aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pretzel.yyz.us>2005-06-22 13:07:28 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-22 13:07:28 -0400
commitff40c6d3d1437ecdf295b8e39adcb06c3d6021ef (patch)
tree3666d029b4bd4df2909dbefd9c7a09e6042b7d32 /arch
parent8bf62ecee58360749c5f0e68bc97d5e02a6816b1 (diff)
parent2a5a68b840cbab31baab2d9b2e1e6de3b289ae1e (diff)
Merge upstream kernel changes into 'C/H/S support' branch of libata.
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/osf_sys.c7
-rw-r--r--arch/arm/Kconfig19
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/boot/compressed/head-xscale.S7
-rw-r--r--arch/arm/common/amba.c2
-rw-r--r--arch/arm/common/dmabounce.c18
-rw-r--r--arch/arm/common/sharpsl_param.c2
-rw-r--r--arch/arm/configs/badge4_defconfig29
-rw-r--r--arch/arm/configs/enp2611_defconfig8
-rw-r--r--arch/arm/configs/h3600_defconfig24
-rw-r--r--arch/arm/configs/hackkit_defconfig22
-rw-r--r--arch/arm/configs/ixdp2400_defconfig8
-rw-r--r--arch/arm/configs/ixdp2401_defconfig8
-rw-r--r--arch/arm/configs/ixdp2800_defconfig8
-rw-r--r--arch/arm/configs/ixdp2801_defconfig8
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/arch.c46
-rw-r--r--arch/arm/kernel/ecard.c12
-rw-r--r--arch/arm/kernel/entry-armv.S272
-rw-r--r--arch/arm/kernel/entry-header.S7
-rw-r--r--arch/arm/kernel/head.S44
-rw-r--r--arch/arm/kernel/setup.c52
-rw-r--r--arch/arm/kernel/smp.c110
-rw-r--r--arch/arm/kernel/traps.c49
-rw-r--r--arch/arm/lib/ashldi3.c47
-rw-r--r--arch/arm/lib/ashrdi3.c48
-rw-r--r--arch/arm/lib/gcclib.h27
-rw-r--r--arch/arm/lib/io-writesw-armv4.S6
-rw-r--r--arch/arm/lib/longlong.h68
-rw-r--r--arch/arm/lib/lshrdi3.c47
-rw-r--r--arch/arm/lib/muldi3.c31
-rw-r--r--arch/arm/lib/ucmpdi2.c30
-rw-r--r--arch/arm/lib/udivdi3.c372
-rw-r--r--arch/arm/mach-aaec2000/Kconfig11
-rw-r--r--arch/arm/mach-aaec2000/Makefile9
-rw-r--r--arch/arm/mach-aaec2000/aaed2000.c48
-rw-r--r--arch/arm/mach-aaec2000/core.c157
-rw-r--r--arch/arm/mach-aaec2000/core.h16
-rw-r--r--arch/arm/mach-integrator/Makefile1
-rw-r--r--arch/arm/mach-integrator/core.c19
-rw-r--r--arch/arm/mach-integrator/headsmp.S37
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c1
-rw-r--r--arch/arm/mach-integrator/leds.c4
-rw-r--r--arch/arm/mach-integrator/platsmp.c192
-rw-r--r--arch/arm/mach-ixp2000/core.c34
-rw-r--r--arch/arm/mach-pxa/lubbock.c30
-rw-r--r--arch/arm/mach-pxa/mainstone.c40
-rw-r--r--arch/arm/mach-pxa/pm.c34
-rw-r--r--arch/arm/mach-pxa/pxa25x.c33
-rw-r--r--arch/arm/mach-pxa/pxa27x.c36
-rw-r--r--arch/arm/mach-s3c2410/clock.c2
-rw-r--r--arch/arm/mach-s3c2410/dma.c4
-rw-r--r--arch/arm/mach-s3c2410/s3c2440.c6
-rw-r--r--arch/arm/mach-sa1100/Kconfig2
-rw-r--r--arch/arm/mach-sa1100/pm.c2
-rw-r--r--arch/arm/mach-versatile/Makefile1
-rw-r--r--arch/arm/mach-versatile/core.c16
-rw-r--r--arch/arm/mach-versatile/pci.c360
-rw-r--r--arch/arm/mm/Kconfig38
-rw-r--r--arch/arm/mm/Makefile2
-rw-r--r--arch/arm/mm/copypage-v4mc.S80
-rw-r--r--arch/arm/mm/copypage-v4mc.c111
-rw-r--r--arch/arm/mm/copypage-v6.c34
-rw-r--r--arch/arm/mm/copypage-xscale.S113
-rw-r--r--arch/arm/mm/copypage-xscale.c131
-rw-r--r--arch/arm/mm/fault-armv.c31
-rw-r--r--arch/arm/mm/flush.c57
-rw-r--r--arch/arm/mm/ioremap.c47
-rw-r--r--arch/arm/mm/minicache.c73
-rw-r--r--arch/arm/mm/mm-armv.c27
-rw-r--r--arch/arm/mm/mmap.c10
-rw-r--r--arch/arm26/kernel/ecard.c10
-rw-r--r--arch/frv/mm/init.c1
-rw-r--r--arch/h8300/kernel/process.c2
-rw-r--r--arch/i386/Kconfig2
-rw-r--r--arch/i386/boot/Makefile2
-rw-r--r--arch/i386/kernel/Makefile2
-rw-r--r--arch/i386/kernel/apm.c2
-rw-r--r--arch/i386/kernel/cpu/amd.c12
-rw-r--r--arch/i386/kernel/cpu/common.c4
-rw-r--r--arch/i386/kernel/cpu/cpufreq/Kconfig14
-rw-r--r--arch/i386/kernel/cpu/cpufreq/Makefile1
-rw-r--r--arch/i386/kernel/cpu/cpufreq/longhaul.c58
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k7.c11
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c113
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.h15
-rw-r--r--arch/i386/kernel/cpu/cpufreq/sc520_freq.c186
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c6
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-lib.c6
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-smi.c3
-rw-r--r--arch/i386/kernel/cpu/intel_cacheinfo.c2
-rw-r--r--arch/i386/kernel/cpuid.c22
-rw-r--r--arch/i386/kernel/msr.c22
-rw-r--r--arch/i386/kernel/setup.c2
-rw-r--r--arch/i386/kernel/smpboot.c5
-rw-r--r--arch/i386/kernel/syscall_table.S2
-rw-r--r--arch/i386/kernel/timers/common.c6
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c20
-rw-r--r--arch/i386/kernel/traps.c2
-rw-r--r--arch/i386/lib/delay.c2
-rw-r--r--arch/i386/mach-voyager/voyager_smp.c17
-rw-r--r--arch/i386/mm/hugetlbpage.c204
-rw-r--r--arch/i386/mm/init.c1
-rw-r--r--arch/i386/mm/ioremap.c10
-rw-r--r--arch/i386/pci/fixup.c2
-rw-r--r--arch/i386/pci/irq.c5
-rw-r--r--arch/ia64/Kconfig6
-rw-r--r--arch/ia64/configs/sn2_defconfig6
-rw-r--r--arch/ia64/defconfig6
-rw-r--r--arch/ia64/ia32/ia32_ioctl.c1
-rw-r--r--arch/ia64/ia32/sys_ia32.c2
-rw-r--r--arch/ia64/kernel/Makefile1
-rw-r--r--arch/ia64/kernel/efi.c32
-rw-r--r--arch/ia64/kernel/entry.S6
-rw-r--r--arch/ia64/kernel/fsys.S4
-rw-r--r--arch/ia64/kernel/mca.c8
-rw-r--r--arch/ia64/kernel/minstate.h3
-rw-r--r--arch/ia64/kernel/module.c10
-rw-r--r--arch/ia64/kernel/perfmon.c175
-rw-r--r--arch/ia64/kernel/ptrace.c26
-rw-r--r--arch/ia64/kernel/setup.c3
-rw-r--r--arch/ia64/kernel/smpboot.c2
-rw-r--r--arch/ia64/kernel/sys_ia64.c7
-rw-r--r--arch/ia64/kernel/traps.c29
-rw-r--r--arch/ia64/kernel/uncached.c246
-rw-r--r--arch/ia64/mm/hugetlbpage.c158
-rw-r--r--arch/ia64/mm/init.c19
-rw-r--r--arch/ia64/sn/kernel/setup.c6
-rw-r--r--arch/ia64/sn/kernel/tiocx.c25
-rw-r--r--arch/ia64/sn/kernel/xpc_partition.c6
-rw-r--r--arch/m32r/Kconfig7
-rw-r--r--arch/m32r/boot/compressed/m32r_sio.c19
-rw-r--r--arch/m32r/defconfig52
-rw-r--r--arch/m32r/kernel/Makefile2
-rw-r--r--arch/m32r/kernel/io_m32700ut.c92
-rw-r--r--arch/m32r/kernel/io_mappi.c74
-rw-r--r--arch/m32r/kernel/io_mappi2.c92
-rw-r--r--arch/m32r/kernel/io_mappi3.c378
-rw-r--r--arch/m32r/kernel/io_oaks32r.c36
-rw-r--r--arch/m32r/kernel/io_opsput.c79
-rw-r--r--arch/m32r/kernel/io_usrv.c51
-rw-r--r--arch/m32r/kernel/setup.c2
-rw-r--r--arch/m32r/kernel/setup_m32700ut.c56
-rw-r--r--arch/m32r/kernel/setup_mappi.c14
-rw-r--r--arch/m32r/kernel/setup_mappi2.c20
-rw-r--r--arch/m32r/kernel/setup_mappi3.c208
-rw-r--r--arch/m32r/kernel/setup_oaks32r.c14
-rw-r--r--arch/m32r/kernel/setup_opsput.c28
-rw-r--r--arch/m32r/kernel/setup_usrv.c28
-rw-r--r--arch/m32r/m32700ut/defconfig.m32700ut.smp53
-rw-r--r--arch/m32r/m32700ut/defconfig.m32700ut.up52
-rw-r--r--arch/m32r/mappi/defconfig.nommu46
-rw-r--r--arch/m32r/mappi/defconfig.smp49
-rw-r--r--arch/m32r/mappi/defconfig.up48
-rw-r--r--arch/m32r/mappi2/defconfig.vdec246
-rw-r--r--arch/m32r/mappi3/defconfig.smp751
-rw-r--r--arch/m32r/mappi3/dot.gdbinit224
-rw-r--r--arch/m32r/mm/extable.c5
-rw-r--r--arch/m32r/oaks32r/defconfig.nommu50
-rw-r--r--arch/m32r/opsput/defconfig.opsput45
-rw-r--r--arch/m68k/configs/amiga_defconfig15
-rw-r--r--arch/m68k/configs/apollo_defconfig7
-rw-r--r--arch/m68k/configs/atari_defconfig7
-rw-r--r--arch/m68k/configs/bvme6000_defconfig7
-rw-r--r--arch/m68k/configs/hp300_defconfig7
-rw-r--r--arch/m68k/configs/mac_defconfig7
-rw-r--r--arch/m68k/configs/mvme147_defconfig7
-rw-r--r--arch/m68k/configs/mvme16x_defconfig7
-rw-r--r--arch/m68k/configs/q40_defconfig15
-rw-r--r--arch/m68k/configs/sun3_defconfig8
-rw-r--r--arch/m68k/configs/sun3x_defconfig7
-rw-r--r--arch/m68k/defconfig7
-rw-r--r--arch/m68knommu/kernel/process.c17
-rw-r--r--arch/mips/mm/init.c1
-rw-r--r--arch/mips/vr41xx/common/pmu.c55
-rw-r--r--arch/parisc/kernel/drivers.c2
-rw-r--r--arch/ppc/Kconfig26
-rw-r--r--arch/ppc/boot/images/Makefile3
-rw-r--r--arch/ppc/boot/ld.script3
-rw-r--r--arch/ppc/boot/openfirmware/Makefile5
-rw-r--r--arch/ppc/boot/openfirmware/common.c16
-rw-r--r--arch/ppc/boot/simple/Makefile4
-rw-r--r--arch/ppc/boot/utils/addSystemMap.c186
-rw-r--r--arch/ppc/configs/mpc8548_cds_defconfig659
-rw-r--r--arch/ppc/configs/mpc8555_cds_defconfig117
-rw-r--r--arch/ppc/kernel/cputable.c25
-rw-r--r--arch/ppc/kernel/entry.S180
-rw-r--r--arch/ppc/kernel/head_44x.S15
-rw-r--r--arch/ppc/kernel/head_4xx.S15
-rw-r--r--arch/ppc/kernel/head_booke.h94
-rw-r--r--arch/ppc/kernel/head_fsl_booke.S15
-rw-r--r--arch/ppc/kernel/misc.S6
-rw-r--r--arch/ppc/kernel/pci.c2
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c2
-rw-r--r--arch/ppc/kernel/ptrace.c40
-rw-r--r--arch/ppc/kernel/setup.c15
-rw-r--r--arch/ppc/kernel/traps.c13
-rw-r--r--arch/ppc/lib/locks.c4
-rw-r--r--arch/ppc/lib/string.S7
-rw-r--r--arch/ppc/mm/fsl_booke_mmu.c2
-rw-r--r--arch/ppc/mm/init.c18
-rw-r--r--arch/ppc/mm/mmu_decl.h2
-rw-r--r--arch/ppc/mm/pgtable.c1
-rw-r--r--arch/ppc/platforms/83xx/mpc834x_sys.c2
-rw-r--r--arch/ppc/platforms/83xx/mpc834x_sys.h7
-rw-r--r--arch/ppc/platforms/85xx/Kconfig10
-rw-r--r--arch/ppc/platforms/85xx/Makefile1
-rw-r--r--arch/ppc/platforms/85xx/mpc8540_ads.c8
-rw-r--r--arch/ppc/platforms/85xx/mpc8560_ads.c1
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_ads_common.c37
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_cds_common.c237
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_cds_common.h3
-rw-r--r--arch/ppc/platforms/85xx/sbc8560.c8
-rw-r--r--arch/ppc/platforms/85xx/sbc85xx.c37
-rw-r--r--arch/ppc/platforms/85xx/stx_gp3.c37
-rw-r--r--arch/ppc/platforms/pmac_cpufreq.c43
-rw-r--r--arch/ppc/platforms/pq2ads.h41
-rw-r--r--arch/ppc/platforms/sandpoint.c20
-rw-r--r--arch/ppc/syslib/Makefile7
-rw-r--r--arch/ppc/syslib/ipic.c2
-rw-r--r--arch/ppc/syslib/m8260_pci.c193
-rw-r--r--arch/ppc/syslib/m8260_pci.h76
-rw-r--r--arch/ppc/syslib/m8260_pci_erratum9.c10
-rw-r--r--arch/ppc/syslib/m8260_setup.c11
-rw-r--r--arch/ppc/syslib/m82xx_pci.c383
-rw-r--r--arch/ppc/syslib/m82xx_pci.h92
-rw-r--r--arch/ppc/syslib/mpc10x_common.c203
-rw-r--r--arch/ppc/syslib/mpc83xx_devices.c1
-rw-r--r--arch/ppc/syslib/mpc85xx_devices.c188
-rw-r--r--arch/ppc/syslib/mpc85xx_sys.c105
-rw-r--r--arch/ppc/syslib/ocp.c2
-rw-r--r--arch/ppc/syslib/of_device.c2
-rw-r--r--arch/ppc/syslib/open_pic.c7
-rw-r--r--arch/ppc/syslib/open_pic2.c1
-rw-r--r--arch/ppc/syslib/ppc4xx_kgdb.c124
-rw-r--r--arch/ppc/syslib/ppc83xx_setup.c29
-rw-r--r--arch/ppc/syslib/ppc85xx_setup.c19
-rw-r--r--arch/ppc/syslib/prom_init.c10
-rw-r--r--arch/ppc/xmon/xmon.c270
-rw-r--r--arch/ppc64/Kconfig2
-rw-r--r--arch/ppc64/Makefile6
-rw-r--r--arch/ppc64/boot/prom.c28
-rw-r--r--arch/ppc64/configs/g5_defconfig76
-rw-r--r--arch/ppc64/configs/iSeries_defconfig62
-rw-r--r--arch/ppc64/configs/maple_defconfig70
-rw-r--r--arch/ppc64/configs/pSeries_defconfig102
-rw-r--r--arch/ppc64/defconfig104
-rw-r--r--arch/ppc64/kernel/HvLpEvent.c2
-rw-r--r--arch/ppc64/kernel/ItLpQueue.c1
-rw-r--r--arch/ppc64/kernel/Makefile7
-rw-r--r--arch/ppc64/kernel/XmPciLpEvent.c190
-rw-r--r--arch/ppc64/kernel/asm-offsets.c1
-rw-r--r--arch/ppc64/kernel/dma.c4
-rw-r--r--arch/ppc64/kernel/eeh.c2
-rw-r--r--arch/ppc64/kernel/entry.S9
-rw-r--r--arch/ppc64/kernel/head.S14
-rw-r--r--arch/ppc64/kernel/iSeries_VpdInfo.c220
-rw-r--r--arch/ppc64/kernel/iSeries_iommu.c3
-rw-r--r--arch/ppc64/kernel/iSeries_irq.c312
-rw-r--r--arch/ppc64/kernel/iSeries_pci.c45
-rw-r--r--arch/ppc64/kernel/iSeries_pci_reset.c104
-rw-r--r--arch/ppc64/kernel/iSeries_proc.c3
-rw-r--r--arch/ppc64/kernel/iSeries_setup.c36
-rw-r--r--arch/ppc64/kernel/iSeries_smp.c2
-rw-r--r--arch/ppc64/kernel/idle.c15
-rw-r--r--arch/ppc64/kernel/iommu.c3
-rw-r--r--arch/ppc64/kernel/irq.c2
-rw-r--r--arch/ppc64/kernel/kprobes.c18
-rw-r--r--arch/ppc64/kernel/lparcfg.c2
-rw-r--r--arch/ppc64/kernel/mf.c86
-rw-r--r--arch/ppc64/kernel/misc.S2
-rw-r--r--arch/ppc64/kernel/of_device.c2
-rw-r--r--arch/ppc64/kernel/pSeries_reconfig.c8
-rw-r--r--arch/ppc64/kernel/pSeries_smp.c9
-rw-r--r--arch/ppc64/kernel/pci.c2
-rw-r--r--arch/ppc64/kernel/pmac_smp.c28
-rw-r--r--arch/ppc64/kernel/process.c11
-rw-r--r--arch/ppc64/kernel/prom.c12
-rw-r--r--arch/ppc64/kernel/prom_init.c154
-rw-r--r--arch/ppc64/kernel/ras.c1
-rw-r--r--arch/ppc64/kernel/rtasd.c4
-rw-r--r--arch/ppc64/kernel/rtc.c41
-rw-r--r--arch/ppc64/kernel/setup.c59
-rw-r--r--arch/ppc64/kernel/smp.c3
-rw-r--r--arch/ppc64/kernel/sys_ppc32.c73
-rw-r--r--arch/ppc64/kernel/syscalls.c33
-rw-r--r--arch/ppc64/kernel/sysfs.c8
-rw-r--r--arch/ppc64/kernel/time.c3
-rw-r--r--arch/ppc64/kernel/vio.c41
-rw-r--r--arch/ppc64/kernel/viopath.c10
-rw-r--r--arch/ppc64/lib/Makefile2
-rw-r--r--arch/ppc64/mm/hash_utils.c6
-rw-r--r--arch/ppc64/mm/hugetlbpage.c214
-rw-r--r--arch/ppc64/mm/imalloc.c20
-rw-r--r--arch/ppc64/mm/init.c93
-rw-r--r--arch/ppc64/xmon/xmon.c9
-rw-r--r--arch/s390/appldata/appldata_base.c72
-rw-r--r--arch/s390/appldata/appldata_mem.c2
-rw-r--r--arch/s390/appldata/appldata_net_sum.c2
-rw-r--r--arch/s390/appldata/appldata_os.c4
-rw-r--r--arch/s390/kernel/compat_ioctl.c6
-rw-r--r--arch/s390/kernel/head.S27
-rw-r--r--arch/s390/kernel/head64.S25
-rw-r--r--arch/s390/kernel/ptrace.c55
-rw-r--r--arch/s390/kernel/traps.c5
-rw-r--r--arch/s390/mm/cmm.c2
-rw-r--r--arch/s390/mm/fault.c2
-rw-r--r--arch/sh/kernel/sys_sh.c8
-rw-r--r--arch/sh/lib/delay.c2
-rw-r--r--arch/sh/mm/hugetlbpage.c196
-rw-r--r--arch/sh64/mm/hugetlbpage.c18
-rw-r--r--arch/sparc/mm/init.c1
-rw-r--r--arch/sparc64/kernel/pci_iommu.c221
-rw-r--r--arch/sparc64/kernel/pci_psycho.c2
-rw-r--r--arch/sparc64/kernel/pci_sabre.c2
-rw-r--r--arch/sparc64/kernel/pci_schizo.c2
-rw-r--r--arch/sparc64/kernel/sbus.c41
-rw-r--r--arch/sparc64/kernel/setup.c11
-rw-r--r--arch/sparc64/kernel/smp.c3
-rw-r--r--arch/sparc64/kernel/sys_sparc.c8
-rw-r--r--arch/sparc64/kernel/traps.c19
-rw-r--r--arch/sparc64/lib/delay.c2
-rw-r--r--arch/sparc64/mm/hugetlbpage.c195
-rw-r--r--arch/sparc64/solaris/socket.c6
-rw-r--r--arch/um/Kconfig5
-rw-r--r--arch/um/Kconfig.debug4
-rw-r--r--arch/um/Kconfig_char6
-rw-r--r--arch/um/Kconfig_x86_644
-rw-r--r--arch/um/Makefile2
-rw-r--r--arch/um/drivers/Makefile6
-rw-r--r--arch/um/drivers/chan_kern.c22
-rw-r--r--arch/um/drivers/chan_user.c26
-rw-r--r--arch/um/drivers/line.c3
-rw-r--r--arch/um/drivers/mcast_kern.c4
-rw-r--r--arch/um/drivers/mcast_user.c47
-rw-r--r--arch/um/drivers/mmapper_kern.c24
-rw-r--r--arch/um/drivers/net_kern.c1
-rw-r--r--arch/um/drivers/net_user.c2
-rw-r--r--arch/um/drivers/port_kern.c1
-rw-r--r--arch/um/drivers/random.c16
-rw-r--r--arch/um/drivers/slip.h23
-rw-r--r--arch/um/drivers/slip_common.c54
-rw-r--r--arch/um/drivers/slip_common.h (renamed from arch/um/drivers/slip_proto.h)47
-rw-r--r--arch/um/drivers/slip_kern.c12
-rw-r--r--arch/um/drivers/slip_user.c152
-rw-r--r--arch/um/drivers/slirp.h26
-rw-r--r--arch/um/drivers/slirp_kern.c5
-rw-r--r--arch/um/drivers/slirp_user.c104
-rw-r--r--arch/um/drivers/ssl.c1
-rw-r--r--arch/um/drivers/stderr_console.c6
-rw-r--r--arch/um/drivers/stdio_console.c1
-rw-r--r--arch/um/drivers/ubd_kern.c303
-rw-r--r--arch/um/drivers/xterm_kern.c1
-rw-r--r--arch/um/include/2_5compat.h24
-rw-r--r--arch/um/include/mconsole.h2
-rw-r--r--arch/um/include/net_user.h2
-rw-r--r--arch/um/include/os.h2
-rw-r--r--arch/um/include/sysdep-i386/ptrace.h5
-rw-r--r--arch/um/include/sysdep-x86_64/checksum.h26
-rw-r--r--arch/um/include/sysdep-x86_64/ptrace.h62
-rw-r--r--arch/um/include/sysrq.h3
-rw-r--r--arch/um/include/user_util.h3
-rw-r--r--arch/um/kernel/Makefile2
-rw-r--r--arch/um/kernel/checksum.c0
-rw-r--r--arch/um/kernel/exec_kern.c1
-rw-r--r--arch/um/kernel/initrd.c (renamed from arch/um/kernel/initrd_kern.c)21
-rw-r--r--arch/um/kernel/initrd_user.c46
-rw-r--r--arch/um/kernel/irq.c11
-rw-r--r--arch/um/kernel/irq_user.c12
-rw-r--r--arch/um/kernel/ksyms.c1
-rw-r--r--arch/um/kernel/main.c42
-rw-r--r--arch/um/kernel/mem.c41
-rw-r--r--arch/um/kernel/process.c49
-rw-r--r--arch/um/kernel/process_kern.c36
-rw-r--r--arch/um/kernel/ptrace.c25
-rw-r--r--arch/um/kernel/skas/process_kern.c7
-rw-r--r--arch/um/kernel/sysrq.c21
-rw-r--r--arch/um/kernel/trap_kern.c37
-rw-r--r--arch/um/kernel/tt/Makefile15
-rw-r--r--arch/um/kernel/tt/ksyms.c1
-rw-r--r--arch/um/kernel/tt/process_kern.c8
-rw-r--r--arch/um/kernel/tt/unmap.c31
-rw-r--r--arch/um/kernel/um_arch.c7
-rw-r--r--arch/um/kernel/uml.lds.S17
-rw-r--r--arch/um/os-Linux/elf_aux.c6
-rw-r--r--arch/um/os-Linux/file.c2
-rw-r--r--arch/um/scripts/Makefile.rules8
-rw-r--r--arch/um/scripts/Makefile.unmap22
-rw-r--r--arch/um/sys-i386/Makefile4
-rw-r--r--arch/um/sys-i386/delay.c16
-rw-r--r--arch/um/sys-i386/sysrq.c80
-rw-r--r--arch/um/sys-i386/unmap.c25
-rw-r--r--arch/um/sys-ppc/sysrq.c14
-rw-r--r--arch/um/sys-x86_64/Makefile8
-rw-r--r--arch/um/sys-x86_64/delay.c33
-rw-r--r--arch/um/sys-x86_64/ksyms.c3
-rw-r--r--arch/um/sys-x86_64/ptrace.c9
-rw-r--r--arch/um/sys-x86_64/syscalls.c17
-rw-r--r--arch/um/sys-x86_64/sysrq.c11
-rw-r--r--arch/um/sys-x86_64/unmap.c25
-rw-r--r--arch/um/sys-x86_64/user-offsets.c8
-rw-r--r--arch/x86_64/Kconfig17
-rw-r--r--arch/x86_64/defconfig58
-rw-r--r--arch/x86_64/ia32/ia32_aout.c1
-rw-r--r--arch/x86_64/ia32/ia32_binfmt.c5
-rw-r--r--arch/x86_64/kernel/Makefile1
-rw-r--r--arch/x86_64/kernel/aperture.c41
-rw-r--r--arch/x86_64/kernel/apic.c5
-rw-r--r--arch/x86_64/kernel/entry.S11
-rw-r--r--arch/x86_64/kernel/io_apic.c82
-rw-r--r--arch/x86_64/kernel/mpparse.c23
-rw-r--r--arch/x86_64/kernel/nmi.c248
-rw-r--r--arch/x86_64/kernel/pmtimer.c101
-rw-r--r--arch/x86_64/kernel/process.c4
-rw-r--r--arch/x86_64/kernel/ptrace.c28
-rw-r--r--arch/x86_64/kernel/setup.c30
-rw-r--r--arch/x86_64/kernel/signal.c5
-rw-r--r--arch/x86_64/kernel/smpboot.c263
-rw-r--r--arch/x86_64/kernel/sys_x86_64.c23
-rw-r--r--arch/x86_64/kernel/time.c64
-rw-r--r--arch/x86_64/kernel/traps.c2
-rw-r--r--arch/x86_64/kernel/vsyscall.c5
-rw-r--r--arch/x86_64/kernel/x8664_ksyms.c3
-rw-r--r--arch/x86_64/lib/delay.c2
-rw-r--r--arch/x86_64/mm/fault.c13
-rw-r--r--arch/x86_64/mm/ioremap.c29
426 files changed, 10676 insertions, 6815 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 64e450dddb49..167fd89f8707 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -1150,16 +1150,13 @@ osf_usleep_thread(struct timeval32 __user *sleep, struct timeval32 __user *remai
1150 if (get_tv32(&tmp, sleep)) 1150 if (get_tv32(&tmp, sleep))
1151 goto fault; 1151 goto fault;
1152 1152
1153 ticks = tmp.tv_usec; 1153 ticks = timeval_to_jiffies(&tmp);
1154 ticks = (ticks + (1000000 / HZ) - 1) / (1000000 / HZ);
1155 ticks += tmp.tv_sec * HZ;
1156 1154
1157 current->state = TASK_INTERRUPTIBLE; 1155 current->state = TASK_INTERRUPTIBLE;
1158 ticks = schedule_timeout(ticks); 1156 ticks = schedule_timeout(ticks);
1159 1157
1160 if (remain) { 1158 if (remain) {
1161 tmp.tv_sec = ticks / HZ; 1159 jiffies_to_timeval(ticks, &tmp);
1162 tmp.tv_usec = ticks % HZ;
1163 if (put_tv32(remain, &tmp)) 1160 if (put_tv32(remain, &tmp))
1164 goto fault; 1161 goto fault;
1165 } 1162 }
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index bf397a9f8ac2..ee8a9ad7bbd9 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -67,10 +67,6 @@ config GENERIC_BUST_SPINLOCK
67config GENERIC_ISA_DMA 67config GENERIC_ISA_DMA
68 bool 68 bool
69 69
70config GENERIC_IOMAP
71 bool
72 default y
73
74config FIQ 70config FIQ
75 bool 71 bool
76 72
@@ -202,6 +198,11 @@ config ARCH_H720X
202 help 198 help
203 This enables support for systems based on the Hynix HMS720x 199 This enables support for systems based on the Hynix HMS720x
204 200
201config ARCH_AAEC2000
202 bool "Agilent AAEC-2000 based"
203 help
204 This enables support for systems based on the Agilent AAEC-2000
205
205endchoice 206endchoice
206 207
207source "arch/arm/mach-clps711x/Kconfig" 208source "arch/arm/mach-clps711x/Kconfig"
@@ -234,6 +235,8 @@ source "arch/arm/mach-h720x/Kconfig"
234 235
235source "arch/arm/mach-versatile/Kconfig" 236source "arch/arm/mach-versatile/Kconfig"
236 237
238source "arch/arm/mach-aaec2000/Kconfig"
239
237# Definitions to make life easier 240# Definitions to make life easier
238config ARCH_ACORN 241config ARCH_ACORN
239 bool 242 bool
@@ -277,7 +280,7 @@ config ISA_DMA_API
277 default y 280 default y
278 281
279config PCI 282config PCI
280 bool "PCI support" if ARCH_INTEGRATOR_AP 283 bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB
281 help 284 help
282 Find out whether you have a PCI motherboard. PCI is the name of a 285 Find out whether you have a PCI motherboard. PCI is the name of a
283 bus system, i.e. the way the CPU talks to the other stuff inside 286 bus system, i.e. the way the CPU talks to the other stuff inside
@@ -497,7 +500,7 @@ source "drivers/cpufreq/Kconfig"
497 500
498config CPU_FREQ_SA1100 501config CPU_FREQ_SA1100
499 bool 502 bool
500 depends on CPU_FREQ && (SA1100_LART || SA1100_PLEB) 503 depends on CPU_FREQ && (SA1100_H3100 || SA1100_H3600 || SA1100_H3800 || SA1100_LART || SA1100_PLEB || SA1100_BADGE4 || SA1100_HACKKIT)
501 default y 504 default y
502 505
503config CPU_FREQ_SA1110 506config CPU_FREQ_SA1110
@@ -689,7 +692,9 @@ source "drivers/block/Kconfig"
689 692
690source "drivers/acorn/block/Kconfig" 693source "drivers/acorn/block/Kconfig"
691 694
692if ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE 695if PCMCIA || ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX \
696 || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC \
697 || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE
693source "drivers/ide/Kconfig" 698source "drivers/ide/Kconfig"
694endif 699endif
695 700
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 2277e3d179cc..8330495e2448 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -97,6 +97,7 @@ textaddr-$(CONFIG_ARCH_FORTUNET) := 0xc0008000
97 machine-$(CONFIG_ARCH_VERSATILE) := versatile 97 machine-$(CONFIG_ARCH_VERSATILE) := versatile
98 machine-$(CONFIG_ARCH_IMX) := imx 98 machine-$(CONFIG_ARCH_IMX) := imx
99 machine-$(CONFIG_ARCH_H720X) := h720x 99 machine-$(CONFIG_ARCH_H720X) := h720x
100 machine-$(CONFIG_ARCH_AAEC2000) := aaec2000
100 101
101ifeq ($(CONFIG_ARCH_EBSA110),y) 102ifeq ($(CONFIG_ARCH_EBSA110),y)
102# This is what happens if you forget the IOCS16 line. 103# This is what happens if you forget the IOCS16 line.
diff --git a/arch/arm/boot/compressed/head-xscale.S b/arch/arm/boot/compressed/head-xscale.S
index 665bd2c20743..d3fe2533907e 100644
--- a/arch/arm/boot/compressed/head-xscale.S
+++ b/arch/arm/boot/compressed/head-xscale.S
@@ -47,3 +47,10 @@ __XScale_start:
47 orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00) 47 orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00)
48#endif 48#endif
49 49
50#ifdef CONFIG_ARCH_IXP2000
51 mov r1, #-1
52 mov r0, #0xd6000000
53 str r1, [r0, #0x14]
54 str r1, [r0, #0x18]
55#endif
56
diff --git a/arch/arm/common/amba.c b/arch/arm/common/amba.c
index a0507f8c33fe..c6beb751f2a9 100644
--- a/arch/arm/common/amba.c
+++ b/arch/arm/common/amba.c
@@ -169,7 +169,7 @@ static void amba_device_release(struct device *dev)
169} 169}
170 170
171#define amba_attr(name,fmt,arg...) \ 171#define amba_attr(name,fmt,arg...) \
172static ssize_t show_##name(struct device *_dev, char *buf) \ 172static ssize_t show_##name(struct device *_dev, struct device_attribute *attr, char *buf) \
173{ \ 173{ \
174 struct amba_device *dev = to_amba_device(_dev); \ 174 struct amba_device *dev = to_amba_device(_dev); \
175 return sprintf(buf, fmt, arg); \ 175 return sprintf(buf, fmt, arg); \
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 5797b1b100a1..9d63a01214eb 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -30,6 +30,8 @@
30#include <linux/dmapool.h> 30#include <linux/dmapool.h>
31#include <linux/list.h> 31#include <linux/list.h>
32 32
33#include <asm/cacheflush.h>
34
33#undef DEBUG 35#undef DEBUG
34 36
35#undef STATS 37#undef STATS
@@ -302,12 +304,24 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
302 304
303 DO_STATS ( device_info->bounce_count++ ); 305 DO_STATS ( device_info->bounce_count++ );
304 306
305 if ((dir == DMA_FROM_DEVICE) || 307 if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) {
306 (dir == DMA_BIDIRECTIONAL)) { 308 unsigned long ptr;
309
307 dev_dbg(dev, 310 dev_dbg(dev,
308 "%s: copy back safe %p to unsafe %p size %d\n", 311 "%s: copy back safe %p to unsafe %p size %d\n",
309 __func__, buf->safe, buf->ptr, size); 312 __func__, buf->safe, buf->ptr, size);
310 memcpy(buf->ptr, buf->safe, size); 313 memcpy(buf->ptr, buf->safe, size);
314
315 /*
316 * DMA buffers must have the same cache properties
317 * as if they were really used for DMA - which means
318 * data must be written back to RAM. Note that
319 * we don't use dmac_flush_range() here for the
320 * bidirectional case because we know the cache
321 * lines will be coherent with the data written.
322 */
323 ptr = (unsigned long)buf->ptr;
324 dmac_clean_range(ptr, ptr + size);
311 } 325 }
312 free_safe_buffer(device_info, buf); 326 free_safe_buffer(device_info, buf);
313 } 327 }
diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c
index c2c557a224c2..c94864c5b1af 100644
--- a/arch/arm/common/sharpsl_param.c
+++ b/arch/arm/common/sharpsl_param.c
@@ -22,7 +22,7 @@
22 * them early in the boot process, then pass them to the appropriate drivers. 22 * them early in the boot process, then pass them to the appropriate drivers.
23 * Not all devices use all paramaters but the format is common to all. 23 * Not all devices use all paramaters but the format is common to all.
24 */ 24 */
25#ifdef ARCH_SA1100 25#ifdef CONFIG_ARCH_SA1100
26#define PARAM_BASE 0xe8ffc000 26#define PARAM_BASE 0xe8ffc000
27#else 27#else
28#define PARAM_BASE 0xa0000a00 28#define PARAM_BASE 0xa0000a00
diff --git a/arch/arm/configs/badge4_defconfig b/arch/arm/configs/badge4_defconfig
index 2b4059d2f8e4..5d92af975d87 100644
--- a/arch/arm/configs/badge4_defconfig
+++ b/arch/arm/configs/badge4_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2 3# Linux kernel version: 2.6.12-rc6-git3
4# Sat Mar 26 21:32:26 2005 4# Thu Jun 9 19:00:50 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -16,6 +16,7 @@ CONFIG_GENERIC_IOMAP=y
16CONFIG_EXPERIMENTAL=y 16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y 17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
19 20
20# 21#
21# General setup 22# General setup
@@ -34,6 +35,8 @@ CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
37CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 41CONFIG_FUTEX=y
39CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -109,7 +112,6 @@ CONFIG_CPU_ABRT_EV4=y
109CONFIG_CPU_CACHE_V4WB=y 112CONFIG_CPU_CACHE_V4WB=y
110CONFIG_CPU_CACHE_VIVT=y 113CONFIG_CPU_CACHE_VIVT=y
111CONFIG_CPU_TLB_V4WB=y 114CONFIG_CPU_TLB_V4WB=y
112CONFIG_CPU_MINICACHE=y
113 115
114# 116#
115# Processor Features 117# Processor Features
@@ -122,6 +124,7 @@ CONFIG_FORCE_MAX_ZONEORDER=9
122# Bus support 124# Bus support
123# 125#
124CONFIG_ISA=y 126CONFIG_ISA=y
127CONFIG_ISA_DMA_API=y
125 128
126# 129#
127# PCCARD (PCMCIA/CardBus) support 130# PCCARD (PCMCIA/CardBus) support
@@ -131,6 +134,7 @@ CONFIG_ISA=y
131# 134#
132# Kernel Features 135# Kernel Features
133# 136#
137# CONFIG_SMP is not set
134# CONFIG_PREEMPT is not set 138# CONFIG_PREEMPT is not set
135CONFIG_DISCONTIGMEM=y 139CONFIG_DISCONTIGMEM=y
136# CONFIG_LEDS is not set 140# CONFIG_LEDS is not set
@@ -152,12 +156,14 @@ CONFIG_CPU_FREQ_TABLE=y
152# CONFIG_CPU_FREQ_DEBUG is not set 156# CONFIG_CPU_FREQ_DEBUG is not set
153CONFIG_CPU_FREQ_STAT=y 157CONFIG_CPU_FREQ_STAT=y
154# CONFIG_CPU_FREQ_STAT_DETAILS is not set 158# CONFIG_CPU_FREQ_STAT_DETAILS is not set
155CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y 159# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
156# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set 160CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
157CONFIG_CPU_FREQ_GOV_PERFORMANCE=y 161CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
158# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 162# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
159# CONFIG_CPU_FREQ_GOV_USERSPACE is not set 163CONFIG_CPU_FREQ_GOV_USERSPACE=y
160# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set 164# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
165# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
166CONFIG_CPU_FREQ_SA1100=y
161 167
162# 168#
163# Floating point emulation 169# Floating point emulation
@@ -294,7 +300,6 @@ CONFIG_PARPORT_NOT_PC=y
294# 300#
295# Block devices 301# Block devices
296# 302#
297# CONFIG_BLK_DEV_FD is not set
298# CONFIG_BLK_DEV_XD is not set 303# CONFIG_BLK_DEV_XD is not set
299# CONFIG_PARIDE is not set 304# CONFIG_PARIDE is not set
300# CONFIG_BLK_DEV_COW_COMMON is not set 305# CONFIG_BLK_DEV_COW_COMMON is not set
@@ -428,7 +433,6 @@ CONFIG_NET=y
428# 433#
429CONFIG_PACKET=y 434CONFIG_PACKET=y
430# CONFIG_PACKET_MMAP is not set 435# CONFIG_PACKET_MMAP is not set
431# CONFIG_NETLINK_DEV is not set
432CONFIG_UNIX=y 436CONFIG_UNIX=y
433# CONFIG_NET_KEY is not set 437# CONFIG_NET_KEY is not set
434CONFIG_INET=y 438CONFIG_INET=y
@@ -526,6 +530,7 @@ CONFIG_IRDA_ULTRA=y
526# CONFIG_SMC_IRCC_FIR is not set 530# CONFIG_SMC_IRCC_FIR is not set
527# CONFIG_ALI_FIR is not set 531# CONFIG_ALI_FIR is not set
528CONFIG_SA1100_FIR=y 532CONFIG_SA1100_FIR=y
533# CONFIG_VIA_FIR is not set
529CONFIG_BT=m 534CONFIG_BT=m
530CONFIG_BT_L2CAP=m 535CONFIG_BT_L2CAP=m
531# CONFIG_BT_SCO is not set 536# CONFIG_BT_SCO is not set
@@ -618,7 +623,6 @@ CONFIG_NET_WIRELESS=y
618# 623#
619# CONFIG_SERIO is not set 624# CONFIG_SERIO is not set
620# CONFIG_GAMEPORT is not set 625# CONFIG_GAMEPORT is not set
621CONFIG_SOUND_GAMEPORT=y
622 626
623# 627#
624# Character devices 628# Character devices
@@ -687,7 +691,6 @@ CONFIG_RTC=m
687# 691#
688# TPM devices 692# TPM devices
689# 693#
690# CONFIG_TCG_TPM is not set
691 694
692# 695#
693# I2C support 696# I2C support
@@ -736,6 +739,7 @@ CONFIG_I2C_ELEKTOR=m
736# CONFIG_SENSORS_LM85 is not set 739# CONFIG_SENSORS_LM85 is not set
737# CONFIG_SENSORS_LM87 is not set 740# CONFIG_SENSORS_LM87 is not set
738# CONFIG_SENSORS_LM90 is not set 741# CONFIG_SENSORS_LM90 is not set
742# CONFIG_SENSORS_LM92 is not set
739# CONFIG_SENSORS_MAX1619 is not set 743# CONFIG_SENSORS_MAX1619 is not set
740# CONFIG_SENSORS_PC87360 is not set 744# CONFIG_SENSORS_PC87360 is not set
741# CONFIG_SENSORS_SMSC47B397 is not set 745# CONFIG_SENSORS_SMSC47B397 is not set
@@ -747,6 +751,7 @@ CONFIG_I2C_ELEKTOR=m
747# 751#
748# Other I2C Chip support 752# Other I2C Chip support
749# 753#
754# CONFIG_SENSORS_DS1337 is not set
750# CONFIG_SENSORS_EEPROM is not set 755# CONFIG_SENSORS_EEPROM is not set
751# CONFIG_SENSORS_PCF8574 is not set 756# CONFIG_SENSORS_PCF8574 is not set
752# CONFIG_SENSORS_PCF8591 is not set 757# CONFIG_SENSORS_PCF8591 is not set
@@ -871,7 +876,6 @@ CONFIG_USB_PRINTER=m
871# 876#
872CONFIG_USB_STORAGE=y 877CONFIG_USB_STORAGE=y
873CONFIG_USB_STORAGE_DEBUG=y 878CONFIG_USB_STORAGE_DEBUG=y
874# CONFIG_USB_STORAGE_RW_DETECT is not set
875# CONFIG_USB_STORAGE_DATAFAB is not set 879# CONFIG_USB_STORAGE_DATAFAB is not set
876# CONFIG_USB_STORAGE_FREECOM is not set 880# CONFIG_USB_STORAGE_FREECOM is not set
877# CONFIG_USB_STORAGE_ISD200 is not set 881# CONFIG_USB_STORAGE_ISD200 is not set
@@ -954,9 +958,11 @@ CONFIG_USB_USS720=m
954# 958#
955CONFIG_USB_SERIAL=m 959CONFIG_USB_SERIAL=m
956CONFIG_USB_SERIAL_GENERIC=y 960CONFIG_USB_SERIAL_GENERIC=y
961# CONFIG_USB_SERIAL_AIRPRIME is not set
957CONFIG_USB_SERIAL_BELKIN=m 962CONFIG_USB_SERIAL_BELKIN=m
958CONFIG_USB_SERIAL_WHITEHEAT=m 963CONFIG_USB_SERIAL_WHITEHEAT=m
959CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m 964CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
965# CONFIG_USB_SERIAL_CP2101 is not set
960# CONFIG_USB_SERIAL_CYPRESS_M8 is not set 966# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
961CONFIG_USB_SERIAL_EMPEG=m 967CONFIG_USB_SERIAL_EMPEG=m
962CONFIG_USB_SERIAL_FTDI_SIO=m 968CONFIG_USB_SERIAL_FTDI_SIO=m
@@ -985,6 +991,7 @@ CONFIG_USB_SERIAL_KEYSPAN=m
985# CONFIG_USB_SERIAL_KOBIL_SCT is not set 991# CONFIG_USB_SERIAL_KOBIL_SCT is not set
986CONFIG_USB_SERIAL_MCT_U232=m 992CONFIG_USB_SERIAL_MCT_U232=m
987CONFIG_USB_SERIAL_PL2303=m 993CONFIG_USB_SERIAL_PL2303=m
994# CONFIG_USB_SERIAL_HP4X is not set
988# CONFIG_USB_SERIAL_SAFE is not set 995# CONFIG_USB_SERIAL_SAFE is not set
989# CONFIG_USB_SERIAL_TI is not set 996# CONFIG_USB_SERIAL_TI is not set
990CONFIG_USB_SERIAL_CYBERJACK=m 997CONFIG_USB_SERIAL_CYBERJACK=m
diff --git a/arch/arm/configs/enp2611_defconfig b/arch/arm/configs/enp2611_defconfig
index e8f9fccffe84..06fae4b62774 100644
--- a/arch/arm/configs/enp2611_defconfig
+++ b/arch/arm/configs/enp2611_defconfig
@@ -50,7 +50,13 @@ CONFIG_BASE_SMALL=0
50# 50#
51# Loadable module support 51# Loadable module support
52# 52#
53# CONFIG_MODULES is not set 53CONFIG_MODULES=y
54CONFIG_MODULE_UNLOAD=y
55# CONFIG_MODULE_FORCE_UNLOAD is not set
56CONFIG_OBSOLETE_MODPARM=y
57# CONFIG_MODVERSIONS is not set
58# CONFIG_MODULE_SRCVERSION_ALL is not set
59CONFIG_KMOD=y
54 60
55# 61#
56# System Type 62# System Type
diff --git a/arch/arm/configs/h3600_defconfig b/arch/arm/configs/h3600_defconfig
index b4e297dd54b2..b9de07de80fe 100644
--- a/arch/arm/configs/h3600_defconfig
+++ b/arch/arm/configs/h3600_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2 3# Linux kernel version: 2.6.12-rc4
4# Mon Mar 28 00:02:26 2005 4# Thu Jun 9 01:59:03 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -16,6 +16,7 @@ CONFIG_GENERIC_IOMAP=y
16CONFIG_EXPERIMENTAL=y 16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y 17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
19 20
20# 21#
21# General setup 22# General setup
@@ -33,6 +34,8 @@ CONFIG_KOBJECT_UEVENT=y
33# CONFIG_EMBEDDED is not set 34# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_PRINTK=y
38CONFIG_BUG=y
36CONFIG_BASE_FULL=y 39CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y 40CONFIG_FUTEX=y
38CONFIG_EPOLL=y 41CONFIG_EPOLL=y
@@ -120,6 +123,7 @@ CONFIG_CPU_MINICACHE=y
120# Bus support 123# Bus support
121# 124#
122CONFIG_ISA=y 125CONFIG_ISA=y
126CONFIG_ISA_DMA_API=y
123 127
124# 128#
125# PCCARD (PCMCIA/CardBus) support 129# PCCARD (PCMCIA/CardBus) support
@@ -138,6 +142,7 @@ CONFIG_PCMCIA_SA1100=y
138# 142#
139# Kernel Features 143# Kernel Features
140# 144#
145# CONFIG_SMP is not set
141# CONFIG_PREEMPT is not set 146# CONFIG_PREEMPT is not set
142CONFIG_DISCONTIGMEM=y 147CONFIG_DISCONTIGMEM=y
143# CONFIG_LEDS is not set 148# CONFIG_LEDS is not set
@@ -159,12 +164,13 @@ CONFIG_CPU_FREQ_TABLE=y
159# CONFIG_CPU_FREQ_DEBUG is not set 164# CONFIG_CPU_FREQ_DEBUG is not set
160CONFIG_CPU_FREQ_STAT=y 165CONFIG_CPU_FREQ_STAT=y
161# CONFIG_CPU_FREQ_STAT_DETAILS is not set 166# CONFIG_CPU_FREQ_STAT_DETAILS is not set
162CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y 167# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
163# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set 168CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
164CONFIG_CPU_FREQ_GOV_PERFORMANCE=y 169# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set
165# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 170# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
166# CONFIG_CPU_FREQ_GOV_USERSPACE is not set 171CONFIG_CPU_FREQ_GOV_USERSPACE=y
167# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set 172# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
173CONFIG_CPU_FREQ_SA1100=y
168 174
169# 175#
170# Floating point emulation 176# Floating point emulation
@@ -298,7 +304,6 @@ CONFIG_MTD_SA1100=y
298# 304#
299# Block devices 305# Block devices
300# 306#
301# CONFIG_BLK_DEV_FD is not set
302# CONFIG_BLK_DEV_XD is not set 307# CONFIG_BLK_DEV_XD is not set
303# CONFIG_BLK_DEV_COW_COMMON is not set 308# CONFIG_BLK_DEV_COW_COMMON is not set
304CONFIG_BLK_DEV_LOOP=m 309CONFIG_BLK_DEV_LOOP=m
@@ -379,7 +384,6 @@ CONFIG_NET=y
379# Networking options 384# Networking options
380# 385#
381# CONFIG_PACKET is not set 386# CONFIG_PACKET is not set
382# CONFIG_NETLINK_DEV is not set
383CONFIG_UNIX=y 387CONFIG_UNIX=y
384# CONFIG_NET_KEY is not set 388# CONFIG_NET_KEY is not set
385CONFIG_INET=y 389CONFIG_INET=y
@@ -476,6 +480,7 @@ CONFIG_IRCOMM=m
476# CONFIG_SMC_IRCC_FIR is not set 480# CONFIG_SMC_IRCC_FIR is not set
477# CONFIG_ALI_FIR is not set 481# CONFIG_ALI_FIR is not set
478CONFIG_SA1100_FIR=m 482CONFIG_SA1100_FIR=m
483# CONFIG_VIA_FIR is not set
479# CONFIG_BT is not set 484# CONFIG_BT is not set
480CONFIG_NETDEVICES=y 485CONFIG_NETDEVICES=y
481# CONFIG_DUMMY is not set 486# CONFIG_DUMMY is not set
@@ -647,7 +652,6 @@ CONFIG_LEGACY_PTY_COUNT=256
647# 652#
648# TPM devices 653# TPM devices
649# 654#
650# CONFIG_TCG_TPM is not set
651 655
652# 656#
653# I2C support 657# I2C support
@@ -676,9 +680,11 @@ CONFIG_FB_CFB_FILLRECT=y
676CONFIG_FB_CFB_COPYAREA=y 680CONFIG_FB_CFB_COPYAREA=y
677CONFIG_FB_CFB_IMAGEBLIT=y 681CONFIG_FB_CFB_IMAGEBLIT=y
678CONFIG_FB_SOFT_CURSOR=y 682CONFIG_FB_SOFT_CURSOR=y
683# CONFIG_FB_MACMODES is not set
679# CONFIG_FB_MODE_HELPERS is not set 684# CONFIG_FB_MODE_HELPERS is not set
680# CONFIG_FB_TILEBLITTING is not set 685# CONFIG_FB_TILEBLITTING is not set
681CONFIG_FB_SA1100=y 686CONFIG_FB_SA1100=y
687# CONFIG_FB_S1D13XXX is not set
682# CONFIG_FB_VIRTUAL is not set 688# CONFIG_FB_VIRTUAL is not set
683 689
684# 690#
diff --git a/arch/arm/configs/hackkit_defconfig b/arch/arm/configs/hackkit_defconfig
index 6987c8c5ddb4..fb41a36a5a68 100644
--- a/arch/arm/configs/hackkit_defconfig
+++ b/arch/arm/configs/hackkit_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2 3# Linux kernel version: 2.6.12-rc6-git3
4# Mon Mar 28 00:22:34 2005 4# Thu Jun 9 20:58:58 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -16,6 +16,7 @@ CONFIG_GENERIC_IOMAP=y
16CONFIG_EXPERIMENTAL=y 16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y 17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
19 20
20# 21#
21# General setup 22# General setup
@@ -34,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
34CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
37CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 41CONFIG_FUTEX=y
39CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -109,7 +112,6 @@ CONFIG_CPU_ABRT_EV4=y
109CONFIG_CPU_CACHE_V4WB=y 112CONFIG_CPU_CACHE_V4WB=y
110CONFIG_CPU_CACHE_VIVT=y 113CONFIG_CPU_CACHE_VIVT=y
111CONFIG_CPU_TLB_V4WB=y 114CONFIG_CPU_TLB_V4WB=y
112CONFIG_CPU_MINICACHE=y
113 115
114# 116#
115# Processor Features 117# Processor Features
@@ -119,6 +121,7 @@ CONFIG_CPU_MINICACHE=y
119# Bus support 121# Bus support
120# 122#
121CONFIG_ISA=y 123CONFIG_ISA=y
124CONFIG_ISA_DMA_API=y
122 125
123# 126#
124# PCCARD (PCMCIA/CardBus) support 127# PCCARD (PCMCIA/CardBus) support
@@ -128,6 +131,7 @@ CONFIG_ISA=y
128# 131#
129# Kernel Features 132# Kernel Features
130# 133#
134# CONFIG_SMP is not set
131# CONFIG_PREEMPT is not set 135# CONFIG_PREEMPT is not set
132CONFIG_DISCONTIGMEM=y 136CONFIG_DISCONTIGMEM=y
133CONFIG_LEDS=y 137CONFIG_LEDS=y
@@ -151,12 +155,14 @@ CONFIG_CPU_FREQ_TABLE=y
151# CONFIG_CPU_FREQ_DEBUG is not set 155# CONFIG_CPU_FREQ_DEBUG is not set
152CONFIG_CPU_FREQ_STAT=y 156CONFIG_CPU_FREQ_STAT=y
153# CONFIG_CPU_FREQ_STAT_DETAILS is not set 157# CONFIG_CPU_FREQ_STAT_DETAILS is not set
154CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y 158# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
155# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set 159CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
156CONFIG_CPU_FREQ_GOV_PERFORMANCE=y 160CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
157# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 161# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
158# CONFIG_CPU_FREQ_GOV_USERSPACE is not set 162CONFIG_CPU_FREQ_GOV_USERSPACE=y
159# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set 163# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
164# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
165CONFIG_CPU_FREQ_SA1100=y
160 166
161# 167#
162# Floating point emulation 168# Floating point emulation
@@ -280,7 +286,6 @@ CONFIG_MTD_CFI_UTIL=y
280# 286#
281# Block devices 287# Block devices
282# 288#
283# CONFIG_BLK_DEV_FD is not set
284# CONFIG_BLK_DEV_XD is not set 289# CONFIG_BLK_DEV_XD is not set
285# CONFIG_BLK_DEV_COW_COMMON is not set 290# CONFIG_BLK_DEV_COW_COMMON is not set
286# CONFIG_BLK_DEV_LOOP is not set 291# CONFIG_BLK_DEV_LOOP is not set
@@ -338,7 +343,6 @@ CONFIG_NET=y
338# 343#
339CONFIG_PACKET=y 344CONFIG_PACKET=y
340# CONFIG_PACKET_MMAP is not set 345# CONFIG_PACKET_MMAP is not set
341# CONFIG_NETLINK_DEV is not set
342CONFIG_UNIX=y 346CONFIG_UNIX=y
343# CONFIG_NET_KEY is not set 347# CONFIG_NET_KEY is not set
344CONFIG_INET=y 348CONFIG_INET=y
@@ -484,7 +488,6 @@ CONFIG_SERIO=y
484CONFIG_SERIO_SERPORT=y 488CONFIG_SERIO_SERPORT=y
485# CONFIG_SERIO_RAW is not set 489# CONFIG_SERIO_RAW is not set
486# CONFIG_GAMEPORT is not set 490# CONFIG_GAMEPORT is not set
487CONFIG_SOUND_GAMEPORT=y
488 491
489# 492#
490# Character devices 493# Character devices
@@ -533,7 +536,6 @@ CONFIG_LEGACY_PTY_COUNT=256
533# 536#
534# TPM devices 537# TPM devices
535# 538#
536# CONFIG_TCG_TPM is not set
537 539
538# 540#
539# I2C support 541# I2C support
diff --git a/arch/arm/configs/ixdp2400_defconfig b/arch/arm/configs/ixdp2400_defconfig
index 4fd663ecbe39..810a450a55d2 100644
--- a/arch/arm/configs/ixdp2400_defconfig
+++ b/arch/arm/configs/ixdp2400_defconfig
@@ -50,7 +50,13 @@ CONFIG_BASE_SMALL=0
50# 50#
51# Loadable module support 51# Loadable module support
52# 52#
53# CONFIG_MODULES is not set 53CONFIG_MODULES=y
54CONFIG_MODULE_UNLOAD=y
55# CONFIG_MODULE_FORCE_UNLOAD is not set
56CONFIG_OBSOLETE_MODPARM=y
57# CONFIG_MODVERSIONS is not set
58# CONFIG_MODULE_SRCVERSION_ALL is not set
59CONFIG_KMOD=y
54 60
55# 61#
56# System Type 62# System Type
diff --git a/arch/arm/configs/ixdp2401_defconfig b/arch/arm/configs/ixdp2401_defconfig
index 6f51c98084a3..72e1b940e975 100644
--- a/arch/arm/configs/ixdp2401_defconfig
+++ b/arch/arm/configs/ixdp2401_defconfig
@@ -50,7 +50,13 @@ CONFIG_BASE_SMALL=0
50# 50#
51# Loadable module support 51# Loadable module support
52# 52#
53# CONFIG_MODULES is not set 53CONFIG_MODULES=y
54CONFIG_MODULE_UNLOAD=y
55# CONFIG_MODULE_FORCE_UNLOAD is not set
56CONFIG_OBSOLETE_MODPARM=y
57# CONFIG_MODVERSIONS is not set
58# CONFIG_MODULE_SRCVERSION_ALL is not set
59CONFIG_KMOD=y
54 60
55# 61#
56# System Type 62# System Type
diff --git a/arch/arm/configs/ixdp2800_defconfig b/arch/arm/configs/ixdp2800_defconfig
index 7be3521f91fc..1592e45f0278 100644
--- a/arch/arm/configs/ixdp2800_defconfig
+++ b/arch/arm/configs/ixdp2800_defconfig
@@ -50,7 +50,13 @@ CONFIG_BASE_SMALL=0
50# 50#
51# Loadable module support 51# Loadable module support
52# 52#
53# CONFIG_MODULES is not set 53CONFIG_MODULES=y
54CONFIG_MODULE_UNLOAD=y
55# CONFIG_MODULE_FORCE_UNLOAD is not set
56CONFIG_OBSOLETE_MODPARM=y
57# CONFIG_MODVERSIONS is not set
58# CONFIG_MODULE_SRCVERSION_ALL is not set
59CONFIG_KMOD=y
54 60
55# 61#
56# System Type 62# System Type
diff --git a/arch/arm/configs/ixdp2801_defconfig b/arch/arm/configs/ixdp2801_defconfig
index cd84a20f30f1..f1afe3d09ec6 100644
--- a/arch/arm/configs/ixdp2801_defconfig
+++ b/arch/arm/configs/ixdp2801_defconfig
@@ -50,7 +50,13 @@ CONFIG_BASE_SMALL=0
50# 50#
51# Loadable module support 51# Loadable module support
52# 52#
53# CONFIG_MODULES is not set 53CONFIG_MODULES=y
54CONFIG_MODULE_UNLOAD=y
55# CONFIG_MODULE_FORCE_UNLOAD is not set
56CONFIG_OBSOLETE_MODPARM=y
57# CONFIG_MODVERSIONS is not set
58# CONFIG_MODULE_SRCVERSION_ALL is not set
59CONFIG_KMOD=y
54 60
55# 61#
56# System Type 62# System Type
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 4a2af55e134b..3e1b0327e4d7 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -6,7 +6,7 @@ AFLAGS_head.o := -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR)
6 6
7# Object file lists. 7# Object file lists.
8 8
9obj-y := arch.o compat.o dma.o entry-armv.o entry-common.o irq.o \ 9obj-y := compat.o dma.o entry-armv.o entry-common.o irq.o \
10 process.o ptrace.o semaphore.o setup.o signal.o sys_arm.o \ 10 process.o ptrace.o semaphore.o setup.o signal.o sys_arm.o \
11 time.o traps.o 11 time.o traps.o
12 12
diff --git a/arch/arm/kernel/arch.c b/arch/arm/kernel/arch.c
deleted file mode 100644
index 4e02fbeb10a6..000000000000
--- a/arch/arm/kernel/arch.c
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * linux/arch/arm/kernel/arch.c
3 *
4 * Architecture specific fixups.
5 */
6#include <linux/config.h>
7#include <linux/init.h>
8#include <linux/types.h>
9
10#include <asm/elf.h>
11#include <asm/page.h>
12#include <asm/setup.h>
13#include <asm/mach/arch.h>
14
15unsigned int vram_size;
16
17#ifdef CONFIG_ARCH_ACORN
18
19unsigned int memc_ctrl_reg;
20unsigned int number_mfm_drives;
21
22static int __init parse_tag_acorn(const struct tag *tag)
23{
24 memc_ctrl_reg = tag->u.acorn.memc_control_reg;
25 number_mfm_drives = tag->u.acorn.adfsdrives;
26
27 switch (tag->u.acorn.vram_pages) {
28 case 512:
29 vram_size += PAGE_SIZE * 256;
30 case 256:
31 vram_size += PAGE_SIZE * 256;
32 default:
33 break;
34 }
35#if 0
36 if (vram_size) {
37 desc->video_start = 0x02000000;
38 desc->video_end = 0x02000000 + vram_size;
39 }
40#endif
41 return 0;
42}
43
44__tagtable(ATAG_ACORN, parse_tag_acorn);
45
46#endif
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 3dc15b131f53..6540db691338 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -866,19 +866,19 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
866 return ec; 866 return ec;
867} 867}
868 868
869static ssize_t ecard_show_irq(struct device *dev, char *buf) 869static ssize_t ecard_show_irq(struct device *dev, struct device_attribute *attr, char *buf)
870{ 870{
871 struct expansion_card *ec = ECARD_DEV(dev); 871 struct expansion_card *ec = ECARD_DEV(dev);
872 return sprintf(buf, "%u\n", ec->irq); 872 return sprintf(buf, "%u\n", ec->irq);
873} 873}
874 874
875static ssize_t ecard_show_dma(struct device *dev, char *buf) 875static ssize_t ecard_show_dma(struct device *dev, struct device_attribute *attr, char *buf)
876{ 876{
877 struct expansion_card *ec = ECARD_DEV(dev); 877 struct expansion_card *ec = ECARD_DEV(dev);
878 return sprintf(buf, "%u\n", ec->dma); 878 return sprintf(buf, "%u\n", ec->dma);
879} 879}
880 880
881static ssize_t ecard_show_resources(struct device *dev, char *buf) 881static ssize_t ecard_show_resources(struct device *dev, struct device_attribute *attr, char *buf)
882{ 882{
883 struct expansion_card *ec = ECARD_DEV(dev); 883 struct expansion_card *ec = ECARD_DEV(dev);
884 char *str = buf; 884 char *str = buf;
@@ -893,19 +893,19 @@ static ssize_t ecard_show_resources(struct device *dev, char *buf)
893 return str - buf; 893 return str - buf;
894} 894}
895 895
896static ssize_t ecard_show_vendor(struct device *dev, char *buf) 896static ssize_t ecard_show_vendor(struct device *dev, struct device_attribute *attr, char *buf)
897{ 897{
898 struct expansion_card *ec = ECARD_DEV(dev); 898 struct expansion_card *ec = ECARD_DEV(dev);
899 return sprintf(buf, "%u\n", ec->cid.manufacturer); 899 return sprintf(buf, "%u\n", ec->cid.manufacturer);
900} 900}
901 901
902static ssize_t ecard_show_device(struct device *dev, char *buf) 902static ssize_t ecard_show_device(struct device *dev, struct device_attribute *attr, char *buf)
903{ 903{
904 struct expansion_card *ec = ECARD_DEV(dev); 904 struct expansion_card *ec = ECARD_DEV(dev);
905 return sprintf(buf, "%u\n", ec->cid.product); 905 return sprintf(buf, "%u\n", ec->cid.product);
906} 906}
907 907
908static ssize_t ecard_show_type(struct device *dev, char *buf) 908static ssize_t ecard_show_type(struct device *dev, struct device_attribute *attr, char *buf)
909{ 909{
910 struct expansion_card *ec = ECARD_DEV(dev); 910 struct expansion_card *ec = ECARD_DEV(dev);
911 return sprintf(buf, "%s\n", ec->type == ECARD_EASI ? "EASI" : "IOC"); 911 return sprintf(buf, "%s\n", ec->type == ECARD_EASI ? "EASI" : "IOC");
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 4eb36155dc93..39a6c1b0b9a3 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -24,48 +24,91 @@
24#include "entry-header.S" 24#include "entry-header.S"
25 25
26/* 26/*
27 * Interrupt handling. Preserves r7, r8, r9
28 */
29 .macro irq_handler
301: get_irqnr_and_base r0, r6, r5, lr
31 movne r1, sp
32 @
33 @ routine called with r0 = irq number, r1 = struct pt_regs *
34 @
35 adrne lr, 1b
36 bne asm_do_IRQ
37
38#ifdef CONFIG_SMP
39 /*
40 * XXX
41 *
42 * this macro assumes that irqstat (r6) and base (r5) are
43 * preserved from get_irqnr_and_base above
44 */
45 test_for_ipi r0, r6, r5, lr
46 movne r0, sp
47 adrne lr, 1b
48 bne do_IPI
49#endif
50
51 .endm
52
53/*
27 * Invalid mode handlers 54 * Invalid mode handlers
28 */ 55 */
29 .macro inv_entry, sym, reason 56 .macro inv_entry, reason
30 sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go 57 sub sp, sp, #S_FRAME_SIZE
31 stmia sp, {r0 - lr} @ Save XXX r0 - lr 58 stmib sp, {r1 - lr}
32 ldr r4, .LC\sym
33 mov r1, #\reason 59 mov r1, #\reason
34 .endm 60 .endm
35 61
36__pabt_invalid: 62__pabt_invalid:
37 inv_entry abt, BAD_PREFETCH 63 inv_entry BAD_PREFETCH
38 b 1f 64 b common_invalid
39 65
40__dabt_invalid: 66__dabt_invalid:
41 inv_entry abt, BAD_DATA 67 inv_entry BAD_DATA
42 b 1f 68 b common_invalid
43 69
44__irq_invalid: 70__irq_invalid:
45 inv_entry irq, BAD_IRQ 71 inv_entry BAD_IRQ
46 b 1f 72 b common_invalid
47 73
48__und_invalid: 74__und_invalid:
49 inv_entry und, BAD_UNDEFINSTR 75 inv_entry BAD_UNDEFINSTR
76
77 @
78 @ XXX fall through to common_invalid
79 @
80
81@
82@ common_invalid - generic code for failed exception (re-entrant version of handlers)
83@
84common_invalid:
85 zero_fp
86
87 ldmia r0, {r4 - r6}
88 add r0, sp, #S_PC @ here for interlock avoidance
89 mov r7, #-1 @ "" "" "" ""
90 str r4, [sp] @ save preserved r0
91 stmia r0, {r5 - r7} @ lr_<exception>,
92 @ cpsr_<exception>, "old_r0"
50 93
511: zero_fp
52 ldmia r4, {r5 - r7} @ Get XXX pc, cpsr, old_r0
53 add r4, sp, #S_PC
54 stmia r4, {r5 - r7} @ Save XXX pc, cpsr, old_r0
55 mov r0, sp 94 mov r0, sp
56 and r2, r6, #31 @ int mode 95 and r2, r6, #0x1f
57 b bad_mode 96 b bad_mode
58 97
59/* 98/*
60 * SVC mode handlers 99 * SVC mode handlers
61 */ 100 */
62 .macro svc_entry, sym 101 .macro svc_entry
63 sub sp, sp, #S_FRAME_SIZE 102 sub sp, sp, #S_FRAME_SIZE
64 stmia sp, {r0 - r12} @ save r0 - r12 103 stmib sp, {r1 - r12}
65 ldr r2, .LC\sym 104
66 add r0, sp, #S_FRAME_SIZE 105 ldmia r0, {r1 - r3}
67 ldmia r2, {r2 - r4} @ get pc, cpsr 106 add r5, sp, #S_SP @ here for interlock avoidance
68 add r5, sp, #S_SP 107 mov r4, #-1 @ "" "" "" ""
108 add r0, sp, #S_FRAME_SIZE @ "" "" "" ""
109 str r1, [sp] @ save the "real" r0 copied
110 @ from the exception stack
111
69 mov r1, lr 112 mov r1, lr
70 113
71 @ 114 @
@@ -82,7 +125,7 @@ __und_invalid:
82 125
83 .align 5 126 .align 5
84__dabt_svc: 127__dabt_svc:
85 svc_entry abt 128 svc_entry
86 129
87 @ 130 @
88 @ get ready to re-enable interrupts if appropriate 131 @ get ready to re-enable interrupts if appropriate
@@ -129,28 +172,24 @@ __dabt_svc:
129 172
130 .align 5 173 .align 5
131__irq_svc: 174__irq_svc:
132 svc_entry irq 175 svc_entry
176
133#ifdef CONFIG_PREEMPT 177#ifdef CONFIG_PREEMPT
134 get_thread_info r8 178 get_thread_info tsk
135 ldr r9, [r8, #TI_PREEMPT] @ get preempt count 179 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
136 add r7, r9, #1 @ increment it 180 add r7, r8, #1 @ increment it
137 str r7, [r8, #TI_PREEMPT] 181 str r7, [tsk, #TI_PREEMPT]
138#endif 182#endif
1391: get_irqnr_and_base r0, r6, r5, lr 183
140 movne r1, sp 184 irq_handler
141 @
142 @ routine called with r0 = irq number, r1 = struct pt_regs *
143 @
144 adrne lr, 1b
145 bne asm_do_IRQ
146#ifdef CONFIG_PREEMPT 185#ifdef CONFIG_PREEMPT
147 ldr r0, [r8, #TI_FLAGS] @ get flags 186 ldr r0, [tsk, #TI_FLAGS] @ get flags
148 tst r0, #_TIF_NEED_RESCHED 187 tst r0, #_TIF_NEED_RESCHED
149 blne svc_preempt 188 blne svc_preempt
150preempt_return: 189preempt_return:
151 ldr r0, [r8, #TI_PREEMPT] @ read preempt value 190 ldr r0, [tsk, #TI_PREEMPT] @ read preempt value
191 str r8, [tsk, #TI_PREEMPT] @ restore preempt count
152 teq r0, r7 192 teq r0, r7
153 str r9, [r8, #TI_PREEMPT] @ restore preempt count
154 strne r0, [r0, -r0] @ bug() 193 strne r0, [r0, -r0] @ bug()
155#endif 194#endif
156 ldr r0, [sp, #S_PSR] @ irqs are already disabled 195 ldr r0, [sp, #S_PSR] @ irqs are already disabled
@@ -161,7 +200,7 @@ preempt_return:
161 200
162#ifdef CONFIG_PREEMPT 201#ifdef CONFIG_PREEMPT
163svc_preempt: 202svc_preempt:
164 teq r9, #0 @ was preempt count = 0 203 teq r8, #0 @ was preempt count = 0
165 ldreq r6, .LCirq_stat 204 ldreq r6, .LCirq_stat
166 movne pc, lr @ no 205 movne pc, lr @ no
167 ldr r0, [r6, #4] @ local_irq_count 206 ldr r0, [r6, #4] @ local_irq_count
@@ -169,9 +208,9 @@ svc_preempt:
169 adds r0, r0, r1 208 adds r0, r0, r1
170 movne pc, lr 209 movne pc, lr
171 mov r7, #0 @ preempt_schedule_irq 210 mov r7, #0 @ preempt_schedule_irq
172 str r7, [r8, #TI_PREEMPT] @ expects preempt_count == 0 211 str r7, [tsk, #TI_PREEMPT] @ expects preempt_count == 0
1731: bl preempt_schedule_irq @ irq en/disable is done inside 2121: bl preempt_schedule_irq @ irq en/disable is done inside
174 ldr r0, [r8, #TI_FLAGS] @ get new tasks TI_FLAGS 213 ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS
175 tst r0, #_TIF_NEED_RESCHED 214 tst r0, #_TIF_NEED_RESCHED
176 beq preempt_return @ go again 215 beq preempt_return @ go again
177 b 1b 216 b 1b
@@ -179,7 +218,7 @@ svc_preempt:
179 218
180 .align 5 219 .align 5
181__und_svc: 220__und_svc:
182 svc_entry und 221 svc_entry
183 222
184 @ 223 @
185 @ call emulation code, which returns using r9 if it has emulated 224 @ call emulation code, which returns using r9 if it has emulated
@@ -209,7 +248,7 @@ __und_svc:
209 248
210 .align 5 249 .align 5
211__pabt_svc: 250__pabt_svc:
212 svc_entry abt 251 svc_entry
213 252
214 @ 253 @
215 @ re-enable interrupts if appropriate 254 @ re-enable interrupts if appropriate
@@ -242,12 +281,8 @@ __pabt_svc:
242 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr 281 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
243 282
244 .align 5 283 .align 5
245.LCirq: 284.LCcralign:
246 .word __temp_irq 285 .word cr_alignment
247.LCund:
248 .word __temp_und
249.LCabt:
250 .word __temp_abt
251#ifdef MULTI_ABORT 286#ifdef MULTI_ABORT
252.LCprocfns: 287.LCprocfns:
253 .word processor 288 .word processor
@@ -262,14 +297,18 @@ __pabt_svc:
262/* 297/*
263 * User mode handlers 298 * User mode handlers
264 */ 299 */
265 .macro usr_entry, sym 300 .macro usr_entry
266 sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go 301 sub sp, sp, #S_FRAME_SIZE
267 stmia sp, {r0 - r12} @ save r0 - r12 302 stmib sp, {r1 - r12}
268 ldr r7, .LC\sym 303
269 add r5, sp, #S_PC 304 ldmia r0, {r1 - r3}
270 ldmia r7, {r2 - r4} @ Get USR pc, cpsr 305 add r0, sp, #S_PC @ here for interlock avoidance
271 306 mov r4, #-1 @ "" "" "" ""
272#if __LINUX_ARM_ARCH__ < 6 307
308 str r1, [sp] @ save the "real" r0 copied
309 @ from the exception stack
310
311#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
273 @ make sure our user space atomic helper is aborted 312 @ make sure our user space atomic helper is aborted
274 cmp r2, #VIRT_OFFSET 313 cmp r2, #VIRT_OFFSET
275 bichs r3, r3, #PSR_Z_BIT 314 bichs r3, r3, #PSR_Z_BIT
@@ -284,13 +323,13 @@ __pabt_svc:
284 @ 323 @
285 @ Also, separately save sp_usr and lr_usr 324 @ Also, separately save sp_usr and lr_usr
286 @ 325 @
287 stmia r5, {r2 - r4} 326 stmia r0, {r2 - r4}
288 stmdb r5, {sp, lr}^ 327 stmdb r0, {sp, lr}^
289 328
290 @ 329 @
291 @ Enable the alignment trap while in kernel mode 330 @ Enable the alignment trap while in kernel mode
292 @ 331 @
293 alignment_trap r7, r0, __temp_\sym 332 alignment_trap r0
294 333
295 @ 334 @
296 @ Clear FP to mark the first stack frame 335 @ Clear FP to mark the first stack frame
@@ -300,7 +339,7 @@ __pabt_svc:
300 339
301 .align 5 340 .align 5
302__dabt_usr: 341__dabt_usr:
303 usr_entry abt 342 usr_entry
304 343
305 @ 344 @
306 @ Call the processor-specific abort handler: 345 @ Call the processor-specific abort handler:
@@ -329,30 +368,23 @@ __dabt_usr:
329 368
330 .align 5 369 .align 5
331__irq_usr: 370__irq_usr:
332 usr_entry irq 371 usr_entry
333 372
373 get_thread_info tsk
334#ifdef CONFIG_PREEMPT 374#ifdef CONFIG_PREEMPT
335 get_thread_info r8 375 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
336 ldr r9, [r8, #TI_PREEMPT] @ get preempt count 376 add r7, r8, #1 @ increment it
337 add r7, r9, #1 @ increment it 377 str r7, [tsk, #TI_PREEMPT]
338 str r7, [r8, #TI_PREEMPT]
339#endif 378#endif
3401: get_irqnr_and_base r0, r6, r5, lr 379
341 movne r1, sp 380 irq_handler
342 adrne lr, 1b
343 @
344 @ routine called with r0 = irq number, r1 = struct pt_regs *
345 @
346 bne asm_do_IRQ
347#ifdef CONFIG_PREEMPT 381#ifdef CONFIG_PREEMPT
348 ldr r0, [r8, #TI_PREEMPT] 382 ldr r0, [tsk, #TI_PREEMPT]
383 str r8, [tsk, #TI_PREEMPT]
349 teq r0, r7 384 teq r0, r7
350 str r9, [r8, #TI_PREEMPT]
351 strne r0, [r0, -r0] 385 strne r0, [r0, -r0]
352 mov tsk, r8
353#else
354 get_thread_info tsk
355#endif 386#endif
387
356 mov why, #0 388 mov why, #0
357 b ret_to_user 389 b ret_to_user
358 390
@@ -360,7 +392,7 @@ __irq_usr:
360 392
361 .align 5 393 .align 5
362__und_usr: 394__und_usr:
363 usr_entry und 395 usr_entry
364 396
365 tst r3, #PSR_T_BIT @ Thumb mode? 397 tst r3, #PSR_T_BIT @ Thumb mode?
366 bne fpundefinstr @ ignore FP 398 bne fpundefinstr @ ignore FP
@@ -476,7 +508,7 @@ fpundefinstr:
476 508
477 .align 5 509 .align 5
478__pabt_usr: 510__pabt_usr:
479 usr_entry abt 511 usr_entry
480 512
481 enable_irq @ Enable interrupts 513 enable_irq @ Enable interrupts
482 mov r0, r2 @ address (pc) 514 mov r0, r2 @ address (pc)
@@ -616,11 +648,17 @@ __kuser_helper_start:
616 648
617__kuser_cmpxchg: @ 0xffff0fc0 649__kuser_cmpxchg: @ 0xffff0fc0
618 650
619#if __LINUX_ARM_ARCH__ < 6 651#if defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
620 652
621#ifdef CONFIG_SMP /* sanity check */ 653 /*
622#error "CONFIG_SMP on a machine supporting pre-ARMv6 processors?" 654 * Poor you. No fast solution possible...
623#endif 655 * The kernel itself must perform the operation.
656 * A special ghost syscall is used for that (see traps.c).
657 */
658 swi #0x9ffff0
659 mov pc, lr
660
661#elif __LINUX_ARM_ARCH__ < 6
624 662
625 /* 663 /*
626 * Theory of operation: 664 * Theory of operation:
@@ -735,29 +773,41 @@ __kuser_helper_end:
735 * 773 *
736 * Common stub entry macro: 774 * Common stub entry macro:
737 * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC 775 * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
776 *
777 * SP points to a minimal amount of processor-private memory, the address
778 * of which is copied into r0 for the mode specific abort handler.
738 */ 779 */
739 .macro vector_stub, name, sym, correction=0 780 .macro vector_stub, name, correction=0
740 .align 5 781 .align 5
741 782
742vector_\name: 783vector_\name:
743 ldr r13, .LCs\sym
744 .if \correction 784 .if \correction
745 sub lr, lr, #\correction 785 sub lr, lr, #\correction
746 .endif 786 .endif
747 str lr, [r13] @ save lr_IRQ 787
788 @
789 @ Save r0, lr_<exception> (parent PC) and spsr_<exception>
790 @ (parent CPSR)
791 @
792 stmia sp, {r0, lr} @ save r0, lr
748 mrs lr, spsr 793 mrs lr, spsr
749 str lr, [r13, #4] @ save spsr_IRQ 794 str lr, [sp, #8] @ save spsr
795
750 @ 796 @
751 @ now branch to the relevant MODE handling routine 797 @ Prepare for SVC32 mode. IRQs remain disabled.
752 @ 798 @
753 mrs r13, cpsr 799 mrs r0, cpsr
754 bic r13, r13, #MODE_MASK 800 bic r0, r0, #MODE_MASK
755 orr r13, r13, #SVC_MODE 801 orr r0, r0, #SVC_MODE
756 msr spsr_cxsf, r13 @ switch to SVC_32 mode 802 msr spsr_cxsf, r0
757 803
758 and lr, lr, #15 804 @
805 @ the branch table must immediately follow this code
806 @
807 mov r0, sp
808 and lr, lr, #0x0f
759 ldr lr, [pc, lr, lsl #2] 809 ldr lr, [pc, lr, lsl #2]
760 movs pc, lr @ Changes mode and branches 810 movs pc, lr @ branch to handler in SVC mode
761 .endm 811 .endm
762 812
763 .globl __stubs_start 813 .globl __stubs_start
@@ -765,7 +815,7 @@ __stubs_start:
765/* 815/*
766 * Interrupt dispatcher 816 * Interrupt dispatcher
767 */ 817 */
768 vector_stub irq, irq, 4 818 vector_stub irq, 4
769 819
770 .long __irq_usr @ 0 (USR_26 / USR_32) 820 .long __irq_usr @ 0 (USR_26 / USR_32)
771 .long __irq_invalid @ 1 (FIQ_26 / FIQ_32) 821 .long __irq_invalid @ 1 (FIQ_26 / FIQ_32)
@@ -788,7 +838,7 @@ __stubs_start:
788 * Data abort dispatcher 838 * Data abort dispatcher
789 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC 839 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
790 */ 840 */
791 vector_stub dabt, abt, 8 841 vector_stub dabt, 8
792 842
793 .long __dabt_usr @ 0 (USR_26 / USR_32) 843 .long __dabt_usr @ 0 (USR_26 / USR_32)
794 .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32) 844 .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32)
@@ -811,7 +861,7 @@ __stubs_start:
811 * Prefetch abort dispatcher 861 * Prefetch abort dispatcher
812 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC 862 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
813 */ 863 */
814 vector_stub pabt, abt, 4 864 vector_stub pabt, 4
815 865
816 .long __pabt_usr @ 0 (USR_26 / USR_32) 866 .long __pabt_usr @ 0 (USR_26 / USR_32)
817 .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32) 867 .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32)
@@ -834,7 +884,7 @@ __stubs_start:
834 * Undef instr entry dispatcher 884 * Undef instr entry dispatcher
835 * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC 885 * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
836 */ 886 */
837 vector_stub und, und 887 vector_stub und
838 888
839 .long __und_usr @ 0 (USR_26 / USR_32) 889 .long __und_usr @ 0 (USR_26 / USR_32)
840 .long __und_invalid @ 1 (FIQ_26 / FIQ_32) 890 .long __und_invalid @ 1 (FIQ_26 / FIQ_32)
@@ -888,13 +938,6 @@ vector_addrexcptn:
888.LCvswi: 938.LCvswi:
889 .word vector_swi 939 .word vector_swi
890 940
891.LCsirq:
892 .word __temp_irq
893.LCsund:
894 .word __temp_und
895.LCsabt:
896 .word __temp_abt
897
898 .globl __stubs_end 941 .globl __stubs_end
899__stubs_end: 942__stubs_end:
900 943
@@ -916,23 +959,6 @@ __vectors_end:
916 959
917 .data 960 .data
918 961
919/*
920 * Do not reorder these, and do not insert extra data between...
921 */
922
923__temp_irq:
924 .word 0 @ saved lr_irq
925 .word 0 @ saved spsr_irq
926 .word -1 @ old_r0
927__temp_und:
928 .word 0 @ Saved lr_und
929 .word 0 @ Saved spsr_und
930 .word -1 @ old_r0
931__temp_abt:
932 .word 0 @ Saved lr_abt
933 .word 0 @ Saved spsr_abt
934 .word -1 @ old_r0
935
936 .globl cr_alignment 962 .globl cr_alignment
937 .globl cr_no_alignment 963 .globl cr_no_alignment
938cr_alignment: 964cr_alignment:
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index a3d40a0e2b04..afef21273963 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -59,11 +59,10 @@
59 mov \rd, \rd, lsl #13 59 mov \rd, \rd, lsl #13
60 .endm 60 .endm
61 61
62 .macro alignment_trap, rbase, rtemp, sym 62 .macro alignment_trap, rtemp
63#ifdef CONFIG_ALIGNMENT_TRAP 63#ifdef CONFIG_ALIGNMENT_TRAP
64#define OFF_CR_ALIGNMENT(x) cr_alignment - x 64 ldr \rtemp, .LCcralign
65 65 ldr \rtemp, [\rtemp]
66 ldr \rtemp, [\rbase, #OFF_CR_ALIGNMENT(\sym)]
67 mcr p15, 0, \rtemp, c1, c0 66 mcr p15, 0, \rtemp, c1, c0
68#endif 67#endif
69 .endm 68 .endm
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 4733877296d4..bd4823c74645 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -2,6 +2,8 @@
2 * linux/arch/arm/kernel/head.S 2 * linux/arch/arm/kernel/head.S
3 * 3 *
4 * Copyright (C) 1994-2002 Russell King 4 * Copyright (C) 1994-2002 Russell King
5 * Copyright (c) 2003 ARM Limited
6 * All Rights Reserved
5 * 7 *
6 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -165,6 +167,48 @@ __mmap_switched:
165 stmia r6, {r0, r4} @ Save control register values 167 stmia r6, {r0, r4} @ Save control register values
166 b start_kernel 168 b start_kernel
167 169
170#if defined(CONFIG_SMP)
171 .type secondary_startup, #function
172ENTRY(secondary_startup)
173 /*
174 * Common entry point for secondary CPUs.
175 *
176 * Ensure that we're in SVC mode, and IRQs are disabled. Lookup
177 * the processor type - there is no need to check the machine type
178 * as it has already been validated by the primary processor.
179 */
180 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC
181 bl __lookup_processor_type
182 movs r10, r5 @ invalid processor?
183 moveq r0, #'p' @ yes, error 'p'
184 beq __error
185
186 /*
187 * Use the page tables supplied from __cpu_up.
188 */
189 adr r4, __secondary_data
190 ldmia r4, {r5, r6, r13} @ address to jump to after
191 sub r4, r4, r5 @ mmu has been enabled
192 ldr r4, [r6, r4] @ get secondary_data.pgdir
193 adr lr, __enable_mmu @ return address
194 add pc, r10, #12 @ initialise processor
195 @ (return control reg)
196
197 /*
198 * r6 = &secondary_data
199 */
200ENTRY(__secondary_switched)
201 ldr sp, [r6, #4] @ get secondary_data.stack
202 mov fp, #0
203 b secondary_start_kernel
204
205 .type __secondary_data, %object
206__secondary_data:
207 .long .
208 .long secondary_data
209 .long __secondary_switched
210#endif /* defined(CONFIG_SMP) */
211
168 212
169 213
170/* 214/*
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index c2a7da3ac0f1..9fed5fa194d9 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -92,6 +92,14 @@ struct cpu_user_fns cpu_user;
92struct cpu_cache_fns cpu_cache; 92struct cpu_cache_fns cpu_cache;
93#endif 93#endif
94 94
95struct stack {
96 u32 irq[3];
97 u32 abt[3];
98 u32 und[3];
99} ____cacheline_aligned;
100
101static struct stack stacks[NR_CPUS];
102
95char elf_platform[ELF_PLATFORM_SIZE]; 103char elf_platform[ELF_PLATFORM_SIZE];
96EXPORT_SYMBOL(elf_platform); 104EXPORT_SYMBOL(elf_platform);
97 105
@@ -307,8 +315,6 @@ static void __init setup_processor(void)
307 cpu_name, processor_id, (int)processor_id & 15, 315 cpu_name, processor_id, (int)processor_id & 15,
308 proc_arch[cpu_architecture()]); 316 proc_arch[cpu_architecture()]);
309 317
310 dump_cpu_info(smp_processor_id());
311
312 sprintf(system_utsname.machine, "%s%c", list->arch_name, ENDIANNESS); 318 sprintf(system_utsname.machine, "%s%c", list->arch_name, ENDIANNESS);
313 sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS); 319 sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS);
314 elf_hwcap = list->elf_hwcap; 320 elf_hwcap = list->elf_hwcap;
@@ -316,6 +322,46 @@ static void __init setup_processor(void)
316 cpu_proc_init(); 322 cpu_proc_init();
317} 323}
318 324
325/*
326 * cpu_init - initialise one CPU.
327 *
328 * cpu_init dumps the cache information, initialises SMP specific
329 * information, and sets up the per-CPU stacks.
330 */
331void cpu_init(void)
332{
333 unsigned int cpu = smp_processor_id();
334 struct stack *stk = &stacks[cpu];
335
336 if (cpu >= NR_CPUS) {
337 printk(KERN_CRIT "CPU%u: bad primary CPU number\n", cpu);
338 BUG();
339 }
340
341 dump_cpu_info(cpu);
342
343 /*
344 * setup stacks for re-entrant exception handlers
345 */
346 __asm__ (
347 "msr cpsr_c, %1\n\t"
348 "add sp, %0, %2\n\t"
349 "msr cpsr_c, %3\n\t"
350 "add sp, %0, %4\n\t"
351 "msr cpsr_c, %5\n\t"
352 "add sp, %0, %6\n\t"
353 "msr cpsr_c, %7"
354 :
355 : "r" (stk),
356 "I" (PSR_F_BIT | PSR_I_BIT | IRQ_MODE),
357 "I" (offsetof(struct stack, irq[0])),
358 "I" (PSR_F_BIT | PSR_I_BIT | ABT_MODE),
359 "I" (offsetof(struct stack, abt[0])),
360 "I" (PSR_F_BIT | PSR_I_BIT | UND_MODE),
361 "I" (offsetof(struct stack, und[0])),
362 "I" (PSR_F_BIT | PSR_I_BIT | SVC_MODE));
363}
364
319static struct machine_desc * __init setup_machine(unsigned int nr) 365static struct machine_desc * __init setup_machine(unsigned int nr)
320{ 366{
321 struct machine_desc *list; 367 struct machine_desc *list;
@@ -715,6 +761,8 @@ void __init setup_arch(char **cmdline_p)
715 paging_init(&meminfo, mdesc); 761 paging_init(&meminfo, mdesc);
716 request_standard_resources(&meminfo, mdesc); 762 request_standard_resources(&meminfo, mdesc);
717 763
764 cpu_init();
765
718 /* 766 /*
719 * Set up various architecture-specific pointers 767 * Set up various architecture-specific pointers
720 */ 768 */
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index ecc8c3332408..34892758f098 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -24,6 +24,9 @@
24#include <asm/atomic.h> 24#include <asm/atomic.h>
25#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
26#include <asm/cpu.h> 26#include <asm/cpu.h>
27#include <asm/mmu_context.h>
28#include <asm/pgtable.h>
29#include <asm/pgalloc.h>
27#include <asm/processor.h> 30#include <asm/processor.h>
28#include <asm/tlbflush.h> 31#include <asm/tlbflush.h>
29#include <asm/ptrace.h> 32#include <asm/ptrace.h>
@@ -37,6 +40,13 @@ cpumask_t cpu_present_mask;
37cpumask_t cpu_online_map; 40cpumask_t cpu_online_map;
38 41
39/* 42/*
43 * as from 2.5, kernels no longer have an init_tasks structure
44 * so we need some other way of telling a new secondary core
45 * where to place its SVC stack
46 */
47struct secondary_data secondary_data;
48
49/*
40 * structures for inter-processor calls 50 * structures for inter-processor calls
41 * - A collection of single bit ipi messages. 51 * - A collection of single bit ipi messages.
42 */ 52 */
@@ -71,6 +81,8 @@ static DEFINE_SPINLOCK(smp_call_function_lock);
71int __init __cpu_up(unsigned int cpu) 81int __init __cpu_up(unsigned int cpu)
72{ 82{
73 struct task_struct *idle; 83 struct task_struct *idle;
84 pgd_t *pgd;
85 pmd_t *pmd;
74 int ret; 86 int ret;
75 87
76 /* 88 /*
@@ -84,11 +96,57 @@ int __init __cpu_up(unsigned int cpu)
84 } 96 }
85 97
86 /* 98 /*
99 * Allocate initial page tables to allow the new CPU to
100 * enable the MMU safely. This essentially means a set
101 * of our "standard" page tables, with the addition of
102 * a 1:1 mapping for the physical address of the kernel.
103 */
104 pgd = pgd_alloc(&init_mm);
105 pmd = pmd_offset(pgd, PHYS_OFFSET);
106 *pmd = __pmd((PHYS_OFFSET & PGDIR_MASK) |
107 PMD_TYPE_SECT | PMD_SECT_AP_WRITE);
108
109 /*
110 * We need to tell the secondary core where to find
111 * its stack and the page tables.
112 */
113 secondary_data.stack = (void *)idle->thread_info + THREAD_SIZE - 8;
114 secondary_data.pgdir = virt_to_phys(pgd);
115 wmb();
116
117 /*
87 * Now bring the CPU into our world. 118 * Now bring the CPU into our world.
88 */ 119 */
89 ret = boot_secondary(cpu, idle); 120 ret = boot_secondary(cpu, idle);
121 if (ret == 0) {
122 unsigned long timeout;
123
124 /*
125 * CPU was successfully started, wait for it
126 * to come online or time out.
127 */
128 timeout = jiffies + HZ;
129 while (time_before(jiffies, timeout)) {
130 if (cpu_online(cpu))
131 break;
132
133 udelay(10);
134 barrier();
135 }
136
137 if (!cpu_online(cpu))
138 ret = -EIO;
139 }
140
141 secondary_data.stack = 0;
142 secondary_data.pgdir = 0;
143
144 *pmd_offset(pgd, PHYS_OFFSET) = __pmd(0);
145 pgd_free(pgd);
146
90 if (ret) { 147 if (ret) {
91 printk(KERN_CRIT "cpu_up: processor %d failed to boot\n", cpu); 148 printk(KERN_CRIT "CPU%u: processor failed to boot\n", cpu);
149
92 /* 150 /*
93 * FIXME: We need to clean up the new idle thread. --rmk 151 * FIXME: We need to clean up the new idle thread. --rmk
94 */ 152 */
@@ -98,6 +156,56 @@ int __init __cpu_up(unsigned int cpu)
98} 156}
99 157
100/* 158/*
159 * This is the secondary CPU boot entry. We're using this CPUs
160 * idle thread stack, but a set of temporary page tables.
161 */
162asmlinkage void __init secondary_start_kernel(void)
163{
164 struct mm_struct *mm = &init_mm;
165 unsigned int cpu = smp_processor_id();
166
167 printk("CPU%u: Booted secondary processor\n", cpu);
168
169 /*
170 * All kernel threads share the same mm context; grab a
171 * reference and switch to it.
172 */
173 atomic_inc(&mm->mm_users);
174 atomic_inc(&mm->mm_count);
175 current->active_mm = mm;
176 cpu_set(cpu, mm->cpu_vm_mask);
177 cpu_switch_mm(mm->pgd, mm);
178 enter_lazy_tlb(mm, current);
179
180 cpu_init();
181
182 /*
183 * Give the platform a chance to do its own initialisation.
184 */
185 platform_secondary_init(cpu);
186
187 /*
188 * Enable local interrupts.
189 */
190 local_irq_enable();
191 local_fiq_enable();
192
193 calibrate_delay();
194
195 smp_store_cpu_info(cpu);
196
197 /*
198 * OK, now it's safe to let the boot CPU continue
199 */
200 cpu_set(cpu, cpu_online_map);
201
202 /*
203 * OK, it's off to the idle thread for us
204 */
205 cpu_idle();
206}
207
208/*
101 * Called by both boot and secondaries to move global data into 209 * Called by both boot and secondaries to move global data into
102 * per-processor storage. 210 * per-processor storage.
103 */ 211 */
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 14df16b983f4..45d2a032d890 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -464,6 +464,55 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
464#endif 464#endif
465 return 0; 465 return 0;
466 466
467#ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG
468 /*
469 * Atomically store r1 in *r2 if *r2 is equal to r0 for user space.
470 * Return zero in r0 if *MEM was changed or non-zero if no exchange
471 * happened. Also set the user C flag accordingly.
472 * If access permissions have to be fixed up then non-zero is
473 * returned and the operation has to be re-attempted.
474 *
475 * *NOTE*: This is a ghost syscall private to the kernel. Only the
476 * __kuser_cmpxchg code in entry-armv.S should be aware of its
477 * existence. Don't ever use this from user code.
478 */
479 case 0xfff0:
480 {
481 extern void do_DataAbort(unsigned long addr, unsigned int fsr,
482 struct pt_regs *regs);
483 unsigned long val;
484 unsigned long addr = regs->ARM_r2;
485 struct mm_struct *mm = current->mm;
486 pgd_t *pgd; pmd_t *pmd; pte_t *pte;
487
488 regs->ARM_cpsr &= ~PSR_C_BIT;
489 spin_lock(&mm->page_table_lock);
490 pgd = pgd_offset(mm, addr);
491 if (!pgd_present(*pgd))
492 goto bad_access;
493 pmd = pmd_offset(pgd, addr);
494 if (!pmd_present(*pmd))
495 goto bad_access;
496 pte = pte_offset_map(pmd, addr);
497 if (!pte_present(*pte) || !pte_write(*pte))
498 goto bad_access;
499 val = *(unsigned long *)addr;
500 val -= regs->ARM_r0;
501 if (val == 0) {
502 *(unsigned long *)addr = regs->ARM_r1;
503 regs->ARM_cpsr |= PSR_C_BIT;
504 }
505 spin_unlock(&mm->page_table_lock);
506 return val;
507
508 bad_access:
509 spin_unlock(&mm->page_table_lock);
510 /* simulate a read access fault */
511 do_DataAbort(addr, 15 + (1 << 11), regs);
512 return -1;
513 }
514#endif
515
467 default: 516 default:
468 /* Calls 9f00xx..9f07ff are defined to return -ENOSYS 517 /* Calls 9f00xx..9f07ff are defined to return -ENOSYS
469 if not implemented, rather than raising SIGILL. This 518 if not implemented, rather than raising SIGILL. This
diff --git a/arch/arm/lib/ashldi3.c b/arch/arm/lib/ashldi3.c
index 130f5a839669..b62875cfd8f8 100644
--- a/arch/arm/lib/ashldi3.c
+++ b/arch/arm/lib/ashldi3.c
@@ -31,31 +31,26 @@ Boston, MA 02111-1307, USA. */
31 31
32#include "gcclib.h" 32#include "gcclib.h"
33 33
34DItype 34s64 __ashldi3(s64 u, int b)
35__ashldi3 (DItype u, word_type b)
36{ 35{
37 DIunion w; 36 DIunion w;
38 word_type bm; 37 int bm;
39 DIunion uu; 38 DIunion uu;
40 39
41 if (b == 0) 40 if (b == 0)
42 return u; 41 return u;
43 42
44 uu.ll = u; 43 uu.ll = u;
45 44
46 bm = (sizeof (SItype) * BITS_PER_UNIT) - b; 45 bm = (sizeof(s32) * BITS_PER_UNIT) - b;
47 if (bm <= 0) 46 if (bm <= 0) {
48 { 47 w.s.low = 0;
49 w.s.low = 0; 48 w.s.high = (u32) uu.s.low << -bm;
50 w.s.high = (USItype)uu.s.low << -bm; 49 } else {
51 } 50 u32 carries = (u32) uu.s.low >> bm;
52 else 51 w.s.low = (u32) uu.s.low << b;
53 { 52 w.s.high = ((u32) uu.s.high << b) | carries;
54 USItype carries = (USItype)uu.s.low >> bm; 53 }
55 w.s.low = (USItype)uu.s.low << b; 54
56 w.s.high = ((USItype)uu.s.high << b) | carries; 55 return w.ll;
57 }
58
59 return w.ll;
60} 56}
61
diff --git a/arch/arm/lib/ashrdi3.c b/arch/arm/lib/ashrdi3.c
index 71625d218f8d..9a8600a7543f 100644
--- a/arch/arm/lib/ashrdi3.c
+++ b/arch/arm/lib/ashrdi3.c
@@ -31,31 +31,27 @@ Boston, MA 02111-1307, USA. */
31 31
32#include "gcclib.h" 32#include "gcclib.h"
33 33
34DItype 34s64 __ashrdi3(s64 u, int b)
35__ashrdi3 (DItype u, word_type b)
36{ 35{
37 DIunion w; 36 DIunion w;
38 word_type bm; 37 int bm;
39 DIunion uu; 38 DIunion uu;
40 39
41 if (b == 0) 40 if (b == 0)
42 return u; 41 return u;
43 42
44 uu.ll = u; 43 uu.ll = u;
45 44
46 bm = (sizeof (SItype) * BITS_PER_UNIT) - b; 45 bm = (sizeof(s32) * BITS_PER_UNIT) - b;
47 if (bm <= 0) 46 if (bm <= 0) {
48 { 47 /* w.s.high = 1..1 or 0..0 */
49 /* w.s.high = 1..1 or 0..0 */ 48 w.s.high = uu.s.high >> (sizeof(s32) * BITS_PER_UNIT - 1);
50 w.s.high = uu.s.high >> (sizeof (SItype) * BITS_PER_UNIT - 1); 49 w.s.low = uu.s.high >> -bm;
51 w.s.low = uu.s.high >> -bm; 50 } else {
52 } 51 u32 carries = (u32) uu.s.high << bm;
53 else 52 w.s.high = uu.s.high >> b;
54 { 53 w.s.low = ((u32) uu.s.low >> b) | carries;
55 USItype carries = (USItype)uu.s.high << bm; 54 }
56 w.s.high = uu.s.high >> b; 55
57 w.s.low = ((USItype)uu.s.low >> b) | carries; 56 return w.ll;
58 }
59
60 return w.ll;
61} 57}
diff --git a/arch/arm/lib/gcclib.h b/arch/arm/lib/gcclib.h
index 65314a3d9e27..8b6dcc656de7 100644
--- a/arch/arm/lib/gcclib.h
+++ b/arch/arm/lib/gcclib.h
@@ -1,25 +1,22 @@
1/* gcclib.h -- definitions for various functions 'borrowed' from gcc-2.95.3 */ 1/* gcclib.h -- definitions for various functions 'borrowed' from gcc-2.95.3 */
2/* I Molton 29/07/01 */ 2/* I Molton 29/07/01 */
3 3
4#define BITS_PER_UNIT 8 4#include <linux/types.h>
5#define SI_TYPE_SIZE (sizeof (SItype) * BITS_PER_UNIT)
6 5
7typedef unsigned int UQItype __attribute__ ((mode (QI))); 6#define BITS_PER_UNIT 8
8typedef int SItype __attribute__ ((mode (SI))); 7#define SI_TYPE_SIZE (sizeof(s32) * BITS_PER_UNIT)
9typedef unsigned int USItype __attribute__ ((mode (SI)));
10typedef int DItype __attribute__ ((mode (DI)));
11typedef int word_type __attribute__ ((mode (__word__)));
12typedef unsigned int UDItype __attribute__ ((mode (DI)));
13 8
14#ifdef __ARMEB__ 9#ifdef __ARMEB__
15 struct DIstruct {SItype high, low;}; 10struct DIstruct {
11 s32 high, low;
12};
16#else 13#else
17 struct DIstruct {SItype low, high;}; 14struct DIstruct {
15 s32 low, high;
16};
18#endif 17#endif
19 18
20typedef union 19typedef union {
21{ 20 struct DIstruct s;
22 struct DIstruct s; 21 s64 ll;
23 DItype ll;
24} DIunion; 22} DIunion;
25
diff --git a/arch/arm/lib/io-writesw-armv4.S b/arch/arm/lib/io-writesw-armv4.S
index 6d1d7c27806e..5e240e452af6 100644
--- a/arch/arm/lib/io-writesw-armv4.S
+++ b/arch/arm/lib/io-writesw-armv4.S
@@ -87,9 +87,9 @@ ENTRY(__raw_writesw)
87 subs r2, r2, #2 87 subs r2, r2, #2
88 orr ip, ip, r3, push_hbyte1 88 orr ip, ip, r3, push_hbyte1
89 strh ip, [r0] 89 strh ip, [r0]
90 bpl 2b 90 bpl 1b
91 91
923: tst r2, #1 92 tst r2, #1
932: movne ip, r3, lsr #8 933: movne ip, r3, lsr #8
94 strneh ip, [r0] 94 strneh ip, [r0]
95 mov pc, lr 95 mov pc, lr
diff --git a/arch/arm/lib/longlong.h b/arch/arm/lib/longlong.h
index 179eea4edc35..90ae647e4d76 100644
--- a/arch/arm/lib/longlong.h
+++ b/arch/arm/lib/longlong.h
@@ -26,18 +26,18 @@
26 26
27#define __BITS4 (SI_TYPE_SIZE / 4) 27#define __BITS4 (SI_TYPE_SIZE / 4)
28#define __ll_B (1L << (SI_TYPE_SIZE / 2)) 28#define __ll_B (1L << (SI_TYPE_SIZE / 2))
29#define __ll_lowpart(t) ((USItype) (t) % __ll_B) 29#define __ll_lowpart(t) ((u32) (t) % __ll_B)
30#define __ll_highpart(t) ((USItype) (t) / __ll_B) 30#define __ll_highpart(t) ((u32) (t) / __ll_B)
31 31
32/* Define auxiliary asm macros. 32/* Define auxiliary asm macros.
33 33
34 1) umul_ppmm(high_prod, low_prod, multipler, multiplicand) 34 1) umul_ppmm(high_prod, low_prod, multipler, multiplicand)
35 multiplies two USItype integers MULTIPLER and MULTIPLICAND, 35 multiplies two u32 integers MULTIPLER and MULTIPLICAND,
36 and generates a two-part USItype product in HIGH_PROD and 36 and generates a two-part u32 product in HIGH_PROD and
37 LOW_PROD. 37 LOW_PROD.
38 38
39 2) __umulsidi3(a,b) multiplies two USItype integers A and B, 39 2) __umulsidi3(a,b) multiplies two u32 integers A and B,
40 and returns a UDItype product. This is just a variant of umul_ppmm. 40 and returns a u64 product. This is just a variant of umul_ppmm.
41 41
42 3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator, 42 3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
43 denominator) divides a two-word unsigned integer, composed by the 43 denominator) divides a two-word unsigned integer, composed by the
@@ -77,23 +77,23 @@
77#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 77#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
78 __asm__ ("adds %1, %4, %5 \n\ 78 __asm__ ("adds %1, %4, %5 \n\
79 adc %0, %2, %3" \ 79 adc %0, %2, %3" \
80 : "=r" ((USItype) (sh)), \ 80 : "=r" ((u32) (sh)), \
81 "=&r" ((USItype) (sl)) \ 81 "=&r" ((u32) (sl)) \
82 : "%r" ((USItype) (ah)), \ 82 : "%r" ((u32) (ah)), \
83 "rI" ((USItype) (bh)), \ 83 "rI" ((u32) (bh)), \
84 "%r" ((USItype) (al)), \ 84 "%r" ((u32) (al)), \
85 "rI" ((USItype) (bl))) 85 "rI" ((u32) (bl)))
86#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 86#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
87 __asm__ ("subs %1, %4, %5 \n\ 87 __asm__ ("subs %1, %4, %5 \n\
88 sbc %0, %2, %3" \ 88 sbc %0, %2, %3" \
89 : "=r" ((USItype) (sh)), \ 89 : "=r" ((u32) (sh)), \
90 "=&r" ((USItype) (sl)) \ 90 "=&r" ((u32) (sl)) \
91 : "r" ((USItype) (ah)), \ 91 : "r" ((u32) (ah)), \
92 "rI" ((USItype) (bh)), \ 92 "rI" ((u32) (bh)), \
93 "r" ((USItype) (al)), \ 93 "r" ((u32) (al)), \
94 "rI" ((USItype) (bl))) 94 "rI" ((u32) (bl)))
95#define umul_ppmm(xh, xl, a, b) \ 95#define umul_ppmm(xh, xl, a, b) \
96{register USItype __t0, __t1, __t2; \ 96{register u32 __t0, __t1, __t2; \
97 __asm__ ("%@ Inlined umul_ppmm \n\ 97 __asm__ ("%@ Inlined umul_ppmm \n\
98 mov %2, %5, lsr #16 \n\ 98 mov %2, %5, lsr #16 \n\
99 mov %0, %6, lsr #16 \n\ 99 mov %0, %6, lsr #16 \n\
@@ -107,14 +107,14 @@
107 addcs %0, %0, #65536 \n\ 107 addcs %0, %0, #65536 \n\
108 adds %1, %1, %3, lsl #16 \n\ 108 adds %1, %1, %3, lsl #16 \n\
109 adc %0, %0, %3, lsr #16" \ 109 adc %0, %0, %3, lsr #16" \
110 : "=&r" ((USItype) (xh)), \ 110 : "=&r" ((u32) (xh)), \
111 "=r" ((USItype) (xl)), \ 111 "=r" ((u32) (xl)), \
112 "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \ 112 "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \
113 : "r" ((USItype) (a)), \ 113 : "r" ((u32) (a)), \
114 "r" ((USItype) (b)));} 114 "r" ((u32) (b)));}
115#define UMUL_TIME 20 115#define UMUL_TIME 20
116#define UDIV_TIME 100 116#define UDIV_TIME 100
117#endif /* __arm__ */ 117#endif /* __arm__ */
118 118
119#define __umulsidi3(u, v) \ 119#define __umulsidi3(u, v) \
120 ({DIunion __w; \ 120 ({DIunion __w; \
@@ -123,14 +123,14 @@
123 123
124#define __udiv_qrnnd_c(q, r, n1, n0, d) \ 124#define __udiv_qrnnd_c(q, r, n1, n0, d) \
125 do { \ 125 do { \
126 USItype __d1, __d0, __q1, __q0; \ 126 u32 __d1, __d0, __q1, __q0; \
127 USItype __r1, __r0, __m; \ 127 u32 __r1, __r0, __m; \
128 __d1 = __ll_highpart (d); \ 128 __d1 = __ll_highpart (d); \
129 __d0 = __ll_lowpart (d); \ 129 __d0 = __ll_lowpart (d); \
130 \ 130 \
131 __r1 = (n1) % __d1; \ 131 __r1 = (n1) % __d1; \
132 __q1 = (n1) / __d1; \ 132 __q1 = (n1) / __d1; \
133 __m = (USItype) __q1 * __d0; \ 133 __m = (u32) __q1 * __d0; \
134 __r1 = __r1 * __ll_B | __ll_highpart (n0); \ 134 __r1 = __r1 * __ll_B | __ll_highpart (n0); \
135 if (__r1 < __m) \ 135 if (__r1 < __m) \
136 { \ 136 { \
@@ -143,7 +143,7 @@
143 \ 143 \
144 __r0 = __r1 % __d1; \ 144 __r0 = __r1 % __d1; \
145 __q0 = __r1 / __d1; \ 145 __q0 = __r1 / __d1; \
146 __m = (USItype) __q0 * __d0; \ 146 __m = (u32) __q0 * __d0; \
147 __r0 = __r0 * __ll_B | __ll_lowpart (n0); \ 147 __r0 = __r0 * __ll_B | __ll_lowpart (n0); \
148 if (__r0 < __m) \ 148 if (__r0 < __m) \
149 { \ 149 { \
@@ -154,7 +154,7 @@
154 } \ 154 } \
155 __r0 -= __m; \ 155 __r0 -= __m; \
156 \ 156 \
157 (q) = (USItype) __q1 * __ll_B | __q0; \ 157 (q) = (u32) __q1 * __ll_B | __q0; \
158 (r) = __r0; \ 158 (r) = __r0; \
159 } while (0) 159 } while (0)
160 160
@@ -163,14 +163,14 @@
163 163
164#define count_leading_zeros(count, x) \ 164#define count_leading_zeros(count, x) \
165 do { \ 165 do { \
166 USItype __xr = (x); \ 166 u32 __xr = (x); \
167 USItype __a; \ 167 u32 __a; \
168 \ 168 \
169 if (SI_TYPE_SIZE <= 32) \ 169 if (SI_TYPE_SIZE <= 32) \
170 { \ 170 { \
171 __a = __xr < ((USItype)1<<2*__BITS4) \ 171 __a = __xr < ((u32)1<<2*__BITS4) \
172 ? (__xr < ((USItype)1<<__BITS4) ? 0 : __BITS4) \ 172 ? (__xr < ((u32)1<<__BITS4) ? 0 : __BITS4) \
173 : (__xr < ((USItype)1<<3*__BITS4) ? 2*__BITS4 : 3*__BITS4); \ 173 : (__xr < ((u32)1<<3*__BITS4) ? 2*__BITS4 : 3*__BITS4); \
174 } \ 174 } \
175 else \ 175 else \
176 { \ 176 { \
diff --git a/arch/arm/lib/lshrdi3.c b/arch/arm/lib/lshrdi3.c
index b666f1bad451..3681f49d2b6e 100644
--- a/arch/arm/lib/lshrdi3.c
+++ b/arch/arm/lib/lshrdi3.c
@@ -31,31 +31,26 @@ Boston, MA 02111-1307, USA. */
31 31
32#include "gcclib.h" 32#include "gcclib.h"
33 33
34DItype 34s64 __lshrdi3(s64 u, int b)
35__lshrdi3 (DItype u, word_type b)
36{ 35{
37 DIunion w; 36 DIunion w;
38 word_type bm; 37 int bm;
39 DIunion uu; 38 DIunion uu;
40 39
41 if (b == 0) 40 if (b == 0)
42 return u; 41 return u;
43 42
44 uu.ll = u; 43 uu.ll = u;
45 44
46 bm = (sizeof (SItype) * BITS_PER_UNIT) - b; 45 bm = (sizeof(s32) * BITS_PER_UNIT) - b;
47 if (bm <= 0) 46 if (bm <= 0) {
48 { 47 w.s.high = 0;
49 w.s.high = 0; 48 w.s.low = (u32) uu.s.high >> -bm;
50 w.s.low = (USItype)uu.s.high >> -bm; 49 } else {
51 } 50 u32 carries = (u32) uu.s.high << bm;
52 else 51 w.s.high = (u32) uu.s.high >> b;
53 { 52 w.s.low = ((u32) uu.s.low >> b) | carries;
54 USItype carries = (USItype)uu.s.high << bm; 53 }
55 w.s.high = (USItype)uu.s.high >> b; 54
56 w.s.low = ((USItype)uu.s.low >> b) | carries; 55 return w.ll;
57 }
58
59 return w.ll;
60} 56}
61
diff --git a/arch/arm/lib/muldi3.c b/arch/arm/lib/muldi3.c
index 44d611b1cfdb..0a3b93313f18 100644
--- a/arch/arm/lib/muldi3.c
+++ b/arch/arm/lib/muldi3.c
@@ -32,7 +32,7 @@ Boston, MA 02111-1307, USA. */
32#include "gcclib.h" 32#include "gcclib.h"
33 33
34#define umul_ppmm(xh, xl, a, b) \ 34#define umul_ppmm(xh, xl, a, b) \
35{register USItype __t0, __t1, __t2; \ 35{register u32 __t0, __t1, __t2; \
36 __asm__ ("%@ Inlined umul_ppmm \n\ 36 __asm__ ("%@ Inlined umul_ppmm \n\
37 mov %2, %5, lsr #16 \n\ 37 mov %2, %5, lsr #16 \n\
38 mov %0, %6, lsr #16 \n\ 38 mov %0, %6, lsr #16 \n\
@@ -46,32 +46,27 @@ Boston, MA 02111-1307, USA. */
46 addcs %0, %0, #65536 \n\ 46 addcs %0, %0, #65536 \n\
47 adds %1, %1, %3, lsl #16 \n\ 47 adds %1, %1, %3, lsl #16 \n\
48 adc %0, %0, %3, lsr #16" \ 48 adc %0, %0, %3, lsr #16" \
49 : "=&r" ((USItype) (xh)), \ 49 : "=&r" ((u32) (xh)), \
50 "=r" ((USItype) (xl)), \ 50 "=r" ((u32) (xl)), \
51 "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \ 51 "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \
52 : "r" ((USItype) (a)), \ 52 : "r" ((u32) (a)), \
53 "r" ((USItype) (b)));} 53 "r" ((u32) (b)));}
54
55 54
56#define __umulsidi3(u, v) \ 55#define __umulsidi3(u, v) \
57 ({DIunion __w; \ 56 ({DIunion __w; \
58 umul_ppmm (__w.s.high, __w.s.low, u, v); \ 57 umul_ppmm (__w.s.high, __w.s.low, u, v); \
59 __w.ll; }) 58 __w.ll; })
60 59
61 60s64 __muldi3(s64 u, s64 v)
62DItype
63__muldi3 (DItype u, DItype v)
64{ 61{
65 DIunion w; 62 DIunion w;
66 DIunion uu, vv; 63 DIunion uu, vv;
67 64
68 uu.ll = u, 65 uu.ll = u, vv.ll = v;
69 vv.ll = v;
70 66
71 w.ll = __umulsidi3 (uu.s.low, vv.s.low); 67 w.ll = __umulsidi3(uu.s.low, vv.s.low);
72 w.s.high += ((USItype) uu.s.low * (USItype) vv.s.high 68 w.s.high += ((u32) uu.s.low * (u32) vv.s.high
73 + (USItype) uu.s.high * (USItype) vv.s.low); 69 + (u32) uu.s.high * (u32) vv.s.low);
74 70
75 return w.ll; 71 return w.ll;
76} 72}
77
diff --git a/arch/arm/lib/ucmpdi2.c b/arch/arm/lib/ucmpdi2.c
index 6c6ae63efa02..57f3f2df3850 100644
--- a/arch/arm/lib/ucmpdi2.c
+++ b/arch/arm/lib/ucmpdi2.c
@@ -31,21 +31,19 @@ Boston, MA 02111-1307, USA. */
31 31
32#include "gcclib.h" 32#include "gcclib.h"
33 33
34word_type 34int __ucmpdi2(s64 a, s64 b)
35__ucmpdi2 (DItype a, DItype b)
36{ 35{
37 DIunion au, bu; 36 DIunion au, bu;
38 37
39 au.ll = a, bu.ll = b; 38 au.ll = a, bu.ll = b;
40 39
41 if ((USItype) au.s.high < (USItype) bu.s.high) 40 if ((u32) au.s.high < (u32) bu.s.high)
42 return 0; 41 return 0;
43 else if ((USItype) au.s.high > (USItype) bu.s.high) 42 else if ((u32) au.s.high > (u32) bu.s.high)
44 return 2; 43 return 2;
45 if ((USItype) au.s.low < (USItype) bu.s.low) 44 if ((u32) au.s.low < (u32) bu.s.low)
46 return 0; 45 return 0;
47 else if ((USItype) au.s.low > (USItype) bu.s.low) 46 else if ((u32) au.s.low > (u32) bu.s.low)
48 return 2; 47 return 2;
49 return 1; 48 return 1;
50} 49}
51
diff --git a/arch/arm/lib/udivdi3.c b/arch/arm/lib/udivdi3.c
index d25195f673f4..e343be4c6642 100644
--- a/arch/arm/lib/udivdi3.c
+++ b/arch/arm/lib/udivdi3.c
@@ -32,211 +32,191 @@ Boston, MA 02111-1307, USA. */
32#include "gcclib.h" 32#include "gcclib.h"
33#include "longlong.h" 33#include "longlong.h"
34 34
35static const UQItype __clz_tab[] = 35static const u8 __clz_tab[] = {
36{ 36 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5,
37 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, 37 5, 5, 5, 5, 5, 5, 5, 5,
38 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, 38 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
39 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 39 6, 6, 6, 6, 6, 6, 6, 6,
40 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 40 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
41 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 41 7, 7, 7, 7, 7, 7, 7, 7,
42 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 42 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
43 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 43 7, 7, 7, 7, 7, 7, 7, 7,
44 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 44 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
45 8, 8, 8, 8, 8, 8, 8, 8,
46 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
47 8, 8, 8, 8, 8, 8, 8, 8,
48 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
49 8, 8, 8, 8, 8, 8, 8, 8,
50 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
51 8, 8, 8, 8, 8, 8, 8, 8,
45}; 52};
46 53
47UDItype 54u64 __udivmoddi4(u64 n, u64 d, u64 * rp)
48__udivmoddi4 (UDItype n, UDItype d, UDItype *rp)
49{ 55{
50 DIunion ww; 56 DIunion ww;
51 DIunion nn, dd; 57 DIunion nn, dd;
52 DIunion rr; 58 DIunion rr;
53 USItype d0, d1, n0, n1, n2; 59 u32 d0, d1, n0, n1, n2;
54 USItype q0, q1; 60 u32 q0, q1;
55 USItype b, bm; 61 u32 b, bm;
56 62
57 nn.ll = n; 63 nn.ll = n;
58 dd.ll = d; 64 dd.ll = d;
59 65
60 d0 = dd.s.low; 66 d0 = dd.s.low;
61 d1 = dd.s.high; 67 d1 = dd.s.high;
62 n0 = nn.s.low; 68 n0 = nn.s.low;
63 n1 = nn.s.high; 69 n1 = nn.s.high;
64 70
65 if (d1 == 0) 71 if (d1 == 0) {
66 { 72 if (d0 > n1) {
67 if (d0 > n1) 73 /* 0q = nn / 0D */
68 { 74
69 /* 0q = nn / 0D */ 75 count_leading_zeros(bm, d0);
70 76
71 count_leading_zeros (bm, d0); 77 if (bm != 0) {
72 78 /* Normalize, i.e. make the most significant bit of the
73 if (bm != 0) 79 denominator set. */
74 { 80
75 /* Normalize, i.e. make the most significant bit of the 81 d0 = d0 << bm;
76 denominator set. */ 82 n1 = (n1 << bm) | (n0 >> (SI_TYPE_SIZE - bm));
77 83 n0 = n0 << bm;
78 d0 = d0 << bm; 84 }
79 n1 = (n1 << bm) | (n0 >> (SI_TYPE_SIZE - bm)); 85
80 n0 = n0 << bm; 86 udiv_qrnnd(q0, n0, n1, n0, d0);
81 } 87 q1 = 0;
82 88
83 udiv_qrnnd (q0, n0, n1, n0, d0); 89 /* Remainder in n0 >> bm. */
84 q1 = 0; 90 } else {
85 91 /* qq = NN / 0d */
86 /* Remainder in n0 >> bm. */ 92
87 } 93 if (d0 == 0)
88 else 94 d0 = 1 / d0; /* Divide intentionally by zero. */
89 { 95
90 /* qq = NN / 0d */ 96 count_leading_zeros(bm, d0);
91 97
92 if (d0 == 0) 98 if (bm == 0) {
93 d0 = 1 / d0; /* Divide intentionally by zero. */ 99 /* From (n1 >= d0) /\ (the most significant bit of d0 is set),
94 100 conclude (the most significant bit of n1 is set) /\ (the
95 count_leading_zeros (bm, d0); 101 leading quotient digit q1 = 1).
96 102
97 if (bm == 0) 103 This special case is necessary, not an optimization.
98 { 104 (Shifts counts of SI_TYPE_SIZE are undefined.) */
99 /* From (n1 >= d0) /\ (the most significant bit of d0 is set), 105
100 conclude (the most significant bit of n1 is set) /\ (the 106 n1 -= d0;
101 leading quotient digit q1 = 1). 107 q1 = 1;
102 108 } else {
103 This special case is necessary, not an optimization. 109 /* Normalize. */
104 (Shifts counts of SI_TYPE_SIZE are undefined.) */ 110
105 111 b = SI_TYPE_SIZE - bm;
106 n1 -= d0; 112
107 q1 = 1; 113 d0 = d0 << bm;
108 } 114 n2 = n1 >> b;
109 else 115 n1 = (n1 << bm) | (n0 >> b);
110 { 116 n0 = n0 << bm;
111 /* Normalize. */ 117
112 118 udiv_qrnnd(q1, n1, n2, n1, d0);
113 b = SI_TYPE_SIZE - bm; 119 }
114 120
115 d0 = d0 << bm; 121 /* n1 != d0... */
116 n2 = n1 >> b; 122
117 n1 = (n1 << bm) | (n0 >> b); 123 udiv_qrnnd(q0, n0, n1, n0, d0);
118 n0 = n0 << bm; 124
119 125 /* Remainder in n0 >> bm. */
120 udiv_qrnnd (q1, n1, n2, n1, d0); 126 }
121 } 127
122 128 if (rp != 0) {
123 /* n1 != d0... */ 129 rr.s.low = n0 >> bm;
124 130 rr.s.high = 0;
125 udiv_qrnnd (q0, n0, n1, n0, d0); 131 *rp = rr.ll;
126 132 }
127 /* Remainder in n0 >> bm. */ 133 } else {
128 } 134 if (d1 > n1) {
129 135 /* 00 = nn / DD */
130 if (rp != 0) 136
131 { 137 q0 = 0;
132 rr.s.low = n0 >> bm; 138 q1 = 0;
133 rr.s.high = 0; 139
134 *rp = rr.ll; 140 /* Remainder in n1n0. */
135 } 141 if (rp != 0) {
136 } 142 rr.s.low = n0;
137 else 143 rr.s.high = n1;
138 { 144 *rp = rr.ll;
139 if (d1 > n1) 145 }
140 { 146 } else {
141 /* 00 = nn / DD */ 147 /* 0q = NN / dd */
142 148
143 q0 = 0; 149 count_leading_zeros(bm, d1);
144 q1 = 0; 150 if (bm == 0) {
145 151 /* From (n1 >= d1) /\ (the most significant bit of d1 is set),
146 /* Remainder in n1n0. */ 152 conclude (the most significant bit of n1 is set) /\ (the
147 if (rp != 0) 153 quotient digit q0 = 0 or 1).
148 { 154
149 rr.s.low = n0; 155 This special case is necessary, not an optimization. */
150 rr.s.high = n1; 156
151 *rp = rr.ll; 157 /* The condition on the next line takes advantage of that
152 } 158 n1 >= d1 (true due to program flow). */
153 } 159 if (n1 > d1 || n0 >= d0) {
154 else 160 q0 = 1;
155 { 161 sub_ddmmss(n1, n0, n1, n0, d1, d0);
156 /* 0q = NN / dd */ 162 } else
157 163 q0 = 0;
158 count_leading_zeros (bm, d1); 164
159 if (bm == 0) 165 q1 = 0;
160 { 166
161 /* From (n1 >= d1) /\ (the most significant bit of d1 is set), 167 if (rp != 0) {
162 conclude (the most significant bit of n1 is set) /\ (the 168 rr.s.low = n0;
163 quotient digit q0 = 0 or 1). 169 rr.s.high = n1;
164 170 *rp = rr.ll;
165 This special case is necessary, not an optimization. */ 171 }
166 172 } else {
167 /* The condition on the next line takes advantage of that 173 u32 m1, m0;
168 n1 >= d1 (true due to program flow). */ 174 /* Normalize. */
169 if (n1 > d1 || n0 >= d0) 175
170 { 176 b = SI_TYPE_SIZE - bm;
171 q0 = 1; 177
172 sub_ddmmss (n1, n0, n1, n0, d1, d0); 178 d1 = (d1 << bm) | (d0 >> b);
173 } 179 d0 = d0 << bm;
174 else 180 n2 = n1 >> b;
175 q0 = 0; 181 n1 = (n1 << bm) | (n0 >> b);
176 182 n0 = n0 << bm;
177 q1 = 0; 183
178 184 udiv_qrnnd(q0, n1, n2, n1, d1);
179 if (rp != 0) 185 umul_ppmm(m1, m0, q0, d0);
180 { 186
181 rr.s.low = n0; 187 if (m1 > n1 || (m1 == n1 && m0 > n0)) {
182 rr.s.high = n1; 188 q0--;
183 *rp = rr.ll; 189 sub_ddmmss(m1, m0, m1, m0, d1, d0);
184 } 190 }
185 } 191
186 else 192 q1 = 0;
187 { 193
188 USItype m1, m0; 194 /* Remainder in (n1n0 - m1m0) >> bm. */
189 /* Normalize. */ 195 if (rp != 0) {
190 196 sub_ddmmss(n1, n0, n1, n0, m1, m0);
191 b = SI_TYPE_SIZE - bm; 197 rr.s.low = (n1 << b) | (n0 >> bm);
192 198 rr.s.high = n1 >> bm;
193 d1 = (d1 << bm) | (d0 >> b); 199 *rp = rr.ll;
194 d0 = d0 << bm; 200 }
195 n2 = n1 >> b; 201 }
196 n1 = (n1 << bm) | (n0 >> b); 202 }
197 n0 = n0 << bm; 203 }
198 204
199 udiv_qrnnd (q0, n1, n2, n1, d1); 205 ww.s.low = q0;
200 umul_ppmm (m1, m0, q0, d0); 206 ww.s.high = q1;
201 207 return ww.ll;
202 if (m1 > n1 || (m1 == n1 && m0 > n0))
203 {
204 q0--;
205 sub_ddmmss (m1, m0, m1, m0, d1, d0);
206 }
207
208 q1 = 0;
209
210 /* Remainder in (n1n0 - m1m0) >> bm. */
211 if (rp != 0)
212 {
213 sub_ddmmss (n1, n0, n1, n0, m1, m0);
214 rr.s.low = (n1 << b) | (n0 >> bm);
215 rr.s.high = n1 >> bm;
216 *rp = rr.ll;
217 }
218 }
219 }
220 }
221
222 ww.s.low = q0;
223 ww.s.high = q1;
224 return ww.ll;
225} 208}
226 209
227UDItype 210u64 __udivdi3(u64 n, u64 d)
228__udivdi3 (UDItype n, UDItype d)
229{ 211{
230 return __udivmoddi4 (n, d, (UDItype *) 0); 212 return __udivmoddi4(n, d, (u64 *) 0);
231} 213}
232 214
233UDItype 215u64 __umoddi3(u64 u, u64 v)
234__umoddi3 (UDItype u, UDItype v)
235{ 216{
236 UDItype w; 217 u64 w;
237 218
238 (void) __udivmoddi4 (u ,v, &w); 219 (void)__udivmoddi4(u, v, &w);
239 220
240 return w; 221 return w;
241} 222}
242
diff --git a/arch/arm/mach-aaec2000/Kconfig b/arch/arm/mach-aaec2000/Kconfig
new file mode 100644
index 000000000000..5e4bef93754c
--- /dev/null
+++ b/arch/arm/mach-aaec2000/Kconfig
@@ -0,0 +1,11 @@
1if ARCH_AAEC2000
2
3menu "Agilent AAEC-2000 Implementations"
4
5config MACH_AAED2000
6 bool "Agilent AAED-2000 Development Platform"
7 select CPU_ARM920T
8
9endmenu
10
11endif
diff --git a/arch/arm/mach-aaec2000/Makefile b/arch/arm/mach-aaec2000/Makefile
new file mode 100644
index 000000000000..20ec83896c37
--- /dev/null
+++ b/arch/arm/mach-aaec2000/Makefile
@@ -0,0 +1,9 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Common support (must be linked before board specific support)
6obj-y += core.o
7
8# Specific board support
9obj-$(CONFIG_MACH_AAED2000) += aaed2000.o
diff --git a/arch/arm/mach-aaec2000/aaed2000.c b/arch/arm/mach-aaec2000/aaed2000.c
new file mode 100644
index 000000000000..5417ca3f4621
--- /dev/null
+++ b/arch/arm/mach-aaec2000/aaed2000.c
@@ -0,0 +1,48 @@
1/*
2 * linux/arch/arm/mach-aaec2000/aaed2000.c
3 *
4 * Support for the Agilent AAED-2000 Development Platform.
5 *
6 * Copyright (c) 2005 Nicolas Bellido Y Ortega
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/device.h>
17#include <linux/major.h>
18#include <linux/interrupt.h>
19
20#include <asm/setup.h>
21#include <asm/memory.h>
22#include <asm/mach-types.h>
23#include <asm/hardware.h>
24#include <asm/irq.h>
25
26#include <asm/mach/arch.h>
27#include <asm/mach/map.h>
28#include <asm/mach/irq.h>
29
30#include "core.h"
31
32static void __init aaed2000_init_irq(void)
33{
34 aaec2000_init_irq();
35}
36
37static void __init aaed2000_map_io(void)
38{
39 aaec2000_map_io();
40}
41
42MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform")
43 MAINTAINER("Nicolas Bellido Y Ortega")
44 BOOT_MEM(0xf0000000, PIO_BASE, VIO_BASE)
45 MAPIO(aaed2000_map_io)
46 INITIRQ(aaed2000_init_irq)
47 .timer = &aaec2000_timer,
48MACHINE_END
diff --git a/arch/arm/mach-aaec2000/core.c b/arch/arm/mach-aaec2000/core.c
new file mode 100644
index 000000000000..fc145b3768fa
--- /dev/null
+++ b/arch/arm/mach-aaec2000/core.c
@@ -0,0 +1,157 @@
1/*
2 * linux/arch/arm/mach-aaec2000/core.c
3 *
4 * Code common to all AAEC-2000 machines
5 *
6 * Copyright (c) 2005 Nicolas Bellido Y Ortega
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/config.h>
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/list.h>
17#include <linux/errno.h>
18#include <linux/interrupt.h>
19#include <linux/timex.h>
20#include <linux/signal.h>
21
22#include <asm/hardware.h>
23#include <asm/irq.h>
24
25#include <asm/mach/irq.h>
26#include <asm/mach/time.h>
27#include <asm/mach/map.h>
28
29/*
30 * Common I/O mapping:
31 *
32 * Static virtual address mappings are as follow:
33 *
34 * 0xf8000000-0xf8001ffff: Devices connected to APB bus
35 * 0xf8002000-0xf8003ffff: Devices connected to AHB bus
36 *
37 * Below 0xe8000000 is reserved for vm allocation.
38 *
39 * The machine specific code must provide the extra mapping beside the
40 * default mapping provided here.
41 */
42static struct map_desc standard_io_desc[] __initdata = {
43 /* virtual physical length type */
44 { VIO_APB_BASE, PIO_APB_BASE, IO_APB_LENGTH, MT_DEVICE },
45 { VIO_AHB_BASE, PIO_AHB_BASE, IO_AHB_LENGTH, MT_DEVICE }
46};
47
48void __init aaec2000_map_io(void)
49{
50 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
51}
52
53/*
54 * Interrupt handling routines
55 */
56static void aaec2000_int_ack(unsigned int irq)
57{
58 IRQ_INTSR = 1 << irq;
59}
60
61static void aaec2000_int_mask(unsigned int irq)
62{
63 IRQ_INTENC |= (1 << irq);
64}
65
66static void aaec2000_int_unmask(unsigned int irq)
67{
68 IRQ_INTENS |= (1 << irq);
69}
70
71static struct irqchip aaec2000_irq_chip = {
72 .ack = aaec2000_int_ack,
73 .mask = aaec2000_int_mask,
74 .unmask = aaec2000_int_unmask,
75};
76
77void __init aaec2000_init_irq(void)
78{
79 unsigned int i;
80
81 for (i = 0; i < NR_IRQS; i++) {
82 set_irq_handler(i, do_level_IRQ);
83 set_irq_chip(i, &aaec2000_irq_chip);
84 set_irq_flags(i, IRQF_VALID);
85 }
86
87 /* Disable all interrupts */
88 IRQ_INTENC = 0xffffffff;
89
90 /* Clear any pending interrupts */
91 IRQ_INTSR = IRQ_INTSR;
92}
93
94/*
95 * Time keeping
96 */
97/* IRQs are disabled before entering here from do_gettimeofday() */
98static unsigned long aaec2000_gettimeoffset(void)
99{
100 unsigned long ticks_to_match, elapsed, usec;
101
102 /* Get ticks before next timer match */
103 ticks_to_match = TIMER1_LOAD - TIMER1_VAL;
104
105 /* We need elapsed ticks since last match */
106 elapsed = LATCH - ticks_to_match;
107
108 /* Now, convert them to usec */
109 usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH;
110
111 return usec;
112}
113
114/* We enter here with IRQs enabled */
115static irqreturn_t
116aaec2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
117{
118 /* TODO: Check timer accuracy */
119 write_seqlock(&xtime_lock);
120
121 timer_tick(regs);
122 TIMER1_CLEAR = 1;
123
124 write_sequnlock(&xtime_lock);
125
126 return IRQ_HANDLED;
127}
128
129static struct irqaction aaec2000_timer_irq = {
130 .name = "AAEC-2000 Timer Tick",
131 .flags = SA_INTERRUPT,
132 .handler = aaec2000_timer_interrupt
133};
134
135static void __init aaec2000_timer_init(void)
136{
137 /* Disable timer 1 */
138 TIMER1_CTRL = 0;
139
140 /* We have somehow to generate a 100Hz clock.
141 * We then use the 508KHz timer in periodic mode.
142 */
143 TIMER1_LOAD = LATCH;
144 TIMER1_CLEAR = 1; /* Clear interrupt */
145
146 setup_irq(INT_TMR1_OFL, &aaec2000_timer_irq);
147
148 TIMER1_CTRL = TIMER_CTRL_ENABLE |
149 TIMER_CTRL_PERIODIC |
150 TIMER_CTRL_CLKSEL_508K;
151}
152
153struct sys_timer aaec2000_timer = {
154 .init = aaec2000_timer_init,
155 .offset = aaec2000_gettimeoffset,
156};
157
diff --git a/arch/arm/mach-aaec2000/core.h b/arch/arm/mach-aaec2000/core.h
new file mode 100644
index 000000000000..91893d848c16
--- /dev/null
+++ b/arch/arm/mach-aaec2000/core.h
@@ -0,0 +1,16 @@
1/*
2 * linux/arch/arm/mach-aaec2000/core.h
3 *
4 * Copyright (c) 2005 Nicolas Bellido Y Ortega
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12struct sys_timer;
13
14extern struct sys_timer aaec2000_timer;
15extern void __init aaec2000_map_io(void);
16extern void __init aaec2000_init_irq(void);
diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile
index 158daaf9e3b0..ebb255bdce8a 100644
--- a/arch/arm/mach-integrator/Makefile
+++ b/arch/arm/mach-integrator/Makefile
@@ -12,3 +12,4 @@ obj-$(CONFIG_LEDS) += leds.o
12obj-$(CONFIG_PCI) += pci_v3.o pci.o 12obj-$(CONFIG_PCI) += pci_v3.o pci.o
13obj-$(CONFIG_CPU_FREQ_INTEGRATOR) += cpu.o 13obj-$(CONFIG_CPU_FREQ_INTEGRATOR) += cpu.o
14obj-$(CONFIG_INTEGRATOR_IMPD1) += impd1.o 14obj-$(CONFIG_INTEGRATOR_IMPD1) += impd1.o
15obj-$(CONFIG_SMP) += platsmp.o headsmp.o
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index bd17b5154311..bd1e5e3c9d34 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -14,6 +14,7 @@
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/smp.h>
17 18
18#include <asm/hardware.h> 19#include <asm/hardware.h>
19#include <asm/irq.h> 20#include <asm/irq.h>
@@ -221,7 +222,23 @@ integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
221 */ 222 */
222 timer1->TimerClear = 1; 223 timer1->TimerClear = 1;
223 224
224 timer_tick(regs); 225 /*
226 * the clock tick routines are only processed on the
227 * primary CPU
228 */
229 if (hard_smp_processor_id() == 0) {
230 timer_tick(regs);
231#ifdef CONFIG_SMP
232 smp_send_timer();
233#endif
234 }
235
236#ifdef CONFIG_SMP
237 /*
238 * this is the ARM equivalent of the APIC timer interrupt
239 */
240 update_process_times(user_mode(regs));
241#endif /* CONFIG_SMP */
225 242
226 write_sequnlock(&xtime_lock); 243 write_sequnlock(&xtime_lock);
227 244
diff --git a/arch/arm/mach-integrator/headsmp.S b/arch/arm/mach-integrator/headsmp.S
new file mode 100644
index 000000000000..ceaa88e30d70
--- /dev/null
+++ b/arch/arm/mach-integrator/headsmp.S
@@ -0,0 +1,37 @@
1/*
2 * linux/arch/arm/mach-integrator/headsmp.S
3 *
4 * Copyright (c) 2003 ARM Limited
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/linkage.h>
12#include <linux/init.h>
13
14 __INIT
15
16/*
17 * Integrator specific entry point for secondary CPUs. This provides
18 * a "holding pen" into which all secondary cores are held until we're
19 * ready for them to initialise.
20 */
21ENTRY(integrator_secondary_startup)
22 adr r4, 1f
23 ldmia r4, {r5, r6}
24 sub r4, r4, r5
25 ldr r6, [r6, r4]
26pen: ldr r7, [r6]
27 cmp r7, r0
28 bne pen
29
30 /*
31 * we've been released from the holding pen: secondary_stack
32 * should now contain the SVC stack for this core
33 */
34 b secondary_startup
35
361: .long .
37 .long phys_pen_release
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 3b948e8c2751..e0a01eef0993 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -83,7 +83,6 @@ static struct map_desc intcp_io_desc[] __initdata = {
83 { IO_ADDRESS(INTEGRATOR_UART1_BASE), INTEGRATOR_UART1_BASE, SZ_4K, MT_DEVICE }, 83 { IO_ADDRESS(INTEGRATOR_UART1_BASE), INTEGRATOR_UART1_BASE, SZ_4K, MT_DEVICE },
84 { IO_ADDRESS(INTEGRATOR_DBG_BASE), INTEGRATOR_DBG_BASE, SZ_4K, MT_DEVICE }, 84 { IO_ADDRESS(INTEGRATOR_DBG_BASE), INTEGRATOR_DBG_BASE, SZ_4K, MT_DEVICE },
85 { IO_ADDRESS(INTEGRATOR_GPIO_BASE), INTEGRATOR_GPIO_BASE, SZ_4K, MT_DEVICE }, 85 { IO_ADDRESS(INTEGRATOR_GPIO_BASE), INTEGRATOR_GPIO_BASE, SZ_4K, MT_DEVICE },
86 { 0xfc900000, 0xc9000000, SZ_4K, MT_DEVICE },
87 { 0xfca00000, 0xca000000, SZ_4K, MT_DEVICE }, 86 { 0xfca00000, 0xca000000, SZ_4K, MT_DEVICE },
88 { 0xfcb00000, 0xcb000000, SZ_4K, MT_DEVICE }, 87 { 0xfcb00000, 0xcb000000, SZ_4K, MT_DEVICE },
89}; 88};
diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c
index d2c0ab21150c..f1436e683b49 100644
--- a/arch/arm/mach-integrator/leds.c
+++ b/arch/arm/mach-integrator/leds.c
@@ -22,6 +22,8 @@
22 */ 22 */
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/smp.h>
26#include <linux/spinlock.h>
25 27
26#include <asm/hardware.h> 28#include <asm/hardware.h>
27#include <asm/io.h> 29#include <asm/io.h>
@@ -85,4 +87,4 @@ static int __init leds_init(void)
85 return 0; 87 return 0;
86} 88}
87 89
88__initcall(leds_init); 90core_initcall(leds_init);
diff --git a/arch/arm/mach-integrator/platsmp.c b/arch/arm/mach-integrator/platsmp.c
new file mode 100644
index 000000000000..ead15dfcb53d
--- /dev/null
+++ b/arch/arm/mach-integrator/platsmp.c
@@ -0,0 +1,192 @@
1/*
2 * linux/arch/arm/mach-cintegrator/platsmp.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/errno.h>
15#include <linux/mm.h>
16
17#include <asm/atomic.h>
18#include <asm/delay.h>
19#include <asm/mmu_context.h>
20#include <asm/procinfo.h>
21#include <asm/ptrace.h>
22#include <asm/smp.h>
23
24extern void integrator_secondary_startup(void);
25
26/*
27 * control for which core is the next to come out of the secondary
28 * boot "holding pen"
29 */
30volatile int __initdata pen_release = -1;
31unsigned long __initdata phys_pen_release = 0;
32
33static DEFINE_SPINLOCK(boot_lock);
34
35void __init platform_secondary_init(unsigned int cpu)
36{
37 /*
38 * the primary core may have used a "cross call" soft interrupt
39 * to get this processor out of WFI in the BootMonitor - make
40 * sure that we are no longer being sent this soft interrupt
41 */
42 smp_cross_call_done(cpumask_of_cpu(cpu));
43
44 /*
45 * if any interrupts are already enabled for the primary
46 * core (e.g. timer irq), then they will not have been enabled
47 * for us: do so
48 */
49 secondary_scan_irqs();
50
51 /*
52 * let the primary processor know we're out of the
53 * pen, then head off into the C entry point
54 */
55 pen_release = -1;
56
57 /*
58 * Synchronise with the boot thread.
59 */
60 spin_lock(&boot_lock);
61 spin_unlock(&boot_lock);
62}
63
64int __init boot_secondary(unsigned int cpu, struct task_struct *idle)
65{
66 unsigned long timeout;
67
68 /*
69 * set synchronisation state between this boot processor
70 * and the secondary one
71 */
72 spin_lock(&boot_lock);
73
74 /*
75 * The secondary processor is waiting to be released from
76 * the holding pen - release it, then wait for it to flag
77 * that it has been released by resetting pen_release.
78 *
79 * Note that "pen_release" is the hardware CPU ID, whereas
80 * "cpu" is Linux's internal ID.
81 */
82 pen_release = cpu;
83
84 /*
85 * XXX
86 *
87 * This is a later addition to the booting protocol: the
88 * bootMonitor now puts secondary cores into WFI, so
89 * poke_milo() no longer gets the cores moving; we need
90 * to send a soft interrupt to wake the secondary core.
91 * Use smp_cross_call() for this, since there's little
92 * point duplicating the code here
93 */
94 smp_cross_call(cpumask_of_cpu(cpu));
95
96 timeout = jiffies + (1 * HZ);
97 while (time_before(jiffies, timeout)) {
98 if (pen_release == -1)
99 break;
100
101 udelay(10);
102 }
103
104 /*
105 * now the secondary core is starting up let it run its
106 * calibrations, then wait for it to finish
107 */
108 spin_unlock(&boot_lock);
109
110 return pen_release != -1 ? -ENOSYS : 0;
111}
112
113static void __init poke_milo(void)
114{
115 extern void secondary_startup(void);
116
117 /* nobody is to be released from the pen yet */
118 pen_release = -1;
119
120 phys_pen_release = virt_to_phys(&pen_release);
121
122 /*
123 * write the address of secondary startup into the system-wide
124 * flags register, then clear the bottom two bits, which is what
125 * BootMonitor is waiting for
126 */
127#if 1
128#define CINTEGRATOR_HDR_FLAGSS_OFFSET 0x30
129 __raw_writel(virt_to_phys(integrator_secondary_startup),
130 (IO_ADDRESS(INTEGRATOR_HDR_BASE) +
131 CINTEGRATOR_HDR_FLAGSS_OFFSET));
132#define CINTEGRATOR_HDR_FLAGSC_OFFSET 0x34
133 __raw_writel(3,
134 (IO_ADDRESS(INTEGRATOR_HDR_BASE) +
135 CINTEGRATOR_HDR_FLAGSC_OFFSET));
136#endif
137
138 mb();
139}
140
141void __init smp_prepare_cpus(unsigned int max_cpus)
142{
143 unsigned int ncores = get_core_count();
144 unsigned int cpu = smp_processor_id();
145 int i;
146
147 /* sanity check */
148 if (ncores == 0) {
149 printk(KERN_ERR
150 "Integrator/CP: strange CM count of 0? Default to 1\n");
151
152 ncores = 1;
153 }
154
155 if (ncores > NR_CPUS) {
156 printk(KERN_WARNING
157 "Integrator/CP: no. of cores (%d) greater than configured "
158 "maximum of %d - clipping\n",
159 ncores, NR_CPUS);
160 ncores = NR_CPUS;
161 }
162
163 /*
164 * start with some more config for the Boot CPU, now that
165 * the world is a bit more alive (which was not the case
166 * when smp_prepare_boot_cpu() was called)
167 */
168 smp_store_cpu_info(cpu);
169
170 /*
171 * are we trying to boot more cores than exist?
172 */
173 if (max_cpus > ncores)
174 max_cpus = ncores;
175
176 /*
177 * Initialise the present mask - this tells us which CPUs should
178 * be present.
179 */
180 for (i = 0; i < max_cpus; i++) {
181 cpu_set(i, cpu_present_mask);
182 }
183
184 /*
185 * Do we need any more CPUs? If so, then let them know where
186 * to start. Note that, on modern versions of MILO, the "poke"
187 * doesn't actually do anything until each individual core is
188 * sent a soft interrupt to get it out of WFI
189 */
190 if (max_cpus > 1)
191 poke_milo();
192}
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 4f3c3d5c781c..fc0555596d6d 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -162,12 +162,13 @@ void __init ixp2000_map_io(void)
162static unsigned ticks_per_jiffy; 162static unsigned ticks_per_jiffy;
163static unsigned ticks_per_usec; 163static unsigned ticks_per_usec;
164static unsigned next_jiffy_time; 164static unsigned next_jiffy_time;
165static volatile unsigned long *missing_jiffy_timer_csr;
165 166
166unsigned long ixp2000_gettimeoffset (void) 167unsigned long ixp2000_gettimeoffset (void)
167{ 168{
168 unsigned long offset; 169 unsigned long offset;
169 170
170 offset = next_jiffy_time - *IXP2000_T4_CSR; 171 offset = next_jiffy_time - *missing_jiffy_timer_csr;
171 172
172 return offset / ticks_per_usec; 173 return offset / ticks_per_usec;
173} 174}
@@ -179,7 +180,7 @@ static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
179 /* clear timer 1 */ 180 /* clear timer 1 */
180 ixp2000_reg_write(IXP2000_T1_CLR, 1); 181 ixp2000_reg_write(IXP2000_T1_CLR, 1);
181 182
182 while ((next_jiffy_time - *IXP2000_T4_CSR) > ticks_per_jiffy) { 183 while ((next_jiffy_time - *missing_jiffy_timer_csr) > ticks_per_jiffy) {
183 timer_tick(regs); 184 timer_tick(regs);
184 next_jiffy_time -= ticks_per_jiffy; 185 next_jiffy_time -= ticks_per_jiffy;
185 } 186 }
@@ -197,20 +198,37 @@ static struct irqaction ixp2000_timer_irq = {
197 198
198void __init ixp2000_init_time(unsigned long tick_rate) 199void __init ixp2000_init_time(unsigned long tick_rate)
199{ 200{
200 ixp2000_reg_write(IXP2000_T1_CLR, 0);
201 ixp2000_reg_write(IXP2000_T4_CLR, 0);
202
203 ticks_per_jiffy = (tick_rate + HZ/2) / HZ; 201 ticks_per_jiffy = (tick_rate + HZ/2) / HZ;
204 ticks_per_usec = tick_rate / 1000000; 202 ticks_per_usec = tick_rate / 1000000;
205 203
204 /*
205 * We use timer 1 as our timer interrupt.
206 */
207 ixp2000_reg_write(IXP2000_T1_CLR, 0);
206 ixp2000_reg_write(IXP2000_T1_CLD, ticks_per_jiffy - 1); 208 ixp2000_reg_write(IXP2000_T1_CLD, ticks_per_jiffy - 1);
207 ixp2000_reg_write(IXP2000_T1_CTL, (1 << 7)); 209 ixp2000_reg_write(IXP2000_T1_CTL, (1 << 7));
208 210
209 /* 211 /*
210 * We use T4 as a monotonic counter to track missed jiffies 212 * We use a second timer as a monotonic counter for tracking
213 * missed jiffies. The IXP2000 has four timers, but if we're
214 * on an A-step IXP2800, timer 2 and 3 don't work, so on those
215 * chips we use timer 4. Timer 4 is the only timer that can
216 * be used for the watchdog, so we use timer 2 if we're on a
217 * non-buggy chip.
211 */ 218 */
212 ixp2000_reg_write(IXP2000_T4_CLD, -1); 219 if ((*IXP2000_PRODUCT_ID & 0x001ffef0) == 0x00000000) {
213 ixp2000_reg_write(IXP2000_T4_CTL, (1 << 7)); 220 printk(KERN_INFO "Enabling IXP2800 erratum #25 workaround\n");
221
222 ixp2000_reg_write(IXP2000_T4_CLR, 0);
223 ixp2000_reg_write(IXP2000_T4_CLD, -1);
224 ixp2000_reg_write(IXP2000_T4_CTL, (1 << 7));
225 missing_jiffy_timer_csr = IXP2000_T4_CSR;
226 } else {
227 ixp2000_reg_write(IXP2000_T2_CLR, 0);
228 ixp2000_reg_write(IXP2000_T2_CLD, -1);
229 ixp2000_reg_write(IXP2000_T2_CTL, (1 << 7));
230 missing_jiffy_timer_csr = IXP2000_T2_CSR;
231 }
214 next_jiffy_time = 0xffffffff; 232 next_jiffy_time = 0xffffffff;
215 233
216 /* register for interrupt */ 234 /* register for interrupt */
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index dd012d6e2f5c..f2c9e0d2b24b 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -15,6 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/sysdev.h>
18#include <linux/major.h> 19#include <linux/major.h>
19#include <linux/fb.h> 20#include <linux/fb.h>
20#include <linux/interrupt.h> 21#include <linux/interrupt.h>
@@ -106,6 +107,35 @@ static void __init lubbock_init_irq(void)
106 set_irq_type(IRQ_GPIO(0), IRQT_FALLING); 107 set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
107} 108}
108 109
110#ifdef CONFIG_PM
111
112static int lubbock_irq_resume(struct sys_device *dev)
113{
114 LUB_IRQ_MASK_EN = lubbock_irq_enabled;
115 return 0;
116}
117
118static struct sysdev_class lubbock_irq_sysclass = {
119 set_kset_name("cpld_irq"),
120 .resume = lubbock_irq_resume,
121};
122
123static struct sys_device lubbock_irq_device = {
124 .cls = &lubbock_irq_sysclass,
125};
126
127static int __init lubbock_irq_device_init(void)
128{
129 int ret = sysdev_class_register(&lubbock_irq_sysclass);
130 if (ret == 0)
131 ret = sysdev_register(&lubbock_irq_device);
132 return ret;
133}
134
135device_initcall(lubbock_irq_device_init);
136
137#endif
138
109static int lubbock_udc_is_connected(void) 139static int lubbock_udc_is_connected(void)
110{ 140{
111 return (LUB_MISC_RD & (1 << 9)) == 0; 141 return (LUB_MISC_RD & (1 << 9)) == 0;
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 3f952237ae3d..9896afca751f 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -15,6 +15,7 @@
15 15
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/sysdev.h>
18#include <linux/interrupt.h> 19#include <linux/interrupt.h>
19#include <linux/sched.h> 20#include <linux/sched.h>
20#include <linux/bitops.h> 21#include <linux/bitops.h>
@@ -62,7 +63,6 @@ static struct irqchip mainstone_irq_chip = {
62 .unmask = mainstone_unmask_irq, 63 .unmask = mainstone_unmask_irq,
63}; 64};
64 65
65
66static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc, 66static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc,
67 struct pt_regs *regs) 67 struct pt_regs *regs)
68{ 68{
@@ -100,6 +100,35 @@ static void __init mainstone_init_irq(void)
100 set_irq_type(IRQ_GPIO(0), IRQT_FALLING); 100 set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
101} 101}
102 102
103#ifdef CONFIG_PM
104
105static int mainstone_irq_resume(struct sys_device *dev)
106{
107 MST_INTMSKENA = mainstone_irq_enabled;
108 return 0;
109}
110
111static struct sysdev_class mainstone_irq_sysclass = {
112 set_kset_name("cpld_irq"),
113 .resume = mainstone_irq_resume,
114};
115
116static struct sys_device mainstone_irq_device = {
117 .cls = &mainstone_irq_sysclass,
118};
119
120static int __init mainstone_irq_device_init(void)
121{
122 int ret = sysdev_class_register(&mainstone_irq_sysclass);
123 if (ret == 0)
124 ret = sysdev_register(&mainstone_irq_device);
125 return ret;
126}
127
128device_initcall(mainstone_irq_device_init);
129
130#endif
131
103 132
104static struct resource smc91x_resources[] = { 133static struct resource smc91x_resources[] = {
105 [0] = { 134 [0] = {
@@ -304,6 +333,15 @@ static void __init mainstone_map_io(void)
304 PWER = 0xC0000002; 333 PWER = 0xC0000002;
305 PRER = 0x00000002; 334 PRER = 0x00000002;
306 PFER = 0x00000002; 335 PFER = 0x00000002;
336 /* for use I SRAM as framebuffer. */
337 PSLR |= 0xF04;
338 PCFR = 0x66;
339 /* For Keypad wakeup. */
340 KPC &=~KPC_ASACT;
341 KPC |=KPC_AS;
342 PKWR = 0x000FD000;
343 /* Need read PKWR back after set it. */
344 PKWR;
307} 345}
308 346
309MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") 347MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index 82a4bf34c251..ac4dd4336160 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -29,9 +29,6 @@
29 */ 29 */
30#undef DEBUG 30#undef DEBUG
31 31
32extern void pxa_cpu_suspend(void);
33extern void pxa_cpu_resume(void);
34
35#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x 32#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
36#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] 33#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
37 34
@@ -63,6 +60,12 @@ enum { SLEEP_SAVE_START = 0,
63 SLEEP_SAVE_ICMR, 60 SLEEP_SAVE_ICMR,
64 SLEEP_SAVE_CKEN, 61 SLEEP_SAVE_CKEN,
65 62
63#ifdef CONFIG_PXA27x
64 SLEEP_SAVE_MDREFR,
65 SLEEP_SAVE_PWER, SLEEP_SAVE_PCFR, SLEEP_SAVE_PRER,
66 SLEEP_SAVE_PFER, SLEEP_SAVE_PKWR,
67#endif
68
66 SLEEP_SAVE_CKSUM, 69 SLEEP_SAVE_CKSUM,
67 70
68 SLEEP_SAVE_SIZE 71 SLEEP_SAVE_SIZE
@@ -75,9 +78,7 @@ static int pxa_pm_enter(suspend_state_t state)
75 unsigned long checksum = 0; 78 unsigned long checksum = 0;
76 struct timespec delta, rtc; 79 struct timespec delta, rtc;
77 int i; 80 int i;
78 81 extern void pxa_cpu_pm_enter(suspend_state_t state);
79 if (state != PM_SUSPEND_MEM)
80 return -EINVAL;
81 82
82#ifdef CONFIG_IWMMXT 83#ifdef CONFIG_IWMMXT
83 /* force any iWMMXt context to ram **/ 84 /* force any iWMMXt context to ram **/
@@ -100,16 +101,17 @@ static int pxa_pm_enter(suspend_state_t state)
100 SAVE(GAFR2_L); SAVE(GAFR2_U); 101 SAVE(GAFR2_L); SAVE(GAFR2_U);
101 102
102#ifdef CONFIG_PXA27x 103#ifdef CONFIG_PXA27x
104 SAVE(MDREFR);
103 SAVE(GPLR3); SAVE(GPDR3); SAVE(GRER3); SAVE(GFER3); SAVE(PGSR3); 105 SAVE(GPLR3); SAVE(GPDR3); SAVE(GRER3); SAVE(GFER3); SAVE(PGSR3);
104 SAVE(GAFR3_L); SAVE(GAFR3_U); 106 SAVE(GAFR3_L); SAVE(GAFR3_U);
107 SAVE(PWER); SAVE(PCFR); SAVE(PRER);
108 SAVE(PFER); SAVE(PKWR);
105#endif 109#endif
106 110
107 SAVE(ICMR); 111 SAVE(ICMR);
108 ICMR = 0; 112 ICMR = 0;
109 113
110 SAVE(CKEN); 114 SAVE(CKEN);
111 CKEN = 0;
112
113 SAVE(PSTR); 115 SAVE(PSTR);
114 116
115 /* Note: wake up source are set up in each machine specific files */ 117 /* Note: wake up source are set up in each machine specific files */
@@ -123,16 +125,15 @@ static int pxa_pm_enter(suspend_state_t state)
123 /* Clear sleep reset status */ 125 /* Clear sleep reset status */
124 RCSR = RCSR_SMR; 126 RCSR = RCSR_SMR;
125 127
126 /* set resume return address */
127 PSPR = virt_to_phys(pxa_cpu_resume);
128
129 /* before sleeping, calculate and save a checksum */ 128 /* before sleeping, calculate and save a checksum */
130 for (i = 0; i < SLEEP_SAVE_SIZE - 1; i++) 129 for (i = 0; i < SLEEP_SAVE_SIZE - 1; i++)
131 checksum += sleep_save[i]; 130 checksum += sleep_save[i];
132 sleep_save[SLEEP_SAVE_CKSUM] = checksum; 131 sleep_save[SLEEP_SAVE_CKSUM] = checksum;
133 132
134 /* *** go zzz *** */ 133 /* *** go zzz *** */
135 pxa_cpu_suspend(); 134 pxa_cpu_pm_enter(state);
135
136 cpu_init();
136 137
137 /* after sleeping, validate the checksum */ 138 /* after sleeping, validate the checksum */
138 checksum = 0; 139 checksum = 0;
@@ -145,7 +146,7 @@ static int pxa_pm_enter(suspend_state_t state)
145 LUB_HEXLED = 0xbadbadc5; 146 LUB_HEXLED = 0xbadbadc5;
146#endif 147#endif
147 while (1) 148 while (1)
148 pxa_cpu_suspend(); 149 pxa_cpu_pm_enter(state);
149 } 150 }
150 151
151 /* ensure not to come back here if it wasn't intended */ 152 /* ensure not to come back here if it wasn't intended */
@@ -162,8 +163,11 @@ static int pxa_pm_enter(suspend_state_t state)
162 RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2); 163 RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2);
163 164
164#ifdef CONFIG_PXA27x 165#ifdef CONFIG_PXA27x
166 RESTORE(MDREFR);
165 RESTORE(GAFR3_L); RESTORE(GAFR3_U); RESTORE_GPLEVEL(3); 167 RESTORE(GAFR3_L); RESTORE(GAFR3_U); RESTORE_GPLEVEL(3);
166 RESTORE(GPDR3); RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3); 168 RESTORE(GPDR3); RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3);
169 RESTORE(PWER); RESTORE(PCFR); RESTORE(PRER);
170 RESTORE(PFER); RESTORE(PKWR);
167#endif 171#endif
168 172
169 PSSR = PSSR_RDH | PSSR_PH; 173 PSSR = PSSR_RDH | PSSR_PH;
@@ -197,7 +201,9 @@ unsigned long sleep_phys_sp(void *sp)
197 */ 201 */
198static int pxa_pm_prepare(suspend_state_t state) 202static int pxa_pm_prepare(suspend_state_t state)
199{ 203{
200 return 0; 204 extern int pxa_cpu_pm_prepare(suspend_state_t state);
205
206 return pxa_cpu_pm_prepare(state);
201} 207}
202 208
203/* 209/*
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index e887b7175ef3..7869c3b4e62f 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -16,6 +16,7 @@
16 * initialization stuff for PXA machines which can be overridden later if 16 * initialization stuff for PXA machines which can be overridden later if
17 * need be. 17 * need be.
18 */ 18 */
19#include <linux/config.h>
19#include <linux/module.h> 20#include <linux/module.h>
20#include <linux/kernel.h> 21#include <linux/kernel.h>
21#include <linux/init.h> 22#include <linux/init.h>
@@ -102,3 +103,35 @@ unsigned int get_lcdclk_frequency_10khz(void)
102} 103}
103 104
104EXPORT_SYMBOL(get_lcdclk_frequency_10khz); 105EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
106
107#ifdef CONFIG_PM
108
109int pxa_cpu_pm_prepare(suspend_state_t state)
110{
111 switch (state) {
112 case PM_SUSPEND_MEM:
113 break;
114 default:
115 return -EINVAL;
116 }
117
118 return 0;
119}
120
121void pxa_cpu_pm_enter(suspend_state_t state)
122{
123 extern void pxa_cpu_suspend(unsigned int);
124 extern void pxa_cpu_resume(void);
125
126 CKEN = 0;
127
128 switch (state) {
129 case PM_SUSPEND_MEM:
130 /* set resume return address */
131 PSPR = virt_to_phys(pxa_cpu_resume);
132 pxa_cpu_suspend(3);
133 break;
134 }
135}
136
137#endif
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 7e863afefb53..893964fb9659 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -120,6 +120,42 @@ EXPORT_SYMBOL(get_clk_frequency_khz);
120EXPORT_SYMBOL(get_memclk_frequency_10khz); 120EXPORT_SYMBOL(get_memclk_frequency_10khz);
121EXPORT_SYMBOL(get_lcdclk_frequency_10khz); 121EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
122 122
123#ifdef CONFIG_PM
124
125int pxa_cpu_pm_prepare(suspend_state_t state)
126{
127 switch (state) {
128 case PM_SUSPEND_MEM:
129 return 0;
130 default:
131 return -EINVAL;
132 }
133}
134
135void pxa_cpu_pm_enter(suspend_state_t state)
136{
137 extern void pxa_cpu_standby(void);
138 extern void pxa_cpu_suspend(unsigned int);
139 extern void pxa_cpu_resume(void);
140
141 CKEN = CKEN22_MEMC | CKEN9_OSTIMER;
142
143 /* ensure voltage-change sequencer not initiated, which hangs */
144 PCFR &= ~PCFR_FVC;
145
146 /* Clear edge-detect status register. */
147 PEDR = 0xDF12FE1B;
148
149 switch (state) {
150 case PM_SUSPEND_MEM:
151 /* set resume return address */
152 PSPR = virt_to_phys(pxa_cpu_resume);
153 pxa_cpu_suspend(3);
154 break;
155 }
156}
157
158#endif
123 159
124/* 160/*
125 * device registration specific to PXA27x. 161 * device registration specific to PXA27x.
diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c
index e23f534d4e1d..8d986b8401c2 100644
--- a/arch/arm/mach-s3c2410/clock.c
+++ b/arch/arm/mach-s3c2410/clock.c
@@ -478,7 +478,7 @@ static int s3c2440_clk_add(struct sys_device *sysdev)
478{ 478{
479 unsigned long upllcon = __raw_readl(S3C2410_UPLLCON); 479 unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
480 480
481 s3c2440_clk_upll.rate = s3c2410_get_pll(upllcon, clk_xtal.rate) * 2; 481 s3c2440_clk_upll.rate = s3c2410_get_pll(upllcon, clk_xtal.rate);
482 482
483 printk("S3C2440: Clock Support, UPLL %ld.%03ld MHz\n", 483 printk("S3C2440: Clock Support, UPLL %ld.%03ld MHz\n",
484 print_mhz(s3c2440_clk_upll.rate)); 484 print_mhz(s3c2440_clk_upll.rate));
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index bc229fab86d4..c7c28890d406 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -785,6 +785,10 @@ int s3c2410_dma_free(dmach_t channel, s3c2410_dma_client_t *client)
785 chan->client = NULL; 785 chan->client = NULL;
786 chan->in_use = 0; 786 chan->in_use = 0;
787 787
788 if (chan->irq_claimed)
789 free_irq(chan->irq, (void *)chan);
790 chan->irq_claimed = 0;
791
788 local_irq_restore(flags); 792 local_irq_restore(flags);
789 793
790 return 0; 794 return 0;
diff --git a/arch/arm/mach-s3c2410/s3c2440.c b/arch/arm/mach-s3c2410/s3c2440.c
index 9a8cc5ae2255..d4c8281b55f6 100644
--- a/arch/arm/mach-s3c2410/s3c2440.c
+++ b/arch/arm/mach-s3c2410/s3c2440.c
@@ -192,9 +192,11 @@ void __init s3c2440_map_io(struct map_desc *mach_desc, int size)
192 192
193 iotable_init(s3c2440_iodesc, ARRAY_SIZE(s3c2440_iodesc)); 193 iotable_init(s3c2440_iodesc, ARRAY_SIZE(s3c2440_iodesc));
194 iotable_init(mach_desc, size); 194 iotable_init(mach_desc, size);
195
195 /* rename any peripherals used differing from the s3c2410 */ 196 /* rename any peripherals used differing from the s3c2410 */
196 197
197 s3c_device_i2c.name = "s3c2440-i2c"; 198 s3c_device_i2c.name = "s3c2440-i2c";
199 s3c_device_nand.name = "s3c2440-nand";
198 200
199 /* change irq for watchdog */ 201 /* change irq for watchdog */
200 202
@@ -225,7 +227,7 @@ void __init s3c2440_init_clocks(int xtal)
225 break; 227 break;
226 228
227 case S3C2440_CLKDIVN_HDIVN_2: 229 case S3C2440_CLKDIVN_HDIVN_2:
228 hdiv = 1; 230 hdiv = 2;
229 break; 231 break;
230 232
231 case S3C2440_CLKDIVN_HDIVN_4_8: 233 case S3C2440_CLKDIVN_HDIVN_4_8:
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index 50cde576dadf..6923316b3d0d 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -150,7 +150,7 @@ config SA1100_SSP
150 150
151config H3600_SLEEVE 151config H3600_SLEEVE
152 tristate "Compaq iPAQ Handheld sleeve support" 152 tristate "Compaq iPAQ Handheld sleeve support"
153 depends on SA1100_H3600 153 depends on SA1100_H3100 || SA1100_H3600
154 help 154 help
155 Choose this option to enable support for extension packs (sleeves) 155 Choose this option to enable support for extension packs (sleeves)
156 for the Compaq iPAQ H3XXX series of handheld computers. This option 156 for the Compaq iPAQ H3XXX series of handheld computers. This option
diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c
index 379ea5e3950f..59c7964cfe11 100644
--- a/arch/arm/mach-sa1100/pm.c
+++ b/arch/arm/mach-sa1100/pm.c
@@ -88,6 +88,8 @@ static int sa11x0_pm_enter(suspend_state_t state)
88 /* go zzz */ 88 /* go zzz */
89 sa1100_cpu_suspend(); 89 sa1100_cpu_suspend();
90 90
91 cpu_init();
92
91 /* 93 /*
92 * Ensure not to come back here if it wasn't intended 94 * Ensure not to come back here if it wasn't intended
93 */ 95 */
diff --git a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile
index 5d608837757a..ba81e70ed813 100644
--- a/arch/arm/mach-versatile/Makefile
+++ b/arch/arm/mach-versatile/Makefile
@@ -5,3 +5,4 @@
5obj-y := core.o clock.o 5obj-y := core.o clock.o
6obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o 6obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o
7obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o 7obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o
8obj-$(CONFIG_PCI) += pci.o
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 554e1bd30d6e..6a7cbea5e098 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -196,11 +196,15 @@ static struct map_desc versatile_io_desc[] __initdata = {
196#ifdef CONFIG_DEBUG_LL 196#ifdef CONFIG_DEBUG_LL
197 { IO_ADDRESS(VERSATILE_UART0_BASE), VERSATILE_UART0_BASE, SZ_4K, MT_DEVICE }, 197 { IO_ADDRESS(VERSATILE_UART0_BASE), VERSATILE_UART0_BASE, SZ_4K, MT_DEVICE },
198#endif 198#endif
199#ifdef FIXME 199#ifdef CONFIG_PCI
200 { PCI_MEMORY_VADDR, PHYS_PCI_MEM_BASE, SZ_16M, MT_DEVICE }, 200 { IO_ADDRESS(VERSATILE_PCI_CORE_BASE), VERSATILE_PCI_CORE_BASE, SZ_4K, MT_DEVICE },
201 { PCI_CONFIG_VADDR, PHYS_PCI_CONFIG_BASE, SZ_16M, MT_DEVICE }, 201 { VERSATILE_PCI_VIRT_BASE, VERSATILE_PCI_BASE, VERSATILE_PCI_BASE_SIZE, MT_DEVICE },
202 { PCI_V3_VADDR, PHYS_PCI_V3_BASE, SZ_512K, MT_DEVICE }, 202 { VERSATILE_PCI_CFG_VIRT_BASE, VERSATILE_PCI_CFG_BASE, VERSATILE_PCI_CFG_BASE_SIZE, MT_DEVICE },
203 { PCI_IO_VADDR, PHYS_PCI_IO_BASE, SZ_64K, MT_DEVICE }, 203#if 0
204 { VERSATILE_PCI_VIRT_MEM_BASE0, VERSATILE_PCI_MEM_BASE0, SZ_16M, MT_DEVICE },
205 { VERSATILE_PCI_VIRT_MEM_BASE1, VERSATILE_PCI_MEM_BASE1, SZ_16M, MT_DEVICE },
206 { VERSATILE_PCI_VIRT_MEM_BASE2, VERSATILE_PCI_MEM_BASE2, SZ_16M, MT_DEVICE },
207#endif
204#endif 208#endif
205}; 209};
206 210
@@ -543,7 +547,7 @@ static void versatile_clcd_enable(struct clcd_fb *fb)
543 val |= SYS_CLCD_MODE_5551; 547 val |= SYS_CLCD_MODE_5551;
544 break; 548 break;
545 case 6: 549 case 6:
546 val |= SYS_CLCD_MODE_565_BLSB; 550 val |= SYS_CLCD_MODE_565_RLSB;
547 break; 551 break;
548 case 8: 552 case 8:
549 val |= SYS_CLCD_MODE_888; 553 val |= SYS_CLCD_MODE_888;
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
new file mode 100644
index 000000000000..d1565e851f0e
--- /dev/null
+++ b/arch/arm/mach-versatile/pci.c
@@ -0,0 +1,360 @@
1/*
2 * linux/arch/arm/mach-versatile/pci.c
3 *
4 * (C) Copyright Koninklijke Philips Electronics NV 2004. All rights reserved.
5 * You can redistribute and/or modify this software under the terms of version 2
6 * of the GNU General Public License as published by the Free Software Foundation.
7 * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED
8 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 * General Public License for more details.
10 * Koninklijke Philips Electronics nor its subsidiaries is obligated to provide any support for this software.
11 *
12 * ARM Versatile PCI driver.
13 *
14 * 14/04/2005 Initial version, colin.king@philips.com
15 *
16 */
17#include <linux/config.h>
18#include <linux/kernel.h>
19#include <linux/pci.h>
20#include <linux/ptrace.h>
21#include <linux/slab.h>
22#include <linux/ioport.h>
23#include <linux/interrupt.h>
24#include <linux/spinlock.h>
25#include <linux/init.h>
26
27#include <asm/hardware.h>
28#include <asm/io.h>
29#include <asm/irq.h>
30#include <asm/system.h>
31#include <asm/mach/pci.h>
32#include <asm/mach-types.h>
33
34/*
35 * these spaces are mapped using the following base registers:
36 *
37 * Usage Local Bus Memory Base/Map registers used
38 *
39 * Mem 50000000 - 5FFFFFFF LB_BASE0/LB_MAP0, non prefetch
40 * Mem 60000000 - 6FFFFFFF LB_BASE1/LB_MAP1, prefetch
41 * IO 44000000 - 4FFFFFFF LB_BASE2/LB_MAP2, IO
42 * Cfg 42000000 - 42FFFFFF PCI config
43 *
44 */
45#define SYS_PCICTL IO_ADDRESS(VERSATILE_SYS_PCICTL)
46#define PCI_IMAP0 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x0)
47#define PCI_IMAP1 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x4)
48#define PCI_IMAP2 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x8)
49#define PCI_SMAP0 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x10)
50#define PCI_SMAP1 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x14)
51#define PCI_SMAP2 IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x18)
52#define PCI_SELFID IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0xc)
53
54#define DEVICE_ID_OFFSET 0x00
55#define CSR_OFFSET 0x04
56#define CLASS_ID_OFFSET 0x08
57
58#define VP_PCI_DEVICE_ID 0x030010ee
59#define VP_PCI_CLASS_ID 0x0b400000
60
61static unsigned long pci_slot_ignore = 0;
62
63static int __init versatile_pci_slot_ignore(char *str)
64{
65 int retval;
66 int slot;
67
68 while ((retval = get_option(&str,&slot))) {
69 if ((slot < 0) || (slot > 31)) {
70 printk("Illegal slot value: %d\n",slot);
71 } else {
72 pci_slot_ignore |= (1 << slot);
73 }
74 }
75 return 1;
76}
77
78__setup("pci_slot_ignore=", versatile_pci_slot_ignore);
79
80
81static unsigned long __pci_addr(struct pci_bus *bus,
82 unsigned int devfn, int offset)
83{
84 unsigned int busnr = bus->number;
85
86 /*
87 * Trap out illegal values
88 */
89 if (offset > 255)
90 BUG();
91 if (busnr > 255)
92 BUG();
93 if (devfn > 255)
94 BUG();
95
96 return (VERSATILE_PCI_CFG_VIRT_BASE | (busnr << 16) |
97 (PCI_SLOT(devfn) << 11) | (PCI_FUNC(devfn) << 8) | offset);
98}
99
100static int versatile_read_config(struct pci_bus *bus, unsigned int devfn, int where,
101 int size, u32 *val)
102{
103 unsigned long addr = __pci_addr(bus, devfn, where);
104 u32 v;
105 int slot = PCI_SLOT(devfn);
106
107 if (pci_slot_ignore & (1 << slot)) {
108 /* Ignore this slot */
109 switch (size) {
110 case 1:
111 v = 0xff;
112 break;
113 case 2:
114 v = 0xffff;
115 break;
116 default:
117 v = 0xffffffff;
118 }
119 } else {
120 switch (size) {
121 case 1:
122 addr &= ~3;
123 v = __raw_readb(addr);
124 break;
125
126 case 2:
127 v = __raw_readl(addr & ~3);
128 if (addr & 2) v >>= 16;
129 v &= 0xffff;
130 break;
131
132 default:
133 addr &= ~3;
134 v = __raw_readl(addr);
135 break;
136 }
137 }
138
139 *val = v;
140 return PCIBIOS_SUCCESSFUL;
141}
142
143static int versatile_write_config(struct pci_bus *bus, unsigned int devfn, int where,
144 int size, u32 val)
145{
146 unsigned long addr = __pci_addr(bus, devfn, where);
147 int slot = PCI_SLOT(devfn);
148
149 if (pci_slot_ignore & (1 << slot)) {
150 return PCIBIOS_SUCCESSFUL;
151 }
152
153 switch (size) {
154 case 1:
155 __raw_writeb((u8)val, addr);
156 break;
157
158 case 2:
159 __raw_writew((u16)val, addr);
160 break;
161
162 case 4:
163 __raw_writel(val, addr);
164 break;
165 }
166
167 return PCIBIOS_SUCCESSFUL;
168}
169
170static struct pci_ops pci_versatile_ops = {
171 .read = versatile_read_config,
172 .write = versatile_write_config,
173};
174
175static struct resource io_mem = {
176 .name = "PCI I/O space",
177 .start = VERSATILE_PCI_MEM_BASE0,
178 .end = VERSATILE_PCI_MEM_BASE0+VERSATILE_PCI_MEM_BASE0_SIZE-1,
179 .flags = IORESOURCE_IO,
180};
181
182static struct resource non_mem = {
183 .name = "PCI non-prefetchable",
184 .start = VERSATILE_PCI_MEM_BASE1,
185 .end = VERSATILE_PCI_MEM_BASE1+VERSATILE_PCI_MEM_BASE1_SIZE-1,
186 .flags = IORESOURCE_MEM,
187};
188
189static struct resource pre_mem = {
190 .name = "PCI prefetchable",
191 .start = VERSATILE_PCI_MEM_BASE2,
192 .end = VERSATILE_PCI_MEM_BASE2+VERSATILE_PCI_MEM_BASE2_SIZE-1,
193 .flags = IORESOURCE_MEM | IORESOURCE_PREFETCH,
194};
195
196static int __init pci_versatile_setup_resources(struct resource **resource)
197{
198 int ret = 0;
199
200 ret = request_resource(&iomem_resource, &io_mem);
201 if (ret) {
202 printk(KERN_ERR "PCI: unable to allocate I/O "
203 "memory region (%d)\n", ret);
204 goto out;
205 }
206 ret = request_resource(&iomem_resource, &non_mem);
207 if (ret) {
208 printk(KERN_ERR "PCI: unable to allocate non-prefetchable "
209 "memory region (%d)\n", ret);
210 goto release_io_mem;
211 }
212 ret = request_resource(&iomem_resource, &pre_mem);
213 if (ret) {
214 printk(KERN_ERR "PCI: unable to allocate prefetchable "
215 "memory region (%d)\n", ret);
216 goto release_non_mem;
217 }
218
219 /*
220 * bus->resource[0] is the IO resource for this bus
221 * bus->resource[1] is the mem resource for this bus
222 * bus->resource[2] is the prefetch mem resource for this bus
223 */
224 resource[0] = &io_mem;
225 resource[1] = &non_mem;
226 resource[2] = &pre_mem;
227
228 goto out;
229
230 release_non_mem:
231 release_resource(&non_mem);
232 release_io_mem:
233 release_resource(&io_mem);
234 out:
235 return ret;
236}
237
238int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
239{
240 int ret = 0;
241 int i;
242 int myslot = -1;
243 unsigned long val;
244
245 if (nr == 0) {
246 sys->mem_offset = 0;
247 ret = pci_versatile_setup_resources(sys->resource);
248 if (ret < 0) {
249 printk("pci_versatile_setup: resources... oops?\n");
250 goto out;
251 }
252 } else {
253 printk("pci_versatile_setup: resources... nr == 0??\n");
254 goto out;
255 }
256
257 __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28,PCI_IMAP0);
258 __raw_writel(VERSATILE_PCI_MEM_BASE1 >> 28,PCI_IMAP1);
259 __raw_writel(VERSATILE_PCI_MEM_BASE2 >> 28,PCI_IMAP2);
260
261 __raw_writel(1, SYS_PCICTL);
262
263 val = __raw_readl(SYS_PCICTL);
264 if (!(val & 1)) {
265 printk("Not plugged into PCI backplane!\n");
266 ret = -EIO;
267 goto out;
268 }
269
270 /*
271 * We need to discover the PCI core first to configure itself
272 * before the main PCI probing is performed
273 */
274 for (i=0; i<32; i++) {
275 if ((__raw_readl(VERSATILE_PCI_VIRT_BASE+(i<<11)+DEVICE_ID_OFFSET) == VP_PCI_DEVICE_ID) &&
276 (__raw_readl(VERSATILE_PCI_VIRT_BASE+(i<<11)+CLASS_ID_OFFSET) == VP_PCI_CLASS_ID)) {
277 myslot = i;
278
279 __raw_writel(myslot, PCI_SELFID);
280 val = __raw_readl(VERSATILE_PCI_CFG_VIRT_BASE+(myslot<<11)+CSR_OFFSET);
281 val |= (1<<2);
282 __raw_writel(val, VERSATILE_PCI_CFG_VIRT_BASE+(myslot<<11)+CSR_OFFSET);
283 break;
284 }
285 }
286
287 if (myslot == -1) {
288 printk("Cannot find PCI core!\n");
289 ret = -EIO;
290 } else {
291 printk("PCI core found (slot %d)\n",myslot);
292 /* Do not to map Versatile FPGA PCI device
293 into memory space as we are short of
294 mappable memory */
295 pci_slot_ignore |= (1 << myslot);
296 ret = 1;
297 }
298
299 out:
300 return ret;
301}
302
303
304struct pci_bus *pci_versatile_scan_bus(int nr, struct pci_sys_data *sys)
305{
306 return pci_scan_bus(sys->busnr, &pci_versatile_ops, sys);
307}
308
309/*
310 * V3_LB_BASE? - local bus address
311 * V3_LB_MAP? - pci bus address
312 */
313void __init pci_versatile_preinit(void)
314{
315}
316
317void __init pci_versatile_postinit(void)
318{
319}
320
321
322/*
323 * map the specified device/slot/pin to an IRQ. Different backplanes may need to modify this.
324 */
325static int __init versatile_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
326{
327 int irq;
328 int devslot = PCI_SLOT(dev->devfn);
329
330 /* slot, pin, irq
331 24 1 27
332 25 1 28 untested
333 26 1 29
334 27 1 30 untested
335 */
336
337 irq = 27 + ((slot + pin + 2) % 3); /* Fudged */
338
339 printk("map irq: slot %d, pin %d, devslot %d, irq: %d\n",slot,pin,devslot,irq);
340
341 return irq;
342}
343
344static struct hw_pci versatile_pci __initdata = {
345 .swizzle = NULL,
346 .map_irq = versatile_map_irq,
347 .nr_controllers = 1,
348 .setup = pci_versatile_setup,
349 .scan = pci_versatile_scan_bus,
350 .preinit = pci_versatile_preinit,
351 .postinit = pci_versatile_postinit,
352};
353
354static int __init versatile_pci_init(void)
355{
356 pci_common_init(&versatile_pci);
357 return 0;
358}
359
360subsys_initcall(versatile_pci_init);
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index c4fc6be629de..95606b4a3ba6 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -62,7 +62,7 @@ config CPU_ARM720T
62# ARM920T 62# ARM920T
63config CPU_ARM920T 63config CPU_ARM920T
64 bool "Support ARM920T processor" if !ARCH_S3C2410 64 bool "Support ARM920T processor" if !ARCH_S3C2410
65 depends on ARCH_INTEGRATOR || ARCH_S3C2410 || ARCH_IMX 65 depends on ARCH_INTEGRATOR || ARCH_S3C2410 || ARCH_IMX || ARCH_AAEC2000
66 default y if ARCH_S3C2410 66 default y if ARCH_S3C2410
67 select CPU_32v4 67 select CPU_32v4
68 select CPU_ABRT_EV4T 68 select CPU_ABRT_EV4T
@@ -228,7 +228,6 @@ config CPU_SA1100
228 select CPU_CACHE_V4WB 228 select CPU_CACHE_V4WB
229 select CPU_CACHE_VIVT 229 select CPU_CACHE_VIVT
230 select CPU_TLB_V4WB 230 select CPU_TLB_V4WB
231 select CPU_MINICACHE
232 231
233# XScale 232# XScale
234config CPU_XSCALE 233config CPU_XSCALE
@@ -239,7 +238,6 @@ config CPU_XSCALE
239 select CPU_ABRT_EV5T 238 select CPU_ABRT_EV5T
240 select CPU_CACHE_VIVT 239 select CPU_CACHE_VIVT
241 select CPU_TLB_V4WBI 240 select CPU_TLB_V4WBI
242 select CPU_MINICACHE
243 241
244# ARMv6 242# ARMv6
245config CPU_V6 243config CPU_V6
@@ -345,11 +343,6 @@ config CPU_TLB_V4WBI
345config CPU_TLB_V6 343config CPU_TLB_V6
346 bool 344 bool
347 345
348config CPU_MINICACHE
349 bool
350 help
351 Processor has a minicache.
352
353comment "Processor Features" 346comment "Processor Features"
354 347
355config ARM_THUMB 348config ARM_THUMB
@@ -412,21 +405,28 @@ config CPU_BPREDICT_DISABLE
412 405
413config TLS_REG_EMUL 406config TLS_REG_EMUL
414 bool 407 bool
415 default y if (SMP || CPU_32v6) && (CPU_32v5 || CPU_32v4 || CPU_32v3) 408 default y if SMP && (CPU_32v5 || CPU_32v4 || CPU_32v3)
416 help 409 help
417 We might be running on an ARMv6+ processor which should have the TLS 410 An SMP system using a pre-ARMv6 processor (there are apparently
418 register but for some reason we can't use it, or maybe an SMP system 411 a few prototypes like that in existence) and therefore access to
419 using a pre-ARMv6 processor (there are apparently a few prototypes 412 that required register must be emulated.
420 like that in existence) and therefore access to that register must
421 be emulated.
422 413
423config HAS_TLS_REG 414config HAS_TLS_REG
424 bool 415 bool
425 depends on CPU_32v6 416 depends on !TLS_REG_EMUL
426 default y if !TLS_REG_EMUL 417 default y if SMP || CPU_32v7
427 help 418 help
428 This selects support for the CP15 thread register. 419 This selects support for the CP15 thread register.
429 It is defined to be available on ARMv6 or later. If a particular 420 It is defined to be available on some ARMv6 processors (including
430 ARMv6 or later CPU doesn't support it then it must omc;ide "select 421 all SMP capable ARMv6's) or later processors. User space may
431 TLS_REG_EMUL" along with its other caracteristics. 422 assume directly accessing that register and always obtain the
423 expected value only on ARMv7 and above.
424
425config NEEDS_SYSCALL_FOR_CMPXCHG
426 bool
427 default y if SMP && (CPU_32v5 || CPU_32v4 || CPU_32v3)
428 help
429 SMP on a pre-ARMv6 processor? Well OK then.
430 Forget about fast user space cmpxchg support.
431 It is just not possible.
432 432
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index ccf316c11e02..59f47d4c2dfe 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -31,8 +31,6 @@ obj-$(CONFIG_CPU_COPY_V6) += copypage-v6.o mmu.o
31obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o 31obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o
32obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o 32obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o
33 33
34obj-$(CONFIG_CPU_MINICACHE) += minicache.o
35
36obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o 34obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o
37obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o 35obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o
38obj-$(CONFIG_CPU_TLB_V4WB) += tlb-v4wb.o 36obj-$(CONFIG_CPU_TLB_V4WB) += tlb-v4wb.o
diff --git a/arch/arm/mm/copypage-v4mc.S b/arch/arm/mm/copypage-v4mc.S
deleted file mode 100644
index 305af3dab3d8..000000000000
--- a/arch/arm/mm/copypage-v4mc.S
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * linux/arch/arm/lib/copy_page-armv4mc.S
3 *
4 * Copyright (C) 1995-2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ASM optimised string functions
11 */
12#include <linux/linkage.h>
13#include <linux/init.h>
14#include <asm/constants.h>
15
16 .text
17 .align 5
18/*
19 * ARMv4 mini-dcache optimised copy_user_page
20 *
21 * We flush the destination cache lines just before we write the data into the
22 * corresponding address. Since the Dcache is read-allocate, this removes the
23 * Dcache aliasing issue. The writes will be forwarded to the write buffer,
24 * and merged as appropriate.
25 *
26 * Note: We rely on all ARMv4 processors implementing the "invalidate D line"
27 * instruction. If your processor does not supply this, you have to write your
28 * own copy_user_page that does the right thing.
29 */
30ENTRY(v4_mc_copy_user_page)
31 stmfd sp!, {r4, lr} @ 2
32 mov r4, r0
33 mov r0, r1
34 bl map_page_minicache
35 mov r1, #PAGE_SZ/64 @ 1
36 ldmia r0!, {r2, r3, ip, lr} @ 4
371: mcr p15, 0, r4, c7, c6, 1 @ 1 invalidate D line
38 stmia r4!, {r2, r3, ip, lr} @ 4
39 ldmia r0!, {r2, r3, ip, lr} @ 4+1
40 stmia r4!, {r2, r3, ip, lr} @ 4
41 ldmia r0!, {r2, r3, ip, lr} @ 4
42 mcr p15, 0, r4, c7, c6, 1 @ 1 invalidate D line
43 stmia r4!, {r2, r3, ip, lr} @ 4
44 ldmia r0!, {r2, r3, ip, lr} @ 4
45 subs r1, r1, #1 @ 1
46 stmia r4!, {r2, r3, ip, lr} @ 4
47 ldmneia r0!, {r2, r3, ip, lr} @ 4
48 bne 1b @ 1
49 ldmfd sp!, {r4, pc} @ 3
50
51 .align 5
52/*
53 * ARMv4 optimised clear_user_page
54 *
55 * Same story as above.
56 */
57ENTRY(v4_mc_clear_user_page)
58 str lr, [sp, #-4]!
59 mov r1, #PAGE_SZ/64 @ 1
60 mov r2, #0 @ 1
61 mov r3, #0 @ 1
62 mov ip, #0 @ 1
63 mov lr, #0 @ 1
641: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line
65 stmia r0!, {r2, r3, ip, lr} @ 4
66 stmia r0!, {r2, r3, ip, lr} @ 4
67 mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line
68 stmia r0!, {r2, r3, ip, lr} @ 4
69 stmia r0!, {r2, r3, ip, lr} @ 4
70 subs r1, r1, #1 @ 1
71 bne 1b @ 1
72 ldr pc, [sp], #4
73
74 __INITDATA
75
76 .type v4_mc_user_fns, #object
77ENTRY(v4_mc_user_fns)
78 .long v4_mc_clear_user_page
79 .long v4_mc_copy_user_page
80 .size v4_mc_user_fns, . - v4_mc_user_fns
diff --git a/arch/arm/mm/copypage-v4mc.c b/arch/arm/mm/copypage-v4mc.c
new file mode 100644
index 000000000000..fc69dccdace1
--- /dev/null
+++ b/arch/arm/mm/copypage-v4mc.c
@@ -0,0 +1,111 @@
1/*
2 * linux/arch/arm/lib/copypage-armv4mc.S
3 *
4 * Copyright (C) 1995-2005 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This handles the mini data cache, as found on SA11x0 and XScale
11 * processors. When we copy a user page page, we map it in such a way
12 * that accesses to this page will not touch the main data cache, but
13 * will be cached in the mini data cache. This prevents us thrashing
14 * the main data cache on page faults.
15 */
16#include <linux/init.h>
17#include <linux/mm.h>
18
19#include <asm/page.h>
20#include <asm/pgtable.h>
21#include <asm/tlbflush.h>
22
23/*
24 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
25 * specific hacks for copying pages efficiently.
26 */
27#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
28 L_PTE_CACHEABLE)
29
30#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
31
32static DEFINE_SPINLOCK(minicache_lock);
33
34/*
35 * ARMv4 mini-dcache optimised copy_user_page
36 *
37 * We flush the destination cache lines just before we write the data into the
38 * corresponding address. Since the Dcache is read-allocate, this removes the
39 * Dcache aliasing issue. The writes will be forwarded to the write buffer,
40 * and merged as appropriate.
41 *
42 * Note: We rely on all ARMv4 processors implementing the "invalidate D line"
43 * instruction. If your processor does not supply this, you have to write your
44 * own copy_user_page that does the right thing.
45 */
46static void __attribute__((naked))
47mc_copy_user_page(void *from, void *to)
48{
49 asm volatile(
50 "stmfd sp!, {r4, lr} @ 2\n\
51 mov r4, %2 @ 1\n\
52 ldmia %0!, {r2, r3, ip, lr} @ 4\n\
531: mcr p15, 0, %1, c7, c6, 1 @ 1 invalidate D line\n\
54 stmia %1!, {r2, r3, ip, lr} @ 4\n\
55 ldmia %0!, {r2, r3, ip, lr} @ 4+1\n\
56 stmia %1!, {r2, r3, ip, lr} @ 4\n\
57 ldmia %0!, {r2, r3, ip, lr} @ 4\n\
58 mcr p15, 0, %1, c7, c6, 1 @ 1 invalidate D line\n\
59 stmia %1!, {r2, r3, ip, lr} @ 4\n\
60 ldmia %0!, {r2, r3, ip, lr} @ 4\n\
61 subs r4, r4, #1 @ 1\n\
62 stmia %1!, {r2, r3, ip, lr} @ 4\n\
63 ldmneia %0!, {r2, r3, ip, lr} @ 4\n\
64 bne 1b @ 1\n\
65 ldmfd sp!, {r4, pc} @ 3"
66 :
67 : "r" (from), "r" (to), "I" (PAGE_SIZE / 64));
68}
69
70void v4_mc_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
71{
72 spin_lock(&minicache_lock);
73
74 set_pte(TOP_PTE(0xffff8000), pfn_pte(__pa(kfrom) >> PAGE_SHIFT, minicache_pgprot));
75 flush_tlb_kernel_page(0xffff8000);
76
77 mc_copy_user_page((void *)0xffff8000, kto);
78
79 spin_unlock(&minicache_lock);
80}
81
82/*
83 * ARMv4 optimised clear_user_page
84 */
85void __attribute__((naked))
86v4_mc_clear_user_page(void *kaddr, unsigned long vaddr)
87{
88 asm volatile(
89 "str lr, [sp, #-4]!\n\
90 mov r1, %0 @ 1\n\
91 mov r2, #0 @ 1\n\
92 mov r3, #0 @ 1\n\
93 mov ip, #0 @ 1\n\
94 mov lr, #0 @ 1\n\
951: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\
96 stmia r0!, {r2, r3, ip, lr} @ 4\n\
97 stmia r0!, {r2, r3, ip, lr} @ 4\n\
98 mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\
99 stmia r0!, {r2, r3, ip, lr} @ 4\n\
100 stmia r0!, {r2, r3, ip, lr} @ 4\n\
101 subs r1, r1, #1 @ 1\n\
102 bne 1b @ 1\n\
103 ldr pc, [sp], #4"
104 :
105 : "I" (PAGE_SIZE / 64));
106}
107
108struct cpu_user_fns v4_mc_user_fns __initdata = {
109 .cpu_clear_user_page = v4_mc_clear_user_page,
110 .cpu_copy_user_page = v4_mc_copy_user_page,
111};
diff --git a/arch/arm/mm/copypage-v6.c b/arch/arm/mm/copypage-v6.c
index 694ac8208858..27d041574ea7 100644
--- a/arch/arm/mm/copypage-v6.c
+++ b/arch/arm/mm/copypage-v6.c
@@ -26,11 +26,9 @@
26#define to_address (0xffffc000) 26#define to_address (0xffffc000)
27#define to_pgprot PAGE_KERNEL 27#define to_pgprot PAGE_KERNEL
28 28
29static pte_t *from_pte; 29#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
30static pte_t *to_pte;
31static DEFINE_SPINLOCK(v6_lock);
32 30
33#define DCACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT) 31static DEFINE_SPINLOCK(v6_lock);
34 32
35/* 33/*
36 * Copy the user page. No aliasing to deal with so we can just 34 * Copy the user page. No aliasing to deal with so we can just
@@ -55,7 +53,7 @@ void v6_clear_user_page_nonaliasing(void *kaddr, unsigned long vaddr)
55 */ 53 */
56void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vaddr) 54void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vaddr)
57{ 55{
58 unsigned int offset = DCACHE_COLOUR(vaddr); 56 unsigned int offset = CACHE_COLOUR(vaddr);
59 unsigned long from, to; 57 unsigned long from, to;
60 58
61 /* 59 /*
@@ -74,8 +72,8 @@ void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vadd
74 */ 72 */
75 spin_lock(&v6_lock); 73 spin_lock(&v6_lock);
76 74
77 set_pte(from_pte + offset, pfn_pte(__pa(kfrom) >> PAGE_SHIFT, from_pgprot)); 75 set_pte(TOP_PTE(from_address) + offset, pfn_pte(__pa(kfrom) >> PAGE_SHIFT, from_pgprot));
78 set_pte(to_pte + offset, pfn_pte(__pa(kto) >> PAGE_SHIFT, to_pgprot)); 76 set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kto) >> PAGE_SHIFT, to_pgprot));
79 77
80 from = from_address + (offset << PAGE_SHIFT); 78 from = from_address + (offset << PAGE_SHIFT);
81 to = to_address + (offset << PAGE_SHIFT); 79 to = to_address + (offset << PAGE_SHIFT);
@@ -95,7 +93,7 @@ void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vadd
95 */ 93 */
96void v6_clear_user_page_aliasing(void *kaddr, unsigned long vaddr) 94void v6_clear_user_page_aliasing(void *kaddr, unsigned long vaddr)
97{ 95{
98 unsigned int offset = DCACHE_COLOUR(vaddr); 96 unsigned int offset = CACHE_COLOUR(vaddr);
99 unsigned long to = to_address + (offset << PAGE_SHIFT); 97 unsigned long to = to_address + (offset << PAGE_SHIFT);
100 98
101 /* 99 /*
@@ -114,7 +112,7 @@ void v6_clear_user_page_aliasing(void *kaddr, unsigned long vaddr)
114 */ 112 */
115 spin_lock(&v6_lock); 113 spin_lock(&v6_lock);
116 114
117 set_pte(to_pte + offset, pfn_pte(__pa(kaddr) >> PAGE_SHIFT, to_pgprot)); 115 set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kaddr) >> PAGE_SHIFT, to_pgprot));
118 flush_tlb_kernel_page(to); 116 flush_tlb_kernel_page(to);
119 clear_page((void *)to); 117 clear_page((void *)to);
120 118
@@ -129,21 +127,6 @@ struct cpu_user_fns v6_user_fns __initdata = {
129static int __init v6_userpage_init(void) 127static int __init v6_userpage_init(void)
130{ 128{
131 if (cache_is_vipt_aliasing()) { 129 if (cache_is_vipt_aliasing()) {
132 pgd_t *pgd;
133 pmd_t *pmd;
134
135 pgd = pgd_offset_k(from_address);
136 pmd = pmd_alloc(&init_mm, pgd, from_address);
137 if (!pmd)
138 BUG();
139 from_pte = pte_alloc_kernel(&init_mm, pmd, from_address);
140 if (!from_pte)
141 BUG();
142
143 to_pte = pte_alloc_kernel(&init_mm, pmd, to_address);
144 if (!to_pte)
145 BUG();
146
147 cpu_user.cpu_clear_user_page = v6_clear_user_page_aliasing; 130 cpu_user.cpu_clear_user_page = v6_clear_user_page_aliasing;
148 cpu_user.cpu_copy_user_page = v6_copy_user_page_aliasing; 131 cpu_user.cpu_copy_user_page = v6_copy_user_page_aliasing;
149 } 132 }
@@ -151,5 +134,4 @@ static int __init v6_userpage_init(void)
151 return 0; 134 return 0;
152} 135}
153 136
154__initcall(v6_userpage_init); 137core_initcall(v6_userpage_init);
155
diff --git a/arch/arm/mm/copypage-xscale.S b/arch/arm/mm/copypage-xscale.S
deleted file mode 100644
index bb277316ef52..000000000000
--- a/arch/arm/mm/copypage-xscale.S
+++ /dev/null
@@ -1,113 +0,0 @@
1/*
2 * linux/arch/arm/lib/copypage-xscale.S
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/linkage.h>
11#include <linux/init.h>
12#include <asm/constants.h>
13
14/*
15 * General note:
16 * We don't really want write-allocate cache behaviour for these functions
17 * since that will just eat through 8K of the cache.
18 */
19
20 .text
21 .align 5
22/*
23 * XScale optimised copy_user_page
24 * r0 = destination
25 * r1 = source
26 * r2 = virtual user address of ultimate destination page
27 *
28 * The source page may have some clean entries in the cache already, but we
29 * can safely ignore them - break_cow() will flush them out of the cache
30 * if we eventually end up using our copied page.
31 *
32 * What we could do is use the mini-cache to buffer reads from the source
33 * page. We rely on the mini-cache being smaller than one page, so we'll
34 * cycle through the complete cache anyway.
35 */
36ENTRY(xscale_mc_copy_user_page)
37 stmfd sp!, {r4, r5, lr}
38 mov r5, r0
39 mov r0, r1
40 bl map_page_minicache
41 mov r1, r5
42 mov lr, #PAGE_SZ/64-1
43
44 /*
45 * Strangely enough, best performance is achieved
46 * when prefetching destination as well. (NP)
47 */
48 pld [r0, #0]
49 pld [r0, #32]
50 pld [r1, #0]
51 pld [r1, #32]
52
531: pld [r0, #64]
54 pld [r0, #96]
55 pld [r1, #64]
56 pld [r1, #96]
57
582: ldrd r2, [r0], #8
59 ldrd r4, [r0], #8
60 mov ip, r1
61 strd r2, [r1], #8
62 ldrd r2, [r0], #8
63 strd r4, [r1], #8
64 ldrd r4, [r0], #8
65 strd r2, [r1], #8
66 strd r4, [r1], #8
67 mcr p15, 0, ip, c7, c10, 1 @ clean D line
68 ldrd r2, [r0], #8
69 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
70 ldrd r4, [r0], #8
71 mov ip, r1
72 strd r2, [r1], #8
73 ldrd r2, [r0], #8
74 strd r4, [r1], #8
75 ldrd r4, [r0], #8
76 strd r2, [r1], #8
77 strd r4, [r1], #8
78 mcr p15, 0, ip, c7, c10, 1 @ clean D line
79 subs lr, lr, #1
80 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
81 bgt 1b
82 beq 2b
83
84 ldmfd sp!, {r4, r5, pc}
85
86 .align 5
87/*
88 * XScale optimised clear_user_page
89 * r0 = destination
90 * r1 = virtual user address of ultimate destination page
91 */
92ENTRY(xscale_mc_clear_user_page)
93 mov r1, #PAGE_SZ/32
94 mov r2, #0
95 mov r3, #0
961: mov ip, r0
97 strd r2, [r0], #8
98 strd r2, [r0], #8
99 strd r2, [r0], #8
100 strd r2, [r0], #8
101 mcr p15, 0, ip, c7, c10, 1 @ clean D line
102 subs r1, r1, #1
103 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
104 bne 1b
105 mov pc, lr
106
107 __INITDATA
108
109 .type xscale_mc_user_fns, #object
110ENTRY(xscale_mc_user_fns)
111 .long xscale_mc_clear_user_page
112 .long xscale_mc_copy_user_page
113 .size xscale_mc_user_fns, . - xscale_mc_user_fns
diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c
new file mode 100644
index 000000000000..42a6ee255ce0
--- /dev/null
+++ b/arch/arm/mm/copypage-xscale.c
@@ -0,0 +1,131 @@
1/*
2 * linux/arch/arm/lib/copypage-xscale.S
3 *
4 * Copyright (C) 1995-2005 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This handles the mini data cache, as found on SA11x0 and XScale
11 * processors. When we copy a user page page, we map it in such a way
12 * that accesses to this page will not touch the main data cache, but
13 * will be cached in the mini data cache. This prevents us thrashing
14 * the main data cache on page faults.
15 */
16#include <linux/init.h>
17#include <linux/mm.h>
18
19#include <asm/page.h>
20#include <asm/pgtable.h>
21#include <asm/tlbflush.h>
22
23/*
24 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
25 * specific hacks for copying pages efficiently.
26 */
27#define COPYPAGE_MINICACHE 0xffff8000
28
29#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
30 L_PTE_CACHEABLE)
31
32#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
33
34static DEFINE_SPINLOCK(minicache_lock);
35
36/*
37 * XScale mini-dcache optimised copy_user_page
38 *
39 * We flush the destination cache lines just before we write the data into the
40 * corresponding address. Since the Dcache is read-allocate, this removes the
41 * Dcache aliasing issue. The writes will be forwarded to the write buffer,
42 * and merged as appropriate.
43 */
44static void __attribute__((naked))
45mc_copy_user_page(void *from, void *to)
46{
47 /*
48 * Strangely enough, best performance is achieved
49 * when prefetching destination as well. (NP)
50 */
51 asm volatile(
52 "stmfd sp!, {r4, r5, lr} \n\
53 mov lr, %2 \n\
54 pld [r0, #0] \n\
55 pld [r0, #32] \n\
56 pld [r1, #0] \n\
57 pld [r1, #32] \n\
581: pld [r0, #64] \n\
59 pld [r0, #96] \n\
60 pld [r1, #64] \n\
61 pld [r1, #96] \n\
622: ldrd r2, [r0], #8 \n\
63 ldrd r4, [r0], #8 \n\
64 mov ip, r1 \n\
65 strd r2, [r1], #8 \n\
66 ldrd r2, [r0], #8 \n\
67 strd r4, [r1], #8 \n\
68 ldrd r4, [r0], #8 \n\
69 strd r2, [r1], #8 \n\
70 strd r4, [r1], #8 \n\
71 mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\
72 ldrd r2, [r0], #8 \n\
73 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\
74 ldrd r4, [r0], #8 \n\
75 mov ip, r1 \n\
76 strd r2, [r1], #8 \n\
77 ldrd r2, [r0], #8 \n\
78 strd r4, [r1], #8 \n\
79 ldrd r4, [r0], #8 \n\
80 strd r2, [r1], #8 \n\
81 strd r4, [r1], #8 \n\
82 mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\
83 subs lr, lr, #1 \n\
84 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\
85 bgt 1b \n\
86 beq 2b \n\
87 ldmfd sp!, {r4, r5, pc} "
88 :
89 : "r" (from), "r" (to), "I" (PAGE_SIZE / 64 - 1));
90}
91
92void xscale_mc_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
93{
94 spin_lock(&minicache_lock);
95
96 set_pte(TOP_PTE(COPYPAGE_MINICACHE), pfn_pte(__pa(kfrom) >> PAGE_SHIFT, minicache_pgprot));
97 flush_tlb_kernel_page(COPYPAGE_MINICACHE);
98
99 mc_copy_user_page((void *)COPYPAGE_MINICACHE, kto);
100
101 spin_unlock(&minicache_lock);
102}
103
104/*
105 * XScale optimised clear_user_page
106 */
107void __attribute__((naked))
108xscale_mc_clear_user_page(void *kaddr, unsigned long vaddr)
109{
110 asm volatile(
111 "mov r1, %0 \n\
112 mov r2, #0 \n\
113 mov r3, #0 \n\
1141: mov ip, r0 \n\
115 strd r2, [r0], #8 \n\
116 strd r2, [r0], #8 \n\
117 strd r2, [r0], #8 \n\
118 strd r2, [r0], #8 \n\
119 mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\
120 subs r1, r1, #1 \n\
121 mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\
122 bne 1b \n\
123 mov pc, lr"
124 :
125 : "I" (PAGE_SIZE / 32));
126}
127
128struct cpu_user_fns xscale_mc_user_fns __initdata = {
129 .cpu_clear_user_page = xscale_mc_clear_user_page,
130 .cpu_copy_user_page = xscale_mc_copy_user_page,
131};
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index 01967ddeef53..be4ab3d73c91 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -77,9 +77,8 @@ no_pmd:
77} 77}
78 78
79static void 79static void
80make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page, int dirty) 80make_coherent(struct address_space *mapping, struct vm_area_struct *vma, unsigned long addr, unsigned long pfn)
81{ 81{
82 struct address_space *mapping = page_mapping(page);
83 struct mm_struct *mm = vma->vm_mm; 82 struct mm_struct *mm = vma->vm_mm;
84 struct vm_area_struct *mpnt; 83 struct vm_area_struct *mpnt;
85 struct prio_tree_iter iter; 84 struct prio_tree_iter iter;
@@ -87,9 +86,6 @@ make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page,
87 pgoff_t pgoff; 86 pgoff_t pgoff;
88 int aliases = 0; 87 int aliases = 0;
89 88
90 if (!mapping)
91 return;
92
93 pgoff = vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT); 89 pgoff = vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT);
94 90
95 /* 91 /*
@@ -115,9 +111,11 @@ make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page,
115 if (aliases) 111 if (aliases)
116 adjust_pte(vma, addr); 112 adjust_pte(vma, addr);
117 else 113 else
118 flush_cache_page(vma, addr, page_to_pfn(page)); 114 flush_cache_page(vma, addr, pfn);
119} 115}
120 116
117void __flush_dcache_page(struct address_space *mapping, struct page *page);
118
121/* 119/*
122 * Take care of architecture specific things when placing a new PTE into 120 * Take care of architecture specific things when placing a new PTE into
123 * a page table, or changing an existing PTE. Basically, there are two 121 * a page table, or changing an existing PTE. Basically, there are two
@@ -134,29 +132,22 @@ make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page,
134void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte) 132void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
135{ 133{
136 unsigned long pfn = pte_pfn(pte); 134 unsigned long pfn = pte_pfn(pte);
135 struct address_space *mapping;
137 struct page *page; 136 struct page *page;
138 137
139 if (!pfn_valid(pfn)) 138 if (!pfn_valid(pfn))
140 return; 139 return;
140
141 page = pfn_to_page(pfn); 141 page = pfn_to_page(pfn);
142 if (page_mapping(page)) { 142 mapping = page_mapping(page);
143 if (mapping) {
143 int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); 144 int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);
144 145
145 if (dirty) { 146 if (dirty)
146 /* 147 __flush_dcache_page(mapping, page);
147 * This is our first userspace mapping of this page.
148 * Ensure that the physical page is coherent with
149 * the kernel mapping.
150 *
151 * FIXME: only need to do this on VIVT and aliasing
152 * VIPT cache architectures. We can do that
153 * by choosing whether to set this bit...
154 */
155 __cpuc_flush_dcache_page(page_address(page));
156 }
157 148
158 if (cache_is_vivt()) 149 if (cache_is_vivt())
159 make_coherent(vma, addr, page, dirty); 150 make_coherent(mapping, vma, addr, pfn);
160 } 151 }
161} 152}
162 153
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index c6de48d89503..191788fb18d1 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -13,14 +13,32 @@
13 13
14#include <asm/cacheflush.h> 14#include <asm/cacheflush.h>
15#include <asm/system.h> 15#include <asm/system.h>
16#include <asm/tlbflush.h>
16 17
17static void __flush_dcache_page(struct address_space *mapping, struct page *page) 18#ifdef CONFIG_CPU_CACHE_VIPT
19#define ALIAS_FLUSH_START 0xffff4000
20
21#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
22
23static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
18{ 24{
19 struct mm_struct *mm = current->active_mm; 25 unsigned long to = ALIAS_FLUSH_START + (CACHE_COLOUR(vaddr) << PAGE_SHIFT);
20 struct vm_area_struct *mpnt; 26
21 struct prio_tree_iter iter; 27 set_pte(TOP_PTE(to), pfn_pte(pfn, PAGE_KERNEL));
22 pgoff_t pgoff; 28 flush_tlb_kernel_page(to);
23 29
30 asm( "mcrr p15, 0, %1, %0, c14\n"
31 " mcrr p15, 0, %1, %0, c5\n"
32 :
33 : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES)
34 : "cc");
35}
36#else
37#define flush_pfn_alias(pfn,vaddr) do { } while (0)
38#endif
39
40void __flush_dcache_page(struct address_space *mapping, struct page *page)
41{
24 /* 42 /*
25 * Writeback any data associated with the kernel mapping of this 43 * Writeback any data associated with the kernel mapping of this
26 * page. This ensures that data in the physical page is mutually 44 * page. This ensures that data in the physical page is mutually
@@ -29,12 +47,21 @@ static void __flush_dcache_page(struct address_space *mapping, struct page *page
29 __cpuc_flush_dcache_page(page_address(page)); 47 __cpuc_flush_dcache_page(page_address(page));
30 48
31 /* 49 /*
32 * If there's no mapping pointer here, then this page isn't 50 * If this is a page cache page, and we have an aliasing VIPT cache,
33 * visible to userspace yet, so there are no cache lines 51 * we only need to do one flush - which would be at the relevant
34 * associated with any other aliases. 52 * userspace colour, which is congruent with page->index.
35 */ 53 */
36 if (!mapping) 54 if (mapping && cache_is_vipt_aliasing())
37 return; 55 flush_pfn_alias(page_to_pfn(page),
56 page->index << PAGE_CACHE_SHIFT);
57}
58
59static void __flush_dcache_aliases(struct address_space *mapping, struct page *page)
60{
61 struct mm_struct *mm = current->active_mm;
62 struct vm_area_struct *mpnt;
63 struct prio_tree_iter iter;
64 pgoff_t pgoff;
38 65
39 /* 66 /*
40 * There are possible user space mappings of this page: 67 * There are possible user space mappings of this page:
@@ -57,8 +84,6 @@ static void __flush_dcache_page(struct address_space *mapping, struct page *page
57 continue; 84 continue;
58 offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT; 85 offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
59 flush_cache_page(mpnt, mpnt->vm_start + offset, page_to_pfn(page)); 86 flush_cache_page(mpnt, mpnt->vm_start + offset, page_to_pfn(page));
60 if (cache_is_vipt())
61 break;
62 } 87 }
63 flush_dcache_mmap_unlock(mapping); 88 flush_dcache_mmap_unlock(mapping);
64} 89}
@@ -83,12 +108,12 @@ void flush_dcache_page(struct page *page)
83{ 108{
84 struct address_space *mapping = page_mapping(page); 109 struct address_space *mapping = page_mapping(page);
85 110
86 if (cache_is_vipt_nonaliasing())
87 return;
88
89 if (mapping && !mapping_mapped(mapping)) 111 if (mapping && !mapping_mapped(mapping))
90 set_bit(PG_dcache_dirty, &page->flags); 112 set_bit(PG_dcache_dirty, &page->flags);
91 else 113 else {
92 __flush_dcache_page(mapping, page); 114 __flush_dcache_page(mapping, page);
115 if (mapping && cache_is_vivt())
116 __flush_dcache_aliases(mapping, page);
117 }
93} 118}
94EXPORT_SYMBOL(flush_dcache_page); 119EXPORT_SYMBOL(flush_dcache_page);
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 00bb8fd37a59..7110e54182b1 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -170,3 +170,50 @@ void __iounmap(void __iomem *addr)
170 vfree((void *) (PAGE_MASK & (unsigned long) addr)); 170 vfree((void *) (PAGE_MASK & (unsigned long) addr));
171} 171}
172EXPORT_SYMBOL(__iounmap); 172EXPORT_SYMBOL(__iounmap);
173
174#ifdef __io
175void __iomem *ioport_map(unsigned long port, unsigned int nr)
176{
177 return __io(port);
178}
179EXPORT_SYMBOL(ioport_map);
180
181void ioport_unmap(void __iomem *addr)
182{
183}
184EXPORT_SYMBOL(ioport_unmap);
185#endif
186
187#ifdef CONFIG_PCI
188#include <linux/pci.h>
189#include <linux/ioport.h>
190
191void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
192{
193 unsigned long start = pci_resource_start(dev, bar);
194 unsigned long len = pci_resource_len(dev, bar);
195 unsigned long flags = pci_resource_flags(dev, bar);
196
197 if (!len || !start)
198 return NULL;
199 if (maxlen && len > maxlen)
200 len = maxlen;
201 if (flags & IORESOURCE_IO)
202 return ioport_map(start, len);
203 if (flags & IORESOURCE_MEM) {
204 if (flags & IORESOURCE_CACHEABLE)
205 return ioremap(start, len);
206 return ioremap_nocache(start, len);
207 }
208 return NULL;
209}
210EXPORT_SYMBOL(pci_iomap);
211
212void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
213{
214 if ((unsigned long)addr >= VMALLOC_START &&
215 (unsigned long)addr < VMALLOC_END)
216 iounmap(addr);
217}
218EXPORT_SYMBOL(pci_iounmap);
219#endif
diff --git a/arch/arm/mm/minicache.c b/arch/arm/mm/minicache.c
deleted file mode 100644
index dedf2ab01b2a..000000000000
--- a/arch/arm/mm/minicache.c
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 * linux/arch/arm/mm/minicache.c
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This handles the mini data cache, as found on SA11x0 and XScale
11 * processors. When we copy a user page page, we map it in such a way
12 * that accesses to this page will not touch the main data cache, but
13 * will be cached in the mini data cache. This prevents us thrashing
14 * the main data cache on page faults.
15 */
16#include <linux/init.h>
17#include <linux/mm.h>
18
19#include <asm/page.h>
20#include <asm/pgtable.h>
21#include <asm/tlbflush.h>
22
23/*
24 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
25 * specific hacks for copying pages efficiently.
26 */
27#define minicache_address (0xffff8000)
28#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
29 L_PTE_CACHEABLE)
30
31static pte_t *minicache_pte;
32
33/*
34 * Note that this is intended to be called only from the copy_user_page
35 * asm code; anything else will require special locking to prevent the
36 * mini-cache space being re-used. (Note: probably preempt unsafe).
37 *
38 * We rely on the fact that the minicache is 2K, and we'll be pushing
39 * 4K of data through it, so we don't actually have to specifically
40 * flush the minicache when we change the mapping.
41 *
42 * Note also: assert(PAGE_OFFSET <= virt < high_memory).
43 * Unsafe: preempt, kmap.
44 */
45unsigned long map_page_minicache(unsigned long virt)
46{
47 set_pte(minicache_pte, pfn_pte(__pa(virt) >> PAGE_SHIFT, minicache_pgprot));
48 flush_tlb_kernel_page(minicache_address);
49
50 return minicache_address;
51}
52
53static int __init minicache_init(void)
54{
55 pgd_t *pgd;
56 pmd_t *pmd;
57
58 spin_lock(&init_mm.page_table_lock);
59
60 pgd = pgd_offset_k(minicache_address);
61 pmd = pmd_alloc(&init_mm, pgd, minicache_address);
62 if (!pmd)
63 BUG();
64 minicache_pte = pte_alloc_kernel(&init_mm, pmd, minicache_address);
65 if (!minicache_pte)
66 BUG();
67
68 spin_unlock(&init_mm.page_table_lock);
69
70 return 0;
71}
72
73core_initcall(minicache_init);
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index 585dfb8e20b9..2c2b93d77d43 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -37,6 +37,8 @@ pgprot_t pgprot_kernel;
37 37
38EXPORT_SYMBOL(pgprot_kernel); 38EXPORT_SYMBOL(pgprot_kernel);
39 39
40pmd_t *top_pmd;
41
40struct cachepolicy { 42struct cachepolicy {
41 const char policy[16]; 43 const char policy[16];
42 unsigned int cr_mask; 44 unsigned int cr_mask;
@@ -142,6 +144,16 @@ __setup("noalign", noalign_setup);
142 144
143#define FIRST_KERNEL_PGD_NR (FIRST_USER_PGD_NR + USER_PTRS_PER_PGD) 145#define FIRST_KERNEL_PGD_NR (FIRST_USER_PGD_NR + USER_PTRS_PER_PGD)
144 146
147static inline pmd_t *pmd_off(pgd_t *pgd, unsigned long virt)
148{
149 return pmd_offset(pgd, virt);
150}
151
152static inline pmd_t *pmd_off_k(unsigned long virt)
153{
154 return pmd_off(pgd_offset_k(virt), virt);
155}
156
145/* 157/*
146 * need to get a 16k page for level 1 158 * need to get a 16k page for level 1
147 */ 159 */
@@ -220,7 +232,7 @@ void free_pgd_slow(pgd_t *pgd)
220 return; 232 return;
221 233
222 /* pgd is always present and good */ 234 /* pgd is always present and good */
223 pmd = (pmd_t *)pgd; 235 pmd = pmd_off(pgd, 0);
224 if (pmd_none(*pmd)) 236 if (pmd_none(*pmd))
225 goto free; 237 goto free;
226 if (pmd_bad(*pmd)) { 238 if (pmd_bad(*pmd)) {
@@ -246,9 +258,8 @@ free:
246static inline void 258static inline void
247alloc_init_section(unsigned long virt, unsigned long phys, int prot) 259alloc_init_section(unsigned long virt, unsigned long phys, int prot)
248{ 260{
249 pmd_t *pmdp; 261 pmd_t *pmdp = pmd_off_k(virt);
250 262
251 pmdp = pmd_offset(pgd_offset_k(virt), virt);
252 if (virt & (1 << 20)) 263 if (virt & (1 << 20))
253 pmdp++; 264 pmdp++;
254 265
@@ -283,11 +294,9 @@ alloc_init_supersection(unsigned long virt, unsigned long phys, int prot)
283static inline void 294static inline void
284alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pgprot_t prot) 295alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pgprot_t prot)
285{ 296{
286 pmd_t *pmdp; 297 pmd_t *pmdp = pmd_off_k(virt);
287 pte_t *ptep; 298 pte_t *ptep;
288 299
289 pmdp = pmd_offset(pgd_offset_k(virt), virt);
290
291 if (pmd_none(*pmdp)) { 300 if (pmd_none(*pmdp)) {
292 unsigned long pmdval; 301 unsigned long pmdval;
293 ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * 302 ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE *
@@ -310,7 +319,7 @@ alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pg
310 */ 319 */
311static inline void clear_mapping(unsigned long virt) 320static inline void clear_mapping(unsigned long virt)
312{ 321{
313 pmd_clear(pmd_offset(pgd_offset_k(virt), virt)); 322 pmd_clear(pmd_off_k(virt));
314} 323}
315 324
316struct mem_types { 325struct mem_types {
@@ -578,7 +587,7 @@ void setup_mm_for_reboot(char mode)
578 PMD_TYPE_SECT; 587 PMD_TYPE_SECT;
579 if (cpu_arch <= CPU_ARCH_ARMv5) 588 if (cpu_arch <= CPU_ARCH_ARMv5)
580 pmdval |= PMD_BIT4; 589 pmdval |= PMD_BIT4;
581 pmd = pmd_offset(pgd + i, i << PGDIR_SHIFT); 590 pmd = pmd_off(pgd, i << PGDIR_SHIFT);
582 pmd[0] = __pmd(pmdval); 591 pmd[0] = __pmd(pmdval);
583 pmd[1] = __pmd(pmdval + (1 << (PGDIR_SHIFT - 1))); 592 pmd[1] = __pmd(pmdval + (1 << (PGDIR_SHIFT - 1)));
584 flush_pmd_entry(pmd); 593 flush_pmd_entry(pmd);
@@ -675,6 +684,8 @@ void __init memtable_init(struct meminfo *mi)
675 684
676 flush_cache_all(); 685 flush_cache_all();
677 flush_tlb_all(); 686 flush_tlb_all();
687
688 top_pmd = pmd_off_k(0xffff0000);
678} 689}
679 690
680/* 691/*
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index 32c4b0e35b37..3de7f84b53c2 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -73,7 +73,12 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
73 (!vma || addr + len <= vma->vm_start)) 73 (!vma || addr + len <= vma->vm_start))
74 return addr; 74 return addr;
75 } 75 }
76 start_addr = addr = mm->free_area_cache; 76 if (len > mm->cached_hole_size) {
77 start_addr = addr = mm->free_area_cache;
78 } else {
79 start_addr = addr = TASK_UNMAPPED_BASE;
80 mm->cached_hole_size = 0;
81 }
77 82
78full_search: 83full_search:
79 if (do_align) 84 if (do_align)
@@ -90,6 +95,7 @@ full_search:
90 */ 95 */
91 if (start_addr != TASK_UNMAPPED_BASE) { 96 if (start_addr != TASK_UNMAPPED_BASE) {
92 start_addr = addr = TASK_UNMAPPED_BASE; 97 start_addr = addr = TASK_UNMAPPED_BASE;
98 mm->cached_hole_size = 0;
93 goto full_search; 99 goto full_search;
94 } 100 }
95 return -ENOMEM; 101 return -ENOMEM;
@@ -101,6 +107,8 @@ full_search:
101 mm->free_area_cache = addr + len; 107 mm->free_area_cache = addr + len;
102 return addr; 108 return addr;
103 } 109 }
110 if (addr + mm->cached_hole_size < vma->vm_start)
111 mm->cached_hole_size = vma->vm_start - addr;
104 addr = vma->vm_end; 112 addr = vma->vm_end;
105 if (do_align) 113 if (do_align)
106 addr = COLOUR_ALIGN(addr, pgoff); 114 addr = COLOUR_ALIGN(addr, pgoff);
diff --git a/arch/arm26/kernel/ecard.c b/arch/arm26/kernel/ecard.c
index 824c6b571ad9..f2278aadac8a 100644
--- a/arch/arm26/kernel/ecard.c
+++ b/arch/arm26/kernel/ecard.c
@@ -562,31 +562,31 @@ static void __init ecard_init_resources(struct expansion_card *ec)
562 } 562 }
563} 563}
564 564
565static ssize_t ecard_show_irq(struct device *dev, char *buf) 565static ssize_t ecard_show_irq(struct device *dev, struct device_attribute *attr, char *buf)
566{ 566{
567 struct expansion_card *ec = ECARD_DEV(dev); 567 struct expansion_card *ec = ECARD_DEV(dev);
568 return sprintf(buf, "%u\n", ec->irq); 568 return sprintf(buf, "%u\n", ec->irq);
569} 569}
570 570
571static ssize_t ecard_show_vendor(struct device *dev, char *buf) 571static ssize_t ecard_show_vendor(struct device *dev, struct device_attribute *attr, char *buf)
572{ 572{
573 struct expansion_card *ec = ECARD_DEV(dev); 573 struct expansion_card *ec = ECARD_DEV(dev);
574 return sprintf(buf, "%u\n", ec->cid.manufacturer); 574 return sprintf(buf, "%u\n", ec->cid.manufacturer);
575} 575}
576 576
577static ssize_t ecard_show_device(struct device *dev, char *buf) 577static ssize_t ecard_show_device(struct device *dev, struct device_attribute *attr, char *buf)
578{ 578{
579 struct expansion_card *ec = ECARD_DEV(dev); 579 struct expansion_card *ec = ECARD_DEV(dev);
580 return sprintf(buf, "%u\n", ec->cid.product); 580 return sprintf(buf, "%u\n", ec->cid.product);
581} 581}
582 582
583static ssize_t ecard_show_dma(struct device *dev, char *buf) 583static ssize_t ecard_show_dma(struct device *dev, struct device_attribute *attr, char *buf)
584{ 584{
585 struct expansion_card *ec = ECARD_DEV(dev); 585 struct expansion_card *ec = ECARD_DEV(dev);
586 return sprintf(buf, "%u\n", ec->dma); 586 return sprintf(buf, "%u\n", ec->dma);
587} 587}
588 588
589static ssize_t ecard_show_resources(struct device *dev, char *buf) 589static ssize_t ecard_show_resources(struct device *dev, struct device_attribute *attr, char *buf)
590{ 590{
591 struct expansion_card *ec = ECARD_DEV(dev); 591 struct expansion_card *ec = ECARD_DEV(dev);
592 char *str = buf; 592 char *str = buf;
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c
index 41958f57c838..79433159b5f0 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -169,7 +169,6 @@ void __init mem_init(void)
169 struct page *page = &mem_map[pfn]; 169 struct page *page = &mem_map[pfn];
170 170
171 ClearPageReserved(page); 171 ClearPageReserved(page);
172 set_bit(PG_highmem, &page->flags);
173 set_page_count(page, 1); 172 set_page_count(page, 1);
174 __free_page(page); 173 __free_page(page);
175 totalram_pages++; 174 totalram_pages++;
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index 134aec1c6d19..b5f83e9f04db 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -54,7 +54,7 @@ asmlinkage void ret_from_fork(void);
54void default_idle(void) 54void default_idle(void)
55{ 55{
56 while(1) { 56 while(1) {
57 if (need_resched()) { 57 if (!need_resched()) {
58 local_irq_enable(); 58 local_irq_enable();
59 __asm__("sleep"); 59 __asm__("sleep");
60 local_irq_disable(); 60 local_irq_disable();
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index e382f32d435e..dfd904f6883b 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -1163,7 +1163,7 @@ config PCI_DIRECT
1163 1163
1164config PCI_MMCONFIG 1164config PCI_MMCONFIG
1165 bool 1165 bool
1166 depends on PCI && (PCI_GOMMCONFIG || (PCI_GOANY && ACPI)) 1166 depends on PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
1167 select ACPI_BOOT 1167 select ACPI_BOOT
1168 default y 1168 default y
1169 1169
diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile
index aa7064a75ee6..43cd6220ee49 100644
--- a/arch/i386/boot/Makefile
+++ b/arch/i386/boot/Makefile
@@ -48,7 +48,7 @@ cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \
48$(obj)/zImage $(obj)/bzImage: $(obj)/bootsect $(obj)/setup \ 48$(obj)/zImage $(obj)/bzImage: $(obj)/bootsect $(obj)/setup \
49 $(obj)/vmlinux.bin $(obj)/tools/build FORCE 49 $(obj)/vmlinux.bin $(obj)/tools/build FORCE
50 $(call if_changed,image) 50 $(call if_changed,image)
51 @echo 'Kernel: $@ is ready' 51 @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
52 52
53$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE 53$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
54 $(call if_changed,objcopy) 54 $(call if_changed,objcopy)
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 0fbcfe00dd8d..51ecd512603d 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -43,7 +43,7 @@ obj-$(CONFIG_SCx200) += scx200.o
43# Note: kbuild does not track this dependency due to usage of .incbin 43# Note: kbuild does not track this dependency due to usage of .incbin
44$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so 44$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so
45targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so) 45targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
46targets += vsyscall.lds 46targets += vsyscall-note.o vsyscall.lds
47 47
48# The DSO images are built using a special linker script. 48# The DSO images are built using a special linker script.
49quiet_cmd_syscall = SYSCALL $@ 49quiet_cmd_syscall = SYSCALL $@
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 45641a872550..0ff65abcd56c 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -1222,6 +1222,7 @@ static int suspend(int vetoable)
1222 1222
1223 save_processor_state(); 1223 save_processor_state();
1224 err = set_system_power_state(APM_STATE_SUSPEND); 1224 err = set_system_power_state(APM_STATE_SUSPEND);
1225 ignore_normal_resume = 1;
1225 restore_processor_state(); 1226 restore_processor_state();
1226 1227
1227 local_irq_disable(); 1228 local_irq_disable();
@@ -1229,7 +1230,6 @@ static int suspend(int vetoable)
1229 spin_lock(&i8253_lock); 1230 spin_lock(&i8253_lock);
1230 reinit_timer(); 1231 reinit_timer();
1231 set_time(); 1232 set_time();
1232 ignore_normal_resume = 1;
1233 1233
1234 spin_unlock(&i8253_lock); 1234 spin_unlock(&i8253_lock);
1235 write_sequnlock(&xtime_lock); 1235 write_sequnlock(&xtime_lock);
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c
index 16dbc4151be4..73aeaf5a9d4e 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/i386/kernel/cpu/amd.c
@@ -24,9 +24,6 @@ __asm__(".align 4\nvide: ret");
24 24
25static void __init init_amd(struct cpuinfo_x86 *c) 25static void __init init_amd(struct cpuinfo_x86 *c)
26{ 26{
27#ifdef CONFIG_X86_SMP
28 int cpu = c == &boot_cpu_data ? 0 : c - cpu_data;
29#endif
30 u32 l, h; 27 u32 l, h;
31 int mbytes = num_physpages >> (20-PAGE_SHIFT); 28 int mbytes = num_physpages >> (20-PAGE_SHIFT);
32 int r; 29 int r;
@@ -198,14 +195,19 @@ static void __init init_amd(struct cpuinfo_x86 *c)
198 c->x86_num_cores = 1; 195 c->x86_num_cores = 1;
199 } 196 }
200 197
201#ifdef CONFIG_X86_SMP 198#ifdef CONFIG_X86_HT
202 /* 199 /*
203 * On a AMD dual core setup the lower bits of the APIC id 200 * On a AMD dual core setup the lower bits of the APIC id
204 * distingush the cores. Assumes number of cores is a power 201 * distingush the cores. Assumes number of cores is a power
205 * of two. 202 * of two.
206 */ 203 */
207 if (c->x86_num_cores > 1) { 204 if (c->x86_num_cores > 1) {
208 cpu_core_id[cpu] = cpu >> hweight32(c->x86_num_cores - 1); 205 int cpu = smp_processor_id();
206 unsigned bits = 0;
207 while ((1 << bits) < c->x86_num_cores)
208 bits++;
209 cpu_core_id[cpu] = phys_proc_id[cpu] & ((1<<bits)-1);
210 phys_proc_id[cpu] >>= bits;
209 printk(KERN_INFO "CPU %d(%d) -> Core %d\n", 211 printk(KERN_INFO "CPU %d(%d) -> Core %d\n",
210 cpu, c->x86_num_cores, cpu_core_id[cpu]); 212 cpu, c->x86_num_cores, cpu_core_id[cpu]);
211 } 213 }
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index 6be0310e3cd3..d199e525680a 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -243,6 +243,10 @@ static void __init early_cpu_detect(void)
243 } 243 }
244 244
245 early_intel_workaround(c); 245 early_intel_workaround(c);
246
247#ifdef CONFIG_X86_HT
248 phys_proc_id[smp_processor_id()] = (cpuid_ebx(1) >> 24) & 0xff;
249#endif
246} 250}
247 251
248void __init generic_identify(struct cpuinfo_x86 * c) 252void __init generic_identify(struct cpuinfo_x86 * c)
diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig
index f25ffd74235c..0f1eb507233b 100644
--- a/arch/i386/kernel/cpu/cpufreq/Kconfig
+++ b/arch/i386/kernel/cpu/cpufreq/Kconfig
@@ -23,7 +23,7 @@ config X86_ACPI_CPUFREQ
23 If in doubt, say N. 23 If in doubt, say N.
24 24
25config ELAN_CPUFREQ 25config ELAN_CPUFREQ
26 tristate "AMD Elan" 26 tristate "AMD Elan SC400 and SC410"
27 select CPU_FREQ_TABLE 27 select CPU_FREQ_TABLE
28 depends on X86_ELAN 28 depends on X86_ELAN
29 ---help--- 29 ---help---
@@ -38,6 +38,18 @@ config ELAN_CPUFREQ
38 38
39 If in doubt, say N. 39 If in doubt, say N.
40 40
41config SC520_CPUFREQ
42 tristate "AMD Elan SC520"
43 select CPU_FREQ_TABLE
44 depends on X86_ELAN
45 ---help---
46 This adds the CPUFreq driver for AMD Elan SC520 processor.
47
48 For details, take a look at <file:Documentation/cpu-freq/>.
49
50 If in doubt, say N.
51
52
41config X86_POWERNOW_K6 53config X86_POWERNOW_K6
42 tristate "AMD Mobile K6-2/K6-3 PowerNow!" 54 tristate "AMD Mobile K6-2/K6-3 PowerNow!"
43 select CPU_FREQ_TABLE 55 select CPU_FREQ_TABLE
diff --git a/arch/i386/kernel/cpu/cpufreq/Makefile b/arch/i386/kernel/cpu/cpufreq/Makefile
index a922e97aeedd..2e894f1c8910 100644
--- a/arch/i386/kernel/cpu/cpufreq/Makefile
+++ b/arch/i386/kernel/cpu/cpufreq/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_X86_POWERNOW_K7) += powernow-k7.o
3obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o 3obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o
4obj-$(CONFIG_X86_LONGHAUL) += longhaul.o 4obj-$(CONFIG_X86_LONGHAUL) += longhaul.o
5obj-$(CONFIG_ELAN_CPUFREQ) += elanfreq.o 5obj-$(CONFIG_ELAN_CPUFREQ) += elanfreq.o
6obj-$(CONFIG_SC520_CPUFREQ) += sc520_freq.o
6obj-$(CONFIG_X86_LONGRUN) += longrun.o 7obj-$(CONFIG_X86_LONGRUN) += longrun.o
7obj-$(CONFIG_X86_GX_SUSPMOD) += gx-suspmod.o 8obj-$(CONFIG_X86_GX_SUSPMOD) += gx-suspmod.o
8obj-$(CONFIG_X86_SPEEDSTEP_ICH) += speedstep-ich.o 9obj-$(CONFIG_X86_SPEEDSTEP_ICH) += speedstep-ich.o
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
index ab0f9f5aac11..04e3563da4fe 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -29,6 +29,7 @@
29#include <linux/cpufreq.h> 29#include <linux/cpufreq.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/string.h> 31#include <linux/string.h>
32#include <linux/pci.h>
32 33
33#include <asm/msr.h> 34#include <asm/msr.h>
34#include <asm/timex.h> 35#include <asm/timex.h>
@@ -119,7 +120,13 @@ static int longhaul_get_cpu_mult(void)
119static void do_powersaver(union msr_longhaul *longhaul, 120static void do_powersaver(union msr_longhaul *longhaul,
120 unsigned int clock_ratio_index) 121 unsigned int clock_ratio_index)
121{ 122{
123 struct pci_dev *dev;
124 unsigned long flags;
125 unsigned int tmp_mask;
122 int version; 126 int version;
127 int i;
128 u16 pci_cmd;
129 u16 cmd_state[64];
123 130
124 switch (cpu_model) { 131 switch (cpu_model) {
125 case CPU_EZRA_T: 132 case CPU_EZRA_T:
@@ -137,17 +144,58 @@ static void do_powersaver(union msr_longhaul *longhaul,
137 longhaul->bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4; 144 longhaul->bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
138 longhaul->bits.EnableSoftBusRatio = 1; 145 longhaul->bits.EnableSoftBusRatio = 1;
139 longhaul->bits.RevisionKey = 0; 146 longhaul->bits.RevisionKey = 0;
140 local_irq_disable(); 147
141 wrmsrl(MSR_VIA_LONGHAUL, longhaul->val); 148 preempt_disable();
149 local_irq_save(flags);
150
151 /*
152 * get current pci bus master state for all devices
153 * and clear bus master bit
154 */
155 dev = NULL;
156 i = 0;
157 do {
158 dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
159 if (dev != NULL) {
160 pci_read_config_word(dev, PCI_COMMAND, &pci_cmd);
161 cmd_state[i++] = pci_cmd;
162 pci_cmd &= ~PCI_COMMAND_MASTER;
163 pci_write_config_word(dev, PCI_COMMAND, pci_cmd);
164 }
165 } while (dev != NULL);
166
167 tmp_mask=inb(0x21); /* works on C3. save mask. */
168 outb(0xFE,0x21); /* TMR0 only */
169 outb(0xFF,0x80); /* delay */
170
142 local_irq_enable(); 171 local_irq_enable();
172
173 __hlt();
174 wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
143 __hlt(); 175 __hlt();
144 176
177 local_irq_disable();
178
179 outb(tmp_mask,0x21); /* restore mask */
180
181 /* restore pci bus master state for all devices */
182 dev = NULL;
183 i = 0;
184 do {
185 dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
186 if (dev != NULL) {
187 pci_cmd = cmd_state[i++];
188 pci_write_config_byte(dev, PCI_COMMAND, pci_cmd);
189 }
190 } while (dev != NULL);
191 local_irq_restore(flags);
192 preempt_enable();
193
194 /* disable bus ratio bit */
145 rdmsrl(MSR_VIA_LONGHAUL, longhaul->val); 195 rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);
146 longhaul->bits.EnableSoftBusRatio = 0; 196 longhaul->bits.EnableSoftBusRatio = 0;
147 longhaul->bits.RevisionKey = version; 197 longhaul->bits.RevisionKey = version;
148 local_irq_disable();
149 wrmsrl(MSR_VIA_LONGHAUL, longhaul->val); 198 wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
150 local_irq_enable();
151} 199}
152 200
153/** 201/**
@@ -578,7 +626,7 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
578 longhaul_setup_voltagescaling(); 626 longhaul_setup_voltagescaling();
579 627
580 policy->governor = CPUFREQ_DEFAULT_GOVERNOR; 628 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
581 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 629 policy->cpuinfo.transition_latency = 200000; /* nsec */
582 policy->cur = calc_speed(longhaul_get_cpu_mult()); 630 policy->cur = calc_speed(longhaul_get_cpu_mult());
583 631
584 ret = cpufreq_frequency_table_cpuinfo(policy, longhaul_table); 632 ret = cpufreq_frequency_table_cpuinfo(policy, longhaul_table);
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
index 913f652623d9..5c530064eb74 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -23,6 +23,7 @@
23#include <linux/dmi.h> 23#include <linux/dmi.h>
24 24
25#include <asm/msr.h> 25#include <asm/msr.h>
26#include <asm/timer.h>
26#include <asm/timex.h> 27#include <asm/timex.h>
27#include <asm/io.h> 28#include <asm/io.h>
28#include <asm/system.h> 29#include <asm/system.h>
@@ -586,13 +587,17 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
586 587
587 rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val); 588 rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val);
588 589
589 /* A K7 with powernow technology is set to max frequency by BIOS */ 590 /* recalibrate cpu_khz */
590 fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.MFID]; 591 result = recalibrate_cpu_khz();
592 if (result)
593 return result;
594
595 fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.CFID];
591 if (!fsb) { 596 if (!fsb) {
592 printk(KERN_WARNING PFX "can not determine bus frequency\n"); 597 printk(KERN_WARNING PFX "can not determine bus frequency\n");
593 return -EINVAL; 598 return -EINVAL;
594 } 599 }
595 dprintk("FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000); 600 dprintk("FSB: %3dMHz\n", fsb/1000);
596 601
597 if (dmi_check_system(powernow_dmi_table) || acpi_force) { 602 if (dmi_check_system(powernow_dmi_table) || acpi_force) {
598 printk (KERN_INFO PFX "PSB/PST known to be broken. Trying ACPI instead\n"); 603 printk (KERN_INFO PFX "PSB/PST known to be broken. Trying ACPI instead\n");
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index a65ff7e32e5d..10cc096c0ade 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -4,7 +4,7 @@
4 * GNU general public license version 2. See "COPYING" or 4 * GNU general public license version 2. See "COPYING" or
5 * http://www.gnu.org/licenses/gpl.html 5 * http://www.gnu.org/licenses/gpl.html
6 * 6 *
7 * Support : paul.devriendt@amd.com 7 * Support : mark.langsdorf@amd.com
8 * 8 *
9 * Based on the powernow-k7.c module written by Dave Jones. 9 * Based on the powernow-k7.c module written by Dave Jones.
10 * (C) 2003 Dave Jones <davej@codemonkey.org.uk> on behalf of SuSE Labs 10 * (C) 2003 Dave Jones <davej@codemonkey.org.uk> on behalf of SuSE Labs
@@ -15,12 +15,13 @@
15 * 15 *
16 * Valuable input gratefully received from Dave Jones, Pavel Machek, 16 * Valuable input gratefully received from Dave Jones, Pavel Machek,
17 * Dominik Brodowski, and others. 17 * Dominik Brodowski, and others.
18 * Originally developed by Paul Devriendt.
18 * Processor information obtained from Chapter 9 (Power and Thermal Management) 19 * Processor information obtained from Chapter 9 (Power and Thermal Management)
19 * of the "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD 20 * of the "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD
20 * Opteron Processors" available for download from www.amd.com 21 * Opteron Processors" available for download from www.amd.com
21 * 22 *
22 * Tables for specific CPUs can be infrerred from 23 * Tables for specific CPUs can be infrerred from
23 * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf 24 * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf
24 */ 25 */
25 26
26#include <linux/kernel.h> 27#include <linux/kernel.h>
@@ -30,6 +31,7 @@
30#include <linux/cpufreq.h> 31#include <linux/cpufreq.h>
31#include <linux/slab.h> 32#include <linux/slab.h>
32#include <linux/string.h> 33#include <linux/string.h>
34#include <linux/cpumask.h>
33 35
34#include <asm/msr.h> 36#include <asm/msr.h>
35#include <asm/io.h> 37#include <asm/io.h>
@@ -42,7 +44,7 @@
42 44
43#define PFX "powernow-k8: " 45#define PFX "powernow-k8: "
44#define BFX PFX "BIOS error: " 46#define BFX PFX "BIOS error: "
45#define VERSION "version 1.00.09e" 47#define VERSION "version 1.40.2"
46#include "powernow-k8.h" 48#include "powernow-k8.h"
47 49
48/* serialize freq changes */ 50/* serialize freq changes */
@@ -50,6 +52,10 @@ static DECLARE_MUTEX(fidvid_sem);
50 52
51static struct powernow_k8_data *powernow_data[NR_CPUS]; 53static struct powernow_k8_data *powernow_data[NR_CPUS];
52 54
55#ifndef CONFIG_SMP
56static cpumask_t cpu_core_map[1];
57#endif
58
53/* Return a frequency in MHz, given an input fid */ 59/* Return a frequency in MHz, given an input fid */
54static u32 find_freq_from_fid(u32 fid) 60static u32 find_freq_from_fid(u32 fid)
55{ 61{
@@ -274,11 +280,18 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid
274{ 280{
275 u32 rvosteps = data->rvo; 281 u32 rvosteps = data->rvo;
276 u32 savefid = data->currfid; 282 u32 savefid = data->currfid;
283 u32 maxvid, lo;
277 284
278 dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n", 285 dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n",
279 smp_processor_id(), 286 smp_processor_id(),
280 data->currfid, data->currvid, reqvid, data->rvo); 287 data->currfid, data->currvid, reqvid, data->rvo);
281 288
289 rdmsr(MSR_FIDVID_STATUS, lo, maxvid);
290 maxvid = 0x1f & (maxvid >> 16);
291 dprintk("ph1 maxvid=0x%x\n", maxvid);
292 if (reqvid < maxvid) /* lower numbers are higher voltages */
293 reqvid = maxvid;
294
282 while (data->currvid > reqvid) { 295 while (data->currvid > reqvid) {
283 dprintk("ph1: curr 0x%x, req vid 0x%x\n", 296 dprintk("ph1: curr 0x%x, req vid 0x%x\n",
284 data->currvid, reqvid); 297 data->currvid, reqvid);
@@ -286,8 +299,8 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid
286 return 1; 299 return 1;
287 } 300 }
288 301
289 while ((rvosteps > 0) && ((data->rvo + data->currvid) > reqvid)) { 302 while ((rvosteps > 0) && ((data->rvo + data->currvid) > reqvid)) {
290 if (data->currvid == 0) { 303 if (data->currvid == maxvid) {
291 rvosteps = 0; 304 rvosteps = 0;
292 } else { 305 } else {
293 dprintk("ph1: changing vid for rvo, req 0x%x\n", 306 dprintk("ph1: changing vid for rvo, req 0x%x\n",
@@ -671,7 +684,7 @@ static int find_psb_table(struct powernow_k8_data *data)
671 * BIOS and Kernel Developer's Guide, which is available on 684 * BIOS and Kernel Developer's Guide, which is available on
672 * www.amd.com 685 * www.amd.com
673 */ 686 */
674 printk(KERN_ERR PFX "BIOS error - no PSB\n"); 687 printk(KERN_INFO PFX "BIOS error - no PSB or ACPI _PSS objects\n");
675 return -ENODEV; 688 return -ENODEV;
676} 689}
677 690
@@ -695,7 +708,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
695 struct cpufreq_frequency_table *powernow_table; 708 struct cpufreq_frequency_table *powernow_table;
696 709
697 if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) { 710 if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) {
698 dprintk("register performance failed\n"); 711 dprintk("register performance failed: bad ACPI data\n");
699 return -EIO; 712 return -EIO;
700 } 713 }
701 714
@@ -746,22 +759,23 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
746 continue; 759 continue;
747 } 760 }
748 761
749 if (fid < HI_FID_TABLE_BOTTOM) { 762 /* verify only 1 entry from the lo frequency table */
750 if (cntlofreq) { 763 if (fid < HI_FID_TABLE_BOTTOM) {
751 /* if both entries are the same, ignore this 764 if (cntlofreq) {
752 * one... 765 /* if both entries are the same, ignore this
753 */ 766 * one...
754 if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) || 767 */
755 (powernow_table[i].index != powernow_table[cntlofreq].index)) { 768 if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) ||
756 printk(KERN_ERR PFX "Too many lo freq table entries\n"); 769 (powernow_table[i].index != powernow_table[cntlofreq].index)) {
757 goto err_out_mem; 770 printk(KERN_ERR PFX "Too many lo freq table entries\n");
758 } 771 goto err_out_mem;
759 772 }
760 dprintk("double low frequency table entry, ignoring it.\n"); 773
761 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; 774 dprintk("double low frequency table entry, ignoring it.\n");
762 continue; 775 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
763 } else 776 continue;
764 cntlofreq = i; 777 } else
778 cntlofreq = i;
765 } 779 }
766 780
767 if (powernow_table[i].frequency != (data->acpi_data.states[i].core_frequency * 1000)) { 781 if (powernow_table[i].frequency != (data->acpi_data.states[i].core_frequency * 1000)) {
@@ -816,7 +830,7 @@ static int transition_frequency(struct powernow_k8_data *data, unsigned int inde
816{ 830{
817 u32 fid; 831 u32 fid;
818 u32 vid; 832 u32 vid;
819 int res; 833 int res, i;
820 struct cpufreq_freqs freqs; 834 struct cpufreq_freqs freqs;
821 835
822 dprintk("cpu %d transition to index %u\n", smp_processor_id(), index); 836 dprintk("cpu %d transition to index %u\n", smp_processor_id(), index);
@@ -841,7 +855,8 @@ static int transition_frequency(struct powernow_k8_data *data, unsigned int inde
841 } 855 }
842 856
843 if ((fid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) { 857 if ((fid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) {
844 printk("ignoring illegal change in lo freq table-%x to 0x%x\n", 858 printk(KERN_ERR PFX
859 "ignoring illegal change in lo freq table-%x to 0x%x\n",
845 data->currfid, fid); 860 data->currfid, fid);
846 return 1; 861 return 1;
847 } 862 }
@@ -850,18 +865,20 @@ static int transition_frequency(struct powernow_k8_data *data, unsigned int inde
850 smp_processor_id(), fid, vid); 865 smp_processor_id(), fid, vid);
851 866
852 freqs.cpu = data->cpu; 867 freqs.cpu = data->cpu;
853
854 freqs.old = find_khz_freq_from_fid(data->currfid); 868 freqs.old = find_khz_freq_from_fid(data->currfid);
855 freqs.new = find_khz_freq_from_fid(fid); 869 freqs.new = find_khz_freq_from_fid(fid);
856 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 870 for_each_cpu_mask(i, cpu_core_map[data->cpu]) {
871 freqs.cpu = i;
872 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
873 }
857 874
858 down(&fidvid_sem);
859 res = transition_fid_vid(data, fid, vid); 875 res = transition_fid_vid(data, fid, vid);
860 up(&fidvid_sem);
861 876
862 freqs.new = find_khz_freq_from_fid(data->currfid); 877 freqs.new = find_khz_freq_from_fid(data->currfid);
863 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 878 for_each_cpu_mask(i, cpu_core_map[data->cpu]) {
864 879 freqs.cpu = i;
880 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
881 }
865 return res; 882 return res;
866} 883}
867 884
@@ -874,6 +891,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
874 u32 checkvid = data->currvid; 891 u32 checkvid = data->currvid;
875 unsigned int newstate; 892 unsigned int newstate;
876 int ret = -EIO; 893 int ret = -EIO;
894 int i;
877 895
878 /* only run on specific CPU from here on */ 896 /* only run on specific CPU from here on */
879 oldmask = current->cpus_allowed; 897 oldmask = current->cpus_allowed;
@@ -902,22 +920,41 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
902 data->currfid, data->currvid); 920 data->currfid, data->currvid);
903 921
904 if ((checkvid != data->currvid) || (checkfid != data->currfid)) { 922 if ((checkvid != data->currvid) || (checkfid != data->currfid)) {
905 printk(KERN_ERR PFX 923 printk(KERN_INFO PFX
906 "error - out of sync, fid 0x%x 0x%x, vid 0x%x 0x%x\n", 924 "error - out of sync, fix 0x%x 0x%x, vid 0x%x 0x%x\n",
907 checkfid, data->currfid, checkvid, data->currvid); 925 checkfid, data->currfid, checkvid, data->currvid);
908 } 926 }
909 927
910 if (cpufreq_frequency_table_target(pol, data->powernow_table, targfreq, relation, &newstate)) 928 if (cpufreq_frequency_table_target(pol, data->powernow_table, targfreq, relation, &newstate))
911 goto err_out; 929 goto err_out;
912 930
931 down(&fidvid_sem);
932
933 for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
934 /* make sure the sibling is initialized */
935 if (!powernow_data[i]) {
936 ret = 0;
937 up(&fidvid_sem);
938 goto err_out;
939 }
940 }
941
913 powernow_k8_acpi_pst_values(data, newstate); 942 powernow_k8_acpi_pst_values(data, newstate);
914 943
915 if (transition_frequency(data, newstate)) { 944 if (transition_frequency(data, newstate)) {
916 printk(KERN_ERR PFX "transition frequency failed\n"); 945 printk(KERN_ERR PFX "transition frequency failed\n");
917 ret = 1; 946 ret = 1;
947 up(&fidvid_sem);
918 goto err_out; 948 goto err_out;
919 } 949 }
920 950
951 /* Update all the fid/vids of our siblings */
952 for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
953 powernow_data[i]->currvid = data->currvid;
954 powernow_data[i]->currfid = data->currfid;
955 }
956 up(&fidvid_sem);
957
921 pol->cur = find_khz_freq_from_fid(data->currfid); 958 pol->cur = find_khz_freq_from_fid(data->currfid);
922 ret = 0; 959 ret = 0;
923 960
@@ -962,7 +999,7 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
962 */ 999 */
963 1000
964 if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) { 1001 if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
965 printk(KERN_INFO PFX "MP systems not supported by PSB BIOS structure\n"); 1002 printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
966 kfree(data); 1003 kfree(data);
967 return -ENODEV; 1004 return -ENODEV;
968 } 1005 }
@@ -1003,6 +1040,7 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
1003 schedule(); 1040 schedule();
1004 1041
1005 pol->governor = CPUFREQ_DEFAULT_GOVERNOR; 1042 pol->governor = CPUFREQ_DEFAULT_GOVERNOR;
1043 pol->cpus = cpu_core_map[pol->cpu];
1006 1044
1007 /* Take a crude guess here. 1045 /* Take a crude guess here.
1008 * That guess was in microseconds, so multiply with 1000 */ 1046 * That guess was in microseconds, so multiply with 1000 */
@@ -1069,7 +1107,7 @@ static unsigned int powernowk8_get (unsigned int cpu)
1069 return 0; 1107 return 0;
1070 } 1108 }
1071 preempt_disable(); 1109 preempt_disable();
1072 1110
1073 if (query_current_values_with_pending_wait(data)) 1111 if (query_current_values_with_pending_wait(data))
1074 goto out; 1112 goto out;
1075 1113
@@ -1127,9 +1165,10 @@ static void __exit powernowk8_exit(void)
1127 cpufreq_unregister_driver(&cpufreq_amd64_driver); 1165 cpufreq_unregister_driver(&cpufreq_amd64_driver);
1128} 1166}
1129 1167
1130MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com>"); 1168MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark Langsdorf <mark.langsdorf@amd.com.");
1131MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver."); 1169MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver.");
1132MODULE_LICENSE("GPL"); 1170MODULE_LICENSE("GPL");
1133 1171
1134late_initcall(powernowk8_init); 1172late_initcall(powernowk8_init);
1135module_exit(powernowk8_exit); 1173module_exit(powernowk8_exit);
1174
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
index 63ebc8470f52..9ed5bf221cb7 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
@@ -174,3 +174,18 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi
174static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid); 174static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid);
175 175
176static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index); 176static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index);
177
178#ifndef for_each_cpu_mask
179#define for_each_cpu_mask(i,mask) for (i=0;i<1;i++)
180#endif
181
182#ifdef CONFIG_SMP
183static inline void define_siblings(int cpu, cpumask_t cpu_sharedcore_mask[])
184{
185}
186#else
187static inline void define_siblings(int cpu, cpumask_t cpu_sharedcore_mask[])
188{
189 cpu_set(0, cpu_sharedcore_mask[0]);
190}
191#endif
diff --git a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c b/arch/i386/kernel/cpu/cpufreq/sc520_freq.c
new file mode 100644
index 000000000000..ef457d50f4ac
--- /dev/null
+++ b/arch/i386/kernel/cpu/cpufreq/sc520_freq.c
@@ -0,0 +1,186 @@
1/*
2 * sc520_freq.c: cpufreq driver for the AMD Elan sc520
3 *
4 * Copyright (C) 2005 Sean Young <sean@mess.org>
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 * Based on elanfreq.c
12 *
13 * 2005-03-30: - initial revision
14 */
15
16#include <linux/kernel.h>
17#include <linux/module.h>
18#include <linux/init.h>
19
20#include <linux/delay.h>
21#include <linux/cpufreq.h>
22
23#include <asm/msr.h>
24#include <asm/timex.h>
25#include <asm/io.h>
26
27#define MMCR_BASE 0xfffef000 /* The default base address */
28#define OFFS_CPUCTL 0x2 /* CPU Control Register */
29
30static __u8 __iomem *cpuctl;
31
32#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "sc520_freq", msg)
33
34static struct cpufreq_frequency_table sc520_freq_table[] = {
35 {0x01, 100000},
36 {0x02, 133000},
37 {0, CPUFREQ_TABLE_END},
38};
39
40static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu)
41{
42 u8 clockspeed_reg = *cpuctl;
43
44 switch (clockspeed_reg & 0x03) {
45 default:
46 printk(KERN_ERR "sc520_freq: error: cpuctl register has unexpected value %02x\n", clockspeed_reg);
47 case 0x01:
48 return 100000;
49 case 0x02:
50 return 133000;
51 }
52}
53
54static void sc520_freq_set_cpu_state (unsigned int state)
55{
56
57 struct cpufreq_freqs freqs;
58 u8 clockspeed_reg;
59
60 freqs.old = sc520_freq_get_cpu_frequency(0);
61 freqs.new = sc520_freq_table[state].frequency;
62 freqs.cpu = 0; /* AMD Elan is UP */
63
64 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
65
66 dprintk("attempting to set frequency to %i kHz\n",
67 sc520_freq_table[state].frequency);
68
69 local_irq_disable();
70
71 clockspeed_reg = *cpuctl & ~0x03;
72 *cpuctl = clockspeed_reg | sc520_freq_table[state].index;
73
74 local_irq_enable();
75
76 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
77};
78
79static int sc520_freq_verify (struct cpufreq_policy *policy)
80{
81 return cpufreq_frequency_table_verify(policy, &sc520_freq_table[0]);
82}
83
84static int sc520_freq_target (struct cpufreq_policy *policy,
85 unsigned int target_freq,
86 unsigned int relation)
87{
88 unsigned int newstate = 0;
89
90 if (cpufreq_frequency_table_target(policy, sc520_freq_table, target_freq, relation, &newstate))
91 return -EINVAL;
92
93 sc520_freq_set_cpu_state(newstate);
94
95 return 0;
96}
97
98
99/*
100 * Module init and exit code
101 */
102
103static int sc520_freq_cpu_init(struct cpufreq_policy *policy)
104{
105 struct cpuinfo_x86 *c = cpu_data;
106 int result;
107
108 /* capability check */
109 if (c->x86_vendor != X86_VENDOR_AMD ||
110 c->x86 != 4 || c->x86_model != 9)
111 return -ENODEV;
112
113 /* cpuinfo and default policy values */
114 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
115 policy->cpuinfo.transition_latency = 1000000; /* 1ms */
116 policy->cur = sc520_freq_get_cpu_frequency(0);
117
118 result = cpufreq_frequency_table_cpuinfo(policy, sc520_freq_table);
119 if (result)
120 return (result);
121
122 cpufreq_frequency_table_get_attr(sc520_freq_table, policy->cpu);
123
124 return 0;
125}
126
127
128static int sc520_freq_cpu_exit(struct cpufreq_policy *policy)
129{
130 cpufreq_frequency_table_put_attr(policy->cpu);
131 return 0;
132}
133
134
135static struct freq_attr* sc520_freq_attr[] = {
136 &cpufreq_freq_attr_scaling_available_freqs,
137 NULL,
138};
139
140
141static struct cpufreq_driver sc520_freq_driver = {
142 .get = sc520_freq_get_cpu_frequency,
143 .verify = sc520_freq_verify,
144 .target = sc520_freq_target,
145 .init = sc520_freq_cpu_init,
146 .exit = sc520_freq_cpu_exit,
147 .name = "sc520_freq",
148 .owner = THIS_MODULE,
149 .attr = sc520_freq_attr,
150};
151
152
153static int __init sc520_freq_init(void)
154{
155 struct cpuinfo_x86 *c = cpu_data;
156
157 /* Test if we have the right hardware */
158 if(c->x86_vendor != X86_VENDOR_AMD ||
159 c->x86 != 4 || c->x86_model != 9) {
160 dprintk("no Elan SC520 processor found!\n");
161 return -ENODEV;
162 }
163 cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1);
164 if(!cpuctl) {
165 printk(KERN_ERR "sc520_freq: error: failed to remap memory\n");
166 return -ENOMEM;
167 }
168
169 return cpufreq_register_driver(&sc520_freq_driver);
170}
171
172
173static void __exit sc520_freq_exit(void)
174{
175 cpufreq_unregister_driver(&sc520_freq_driver);
176 iounmap(cpuctl);
177}
178
179
180MODULE_LICENSE("GPL");
181MODULE_AUTHOR("Sean Young <sean@mess.org>");
182MODULE_DESCRIPTION("cpufreq driver for AMD's Elan sc520 CPU");
183
184module_init(sc520_freq_init);
185module_exit(sc520_freq_exit);
186
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index 07d5612dc00f..7dcbf70fc16f 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -54,6 +54,8 @@ enum {
54 CPU_DOTHAN_A1, 54 CPU_DOTHAN_A1,
55 CPU_DOTHAN_A2, 55 CPU_DOTHAN_A2,
56 CPU_DOTHAN_B0, 56 CPU_DOTHAN_B0,
57 CPU_MP4HT_D0,
58 CPU_MP4HT_E0,
57}; 59};
58 60
59static const struct cpu_id cpu_ids[] = { 61static const struct cpu_id cpu_ids[] = {
@@ -61,6 +63,8 @@ static const struct cpu_id cpu_ids[] = {
61 [CPU_DOTHAN_A1] = { 6, 13, 1 }, 63 [CPU_DOTHAN_A1] = { 6, 13, 1 },
62 [CPU_DOTHAN_A2] = { 6, 13, 2 }, 64 [CPU_DOTHAN_A2] = { 6, 13, 2 },
63 [CPU_DOTHAN_B0] = { 6, 13, 6 }, 65 [CPU_DOTHAN_B0] = { 6, 13, 6 },
66 [CPU_MP4HT_D0] = {15, 3, 4 },
67 [CPU_MP4HT_E0] = {15, 4, 1 },
64}; 68};
65#define N_IDS (sizeof(cpu_ids)/sizeof(cpu_ids[0])) 69#define N_IDS (sizeof(cpu_ids)/sizeof(cpu_ids[0]))
66 70
@@ -226,6 +230,8 @@ static struct cpu_model models[] =
226 { &cpu_ids[CPU_DOTHAN_A1], NULL, 0, NULL }, 230 { &cpu_ids[CPU_DOTHAN_A1], NULL, 0, NULL },
227 { &cpu_ids[CPU_DOTHAN_A2], NULL, 0, NULL }, 231 { &cpu_ids[CPU_DOTHAN_A2], NULL, 0, NULL },
228 { &cpu_ids[CPU_DOTHAN_B0], NULL, 0, NULL }, 232 { &cpu_ids[CPU_DOTHAN_B0], NULL, 0, NULL },
233 { &cpu_ids[CPU_MP4HT_D0], NULL, 0, NULL },
234 { &cpu_ids[CPU_MP4HT_E0], NULL, 0, NULL },
229 235
230 { NULL, } 236 { NULL, }
231}; 237};
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
index 8ba430a9c3a2..d368b3f5fce8 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
@@ -336,7 +336,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
336 if (!prev_speed) 336 if (!prev_speed)
337 return -EIO; 337 return -EIO;
338 338
339 dprintk("previous seped is %u\n", prev_speed); 339 dprintk("previous speed is %u\n", prev_speed);
340 340
341 local_irq_save(flags); 341 local_irq_save(flags);
342 342
@@ -348,7 +348,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
348 goto out; 348 goto out;
349 } 349 }
350 350
351 dprintk("low seped is %u\n", *low_speed); 351 dprintk("low speed is %u\n", *low_speed);
352 352
353 /* switch to high state */ 353 /* switch to high state */
354 set_state(SPEEDSTEP_HIGH); 354 set_state(SPEEDSTEP_HIGH);
@@ -358,7 +358,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
358 goto out; 358 goto out;
359 } 359 }
360 360
361 dprintk("high seped is %u\n", *high_speed); 361 dprintk("high speed is %u\n", *high_speed);
362 362
363 if (*low_speed == *high_speed) { 363 if (*low_speed == *high_speed) {
364 ret = -ENODEV; 364 ret = -ENODEV;
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
index 79440b3f087e..b25fb6b635ae 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
@@ -357,6 +357,9 @@ static int __init speedstep_init(void)
357 case SPEEDSTEP_PROCESSOR_PIII_C: 357 case SPEEDSTEP_PROCESSOR_PIII_C:
358 case SPEEDSTEP_PROCESSOR_PIII_C_EARLY: 358 case SPEEDSTEP_PROCESSOR_PIII_C_EARLY:
359 break; 359 break;
360 case SPEEDSTEP_PROCESSOR_P4M:
361 printk(KERN_INFO "speedstep-smi: you're trying to use this cpufreq driver on a Pentium 4-based CPU. Most likely it will not work.\n");
362 break;
360 default: 363 default:
361 speedstep_processor = 0; 364 speedstep_processor = 0;
362 } 365 }
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c
index aeb5b4ef8c8b..a710dc4eb20e 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -118,7 +118,7 @@ struct _cpuid4_info {
118}; 118};
119 119
120#define MAX_CACHE_LEAVES 4 120#define MAX_CACHE_LEAVES 4
121static unsigned short __devinitdata num_cache_leaves; 121static unsigned short num_cache_leaves;
122 122
123static int __devinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf) 123static int __devinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf)
124{ 124{
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c
index 2e2756345bb2..4647db4ad6de 100644
--- a/arch/i386/kernel/cpuid.c
+++ b/arch/i386/kernel/cpuid.c
@@ -45,7 +45,7 @@
45#include <asm/uaccess.h> 45#include <asm/uaccess.h>
46#include <asm/system.h> 46#include <asm/system.h>
47 47
48static struct class_simple *cpuid_class; 48static struct class *cpuid_class;
49 49
50#ifdef CONFIG_SMP 50#ifdef CONFIG_SMP
51 51
@@ -158,12 +158,12 @@ static struct file_operations cpuid_fops = {
158 .open = cpuid_open, 158 .open = cpuid_open,
159}; 159};
160 160
161static int cpuid_class_simple_device_add(int i) 161static int cpuid_class_device_create(int i)
162{ 162{
163 int err = 0; 163 int err = 0;
164 struct class_device *class_err; 164 struct class_device *class_err;
165 165
166 class_err = class_simple_device_add(cpuid_class, MKDEV(CPUID_MAJOR, i), NULL, "cpu%d",i); 166 class_err = class_device_create(cpuid_class, MKDEV(CPUID_MAJOR, i), NULL, "cpu%d",i);
167 if (IS_ERR(class_err)) 167 if (IS_ERR(class_err))
168 err = PTR_ERR(class_err); 168 err = PTR_ERR(class_err);
169 return err; 169 return err;
@@ -175,10 +175,10 @@ static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsign
175 175
176 switch (action) { 176 switch (action) {
177 case CPU_ONLINE: 177 case CPU_ONLINE:
178 cpuid_class_simple_device_add(cpu); 178 cpuid_class_device_create(cpu);
179 break; 179 break;
180 case CPU_DEAD: 180 case CPU_DEAD:
181 class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu)); 181 class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
182 break; 182 break;
183 } 183 }
184 return NOTIFY_OK; 184 return NOTIFY_OK;
@@ -200,13 +200,13 @@ static int __init cpuid_init(void)
200 err = -EBUSY; 200 err = -EBUSY;
201 goto out; 201 goto out;
202 } 202 }
203 cpuid_class = class_simple_create(THIS_MODULE, "cpuid"); 203 cpuid_class = class_create(THIS_MODULE, "cpuid");
204 if (IS_ERR(cpuid_class)) { 204 if (IS_ERR(cpuid_class)) {
205 err = PTR_ERR(cpuid_class); 205 err = PTR_ERR(cpuid_class);
206 goto out_chrdev; 206 goto out_chrdev;
207 } 207 }
208 for_each_online_cpu(i) { 208 for_each_online_cpu(i) {
209 err = cpuid_class_simple_device_add(i); 209 err = cpuid_class_device_create(i);
210 if (err != 0) 210 if (err != 0)
211 goto out_class; 211 goto out_class;
212 } 212 }
@@ -218,9 +218,9 @@ static int __init cpuid_init(void)
218out_class: 218out_class:
219 i = 0; 219 i = 0;
220 for_each_online_cpu(i) { 220 for_each_online_cpu(i) {
221 class_simple_device_remove(MKDEV(CPUID_MAJOR, i)); 221 class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, i));
222 } 222 }
223 class_simple_destroy(cpuid_class); 223 class_destroy(cpuid_class);
224out_chrdev: 224out_chrdev:
225 unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); 225 unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
226out: 226out:
@@ -232,8 +232,8 @@ static void __exit cpuid_exit(void)
232 int cpu = 0; 232 int cpu = 0;
233 233
234 for_each_online_cpu(cpu) 234 for_each_online_cpu(cpu)
235 class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu)); 235 class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
236 class_simple_destroy(cpuid_class); 236 class_destroy(cpuid_class);
237 unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); 237 unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
238 unregister_cpu_notifier(&cpuid_class_cpu_notifier); 238 unregister_cpu_notifier(&cpuid_class_cpu_notifier);
239} 239}
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
index 05d9f8f363a6..b2f03c39a6fe 100644
--- a/arch/i386/kernel/msr.c
+++ b/arch/i386/kernel/msr.c
@@ -44,7 +44,7 @@
44#include <asm/uaccess.h> 44#include <asm/uaccess.h>
45#include <asm/system.h> 45#include <asm/system.h>
46 46
47static struct class_simple *msr_class; 47static struct class *msr_class;
48 48
49/* Note: "err" is handled in a funny way below. Otherwise one version 49/* Note: "err" is handled in a funny way below. Otherwise one version
50 of gcc or another breaks. */ 50 of gcc or another breaks. */
@@ -260,12 +260,12 @@ static struct file_operations msr_fops = {
260 .open = msr_open, 260 .open = msr_open,
261}; 261};
262 262
263static int msr_class_simple_device_add(int i) 263static int msr_class_device_create(int i)
264{ 264{
265 int err = 0; 265 int err = 0;
266 struct class_device *class_err; 266 struct class_device *class_err;
267 267
268 class_err = class_simple_device_add(msr_class, MKDEV(MSR_MAJOR, i), NULL, "msr%d",i); 268 class_err = class_device_create(msr_class, MKDEV(MSR_MAJOR, i), NULL, "msr%d",i);
269 if (IS_ERR(class_err)) 269 if (IS_ERR(class_err))
270 err = PTR_ERR(class_err); 270 err = PTR_ERR(class_err);
271 return err; 271 return err;
@@ -277,10 +277,10 @@ static int __devinit msr_class_cpu_callback(struct notifier_block *nfb, unsigned
277 277
278 switch (action) { 278 switch (action) {
279 case CPU_ONLINE: 279 case CPU_ONLINE:
280 msr_class_simple_device_add(cpu); 280 msr_class_device_create(cpu);
281 break; 281 break;
282 case CPU_DEAD: 282 case CPU_DEAD:
283 class_simple_device_remove(MKDEV(MSR_MAJOR, cpu)); 283 class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
284 break; 284 break;
285 } 285 }
286 return NOTIFY_OK; 286 return NOTIFY_OK;
@@ -302,13 +302,13 @@ static int __init msr_init(void)
302 err = -EBUSY; 302 err = -EBUSY;
303 goto out; 303 goto out;
304 } 304 }
305 msr_class = class_simple_create(THIS_MODULE, "msr"); 305 msr_class = class_create(THIS_MODULE, "msr");
306 if (IS_ERR(msr_class)) { 306 if (IS_ERR(msr_class)) {
307 err = PTR_ERR(msr_class); 307 err = PTR_ERR(msr_class);
308 goto out_chrdev; 308 goto out_chrdev;
309 } 309 }
310 for_each_online_cpu(i) { 310 for_each_online_cpu(i) {
311 err = msr_class_simple_device_add(i); 311 err = msr_class_device_create(i);
312 if (err != 0) 312 if (err != 0)
313 goto out_class; 313 goto out_class;
314 } 314 }
@@ -320,8 +320,8 @@ static int __init msr_init(void)
320out_class: 320out_class:
321 i = 0; 321 i = 0;
322 for_each_online_cpu(i) 322 for_each_online_cpu(i)
323 class_simple_device_remove(MKDEV(MSR_MAJOR, i)); 323 class_device_destroy(msr_class, MKDEV(MSR_MAJOR, i));
324 class_simple_destroy(msr_class); 324 class_destroy(msr_class);
325out_chrdev: 325out_chrdev:
326 unregister_chrdev(MSR_MAJOR, "cpu/msr"); 326 unregister_chrdev(MSR_MAJOR, "cpu/msr");
327out: 327out:
@@ -332,8 +332,8 @@ static void __exit msr_exit(void)
332{ 332{
333 int cpu = 0; 333 int cpu = 0;
334 for_each_online_cpu(cpu) 334 for_each_online_cpu(cpu)
335 class_simple_device_remove(MKDEV(MSR_MAJOR, cpu)); 335 class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
336 class_simple_destroy(msr_class); 336 class_destroy(msr_class);
337 unregister_chrdev(MSR_MAJOR, "cpu/msr"); 337 unregister_chrdev(MSR_MAJOR, "cpu/msr");
338 unregister_cpu_notifier(&msr_class_cpu_notifier); 338 unregister_cpu_notifier(&msr_class_cpu_notifier);
339} 339}
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 945ec73163c8..2bfbddebdbf8 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -1502,11 +1502,13 @@ void __init setup_arch(char **cmdline_p)
1502 if (efi_enabled) 1502 if (efi_enabled)
1503 efi_map_memmap(); 1503 efi_map_memmap();
1504 1504
1505#ifdef CONFIG_ACPI_BOOT
1505 /* 1506 /*
1506 * Parse the ACPI tables for possible boot-time SMP configuration. 1507 * Parse the ACPI tables for possible boot-time SMP configuration.
1507 */ 1508 */
1508 acpi_boot_table_init(); 1509 acpi_boot_table_init();
1509 acpi_boot_init(); 1510 acpi_boot_init();
1511#endif
1510 1512
1511#ifdef CONFIG_X86_LOCAL_APIC 1513#ifdef CONFIG_X86_LOCAL_APIC
1512 if (smp_found_config) 1514 if (smp_found_config)
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index cbea7ac582e5..bc1bb6919e6a 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -888,6 +888,7 @@ void *xquad_portio;
888 888
889cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned; 889cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned;
890cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; 890cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned;
891EXPORT_SYMBOL(cpu_core_map);
891 892
892static void __init smp_boot_cpus(unsigned int max_cpus) 893static void __init smp_boot_cpus(unsigned int max_cpus)
893{ 894{
@@ -1073,8 +1074,10 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
1073 cpu_set(cpu, cpu_sibling_map[cpu]); 1074 cpu_set(cpu, cpu_sibling_map[cpu]);
1074 } 1075 }
1075 1076
1076 if (siblings != smp_num_siblings) 1077 if (siblings != smp_num_siblings) {
1077 printk(KERN_WARNING "WARNING: %d siblings found for CPU%d, should be %d\n", siblings, cpu, smp_num_siblings); 1078 printk(KERN_WARNING "WARNING: %d siblings found for CPU%d, should be %d\n", siblings, cpu, smp_num_siblings);
1079 smp_num_siblings = siblings;
1080 }
1078 1081
1079 if (c->x86_num_cores > 1) { 1082 if (c->x86_num_cores > 1) {
1080 for (i = 0; i < NR_CPUS; i++) { 1083 for (i = 0; i < NR_CPUS; i++) {
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index 6cd1ed311f02..d408afaf6495 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -251,7 +251,7 @@ ENTRY(sys_call_table)
251 .long sys_io_submit 251 .long sys_io_submit
252 .long sys_io_cancel 252 .long sys_io_cancel
253 .long sys_fadvise64 /* 250 */ 253 .long sys_fadvise64 /* 250 */
254 .long sys_ni_syscall 254 .long sys_set_zone_reclaim
255 .long sys_exit_group 255 .long sys_exit_group
256 .long sys_lookup_dcookie 256 .long sys_lookup_dcookie
257 .long sys_epoll_create 257 .long sys_epoll_create
diff --git a/arch/i386/kernel/timers/common.c b/arch/i386/kernel/timers/common.c
index f7f90005e22e..8e201219f525 100644
--- a/arch/i386/kernel/timers/common.c
+++ b/arch/i386/kernel/timers/common.c
@@ -6,6 +6,7 @@
6#include <linux/timex.h> 6#include <linux/timex.h>
7#include <linux/errno.h> 7#include <linux/errno.h>
8#include <linux/jiffies.h> 8#include <linux/jiffies.h>
9#include <linux/module.h>
9 10
10#include <asm/io.h> 11#include <asm/io.h>
11#include <asm/timer.h> 12#include <asm/timer.h>
@@ -24,7 +25,7 @@
24 25
25#define CALIBRATE_TIME (5 * 1000020/HZ) 26#define CALIBRATE_TIME (5 * 1000020/HZ)
26 27
27unsigned long __init calibrate_tsc(void) 28unsigned long calibrate_tsc(void)
28{ 29{
29 mach_prepare_counter(); 30 mach_prepare_counter();
30 31
@@ -139,7 +140,7 @@ bad_calibration:
139#endif 140#endif
140 141
141/* calculate cpu_khz */ 142/* calculate cpu_khz */
142void __init init_cpu_khz(void) 143void init_cpu_khz(void)
143{ 144{
144 if (cpu_has_tsc) { 145 if (cpu_has_tsc) {
145 unsigned long tsc_quotient = calibrate_tsc(); 146 unsigned long tsc_quotient = calibrate_tsc();
@@ -158,3 +159,4 @@ void __init init_cpu_khz(void)
158 } 159 }
159 } 160 }
160} 161}
162
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index 7926d967be00..180444d87824 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -320,6 +320,26 @@ core_initcall(cpufreq_tsc);
320static inline void cpufreq_delayed_get(void) { return; } 320static inline void cpufreq_delayed_get(void) { return; }
321#endif 321#endif
322 322
323int recalibrate_cpu_khz(void)
324{
325#ifndef CONFIG_SMP
326 unsigned long cpu_khz_old = cpu_khz;
327
328 if (cpu_has_tsc) {
329 init_cpu_khz();
330 cpu_data[0].loops_per_jiffy =
331 cpufreq_scale(cpu_data[0].loops_per_jiffy,
332 cpu_khz_old,
333 cpu_khz);
334 return 0;
335 } else
336 return -ENODEV;
337#else
338 return -ENODEV;
339#endif
340}
341EXPORT_SYMBOL(recalibrate_cpu_khz);
342
323static void mark_offset_tsc(void) 343static void mark_offset_tsc(void)
324{ 344{
325 unsigned long lost,delay; 345 unsigned long lost,delay;
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 00c63419c06f..83c579e82a81 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -306,7 +306,7 @@ void die(const char * str, struct pt_regs * regs, long err)
306 }; 306 };
307 static int die_counter; 307 static int die_counter;
308 308
309 if (die.lock_owner != _smp_processor_id()) { 309 if (die.lock_owner != raw_smp_processor_id()) {
310 console_verbose(); 310 console_verbose();
311 spin_lock_irq(&die.lock); 311 spin_lock_irq(&die.lock);
312 die.lock_owner = smp_processor_id(); 312 die.lock_owner = smp_processor_id();
diff --git a/arch/i386/lib/delay.c b/arch/i386/lib/delay.c
index 080639f262b1..eb0cdfe9280f 100644
--- a/arch/i386/lib/delay.c
+++ b/arch/i386/lib/delay.c
@@ -34,7 +34,7 @@ inline void __const_udelay(unsigned long xloops)
34 xloops *= 4; 34 xloops *= 4;
35 __asm__("mull %0" 35 __asm__("mull %0"
36 :"=d" (xloops), "=&a" (d0) 36 :"=d" (xloops), "=&a" (d0)
37 :"1" (xloops),"0" (cpu_data[_smp_processor_id()].loops_per_jiffy * (HZ/4))); 37 :"1" (xloops),"0" (cpu_data[raw_smp_processor_id()].loops_per_jiffy * (HZ/4)));
38 __delay(++xloops); 38 __delay(++xloops);
39} 39}
40 40
diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c
index 903d739ca74a..a6e0ddd65bd0 100644
--- a/arch/i386/mach-voyager/voyager_smp.c
+++ b/arch/i386/mach-voyager/voyager_smp.c
@@ -97,7 +97,6 @@ static void ack_vic_irq(unsigned int irq);
97static void vic_enable_cpi(void); 97static void vic_enable_cpi(void);
98static void do_boot_cpu(__u8 cpuid); 98static void do_boot_cpu(__u8 cpuid);
99static void do_quad_bootstrap(void); 99static void do_quad_bootstrap(void);
100static inline void wrapper_smp_local_timer_interrupt(struct pt_regs *);
101 100
102int hard_smp_processor_id(void); 101int hard_smp_processor_id(void);
103 102
@@ -126,6 +125,14 @@ send_QIC_CPI(__u32 cpuset, __u8 cpi)
126} 125}
127 126
128static inline void 127static inline void
128wrapper_smp_local_timer_interrupt(struct pt_regs *regs)
129{
130 irq_enter();
131 smp_local_timer_interrupt(regs);
132 irq_exit();
133}
134
135static inline void
129send_one_CPI(__u8 cpu, __u8 cpi) 136send_one_CPI(__u8 cpu, __u8 cpi)
130{ 137{
131 if(voyager_quad_processors & (1<<cpu)) 138 if(voyager_quad_processors & (1<<cpu))
@@ -1249,14 +1256,6 @@ smp_vic_timer_interrupt(struct pt_regs *regs)
1249 smp_local_timer_interrupt(regs); 1256 smp_local_timer_interrupt(regs);
1250} 1257}
1251 1258
1252static inline void
1253wrapper_smp_local_timer_interrupt(struct pt_regs *regs)
1254{
1255 irq_enter();
1256 smp_local_timer_interrupt(regs);
1257 irq_exit();
1258}
1259
1260/* local (per CPU) timer interrupt. It does both profiling and 1259/* local (per CPU) timer interrupt. It does both profiling and
1261 * process statistics/rescheduling. 1260 * process statistics/rescheduling.
1262 * 1261 *
diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c
index 171fc925e1e4..3b099f32b948 100644
--- a/arch/i386/mm/hugetlbpage.c
+++ b/arch/i386/mm/hugetlbpage.c
@@ -18,7 +18,7 @@
18#include <asm/tlb.h> 18#include <asm/tlb.h>
19#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
20 20
21static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) 21pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
22{ 22{
23 pgd_t *pgd; 23 pgd_t *pgd;
24 pud_t *pud; 24 pud_t *pud;
@@ -30,7 +30,7 @@ static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
30 return (pte_t *) pmd; 30 return (pte_t *) pmd;
31} 31}
32 32
33static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) 33pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
34{ 34{
35 pgd_t *pgd; 35 pgd_t *pgd;
36 pud_t *pud; 36 pud_t *pud;
@@ -42,21 +42,6 @@ static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
42 return (pte_t *) pmd; 42 return (pte_t *) pmd;
43} 43}
44 44
45static void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma, struct page *page, pte_t * page_table, int write_access)
46{
47 pte_t entry;
48
49 add_mm_counter(mm, rss, HPAGE_SIZE / PAGE_SIZE);
50 if (write_access) {
51 entry =
52 pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
53 } else
54 entry = pte_wrprotect(mk_pte(page, vma->vm_page_prot));
55 entry = pte_mkyoung(entry);
56 mk_pte_huge(entry);
57 set_pte(page_table, entry);
58}
59
60/* 45/*
61 * This function checks for proper alignment of input addr and len parameters. 46 * This function checks for proper alignment of input addr and len parameters.
62 */ 47 */
@@ -69,77 +54,6 @@ int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
69 return 0; 54 return 0;
70} 55}
71 56
72int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
73 struct vm_area_struct *vma)
74{
75 pte_t *src_pte, *dst_pte, entry;
76 struct page *ptepage;
77 unsigned long addr = vma->vm_start;
78 unsigned long end = vma->vm_end;
79
80 while (addr < end) {
81 dst_pte = huge_pte_alloc(dst, addr);
82 if (!dst_pte)
83 goto nomem;
84 src_pte = huge_pte_offset(src, addr);
85 entry = *src_pte;
86 ptepage = pte_page(entry);
87 get_page(ptepage);
88 set_pte(dst_pte, entry);
89 add_mm_counter(dst, rss, HPAGE_SIZE / PAGE_SIZE);
90 addr += HPAGE_SIZE;
91 }
92 return 0;
93
94nomem:
95 return -ENOMEM;
96}
97
98int
99follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
100 struct page **pages, struct vm_area_struct **vmas,
101 unsigned long *position, int *length, int i)
102{
103 unsigned long vpfn, vaddr = *position;
104 int remainder = *length;
105
106 WARN_ON(!is_vm_hugetlb_page(vma));
107
108 vpfn = vaddr/PAGE_SIZE;
109 while (vaddr < vma->vm_end && remainder) {
110
111 if (pages) {
112 pte_t *pte;
113 struct page *page;
114
115 pte = huge_pte_offset(mm, vaddr);
116
117 /* hugetlb should be locked, and hence, prefaulted */
118 WARN_ON(!pte || pte_none(*pte));
119
120 page = &pte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)];
121
122 WARN_ON(!PageCompound(page));
123
124 get_page(page);
125 pages[i] = page;
126 }
127
128 if (vmas)
129 vmas[i] = vma;
130
131 vaddr += PAGE_SIZE;
132 ++vpfn;
133 --remainder;
134 ++i;
135 }
136
137 *length = remainder;
138 *position = vaddr;
139
140 return i;
141}
142
143#if 0 /* This is just for testing */ 57#if 0 /* This is just for testing */
144struct page * 58struct page *
145follow_huge_addr(struct mm_struct *mm, unsigned long address, int write) 59follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
@@ -204,83 +118,15 @@ follow_huge_pmd(struct mm_struct *mm, unsigned long address,
204} 118}
205#endif 119#endif
206 120
207void unmap_hugepage_range(struct vm_area_struct *vma, 121void hugetlb_clean_stale_pgtable(pte_t *pte)
208 unsigned long start, unsigned long end)
209{ 122{
210 struct mm_struct *mm = vma->vm_mm; 123 pmd_t *pmd = (pmd_t *) pte;
211 unsigned long address;
212 pte_t pte, *ptep;
213 struct page *page; 124 struct page *page;
214 125
215 BUG_ON(start & (HPAGE_SIZE - 1)); 126 page = pmd_page(*pmd);
216 BUG_ON(end & (HPAGE_SIZE - 1)); 127 pmd_clear(pmd);
217 128 dec_page_state(nr_page_table_pages);
218 for (address = start; address < end; address += HPAGE_SIZE) { 129 page_cache_release(page);
219 ptep = huge_pte_offset(mm, address);
220 if (!ptep)
221 continue;
222 pte = ptep_get_and_clear(mm, address, ptep);
223 if (pte_none(pte))
224 continue;
225 page = pte_page(pte);
226 put_page(page);
227 }
228 add_mm_counter(mm ,rss, -((end - start) >> PAGE_SHIFT));
229 flush_tlb_range(vma, start, end);
230}
231
232int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
233{
234 struct mm_struct *mm = current->mm;
235 unsigned long addr;
236 int ret = 0;
237
238 BUG_ON(vma->vm_start & ~HPAGE_MASK);
239 BUG_ON(vma->vm_end & ~HPAGE_MASK);
240
241 spin_lock(&mm->page_table_lock);
242 for (addr = vma->vm_start; addr < vma->vm_end; addr += HPAGE_SIZE) {
243 unsigned long idx;
244 pte_t *pte = huge_pte_alloc(mm, addr);
245 struct page *page;
246
247 if (!pte) {
248 ret = -ENOMEM;
249 goto out;
250 }
251
252 if (!pte_none(*pte))
253 continue;
254
255 idx = ((addr - vma->vm_start) >> HPAGE_SHIFT)
256 + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
257 page = find_get_page(mapping, idx);
258 if (!page) {
259 /* charge the fs quota first */
260 if (hugetlb_get_quota(mapping)) {
261 ret = -ENOMEM;
262 goto out;
263 }
264 page = alloc_huge_page();
265 if (!page) {
266 hugetlb_put_quota(mapping);
267 ret = -ENOMEM;
268 goto out;
269 }
270 ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
271 if (! ret) {
272 unlock_page(page);
273 } else {
274 hugetlb_put_quota(mapping);
275 free_huge_page(page);
276 goto out;
277 }
278 }
279 set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE);
280 }
281out:
282 spin_unlock(&mm->page_table_lock);
283 return ret;
284} 130}
285 131
286/* x86_64 also uses this file */ 132/* x86_64 also uses this file */
@@ -294,7 +140,12 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file,
294 struct vm_area_struct *vma; 140 struct vm_area_struct *vma;
295 unsigned long start_addr; 141 unsigned long start_addr;
296 142
297 start_addr = mm->free_area_cache; 143 if (len > mm->cached_hole_size) {
144 start_addr = mm->free_area_cache;
145 } else {
146 start_addr = TASK_UNMAPPED_BASE;
147 mm->cached_hole_size = 0;
148 }
298 149
299full_search: 150full_search:
300 addr = ALIGN(start_addr, HPAGE_SIZE); 151 addr = ALIGN(start_addr, HPAGE_SIZE);
@@ -308,6 +159,7 @@ full_search:
308 */ 159 */
309 if (start_addr != TASK_UNMAPPED_BASE) { 160 if (start_addr != TASK_UNMAPPED_BASE) {
310 start_addr = TASK_UNMAPPED_BASE; 161 start_addr = TASK_UNMAPPED_BASE;
162 mm->cached_hole_size = 0;
311 goto full_search; 163 goto full_search;
312 } 164 }
313 return -ENOMEM; 165 return -ENOMEM;
@@ -316,6 +168,8 @@ full_search:
316 mm->free_area_cache = addr + len; 168 mm->free_area_cache = addr + len;
317 return addr; 169 return addr;
318 } 170 }
171 if (addr + mm->cached_hole_size < vma->vm_start)
172 mm->cached_hole_size = vma->vm_start - addr;
319 addr = ALIGN(vma->vm_end, HPAGE_SIZE); 173 addr = ALIGN(vma->vm_end, HPAGE_SIZE);
320 } 174 }
321} 175}
@@ -327,12 +181,17 @@ static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file,
327 struct mm_struct *mm = current->mm; 181 struct mm_struct *mm = current->mm;
328 struct vm_area_struct *vma, *prev_vma; 182 struct vm_area_struct *vma, *prev_vma;
329 unsigned long base = mm->mmap_base, addr = addr0; 183 unsigned long base = mm->mmap_base, addr = addr0;
184 unsigned long largest_hole = mm->cached_hole_size;
330 int first_time = 1; 185 int first_time = 1;
331 186
332 /* don't allow allocations above current base */ 187 /* don't allow allocations above current base */
333 if (mm->free_area_cache > base) 188 if (mm->free_area_cache > base)
334 mm->free_area_cache = base; 189 mm->free_area_cache = base;
335 190
191 if (len <= largest_hole) {
192 largest_hole = 0;
193 mm->free_area_cache = base;
194 }
336try_again: 195try_again:
337 /* make sure it can fit in the remaining address space */ 196 /* make sure it can fit in the remaining address space */
338 if (mm->free_area_cache < len) 197 if (mm->free_area_cache < len)
@@ -353,13 +212,21 @@ try_again:
353 * vma->vm_start, use it: 212 * vma->vm_start, use it:
354 */ 213 */
355 if (addr + len <= vma->vm_start && 214 if (addr + len <= vma->vm_start &&
356 (!prev_vma || (addr >= prev_vma->vm_end))) 215 (!prev_vma || (addr >= prev_vma->vm_end))) {
357 /* remember the address as a hint for next time */ 216 /* remember the address as a hint for next time */
358 return (mm->free_area_cache = addr); 217 mm->cached_hole_size = largest_hole;
359 else 218 return (mm->free_area_cache = addr);
219 } else {
360 /* pull free_area_cache down to the first hole */ 220 /* pull free_area_cache down to the first hole */
361 if (mm->free_area_cache == vma->vm_end) 221 if (mm->free_area_cache == vma->vm_end) {
362 mm->free_area_cache = vma->vm_start; 222 mm->free_area_cache = vma->vm_start;
223 mm->cached_hole_size = largest_hole;
224 }
225 }
226
227 /* remember the largest hole we saw so far */
228 if (addr + largest_hole < vma->vm_start)
229 largest_hole = vma->vm_start - addr;
363 230
364 /* try just below the current vma->vm_start */ 231 /* try just below the current vma->vm_start */
365 addr = (vma->vm_start - len) & HPAGE_MASK; 232 addr = (vma->vm_start - len) & HPAGE_MASK;
@@ -372,6 +239,7 @@ fail:
372 */ 239 */
373 if (first_time) { 240 if (first_time) {
374 mm->free_area_cache = base; 241 mm->free_area_cache = base;
242 largest_hole = 0;
375 first_time = 0; 243 first_time = 0;
376 goto try_again; 244 goto try_again;
377 } 245 }
@@ -382,6 +250,7 @@ fail:
382 * allocations. 250 * allocations.
383 */ 251 */
384 mm->free_area_cache = TASK_UNMAPPED_BASE; 252 mm->free_area_cache = TASK_UNMAPPED_BASE;
253 mm->cached_hole_size = ~0UL;
385 addr = hugetlb_get_unmapped_area_bottomup(file, addr0, 254 addr = hugetlb_get_unmapped_area_bottomup(file, addr0,
386 len, pgoff, flags); 255 len, pgoff, flags);
387 256
@@ -389,6 +258,7 @@ fail:
389 * Restore the topdown base: 258 * Restore the topdown base:
390 */ 259 */
391 mm->free_area_cache = base; 260 mm->free_area_cache = base;
261 mm->cached_hole_size = ~0UL;
392 262
393 return addr; 263 return addr;
394} 264}
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 7a7ea3737265..8766c771bb45 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -269,7 +269,6 @@ void __init one_highpage_init(struct page *page, int pfn, int bad_ppro)
269{ 269{
270 if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) { 270 if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) {
271 ClearPageReserved(page); 271 ClearPageReserved(page);
272 set_bit(PG_highmem, &page->flags);
273 set_page_count(page, 1); 272 set_page_count(page, 1);
274 __free_page(page); 273 __free_page(page);
275 totalhigh_pages++; 274 totalhigh_pages++;
diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c
index db06f7399913..ab542792b27b 100644
--- a/arch/i386/mm/ioremap.c
+++ b/arch/i386/mm/ioremap.c
@@ -238,19 +238,21 @@ void iounmap(volatile void __iomem *addr)
238 addr < phys_to_virt(ISA_END_ADDRESS)) 238 addr < phys_to_virt(ISA_END_ADDRESS))
239 return; 239 return;
240 240
241 p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); 241 write_lock(&vmlist_lock);
242 p = __remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr));
242 if (!p) { 243 if (!p) {
243 printk("__iounmap: bad address %p\n", addr); 244 printk("iounmap: bad address %p\n", addr);
244 return; 245 goto out_unlock;
245 } 246 }
246 247
247 if ((p->flags >> 20) && p->phys_addr < virt_to_phys(high_memory) - 1) { 248 if ((p->flags >> 20) && p->phys_addr < virt_to_phys(high_memory) - 1) {
248 /* p->size includes the guard page, but cpa doesn't like that */
249 change_page_attr(virt_to_page(__va(p->phys_addr)), 249 change_page_attr(virt_to_page(__va(p->phys_addr)),
250 p->size >> PAGE_SHIFT, 250 p->size >> PAGE_SHIFT,
251 PAGE_KERNEL); 251 PAGE_KERNEL);
252 global_flush_tlb(); 252 global_flush_tlb();
253 } 253 }
254out_unlock:
255 write_unlock(&vmlist_lock);
254 kfree(p); 256 kfree(p);
255} 257}
256 258
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c
index be52c5ac4e05..8e8e895e1b5a 100644
--- a/arch/i386/pci/fixup.c
+++ b/arch/i386/pci/fixup.c
@@ -253,7 +253,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2, pci
253#define MAX_PCIEROOT 6 253#define MAX_PCIEROOT 6
254static int quirk_aspm_offset[MAX_PCIEROOT << 3]; 254static int quirk_aspm_offset[MAX_PCIEROOT << 3];
255 255
256#define GET_INDEX(a, b) (((a - PCI_DEVICE_ID_INTEL_MCH_PA) << 3) + b) 256#define GET_INDEX(a, b) ((((a) - PCI_DEVICE_ID_INTEL_MCH_PA) << 3) + ((b) & 7))
257 257
258static int quirk_pcie_aspm_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) 258static int quirk_pcie_aspm_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
259{ 259{
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index d6598da4b67b..da21b1d07c15 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -1029,7 +1029,6 @@ void pcibios_penalize_isa_irq(int irq)
1029static int pirq_enable_irq(struct pci_dev *dev) 1029static int pirq_enable_irq(struct pci_dev *dev)
1030{ 1030{
1031 u8 pin; 1031 u8 pin;
1032 extern int via_interrupt_line_quirk;
1033 struct pci_dev *temp_dev; 1032 struct pci_dev *temp_dev;
1034 1033
1035 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); 1034 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
@@ -1084,10 +1083,6 @@ static int pirq_enable_irq(struct pci_dev *dev)
1084 printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of device %s.%s\n", 1083 printk(KERN_WARNING "PCI: No IRQ known for interrupt pin %c of device %s.%s\n",
1085 'A' + pin, pci_name(dev), msg); 1084 'A' + pin, pci_name(dev), msg);
1086 } 1085 }
1087 /* VIA bridges use interrupt line for apic/pci steering across
1088 the V-Link */
1089 else if (via_interrupt_line_quirk)
1090 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq & 15);
1091 return 0; 1086 return 0;
1092} 1087}
1093 1088
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 3ad2c4af099c..34e603cc1716 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -50,6 +50,10 @@ config SCHED_NO_NO_OMIT_FRAME_POINTER
50 bool 50 bool
51 default y 51 default y
52 52
53config IA64_UNCACHED_ALLOCATOR
54 bool
55 select GENERIC_ALLOCATOR
56
53choice 57choice
54 prompt "System type" 58 prompt "System type"
55 default IA64_GENERIC 59 default IA64_GENERIC
@@ -223,7 +227,7 @@ config IA64_SGI_SN_SIM
223 227
224config IA64_SGI_SN_XP 228config IA64_SGI_SN_XP
225 tristate "Support communication between SGI SSIs" 229 tristate "Support communication between SGI SSIs"
226 depends on MSPEC 230 select IA64_UNCACHED_ALLOCATOR
227 help 231 help
228 An SGI machine can be divided into multiple Single System 232 An SGI machine can be divided into multiple Single System
229 Images which act independently of each other and have 233 Images which act independently of each other and have
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index 6ff7107fee4d..a01bb02d074d 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -588,6 +588,7 @@ CONFIG_SGI_MBCS=m
588CONFIG_SERIAL_CORE=y 588CONFIG_SERIAL_CORE=y
589CONFIG_SERIAL_CORE_CONSOLE=y 589CONFIG_SERIAL_CORE_CONSOLE=y
590CONFIG_SERIAL_SGI_L1_CONSOLE=y 590CONFIG_SERIAL_SGI_L1_CONSOLE=y
591CONFIG_SERIAL_SGI_IOC4=y
591CONFIG_UNIX98_PTYS=y 592CONFIG_UNIX98_PTYS=y
592CONFIG_LEGACY_PTYS=y 593CONFIG_LEGACY_PTYS=y
593CONFIG_LEGACY_PTY_COUNT=256 594CONFIG_LEGACY_PTY_COUNT=256
@@ -788,6 +789,11 @@ CONFIG_INFINIBAND_IPOIB=m
788# CONFIG_INFINIBAND_IPOIB_DEBUG is not set 789# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
789 790
790# 791#
792# SN Devices
793#
794CONFIG_SGI_IOC4=y
795
796#
791# File systems 797# File systems
792# 798#
793CONFIG_EXT2_FS=y 799CONFIG_EXT2_FS=y
diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig
index 7539e83bf054..9997ef45ab23 100644
--- a/arch/ia64/defconfig
+++ b/arch/ia64/defconfig
@@ -638,6 +638,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
638CONFIG_SERIAL_CORE=y 638CONFIG_SERIAL_CORE=y
639CONFIG_SERIAL_CORE_CONSOLE=y 639CONFIG_SERIAL_CORE_CONSOLE=y
640CONFIG_SERIAL_SGI_L1_CONSOLE=y 640CONFIG_SERIAL_SGI_L1_CONSOLE=y
641CONFIG_SERIAL_SGI_IOC4=y
641CONFIG_UNIX98_PTYS=y 642CONFIG_UNIX98_PTYS=y
642CONFIG_LEGACY_PTYS=y 643CONFIG_LEGACY_PTYS=y
643CONFIG_LEGACY_PTY_COUNT=256 644CONFIG_LEGACY_PTY_COUNT=256
@@ -943,6 +944,11 @@ CONFIG_INFINIBAND_IPOIB=m
943# CONFIG_INFINIBAND_IPOIB_DEBUG is not set 944# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
944 945
945# 946#
947# SN Devices
948#
949CONFIG_SGI_IOC4=y
950
951#
946# File systems 952# File systems
947# 953#
948CONFIG_EXT2_FS=y 954CONFIG_EXT2_FS=y
diff --git a/arch/ia64/ia32/ia32_ioctl.c b/arch/ia64/ia32/ia32_ioctl.c
index 9845dabe2613..164b211f4174 100644
--- a/arch/ia64/ia32/ia32_ioctl.c
+++ b/arch/ia64/ia32/ia32_ioctl.c
@@ -13,7 +13,6 @@
13 13
14#define INCLUDES 14#define INCLUDES
15#include "compat_ioctl.c" 15#include "compat_ioctl.c"
16#include <asm/ioctl32.h>
17 16
18#define IOCTL_NR(a) ((a) & ~(_IOC_SIZEMASK << _IOC_SIZESHIFT)) 17#define IOCTL_NR(a) ((a) & ~(_IOC_SIZEMASK << _IOC_SIZESHIFT))
19 18
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index 247a21c64aea..c1e20d65dd6c 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -2427,7 +2427,7 @@ sys32_epoll_wait(int epfd, struct epoll_event32 __user * events, int maxevents,
2427{ 2427{
2428 struct epoll_event *events64 = NULL; 2428 struct epoll_event *events64 = NULL;
2429 mm_segment_t old_fs = get_fs(); 2429 mm_segment_t old_fs = get_fs();
2430 int error, numevents, size; 2430 int numevents, size;
2431 int evt_idx; 2431 int evt_idx;
2432 int do_free_pages = 0; 2432 int do_free_pages = 0;
2433 2433
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index c1a02bbc252c..4c73d8ba2e3d 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_SMP) += smp.o smpboot.o domain.o
20obj-$(CONFIG_PERFMON) += perfmon_default_smpl.o 20obj-$(CONFIG_PERFMON) += perfmon_default_smpl.o
21obj-$(CONFIG_IA64_CYCLONE) += cyclone.o 21obj-$(CONFIG_IA64_CYCLONE) += cyclone.o
22obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o 22obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o
23obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o
23mca_recovery-y += mca_drv.o mca_drv_asm.o 24mca_recovery-y += mca_drv.o mca_drv_asm.o
24 25
25# The gate DSO image is built using a special linker script. 26# The gate DSO image is built using a special linker script.
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 4a3b1aac43e7..179f230816ed 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -410,6 +410,38 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
410} 410}
411 411
412/* 412/*
413 * Walk the EFI memory map to pull out leftover pages in the lower
414 * memory regions which do not end up in the regular memory map and
415 * stick them into the uncached allocator
416 *
417 * The regular walk function is significantly more complex than the
418 * uncached walk which means it really doesn't make sense to try and
419 * marge the two.
420 */
421void __init
422efi_memmap_walk_uc (efi_freemem_callback_t callback)
423{
424 void *efi_map_start, *efi_map_end, *p;
425 efi_memory_desc_t *md;
426 u64 efi_desc_size, start, end;
427
428 efi_map_start = __va(ia64_boot_param->efi_memmap);
429 efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size;
430 efi_desc_size = ia64_boot_param->efi_memdesc_size;
431
432 for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
433 md = p;
434 if (md->attribute == EFI_MEMORY_UC) {
435 start = PAGE_ALIGN(md->phys_addr);
436 end = PAGE_ALIGN((md->phys_addr+(md->num_pages << EFI_PAGE_SHIFT)) & PAGE_MASK);
437 if ((*callback)(start, end, NULL) < 0)
438 return;
439 }
440 }
441}
442
443
444/*
413 * Look for the PAL_CODE region reported by EFI and maps it using an 445 * Look for the PAL_CODE region reported by EFI and maps it using an
414 * ITR to enable safe PAL calls in virtual mode. See IA-64 Processor 446 * ITR to enable safe PAL calls in virtual mode. See IA-64 Processor
415 * Abstraction Layer chapter 11 in ADAG 447 * Abstraction Layer chapter 11 in ADAG
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 81c45d447394..b1d5d3d5276c 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1182,7 +1182,7 @@ ENTRY(notify_resume_user)
1182 ;; 1182 ;;
1183(pNonSys) mov out2=0 // out2==0 => not a syscall 1183(pNonSys) mov out2=0 // out2==0 => not a syscall
1184 .fframe 16 1184 .fframe 16
1185 .spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!) 1185 .spillsp ar.unat, 16
1186 st8 [sp]=r9,-16 // allocate space for ar.unat and save it 1186 st8 [sp]=r9,-16 // allocate space for ar.unat and save it
1187 st8 [out1]=loc1,-8 // save ar.pfs, out1=&sigscratch 1187 st8 [out1]=loc1,-8 // save ar.pfs, out1=&sigscratch
1188 .body 1188 .body
@@ -1208,7 +1208,7 @@ GLOBAL_ENTRY(sys_rt_sigsuspend)
1208 adds out2=8,sp // out2=&sigscratch->ar_pfs 1208 adds out2=8,sp // out2=&sigscratch->ar_pfs
1209 ;; 1209 ;;
1210 .fframe 16 1210 .fframe 16
1211 .spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!) 1211 .spillsp ar.unat, 16
1212 st8 [sp]=r9,-16 // allocate space for ar.unat and save it 1212 st8 [sp]=r9,-16 // allocate space for ar.unat and save it
1213 st8 [out2]=loc1,-8 // save ar.pfs, out2=&sigscratch 1213 st8 [out2]=loc1,-8 // save ar.pfs, out2=&sigscratch
1214 .body 1214 .body
@@ -1579,7 +1579,7 @@ sys_call_table:
1579 data8 sys_keyctl 1579 data8 sys_keyctl
1580 data8 sys_ni_syscall 1580 data8 sys_ni_syscall
1581 data8 sys_ni_syscall // 1275 1581 data8 sys_ni_syscall // 1275
1582 data8 sys_ni_syscall 1582 data8 sys_set_zone_reclaim
1583 data8 sys_ni_syscall 1583 data8 sys_ni_syscall
1584 data8 sys_ni_syscall 1584 data8 sys_ni_syscall
1585 data8 sys_ni_syscall 1585 data8 sys_ni_syscall
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
index 4f3cdef75797..962b6c4e32b5 100644
--- a/arch/ia64/kernel/fsys.S
+++ b/arch/ia64/kernel/fsys.S
@@ -460,9 +460,9 @@ EX(.fail_efault, ld8 r14=[r33]) // r14 <- *set
460 ;; 460 ;;
461 461
462 st8 [r2]=r14 // update current->blocked with new mask 462 st8 [r2]=r14 // update current->blocked with new mask
463 cmpxchg4.acq r14=[r9],r18,ar.ccv // current->thread_info->flags <- r18 463 cmpxchg4.acq r8=[r9],r18,ar.ccv // current->thread_info->flags <- r18
464 ;; 464 ;;
465 cmp.ne p6,p0=r17,r14 // update failed? 465 cmp.ne p6,p0=r17,r8 // update failed?
466(p6) br.cond.spnt.few 1b // yes -> retry 466(p6) br.cond.spnt.few 1b // yes -> retry
467 467
468#ifdef CONFIG_SMP 468#ifdef CONFIG_SMP
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 4d6c7b8f667b..736e328b5e61 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -1103,8 +1103,6 @@ ia64_mca_cpe_int_caller(int cpe_irq, void *arg, struct pt_regs *ptregs)
1103 return IRQ_HANDLED; 1103 return IRQ_HANDLED;
1104} 1104}
1105 1105
1106#endif /* CONFIG_ACPI */
1107
1108/* 1106/*
1109 * ia64_mca_cpe_poll 1107 * ia64_mca_cpe_poll
1110 * 1108 *
@@ -1122,6 +1120,8 @@ ia64_mca_cpe_poll (unsigned long dummy)
1122 platform_send_ipi(first_cpu(cpu_online_map), IA64_CPEP_VECTOR, IA64_IPI_DM_INT, 0); 1120 platform_send_ipi(first_cpu(cpu_online_map), IA64_CPEP_VECTOR, IA64_IPI_DM_INT, 0);
1123} 1121}
1124 1122
1123#endif /* CONFIG_ACPI */
1124
1125/* 1125/*
1126 * C portion of the OS INIT handler 1126 * C portion of the OS INIT handler
1127 * 1127 *
@@ -1390,8 +1390,7 @@ ia64_mca_init(void)
1390 register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction); 1390 register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);
1391 1391
1392#ifdef CONFIG_ACPI 1392#ifdef CONFIG_ACPI
1393 /* Setup the CPEI/P vector and handler */ 1393 /* Setup the CPEI/P handler */
1394 cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI);
1395 register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction); 1394 register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);
1396#endif 1395#endif
1397 1396
@@ -1436,6 +1435,7 @@ ia64_mca_late_init(void)
1436 1435
1437#ifdef CONFIG_ACPI 1436#ifdef CONFIG_ACPI
1438 /* Setup the CPEI/P vector and handler */ 1437 /* Setup the CPEI/P vector and handler */
1438 cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI);
1439 init_timer(&cpe_poll_timer); 1439 init_timer(&cpe_poll_timer);
1440 cpe_poll_timer.function = ia64_mca_cpe_poll; 1440 cpe_poll_timer.function = ia64_mca_cpe_poll;
1441 1441
diff --git a/arch/ia64/kernel/minstate.h b/arch/ia64/kernel/minstate.h
index 1dbc7b2497c9..f6d8a010d99b 100644
--- a/arch/ia64/kernel/minstate.h
+++ b/arch/ia64/kernel/minstate.h
@@ -41,7 +41,7 @@
41(pKStk) addl r3=THIS_CPU(ia64_mca_data),r3;; \ 41(pKStk) addl r3=THIS_CPU(ia64_mca_data),r3;; \
42(pKStk) ld8 r3 = [r3];; \ 42(pKStk) ld8 r3 = [r3];; \
43(pKStk) addl r3=IA64_MCA_CPU_INIT_STACK_OFFSET,r3;; \ 43(pKStk) addl r3=IA64_MCA_CPU_INIT_STACK_OFFSET,r3;; \
44(pKStk) addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3; \ 44(pKStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3; \
45(pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \ 45(pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \
46(pUStk) addl r22=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \ 46(pUStk) addl r22=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \
47 ;; \ 47 ;; \
@@ -50,7 +50,6 @@
50(pUStk) mov r23=ar.bspstore; /* save ar.bspstore */ \ 50(pUStk) mov r23=ar.bspstore; /* save ar.bspstore */ \
51(pUStk) dep r22=-1,r22,61,3; /* compute kernel virtual addr of RBS */ \ 51(pUStk) dep r22=-1,r22,61,3; /* compute kernel virtual addr of RBS */ \
52 ;; \ 52 ;; \
53(pKStk) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \
54(pUStk) mov ar.bspstore=r22; /* switch to kernel RBS */ \ 53(pUStk) mov ar.bspstore=r22; /* switch to kernel RBS */ \
55 ;; \ 54 ;; \
56(pUStk) mov r18=ar.bsp; \ 55(pUStk) mov r18=ar.bsp; \
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
index febc091c2f02..f1aca7cffd12 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -825,14 +825,16 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
825 * XXX Should have an arch-hook for running this after final section 825 * XXX Should have an arch-hook for running this after final section
826 * addresses have been selected... 826 * addresses have been selected...
827 */ 827 */
828 /* See if gp can cover the entire core module: */ 828 uint64_t gp;
829 uint64_t gp = (uint64_t) mod->module_core + MAX_LTOFF / 2; 829 if (mod->core_size > MAX_LTOFF)
830 if (mod->core_size >= MAX_LTOFF)
831 /* 830 /*
832 * This takes advantage of fact that SHF_ARCH_SMALL gets allocated 831 * This takes advantage of fact that SHF_ARCH_SMALL gets allocated
833 * at the end of the module. 832 * at the end of the module.
834 */ 833 */
835 gp = (uint64_t) mod->module_core + mod->core_size - MAX_LTOFF / 2; 834 gp = mod->core_size - MAX_LTOFF / 2;
835 else
836 gp = mod->core_size / 2;
837 gp = (uint64_t) mod->module_core + ((gp + 7) & -8);
836 mod->arch.gp = gp; 838 mod->arch.gp = gp;
837 DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp); 839 DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp);
838 } 840 }
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 71c101601e3e..6407bff6bfd7 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -11,7 +11,7 @@
11 * Version Perfmon-2.x is a rewrite of perfmon-1.x 11 * Version Perfmon-2.x is a rewrite of perfmon-1.x
12 * by Stephane Eranian, Hewlett Packard Co. 12 * by Stephane Eranian, Hewlett Packard Co.
13 * 13 *
14 * Copyright (C) 1999-2003, 2005 Hewlett Packard Co 14 * Copyright (C) 1999-2005 Hewlett Packard Co
15 * Stephane Eranian <eranian@hpl.hp.com> 15 * Stephane Eranian <eranian@hpl.hp.com>
16 * David Mosberger-Tang <davidm@hpl.hp.com> 16 * David Mosberger-Tang <davidm@hpl.hp.com>
17 * 17 *
@@ -497,6 +497,9 @@ typedef struct {
497static pfm_stats_t pfm_stats[NR_CPUS]; 497static pfm_stats_t pfm_stats[NR_CPUS];
498static pfm_session_t pfm_sessions; /* global sessions information */ 498static pfm_session_t pfm_sessions; /* global sessions information */
499 499
500static spinlock_t pfm_alt_install_check = SPIN_LOCK_UNLOCKED;
501static pfm_intr_handler_desc_t *pfm_alt_intr_handler;
502
500static struct proc_dir_entry *perfmon_dir; 503static struct proc_dir_entry *perfmon_dir;
501static pfm_uuid_t pfm_null_uuid = {0,}; 504static pfm_uuid_t pfm_null_uuid = {0,};
502 505
@@ -606,6 +609,7 @@ DEFINE_PER_CPU(unsigned long, pfm_syst_info);
606DEFINE_PER_CPU(struct task_struct *, pmu_owner); 609DEFINE_PER_CPU(struct task_struct *, pmu_owner);
607DEFINE_PER_CPU(pfm_context_t *, pmu_ctx); 610DEFINE_PER_CPU(pfm_context_t *, pmu_ctx);
608DEFINE_PER_CPU(unsigned long, pmu_activation_number); 611DEFINE_PER_CPU(unsigned long, pmu_activation_number);
612EXPORT_PER_CPU_SYMBOL_GPL(pfm_syst_info);
609 613
610 614
611/* forward declaration */ 615/* forward declaration */
@@ -1325,7 +1329,7 @@ pfm_reserve_session(struct task_struct *task, int is_syswide, unsigned int cpu)
1325error_conflict: 1329error_conflict:
1326 DPRINT(("system wide not possible, conflicting session [%d] on CPU%d\n", 1330 DPRINT(("system wide not possible, conflicting session [%d] on CPU%d\n",
1327 pfm_sessions.pfs_sys_session[cpu]->pid, 1331 pfm_sessions.pfs_sys_session[cpu]->pid,
1328 smp_processor_id())); 1332 cpu));
1329abort: 1333abort:
1330 UNLOCK_PFS(flags); 1334 UNLOCK_PFS(flags);
1331 1335
@@ -5555,26 +5559,32 @@ pfm_interrupt_handler(int irq, void *arg, struct pt_regs *regs)
5555 int ret; 5559 int ret;
5556 5560
5557 this_cpu = get_cpu(); 5561 this_cpu = get_cpu();
5558 min = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min; 5562 if (likely(!pfm_alt_intr_handler)) {
5559 max = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max; 5563 min = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min;
5564 max = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max;
5560 5565
5561 start_cycles = ia64_get_itc(); 5566 start_cycles = ia64_get_itc();
5562 5567
5563 ret = pfm_do_interrupt_handler(irq, arg, regs); 5568 ret = pfm_do_interrupt_handler(irq, arg, regs);
5564 5569
5565 total_cycles = ia64_get_itc(); 5570 total_cycles = ia64_get_itc();
5566 5571
5567 /* 5572 /*
5568 * don't measure spurious interrupts 5573 * don't measure spurious interrupts
5569 */ 5574 */
5570 if (likely(ret == 0)) { 5575 if (likely(ret == 0)) {
5571 total_cycles -= start_cycles; 5576 total_cycles -= start_cycles;
5572 5577
5573 if (total_cycles < min) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min = total_cycles; 5578 if (total_cycles < min) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min = total_cycles;
5574 if (total_cycles > max) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max = total_cycles; 5579 if (total_cycles > max) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max = total_cycles;
5575 5580
5576 pfm_stats[this_cpu].pfm_ovfl_intr_cycles += total_cycles; 5581 pfm_stats[this_cpu].pfm_ovfl_intr_cycles += total_cycles;
5582 }
5583 }
5584 else {
5585 (*pfm_alt_intr_handler->handler)(irq, arg, regs);
5577 } 5586 }
5587
5578 put_cpu_no_resched(); 5588 put_cpu_no_resched();
5579 return IRQ_HANDLED; 5589 return IRQ_HANDLED;
5580} 5590}
@@ -6425,6 +6435,141 @@ static struct irqaction perfmon_irqaction = {
6425 .name = "perfmon" 6435 .name = "perfmon"
6426}; 6436};
6427 6437
6438static void
6439pfm_alt_save_pmu_state(void *data)
6440{
6441 struct pt_regs *regs;
6442
6443 regs = ia64_task_regs(current);
6444
6445 DPRINT(("called\n"));
6446
6447 /*
6448 * should not be necessary but
6449 * let's take not risk
6450 */
6451 pfm_clear_psr_up();
6452 pfm_clear_psr_pp();
6453 ia64_psr(regs)->pp = 0;
6454
6455 /*
6456 * This call is required
6457 * May cause a spurious interrupt on some processors
6458 */
6459 pfm_freeze_pmu();
6460
6461 ia64_srlz_d();
6462}
6463
6464void
6465pfm_alt_restore_pmu_state(void *data)
6466{
6467 struct pt_regs *regs;
6468
6469 regs = ia64_task_regs(current);
6470
6471 DPRINT(("called\n"));
6472
6473 /*
6474 * put PMU back in state expected
6475 * by perfmon
6476 */
6477 pfm_clear_psr_up();
6478 pfm_clear_psr_pp();
6479 ia64_psr(regs)->pp = 0;
6480
6481 /*
6482 * perfmon runs with PMU unfrozen at all times
6483 */
6484 pfm_unfreeze_pmu();
6485
6486 ia64_srlz_d();
6487}
6488
6489int
6490pfm_install_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl)
6491{
6492 int ret, i;
6493 int reserve_cpu;
6494
6495 /* some sanity checks */
6496 if (hdl == NULL || hdl->handler == NULL) return -EINVAL;
6497
6498 /* do the easy test first */
6499 if (pfm_alt_intr_handler) return -EBUSY;
6500
6501 /* one at a time in the install or remove, just fail the others */
6502 if (!spin_trylock(&pfm_alt_install_check)) {
6503 return -EBUSY;
6504 }
6505
6506 /* reserve our session */
6507 for_each_online_cpu(reserve_cpu) {
6508 ret = pfm_reserve_session(NULL, 1, reserve_cpu);
6509 if (ret) goto cleanup_reserve;
6510 }
6511
6512 /* save the current system wide pmu states */
6513 ret = on_each_cpu(pfm_alt_save_pmu_state, NULL, 0, 1);
6514 if (ret) {
6515 DPRINT(("on_each_cpu() failed: %d\n", ret));
6516 goto cleanup_reserve;
6517 }
6518
6519 /* officially change to the alternate interrupt handler */
6520 pfm_alt_intr_handler = hdl;
6521
6522 spin_unlock(&pfm_alt_install_check);
6523
6524 return 0;
6525
6526cleanup_reserve:
6527 for_each_online_cpu(i) {
6528 /* don't unreserve more than we reserved */
6529 if (i >= reserve_cpu) break;
6530
6531 pfm_unreserve_session(NULL, 1, i);
6532 }
6533
6534 spin_unlock(&pfm_alt_install_check);
6535
6536 return ret;
6537}
6538EXPORT_SYMBOL_GPL(pfm_install_alt_pmu_interrupt);
6539
6540int
6541pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl)
6542{
6543 int i;
6544 int ret;
6545
6546 if (hdl == NULL) return -EINVAL;
6547
6548 /* cannot remove someone else's handler! */
6549 if (pfm_alt_intr_handler != hdl) return -EINVAL;
6550
6551 /* one at a time in the install or remove, just fail the others */
6552 if (!spin_trylock(&pfm_alt_install_check)) {
6553 return -EBUSY;
6554 }
6555
6556 pfm_alt_intr_handler = NULL;
6557
6558 ret = on_each_cpu(pfm_alt_restore_pmu_state, NULL, 0, 1);
6559 if (ret) {
6560 DPRINT(("on_each_cpu() failed: %d\n", ret));
6561 }
6562
6563 for_each_online_cpu(i) {
6564 pfm_unreserve_session(NULL, 1, i);
6565 }
6566
6567 spin_unlock(&pfm_alt_install_check);
6568
6569 return 0;
6570}
6571EXPORT_SYMBOL_GPL(pfm_remove_alt_pmu_interrupt);
6572
6428/* 6573/*
6429 * perfmon initialization routine, called from the initcall() table 6574 * perfmon initialization routine, called from the initcall() table
6430 */ 6575 */
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 907464ee7273..575a8f657b31 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -635,11 +635,17 @@ ia64_flush_fph (struct task_struct *task)
635{ 635{
636 struct ia64_psr *psr = ia64_psr(ia64_task_regs(task)); 636 struct ia64_psr *psr = ia64_psr(ia64_task_regs(task));
637 637
638 /*
639 * Prevent migrating this task while
640 * we're fiddling with the FPU state
641 */
642 preempt_disable();
638 if (ia64_is_local_fpu_owner(task) && psr->mfh) { 643 if (ia64_is_local_fpu_owner(task) && psr->mfh) {
639 psr->mfh = 0; 644 psr->mfh = 0;
640 task->thread.flags |= IA64_THREAD_FPH_VALID; 645 task->thread.flags |= IA64_THREAD_FPH_VALID;
641 ia64_save_fpu(&task->thread.fph[0]); 646 ia64_save_fpu(&task->thread.fph[0]);
642 } 647 }
648 preempt_enable();
643} 649}
644 650
645/* 651/*
@@ -692,16 +698,30 @@ convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt,
692 unsigned long cfm) 698 unsigned long cfm)
693{ 699{
694 struct unw_frame_info info, prev_info; 700 struct unw_frame_info info, prev_info;
695 unsigned long ip, pr; 701 unsigned long ip, sp, pr;
696 702
697 unw_init_from_blocked_task(&info, child); 703 unw_init_from_blocked_task(&info, child);
698 while (1) { 704 while (1) {
699 prev_info = info; 705 prev_info = info;
700 if (unw_unwind(&info) < 0) 706 if (unw_unwind(&info) < 0)
701 return; 707 return;
702 if (unw_get_rp(&info, &ip) < 0) 708
709 unw_get_sp(&info, &sp);
710 if ((long)((unsigned long)child + IA64_STK_OFFSET - sp)
711 < IA64_PT_REGS_SIZE) {
712 dprintk("ptrace.%s: ran off the top of the kernel "
713 "stack\n", __FUNCTION__);
714 return;
715 }
716 if (unw_get_pr (&prev_info, &pr) < 0) {
717 unw_get_rp(&prev_info, &ip);
718 dprintk("ptrace.%s: failed to read "
719 "predicate register (ip=0x%lx)\n",
720 __FUNCTION__, ip);
703 return; 721 return;
704 if (ip < FIXADDR_USER_END) 722 }
723 if (unw_is_intr_frame(&info)
724 && (pr & (1UL << PRED_USER_STACK)))
705 break; 725 break;
706 } 726 }
707 727
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index b7e6b4cb374b..d14692e0920a 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -720,7 +720,8 @@ cpu_init (void)
720 ia64_set_kr(IA64_KR_PT_BASE, __pa(ia64_imva(empty_zero_page))); 720 ia64_set_kr(IA64_KR_PT_BASE, __pa(ia64_imva(empty_zero_page)));
721 721
722 /* 722 /*
723 * Initialize default control register to defer all speculative faults. The 723 * Initialize default control register to defer speculative faults except
724 * for those arising from TLB misses, which are not deferred. The
724 * kernel MUST NOT depend on a particular setting of these bits (in other words, 725 * kernel MUST NOT depend on a particular setting of these bits (in other words,
725 * the kernel must have recovery code for all speculative accesses). Turn on 726 * the kernel must have recovery code for all speculative accesses). Turn on
726 * dcr.lc as per recommendation by the architecture team. Most IA-32 apps 727 * dcr.lc as per recommendation by the architecture team. Most IA-32 apps
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 0d5ee57c9865..3865f088ffa2 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -624,7 +624,7 @@ static struct {
624 __u16 thread_id; 624 __u16 thread_id;
625 __u16 proc_fixed_addr; 625 __u16 proc_fixed_addr;
626 __u8 valid; 626 __u8 valid;
627}mt_info[NR_CPUS] __devinit; 627} mt_info[NR_CPUS] __devinitdata;
628 628
629#ifdef CONFIG_HOTPLUG_CPU 629#ifdef CONFIG_HOTPLUG_CPU
630static inline void 630static inline void
diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
index a8cf6d8a509c..770fab37928e 100644
--- a/arch/ia64/kernel/sys_ia64.c
+++ b/arch/ia64/kernel/sys_ia64.c
@@ -182,13 +182,6 @@ do_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, un
182 } 182 }
183 } 183 }
184 184
185 /*
186 * A zero mmap always succeeds in Linux, independent of whether or not the
187 * remaining arguments are valid.
188 */
189 if (len == 0)
190 goto out;
191
192 /* Careful about overflows.. */ 185 /* Careful about overflows.. */
193 len = PAGE_ALIGN(len); 186 len = PAGE_ALIGN(len);
194 if (!len || len > TASK_SIZE) { 187 if (!len || len > TASK_SIZE) {
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index e82ad78081b3..1861173bd4f6 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -111,6 +111,24 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
111 siginfo_t siginfo; 111 siginfo_t siginfo;
112 int sig, code; 112 int sig, code;
113 113
114 /* break.b always sets cr.iim to 0, which causes problems for
115 * debuggers. Get the real break number from the original instruction,
116 * but only for kernel code. User space break.b is left alone, to
117 * preserve the existing behaviour. All break codings have the same
118 * format, so there is no need to check the slot type.
119 */
120 if (break_num == 0 && !user_mode(regs)) {
121 struct ia64_psr *ipsr = ia64_psr(regs);
122 unsigned long *bundle = (unsigned long *)regs->cr_iip;
123 unsigned long slot;
124 switch (ipsr->ri) {
125 case 0: slot = (bundle[0] >> 5); break;
126 case 1: slot = (bundle[0] >> 46) | (bundle[1] << 18); break;
127 default: slot = (bundle[1] >> 23); break;
128 }
129 break_num = ((slot >> 36 & 1) << 20) | (slot >> 6 & 0xfffff);
130 }
131
114 /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */ 132 /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */
115 siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri); 133 siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
116 siginfo.si_imm = break_num; 134 siginfo.si_imm = break_num;
@@ -202,13 +220,21 @@ disabled_fph_fault (struct pt_regs *regs)
202 220
203 /* first, grant user-level access to fph partition: */ 221 /* first, grant user-level access to fph partition: */
204 psr->dfh = 0; 222 psr->dfh = 0;
223
224 /*
225 * Make sure that no other task gets in on this processor
226 * while we're claiming the FPU
227 */
228 preempt_disable();
205#ifndef CONFIG_SMP 229#ifndef CONFIG_SMP
206 { 230 {
207 struct task_struct *fpu_owner 231 struct task_struct *fpu_owner
208 = (struct task_struct *)ia64_get_kr(IA64_KR_FPU_OWNER); 232 = (struct task_struct *)ia64_get_kr(IA64_KR_FPU_OWNER);
209 233
210 if (ia64_is_local_fpu_owner(current)) 234 if (ia64_is_local_fpu_owner(current)) {
235 preempt_enable_no_resched();
211 return; 236 return;
237 }
212 238
213 if (fpu_owner) 239 if (fpu_owner)
214 ia64_flush_fph(fpu_owner); 240 ia64_flush_fph(fpu_owner);
@@ -226,6 +252,7 @@ disabled_fph_fault (struct pt_regs *regs)
226 */ 252 */
227 psr->mfh = 1; 253 psr->mfh = 1;
228 } 254 }
255 preempt_enable_no_resched();
229} 256}
230 257
231static inline int 258static inline int
diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c
new file mode 100644
index 000000000000..490dfc9ab47f
--- /dev/null
+++ b/arch/ia64/kernel/uncached.c
@@ -0,0 +1,246 @@
1/*
2 * Copyright (C) 2001-2005 Silicon Graphics, Inc. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License
6 * as published by the Free Software Foundation.
7 *
8 * A simple uncached page allocator using the generic allocator. This
9 * allocator first utilizes the spare (spill) pages found in the EFI
10 * memmap and will then start converting cached pages to uncached ones
11 * at a granule at a time. Node awareness is implemented by having a
12 * pool of pages per node.
13 */
14
15#include <linux/types.h>
16#include <linux/kernel.h>
17#include <linux/module.h>
18#include <linux/init.h>
19#include <linux/errno.h>
20#include <linux/string.h>
21#include <linux/slab.h>
22#include <linux/efi.h>
23#include <linux/genalloc.h>
24#include <asm/page.h>
25#include <asm/pal.h>
26#include <asm/system.h>
27#include <asm/pgtable.h>
28#include <asm/atomic.h>
29#include <asm/tlbflush.h>
30#include <asm/sn/arch.h>
31
32#define DEBUG 0
33
34#if DEBUG
35#define dprintk printk
36#else
37#define dprintk(x...) do { } while (0)
38#endif
39
40void __init efi_memmap_walk_uc (efi_freemem_callback_t callback);
41
42#define MAX_UNCACHED_GRANULES 5
43static int allocated_granules;
44
45struct gen_pool *uncached_pool[MAX_NUMNODES];
46
47
48static void uncached_ipi_visibility(void *data)
49{
50 int status;
51
52 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
53 if ((status != PAL_VISIBILITY_OK) &&
54 (status != PAL_VISIBILITY_OK_REMOTE_NEEDED))
55 printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on "
56 "CPU %i\n", status, get_cpu());
57}
58
59
60static void uncached_ipi_mc_drain(void *data)
61{
62 int status;
63 status = ia64_pal_mc_drain();
64 if (status)
65 printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on "
66 "CPU %i\n", status, get_cpu());
67}
68
69
70static unsigned long
71uncached_get_new_chunk(struct gen_pool *poolp)
72{
73 struct page *page;
74 void *tmp;
75 int status, i;
76 unsigned long addr, node;
77
78 if (allocated_granules >= MAX_UNCACHED_GRANULES)
79 return 0;
80
81 node = poolp->private;
82 page = alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO,
83 IA64_GRANULE_SHIFT-PAGE_SHIFT);
84
85 dprintk(KERN_INFO "get_new_chunk page %p, addr %lx\n",
86 page, (unsigned long)(page-vmem_map) << PAGE_SHIFT);
87
88 /*
89 * Do magic if no mem on local node! XXX
90 */
91 if (!page)
92 return 0;
93 tmp = page_address(page);
94
95 /*
96 * There's a small race here where it's possible for someone to
97 * access the page through /dev/mem halfway through the conversion
98 * to uncached - not sure it's really worth bothering about
99 */
100 for (i = 0; i < (IA64_GRANULE_SIZE / PAGE_SIZE); i++)
101 SetPageUncached(&page[i]);
102
103 flush_tlb_kernel_range(tmp, tmp + IA64_GRANULE_SIZE);
104
105 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
106
107 dprintk(KERN_INFO "pal_prefetch_visibility() returns %i on cpu %i\n",
108 status, get_cpu());
109
110 if (!status) {
111 status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1);
112 if (status)
113 printk(KERN_WARNING "smp_call_function failed for "
114 "uncached_ipi_visibility! (%i)\n", status);
115 }
116
117 if (ia64_platform_is("sn2"))
118 sn_flush_all_caches((unsigned long)tmp, IA64_GRANULE_SIZE);
119 else
120 flush_icache_range((unsigned long)tmp,
121 (unsigned long)tmp+IA64_GRANULE_SIZE);
122
123 ia64_pal_mc_drain();
124 status = smp_call_function(uncached_ipi_mc_drain, NULL, 0, 1);
125 if (status)
126 printk(KERN_WARNING "smp_call_function failed for "
127 "uncached_ipi_mc_drain! (%i)\n", status);
128
129 addr = (unsigned long)tmp - PAGE_OFFSET + __IA64_UNCACHED_OFFSET;
130
131 allocated_granules++;
132 return addr;
133}
134
135
136/*
137 * uncached_alloc_page
138 *
139 * Allocate 1 uncached page. Allocates on the requested node. If no
140 * uncached pages are available on the requested node, roundrobin starting
141 * with higher nodes.
142 */
143unsigned long
144uncached_alloc_page(int nid)
145{
146 unsigned long maddr;
147
148 maddr = gen_pool_alloc(uncached_pool[nid], PAGE_SIZE);
149
150 dprintk(KERN_DEBUG "uncached_alloc_page returns %lx on node %i\n",
151 maddr, nid);
152
153 /*
154 * If no memory is availble on our local node, try the
155 * remaining nodes in the system.
156 */
157 if (!maddr) {
158 int i;
159
160 for (i = MAX_NUMNODES - 1; i >= 0; i--) {
161 if (i == nid || !node_online(i))
162 continue;
163 maddr = gen_pool_alloc(uncached_pool[i], PAGE_SIZE);
164 dprintk(KERN_DEBUG "uncached_alloc_page alternate search "
165 "returns %lx on node %i\n", maddr, i);
166 if (maddr) {
167 break;
168 }
169 }
170 }
171
172 return maddr;
173}
174EXPORT_SYMBOL(uncached_alloc_page);
175
176
177/*
178 * uncached_free_page
179 *
180 * Free a single uncached page.
181 */
182void
183uncached_free_page(unsigned long maddr)
184{
185 int node;
186
187 node = nasid_to_cnodeid(NASID_GET(maddr));
188
189 dprintk(KERN_DEBUG "uncached_free_page(%lx) on node %i\n", maddr, node);
190
191 if ((maddr & (0XFUL << 60)) != __IA64_UNCACHED_OFFSET)
192 panic("uncached_free_page invalid address %lx\n", maddr);
193
194 gen_pool_free(uncached_pool[node], maddr, PAGE_SIZE);
195}
196EXPORT_SYMBOL(uncached_free_page);
197
198
199/*
200 * uncached_build_memmap,
201 *
202 * Called at boot time to build a map of pages that can be used for
203 * memory special operations.
204 */
205static int __init
206uncached_build_memmap(unsigned long start, unsigned long end, void *arg)
207{
208 long length;
209 unsigned long vstart, vend;
210 int node;
211
212 length = end - start;
213 vstart = start + __IA64_UNCACHED_OFFSET;
214 vend = end + __IA64_UNCACHED_OFFSET;
215
216 dprintk(KERN_ERR "uncached_build_memmap(%lx %lx)\n", start, end);
217
218 memset((char *)vstart, 0, length);
219
220 node = nasid_to_cnodeid(NASID_GET(start));
221
222 for (; vstart < vend ; vstart += PAGE_SIZE) {
223 dprintk(KERN_INFO "sticking %lx into the pool!\n", vstart);
224 gen_pool_free(uncached_pool[node], vstart, PAGE_SIZE);
225 }
226
227 return 0;
228}
229
230
231static int __init uncached_init(void) {
232 int i;
233
234 for (i = 0; i < MAX_NUMNODES; i++) {
235 if (!node_online(i))
236 continue;
237 uncached_pool[i] = gen_pool_create(0, IA64_GRANULE_SHIFT,
238 &uncached_get_new_chunk, i);
239 }
240
241 efi_memmap_walk_uc(uncached_build_memmap);
242
243 return 0;
244}
245
246__initcall(uncached_init);
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index df08ae7634b6..e0a776a3044c 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -24,7 +24,7 @@
24 24
25unsigned int hpage_shift=HPAGE_SHIFT_DEFAULT; 25unsigned int hpage_shift=HPAGE_SHIFT_DEFAULT;
26 26
27static pte_t * 27pte_t *
28huge_pte_alloc (struct mm_struct *mm, unsigned long addr) 28huge_pte_alloc (struct mm_struct *mm, unsigned long addr)
29{ 29{
30 unsigned long taddr = htlbpage_to_page(addr); 30 unsigned long taddr = htlbpage_to_page(addr);
@@ -43,7 +43,7 @@ huge_pte_alloc (struct mm_struct *mm, unsigned long addr)
43 return pte; 43 return pte;
44} 44}
45 45
46static pte_t * 46pte_t *
47huge_pte_offset (struct mm_struct *mm, unsigned long addr) 47huge_pte_offset (struct mm_struct *mm, unsigned long addr)
48{ 48{
49 unsigned long taddr = htlbpage_to_page(addr); 49 unsigned long taddr = htlbpage_to_page(addr);
@@ -67,23 +67,6 @@ huge_pte_offset (struct mm_struct *mm, unsigned long addr)
67 67
68#define mk_pte_huge(entry) { pte_val(entry) |= _PAGE_P; } 68#define mk_pte_huge(entry) { pte_val(entry) |= _PAGE_P; }
69 69
70static void
71set_huge_pte (struct mm_struct *mm, struct vm_area_struct *vma,
72 struct page *page, pte_t * page_table, int write_access)
73{
74 pte_t entry;
75
76 add_mm_counter(mm, rss, HPAGE_SIZE / PAGE_SIZE);
77 if (write_access) {
78 entry =
79 pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
80 } else
81 entry = pte_wrprotect(mk_pte(page, vma->vm_page_prot));
82 entry = pte_mkyoung(entry);
83 mk_pte_huge(entry);
84 set_pte(page_table, entry);
85 return;
86}
87/* 70/*
88 * This function checks for proper alignment of input addr and len parameters. 71 * This function checks for proper alignment of input addr and len parameters.
89 */ 72 */
@@ -99,68 +82,6 @@ int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
99 return 0; 82 return 0;
100} 83}
101 84
102int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
103 struct vm_area_struct *vma)
104{
105 pte_t *src_pte, *dst_pte, entry;
106 struct page *ptepage;
107 unsigned long addr = vma->vm_start;
108 unsigned long end = vma->vm_end;
109
110 while (addr < end) {
111 dst_pte = huge_pte_alloc(dst, addr);
112 if (!dst_pte)
113 goto nomem;
114 src_pte = huge_pte_offset(src, addr);
115 entry = *src_pte;
116 ptepage = pte_page(entry);
117 get_page(ptepage);
118 set_pte(dst_pte, entry);
119 add_mm_counter(dst, rss, HPAGE_SIZE / PAGE_SIZE);
120 addr += HPAGE_SIZE;
121 }
122 return 0;
123nomem:
124 return -ENOMEM;
125}
126
127int
128follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
129 struct page **pages, struct vm_area_struct **vmas,
130 unsigned long *st, int *length, int i)
131{
132 pte_t *ptep, pte;
133 unsigned long start = *st;
134 unsigned long pstart;
135 int len = *length;
136 struct page *page;
137
138 do {
139 pstart = start & HPAGE_MASK;
140 ptep = huge_pte_offset(mm, start);
141 pte = *ptep;
142
143back1:
144 page = pte_page(pte);
145 if (pages) {
146 page += ((start & ~HPAGE_MASK) >> PAGE_SHIFT);
147 get_page(page);
148 pages[i] = page;
149 }
150 if (vmas)
151 vmas[i] = vma;
152 i++;
153 len--;
154 start += PAGE_SIZE;
155 if (((start & HPAGE_MASK) == pstart) && len &&
156 (start < vma->vm_end))
157 goto back1;
158 } while (len && start < vma->vm_end);
159 *length = len;
160 *st = start;
161 return i;
162}
163
164struct page *follow_huge_addr(struct mm_struct *mm, unsigned long addr, int write) 85struct page *follow_huge_addr(struct mm_struct *mm, unsigned long addr, int write)
165{ 86{
166 struct page *page; 87 struct page *page;
@@ -212,81 +133,6 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb,
212 free_pgd_range(tlb, addr, end, floor, ceiling); 133 free_pgd_range(tlb, addr, end, floor, ceiling);
213} 134}
214 135
215void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
216{
217 struct mm_struct *mm = vma->vm_mm;
218 unsigned long address;
219 pte_t *pte;
220 struct page *page;
221
222 BUG_ON(start & (HPAGE_SIZE - 1));
223 BUG_ON(end & (HPAGE_SIZE - 1));
224
225 for (address = start; address < end; address += HPAGE_SIZE) {
226 pte = huge_pte_offset(mm, address);
227 if (pte_none(*pte))
228 continue;
229 page = pte_page(*pte);
230 put_page(page);
231 pte_clear(mm, address, pte);
232 }
233 add_mm_counter(mm, rss, - ((end - start) >> PAGE_SHIFT));
234 flush_tlb_range(vma, start, end);
235}
236
237int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
238{
239 struct mm_struct *mm = current->mm;
240 unsigned long addr;
241 int ret = 0;
242
243 BUG_ON(vma->vm_start & ~HPAGE_MASK);
244 BUG_ON(vma->vm_end & ~HPAGE_MASK);
245
246 spin_lock(&mm->page_table_lock);
247 for (addr = vma->vm_start; addr < vma->vm_end; addr += HPAGE_SIZE) {
248 unsigned long idx;
249 pte_t *pte = huge_pte_alloc(mm, addr);
250 struct page *page;
251
252 if (!pte) {
253 ret = -ENOMEM;
254 goto out;
255 }
256 if (!pte_none(*pte))
257 continue;
258
259 idx = ((addr - vma->vm_start) >> HPAGE_SHIFT)
260 + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
261 page = find_get_page(mapping, idx);
262 if (!page) {
263 /* charge the fs quota first */
264 if (hugetlb_get_quota(mapping)) {
265 ret = -ENOMEM;
266 goto out;
267 }
268 page = alloc_huge_page();
269 if (!page) {
270 hugetlb_put_quota(mapping);
271 ret = -ENOMEM;
272 goto out;
273 }
274 ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
275 if (! ret) {
276 unlock_page(page);
277 } else {
278 hugetlb_put_quota(mapping);
279 page_cache_release(page);
280 goto out;
281 }
282 }
283 set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE);
284 }
285out:
286 spin_unlock(&mm->page_table_lock);
287 return ret;
288}
289
290unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, 136unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
291 unsigned long pgoff, unsigned long flags) 137 unsigned long pgoff, unsigned long flags)
292{ 138{
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 547785e3cba2..4eb2f52b87a1 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -305,8 +305,9 @@ setup_gate (void)
305 struct page *page; 305 struct page *page;
306 306
307 /* 307 /*
308 * Map the gate page twice: once read-only to export the ELF headers etc. and once 308 * Map the gate page twice: once read-only to export the ELF
309 * execute-only page to enable privilege-promotion via "epc": 309 * headers etc. and once execute-only page to enable
310 * privilege-promotion via "epc":
310 */ 311 */
311 page = virt_to_page(ia64_imva(__start_gate_section)); 312 page = virt_to_page(ia64_imva(__start_gate_section));
312 put_kernel_page(page, GATE_ADDR, PAGE_READONLY); 313 put_kernel_page(page, GATE_ADDR, PAGE_READONLY);
@@ -315,6 +316,20 @@ setup_gate (void)
315 put_kernel_page(page, GATE_ADDR + PAGE_SIZE, PAGE_GATE); 316 put_kernel_page(page, GATE_ADDR + PAGE_SIZE, PAGE_GATE);
316#else 317#else
317 put_kernel_page(page, GATE_ADDR + PERCPU_PAGE_SIZE, PAGE_GATE); 318 put_kernel_page(page, GATE_ADDR + PERCPU_PAGE_SIZE, PAGE_GATE);
319 /* Fill in the holes (if any) with read-only zero pages: */
320 {
321 unsigned long addr;
322
323 for (addr = GATE_ADDR + PAGE_SIZE;
324 addr < GATE_ADDR + PERCPU_PAGE_SIZE;
325 addr += PAGE_SIZE)
326 {
327 put_kernel_page(ZERO_PAGE(0), addr,
328 PAGE_READONLY);
329 put_kernel_page(ZERO_PAGE(0), addr + PERCPU_PAGE_SIZE,
330 PAGE_READONLY);
331 }
332 }
318#endif 333#endif
319 ia64_patch_gate(); 334 ia64_patch_gate();
320} 335}
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 4fb44984afe6..44bfc7f318cb 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -222,7 +222,7 @@ void __init early_sn_setup(void)
222 222
223extern int platform_intr_list[]; 223extern int platform_intr_list[];
224extern nasid_t master_nasid; 224extern nasid_t master_nasid;
225static int shub_1_1_found __initdata; 225static int __initdata shub_1_1_found = 0;
226 226
227/* 227/*
228 * sn_check_for_wars 228 * sn_check_for_wars
@@ -251,7 +251,7 @@ static void __init sn_check_for_wars(void)
251 } else { 251 } else {
252 for_each_online_node(cnode) { 252 for_each_online_node(cnode) {
253 if (is_shub_1_1(cnodeid_to_nasid(cnode))) 253 if (is_shub_1_1(cnodeid_to_nasid(cnode)))
254 sn_hub_info->shub_1_1_found = 1; 254 shub_1_1_found = 1;
255 } 255 }
256 } 256 }
257} 257}
@@ -271,6 +271,8 @@ void __init sn_setup(char **cmdline_p)
271 int major = sn_sal_rev_major(), minor = sn_sal_rev_minor(); 271 int major = sn_sal_rev_major(), minor = sn_sal_rev_minor();
272 extern void sn_cpu_init(void); 272 extern void sn_cpu_init(void);
273 273
274 ia64_sn_plat_set_error_handling_features();
275
274 /* 276 /*
275 * If the generic code has enabled vga console support - lets 277 * If the generic code has enabled vga console support - lets
276 * get rid of it again. This is a kludge for the fact that ACPI 278 * get rid of it again. This is a kludge for the fact that ACPI
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index ab9b5f35c2a7..a087b274847e 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -432,7 +432,7 @@ static int tiocx_reload(struct cx_dev *cx_dev)
432 return cx_device_reload(cx_dev); 432 return cx_device_reload(cx_dev);
433} 433}
434 434
435static ssize_t show_cxdev_control(struct device *dev, char *buf) 435static ssize_t show_cxdev_control(struct device *dev, struct device_attribute *attr, char *buf)
436{ 436{
437 struct cx_dev *cx_dev = to_cx_dev(dev); 437 struct cx_dev *cx_dev = to_cx_dev(dev);
438 438
@@ -442,7 +442,7 @@ static ssize_t show_cxdev_control(struct device *dev, char *buf)
442 tiocx_btchar_get(cx_dev->cx_id.nasid)); 442 tiocx_btchar_get(cx_dev->cx_id.nasid));
443} 443}
444 444
445static ssize_t store_cxdev_control(struct device *dev, const char *buf, 445static ssize_t store_cxdev_control(struct device *dev, struct device_attribute *attr, const char *buf,
446 size_t count) 446 size_t count)
447{ 447{
448 int n; 448 int n;
@@ -518,25 +518,22 @@ static int __init tiocx_init(void)
518 return 0; 518 return 0;
519} 519}
520 520
521static void __exit tiocx_exit(void) 521static int cx_remove_device(struct device * dev, void * data)
522{ 522{
523 struct device *dev; 523 struct cx_dev *cx_dev = to_cx_dev(dev);
524 struct device *tdev; 524 device_remove_file(dev, &dev_attr_cxdev_control);
525 cx_device_unregister(cx_dev);
526 return 0;
527}
525 528
529static void __exit tiocx_exit(void)
530{
526 DBG("tiocx_exit\n"); 531 DBG("tiocx_exit\n");
527 532
528 /* 533 /*
529 * Unregister devices. 534 * Unregister devices.
530 */ 535 */
531 list_for_each_entry_safe(dev, tdev, &tiocx_bus_type.devices.list, 536 bus_for_each_dev(&tiocx_bus_type, NULL, NULL, cx_remove_device);
532 bus_list) {
533 if (dev) {
534 struct cx_dev *cx_dev = to_cx_dev(dev);
535 device_remove_file(dev, &dev_attr_cxdev_control);
536 cx_device_unregister(cx_dev);
537 }
538 }
539
540 bus_unregister(&tiocx_bus_type); 537 bus_unregister(&tiocx_bus_type);
541} 538}
542 539
diff --git a/arch/ia64/sn/kernel/xpc_partition.c b/arch/ia64/sn/kernel/xpc_partition.c
index 2c3c4a8af553..cd7ed73f0e7a 100644
--- a/arch/ia64/sn/kernel/xpc_partition.c
+++ b/arch/ia64/sn/kernel/xpc_partition.c
@@ -22,6 +22,7 @@
22#include <linux/cache.h> 22#include <linux/cache.h>
23#include <linux/mmzone.h> 23#include <linux/mmzone.h>
24#include <linux/nodemask.h> 24#include <linux/nodemask.h>
25#include <asm/uncached.h>
25#include <asm/sn/bte.h> 26#include <asm/sn/bte.h>
26#include <asm/sn/intr.h> 27#include <asm/sn/intr.h>
27#include <asm/sn/sn_sal.h> 28#include <asm/sn/sn_sal.h>
@@ -183,7 +184,7 @@ xpc_rsvd_page_init(void)
183 * memory protections are never restricted. 184 * memory protections are never restricted.
184 */ 185 */
185 if ((amos_page = xpc_vars->amos_page) == NULL) { 186 if ((amos_page = xpc_vars->amos_page) == NULL) {
186 amos_page = (AMO_t *) mspec_kalloc_page(0); 187 amos_page = (AMO_t *) TO_AMO(uncached_alloc_page(0));
187 if (amos_page == NULL) { 188 if (amos_page == NULL) {
188 dev_err(xpc_part, "can't allocate page of AMOs\n"); 189 dev_err(xpc_part, "can't allocate page of AMOs\n");
189 return NULL; 190 return NULL;
@@ -200,7 +201,8 @@ xpc_rsvd_page_init(void)
200 if (ret != 0) { 201 if (ret != 0) {
201 dev_err(xpc_part, "can't change memory " 202 dev_err(xpc_part, "can't change memory "
202 "protections\n"); 203 "protections\n");
203 mspec_kfree_page((unsigned long) amos_page); 204 uncached_free_page(__IA64_UNCACHED_OFFSET |
205 TO_PHYS((u64) amos_page));
204 return NULL; 206 return NULL;
205 } 207 }
206 } 208 }
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index 0d90ea58a0cb..64c133344afe 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -78,6 +78,9 @@ config PLAT_OAKS32R
78config PLAT_MAPPI2 78config PLAT_MAPPI2
79 bool "Mappi-II(M3A-ZA36/M3A-ZA52)" 79 bool "Mappi-II(M3A-ZA36/M3A-ZA52)"
80 80
81config PLAT_MAPPI3
82 bool "Mappi-III(M3A-2170)"
83
81endchoice 84endchoice
82 85
83choice 86choice
@@ -134,6 +137,7 @@ config BUS_CLOCK
134 int "Bus Clock [Hz] (integer)" 137 int "Bus Clock [Hz] (integer)"
135 default "70000000" if PLAT_MAPPI 138 default "70000000" if PLAT_MAPPI
136 default "25000000" if PLAT_USRV 139 default "25000000" if PLAT_USRV
140 default "50000000" if PLAT_MAPPI3
137 default "50000000" if PLAT_M32700UT 141 default "50000000" if PLAT_M32700UT
138 default "50000000" if PLAT_OPSPUT 142 default "50000000" if PLAT_OPSPUT
139 default "33333333" if PLAT_OAKS32R 143 default "33333333" if PLAT_OAKS32R
@@ -149,7 +153,7 @@ config CPU_LITTLE_ENDIAN
149 153
150config MEMORY_START 154config MEMORY_START
151 hex "Physical memory start address (hex)" 155 hex "Physical memory start address (hex)"
152 default "08000000" if PLAT_MAPPI || PLAT_MAPPI2 156 default "08000000" if PLAT_MAPPI || PLAT_MAPPI2 || PLAT_MAPPI3
153 default "08000000" if PLAT_USRV 157 default "08000000" if PLAT_USRV
154 default "08000000" if PLAT_M32700UT 158 default "08000000" if PLAT_M32700UT
155 default "08000000" if PLAT_OPSPUT 159 default "08000000" if PLAT_OPSPUT
@@ -157,6 +161,7 @@ config MEMORY_START
157 161
158config MEMORY_SIZE 162config MEMORY_SIZE
159 hex "Physical memory size (hex)" 163 hex "Physical memory size (hex)"
164 default "08000000" if PLAT_MAPPI3
160 default "04000000" if PLAT_MAPPI || PLAT_MAPPI2 165 default "04000000" if PLAT_MAPPI || PLAT_MAPPI2
161 default "02000000" if PLAT_USRV 166 default "02000000" if PLAT_USRV
162 default "01000000" if PLAT_M32700UT 167 default "01000000" if PLAT_M32700UT
diff --git a/arch/m32r/boot/compressed/m32r_sio.c b/arch/m32r/boot/compressed/m32r_sio.c
index bad5475eff90..8f9a57271f83 100644
--- a/arch/m32r/boot/compressed/m32r_sio.c
+++ b/arch/m32r/boot/compressed/m32r_sio.c
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <linux/config.h> 8#include <linux/config.h>
9#include <asm/processor.h>
9 10
10static void putc(char c); 11static void putc(char c);
11 12
@@ -38,16 +39,17 @@ static int puts(const char *s)
38 39
39static void putc(char c) 40static void putc(char c)
40{ 41{
41 42 while ((*BOOT_SIO0STS & 0x3) != 0x3)
42 while ((*BOOT_SIO0STS & 0x3) != 0x3) ; 43 cpu_relax();
43 if (c == '\n') { 44 if (c == '\n') {
44 *BOOT_SIO0TXB = '\r'; 45 *BOOT_SIO0TXB = '\r';
45 while ((*BOOT_SIO0STS & 0x3) != 0x3) ; 46 while ((*BOOT_SIO0STS & 0x3) != 0x3)
47 cpu_relax();
46 } 48 }
47 *BOOT_SIO0TXB = c; 49 *BOOT_SIO0TXB = c;
48} 50}
49#else /* defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_M32700UT) */ 51#else /* !(CONFIG_PLAT_M32700UT_Alpha) && !(CONFIG_PLAT_M32700UT) */
50#ifdef CONFIG_MMU 52#if defined(CONFIG_PLAT_MAPPI2)
51#define SIO0STS (volatile unsigned short *)(0xa0efd000 + 14) 53#define SIO0STS (volatile unsigned short *)(0xa0efd000 + 14)
52#define SIO0TXB (volatile unsigned short *)(0xa0efd000 + 30) 54#define SIO0TXB (volatile unsigned short *)(0xa0efd000 + 30)
53#else 55#else
@@ -57,11 +59,12 @@ static void putc(char c)
57 59
58static void putc(char c) 60static void putc(char c)
59{ 61{
60 62 while ((*SIO0STS & 0x1) == 0)
61 while ((*SIO0STS & 0x1) == 0) ; 63 cpu_relax();
62 if (c == '\n') { 64 if (c == '\n') {
63 *SIO0TXB = '\r'; 65 *SIO0TXB = '\r';
64 while ((*SIO0STS & 0x1) == 0) ; 66 while ((*SIO0STS & 0x1) == 0)
67 cpu_relax();
65 } 68 }
66 *SIO0TXB = c; 69 *SIO0TXB = c;
67} 70}
diff --git a/arch/m32r/defconfig b/arch/m32r/defconfig
index 417c95ba87e9..853093093168 100644
--- a/arch/m32r/defconfig
+++ b/arch/m32r/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc4 3# Linux kernel version: 2.6.12-rc5
4# Wed Feb 16 21:10:44 2005 4# Fri Jun 3 16:20:11 2005
5# 5#
6CONFIG_M32R=y 6CONFIG_M32R=y
7# CONFIG_UID16 is not set 7# CONFIG_UID16 is not set
@@ -16,6 +16,7 @@ CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y 16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
18CONFIG_LOCK_KERNEL=y 18CONFIG_LOCK_KERNEL=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
19 20
20# 21#
21# General setup 22# General setup
@@ -28,13 +29,15 @@ CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set 29# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
31CONFIG_LOG_BUF_SHIFT=14
32CONFIG_HOTPLUG=y 32CONFIG_HOTPLUG=y
33CONFIG_KOBJECT_UEVENT=y 33CONFIG_KOBJECT_UEVENT=y
34CONFIG_IKCONFIG=y 34CONFIG_IKCONFIG=y
35# CONFIG_IKCONFIG_PROC is not set 35# CONFIG_IKCONFIG_PROC is not set
36CONFIG_EMBEDDED=y 36CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set 37# CONFIG_KALLSYMS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
40CONFIG_BASE_FULL=y
38# CONFIG_FUTEX is not set 41# CONFIG_FUTEX is not set
39# CONFIG_EPOLL is not set 42# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 43# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -44,6 +47,7 @@ CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0 47CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0 48CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 49# CONFIG_TINY_SHMEM is not set
50CONFIG_BASE_SMALL=0
47 51
48# 52#
49# Loadable module support 53# Loadable module support
@@ -65,6 +69,7 @@ CONFIG_PLAT_M32700UT=y
65# CONFIG_PLAT_OPSPUT is not set 69# CONFIG_PLAT_OPSPUT is not set
66# CONFIG_PLAT_OAKS32R is not set 70# CONFIG_PLAT_OAKS32R is not set
67# CONFIG_PLAT_MAPPI2 is not set 71# CONFIG_PLAT_MAPPI2 is not set
72# CONFIG_PLAT_MAPPI3 is not set
68CONFIG_CHIP_M32700=y 73CONFIG_CHIP_M32700=y
69# CONFIG_CHIP_M32102 is not set 74# CONFIG_CHIP_M32102 is not set
70# CONFIG_CHIP_VDEC2 is not set 75# CONFIG_CHIP_VDEC2 is not set
@@ -268,7 +273,6 @@ CONFIG_NET=y
268# 273#
269CONFIG_PACKET=y 274CONFIG_PACKET=y
270# CONFIG_PACKET_MMAP is not set 275# CONFIG_PACKET_MMAP is not set
271# CONFIG_NETLINK_DEV is not set
272CONFIG_UNIX=y 276CONFIG_UNIX=y
273# CONFIG_NET_KEY is not set 277# CONFIG_NET_KEY is not set
274CONFIG_INET=y 278CONFIG_INET=y
@@ -393,18 +397,6 @@ CONFIG_INPUT=y
393# CONFIG_INPUT_EVBUG is not set 397# CONFIG_INPUT_EVBUG is not set
394 398
395# 399#
396# Input I/O drivers
397#
398# CONFIG_GAMEPORT is not set
399CONFIG_SOUND_GAMEPORT=y
400CONFIG_SERIO=y
401# CONFIG_SERIO_I8042 is not set
402CONFIG_SERIO_SERPORT=y
403# CONFIG_SERIO_CT82C710 is not set
404# CONFIG_SERIO_LIBPS2 is not set
405# CONFIG_SERIO_RAW is not set
406
407#
408# Input Device Drivers 400# Input Device Drivers
409# 401#
410# CONFIG_INPUT_KEYBOARD is not set 402# CONFIG_INPUT_KEYBOARD is not set
@@ -414,6 +406,17 @@ CONFIG_SERIO_SERPORT=y
414# CONFIG_INPUT_MISC is not set 406# CONFIG_INPUT_MISC is not set
415 407
416# 408#
409# Hardware I/O ports
410#
411CONFIG_SERIO=y
412# CONFIG_SERIO_I8042 is not set
413CONFIG_SERIO_SERPORT=y
414# CONFIG_SERIO_LIBPS2 is not set
415# CONFIG_SERIO_RAW is not set
416# CONFIG_GAMEPORT is not set
417CONFIG_SOUND_GAMEPORT=y
418
419#
417# Character devices 420# Character devices
418# 421#
419CONFIG_VT=y 422CONFIG_VT=y
@@ -465,6 +468,10 @@ CONFIG_DS1302=y
465# CONFIG_RAW_DRIVER is not set 468# CONFIG_RAW_DRIVER is not set
466 469
467# 470#
471# TPM devices
472#
473
474#
468# I2C support 475# I2C support
469# 476#
470# CONFIG_I2C is not set 477# CONFIG_I2C is not set
@@ -508,8 +515,14 @@ CONFIG_VIDEO_M32R_AR_M64278=y
508# Graphics support 515# Graphics support
509# 516#
510CONFIG_FB=y 517CONFIG_FB=y
518# CONFIG_FB_CFB_FILLRECT is not set
519# CONFIG_FB_CFB_COPYAREA is not set
520# CONFIG_FB_CFB_IMAGEBLIT is not set
521# CONFIG_FB_SOFT_CURSOR is not set
522# CONFIG_FB_MACMODES is not set
511# CONFIG_FB_MODE_HELPERS is not set 523# CONFIG_FB_MODE_HELPERS is not set
512# CONFIG_FB_TILEBLITTING is not set 524# CONFIG_FB_TILEBLITTING is not set
525# CONFIG_FB_S1D13XXX is not set
513# CONFIG_FB_VIRTUAL is not set 526# CONFIG_FB_VIRTUAL is not set
514 527
515# 528#
@@ -543,10 +556,6 @@ CONFIG_LOGO_LINUX_CLUT224=y
543# CONFIG_USB_ARCH_HAS_OHCI is not set 556# CONFIG_USB_ARCH_HAS_OHCI is not set
544 557
545# 558#
546# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
547#
548
549#
550# USB Gadget Support 559# USB Gadget Support
551# 560#
552# CONFIG_USB_GADGET is not set 561# CONFIG_USB_GADGET is not set
@@ -719,8 +728,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
719# 728#
720# Kernel hacking 729# Kernel hacking
721# 730#
731# CONFIG_PRINTK_TIME is not set
722# CONFIG_DEBUG_KERNEL is not set 732# CONFIG_DEBUG_KERNEL is not set
723CONFIG_DEBUG_PREEMPT=y 733CONFIG_LOG_BUF_SHIFT=14
724# CONFIG_DEBUG_BUGVERBOSE is not set 734# CONFIG_DEBUG_BUGVERBOSE is not set
725# CONFIG_FRAME_POINTER is not set 735# CONFIG_FRAME_POINTER is not set
726 736
diff --git a/arch/m32r/kernel/Makefile b/arch/m32r/kernel/Makefile
index cfd690bf6d8a..6c6b6c376638 100644
--- a/arch/m32r/kernel/Makefile
+++ b/arch/m32r/kernel/Makefile
@@ -10,6 +10,7 @@ obj-y := process.o entry.o traps.o align.o irq.o setup.o time.o \
10obj-$(CONFIG_SMP) += smp.o smpboot.o 10obj-$(CONFIG_SMP) += smp.o smpboot.o
11obj-$(CONFIG_PLAT_MAPPI) += setup_mappi.o io_mappi.o 11obj-$(CONFIG_PLAT_MAPPI) += setup_mappi.o io_mappi.o
12obj-$(CONFIG_PLAT_MAPPI2) += setup_mappi2.o io_mappi2.o 12obj-$(CONFIG_PLAT_MAPPI2) += setup_mappi2.o io_mappi2.o
13obj-$(CONFIG_PLAT_MAPPI3) += setup_mappi3.o io_mappi3.o
13obj-$(CONFIG_PLAT_USRV) += setup_usrv.o io_usrv.o 14obj-$(CONFIG_PLAT_USRV) += setup_usrv.o io_usrv.o
14obj-$(CONFIG_PLAT_M32700UT) += setup_m32700ut.o io_m32700ut.o 15obj-$(CONFIG_PLAT_M32700UT) += setup_m32700ut.o io_m32700ut.o
15obj-$(CONFIG_PLAT_OPSPUT) += setup_opsput.o io_opsput.o 16obj-$(CONFIG_PLAT_OPSPUT) += setup_opsput.o io_opsput.o
@@ -17,4 +18,3 @@ obj-$(CONFIG_MODULES) += module.o
17obj-$(CONFIG_PLAT_OAKS32R) += setup_oaks32r.o io_oaks32r.o 18obj-$(CONFIG_PLAT_OAKS32R) += setup_oaks32r.o io_oaks32r.o
18 19
19EXTRA_AFLAGS := -traditional 20EXTRA_AFLAGS := -traditional
20
diff --git a/arch/m32r/kernel/io_m32700ut.c b/arch/m32r/kernel/io_m32700ut.c
index 371ba904e968..e545b065f7e9 100644
--- a/arch/m32r/kernel/io_m32700ut.c
+++ b/arch/m32r/kernel/io_m32700ut.c
@@ -3,8 +3,8 @@
3 * 3 *
4 * Typical I/O routines for M32700UT board. 4 * Typical I/O routines for M32700UT board.
5 * 5 *
6 * Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
7 * Hitoshi Yamamoto, Takeo Takahashi 7 * Hitoshi Yamamoto, Takeo Takahashi
8 * 8 *
9 * This file is subject to the terms and conditions of the GNU General 9 * This file is subject to the terms and conditions of the GNU General
10 * Public License. See the file "COPYING" in the main directory of this 10 * Public License. See the file "COPYING" in the main directory of this
@@ -172,64 +172,21 @@ unsigned long _inl(unsigned long port)
172 172
173unsigned char _inb_p(unsigned long port) 173unsigned char _inb_p(unsigned long port)
174{ 174{
175 unsigned char v; 175 unsigned char v = _inb(port);
176
177 if (port >= LAN_IOSTART && port < LAN_IOEND)
178 v = _ne_inb(PORT2ADDR_NE(port));
179 else
180#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
181 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
182 return *(volatile unsigned char *)__port2addr_ata(port);
183 } else
184#endif
185#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
186 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
187 unsigned char b;
188 pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0);
189 return b;
190 } else
191#endif
192 v = *(volatile unsigned char *)PORT2ADDR(port);
193
194 delay(); 176 delay();
195 return (v); 177 return (v);
196} 178}
197 179
198unsigned short _inw_p(unsigned long port) 180unsigned short _inw_p(unsigned long port)
199{ 181{
200 unsigned short v; 182 unsigned short v = _inw(port);
201
202 if (port >= LAN_IOSTART && port < LAN_IOEND)
203 v = _ne_inw(PORT2ADDR_NE(port));
204 else
205#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
206 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
207 return *(volatile unsigned short *)__port2addr_ata(port);
208 } else
209#endif
210#if defined(CONFIG_USB)
211 if(port >= 0x340 && port < 0x3a0)
212 return *(volatile unsigned short *)PORT2ADDR_USB(port);
213 else
214#endif
215#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
216 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
217 unsigned short w;
218 pcc_ioread_word(0, port, &w, sizeof(w), 1, 0);
219 return w;
220 } else
221#endif
222 v = *(volatile unsigned short *)PORT2ADDR(port);
223
224 delay(); 183 delay();
225 return (v); 184 return (v);
226} 185}
227 186
228unsigned long _inl_p(unsigned long port) 187unsigned long _inl_p(unsigned long port)
229{ 188{
230 unsigned long v; 189 unsigned long v = _inl(port);
231
232 v = *(volatile unsigned long *)PORT2ADDR(port);
233 delay(); 190 delay();
234 return (v); 191 return (v);
235} 192}
@@ -287,52 +244,19 @@ void _outl(unsigned long l, unsigned long port)
287 244
288void _outb_p(unsigned char b, unsigned long port) 245void _outb_p(unsigned char b, unsigned long port)
289{ 246{
290 if (port >= LAN_IOSTART && port < LAN_IOEND) 247 _outb(b, port);
291 _ne_outb(b, PORT2ADDR_NE(port));
292 else
293#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
294 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
295 *(volatile unsigned char *)__port2addr_ata(port) = b;
296 } else
297#endif
298#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
299 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
300 pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0);
301 } else
302#endif
303 *(volatile unsigned char *)PORT2ADDR(port) = b;
304
305 delay(); 248 delay();
306} 249}
307 250
308void _outw_p(unsigned short w, unsigned long port) 251void _outw_p(unsigned short w, unsigned long port)
309{ 252{
310 if (port >= LAN_IOSTART && port < LAN_IOEND) 253 _outw(w, port);
311 _ne_outw(w, PORT2ADDR_NE(port));
312 else
313#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
314 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
315 *(volatile unsigned short *)__port2addr_ata(port) = w;
316 } else
317#endif
318#if defined(CONFIG_USB)
319 if(port >= 0x340 && port < 0x3a0)
320 *(volatile unsigned short *)PORT2ADDR_USB(port) = w;
321 else
322#endif
323#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
324 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
325 pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
326 } else
327#endif
328 *(volatile unsigned short *)PORT2ADDR(port) = w;
329
330 delay(); 254 delay();
331} 255}
332 256
333void _outl_p(unsigned long l, unsigned long port) 257void _outl_p(unsigned long l, unsigned long port)
334{ 258{
335 *(volatile unsigned long *)PORT2ADDR(port) = l; 259 _outl(l, port);
336 delay(); 260 delay();
337} 261}
338 262
diff --git a/arch/m32r/kernel/io_mappi.c b/arch/m32r/kernel/io_mappi.c
index 85688ffb52f9..78033165fb5c 100644
--- a/arch/m32r/kernel/io_mappi.c
+++ b/arch/m32r/kernel/io_mappi.c
@@ -3,8 +3,8 @@
3 * 3 *
4 * Typical I/O routines for Mappi board. 4 * Typical I/O routines for Mappi board.
5 * 5 *
6 * Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
7 * Hitoshi Yamamoto 7 * Hitoshi Yamamoto
8 */ 8 */
9 9
10#include <linux/config.h> 10#include <linux/config.h>
@@ -130,57 +130,21 @@ unsigned long _inl(unsigned long port)
130 130
131unsigned char _inb_p(unsigned long port) 131unsigned char _inb_p(unsigned long port)
132{ 132{
133 unsigned char v; 133 unsigned char v = _inb(port);
134
135 if (port >= 0x300 && port < 0x320)
136 v = _ne_inb(PORT2ADDR_NE(port));
137 else
138#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
139 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
140 unsigned char b;
141 pcc_ioread(0, port, &b, sizeof(b), 1, 0);
142 return b;
143 } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
144 unsigned char b;
145 pcc_ioread(1, port, &b, sizeof(b), 1, 0);
146 return b;
147 } else
148#endif
149 v = *(volatile unsigned char *)PORT2ADDR(port);
150
151 delay(); 134 delay();
152 return (v); 135 return (v);
153} 136}
154 137
155unsigned short _inw_p(unsigned long port) 138unsigned short _inw_p(unsigned long port)
156{ 139{
157 unsigned short v; 140 unsigned short v = _inw(port);
158
159 if (port >= 0x300 && port < 0x320)
160 v = _ne_inw(PORT2ADDR_NE(port));
161 else
162#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
163 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
164 unsigned short w;
165 pcc_ioread(0, port, &w, sizeof(w), 1, 0);
166 return w;
167 } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
168 unsigned short w;
169 pcc_ioread(1, port, &w, sizeof(w), 1, 0);
170 return w;
171 } else
172#endif
173 v = *(volatile unsigned short *)PORT2ADDR(port);
174
175 delay(); 141 delay();
176 return (v); 142 return (v);
177} 143}
178 144
179unsigned long _inl_p(unsigned long port) 145unsigned long _inl_p(unsigned long port)
180{ 146{
181 unsigned long v; 147 unsigned long v = _inl(port);
182
183 v = *(volatile unsigned long *)PORT2ADDR(port);
184 delay(); 148 delay();
185 return (v); 149 return (v);
186} 150}
@@ -229,41 +193,19 @@ void _outl(unsigned long l, unsigned long port)
229 193
230void _outb_p(unsigned char b, unsigned long port) 194void _outb_p(unsigned char b, unsigned long port)
231{ 195{
232 if (port >= 0x300 && port < 0x320) 196 _outb(b, port);
233 _ne_outb(b, PORT2ADDR_NE(port));
234 else
235#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
236 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
237 pcc_iowrite(0, port, &b, sizeof(b), 1, 0);
238 } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
239 pcc_iowrite(1, port, &b, sizeof(b), 1, 0);
240 } else
241#endif
242 *(volatile unsigned char *)PORT2ADDR(port) = b;
243
244 delay(); 197 delay();
245} 198}
246 199
247void _outw_p(unsigned short w, unsigned long port) 200void _outw_p(unsigned short w, unsigned long port)
248{ 201{
249 if (port >= 0x300 && port < 0x320) 202 _outw(w, port);
250 _ne_outw(w, PORT2ADDR_NE(port));
251 else
252#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
253 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
254 pcc_iowrite(0, port, &w, sizeof(w), 1, 0);
255 } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
256 pcc_iowrite(1, port, &w, sizeof(w), 1, 0);
257 } else
258#endif
259 *(volatile unsigned short *)PORT2ADDR(port) = w;
260
261 delay(); 203 delay();
262} 204}
263 205
264void _outl_p(unsigned long l, unsigned long port) 206void _outl_p(unsigned long l, unsigned long port)
265{ 207{
266 *(volatile unsigned long *)PORT2ADDR(port) = l; 208 _outl(l, port);
267 delay(); 209 delay();
268} 210}
269 211
diff --git a/arch/m32r/kernel/io_mappi2.c b/arch/m32r/kernel/io_mappi2.c
index 4182cd4f97c8..5c03504bf653 100644
--- a/arch/m32r/kernel/io_mappi2.c
+++ b/arch/m32r/kernel/io_mappi2.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Typical I/O routines for Mappi2 board. 4 * Typical I/O routines for Mappi2 board.
5 * 5 *
6 * Copyright (c) 2001-2003 Hiroyuki Kondo, Hirokazu Takata, 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
7 * Hitoshi Yamamoto, Mamoru Sakugawa 7 * Hitoshi Yamamoto, Mamoru Sakugawa
8 */ 8 */
9 9
@@ -25,7 +25,7 @@ extern void pcc_ioread_byte(int, unsigned long, void *, size_t, size_t, int);
25extern void pcc_ioread_word(int, unsigned long, void *, size_t, size_t, int); 25extern void pcc_ioread_word(int, unsigned long, void *, size_t, size_t, int);
26extern void pcc_iowrite_byte(int, unsigned long, void *, size_t, size_t, int); 26extern void pcc_iowrite_byte(int, unsigned long, void *, size_t, size_t, int);
27extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); 27extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int);
28#endif /* CONFIG_PCMCIA && CONFIG_MAPPI2_CFC */ 28#endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */
29 29
30#define PORT2ADDR(port) _port2addr(port) 30#define PORT2ADDR(port) _port2addr(port)
31#define PORT2ADDR_NE(port) _port2addr_ne(port) 31#define PORT2ADDR_NE(port) _port2addr_ne(port)
@@ -169,64 +169,21 @@ unsigned long _inl(unsigned long port)
169 169
170unsigned char _inb_p(unsigned long port) 170unsigned char _inb_p(unsigned long port)
171{ 171{
172 unsigned char v; 172 unsigned char v = _inb(port);
173
174 if (port >= LAN_IOSTART && port < LAN_IOEND)
175 v = _ne_inb(PORT2ADDR_NE(port));
176 else
177#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
178 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
179 return *(volatile unsigned char *)__port2addr_ata(port);
180 } else
181#endif
182#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
183 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
184 unsigned char b;
185 pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0);
186 return b;
187 } else
188#endif
189 v = *(volatile unsigned char *)PORT2ADDR(port);
190
191 delay(); 173 delay();
192 return (v); 174 return (v);
193} 175}
194 176
195unsigned short _inw_p(unsigned long port) 177unsigned short _inw_p(unsigned long port)
196{ 178{
197 unsigned short v; 179 unsigned short v = _inw(port);
198
199 if (port >= LAN_IOSTART && port < LAN_IOEND)
200 v = _ne_inw(PORT2ADDR_NE(port));
201 else
202#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
203 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
204 return *(volatile unsigned short *)__port2addr_ata(port);
205 } else
206#endif
207#if defined(CONFIG_USB)
208 if (port >= 0x340 && port < 0x3a0)
209 v = *(volatile unsigned short *)PORT2ADDR_USB(port);
210 else
211#endif
212#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
213 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
214 unsigned short w;
215 pcc_ioread_word(0, port, &w, sizeof(w), 1, 0);
216 return w;
217 } else
218#endif
219 v = *(volatile unsigned short *)PORT2ADDR(port);
220
221 delay(); 180 delay();
222 return (v); 181 return (v);
223} 182}
224 183
225unsigned long _inl_p(unsigned long port) 184unsigned long _inl_p(unsigned long port)
226{ 185{
227 unsigned long v; 186 unsigned long v = _inl(port);
228
229 v = *(volatile unsigned long *)PORT2ADDR(port);
230 delay(); 187 delay();
231 return (v); 188 return (v);
232} 189}
@@ -284,52 +241,19 @@ void _outl(unsigned long l, unsigned long port)
284 241
285void _outb_p(unsigned char b, unsigned long port) 242void _outb_p(unsigned char b, unsigned long port)
286{ 243{
287 if (port >= LAN_IOSTART && port < LAN_IOEND) 244 _outb(b, port);
288 _ne_outb(b, PORT2ADDR_NE(port));
289 else
290#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
291 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
292 *(volatile unsigned char *)__port2addr_ata(port) = b;
293 } else
294#endif
295#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
296 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
297 pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0);
298 } else
299#endif
300 *(volatile unsigned char *)PORT2ADDR(port) = b;
301
302 delay(); 245 delay();
303} 246}
304 247
305void _outw_p(unsigned short w, unsigned long port) 248void _outw_p(unsigned short w, unsigned long port)
306{ 249{
307 if (port >= LAN_IOSTART && port < LAN_IOEND) 250 _outw(w, port);
308 _ne_outw(w, PORT2ADDR_NE(port));
309 else
310#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
311 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
312 *(volatile unsigned short *)__port2addr_ata(port) = w;
313 } else
314#endif
315#if defined(CONFIG_USB)
316 if (port >= 0x340 && port < 0x3a0)
317 *(volatile unsigned short *)PORT2ADDR_USB(port) = w;
318 else
319#endif
320#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
321 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
322 pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
323 } else
324#endif
325 *(volatile unsigned short *)PORT2ADDR(port) = w;
326
327 delay(); 251 delay();
328} 252}
329 253
330void _outl_p(unsigned long l, unsigned long port) 254void _outl_p(unsigned long l, unsigned long port)
331{ 255{
332 *(volatile unsigned long *)PORT2ADDR(port) = l; 256 _outl(l, port);
333 delay(); 257 delay();
334} 258}
335 259
diff --git a/arch/m32r/kernel/io_mappi3.c b/arch/m32r/kernel/io_mappi3.c
new file mode 100644
index 000000000000..c80bde657854
--- /dev/null
+++ b/arch/m32r/kernel/io_mappi3.c
@@ -0,0 +1,378 @@
1/*
2 * linux/arch/m32r/kernel/io_mappi3.c
3 *
4 * Typical I/O routines for Mappi3 board.
5 *
6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
7 * Hitoshi Yamamoto, Mamoru Sakugawa
8 */
9
10#include <linux/config.h>
11#include <asm/m32r.h>
12#include <asm/page.h>
13#include <asm/io.h>
14#include <asm/byteorder.h>
15
16#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
17#include <linux/types.h>
18
19#define M32R_PCC_IOMAP_SIZE 0x1000
20
21#define M32R_PCC_IOSTART0 0x1000
22#define M32R_PCC_IOEND0 (M32R_PCC_IOSTART0 + M32R_PCC_IOMAP_SIZE - 1)
23
24extern void pcc_ioread_byte(int, unsigned long, void *, size_t, size_t, int);
25extern void pcc_ioread_word(int, unsigned long, void *, size_t, size_t, int);
26extern void pcc_iowrite_byte(int, unsigned long, void *, size_t, size_t, int);
27extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int);
28#endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */
29
30#define PORT2ADDR(port) _port2addr(port)
31#define PORT2ADDR_NE(port) _port2addr_ne(port)
32#define PORT2ADDR_USB(port) _port2addr_usb(port)
33
34static inline void *_port2addr(unsigned long port)
35{
36 return (void *)(port + NONCACHE_OFFSET);
37}
38
39#define LAN_IOSTART 0x300
40#define LAN_IOEND 0x320
41
42#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
43static inline void *__port2addr_ata(unsigned long port)
44{
45 static int dummy_reg;
46
47 switch (port) {
48 case 0x1f0: return (void *)0xb4002000;
49 case 0x1f1: return (void *)0xb4012800;
50 case 0x1f2: return (void *)0xb4012002;
51 case 0x1f3: return (void *)0xb4012802;
52 case 0x1f4: return (void *)0xb4012004;
53 case 0x1f5: return (void *)0xb4012804;
54 case 0x1f6: return (void *)0xb4012006;
55 case 0x1f7: return (void *)0xb4012806;
56 case 0x3f6: return (void *)0xb401200e;
57 default: return (void *)&dummy_reg;
58 }
59}
60#endif
61
62static inline void *_port2addr_ne(unsigned long port)
63{
64 return (void *)(port + NONCACHE_OFFSET + 0x10000000);
65}
66
67static inline void *_port2addr_usb(unsigned long port)
68{
69 return (void *)(port + NONCACHE_OFFSET + 0x12000000);
70}
71static inline void delay(void)
72{
73 __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory");
74}
75
76/*
77 * NIC I/O function
78 */
79
80static inline unsigned char _ne_inb(void *portp)
81{
82 return (unsigned char) *(volatile unsigned char *)portp;
83}
84
85static inline unsigned short _ne_inw(void *portp)
86{
87 return (unsigned short)le16_to_cpu(*(volatile unsigned short *)portp);
88}
89
90static inline void _ne_insb(void *portp, void * addr, unsigned long count)
91{
92 unsigned char *buf = addr;
93
94 while (count--)
95 *buf++ = *(volatile unsigned char *)portp;
96}
97
98static inline void _ne_outb(unsigned char b, void *portp)
99{
100 *(volatile unsigned char *)portp = (unsigned char)b;
101}
102
103static inline void _ne_outw(unsigned short w, void *portp)
104{
105 *(volatile unsigned short *)portp = cpu_to_le16(w);
106}
107
108unsigned char _inb(unsigned long port)
109{
110 if (port >= LAN_IOSTART && port < LAN_IOEND)
111 return _ne_inb(PORT2ADDR_NE(port));
112#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
113 else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
114 return *(volatile unsigned char *)__port2addr_ata(port);
115 }
116#endif
117#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
118 else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
119 unsigned char b;
120 pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0);
121 return b;
122 } else
123#endif
124 return *(volatile unsigned char *)PORT2ADDR(port);
125}
126
127unsigned short _inw(unsigned long port)
128{
129 if (port >= LAN_IOSTART && port < LAN_IOEND)
130 return _ne_inw(PORT2ADDR_NE(port));
131#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
132 else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
133 return *(volatile unsigned short *)__port2addr_ata(port);
134 }
135#endif
136#if defined(CONFIG_USB)
137 else if (port >= 0x340 && port < 0x3a0)
138 return *(volatile unsigned short *)PORT2ADDR_USB(port);
139#endif
140
141#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
142 else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
143 unsigned short w;
144 pcc_ioread_word(0, port, &w, sizeof(w), 1, 0);
145 return w;
146 } else
147#endif
148 return *(volatile unsigned short *)PORT2ADDR(port);
149}
150
151unsigned long _inl(unsigned long port)
152{
153#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
154 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
155 unsigned long l;
156 pcc_ioread_word(0, port, &l, sizeof(l), 1, 0);
157 return l;
158 } else
159#endif
160 return *(volatile unsigned long *)PORT2ADDR(port);
161}
162
163unsigned char _inb_p(unsigned long port)
164{
165 unsigned char v = _inb(port);
166 delay();
167 return (v);
168}
169
170unsigned short _inw_p(unsigned long port)
171{
172 unsigned short v = _inw(port);
173 delay();
174 return (v);
175}
176
177unsigned long _inl_p(unsigned long port)
178{
179 unsigned long v = _inl(port);
180 delay();
181 return (v);
182}
183
184void _outb(unsigned char b, unsigned long port)
185{
186 if (port >= LAN_IOSTART && port < LAN_IOEND)
187 _ne_outb(b, PORT2ADDR_NE(port));
188 else
189#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
190 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
191 *(volatile unsigned char *)__port2addr_ata(port) = b;
192 } else
193#endif
194#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
195 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
196 pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0);
197 } else
198#endif
199 *(volatile unsigned char *)PORT2ADDR(port) = b;
200}
201
202void _outw(unsigned short w, unsigned long port)
203{
204 if (port >= LAN_IOSTART && port < LAN_IOEND)
205 _ne_outw(w, PORT2ADDR_NE(port));
206 else
207#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
208 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
209 *(volatile unsigned short *)__port2addr_ata(port) = w;
210 } else
211#endif
212#if defined(CONFIG_USB)
213 if (port >= 0x340 && port < 0x3a0)
214 *(volatile unsigned short *)PORT2ADDR_USB(port) = w;
215 else
216#endif
217#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
218 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
219 pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
220 } else
221#endif
222 *(volatile unsigned short *)PORT2ADDR(port) = w;
223}
224
225void _outl(unsigned long l, unsigned long port)
226{
227#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
228 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
229 pcc_iowrite_word(0, port, &l, sizeof(l), 1, 0);
230 } else
231#endif
232 *(volatile unsigned long *)PORT2ADDR(port) = l;
233}
234
235void _outb_p(unsigned char b, unsigned long port)
236{
237 _outb(b, port);
238 delay();
239}
240
241void _outw_p(unsigned short w, unsigned long port)
242{
243 _outw(w, port);
244 delay();
245}
246
247void _outl_p(unsigned long l, unsigned long port)
248{
249 _outl(l, port);
250 delay();
251}
252
253void _insb(unsigned int port, void * addr, unsigned long count)
254{
255 if (port >= LAN_IOSTART && port < LAN_IOEND)
256 _ne_insb(PORT2ADDR_NE(port), addr, count);
257#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
258 else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
259 unsigned char *buf = addr;
260 unsigned char *portp = __port2addr_ata(port);
261 while (count--)
262 *buf++ = *(volatile unsigned char *)portp;
263 }
264#endif
265#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
266 else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
267 pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char),
268 count, 1);
269 }
270#endif
271 else {
272 unsigned char *buf = addr;
273 unsigned char *portp = PORT2ADDR(port);
274 while (count--)
275 *buf++ = *(volatile unsigned char *)portp;
276 }
277}
278
279void _insw(unsigned int port, void * addr, unsigned long count)
280{
281 unsigned short *buf = addr;
282 unsigned short *portp;
283
284 if (port >= LAN_IOSTART && port < LAN_IOEND) {
285 portp = PORT2ADDR_NE(port);
286 while (count--)
287 *buf++ = *(volatile unsigned short *)portp;
288#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
289 } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
290 pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short),
291 count, 1);
292#endif
293#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
294 } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
295 portp = __port2addr_ata(port);
296 while (count--)
297 *buf++ = *(volatile unsigned short *)portp;
298#endif
299 } else {
300 portp = PORT2ADDR(port);
301 while (count--)
302 *buf++ = *(volatile unsigned short *)portp;
303 }
304}
305
306void _insl(unsigned int port, void * addr, unsigned long count)
307{
308 unsigned long *buf = addr;
309 unsigned long *portp;
310
311 portp = PORT2ADDR(port);
312 while (count--)
313 *buf++ = *(volatile unsigned long *)portp;
314}
315
316void _outsb(unsigned int port, const void * addr, unsigned long count)
317{
318 const unsigned char *buf = addr;
319 unsigned char *portp;
320
321 if (port >= LAN_IOSTART && port < LAN_IOEND) {
322 portp = PORT2ADDR_NE(port);
323 while (count--)
324 _ne_outb(*buf++, portp);
325#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
326 } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
327 portp = __port2addr_ata(port);
328 while (count--)
329 *(volatile unsigned char *)portp = *buf++;
330#endif
331#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
332 } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
333 pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char),
334 count, 1);
335#endif
336 } else {
337 portp = PORT2ADDR(port);
338 while (count--)
339 *(volatile unsigned char *)portp = *buf++;
340 }
341}
342
343void _outsw(unsigned int port, const void * addr, unsigned long count)
344{
345 const unsigned short *buf = addr;
346 unsigned short *portp;
347
348 if (port >= LAN_IOSTART && port < LAN_IOEND) {
349 portp = PORT2ADDR_NE(port);
350 while (count--)
351 *(volatile unsigned short *)portp = *buf++;
352#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
353 } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
354 portp = __port2addr_ata(port);
355 while (count--)
356 *(volatile unsigned short *)portp = *buf++;
357#endif
358#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
359 } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
360 pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short),
361 count, 1);
362#endif
363 } else {
364 portp = PORT2ADDR(port);
365 while (count--)
366 *(volatile unsigned short *)portp = *buf++;
367 }
368}
369
370void _outsl(unsigned int port, const void * addr, unsigned long count)
371{
372 const unsigned long *buf = addr;
373 unsigned char *portp;
374
375 portp = PORT2ADDR(port);
376 while (count--)
377 *(volatile unsigned long *)portp = *buf++;
378}
diff --git a/arch/m32r/kernel/io_oaks32r.c b/arch/m32r/kernel/io_oaks32r.c
index 286964794d51..9997dddd24d7 100644
--- a/arch/m32r/kernel/io_oaks32r.c
+++ b/arch/m32r/kernel/io_oaks32r.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Typical I/O routines for OAKS32R board. 4 * Typical I/O routines for OAKS32R board.
5 * 5 *
6 * Copyright (c) 2001-2004 Hiroyuki Kondo, Hirokazu Takata, 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
7 * Hitoshi Yamamoto, Mamoru Sakugawa 7 * Hitoshi Yamamoto, Mamoru Sakugawa
8 */ 8 */
9 9
@@ -90,35 +90,21 @@ unsigned long _inl(unsigned long port)
90 90
91unsigned char _inb_p(unsigned long port) 91unsigned char _inb_p(unsigned long port)
92{ 92{
93 unsigned char v; 93 unsigned char v = _inb(port);
94
95 if (port >= 0x300 && port < 0x320)
96 v = _ne_inb(PORT2ADDR_NE(port));
97 else
98 v = *(volatile unsigned char *)PORT2ADDR(port);
99
100 delay(); 94 delay();
101 return (v); 95 return (v);
102} 96}
103 97
104unsigned short _inw_p(unsigned long port) 98unsigned short _inw_p(unsigned long port)
105{ 99{
106 unsigned short v; 100 unsigned short v = _inw(port);
107
108 if (port >= 0x300 && port < 0x320)
109 v = _ne_inw(PORT2ADDR_NE(port));
110 else
111 v = *(volatile unsigned short *)PORT2ADDR(port);
112
113 delay(); 101 delay();
114 return (v); 102 return (v);
115} 103}
116 104
117unsigned long _inl_p(unsigned long port) 105unsigned long _inl_p(unsigned long port)
118{ 106{
119 unsigned long v; 107 unsigned long v = _inl(port);
120
121 v = *(volatile unsigned long *)PORT2ADDR(port);
122 delay(); 108 delay();
123 return (v); 109 return (v);
124} 110}
@@ -146,27 +132,19 @@ void _outl(unsigned long l, unsigned long port)
146 132
147void _outb_p(unsigned char b, unsigned long port) 133void _outb_p(unsigned char b, unsigned long port)
148{ 134{
149 if (port >= 0x300 && port < 0x320) 135 _outb(b, port);
150 _ne_outb(b, PORT2ADDR_NE(port));
151 else
152 *(volatile unsigned char *)PORT2ADDR(port) = b;
153
154 delay(); 136 delay();
155} 137}
156 138
157void _outw_p(unsigned short w, unsigned long port) 139void _outw_p(unsigned short w, unsigned long port)
158{ 140{
159 if (port >= 0x300 && port < 0x320) 141 _outw(w, port);
160 _ne_outw(w, PORT2ADDR_NE(port));
161 else
162 *(volatile unsigned short *)PORT2ADDR(port) = w;
163
164 delay(); 142 delay();
165} 143}
166 144
167void _outl_p(unsigned long l, unsigned long port) 145void _outl_p(unsigned long l, unsigned long port)
168{ 146{
169 *(volatile unsigned long *)PORT2ADDR(port) = l; 147 _outl(l, port);
170 delay(); 148 delay();
171} 149}
172 150
diff --git a/arch/m32r/kernel/io_opsput.c b/arch/m32r/kernel/io_opsput.c
index aaf42f9f76da..e34951e8156f 100644
--- a/arch/m32r/kernel/io_opsput.c
+++ b/arch/m32r/kernel/io_opsput.c
@@ -1,10 +1,10 @@
1/* 1/*
2 * linux/arch/m32r/kernel/io_mappi.c 2 * linux/arch/m32r/kernel/io_opsput.c
3 * 3 *
4 * Typical I/O routines for OPSPUT board. 4 * Typical I/O routines for OPSPUT board.
5 * 5 *
6 * Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
7 * Hitoshi Yamamoto, Takeo Takahashi 7 * Hitoshi Yamamoto, Takeo Takahashi
8 * 8 *
9 * This file is subject to the terms and conditions of the GNU General 9 * This file is subject to the terms and conditions of the GNU General
10 * Public License. See the file "COPYING" in the main directory of this 10 * Public License. See the file "COPYING" in the main directory of this
@@ -98,7 +98,6 @@ unsigned char _inb(unsigned long port)
98{ 98{
99 if (port >= LAN_IOSTART && port < LAN_IOEND) 99 if (port >= LAN_IOSTART && port < LAN_IOEND)
100 return _ne_inb(PORT2ADDR_NE(port)); 100 return _ne_inb(PORT2ADDR_NE(port));
101
102#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 101#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
103 else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 102 else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
104 unsigned char b; 103 unsigned char b;
@@ -118,7 +117,6 @@ unsigned short _inw(unsigned long port)
118 else if(port >= 0x340 && port < 0x3a0) 117 else if(port >= 0x340 && port < 0x3a0)
119 return *(volatile unsigned short *)PORT2ADDR_USB(port); 118 return *(volatile unsigned short *)PORT2ADDR_USB(port);
120#endif 119#endif
121
122#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 120#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
123 else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 121 else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
124 unsigned short w; 122 unsigned short w;
@@ -143,55 +141,21 @@ unsigned long _inl(unsigned long port)
143 141
144unsigned char _inb_p(unsigned long port) 142unsigned char _inb_p(unsigned long port)
145{ 143{
146 unsigned char v; 144 unsigned char v = _inb(port);
147
148 if (port >= LAN_IOSTART && port < LAN_IOEND)
149 v = _ne_inb(PORT2ADDR_NE(port));
150 else
151#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
152 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
153 unsigned char b;
154 pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0);
155 return b;
156 } else
157#endif
158 v = *(volatile unsigned char *)PORT2ADDR(port);
159
160 delay(); 145 delay();
161 return (v); 146 return (v);
162} 147}
163 148
164unsigned short _inw_p(unsigned long port) 149unsigned short _inw_p(unsigned long port)
165{ 150{
166 unsigned short v; 151 unsigned short v = _inw(port);
167
168 if (port >= LAN_IOSTART && port < LAN_IOEND)
169 v = _ne_inw(PORT2ADDR_NE(port));
170 else
171#if defined(CONFIG_USB)
172 if(port >= 0x340 && port < 0x3a0)
173 return *(volatile unsigned short *)PORT2ADDR_USB(port);
174 else
175#endif
176
177#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
178 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
179 unsigned short w;
180 pcc_ioread_word(0, port, &w, sizeof(w), 1, 0);
181 return w;
182 } else
183#endif
184 v = *(volatile unsigned short *)PORT2ADDR(port);
185
186 delay(); 152 delay();
187 return (v); 153 return (v);
188} 154}
189 155
190unsigned long _inl_p(unsigned long port) 156unsigned long _inl_p(unsigned long port)
191{ 157{
192 unsigned long v; 158 unsigned long v = _inl(port);
193
194 v = *(volatile unsigned long *)PORT2ADDR(port);
195 delay(); 159 delay();
196 return (v); 160 return (v);
197} 161}
@@ -219,7 +183,6 @@ void _outw(unsigned short w, unsigned long port)
219 *(volatile unsigned short *)PORT2ADDR_USB(port) = w; 183 *(volatile unsigned short *)PORT2ADDR_USB(port) = w;
220 else 184 else
221#endif 185#endif
222
223#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 186#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
224 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 187 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
225 pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); 188 pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
@@ -240,43 +203,19 @@ void _outl(unsigned long l, unsigned long port)
240 203
241void _outb_p(unsigned char b, unsigned long port) 204void _outb_p(unsigned char b, unsigned long port)
242{ 205{
243 if (port >= LAN_IOSTART && port < LAN_IOEND) 206 _outb(b, port);
244 _ne_outb(b, PORT2ADDR_NE(port));
245 else
246#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
247 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
248 pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0);
249 } else
250#endif
251 *(volatile unsigned char *)PORT2ADDR(port) = b;
252
253 delay(); 207 delay();
254} 208}
255 209
256void _outw_p(unsigned short w, unsigned long port) 210void _outw_p(unsigned short w, unsigned long port)
257{ 211{
258 if (port >= LAN_IOSTART && port < LAN_IOEND) 212 _outw(w, port);
259 _ne_outw(w, PORT2ADDR_NE(port));
260 else
261#if defined(CONFIG_USB)
262 if(port >= 0x340 && port < 0x3a0)
263 *(volatile unsigned short *)PORT2ADDR_USB(port) = w;
264 else
265#endif
266
267#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
268 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
269 pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
270 } else
271#endif
272 *(volatile unsigned short *)PORT2ADDR(port) = w;
273
274 delay(); 213 delay();
275} 214}
276 215
277void _outl_p(unsigned long l, unsigned long port) 216void _outl_p(unsigned long l, unsigned long port)
278{ 217{
279 *(volatile unsigned long *)PORT2ADDR(port) = l; 218 _outl(l, port);
280 delay(); 219 delay();
281} 220}
282 221
diff --git a/arch/m32r/kernel/io_usrv.c b/arch/m32r/kernel/io_usrv.c
index 27928a0b99ed..9eb161dcc104 100644
--- a/arch/m32r/kernel/io_usrv.c
+++ b/arch/m32r/kernel/io_usrv.c
@@ -3,8 +3,8 @@
3 * 3 *
4 * Typical I/O routines for uServer board. 4 * Typical I/O routines for uServer board.
5 * 5 *
6 * Copyright (c) 2001 - 2003 Hiroyuki Kondo, Hirokazu Takata, 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
7 * Hitoshi Yamamoto, Takeo Takahashi 7 * Hitoshi Yamamoto, Takeo Takahashi
8 * 8 *
9 * This file is subject to the terms and conditions of the GNU General 9 * This file is subject to the terms and conditions of the GNU General
10 * Public License. See the file "COPYING" in the main directory of this 10 * Public License. See the file "COPYING" in the main directory of this
@@ -39,7 +39,7 @@ extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int);
39 39
40#define PORT2ADDR(port) _port2addr(port) 40#define PORT2ADDR(port) _port2addr(port)
41 41
42static __inline__ void *_port2addr(unsigned long port) 42static inline void *_port2addr(unsigned long port)
43{ 43{
44#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) 44#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
45 if (port >= UART0_IOSTART && port <= UART0_IOEND) 45 if (port >= UART0_IOSTART && port <= UART0_IOEND)
@@ -50,7 +50,7 @@ static __inline__ void *_port2addr(unsigned long port)
50 return (void *)(port + NONCACHE_OFFSET); 50 return (void *)(port + NONCACHE_OFFSET);
51} 51}
52 52
53static __inline__ void delay(void) 53static inline void delay(void)
54{ 54{
55 __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); 55 __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory");
56} 56}
@@ -87,39 +87,22 @@ unsigned long _inl(unsigned long port)
87 87
88unsigned char _inb_p(unsigned long port) 88unsigned char _inb_p(unsigned long port)
89{ 89{
90 unsigned char b; 90 unsigned char v = _inb(port);
91 91 delay();
92 if (port >= CFC_IOSTART && port <= CFC_IOEND) { 92 return v;
93 pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0);
94 return b;
95 } else {
96 b = *(volatile unsigned char *)PORT2ADDR(port);
97 delay();
98 return b;
99 }
100} 93}
101 94
102unsigned short _inw_p(unsigned long port) 95unsigned short _inw_p(unsigned long port)
103{ 96{
104 unsigned short w; 97 unsigned short v = _inw(port);
105 98 delay();
106 if (port >= CFC_IOSTART && port <= CFC_IOEND) { 99 return v;
107 pcc_ioread_word(0, port, &w, sizeof(w), 1, 0);
108 return w;
109 } else {
110 w = *(volatile unsigned short *)PORT2ADDR(port);
111 delay();
112 return w;
113 }
114} 100}
115 101
116unsigned long _inl_p(unsigned long port) 102unsigned long _inl_p(unsigned long port)
117{ 103{
118 unsigned long v; 104 unsigned long v = _inl(port);
119
120 v = *(volatile unsigned long *)PORT2ADDR(port);
121 delay(); 105 delay();
122
123 return v; 106 return v;
124} 107}
125 108
@@ -149,25 +132,19 @@ void _outl(unsigned long l, unsigned long port)
149 132
150void _outb_p(unsigned char b, unsigned long port) 133void _outb_p(unsigned char b, unsigned long port)
151{ 134{
152 if (port >= CFC_IOSTART && port <= CFC_IOEND) 135 _outb(b, port);
153 pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0);
154 else
155 *(volatile unsigned char *)PORT2ADDR(port) = b;
156 delay(); 136 delay();
157} 137}
158 138
159void _outw_p(unsigned short w, unsigned long port) 139void _outw_p(unsigned short w, unsigned long port)
160{ 140{
161 if (port >= CFC_IOSTART && port <= CFC_IOEND) 141 _outw(w, port);
162 pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
163 else
164 *(volatile unsigned short *)PORT2ADDR(port) = w;
165 delay(); 142 delay();
166} 143}
167 144
168void _outl_p(unsigned long l, unsigned long port) 145void _outl_p(unsigned long l, unsigned long port)
169{ 146{
170 *(volatile unsigned long *)PORT2ADDR(port) = l; 147 _outl(l, port);
171 delay(); 148 delay();
172} 149}
173 150
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index 4826cd6e40e8..ec5674727e7f 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -330,6 +330,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
330 seq_printf(m, "Machine\t\t: Mappi Evaluation board\n"); 330 seq_printf(m, "Machine\t\t: Mappi Evaluation board\n");
331#elif CONFIG_PLAT_MAPPI2 331#elif CONFIG_PLAT_MAPPI2
332 seq_printf(m, "Machine\t\t: Mappi-II Evaluation board\n"); 332 seq_printf(m, "Machine\t\t: Mappi-II Evaluation board\n");
333#elif CONFIG_PLAT_MAPPI3
334 seq_printf(m, "Machine\t\t: Mappi-III Evaluation board\n");
333#elif CONFIG_PLAT_M32700UT 335#elif CONFIG_PLAT_M32700UT
334 seq_printf(m, "Machine\t\t: M32700UT Evaluation board\n"); 336 seq_printf(m, "Machine\t\t: M32700UT Evaluation board\n");
335#elif CONFIG_PLAT_OPSPUT 337#elif CONFIG_PLAT_OPSPUT
diff --git a/arch/m32r/kernel/setup_m32700ut.c b/arch/m32r/kernel/setup_m32700ut.c
index 488aa87bab76..b014e2c1e524 100644
--- a/arch/m32r/kernel/setup_m32700ut.c
+++ b/arch/m32r/kernel/setup_m32700ut.c
@@ -78,13 +78,13 @@ static void shutdown_m32700ut_irq(unsigned int irq)
78 78
79static struct hw_interrupt_type m32700ut_irq_type = 79static struct hw_interrupt_type m32700ut_irq_type =
80{ 80{
81 "M32700UT-IRQ", 81 .typename = "M32700UT-IRQ",
82 startup_m32700ut_irq, 82 .startup = startup_m32700ut_irq,
83 shutdown_m32700ut_irq, 83 .shutdown = shutdown_m32700ut_irq,
84 enable_m32700ut_irq, 84 .enable = enable_m32700ut_irq,
85 disable_m32700ut_irq, 85 .disable = disable_m32700ut_irq,
86 mask_and_ack_m32700ut, 86 .ack = mask_and_ack_m32700ut,
87 end_m32700ut_irq 87 .end = end_m32700ut_irq
88}; 88};
89 89
90/* 90/*
@@ -155,13 +155,13 @@ static void shutdown_m32700ut_pld_irq(unsigned int irq)
155 155
156static struct hw_interrupt_type m32700ut_pld_irq_type = 156static struct hw_interrupt_type m32700ut_pld_irq_type =
157{ 157{
158 "M32700UT-PLD-IRQ", 158 .typename = "M32700UT-PLD-IRQ",
159 startup_m32700ut_pld_irq, 159 .startup = startup_m32700ut_pld_irq,
160 shutdown_m32700ut_pld_irq, 160 .shutdown = shutdown_m32700ut_pld_irq,
161 enable_m32700ut_pld_irq, 161 .enable = enable_m32700ut_pld_irq,
162 disable_m32700ut_pld_irq, 162 .disable = disable_m32700ut_pld_irq,
163 mask_and_ack_m32700ut_pld, 163 .ack = mask_and_ack_m32700ut_pld,
164 end_m32700ut_pld_irq 164 .end = end_m32700ut_pld_irq
165}; 165};
166 166
167/* 167/*
@@ -224,13 +224,13 @@ static void shutdown_m32700ut_lanpld_irq(unsigned int irq)
224 224
225static struct hw_interrupt_type m32700ut_lanpld_irq_type = 225static struct hw_interrupt_type m32700ut_lanpld_irq_type =
226{ 226{
227 "M32700UT-PLD-LAN-IRQ", 227 .typename = "M32700UT-PLD-LAN-IRQ",
228 startup_m32700ut_lanpld_irq, 228 .startup = startup_m32700ut_lanpld_irq,
229 shutdown_m32700ut_lanpld_irq, 229 .shutdown = shutdown_m32700ut_lanpld_irq,
230 enable_m32700ut_lanpld_irq, 230 .enable = enable_m32700ut_lanpld_irq,
231 disable_m32700ut_lanpld_irq, 231 .disable = disable_m32700ut_lanpld_irq,
232 mask_and_ack_m32700ut_lanpld, 232 .ack = mask_and_ack_m32700ut_lanpld,
233 end_m32700ut_lanpld_irq 233 .end = end_m32700ut_lanpld_irq
234}; 234};
235 235
236/* 236/*
@@ -293,13 +293,13 @@ static void shutdown_m32700ut_lcdpld_irq(unsigned int irq)
293 293
294static struct hw_interrupt_type m32700ut_lcdpld_irq_type = 294static struct hw_interrupt_type m32700ut_lcdpld_irq_type =
295{ 295{
296 "M32700UT-PLD-LCD-IRQ", 296 .typename = "M32700UT-PLD-LCD-IRQ",
297 startup_m32700ut_lcdpld_irq, 297 .startup = startup_m32700ut_lcdpld_irq,
298 shutdown_m32700ut_lcdpld_irq, 298 .shutdown = shutdown_m32700ut_lcdpld_irq,
299 enable_m32700ut_lcdpld_irq, 299 .enable = enable_m32700ut_lcdpld_irq,
300 disable_m32700ut_lcdpld_irq, 300 .disable = disable_m32700ut_lcdpld_irq,
301 mask_and_ack_m32700ut_lcdpld, 301 .ack = mask_and_ack_m32700ut_lcdpld,
302 end_m32700ut_lcdpld_irq 302 .end = end_m32700ut_lcdpld_irq
303}; 303};
304 304
305void __init init_IRQ(void) 305void __init init_IRQ(void)
diff --git a/arch/m32r/kernel/setup_mappi.c b/arch/m32r/kernel/setup_mappi.c
index 1e74110f0670..aaf8e569b930 100644
--- a/arch/m32r/kernel/setup_mappi.c
+++ b/arch/m32r/kernel/setup_mappi.c
@@ -70,13 +70,13 @@ static void shutdown_mappi_irq(unsigned int irq)
70 70
71static struct hw_interrupt_type mappi_irq_type = 71static struct hw_interrupt_type mappi_irq_type =
72{ 72{
73 "MAPPI-IRQ", 73 .typename = "MAPPI-IRQ",
74 startup_mappi_irq, 74 .startup = startup_mappi_irq,
75 shutdown_mappi_irq, 75 .shutdown = shutdown_mappi_irq,
76 enable_mappi_irq, 76 .enable = enable_mappi_irq,
77 disable_mappi_irq, 77 .disable = disable_mappi_irq,
78 mask_and_ack_mappi, 78 .ack = mask_and_ack_mappi,
79 end_mappi_irq 79 .end = end_mappi_irq
80}; 80};
81 81
82void __init init_IRQ(void) 82void __init init_IRQ(void)
diff --git a/arch/m32r/kernel/setup_mappi2.c b/arch/m32r/kernel/setup_mappi2.c
index 1904d465a507..38d5e9a41427 100644
--- a/arch/m32r/kernel/setup_mappi2.c
+++ b/arch/m32r/kernel/setup_mappi2.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/m32r/kernel/setup_mappi.c 2 * linux/arch/m32r/kernel/setup_mappi2.c
3 * 3 *
4 * Setup routines for Renesas MAPPI-II(M3A-ZA36) Board 4 * Setup routines for Renesas MAPPI-II(M3A-ZA36) Board
5 * 5 *
@@ -79,13 +79,13 @@ static void shutdown_mappi2_irq(unsigned int irq)
79 79
80static struct hw_interrupt_type mappi2_irq_type = 80static struct hw_interrupt_type mappi2_irq_type =
81{ 81{
82 "MAPPI2-IRQ", 82 .typename = "MAPPI2-IRQ",
83 startup_mappi2_irq, 83 .startup = startup_mappi2_irq,
84 shutdown_mappi2_irq, 84 .shutdown = shutdown_mappi2_irq,
85 enable_mappi2_irq, 85 .enable = enable_mappi2_irq,
86 disable_mappi2_irq, 86 .disable = disable_mappi2_irq,
87 mask_and_ack_mappi2, 87 .ack = mask_and_ack_mappi2,
88 end_mappi2_irq 88 .end = end_mappi2_irq
89}; 89};
90 90
91void __init init_IRQ(void) 91void __init init_IRQ(void)
@@ -156,7 +156,6 @@ void __init init_IRQ(void)
156 irq_desc[PLD_IRQ_CFIREQ].handler = &mappi2_irq_type; 156 irq_desc[PLD_IRQ_CFIREQ].handler = &mappi2_irq_type;
157 irq_desc[PLD_IRQ_CFIREQ].action = 0; 157 irq_desc[PLD_IRQ_CFIREQ].action = 0;
158 irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */ 158 irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */
159// icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00;
160 icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; 159 icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01;
161 disable_mappi2_irq(PLD_IRQ_CFIREQ); 160 disable_mappi2_irq(PLD_IRQ_CFIREQ);
162 161
@@ -167,7 +166,6 @@ void __init init_IRQ(void)
167 irq_desc[PLD_IRQ_CFC_INSERT].action = 0; 166 irq_desc[PLD_IRQ_CFC_INSERT].action = 0;
168 irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */ 167 irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */
169 icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00; 168 icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00;
170// icu_data[PLD_IRQ_CFC_INSERT].icucr = 0;
171 disable_mappi2_irq(PLD_IRQ_CFC_INSERT); 169 disable_mappi2_irq(PLD_IRQ_CFC_INSERT);
172 170
173 /* ICUCR42: CFC Eject */ 171 /* ICUCR42: CFC Eject */
@@ -176,9 +174,7 @@ void __init init_IRQ(void)
176 irq_desc[PLD_IRQ_CFC_EJECT].action = 0; 174 irq_desc[PLD_IRQ_CFC_EJECT].action = 0;
177 irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ 175 irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */
178 icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 176 icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
179// icu_data[PLD_IRQ_CFC_EJECT].icucr = 0;
180 disable_mappi2_irq(PLD_IRQ_CFC_EJECT); 177 disable_mappi2_irq(PLD_IRQ_CFC_EJECT);
181
182#endif /* CONFIG_MAPPI2_CFC */ 178#endif /* CONFIG_MAPPI2_CFC */
183} 179}
184 180
diff --git a/arch/m32r/kernel/setup_mappi3.c b/arch/m32r/kernel/setup_mappi3.c
new file mode 100644
index 000000000000..3d60a85aaec5
--- /dev/null
+++ b/arch/m32r/kernel/setup_mappi3.c
@@ -0,0 +1,208 @@
1/*
2 * linux/arch/m32r/kernel/setup_mappi3.c
3 *
4 * Setup routines for Renesas MAPPI-III(M3A-2170) Board
5 *
6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
7 * Hitoshi Yamamoto, Mamoru Sakugawa
8 */
9
10#include <linux/config.h>
11#include <linux/irq.h>
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/device.h>
15
16#include <asm/system.h>
17#include <asm/m32r.h>
18#include <asm/io.h>
19
20#define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long)))
21
22#ifndef CONFIG_SMP
23typedef struct {
24 unsigned long icucr; /* ICU Control Register */
25} icu_data_t;
26#endif /* CONFIG_SMP */
27
28icu_data_t icu_data[NR_IRQS];
29
30static void disable_mappi3_irq(unsigned int irq)
31{
32 unsigned long port, data;
33
34 if ((irq == 0) ||(irq >= NR_IRQS)) {
35 printk("bad irq 0x%08x\n", irq);
36 return;
37 }
38 port = irq2port(irq);
39 data = icu_data[irq].icucr|M32R_ICUCR_ILEVEL7;
40 outl(data, port);
41}
42
43static void enable_mappi3_irq(unsigned int irq)
44{
45 unsigned long port, data;
46
47 if ((irq == 0) ||(irq >= NR_IRQS)) {
48 printk("bad irq 0x%08x\n", irq);
49 return;
50 }
51 port = irq2port(irq);
52 data = icu_data[irq].icucr|M32R_ICUCR_IEN|M32R_ICUCR_ILEVEL6;
53 outl(data, port);
54}
55
56static void mask_and_ack_mappi3(unsigned int irq)
57{
58 disable_mappi3_irq(irq);
59}
60
61static void end_mappi3_irq(unsigned int irq)
62{
63 enable_mappi3_irq(irq);
64}
65
66static unsigned int startup_mappi3_irq(unsigned int irq)
67{
68 enable_mappi3_irq(irq);
69 return (0);
70}
71
72static void shutdown_mappi3_irq(unsigned int irq)
73{
74 unsigned long port;
75
76 port = irq2port(irq);
77 outl(M32R_ICUCR_ILEVEL7, port);
78}
79
80static struct hw_interrupt_type mappi3_irq_type =
81{
82 .typename = "MAPPI3-IRQ",
83 .startup = startup_mappi3_irq,
84 .shutdown = shutdown_mappi3_irq,
85 .enable = enable_mappi3_irq,
86 .disable = disable_mappi3_irq,
87 .ack = mask_and_ack_mappi3,
88 .end = end_mappi3_irq
89};
90
91void __init init_IRQ(void)
92{
93#if defined(CONFIG_SMC91X)
94 /* INT0 : LAN controller (SMC91111) */
95 irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED;
96 irq_desc[M32R_IRQ_INT0].handler = &mappi3_irq_type;
97 irq_desc[M32R_IRQ_INT0].action = 0;
98 irq_desc[M32R_IRQ_INT0].depth = 1;
99 icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
100 disable_mappi3_irq(M32R_IRQ_INT0);
101#endif /* CONFIG_SMC91X */
102
103 /* MFT2 : system timer */
104 irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
105 irq_desc[M32R_IRQ_MFT2].handler = &mappi3_irq_type;
106 irq_desc[M32R_IRQ_MFT2].action = 0;
107 irq_desc[M32R_IRQ_MFT2].depth = 1;
108 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
109 disable_mappi3_irq(M32R_IRQ_MFT2);
110
111#ifdef CONFIG_SERIAL_M32R_SIO
112 /* SIO0_R : uart receive data */
113 irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
114 irq_desc[M32R_IRQ_SIO0_R].handler = &mappi3_irq_type;
115 irq_desc[M32R_IRQ_SIO0_R].action = 0;
116 irq_desc[M32R_IRQ_SIO0_R].depth = 1;
117 icu_data[M32R_IRQ_SIO0_R].icucr = 0;
118 disable_mappi3_irq(M32R_IRQ_SIO0_R);
119
120 /* SIO0_S : uart send data */
121 irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
122 irq_desc[M32R_IRQ_SIO0_S].handler = &mappi3_irq_type;
123 irq_desc[M32R_IRQ_SIO0_S].action = 0;
124 irq_desc[M32R_IRQ_SIO0_S].depth = 1;
125 icu_data[M32R_IRQ_SIO0_S].icucr = 0;
126 disable_mappi3_irq(M32R_IRQ_SIO0_S);
127 /* SIO1_R : uart receive data */
128 irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
129 irq_desc[M32R_IRQ_SIO1_R].handler = &mappi3_irq_type;
130 irq_desc[M32R_IRQ_SIO1_R].action = 0;
131 irq_desc[M32R_IRQ_SIO1_R].depth = 1;
132 icu_data[M32R_IRQ_SIO1_R].icucr = 0;
133 disable_mappi3_irq(M32R_IRQ_SIO1_R);
134
135 /* SIO1_S : uart send data */
136 irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
137 irq_desc[M32R_IRQ_SIO1_S].handler = &mappi3_irq_type;
138 irq_desc[M32R_IRQ_SIO1_S].action = 0;
139 irq_desc[M32R_IRQ_SIO1_S].depth = 1;
140 icu_data[M32R_IRQ_SIO1_S].icucr = 0;
141 disable_mappi3_irq(M32R_IRQ_SIO1_S);
142#endif /* CONFIG_M32R_USE_DBG_CONSOLE */
143
144#if defined(CONFIG_USB)
145 /* INT1 : USB Host controller interrupt */
146 irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED;
147 irq_desc[M32R_IRQ_INT1].handler = &mappi3_irq_type;
148 irq_desc[M32R_IRQ_INT1].action = 0;
149 irq_desc[M32R_IRQ_INT1].depth = 1;
150 icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_ISMOD01;
151 disable_mappi3_irq(M32R_IRQ_INT1);
152#endif /* CONFIG_USB */
153
154 /* ICUCR40: CFC IREQ */
155 irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED;
156 irq_desc[PLD_IRQ_CFIREQ].handler = &mappi3_irq_type;
157 irq_desc[PLD_IRQ_CFIREQ].action = 0;
158 irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */
159 icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01;
160 disable_mappi3_irq(PLD_IRQ_CFIREQ);
161
162#if defined(CONFIG_M32R_CFC)
163 /* ICUCR41: CFC Insert */
164 irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED;
165 irq_desc[PLD_IRQ_CFC_INSERT].handler = &mappi3_irq_type;
166 irq_desc[PLD_IRQ_CFC_INSERT].action = 0;
167 irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */
168 icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00;
169 disable_mappi3_irq(PLD_IRQ_CFC_INSERT);
170
171 /* ICUCR42: CFC Eject */
172 irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED;
173 irq_desc[PLD_IRQ_CFC_EJECT].handler = &mappi3_irq_type;
174 irq_desc[PLD_IRQ_CFC_EJECT].action = 0;
175 irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */
176 icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
177 disable_mappi3_irq(PLD_IRQ_CFC_EJECT);
178#endif /* CONFIG_M32R_CFC */
179}
180
181#define LAN_IOSTART 0x300
182#define LAN_IOEND 0x320
183static struct resource smc91x_resources[] = {
184 [0] = {
185 .start = (LAN_IOSTART),
186 .end = (LAN_IOEND),
187 .flags = IORESOURCE_MEM,
188 },
189 [1] = {
190 .start = M32R_IRQ_INT0,
191 .end = M32R_IRQ_INT0,
192 .flags = IORESOURCE_IRQ,
193 }
194};
195
196static struct platform_device smc91x_device = {
197 .name = "smc91x",
198 .id = 0,
199 .num_resources = ARRAY_SIZE(smc91x_resources),
200 .resource = smc91x_resources,
201};
202
203static int __init platform_init(void)
204{
205 platform_device_register(&smc91x_device);
206 return 0;
207}
208arch_initcall(platform_init);
diff --git a/arch/m32r/kernel/setup_oaks32r.c b/arch/m32r/kernel/setup_oaks32r.c
index b04834526c9a..d656640badc9 100644
--- a/arch/m32r/kernel/setup_oaks32r.c
+++ b/arch/m32r/kernel/setup_oaks32r.c
@@ -70,13 +70,13 @@ static void shutdown_oaks32r_irq(unsigned int irq)
70 70
71static struct hw_interrupt_type oaks32r_irq_type = 71static struct hw_interrupt_type oaks32r_irq_type =
72{ 72{
73 "OAKS32R-IRQ", 73 .typename = "OAKS32R-IRQ",
74 startup_oaks32r_irq, 74 .startup = startup_oaks32r_irq,
75 shutdown_oaks32r_irq, 75 .shutdown = shutdown_oaks32r_irq,
76 enable_oaks32r_irq, 76 .enable = enable_oaks32r_irq,
77 disable_oaks32r_irq, 77 .disable = disable_oaks32r_irq,
78 mask_and_ack_mappi, 78 .ack = mask_and_ack_mappi,
79 end_oaks32r_irq 79 .end = end_oaks32r_irq
80}; 80};
81 81
82void __init init_IRQ(void) 82void __init init_IRQ(void)
diff --git a/arch/m32r/kernel/setup_opsput.c b/arch/m32r/kernel/setup_opsput.c
index 84315e344c58..86f4cf2a86c3 100644
--- a/arch/m32r/kernel/setup_opsput.c
+++ b/arch/m32r/kernel/setup_opsput.c
@@ -79,13 +79,13 @@ static void shutdown_opsput_irq(unsigned int irq)
79 79
80static struct hw_interrupt_type opsput_irq_type = 80static struct hw_interrupt_type opsput_irq_type =
81{ 81{
82 "OPSPUT-IRQ", 82 .typename = "OPSPUT-IRQ",
83 startup_opsput_irq, 83 .startup = startup_opsput_irq,
84 shutdown_opsput_irq, 84 .shutdown = shutdown_opsput_irq,
85 enable_opsput_irq, 85 .enable = enable_opsput_irq,
86 disable_opsput_irq, 86 .disable = disable_opsput_irq,
87 mask_and_ack_opsput, 87 .ack = mask_and_ack_opsput,
88 end_opsput_irq 88 .end = end_opsput_irq
89}; 89};
90 90
91/* 91/*
@@ -156,13 +156,13 @@ static void shutdown_opsput_pld_irq(unsigned int irq)
156 156
157static struct hw_interrupt_type opsput_pld_irq_type = 157static struct hw_interrupt_type opsput_pld_irq_type =
158{ 158{
159 "OPSPUT-PLD-IRQ", 159 .typename = "OPSPUT-PLD-IRQ",
160 startup_opsput_pld_irq, 160 .startup = startup_opsput_pld_irq,
161 shutdown_opsput_pld_irq, 161 .shutdown = shutdown_opsput_pld_irq,
162 enable_opsput_pld_irq, 162 .enable = enable_opsput_pld_irq,
163 disable_opsput_pld_irq, 163 .disable = disable_opsput_pld_irq,
164 mask_and_ack_opsput_pld, 164 .ack = mask_and_ack_opsput_pld,
165 end_opsput_pld_irq 165 .end = end_opsput_pld_irq
166}; 166};
167 167
168/* 168/*
diff --git a/arch/m32r/kernel/setup_usrv.c b/arch/m32r/kernel/setup_usrv.c
index fe417be5e3e9..634741bf9d35 100644
--- a/arch/m32r/kernel/setup_usrv.c
+++ b/arch/m32r/kernel/setup_usrv.c
@@ -70,13 +70,13 @@ static void shutdown_mappi_irq(unsigned int irq)
70 70
71static struct hw_interrupt_type mappi_irq_type = 71static struct hw_interrupt_type mappi_irq_type =
72{ 72{
73 "M32700-IRQ", 73 .typename = "M32700-IRQ",
74 startup_mappi_irq, 74 .startup = startup_mappi_irq,
75 shutdown_mappi_irq, 75 .shutdown = shutdown_mappi_irq,
76 enable_mappi_irq, 76 .enable = enable_mappi_irq,
77 disable_mappi_irq, 77 .disable = disable_mappi_irq,
78 mask_and_ack_mappi, 78 .ack = mask_and_ack_mappi,
79 end_mappi_irq 79 .end = end_mappi_irq
80}; 80};
81 81
82/* 82/*
@@ -143,13 +143,13 @@ static void shutdown_m32700ut_pld_irq(unsigned int irq)
143 143
144static struct hw_interrupt_type m32700ut_pld_irq_type = 144static struct hw_interrupt_type m32700ut_pld_irq_type =
145{ 145{
146 "USRV-PLD-IRQ", 146 .typename = "USRV-PLD-IRQ",
147 startup_m32700ut_pld_irq, 147 .startup = startup_m32700ut_pld_irq,
148 shutdown_m32700ut_pld_irq, 148 .shutdown = shutdown_m32700ut_pld_irq,
149 enable_m32700ut_pld_irq, 149 .enable = enable_m32700ut_pld_irq,
150 disable_m32700ut_pld_irq, 150 .disable = disable_m32700ut_pld_irq,
151 mask_and_ack_m32700ut_pld, 151 .ack = mask_and_ack_m32700ut_pld,
152 end_m32700ut_pld_irq 152 .end = end_m32700ut_pld_irq
153}; 153};
154 154
155void __init init_IRQ(void) 155void __init init_IRQ(void)
diff --git a/arch/m32r/m32700ut/defconfig.m32700ut.smp b/arch/m32r/m32700ut/defconfig.m32700ut.smp
index 1c002181df7f..3e607d90b5f4 100644
--- a/arch/m32r/m32700ut/defconfig.m32700ut.smp
+++ b/arch/m32r/m32700ut/defconfig.m32700ut.smp
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc4 3# Linux kernel version: 2.6.12-rc5
4# Wed Feb 16 21:10:50 2005 4# Fri Jun 3 16:20:58 2005
5# 5#
6CONFIG_M32R=y 6CONFIG_M32R=y
7# CONFIG_UID16 is not set 7# CONFIG_UID16 is not set
@@ -15,6 +15,7 @@ CONFIG_GENERIC_IRQ_PROBE=y
15CONFIG_EXPERIMENTAL=y 15CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y 16CONFIG_CLEAN_COMPILE=y
17CONFIG_LOCK_KERNEL=y 17CONFIG_LOCK_KERNEL=y
18CONFIG_INIT_ENV_ARG_LIMIT=32
18 19
19# 20#
20# General setup 21# General setup
@@ -27,13 +28,16 @@ CONFIG_BSD_PROCESS_ACCT=y
27# CONFIG_BSD_PROCESS_ACCT_V3 is not set 28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
28CONFIG_SYSCTL=y 29CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set 30# CONFIG_AUDIT is not set
30CONFIG_LOG_BUF_SHIFT=15
31CONFIG_HOTPLUG=y 31CONFIG_HOTPLUG=y
32CONFIG_KOBJECT_UEVENT=y 32CONFIG_KOBJECT_UEVENT=y
33CONFIG_IKCONFIG=y 33CONFIG_IKCONFIG=y
34# CONFIG_IKCONFIG_PROC is not set 34# CONFIG_IKCONFIG_PROC is not set
35# CONFIG_CPUSETS is not set
35CONFIG_EMBEDDED=y 36CONFIG_EMBEDDED=y
36# CONFIG_KALLSYMS is not set 37# CONFIG_KALLSYMS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
40CONFIG_BASE_FULL=y
37# CONFIG_FUTEX is not set 41# CONFIG_FUTEX is not set
38# CONFIG_EPOLL is not set 42# CONFIG_EPOLL is not set
39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 43# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -43,6 +47,7 @@ CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0 47CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0 48CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set 49# CONFIG_TINY_SHMEM is not set
50CONFIG_BASE_SMALL=0
46 51
47# 52#
48# Loadable module support 53# Loadable module support
@@ -65,6 +70,7 @@ CONFIG_PLAT_M32700UT=y
65# CONFIG_PLAT_OPSPUT is not set 70# CONFIG_PLAT_OPSPUT is not set
66# CONFIG_PLAT_OAKS32R is not set 71# CONFIG_PLAT_OAKS32R is not set
67# CONFIG_PLAT_MAPPI2 is not set 72# CONFIG_PLAT_MAPPI2 is not set
73# CONFIG_PLAT_MAPPI3 is not set
68CONFIG_CHIP_M32700=y 74CONFIG_CHIP_M32700=y
69# CONFIG_CHIP_M32102 is not set 75# CONFIG_CHIP_M32102 is not set
70# CONFIG_CHIP_VDEC2 is not set 76# CONFIG_CHIP_VDEC2 is not set
@@ -271,7 +277,6 @@ CONFIG_NET=y
271# 277#
272CONFIG_PACKET=y 278CONFIG_PACKET=y
273# CONFIG_PACKET_MMAP is not set 279# CONFIG_PACKET_MMAP is not set
274# CONFIG_NETLINK_DEV is not set
275CONFIG_UNIX=y 280CONFIG_UNIX=y
276# CONFIG_NET_KEY is not set 281# CONFIG_NET_KEY is not set
277CONFIG_INET=y 282CONFIG_INET=y
@@ -396,18 +401,6 @@ CONFIG_INPUT=y
396# CONFIG_INPUT_EVBUG is not set 401# CONFIG_INPUT_EVBUG is not set
397 402
398# 403#
399# Input I/O drivers
400#
401# CONFIG_GAMEPORT is not set
402CONFIG_SOUND_GAMEPORT=y
403CONFIG_SERIO=y
404# CONFIG_SERIO_I8042 is not set
405CONFIG_SERIO_SERPORT=y
406# CONFIG_SERIO_CT82C710 is not set
407# CONFIG_SERIO_LIBPS2 is not set
408# CONFIG_SERIO_RAW is not set
409
410#
411# Input Device Drivers 404# Input Device Drivers
412# 405#
413# CONFIG_INPUT_KEYBOARD is not set 406# CONFIG_INPUT_KEYBOARD is not set
@@ -417,6 +410,17 @@ CONFIG_SERIO_SERPORT=y
417# CONFIG_INPUT_MISC is not set 410# CONFIG_INPUT_MISC is not set
418 411
419# 412#
413# Hardware I/O ports
414#
415CONFIG_SERIO=y
416# CONFIG_SERIO_I8042 is not set
417CONFIG_SERIO_SERPORT=y
418# CONFIG_SERIO_LIBPS2 is not set
419# CONFIG_SERIO_RAW is not set
420# CONFIG_GAMEPORT is not set
421CONFIG_SOUND_GAMEPORT=y
422
423#
420# Character devices 424# Character devices
421# 425#
422CONFIG_VT=y 426CONFIG_VT=y
@@ -468,6 +472,10 @@ CONFIG_DS1302=y
468# CONFIG_RAW_DRIVER is not set 472# CONFIG_RAW_DRIVER is not set
469 473
470# 474#
475# TPM devices
476#
477
478#
471# I2C support 479# I2C support
472# 480#
473# CONFIG_I2C is not set 481# CONFIG_I2C is not set
@@ -511,8 +519,14 @@ CONFIG_VIDEO_M32R_AR_M64278=y
511# Graphics support 519# Graphics support
512# 520#
513CONFIG_FB=y 521CONFIG_FB=y
522# CONFIG_FB_CFB_FILLRECT is not set
523# CONFIG_FB_CFB_COPYAREA is not set
524# CONFIG_FB_CFB_IMAGEBLIT is not set
525# CONFIG_FB_SOFT_CURSOR is not set
526# CONFIG_FB_MACMODES is not set
514# CONFIG_FB_MODE_HELPERS is not set 527# CONFIG_FB_MODE_HELPERS is not set
515# CONFIG_FB_TILEBLITTING is not set 528# CONFIG_FB_TILEBLITTING is not set
529# CONFIG_FB_S1D13XXX is not set
516# CONFIG_FB_VIRTUAL is not set 530# CONFIG_FB_VIRTUAL is not set
517 531
518# 532#
@@ -546,10 +560,6 @@ CONFIG_LOGO_LINUX_CLUT224=y
546# CONFIG_USB_ARCH_HAS_OHCI is not set 560# CONFIG_USB_ARCH_HAS_OHCI is not set
547 561
548# 562#
549# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
550#
551
552#
553# USB Gadget Support 563# USB Gadget Support
554# 564#
555# CONFIG_USB_GADGET is not set 565# CONFIG_USB_GADGET is not set
@@ -722,8 +732,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
722# 732#
723# Kernel hacking 733# Kernel hacking
724# 734#
735# CONFIG_PRINTK_TIME is not set
725# CONFIG_DEBUG_KERNEL is not set 736# CONFIG_DEBUG_KERNEL is not set
726CONFIG_DEBUG_PREEMPT=y 737CONFIG_LOG_BUF_SHIFT=15
727# CONFIG_DEBUG_BUGVERBOSE is not set 738# CONFIG_DEBUG_BUGVERBOSE is not set
728# CONFIG_FRAME_POINTER is not set 739# CONFIG_FRAME_POINTER is not set
729 740
diff --git a/arch/m32r/m32700ut/defconfig.m32700ut.up b/arch/m32r/m32700ut/defconfig.m32700ut.up
index 805357f7bda1..2d3e7cda8f46 100644
--- a/arch/m32r/m32700ut/defconfig.m32700ut.up
+++ b/arch/m32r/m32700ut/defconfig.m32700ut.up
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc4 3# Linux kernel version: 2.6.12-rc5
4# Wed Feb 16 21:10:54 2005 4# Fri Jun 3 16:21:34 2005
5# 5#
6CONFIG_M32R=y 6CONFIG_M32R=y
7# CONFIG_UID16 is not set 7# CONFIG_UID16 is not set
@@ -16,6 +16,7 @@ CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y 16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
18CONFIG_LOCK_KERNEL=y 18CONFIG_LOCK_KERNEL=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
19 20
20# 21#
21# General setup 22# General setup
@@ -28,13 +29,15 @@ CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set 29# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
31CONFIG_LOG_BUF_SHIFT=14
32CONFIG_HOTPLUG=y 32CONFIG_HOTPLUG=y
33CONFIG_KOBJECT_UEVENT=y 33CONFIG_KOBJECT_UEVENT=y
34CONFIG_IKCONFIG=y 34CONFIG_IKCONFIG=y
35# CONFIG_IKCONFIG_PROC is not set 35# CONFIG_IKCONFIG_PROC is not set
36CONFIG_EMBEDDED=y 36CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set 37# CONFIG_KALLSYMS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
40CONFIG_BASE_FULL=y
38# CONFIG_FUTEX is not set 41# CONFIG_FUTEX is not set
39# CONFIG_EPOLL is not set 42# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 43# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -44,6 +47,7 @@ CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0 47CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0 48CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 49# CONFIG_TINY_SHMEM is not set
50CONFIG_BASE_SMALL=0
47 51
48# 52#
49# Loadable module support 53# Loadable module support
@@ -65,6 +69,7 @@ CONFIG_PLAT_M32700UT=y
65# CONFIG_PLAT_OPSPUT is not set 69# CONFIG_PLAT_OPSPUT is not set
66# CONFIG_PLAT_OAKS32R is not set 70# CONFIG_PLAT_OAKS32R is not set
67# CONFIG_PLAT_MAPPI2 is not set 71# CONFIG_PLAT_MAPPI2 is not set
72# CONFIG_PLAT_MAPPI3 is not set
68CONFIG_CHIP_M32700=y 73CONFIG_CHIP_M32700=y
69# CONFIG_CHIP_M32102 is not set 74# CONFIG_CHIP_M32102 is not set
70# CONFIG_CHIP_VDEC2 is not set 75# CONFIG_CHIP_VDEC2 is not set
@@ -268,7 +273,6 @@ CONFIG_NET=y
268# 273#
269CONFIG_PACKET=y 274CONFIG_PACKET=y
270# CONFIG_PACKET_MMAP is not set 275# CONFIG_PACKET_MMAP is not set
271# CONFIG_NETLINK_DEV is not set
272CONFIG_UNIX=y 276CONFIG_UNIX=y
273# CONFIG_NET_KEY is not set 277# CONFIG_NET_KEY is not set
274CONFIG_INET=y 278CONFIG_INET=y
@@ -393,18 +397,6 @@ CONFIG_INPUT=y
393# CONFIG_INPUT_EVBUG is not set 397# CONFIG_INPUT_EVBUG is not set
394 398
395# 399#
396# Input I/O drivers
397#
398# CONFIG_GAMEPORT is not set
399CONFIG_SOUND_GAMEPORT=y
400CONFIG_SERIO=y
401# CONFIG_SERIO_I8042 is not set
402CONFIG_SERIO_SERPORT=y
403# CONFIG_SERIO_CT82C710 is not set
404# CONFIG_SERIO_LIBPS2 is not set
405# CONFIG_SERIO_RAW is not set
406
407#
408# Input Device Drivers 400# Input Device Drivers
409# 401#
410# CONFIG_INPUT_KEYBOARD is not set 402# CONFIG_INPUT_KEYBOARD is not set
@@ -414,6 +406,17 @@ CONFIG_SERIO_SERPORT=y
414# CONFIG_INPUT_MISC is not set 406# CONFIG_INPUT_MISC is not set
415 407
416# 408#
409# Hardware I/O ports
410#
411CONFIG_SERIO=y
412# CONFIG_SERIO_I8042 is not set
413CONFIG_SERIO_SERPORT=y
414# CONFIG_SERIO_LIBPS2 is not set
415# CONFIG_SERIO_RAW is not set
416# CONFIG_GAMEPORT is not set
417CONFIG_SOUND_GAMEPORT=y
418
419#
417# Character devices 420# Character devices
418# 421#
419CONFIG_VT=y 422CONFIG_VT=y
@@ -465,6 +468,10 @@ CONFIG_DS1302=y
465# CONFIG_RAW_DRIVER is not set 468# CONFIG_RAW_DRIVER is not set
466 469
467# 470#
471# TPM devices
472#
473
474#
468# I2C support 475# I2C support
469# 476#
470# CONFIG_I2C is not set 477# CONFIG_I2C is not set
@@ -508,8 +515,14 @@ CONFIG_VIDEO_M32R_AR_M64278=y
508# Graphics support 515# Graphics support
509# 516#
510CONFIG_FB=y 517CONFIG_FB=y
518# CONFIG_FB_CFB_FILLRECT is not set
519# CONFIG_FB_CFB_COPYAREA is not set
520# CONFIG_FB_CFB_IMAGEBLIT is not set
521# CONFIG_FB_SOFT_CURSOR is not set
522# CONFIG_FB_MACMODES is not set
511# CONFIG_FB_MODE_HELPERS is not set 523# CONFIG_FB_MODE_HELPERS is not set
512# CONFIG_FB_TILEBLITTING is not set 524# CONFIG_FB_TILEBLITTING is not set
525# CONFIG_FB_S1D13XXX is not set
513# CONFIG_FB_VIRTUAL is not set 526# CONFIG_FB_VIRTUAL is not set
514 527
515# 528#
@@ -543,10 +556,6 @@ CONFIG_LOGO_LINUX_CLUT224=y
543# CONFIG_USB_ARCH_HAS_OHCI is not set 556# CONFIG_USB_ARCH_HAS_OHCI is not set
544 557
545# 558#
546# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
547#
548
549#
550# USB Gadget Support 559# USB Gadget Support
551# 560#
552# CONFIG_USB_GADGET is not set 561# CONFIG_USB_GADGET is not set
@@ -719,8 +728,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
719# 728#
720# Kernel hacking 729# Kernel hacking
721# 730#
731# CONFIG_PRINTK_TIME is not set
722# CONFIG_DEBUG_KERNEL is not set 732# CONFIG_DEBUG_KERNEL is not set
723CONFIG_DEBUG_PREEMPT=y 733CONFIG_LOG_BUF_SHIFT=14
724# CONFIG_DEBUG_BUGVERBOSE is not set 734# CONFIG_DEBUG_BUGVERBOSE is not set
725# CONFIG_FRAME_POINTER is not set 735# CONFIG_FRAME_POINTER is not set
726 736
diff --git a/arch/m32r/mappi/defconfig.nommu b/arch/m32r/mappi/defconfig.nommu
index 714aa6e7034c..a8425fba340b 100644
--- a/arch/m32r/mappi/defconfig.nommu
+++ b/arch/m32r/mappi/defconfig.nommu
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc4 3# Linux kernel version: 2.6.12-rc5
4# Wed Feb 16 21:10:57 2005 4# Fri Jun 3 16:21:46 2005
5# 5#
6CONFIG_M32R=y 6CONFIG_M32R=y
7# CONFIG_UID16 is not set 7# CONFIG_UID16 is not set
@@ -16,6 +16,7 @@ CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y 16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
18CONFIG_LOCK_KERNEL=y 18CONFIG_LOCK_KERNEL=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
19 20
20# 21#
21# General setup 22# General setup
@@ -26,13 +27,15 @@ CONFIG_BSD_PROCESS_ACCT=y
26# CONFIG_BSD_PROCESS_ACCT_V3 is not set 27# CONFIG_BSD_PROCESS_ACCT_V3 is not set
27CONFIG_SYSCTL=y 28CONFIG_SYSCTL=y
28# CONFIG_AUDIT is not set 29# CONFIG_AUDIT is not set
29CONFIG_LOG_BUF_SHIFT=14
30CONFIG_HOTPLUG=y 30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y 31CONFIG_KOBJECT_UEVENT=y
32CONFIG_IKCONFIG=y 32CONFIG_IKCONFIG=y
33# CONFIG_IKCONFIG_PROC is not set 33# CONFIG_IKCONFIG_PROC is not set
34CONFIG_EMBEDDED=y 34CONFIG_EMBEDDED=y
35# CONFIG_KALLSYMS is not set 35# CONFIG_KALLSYMS is not set
36CONFIG_PRINTK=y
37CONFIG_BUG=y
38CONFIG_BASE_FULL=y
36# CONFIG_FUTEX is not set 39# CONFIG_FUTEX is not set
37# CONFIG_EPOLL is not set 40# CONFIG_EPOLL is not set
38# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -41,6 +44,7 @@ CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 44CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 45CONFIG_CC_ALIGN_JUMPS=0
43CONFIG_TINY_SHMEM=y 46CONFIG_TINY_SHMEM=y
47CONFIG_BASE_SMALL=0
44 48
45# 49#
46# Loadable module support 50# Loadable module support
@@ -62,6 +66,7 @@ CONFIG_PLAT_MAPPI=y
62# CONFIG_PLAT_OPSPUT is not set 66# CONFIG_PLAT_OPSPUT is not set
63# CONFIG_PLAT_OAKS32R is not set 67# CONFIG_PLAT_OAKS32R is not set
64# CONFIG_PLAT_MAPPI2 is not set 68# CONFIG_PLAT_MAPPI2 is not set
69# CONFIG_PLAT_MAPPI3 is not set
65CONFIG_CHIP_M32700=y 70CONFIG_CHIP_M32700=y
66# CONFIG_CHIP_M32102 is not set 71# CONFIG_CHIP_M32102 is not set
67# CONFIG_CHIP_VDEC2 is not set 72# CONFIG_CHIP_VDEC2 is not set
@@ -202,7 +207,6 @@ CONFIG_NET=y
202# 207#
203CONFIG_PACKET=y 208CONFIG_PACKET=y
204# CONFIG_PACKET_MMAP is not set 209# CONFIG_PACKET_MMAP is not set
205# CONFIG_NETLINK_DEV is not set
206CONFIG_UNIX=y 210CONFIG_UNIX=y
207# CONFIG_NET_KEY is not set 211# CONFIG_NET_KEY is not set
208CONFIG_INET=y 212CONFIG_INET=y
@@ -325,18 +329,6 @@ CONFIG_INPUT=y
325# CONFIG_INPUT_EVBUG is not set 329# CONFIG_INPUT_EVBUG is not set
326 330
327# 331#
328# Input I/O drivers
329#
330# CONFIG_GAMEPORT is not set
331CONFIG_SOUND_GAMEPORT=y
332CONFIG_SERIO=y
333# CONFIG_SERIO_I8042 is not set
334CONFIG_SERIO_SERPORT=y
335# CONFIG_SERIO_CT82C710 is not set
336# CONFIG_SERIO_LIBPS2 is not set
337# CONFIG_SERIO_RAW is not set
338
339#
340# Input Device Drivers 332# Input Device Drivers
341# 333#
342# CONFIG_INPUT_KEYBOARD is not set 334# CONFIG_INPUT_KEYBOARD is not set
@@ -346,6 +338,17 @@ CONFIG_SERIO_SERPORT=y
346# CONFIG_INPUT_MISC is not set 338# CONFIG_INPUT_MISC is not set
347 339
348# 340#
341# Hardware I/O ports
342#
343CONFIG_SERIO=y
344# CONFIG_SERIO_I8042 is not set
345CONFIG_SERIO_SERPORT=y
346# CONFIG_SERIO_LIBPS2 is not set
347# CONFIG_SERIO_RAW is not set
348# CONFIG_GAMEPORT is not set
349CONFIG_SOUND_GAMEPORT=y
350
351#
349# Character devices 352# Character devices
350# 353#
351# CONFIG_VT is not set 354# CONFIG_VT is not set
@@ -394,6 +397,10 @@ CONFIG_LEGACY_PTY_COUNT=256
394# CONFIG_RAW_DRIVER is not set 397# CONFIG_RAW_DRIVER is not set
395 398
396# 399#
400# TPM devices
401#
402
403#
397# I2C support 404# I2C support
398# 405#
399# CONFIG_I2C is not set 406# CONFIG_I2C is not set
@@ -434,10 +441,6 @@ CONFIG_LEGACY_PTY_COUNT=256
434# CONFIG_USB_ARCH_HAS_OHCI is not set 441# CONFIG_USB_ARCH_HAS_OHCI is not set
435 442
436# 443#
437# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
438#
439
440#
441# USB Gadget Support 444# USB Gadget Support
442# 445#
443# CONFIG_USB_GADGET is not set 446# CONFIG_USB_GADGET is not set
@@ -595,8 +598,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
595# 598#
596# Kernel hacking 599# Kernel hacking
597# 600#
601# CONFIG_PRINTK_TIME is not set
598# CONFIG_DEBUG_KERNEL is not set 602# CONFIG_DEBUG_KERNEL is not set
599CONFIG_DEBUG_PREEMPT=y 603CONFIG_LOG_BUF_SHIFT=14
600# CONFIG_DEBUG_BUGVERBOSE is not set 604# CONFIG_DEBUG_BUGVERBOSE is not set
601# CONFIG_FRAME_POINTER is not set 605# CONFIG_FRAME_POINTER is not set
602 606
diff --git a/arch/m32r/mappi/defconfig.smp b/arch/m32r/mappi/defconfig.smp
index 956a8e2f98d6..1a7f3cd42246 100644
--- a/arch/m32r/mappi/defconfig.smp
+++ b/arch/m32r/mappi/defconfig.smp
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc4 3# Linux kernel version: 2.6.12-rc5
4# Wed Feb 16 21:11:02 2005 4# Fri Jun 3 16:21:52 2005
5# 5#
6CONFIG_M32R=y 6CONFIG_M32R=y
7# CONFIG_UID16 is not set 7# CONFIG_UID16 is not set
@@ -17,6 +17,7 @@ CONFIG_EXPERIMENTAL=y
17CONFIG_BROKEN=y 17CONFIG_BROKEN=y
18CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
19CONFIG_LOCK_KERNEL=y 19CONFIG_LOCK_KERNEL=y
20CONFIG_INIT_ENV_ARG_LIMIT=32
20 21
21# 22#
22# General setup 23# General setup
@@ -28,13 +29,16 @@ CONFIG_SYSVIPC=y
28# CONFIG_BSD_PROCESS_ACCT is not set 29# CONFIG_BSD_PROCESS_ACCT is not set
29CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
31CONFIG_LOG_BUF_SHIFT=15
32CONFIG_HOTPLUG=y 32CONFIG_HOTPLUG=y
33CONFIG_KOBJECT_UEVENT=y 33CONFIG_KOBJECT_UEVENT=y
34CONFIG_IKCONFIG=y 34CONFIG_IKCONFIG=y
35CONFIG_IKCONFIG_PROC=y 35CONFIG_IKCONFIG_PROC=y
36# CONFIG_CPUSETS is not set
36CONFIG_EMBEDDED=y 37CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set 38# CONFIG_KALLSYMS is not set
39CONFIG_PRINTK=y
40CONFIG_BUG=y
41CONFIG_BASE_FULL=y
38# CONFIG_FUTEX is not set 42# CONFIG_FUTEX is not set
39# CONFIG_EPOLL is not set 43# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -44,6 +48,7 @@ CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0 48CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0 49CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 50# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0
47 52
48# 53#
49# Loadable module support 54# Loadable module support
@@ -66,6 +71,7 @@ CONFIG_PLAT_MAPPI=y
66# CONFIG_PLAT_OPSPUT is not set 71# CONFIG_PLAT_OPSPUT is not set
67# CONFIG_PLAT_OAKS32R is not set 72# CONFIG_PLAT_OAKS32R is not set
68# CONFIG_PLAT_MAPPI2 is not set 73# CONFIG_PLAT_MAPPI2 is not set
74# CONFIG_PLAT_MAPPI3 is not set
69CONFIG_CHIP_M32700=y 75CONFIG_CHIP_M32700=y
70# CONFIG_CHIP_M32102 is not set 76# CONFIG_CHIP_M32102 is not set
71# CONFIG_CHIP_VDEC2 is not set 77# CONFIG_CHIP_VDEC2 is not set
@@ -139,8 +145,8 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
139# 145#
140CONFIG_MTD=y 146CONFIG_MTD=y
141# CONFIG_MTD_DEBUG is not set 147# CONFIG_MTD_DEBUG is not set
142CONFIG_MTD_PARTITIONS=y
143# CONFIG_MTD_CONCAT is not set 148# CONFIG_MTD_CONCAT is not set
149CONFIG_MTD_PARTITIONS=y
144CONFIG_MTD_REDBOOT_PARTS=y 150CONFIG_MTD_REDBOOT_PARTS=y
145CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 151CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
146# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set 152# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
@@ -294,7 +300,6 @@ CONFIG_NET=y
294# Networking options 300# Networking options
295# 301#
296# CONFIG_PACKET is not set 302# CONFIG_PACKET is not set
297# CONFIG_NETLINK_DEV is not set
298CONFIG_UNIX=y 303CONFIG_UNIX=y
299# CONFIG_NET_KEY is not set 304# CONFIG_NET_KEY is not set
300CONFIG_INET=y 305CONFIG_INET=y
@@ -420,18 +425,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
420# CONFIG_INPUT_EVBUG is not set 425# CONFIG_INPUT_EVBUG is not set
421 426
422# 427#
423# Input I/O drivers
424#
425# CONFIG_GAMEPORT is not set
426CONFIG_SOUND_GAMEPORT=y
427CONFIG_SERIO=y
428# CONFIG_SERIO_I8042 is not set
429# CONFIG_SERIO_SERPORT is not set
430# CONFIG_SERIO_CT82C710 is not set
431# CONFIG_SERIO_LIBPS2 is not set
432# CONFIG_SERIO_RAW is not set
433
434#
435# Input Device Drivers 428# Input Device Drivers
436# 429#
437# CONFIG_INPUT_KEYBOARD is not set 430# CONFIG_INPUT_KEYBOARD is not set
@@ -441,6 +434,17 @@ CONFIG_SERIO=y
441# CONFIG_INPUT_MISC is not set 434# CONFIG_INPUT_MISC is not set
442 435
443# 436#
437# Hardware I/O ports
438#
439CONFIG_SERIO=y
440# CONFIG_SERIO_I8042 is not set
441# CONFIG_SERIO_SERPORT is not set
442# CONFIG_SERIO_LIBPS2 is not set
443# CONFIG_SERIO_RAW is not set
444# CONFIG_GAMEPORT is not set
445CONFIG_SOUND_GAMEPORT=y
446
447#
444# Character devices 448# Character devices
445# 449#
446# CONFIG_VT is not set 450# CONFIG_VT is not set
@@ -489,6 +493,10 @@ CONFIG_LEGACY_PTY_COUNT=256
489# CONFIG_RAW_DRIVER is not set 493# CONFIG_RAW_DRIVER is not set
490 494
491# 495#
496# TPM devices
497#
498
499#
492# I2C support 500# I2C support
493# 501#
494# CONFIG_I2C is not set 502# CONFIG_I2C is not set
@@ -529,10 +537,6 @@ CONFIG_LEGACY_PTY_COUNT=256
529# CONFIG_USB_ARCH_HAS_OHCI is not set 537# CONFIG_USB_ARCH_HAS_OHCI is not set
530 538
531# 539#
532# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
533#
534
535#
536# USB Gadget Support 540# USB Gadget Support
537# 541#
538# CONFIG_USB_GADGET is not set 542# CONFIG_USB_GADGET is not set
@@ -708,8 +712,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
708# 712#
709# Kernel hacking 713# Kernel hacking
710# 714#
715# CONFIG_PRINTK_TIME is not set
711# CONFIG_DEBUG_KERNEL is not set 716# CONFIG_DEBUG_KERNEL is not set
712CONFIG_DEBUG_PREEMPT=y 717CONFIG_LOG_BUF_SHIFT=15
713# CONFIG_DEBUG_BUGVERBOSE is not set 718# CONFIG_DEBUG_BUGVERBOSE is not set
714# CONFIG_FRAME_POINTER is not set 719# CONFIG_FRAME_POINTER is not set
715 720
diff --git a/arch/m32r/mappi/defconfig.up b/arch/m32r/mappi/defconfig.up
index c9253e94efbd..38910fb76692 100644
--- a/arch/m32r/mappi/defconfig.up
+++ b/arch/m32r/mappi/defconfig.up
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc4 3# Linux kernel version: 2.6.12-rc5
4# Wed Feb 16 21:11:07 2005 4# Fri Jun 3 16:21:59 2005
5# 5#
6CONFIG_M32R=y 6CONFIG_M32R=y
7# CONFIG_UID16 is not set 7# CONFIG_UID16 is not set
@@ -17,6 +17,7 @@ CONFIG_EXPERIMENTAL=y
17CONFIG_BROKEN=y 17CONFIG_BROKEN=y
18CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
19CONFIG_LOCK_KERNEL=y 19CONFIG_LOCK_KERNEL=y
20CONFIG_INIT_ENV_ARG_LIMIT=32
20 21
21# 22#
22# General setup 23# General setup
@@ -28,13 +29,15 @@ CONFIG_SYSVIPC=y
28# CONFIG_BSD_PROCESS_ACCT is not set 29# CONFIG_BSD_PROCESS_ACCT is not set
29CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
31CONFIG_LOG_BUF_SHIFT=14
32CONFIG_HOTPLUG=y 32CONFIG_HOTPLUG=y
33CONFIG_KOBJECT_UEVENT=y 33CONFIG_KOBJECT_UEVENT=y
34CONFIG_IKCONFIG=y 34CONFIG_IKCONFIG=y
35CONFIG_IKCONFIG_PROC=y 35CONFIG_IKCONFIG_PROC=y
36CONFIG_EMBEDDED=y 36CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set 37# CONFIG_KALLSYMS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
40CONFIG_BASE_FULL=y
38# CONFIG_FUTEX is not set 41# CONFIG_FUTEX is not set
39# CONFIG_EPOLL is not set 42# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 43# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -44,6 +47,7 @@ CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0 47CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0 48CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 49# CONFIG_TINY_SHMEM is not set
50CONFIG_BASE_SMALL=0
47 51
48# 52#
49# Loadable module support 53# Loadable module support
@@ -65,6 +69,7 @@ CONFIG_PLAT_MAPPI=y
65# CONFIG_PLAT_OPSPUT is not set 69# CONFIG_PLAT_OPSPUT is not set
66# CONFIG_PLAT_OAKS32R is not set 70# CONFIG_PLAT_OAKS32R is not set
67# CONFIG_PLAT_MAPPI2 is not set 71# CONFIG_PLAT_MAPPI2 is not set
72# CONFIG_PLAT_MAPPI3 is not set
68CONFIG_CHIP_M32700=y 73CONFIG_CHIP_M32700=y
69# CONFIG_CHIP_M32102 is not set 74# CONFIG_CHIP_M32102 is not set
70# CONFIG_CHIP_VDEC2 is not set 75# CONFIG_CHIP_VDEC2 is not set
@@ -135,8 +140,8 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
135# 140#
136CONFIG_MTD=y 141CONFIG_MTD=y
137# CONFIG_MTD_DEBUG is not set 142# CONFIG_MTD_DEBUG is not set
138CONFIG_MTD_PARTITIONS=y
139# CONFIG_MTD_CONCAT is not set 143# CONFIG_MTD_CONCAT is not set
144CONFIG_MTD_PARTITIONS=y
140CONFIG_MTD_REDBOOT_PARTS=y 145CONFIG_MTD_REDBOOT_PARTS=y
141CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 146CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
142# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set 147# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
@@ -290,7 +295,6 @@ CONFIG_NET=y
290# Networking options 295# Networking options
291# 296#
292# CONFIG_PACKET is not set 297# CONFIG_PACKET is not set
293# CONFIG_NETLINK_DEV is not set
294CONFIG_UNIX=y 298CONFIG_UNIX=y
295# CONFIG_NET_KEY is not set 299# CONFIG_NET_KEY is not set
296CONFIG_INET=y 300CONFIG_INET=y
@@ -416,18 +420,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
416# CONFIG_INPUT_EVBUG is not set 420# CONFIG_INPUT_EVBUG is not set
417 421
418# 422#
419# Input I/O drivers
420#
421# CONFIG_GAMEPORT is not set
422CONFIG_SOUND_GAMEPORT=y
423CONFIG_SERIO=y
424# CONFIG_SERIO_I8042 is not set
425# CONFIG_SERIO_SERPORT is not set
426# CONFIG_SERIO_CT82C710 is not set
427# CONFIG_SERIO_LIBPS2 is not set
428# CONFIG_SERIO_RAW is not set
429
430#
431# Input Device Drivers 423# Input Device Drivers
432# 424#
433# CONFIG_INPUT_KEYBOARD is not set 425# CONFIG_INPUT_KEYBOARD is not set
@@ -437,6 +429,17 @@ CONFIG_SERIO=y
437# CONFIG_INPUT_MISC is not set 429# CONFIG_INPUT_MISC is not set
438 430
439# 431#
432# Hardware I/O ports
433#
434CONFIG_SERIO=y
435# CONFIG_SERIO_I8042 is not set
436# CONFIG_SERIO_SERPORT is not set
437# CONFIG_SERIO_LIBPS2 is not set
438# CONFIG_SERIO_RAW is not set
439# CONFIG_GAMEPORT is not set
440CONFIG_SOUND_GAMEPORT=y
441
442#
440# Character devices 443# Character devices
441# 444#
442# CONFIG_VT is not set 445# CONFIG_VT is not set
@@ -485,6 +488,10 @@ CONFIG_LEGACY_PTY_COUNT=256
485# CONFIG_RAW_DRIVER is not set 488# CONFIG_RAW_DRIVER is not set
486 489
487# 490#
491# TPM devices
492#
493
494#
488# I2C support 495# I2C support
489# 496#
490# CONFIG_I2C is not set 497# CONFIG_I2C is not set
@@ -525,10 +532,6 @@ CONFIG_LEGACY_PTY_COUNT=256
525# CONFIG_USB_ARCH_HAS_OHCI is not set 532# CONFIG_USB_ARCH_HAS_OHCI is not set
526 533
527# 534#
528# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
529#
530
531#
532# USB Gadget Support 535# USB Gadget Support
533# 536#
534# CONFIG_USB_GADGET is not set 537# CONFIG_USB_GADGET is not set
@@ -704,8 +707,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
704# 707#
705# Kernel hacking 708# Kernel hacking
706# 709#
710# CONFIG_PRINTK_TIME is not set
707# CONFIG_DEBUG_KERNEL is not set 711# CONFIG_DEBUG_KERNEL is not set
708CONFIG_DEBUG_PREEMPT=y 712CONFIG_LOG_BUF_SHIFT=14
709# CONFIG_DEBUG_BUGVERBOSE is not set 713# CONFIG_DEBUG_BUGVERBOSE is not set
710# CONFIG_FRAME_POINTER is not set 714# CONFIG_FRAME_POINTER is not set
711 715
diff --git a/arch/m32r/mappi2/defconfig.vdec2 b/arch/m32r/mappi2/defconfig.vdec2
index c14791d27300..56f287b65898 100644
--- a/arch/m32r/mappi2/defconfig.vdec2
+++ b/arch/m32r/mappi2/defconfig.vdec2
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc4 3# Linux kernel version: 2.6.12-rc5
4# Wed Feb 16 21:11:10 2005 4# Fri Jun 3 16:22:02 2005
5# 5#
6CONFIG_M32R=y 6CONFIG_M32R=y
7# CONFIG_UID16 is not set 7# CONFIG_UID16 is not set
@@ -16,6 +16,7 @@ CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y 16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
18CONFIG_LOCK_KERNEL=y 18CONFIG_LOCK_KERNEL=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
19 20
20# 21#
21# General setup 22# General setup
@@ -28,13 +29,15 @@ CONFIG_BSD_PROCESS_ACCT=y
28# CONFIG_BSD_PROCESS_ACCT_V3 is not set 29# CONFIG_BSD_PROCESS_ACCT_V3 is not set
29CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
31CONFIG_LOG_BUF_SHIFT=14
32CONFIG_HOTPLUG=y 32CONFIG_HOTPLUG=y
33CONFIG_KOBJECT_UEVENT=y 33CONFIG_KOBJECT_UEVENT=y
34CONFIG_IKCONFIG=y 34CONFIG_IKCONFIG=y
35# CONFIG_IKCONFIG_PROC is not set 35# CONFIG_IKCONFIG_PROC is not set
36CONFIG_EMBEDDED=y 36CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set 37# CONFIG_KALLSYMS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
40CONFIG_BASE_FULL=y
38# CONFIG_FUTEX is not set 41# CONFIG_FUTEX is not set
39# CONFIG_EPOLL is not set 42# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 43# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -44,6 +47,7 @@ CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0 47CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0 48CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 49# CONFIG_TINY_SHMEM is not set
50CONFIG_BASE_SMALL=0
47 51
48# 52#
49# Loadable module support 53# Loadable module support
@@ -65,6 +69,7 @@ CONFIG_KMOD=y
65# CONFIG_PLAT_OPSPUT is not set 69# CONFIG_PLAT_OPSPUT is not set
66# CONFIG_PLAT_OAKS32R is not set 70# CONFIG_PLAT_OAKS32R is not set
67CONFIG_PLAT_MAPPI2=y 71CONFIG_PLAT_MAPPI2=y
72# CONFIG_PLAT_MAPPI3 is not set
68# CONFIG_CHIP_M32700 is not set 73# CONFIG_CHIP_M32700 is not set
69# CONFIG_CHIP_M32102 is not set 74# CONFIG_CHIP_M32102 is not set
70CONFIG_CHIP_VDEC2=y 75CONFIG_CHIP_VDEC2=y
@@ -264,7 +269,6 @@ CONFIG_NET=y
264# 269#
265CONFIG_PACKET=y 270CONFIG_PACKET=y
266# CONFIG_PACKET_MMAP is not set 271# CONFIG_PACKET_MMAP is not set
267# CONFIG_NETLINK_DEV is not set
268CONFIG_UNIX=y 272CONFIG_UNIX=y
269# CONFIG_NET_KEY is not set 273# CONFIG_NET_KEY is not set
270CONFIG_INET=y 274CONFIG_INET=y
@@ -389,18 +393,6 @@ CONFIG_INPUT=y
389# CONFIG_INPUT_EVBUG is not set 393# CONFIG_INPUT_EVBUG is not set
390 394
391# 395#
392# Input I/O drivers
393#
394# CONFIG_GAMEPORT is not set
395CONFIG_SOUND_GAMEPORT=y
396CONFIG_SERIO=y
397# CONFIG_SERIO_I8042 is not set
398CONFIG_SERIO_SERPORT=y
399# CONFIG_SERIO_CT82C710 is not set
400# CONFIG_SERIO_LIBPS2 is not set
401# CONFIG_SERIO_RAW is not set
402
403#
404# Input Device Drivers 396# Input Device Drivers
405# 397#
406# CONFIG_INPUT_KEYBOARD is not set 398# CONFIG_INPUT_KEYBOARD is not set
@@ -410,6 +402,17 @@ CONFIG_SERIO_SERPORT=y
410# CONFIG_INPUT_MISC is not set 402# CONFIG_INPUT_MISC is not set
411 403
412# 404#
405# Hardware I/O ports
406#
407CONFIG_SERIO=y
408# CONFIG_SERIO_I8042 is not set
409CONFIG_SERIO_SERPORT=y
410# CONFIG_SERIO_LIBPS2 is not set
411# CONFIG_SERIO_RAW is not set
412# CONFIG_GAMEPORT is not set
413CONFIG_SOUND_GAMEPORT=y
414
415#
413# Character devices 416# Character devices
414# 417#
415CONFIG_VT=y 418CONFIG_VT=y
@@ -460,6 +463,10 @@ CONFIG_LEGACY_PTY_COUNT=256
460# CONFIG_RAW_DRIVER is not set 463# CONFIG_RAW_DRIVER is not set
461 464
462# 465#
466# TPM devices
467#
468
469#
463# I2C support 470# I2C support
464# 471#
465# CONFIG_I2C is not set 472# CONFIG_I2C is not set
@@ -521,10 +528,6 @@ CONFIG_DUMMY_CONSOLE=y
521# CONFIG_USB_ARCH_HAS_OHCI is not set 528# CONFIG_USB_ARCH_HAS_OHCI is not set
522 529
523# 530#
524# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
525#
526
527#
528# USB Gadget Support 531# USB Gadget Support
529# 532#
530# CONFIG_USB_GADGET is not set 533# CONFIG_USB_GADGET is not set
@@ -697,8 +700,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
697# 700#
698# Kernel hacking 701# Kernel hacking
699# 702#
703# CONFIG_PRINTK_TIME is not set
700# CONFIG_DEBUG_KERNEL is not set 704# CONFIG_DEBUG_KERNEL is not set
701CONFIG_DEBUG_PREEMPT=y 705CONFIG_LOG_BUF_SHIFT=14
702# CONFIG_DEBUG_BUGVERBOSE is not set 706# CONFIG_DEBUG_BUGVERBOSE is not set
703# CONFIG_FRAME_POINTER is not set 707# CONFIG_FRAME_POINTER is not set
704 708
diff --git a/arch/m32r/mappi3/defconfig.smp b/arch/m32r/mappi3/defconfig.smp
new file mode 100644
index 000000000000..2eebe75fc071
--- /dev/null
+++ b/arch/m32r/mappi3/defconfig.smp
@@ -0,0 +1,751 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc5
4# Tue May 31 17:55:34 2005
5#
6CONFIG_M32R=y
7# CONFIG_UID16 is not set
8CONFIG_GENERIC_ISA_DMA=y
9CONFIG_GENERIC_HARDIRQS=y
10CONFIG_GENERIC_IRQ_PROBE=y
11
12#
13# Code maturity level options
14#
15CONFIG_EXPERIMENTAL=y
16# CONFIG_CLEAN_COMPILE is not set
17CONFIG_BROKEN=y
18CONFIG_BROKEN_ON_SMP=y
19CONFIG_LOCK_KERNEL=y
20CONFIG_INIT_ENV_ARG_LIMIT=32
21
22#
23# General setup
24#
25CONFIG_LOCALVERSION=""
26CONFIG_SWAP=y
27CONFIG_SYSVIPC=y
28# CONFIG_POSIX_MQUEUE is not set
29# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set
32CONFIG_HOTPLUG=y
33CONFIG_KOBJECT_UEVENT=y
34CONFIG_IKCONFIG=y
35CONFIG_IKCONFIG_PROC=y
36# CONFIG_CPUSETS is not set
37CONFIG_EMBEDDED=y
38# CONFIG_KALLSYMS is not set
39CONFIG_PRINTK=y
40CONFIG_BUG=y
41CONFIG_BASE_FULL=y
42# CONFIG_FUTEX is not set
43# CONFIG_EPOLL is not set
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0
50# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0
52
53#
54# Loadable module support
55#
56CONFIG_MODULES=y
57CONFIG_MODULE_UNLOAD=y
58# CONFIG_MODULE_FORCE_UNLOAD is not set
59CONFIG_OBSOLETE_MODPARM=y
60# CONFIG_MODVERSIONS is not set
61# CONFIG_MODULE_SRCVERSION_ALL is not set
62CONFIG_KMOD=y
63CONFIG_STOP_MACHINE=y
64
65#
66# Processor type and features
67#
68# CONFIG_PLAT_MAPPI is not set
69# CONFIG_PLAT_USRV is not set
70# CONFIG_PLAT_M32700UT is not set
71# CONFIG_PLAT_OPSPUT is not set
72# CONFIG_PLAT_OAKS32R is not set
73# CONFIG_PLAT_MAPPI2 is not set
74CONFIG_PLAT_MAPPI3=y
75CONFIG_CHIP_M32700=y
76# CONFIG_CHIP_M32102 is not set
77# CONFIG_CHIP_VDEC2 is not set
78# CONFIG_CHIP_OPSP is not set
79CONFIG_MMU=y
80CONFIG_TLB_ENTRIES=32
81CONFIG_ISA_M32R2=y
82CONFIG_ISA_DSP_LEVEL2=y
83CONFIG_ISA_DUAL_ISSUE=y
84CONFIG_BUS_CLOCK=10000000
85CONFIG_TIMER_DIVIDE=128
86# CONFIG_CPU_LITTLE_ENDIAN is not set
87CONFIG_MEMORY_START=0x08000000
88CONFIG_MEMORY_SIZE=0x08000000
89CONFIG_NOHIGHMEM=y
90CONFIG_DISCONTIGMEM=y
91CONFIG_IRAM_START=0x00f00000
92CONFIG_IRAM_SIZE=0x00080000
93CONFIG_RWSEM_GENERIC_SPINLOCK=y
94# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
95CONFIG_GENERIC_CALIBRATE_DELAY=y
96CONFIG_PREEMPT=y
97# CONFIG_HAVE_DEC_LOCK is not set
98CONFIG_SMP=y
99# CONFIG_CHIP_M32700_TS1 is not set
100CONFIG_NR_CPUS=2
101# CONFIG_NUMA is not set
102
103#
104# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
105#
106# CONFIG_PCI is not set
107# CONFIG_ISA is not set
108
109#
110# PCCARD (PCMCIA/CardBus) support
111#
112CONFIG_PCCARD=y
113# CONFIG_PCMCIA_DEBUG is not set
114CONFIG_PCMCIA=y
115
116#
117# PC-card bridges
118#
119# CONFIG_TCIC is not set
120# CONFIG_M32R_PCC is not set
121# CONFIG_M32R_CFC is not set
122
123#
124# PCI Hotplug Support
125#
126
127#
128# Executable file formats
129#
130CONFIG_BINFMT_ELF=y
131# CONFIG_BINFMT_MISC is not set
132
133#
134# Device Drivers
135#
136
137#
138# Generic Driver Options
139#
140CONFIG_STANDALONE=y
141CONFIG_PREVENT_FIRMWARE_BUILD=y
142CONFIG_FW_LOADER=y
143
144#
145# Memory Technology Devices (MTD)
146#
147CONFIG_MTD=y
148# CONFIG_MTD_DEBUG is not set
149# CONFIG_MTD_CONCAT is not set
150CONFIG_MTD_PARTITIONS=y
151CONFIG_MTD_REDBOOT_PARTS=y
152CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
153# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
154# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
155# CONFIG_MTD_CMDLINE_PARTS is not set
156
157#
158# User Modules And Translation Layers
159#
160CONFIG_MTD_CHAR=y
161CONFIG_MTD_BLOCK=y
162# CONFIG_FTL is not set
163# CONFIG_NFTL is not set
164# CONFIG_INFTL is not set
165
166#
167# RAM/ROM/Flash chip drivers
168#
169# CONFIG_MTD_CFI is not set
170# CONFIG_MTD_JEDECPROBE is not set
171CONFIG_MTD_MAP_BANK_WIDTH_1=y
172CONFIG_MTD_MAP_BANK_WIDTH_2=y
173CONFIG_MTD_MAP_BANK_WIDTH_4=y
174# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
175# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
176# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
177CONFIG_MTD_CFI_I1=y
178CONFIG_MTD_CFI_I2=y
179# CONFIG_MTD_CFI_I4 is not set
180# CONFIG_MTD_CFI_I8 is not set
181# CONFIG_MTD_RAM is not set
182# CONFIG_MTD_ROM is not set
183# CONFIG_MTD_ABSENT is not set
184# CONFIG_MTD_OBSOLETE_CHIPS is not set
185
186#
187# Mapping drivers for chip access
188#
189# CONFIG_MTD_COMPLEX_MAPPINGS is not set
190
191#
192# Self-contained MTD device drivers
193#
194# CONFIG_MTD_SLRAM is not set
195# CONFIG_MTD_PHRAM is not set
196# CONFIG_MTD_MTDRAM is not set
197# CONFIG_MTD_BLKMTD is not set
198# CONFIG_MTD_BLOCK2MTD is not set
199
200#
201# Disk-On-Chip Device Drivers
202#
203# CONFIG_MTD_DOC2000 is not set
204# CONFIG_MTD_DOC2001 is not set
205# CONFIG_MTD_DOC2001PLUS is not set
206
207#
208# NAND Flash Device Drivers
209#
210# CONFIG_MTD_NAND is not set
211
212#
213# Parallel port support
214#
215# CONFIG_PARPORT is not set
216
217#
218# Plug and Play support
219#
220
221#
222# Block devices
223#
224# CONFIG_BLK_DEV_FD is not set
225# CONFIG_BLK_DEV_COW_COMMON is not set
226CONFIG_BLK_DEV_LOOP=y
227# CONFIG_BLK_DEV_CRYPTOLOOP is not set
228CONFIG_BLK_DEV_NBD=m
229CONFIG_BLK_DEV_RAM=y
230CONFIG_BLK_DEV_RAM_COUNT=16
231CONFIG_BLK_DEV_RAM_SIZE=4096
232CONFIG_BLK_DEV_INITRD=y
233CONFIG_INITRAMFS_SOURCE=""
234# CONFIG_CDROM_PKTCDVD is not set
235
236#
237# IO Schedulers
238#
239CONFIG_IOSCHED_NOOP=y
240# CONFIG_IOSCHED_AS is not set
241CONFIG_IOSCHED_DEADLINE=y
242CONFIG_IOSCHED_CFQ=y
243# CONFIG_ATA_OVER_ETH is not set
244
245#
246# ATA/ATAPI/MFM/RLL support
247#
248CONFIG_IDE=y
249CONFIG_BLK_DEV_IDE=y
250
251#
252# Please see Documentation/ide.txt for help/info on IDE drives
253#
254# CONFIG_BLK_DEV_IDE_SATA is not set
255CONFIG_BLK_DEV_IDEDISK=y
256# CONFIG_IDEDISK_MULTI_MODE is not set
257CONFIG_BLK_DEV_IDECS=y
258CONFIG_BLK_DEV_IDECD=m
259# CONFIG_BLK_DEV_IDETAPE is not set
260# CONFIG_BLK_DEV_IDEFLOPPY is not set
261# CONFIG_IDE_TASK_IOCTL is not set
262
263#
264# IDE chipset support/bugfixes
265#
266CONFIG_IDE_GENERIC=y
267# CONFIG_IDE_ARM is not set
268# CONFIG_BLK_DEV_IDEDMA is not set
269# CONFIG_IDEDMA_AUTO is not set
270# CONFIG_BLK_DEV_HD is not set
271
272#
273# SCSI device support
274#
275# CONFIG_SCSI is not set
276
277#
278# Multi-device support (RAID and LVM)
279#
280# CONFIG_MD is not set
281
282#
283# Fusion MPT device support
284#
285
286#
287# IEEE 1394 (FireWire) support
288#
289# CONFIG_IEEE1394 is not set
290
291#
292# I2O device support
293#
294
295#
296# Networking support
297#
298CONFIG_NET=y
299
300#
301# Networking options
302#
303# CONFIG_PACKET is not set
304CONFIG_UNIX=y
305# CONFIG_NET_KEY is not set
306CONFIG_INET=y
307# CONFIG_IP_MULTICAST is not set
308# CONFIG_IP_ADVANCED_ROUTER is not set
309CONFIG_IP_PNP=y
310CONFIG_IP_PNP_DHCP=y
311# CONFIG_IP_PNP_BOOTP is not set
312# CONFIG_IP_PNP_RARP is not set
313# CONFIG_NET_IPIP is not set
314# CONFIG_NET_IPGRE is not set
315# CONFIG_ARPD is not set
316# CONFIG_SYN_COOKIES is not set
317# CONFIG_INET_AH is not set
318# CONFIG_INET_ESP is not set
319# CONFIG_INET_IPCOMP is not set
320# CONFIG_INET_TUNNEL is not set
321CONFIG_IP_TCPDIAG=y
322# CONFIG_IP_TCPDIAG_IPV6 is not set
323# CONFIG_IPV6 is not set
324# CONFIG_NETFILTER is not set
325
326#
327# SCTP Configuration (EXPERIMENTAL)
328#
329# CONFIG_IP_SCTP is not set
330# CONFIG_ATM is not set
331# CONFIG_BRIDGE is not set
332# CONFIG_VLAN_8021Q is not set
333# CONFIG_DECNET is not set
334# CONFIG_LLC2 is not set
335# CONFIG_IPX is not set
336# CONFIG_ATALK is not set
337# CONFIG_X25 is not set
338# CONFIG_LAPB is not set
339# CONFIG_NET_DIVERT is not set
340# CONFIG_ECONET is not set
341# CONFIG_WAN_ROUTER is not set
342
343#
344# QoS and/or fair queueing
345#
346# CONFIG_NET_SCHED is not set
347# CONFIG_NET_CLS_ROUTE is not set
348
349#
350# Network testing
351#
352# CONFIG_NET_PKTGEN is not set
353# CONFIG_NETPOLL is not set
354# CONFIG_NET_POLL_CONTROLLER is not set
355# CONFIG_HAMRADIO is not set
356# CONFIG_IRDA is not set
357# CONFIG_BT is not set
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# Ethernet (10 or 100Mbit)
366#
367CONFIG_NET_ETHERNET=y
368CONFIG_MII=y
369CONFIG_SMC91X=y
370# CONFIG_NE2000 is not set
371
372#
373# Ethernet (1000 Mbit)
374#
375
376#
377# Ethernet (10000 Mbit)
378#
379
380#
381# Token Ring devices
382#
383
384#
385# Wireless LAN (non-hamradio)
386#
387# CONFIG_NET_RADIO is not set
388
389#
390# PCMCIA network device support
391#
392# CONFIG_NET_PCMCIA is not set
393
394#
395# Wan interfaces
396#
397# CONFIG_WAN is not set
398# CONFIG_PPP is not set
399# CONFIG_SLIP is not set
400# CONFIG_SHAPER is not set
401# CONFIG_NETCONSOLE is not set
402
403#
404# ISDN subsystem
405#
406# CONFIG_ISDN is not set
407
408#
409# Telephony Support
410#
411# CONFIG_PHONE is not set
412
413#
414# Input device support
415#
416CONFIG_INPUT=y
417
418#
419# Userland interfaces
420#
421CONFIG_INPUT_MOUSEDEV=y
422CONFIG_INPUT_MOUSEDEV_PSAUX=y
423CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
424CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
425# CONFIG_INPUT_JOYDEV is not set
426# CONFIG_INPUT_TSDEV is not set
427# CONFIG_INPUT_EVDEV is not set
428# CONFIG_INPUT_EVBUG is not set
429
430#
431# Input Device Drivers
432#
433# CONFIG_INPUT_KEYBOARD is not set
434# CONFIG_INPUT_MOUSE is not set
435# CONFIG_INPUT_JOYSTICK is not set
436# CONFIG_INPUT_TOUCHSCREEN is not set
437# CONFIG_INPUT_MISC is not set
438
439#
440# Hardware I/O ports
441#
442CONFIG_SERIO=y
443# CONFIG_SERIO_I8042 is not set
444# CONFIG_SERIO_SERPORT is not set
445# CONFIG_SERIO_LIBPS2 is not set
446# CONFIG_SERIO_RAW is not set
447# CONFIG_GAMEPORT is not set
448CONFIG_SOUND_GAMEPORT=y
449
450#
451# Character devices
452#
453# CONFIG_VT is not set
454# CONFIG_SERIAL_NONSTANDARD is not set
455
456#
457# Serial drivers
458#
459# CONFIG_SERIAL_8250 is not set
460
461#
462# Non-8250 serial port support
463#
464CONFIG_SERIAL_CORE=y
465CONFIG_SERIAL_CORE_CONSOLE=y
466CONFIG_SERIAL_M32R_SIO=y
467CONFIG_SERIAL_M32R_SIO_CONSOLE=y
468# CONFIG_SERIAL_M32R_PLDSIO is not set
469CONFIG_UNIX98_PTYS=y
470CONFIG_LEGACY_PTYS=y
471CONFIG_LEGACY_PTY_COUNT=256
472
473#
474# IPMI
475#
476# CONFIG_IPMI_HANDLER is not set
477
478#
479# Watchdog Cards
480#
481# CONFIG_WATCHDOG is not set
482# CONFIG_RTC is not set
483# CONFIG_GEN_RTC is not set
484# CONFIG_DTLK is not set
485# CONFIG_R3964 is not set
486
487#
488# Ftape, the floppy tape device driver
489#
490# CONFIG_DRM is not set
491
492#
493# PCMCIA character devices
494#
495# CONFIG_SYNCLINK_CS is not set
496# CONFIG_RAW_DRIVER is not set
497
498#
499# TPM devices
500#
501
502#
503# I2C support
504#
505# CONFIG_I2C is not set
506
507#
508# Dallas's 1-wire bus
509#
510# CONFIG_W1 is not set
511
512#
513# Misc devices
514#
515
516#
517# Multimedia devices
518#
519# CONFIG_VIDEO_DEV is not set
520
521#
522# Digital Video Broadcasting Devices
523#
524# CONFIG_DVB is not set
525
526#
527# Graphics support
528#
529# CONFIG_FB is not set
530
531#
532# Sound
533#
534# CONFIG_SOUND is not set
535
536#
537# USB support
538#
539# CONFIG_USB_ARCH_HAS_HCD is not set
540# CONFIG_USB_ARCH_HAS_OHCI is not set
541
542#
543# USB Gadget Support
544#
545# CONFIG_USB_GADGET is not set
546
547#
548# MMC/SD Card support
549#
550# CONFIG_MMC is not set
551
552#
553# InfiniBand support
554#
555# CONFIG_INFINIBAND is not set
556
557#
558# File systems
559#
560CONFIG_EXT2_FS=y
561# CONFIG_EXT2_FS_XATTR is not set
562CONFIG_EXT3_FS=y
563CONFIG_EXT3_FS_XATTR=y
564# CONFIG_EXT3_FS_POSIX_ACL is not set
565# CONFIG_EXT3_FS_SECURITY is not set
566CONFIG_JBD=y
567# CONFIG_JBD_DEBUG is not set
568CONFIG_FS_MBCACHE=y
569# CONFIG_REISERFS_FS is not set
570# CONFIG_JFS_FS is not set
571
572#
573# XFS support
574#
575# CONFIG_XFS_FS is not set
576# CONFIG_MINIX_FS is not set
577CONFIG_ROMFS_FS=y
578# CONFIG_QUOTA is not set
579CONFIG_DNOTIFY=y
580# CONFIG_AUTOFS_FS is not set
581# CONFIG_AUTOFS4_FS is not set
582
583#
584# CD-ROM/DVD Filesystems
585#
586CONFIG_ISO9660_FS=y
587# CONFIG_JOLIET is not set
588# CONFIG_ZISOFS is not set
589# CONFIG_UDF_FS is not set
590
591#
592# DOS/FAT/NT Filesystems
593#
594CONFIG_FAT_FS=m
595CONFIG_MSDOS_FS=m
596CONFIG_VFAT_FS=m
597CONFIG_FAT_DEFAULT_CODEPAGE=437
598CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
599# CONFIG_NTFS_FS is not set
600
601#
602# Pseudo filesystems
603#
604CONFIG_PROC_FS=y
605CONFIG_PROC_KCORE=y
606CONFIG_SYSFS=y
607CONFIG_DEVFS_FS=y
608CONFIG_DEVFS_MOUNT=y
609# CONFIG_DEVFS_DEBUG is not set
610# CONFIG_DEVPTS_FS_XATTR is not set
611CONFIG_TMPFS=y
612# CONFIG_TMPFS_XATTR is not set
613# CONFIG_HUGETLBFS is not set
614# CONFIG_HUGETLB_PAGE is not set
615CONFIG_RAMFS=y
616
617#
618# Miscellaneous filesystems
619#
620# CONFIG_ADFS_FS is not set
621# CONFIG_AFFS_FS is not set
622# CONFIG_HFS_FS is not set
623# CONFIG_HFSPLUS_FS is not set
624# CONFIG_BEFS_FS is not set
625# CONFIG_BFS_FS is not set
626# CONFIG_EFS_FS is not set
627CONFIG_JFFS_FS=y
628CONFIG_JFFS_FS_VERBOSE=0
629CONFIG_JFFS_PROC_FS=y
630CONFIG_JFFS2_FS=y
631CONFIG_JFFS2_FS_DEBUG=0
632# CONFIG_JFFS2_FS_NAND is not set
633# CONFIG_JFFS2_FS_NOR_ECC is not set
634# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
635CONFIG_JFFS2_ZLIB=y
636CONFIG_JFFS2_RTIME=y
637# CONFIG_JFFS2_RUBIN is not set
638# CONFIG_CRAMFS is not set
639# CONFIG_VXFS_FS is not set
640# CONFIG_HPFS_FS is not set
641# CONFIG_QNX4FS_FS is not set
642# CONFIG_SYSV_FS is not set
643# CONFIG_UFS_FS is not set
644
645#
646# Network File Systems
647#
648CONFIG_NFS_FS=y
649CONFIG_NFS_V3=y
650# CONFIG_NFS_V4 is not set
651# CONFIG_NFS_DIRECTIO is not set
652# CONFIG_NFSD is not set
653CONFIG_ROOT_NFS=y
654CONFIG_LOCKD=y
655CONFIG_LOCKD_V4=y
656CONFIG_SUNRPC=y
657# CONFIG_RPCSEC_GSS_KRB5 is not set
658# CONFIG_RPCSEC_GSS_SPKM3 is not set
659# CONFIG_SMB_FS is not set
660# CONFIG_CIFS is not set
661# CONFIG_NCP_FS is not set
662# CONFIG_CODA_FS is not set
663# CONFIG_AFS_FS is not set
664
665#
666# Partition Types
667#
668# CONFIG_PARTITION_ADVANCED is not set
669CONFIG_MSDOS_PARTITION=y
670
671#
672# Native Language Support
673#
674CONFIG_NLS=y
675CONFIG_NLS_DEFAULT="iso8859-1"
676# CONFIG_NLS_CODEPAGE_437 is not set
677# CONFIG_NLS_CODEPAGE_737 is not set
678# CONFIG_NLS_CODEPAGE_775 is not set
679# CONFIG_NLS_CODEPAGE_850 is not set
680# CONFIG_NLS_CODEPAGE_852 is not set
681# CONFIG_NLS_CODEPAGE_855 is not set
682# CONFIG_NLS_CODEPAGE_857 is not set
683# CONFIG_NLS_CODEPAGE_860 is not set
684# CONFIG_NLS_CODEPAGE_861 is not set
685# CONFIG_NLS_CODEPAGE_862 is not set
686# CONFIG_NLS_CODEPAGE_863 is not set
687# CONFIG_NLS_CODEPAGE_864 is not set
688# CONFIG_NLS_CODEPAGE_865 is not set
689# CONFIG_NLS_CODEPAGE_866 is not set
690# CONFIG_NLS_CODEPAGE_869 is not set
691# CONFIG_NLS_CODEPAGE_936 is not set
692# CONFIG_NLS_CODEPAGE_950 is not set
693# CONFIG_NLS_CODEPAGE_932 is not set
694# CONFIG_NLS_CODEPAGE_949 is not set
695# CONFIG_NLS_CODEPAGE_874 is not set
696# CONFIG_NLS_ISO8859_8 is not set
697# CONFIG_NLS_CODEPAGE_1250 is not set
698# CONFIG_NLS_CODEPAGE_1251 is not set
699# CONFIG_NLS_ASCII is not set
700# CONFIG_NLS_ISO8859_1 is not set
701# CONFIG_NLS_ISO8859_2 is not set
702# CONFIG_NLS_ISO8859_3 is not set
703# CONFIG_NLS_ISO8859_4 is not set
704# CONFIG_NLS_ISO8859_5 is not set
705# CONFIG_NLS_ISO8859_6 is not set
706# CONFIG_NLS_ISO8859_7 is not set
707# CONFIG_NLS_ISO8859_9 is not set
708# CONFIG_NLS_ISO8859_13 is not set
709# CONFIG_NLS_ISO8859_14 is not set
710# CONFIG_NLS_ISO8859_15 is not set
711# CONFIG_NLS_KOI8_R is not set
712# CONFIG_NLS_KOI8_U is not set
713# CONFIG_NLS_UTF8 is not set
714
715#
716# Profiling support
717#
718# CONFIG_PROFILING is not set
719
720#
721# Kernel hacking
722#
723# CONFIG_PRINTK_TIME is not set
724# CONFIG_DEBUG_KERNEL is not set
725CONFIG_LOG_BUF_SHIFT=15
726# CONFIG_DEBUG_BUGVERBOSE is not set
727# CONFIG_FRAME_POINTER is not set
728
729#
730# Security options
731#
732# CONFIG_KEYS is not set
733# CONFIG_SECURITY is not set
734
735#
736# Cryptographic options
737#
738# CONFIG_CRYPTO is not set
739
740#
741# Hardware crypto devices
742#
743
744#
745# Library routines
746#
747# CONFIG_CRC_CCITT is not set
748CONFIG_CRC32=y
749# CONFIG_LIBCRC32C is not set
750CONFIG_ZLIB_INFLATE=y
751CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/m32r/mappi3/dot.gdbinit b/arch/m32r/mappi3/dot.gdbinit
new file mode 100644
index 000000000000..89c22184e139
--- /dev/null
+++ b/arch/m32r/mappi3/dot.gdbinit
@@ -0,0 +1,224 @@
1# .gdbinit file
2# $Id: dot.gdbinit,v 1.1 2005/04/11 02:21:08 sakugawa Exp $
3
4# setting
5set width 0d70
6set radix 0d16
7use_debug_dma
8
9# Initialize SDRAM controller for Mappi
10define sdram_init
11 # SDIR0
12 set *(unsigned long *)0x00ef6008 = 0x00000182
13 # SDIR1
14 set *(unsigned long *)0x00ef600c = 0x00000001
15 # Initialize wait
16 shell sleep 0.1
17 # MOD
18 set *(unsigned long *)0x00ef602c = 0x00000020
19 set *(unsigned long *)0x00ef604c = 0x00000020
20 # TR
21 set *(unsigned long *)0x00ef6028 = 0x00051502
22 set *(unsigned long *)0x00ef6048 = 0x00051502
23 # ADR
24 set *(unsigned long *)0x00ef6020 = 0x08000004
25 set *(unsigned long *)0x00ef6040 = 0x0c000004
26 # AutoRef On
27 set *(unsigned long *)0x00ef6004 = 0x00010517
28 # Access enable
29 set *(unsigned long *)0x00ef6024 = 0x00000001
30 set *(unsigned long *)0x00ef6044 = 0x00000001
31end
32
33# Initialize LAN controller for Mappi
34define lanc_init
35 # Set BSEL4
36 #set *(unsigned long *)0x00ef5004 = 0x0fff330f
37 #set *(unsigned long *)0x00ef5004 = 0x01113301
38
39# set *(unsigned long *)0x00ef5004 = 0x02011101
40# set *(unsigned long *)0x00ef5004 = 0x04441104
41end
42
43define clock_init
44 set *(unsigned long *)0x00ef4010 = 2
45 set *(unsigned long *)0x00ef4014 = 2
46 set *(unsigned long *)0x00ef4020 = 3
47 set *(unsigned long *)0x00ef4024 = 3
48 set *(unsigned long *)0x00ef4004 = 0x7
49# shell sleep 0.1
50# set *(unsigned long *)0x00ef4004 = 0x5
51 shell sleep 0.1
52 set *(unsigned long *)0x00ef4008 = 0x0200
53end
54
55define port_init
56 set $sfrbase = 0x00ef0000
57 set *(unsigned short *)0x00ef1060 = 0x5555
58 set *(unsigned short *)0x00ef1062 = 0x5555
59 set *(unsigned short *)0x00ef1064 = 0x5555
60 set *(unsigned short *)0x00ef1066 = 0x5555
61 set *(unsigned short *)0x00ef1068 = 0x5555
62 set *(unsigned short *)0x00ef106a = 0x0000
63 set *(unsigned short *)0x00ef106e = 0x5555
64 set *(unsigned short *)0x00ef1070 = 0x5555
65end
66
67# MMU enable
68define mmu_enable
69 set $evb=0x88000000
70 set *(unsigned long *)0xffff0024=1
71end
72
73# MMU disable
74define mmu_disable
75 set $evb=0
76 set *(unsigned long *)0xffff0024=0
77end
78
79# Show TLB entries
80define show_tlb_entries
81 set $i = 0
82 set $addr = $arg0
83 while ($i < 0d16 )
84 set $tlb_tag = *(unsigned long*)$addr
85 set $tlb_data = *(unsigned long*)($addr + 4)
86 printf " [%2d] 0x%08lx : 0x%08lx - 0x%08lx\n", $i, $addr, $tlb_tag, $tlb_data
87 set $i = $i + 1
88 set $addr = $addr + 8
89 end
90end
91define itlb
92 set $itlb=0xfe000000
93 show_tlb_entries $itlb
94end
95define dtlb
96 set $dtlb=0xfe000800
97 show_tlb_entries $dtlb
98end
99
100# Cache ON
101define set_cache_type
102 set $mctype = (void*)0xfffffff8
103# chaos
104# set *(unsigned long *)($mctype) = 0x0000c000
105# m32102 i-cache only
106 set *(unsigned long *)($mctype) = 0x00008000
107# m32102 d-cache only
108# set *(unsigned long *)($mctype) = 0x00004000
109end
110define cache_on
111 set $param = (void*)0x08001000
112 set *(unsigned long *)($param) = 0x60ff6102
113end
114
115
116# Show current task structure
117define show_current
118 set $current = $spi & 0xffffe000
119 printf "$current=0x%08lX\n",$current
120 print *(struct task_struct *)$current
121end
122
123# Show user assigned task structure
124define show_task
125 set $task = $arg0 & 0xffffe000
126 printf "$task=0x%08lX\n",$task
127 print *(struct task_struct *)$task
128end
129document show_task
130 Show user assigned task structure
131 arg0 : task structure address
132end
133
134# Show M32R registers
135define show_regs
136 printf " R0[0x%08lX] R1[0x%08lX] R2[0x%08lX] R3[0x%08lX]\n",$r0,$r1,$r2,$r3
137 printf " R4[0x%08lX] R5[0x%08lX] R6[0x%08lX] R7[0x%08lX]\n",$r4,$r5,$r6,$r7
138 printf " R8[0x%08lX] R9[0x%08lX] R10[0x%08lX] R11[0x%08lX]\n",$r8,$r9,$r10,$r11
139 printf "R12[0x%08lX] FP[0x%08lX] LR[0x%08lX] SP[0x%08lX]\n",$r12,$fp,$lr,$sp
140 printf "PSW[0x%08lX] CBR[0x%08lX] SPI[0x%08lX] SPU[0x%08lX]\n",$psw,$cbr,$spi,$spu
141 printf "BPC[0x%08lX] PC[0x%08lX] ACCL[0x%08lX] ACCH[0x%08lX]\n",$bpc,$pc,$accl,$acch
142 printf "EVB[0x%08lX]\n",$evb
143
144 set $mests = *(unsigned long *)0xffff000c
145 set $mdeva = *(unsigned long *)0xffff0010
146 printf "MESTS[0x%08lX] MDEVA[0x%08lX]\n",$mests,$mdeva
147end
148
149
150# Setup all
151define setup
152 clock_init
153 shell sleep 0.1
154 port_init
155 sdram_init
156# lanc_init
157# dispc_init
158# set $evb=0x08000000
159end
160
161# Load modules
162define load_modules
163 use_debug_dma
164 load
165# load busybox.mot
166end
167
168# Set kernel parameters
169define set_kernel_parameters
170 set $param = (void*)0x08001000
171
172 ## MOUNT_ROOT_RDONLY
173 set {long}($param+0x00)=0
174 ## RAMDISK_FLAGS
175 #set {long}($param+0x04)=0
176 ## ORIG_ROOT_DEV
177 #set {long}($param+0x08)=0x00000100
178 ## LOADER_TYPE
179 #set {long}($param+0x0C)=0
180 ## INITRD_START
181 set {long}($param+0x10)=0x082a0000
182 ## INITRD_SIZE
183 set {long}($param+0x14)=0d6200000
184
185 # M32R_CPUCLK
186 set *(unsigned long *)($param + 0x0018) = 0d100000000
187 # M32R_BUSCLK
188 set *(unsigned long *)($param + 0x001c) = 0d50000000
189 # M32R_TIMER_DIVIDE
190 set *(unsigned long *)($param + 0x0020) = 0d128
191
192
193 set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/root.2.6_04 nfsaddrs=192.168.0.102:192.168.0.1:192.168.0.1:255.255.255.0:mappi: \0"
194
195
196end
197
198# Boot
199define boot
200 set_kernel_parameters
201 debug_chaos
202 set *(unsigned long *)0x00f00000=0x08002000
203 set $pc=0x08002000
204 set $fp=0
205 del b
206 si
207end
208
209# Restart
210define restart
211 sdireset
212 sdireset
213 setup
214 load_modules
215 boot
216end
217
218sdireset
219sdireset
220file vmlinux
221target m32rsdi
222
223restart
224boot
diff --git a/arch/m32r/mm/extable.c b/arch/m32r/mm/extable.c
index 9a97363b6524..1743f23d49a3 100644
--- a/arch/m32r/mm/extable.c
+++ b/arch/m32r/mm/extable.c
@@ -1,10 +1,8 @@
1/* 1/*
2 * linux/arch/i386/mm/extable.c 2 * linux/arch/m32r/mm/extable.c
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <linux/module.h> 5#include <linux/module.h>
7#include <linux/spinlock.h>
8#include <asm/uaccess.h> 6#include <asm/uaccess.h>
9 7
10int fixup_exception(struct pt_regs *regs) 8int fixup_exception(struct pt_regs *regs)
@@ -19,4 +17,3 @@ int fixup_exception(struct pt_regs *regs)
19 17
20 return 0; 18 return 0;
21} 19}
22
diff --git a/arch/m32r/oaks32r/defconfig.nommu b/arch/m32r/oaks32r/defconfig.nommu
index f2da9be726e5..3f9fe519acb2 100644
--- a/arch/m32r/oaks32r/defconfig.nommu
+++ b/arch/m32r/oaks32r/defconfig.nommu
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc4 3# Linux kernel version: 2.6.12-rc5
4# Wed Feb 16 21:11:13 2005 4# Fri Jun 3 16:22:04 2005
5# 5#
6CONFIG_M32R=y 6CONFIG_M32R=y
7# CONFIG_UID16 is not set 7# CONFIG_UID16 is not set
@@ -16,6 +16,7 @@ CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y 16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
18CONFIG_LOCK_KERNEL=y 18CONFIG_LOCK_KERNEL=y
19CONFIG_INIT_ENV_ARG_LIMIT=32
19 20
20# 21#
21# General setup 22# General setup
@@ -26,12 +27,14 @@ CONFIG_BSD_PROCESS_ACCT=y
26# CONFIG_BSD_PROCESS_ACCT_V3 is not set 27# CONFIG_BSD_PROCESS_ACCT_V3 is not set
27CONFIG_SYSCTL=y 28CONFIG_SYSCTL=y
28# CONFIG_AUDIT is not set 29# CONFIG_AUDIT is not set
29CONFIG_LOG_BUF_SHIFT=14
30CONFIG_HOTPLUG=y 30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y 31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set 32# CONFIG_IKCONFIG is not set
33CONFIG_EMBEDDED=y 33CONFIG_EMBEDDED=y
34# CONFIG_KALLSYMS is not set 34# CONFIG_KALLSYMS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
35# CONFIG_FUTEX is not set 38# CONFIG_FUTEX is not set
36# CONFIG_EPOLL is not set 39# CONFIG_EPOLL is not set
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -40,6 +43,7 @@ CONFIG_CC_ALIGN_LABELS=0
40CONFIG_CC_ALIGN_LOOPS=0 43CONFIG_CC_ALIGN_LOOPS=0
41CONFIG_CC_ALIGN_JUMPS=0 44CONFIG_CC_ALIGN_JUMPS=0
42CONFIG_TINY_SHMEM=y 45CONFIG_TINY_SHMEM=y
46CONFIG_BASE_SMALL=0
43 47
44# 48#
45# Loadable module support 49# Loadable module support
@@ -61,6 +65,7 @@ CONFIG_KMOD=y
61# CONFIG_PLAT_OPSPUT is not set 65# CONFIG_PLAT_OPSPUT is not set
62CONFIG_PLAT_OAKS32R=y 66CONFIG_PLAT_OAKS32R=y
63# CONFIG_PLAT_MAPPI2 is not set 67# CONFIG_PLAT_MAPPI2 is not set
68# CONFIG_PLAT_MAPPI3 is not set
64# CONFIG_CHIP_M32700 is not set 69# CONFIG_CHIP_M32700 is not set
65CONFIG_CHIP_M32102=y 70CONFIG_CHIP_M32102=y
66# CONFIG_CHIP_VDEC2 is not set 71# CONFIG_CHIP_VDEC2 is not set
@@ -92,10 +97,6 @@ CONFIG_PREEMPT=y
92# CONFIG_PCCARD is not set 97# CONFIG_PCCARD is not set
93 98
94# 99#
95# PC-card bridges
96#
97
98#
99# PCI Hotplug Support 100# PCI Hotplug Support
100# 101#
101 102
@@ -193,7 +194,6 @@ CONFIG_NET=y
193# 194#
194CONFIG_PACKET=y 195CONFIG_PACKET=y
195# CONFIG_PACKET_MMAP is not set 196# CONFIG_PACKET_MMAP is not set
196# CONFIG_NETLINK_DEV is not set
197CONFIG_UNIX=y 197CONFIG_UNIX=y
198# CONFIG_NET_KEY is not set 198# CONFIG_NET_KEY is not set
199CONFIG_INET=y 199CONFIG_INET=y
@@ -311,18 +311,6 @@ CONFIG_INPUT=y
311# CONFIG_INPUT_EVBUG is not set 311# CONFIG_INPUT_EVBUG is not set
312 312
313# 313#
314# Input I/O drivers
315#
316# CONFIG_GAMEPORT is not set
317CONFIG_SOUND_GAMEPORT=y
318CONFIG_SERIO=y
319# CONFIG_SERIO_I8042 is not set
320CONFIG_SERIO_SERPORT=y
321# CONFIG_SERIO_CT82C710 is not set
322# CONFIG_SERIO_LIBPS2 is not set
323# CONFIG_SERIO_RAW is not set
324
325#
326# Input Device Drivers 314# Input Device Drivers
327# 315#
328# CONFIG_INPUT_KEYBOARD is not set 316# CONFIG_INPUT_KEYBOARD is not set
@@ -332,6 +320,17 @@ CONFIG_SERIO_SERPORT=y
332# CONFIG_INPUT_MISC is not set 320# CONFIG_INPUT_MISC is not set
333 321
334# 322#
323# Hardware I/O ports
324#
325CONFIG_SERIO=y
326# CONFIG_SERIO_I8042 is not set
327CONFIG_SERIO_SERPORT=y
328# CONFIG_SERIO_LIBPS2 is not set
329# CONFIG_SERIO_RAW is not set
330# CONFIG_GAMEPORT is not set
331CONFIG_SOUND_GAMEPORT=y
332
333#
335# Character devices 334# Character devices
336# 335#
337# CONFIG_VT is not set 336# CONFIG_VT is not set
@@ -375,6 +374,10 @@ CONFIG_LEGACY_PTY_COUNT=256
375# CONFIG_RAW_DRIVER is not set 374# CONFIG_RAW_DRIVER is not set
376 375
377# 376#
377# TPM devices
378#
379
380#
378# I2C support 381# I2C support
379# 382#
380# CONFIG_I2C is not set 383# CONFIG_I2C is not set
@@ -415,10 +418,6 @@ CONFIG_LEGACY_PTY_COUNT=256
415# CONFIG_USB_ARCH_HAS_OHCI is not set 418# CONFIG_USB_ARCH_HAS_OHCI is not set
416 419
417# 420#
418# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
419#
420
421#
422# USB Gadget Support 421# USB Gadget Support
423# 422#
424# CONFIG_USB_GADGET is not set 423# CONFIG_USB_GADGET is not set
@@ -574,8 +573,9 @@ CONFIG_NLS_DEFAULT="iso8859-1"
574# 573#
575# Kernel hacking 574# Kernel hacking
576# 575#
576# CONFIG_PRINTK_TIME is not set
577# CONFIG_DEBUG_KERNEL is not set 577# CONFIG_DEBUG_KERNEL is not set
578CONFIG_DEBUG_PREEMPT=y 578CONFIG_LOG_BUF_SHIFT=14
579# CONFIG_DEBUG_BUGVERBOSE is not set 579# CONFIG_DEBUG_BUGVERBOSE is not set
580# CONFIG_FRAME_POINTER is not set 580# CONFIG_FRAME_POINTER is not set
581 581
diff --git a/arch/m32r/opsput/defconfig.opsput b/arch/m32r/opsput/defconfig.opsput
index a87e1ea4c301..66adec6a701a 100644
--- a/arch/m32r/opsput/defconfig.opsput
+++ b/arch/m32r/opsput/defconfig.opsput
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc4 3# Linux kernel version: 2.6.12-rc5
4# Wed Feb 16 21:11:41 2005 4# Fri Jun 3 16:22:06 2005
5# 5#
6CONFIG_M32R=y 6CONFIG_M32R=y
7# CONFIG_UID16 is not set 7# CONFIG_UID16 is not set
@@ -15,6 +15,7 @@ CONFIG_GENERIC_IRQ_PROBE=y
15CONFIG_EXPERIMENTAL=y 15CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y 16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
18CONFIG_INIT_ENV_ARG_LIMIT=32
18 19
19# 20#
20# General setup 21# General setup
@@ -27,13 +28,15 @@ CONFIG_BSD_PROCESS_ACCT=y
27# CONFIG_BSD_PROCESS_ACCT_V3 is not set 28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
28CONFIG_SYSCTL=y 29CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set 30# CONFIG_AUDIT is not set
30CONFIG_LOG_BUF_SHIFT=14
31CONFIG_HOTPLUG=y 31CONFIG_HOTPLUG=y
32CONFIG_KOBJECT_UEVENT=y 32CONFIG_KOBJECT_UEVENT=y
33CONFIG_IKCONFIG=y 33CONFIG_IKCONFIG=y
34# CONFIG_IKCONFIG_PROC is not set 34# CONFIG_IKCONFIG_PROC is not set
35CONFIG_EMBEDDED=y 35CONFIG_EMBEDDED=y
36# CONFIG_KALLSYMS is not set 36# CONFIG_KALLSYMS is not set
37CONFIG_PRINTK=y
38CONFIG_BUG=y
39CONFIG_BASE_FULL=y
37# CONFIG_FUTEX is not set 40# CONFIG_FUTEX is not set
38# CONFIG_EPOLL is not set 41# CONFIG_EPOLL is not set
39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -43,6 +46,7 @@ CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0 46CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0 47CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set 48# CONFIG_TINY_SHMEM is not set
49CONFIG_BASE_SMALL=0
46 50
47# 51#
48# Loadable module support 52# Loadable module support
@@ -64,6 +68,7 @@ CONFIG_KMOD=y
64CONFIG_PLAT_OPSPUT=y 68CONFIG_PLAT_OPSPUT=y
65# CONFIG_PLAT_OAKS32R is not set 69# CONFIG_PLAT_OAKS32R is not set
66# CONFIG_PLAT_MAPPI2 is not set 70# CONFIG_PLAT_MAPPI2 is not set
71# CONFIG_PLAT_MAPPI3 is not set
67# CONFIG_CHIP_M32700 is not set 72# CONFIG_CHIP_M32700 is not set
68# CONFIG_CHIP_M32102 is not set 73# CONFIG_CHIP_M32102 is not set
69# CONFIG_CHIP_VDEC2 is not set 74# CONFIG_CHIP_VDEC2 is not set
@@ -243,7 +248,6 @@ CONFIG_NET=y
243# 248#
244CONFIG_PACKET=y 249CONFIG_PACKET=y
245# CONFIG_PACKET_MMAP is not set 250# CONFIG_PACKET_MMAP is not set
246# CONFIG_NETLINK_DEV is not set
247CONFIG_UNIX=y 251CONFIG_UNIX=y
248# CONFIG_NET_KEY is not set 252# CONFIG_NET_KEY is not set
249CONFIG_INET=y 253CONFIG_INET=y
@@ -368,18 +372,6 @@ CONFIG_INPUT=y
368# CONFIG_INPUT_EVBUG is not set 372# CONFIG_INPUT_EVBUG is not set
369 373
370# 374#
371# Input I/O drivers
372#
373# CONFIG_GAMEPORT is not set
374CONFIG_SOUND_GAMEPORT=y
375CONFIG_SERIO=y
376# CONFIG_SERIO_I8042 is not set
377CONFIG_SERIO_SERPORT=y
378# CONFIG_SERIO_CT82C710 is not set
379# CONFIG_SERIO_LIBPS2 is not set
380# CONFIG_SERIO_RAW is not set
381
382#
383# Input Device Drivers 375# Input Device Drivers
384# 376#
385# CONFIG_INPUT_KEYBOARD is not set 377# CONFIG_INPUT_KEYBOARD is not set
@@ -389,6 +381,17 @@ CONFIG_SERIO_SERPORT=y
389# CONFIG_INPUT_MISC is not set 381# CONFIG_INPUT_MISC is not set
390 382
391# 383#
384# Hardware I/O ports
385#
386CONFIG_SERIO=y
387# CONFIG_SERIO_I8042 is not set
388CONFIG_SERIO_SERPORT=y
389# CONFIG_SERIO_LIBPS2 is not set
390# CONFIG_SERIO_RAW is not set
391# CONFIG_GAMEPORT is not set
392CONFIG_SOUND_GAMEPORT=y
393
394#
392# Character devices 395# Character devices
393# 396#
394# CONFIG_VT is not set 397# CONFIG_VT is not set
@@ -438,6 +441,10 @@ CONFIG_DS1302=y
438# CONFIG_RAW_DRIVER is not set 441# CONFIG_RAW_DRIVER is not set
439 442
440# 443#
444# TPM devices
445#
446
447#
441# I2C support 448# I2C support
442# 449#
443# CONFIG_I2C is not set 450# CONFIG_I2C is not set
@@ -478,10 +485,6 @@ CONFIG_DS1302=y
478# CONFIG_USB_ARCH_HAS_OHCI is not set 485# CONFIG_USB_ARCH_HAS_OHCI is not set
479 486
480# 487#
481# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
482#
483
484#
485# USB Gadget Support 488# USB Gadget Support
486# 489#
487# CONFIG_USB_GADGET is not set 490# CONFIG_USB_GADGET is not set
@@ -654,8 +657,10 @@ CONFIG_NLS_DEFAULT="iso8859-1"
654# 657#
655# Kernel hacking 658# Kernel hacking
656# 659#
660# CONFIG_PRINTK_TIME is not set
657CONFIG_DEBUG_KERNEL=y 661CONFIG_DEBUG_KERNEL=y
658# CONFIG_MAGIC_SYSRQ is not set 662# CONFIG_MAGIC_SYSRQ is not set
663CONFIG_LOG_BUF_SHIFT=14
659# CONFIG_SCHEDSTATS is not set 664# CONFIG_SCHEDSTATS is not set
660# CONFIG_DEBUG_SLAB is not set 665# CONFIG_DEBUG_SLAB is not set
661# CONFIG_DEBUG_SPINLOCK is not set 666# CONFIG_DEBUG_SPINLOCK is not set
diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig
index 7dbf997ff205..5649fbae430e 100644
--- a/arch/m68k/configs/amiga_defconfig
+++ b/arch/m68k/configs/amiga_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:05:59 2005 4# Tue Jun 7 20:34:23 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -135,7 +137,6 @@ CONFIG_PARPORT_1284=y
135# 137#
136CONFIG_AMIGA_FLOPPY=y 138CONFIG_AMIGA_FLOPPY=y
137CONFIG_AMIGA_Z2RAM=y 139CONFIG_AMIGA_Z2RAM=y
138# CONFIG_BLK_DEV_XD is not set
139# CONFIG_PARIDE is not set 140# CONFIG_PARIDE is not set
140# CONFIG_BLK_DEV_COW_COMMON is not set 141# CONFIG_BLK_DEV_COW_COMMON is not set
141CONFIG_BLK_DEV_LOOP=y 142CONFIG_BLK_DEV_LOOP=y
@@ -223,17 +224,12 @@ CONFIG_SCSI_CONSTANTS=y
223# 224#
224# SCSI low-level drivers 225# SCSI low-level drivers
225# 226#
226# CONFIG_SCSI_7000FASST is not set
227# CONFIG_SCSI_AHA152X is not set 227# CONFIG_SCSI_AHA152X is not set
228# CONFIG_SCSI_AHA1542 is not set
229# CONFIG_SCSI_AIC7XXX_OLD is not set 228# CONFIG_SCSI_AIC7XXX_OLD is not set
230# CONFIG_SCSI_IN2000 is not set 229# CONFIG_SCSI_IN2000 is not set
231# CONFIG_SCSI_SATA is not set 230# CONFIG_SCSI_SATA is not set
232# CONFIG_SCSI_BUSLOGIC is not set
233# CONFIG_SCSI_DTC3280 is not set 231# CONFIG_SCSI_DTC3280 is not set
234# CONFIG_SCSI_EATA is not set
235# CONFIG_SCSI_FUTURE_DOMAIN is not set 232# CONFIG_SCSI_FUTURE_DOMAIN is not set
236# CONFIG_SCSI_GDTH is not set
237# CONFIG_SCSI_GENERIC_NCR5380 is not set 233# CONFIG_SCSI_GENERIC_NCR5380 is not set
238# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set 234# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
239# CONFIG_SCSI_PPA is not set 235# CONFIG_SCSI_PPA is not set
@@ -244,7 +240,6 @@ CONFIG_SCSI_CONSTANTS=y
244# CONFIG_SCSI_QLOGIC_FAS is not set 240# CONFIG_SCSI_QLOGIC_FAS is not set
245# CONFIG_SCSI_SYM53C416 is not set 241# CONFIG_SCSI_SYM53C416 is not set
246# CONFIG_SCSI_T128 is not set 242# CONFIG_SCSI_T128 is not set
247# CONFIG_SCSI_U14_34F is not set
248# CONFIG_SCSI_DEBUG is not set 243# CONFIG_SCSI_DEBUG is not set
249CONFIG_A3000_SCSI=y 244CONFIG_A3000_SCSI=y
250CONFIG_A2091_SCSI=y 245CONFIG_A2091_SCSI=y
@@ -492,7 +487,6 @@ CONFIG_HYDRA=m
492CONFIG_ZORRO8390=m 487CONFIG_ZORRO8390=m
493CONFIG_APNE=m 488CONFIG_APNE=m
494# CONFIG_NET_VENDOR_3COM is not set 489# CONFIG_NET_VENDOR_3COM is not set
495# CONFIG_LANCE is not set
496# CONFIG_NET_VENDOR_SMC is not set 490# CONFIG_NET_VENDOR_SMC is not set
497# CONFIG_NET_VENDOR_RACAL is not set 491# CONFIG_NET_VENDOR_RACAL is not set
498# CONFIG_AT1700 is not set 492# CONFIG_AT1700 is not set
@@ -620,7 +614,6 @@ CONFIG_SERIO_SERPORT=m
620# CONFIG_SERIO_PARKBD is not set 614# CONFIG_SERIO_PARKBD is not set
621# CONFIG_SERIO_RAW is not set 615# CONFIG_SERIO_RAW is not set
622# CONFIG_GAMEPORT is not set 616# CONFIG_GAMEPORT is not set
623CONFIG_SOUND_GAMEPORT=y
624 617
625# 618#
626# Character devices 619# Character devices
diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig
index 505a2968e604..63024b0b7ac3 100644
--- a/arch/m68k/configs/apollo_defconfig
+++ b/arch/m68k/configs/apollo_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:00 2005 4# Tue Jun 7 20:34:27 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -497,7 +499,6 @@ CONFIG_SERIO_SERPORT=m
497CONFIG_SERIO_LIBPS2=m 499CONFIG_SERIO_LIBPS2=m
498# CONFIG_SERIO_RAW is not set 500# CONFIG_SERIO_RAW is not set
499# CONFIG_GAMEPORT is not set 501# CONFIG_GAMEPORT is not set
500CONFIG_SOUND_GAMEPORT=y
501 502
502# 503#
503# Character devices 504# Character devices
diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig
index 617aa73c3250..6433da2d2ce2 100644
--- a/arch/m68k/configs/atari_defconfig
+++ b/arch/m68k/configs/atari_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:18 2005 4# Tue Jun 7 20:34:32 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -531,7 +533,6 @@ CONFIG_SERIO_SERPORT=y
531CONFIG_SERIO_LIBPS2=y 533CONFIG_SERIO_LIBPS2=y
532# CONFIG_SERIO_RAW is not set 534# CONFIG_SERIO_RAW is not set
533# CONFIG_GAMEPORT is not set 535# CONFIG_GAMEPORT is not set
534CONFIG_SOUND_GAMEPORT=y
535 536
536# 537#
537# Character devices 538# Character devices
diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig
index b501db51d9ec..da2a23a21463 100644
--- a/arch/m68k/configs/bvme6000_defconfig
+++ b/arch/m68k/configs/bvme6000_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:19 2005 4# Tue Jun 7 20:34:37 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -496,7 +498,6 @@ CONFIG_SERIO_SERPORT=m
496CONFIG_SERIO_LIBPS2=m 498CONFIG_SERIO_LIBPS2=m
497# CONFIG_SERIO_RAW is not set 499# CONFIG_SERIO_RAW is not set
498# CONFIG_GAMEPORT is not set 500# CONFIG_GAMEPORT is not set
499CONFIG_SOUND_GAMEPORT=y
500 501
501# 502#
502# Character devices 503# Character devices
diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig
index 2bf6cef4f2b2..51251883adf8 100644
--- a/arch/m68k/configs/hp300_defconfig
+++ b/arch/m68k/configs/hp300_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:21 2005 4# Tue Jun 7 20:34:41 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -498,7 +500,6 @@ CONFIG_SERIO_SERPORT=m
498CONFIG_SERIO_LIBPS2=m 500CONFIG_SERIO_LIBPS2=m
499# CONFIG_SERIO_RAW is not set 501# CONFIG_SERIO_RAW is not set
500# CONFIG_GAMEPORT is not set 502# CONFIG_GAMEPORT is not set
501CONFIG_SOUND_GAMEPORT=y
502 503
503# 504#
504# Character devices 505# Character devices
diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig
index 7074f856820c..15b80abfe94a 100644
--- a/arch/m68k/configs/mac_defconfig
+++ b/arch/m68k/configs/mac_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:24 2005 4# Tue Jun 7 20:34:45 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -540,7 +542,6 @@ CONFIG_SERIO_SERPORT=m
540CONFIG_SERIO_LIBPS2=m 542CONFIG_SERIO_LIBPS2=m
541# CONFIG_SERIO_RAW is not set 543# CONFIG_SERIO_RAW is not set
542# CONFIG_GAMEPORT is not set 544# CONFIG_GAMEPORT is not set
543CONFIG_SOUND_GAMEPORT=y
544 545
545# 546#
546# Character devices 547# Character devices
diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig
index 61f09bc4846a..f0d5534f6830 100644
--- a/arch/m68k/configs/mvme147_defconfig
+++ b/arch/m68k/configs/mvme147_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:28 2005 4# Tue Jun 7 20:34:50 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -498,7 +500,6 @@ CONFIG_SERIO_SERPORT=m
498CONFIG_SERIO_LIBPS2=m 500CONFIG_SERIO_LIBPS2=m
499# CONFIG_SERIO_RAW is not set 501# CONFIG_SERIO_RAW is not set
500# CONFIG_GAMEPORT is not set 502# CONFIG_GAMEPORT is not set
501CONFIG_SOUND_GAMEPORT=y
502 503
503# 504#
504# Character devices 505# Character devices
diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig
index 69c01004ec41..1d5c46ff3c81 100644
--- a/arch/m68k/configs/mvme16x_defconfig
+++ b/arch/m68k/configs/mvme16x_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:31 2005 4# Tue Jun 7 20:34:53 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -497,7 +499,6 @@ CONFIG_SERIO_SERPORT=m
497CONFIG_SERIO_LIBPS2=m 499CONFIG_SERIO_LIBPS2=m
498# CONFIG_SERIO_RAW is not set 500# CONFIG_SERIO_RAW is not set
499# CONFIG_GAMEPORT is not set 501# CONFIG_GAMEPORT is not set
500CONFIG_SOUND_GAMEPORT=y
501 502
502# 503#
503# Character devices 504# Character devices
diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig
index 550ec26006c1..856238634d42 100644
--- a/arch/m68k/configs/q40_defconfig
+++ b/arch/m68k/configs/q40_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:34 2005 4# Tue Jun 7 20:34:58 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -125,7 +127,6 @@ CONFIG_FW_LOADER=m
125# Block devices 127# Block devices
126# 128#
127# CONFIG_BLK_DEV_FD is not set 129# CONFIG_BLK_DEV_FD is not set
128# CONFIG_BLK_DEV_XD is not set
129# CONFIG_BLK_DEV_COW_COMMON is not set 130# CONFIG_BLK_DEV_COW_COMMON is not set
130CONFIG_BLK_DEV_LOOP=y 131CONFIG_BLK_DEV_LOOP=y
131CONFIG_BLK_DEV_CRYPTOLOOP=m 132CONFIG_BLK_DEV_CRYPTOLOOP=m
@@ -210,17 +211,12 @@ CONFIG_SCSI_CONSTANTS=y
210# 211#
211# SCSI low-level drivers 212# SCSI low-level drivers
212# 213#
213# CONFIG_SCSI_7000FASST is not set
214# CONFIG_SCSI_AHA152X is not set 214# CONFIG_SCSI_AHA152X is not set
215# CONFIG_SCSI_AHA1542 is not set
216# CONFIG_SCSI_AIC7XXX_OLD is not set 215# CONFIG_SCSI_AIC7XXX_OLD is not set
217# CONFIG_SCSI_IN2000 is not set 216# CONFIG_SCSI_IN2000 is not set
218# CONFIG_SCSI_SATA is not set 217# CONFIG_SCSI_SATA is not set
219# CONFIG_SCSI_BUSLOGIC is not set
220# CONFIG_SCSI_DTC3280 is not set 218# CONFIG_SCSI_DTC3280 is not set
221# CONFIG_SCSI_EATA is not set
222# CONFIG_SCSI_FUTURE_DOMAIN is not set 219# CONFIG_SCSI_FUTURE_DOMAIN is not set
223# CONFIG_SCSI_GDTH is not set
224# CONFIG_SCSI_GENERIC_NCR5380 is not set 220# CONFIG_SCSI_GENERIC_NCR5380 is not set
225# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set 221# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
226# CONFIG_SCSI_NCR53C406A is not set 222# CONFIG_SCSI_NCR53C406A is not set
@@ -229,7 +225,6 @@ CONFIG_SCSI_CONSTANTS=y
229# CONFIG_SCSI_QLOGIC_FAS is not set 225# CONFIG_SCSI_QLOGIC_FAS is not set
230# CONFIG_SCSI_SYM53C416 is not set 226# CONFIG_SCSI_SYM53C416 is not set
231# CONFIG_SCSI_T128 is not set 227# CONFIG_SCSI_T128 is not set
232# CONFIG_SCSI_U14_34F is not set
233# CONFIG_SCSI_DEBUG is not set 228# CONFIG_SCSI_DEBUG is not set
234 229
235# 230#
@@ -466,7 +461,6 @@ CONFIG_EQUALIZER=m
466CONFIG_NET_ETHERNET=y 461CONFIG_NET_ETHERNET=y
467CONFIG_MII=m 462CONFIG_MII=m
468# CONFIG_NET_VENDOR_3COM is not set 463# CONFIG_NET_VENDOR_3COM is not set
469# CONFIG_LANCE is not set
470# CONFIG_NET_VENDOR_SMC is not set 464# CONFIG_NET_VENDOR_SMC is not set
471# CONFIG_NET_VENDOR_RACAL is not set 465# CONFIG_NET_VENDOR_RACAL is not set
472# CONFIG_AT1700 is not set 466# CONFIG_AT1700 is not set
@@ -570,7 +564,6 @@ CONFIG_SERIO_Q40KBD=m
570CONFIG_SERIO_LIBPS2=m 564CONFIG_SERIO_LIBPS2=m
571# CONFIG_SERIO_RAW is not set 565# CONFIG_SERIO_RAW is not set
572# CONFIG_GAMEPORT is not set 566# CONFIG_GAMEPORT is not set
573CONFIG_SOUND_GAMEPORT=y
574 567
575# 568#
576# Character devices 569# Character devices
diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig
index 5b5a619645aa..af903b5c5708 100644
--- a/arch/m68k/configs/sun3_defconfig
+++ b/arch/m68k/configs/sun3_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:37 2005 4# Tue Jun 7 20:35:02 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -171,7 +173,6 @@ CONFIG_SCSI_CONSTANTS=y
171# 173#
172# CONFIG_SCSI_SATA is not set 174# CONFIG_SCSI_SATA is not set
173# CONFIG_SCSI_DEBUG is not set 175# CONFIG_SCSI_DEBUG is not set
174CONFIG_SUN3_SCSI=y
175 176
176# 177#
177# Multi-device support (RAID and LVM) 178# Multi-device support (RAID and LVM)
@@ -487,7 +488,6 @@ CONFIG_SERIO_SERPORT=m
487CONFIG_SERIO_LIBPS2=m 488CONFIG_SERIO_LIBPS2=m
488# CONFIG_SERIO_RAW is not set 489# CONFIG_SERIO_RAW is not set
489# CONFIG_GAMEPORT is not set 490# CONFIG_GAMEPORT is not set
490CONFIG_SOUND_GAMEPORT=y
491 491
492# 492#
493# Character devices 493# Character devices
diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig
index 704e42344cba..997143b7928a 100644
--- a/arch/m68k/configs/sun3x_defconfig
+++ b/arch/m68k/configs/sun3x_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:06:40 2005 4# Tue Jun 7 20:35:06 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -35,6 +35,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_PRINTK=y
39CONFIG_BUG=y
38CONFIG_BASE_FULL=y 40CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 41CONFIG_FUTEX=y
40CONFIG_EPOLL=y 42CONFIG_EPOLL=y
@@ -497,7 +499,6 @@ CONFIG_SERIO_SERPORT=m
497CONFIG_SERIO_LIBPS2=m 499CONFIG_SERIO_LIBPS2=m
498# CONFIG_SERIO_RAW is not set 500# CONFIG_SERIO_RAW is not set
499# CONFIG_GAMEPORT is not set 501# CONFIG_GAMEPORT is not set
500CONFIG_SOUND_GAMEPORT=y
501 502
502# 503#
503# Character devices 504# Character devices
diff --git a/arch/m68k/defconfig b/arch/m68k/defconfig
index 5b2296ecba82..7d935e48a9a8 100644
--- a/arch/m68k/defconfig
+++ b/arch/m68k/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc2-m68k 3# Linux kernel version: 2.6.12-rc6-m68k
4# Tue Apr 5 14:05:31 2005 4# Tue Jun 7 20:34:17 2005
5# 5#
6CONFIG_M68K=y 6CONFIG_M68K=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -33,6 +33,8 @@ CONFIG_KOBJECT_UEVENT=y
33# CONFIG_EMBEDDED is not set 33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y 34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_PRINTK=y
37CONFIG_BUG=y
36CONFIG_BASE_FULL=y 38CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y 39CONFIG_FUTEX=y
38CONFIG_EPOLL=y 40CONFIG_EPOLL=y
@@ -355,7 +357,6 @@ CONFIG_SERIO_SERPORT=y
355CONFIG_SERIO_LIBPS2=y 357CONFIG_SERIO_LIBPS2=y
356# CONFIG_SERIO_RAW is not set 358# CONFIG_SERIO_RAW is not set
357# CONFIG_GAMEPORT is not set 359# CONFIG_GAMEPORT is not set
358CONFIG_SOUND_GAMEPORT=y
359 360
360# 361#
361# Character devices 362# Character devices
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 2b6c9d32b7a6..c4a33f265dc0 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -45,11 +45,13 @@ asmlinkage void ret_from_fork(void);
45 */ 45 */
46void default_idle(void) 46void default_idle(void)
47{ 47{
48 while(1) { 48 local_irq_disable();
49 if (need_resched()) 49 while (!need_resched()) {
50 __asm__("stop #0x2000" : : : "cc"); 50 /* This stop will re-enable interrupts */
51 schedule(); 51 __asm__("stop #0x2000" : : : "cc");
52 local_irq_disable();
52 } 53 }
54 local_irq_enable();
53} 55}
54 56
55void (*idle)(void) = default_idle; 57void (*idle)(void) = default_idle;
@@ -63,7 +65,12 @@ void (*idle)(void) = default_idle;
63void cpu_idle(void) 65void cpu_idle(void)
64{ 66{
65 /* endless idle loop with no priority at all */ 67 /* endless idle loop with no priority at all */
66 idle(); 68 while (1) {
69 idle();
70 preempt_enable_no_resched();
71 schedule();
72 preempt_disable();
73 }
67} 74}
68 75
69void machine_restart(char * __unused) 76void machine_restart(char * __unused)
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index b027ce7efbc6..73843c528778 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -232,7 +232,6 @@ void __init mem_init(void)
232#ifdef CONFIG_LIMITED_DMA 232#ifdef CONFIG_LIMITED_DMA
233 set_page_address(page, lowmem_page_address(page)); 233 set_page_address(page, lowmem_page_address(page));
234#endif 234#endif
235 set_bit(PG_highmem, &page->flags);
236 set_page_count(page, 1); 235 set_page_count(page, 1);
237 __free_page(page); 236 __free_page(page);
238 totalhigh_pages++; 237 totalhigh_pages++;
diff --git a/arch/mips/vr41xx/common/pmu.c b/arch/mips/vr41xx/common/pmu.c
index c5f1043de938..53166f3598b2 100644
--- a/arch/mips/vr41xx/common/pmu.c
+++ b/arch/mips/vr41xx/common/pmu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * pmu.c, Power Management Unit routines for NEC VR4100 series. 2 * pmu.c, Power Management Unit routines for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2003-2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> 4 * Copyright (C) 2003-2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -17,7 +17,9 @@
17 * along with this program; if not, write to the Free Software 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 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20#include <linux/errno.h>
20#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/ioport.h>
21#include <linux/kernel.h> 23#include <linux/kernel.h>
22#include <linux/smp.h> 24#include <linux/smp.h>
23#include <linux/types.h> 25#include <linux/types.h>
@@ -27,20 +29,31 @@
27#include <asm/reboot.h> 29#include <asm/reboot.h>
28#include <asm/system.h> 30#include <asm/system.h>
29 31
30#define PMUCNT2REG KSEG1ADDR(0x0f0000c6) 32#define PMU_TYPE1_BASE 0x0b0000a0UL
33#define PMU_TYPE1_SIZE 0x0eUL
34
35#define PMU_TYPE2_BASE 0x0f0000c0UL
36#define PMU_TYPE2_SIZE 0x10UL
37
38#define PMUCNT2REG 0x06
31 #define SOFTRST 0x0010 39 #define SOFTRST 0x0010
32 40
41static void __iomem *pmu_base;
42
43#define pmu_read(offset) readw(pmu_base + (offset))
44#define pmu_write(offset, value) writew((value), pmu_base + (offset))
45
33static inline void software_reset(void) 46static inline void software_reset(void)
34{ 47{
35 uint16_t val; 48 uint16_t pmucnt2;
36 49
37 switch (current_cpu_data.cputype) { 50 switch (current_cpu_data.cputype) {
38 case CPU_VR4122: 51 case CPU_VR4122:
39 case CPU_VR4131: 52 case CPU_VR4131:
40 case CPU_VR4133: 53 case CPU_VR4133:
41 val = readw(PMUCNT2REG); 54 pmucnt2 = pmu_read(PMUCNT2REG);
42 val |= SOFTRST; 55 pmucnt2 |= SOFTRST;
43 writew(val, PMUCNT2REG); 56 pmu_write(PMUCNT2REG, pmucnt2);
44 break; 57 break;
45 default: 58 default:
46 break; 59 break;
@@ -71,6 +84,34 @@ static void vr41xx_power_off(void)
71 84
72static int __init vr41xx_pmu_init(void) 85static int __init vr41xx_pmu_init(void)
73{ 86{
87 unsigned long start, size;
88
89 switch (current_cpu_data.cputype) {
90 case CPU_VR4111:
91 case CPU_VR4121:
92 start = PMU_TYPE1_BASE;
93 size = PMU_TYPE1_SIZE;
94 break;
95 case CPU_VR4122:
96 case CPU_VR4131:
97 case CPU_VR4133:
98 start = PMU_TYPE2_BASE;
99 size = PMU_TYPE2_SIZE;
100 break;
101 default:
102 printk("Unexpected CPU of NEC VR4100 series\n");
103 return -ENODEV;
104 }
105
106 if (request_mem_region(start, size, "PMU") == NULL)
107 return -EBUSY;
108
109 pmu_base = ioremap(start, size);
110 if (pmu_base == NULL) {
111 release_mem_region(start, size);
112 return -EBUSY;
113 }
114
74 _machine_restart = vr41xx_restart; 115 _machine_restart = vr41xx_restart;
75 _machine_halt = vr41xx_halt; 116 _machine_halt = vr41xx_halt;
76 _machine_power_off = vr41xx_power_off; 117 _machine_power_off = vr41xx_power_off;
@@ -78,4 +119,4 @@ static int __init vr41xx_pmu_init(void)
78 return 0; 119 return 0;
79} 120}
80 121
81early_initcall(vr41xx_pmu_init); 122core_initcall(vr41xx_pmu_init);
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index ebf186656afb..d34bbe7ae0e3 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -466,7 +466,7 @@ static int parisc_generic_match(struct device *dev, struct device_driver *drv)
466} 466}
467 467
468#define pa_dev_attr(name, field, format_string) \ 468#define pa_dev_attr(name, field, format_string) \
469static ssize_t name##_show(struct device *dev, char *buf) \ 469static ssize_t name##_show(struct device *dev, struct device_attribute *attr, char *buf) \
470{ \ 470{ \
471 struct parisc_device *padev = to_parisc_device(dev); \ 471 struct parisc_device *padev = to_parisc_device(dev); \
472 return sprintf(buf, format_string, padev->field); \ 472 return sprintf(buf, format_string, padev->field); \
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 600f23d7fd33..10162b187bcf 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -826,11 +826,6 @@ config MPC10X_BRIDGE
826 depends on PCORE || POWERPMC250 || LOPEC || SANDPOINT 826 depends on PCORE || POWERPMC250 || LOPEC || SANDPOINT
827 default y 827 default y
828 828
829config FSL_OCP
830 bool
831 depends on MPC10X_BRIDGE
832 default y
833
834config MPC10X_OPENPIC 829config MPC10X_OPENPIC
835 bool 830 bool
836 depends on POWERPMC250 || LOPEC || SANDPOINT 831 depends on POWERPMC250 || LOPEC || SANDPOINT
@@ -1083,6 +1078,23 @@ source "drivers/zorro/Kconfig"
1083 1078
1084source kernel/power/Kconfig 1079source kernel/power/Kconfig
1085 1080
1081config SECCOMP
1082 bool "Enable seccomp to safely compute untrusted bytecode"
1083 depends on PROC_FS
1084 default y
1085 help
1086 This kernel feature is useful for number crunching applications
1087 that may need to compute untrusted bytecode during their
1088 execution. By using pipes or other transports made available to
1089 the process as file descriptors supporting the read/write
1090 syscalls, it's possible to isolate those applications in
1091 their own address space using seccomp. Once seccomp is
1092 enabled via /proc/<pid>/seccomp, it cannot be disabled
1093 and the task is only allowed to execute a few safe syscalls
1094 defined by each seccomp mode.
1095
1096 If unsure, say Y. Only embedded should say N here.
1097
1086endmenu 1098endmenu
1087 1099
1088config ISA_DMA_API 1100config ISA_DMA_API
@@ -1143,12 +1155,12 @@ config PCI_QSPAN
1143 1155
1144config PCI_8260 1156config PCI_8260
1145 bool 1157 bool
1146 depends on PCI && 8260 && !8272 1158 depends on PCI && 8260
1147 default y 1159 default y
1148 1160
1149config 8260_PCI9 1161config 8260_PCI9
1150 bool " Enable workaround for MPC826x erratum PCI 9" 1162 bool " Enable workaround for MPC826x erratum PCI 9"
1151 depends on PCI_8260 1163 depends on PCI_8260 && !ADS8272
1152 default y 1164 default y
1153 1165
1154choice 1166choice
diff --git a/arch/ppc/boot/images/Makefile b/arch/ppc/boot/images/Makefile
index f850fb0fb511..c9ac5f5fa9e4 100644
--- a/arch/ppc/boot/images/Makefile
+++ b/arch/ppc/boot/images/Makefile
@@ -22,7 +22,8 @@ targets += uImage
22$(obj)/uImage: $(obj)/vmlinux.gz 22$(obj)/uImage: $(obj)/vmlinux.gz
23 $(Q)rm -f $@ 23 $(Q)rm -f $@
24 $(call if_changed,uimage) 24 $(call if_changed,uimage)
25 @echo ' Image: $@' $(if $(wildcard $@),'is ready','not made') 25 @echo -n ' Image: $@ '
26 @if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi
26 27
27# Files generated that shall be removed upon make clean 28# Files generated that shall be removed upon make clean
28clean-files := sImage vmapus vmlinux* miboot* zImage* uImage 29clean-files := sImage vmapus vmlinux* miboot* zImage* uImage
diff --git a/arch/ppc/boot/ld.script b/arch/ppc/boot/ld.script
index 6ee602d8b6a0..9362193742ac 100644
--- a/arch/ppc/boot/ld.script
+++ b/arch/ppc/boot/ld.script
@@ -58,9 +58,6 @@ SECTIONS
58 *(.ramdisk) 58 *(.ramdisk)
59 __ramdisk_end = .; 59 __ramdisk_end = .;
60 . = ALIGN(4096); 60 . = ALIGN(4096);
61 __sysmap_begin = .;
62 *(.sysmap)
63 __sysmap_end = .;
64 CONSTRUCTORS 61 CONSTRUCTORS
65 } 62 }
66 _edata = .; 63 _edata = .;
diff --git a/arch/ppc/boot/openfirmware/Makefile b/arch/ppc/boot/openfirmware/Makefile
index 4eacbd8c772a..03415238fabf 100644
--- a/arch/ppc/boot/openfirmware/Makefile
+++ b/arch/ppc/boot/openfirmware/Makefile
@@ -54,13 +54,10 @@ $(images)/ramdisk.image.gz:
54 @echo ' RAM disk image must be provided separately' 54 @echo ' RAM disk image must be provided separately'
55 @/bin/false 55 @/bin/false
56 56
57objcpxmon-$(CONFIG_XMON) := --add-section=.sysmap=System.map \
58 --set-section-flags=.sysmap=contents,alloc,load,readonly,data
59quiet_cmd_genimage = GEN $@ 57quiet_cmd_genimage = GEN $@
60 cmd_genimage = $(OBJCOPY) -R .comment \ 58 cmd_genimage = $(OBJCOPY) -R .comment \
61 --add-section=.image=$(images)/vmlinux.gz \ 59 --add-section=.image=$(images)/vmlinux.gz \
62 --set-section-flags=.image=contents,alloc,load,readonly,data \ 60 --set-section-flags=.image=contents,alloc,load,readonly,data $< $@
63 $(objcpxmon-y) $< $@
64 61
65targets += image.o 62targets += image.o
66$(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz FORCE 63$(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz FORCE
diff --git a/arch/ppc/boot/openfirmware/common.c b/arch/ppc/boot/openfirmware/common.c
index 9e6952781f1f..0f46756a903e 100644
--- a/arch/ppc/boot/openfirmware/common.c
+++ b/arch/ppc/boot/openfirmware/common.c
@@ -15,7 +15,6 @@
15#include <asm/page.h> 15#include <asm/page.h>
16 16
17/* Information from the linker */ 17/* Information from the linker */
18extern char __sysmap_begin, __sysmap_end;
19 18
20extern int strcmp(const char *s1, const char *s2); 19extern int strcmp(const char *s1, const char *s2);
21extern char *avail_ram, *avail_high; 20extern char *avail_ram, *avail_high;
@@ -116,14 +115,8 @@ void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
116void make_bi_recs(unsigned long addr, char *name, unsigned int mach, 115void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
117 unsigned long progend) 116 unsigned long progend)
118{ 117{
119 unsigned long sysmap_size;
120 struct bi_record *rec; 118 struct bi_record *rec;
121 119
122 /* Figure out the size of a possible System.map we're going to
123 * pass along.
124 * */
125 sysmap_size = (unsigned long)(&__sysmap_end) -
126 (unsigned long)(&__sysmap_begin);
127 120
128 /* leave a 1MB gap then align to the next 1MB boundary */ 121 /* leave a 1MB gap then align to the next 1MB boundary */
129 addr = _ALIGN(addr+ (1<<20) - 1, (1<<20)); 122 addr = _ALIGN(addr+ (1<<20) - 1, (1<<20));
@@ -147,15 +140,6 @@ void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
147 rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long); 140 rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
148 rec = (struct bi_record *)((unsigned long)rec + rec->size); 141 rec = (struct bi_record *)((unsigned long)rec + rec->size);
149 142
150 if (sysmap_size) {
151 rec->tag = BI_SYSMAP;
152 rec->data[0] = (unsigned long)(&__sysmap_begin);
153 rec->data[1] = sysmap_size;
154 rec->size = sizeof(struct bi_record) + 2 *
155 sizeof(unsigned long);
156 rec = (struct bi_record *)((unsigned long)rec + rec->size);
157 }
158
159 rec->tag = BI_LAST; 143 rec->tag = BI_LAST;
160 rec->size = sizeof(struct bi_record); 144 rec->size = sizeof(struct bi_record);
161 rec = (struct bi_record *)((unsigned long)rec + rec->size); 145 rec = (struct bi_record *)((unsigned long)rec + rec->size);
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index c28061ad5982..991b4cbb83c8 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -203,7 +203,7 @@ $(obj)/zvmlinux: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
203 $(obj)/dummy.o $(obj)/image.o 203 $(obj)/dummy.o $(obj)/image.o
204 $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS) 204 $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS)
205 $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \ 205 $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \
206 -R .stabstr -R .ramdisk -R .sysmap 206 -R .stabstr -R .ramdisk
207 207
208$(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \ 208$(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
209 $(images)/vmlinux.gz $(obj)/dummy.o 209 $(images)/vmlinux.gz $(obj)/dummy.o
@@ -215,7 +215,7 @@ $(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
215 $(obj)/dummy.o $(obj)/image.o 215 $(obj)/dummy.o $(obj)/image.o
216 $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS) 216 $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS)
217 $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \ 217 $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \
218 -R .stabstr -R .sysmap 218 -R .stabstr
219 219
220# Sort-of dummy rules, that let us format the image we want. 220# Sort-of dummy rules, that let us format the image we want.
221zImage: $(images)/$(zimage-y) $(obj)/zvmlinux 221zImage: $(images)/$(zimage-y) $(obj)/zvmlinux
diff --git a/arch/ppc/boot/utils/addSystemMap.c b/arch/ppc/boot/utils/addSystemMap.c
deleted file mode 100644
index 4654f891b274..000000000000
--- a/arch/ppc/boot/utils/addSystemMap.c
+++ /dev/null
@@ -1,186 +0,0 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include <byteswap.h>
4#include <sys/types.h>
5#include <sys/stat.h>
6
7void xlate( char * inb, char * trb, unsigned len )
8{
9 unsigned i;
10 for ( i=0; i<len; ++i ) {
11 char c = *inb++;
12 char c1 = c >> 4;
13 char c2 = c & 0xf;
14 if ( c1 > 9 )
15 c1 = c1 + 'A' - 10;
16 else
17 c1 = c1 + '0';
18 if ( c2 > 9 )
19 c2 = c2 + 'A' - 10;
20 else
21 c2 = c2 + '0';
22 *trb++ = c1;
23 *trb++ = c2;
24 }
25 *trb = 0;
26}
27
28#define ElfHeaderSize (64 * 1024)
29#define ElfPages (ElfHeaderSize / 4096)
30#define KERNELBASE (0xc0000000)
31
32void get4k( /*istream *inf*/FILE *file, char *buf )
33{
34 unsigned j;
35 unsigned num = fread(buf, 1, 4096, file);
36 for ( j=num; j<4096; ++j )
37 buf[j] = 0;
38}
39
40void put4k( /*ostream *outf*/FILE *file, char *buf )
41{
42 fwrite(buf, 1, 4096, file);
43}
44
45int main(int argc, char **argv)
46{
47 char inbuf[4096];
48 FILE *ramDisk = NULL;
49 FILE *inputVmlinux = NULL;
50 FILE *outputVmlinux = NULL;
51 unsigned i = 0;
52 unsigned long ramFileLen = 0;
53 unsigned long ramLen = 0;
54 unsigned long roundR = 0;
55 unsigned long kernelLen = 0;
56 unsigned long actualKernelLen = 0;
57 unsigned long round = 0;
58 unsigned long roundedKernelLen = 0;
59 unsigned long ramStartOffs = 0;
60 unsigned long ramPages = 0;
61 unsigned long roundedKernelPages = 0;
62 if ( argc < 2 ) {
63 printf("Name of System Map file missing.\n");
64 exit(1);
65 }
66
67 if ( argc < 3 ) {
68 printf("Name of vmlinux file missing.\n");
69 exit(1);
70 }
71
72 if ( argc < 4 ) {
73 printf("Name of vmlinux output file missing.\n");
74 exit(1);
75 }
76
77 ramDisk = fopen(argv[1], "r");
78 if ( ! ramDisk ) {
79 printf("System Map file \"%s\" failed to open.\n", argv[1]);
80 exit(1);
81 }
82 inputVmlinux = fopen(argv[2], "r");
83 if ( ! inputVmlinux ) {
84 printf("vmlinux file \"%s\" failed to open.\n", argv[2]);
85 exit(1);
86 }
87 outputVmlinux = fopen(argv[3], "w");
88 if ( ! outputVmlinux ) {
89 printf("output vmlinux file \"%s\" failed to open.\n", argv[3]);
90 exit(1);
91 }
92 fseek(ramDisk, 0, SEEK_END);
93 ramFileLen = ftell(ramDisk);
94 fseek(ramDisk, 0, SEEK_SET);
95 printf("%s file size = %ld\n", argv[1], ramFileLen);
96
97 ramLen = ramFileLen;
98
99 roundR = 4096 - (ramLen % 4096);
100 if ( roundR ) {
101 printf("Rounding System Map file up to a multiple of 4096, adding %ld\n", roundR);
102 ramLen += roundR;
103 }
104
105 printf("Rounded System Map size is %ld\n", ramLen);
106 fseek(inputVmlinux, 0, SEEK_END);
107 kernelLen = ftell(inputVmlinux);
108 fseek(inputVmlinux, 0, SEEK_SET);
109 printf("kernel file size = %ld\n", kernelLen);
110 if ( kernelLen == 0 ) {
111 printf("You must have a linux kernel specified as argv[2]\n");
112 exit(1);
113 }
114
115 actualKernelLen = kernelLen - ElfHeaderSize;
116
117 printf("actual kernel length (minus ELF header) = %ld\n", actualKernelLen);
118
119 round = actualKernelLen % 4096;
120 roundedKernelLen = actualKernelLen;
121 if ( round )
122 roundedKernelLen += (4096 - round);
123
124 printf("actual kernel length rounded up to a 4k multiple = %ld\n", roundedKernelLen);
125
126 ramStartOffs = roundedKernelLen;
127 ramPages = ramLen / 4096;
128
129 printf("System map pages to copy = %ld\n", ramPages);
130
131 // Copy 64K ELF header
132 for (i=0; i<(ElfPages); ++i) {
133 get4k( inputVmlinux, inbuf );
134 put4k( outputVmlinux, inbuf );
135 }
136
137
138
139 roundedKernelPages = roundedKernelLen / 4096;
140
141 fseek(inputVmlinux, ElfHeaderSize, SEEK_SET);
142
143 {
144 for ( i=0; i<roundedKernelPages; ++i ) {
145 get4k( inputVmlinux, inbuf );
146 if ( i == 0 ) {
147 unsigned long * p;
148 printf("Storing embedded_sysmap_start at 0x3c\n");
149 p = (unsigned long *)(inbuf + 0x3c);
150
151#if (BYTE_ORDER == __BIG_ENDIAN)
152 *p = ramStartOffs;
153#else
154 *p = bswap_32(ramStartOffs);
155#endif
156
157 printf("Storing embedded_sysmap_end at 0x44\n");
158 p = (unsigned long *)(inbuf + 0x44);
159#if (BYTE_ORDER == __BIG_ENDIAN)
160 *p = ramStartOffs + ramFileLen;
161#else
162 *p = bswap_32(ramStartOffs + ramFileLen);
163#endif
164 }
165 put4k( outputVmlinux, inbuf );
166 }
167 }
168
169 {
170 for ( i=0; i<ramPages; ++i ) {
171 get4k( ramDisk, inbuf );
172 put4k( outputVmlinux, inbuf );
173 }
174 }
175
176
177 fclose(ramDisk);
178 fclose(inputVmlinux);
179 fclose(outputVmlinux);
180 /* Set permission to executable */
181 chmod(argv[3], S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
182
183 return 0;
184
185}
186
diff --git a/arch/ppc/configs/mpc8548_cds_defconfig b/arch/ppc/configs/mpc8548_cds_defconfig
new file mode 100644
index 000000000000..abe034f24b83
--- /dev/null
+++ b/arch/ppc/configs/mpc8548_cds_defconfig
@@ -0,0 +1,659 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc4
4# Tue May 24 22:36:27 2005
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y
12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15
16#
17# Code maturity level options
18#
19CONFIG_EXPERIMENTAL=y
20CONFIG_CLEAN_COMPILE=y
21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
23
24#
25# General setup
26#
27CONFIG_LOCALVERSION=""
28CONFIG_SWAP=y
29CONFIG_SYSVIPC=y
30# CONFIG_POSIX_MQUEUE is not set
31# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y
33# CONFIG_AUDIT is not set
34# CONFIG_HOTPLUG is not set
35CONFIG_KOBJECT_UEVENT=y
36# CONFIG_IKCONFIG is not set
37CONFIG_EMBEDDED=y
38# CONFIG_KALLSYMS is not set
39CONFIG_PRINTK=y
40CONFIG_BUG=y
41CONFIG_BASE_FULL=y
42CONFIG_FUTEX=y
43# CONFIG_EPOLL is not set
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0
50# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0
52
53#
54# Loadable module support
55#
56# CONFIG_MODULES is not set
57
58#
59# Processor
60#
61# CONFIG_6xx is not set
62# CONFIG_40x is not set
63# CONFIG_44x is not set
64# CONFIG_POWER3 is not set
65# CONFIG_POWER4 is not set
66# CONFIG_8xx is not set
67CONFIG_E500=y
68CONFIG_BOOKE=y
69CONFIG_FSL_BOOKE=y
70# CONFIG_PHYS_64BIT is not set
71CONFIG_SPE=y
72CONFIG_MATH_EMULATION=y
73# CONFIG_CPU_FREQ is not set
74# CONFIG_PM is not set
75CONFIG_85xx=y
76CONFIG_PPC_INDIRECT_PCI_BE=y
77
78#
79# Freescale 85xx options
80#
81# CONFIG_MPC8540_ADS is not set
82CONFIG_MPC8548_CDS=y
83# CONFIG_MPC8555_CDS is not set
84# CONFIG_MPC8560_ADS is not set
85# CONFIG_SBC8560 is not set
86# CONFIG_STX_GP3 is not set
87CONFIG_MPC8548=y
88
89#
90# Platform options
91#
92# CONFIG_SMP is not set
93# CONFIG_PREEMPT is not set
94# CONFIG_HIGHMEM is not set
95CONFIG_BINFMT_ELF=y
96# CONFIG_BINFMT_MISC is not set
97# CONFIG_CMDLINE_BOOL is not set
98CONFIG_ISA_DMA_API=y
99
100#
101# Bus options
102#
103# CONFIG_PCI is not set
104# CONFIG_PCI_DOMAINS is not set
105
106#
107# PCCARD (PCMCIA/CardBus) support
108#
109# CONFIG_PCCARD is not set
110
111#
112# Advanced setup
113#
114# CONFIG_ADVANCED_OPTIONS is not set
115
116#
117# Default settings for advanced configuration options are used
118#
119CONFIG_HIGHMEM_START=0xfe000000
120CONFIG_LOWMEM_SIZE=0x30000000
121CONFIG_KERNEL_START=0xc0000000
122CONFIG_TASK_SIZE=0x80000000
123CONFIG_BOOT_LOAD=0x00800000
124
125#
126# Device Drivers
127#
128
129#
130# Generic Driver Options
131#
132CONFIG_STANDALONE=y
133CONFIG_PREVENT_FIRMWARE_BUILD=y
134# CONFIG_FW_LOADER is not set
135
136#
137# Memory Technology Devices (MTD)
138#
139# CONFIG_MTD is not set
140
141#
142# Parallel port support
143#
144# CONFIG_PARPORT is not set
145
146#
147# Plug and Play support
148#
149
150#
151# Block devices
152#
153# CONFIG_BLK_DEV_FD is not set
154# CONFIG_BLK_DEV_COW_COMMON is not set
155CONFIG_BLK_DEV_LOOP=y
156# CONFIG_BLK_DEV_CRYPTOLOOP is not set
157# CONFIG_BLK_DEV_NBD is not set
158CONFIG_BLK_DEV_RAM=y
159CONFIG_BLK_DEV_RAM_COUNT=16
160CONFIG_BLK_DEV_RAM_SIZE=32768
161CONFIG_BLK_DEV_INITRD=y
162CONFIG_INITRAMFS_SOURCE=""
163# CONFIG_LBD is not set
164# CONFIG_CDROM_PKTCDVD is not set
165
166#
167# IO Schedulers
168#
169CONFIG_IOSCHED_NOOP=y
170CONFIG_IOSCHED_AS=y
171CONFIG_IOSCHED_DEADLINE=y
172CONFIG_IOSCHED_CFQ=y
173# CONFIG_ATA_OVER_ETH is not set
174
175#
176# ATA/ATAPI/MFM/RLL support
177#
178# CONFIG_IDE is not set
179
180#
181# SCSI device support
182#
183# CONFIG_SCSI is not set
184
185#
186# Multi-device support (RAID and LVM)
187#
188# CONFIG_MD is not set
189
190#
191# Fusion MPT device support
192#
193
194#
195# IEEE 1394 (FireWire) support
196#
197
198#
199# I2O device support
200#
201
202#
203# Macintosh device drivers
204#
205
206#
207# Networking support
208#
209CONFIG_NET=y
210
211#
212# Networking options
213#
214CONFIG_PACKET=y
215# CONFIG_PACKET_MMAP is not set
216CONFIG_UNIX=y
217# CONFIG_NET_KEY is not set
218CONFIG_INET=y
219CONFIG_IP_MULTICAST=y
220# CONFIG_IP_ADVANCED_ROUTER is not set
221CONFIG_IP_PNP=y
222CONFIG_IP_PNP_DHCP=y
223CONFIG_IP_PNP_BOOTP=y
224# CONFIG_IP_PNP_RARP is not set
225# CONFIG_NET_IPIP is not set
226# CONFIG_NET_IPGRE is not set
227# CONFIG_IP_MROUTE is not set
228# CONFIG_ARPD is not set
229CONFIG_SYN_COOKIES=y
230# CONFIG_INET_AH is not set
231# CONFIG_INET_ESP is not set
232# CONFIG_INET_IPCOMP is not set
233# CONFIG_INET_TUNNEL is not set
234CONFIG_IP_TCPDIAG=y
235# CONFIG_IP_TCPDIAG_IPV6 is not set
236# CONFIG_IPV6 is not set
237# CONFIG_NETFILTER is not set
238
239#
240# SCTP Configuration (EXPERIMENTAL)
241#
242# CONFIG_IP_SCTP is not set
243# CONFIG_ATM is not set
244# CONFIG_BRIDGE is not set
245# CONFIG_VLAN_8021Q is not set
246# CONFIG_DECNET is not set
247# CONFIG_LLC2 is not set
248# CONFIG_IPX is not set
249# CONFIG_ATALK is not set
250# CONFIG_X25 is not set
251# CONFIG_LAPB is not set
252# CONFIG_NET_DIVERT is not set
253# CONFIG_ECONET is not set
254# CONFIG_WAN_ROUTER is not set
255
256#
257# QoS and/or fair queueing
258#
259# CONFIG_NET_SCHED is not set
260# CONFIG_NET_CLS_ROUTE is not set
261
262#
263# Network testing
264#
265# CONFIG_NET_PKTGEN is not set
266# CONFIG_NETPOLL is not set
267# CONFIG_NET_POLL_CONTROLLER is not set
268# CONFIG_HAMRADIO is not set
269# CONFIG_IRDA is not set
270# CONFIG_BT is not set
271CONFIG_NETDEVICES=y
272# CONFIG_DUMMY is not set
273# CONFIG_BONDING is not set
274# CONFIG_EQUALIZER is not set
275# CONFIG_TUN is not set
276
277#
278# Ethernet (10 or 100Mbit)
279#
280CONFIG_NET_ETHERNET=y
281CONFIG_MII=y
282
283#
284# Ethernet (1000 Mbit)
285#
286CONFIG_GIANFAR=y
287CONFIG_GFAR_NAPI=y
288
289#
290# Ethernet (10000 Mbit)
291#
292
293#
294# Token Ring devices
295#
296
297#
298# Wireless LAN (non-hamradio)
299#
300# CONFIG_NET_RADIO is not set
301
302#
303# Wan interfaces
304#
305# CONFIG_WAN is not set
306# CONFIG_PPP is not set
307# CONFIG_SLIP is not set
308# CONFIG_SHAPER is not set
309# CONFIG_NETCONSOLE is not set
310
311#
312# ISDN subsystem
313#
314# CONFIG_ISDN is not set
315
316#
317# Telephony Support
318#
319# CONFIG_PHONE is not set
320
321#
322# Input device support
323#
324CONFIG_INPUT=y
325
326#
327# Userland interfaces
328#
329# CONFIG_INPUT_MOUSEDEV is not set
330# CONFIG_INPUT_JOYDEV is not set
331# CONFIG_INPUT_TSDEV is not set
332# CONFIG_INPUT_EVDEV is not set
333# CONFIG_INPUT_EVBUG is not set
334
335#
336# Input Device Drivers
337#
338# CONFIG_INPUT_KEYBOARD is not set
339# CONFIG_INPUT_MOUSE is not set
340# CONFIG_INPUT_JOYSTICK is not set
341# CONFIG_INPUT_TOUCHSCREEN is not set
342# CONFIG_INPUT_MISC is not set
343
344#
345# Hardware I/O ports
346#
347# CONFIG_SERIO is not set
348# CONFIG_GAMEPORT is not set
349CONFIG_SOUND_GAMEPORT=y
350
351#
352# Character devices
353#
354# CONFIG_VT is not set
355# CONFIG_SERIAL_NONSTANDARD is not set
356
357#
358# Serial drivers
359#
360CONFIG_SERIAL_8250=y
361CONFIG_SERIAL_8250_CONSOLE=y
362CONFIG_SERIAL_8250_NR_UARTS=4
363# CONFIG_SERIAL_8250_EXTENDED is not set
364
365#
366# Non-8250 serial port support
367#
368CONFIG_SERIAL_CORE=y
369CONFIG_SERIAL_CORE_CONSOLE=y
370CONFIG_UNIX98_PTYS=y
371CONFIG_LEGACY_PTYS=y
372CONFIG_LEGACY_PTY_COUNT=256
373
374#
375# IPMI
376#
377# CONFIG_IPMI_HANDLER is not set
378
379#
380# Watchdog Cards
381#
382# CONFIG_WATCHDOG is not set
383# CONFIG_NVRAM is not set
384CONFIG_GEN_RTC=y
385# CONFIG_GEN_RTC_X is not set
386# CONFIG_DTLK is not set
387# CONFIG_R3964 is not set
388
389#
390# Ftape, the floppy tape device driver
391#
392# CONFIG_AGP is not set
393# CONFIG_DRM is not set
394# CONFIG_RAW_DRIVER is not set
395
396#
397# TPM devices
398#
399
400#
401# I2C support
402#
403CONFIG_I2C=y
404CONFIG_I2C_CHARDEV=y
405
406#
407# I2C Algorithms
408#
409# CONFIG_I2C_ALGOBIT is not set
410# CONFIG_I2C_ALGOPCF is not set
411# CONFIG_I2C_ALGOPCA is not set
412
413#
414# I2C Hardware Bus support
415#
416# CONFIG_I2C_ISA is not set
417CONFIG_I2C_MPC=y
418# CONFIG_I2C_PARPORT_LIGHT is not set
419# CONFIG_I2C_PCA_ISA is not set
420
421#
422# Hardware Sensors Chip support
423#
424# CONFIG_I2C_SENSOR is not set
425# CONFIG_SENSORS_ADM1021 is not set
426# CONFIG_SENSORS_ADM1025 is not set
427# CONFIG_SENSORS_ADM1026 is not set
428# CONFIG_SENSORS_ADM1031 is not set
429# CONFIG_SENSORS_ASB100 is not set
430# CONFIG_SENSORS_DS1621 is not set
431# CONFIG_SENSORS_FSCHER is not set
432# CONFIG_SENSORS_FSCPOS is not set
433# CONFIG_SENSORS_GL518SM is not set
434# CONFIG_SENSORS_GL520SM is not set
435# CONFIG_SENSORS_IT87 is not set
436# CONFIG_SENSORS_LM63 is not set
437# CONFIG_SENSORS_LM75 is not set
438# CONFIG_SENSORS_LM77 is not set
439# CONFIG_SENSORS_LM78 is not set
440# CONFIG_SENSORS_LM80 is not set
441# CONFIG_SENSORS_LM83 is not set
442# CONFIG_SENSORS_LM85 is not set
443# CONFIG_SENSORS_LM87 is not set
444# CONFIG_SENSORS_LM90 is not set
445# CONFIG_SENSORS_LM92 is not set
446# CONFIG_SENSORS_MAX1619 is not set
447# CONFIG_SENSORS_PC87360 is not set
448# CONFIG_SENSORS_SMSC47B397 is not set
449# CONFIG_SENSORS_SMSC47M1 is not set
450# CONFIG_SENSORS_W83781D is not set
451# CONFIG_SENSORS_W83L785TS is not set
452# CONFIG_SENSORS_W83627HF is not set
453
454#
455# Other I2C Chip support
456#
457# CONFIG_SENSORS_DS1337 is not set
458# CONFIG_SENSORS_EEPROM is not set
459# CONFIG_SENSORS_PCF8574 is not set
460# CONFIG_SENSORS_PCF8591 is not set
461# CONFIG_SENSORS_RTC8564 is not set
462# CONFIG_SENSORS_M41T00 is not set
463# CONFIG_I2C_DEBUG_CORE is not set
464# CONFIG_I2C_DEBUG_ALGO is not set
465# CONFIG_I2C_DEBUG_BUS is not set
466# CONFIG_I2C_DEBUG_CHIP is not set
467
468#
469# Dallas's 1-wire bus
470#
471# CONFIG_W1 is not set
472
473#
474# Misc devices
475#
476
477#
478# Multimedia devices
479#
480# CONFIG_VIDEO_DEV is not set
481
482#
483# Digital Video Broadcasting Devices
484#
485# CONFIG_DVB is not set
486
487#
488# Graphics support
489#
490# CONFIG_FB is not set
491
492#
493# Sound
494#
495# CONFIG_SOUND is not set
496
497#
498# USB support
499#
500# CONFIG_USB_ARCH_HAS_HCD is not set
501# CONFIG_USB_ARCH_HAS_OHCI is not set
502
503#
504# USB Gadget Support
505#
506# CONFIG_USB_GADGET is not set
507
508#
509# MMC/SD Card support
510#
511# CONFIG_MMC is not set
512
513#
514# InfiniBand support
515#
516# CONFIG_INFINIBAND is not set
517
518#
519# File systems
520#
521CONFIG_EXT2_FS=y
522# CONFIG_EXT2_FS_XATTR is not set
523CONFIG_EXT3_FS=y
524CONFIG_EXT3_FS_XATTR=y
525# CONFIG_EXT3_FS_POSIX_ACL is not set
526# CONFIG_EXT3_FS_SECURITY is not set
527CONFIG_JBD=y
528# CONFIG_JBD_DEBUG is not set
529CONFIG_FS_MBCACHE=y
530# CONFIG_REISERFS_FS is not set
531# CONFIG_JFS_FS is not set
532
533#
534# XFS support
535#
536# CONFIG_XFS_FS is not set
537# CONFIG_MINIX_FS is not set
538# CONFIG_ROMFS_FS is not set
539# CONFIG_QUOTA is not set
540CONFIG_DNOTIFY=y
541# CONFIG_AUTOFS_FS is not set
542# CONFIG_AUTOFS4_FS is not set
543
544#
545# CD-ROM/DVD Filesystems
546#
547# CONFIG_ISO9660_FS is not set
548# CONFIG_UDF_FS is not set
549
550#
551# DOS/FAT/NT Filesystems
552#
553# CONFIG_MSDOS_FS is not set
554# CONFIG_VFAT_FS is not set
555# CONFIG_NTFS_FS is not set
556
557#
558# Pseudo filesystems
559#
560CONFIG_PROC_FS=y
561CONFIG_PROC_KCORE=y
562CONFIG_SYSFS=y
563# CONFIG_DEVFS_FS is not set
564# CONFIG_DEVPTS_FS_XATTR is not set
565CONFIG_TMPFS=y
566# CONFIG_TMPFS_XATTR is not set
567# CONFIG_HUGETLB_PAGE is not set
568CONFIG_RAMFS=y
569
570#
571# Miscellaneous filesystems
572#
573# CONFIG_ADFS_FS is not set
574# CONFIG_AFFS_FS is not set
575# CONFIG_HFS_FS is not set
576# CONFIG_HFSPLUS_FS is not set
577# CONFIG_BEFS_FS is not set
578# CONFIG_BFS_FS is not set
579# CONFIG_EFS_FS is not set
580# CONFIG_CRAMFS is not set
581# CONFIG_VXFS_FS is not set
582# CONFIG_HPFS_FS is not set
583# CONFIG_QNX4FS_FS is not set
584# CONFIG_SYSV_FS is not set
585# CONFIG_UFS_FS is not set
586
587#
588# Network File Systems
589#
590CONFIG_NFS_FS=y
591# CONFIG_NFS_V3 is not set
592# CONFIG_NFS_V4 is not set
593# CONFIG_NFS_DIRECTIO is not set
594# CONFIG_NFSD is not set
595CONFIG_ROOT_NFS=y
596CONFIG_LOCKD=y
597CONFIG_SUNRPC=y
598# CONFIG_RPCSEC_GSS_KRB5 is not set
599# CONFIG_RPCSEC_GSS_SPKM3 is not set
600# CONFIG_SMB_FS is not set
601# CONFIG_CIFS is not set
602# CONFIG_NCP_FS is not set
603# CONFIG_CODA_FS is not set
604# CONFIG_AFS_FS is not set
605
606#
607# Partition Types
608#
609CONFIG_PARTITION_ADVANCED=y
610# CONFIG_ACORN_PARTITION is not set
611# CONFIG_OSF_PARTITION is not set
612# CONFIG_AMIGA_PARTITION is not set
613# CONFIG_ATARI_PARTITION is not set
614# CONFIG_MAC_PARTITION is not set
615# CONFIG_MSDOS_PARTITION is not set
616# CONFIG_LDM_PARTITION is not set
617# CONFIG_SGI_PARTITION is not set
618# CONFIG_ULTRIX_PARTITION is not set
619# CONFIG_SUN_PARTITION is not set
620# CONFIG_EFI_PARTITION is not set
621
622#
623# Native Language Support
624#
625# CONFIG_NLS is not set
626
627#
628# Library routines
629#
630# CONFIG_CRC_CCITT is not set
631CONFIG_CRC32=y
632# CONFIG_LIBCRC32C is not set
633
634#
635# Profiling support
636#
637# CONFIG_PROFILING is not set
638
639#
640# Kernel hacking
641#
642# CONFIG_PRINTK_TIME is not set
643# CONFIG_DEBUG_KERNEL is not set
644CONFIG_LOG_BUF_SHIFT=14
645
646#
647# Security options
648#
649# CONFIG_KEYS is not set
650# CONFIG_SECURITY is not set
651
652#
653# Cryptographic options
654#
655# CONFIG_CRYPTO is not set
656
657#
658# Hardware crypto devices
659#
diff --git a/arch/ppc/configs/mpc8555_cds_defconfig b/arch/ppc/configs/mpc8555_cds_defconfig
index 728bd9e1a8fa..15abebf46b96 100644
--- a/arch/ppc/configs/mpc8555_cds_defconfig
+++ b/arch/ppc/configs/mpc8555_cds_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc1 3# Linux kernel version: 2.6.12-rc4
4# Thu Jan 20 01:25:35 2005 4# Tue May 17 11:56:01 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y 7CONFIG_GENERIC_HARDIRQS=y
@@ -11,6 +11,7 @@ CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y 11CONFIG_PPC=y
12CONFIG_PPC32=y 12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y 13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14 15
15# 16#
16# Code maturity level options 17# Code maturity level options
@@ -18,6 +19,7 @@ CONFIG_GENERIC_NVRAM=y
18CONFIG_EXPERIMENTAL=y 19CONFIG_EXPERIMENTAL=y
19CONFIG_CLEAN_COMPILE=y 20CONFIG_CLEAN_COMPILE=y
20CONFIG_BROKEN_ON_SMP=y 21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
21 23
22# 24#
23# General setup 25# General setup
@@ -29,12 +31,14 @@ CONFIG_SYSVIPC=y
29# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y 32CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 33# CONFIG_AUDIT is not set
32CONFIG_LOG_BUF_SHIFT=14
33# CONFIG_HOTPLUG is not set 34# CONFIG_HOTPLUG is not set
34CONFIG_KOBJECT_UEVENT=y 35CONFIG_KOBJECT_UEVENT=y
35# CONFIG_IKCONFIG is not set 36# CONFIG_IKCONFIG is not set
36CONFIG_EMBEDDED=y 37CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set 38# CONFIG_KALLSYMS is not set
39CONFIG_PRINTK=y
40CONFIG_BUG=y
41CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 42CONFIG_FUTEX=y
39# CONFIG_EPOLL is not set 43# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -44,6 +48,7 @@ CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0 48CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0 49CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 50# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0
47 52
48# 53#
49# Loadable module support 54# Loadable module support
@@ -62,10 +67,12 @@ CONFIG_CC_ALIGN_JUMPS=0
62CONFIG_E500=y 67CONFIG_E500=y
63CONFIG_BOOKE=y 68CONFIG_BOOKE=y
64CONFIG_FSL_BOOKE=y 69CONFIG_FSL_BOOKE=y
70# CONFIG_PHYS_64BIT is not set
65CONFIG_SPE=y 71CONFIG_SPE=y
66CONFIG_MATH_EMULATION=y 72CONFIG_MATH_EMULATION=y
67# CONFIG_CPU_FREQ is not set 73# CONFIG_CPU_FREQ is not set
68CONFIG_PPC_GEN550=y 74CONFIG_PPC_GEN550=y
75# CONFIG_PM is not set
69CONFIG_85xx=y 76CONFIG_85xx=y
70CONFIG_PPC_INDIRECT_PCI_BE=y 77CONFIG_PPC_INDIRECT_PCI_BE=y
71 78
@@ -76,6 +83,7 @@ CONFIG_PPC_INDIRECT_PCI_BE=y
76CONFIG_MPC8555_CDS=y 83CONFIG_MPC8555_CDS=y
77# CONFIG_MPC8560_ADS is not set 84# CONFIG_MPC8560_ADS is not set
78# CONFIG_SBC8560 is not set 85# CONFIG_SBC8560 is not set
86# CONFIG_STX_GP3 is not set
79CONFIG_MPC8555=y 87CONFIG_MPC8555=y
80CONFIG_85xx_PCI2=y 88CONFIG_85xx_PCI2=y
81 89
@@ -90,6 +98,7 @@ CONFIG_CPM2=y
90CONFIG_BINFMT_ELF=y 98CONFIG_BINFMT_ELF=y
91# CONFIG_BINFMT_MISC is not set 99# CONFIG_BINFMT_MISC is not set
92# CONFIG_CMDLINE_BOOL is not set 100# CONFIG_CMDLINE_BOOL is not set
101CONFIG_ISA_DMA_API=y
93 102
94# 103#
95# Bus options 104# Bus options
@@ -105,10 +114,6 @@ CONFIG_PCI_NAMES=y
105# CONFIG_PCCARD is not set 114# CONFIG_PCCARD is not set
106 115
107# 116#
108# PC-card bridges
109#
110
111#
112# Advanced setup 117# Advanced setup
113# 118#
114# CONFIG_ADVANCED_OPTIONS is not set 119# CONFIG_ADVANCED_OPTIONS is not set
@@ -180,7 +185,59 @@ CONFIG_IOSCHED_CFQ=y
180# 185#
181# ATA/ATAPI/MFM/RLL support 186# ATA/ATAPI/MFM/RLL support
182# 187#
183# CONFIG_IDE is not set 188CONFIG_IDE=y
189CONFIG_BLK_DEV_IDE=y
190
191#
192# Please see Documentation/ide.txt for help/info on IDE drives
193#
194# CONFIG_BLK_DEV_IDE_SATA is not set
195CONFIG_BLK_DEV_IDEDISK=y
196# CONFIG_IDEDISK_MULTI_MODE is not set
197# CONFIG_BLK_DEV_IDECD is not set
198# CONFIG_BLK_DEV_IDETAPE is not set
199# CONFIG_BLK_DEV_IDEFLOPPY is not set
200# CONFIG_IDE_TASK_IOCTL is not set
201
202#
203# IDE chipset support/bugfixes
204#
205CONFIG_IDE_GENERIC=y
206CONFIG_BLK_DEV_IDEPCI=y
207CONFIG_IDEPCI_SHARE_IRQ=y
208# CONFIG_BLK_DEV_OFFBOARD is not set
209CONFIG_BLK_DEV_GENERIC=y
210# CONFIG_BLK_DEV_OPTI621 is not set
211# CONFIG_BLK_DEV_SL82C105 is not set
212CONFIG_BLK_DEV_IDEDMA_PCI=y
213# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
214CONFIG_IDEDMA_PCI_AUTO=y
215# CONFIG_IDEDMA_ONLYDISK is not set
216# CONFIG_BLK_DEV_AEC62XX is not set
217# CONFIG_BLK_DEV_ALI15X3 is not set
218# CONFIG_BLK_DEV_AMD74XX is not set
219# CONFIG_BLK_DEV_CMD64X is not set
220# CONFIG_BLK_DEV_TRIFLEX is not set
221# CONFIG_BLK_DEV_CY82C693 is not set
222# CONFIG_BLK_DEV_CS5520 is not set
223# CONFIG_BLK_DEV_CS5530 is not set
224# CONFIG_BLK_DEV_HPT34X is not set
225# CONFIG_BLK_DEV_HPT366 is not set
226# CONFIG_BLK_DEV_SC1200 is not set
227# CONFIG_BLK_DEV_PIIX is not set
228# CONFIG_BLK_DEV_NS87415 is not set
229# CONFIG_BLK_DEV_PDC202XX_OLD is not set
230# CONFIG_BLK_DEV_PDC202XX_NEW is not set
231# CONFIG_BLK_DEV_SVWKS is not set
232# CONFIG_BLK_DEV_SIIMAGE is not set
233# CONFIG_BLK_DEV_SLC90E66 is not set
234# CONFIG_BLK_DEV_TRM290 is not set
235CONFIG_BLK_DEV_VIA82CXXX=y
236# CONFIG_IDE_ARM is not set
237CONFIG_BLK_DEV_IDEDMA=y
238# CONFIG_IDEDMA_IVB is not set
239CONFIG_IDEDMA_AUTO=y
240# CONFIG_BLK_DEV_HD is not set
184 241
185# 242#
186# SCSI device support 243# SCSI device support
@@ -220,7 +277,6 @@ CONFIG_NET=y
220# 277#
221CONFIG_PACKET=y 278CONFIG_PACKET=y
222# CONFIG_PACKET_MMAP is not set 279# CONFIG_PACKET_MMAP is not set
223# CONFIG_NETLINK_DEV is not set
224CONFIG_UNIX=y 280CONFIG_UNIX=y
225# CONFIG_NET_KEY is not set 281# CONFIG_NET_KEY is not set
226CONFIG_INET=y 282CONFIG_INET=y
@@ -370,14 +426,6 @@ CONFIG_INPUT=y
370# CONFIG_INPUT_EVBUG is not set 426# CONFIG_INPUT_EVBUG is not set
371 427
372# 428#
373# Input I/O drivers
374#
375# CONFIG_GAMEPORT is not set
376CONFIG_SOUND_GAMEPORT=y
377# CONFIG_SERIO is not set
378# CONFIG_SERIO_I8042 is not set
379
380#
381# Input Device Drivers 429# Input Device Drivers
382# 430#
383# CONFIG_INPUT_KEYBOARD is not set 431# CONFIG_INPUT_KEYBOARD is not set
@@ -387,6 +435,13 @@ CONFIG_SOUND_GAMEPORT=y
387# CONFIG_INPUT_MISC is not set 435# CONFIG_INPUT_MISC is not set
388 436
389# 437#
438# Hardware I/O ports
439#
440# CONFIG_SERIO is not set
441# CONFIG_GAMEPORT is not set
442CONFIG_SOUND_GAMEPORT=y
443
444#
390# Character devices 445# Character devices
391# 446#
392# CONFIG_VT is not set 447# CONFIG_VT is not set
@@ -406,6 +461,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
406CONFIG_SERIAL_CORE=y 461CONFIG_SERIAL_CORE=y
407CONFIG_SERIAL_CORE_CONSOLE=y 462CONFIG_SERIAL_CORE_CONSOLE=y
408# CONFIG_SERIAL_CPM is not set 463# CONFIG_SERIAL_CPM is not set
464# CONFIG_SERIAL_JSM is not set
409CONFIG_UNIX98_PTYS=y 465CONFIG_UNIX98_PTYS=y
410CONFIG_LEGACY_PTYS=y 466CONFIG_LEGACY_PTYS=y
411CONFIG_LEGACY_PTY_COUNT=256 467CONFIG_LEGACY_PTY_COUNT=256
@@ -434,6 +490,11 @@ CONFIG_GEN_RTC=y
434# CONFIG_RAW_DRIVER is not set 490# CONFIG_RAW_DRIVER is not set
435 491
436# 492#
493# TPM devices
494#
495# CONFIG_TCG_TPM is not set
496
497#
437# I2C support 498# I2C support
438# 499#
439CONFIG_I2C=y 500CONFIG_I2C=y
@@ -456,11 +517,11 @@ CONFIG_I2C_CHARDEV=y
456# CONFIG_I2C_AMD8111 is not set 517# CONFIG_I2C_AMD8111 is not set
457# CONFIG_I2C_I801 is not set 518# CONFIG_I2C_I801 is not set
458# CONFIG_I2C_I810 is not set 519# CONFIG_I2C_I810 is not set
520# CONFIG_I2C_PIIX4 is not set
459# CONFIG_I2C_ISA is not set 521# CONFIG_I2C_ISA is not set
460CONFIG_I2C_MPC=y 522CONFIG_I2C_MPC=y
461# CONFIG_I2C_NFORCE2 is not set 523# CONFIG_I2C_NFORCE2 is not set
462# CONFIG_I2C_PARPORT_LIGHT is not set 524# CONFIG_I2C_PARPORT_LIGHT is not set
463# CONFIG_I2C_PIIX4 is not set
464# CONFIG_I2C_PROSAVAGE is not set 525# CONFIG_I2C_PROSAVAGE is not set
465# CONFIG_I2C_SAVAGE4 is not set 526# CONFIG_I2C_SAVAGE4 is not set
466# CONFIG_SCx200_ACB is not set 527# CONFIG_SCx200_ACB is not set
@@ -483,7 +544,9 @@ CONFIG_I2C_MPC=y
483# CONFIG_SENSORS_ASB100 is not set 544# CONFIG_SENSORS_ASB100 is not set
484# CONFIG_SENSORS_DS1621 is not set 545# CONFIG_SENSORS_DS1621 is not set
485# CONFIG_SENSORS_FSCHER is not set 546# CONFIG_SENSORS_FSCHER is not set
547# CONFIG_SENSORS_FSCPOS is not set
486# CONFIG_SENSORS_GL518SM is not set 548# CONFIG_SENSORS_GL518SM is not set
549# CONFIG_SENSORS_GL520SM is not set
487# CONFIG_SENSORS_IT87 is not set 550# CONFIG_SENSORS_IT87 is not set
488# CONFIG_SENSORS_LM63 is not set 551# CONFIG_SENSORS_LM63 is not set
489# CONFIG_SENSORS_LM75 is not set 552# CONFIG_SENSORS_LM75 is not set
@@ -494,9 +557,11 @@ CONFIG_I2C_MPC=y
494# CONFIG_SENSORS_LM85 is not set 557# CONFIG_SENSORS_LM85 is not set
495# CONFIG_SENSORS_LM87 is not set 558# CONFIG_SENSORS_LM87 is not set
496# CONFIG_SENSORS_LM90 is not set 559# CONFIG_SENSORS_LM90 is not set
560# CONFIG_SENSORS_LM92 is not set
497# CONFIG_SENSORS_MAX1619 is not set 561# CONFIG_SENSORS_MAX1619 is not set
498# CONFIG_SENSORS_PC87360 is not set 562# CONFIG_SENSORS_PC87360 is not set
499# CONFIG_SENSORS_SMSC47B397 is not set 563# CONFIG_SENSORS_SMSC47B397 is not set
564# CONFIG_SENSORS_SIS5595 is not set
500# CONFIG_SENSORS_SMSC47M1 is not set 565# CONFIG_SENSORS_SMSC47M1 is not set
501# CONFIG_SENSORS_VIA686A is not set 566# CONFIG_SENSORS_VIA686A is not set
502# CONFIG_SENSORS_W83781D is not set 567# CONFIG_SENSORS_W83781D is not set
@@ -506,10 +571,12 @@ CONFIG_I2C_MPC=y
506# 571#
507# Other I2C Chip support 572# Other I2C Chip support
508# 573#
574# CONFIG_SENSORS_DS1337 is not set
509# CONFIG_SENSORS_EEPROM is not set 575# CONFIG_SENSORS_EEPROM is not set
510# CONFIG_SENSORS_PCF8574 is not set 576# CONFIG_SENSORS_PCF8574 is not set
511# CONFIG_SENSORS_PCF8591 is not set 577# CONFIG_SENSORS_PCF8591 is not set
512# CONFIG_SENSORS_RTC8564 is not set 578# CONFIG_SENSORS_RTC8564 is not set
579# CONFIG_SENSORS_M41T00 is not set
513# CONFIG_I2C_DEBUG_CORE is not set 580# CONFIG_I2C_DEBUG_CORE is not set
514# CONFIG_I2C_DEBUG_ALGO is not set 581# CONFIG_I2C_DEBUG_ALGO is not set
515# CONFIG_I2C_DEBUG_BUS is not set 582# CONFIG_I2C_DEBUG_BUS is not set
@@ -538,7 +605,6 @@ CONFIG_I2C_MPC=y
538# Graphics support 605# Graphics support
539# 606#
540# CONFIG_FB is not set 607# CONFIG_FB is not set
541# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
542 608
543# 609#
544# Sound 610# Sound
@@ -548,13 +614,9 @@ CONFIG_I2C_MPC=y
548# 614#
549# USB support 615# USB support
550# 616#
551# CONFIG_USB is not set
552CONFIG_USB_ARCH_HAS_HCD=y 617CONFIG_USB_ARCH_HAS_HCD=y
553CONFIG_USB_ARCH_HAS_OHCI=y 618CONFIG_USB_ARCH_HAS_OHCI=y
554 619# CONFIG_USB is not set
555#
556# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
557#
558 620
559# 621#
560# USB Gadget Support 622# USB Gadget Support
@@ -585,6 +647,10 @@ CONFIG_JBD=y
585CONFIG_FS_MBCACHE=y 647CONFIG_FS_MBCACHE=y
586# CONFIG_REISERFS_FS is not set 648# CONFIG_REISERFS_FS is not set
587# CONFIG_JFS_FS is not set 649# CONFIG_JFS_FS is not set
650
651#
652# XFS support
653#
588# CONFIG_XFS_FS is not set 654# CONFIG_XFS_FS is not set
589# CONFIG_MINIX_FS is not set 655# CONFIG_MINIX_FS is not set
590# CONFIG_ROMFS_FS is not set 656# CONFIG_ROMFS_FS is not set
@@ -646,7 +712,6 @@ CONFIG_NFS_FS=y
646# CONFIG_NFSD is not set 712# CONFIG_NFSD is not set
647CONFIG_ROOT_NFS=y 713CONFIG_ROOT_NFS=y
648CONFIG_LOCKD=y 714CONFIG_LOCKD=y
649# CONFIG_EXPORTFS is not set
650CONFIG_SUNRPC=y 715CONFIG_SUNRPC=y
651# CONFIG_RPCSEC_GSS_KRB5 is not set 716# CONFIG_RPCSEC_GSS_KRB5 is not set
652# CONFIG_RPCSEC_GSS_SPKM3 is not set 717# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -698,7 +763,9 @@ CONFIG_CRC32=y
698# 763#
699# Kernel hacking 764# Kernel hacking
700# 765#
766# CONFIG_PRINTK_TIME is not set
701# CONFIG_DEBUG_KERNEL is not set 767# CONFIG_DEBUG_KERNEL is not set
768CONFIG_LOG_BUF_SHIFT=14
702# CONFIG_KGDB_CONSOLE is not set 769# CONFIG_KGDB_CONSOLE is not set
703# CONFIG_SERIAL_TEXT_DEBUG is not set 770# CONFIG_SERIAL_TEXT_DEBUG is not set
704 771
diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c
index 8aa5e8c69009..01c226008dbf 100644
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/ppc/kernel/cputable.c
@@ -838,6 +838,17 @@ struct cpu_spec cpu_specs[] = {
838 .icache_bsize = 32, 838 .icache_bsize = 32,
839 .dcache_bsize = 32, 839 .dcache_bsize = 32,
840 }, 840 },
841 { /* 405EP */
842 .pvr_mask = 0xffff0000,
843 .pvr_value = 0x51210000,
844 .cpu_name = "405EP",
845 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
846 CPU_FTR_USE_TB,
847 .cpu_user_features = PPC_FEATURE_32 |
848 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
849 .icache_bsize = 32,
850 .dcache_bsize = 32,
851 },
841 852
842#endif /* CONFIG_40x */ 853#endif /* CONFIG_40x */
843#ifdef CONFIG_44x 854#ifdef CONFIG_44x
@@ -907,6 +918,20 @@ struct cpu_spec cpu_specs[] = {
907 .dcache_bsize = 32, 918 .dcache_bsize = 32,
908 .num_pmcs = 4, 919 .num_pmcs = 4,
909 }, 920 },
921 { /* e500v2 */
922 .pvr_mask = 0xffff0000,
923 .pvr_value = 0x80210000,
924 .cpu_name = "e500v2",
925 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
926 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
927 CPU_FTR_USE_TB | CPU_FTR_BIG_PHYS,
928 .cpu_user_features = PPC_FEATURE_32 |
929 PPC_FEATURE_HAS_MMU | PPC_FEATURE_SPE_COMP |
930 PPC_FEATURE_HAS_EFP_SINGLE | PPC_FEATURE_HAS_EFP_DOUBLE,
931 .icache_bsize = 32,
932 .dcache_bsize = 32,
933 .num_pmcs = 4,
934 },
910#endif 935#endif
911#if !CLASSIC_PPC 936#if !CLASSIC_PPC
912 { /* default match */ 937 { /* default match */
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index 5f075dbc4ee7..8377b6ca26da 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -46,26 +46,23 @@
46 46
47#ifdef CONFIG_BOOKE 47#ifdef CONFIG_BOOKE
48#include "head_booke.h" 48#include "head_booke.h"
49#define TRANSFER_TO_HANDLER_EXC_LEVEL(exc_level) \
50 mtspr exc_level##_SPRG,r8; \
51 BOOKE_LOAD_EXC_LEVEL_STACK(exc_level); \
52 lwz r0,GPR10-INT_FRAME_SIZE(r8); \
53 stw r0,GPR10(r11); \
54 lwz r0,GPR11-INT_FRAME_SIZE(r8); \
55 stw r0,GPR11(r11); \
56 mfspr r8,exc_level##_SPRG
57
49 .globl mcheck_transfer_to_handler 58 .globl mcheck_transfer_to_handler
50mcheck_transfer_to_handler: 59mcheck_transfer_to_handler:
51 mtspr MCHECK_SPRG,r8 60 TRANSFER_TO_HANDLER_EXC_LEVEL(MCHECK)
52 BOOKE_LOAD_MCHECK_STACK
53 lwz r0,GPR10-INT_FRAME_SIZE(r8)
54 stw r0,GPR10(r11)
55 lwz r0,GPR11-INT_FRAME_SIZE(r8)
56 stw r0,GPR11(r11)
57 mfspr r8,MCHECK_SPRG
58 b transfer_to_handler_full 61 b transfer_to_handler_full
59 62
60 .globl crit_transfer_to_handler 63 .globl crit_transfer_to_handler
61crit_transfer_to_handler: 64crit_transfer_to_handler:
62 mtspr CRIT_SPRG,r8 65 TRANSFER_TO_HANDLER_EXC_LEVEL(CRIT)
63 BOOKE_LOAD_CRIT_STACK
64 lwz r0,GPR10-INT_FRAME_SIZE(r8)
65 stw r0,GPR10(r11)
66 lwz r0,GPR11-INT_FRAME_SIZE(r8)
67 stw r0,GPR11(r11)
68 mfspr r8,CRIT_SPRG
69 /* fall through */ 66 /* fall through */
70#endif 67#endif
71 68
@@ -202,7 +199,7 @@ _GLOBAL(DoSyscall)
202 rlwinm r11,r11,0,~_TIFL_FORCE_NOERROR 199 rlwinm r11,r11,0,~_TIFL_FORCE_NOERROR
203 stw r11,TI_LOCAL_FLAGS(r10) 200 stw r11,TI_LOCAL_FLAGS(r10)
204 lwz r11,TI_FLAGS(r10) 201 lwz r11,TI_FLAGS(r10)
205 andi. r11,r11,_TIF_SYSCALL_TRACE 202 andi. r11,r11,_TIF_SYSCALL_T_OR_A
206 bne- syscall_dotrace 203 bne- syscall_dotrace
207syscall_dotrace_cont: 204syscall_dotrace_cont:
208 cmplwi 0,r0,NR_syscalls 205 cmplwi 0,r0,NR_syscalls
@@ -237,7 +234,7 @@ ret_from_syscall:
237 SYNC 234 SYNC
238 MTMSRD(r10) 235 MTMSRD(r10)
239 lwz r9,TI_FLAGS(r12) 236 lwz r9,TI_FLAGS(r12)
240 andi. r0,r9,(_TIF_SYSCALL_TRACE|_TIF_SIGPENDING|_TIF_NEED_RESCHED) 237 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED)
241 bne- syscall_exit_work 238 bne- syscall_exit_work
242syscall_exit_cont: 239syscall_exit_cont:
243#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 240#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
@@ -277,7 +274,8 @@ syscall_dotrace:
277 SAVE_NVGPRS(r1) 274 SAVE_NVGPRS(r1)
278 li r0,0xc00 275 li r0,0xc00
279 stw r0,TRAP(r1) 276 stw r0,TRAP(r1)
280 bl do_syscall_trace 277 addi r3,r1,STACK_FRAME_OVERHEAD
278 bl do_syscall_trace_enter
281 lwz r0,GPR0(r1) /* Restore original registers */ 279 lwz r0,GPR0(r1) /* Restore original registers */
282 lwz r3,GPR3(r1) 280 lwz r3,GPR3(r1)
283 lwz r4,GPR4(r1) 281 lwz r4,GPR4(r1)
@@ -291,7 +289,7 @@ syscall_dotrace:
291syscall_exit_work: 289syscall_exit_work:
292 stw r6,RESULT(r1) /* Save result */ 290 stw r6,RESULT(r1) /* Save result */
293 stw r3,GPR3(r1) /* Update return value */ 291 stw r3,GPR3(r1) /* Update return value */
294 andi. r0,r9,_TIF_SYSCALL_TRACE 292 andi. r0,r9,_TIF_SYSCALL_T_OR_A
295 beq 5f 293 beq 5f
296 ori r10,r10,MSR_EE 294 ori r10,r10,MSR_EE
297 SYNC 295 SYNC
@@ -303,7 +301,8 @@ syscall_exit_work:
303 li r4,0xc00 301 li r4,0xc00
304 stw r4,TRAP(r1) 302 stw r4,TRAP(r1)
3054: 3034:
306 bl do_syscall_trace 304 addi r3,r1,STACK_FRAME_OVERHEAD
305 bl do_syscall_trace_leave
307 REST_NVGPRS(r1) 306 REST_NVGPRS(r1)
3082: 3072:
309 lwz r3,GPR3(r1) 308 lwz r3,GPR3(r1)
@@ -627,8 +626,8 @@ sigreturn_exit:
627 subi r1,r3,STACK_FRAME_OVERHEAD 626 subi r1,r3,STACK_FRAME_OVERHEAD
628 rlwinm r12,r1,0,0,18 /* current_thread_info() */ 627 rlwinm r12,r1,0,0,18 /* current_thread_info() */
629 lwz r9,TI_FLAGS(r12) 628 lwz r9,TI_FLAGS(r12)
630 andi. r0,r9,_TIF_SYSCALL_TRACE 629 andi. r0,r9,_TIF_SYSCALL_T_OR_A
631 bnel- do_syscall_trace 630 bnel- do_syscall_trace_leave
632 /* fall through */ 631 /* fall through */
633 632
634 .globl ret_from_except_full 633 .globl ret_from_except_full
@@ -781,99 +780,64 @@ exc_exit_restart_end:
781 * time of the critical interrupt. 780 * time of the critical interrupt.
782 * 781 *
783 */ 782 */
784 .globl ret_from_crit_exc
785ret_from_crit_exc:
786 REST_NVGPRS(r1)
787 lwz r3,_MSR(r1)
788 andi. r3,r3,MSR_PR
789 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
790 bne user_exc_return
791
792 lwz r0,GPR0(r1)
793 lwz r2,GPR2(r1)
794 REST_4GPRS(3, r1)
795 REST_2GPRS(7, r1)
796
797 lwz r10,_XER(r1)
798 lwz r11,_CTR(r1)
799 mtspr SPRN_XER,r10
800 mtctr r11
801
802 PPC405_ERR77(0,r1)
803 stwcx. r0,0,r1 /* to clear the reservation */
804
805 lwz r11,_LINK(r1)
806 mtlr r11
807 lwz r10,_CCR(r1)
808 mtcrf 0xff,r10
809#ifdef CONFIG_40x 783#ifdef CONFIG_40x
810 /* avoid any possible TLB misses here by turning off MSR.DR, we 784#define PPC_40x_TURN_OFF_MSR_DR \
811 * assume the instructions here are mapped by a pinned TLB entry */ 785 /* avoid any possible TLB misses here by turning off MSR.DR, we \
812 li r10,MSR_IR 786 * assume the instructions here are mapped by a pinned TLB entry */ \
813 mtmsr r10 787 li r10,MSR_IR; \
814 isync 788 mtmsr r10; \
815 tophys(r1, r1) 789 isync; \
790 tophys(r1, r1);
791#else
792#define PPC_40x_TURN_OFF_MSR_DR
816#endif 793#endif
817 lwz r9,_DEAR(r1) 794
818 lwz r10,_ESR(r1) 795#define RET_FROM_EXC_LEVEL(exc_lvl_srr0, exc_lvl_srr1, exc_lvl_rfi) \
819 mtspr SPRN_DEAR,r9 796 REST_NVGPRS(r1); \
820 mtspr SPRN_ESR,r10 797 lwz r3,_MSR(r1); \
821 lwz r11,_NIP(r1) 798 andi. r3,r3,MSR_PR; \
822 lwz r12,_MSR(r1) 799 LOAD_MSR_KERNEL(r10,MSR_KERNEL); \
823 mtspr SPRN_CSRR0,r11 800 bne user_exc_return; \
824 mtspr SPRN_CSRR1,r12 801 lwz r0,GPR0(r1); \
825 lwz r9,GPR9(r1) 802 lwz r2,GPR2(r1); \
826 lwz r12,GPR12(r1) 803 REST_4GPRS(3, r1); \
827 lwz r10,GPR10(r1) 804 REST_2GPRS(7, r1); \
828 lwz r11,GPR11(r1) 805 lwz r10,_XER(r1); \
829 lwz r1,GPR1(r1) 806 lwz r11,_CTR(r1); \
830 PPC405_ERR77_SYNC 807 mtspr SPRN_XER,r10; \
831 rfci 808 mtctr r11; \
832 b . /* prevent prefetch past rfci */ 809 PPC405_ERR77(0,r1); \
810 stwcx. r0,0,r1; /* to clear the reservation */ \
811 lwz r11,_LINK(r1); \
812 mtlr r11; \
813 lwz r10,_CCR(r1); \
814 mtcrf 0xff,r10; \
815 PPC_40x_TURN_OFF_MSR_DR; \
816 lwz r9,_DEAR(r1); \
817 lwz r10,_ESR(r1); \
818 mtspr SPRN_DEAR,r9; \
819 mtspr SPRN_ESR,r10; \
820 lwz r11,_NIP(r1); \
821 lwz r12,_MSR(r1); \
822 mtspr exc_lvl_srr0,r11; \
823 mtspr exc_lvl_srr1,r12; \
824 lwz r9,GPR9(r1); \
825 lwz r12,GPR12(r1); \
826 lwz r10,GPR10(r1); \
827 lwz r11,GPR11(r1); \
828 lwz r1,GPR1(r1); \
829 PPC405_ERR77_SYNC; \
830 exc_lvl_rfi; \
831 b .; /* prevent prefetch past exc_lvl_rfi */
832
833 .globl ret_from_crit_exc
834ret_from_crit_exc:
835 RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, RFCI)
833 836
834#ifdef CONFIG_BOOKE 837#ifdef CONFIG_BOOKE
835/*
836 * Return from a machine check interrupt, similar to a critical
837 * interrupt.
838 */
839 .globl ret_from_mcheck_exc 838 .globl ret_from_mcheck_exc
840ret_from_mcheck_exc: 839ret_from_mcheck_exc:
841 REST_NVGPRS(r1) 840 RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, RFMCI)
842 lwz r3,_MSR(r1)
843 andi. r3,r3,MSR_PR
844 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
845 bne user_exc_return
846
847 lwz r0,GPR0(r1)
848 lwz r2,GPR2(r1)
849 REST_4GPRS(3, r1)
850 REST_2GPRS(7, r1)
851
852 lwz r10,_XER(r1)
853 lwz r11,_CTR(r1)
854 mtspr SPRN_XER,r10
855 mtctr r11
856
857 stwcx. r0,0,r1 /* to clear the reservation */
858
859 lwz r11,_LINK(r1)
860 mtlr r11
861 lwz r10,_CCR(r1)
862 mtcrf 0xff,r10
863 lwz r9,_DEAR(r1)
864 lwz r10,_ESR(r1)
865 mtspr SPRN_DEAR,r9
866 mtspr SPRN_ESR,r10
867 lwz r11,_NIP(r1)
868 lwz r12,_MSR(r1)
869 mtspr SPRN_MCSRR0,r11
870 mtspr SPRN_MCSRR1,r12
871 lwz r9,GPR9(r1)
872 lwz r12,GPR12(r1)
873 lwz r10,GPR10(r1)
874 lwz r11,GPR11(r1)
875 lwz r1,GPR1(r1)
876 RFMCI
877#endif /* CONFIG_BOOKE */ 841#endif /* CONFIG_BOOKE */
878 842
879/* 843/*
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
index 9b6a8e513657..6c7ae6052464 100644
--- a/arch/ppc/kernel/head_44x.S
+++ b/arch/ppc/kernel/head_44x.S
@@ -330,8 +330,9 @@ interrupt_base:
330 /* If we are faulting a kernel address, we have to use the 330 /* If we are faulting a kernel address, we have to use the
331 * kernel page tables. 331 * kernel page tables.
332 */ 332 */
333 andis. r11, r10, 0x8000 333 lis r11, TASK_SIZE@h
334 beq 3f 334 cmplw r10, r11
335 blt+ 3f
335 lis r11, swapper_pg_dir@h 336 lis r11, swapper_pg_dir@h
336 ori r11, r11, swapper_pg_dir@l 337 ori r11, r11, swapper_pg_dir@l
337 338
@@ -464,8 +465,9 @@ interrupt_base:
464 /* If we are faulting a kernel address, we have to use the 465 /* If we are faulting a kernel address, we have to use the
465 * kernel page tables. 466 * kernel page tables.
466 */ 467 */
467 andis. r11, r10, 0x8000 468 lis r11, TASK_SIZE@h
468 beq 3f 469 cmplw r10, r11
470 blt+ 3f
469 lis r11, swapper_pg_dir@h 471 lis r11, swapper_pg_dir@h
470 ori r11, r11, swapper_pg_dir@l 472 ori r11, r11, swapper_pg_dir@l
471 473
@@ -533,8 +535,9 @@ interrupt_base:
533 /* If we are faulting a kernel address, we have to use the 535 /* If we are faulting a kernel address, we have to use the
534 * kernel page tables. 536 * kernel page tables.
535 */ 537 */
536 andis. r11, r10, 0x8000 538 lis r11, TASK_SIZE@h
537 beq 3f 539 cmplw r10, r11
540 blt+ 3f
538 lis r11, swapper_pg_dir@h 541 lis r11, swapper_pg_dir@h
539 ori r11, r11, swapper_pg_dir@l 542 ori r11, r11, swapper_pg_dir@l
540 543
diff --git a/arch/ppc/kernel/head_4xx.S b/arch/ppc/kernel/head_4xx.S
index 6f5d380e2345..23fb51819ba5 100644
--- a/arch/ppc/kernel/head_4xx.S
+++ b/arch/ppc/kernel/head_4xx.S
@@ -291,8 +291,9 @@ label:
291 /* If we are faulting a kernel address, we have to use the 291 /* If we are faulting a kernel address, we have to use the
292 * kernel page tables. 292 * kernel page tables.
293 */ 293 */
294 andis. r11, r10, 0x8000 294 lis r11, TASK_SIZE@h
295 beq 3f 295 cmplw r10, r11
296 blt+ 3f
296 lis r11, swapper_pg_dir@h 297 lis r11, swapper_pg_dir@h
297 ori r11, r11, swapper_pg_dir@l 298 ori r11, r11, swapper_pg_dir@l
298 li r9, 0 299 li r9, 0
@@ -479,8 +480,9 @@ label:
479 /* If we are faulting a kernel address, we have to use the 480 /* If we are faulting a kernel address, we have to use the
480 * kernel page tables. 481 * kernel page tables.
481 */ 482 */
482 andis. r11, r10, 0x8000 483 lis r11, TASK_SIZE@h
483 beq 3f 484 cmplw r10, r11
485 blt+ 3f
484 lis r11, swapper_pg_dir@h 486 lis r11, swapper_pg_dir@h
485 ori r11, r11, swapper_pg_dir@l 487 ori r11, r11, swapper_pg_dir@l
486 li r9, 0 488 li r9, 0
@@ -578,8 +580,9 @@ label:
578 /* If we are faulting a kernel address, we have to use the 580 /* If we are faulting a kernel address, we have to use the
579 * kernel page tables. 581 * kernel page tables.
580 */ 582 */
581 andis. r11, r10, 0x8000 583 lis r11, TASK_SIZE@h
582 beq 3f 584 cmplw r10, r11
585 blt+ 3f
583 lis r11, swapper_pg_dir@h 586 lis r11, swapper_pg_dir@h
584 ori r11, r11, swapper_pg_dir@l 587 ori r11, r11, swapper_pg_dir@l
585 li r9, 0 588 li r9, 0
diff --git a/arch/ppc/kernel/head_booke.h b/arch/ppc/kernel/head_booke.h
index f213d12eec08..9c50f9d2657c 100644
--- a/arch/ppc/kernel/head_booke.h
+++ b/arch/ppc/kernel/head_booke.h
@@ -67,46 +67,36 @@
67#define CRIT_STACK_TOP (exception_stack_top) 67#define CRIT_STACK_TOP (exception_stack_top)
68 68
69#ifdef CONFIG_SMP 69#ifdef CONFIG_SMP
70#define BOOKE_LOAD_CRIT_STACK \ 70#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
71 mfspr r8,SPRN_PIR; \ 71 mfspr r8,SPRN_PIR; \
72 mulli r8,r8,BOOKE_EXCEPTION_STACK_SIZE; \ 72 mulli r8,r8,BOOKE_EXCEPTION_STACK_SIZE; \
73 neg r8,r8; \ 73 neg r8,r8; \
74 addis r8,r8,CRIT_STACK_TOP@ha; \ 74 addis r8,r8,level##_STACK_TOP@ha; \
75 addi r8,r8,CRIT_STACK_TOP@l 75 addi r8,r8,level##_STACK_TOP@l
76#define BOOKE_LOAD_MCHECK_STACK \
77 mfspr r8,SPRN_PIR; \
78 mulli r8,r8,BOOKE_EXCEPTION_STACK_SIZE; \
79 neg r8,r8; \
80 addis r8,r8,MCHECK_STACK_TOP@ha; \
81 addi r8,r8,MCHECK_STACK_TOP@l
82#else 76#else
83#define BOOKE_LOAD_CRIT_STACK \ 77#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
84 lis r8,CRIT_STACK_TOP@h; \ 78 lis r8,level##_STACK_TOP@h; \
85 ori r8,r8,CRIT_STACK_TOP@l 79 ori r8,r8,level##_STACK_TOP@l
86#define BOOKE_LOAD_MCHECK_STACK \
87 lis r8,MCHECK_STACK_TOP@h; \
88 ori r8,r8,MCHECK_STACK_TOP@l
89#endif 80#endif
90 81
91/* 82/*
92 * Exception prolog for critical exceptions. This is a little different 83 * Exception prolog for critical/machine check exceptions. This is a
93 * from the normal exception prolog above since a critical exception 84 * little different from the normal exception prolog above since a
94 * can potentially occur at any point during normal exception processing. 85 * critical/machine check exception can potentially occur at any point
95 * Thus we cannot use the same SPRG registers as the normal prolog above. 86 * during normal exception processing. Thus we cannot use the same SPRG
96 * Instead we use a portion of the critical exception stack at low physical 87 * registers as the normal prolog above. Instead we use a portion of the
97 * addresses. 88 * critical/machine check exception stack at low physical addresses.
98 */ 89 */
99 90#define EXC_LEVEL_EXCEPTION_PROLOG(exc_level, exc_level_srr0, exc_level_srr1) \
100#define CRITICAL_EXCEPTION_PROLOG \ 91 mtspr exc_level##_SPRG,r8; \
101 mtspr CRIT_SPRG,r8; \ 92 BOOKE_LOAD_EXC_LEVEL_STACK(exc_level);/* r8 points to the exc_level stack*/ \
102 BOOKE_LOAD_CRIT_STACK; /* r8 points to the crit stack */ \
103 stw r10,GPR10-INT_FRAME_SIZE(r8); \ 93 stw r10,GPR10-INT_FRAME_SIZE(r8); \
104 stw r11,GPR11-INT_FRAME_SIZE(r8); \ 94 stw r11,GPR11-INT_FRAME_SIZE(r8); \
105 mfcr r10; /* save CR in r10 for now */\ 95 mfcr r10; /* save CR in r10 for now */\
106 mfspr r11,SPRN_CSRR1; /* check whether user or kernel */\ 96 mfspr r11,exc_level_srr1; /* check whether user or kernel */\
107 andi. r11,r11,MSR_PR; \ 97 andi. r11,r11,MSR_PR; \
108 mr r11,r8; \ 98 mr r11,r8; \
109 mfspr r8,CRIT_SPRG; \ 99 mfspr r8,exc_level##_SPRG; \
110 beq 1f; \ 100 beq 1f; \
111 /* COMING FROM USER MODE */ \ 101 /* COMING FROM USER MODE */ \
112 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\ 102 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\
@@ -122,9 +112,9 @@
122 stw r12,_DEAR(r11); /* since they may have had stuff */\ 112 stw r12,_DEAR(r11); /* since they may have had stuff */\
123 mfspr r9,SPRN_ESR; /* in them at the point where the */\ 113 mfspr r9,SPRN_ESR; /* in them at the point where the */\
124 stw r9,_ESR(r11); /* exception was taken */\ 114 stw r9,_ESR(r11); /* exception was taken */\
125 mfspr r12,SPRN_CSRR0; \ 115 mfspr r12,exc_level_srr0; \
126 stw r1,GPR1(r11); \ 116 stw r1,GPR1(r11); \
127 mfspr r9,SPRN_CSRR1; \ 117 mfspr r9,exc_level_srr1; \
128 stw r1,0(r11); \ 118 stw r1,0(r11); \
129 mr r1,r11; \ 119 mr r1,r11; \
130 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\ 120 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
@@ -132,45 +122,10 @@
132 SAVE_4GPRS(3, r11); \ 122 SAVE_4GPRS(3, r11); \
133 SAVE_2GPRS(7, r11) 123 SAVE_2GPRS(7, r11)
134 124
135/* 125#define CRITICAL_EXCEPTION_PROLOG \
136 * Exception prolog for machine check exceptions. This is similar to 126 EXC_LEVEL_EXCEPTION_PROLOG(CRIT, SPRN_CSRR0, SPRN_CSRR1)
137 * the critical exception prolog, except that machine check exceptions 127#define MCHECK_EXCEPTION_PROLOG \
138 * have their stack. 128 EXC_LEVEL_EXCEPTION_PROLOG(MCHECK, SPRN_MCSRR0, SPRN_MCSRR1)
139 */
140#define MCHECK_EXCEPTION_PROLOG \
141 mtspr MCHECK_SPRG,r8; \
142 BOOKE_LOAD_MCHECK_STACK; /* r8 points to the mcheck stack */\
143 stw r10,GPR10-INT_FRAME_SIZE(r8); \
144 stw r11,GPR11-INT_FRAME_SIZE(r8); \
145 mfcr r10; /* save CR in r10 for now */\
146 mfspr r11,SPRN_MCSRR1; /* check whether user or kernel */\
147 andi. r11,r11,MSR_PR; \
148 mr r11,r8; \
149 mfspr r8,MCHECK_SPRG; \
150 beq 1f; \
151 /* COMING FROM USER MODE */ \
152 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\
153 lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
154 addi r11,r11,THREAD_SIZE; \
1551: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\
156 stw r10,_CCR(r11); /* save various registers */\
157 stw r12,GPR12(r11); \
158 stw r9,GPR9(r11); \
159 mflr r10; \
160 stw r10,_LINK(r11); \
161 mfspr r12,SPRN_DEAR; /* save DEAR and ESR in the frame */\
162 stw r12,_DEAR(r11); /* since they may have had stuff */\
163 mfspr r9,SPRN_ESR; /* in them at the point where the */\
164 stw r9,_ESR(r11); /* exception was taken */\
165 mfspr r12,SPRN_MCSRR0; \
166 stw r1,GPR1(r11); \
167 mfspr r9,SPRN_MCSRR1; \
168 stw r1,0(r11); \
169 mr r1,r11; \
170 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
171 stw r0,GPR0(r11); \
172 SAVE_4GPRS(3, r11); \
173 SAVE_2GPRS(7, r11)
174 129
175/* 130/*
176 * Exception vectors. 131 * Exception vectors.
@@ -237,7 +192,6 @@ label:
237 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \ 192 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \
238 ret_from_except) 193 ret_from_except)
239 194
240
241/* Check for a single step debug exception while in an exception 195/* Check for a single step debug exception while in an exception
242 * handler before state has been saved. This is to catch the case 196 * handler before state has been saved. This is to catch the case
243 * where an instruction that we are trying to single step causes 197 * where an instruction that we are trying to single step causes
@@ -291,7 +245,7 @@ label:
291 lwz r9,GPR9(r11); \ 245 lwz r9,GPR9(r11); \
292 lwz r12,GPR12(r11); \ 246 lwz r12,GPR12(r11); \
293 mtspr CRIT_SPRG,r8; \ 247 mtspr CRIT_SPRG,r8; \
294 BOOKE_LOAD_CRIT_STACK; /* r8 points to the crit stack */ \ 248 BOOKE_LOAD_EXC_LEVEL_STACK(CRIT); /* r8 points to the debug stack */ \
295 lwz r10,GPR10-INT_FRAME_SIZE(r8); \ 249 lwz r10,GPR10-INT_FRAME_SIZE(r8); \
296 lwz r11,GPR11-INT_FRAME_SIZE(r8); \ 250 lwz r11,GPR11-INT_FRAME_SIZE(r8); \
297 mfspr r8,CRIT_SPRG; \ 251 mfspr r8,CRIT_SPRG; \
diff --git a/arch/ppc/kernel/head_fsl_booke.S b/arch/ppc/kernel/head_fsl_booke.S
index f22ddce36135..ce36e88ba627 100644
--- a/arch/ppc/kernel/head_fsl_booke.S
+++ b/arch/ppc/kernel/head_fsl_booke.S
@@ -232,7 +232,8 @@ skpinv: addi r6,r6,1 /* Increment */
232 tlbwe 232 tlbwe
233 233
234/* 7. Jump to KERNELBASE mapping */ 234/* 7. Jump to KERNELBASE mapping */
235 li r7,0 235 lis r7,MSR_KERNEL@h
236 ori r7,r7,MSR_KERNEL@l
236 bl 1f /* Find our address */ 237 bl 1f /* Find our address */
2371: mflr r9 2381: mflr r9
238 rlwimi r6,r9,0,20,31 239 rlwimi r6,r9,0,20,31
@@ -293,6 +294,18 @@ skpinv: addi r6,r6,1 /* Increment */
293 mtspr SPRN_HID0, r2 294 mtspr SPRN_HID0, r2
294#endif 295#endif
295 296
297#if !defined(CONFIG_BDI_SWITCH)
298 /*
299 * The Abatron BDI JTAG debugger does not tolerate others
300 * mucking with the debug registers.
301 */
302 lis r2,DBCR0_IDM@h
303 mtspr SPRN_DBCR0,r2
304 /* clear any residual debug events */
305 li r2,-1
306 mtspr SPRN_DBSR,r2
307#endif
308
296 /* 309 /*
297 * This is where the main kernel code starts. 310 * This is where the main kernel code starts.
298 */ 311 */
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index e4f1615ec13f..7329ef177a18 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -619,7 +619,7 @@ _GLOBAL(flush_instruction_cache)
619_GLOBAL(flush_icache_range) 619_GLOBAL(flush_icache_range)
620BEGIN_FTR_SECTION 620BEGIN_FTR_SECTION
621 blr /* for 601, do nothing */ 621 blr /* for 601, do nothing */
622END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE) 622END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
623 li r5,L1_CACHE_LINE_SIZE-1 623 li r5,L1_CACHE_LINE_SIZE-1
624 andc r3,r3,r5 624 andc r3,r3,r5
625 subf r4,r3,r4 625 subf r4,r3,r4
@@ -736,7 +736,7 @@ _GLOBAL(flush_dcache_all)
736_GLOBAL(__flush_dcache_icache) 736_GLOBAL(__flush_dcache_icache)
737BEGIN_FTR_SECTION 737BEGIN_FTR_SECTION
738 blr /* for 601, do nothing */ 738 blr /* for 601, do nothing */
739END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE) 739END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
740 rlwinm r3,r3,0,0,19 /* Get page base address */ 740 rlwinm r3,r3,0,0,19 /* Get page base address */
741 li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */ 741 li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */
742 mtctr r4 742 mtctr r4
@@ -764,7 +764,7 @@ END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE)
764_GLOBAL(__flush_dcache_icache_phys) 764_GLOBAL(__flush_dcache_icache_phys)
765BEGIN_FTR_SECTION 765BEGIN_FTR_SECTION
766 blr /* for 601, do nothing */ 766 blr /* for 601, do nothing */
767END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE) 767END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
768 mfmsr r10 768 mfmsr r10
769 rlwinm r0,r10,0,28,26 /* clear DR */ 769 rlwinm r0,r10,0,28,26 /* clear DR */
770 mtmsr r0 770 mtmsr r0
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 47a15306823a..6d7b92d72458 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -1003,7 +1003,7 @@ pci_create_OF_bus_map(void)
1003 } 1003 }
1004} 1004}
1005 1005
1006static ssize_t pci_show_devspec(struct device *dev, char *buf) 1006static ssize_t pci_show_devspec(struct device *dev, struct device_attribute *attr, char *buf)
1007{ 1007{
1008 struct pci_dev *pdev; 1008 struct pci_dev *pdev;
1009 struct device_node *np; 1009 struct device_node *np;
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 2ccb58fe4fc3..d59ad07de8e7 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -55,7 +55,6 @@
55#define EXPORT_SYMTAB_STROPS 55#define EXPORT_SYMTAB_STROPS
56 56
57extern void transfer_to_handler(void); 57extern void transfer_to_handler(void);
58extern void do_syscall_trace(void);
59extern void do_IRQ(struct pt_regs *regs); 58extern void do_IRQ(struct pt_regs *regs);
60extern void MachineCheckException(struct pt_regs *regs); 59extern void MachineCheckException(struct pt_regs *regs);
61extern void AlignmentException(struct pt_regs *regs); 60extern void AlignmentException(struct pt_regs *regs);
@@ -74,7 +73,6 @@ extern unsigned long mm_ptov (unsigned long paddr);
74EXPORT_SYMBOL(clear_pages); 73EXPORT_SYMBOL(clear_pages);
75EXPORT_SYMBOL(clear_user_page); 74EXPORT_SYMBOL(clear_user_page);
76EXPORT_SYMBOL(do_signal); 75EXPORT_SYMBOL(do_signal);
77EXPORT_SYMBOL(do_syscall_trace);
78EXPORT_SYMBOL(transfer_to_handler); 76EXPORT_SYMBOL(transfer_to_handler);
79EXPORT_SYMBOL(do_IRQ); 77EXPORT_SYMBOL(do_IRQ);
80EXPORT_SYMBOL(MachineCheckException); 78EXPORT_SYMBOL(MachineCheckException);
diff --git a/arch/ppc/kernel/ptrace.c b/arch/ppc/kernel/ptrace.c
index 59d59a8dc249..e7aee4108dea 100644
--- a/arch/ppc/kernel/ptrace.c
+++ b/arch/ppc/kernel/ptrace.c
@@ -27,6 +27,9 @@
27#include <linux/user.h> 27#include <linux/user.h>
28#include <linux/security.h> 28#include <linux/security.h>
29#include <linux/signal.h> 29#include <linux/signal.h>
30#include <linux/seccomp.h>
31#include <linux/audit.h>
32#include <linux/module.h>
30 33
31#include <asm/uaccess.h> 34#include <asm/uaccess.h>
32#include <asm/page.h> 35#include <asm/page.h>
@@ -455,11 +458,10 @@ out:
455 return ret; 458 return ret;
456} 459}
457 460
458void do_syscall_trace(void) 461static void do_syscall_trace(void)
459{ 462{
460 if (!test_thread_flag(TIF_SYSCALL_TRACE) 463 /* the 0x80 provides a way for the tracing parent to distinguish
461 || !(current->ptrace & PT_PTRACED)) 464 between a syscall stop and SIGTRAP delivery */
462 return;
463 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) 465 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
464 ? 0x80 : 0)); 466 ? 0x80 : 0));
465 467
@@ -473,3 +475,33 @@ void do_syscall_trace(void)
473 current->exit_code = 0; 475 current->exit_code = 0;
474 } 476 }
475} 477}
478
479void do_syscall_trace_enter(struct pt_regs *regs)
480{
481 if (test_thread_flag(TIF_SYSCALL_TRACE)
482 && (current->ptrace & PT_PTRACED))
483 do_syscall_trace();
484
485 if (unlikely(current->audit_context))
486 audit_syscall_entry(current, AUDIT_ARCH_PPC,
487 regs->gpr[0],
488 regs->gpr[3], regs->gpr[4],
489 regs->gpr[5], regs->gpr[6]);
490}
491
492void do_syscall_trace_leave(struct pt_regs *regs)
493{
494 secure_computing(regs->gpr[0]);
495
496 if (unlikely(current->audit_context))
497 audit_syscall_exit(current,
498 (regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,
499 regs->result);
500
501 if ((test_thread_flag(TIF_SYSCALL_TRACE))
502 && (current->ptrace & PT_PTRACED))
503 do_syscall_trace();
504}
505
506EXPORT_SYMBOL(do_syscall_trace_enter);
507EXPORT_SYMBOL(do_syscall_trace_leave);
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 5dfb42f1a152..c42f75326939 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -41,7 +41,7 @@
41#include <asm/xmon.h> 41#include <asm/xmon.h>
42#include <asm/ocp.h> 42#include <asm/ocp.h>
43 43
44#if defined(CONFIG_85xx) || defined(CONFIG_83xx) 44#if defined(CONFIG_85xx) || defined(CONFIG_83xx) || defined(CONFIG_MPC10X_BRIDGE)
45#include <asm/ppc_sys.h> 45#include <asm/ppc_sys.h>
46#endif 46#endif
47 47
@@ -61,8 +61,6 @@ extern void power4_idle(void);
61 61
62extern boot_infos_t *boot_infos; 62extern boot_infos_t *boot_infos;
63struct ide_machdep_calls ppc_ide_md; 63struct ide_machdep_calls ppc_ide_md;
64char *sysmap;
65unsigned long sysmap_size;
66 64
67/* Used with the BI_MEMSIZE bootinfo parameter to store the memory 65/* Used with the BI_MEMSIZE bootinfo parameter to store the memory
68 size value reported by the boot loader. */ 66 size value reported by the boot loader. */
@@ -249,7 +247,7 @@ int show_cpuinfo(struct seq_file *m, void *v)
249 seq_printf(m, "bogomips\t: %lu.%02lu\n", 247 seq_printf(m, "bogomips\t: %lu.%02lu\n",
250 lpj / (500000/HZ), (lpj / (5000/HZ)) % 100); 248 lpj / (500000/HZ), (lpj / (5000/HZ)) % 100);
251 249
252#if defined(CONFIG_85xx) || defined(CONFIG_83xx) 250#if defined(CONFIG_85xx) || defined(CONFIG_83xx) || defined(CONFIG_MPC10X_BRIDGE)
253 if (cur_ppc_sys_spec->ppc_sys_name) 251 if (cur_ppc_sys_spec->ppc_sys_name)
254 seq_printf(m, "chipset\t\t: %s\n", 252 seq_printf(m, "chipset\t\t: %s\n",
255 cur_ppc_sys_spec->ppc_sys_name); 253 cur_ppc_sys_spec->ppc_sys_name);
@@ -499,7 +497,7 @@ static int __init set_preferred_console(void)
499{ 497{
500 struct device_node *prom_stdout; 498 struct device_node *prom_stdout;
501 char *name; 499 char *name;
502 int offset; 500 int offset = 0;
503 501
504 if (of_stdout_device == NULL) 502 if (of_stdout_device == NULL)
505 return -ENODEV; 503 return -ENODEV;
@@ -578,11 +576,6 @@ void parse_bootinfo(struct bi_record *rec)
578 case BI_CMD_LINE: 576 case BI_CMD_LINE:
579 strlcpy(cmd_line, (void *)data, sizeof(cmd_line)); 577 strlcpy(cmd_line, (void *)data, sizeof(cmd_line));
580 break; 578 break;
581 case BI_SYSMAP:
582 sysmap = (char *)((data[0] >= (KERNELBASE)) ? data[0] :
583 (data[0]+KERNELBASE));
584 sysmap_size = data[1];
585 break;
586#ifdef CONFIG_BLK_DEV_INITRD 579#ifdef CONFIG_BLK_DEV_INITRD
587 case BI_INITRD: 580 case BI_INITRD:
588 initrd_start = data[0] + KERNELBASE; 581 initrd_start = data[0] + KERNELBASE;
@@ -753,6 +746,8 @@ void __init setup_arch(char **cmdline_p)
753 strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); 746 strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
754 *cmdline_p = cmd_line; 747 *cmdline_p = cmd_line;
755 748
749 parse_early_param();
750
756 /* set up the bootmem stuff with available memory */ 751 /* set up the bootmem stuff with available memory */
757 do_init_bootmem(); 752 do_init_bootmem();
758 if ( ppc_md.progress ) ppc_md.progress("setup_arch: bootmem", 0x3eab); 753 if ( ppc_md.progress ) ppc_md.progress("setup_arch: bootmem", 0x3eab);
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index f8e7e324a173..2ca8ecfeefd9 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -81,8 +81,10 @@ void die(const char * str, struct pt_regs * fp, long err)
81 console_verbose(); 81 console_verbose();
82 spin_lock_irq(&die_lock); 82 spin_lock_irq(&die_lock);
83#ifdef CONFIG_PMAC_BACKLIGHT 83#ifdef CONFIG_PMAC_BACKLIGHT
84 set_backlight_enable(1); 84 if (_machine == _MACH_Pmac) {
85 set_backlight_level(BACKLIGHT_MAX); 85 set_backlight_enable(1);
86 set_backlight_level(BACKLIGHT_MAX);
87 }
86#endif 88#endif
87 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); 89 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
88#ifdef CONFIG_PREEMPT 90#ifdef CONFIG_PREEMPT
@@ -408,12 +410,7 @@ static int emulate_string_inst(struct pt_regs *regs, u32 instword)
408 410
409 /* Early out if we are an invalid form of lswx */ 411 /* Early out if we are an invalid form of lswx */
410 if ((instword & INST_STRING_MASK) == INST_LSWX) 412 if ((instword & INST_STRING_MASK) == INST_LSWX)
411 if ((rA >= rT) || (NB_RB >= rT) || (rT == rA) || (rT == NB_RB)) 413 if ((rT == rA) || (rT == NB_RB))
412 return -EINVAL;
413
414 /* Early out if we are an invalid form of lswi */
415 if ((instword & INST_STRING_MASK) == INST_LSWI)
416 if ((rA >= rT) || (rT == rA))
417 return -EINVAL; 414 return -EINVAL;
418 415
419 EA = (rA == 0) ? 0 : regs->gpr[rA]; 416 EA = (rA == 0) ? 0 : regs->gpr[rA];
diff --git a/arch/ppc/lib/locks.c b/arch/ppc/lib/locks.c
index 694163d696d8..c450dc4b766e 100644
--- a/arch/ppc/lib/locks.c
+++ b/arch/ppc/lib/locks.c
@@ -130,7 +130,7 @@ void _raw_read_lock(rwlock_t *rw)
130 while (!read_can_lock(rw)) { 130 while (!read_can_lock(rw)) {
131 if (--stuck == 0) { 131 if (--stuck == 0) {
132 printk("_read_lock(%p) CPU#%d lock %d\n", 132 printk("_read_lock(%p) CPU#%d lock %d\n",
133 rw, _smp_processor_id(), rw->lock); 133 rw, raw_smp_processor_id(), rw->lock);
134 stuck = INIT_STUCK; 134 stuck = INIT_STUCK;
135 } 135 }
136 } 136 }
@@ -158,7 +158,7 @@ void _raw_write_lock(rwlock_t *rw)
158 while (!write_can_lock(rw)) { 158 while (!write_can_lock(rw)) {
159 if (--stuck == 0) { 159 if (--stuck == 0) {
160 printk("write_lock(%p) CPU#%d lock %d)\n", 160 printk("write_lock(%p) CPU#%d lock %d)\n",
161 rw, _smp_processor_id(), rw->lock); 161 rw, raw_smp_processor_id(), rw->lock);
162 stuck = INIT_STUCK; 162 stuck = INIT_STUCK;
163 } 163 }
164 } 164 }
diff --git a/arch/ppc/lib/string.S b/arch/ppc/lib/string.S
index 8d08a2eb225e..36c9b97fd92a 100644
--- a/arch/ppc/lib/string.S
+++ b/arch/ppc/lib/string.S
@@ -446,6 +446,7 @@ _GLOBAL(__copy_tofrom_user)
446#ifdef CONFIG_8xx 446#ifdef CONFIG_8xx
447 /* Don't use prefetch on 8xx */ 447 /* Don't use prefetch on 8xx */
448 mtctr r0 448 mtctr r0
449 li r0,0
44953: COPY_16_BYTES_WITHEX(0) 45053: COPY_16_BYTES_WITHEX(0)
450 bdnz 53b 451 bdnz 53b
451 452
@@ -564,7 +565,9 @@ _GLOBAL(__copy_tofrom_user)
564/* or write fault in cacheline loop */ 565/* or write fault in cacheline loop */
565105: li r9,1 566105: li r9,1
56692: li r3,LG_CACHELINE_BYTES 56792: li r3,LG_CACHELINE_BYTES
567 b 99f 568 mfctr r8
569 add r0,r0,r8
570 b 106f
568/* read fault in final word loop */ 571/* read fault in final word loop */
569108: li r9,0 572108: li r9,0
570 b 93f 573 b 93f
@@ -585,7 +588,7 @@ _GLOBAL(__copy_tofrom_user)
585 * r5 + (ctr << r3), and r9 is 0 for read or 1 for write. 588 * r5 + (ctr << r3), and r9 is 0 for read or 1 for write.
586 */ 589 */
58799: mfctr r0 59099: mfctr r0
588 slw r3,r0,r3 591106: slw r3,r0,r3
589 add. r3,r3,r5 592 add. r3,r3,r5
590 beq 120f /* shouldn't happen */ 593 beq 120f /* shouldn't happen */
591 cmpwi 0,r9,0 594 cmpwi 0,r9,0
diff --git a/arch/ppc/mm/fsl_booke_mmu.c b/arch/ppc/mm/fsl_booke_mmu.c
index 36233bdcdf8f..e07990efa046 100644
--- a/arch/ppc/mm/fsl_booke_mmu.c
+++ b/arch/ppc/mm/fsl_booke_mmu.c
@@ -64,6 +64,8 @@ extern unsigned long total_lowmem;
64extern unsigned long __max_low_memory; 64extern unsigned long __max_low_memory;
65#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE 65#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE
66 66
67#define NUM_TLBCAMS (16)
68
67struct tlbcam { 69struct tlbcam {
68 u32 MAS0; 70 u32 MAS0;
69 u32 MAS1; 71 u32 MAS1;
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index be02a7fec2b7..334ef4150d92 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -96,9 +96,6 @@ extern struct task_struct *current_set[NR_CPUS];
96char *klimit = _end; 96char *klimit = _end;
97struct mem_pieces phys_avail; 97struct mem_pieces phys_avail;
98 98
99extern char *sysmap;
100extern unsigned long sysmap_size;
101
102/* 99/*
103 * this tells the system to map all of ram with the segregs 100 * this tells the system to map all of ram with the segregs
104 * (i.e. page tables) instead of the bats. 101 * (i.e. page tables) instead of the bats.
@@ -179,6 +176,7 @@ void free_initmem(void)
179 if (!have_of) 176 if (!have_of)
180 FREESEC(openfirmware); 177 FREESEC(openfirmware);
181 printk("\n"); 178 printk("\n");
179 ppc_md.progress = NULL;
182#undef FREESEC 180#undef FREESEC
183} 181}
184 182
@@ -441,12 +439,6 @@ void __init mem_init(void)
441 if (agp_special_page) 439 if (agp_special_page)
442 SetPageReserved(virt_to_page(agp_special_page)); 440 SetPageReserved(virt_to_page(agp_special_page));
443#endif 441#endif
444 if ( sysmap )
445 for (addr = (unsigned long)sysmap;
446 addr < PAGE_ALIGN((unsigned long)sysmap+sysmap_size) ;
447 addr += PAGE_SIZE)
448 SetPageReserved(virt_to_page(addr));
449
450 for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory; 442 for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory;
451 addr += PAGE_SIZE) { 443 addr += PAGE_SIZE) {
452 if (!PageReserved(virt_to_page(addr))) 444 if (!PageReserved(virt_to_page(addr)))
@@ -468,7 +460,6 @@ void __init mem_init(void)
468 struct page *page = mem_map + pfn; 460 struct page *page = mem_map + pfn;
469 461
470 ClearPageReserved(page); 462 ClearPageReserved(page);
471 set_bit(PG_highmem, &page->flags);
472 set_page_count(page, 1); 463 set_page_count(page, 1);
473 __free_page(page); 464 __free_page(page);
474 totalhigh_pages++; 465 totalhigh_pages++;
@@ -482,9 +473,7 @@ void __init mem_init(void)
482 codepages<< (PAGE_SHIFT-10), datapages<< (PAGE_SHIFT-10), 473 codepages<< (PAGE_SHIFT-10), datapages<< (PAGE_SHIFT-10),
483 initpages<< (PAGE_SHIFT-10), 474 initpages<< (PAGE_SHIFT-10),
484 (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10))); 475 (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)));
485 if (sysmap) 476
486 printk("System.map loaded at 0x%08x for debugger, size: %ld bytes\n",
487 (unsigned int)sysmap, sysmap_size);
488#ifdef CONFIG_PPC_PMAC 477#ifdef CONFIG_PPC_PMAC
489 if (agp_special_page) 478 if (agp_special_page)
490 printk(KERN_INFO "AGP special page: 0x%08lx\n", agp_special_page); 479 printk(KERN_INFO "AGP special page: 0x%08lx\n", agp_special_page);
@@ -534,9 +523,6 @@ set_phys_avail(unsigned long total_memory)
534 if (rtas_data) 523 if (rtas_data)
535 mem_pieces_remove(&phys_avail, rtas_data, rtas_size, 1); 524 mem_pieces_remove(&phys_avail, rtas_data, rtas_size, 1);
536#endif 525#endif
537 /* remove the sysmap pages from the available memory */
538 if (sysmap)
539 mem_pieces_remove(&phys_avail, __pa(sysmap), sysmap_size, 1);
540#ifdef CONFIG_PPC_PMAC 526#ifdef CONFIG_PPC_PMAC
541 /* Because of some uninorth weirdness, we need a page of 527 /* Because of some uninorth weirdness, we need a page of
542 * memory as high as possible (it must be outside of the 528 * memory as high as possible (it must be outside of the
diff --git a/arch/ppc/mm/mmu_decl.h b/arch/ppc/mm/mmu_decl.h
index ffcdb46997dc..540f3292b229 100644
--- a/arch/ppc/mm/mmu_decl.h
+++ b/arch/ppc/mm/mmu_decl.h
@@ -43,6 +43,8 @@ extern int mem_init_done;
43extern PTE *Hash, *Hash_end; 43extern PTE *Hash, *Hash_end;
44extern unsigned long Hash_size, Hash_mask; 44extern unsigned long Hash_size, Hash_mask;
45 45
46extern unsigned int num_tlbcam_entries;
47
46/* ...and now those things that may be slightly different between processor 48/* ...and now those things that may be slightly different between processor
47 * architectures. -- Dan 49 * architectures. -- Dan
48 */ 50 */
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index 5d2f3f66aefa..81a3d7446d37 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -66,7 +66,6 @@ void setbat(int index, unsigned long virt, unsigned long phys,
66 66
67#ifdef HAVE_TLBCAM 67#ifdef HAVE_TLBCAM
68extern unsigned int tlbcam_index; 68extern unsigned int tlbcam_index;
69extern unsigned int num_tlbcam_entries;
70extern unsigned long v_mapped_by_tlbcam(unsigned long va); 69extern unsigned long v_mapped_by_tlbcam(unsigned long va);
71extern unsigned long p_mapped_by_tlbcam(unsigned long pa); 70extern unsigned long p_mapped_by_tlbcam(unsigned long pa);
72#else /* !HAVE_TLBCAM */ 71#else /* !HAVE_TLBCAM */
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.c b/arch/ppc/platforms/83xx/mpc834x_sys.c
index b3b0f51979d2..86ca5cf81263 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.c
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.c
@@ -41,7 +41,6 @@
41#include <asm/time.h> 41#include <asm/time.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/prom.h>
45#include <asm/ipic.h> 44#include <asm/ipic.h>
46#include <asm/bootinfo.h> 45#include <asm/bootinfo.h>
47#include <asm/pci-bridge.h> 46#include <asm/pci-bridge.h>
@@ -127,7 +126,6 @@ mpc834x_sys_map_io(void)
127{ 126{
128 /* we steal the lowest ioremap addr for virt space */ 127 /* we steal the lowest ioremap addr for virt space */
129 io_block_mapping(VIRT_IMMRBAR, immrbar, 1024*1024, _PAGE_IO); 128 io_block_mapping(VIRT_IMMRBAR, immrbar, 1024*1024, _PAGE_IO);
130 io_block_mapping(BCSR_VIRT_ADDR, BCSR_PHYS_ADDR, BCSR_SIZE, _PAGE_IO);
131} 129}
132 130
133int 131int
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.h b/arch/ppc/platforms/83xx/mpc834x_sys.h
index f4d055ae19c1..a2f6e49d7151 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.h
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.h
@@ -26,9 +26,14 @@
26#define VIRT_IMMRBAR ((uint)0xfe000000) 26#define VIRT_IMMRBAR ((uint)0xfe000000)
27 27
28#define BCSR_PHYS_ADDR ((uint)0xf8000000) 28#define BCSR_PHYS_ADDR ((uint)0xf8000000)
29#define BCSR_VIRT_ADDR ((uint)0xfe100000)
30#define BCSR_SIZE ((uint)(32 * 1024)) 29#define BCSR_SIZE ((uint)(32 * 1024))
31 30
31#define BCSR_MISC_REG2_OFF 0x07
32#define BCSR_MISC_REG2_PORESET 0x01
33
34#define BCSR_MISC_REG3_OFF 0x08
35#define BCSR_MISC_REG3_CNFLOCK 0x80
36
32#ifdef CONFIG_PCI 37#ifdef CONFIG_PCI
33/* PCI interrupt controller */ 38/* PCI interrupt controller */
34#define PIRQA MPC83xx_IRQ_IRQ4 39#define PIRQA MPC83xx_IRQ_IRQ4
diff --git a/arch/ppc/platforms/85xx/Kconfig b/arch/ppc/platforms/85xx/Kconfig
index ff92e38e7da1..c5bc2821d991 100644
--- a/arch/ppc/platforms/85xx/Kconfig
+++ b/arch/ppc/platforms/85xx/Kconfig
@@ -21,6 +21,11 @@ config MPC8540_ADS
21 help 21 help
22 This option enables support for the MPC 8540 ADS evaluation board. 22 This option enables support for the MPC 8540 ADS evaluation board.
23 23
24config MPC8548_CDS
25 bool "Freescale MPC8548 CDS"
26 help
27 This option enablese support for the MPC8548 CDS evaluation board.
28
24config MPC8555_CDS 29config MPC8555_CDS
25 bool "Freescale MPC8555 CDS" 30 bool "Freescale MPC8555 CDS"
26 help 31 help
@@ -53,6 +58,11 @@ config MPC8540
53 depends on MPC8540_ADS 58 depends on MPC8540_ADS
54 default y 59 default y
55 60
61config MPC8548
62 bool
63 depends on MPC8548_CDS
64 default y
65
56config MPC8555 66config MPC8555
57 bool 67 bool
58 depends on MPC8555_CDS 68 depends on MPC8555_CDS
diff --git a/arch/ppc/platforms/85xx/Makefile b/arch/ppc/platforms/85xx/Makefile
index 854fbd298ba2..efdf813108f2 100644
--- a/arch/ppc/platforms/85xx/Makefile
+++ b/arch/ppc/platforms/85xx/Makefile
@@ -2,6 +2,7 @@
2# Makefile for the PowerPC 85xx linux kernel. 2# Makefile for the PowerPC 85xx linux kernel.
3# 3#
4obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads_common.o mpc8540_ads.o 4obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads_common.o mpc8540_ads.o
5obj-$(CONFIG_MPC8548_CDS) += mpc85xx_cds_common.o
5obj-$(CONFIG_MPC8555_CDS) += mpc85xx_cds_common.o 6obj-$(CONFIG_MPC8555_CDS) += mpc85xx_cds_common.o
6obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads_common.o mpc8560_ads.o 7obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads_common.o mpc8560_ads.o
7obj-$(CONFIG_SBC8560) += sbc85xx.o sbc8560.o 8obj-$(CONFIG_SBC8560) += sbc85xx.o sbc8560.o
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c
index 4d857d6d633d..a2ed611cd936 100644
--- a/arch/ppc/platforms/85xx/mpc8540_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -41,7 +41,6 @@
41#include <asm/time.h> 41#include <asm/time.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/prom.h>
45#include <asm/open_pic.h> 44#include <asm/open_pic.h>
46#include <asm/bootinfo.h> 45#include <asm/bootinfo.h>
47#include <asm/pci-bridge.h> 46#include <asm/pci-bridge.h>
@@ -88,7 +87,7 @@ mpc8540ads_setup_arch(void)
88#ifdef CONFIG_SERIAL_TEXT_DEBUG 87#ifdef CONFIG_SERIAL_TEXT_DEBUG
89 /* Invalidate the entry we stole earlier the serial ports 88 /* Invalidate the entry we stole earlier the serial ports
90 * should be properly mapped */ 89 * should be properly mapped */
91 invalidate_tlbcam_entry(NUM_TLBCAMS - 1); 90 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
92#endif 91#endif
93 92
94 /* setup the board related information for the enet controllers */ 93 /* setup the board related information for the enet controllers */
@@ -150,7 +149,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
150 struct uart_port p; 149 struct uart_port p;
151 150
152 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ 151 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */
153 settlbcam(NUM_TLBCAMS - 1, binfo->bi_immr_base, 152 settlbcam(num_tlbcam_entries - 1, binfo->bi_immr_base,
154 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0); 153 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0);
155 154
156 memset(&p, 0, sizeof (p)); 155 memset(&p, 0, sizeof (p));
@@ -210,6 +209,9 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
210#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG) 209#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG)
211 ppc_md.progress = gen550_progress; 210 ppc_md.progress = gen550_progress;
212#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */ 211#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */
212#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_KGDB)
213 ppc_md.early_serial_map = mpc85xx_early_serial_map;
214#endif /* CONFIG_SERIAL_8250 && CONFIG_KGDB */
213 215
214 if (ppc_md.progress) 216 if (ppc_md.progress)
215 ppc_md.progress("mpc8540ads_init(): exit", 0); 217 ppc_md.progress("mpc8540ads_init(): exit", 0);
diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c b/arch/ppc/platforms/85xx/mpc8560_ads.c
index 761b8c7b25d2..d87dfd5ce0a2 100644
--- a/arch/ppc/platforms/85xx/mpc8560_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8560_ads.c
@@ -41,7 +41,6 @@
41#include <asm/time.h> 41#include <asm/time.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/prom.h>
45#include <asm/open_pic.h> 44#include <asm/open_pic.h>
46#include <asm/bootinfo.h> 45#include <asm/bootinfo.h>
47#include <asm/pci-bridge.h> 46#include <asm/pci-bridge.h>
diff --git a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
index ba9f9f562c45..18e952d1767c 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
@@ -36,7 +36,6 @@
36#include <asm/time.h> 36#include <asm/time.h>
37#include <asm/io.h> 37#include <asm/io.h>
38#include <asm/machdep.h> 38#include <asm/machdep.h>
39#include <asm/prom.h>
40#include <asm/open_pic.h> 39#include <asm/open_pic.h>
41#include <asm/bootinfo.h> 40#include <asm/bootinfo.h>
42#include <asm/pci-bridge.h> 41#include <asm/pci-bridge.h>
@@ -59,40 +58,8 @@ extern unsigned long total_memory; /* in mm/init */
59unsigned char __res[sizeof (bd_t)]; 58unsigned char __res[sizeof (bd_t)];
60 59
61/* Internal interrupts are all Level Sensitive, and Positive Polarity */ 60/* Internal interrupts are all Level Sensitive, and Positive Polarity */
62
63static u_char mpc85xx_ads_openpic_initsenses[] __initdata = { 61static u_char mpc85xx_ads_openpic_initsenses[] __initdata = {
64 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 0: L2 Cache */ 62 MPC85XX_INTERNAL_IRQ_SENSES,
65 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 1: ECM */
66 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 2: DDR DRAM */
67 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 3: LBIU */
68 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 4: DMA 0 */
69 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 5: DMA 1 */
70 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 6: DMA 2 */
71 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 7: DMA 3 */
72 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 8: PCI/PCI-X */
73 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 9: RIO Inbound Port Write Error */
74 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 10: RIO Doorbell Inbound */
75 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 11: RIO Outbound Message */
76 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 12: RIO Inbound Message */
77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 13: TSEC 0 Transmit */
78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 14: TSEC 0 Receive */
79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 15: Unused */
80 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 16: Unused */
81 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 17: Unused */
82 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 18: TSEC 0 Receive/Transmit Error */
83 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 19: TSEC 1 Transmit */
84 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 20: TSEC 1 Receive */
85 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 21: Unused */
86 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 22: Unused */
87 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 23: Unused */
88 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 24: TSEC 1 Receive/Transmit Error */
89 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 25: Fast Ethernet */
90 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 26: DUART */
91 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 27: I2C */
92 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 28: Performance Monitor */
93 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 29: Unused */
94 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 30: CPM */
95 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 31: Unused */
96 0x0, /* External 0: */ 63 0x0, /* External 0: */
97#if defined(CONFIG_PCI) 64#if defined(CONFIG_PCI)
98 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI slot 0 */ 65 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI slot 0 */
@@ -159,7 +126,7 @@ mpc85xx_ads_init_IRQ(void)
159 /* Skip reserved space and internal sources */ 126 /* Skip reserved space and internal sources */
160 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200); 127 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200);
161 /* Map PIC IRQs 0-11 */ 128 /* Map PIC IRQs 0-11 */
162 openpic_set_sources(32, 12, OpenPIC_Addr + 0x10000); 129 openpic_set_sources(48, 12, OpenPIC_Addr + 0x10000);
163 130
164 /* we let openpic interrupts starting from an offset, to 131 /* we let openpic interrupts starting from an offset, to
165 * leave space for cascading interrupts underneath. 132 * leave space for cascading interrupts underneath.
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
index 6c020d67ad70..203b2ca61df8 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
@@ -42,8 +42,8 @@
42#include <asm/todc.h> 42#include <asm/todc.h>
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/machdep.h> 44#include <asm/machdep.h>
45#include <asm/prom.h>
46#include <asm/open_pic.h> 45#include <asm/open_pic.h>
46#include <asm/i8259.h>
47#include <asm/bootinfo.h> 47#include <asm/bootinfo.h>
48#include <asm/pci-bridge.h> 48#include <asm/pci-bridge.h>
49#include <asm/mpc85xx.h> 49#include <asm/mpc85xx.h>
@@ -72,40 +72,8 @@ static int cds_pci_slot = 2;
72static volatile u8 * cadmus; 72static volatile u8 * cadmus;
73 73
74/* Internal interrupts are all Level Sensitive, and Positive Polarity */ 74/* Internal interrupts are all Level Sensitive, and Positive Polarity */
75
76static u_char mpc85xx_cds_openpic_initsenses[] __initdata = { 75static u_char mpc85xx_cds_openpic_initsenses[] __initdata = {
77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 0: L2 Cache */ 76 MPC85XX_INTERNAL_IRQ_SENSES,
78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 1: ECM */
79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 2: DDR DRAM */
80 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 3: LBIU */
81 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 4: DMA 0 */
82 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 5: DMA 1 */
83 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 6: DMA 2 */
84 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 7: DMA 3 */
85 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 8: PCI/PCI-X */
86 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 9: RIO Inbound Port Write Error */
87 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 10: RIO Doorbell Inbound */
88 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 11: RIO Outbound Message */
89 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 12: RIO Inbound Message */
90 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 13: TSEC 0 Transmit */
91 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 14: TSEC 0 Receive */
92 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 15: Unused */
93 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 16: Unused */
94 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 17: Unused */
95 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 18: TSEC 0 Receive/Transmit Error */
96 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 19: TSEC 1 Transmit */
97 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 20: TSEC 1 Receive */
98 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 21: Unused */
99 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 22: Unused */
100 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 23: Unused */
101 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 24: TSEC 1 Receive/Transmit Error */
102 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 25: Fast Ethernet */
103 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 26: DUART */
104 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 27: I2C */
105 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 28: Performance Monitor */
106 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 29: Unused */
107 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 30: CPM */
108 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 31: Unused */
109#if defined(CONFIG_PCI) 77#if defined(CONFIG_PCI)
110 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 0: PCI1 slot */ 78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 0: PCI1 slot */
111 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI1 slot */ 79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI1 slot */
@@ -189,15 +157,28 @@ mpc85xx_cds_init_IRQ(void)
189 OpenPIC_NumInitSenses = sizeof (mpc85xx_cds_openpic_initsenses); 157 OpenPIC_NumInitSenses = sizeof (mpc85xx_cds_openpic_initsenses);
190 158
191 /* Skip reserved space and internal sources */ 159 /* Skip reserved space and internal sources */
160#ifdef CONFIG_MPC8548
161 openpic_set_sources(0, 48, OpenPIC_Addr + 0x10200);
162#else
192 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200); 163 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200);
164#endif
193 /* Map PIC IRQs 0-11 */ 165 /* Map PIC IRQs 0-11 */
194 openpic_set_sources(32, 12, OpenPIC_Addr + 0x10000); 166 openpic_set_sources(48, 12, OpenPIC_Addr + 0x10000);
195 167
196 /* we let openpic interrupts starting from an offset, to 168 /* we let openpic interrupts starting from an offset, to
197 * leave space for cascading interrupts underneath. 169 * leave space for cascading interrupts underneath.
198 */ 170 */
199 openpic_init(MPC85xx_OPENPIC_IRQ_OFFSET); 171 openpic_init(MPC85xx_OPENPIC_IRQ_OFFSET);
200 172
173#ifdef CONFIG_PCI
174 openpic_hookup_cascade(PIRQ0A, "82c59 cascade", i8259_irq);
175
176 for (i = 0; i < NUM_8259_INTERRUPTS; i++)
177 irq_desc[i].handler = &i8259_pic;
178
179 i8259_init(0);
180#endif
181
201#ifdef CONFIG_CPM2 182#ifdef CONFIG_CPM2
202 /* Setup CPM2 PIC */ 183 /* Setup CPM2 PIC */
203 cpm2_init_IRQ(); 184 cpm2_init_IRQ();
@@ -231,7 +212,7 @@ mpc85xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
231 * interrupt on slot */ 212 * interrupt on slot */
232 { 213 {
233 { 0, 1, 2, 3 }, /* 16 - PMC */ 214 { 0, 1, 2, 3 }, /* 16 - PMC */
234 { 3, 0, 0, 0 }, /* 17 P2P (Tsi320) */ 215 { 0, 1, 2, 3 }, /* 17 P2P (Tsi320) */
235 { 0, 1, 2, 3 }, /* 18 - Slot 1 */ 216 { 0, 1, 2, 3 }, /* 18 - Slot 1 */
236 { 1, 2, 3, 0 }, /* 19 - Slot 2 */ 217 { 1, 2, 3, 0 }, /* 19 - Slot 2 */
237 { 2, 3, 0, 1 }, /* 20 - Slot 3 */ 218 { 2, 3, 0, 1 }, /* 20 - Slot 3 */
@@ -280,13 +261,135 @@ mpc85xx_exclude_device(u_char bus, u_char devfn)
280 return PCIBIOS_DEVICE_NOT_FOUND; 261 return PCIBIOS_DEVICE_NOT_FOUND;
281#endif 262#endif
282 /* We explicitly do not go past the Tundra 320 Bridge */ 263 /* We explicitly do not go past the Tundra 320 Bridge */
283 if (bus == 1) 264 if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
284 return PCIBIOS_DEVICE_NOT_FOUND; 265 return PCIBIOS_DEVICE_NOT_FOUND;
285 if ((bus == 0) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL)) 266 if ((bus == 0) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
286 return PCIBIOS_DEVICE_NOT_FOUND; 267 return PCIBIOS_DEVICE_NOT_FOUND;
287 else 268 else
288 return PCIBIOS_SUCCESSFUL; 269 return PCIBIOS_SUCCESSFUL;
289} 270}
271
272void __init
273mpc85xx_cds_enable_via(struct pci_controller *hose)
274{
275 u32 pci_class;
276 u16 vid, did;
277
278 early_read_config_dword(hose, 0, 0x88, PCI_CLASS_REVISION, &pci_class);
279 if ((pci_class >> 16) != PCI_CLASS_BRIDGE_PCI)
280 return;
281
282 /* Configure P2P so that we can reach bus 1 */
283 early_write_config_byte(hose, 0, 0x88, PCI_PRIMARY_BUS, 0);
284 early_write_config_byte(hose, 0, 0x88, PCI_SECONDARY_BUS, 1);
285 early_write_config_byte(hose, 0, 0x88, PCI_SUBORDINATE_BUS, 0xff);
286
287 early_read_config_word(hose, 1, 0x10, PCI_VENDOR_ID, &vid);
288 early_read_config_word(hose, 1, 0x10, PCI_DEVICE_ID, &did);
289
290 if ((vid != PCI_VENDOR_ID_VIA) ||
291 (did != PCI_DEVICE_ID_VIA_82C686))
292 return;
293
294 /* Enable USB and IDE functions */
295 early_write_config_byte(hose, 1, 0x10, 0x48, 0x08);
296}
297
298void __init
299mpc85xx_cds_fixup_via(struct pci_controller *hose)
300{
301 u32 pci_class;
302 u16 vid, did;
303
304 early_read_config_dword(hose, 0, 0x88, PCI_CLASS_REVISION, &pci_class);
305 if ((pci_class >> 16) != PCI_CLASS_BRIDGE_PCI)
306 return;
307
308 /*
309 * Force the backplane P2P bridge to have a window
310 * open from 0x00000000-0x00001fff in PCI I/O space.
311 * This allows legacy I/O (i8259, etc) on the VIA
312 * southbridge to be accessed.
313 */
314 early_write_config_byte(hose, 0, 0x88, PCI_IO_BASE, 0x00);
315 early_write_config_word(hose, 0, 0x88, PCI_IO_BASE_UPPER16, 0x0000);
316 early_write_config_byte(hose, 0, 0x88, PCI_IO_LIMIT, 0x10);
317 early_write_config_word(hose, 0, 0x88, PCI_IO_LIMIT_UPPER16, 0x0000);
318
319 early_read_config_word(hose, 1, 0x10, PCI_VENDOR_ID, &vid);
320 early_read_config_word(hose, 1, 0x10, PCI_DEVICE_ID, &did);
321 if ((vid != PCI_VENDOR_ID_VIA) ||
322 (did != PCI_DEVICE_ID_VIA_82C686))
323 return;
324
325 /*
326 * Since the P2P window was forced to cover the fixed
327 * legacy I/O addresses, it is necessary to manually
328 * place the base addresses for the IDE and USB functions
329 * within this window.
330 */
331 /* Function 1, IDE */
332 early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_0, 0x1ff8);
333 early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_1, 0x1ff4);
334 early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_2, 0x1fe8);
335 early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_3, 0x1fe4);
336 early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_4, 0x1fd0);
337
338 /* Function 2, USB ports 0-1 */
339 early_write_config_dword(hose, 1, 0x12, PCI_BASE_ADDRESS_4, 0x1fa0);
340
341 /* Function 3, USB ports 2-3 */
342 early_write_config_dword(hose, 1, 0x13, PCI_BASE_ADDRESS_4, 0x1f80);
343
344 /* Function 5, Power Management */
345 early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_0, 0x1e00);
346 early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_1, 0x1dfc);
347 early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_2, 0x1df8);
348
349 /* Function 6, AC97 Interface */
350 early_write_config_dword(hose, 1, 0x16, PCI_BASE_ADDRESS_0, 0x1c00);
351}
352
353void __init
354mpc85xx_cds_pcibios_fixup(void)
355{
356 struct pci_dev *dev = NULL;
357 u_char c;
358
359 if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
360 PCI_DEVICE_ID_VIA_82C586_1, NULL))) {
361 /*
362 * U-Boot does not set the enable bits
363 * for the IDE device. Force them on here.
364 */
365 pci_read_config_byte(dev, 0x40, &c);
366 c |= 0x03; /* IDE: Chip Enable Bits */
367 pci_write_config_byte(dev, 0x40, c);
368
369 /*
370 * Since only primary interface works, force the
371 * IDE function to standard primary IDE interrupt
372 * w/ 8259 offset
373 */
374 dev->irq = 14;
375 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
376 }
377
378 /*
379 * Force legacy USB interrupt routing
380 */
381 if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
382 PCI_DEVICE_ID_VIA_82C586_2, NULL))) {
383 dev->irq = 10;
384 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 10);
385 }
386
387 if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
388 PCI_DEVICE_ID_VIA_82C586_2, dev))) {
389 dev->irq = 11;
390 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11);
391 }
392}
290#endif /* CONFIG_PCI */ 393#endif /* CONFIG_PCI */
291 394
292TODC_ALLOC(); 395TODC_ALLOC();
@@ -328,6 +431,9 @@ mpc85xx_cds_setup_arch(void)
328 loops_per_jiffy = freq / HZ; 431 loops_per_jiffy = freq / HZ;
329 432
330#ifdef CONFIG_PCI 433#ifdef CONFIG_PCI
434 /* VIA IDE configuration */
435 ppc_md.pcibios_fixup = mpc85xx_cds_pcibios_fixup;
436
331 /* setup PCI host bridges */ 437 /* setup PCI host bridges */
332 mpc85xx_setup_hose(); 438 mpc85xx_setup_hose();
333#endif 439#endif
@@ -339,26 +445,52 @@ mpc85xx_cds_setup_arch(void)
339#ifdef CONFIG_SERIAL_TEXT_DEBUG 445#ifdef CONFIG_SERIAL_TEXT_DEBUG
340 /* Invalidate the entry we stole earlier the serial ports 446 /* Invalidate the entry we stole earlier the serial ports
341 * should be properly mapped */ 447 * should be properly mapped */
342 invalidate_tlbcam_entry(NUM_TLBCAMS - 1); 448 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
343#endif 449#endif
344 450
345 /* setup the board related information for the enet controllers */ 451 /* setup the board related information for the enet controllers */
346 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); 452 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
347 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 453 if (pdata) {
348 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 454 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
349 pdata->phyid = 0; 455 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
350 /* fixup phy address */ 456 pdata->phyid = 0;
351 pdata->phy_reg_addr += binfo->bi_immr_base; 457 /* fixup phy address */
352 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 458 pdata->phy_reg_addr += binfo->bi_immr_base;
459 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
460 }
353 461
354 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); 462 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
355 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 463 if (pdata) {
356 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 464 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
357 pdata->phyid = 1; 465 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
358 /* fixup phy address */ 466 pdata->phyid = 1;
359 pdata->phy_reg_addr += binfo->bi_immr_base; 467 /* fixup phy address */
360 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 468 pdata->phy_reg_addr += binfo->bi_immr_base;
469 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
470 }
471
472 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC1);
473 if (pdata) {
474 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
475 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
476 pdata->phyid = 0;
477 /* fixup phy address */
478 pdata->phy_reg_addr += binfo->bi_immr_base;
479 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
480 }
481
482 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC2);
483 if (pdata) {
484 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
485 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
486 pdata->phyid = 1;
487 /* fixup phy address */
488 pdata->phy_reg_addr += binfo->bi_immr_base;
489 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
490 }
361 491
492 ppc_sys_device_remove(MPC85xx_eTSEC3);
493 ppc_sys_device_remove(MPC85xx_eTSEC4);
362 494
363#ifdef CONFIG_BLK_DEV_INITRD 495#ifdef CONFIG_BLK_DEV_INITRD
364 if (initrd_start) 496 if (initrd_start)
@@ -395,7 +527,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
395 struct uart_port p; 527 struct uart_port p;
396 528
397 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ 529 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */
398 settlbcam(NUM_TLBCAMS - 1, binfo->bi_immr_base, 530 settlbcam(num_tlbcam_entries - 1, binfo->bi_immr_base,
399 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0); 531 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0);
400 532
401 memset(&p, 0, sizeof (p)); 533 memset(&p, 0, sizeof (p));
@@ -459,6 +591,9 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
459#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG) 591#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG)
460 ppc_md.progress = gen550_progress; 592 ppc_md.progress = gen550_progress;
461#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */ 593#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */
594#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_KGDB)
595 ppc_md.early_serial_map = mpc85xx_early_serial_map;
596#endif /* CONFIG_SERIAL_8250 && CONFIG_KGDB */
462 597
463 if (ppc_md.progress) 598 if (ppc_md.progress)
464 ppc_md.progress("mpc85xx_cds_init(): exit", 0); 599 ppc_md.progress("mpc85xx_cds_init(): exit", 0);
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h
index 7627d77504bd..12b292c6ae32 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h
@@ -77,4 +77,7 @@
77 77
78#define MPC85XX_PCI2_IO_SIZE 0x01000000 78#define MPC85XX_PCI2_IO_SIZE 0x01000000
79 79
80#define NR_8259_INTS 16
81#define CPM_IRQ_OFFSET NR_8259_INTS
82
80#endif /* __MACH_MPC85XX_CDS_H__ */ 83#endif /* __MACH_MPC85XX_CDS_H__ */
diff --git a/arch/ppc/platforms/85xx/sbc8560.c b/arch/ppc/platforms/85xx/sbc8560.c
index 9ab05e590c3e..3dbdd73618eb 100644
--- a/arch/ppc/platforms/85xx/sbc8560.c
+++ b/arch/ppc/platforms/85xx/sbc8560.c
@@ -41,7 +41,6 @@
41#include <asm/time.h> 41#include <asm/time.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/prom.h>
45#include <asm/open_pic.h> 44#include <asm/open_pic.h>
46#include <asm/bootinfo.h> 45#include <asm/bootinfo.h>
47#include <asm/pci-bridge.h> 46#include <asm/pci-bridge.h>
@@ -125,7 +124,7 @@ sbc8560_setup_arch(void)
125#ifdef CONFIG_SERIAL_TEXT_DEBUG 124#ifdef CONFIG_SERIAL_TEXT_DEBUG
126 /* Invalidate the entry we stole earlier the serial ports 125 /* Invalidate the entry we stole earlier the serial ports
127 * should be properly mapped */ 126 * should be properly mapped */
128 invalidate_tlbcam_entry(NUM_TLBCAMS - 1); 127 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
129#endif 128#endif
130 129
131 /* setup the board related information for the enet controllers */ 130 /* setup the board related information for the enet controllers */
@@ -176,7 +175,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
176 175
177#ifdef CONFIG_SERIAL_TEXT_DEBUG 176#ifdef CONFIG_SERIAL_TEXT_DEBUG
178 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ 177 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */
179 settlbcam(NUM_TLBCAMS - 1, UARTA_ADDR, 178 settlbcam(num_tlbcam_entries - 1, UARTA_ADDR,
180 UARTA_ADDR, 0x1000, _PAGE_IO, 0); 179 UARTA_ADDR, 0x1000, _PAGE_IO, 0);
181#endif 180#endif
182 181
@@ -221,6 +220,9 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
221#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG) 220#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG)
222 ppc_md.progress = gen550_progress; 221 ppc_md.progress = gen550_progress;
223#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */ 222#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */
223#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_KGDB)
224 ppc_md.early_serial_map = sbc8560_early_serial_map;
225#endif /* CONFIG_SERIAL_8250 && CONFIG_KGDB */
224 226
225 if (ppc_md.progress) 227 if (ppc_md.progress)
226 ppc_md.progress("sbc8560_init(): exit", 0); 228 ppc_md.progress("sbc8560_init(): exit", 0);
diff --git a/arch/ppc/platforms/85xx/sbc85xx.c b/arch/ppc/platforms/85xx/sbc85xx.c
index 2d638c1c1bd6..4f6d1ddd6fb8 100644
--- a/arch/ppc/platforms/85xx/sbc85xx.c
+++ b/arch/ppc/platforms/85xx/sbc85xx.c
@@ -35,7 +35,6 @@
35#include <asm/time.h> 35#include <asm/time.h>
36#include <asm/io.h> 36#include <asm/io.h>
37#include <asm/machdep.h> 37#include <asm/machdep.h>
38#include <asm/prom.h>
39#include <asm/open_pic.h> 38#include <asm/open_pic.h>
40#include <asm/bootinfo.h> 39#include <asm/bootinfo.h>
41#include <asm/pci-bridge.h> 40#include <asm/pci-bridge.h>
@@ -59,40 +58,8 @@ unsigned long pci_dram_offset = 0;
59extern unsigned long total_memory; /* in mm/init */ 58extern unsigned long total_memory; /* in mm/init */
60 59
61/* Internal interrupts are all Level Sensitive, and Positive Polarity */ 60/* Internal interrupts are all Level Sensitive, and Positive Polarity */
62
63static u_char sbc8560_openpic_initsenses[] __initdata = { 61static u_char sbc8560_openpic_initsenses[] __initdata = {
64 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 0: L2 Cache */ 62 MPC85XX_INTERNAL_IRQ_SENSES,
65 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 1: ECM */
66 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 2: DDR DRAM */
67 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 3: LBIU */
68 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 4: DMA 0 */
69 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 5: DMA 1 */
70 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 6: DMA 2 */
71 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 7: DMA 3 */
72 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 8: PCI/PCI-X */
73 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 9: RIO Inbound Port Write Error */
74 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 10: RIO Doorbell Inbound */
75 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 11: RIO Outbound Message */
76 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 12: RIO Inbound Message */
77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 13: TSEC 0 Transmit */
78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 14: TSEC 0 Receive */
79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 15: Unused */
80 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 16: Unused */
81 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 17: Unused */
82 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 18: TSEC 0 Receive/Transmit Error */
83 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 19: TSEC 1 Transmit */
84 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 20: TSEC 1 Receive */
85 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 21: Unused */
86 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 22: Unused */
87 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 23: Unused */
88 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 24: TSEC 1 Receive/Transmit Error */
89 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 25: Fast Ethernet */
90 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 26: DUART */
91 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 27: I2C */
92 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 28: Performance Monitor */
93 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 29: Unused */
94 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 30: CPM */
95 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 31: Unused */
96 0x0, /* External 0: */ 63 0x0, /* External 0: */
97 0x0, /* External 1: */ 64 0x0, /* External 1: */
98#if defined(CONFIG_PCI) 65#if defined(CONFIG_PCI)
@@ -159,7 +126,7 @@ sbc8560_init_IRQ(void)
159 /* Skip reserved space and internal sources */ 126 /* Skip reserved space and internal sources */
160 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200); 127 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200);
161 /* Map PIC IRQs 0-11 */ 128 /* Map PIC IRQs 0-11 */
162 openpic_set_sources(32, 12, OpenPIC_Addr + 0x10000); 129 openpic_set_sources(48, 12, OpenPIC_Addr + 0x10000);
163 130
164 /* we let openpic interrupts starting from an offset, to 131 /* we let openpic interrupts starting from an offset, to
165 * leave space for cascading interrupts underneath. 132 * leave space for cascading interrupts underneath.
diff --git a/arch/ppc/platforms/85xx/stx_gp3.c b/arch/ppc/platforms/85xx/stx_gp3.c
index bc95836e417c..9455bb6b45e9 100644
--- a/arch/ppc/platforms/85xx/stx_gp3.c
+++ b/arch/ppc/platforms/85xx/stx_gp3.c
@@ -46,7 +46,6 @@
46#include <asm/time.h> 46#include <asm/time.h>
47#include <asm/io.h> 47#include <asm/io.h>
48#include <asm/machdep.h> 48#include <asm/machdep.h>
49#include <asm/prom.h>
50#include <asm/open_pic.h> 49#include <asm/open_pic.h>
51#include <asm/bootinfo.h> 50#include <asm/bootinfo.h>
52#include <asm/pci-bridge.h> 51#include <asm/pci-bridge.h>
@@ -72,38 +71,7 @@ unsigned long pci_dram_offset = 0;
72 71
73/* Internal interrupts are all Level Sensitive, and Positive Polarity */ 72/* Internal interrupts are all Level Sensitive, and Positive Polarity */
74static u8 gp3_openpic_initsenses[] __initdata = { 73static u8 gp3_openpic_initsenses[] __initdata = {
75 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 0: L2 Cache */ 74 MPC85XX_INTERNAL_IRQ_SENSES,
76 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 1: ECM */
77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 2: DDR DRAM */
78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 3: LBIU */
79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 4: DMA 0 */
80 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 5: DMA 1 */
81 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 6: DMA 2 */
82 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 7: DMA 3 */
83 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 8: PCI/PCI-X */
84 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 9: RIO Inbound Port Write Error */
85 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 10: RIO Doorbell Inbound */
86 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 11: RIO Outbound Message */
87 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 12: RIO Inbound Message */
88 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 13: TSEC 0 Transmit */
89 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 14: TSEC 0 Receive */
90 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 15: Unused */
91 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 16: Unused */
92 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 17: Unused */
93 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 18: TSEC 0 Receive/Transmit Error */
94 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 19: TSEC 1 Transmit */
95 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 20: TSEC 1 Receive */
96 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 21: Unused */
97 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 22: Unused */
98 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 23: Unused */
99 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 24: TSEC 1 Receive/Transmit Error */
100 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 25: Fast Ethernet */
101 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 26: DUART */
102 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 27: I2C */
103 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 28: Performance Monitor */
104 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 29: Unused */
105 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 30: CPM */
106 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 31: Unused */
107 0x0, /* External 0: */ 75 0x0, /* External 0: */
108#if defined(CONFIG_PCI) 76#if defined(CONFIG_PCI)
109 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI slot 0 */ 77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI slot 0 */
@@ -200,7 +168,6 @@ static struct irqaction cpm2_irqaction = {
200static void __init 168static void __init
201gp3_init_IRQ(void) 169gp3_init_IRQ(void)
202{ 170{
203 int i;
204 bd_t *binfo = (bd_t *) __res; 171 bd_t *binfo = (bd_t *) __res;
205 172
206 /* 173 /*
@@ -218,7 +185,7 @@ gp3_init_IRQ(void)
218 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200); 185 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200);
219 186
220 /* Map PIC IRQs 0-11 */ 187 /* Map PIC IRQs 0-11 */
221 openpic_set_sources(32, 12, OpenPIC_Addr + 0x10000); 188 openpic_set_sources(48, 12, OpenPIC_Addr + 0x10000);
222 189
223 /* 190 /*
224 * Let openpic interrupts starting from an offset, to 191 * Let openpic interrupts starting from an offset, to
diff --git a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c
index f7fb2786cd50..5fdd4f607a40 100644
--- a/arch/ppc/platforms/pmac_cpufreq.c
+++ b/arch/ppc/platforms/pmac_cpufreq.c
@@ -83,16 +83,13 @@ static u32 frequency_gpio;
83static u32 slew_done_gpio; 83static u32 slew_done_gpio;
84static int no_schedule; 84static int no_schedule;
85static int has_cpu_l2lve; 85static int has_cpu_l2lve;
86 86static int is_pmu_based;
87
88#define PMAC_CPU_LOW_SPEED 1
89#define PMAC_CPU_HIGH_SPEED 0
90 87
91/* There are only two frequency states for each processor. Values 88/* There are only two frequency states for each processor. Values
92 * are in kHz for the time being. 89 * are in kHz for the time being.
93 */ 90 */
94#define CPUFREQ_HIGH PMAC_CPU_HIGH_SPEED 91#define CPUFREQ_HIGH 0
95#define CPUFREQ_LOW PMAC_CPU_LOW_SPEED 92#define CPUFREQ_LOW 1
96 93
97static struct cpufreq_frequency_table pmac_cpu_freqs[] = { 94static struct cpufreq_frequency_table pmac_cpu_freqs[] = {
98 {CPUFREQ_HIGH, 0}, 95 {CPUFREQ_HIGH, 0},
@@ -100,6 +97,11 @@ static struct cpufreq_frequency_table pmac_cpu_freqs[] = {
100 {0, CPUFREQ_TABLE_END}, 97 {0, CPUFREQ_TABLE_END},
101}; 98};
102 99
100static struct freq_attr* pmac_cpu_freqs_attr[] = {
101 &cpufreq_freq_attr_scaling_available_freqs,
102 NULL,
103};
104
103static inline void local_delay(unsigned long ms) 105static inline void local_delay(unsigned long ms)
104{ 106{
105 if (no_schedule) 107 if (no_schedule)
@@ -269,6 +271,8 @@ static int __pmac pmu_set_cpu_speed(int low_speed)
269#ifdef DEBUG_FREQ 271#ifdef DEBUG_FREQ
270 printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1)); 272 printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1));
271#endif 273#endif
274 pmu_suspend();
275
272 /* Disable all interrupt sources on openpic */ 276 /* Disable all interrupt sources on openpic */
273 pic_prio = openpic_get_priority(); 277 pic_prio = openpic_get_priority();
274 openpic_set_priority(0xf); 278 openpic_set_priority(0xf);
@@ -343,6 +347,8 @@ static int __pmac pmu_set_cpu_speed(int low_speed)
343 debug_calc_bogomips(); 347 debug_calc_bogomips();
344#endif 348#endif
345 349
350 pmu_resume();
351
346 preempt_enable(); 352 preempt_enable();
347 353
348 return 0; 354 return 0;
@@ -355,7 +361,7 @@ static int __pmac do_set_cpu_speed(int speed_mode, int notify)
355 static unsigned long prev_l3cr; 361 static unsigned long prev_l3cr;
356 362
357 freqs.old = cur_freq; 363 freqs.old = cur_freq;
358 freqs.new = (speed_mode == PMAC_CPU_HIGH_SPEED) ? hi_freq : low_freq; 364 freqs.new = (speed_mode == CPUFREQ_HIGH) ? hi_freq : low_freq;
359 freqs.cpu = smp_processor_id(); 365 freqs.cpu = smp_processor_id();
360 366
361 if (freqs.old == freqs.new) 367 if (freqs.old == freqs.new)
@@ -363,7 +369,7 @@ static int __pmac do_set_cpu_speed(int speed_mode, int notify)
363 369
364 if (notify) 370 if (notify)
365 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 371 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
366 if (speed_mode == PMAC_CPU_LOW_SPEED && 372 if (speed_mode == CPUFREQ_LOW &&
367 cpu_has_feature(CPU_FTR_L3CR)) { 373 cpu_has_feature(CPU_FTR_L3CR)) {
368 l3cr = _get_L3CR(); 374 l3cr = _get_L3CR();
369 if (l3cr & L3CR_L3E) { 375 if (l3cr & L3CR_L3E) {
@@ -371,8 +377,8 @@ static int __pmac do_set_cpu_speed(int speed_mode, int notify)
371 _set_L3CR(0); 377 _set_L3CR(0);
372 } 378 }
373 } 379 }
374 set_speed_proc(speed_mode == PMAC_CPU_LOW_SPEED); 380 set_speed_proc(speed_mode == CPUFREQ_LOW);
375 if (speed_mode == PMAC_CPU_HIGH_SPEED && 381 if (speed_mode == CPUFREQ_HIGH &&
376 cpu_has_feature(CPU_FTR_L3CR)) { 382 cpu_has_feature(CPU_FTR_L3CR)) {
377 l3cr = _get_L3CR(); 383 l3cr = _get_L3CR();
378 if ((prev_l3cr & L3CR_L3E) && l3cr != prev_l3cr) 384 if ((prev_l3cr & L3CR_L3E) && l3cr != prev_l3cr)
@@ -380,7 +386,7 @@ static int __pmac do_set_cpu_speed(int speed_mode, int notify)
380 } 386 }
381 if (notify) 387 if (notify)
382 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 388 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
383 cur_freq = (speed_mode == PMAC_CPU_HIGH_SPEED) ? hi_freq : low_freq; 389 cur_freq = (speed_mode == CPUFREQ_HIGH) ? hi_freq : low_freq;
384 390
385 return 0; 391 return 0;
386} 392}
@@ -423,7 +429,8 @@ static int __pmac pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
423 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 429 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
424 policy->cur = cur_freq; 430 policy->cur = cur_freq;
425 431
426 return cpufreq_frequency_table_cpuinfo(policy, &pmac_cpu_freqs[0]); 432 cpufreq_frequency_table_get_attr(pmac_cpu_freqs, policy->cpu);
433 return cpufreq_frequency_table_cpuinfo(policy, pmac_cpu_freqs);
427} 434}
428 435
429static u32 __pmac read_gpio(struct device_node *np) 436static u32 __pmac read_gpio(struct device_node *np)
@@ -456,8 +463,8 @@ static int __pmac pmac_cpufreq_suspend(struct cpufreq_policy *policy, u32 state)
456 */ 463 */
457 no_schedule = 1; 464 no_schedule = 1;
458 sleep_freq = cur_freq; 465 sleep_freq = cur_freq;
459 if (cur_freq == low_freq) 466 if (cur_freq == low_freq && !is_pmu_based)
460 do_set_cpu_speed(PMAC_CPU_HIGH_SPEED, 0); 467 do_set_cpu_speed(CPUFREQ_HIGH, 0);
461 return 0; 468 return 0;
462} 469}
463 470
@@ -473,8 +480,8 @@ static int __pmac pmac_cpufreq_resume(struct cpufreq_policy *policy)
473 * is that we force a switch to whatever it was, which is 480 * is that we force a switch to whatever it was, which is
474 * probably high speed due to our suspend() routine 481 * probably high speed due to our suspend() routine
475 */ 482 */
476 do_set_cpu_speed(sleep_freq == low_freq ? PMAC_CPU_LOW_SPEED 483 do_set_cpu_speed(sleep_freq == low_freq ?
477 : PMAC_CPU_HIGH_SPEED, 0); 484 CPUFREQ_LOW : CPUFREQ_HIGH, 0);
478 485
479 no_schedule = 0; 486 no_schedule = 0;
480 return 0; 487 return 0;
@@ -488,6 +495,7 @@ static struct cpufreq_driver pmac_cpufreq_driver = {
488 .suspend = pmac_cpufreq_suspend, 495 .suspend = pmac_cpufreq_suspend,
489 .resume = pmac_cpufreq_resume, 496 .resume = pmac_cpufreq_resume,
490 .flags = CPUFREQ_PM_NO_WARN, 497 .flags = CPUFREQ_PM_NO_WARN,
498 .attr = pmac_cpu_freqs_attr,
491 .name = "powermac", 499 .name = "powermac",
492 .owner = THIS_MODULE, 500 .owner = THIS_MODULE,
493}; 501};
@@ -580,6 +588,7 @@ static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
580 return 1; 588 return 1;
581 hi_freq = (*value) / 1000; 589 hi_freq = (*value) / 1000;
582 set_speed_proc = pmu_set_cpu_speed; 590 set_speed_proc = pmu_set_cpu_speed;
591 is_pmu_based = 1;
583 592
584 return 0; 593 return 0;
585} 594}
@@ -684,6 +693,7 @@ static int __init pmac_cpufreq_setup(void)
684 hi_freq = cur_freq; 693 hi_freq = cur_freq;
685 low_freq = 400000; 694 low_freq = 400000;
686 set_speed_proc = pmu_set_cpu_speed; 695 set_speed_proc = pmu_set_cpu_speed;
696 is_pmu_based = 1;
687 } 697 }
688 /* Else check for TiPb 400 & 500 */ 698 /* Else check for TiPb 400 & 500 */
689 else if (machine_is_compatible("PowerBook3,2")) { 699 else if (machine_is_compatible("PowerBook3,2")) {
@@ -695,6 +705,7 @@ static int __init pmac_cpufreq_setup(void)
695 hi_freq = cur_freq; 705 hi_freq = cur_freq;
696 low_freq = 300000; 706 low_freq = 300000;
697 set_speed_proc = pmu_set_cpu_speed; 707 set_speed_proc = pmu_set_cpu_speed;
708 is_pmu_based = 1;
698 } 709 }
699 /* Else check for 750FX */ 710 /* Else check for 750FX */
700 else if (PVR_VER(mfspr(SPRN_PVR)) == 0x7000) 711 else if (PVR_VER(mfspr(SPRN_PVR)) == 0x7000)
diff --git a/arch/ppc/platforms/pq2ads.h b/arch/ppc/platforms/pq2ads.h
index cf5e5dd06d63..067d9a5aebc1 100644
--- a/arch/ppc/platforms/pq2ads.h
+++ b/arch/ppc/platforms/pq2ads.h
@@ -49,10 +49,10 @@
49/* PCI interrupt controller */ 49/* PCI interrupt controller */
50#define PCI_INT_STAT_REG 0xF8200000 50#define PCI_INT_STAT_REG 0xF8200000
51#define PCI_INT_MASK_REG 0xF8200004 51#define PCI_INT_MASK_REG 0xF8200004
52#define PIRQA (NR_SIU_INTS + 0) 52#define PIRQA (NR_CPM_INTS + 0)
53#define PIRQB (NR_SIU_INTS + 1) 53#define PIRQB (NR_CPM_INTS + 1)
54#define PIRQC (NR_SIU_INTS + 2) 54#define PIRQC (NR_CPM_INTS + 2)
55#define PIRQD (NR_SIU_INTS + 3) 55#define PIRQD (NR_CPM_INTS + 3)
56 56
57/* 57/*
58 * PCI memory map definitions for MPC8266ADS-PCI. 58 * PCI memory map definitions for MPC8266ADS-PCI.
@@ -68,28 +68,23 @@
68 * 0x00000000-0x1FFFFFFF 0x00000000-0x1FFFFFFF MPC8266 local memory 68 * 0x00000000-0x1FFFFFFF 0x00000000-0x1FFFFFFF MPC8266 local memory
69 */ 69 */
70 70
71/* window for a PCI master to access MPC8266 memory */ 71/* All the other PCI memory map definitions reside at syslib/m82xx_pci.h
72#define PCI_SLV_MEM_LOCAL 0x00000000 /* Local base */ 72 Here we should redefine what is unique for this board */
73#define PCI_SLV_MEM_BUS 0x00000000 /* PCI base */ 73#define M82xx_PCI_SLAVE_MEM_LOCAL 0x00000000 /* Local base */
74#define M82xx_PCI_SLAVE_MEM_BUS 0x00000000 /* PCI base */
75#define M82xx_PCI_SLAVE_MEM_SIZE 0x10000000 /* 256 Mb */
74 76
75/* window for the processor to access PCI memory with prefetching */ 77#define M82xx_PCI_SLAVE_SEC_WND_SIZE ~(0x40000000 - 1U) /* 2 x 512Mb */
76#define PCI_MSTR_MEM_LOCAL 0x80000000 /* Local base */ 78#define M82xx_PCI_SLAVE_SEC_WND_BASE 0x80000000 /* PCI Memory base */
77#define PCI_MSTR_MEM_BUS 0x80000000 /* PCI base */
78#define PCI_MSTR_MEM_SIZE 0x20000000 /* 512MB */
79 79
80/* window for the processor to access PCI memory without prefetching */ 80#if defined(CONFIG_ADS8272)
81#define PCI_MSTR_MEMIO_LOCAL 0xA0000000 /* Local base */ 81#define PCI_INT_TO_SIU SIU_INT_IRQ2
82#define PCI_MSTR_MEMIO_BUS 0xA0000000 /* PCI base */ 82#elif defined(CONFIG_PQ2FADS)
83#define PCI_MSTR_MEMIO_SIZE 0x20000000 /* 512MB */ 83#define PCI_INT_TO_SIU SIU_INT_IRQ6
84#else
85#warning PCI Bridge will be without interrupts support
86#endif
84 87
85/* window for the processor to access PCI I/O */
86#define PCI_MSTR_IO_LOCAL 0xF4000000 /* Local base */
87#define PCI_MSTR_IO_BUS 0x00000000 /* PCI base */
88#define PCI_MSTR_IO_SIZE 0x04000000 /* 64MB */
89
90#define _IO_BASE PCI_MSTR_IO_LOCAL
91#define _ISA_MEM_BASE PCI_MSTR_MEMIO_LOCAL
92#define PCI_DRAM_OFFSET PCI_SLV_MEM_BUS
93#endif /* CONFIG_PCI */ 88#endif /* CONFIG_PCI */
94 89
95#endif /* __MACH_ADS8260_DEFS */ 90#endif /* __MACH_ADS8260_DEFS */
diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c
index 531bfa0e4512..70e58f43f2b8 100644
--- a/arch/ppc/platforms/sandpoint.c
+++ b/arch/ppc/platforms/sandpoint.c
@@ -81,6 +81,7 @@
81#include <linux/serial.h> 81#include <linux/serial.h>
82#include <linux/tty.h> /* for linux/serial_core.h */ 82#include <linux/tty.h> /* for linux/serial_core.h */
83#include <linux/serial_core.h> 83#include <linux/serial_core.h>
84#include <linux/serial_8250.h>
84 85
85#include <asm/system.h> 86#include <asm/system.h>
86#include <asm/pgtable.h> 87#include <asm/pgtable.h>
@@ -99,6 +100,7 @@
99#include <asm/mpc10x.h> 100#include <asm/mpc10x.h>
100#include <asm/pci-bridge.h> 101#include <asm/pci-bridge.h>
101#include <asm/kgdb.h> 102#include <asm/kgdb.h>
103#include <asm/ppc_sys.h>
102 104
103#include "sandpoint.h" 105#include "sandpoint.h"
104 106
@@ -305,6 +307,24 @@ sandpoint_setup_arch(void)
305 /* Lookup PCI host bridges */ 307 /* Lookup PCI host bridges */
306 sandpoint_find_bridges(); 308 sandpoint_find_bridges();
307 309
310 if (strncmp (cur_ppc_sys_spec->ppc_sys_name, "8245", 4) == 0)
311 {
312 bd_t *bp = (bd_t *)__res;
313 struct plat_serial8250_port *pdata;
314 pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(MPC10X_DUART);
315
316 if (pdata)
317 {
318 pdata[0].uartclk = bp->bi_busfreq;
319 pdata[0].membase = ioremap(pdata[0].mapbase, 0x100);
320
321 /* this disables the 2nd serial port on the DUART
322 * since the sandpoint does not have it connected */
323 pdata[1].uartclk = 0;
324 pdata[1].irq = 0;
325 pdata[1].mapbase = 0;
326 }
327
308 printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n"); 328 printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n");
309 printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n"); 329 printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n");
310 330
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index dd418ea3426c..dec5bf4f6879 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -81,7 +81,7 @@ obj-$(CONFIG_SBC82xx) += todc_time.o
81obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \ 81obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \
82 todc_time.o 82 todc_time.o
83obj-$(CONFIG_8260) += m8260_setup.o 83obj-$(CONFIG_8260) += m8260_setup.o
84obj-$(CONFIG_PCI_8260) += m8260_pci.o indirect_pci.o 84obj-$(CONFIG_PCI_8260) += m82xx_pci.o indirect_pci.o pci_auto.o
85obj-$(CONFIG_8260_PCI9) += m8260_pci_erratum9.o 85obj-$(CONFIG_8260_PCI9) += m8260_pci_erratum9.o
86obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o 86obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
87ifeq ($(CONFIG_PPC_GEN550),y) 87ifeq ($(CONFIG_PPC_GEN550),y)
@@ -92,12 +92,12 @@ ifeq ($(CONFIG_SERIAL_MPSC_CONSOLE),y)
92obj-$(CONFIG_SERIAL_TEXT_DEBUG) += mv64x60_dbg.o 92obj-$(CONFIG_SERIAL_TEXT_DEBUG) += mv64x60_dbg.o
93endif 93endif
94obj-$(CONFIG_BOOTX_TEXT) += btext.o 94obj-$(CONFIG_BOOTX_TEXT) += btext.o
95obj-$(CONFIG_MPC10X_BRIDGE) += mpc10x_common.o indirect_pci.o 95obj-$(CONFIG_MPC10X_BRIDGE) += mpc10x_common.o indirect_pci.o ppc_sys.o
96obj-$(CONFIG_MPC10X_OPENPIC) += open_pic.o 96obj-$(CONFIG_MPC10X_OPENPIC) += open_pic.o
97obj-$(CONFIG_40x) += dcr.o 97obj-$(CONFIG_40x) += dcr.o
98obj-$(CONFIG_BOOKE) += dcr.o 98obj-$(CONFIG_BOOKE) += dcr.o
99obj-$(CONFIG_85xx) += open_pic.o ppc85xx_common.o ppc85xx_setup.o \ 99obj-$(CONFIG_85xx) += open_pic.o ppc85xx_common.o ppc85xx_setup.o \
100 ppc_sys.o mpc85xx_sys.o \ 100 ppc_sys.o i8259.o mpc85xx_sys.o \
101 mpc85xx_devices.o 101 mpc85xx_devices.o
102ifeq ($(CONFIG_85xx),y) 102ifeq ($(CONFIG_85xx),y)
103obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o 103obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o
@@ -107,6 +107,7 @@ obj-$(CONFIG_83xx) += ipic.o ppc83xx_setup.o ppc_sys.o \
107ifeq ($(CONFIG_83xx),y) 107ifeq ($(CONFIG_83xx),y)
108obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o 108obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o
109endif 109endif
110obj-$(CONFIG_MPC8548_CDS) += todc_time.o
110obj-$(CONFIG_MPC8555_CDS) += todc_time.o 111obj-$(CONFIG_MPC8555_CDS) += todc_time.o
111obj-$(CONFIG_PPC_MPC52xx) += mpc52xx_setup.o mpc52xx_pic.o \ 112obj-$(CONFIG_PPC_MPC52xx) += mpc52xx_setup.o mpc52xx_pic.o \
112 mpc52xx_sys.o mpc52xx_devices.o ppc_sys.o 113 mpc52xx_sys.o mpc52xx_devices.o ppc_sys.o
diff --git a/arch/ppc/syslib/ipic.c b/arch/ppc/syslib/ipic.c
index acb2cde3171f..580ed658e872 100644
--- a/arch/ppc/syslib/ipic.c
+++ b/arch/ppc/syslib/ipic.c
@@ -479,7 +479,7 @@ void __init ipic_init(phys_addr_t phys_addr,
479 temp = 0; 479 temp = 0;
480 for (i = 0 ; i < senses_count ; i++) { 480 for (i = 0 ; i < senses_count ; i++) {
481 if ((senses[i] & IRQ_SENSE_MASK) == IRQ_SENSE_EDGE) { 481 if ((senses[i] & IRQ_SENSE_MASK) == IRQ_SENSE_EDGE) {
482 temp |= 1 << (16 - i); 482 temp |= 1 << (15 - i);
483 if (i != 0) 483 if (i != 0)
484 irq_desc[i + irq_offset + MPC83xx_IRQ_EXT1 - 1].status = 0; 484 irq_desc[i + irq_offset + MPC83xx_IRQ_EXT1 - 1].status = 0;
485 else 485 else
diff --git a/arch/ppc/syslib/m8260_pci.c b/arch/ppc/syslib/m8260_pci.c
deleted file mode 100644
index 057cc3f8ff37..000000000000
--- a/arch/ppc/syslib/m8260_pci.c
+++ /dev/null
@@ -1,193 +0,0 @@
1/*
2 * (C) Copyright 2003
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
5 * (C) Copyright 2004 Red Hat, Inc.
6 *
7 * See file CREDITS for list of people who contributed to this
8 * project.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA
24 */
25
26#include <linux/kernel.h>
27#include <linux/init.h>
28#include <linux/pci.h>
29#include <linux/slab.h>
30#include <linux/delay.h>
31
32#include <asm/byteorder.h>
33#include <asm/io.h>
34#include <asm/irq.h>
35#include <asm/uaccess.h>
36#include <asm/machdep.h>
37#include <asm/pci-bridge.h>
38#include <asm/immap_cpm2.h>
39#include <asm/mpc8260.h>
40
41#include "m8260_pci.h"
42
43
44/* PCI bus configuration registers.
45 */
46
47static void __init m8260_setup_pci(struct pci_controller *hose)
48{
49 volatile cpm2_map_t *immap = cpm2_immr;
50 unsigned long pocmr;
51 u16 tempShort;
52
53#ifndef CONFIG_ATC /* already done in U-Boot */
54 /*
55 * Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]),
56 * and local bus for PCI (SIUMCR [LBPC]).
57 */
58 immap->im_siu_conf.siu_82xx.sc_siumcr = 0x00640000;
59#endif
60
61 /* Make PCI lowest priority */
62 /* Each 4 bits is a device bus request and the MS 4bits
63 is highest priority */
64 /* Bus 4bit value
65 --- ----------
66 CPM high 0b0000
67 CPM middle 0b0001
68 CPM low 0b0010
69 PCI reguest 0b0011
70 Reserved 0b0100
71 Reserved 0b0101
72 Internal Core 0b0110
73 External Master 1 0b0111
74 External Master 2 0b1000
75 External Master 3 0b1001
76 The rest are reserved */
77 immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x61207893;
78
79 /* Park bus on core while modifying PCI Bus accesses */
80 immap->im_siu_conf.siu_82xx.sc_ppc_acr = 0x6;
81
82 /*
83 * Set up master window that allows the CPU to access PCI space. This
84 * window is set up using the first SIU PCIBR registers.
85 */
86 immap->im_memctl.memc_pcimsk0 = MPC826x_PCI_MASK;
87 immap->im_memctl.memc_pcibr0 = MPC826x_PCI_BASE | PCIBR_ENABLE;
88
89 /* Disable machine check on no response or target abort */
90 immap->im_pci.pci_emr = cpu_to_le32(0x1fe7);
91 /* Release PCI RST (by default the PCI RST signal is held low) */
92 immap->im_pci.pci_gcr = cpu_to_le32(PCIGCR_PCI_BUS_EN);
93
94 /* give it some time */
95 mdelay(1);
96
97 /*
98 * Set up master window that allows the CPU to access PCI Memory (prefetch)
99 * space. This window is set up using the first set of Outbound ATU registers.
100 */
101 immap->im_pci.pci_potar0 = cpu_to_le32(MPC826x_PCI_LOWER_MEM >> 12);
102 immap->im_pci.pci_pobar0 = cpu_to_le32((MPC826x_PCI_LOWER_MEM - MPC826x_PCI_MEM_OFFSET) >> 12);
103 pocmr = ((MPC826x_PCI_UPPER_MEM - MPC826x_PCI_LOWER_MEM) >> 12) ^ 0xfffff;
104 immap->im_pci.pci_pocmr0 = cpu_to_le32(pocmr | POCMR_ENABLE | POCMR_PREFETCH_EN);
105
106 /*
107 * Set up master window that allows the CPU to access PCI Memory (non-prefetch)
108 * space. This window is set up using the second set of Outbound ATU registers.
109 */
110 immap->im_pci.pci_potar1 = cpu_to_le32(MPC826x_PCI_LOWER_MMIO >> 12);
111 immap->im_pci.pci_pobar1 = cpu_to_le32((MPC826x_PCI_LOWER_MMIO - MPC826x_PCI_MMIO_OFFSET) >> 12);
112 pocmr = ((MPC826x_PCI_UPPER_MMIO - MPC826x_PCI_LOWER_MMIO) >> 12) ^ 0xfffff;
113 immap->im_pci.pci_pocmr1 = cpu_to_le32(pocmr | POCMR_ENABLE);
114
115 /*
116 * Set up master window that allows the CPU to access PCI IO space. This window
117 * is set up using the third set of Outbound ATU registers.
118 */
119 immap->im_pci.pci_potar2 = cpu_to_le32(MPC826x_PCI_IO_BASE >> 12);
120 immap->im_pci.pci_pobar2 = cpu_to_le32(MPC826x_PCI_LOWER_IO >> 12);
121 pocmr = ((MPC826x_PCI_UPPER_IO - MPC826x_PCI_LOWER_IO) >> 12) ^ 0xfffff;
122 immap->im_pci.pci_pocmr2 = cpu_to_le32(pocmr | POCMR_ENABLE | POCMR_PCI_IO);
123
124 /*
125 * Set up slave window that allows PCI masters to access MPC826x local memory.
126 * This window is set up using the first set of Inbound ATU registers
127 */
128
129 immap->im_pci.pci_pitar0 = cpu_to_le32(MPC826x_PCI_SLAVE_MEM_LOCAL >> 12);
130 immap->im_pci.pci_pibar0 = cpu_to_le32(MPC826x_PCI_SLAVE_MEM_BUS >> 12);
131 pocmr = ((MPC826x_PCI_SLAVE_MEM_SIZE-1) >> 12) ^ 0xfffff;
132 immap->im_pci.pci_picmr0 = cpu_to_le32(pocmr | PICMR_ENABLE | PICMR_PREFETCH_EN);
133
134 /* See above for description - puts PCI request as highest priority */
135 immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x03124567;
136
137 /* Park the bus on the PCI */
138 immap->im_siu_conf.siu_82xx.sc_ppc_acr = PPC_ACR_BUS_PARK_PCI;
139
140 /* Host mode - specify the bridge as a host-PCI bridge */
141 early_write_config_word(hose, 0, 0, PCI_CLASS_DEVICE, PCI_CLASS_BRIDGE_HOST);
142
143 /* Enable the host bridge to be a master on the PCI bus, and to act as a PCI memory target */
144 early_read_config_word(hose, 0, 0, PCI_COMMAND, &tempShort);
145 early_write_config_word(hose, 0, 0, PCI_COMMAND,
146 tempShort | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
147}
148
149void __init m8260_find_bridges(void)
150{
151 extern int pci_assign_all_busses;
152 struct pci_controller * hose;
153
154 pci_assign_all_busses = 1;
155
156 hose = pcibios_alloc_controller();
157
158 if (!hose)
159 return;
160
161 ppc_md.pci_swizzle = common_swizzle;
162
163 hose->first_busno = 0;
164 hose->bus_offset = 0;
165 hose->last_busno = 0xff;
166
167 setup_m8260_indirect_pci(hose,
168 (unsigned long)&cpm2_immr->im_pci.pci_cfg_addr,
169 (unsigned long)&cpm2_immr->im_pci.pci_cfg_data);
170
171 m8260_setup_pci(hose);
172 hose->pci_mem_offset = MPC826x_PCI_MEM_OFFSET;
173
174 hose->io_base_virt = ioremap(MPC826x_PCI_IO_BASE,
175 MPC826x_PCI_IO_SIZE);
176 isa_io_base = (unsigned long) hose->io_base_virt;
177
178 /* setup resources */
179 pci_init_resource(&hose->mem_resources[0],
180 MPC826x_PCI_LOWER_MEM,
181 MPC826x_PCI_UPPER_MEM,
182 IORESOURCE_MEM|IORESOURCE_PREFETCH, "PCI prefetchable memory");
183
184 pci_init_resource(&hose->mem_resources[1],
185 MPC826x_PCI_LOWER_MMIO,
186 MPC826x_PCI_UPPER_MMIO,
187 IORESOURCE_MEM, "PCI memory");
188
189 pci_init_resource(&hose->io_resource,
190 MPC826x_PCI_LOWER_IO,
191 MPC826x_PCI_UPPER_IO,
192 IORESOURCE_IO, "PCI I/O");
193}
diff --git a/arch/ppc/syslib/m8260_pci.h b/arch/ppc/syslib/m8260_pci.h
deleted file mode 100644
index d1352120acd7..000000000000
--- a/arch/ppc/syslib/m8260_pci.h
+++ /dev/null
@@ -1,76 +0,0 @@
1
2#ifndef _PPC_KERNEL_M8260_PCI_H
3#define _PPC_KERNEL_M8260_PCI_H
4
5#include <asm/m8260_pci.h>
6
7/*
8 * Local->PCI map (from CPU) controlled by
9 * MPC826x master window
10 *
11 * 0x80000000 - 0xBFFFFFFF Total CPU2PCI space PCIBR0
12 *
13 * 0x80000000 - 0x9FFFFFFF PCI Mem with prefetch (Outbound ATU #1)
14 * 0xA0000000 - 0xAFFFFFFF PCI Mem w/o prefetch (Outbound ATU #2)
15 * 0xB0000000 - 0xB0FFFFFF 32-bit PCI IO (Outbound ATU #3)
16 *
17 * PCI->Local map (from PCI)
18 * MPC826x slave window controlled by
19 *
20 * 0x00000000 - 0x07FFFFFF MPC826x local memory (Inbound ATU #1)
21 */
22
23/*
24 * Slave window that allows PCI masters to access MPC826x local memory.
25 * This window is set up using the first set of Inbound ATU registers
26 */
27
28#ifndef MPC826x_PCI_SLAVE_MEM_LOCAL
29#define MPC826x_PCI_SLAVE_MEM_LOCAL (((struct bd_info *)__res)->bi_memstart)
30#define MPC826x_PCI_SLAVE_MEM_BUS (((struct bd_info *)__res)->bi_memstart)
31#define MPC826x_PCI_SLAVE_MEM_SIZE (((struct bd_info *)__res)->bi_memsize)
32#endif
33
34/*
35 * This is the window that allows the CPU to access PCI address space.
36 * It will be setup with the SIU PCIBR0 register. All three PCI master
37 * windows, which allow the CPU to access PCI prefetch, non prefetch,
38 * and IO space (see below), must all fit within this window.
39 */
40#ifndef MPC826x_PCI_BASE
41#define MPC826x_PCI_BASE 0x80000000
42#define MPC826x_PCI_MASK 0xc0000000
43#endif
44
45#ifndef MPC826x_PCI_LOWER_MEM
46#define MPC826x_PCI_LOWER_MEM 0x80000000
47#define MPC826x_PCI_UPPER_MEM 0x9fffffff
48#define MPC826x_PCI_MEM_OFFSET 0x00000000
49#endif
50
51#ifndef MPC826x_PCI_LOWER_MMIO
52#define MPC826x_PCI_LOWER_MMIO 0xa0000000
53#define MPC826x_PCI_UPPER_MMIO 0xafffffff
54#define MPC826x_PCI_MMIO_OFFSET 0x00000000
55#endif
56
57#ifndef MPC826x_PCI_LOWER_IO
58#define MPC826x_PCI_LOWER_IO 0x00000000
59#define MPC826x_PCI_UPPER_IO 0x00ffffff
60#define MPC826x_PCI_IO_BASE 0xb0000000
61#define MPC826x_PCI_IO_SIZE 0x01000000
62#endif
63
64#ifndef _IO_BASE
65#define _IO_BASE isa_io_base
66#endif
67
68#ifdef CONFIG_8260_PCI9
69struct pci_controller;
70extern void setup_m8260_indirect_pci(struct pci_controller* hose,
71 u32 cfg_addr, u32 cfg_data);
72#else
73#define setup_m8260_indirect_pci setup_indirect_pci
74#endif
75
76#endif /* _PPC_KERNEL_M8260_PCI_H */
diff --git a/arch/ppc/syslib/m8260_pci_erratum9.c b/arch/ppc/syslib/m8260_pci_erratum9.c
index 9c0582d639e0..1dc7e4e1d491 100644
--- a/arch/ppc/syslib/m8260_pci_erratum9.c
+++ b/arch/ppc/syslib/m8260_pci_erratum9.c
@@ -31,7 +31,7 @@
31#include <asm/immap_cpm2.h> 31#include <asm/immap_cpm2.h>
32#include <asm/cpm2.h> 32#include <asm/cpm2.h>
33 33
34#include "m8260_pci.h" 34#include "m82xx_pci.h"
35 35
36#ifdef CONFIG_8260_PCI9 36#ifdef CONFIG_8260_PCI9
37/*#include <asm/mpc8260_pci9.h>*/ /* included in asm/io.h */ 37/*#include <asm/mpc8260_pci9.h>*/ /* included in asm/io.h */
@@ -248,11 +248,11 @@ EXPORT_SYMBOL(idma_pci9_read_le);
248 248
249static inline int is_pci_mem(unsigned long addr) 249static inline int is_pci_mem(unsigned long addr)
250{ 250{
251 if (addr >= MPC826x_PCI_LOWER_MMIO && 251 if (addr >= M82xx_PCI_LOWER_MMIO &&
252 addr <= MPC826x_PCI_UPPER_MMIO) 252 addr <= M82xx_PCI_UPPER_MMIO)
253 return 1; 253 return 1;
254 if (addr >= MPC826x_PCI_LOWER_MEM && 254 if (addr >= M82xx_PCI_LOWER_MEM &&
255 addr <= MPC826x_PCI_UPPER_MEM) 255 addr <= M82xx_PCI_UPPER_MEM)
256 return 1; 256 return 1;
257 return 0; 257 return 0;
258} 258}
diff --git a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c
index 23ea3f694de2..fda75d79050c 100644
--- a/arch/ppc/syslib/m8260_setup.c
+++ b/arch/ppc/syslib/m8260_setup.c
@@ -34,7 +34,8 @@
34unsigned char __res[sizeof(bd_t)]; 34unsigned char __res[sizeof(bd_t)];
35 35
36extern void cpm2_reset(void); 36extern void cpm2_reset(void);
37extern void m8260_find_bridges(void); 37extern void pq2_find_bridges(void);
38extern void pq2pci_init_irq(void);
38extern void idma_pci9_init(void); 39extern void idma_pci9_init(void);
39 40
40/* Place-holder for board-specific init */ 41/* Place-holder for board-specific init */
@@ -56,7 +57,7 @@ m8260_setup_arch(void)
56 idma_pci9_init(); 57 idma_pci9_init();
57#endif 58#endif
58#ifdef CONFIG_PCI_8260 59#ifdef CONFIG_PCI_8260
59 m8260_find_bridges(); 60 pq2_find_bridges();
60#endif 61#endif
61#ifdef CONFIG_BLK_DEV_INITRD 62#ifdef CONFIG_BLK_DEV_INITRD
62 if (initrd_start) 63 if (initrd_start)
@@ -173,6 +174,12 @@ m8260_init_IRQ(void)
173 * in case the boot rom changed something on us. 174 * in case the boot rom changed something on us.
174 */ 175 */
175 cpm2_immr->im_intctl.ic_siprr = 0x05309770; 176 cpm2_immr->im_intctl.ic_siprr = 0x05309770;
177
178#if defined(CONFIG_PCI) && (defined(CONFIG_ADS8272) || defined(CONFIG_PQ2FADS))
179 /* Initialize stuff for the 82xx CPLD IC and install demux */
180 pq2pci_init_irq();
181#endif
182
176} 183}
177 184
178/* 185/*
diff --git a/arch/ppc/syslib/m82xx_pci.c b/arch/ppc/syslib/m82xx_pci.c
new file mode 100644
index 000000000000..5e7a7edcea74
--- /dev/null
+++ b/arch/ppc/syslib/m82xx_pci.c
@@ -0,0 +1,383 @@
1/*
2 *
3 * (C) Copyright 2003
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 *
6 * (C) Copyright 2004 Red Hat, Inc.
7 *
8 * 2005 (c) MontaVista Software, Inc.
9 * Vitaly Bordug <vbordug@ru.mvista.com>
10 *
11 * See file CREDITS for list of people who contributed to this
12 * project.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 */
29
30#include <linux/kernel.h>
31#include <linux/init.h>
32#include <linux/pci.h>
33#include <linux/slab.h>
34#include <linux/delay.h>
35#include <linux/irq.h>
36#include <linux/interrupt.h>
37
38#include <asm/byteorder.h>
39#include <asm/io.h>
40#include <asm/irq.h>
41#include <asm/uaccess.h>
42#include <asm/machdep.h>
43#include <asm/pci-bridge.h>
44#include <asm/immap_cpm2.h>
45#include <asm/mpc8260.h>
46#include <asm/cpm2.h>
47
48#include "m82xx_pci.h"
49
50/*
51 * Interrupt routing
52 */
53
54static inline int
55pq2pci_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
56{
57 static char pci_irq_table[][4] =
58 /*
59 * PCI IDSEL/INTPIN->INTLINE
60 * A B C D
61 */
62 {
63 { PIRQA, PIRQB, PIRQC, PIRQD }, /* IDSEL 22 - PCI slot 0 */
64 { PIRQD, PIRQA, PIRQB, PIRQC }, /* IDSEL 23 - PCI slot 1 */
65 { PIRQC, PIRQD, PIRQA, PIRQB }, /* IDSEL 24 - PCI slot 2 */
66 };
67
68 const long min_idsel = 22, max_idsel = 24, irqs_per_slot = 4;
69 return PCI_IRQ_TABLE_LOOKUP;
70}
71
72static void
73pq2pci_mask_irq(unsigned int irq)
74{
75 int bit = irq - NR_CPM_INTS;
76
77 *(volatile unsigned long *) PCI_INT_MASK_REG |= (1 << (31 - bit));
78 return;
79}
80
81static void
82pq2pci_unmask_irq(unsigned int irq)
83{
84 int bit = irq - NR_CPM_INTS;
85
86 *(volatile unsigned long *) PCI_INT_MASK_REG &= ~(1 << (31 - bit));
87 return;
88}
89
90static void
91pq2pci_mask_and_ack(unsigned int irq)
92{
93 int bit = irq - NR_CPM_INTS;
94
95 *(volatile unsigned long *) PCI_INT_MASK_REG |= (1 << (31 - bit));
96 return;
97}
98
99static void
100pq2pci_end_irq(unsigned int irq)
101{
102 int bit = irq - NR_CPM_INTS;
103
104 *(volatile unsigned long *) PCI_INT_MASK_REG &= ~(1 << (31 - bit));
105 return;
106}
107
108struct hw_interrupt_type pq2pci_ic = {
109 "PQ2 PCI",
110 NULL,
111 NULL,
112 pq2pci_unmask_irq,
113 pq2pci_mask_irq,
114 pq2pci_mask_and_ack,
115 pq2pci_end_irq,
116 0
117};
118
119static irqreturn_t
120pq2pci_irq_demux(int irq, void *dev_id, struct pt_regs *regs)
121{
122 unsigned long stat, mask, pend;
123 int bit;
124
125 for(;;) {
126 stat = *(volatile unsigned long *) PCI_INT_STAT_REG;
127 mask = *(volatile unsigned long *) PCI_INT_MASK_REG;
128 pend = stat & ~mask & 0xf0000000;
129 if (!pend)
130 break;
131 for (bit = 0; pend != 0; ++bit, pend <<= 1) {
132 if (pend & 0x80000000)
133 __do_IRQ(NR_CPM_INTS + bit, regs);
134 }
135 }
136
137 return IRQ_HANDLED;
138}
139
140static struct irqaction pq2pci_irqaction = {
141 .handler = pq2pci_irq_demux,
142 .flags = SA_INTERRUPT,
143 .mask = CPU_MASK_NONE,
144 .name = "PQ2 PCI cascade",
145};
146
147
148void
149pq2pci_init_irq(void)
150{
151 int irq;
152 volatile cpm2_map_t *immap = cpm2_immr;
153#if defined CONFIG_ADS8272
154 /* configure chip select for PCI interrupt controller */
155 immap->im_memctl.memc_br3 = PCI_INT_STAT_REG | 0x00001801;
156 immap->im_memctl.memc_or3 = 0xffff8010;
157#elif defined CONFIG_PQ2FADS
158 immap->im_memctl.memc_br8 = PCI_INT_STAT_REG | 0x00001801;
159 immap->im_memctl.memc_or8 = 0xffff8010;
160#endif
161 for (irq = NR_CPM_INTS; irq < NR_CPM_INTS + 4; irq++)
162 irq_desc[irq].handler = &pq2pci_ic;
163
164 /* make PCI IRQ level sensitive */
165 immap->im_intctl.ic_siexr &=
166 ~(1 << (14 - (PCI_INT_TO_SIU - SIU_INT_IRQ1)));
167
168 /* mask all PCI interrupts */
169 *(volatile unsigned long *) PCI_INT_MASK_REG |= 0xfff00000;
170
171 /* install the demultiplexer for the PCI cascade interrupt */
172 setup_irq(PCI_INT_TO_SIU, &pq2pci_irqaction);
173 return;
174}
175
176static int
177pq2pci_exclude_device(u_char bus, u_char devfn)
178{
179 return PCIBIOS_SUCCESSFUL;
180}
181
182/* PCI bus configuration registers.
183 */
184static void
185pq2ads_setup_pci(struct pci_controller *hose)
186{
187 __u32 val;
188 volatile cpm2_map_t *immap = cpm2_immr;
189 bd_t* binfo = (bd_t*) __res;
190 u32 sccr = immap->im_clkrst.car_sccr;
191 uint pci_div,freq,time;
192 /* PCI int lowest prio */
193 /* Each 4 bits is a device bus request and the MS 4bits
194 is highest priority */
195 /* Bus 4bit value
196 --- ----------
197 CPM high 0b0000
198 CPM middle 0b0001
199 CPM low 0b0010
200 PCI reguest 0b0011
201 Reserved 0b0100
202 Reserved 0b0101
203 Internal Core 0b0110
204 External Master 1 0b0111
205 External Master 2 0b1000
206 External Master 3 0b1001
207 The rest are reserved
208 */
209 immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x61207893;
210 /* park bus on core */
211 immap->im_siu_conf.siu_82xx.sc_ppc_acr = PPC_ACR_BUS_PARK_CORE;
212 /*
213 * Set up master windows that allow the CPU to access PCI space. These
214 * windows are set up using the two SIU PCIBR registers.
215 */
216
217 immap->im_memctl.memc_pcimsk0 = M82xx_PCI_PRIM_WND_SIZE;
218 immap->im_memctl.memc_pcibr0 = M82xx_PCI_PRIM_WND_BASE | PCIBR_ENABLE;
219
220#ifdef M82xx_PCI_SEC_WND_SIZE
221 immap->im_memctl.memc_pcimsk1 = M82xx_PCI_SEC_WND_SIZE;
222 immap->im_memctl.memc_pcibr1 = M82xx_PCI_SEC_WND_BASE | PCIBR_ENABLE;
223#endif
224
225#if defined CONFIG_ADS8272
226 immap->im_siu_conf.siu_82xx.sc_siumcr =
227 (immap->im_siu_conf.siu_82xx.sc_siumcr &
228 ~(SIUMCR_BBD | SIUMCR_ESE | SIUMCR_PBSE |
229 SIUMCR_CDIS | SIUMCR_DPPC11 | SIUMCR_L2CPC11 |
230 SIUMCR_LBPC11 | SIUMCR_APPC11 |
231 SIUMCR_CS10PC11 | SIUMCR_BCTLC11 | SIUMCR_MMR11)) |
232 SIUMCR_DPPC11 | SIUMCR_L2CPC01 | SIUMCR_LBPC00 |
233 SIUMCR_APPC10 | SIUMCR_CS10PC00 |
234 SIUMCR_BCTLC00 | SIUMCR_MMR11 ;
235
236#elif defined CONFIG_PQ2FADS
237 /*
238 * Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]),
239 * and local bus for PCI (SIUMCR [LBPC]).
240 */
241 immap->im_siu_conf.siu_82xx.sc_siumcr = (immap->im_siu_conf.sc_siumcr &
242 ~(SIUMCR_L2PC11 | SIUMCR_LBPC11 | SIUMCR_CS10PC11 | SIUMCR_APPC11) |
243 SIUMCR_BBD | SIUMCR_LBPC01 | SIUMCR_DPPC11 | SIUMCR_APPC10;
244#endif
245 /* Enable PCI */
246 immap->im_pci.pci_gcr = cpu_to_le32(PCIGCR_PCI_BUS_EN);
247
248 pci_div = ( (sccr & SCCR_PCI_MODCK) ? 2 : 1) *
249 ( ( (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT) + 1);
250 freq = (uint)((2*binfo->bi_cpmfreq)/(pci_div));
251 time = (int)666666/freq;
252 /* due to PCI Local Bus spec, some devices needs to wait such a long
253 time after RST deassertion. More specifically, 0.508s for 66MHz & twice more for 33 */
254 printk("%s: The PCI bus is %d Mhz.\nWaiting %s after deasserting RST...\n",__FILE__,freq,
255 (time==1) ? "0.5 seconds":"1 second" );
256
257 {
258 int i;
259 for(i=0;i<(500*time);i++)
260 udelay(1000);
261 }
262
263 /* setup ATU registers */
264 immap->im_pci.pci_pocmr0 = cpu_to_le32(POCMR_ENABLE | POCMR_PCI_IO |
265 ((~(M82xx_PCI_IO_SIZE - 1U)) >> POTA_ADDR_SHIFT));
266 immap->im_pci.pci_potar0 = cpu_to_le32(M82xx_PCI_LOWER_IO >> POTA_ADDR_SHIFT);
267 immap->im_pci.pci_pobar0 = cpu_to_le32(M82xx_PCI_IO_BASE >> POTA_ADDR_SHIFT);
268
269 /* Set-up non-prefetchable window */
270 immap->im_pci.pci_pocmr1 = cpu_to_le32(POCMR_ENABLE | ((~(M82xx_PCI_MMIO_SIZE-1U)) >> POTA_ADDR_SHIFT));
271 immap->im_pci.pci_potar1 = cpu_to_le32(M82xx_PCI_LOWER_MMIO >> POTA_ADDR_SHIFT);
272 immap->im_pci.pci_pobar1 = cpu_to_le32((M82xx_PCI_LOWER_MMIO - M82xx_PCI_MMIO_OFFSET) >> POTA_ADDR_SHIFT);
273
274 /* Set-up prefetchable window */
275 immap->im_pci.pci_pocmr2 = cpu_to_le32(POCMR_ENABLE |POCMR_PREFETCH_EN |
276 (~(M82xx_PCI_MEM_SIZE-1U) >> POTA_ADDR_SHIFT));
277 immap->im_pci.pci_potar2 = cpu_to_le32(M82xx_PCI_LOWER_MEM >> POTA_ADDR_SHIFT);
278 immap->im_pci.pci_pobar2 = cpu_to_le32((M82xx_PCI_LOWER_MEM - M82xx_PCI_MEM_OFFSET) >> POTA_ADDR_SHIFT);
279
280 /* Inbound transactions from PCI memory space */
281 immap->im_pci.pci_picmr0 = cpu_to_le32(PICMR_ENABLE | PICMR_PREFETCH_EN |
282 ((~(M82xx_PCI_SLAVE_MEM_SIZE-1U)) >> PITA_ADDR_SHIFT));
283 immap->im_pci.pci_pibar0 = cpu_to_le32(M82xx_PCI_SLAVE_MEM_BUS >> PITA_ADDR_SHIFT);
284 immap->im_pci.pci_pitar0 = cpu_to_le32(M82xx_PCI_SLAVE_MEM_LOCAL>> PITA_ADDR_SHIFT);
285
286#if defined CONFIG_ADS8272
287 /* PCI int highest prio */
288 immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x01236745;
289#elif defined CONFIG_PQ2FADS
290 immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x03124567;
291#endif
292 /* park bus on PCI */
293 immap->im_siu_conf.siu_82xx.sc_ppc_acr = PPC_ACR_BUS_PARK_PCI;
294
295 /* Enable bus mastering and inbound memory transactions */
296 early_read_config_dword(hose, hose->first_busno, 0, PCI_COMMAND, &val);
297 val &= 0xffff0000;
298 val |= PCI_COMMAND_MEMORY|PCI_COMMAND_MASTER;
299 early_write_config_dword(hose, hose->first_busno, 0, PCI_COMMAND, val);
300
301}
302
303void __init pq2_find_bridges(void)
304{
305 extern int pci_assign_all_busses;
306 struct pci_controller * hose;
307 int host_bridge;
308
309 pci_assign_all_busses = 1;
310
311 hose = pcibios_alloc_controller();
312
313 if (!hose)
314 return;
315
316 ppc_md.pci_swizzle = common_swizzle;
317
318 hose->first_busno = 0;
319 hose->bus_offset = 0;
320 hose->last_busno = 0xff;
321
322#ifdef CONFIG_ADS8272
323 hose->set_cfg_type = 1;
324#endif
325
326 setup_m8260_indirect_pci(hose,
327 (unsigned long)&cpm2_immr->im_pci.pci_cfg_addr,
328 (unsigned long)&cpm2_immr->im_pci.pci_cfg_data);
329
330 /* Make sure it is a supported bridge */
331 early_read_config_dword(hose,
332 0,
333 PCI_DEVFN(0,0),
334 PCI_VENDOR_ID,
335 &host_bridge);
336 switch (host_bridge) {
337 case PCI_DEVICE_ID_MPC8265:
338 break;
339 case PCI_DEVICE_ID_MPC8272:
340 break;
341 default:
342 printk("Attempting to use unrecognized host bridge ID"
343 " 0x%08x.\n", host_bridge);
344 break;
345 }
346
347 pq2ads_setup_pci(hose);
348
349 hose->io_space.start = M82xx_PCI_LOWER_IO;
350 hose->io_space.end = M82xx_PCI_UPPER_IO;
351 hose->mem_space.start = M82xx_PCI_LOWER_MEM;
352 hose->mem_space.end = M82xx_PCI_UPPER_MMIO;
353 hose->pci_mem_offset = M82xx_PCI_MEM_OFFSET;
354
355 isa_io_base =
356 (unsigned long) ioremap(M82xx_PCI_IO_BASE,
357 M82xx_PCI_IO_SIZE);
358 hose->io_base_virt = (void *) isa_io_base;
359
360 /* setup resources */
361 pci_init_resource(&hose->mem_resources[0],
362 M82xx_PCI_LOWER_MEM,
363 M82xx_PCI_UPPER_MEM,
364 IORESOURCE_MEM|IORESOURCE_PREFETCH, "PCI prefetchable memory");
365
366 pci_init_resource(&hose->mem_resources[1],
367 M82xx_PCI_LOWER_MMIO,
368 M82xx_PCI_UPPER_MMIO,
369 IORESOURCE_MEM, "PCI memory");
370
371 pci_init_resource(&hose->io_resource,
372 M82xx_PCI_LOWER_IO,
373 M82xx_PCI_UPPER_IO,
374 IORESOURCE_IO | 1, "PCI I/O");
375
376 ppc_md.pci_exclude_device = pq2pci_exclude_device;
377 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
378
379 ppc_md.pci_map_irq = pq2pci_map_irq;
380 ppc_md.pcibios_fixup = NULL;
381 ppc_md.pcibios_fixup_bus = NULL;
382
383}
diff --git a/arch/ppc/syslib/m82xx_pci.h b/arch/ppc/syslib/m82xx_pci.h
new file mode 100644
index 000000000000..924f73f8e595
--- /dev/null
+++ b/arch/ppc/syslib/m82xx_pci.h
@@ -0,0 +1,92 @@
1
2#ifndef _PPC_KERNEL_M82XX_PCI_H
3#define _PPC_KERNEL_M82XX_PCI_H
4
5#include <asm/m8260_pci.h>
6/*
7 * Local->PCI map (from CPU) controlled by
8 * MPC826x master window
9 *
10 * 0xF6000000 - 0xF7FFFFFF IO space
11 * 0x80000000 - 0xBFFFFFFF CPU2PCI memory space PCIBR0
12 *
13 * 0x80000000 - 0x9FFFFFFF PCI Mem with prefetch (Outbound ATU #1)
14 * 0xA0000000 - 0xBFFFFFFF PCI Mem w/o prefetch (Outbound ATU #2)
15 * 0xF6000000 - 0xF7FFFFFF 32-bit PCI IO (Outbound ATU #3)
16 *
17 * PCI->Local map (from PCI)
18 * MPC826x slave window controlled by
19 *
20 * 0x00000000 - 0x07FFFFFF MPC826x local memory (Inbound ATU #1)
21 */
22
23/*
24 * Slave window that allows PCI masters to access MPC826x local memory.
25 * This window is set up using the first set of Inbound ATU registers
26 */
27
28#ifndef M82xx_PCI_SLAVE_MEM_LOCAL
29#define M82xx_PCI_SLAVE_MEM_LOCAL (((struct bd_info *)__res)->bi_memstart)
30#define M82xx_PCI_SLAVE_MEM_BUS (((struct bd_info *)__res)->bi_memstart)
31#define M82xx_PCI_SLAVE_MEM_SIZE (((struct bd_info *)__res)->bi_memsize)
32#endif
33
34/*
35 * This is the window that allows the CPU to access PCI address space.
36 * It will be setup with the SIU PCIBR0 register. All three PCI master
37 * windows, which allow the CPU to access PCI prefetch, non prefetch,
38 * and IO space (see below), must all fit within this window.
39 */
40
41#ifndef M82xx_PCI_LOWER_MEM
42#define M82xx_PCI_LOWER_MEM 0x80000000
43#define M82xx_PCI_UPPER_MEM 0x9fffffff
44#define M82xx_PCI_MEM_OFFSET 0x00000000
45#define M82xx_PCI_MEM_SIZE 0x20000000
46#endif
47
48#ifndef M82xx_PCI_LOWER_MMIO
49#define M82xx_PCI_LOWER_MMIO 0xa0000000
50#define M82xx_PCI_UPPER_MMIO 0xafffffff
51#define M82xx_PCI_MMIO_OFFSET 0x00000000
52#define M82xx_PCI_MMIO_SIZE 0x20000000
53#endif
54
55#ifndef M82xx_PCI_LOWER_IO
56#define M82xx_PCI_LOWER_IO 0x00000000
57#define M82xx_PCI_UPPER_IO 0x01ffffff
58#define M82xx_PCI_IO_BASE 0xf6000000
59#define M82xx_PCI_IO_SIZE 0x02000000
60#endif
61
62#ifndef M82xx_PCI_PRIM_WND_SIZE
63#define M82xx_PCI_PRIM_WND_SIZE ~(M82xx_PCI_IO_SIZE - 1U)
64#define M82xx_PCI_PRIM_WND_BASE (M82xx_PCI_IO_BASE)
65#endif
66
67#ifndef M82xx_PCI_SEC_WND_SIZE
68#define M82xx_PCI_SEC_WND_SIZE ~(M82xx_PCI_MEM_SIZE + M82xx_PCI_MMIO_SIZE - 1U)
69#define M82xx_PCI_SEC_WND_BASE (M82xx_PCI_LOWER_MEM)
70#endif
71
72#ifndef POTA_ADDR_SHIFT
73#define POTA_ADDR_SHIFT 12
74#endif
75
76#ifndef PITA_ADDR_SHIFT
77#define PITA_ADDR_SHIFT 12
78#endif
79
80#ifndef _IO_BASE
81#define _IO_BASE isa_io_base
82#endif
83
84#ifdef CONFIG_8260_PCI9
85struct pci_controller;
86extern void setup_m8260_indirect_pci(struct pci_controller* hose,
87 u32 cfg_addr, u32 cfg_data);
88#else
89#define setup_m8260_indirect_pci setup_indirect_pci
90#endif
91
92#endif /* _PPC_KERNEL_M8260_PCI_H */
diff --git a/arch/ppc/syslib/mpc10x_common.c b/arch/ppc/syslib/mpc10x_common.c
index fd93adfd464c..8fc5f4154521 100644
--- a/arch/ppc/syslib/mpc10x_common.c
+++ b/arch/ppc/syslib/mpc10x_common.c
@@ -21,6 +21,9 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/pci.h> 22#include <linux/pci.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/serial_8250.h>
25#include <linux/fsl_devices.h>
26#include <linux/device.h>
24 27
25#include <asm/byteorder.h> 28#include <asm/byteorder.h>
26#include <asm/io.h> 29#include <asm/io.h>
@@ -30,16 +33,7 @@
30#include <asm/pci-bridge.h> 33#include <asm/pci-bridge.h>
31#include <asm/open_pic.h> 34#include <asm/open_pic.h>
32#include <asm/mpc10x.h> 35#include <asm/mpc10x.h>
33#include <asm/ocp.h> 36#include <asm/ppc_sys.h>
34
35/* The OCP structure is fixed by code below, before OCP initialises.
36 paddr depends on where the board places the EUMB.
37 - fixed in mpc10x_bridge_init().
38 irq depends on two things:
39 > does the board use the EPIC at all? (PCORE does not).
40 > is the EPIC in serial or parallel mode?
41 - fixed in mpc10x_set_openpic().
42*/
43 37
44#ifdef CONFIG_MPC10X_OPENPIC 38#ifdef CONFIG_MPC10X_OPENPIC
45#ifdef CONFIG_EPIC_SERIAL_MODE 39#ifdef CONFIG_EPIC_SERIAL_MODE
@@ -50,35 +44,140 @@
50#define MPC10X_I2C_IRQ (EPIC_IRQ_BASE + NUM_8259_INTERRUPTS) 44#define MPC10X_I2C_IRQ (EPIC_IRQ_BASE + NUM_8259_INTERRUPTS)
51#define MPC10X_DMA0_IRQ (EPIC_IRQ_BASE + 1 + NUM_8259_INTERRUPTS) 45#define MPC10X_DMA0_IRQ (EPIC_IRQ_BASE + 1 + NUM_8259_INTERRUPTS)
52#define MPC10X_DMA1_IRQ (EPIC_IRQ_BASE + 2 + NUM_8259_INTERRUPTS) 46#define MPC10X_DMA1_IRQ (EPIC_IRQ_BASE + 2 + NUM_8259_INTERRUPTS)
47#define MPC10X_UART0_IRQ (EPIC_IRQ_BASE + 4 + NUM_8259_INTERRUPTS)
53#else 48#else
54#define MPC10X_I2C_IRQ OCP_IRQ_NA 49#define MPC10X_I2C_IRQ -1
55#define MPC10X_DMA0_IRQ OCP_IRQ_NA 50#define MPC10X_DMA0_IRQ -1
56#define MPC10X_DMA1_IRQ OCP_IRQ_NA 51#define MPC10X_DMA1_IRQ -1
52#define MPC10X_UART0_IRQ -1
57#endif 53#endif
58 54
59 55static struct fsl_i2c_platform_data mpc10x_i2c_pdata = {
60struct ocp_def core_ocp[] = { 56 .device_flags = 0,
61 { .vendor = OCP_VENDOR_INVALID
62 }
63}; 57};
64 58
65static struct ocp_fs_i2c_data mpc10x_i2c_data = { 59static struct plat_serial8250_port serial_platform_data[] = {
66 .flags = 0 60 [0] = {
61 .mapbase = 0x4500,
62 .iotype = UPIO_MEM,
63 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
64 },
65 [1] = {
66 .mapbase = 0x4600,
67 .iotype = UPIO_MEM,
68 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
69 },
70 { },
67}; 71};
68static struct ocp_def mpc10x_i2c_ocp = { 72
69 .vendor = OCP_VENDOR_MOTOROLA, 73struct platform_device ppc_sys_platform_devices[] = {
70 .function = OCP_FUNC_IIC, 74 [MPC10X_IIC1] = {
71 .index = 0, 75 .name = "fsl-i2c",
72 .additions = &mpc10x_i2c_data 76 .id = 1,
77 .dev.platform_data = &mpc10x_i2c_pdata,
78 .num_resources = 2,
79 .resource = (struct resource[]) {
80 {
81 .start = MPC10X_EUMB_I2C_OFFSET,
82 .end = MPC10X_EUMB_I2C_OFFSET +
83 MPC10X_EUMB_I2C_SIZE - 1,
84 .flags = IORESOURCE_MEM,
85 },
86 {
87 .flags = IORESOURCE_IRQ
88 },
89 },
90 },
91 [MPC10X_DMA0] = {
92 .name = "fsl-dma",
93 .id = 0,
94 .num_resources = 2,
95 .resource = (struct resource[]) {
96 {
97 .start = MPC10X_EUMB_DMA_OFFSET + 0x10,
98 .end = MPC10X_EUMB_DMA_OFFSET + 0x1f,
99 .flags = IORESOURCE_MEM,
100 },
101 {
102 .flags = IORESOURCE_IRQ,
103 },
104 },
105 },
106 [MPC10X_DMA1] = {
107 .name = "fsl-dma",
108 .id = 1,
109 .num_resources = 2,
110 .resource = (struct resource[]) {
111 {
112 .start = MPC10X_EUMB_DMA_OFFSET + 0x20,
113 .end = MPC10X_EUMB_DMA_OFFSET + 0x2f,
114 .flags = IORESOURCE_MEM,
115 },
116 {
117 .flags = IORESOURCE_IRQ,
118 },
119 },
120 },
121 [MPC10X_DMA1] = {
122 .name = "fsl-dma",
123 .id = 1,
124 .num_resources = 2,
125 .resource = (struct resource[]) {
126 {
127 .start = MPC10X_EUMB_DMA_OFFSET + 0x20,
128 .end = MPC10X_EUMB_DMA_OFFSET + 0x2f,
129 .flags = IORESOURCE_MEM,
130 },
131 {
132 .flags = IORESOURCE_IRQ,
133 },
134 },
135 },
136 [MPC10X_DUART] = {
137 .name = "serial8250",
138 .id = 0,
139 .dev.platform_data = serial_platform_data,
140 },
73}; 141};
74 142
75static struct ocp_def mpc10x_dma_ocp[2] = { 143/* We use the PCI ID to match on */
76{ .vendor = OCP_VENDOR_MOTOROLA, 144struct ppc_sys_spec *cur_ppc_sys_spec;
77 .function = OCP_FUNC_DMA, 145struct ppc_sys_spec ppc_sys_specs[] = {
78 .index = 0 }, 146 {
79{ .vendor = OCP_VENDOR_MOTOROLA, 147 .ppc_sys_name = "8245",
80 .function = OCP_FUNC_DMA, 148 .mask = 0xFFFFFFFF,
81 .index = 1 } 149 .value = MPC10X_BRIDGE_8245,
150 .num_devices = 4,
151 .device_list = (enum ppc_sys_devices[])
152 {
153 MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1, MPC10X_DUART,
154 },
155 },
156 {
157 .ppc_sys_name = "8240",
158 .mask = 0xFFFFFFFF,
159 .value = MPC10X_BRIDGE_8240,
160 .num_devices = 3,
161 .device_list = (enum ppc_sys_devices[])
162 {
163 MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1,
164 },
165 },
166 {
167 .ppc_sys_name = "107",
168 .mask = 0xFFFFFFFF,
169 .value = MPC10X_BRIDGE_107,
170 .num_devices = 3,
171 .device_list = (enum ppc_sys_devices[])
172 {
173 MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1,
174 },
175 },
176 { /* default match */
177 .ppc_sys_name = "",
178 .mask = 0x00000000,
179 .value = 0x00000000,
180 },
82}; 181};
83 182
84/* Set resources to match bridge memory map */ 183/* Set resources to match bridge memory map */
@@ -132,7 +231,7 @@ mpc10x_bridge_init(struct pci_controller *hose,
132 uint new_map, 231 uint new_map,
133 uint phys_eumb_base) 232 uint phys_eumb_base)
134{ 233{
135 int host_bridge, picr1, picr1_bit; 234 int host_bridge, picr1, picr1_bit, i;
136 ulong pci_config_addr, pci_config_data; 235 ulong pci_config_addr, pci_config_data;
137 u_char pir, byte; 236 u_char pir, byte;
138 237
@@ -273,7 +372,7 @@ mpc10x_bridge_init(struct pci_controller *hose,
273 printk("Host bridge in Agent mode\n"); 372 printk("Host bridge in Agent mode\n");
274 /* Read or Set LMBAR & PCSRBAR? */ 373 /* Read or Set LMBAR & PCSRBAR? */
275 } 374 }
276 375
277 /* Set base addr of the 8240/107 EUMB. */ 376 /* Set base addr of the 8240/107 EUMB. */
278 early_write_config_dword(hose, 377 early_write_config_dword(hose,
279 0, 378 0,
@@ -287,17 +386,6 @@ mpc10x_bridge_init(struct pci_controller *hose,
287 ioremap(phys_eumb_base + MPC10X_EUMB_EPIC_OFFSET, 386 ioremap(phys_eumb_base + MPC10X_EUMB_EPIC_OFFSET,
288 MPC10X_EUMB_EPIC_SIZE); 387 MPC10X_EUMB_EPIC_SIZE);
289#endif 388#endif
290 mpc10x_i2c_ocp.paddr = phys_eumb_base + MPC10X_EUMB_I2C_OFFSET;
291 mpc10x_i2c_ocp.irq = MPC10X_I2C_IRQ;
292 ocp_add_one_device(&mpc10x_i2c_ocp);
293 mpc10x_dma_ocp[0].paddr = phys_eumb_base +
294 MPC10X_EUMB_DMA_OFFSET + 0x100;
295 mpc10x_dma_ocp[0].irq = MPC10X_DMA0_IRQ;
296 ocp_add_one_device(&mpc10x_dma_ocp[0]);
297 mpc10x_dma_ocp[1].paddr = phys_eumb_base +
298 MPC10X_EUMB_DMA_OFFSET + 0x200;
299 mpc10x_dma_ocp[1].irq = MPC10X_DMA1_IRQ;
300 ocp_add_one_device(&mpc10x_dma_ocp[1]);
301 } 389 }
302 390
303#ifdef CONFIG_MPC10X_STORE_GATHERING 391#ifdef CONFIG_MPC10X_STORE_GATHERING
@@ -306,6 +394,29 @@ mpc10x_bridge_init(struct pci_controller *hose,
306 mpc10x_disable_store_gathering(hose); 394 mpc10x_disable_store_gathering(hose);
307#endif 395#endif
308 396
397 /* setup platform devices for MPC10x bridges */
398 identify_ppc_sys_by_id (host_bridge);
399
400 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
401 unsigned int dev_id = cur_ppc_sys_spec->device_list[i];
402 ppc_sys_fixup_mem_resource(&ppc_sys_platform_devices[dev_id],
403 phys_eumb_base);
404 }
405
406 /* IRQ's are determined at runtime */
407 ppc_sys_platform_devices[MPC10X_IIC1].resource[1].start = MPC10X_I2C_IRQ;
408 ppc_sys_platform_devices[MPC10X_IIC1].resource[1].end = MPC10X_I2C_IRQ;
409 ppc_sys_platform_devices[MPC10X_DMA0].resource[1].start = MPC10X_DMA0_IRQ;
410 ppc_sys_platform_devices[MPC10X_DMA0].resource[1].end = MPC10X_DMA0_IRQ;
411 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].start = MPC10X_DMA1_IRQ;
412 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].end = MPC10X_DMA1_IRQ;
413
414 serial_platform_data[0].mapbase += phys_eumb_base;
415 serial_platform_data[0].irq = MPC10X_UART0_IRQ;
416
417 serial_platform_data[1].mapbase += phys_eumb_base;
418 serial_platform_data[1].irq = MPC10X_UART0_IRQ + 1;
419
309 /* 420 /*
310 * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative 421 * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative
311 * PCI reads may return stale data so turn off. 422 * PCI reads may return stale data so turn off.
@@ -330,7 +441,7 @@ mpc10x_bridge_init(struct pci_controller *hose,
330 * 8245 (Rev 2., dated 10/2003) says PICR2[0] is reserverd. 441 * 8245 (Rev 2., dated 10/2003) says PICR2[0] is reserverd.
331 */ 442 */
332 if (host_bridge == MPC10X_BRIDGE_8245) { 443 if (host_bridge == MPC10X_BRIDGE_8245) {
333 ulong picr2; 444 u32 picr2;
334 445
335 early_read_config_dword(hose, 0, PCI_DEVFN(0,0), 446 early_read_config_dword(hose, 0, PCI_DEVFN(0,0),
336 MPC10X_CFG_PICR2_REG, &picr2); 447 MPC10X_CFG_PICR2_REG, &picr2);
@@ -504,6 +615,8 @@ void __init mpc10x_set_openpic(void)
504 openpic_set_sources(EPIC_IRQ_BASE, 3, OpenPIC_Addr + 0x11020); 615 openpic_set_sources(EPIC_IRQ_BASE, 3, OpenPIC_Addr + 0x11020);
505 /* Skip reserved space and map Message Unit Interrupt (I2O) */ 616 /* Skip reserved space and map Message Unit Interrupt (I2O) */
506 openpic_set_sources(EPIC_IRQ_BASE + 3, 1, OpenPIC_Addr + 0x110C0); 617 openpic_set_sources(EPIC_IRQ_BASE + 3, 1, OpenPIC_Addr + 0x110C0);
618 /* Skip reserved space and map Serial Interupts */
619 openpic_set_sources(EPIC_IRQ_BASE + 4, 2, OpenPIC_Addr + 0x11120);
507 620
508 openpic_init(NUM_8259_INTERRUPTS); 621 openpic_init(NUM_8259_INTERRUPTS);
509} 622}
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c
index 5c1a919eaabf..75c8e9834ae7 100644
--- a/arch/ppc/syslib/mpc83xx_devices.c
+++ b/arch/ppc/syslib/mpc83xx_devices.c
@@ -61,6 +61,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
61 .iotype = UPIO_MEM, 61 .iotype = UPIO_MEM,
62 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, 62 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
63 }, 63 },
64 { },
64}; 65};
65 66
66struct platform_device ppc_sys_platform_devices[] = { 67struct platform_device ppc_sys_platform_devices[] = {
diff --git a/arch/ppc/syslib/mpc85xx_devices.c b/arch/ppc/syslib/mpc85xx_devices.c
index a231795ee26f..8af322dd476a 100644
--- a/arch/ppc/syslib/mpc85xx_devices.c
+++ b/arch/ppc/syslib/mpc85xx_devices.c
@@ -40,6 +40,42 @@ static struct gianfar_platform_data mpc85xx_tsec2_pdata = {
40 .phy_reg_addr = MPC85xx_ENET1_OFFSET, 40 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
41}; 41};
42 42
43static struct gianfar_platform_data mpc85xx_etsec1_pdata = {
44 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
45 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
46 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
47 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
48 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
49 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
50};
51
52static struct gianfar_platform_data mpc85xx_etsec2_pdata = {
53 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
54 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
55 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
56 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
57 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
58 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
59};
60
61static struct gianfar_platform_data mpc85xx_etsec3_pdata = {
62 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
63 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
64 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
65 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
66 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
67 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
68};
69
70static struct gianfar_platform_data mpc85xx_etsec4_pdata = {
71 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
72 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
73 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
74 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
75 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
76 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
77};
78
43static struct gianfar_platform_data mpc85xx_fec_pdata = { 79static struct gianfar_platform_data mpc85xx_fec_pdata = {
44 .phy_reg_addr = MPC85xx_ENET1_OFFSET, 80 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
45}; 81};
@@ -48,6 +84,10 @@ static struct fsl_i2c_platform_data mpc85xx_fsl_i2c_pdata = {
48 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR, 84 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
49}; 85};
50 86
87static struct fsl_i2c_platform_data mpc85xx_fsl_i2c2_pdata = {
88 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
89};
90
51static struct plat_serial8250_port serial_platform_data[] = { 91static struct plat_serial8250_port serial_platform_data[] = {
52 [0] = { 92 [0] = {
53 .mapbase = 0x4500, 93 .mapbase = 0x4500,
@@ -61,6 +101,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
61 .iotype = UPIO_MEM, 101 .iotype = UPIO_MEM,
62 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ, 102 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ,
63 }, 103 },
104 { },
64}; 105};
65 106
66struct platform_device ppc_sys_platform_devices[] = { 107struct platform_device ppc_sys_platform_devices[] = {
@@ -280,7 +321,6 @@ struct platform_device ppc_sys_platform_devices[] = {
280 }, 321 },
281 }, 322 },
282 }, 323 },
283#ifdef CONFIG_CPM2
284 [MPC85xx_CPM_FCC1] = { 324 [MPC85xx_CPM_FCC1] = {
285 .name = "fsl-cpm-fcc", 325 .name = "fsl-cpm-fcc",
286 .id = 1, 326 .id = 1,
@@ -534,7 +574,151 @@ struct platform_device ppc_sys_platform_devices[] = {
534 }, 574 },
535 }, 575 },
536 }, 576 },
537#endif /* CONFIG_CPM2 */ 577 [MPC85xx_eTSEC1] = {
578 .name = "fsl-gianfar",
579 .id = 1,
580 .dev.platform_data = &mpc85xx_etsec1_pdata,
581 .num_resources = 4,
582 .resource = (struct resource[]) {
583 {
584 .start = MPC85xx_ENET1_OFFSET,
585 .end = MPC85xx_ENET1_OFFSET +
586 MPC85xx_ENET1_SIZE - 1,
587 .flags = IORESOURCE_MEM,
588 },
589 {
590 .name = "tx",
591 .start = MPC85xx_IRQ_TSEC1_TX,
592 .end = MPC85xx_IRQ_TSEC1_TX,
593 .flags = IORESOURCE_IRQ,
594 },
595 {
596 .name = "rx",
597 .start = MPC85xx_IRQ_TSEC1_RX,
598 .end = MPC85xx_IRQ_TSEC1_RX,
599 .flags = IORESOURCE_IRQ,
600 },
601 {
602 .name = "error",
603 .start = MPC85xx_IRQ_TSEC1_ERROR,
604 .end = MPC85xx_IRQ_TSEC1_ERROR,
605 .flags = IORESOURCE_IRQ,
606 },
607 },
608 },
609 [MPC85xx_eTSEC2] = {
610 .name = "fsl-gianfar",
611 .id = 2,
612 .dev.platform_data = &mpc85xx_etsec2_pdata,
613 .num_resources = 4,
614 .resource = (struct resource[]) {
615 {
616 .start = MPC85xx_ENET2_OFFSET,
617 .end = MPC85xx_ENET2_OFFSET +
618 MPC85xx_ENET2_SIZE - 1,
619 .flags = IORESOURCE_MEM,
620 },
621 {
622 .name = "tx",
623 .start = MPC85xx_IRQ_TSEC2_TX,
624 .end = MPC85xx_IRQ_TSEC2_TX,
625 .flags = IORESOURCE_IRQ,
626 },
627 {
628 .name = "rx",
629 .start = MPC85xx_IRQ_TSEC2_RX,
630 .end = MPC85xx_IRQ_TSEC2_RX,
631 .flags = IORESOURCE_IRQ,
632 },
633 {
634 .name = "error",
635 .start = MPC85xx_IRQ_TSEC2_ERROR,
636 .end = MPC85xx_IRQ_TSEC2_ERROR,
637 .flags = IORESOURCE_IRQ,
638 },
639 },
640 },
641 [MPC85xx_eTSEC3] = {
642 .name = "fsl-gianfar",
643 .id = 3,
644 .dev.platform_data = &mpc85xx_etsec3_pdata,
645 .num_resources = 4,
646 .resource = (struct resource[]) {
647 {
648 .start = MPC85xx_ENET3_OFFSET,
649 .end = MPC85xx_ENET3_OFFSET +
650 MPC85xx_ENET3_SIZE - 1,
651 .flags = IORESOURCE_MEM,
652 },
653 {
654 .name = "tx",
655 .start = MPC85xx_IRQ_TSEC3_TX,
656 .end = MPC85xx_IRQ_TSEC3_TX,
657 .flags = IORESOURCE_IRQ,
658 },
659 {
660 .name = "rx",
661 .start = MPC85xx_IRQ_TSEC3_RX,
662 .end = MPC85xx_IRQ_TSEC3_RX,
663 .flags = IORESOURCE_IRQ,
664 },
665 {
666 .name = "error",
667 .start = MPC85xx_IRQ_TSEC3_ERROR,
668 .end = MPC85xx_IRQ_TSEC3_ERROR,
669 .flags = IORESOURCE_IRQ,
670 },
671 },
672 },
673 [MPC85xx_eTSEC4] = {
674 .name = "fsl-gianfar",
675 .id = 4,
676 .dev.platform_data = &mpc85xx_etsec4_pdata,
677 .num_resources = 4,
678 .resource = (struct resource[]) {
679 {
680 .start = 0x27000,
681 .end = 0x27fff,
682 .flags = IORESOURCE_MEM,
683 },
684 {
685 .name = "tx",
686 .start = MPC85xx_IRQ_TSEC4_TX,
687 .end = MPC85xx_IRQ_TSEC4_TX,
688 .flags = IORESOURCE_IRQ,
689 },
690 {
691 .name = "rx",
692 .start = MPC85xx_IRQ_TSEC4_RX,
693 .end = MPC85xx_IRQ_TSEC4_RX,
694 .flags = IORESOURCE_IRQ,
695 },
696 {
697 .name = "error",
698 .start = MPC85xx_IRQ_TSEC4_ERROR,
699 .end = MPC85xx_IRQ_TSEC4_ERROR,
700 .flags = IORESOURCE_IRQ,
701 },
702 },
703 },
704 [MPC85xx_IIC2] = {
705 .name = "fsl-i2c",
706 .id = 2,
707 .dev.platform_data = &mpc85xx_fsl_i2c2_pdata,
708 .num_resources = 2,
709 .resource = (struct resource[]) {
710 {
711 .start = 0x03100,
712 .end = 0x031ff,
713 .flags = IORESOURCE_MEM,
714 },
715 {
716 .start = MPC85xx_IRQ_IIC1,
717 .end = MPC85xx_IRQ_IIC1,
718 .flags = IORESOURCE_IRQ,
719 },
720 },
721 },
538}; 722};
539 723
540static int __init mach_mpc85xx_fixup(struct platform_device *pdev) 724static int __init mach_mpc85xx_fixup(struct platform_device *pdev)
diff --git a/arch/ppc/syslib/mpc85xx_sys.c b/arch/ppc/syslib/mpc85xx_sys.c
index d806a92a9401..6e3184ab354f 100644
--- a/arch/ppc/syslib/mpc85xx_sys.c
+++ b/arch/ppc/syslib/mpc85xx_sys.c
@@ -110,6 +110,111 @@ struct ppc_sys_spec ppc_sys_specs[] = {
110 MPC85xx_CPM_USB, 110 MPC85xx_CPM_USB,
111 }, 111 },
112 }, 112 },
113 /* SVRs on 8548 rev1.0 matches for 8548/8547/8545 */
114 {
115 .ppc_sys_name = "8548E",
116 .mask = 0xFFFF00F0,
117 .value = 0x80390010,
118 .num_devices = 13,
119 .device_list = (enum ppc_sys_devices[])
120 {
121 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
122 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
123 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
124 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
125 },
126 },
127 {
128 .ppc_sys_name = "8548",
129 .mask = 0xFFFF00F0,
130 .value = 0x80310010,
131 .num_devices = 12,
132 .device_list = (enum ppc_sys_devices[])
133 {
134 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
135 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
136 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
137 MPC85xx_PERFMON, MPC85xx_DUART,
138 },
139 },
140 {
141 .ppc_sys_name = "8547E",
142 .mask = 0xFFFF00F0,
143 .value = 0x80390010,
144 .num_devices = 13,
145 .device_list = (enum ppc_sys_devices[])
146 {
147 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
148 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
149 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
150 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
151 },
152 },
153 {
154 .ppc_sys_name = "8547",
155 .mask = 0xFFFF00F0,
156 .value = 0x80310010,
157 .num_devices = 12,
158 .device_list = (enum ppc_sys_devices[])
159 {
160 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
161 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
162 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
163 MPC85xx_PERFMON, MPC85xx_DUART,
164 },
165 },
166 {
167 .ppc_sys_name = "8545E",
168 .mask = 0xFFFF00F0,
169 .value = 0x80390010,
170 .num_devices = 11,
171 .device_list = (enum ppc_sys_devices[])
172 {
173 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
174 MPC85xx_IIC1, MPC85xx_IIC2,
175 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
176 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
177 },
178 },
179 {
180 .ppc_sys_name = "8545",
181 .mask = 0xFFFF00F0,
182 .value = 0x80310010,
183 .num_devices = 10,
184 .device_list = (enum ppc_sys_devices[])
185 {
186 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
187 MPC85xx_IIC1, MPC85xx_IIC2,
188 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
189 MPC85xx_PERFMON, MPC85xx_DUART,
190 },
191 },
192 {
193 .ppc_sys_name = "8543E",
194 .mask = 0xFFFF00F0,
195 .value = 0x803A0010,
196 .num_devices = 11,
197 .device_list = (enum ppc_sys_devices[])
198 {
199 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
200 MPC85xx_IIC1, MPC85xx_IIC2,
201 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
202 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
203 },
204 },
205 {
206 .ppc_sys_name = "8543",
207 .mask = 0xFFFF00F0,
208 .value = 0x80320010,
209 .num_devices = 10,
210 .device_list = (enum ppc_sys_devices[])
211 {
212 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
213 MPC85xx_IIC1, MPC85xx_IIC2,
214 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
215 MPC85xx_PERFMON, MPC85xx_DUART,
216 },
217 },
113 { /* default match */ 218 { /* default match */
114 .ppc_sys_name = "", 219 .ppc_sys_name = "",
115 .mask = 0x00000000, 220 .mask = 0x00000000,
diff --git a/arch/ppc/syslib/ocp.c b/arch/ppc/syslib/ocp.c
index a5156c5179a6..e5fd2ae503ea 100644
--- a/arch/ppc/syslib/ocp.c
+++ b/arch/ppc/syslib/ocp.c
@@ -68,7 +68,7 @@ static int ocp_inited;
68/* Sysfs support */ 68/* Sysfs support */
69#define OCP_DEF_ATTR(field, format_string) \ 69#define OCP_DEF_ATTR(field, format_string) \
70static ssize_t \ 70static ssize_t \
71show_##field(struct device *dev, char *buf) \ 71show_##field(struct device *dev, struct device_attribute *attr, char *buf) \
72{ \ 72{ \
73 struct ocp_device *odev = to_ocp_dev(dev); \ 73 struct ocp_device *odev = to_ocp_dev(dev); \
74 \ 74 \
diff --git a/arch/ppc/syslib/of_device.c b/arch/ppc/syslib/of_device.c
index 46269ed21aee..49c0e34e2d6b 100644
--- a/arch/ppc/syslib/of_device.c
+++ b/arch/ppc/syslib/of_device.c
@@ -161,7 +161,7 @@ void of_unregister_driver(struct of_platform_driver *drv)
161} 161}
162 162
163 163
164static ssize_t dev_show_devspec(struct device *dev, char *buf) 164static ssize_t dev_show_devspec(struct device *dev, struct device_attribute *attr, char *buf)
165{ 165{
166 struct of_device *ofdev; 166 struct of_device *ofdev;
167 167
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
index 7619e16fccae..b45d8268bf93 100644
--- a/arch/ppc/syslib/open_pic.c
+++ b/arch/ppc/syslib/open_pic.c
@@ -21,7 +21,6 @@
21#include <asm/signal.h> 21#include <asm/signal.h>
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/irq.h> 23#include <asm/irq.h>
24#include <asm/prom.h>
25#include <asm/sections.h> 24#include <asm/sections.h>
26#include <asm/open_pic.h> 25#include <asm/open_pic.h>
27#include <asm/i8259.h> 26#include <asm/i8259.h>
@@ -275,7 +274,7 @@ static void __init openpic_enable_sie(void)
275} 274}
276#endif 275#endif
277 276
278#if defined(CONFIG_EPIC_SERIAL_MODE) || defined(CONFIG_PM) 277#if defined(CONFIG_EPIC_SERIAL_MODE)
279static void openpic_reset(void) 278static void openpic_reset(void)
280{ 279{
281 openpic_setfield(&OpenPIC->Global.Global_Configuration0, 280 openpic_setfield(&OpenPIC->Global.Global_Configuration0,
@@ -557,12 +556,10 @@ static void __init openpic_initipi(u_int ipi, u_int pri, u_int vec)
557 */ 556 */
558void openpic_cause_IPI(u_int ipi, cpumask_t cpumask) 557void openpic_cause_IPI(u_int ipi, cpumask_t cpumask)
559{ 558{
560 cpumask_t phys;
561 DECL_THIS_CPU; 559 DECL_THIS_CPU;
562 560
563 CHECK_THIS_CPU; 561 CHECK_THIS_CPU;
564 check_arg_ipi(ipi); 562 check_arg_ipi(ipi);
565 phys = physmask(cpumask);
566 openpic_write(&OpenPIC->THIS_CPU.IPI_Dispatch(ipi), 563 openpic_write(&OpenPIC->THIS_CPU.IPI_Dispatch(ipi),
567 cpus_addr(physmask(cpumask))[0]); 564 cpus_addr(physmask(cpumask))[0]);
568} 565}
@@ -995,8 +992,6 @@ int openpic_resume(struct sys_device *sysdev)
995 return 0; 992 return 0;
996 } 993 }
997 994
998 openpic_reset();
999
1000 /* OpenPIC sometimes seem to need some time to be fully back up... */ 995 /* OpenPIC sometimes seem to need some time to be fully back up... */
1001 do { 996 do {
1002 openpic_set_spurious(OPENPIC_VEC_SPURIOUS); 997 openpic_set_spurious(OPENPIC_VEC_SPURIOUS);
diff --git a/arch/ppc/syslib/open_pic2.c b/arch/ppc/syslib/open_pic2.c
index ea26da0d8b6b..7e272c51a497 100644
--- a/arch/ppc/syslib/open_pic2.c
+++ b/arch/ppc/syslib/open_pic2.c
@@ -25,7 +25,6 @@
25#include <asm/signal.h> 25#include <asm/signal.h>
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/irq.h> 27#include <asm/irq.h>
28#include <asm/prom.h>
29#include <asm/sections.h> 28#include <asm/sections.h>
30#include <asm/open_pic.h> 29#include <asm/open_pic.h>
31#include <asm/i8259.h> 30#include <asm/i8259.h>
diff --git a/arch/ppc/syslib/ppc4xx_kgdb.c b/arch/ppc/syslib/ppc4xx_kgdb.c
deleted file mode 100644
index fe8668bf8137..000000000000
--- a/arch/ppc/syslib/ppc4xx_kgdb.c
+++ /dev/null
@@ -1,124 +0,0 @@
1#include <linux/config.h>
2#include <linux/types.h>
3#include <asm/ibm4xx.h>
4#include <linux/kernel.h>
5
6
7
8#define LSR_DR 0x01 /* Data ready */
9#define LSR_OE 0x02 /* Overrun */
10#define LSR_PE 0x04 /* Parity error */
11#define LSR_FE 0x08 /* Framing error */
12#define LSR_BI 0x10 /* Break */
13#define LSR_THRE 0x20 /* Xmit holding register empty */
14#define LSR_TEMT 0x40 /* Xmitter empty */
15#define LSR_ERR 0x80 /* Error */
16
17#include <platforms/4xx/ibm_ocp.h>
18
19extern struct NS16550* COM_PORTS[];
20#ifndef NULL
21#define NULL 0x00
22#endif
23
24static volatile struct NS16550 *kgdb_debugport = NULL;
25
26volatile struct NS16550 *
27NS16550_init(int chan)
28{
29 volatile struct NS16550 *com_port;
30 int quot;
31#ifdef BASE_BAUD
32 quot = BASE_BAUD / 9600;
33#else
34 quot = 0x000c; /* 0xc = 9600 baud (on a pc) */
35#endif
36
37 com_port = (struct NS16550 *) COM_PORTS[chan];
38
39 com_port->lcr = 0x00;
40 com_port->ier = 0xFF;
41 com_port->ier = 0x00;
42 com_port->lcr = com_port->lcr | 0x80; /* Access baud rate */
43 com_port->dll = ( quot & 0x00ff ); /* 0xc = 9600 baud */
44 com_port->dlm = ( quot & 0xff00 ) >> 8;
45 com_port->lcr = 0x03; /* 8 data, 1 stop, no parity */
46 com_port->mcr = 0x00; /* RTS/DTR */
47 com_port->fcr = 0x07; /* Clear & enable FIFOs */
48
49 return( com_port );
50}
51
52
53void
54NS16550_putc(volatile struct NS16550 *com_port, unsigned char c)
55{
56 while ((com_port->lsr & LSR_THRE) == 0)
57 ;
58 com_port->thr = c;
59 return;
60}
61
62unsigned char
63NS16550_getc(volatile struct NS16550 *com_port)
64{
65 while ((com_port->lsr & LSR_DR) == 0)
66 ;
67 return (com_port->rbr);
68}
69
70unsigned char
71NS16550_tstc(volatile struct NS16550 *com_port)
72{
73 return ((com_port->lsr & LSR_DR) != 0);
74}
75
76
77#if defined(CONFIG_KGDB_TTYS0)
78#define KGDB_PORT 0
79#elif defined(CONFIG_KGDB_TTYS1)
80#define KGDB_PORT 1
81#elif defined(CONFIG_KGDB_TTYS2)
82#define KGDB_PORT 2
83#elif defined(CONFIG_KGDB_TTYS3)
84#define KGDB_PORT 3
85#else
86#error "invalid kgdb_tty port"
87#endif
88
89void putDebugChar( unsigned char c )
90{
91 if ( kgdb_debugport == NULL )
92 kgdb_debugport = NS16550_init(KGDB_PORT);
93 NS16550_putc( kgdb_debugport, c );
94}
95
96int getDebugChar( void )
97{
98 if (kgdb_debugport == NULL)
99 kgdb_debugport = NS16550_init(KGDB_PORT);
100
101 return(NS16550_getc(kgdb_debugport));
102}
103
104void kgdb_interruptible(int enable)
105{
106 return;
107}
108
109void putDebugString(char* str)
110{
111 while (*str != '\0') {
112 putDebugChar(*str);
113 str++;
114 }
115 putDebugChar('\r');
116 return;
117}
118
119void
120kgdb_map_scc(void)
121{
122 printk("kgdb init \n");
123 kgdb_debugport = NS16550_init(KGDB_PORT);
124}
diff --git a/arch/ppc/syslib/ppc83xx_setup.c b/arch/ppc/syslib/ppc83xx_setup.c
index c28f9d679484..602a86891f7f 100644
--- a/arch/ppc/syslib/ppc83xx_setup.c
+++ b/arch/ppc/syslib/ppc83xx_setup.c
@@ -23,12 +23,12 @@
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/serial_8250.h> 24#include <linux/serial_8250.h>
25 25
26#include <asm/prom.h>
27#include <asm/time.h> 26#include <asm/time.h>
28#include <asm/mpc83xx.h> 27#include <asm/mpc83xx.h>
29#include <asm/mmu.h> 28#include <asm/mmu.h>
30#include <asm/ppc_sys.h> 29#include <asm/ppc_sys.h>
31#include <asm/kgdb.h> 30#include <asm/kgdb.h>
31#include <asm/delay.h>
32 32
33#include <syslib/ppc83xx_setup.h> 33#include <syslib/ppc83xx_setup.h>
34 34
@@ -117,7 +117,34 @@ mpc83xx_early_serial_map(void)
117void 117void
118mpc83xx_restart(char *cmd) 118mpc83xx_restart(char *cmd)
119{ 119{
120 volatile unsigned char __iomem *reg;
121 unsigned char tmp;
122
123 reg = ioremap(BCSR_PHYS_ADDR, BCSR_SIZE);
124
120 local_irq_disable(); 125 local_irq_disable();
126
127 /*
128 * Unlock the BCSR bits so a PRST will update the contents.
129 * Otherwise the reset asserts but doesn't clear.
130 */
131 tmp = in_8(reg + BCSR_MISC_REG3_OFF);
132 tmp |= BCSR_MISC_REG3_CNFLOCK; /* low true, high false */
133 out_8(reg + BCSR_MISC_REG3_OFF, tmp);
134
135 /*
136 * Trigger a reset via a low->high transition of the
137 * PORESET bit.
138 */
139 tmp = in_8(reg + BCSR_MISC_REG2_OFF);
140 tmp &= ~BCSR_MISC_REG2_PORESET;
141 out_8(reg + BCSR_MISC_REG2_OFF, tmp);
142
143 udelay(1);
144
145 tmp |= BCSR_MISC_REG2_PORESET;
146 out_8(reg + BCSR_MISC_REG2_OFF, tmp);
147
121 for(;;); 148 for(;;);
122} 149}
123 150
diff --git a/arch/ppc/syslib/ppc85xx_setup.c b/arch/ppc/syslib/ppc85xx_setup.c
index 152c3ef1312a..ca95d79a704e 100644
--- a/arch/ppc/syslib/ppc85xx_setup.c
+++ b/arch/ppc/syslib/ppc85xx_setup.c
@@ -23,7 +23,6 @@
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/serial_8250.h> 24#include <linux/serial_8250.h>
25 25
26#include <asm/prom.h>
27#include <asm/time.h> 26#include <asm/time.h>
28#include <asm/mpc85xx.h> 27#include <asm/mpc85xx.h>
29#include <asm/immap_85xx.h> 28#include <asm/immap_85xx.h>
@@ -33,6 +32,8 @@
33 32
34#include <syslib/ppc85xx_setup.h> 33#include <syslib/ppc85xx_setup.h>
35 34
35extern void abort(void);
36
36/* Return the amount of memory */ 37/* Return the amount of memory */
37unsigned long __init 38unsigned long __init
38mpc85xx_find_end_of_memory(void) 39mpc85xx_find_end_of_memory(void)
@@ -132,6 +133,12 @@ mpc85xx_halt(void)
132} 133}
133 134
134#ifdef CONFIG_PCI 135#ifdef CONFIG_PCI
136
137#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS)
138extern void mpc85xx_cds_enable_via(struct pci_controller *hose);
139extern void mpc85xx_cds_fixup_via(struct pci_controller *hose);
140#endif
141
135static void __init 142static void __init
136mpc85xx_setup_pci1(struct pci_controller *hose) 143mpc85xx_setup_pci1(struct pci_controller *hose)
137{ 144{
@@ -302,8 +309,18 @@ mpc85xx_setup_hose(void)
302 309
303 ppc_md.pci_exclude_device = mpc85xx_exclude_device; 310 ppc_md.pci_exclude_device = mpc85xx_exclude_device;
304 311
312#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS)
313 /* Pre pciauto_bus_scan VIA init */
314 mpc85xx_cds_enable_via(hose_a);
315#endif
316
305 hose_a->last_busno = pciauto_bus_scan(hose_a, hose_a->first_busno); 317 hose_a->last_busno = pciauto_bus_scan(hose_a, hose_a->first_busno);
306 318
319#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS)
320 /* Post pciauto_bus_scan VIA fixup */
321 mpc85xx_cds_fixup_via(hose_a);
322#endif
323
307#ifdef CONFIG_85xx_PCI2 324#ifdef CONFIG_85xx_PCI2
308 hose_b = pcibios_alloc_controller(); 325 hose_b = pcibios_alloc_controller();
309 326
diff --git a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c
index 2cee87137f2e..7f15136830f4 100644
--- a/arch/ppc/syslib/prom_init.c
+++ b/arch/ppc/syslib/prom_init.c
@@ -626,8 +626,18 @@ inspect_node(phandle node, struct device_node *dad,
626 l = call_prom("package-to-path", 3, 1, node, 626 l = call_prom("package-to-path", 3, 1, node,
627 mem_start, mem_end - mem_start); 627 mem_start, mem_end - mem_start);
628 if (l >= 0) { 628 if (l >= 0) {
629 char *p, *ep;
630
629 np->full_name = PTRUNRELOC((char *) mem_start); 631 np->full_name = PTRUNRELOC((char *) mem_start);
630 *(char *)(mem_start + l) = 0; 632 *(char *)(mem_start + l) = 0;
633 /* Fixup an Apple bug where they have bogus \0 chars in the
634 * middle of the path in some properties
635 */
636 for (p = (char *)mem_start, ep = p + l; p < ep; p++)
637 if ((*p) == '\0') {
638 memmove(p, p+1, ep - p);
639 ep--;
640 }
631 mem_start = ALIGNUL(mem_start + l + 1); 641 mem_start = ALIGNUL(mem_start + l + 1);
632 } 642 }
633 643
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
index 8565f49b8b0b..be7869e39465 100644
--- a/arch/ppc/xmon/xmon.c
+++ b/arch/ppc/xmon/xmon.c
@@ -9,6 +9,7 @@
9#include <linux/smp.h> 9#include <linux/smp.h>
10#include <linux/interrupt.h> 10#include <linux/interrupt.h>
11#include <linux/bitops.h> 11#include <linux/bitops.h>
12#include <linux/kallsyms.h>
12#include <asm/ptrace.h> 13#include <asm/ptrace.h>
13#include <asm/string.h> 14#include <asm/string.h>
14#include <asm/prom.h> 15#include <asm/prom.h>
@@ -93,8 +94,7 @@ static void take_input(char *);
93static unsigned read_spr(int); 94static unsigned read_spr(int);
94static void write_spr(int, unsigned); 95static void write_spr(int, unsigned);
95static void super_regs(void); 96static void super_regs(void);
96static void print_sysmap(void); 97static void symbol_lookup(void);
97static void sysmap_lookup(void);
98static void remove_bpts(void); 98static void remove_bpts(void);
99static void insert_bpts(void); 99static void insert_bpts(void);
100static struct bpt *at_breakpoint(unsigned pc); 100static struct bpt *at_breakpoint(unsigned pc);
@@ -103,7 +103,6 @@ static void cacheflush(void);
103#ifdef CONFIG_SMP 103#ifdef CONFIG_SMP
104static void cpu_cmd(void); 104static void cpu_cmd(void);
105#endif /* CONFIG_SMP */ 105#endif /* CONFIG_SMP */
106static int pretty_print_addr(unsigned long addr);
107static void csum(void); 106static void csum(void);
108#ifdef CONFIG_BOOTX_TEXT 107#ifdef CONFIG_BOOTX_TEXT
109static void vidcmds(void); 108static void vidcmds(void);
@@ -120,8 +119,6 @@ extern void longjmp(u_int *, int);
120 119
121extern void xmon_enter(void); 120extern void xmon_enter(void);
122extern void xmon_leave(void); 121extern void xmon_leave(void);
123extern char* xmon_find_symbol(unsigned long addr, unsigned long* saddr);
124extern unsigned long xmon_symbol_to_addr(char* symbol);
125 122
126static unsigned start_tb[NR_CPUS][2]; 123static unsigned start_tb[NR_CPUS][2];
127static unsigned stop_tb[NR_CPUS][2]; 124static unsigned stop_tb[NR_CPUS][2];
@@ -148,7 +145,6 @@ Commands:\n\
148 mm move a block of memory\n\ 145 mm move a block of memory\n\
149 ms set a block of memory\n\ 146 ms set a block of memory\n\
150 md compare two blocks of memory\n\ 147 md compare two blocks of memory\n\
151 M print System.map\n\
152 r print registers\n\ 148 r print registers\n\
153 S print special registers\n\ 149 S print special registers\n\
154 t print backtrace\n\ 150 t print backtrace\n\
@@ -175,6 +171,35 @@ extern inline void __delay(unsigned int loops)
175 "r" (loops) : "ctr"); 171 "r" (loops) : "ctr");
176} 172}
177 173
174/* Print an address in numeric and symbolic form (if possible) */
175static void xmon_print_symbol(unsigned long address, const char *mid,
176 const char *after)
177{
178 char *modname;
179 const char *name = NULL;
180 unsigned long offset, size;
181 static char tmpstr[128];
182
183 printf("%.8lx", address);
184 if (setjmp(bus_error_jmp) == 0) {
185 debugger_fault_handler = handle_fault;
186 sync();
187 name = kallsyms_lookup(address, &size, &offset, &modname,
188 tmpstr);
189 sync();
190 /* wait a little while to see if we get a machine check */
191 __delay(200);
192 }
193 debugger_fault_handler = NULL;
194
195 if (name) {
196 printf("%s%s+%#lx/%#lx", mid, name, offset, size);
197 if (modname)
198 printf(" [%s]", modname);
199 }
200 printf("%s", after);
201}
202
178static void get_tb(unsigned *p) 203static void get_tb(unsigned *p)
179{ 204{
180 unsigned hi, lo, hiagain; 205 unsigned hi, lo, hiagain;
@@ -454,7 +479,7 @@ cmds(struct pt_regs *excp)
454 dump(); 479 dump();
455 break; 480 break;
456 case 'l': 481 case 'l':
457 sysmap_lookup(); 482 symbol_lookup();
458 break; 483 break;
459 case 'r': 484 case 'r':
460 if (excp != NULL) 485 if (excp != NULL)
@@ -466,9 +491,6 @@ cmds(struct pt_regs *excp)
466 else 491 else
467 excprint(excp); 492 excprint(excp);
468 break; 493 break;
469 case 'M':
470 print_sysmap();
471 break;
472 case 'S': 494 case 'S':
473 super_regs(); 495 super_regs();
474 break; 496 break;
@@ -825,20 +847,19 @@ backtrace(struct pt_regs *excp)
825 for (; sp != 0; sp = stack[0]) { 847 for (; sp != 0; sp = stack[0]) {
826 if (mread(sp, stack, sizeof(stack)) != sizeof(stack)) 848 if (mread(sp, stack, sizeof(stack)) != sizeof(stack))
827 break; 849 break;
828 pretty_print_addr(stack[1]); 850 printf("[%.8lx] ", stack);
829 printf(" "); 851 xmon_print_symbol(stack[1], " ", "\n");
830 if (stack[1] == (unsigned) &ret_from_except 852 if (stack[1] == (unsigned) &ret_from_except
831 || stack[1] == (unsigned) &ret_from_except_full 853 || stack[1] == (unsigned) &ret_from_except_full
832 || stack[1] == (unsigned) &ret_from_syscall) { 854 || stack[1] == (unsigned) &ret_from_syscall) {
833 if (mread(sp+16, &regs, sizeof(regs)) != sizeof(regs)) 855 if (mread(sp+16, &regs, sizeof(regs)) != sizeof(regs))
834 break; 856 break;
835 printf("\nexception:%x [%x] %x ", regs.trap, sp+16, 857 printf("exception:%x [%x] %x\n", regs.trap, sp+16,
836 regs.nip); 858 regs.nip);
837 sp = regs.gpr[1]; 859 sp = regs.gpr[1];
838 if (mread(sp, stack, sizeof(stack)) != sizeof(stack)) 860 if (mread(sp, stack, sizeof(stack)) != sizeof(stack))
839 break; 861 break;
840 } 862 }
841 printf("\n");
842 } 863 }
843} 864}
844 865
@@ -859,11 +880,10 @@ excprint(struct pt_regs *fp)
859#ifdef CONFIG_SMP 880#ifdef CONFIG_SMP
860 printf("cpu %d: ", smp_processor_id()); 881 printf("cpu %d: ", smp_processor_id());
861#endif /* CONFIG_SMP */ 882#endif /* CONFIG_SMP */
862 printf("vector: %x at pc = ", fp->trap); 883 printf("vector: %x at pc=", fp->trap);
863 pretty_print_addr(fp->nip); 884 xmon_print_symbol(fp->nip, ": ", ", lr=");
864 printf(", lr = "); 885 xmon_print_symbol(fp->link, ": ", "\n");
865 pretty_print_addr(fp->link); 886 printf("msr = %x, sp = %x [%x]\n", fp->msr, fp->gpr[1], fp);
866 printf("\nmsr = %x, sp = %x [%x]\n", fp->msr, fp->gpr[1], fp);
867 trap = TRAP(fp); 887 trap = TRAP(fp);
868 if (trap == 0x300 || trap == 0x600) 888 if (trap == 0x300 || trap == 0x600)
869 printf("dar = %x, dsisr = %x\n", fp->dar, fp->dsisr); 889 printf("dar = %x, dsisr = %x\n", fp->dar, fp->dsisr);
@@ -951,24 +971,6 @@ extern char exc_prolog;
951extern char dec_exc; 971extern char dec_exc;
952 972
953void 973void
954print_sysmap(void)
955{
956 extern char *sysmap;
957 if ( sysmap ) {
958 printf("System.map: \n");
959 if( setjmp(bus_error_jmp) == 0 ) {
960 debugger_fault_handler = handle_fault;
961 sync();
962 xmon_puts(sysmap);
963 sync();
964 }
965 debugger_fault_handler = NULL;
966 }
967 else
968 printf("No System.map\n");
969}
970
971void
972super_regs(void) 974super_regs(void)
973{ 975{
974 int i, cmd; 976 int i, cmd;
@@ -1738,7 +1740,7 @@ scanhex(unsigned *vp)
1738 printf("invalid register name '%%%s'\n", regname); 1740 printf("invalid register name '%%%s'\n", regname);
1739 return 0; 1741 return 0;
1740 } else if (c == '$') { 1742 } else if (c == '$') {
1741 static char symname[64]; 1743 static char symname[128];
1742 int i; 1744 int i;
1743 for (i=0; i<63; i++) { 1745 for (i=0; i<63; i++) {
1744 c = inchar(); 1746 c = inchar();
@@ -1749,7 +1751,14 @@ scanhex(unsigned *vp)
1749 symname[i] = c; 1751 symname[i] = c;
1750 } 1752 }
1751 symname[i++] = 0; 1753 symname[i++] = 0;
1752 *vp = xmon_symbol_to_addr(symname); 1754 *vp = 0;
1755 if (setjmp(bus_error_jmp) == 0) {
1756 debugger_fault_handler = handle_fault;
1757 sync();
1758 *vp = kallsyms_lookup_name(symname);
1759 sync();
1760 }
1761 debugger_fault_handler = NULL;
1753 if (!(*vp)) { 1762 if (!(*vp)) {
1754 printf("unknown symbol\n"); 1763 printf("unknown symbol\n");
1755 return 0; 1764 return 0;
@@ -1840,169 +1849,34 @@ take_input(char *str)
1840 lineptr = str; 1849 lineptr = str;
1841} 1850}
1842 1851
1843void 1852static void
1844sysmap_lookup(void) 1853symbol_lookup(void)
1845{ 1854{
1846 int type = inchar(); 1855 int type = inchar();
1847 unsigned addr; 1856 unsigned addr;
1848 static char tmp[64]; 1857 static char tmp[128];
1849 char* cur;
1850
1851 extern char *sysmap;
1852 extern unsigned long sysmap_size;
1853 if ( !sysmap || !sysmap_size )
1854 return;
1855
1856 switch(type) {
1857 case 'a':
1858 if (scanhex(&addr)) {
1859 pretty_print_addr(addr);
1860 printf("\n");
1861 }
1862 termch = 0;
1863 break;
1864 case 's':
1865 getstring(tmp, 64);
1866 if( setjmp(bus_error_jmp) == 0 ) {
1867 debugger_fault_handler = handle_fault;
1868 sync();
1869 cur = sysmap;
1870 do {
1871 cur = strstr(cur, tmp);
1872 if (cur) {
1873 static char res[64];
1874 char *p, *d;
1875 p = cur;
1876 while(p > sysmap && *p != 10)
1877 p--;
1878 if (*p == 10) p++;
1879 d = res;
1880 while(*p && p < (sysmap + sysmap_size) && *p != 10)
1881 *(d++) = *(p++);
1882 *(d++) = 0;
1883 printf("%s\n", res);
1884 cur++;
1885 }
1886 } while (cur);
1887 sync();
1888 }
1889 debugger_fault_handler = NULL;
1890 termch = 0;
1891 break;
1892 }
1893}
1894 1858
1895static int 1859 switch (type) {
1896pretty_print_addr(unsigned long addr) 1860 case 'a':
1897{ 1861 if (scanhex(&addr))
1898 char *sym; 1862 xmon_print_symbol(addr, ": ", "\n");
1899 unsigned long saddr; 1863 termch = 0;
1900 1864 break;
1901 printf("%08x", addr); 1865 case 's':
1902 sym = xmon_find_symbol(addr, &saddr); 1866 getstring(tmp, 64);
1903 if (sym) 1867 if (setjmp(bus_error_jmp) == 0) {
1904 printf(" (%s+0x%x)", sym, addr-saddr); 1868 debugger_fault_handler = handle_fault;
1905 return (sym != 0); 1869 sync();
1906} 1870 addr = kallsyms_lookup_name(tmp);
1907 1871 if (addr)
1908char* 1872 printf("%s: %lx\n", tmp, addr);
1909xmon_find_symbol(unsigned long addr, unsigned long* saddr) 1873 else
1910{ 1874 printf("Symbol '%s' not found.\n", tmp);
1911 static char rbuffer[64]; 1875 sync();
1912 char *p, *ep, *limit; 1876 }
1913 unsigned long prev, next; 1877 debugger_fault_handler = NULL;
1914 char* psym; 1878 termch = 0;
1915 1879 break;
1916 extern char *sysmap;
1917 extern unsigned long sysmap_size;
1918 if ( !sysmap || !sysmap_size )
1919 return NULL;
1920
1921 prev = 0;
1922 psym = NULL;
1923 p = sysmap;
1924 limit = p + sysmap_size;
1925 if( setjmp(bus_error_jmp) == 0 ) {
1926 debugger_fault_handler = handle_fault;
1927 sync();
1928 do {
1929 next = simple_strtoul(p, &p, 16);
1930 if (next > addr && prev <= addr) {
1931 if (!psym)
1932 goto bail;
1933 ep = rbuffer;
1934 p = psym;
1935 while(*p && p < limit && *p == 32)
1936 p++;
1937 while(*p && p < limit && *p != 10 && (ep - rbuffer) < 63)
1938 *(ep++) = *(p++);
1939 *(ep++) = 0;
1940 if (saddr)
1941 *saddr = prev;
1942 debugger_fault_handler = NULL;
1943 return rbuffer;
1944 }
1945 prev = next;
1946 psym = p;
1947 while(*p && p < limit && *p != 10)
1948 p++;
1949 if (*p) p++;
1950 } while(*p && p < limit && next);
1951bail:
1952 sync();
1953 } 1880 }
1954 debugger_fault_handler = NULL;
1955 return NULL;
1956} 1881}
1957 1882
1958unsigned long
1959xmon_symbol_to_addr(char* symbol)
1960{
1961 char *p, *cur;
1962 char *match = NULL;
1963 int goodness = 0;
1964 int result = 0;
1965
1966 extern char *sysmap;
1967 extern unsigned long sysmap_size;
1968 if ( !sysmap || !sysmap_size )
1969 return 0;
1970
1971 if( setjmp(bus_error_jmp) == 0 ) {
1972 debugger_fault_handler = handle_fault;
1973 sync();
1974 cur = sysmap;
1975 while(cur) {
1976 cur = strstr(cur, symbol);
1977 if (cur) {
1978 int gd = 1;
1979
1980 /* best match if equal, better match if
1981 * begins with
1982 */
1983 if (cur == sysmap || *(cur-1) == ' ') {
1984 gd++;
1985 if (cur[strlen(symbol)] == 10)
1986 gd++;
1987 }
1988 if (gd > goodness) {
1989 match = cur;
1990 goodness = gd;
1991 if (gd == 3)
1992 break;
1993 }
1994 cur++;
1995 }
1996 }
1997 if (goodness) {
1998 p = match;
1999 while(p > sysmap && *p != 10)
2000 p--;
2001 if (*p == 10) p++;
2002 result = simple_strtoul(p, &p, 16);
2003 }
2004 sync();
2005 }
2006 debugger_fault_handler = NULL;
2007 return result;
2008}
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
index 5cb343883e4d..0f1fa289744e 100644
--- a/arch/ppc64/Kconfig
+++ b/arch/ppc64/Kconfig
@@ -323,7 +323,7 @@ config EISA
323 bool 323 bool
324 324
325config PCI 325config PCI
326 bool 326 bool "support for PCI devices" if (EMBEDDED && PPC_ISERIES)
327 default y 327 default y
328 help 328 help
329 Find out whether your system includes a PCI bus. PCI is the name of 329 Find out whether your system includes a PCI bus. PCI is the name of
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile
index 691f3008e698..33c752ceca4b 100644
--- a/arch/ppc64/Makefile
+++ b/arch/ppc64/Makefile
@@ -35,9 +35,9 @@ CROSS32AS := $(AS) -a32
35CROSS32LD := $(LD) -m elf32ppc 35CROSS32LD := $(LD) -m elf32ppc
36CROSS32OBJCOPY := $(OBJCOPY) 36CROSS32OBJCOPY := $(OBJCOPY)
37endif 37endif
38AS := $(AS) -a64 38override AS += -a64
39LD := $(LD) -m elf64ppc 39override LD += -m elf64ppc
40CC := $(CC) -m64 40override CC += -m64
41endif 41endif
42 42
43export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY 43export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY
diff --git a/arch/ppc64/boot/prom.c b/arch/ppc64/boot/prom.c
index 7b607d1862cb..d5218b15824e 100644
--- a/arch/ppc64/boot/prom.c
+++ b/arch/ppc64/boot/prom.c
@@ -11,6 +11,23 @@
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/ctype.h> 12#include <linux/ctype.h>
13 13
14extern __u32 __div64_32(unsigned long long *dividend, __u32 divisor);
15
16/* The unnecessary pointer compare is there
17 * to check for type safety (n must be 64bit)
18 */
19# define do_div(n,base) ({ \
20 __u32 __base = (base); \
21 __u32 __rem; \
22 (void)(((typeof((n)) *)0) == ((unsigned long long *)0)); \
23 if (((n) >> 32) == 0) { \
24 __rem = (__u32)(n) % __base; \
25 (n) = (__u32)(n) / __base; \
26 } else \
27 __rem = __div64_32(&(n), __base); \
28 __rem; \
29 })
30
14int (*prom)(void *); 31int (*prom)(void *);
15 32
16void *chosen_handle; 33void *chosen_handle;
@@ -352,7 +369,7 @@ static int skip_atoi(const char **s)
352#define SPECIAL 32 /* 0x */ 369#define SPECIAL 32 /* 0x */
353#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ 370#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
354 371
355static char * number(char * str, long num, int base, int size, int precision, int type) 372static char * number(char * str, unsigned long long num, int base, int size, int precision, int type)
356{ 373{
357 char c,sign,tmp[66]; 374 char c,sign,tmp[66];
358 const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; 375 const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
@@ -367,9 +384,9 @@ static char * number(char * str, long num, int base, int size, int precision, in
367 c = (type & ZEROPAD) ? '0' : ' '; 384 c = (type & ZEROPAD) ? '0' : ' ';
368 sign = 0; 385 sign = 0;
369 if (type & SIGN) { 386 if (type & SIGN) {
370 if (num < 0) { 387 if ((signed long long)num < 0) {
371 sign = '-'; 388 sign = '-';
372 num = -num; 389 num = - (signed long long)num;
373 size--; 390 size--;
374 } else if (type & PLUS) { 391 } else if (type & PLUS) {
375 sign = '+'; 392 sign = '+';
@@ -389,8 +406,7 @@ static char * number(char * str, long num, int base, int size, int precision, in
389 if (num == 0) 406 if (num == 0)
390 tmp[i++]='0'; 407 tmp[i++]='0';
391 else while (num != 0) { 408 else while (num != 0) {
392 tmp[i++] = digits[num % base]; 409 tmp[i++] = digits[do_div(num, base)];
393 num /= base;
394 } 410 }
395 if (i > precision) 411 if (i > precision)
396 precision = i; 412 precision = i;
@@ -426,7 +442,7 @@ int sprintf(char * buf, const char *fmt, ...);
426int vsprintf(char *buf, const char *fmt, va_list args) 442int vsprintf(char *buf, const char *fmt, va_list args)
427{ 443{
428 int len; 444 int len;
429 unsigned long num; 445 unsigned long long num;
430 int i, base; 446 int i, base;
431 char * str; 447 char * str;
432 const char *s; 448 const char *s;
diff --git a/arch/ppc64/configs/g5_defconfig b/arch/ppc64/configs/g5_defconfig
index 0f90df0b3f9c..1eb33398648e 100644
--- a/arch/ppc64/configs/g5_defconfig
+++ b/arch/ppc64/configs/g5_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11 3# Linux kernel version: 2.6.12-rc6
4# Thu Mar 10 16:47:04 2005 4# Tue Jun 14 16:59:20 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -11,7 +11,7 @@ CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y 11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y 12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y 13CONFIG_COMPAT=y
14CONFIG_FRAME_POINTER=y 14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13 15CONFIG_FORCE_MAX_ZONEORDER=13
16 16
17# 17#
@@ -20,6 +20,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
20CONFIG_EXPERIMENTAL=y 20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y 21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y 22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
23 24
24# 25#
25# General setup 26# General setup
@@ -31,19 +32,20 @@ CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
33# CONFIG_AUDIT is not set 34# CONFIG_AUDIT is not set
34CONFIG_LOG_BUF_SHIFT=17
35CONFIG_HOTPLUG=y 35CONFIG_HOTPLUG=y
36CONFIG_KOBJECT_UEVENT=y 36CONFIG_KOBJECT_UEVENT=y
37CONFIG_IKCONFIG=y 37CONFIG_IKCONFIG=y
38CONFIG_IKCONFIG_PROC=y 38CONFIG_IKCONFIG_PROC=y
39# CONFIG_CPUSETS is not set
39# CONFIG_EMBEDDED is not set 40# CONFIG_EMBEDDED is not set
40CONFIG_KALLSYMS=y 41CONFIG_KALLSYMS=y
41# CONFIG_KALLSYMS_ALL is not set 42# CONFIG_KALLSYMS_ALL is not set
42# CONFIG_KALLSYMS_EXTRA_PASS is not set 43# CONFIG_KALLSYMS_EXTRA_PASS is not set
44CONFIG_PRINTK=y
45CONFIG_BUG=y
43CONFIG_BASE_FULL=y 46CONFIG_BASE_FULL=y
44CONFIG_FUTEX=y 47CONFIG_FUTEX=y
45CONFIG_EPOLL=y 48CONFIG_EPOLL=y
46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
47CONFIG_SHMEM=y 49CONFIG_SHMEM=y
48CONFIG_CC_ALIGN_FUNCTIONS=0 50CONFIG_CC_ALIGN_FUNCTIONS=0
49CONFIG_CC_ALIGN_LABELS=0 51CONFIG_CC_ALIGN_LABELS=0
@@ -87,6 +89,8 @@ CONFIG_NR_CPUS=2
87# CONFIG_SCHED_SMT is not set 89# CONFIG_SCHED_SMT is not set
88# CONFIG_PREEMPT is not set 90# CONFIG_PREEMPT is not set
89CONFIG_GENERIC_HARDIRQS=y 91CONFIG_GENERIC_HARDIRQS=y
92CONFIG_SECCOMP=y
93CONFIG_ISA_DMA_API=y
90 94
91# 95#
92# General setup 96# General setup
@@ -97,6 +101,7 @@ CONFIG_BINFMT_ELF=y
97# CONFIG_BINFMT_MISC is not set 101# CONFIG_BINFMT_MISC is not set
98CONFIG_PCI_LEGACY_PROC=y 102CONFIG_PCI_LEGACY_PROC=y
99CONFIG_PCI_NAMES=y 103CONFIG_PCI_NAMES=y
104# CONFIG_PCI_DEBUG is not set
100# CONFIG_HOTPLUG_CPU is not set 105# CONFIG_HOTPLUG_CPU is not set
101 106
102# 107#
@@ -105,10 +110,6 @@ CONFIG_PCI_NAMES=y
105# CONFIG_PCCARD is not set 110# CONFIG_PCCARD is not set
106 111
107# 112#
108# PC-card bridges
109#
110
111#
112# PCI Hotplug Support 113# PCI Hotplug Support
113# 114#
114# CONFIG_HOTPLUG_PCI is not set 115# CONFIG_HOTPLUG_PCI is not set
@@ -293,7 +294,6 @@ CONFIG_SCSI_SATA_SVW=y
293# CONFIG_SCSI_BUSLOGIC is not set 294# CONFIG_SCSI_BUSLOGIC is not set
294# CONFIG_SCSI_DMX3191D is not set 295# CONFIG_SCSI_DMX3191D is not set
295# CONFIG_SCSI_EATA is not set 296# CONFIG_SCSI_EATA is not set
296# CONFIG_SCSI_EATA_PIO is not set
297# CONFIG_SCSI_FUTURE_DOMAIN is not set 297# CONFIG_SCSI_FUTURE_DOMAIN is not set
298# CONFIG_SCSI_GDTH is not set 298# CONFIG_SCSI_GDTH is not set
299# CONFIG_SCSI_IPS is not set 299# CONFIG_SCSI_IPS is not set
@@ -301,7 +301,6 @@ CONFIG_SCSI_SATA_SVW=y
301# CONFIG_SCSI_INIA100 is not set 301# CONFIG_SCSI_INIA100 is not set
302# CONFIG_SCSI_SYM53C8XX_2 is not set 302# CONFIG_SCSI_SYM53C8XX_2 is not set
303# CONFIG_SCSI_IPR is not set 303# CONFIG_SCSI_IPR is not set
304# CONFIG_SCSI_QLOGIC_ISP is not set
305# CONFIG_SCSI_QLOGIC_FC is not set 304# CONFIG_SCSI_QLOGIC_FC is not set
306# CONFIG_SCSI_QLOGIC_1280 is not set 305# CONFIG_SCSI_QLOGIC_1280 is not set
307CONFIG_SCSI_QLA2XXX=y 306CONFIG_SCSI_QLA2XXX=y
@@ -310,6 +309,7 @@ CONFIG_SCSI_QLA2XXX=y
310# CONFIG_SCSI_QLA2300 is not set 309# CONFIG_SCSI_QLA2300 is not set
311# CONFIG_SCSI_QLA2322 is not set 310# CONFIG_SCSI_QLA2322 is not set
312# CONFIG_SCSI_QLA6312 is not set 311# CONFIG_SCSI_QLA6312 is not set
312# CONFIG_SCSI_LPFC is not set
313# CONFIG_SCSI_DC395x is not set 313# CONFIG_SCSI_DC395x is not set
314# CONFIG_SCSI_DC390T is not set 314# CONFIG_SCSI_DC390T is not set
315# CONFIG_SCSI_DEBUG is not set 315# CONFIG_SCSI_DEBUG is not set
@@ -332,6 +332,7 @@ CONFIG_DM_CRYPT=m
332CONFIG_DM_SNAPSHOT=m 332CONFIG_DM_SNAPSHOT=m
333CONFIG_DM_MIRROR=m 333CONFIG_DM_MIRROR=m
334CONFIG_DM_ZERO=m 334CONFIG_DM_ZERO=m
335# CONFIG_DM_MULTIPATH is not set
335 336
336# 337#
337# Fusion MPT device support 338# Fusion MPT device support
@@ -394,7 +395,6 @@ CONFIG_NET=y
394# 395#
395CONFIG_PACKET=y 396CONFIG_PACKET=y
396# CONFIG_PACKET_MMAP is not set 397# CONFIG_PACKET_MMAP is not set
397# CONFIG_NETLINK_DEV is not set
398CONFIG_UNIX=y 398CONFIG_UNIX=y
399CONFIG_NET_KEY=m 399CONFIG_NET_KEY=m
400CONFIG_INET=y 400CONFIG_INET=y
@@ -564,6 +564,8 @@ CONFIG_E1000=y
564# CONFIG_R8169 is not set 564# CONFIG_R8169 is not set
565# CONFIG_SK98LIN is not set 565# CONFIG_SK98LIN is not set
566CONFIG_TIGON3=m 566CONFIG_TIGON3=m
567# CONFIG_BNX2 is not set
568# CONFIG_MV643XX_ETH is not set
567 569
568# 570#
569# Ethernet (10000 Mbit) 571# Ethernet (10000 Mbit)
@@ -631,18 +633,6 @@ CONFIG_INPUT_EVDEV=y
631# CONFIG_INPUT_EVBUG is not set 633# CONFIG_INPUT_EVBUG is not set
632 634
633# 635#
634# Input I/O drivers
635#
636# CONFIG_GAMEPORT is not set
637CONFIG_SOUND_GAMEPORT=y
638CONFIG_SERIO=y
639# CONFIG_SERIO_I8042 is not set
640# CONFIG_SERIO_SERPORT is not set
641# CONFIG_SERIO_CT82C710 is not set
642# CONFIG_SERIO_PCIPS2 is not set
643# CONFIG_SERIO_RAW is not set
644
645#
646# Input Device Drivers 636# Input Device Drivers
647# 637#
648CONFIG_INPUT_KEYBOARD=y 638CONFIG_INPUT_KEYBOARD=y
@@ -660,6 +650,16 @@ CONFIG_INPUT_MOUSE=y
660# CONFIG_INPUT_MISC is not set 650# CONFIG_INPUT_MISC is not set
661 651
662# 652#
653# Hardware I/O ports
654#
655CONFIG_SERIO=y
656# CONFIG_SERIO_I8042 is not set
657# CONFIG_SERIO_SERPORT is not set
658# CONFIG_SERIO_PCIPS2 is not set
659# CONFIG_SERIO_RAW is not set
660# CONFIG_GAMEPORT is not set
661
662#
663# Character devices 663# Character devices
664# 664#
665CONFIG_VT=y 665CONFIG_VT=y
@@ -676,6 +676,7 @@ CONFIG_HW_CONSOLE=y
676# Non-8250 serial port support 676# Non-8250 serial port support
677# 677#
678# CONFIG_SERIAL_PMACZILOG is not set 678# CONFIG_SERIAL_PMACZILOG is not set
679# CONFIG_SERIAL_JSM is not set
679CONFIG_UNIX98_PTYS=y 680CONFIG_UNIX98_PTYS=y
680CONFIG_LEGACY_PTYS=y 681CONFIG_LEGACY_PTYS=y
681CONFIG_LEGACY_PTY_COUNT=256 682CONFIG_LEGACY_PTY_COUNT=256
@@ -698,9 +699,12 @@ CONFIG_LEGACY_PTY_COUNT=256
698# 699#
699# Ftape, the floppy tape device driver 700# Ftape, the floppy tape device driver
700# 701#
702CONFIG_AGP=m
703CONFIG_AGP_UNINORTH=m
701# CONFIG_DRM is not set 704# CONFIG_DRM is not set
702CONFIG_RAW_DRIVER=y 705CONFIG_RAW_DRIVER=y
703CONFIG_MAX_RAW_DEVS=256 706CONFIG_MAX_RAW_DEVS=256
707# CONFIG_HANGCHECK_TIMER is not set
704 708
705# 709#
706# TPM devices 710# TPM devices
@@ -730,12 +734,11 @@ CONFIG_I2C_ALGOBIT=y
730# CONFIG_I2C_AMD8111 is not set 734# CONFIG_I2C_AMD8111 is not set
731# CONFIG_I2C_I801 is not set 735# CONFIG_I2C_I801 is not set
732# CONFIG_I2C_I810 is not set 736# CONFIG_I2C_I810 is not set
737# CONFIG_I2C_PIIX4 is not set
733# CONFIG_I2C_ISA is not set 738# CONFIG_I2C_ISA is not set
734CONFIG_I2C_KEYWEST=y 739CONFIG_I2C_KEYWEST=y
735# CONFIG_I2C_MPC is not set
736# CONFIG_I2C_NFORCE2 is not set 740# CONFIG_I2C_NFORCE2 is not set
737# CONFIG_I2C_PARPORT_LIGHT is not set 741# CONFIG_I2C_PARPORT_LIGHT is not set
738# CONFIG_I2C_PIIX4 is not set
739# CONFIG_I2C_PROSAVAGE is not set 742# CONFIG_I2C_PROSAVAGE is not set
740# CONFIG_I2C_SAVAGE4 is not set 743# CONFIG_I2C_SAVAGE4 is not set
741# CONFIG_SCx200_ACB is not set 744# CONFIG_SCx200_ACB is not set
@@ -772,6 +775,7 @@ CONFIG_I2C_KEYWEST=y
772# CONFIG_SENSORS_LM85 is not set 775# CONFIG_SENSORS_LM85 is not set
773# CONFIG_SENSORS_LM87 is not set 776# CONFIG_SENSORS_LM87 is not set
774# CONFIG_SENSORS_LM90 is not set 777# CONFIG_SENSORS_LM90 is not set
778# CONFIG_SENSORS_LM92 is not set
775# CONFIG_SENSORS_MAX1619 is not set 779# CONFIG_SENSORS_MAX1619 is not set
776# CONFIG_SENSORS_PC87360 is not set 780# CONFIG_SENSORS_PC87360 is not set
777# CONFIG_SENSORS_SMSC47B397 is not set 781# CONFIG_SENSORS_SMSC47B397 is not set
@@ -785,6 +789,7 @@ CONFIG_I2C_KEYWEST=y
785# 789#
786# Other I2C Chip support 790# Other I2C Chip support
787# 791#
792# CONFIG_SENSORS_DS1337 is not set
788# CONFIG_SENSORS_EEPROM is not set 793# CONFIG_SENSORS_EEPROM is not set
789# CONFIG_SENSORS_PCF8574 is not set 794# CONFIG_SENSORS_PCF8574 is not set
790# CONFIG_SENSORS_PCF8591 is not set 795# CONFIG_SENSORS_PCF8591 is not set
@@ -817,6 +822,11 @@ CONFIG_I2C_KEYWEST=y
817# Graphics support 822# Graphics support
818# 823#
819CONFIG_FB=y 824CONFIG_FB=y
825CONFIG_FB_CFB_FILLRECT=y
826CONFIG_FB_CFB_COPYAREA=y
827CONFIG_FB_CFB_IMAGEBLIT=y
828CONFIG_FB_SOFT_CURSOR=y
829CONFIG_FB_MACMODES=y
820CONFIG_FB_MODE_HELPERS=y 830CONFIG_FB_MODE_HELPERS=y
821CONFIG_FB_TILEBLITTING=y 831CONFIG_FB_TILEBLITTING=y
822# CONFIG_FB_CIRRUS is not set 832# CONFIG_FB_CIRRUS is not set
@@ -830,6 +840,7 @@ CONFIG_FB_OF=y
830# CONFIG_FB_ASILIANT is not set 840# CONFIG_FB_ASILIANT is not set
831# CONFIG_FB_IMSTT is not set 841# CONFIG_FB_IMSTT is not set
832# CONFIG_FB_VGA16 is not set 842# CONFIG_FB_VGA16 is not set
843# CONFIG_FB_NVIDIA is not set
833CONFIG_FB_RIVA=y 844CONFIG_FB_RIVA=y
834# CONFIG_FB_RIVA_I2C is not set 845# CONFIG_FB_RIVA_I2C is not set
835# CONFIG_FB_RIVA_DEBUG is not set 846# CONFIG_FB_RIVA_DEBUG is not set
@@ -847,6 +858,7 @@ CONFIG_FB_RADEON_I2C=y
847# CONFIG_FB_3DFX is not set 858# CONFIG_FB_3DFX is not set
848# CONFIG_FB_VOODOO1 is not set 859# CONFIG_FB_VOODOO1 is not set
849# CONFIG_FB_TRIDENT is not set 860# CONFIG_FB_TRIDENT is not set
861# CONFIG_FB_S1D13XXX is not set
850# CONFIG_FB_VIRTUAL is not set 862# CONFIG_FB_VIRTUAL is not set
851 863
852# 864#
@@ -880,6 +892,8 @@ CONFIG_LCD_DEVICE=y
880# 892#
881# USB support 893# USB support
882# 894#
895CONFIG_USB_ARCH_HAS_HCD=y
896CONFIG_USB_ARCH_HAS_OHCI=y
883CONFIG_USB=y 897CONFIG_USB=y
884# CONFIG_USB_DEBUG is not set 898# CONFIG_USB_DEBUG is not set
885 899
@@ -890,8 +904,6 @@ CONFIG_USB_DEVICEFS=y
890# CONFIG_USB_BANDWIDTH is not set 904# CONFIG_USB_BANDWIDTH is not set
891# CONFIG_USB_DYNAMIC_MINORS is not set 905# CONFIG_USB_DYNAMIC_MINORS is not set
892# CONFIG_USB_OTG is not set 906# CONFIG_USB_OTG is not set
893CONFIG_USB_ARCH_HAS_HCD=y
894CONFIG_USB_ARCH_HAS_OHCI=y
895 907
896# 908#
897# USB Host Controller Drivers 909# USB Host Controller Drivers
@@ -917,7 +929,6 @@ CONFIG_USB_PRINTER=y
917# 929#
918CONFIG_USB_STORAGE=y 930CONFIG_USB_STORAGE=y
919# CONFIG_USB_STORAGE_DEBUG is not set 931# CONFIG_USB_STORAGE_DEBUG is not set
920CONFIG_USB_STORAGE_RW_DETECT=y
921CONFIG_USB_STORAGE_DATAFAB=y 932CONFIG_USB_STORAGE_DATAFAB=y
922CONFIG_USB_STORAGE_FREECOM=y 933CONFIG_USB_STORAGE_FREECOM=y
923CONFIG_USB_STORAGE_ISD200=y 934CONFIG_USB_STORAGE_ISD200=y
@@ -1004,8 +1015,10 @@ CONFIG_USB_MON=y
1004# 1015#
1005CONFIG_USB_SERIAL=m 1016CONFIG_USB_SERIAL=m
1006CONFIG_USB_SERIAL_GENERIC=y 1017CONFIG_USB_SERIAL_GENERIC=y
1018# CONFIG_USB_SERIAL_AIRPRIME is not set
1007CONFIG_USB_SERIAL_BELKIN=m 1019CONFIG_USB_SERIAL_BELKIN=m
1008CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m 1020CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
1021# CONFIG_USB_SERIAL_CP2101 is not set
1009CONFIG_USB_SERIAL_CYPRESS_M8=m 1022CONFIG_USB_SERIAL_CYPRESS_M8=m
1010CONFIG_USB_SERIAL_EMPEG=m 1023CONFIG_USB_SERIAL_EMPEG=m
1011CONFIG_USB_SERIAL_FTDI_SIO=m 1024CONFIG_USB_SERIAL_FTDI_SIO=m
@@ -1034,6 +1047,7 @@ CONFIG_USB_SERIAL_KLSI=m
1034CONFIG_USB_SERIAL_KOBIL_SCT=m 1047CONFIG_USB_SERIAL_KOBIL_SCT=m
1035CONFIG_USB_SERIAL_MCT_U232=m 1048CONFIG_USB_SERIAL_MCT_U232=m
1036CONFIG_USB_SERIAL_PL2303=m 1049CONFIG_USB_SERIAL_PL2303=m
1050# CONFIG_USB_SERIAL_HP4X is not set
1037CONFIG_USB_SERIAL_SAFE=m 1051CONFIG_USB_SERIAL_SAFE=m
1038CONFIG_USB_SERIAL_SAFE_PADDED=y 1052CONFIG_USB_SERIAL_SAFE_PADDED=y
1039CONFIG_USB_SERIAL_TI=m 1053CONFIG_USB_SERIAL_TI=m
@@ -1270,11 +1284,13 @@ CONFIG_OPROFILE=y
1270# 1284#
1271# Kernel hacking 1285# Kernel hacking
1272# 1286#
1287# CONFIG_PRINTK_TIME is not set
1273CONFIG_DEBUG_KERNEL=y 1288CONFIG_DEBUG_KERNEL=y
1274CONFIG_MAGIC_SYSRQ=y 1289CONFIG_MAGIC_SYSRQ=y
1275# CONFIG_PRINTK_TIME is not set 1290CONFIG_LOG_BUF_SHIFT=17
1276# CONFIG_SCHEDSTATS is not set 1291# CONFIG_SCHEDSTATS is not set
1277# CONFIG_DEBUG_SLAB is not set 1292# CONFIG_DEBUG_SLAB is not set
1293# CONFIG_DEBUG_SPINLOCK is not set
1278# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1294# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1279# CONFIG_DEBUG_KOBJECT is not set 1295# CONFIG_DEBUG_KOBJECT is not set
1280# CONFIG_DEBUG_INFO is not set 1296# CONFIG_DEBUG_INFO is not set
diff --git a/arch/ppc64/configs/iSeries_defconfig b/arch/ppc64/configs/iSeries_defconfig
index a39e9d2e25da..f6a2b99afd63 100644
--- a/arch/ppc64/configs/iSeries_defconfig
+++ b/arch/ppc64/configs/iSeries_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc3-bk6 3# Linux kernel version: 2.6.12-rc6
4# Wed Feb 9 23:34:52 2005 4# Tue Jun 14 17:01:28 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -11,7 +11,7 @@ CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y 11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y 12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y 13CONFIG_COMPAT=y
14CONFIG_FRAME_POINTER=y 14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13 15CONFIG_FORCE_MAX_ZONEORDER=13
16 16
17# 17#
@@ -20,6 +20,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
20CONFIG_EXPERIMENTAL=y 20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y 21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y 22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
23 24
24# 25#
25# General setup 26# General setup
@@ -30,24 +31,29 @@ CONFIG_SYSVIPC=y
30CONFIG_POSIX_MQUEUE=y 31CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
33CONFIG_LOG_BUF_SHIFT=17 34CONFIG_AUDIT=y
35CONFIG_AUDITSYSCALL=y
34CONFIG_HOTPLUG=y 36CONFIG_HOTPLUG=y
35CONFIG_KOBJECT_UEVENT=y 37CONFIG_KOBJECT_UEVENT=y
36CONFIG_IKCONFIG=y 38CONFIG_IKCONFIG=y
37CONFIG_IKCONFIG_PROC=y 39CONFIG_IKCONFIG_PROC=y
40# CONFIG_CPUSETS is not set
38# CONFIG_EMBEDDED is not set 41# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y 42CONFIG_KALLSYMS=y
40# CONFIG_KALLSYMS_ALL is not set 43# CONFIG_KALLSYMS_ALL is not set
41# CONFIG_KALLSYMS_EXTRA_PASS is not set 44# CONFIG_KALLSYMS_EXTRA_PASS is not set
45CONFIG_PRINTK=y
46CONFIG_BUG=y
47CONFIG_BASE_FULL=y
42CONFIG_FUTEX=y 48CONFIG_FUTEX=y
43CONFIG_EPOLL=y 49CONFIG_EPOLL=y
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SHMEM=y 50CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0 51CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0 52CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0 53CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0 54CONFIG_CC_ALIGN_JUMPS=0
50# CONFIG_TINY_SHMEM is not set 55# CONFIG_TINY_SHMEM is not set
56CONFIG_BASE_SMALL=0
51 57
52# 58#
53# Loadable module support 59# Loadable module support
@@ -79,6 +85,8 @@ CONFIG_NR_CPUS=32
79CONFIG_GENERIC_HARDIRQS=y 85CONFIG_GENERIC_HARDIRQS=y
80CONFIG_MSCHUNKS=y 86CONFIG_MSCHUNKS=y
81CONFIG_LPARCFG=y 87CONFIG_LPARCFG=y
88CONFIG_SECCOMP=y
89CONFIG_ISA_DMA_API=y
82 90
83# 91#
84# General setup 92# General setup
@@ -89,6 +97,7 @@ CONFIG_BINFMT_ELF=y
89# CONFIG_BINFMT_MISC is not set 97# CONFIG_BINFMT_MISC is not set
90CONFIG_PCI_LEGACY_PROC=y 98CONFIG_PCI_LEGACY_PROC=y
91CONFIG_PCI_NAMES=y 99CONFIG_PCI_NAMES=y
100# CONFIG_PCI_DEBUG is not set
92 101
93# 102#
94# PCCARD (PCMCIA/CardBus) support 103# PCCARD (PCMCIA/CardBus) support
@@ -96,10 +105,6 @@ CONFIG_PCI_NAMES=y
96# CONFIG_PCCARD is not set 105# CONFIG_PCCARD is not set
97 106
98# 107#
99# PC-card bridges
100#
101
102#
103# PCI Hotplug Support 108# PCI Hotplug Support
104# 109#
105# CONFIG_HOTPLUG_PCI is not set 110# CONFIG_HOTPLUG_PCI is not set
@@ -210,7 +215,6 @@ CONFIG_SCSI_FC_ATTRS=y
210# CONFIG_SCSI_BUSLOGIC is not set 215# CONFIG_SCSI_BUSLOGIC is not set
211# CONFIG_SCSI_DMX3191D is not set 216# CONFIG_SCSI_DMX3191D is not set
212# CONFIG_SCSI_EATA is not set 217# CONFIG_SCSI_EATA is not set
213# CONFIG_SCSI_EATA_PIO is not set
214# CONFIG_SCSI_FUTURE_DOMAIN is not set 218# CONFIG_SCSI_FUTURE_DOMAIN is not set
215# CONFIG_SCSI_GDTH is not set 219# CONFIG_SCSI_GDTH is not set
216# CONFIG_SCSI_IPS is not set 220# CONFIG_SCSI_IPS is not set
@@ -219,7 +223,6 @@ CONFIG_SCSI_IBMVSCSI=m
219# CONFIG_SCSI_INIA100 is not set 223# CONFIG_SCSI_INIA100 is not set
220# CONFIG_SCSI_SYM53C8XX_2 is not set 224# CONFIG_SCSI_SYM53C8XX_2 is not set
221# CONFIG_SCSI_IPR is not set 225# CONFIG_SCSI_IPR is not set
222# CONFIG_SCSI_QLOGIC_ISP is not set
223# CONFIG_SCSI_QLOGIC_FC is not set 226# CONFIG_SCSI_QLOGIC_FC is not set
224# CONFIG_SCSI_QLOGIC_1280 is not set 227# CONFIG_SCSI_QLOGIC_1280 is not set
225CONFIG_SCSI_QLA2XXX=y 228CONFIG_SCSI_QLA2XXX=y
@@ -228,6 +231,7 @@ CONFIG_SCSI_QLA2XXX=y
228# CONFIG_SCSI_QLA2300 is not set 231# CONFIG_SCSI_QLA2300 is not set
229# CONFIG_SCSI_QLA2322 is not set 232# CONFIG_SCSI_QLA2322 is not set
230# CONFIG_SCSI_QLA6312 is not set 233# CONFIG_SCSI_QLA6312 is not set
234# CONFIG_SCSI_LPFC is not set
231# CONFIG_SCSI_DC395x is not set 235# CONFIG_SCSI_DC395x is not set
232# CONFIG_SCSI_DC390T is not set 236# CONFIG_SCSI_DC390T is not set
233# CONFIG_SCSI_DEBUG is not set 237# CONFIG_SCSI_DEBUG is not set
@@ -250,6 +254,7 @@ CONFIG_DM_CRYPT=m
250CONFIG_DM_SNAPSHOT=m 254CONFIG_DM_SNAPSHOT=m
251CONFIG_DM_MIRROR=m 255CONFIG_DM_MIRROR=m
252CONFIG_DM_ZERO=m 256CONFIG_DM_ZERO=m
257# CONFIG_DM_MULTIPATH is not set
253 258
254# 259#
255# Fusion MPT device support 260# Fusion MPT device support
@@ -280,7 +285,6 @@ CONFIG_NET=y
280# 285#
281CONFIG_PACKET=y 286CONFIG_PACKET=y
282# CONFIG_PACKET_MMAP is not set 287# CONFIG_PACKET_MMAP is not set
283# CONFIG_NETLINK_DEV is not set
284CONFIG_UNIX=y 288CONFIG_UNIX=y
285CONFIG_NET_KEY=m 289CONFIG_NET_KEY=m
286CONFIG_INET=y 290CONFIG_INET=y
@@ -445,7 +449,6 @@ CONFIG_PCNET32=y
445# CONFIG_DGRS is not set 449# CONFIG_DGRS is not set
446# CONFIG_EEPRO100 is not set 450# CONFIG_EEPRO100 is not set
447CONFIG_E100=y 451CONFIG_E100=y
448# CONFIG_E100_NAPI is not set
449# CONFIG_FEALNX is not set 452# CONFIG_FEALNX is not set
450# CONFIG_NATSEMI is not set 453# CONFIG_NATSEMI is not set
451# CONFIG_NE2K_PCI is not set 454# CONFIG_NE2K_PCI is not set
@@ -471,6 +474,7 @@ CONFIG_E1000=m
471# CONFIG_SK98LIN is not set 474# CONFIG_SK98LIN is not set
472# CONFIG_VIA_VELOCITY is not set 475# CONFIG_VIA_VELOCITY is not set
473# CONFIG_TIGON3 is not set 476# CONFIG_TIGON3 is not set
477# CONFIG_BNX2 is not set
474 478
475# 479#
476# Ethernet (10000 Mbit) 480# Ethernet (10000 Mbit)
@@ -539,14 +543,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
539# CONFIG_INPUT_EVBUG is not set 543# CONFIG_INPUT_EVBUG is not set
540 544
541# 545#
542# Input I/O drivers
543#
544# CONFIG_GAMEPORT is not set
545CONFIG_SOUND_GAMEPORT=y
546# CONFIG_SERIO is not set
547# CONFIG_SERIO_I8042 is not set
548
549#
550# Input Device Drivers 546# Input Device Drivers
551# 547#
552# CONFIG_INPUT_KEYBOARD is not set 548# CONFIG_INPUT_KEYBOARD is not set
@@ -556,6 +552,12 @@ CONFIG_SOUND_GAMEPORT=y
556# CONFIG_INPUT_MISC is not set 552# CONFIG_INPUT_MISC is not set
557 553
558# 554#
555# Hardware I/O ports
556#
557# CONFIG_SERIO is not set
558# CONFIG_GAMEPORT is not set
559
560#
559# Character devices 561# Character devices
560# 562#
561# CONFIG_SERIAL_NONSTANDARD is not set 563# CONFIG_SERIAL_NONSTANDARD is not set
@@ -570,6 +572,7 @@ CONFIG_SOUND_GAMEPORT=y
570# 572#
571CONFIG_SERIAL_CORE=m 573CONFIG_SERIAL_CORE=m
572CONFIG_SERIAL_ICOM=m 574CONFIG_SERIAL_ICOM=m
575# CONFIG_SERIAL_JSM is not set
573CONFIG_UNIX98_PTYS=y 576CONFIG_UNIX98_PTYS=y
574CONFIG_LEGACY_PTYS=y 577CONFIG_LEGACY_PTYS=y
575CONFIG_LEGACY_PTY_COUNT=256 578CONFIG_LEGACY_PTY_COUNT=256
@@ -592,9 +595,16 @@ CONFIG_LEGACY_PTY_COUNT=256
592# 595#
593# Ftape, the floppy tape device driver 596# Ftape, the floppy tape device driver
594# 597#
598# CONFIG_AGP is not set
595# CONFIG_DRM is not set 599# CONFIG_DRM is not set
596CONFIG_RAW_DRIVER=y 600CONFIG_RAW_DRIVER=y
597CONFIG_MAX_RAW_DEVS=256 601CONFIG_MAX_RAW_DEVS=256
602# CONFIG_HANGCHECK_TIMER is not set
603
604#
605# TPM devices
606#
607# CONFIG_TCG_TPM is not set
598 608
599# 609#
600# I2C support 610# I2C support
@@ -633,13 +643,9 @@ CONFIG_MAX_RAW_DEVS=256
633# 643#
634# USB support 644# USB support
635# 645#
636# CONFIG_USB is not set
637CONFIG_USB_ARCH_HAS_HCD=y 646CONFIG_USB_ARCH_HAS_HCD=y
638CONFIG_USB_ARCH_HAS_OHCI=y 647CONFIG_USB_ARCH_HAS_OHCI=y
639 648# CONFIG_USB is not set
640#
641# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
642#
643 649
644# 650#
645# USB Gadget Support 651# USB Gadget Support
@@ -848,10 +854,13 @@ CONFIG_OPROFILE=y
848# 854#
849# Kernel hacking 855# Kernel hacking
850# 856#
857# CONFIG_PRINTK_TIME is not set
851CONFIG_DEBUG_KERNEL=y 858CONFIG_DEBUG_KERNEL=y
852CONFIG_MAGIC_SYSRQ=y 859CONFIG_MAGIC_SYSRQ=y
860CONFIG_LOG_BUF_SHIFT=17
853# CONFIG_SCHEDSTATS is not set 861# CONFIG_SCHEDSTATS is not set
854# CONFIG_DEBUG_SLAB is not set 862# CONFIG_DEBUG_SLAB is not set
863# CONFIG_DEBUG_SPINLOCK is not set
855# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 864# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
856# CONFIG_DEBUG_KOBJECT is not set 865# CONFIG_DEBUG_KOBJECT is not set
857# CONFIG_DEBUG_INFO is not set 866# CONFIG_DEBUG_INFO is not set
@@ -881,6 +890,7 @@ CONFIG_CRYPTO_SHA1=m
881CONFIG_CRYPTO_SHA256=m 890CONFIG_CRYPTO_SHA256=m
882CONFIG_CRYPTO_SHA512=m 891CONFIG_CRYPTO_SHA512=m
883CONFIG_CRYPTO_WP512=m 892CONFIG_CRYPTO_WP512=m
893CONFIG_CRYPTO_TGR192=m
884CONFIG_CRYPTO_DES=y 894CONFIG_CRYPTO_DES=y
885CONFIG_CRYPTO_BLOWFISH=m 895CONFIG_CRYPTO_BLOWFISH=m
886CONFIG_CRYPTO_TWOFISH=m 896CONFIG_CRYPTO_TWOFISH=m
diff --git a/arch/ppc64/configs/maple_defconfig b/arch/ppc64/configs/maple_defconfig
index cf527501915c..8051b0f47b6f 100644
--- a/arch/ppc64/configs/maple_defconfig
+++ b/arch/ppc64/configs/maple_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc3-bk6 3# Linux kernel version: 2.6.12-rc6
4# Wed Feb 9 23:34:53 2005 4# Tue Jun 14 17:12:48 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -11,7 +11,7 @@ CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y 11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y 12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y 13CONFIG_COMPAT=y
14CONFIG_FRAME_POINTER=y 14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13 15CONFIG_FORCE_MAX_ZONEORDER=13
16 16
17# 17#
@@ -20,6 +20,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
20CONFIG_EXPERIMENTAL=y 20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y 21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y 22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
23 24
24# 25#
25# General setup 26# General setup
@@ -30,24 +31,28 @@ CONFIG_SYSVIPC=y
30CONFIG_POSIX_MQUEUE=y 31CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
33CONFIG_LOG_BUF_SHIFT=17 34# CONFIG_AUDIT is not set
34# CONFIG_HOTPLUG is not set 35# CONFIG_HOTPLUG is not set
35CONFIG_KOBJECT_UEVENT=y 36CONFIG_KOBJECT_UEVENT=y
36CONFIG_IKCONFIG=y 37CONFIG_IKCONFIG=y
37CONFIG_IKCONFIG_PROC=y 38CONFIG_IKCONFIG_PROC=y
39# CONFIG_CPUSETS is not set
38# CONFIG_EMBEDDED is not set 40# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y 41CONFIG_KALLSYMS=y
40CONFIG_KALLSYMS_ALL=y 42CONFIG_KALLSYMS_ALL=y
41# CONFIG_KALLSYMS_EXTRA_PASS is not set 43# CONFIG_KALLSYMS_EXTRA_PASS is not set
44CONFIG_PRINTK=y
45CONFIG_BUG=y
46CONFIG_BASE_FULL=y
42CONFIG_FUTEX=y 47CONFIG_FUTEX=y
43CONFIG_EPOLL=y 48CONFIG_EPOLL=y
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SHMEM=y 49CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0 50CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0 51CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0 52CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0 53CONFIG_CC_ALIGN_JUMPS=0
50# CONFIG_TINY_SHMEM is not set 54# CONFIG_TINY_SHMEM is not set
55CONFIG_BASE_SMALL=0
51 56
52# 57#
53# Loadable module support 58# Loadable module support
@@ -84,6 +89,8 @@ CONFIG_NR_CPUS=2
84# CONFIG_SCHED_SMT is not set 89# CONFIG_SCHED_SMT is not set
85# CONFIG_PREEMPT is not set 90# CONFIG_PREEMPT is not set
86CONFIG_GENERIC_HARDIRQS=y 91CONFIG_GENERIC_HARDIRQS=y
92CONFIG_SECCOMP=y
93CONFIG_ISA_DMA_API=y
87 94
88# 95#
89# General setup 96# General setup
@@ -94,6 +101,7 @@ CONFIG_BINFMT_ELF=y
94# CONFIG_BINFMT_MISC is not set 101# CONFIG_BINFMT_MISC is not set
95CONFIG_PCI_LEGACY_PROC=y 102CONFIG_PCI_LEGACY_PROC=y
96CONFIG_PCI_NAMES=y 103CONFIG_PCI_NAMES=y
104# CONFIG_PCI_DEBUG is not set
97 105
98# 106#
99# PCCARD (PCMCIA/CardBus) support 107# PCCARD (PCMCIA/CardBus) support
@@ -101,10 +109,6 @@ CONFIG_PCI_NAMES=y
101# CONFIG_PCCARD is not set 109# CONFIG_PCCARD is not set
102 110
103# 111#
104# PC-card bridges
105#
106
107#
108# PCI Hotplug Support 112# PCI Hotplug Support
109# 113#
110# CONFIG_HOTPLUG_PCI is not set 114# CONFIG_HOTPLUG_PCI is not set
@@ -261,7 +265,6 @@ CONFIG_NET=y
261# 265#
262CONFIG_PACKET=y 266CONFIG_PACKET=y
263CONFIG_PACKET_MMAP=y 267CONFIG_PACKET_MMAP=y
264# CONFIG_NETLINK_DEV is not set
265CONFIG_UNIX=y 268CONFIG_UNIX=y
266# CONFIG_NET_KEY is not set 269# CONFIG_NET_KEY is not set
267CONFIG_INET=y 270CONFIG_INET=y
@@ -376,6 +379,8 @@ CONFIG_E1000=y
376# CONFIG_SK98LIN is not set 379# CONFIG_SK98LIN is not set
377# CONFIG_VIA_VELOCITY is not set 380# CONFIG_VIA_VELOCITY is not set
378# CONFIG_TIGON3 is not set 381# CONFIG_TIGON3 is not set
382# CONFIG_BNX2 is not set
383# CONFIG_MV643XX_ETH is not set
379 384
380# 385#
381# Ethernet (10000 Mbit) 386# Ethernet (10000 Mbit)
@@ -432,14 +437,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=1200
432# CONFIG_INPUT_EVBUG is not set 437# CONFIG_INPUT_EVBUG is not set
433 438
434# 439#
435# Input I/O drivers
436#
437# CONFIG_GAMEPORT is not set
438CONFIG_SOUND_GAMEPORT=y
439# CONFIG_SERIO is not set
440# CONFIG_SERIO_I8042 is not set
441
442#
443# Input Device Drivers 440# Input Device Drivers
444# 441#
445# CONFIG_INPUT_KEYBOARD is not set 442# CONFIG_INPUT_KEYBOARD is not set
@@ -449,6 +446,12 @@ CONFIG_SOUND_GAMEPORT=y
449# CONFIG_INPUT_MISC is not set 446# CONFIG_INPUT_MISC is not set
450 447
451# 448#
449# Hardware I/O ports
450#
451# CONFIG_SERIO is not set
452# CONFIG_GAMEPORT is not set
453
454#
452# Character devices 455# Character devices
453# 456#
454CONFIG_VT=y 457CONFIG_VT=y
@@ -469,7 +472,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
469# 472#
470CONFIG_SERIAL_CORE=y 473CONFIG_SERIAL_CORE=y
471CONFIG_SERIAL_CORE_CONSOLE=y 474CONFIG_SERIAL_CORE_CONSOLE=y
472# CONFIG_SERIAL_PMACZILOG is not set 475# CONFIG_SERIAL_JSM is not set
473CONFIG_UNIX98_PTYS=y 476CONFIG_UNIX98_PTYS=y
474CONFIG_LEGACY_PTYS=y 477CONFIG_LEGACY_PTYS=y
475CONFIG_LEGACY_PTY_COUNT=256 478CONFIG_LEGACY_PTY_COUNT=256
@@ -492,8 +495,15 @@ CONFIG_LEGACY_PTY_COUNT=256
492# 495#
493# Ftape, the floppy tape device driver 496# Ftape, the floppy tape device driver
494# 497#
498# CONFIG_AGP is not set
495# CONFIG_DRM is not set 499# CONFIG_DRM is not set
496# CONFIG_RAW_DRIVER is not set 500# CONFIG_RAW_DRIVER is not set
501# CONFIG_HANGCHECK_TIMER is not set
502
503#
504# TPM devices
505#
506# CONFIG_TCG_TPM is not set
497 507
498# 508#
499# I2C support 509# I2C support
@@ -518,8 +528,8 @@ CONFIG_I2C_ALGOBIT=y
518CONFIG_I2C_AMD8111=y 528CONFIG_I2C_AMD8111=y
519# CONFIG_I2C_I801 is not set 529# CONFIG_I2C_I801 is not set
520# CONFIG_I2C_I810 is not set 530# CONFIG_I2C_I810 is not set
531# CONFIG_I2C_PIIX4 is not set
521# CONFIG_I2C_ISA is not set 532# CONFIG_I2C_ISA is not set
522# CONFIG_I2C_MPC is not set
523# CONFIG_I2C_NFORCE2 is not set 533# CONFIG_I2C_NFORCE2 is not set
524# CONFIG_I2C_PARPORT_LIGHT is not set 534# CONFIG_I2C_PARPORT_LIGHT is not set
525# CONFIG_I2C_PROSAVAGE is not set 535# CONFIG_I2C_PROSAVAGE is not set
@@ -545,7 +555,9 @@ CONFIG_I2C_AMD8111=y
545# CONFIG_SENSORS_ASB100 is not set 555# CONFIG_SENSORS_ASB100 is not set
546# CONFIG_SENSORS_DS1621 is not set 556# CONFIG_SENSORS_DS1621 is not set
547# CONFIG_SENSORS_FSCHER is not set 557# CONFIG_SENSORS_FSCHER is not set
558# CONFIG_SENSORS_FSCPOS is not set
548# CONFIG_SENSORS_GL518SM is not set 559# CONFIG_SENSORS_GL518SM is not set
560# CONFIG_SENSORS_GL520SM is not set
549# CONFIG_SENSORS_IT87 is not set 561# CONFIG_SENSORS_IT87 is not set
550# CONFIG_SENSORS_LM63 is not set 562# CONFIG_SENSORS_LM63 is not set
551# CONFIG_SENSORS_LM75 is not set 563# CONFIG_SENSORS_LM75 is not set
@@ -556,9 +568,11 @@ CONFIG_I2C_AMD8111=y
556# CONFIG_SENSORS_LM85 is not set 568# CONFIG_SENSORS_LM85 is not set
557# CONFIG_SENSORS_LM87 is not set 569# CONFIG_SENSORS_LM87 is not set
558# CONFIG_SENSORS_LM90 is not set 570# CONFIG_SENSORS_LM90 is not set
571# CONFIG_SENSORS_LM92 is not set
559# CONFIG_SENSORS_MAX1619 is not set 572# CONFIG_SENSORS_MAX1619 is not set
560# CONFIG_SENSORS_PC87360 is not set 573# CONFIG_SENSORS_PC87360 is not set
561# CONFIG_SENSORS_SMSC47B397 is not set 574# CONFIG_SENSORS_SMSC47B397 is not set
575# CONFIG_SENSORS_SIS5595 is not set
562# CONFIG_SENSORS_SMSC47M1 is not set 576# CONFIG_SENSORS_SMSC47M1 is not set
563# CONFIG_SENSORS_VIA686A is not set 577# CONFIG_SENSORS_VIA686A is not set
564# CONFIG_SENSORS_W83781D is not set 578# CONFIG_SENSORS_W83781D is not set
@@ -568,6 +582,7 @@ CONFIG_I2C_AMD8111=y
568# 582#
569# Other I2C Chip support 583# Other I2C Chip support
570# 584#
585# CONFIG_SENSORS_DS1337 is not set
571# CONFIG_SENSORS_EEPROM is not set 586# CONFIG_SENSORS_EEPROM is not set
572# CONFIG_SENSORS_PCF8574 is not set 587# CONFIG_SENSORS_PCF8574 is not set
573# CONFIG_SENSORS_PCF8591 is not set 588# CONFIG_SENSORS_PCF8591 is not set
@@ -615,6 +630,8 @@ CONFIG_DUMMY_CONSOLE=y
615# 630#
616# USB support 631# USB support
617# 632#
633CONFIG_USB_ARCH_HAS_HCD=y
634CONFIG_USB_ARCH_HAS_OHCI=y
618CONFIG_USB=y 635CONFIG_USB=y
619# CONFIG_USB_DEBUG is not set 636# CONFIG_USB_DEBUG is not set
620 637
@@ -625,8 +642,6 @@ CONFIG_USB_DEVICEFS=y
625# CONFIG_USB_BANDWIDTH is not set 642# CONFIG_USB_BANDWIDTH is not set
626# CONFIG_USB_DYNAMIC_MINORS is not set 643# CONFIG_USB_DYNAMIC_MINORS is not set
627# CONFIG_USB_OTG is not set 644# CONFIG_USB_OTG is not set
628CONFIG_USB_ARCH_HAS_HCD=y
629CONFIG_USB_ARCH_HAS_OHCI=y
630 645
631# 646#
632# USB Host Controller Drivers 647# USB Host Controller Drivers
@@ -635,6 +650,8 @@ CONFIG_USB_EHCI_HCD=y
635CONFIG_USB_EHCI_SPLIT_ISO=y 650CONFIG_USB_EHCI_SPLIT_ISO=y
636CONFIG_USB_EHCI_ROOT_HUB_TT=y 651CONFIG_USB_EHCI_ROOT_HUB_TT=y
637CONFIG_USB_OHCI_HCD=y 652CONFIG_USB_OHCI_HCD=y
653# CONFIG_USB_OHCI_BIG_ENDIAN is not set
654CONFIG_USB_OHCI_LITTLE_ENDIAN=y
638CONFIG_USB_UHCI_HCD=y 655CONFIG_USB_UHCI_HCD=y
639# CONFIG_USB_SL811_HCD is not set 656# CONFIG_USB_SL811_HCD is not set
640 657
@@ -688,6 +705,7 @@ CONFIG_USB_HIDINPUT=y
688CONFIG_USB_PEGASUS=y 705CONFIG_USB_PEGASUS=y
689# CONFIG_USB_RTL8150 is not set 706# CONFIG_USB_RTL8150 is not set
690# CONFIG_USB_USBNET is not set 707# CONFIG_USB_USBNET is not set
708CONFIG_USB_MON=y
691 709
692# 710#
693# USB port drivers 711# USB port drivers
@@ -699,8 +717,10 @@ CONFIG_USB_PEGASUS=y
699CONFIG_USB_SERIAL=y 717CONFIG_USB_SERIAL=y
700# CONFIG_USB_SERIAL_CONSOLE is not set 718# CONFIG_USB_SERIAL_CONSOLE is not set
701CONFIG_USB_SERIAL_GENERIC=y 719CONFIG_USB_SERIAL_GENERIC=y
720# CONFIG_USB_SERIAL_AIRPRIME is not set
702# CONFIG_USB_SERIAL_BELKIN is not set 721# CONFIG_USB_SERIAL_BELKIN is not set
703# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set 722# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
723# CONFIG_USB_SERIAL_CP2101 is not set
704CONFIG_USB_SERIAL_CYPRESS_M8=m 724CONFIG_USB_SERIAL_CYPRESS_M8=m
705# CONFIG_USB_SERIAL_EMPEG is not set 725# CONFIG_USB_SERIAL_EMPEG is not set
706# CONFIG_USB_SERIAL_FTDI_SIO is not set 726# CONFIG_USB_SERIAL_FTDI_SIO is not set
@@ -729,6 +749,7 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
729# CONFIG_USB_SERIAL_KOBIL_SCT is not set 749# CONFIG_USB_SERIAL_KOBIL_SCT is not set
730# CONFIG_USB_SERIAL_MCT_U232 is not set 750# CONFIG_USB_SERIAL_MCT_U232 is not set
731# CONFIG_USB_SERIAL_PL2303 is not set 751# CONFIG_USB_SERIAL_PL2303 is not set
752# CONFIG_USB_SERIAL_HP4X is not set
732# CONFIG_USB_SERIAL_SAFE is not set 753# CONFIG_USB_SERIAL_SAFE is not set
733CONFIG_USB_SERIAL_TI=m 754CONFIG_USB_SERIAL_TI=m
734# CONFIG_USB_SERIAL_CYBERJACK is not set 755# CONFIG_USB_SERIAL_CYBERJACK is not set
@@ -750,6 +771,7 @@ CONFIG_USB_EZUSB=y
750# CONFIG_USB_PHIDGETKIT is not set 771# CONFIG_USB_PHIDGETKIT is not set
751# CONFIG_USB_PHIDGETSERVO is not set 772# CONFIG_USB_PHIDGETSERVO is not set
752# CONFIG_USB_IDMOUSE is not set 773# CONFIG_USB_IDMOUSE is not set
774# CONFIG_USB_SISUSBVGA is not set
753# CONFIG_USB_TEST is not set 775# CONFIG_USB_TEST is not set
754 776
755# 777#
@@ -936,10 +958,13 @@ CONFIG_NLS_UTF8=y
936# 958#
937# Kernel hacking 959# Kernel hacking
938# 960#
961# CONFIG_PRINTK_TIME is not set
939CONFIG_DEBUG_KERNEL=y 962CONFIG_DEBUG_KERNEL=y
940CONFIG_MAGIC_SYSRQ=y 963CONFIG_MAGIC_SYSRQ=y
964CONFIG_LOG_BUF_SHIFT=17
941# CONFIG_SCHEDSTATS is not set 965# CONFIG_SCHEDSTATS is not set
942CONFIG_DEBUG_SLAB=y 966CONFIG_DEBUG_SLAB=y
967# CONFIG_DEBUG_SPINLOCK is not set
943CONFIG_DEBUG_SPINLOCK_SLEEP=y 968CONFIG_DEBUG_SPINLOCK_SLEEP=y
944# CONFIG_DEBUG_KOBJECT is not set 969# CONFIG_DEBUG_KOBJECT is not set
945# CONFIG_DEBUG_INFO is not set 970# CONFIG_DEBUG_INFO is not set
@@ -971,6 +996,7 @@ CONFIG_CRYPTO_MD5=y
971# CONFIG_CRYPTO_SHA256 is not set 996# CONFIG_CRYPTO_SHA256 is not set
972# CONFIG_CRYPTO_SHA512 is not set 997# CONFIG_CRYPTO_SHA512 is not set
973# CONFIG_CRYPTO_WP512 is not set 998# CONFIG_CRYPTO_WP512 is not set
999# CONFIG_CRYPTO_TGR192 is not set
974CONFIG_CRYPTO_DES=y 1000CONFIG_CRYPTO_DES=y
975# CONFIG_CRYPTO_BLOWFISH is not set 1001# CONFIG_CRYPTO_BLOWFISH is not set
976# CONFIG_CRYPTO_TWOFISH is not set 1002# CONFIG_CRYPTO_TWOFISH is not set
diff --git a/arch/ppc64/configs/pSeries_defconfig b/arch/ppc64/configs/pSeries_defconfig
index 4fecf237d5c9..3eb5ef25d3a3 100644
--- a/arch/ppc64/configs/pSeries_defconfig
+++ b/arch/ppc64/configs/pSeries_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc3-bk6 3# Linux kernel version: 2.6.12-rc6
4# Wed Feb 9 23:34:54 2005 4# Tue Jun 14 17:13:47 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -11,7 +11,7 @@ CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y 11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y 12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y 13CONFIG_COMPAT=y
14CONFIG_FRAME_POINTER=y 14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13 15CONFIG_FORCE_MAX_ZONEORDER=13
16 16
17# 17#
@@ -20,6 +20,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
20CONFIG_EXPERIMENTAL=y 20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y 21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y 22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
23 24
24# 25#
25# General setup 26# General setup
@@ -30,24 +31,29 @@ CONFIG_SYSVIPC=y
30CONFIG_POSIX_MQUEUE=y 31CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
33CONFIG_LOG_BUF_SHIFT=17 34CONFIG_AUDIT=y
35CONFIG_AUDITSYSCALL=y
34CONFIG_HOTPLUG=y 36CONFIG_HOTPLUG=y
35CONFIG_KOBJECT_UEVENT=y 37CONFIG_KOBJECT_UEVENT=y
36CONFIG_IKCONFIG=y 38CONFIG_IKCONFIG=y
37CONFIG_IKCONFIG_PROC=y 39CONFIG_IKCONFIG_PROC=y
40CONFIG_CPUSETS=y
38# CONFIG_EMBEDDED is not set 41# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y 42CONFIG_KALLSYMS=y
40CONFIG_KALLSYMS_ALL=y 43CONFIG_KALLSYMS_ALL=y
41# CONFIG_KALLSYMS_EXTRA_PASS is not set 44# CONFIG_KALLSYMS_EXTRA_PASS is not set
45CONFIG_PRINTK=y
46CONFIG_BUG=y
47CONFIG_BASE_FULL=y
42CONFIG_FUTEX=y 48CONFIG_FUTEX=y
43CONFIG_EPOLL=y 49CONFIG_EPOLL=y
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SHMEM=y 50CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0 51CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0 52CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0 53CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0 54CONFIG_CC_ALIGN_JUMPS=0
50# CONFIG_TINY_SHMEM is not set 55# CONFIG_TINY_SHMEM is not set
56CONFIG_BASE_SMALL=0
51 57
52# 58#
53# Loadable module support 59# Loadable module support
@@ -89,9 +95,12 @@ CONFIG_SCHED_SMT=y
89CONFIG_EEH=y 95CONFIG_EEH=y
90CONFIG_GENERIC_HARDIRQS=y 96CONFIG_GENERIC_HARDIRQS=y
91CONFIG_PPC_RTAS=y 97CONFIG_PPC_RTAS=y
98CONFIG_RTAS_PROC=y
92CONFIG_RTAS_FLASH=m 99CONFIG_RTAS_FLASH=m
93CONFIG_SCANLOG=m 100CONFIG_SCANLOG=m
94CONFIG_LPARCFG=y 101CONFIG_LPARCFG=y
102CONFIG_SECCOMP=y
103CONFIG_ISA_DMA_API=y
95 104
96# 105#
97# General setup 106# General setup
@@ -102,6 +111,7 @@ CONFIG_BINFMT_ELF=y
102# CONFIG_BINFMT_MISC is not set 111# CONFIG_BINFMT_MISC is not set
103CONFIG_PCI_LEGACY_PROC=y 112CONFIG_PCI_LEGACY_PROC=y
104CONFIG_PCI_NAMES=y 113CONFIG_PCI_NAMES=y
114# CONFIG_PCI_DEBUG is not set
105CONFIG_HOTPLUG_CPU=y 115CONFIG_HOTPLUG_CPU=y
106 116
107# 117#
@@ -110,10 +120,6 @@ CONFIG_HOTPLUG_CPU=y
110# CONFIG_PCCARD is not set 120# CONFIG_PCCARD is not set
111 121
112# 122#
113# PC-card bridges
114#
115
116#
117# PCI Hotplug Support 123# PCI Hotplug Support
118# 124#
119CONFIG_HOTPLUG_PCI=m 125CONFIG_HOTPLUG_PCI=m
@@ -147,11 +153,10 @@ CONFIG_FW_LOADER=y
147# 153#
148CONFIG_PARPORT=m 154CONFIG_PARPORT=m
149CONFIG_PARPORT_PC=m 155CONFIG_PARPORT_PC=m
150CONFIG_PARPORT_PC_CML1=m
151# CONFIG_PARPORT_SERIAL is not set 156# CONFIG_PARPORT_SERIAL is not set
152# CONFIG_PARPORT_PC_FIFO is not set 157# CONFIG_PARPORT_PC_FIFO is not set
153# CONFIG_PARPORT_PC_SUPERIO is not set 158# CONFIG_PARPORT_PC_SUPERIO is not set
154# CONFIG_PARPORT_OTHER is not set 159# CONFIG_PARPORT_GSC is not set
155# CONFIG_PARPORT_1284 is not set 160# CONFIG_PARPORT_1284 is not set
156 161
157# 162#
@@ -293,7 +298,6 @@ CONFIG_SCSI_ISCSI_ATTRS=m
293# CONFIG_SCSI_BUSLOGIC is not set 298# CONFIG_SCSI_BUSLOGIC is not set
294# CONFIG_SCSI_DMX3191D is not set 299# CONFIG_SCSI_DMX3191D is not set
295# CONFIG_SCSI_EATA is not set 300# CONFIG_SCSI_EATA is not set
296# CONFIG_SCSI_EATA_PIO is not set
297# CONFIG_SCSI_FUTURE_DOMAIN is not set 301# CONFIG_SCSI_FUTURE_DOMAIN is not set
298# CONFIG_SCSI_GDTH is not set 302# CONFIG_SCSI_GDTH is not set
299# CONFIG_SCSI_IPS is not set 303# CONFIG_SCSI_IPS is not set
@@ -310,7 +314,6 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
310CONFIG_SCSI_IPR=y 314CONFIG_SCSI_IPR=y
311CONFIG_SCSI_IPR_TRACE=y 315CONFIG_SCSI_IPR_TRACE=y
312CONFIG_SCSI_IPR_DUMP=y 316CONFIG_SCSI_IPR_DUMP=y
313# CONFIG_SCSI_QLOGIC_ISP is not set
314# CONFIG_SCSI_QLOGIC_FC is not set 317# CONFIG_SCSI_QLOGIC_FC is not set
315# CONFIG_SCSI_QLOGIC_1280 is not set 318# CONFIG_SCSI_QLOGIC_1280 is not set
316CONFIG_SCSI_QLA2XXX=y 319CONFIG_SCSI_QLA2XXX=y
@@ -319,6 +322,7 @@ CONFIG_SCSI_QLA22XX=m
319CONFIG_SCSI_QLA2300=m 322CONFIG_SCSI_QLA2300=m
320CONFIG_SCSI_QLA2322=m 323CONFIG_SCSI_QLA2322=m
321CONFIG_SCSI_QLA6312=m 324CONFIG_SCSI_QLA6312=m
325CONFIG_SCSI_LPFC=m
322# CONFIG_SCSI_DC395x is not set 326# CONFIG_SCSI_DC395x is not set
323# CONFIG_SCSI_DC390T is not set 327# CONFIG_SCSI_DC390T is not set
324# CONFIG_SCSI_DEBUG is not set 328# CONFIG_SCSI_DEBUG is not set
@@ -341,6 +345,8 @@ CONFIG_DM_CRYPT=m
341CONFIG_DM_SNAPSHOT=m 345CONFIG_DM_SNAPSHOT=m
342CONFIG_DM_MIRROR=m 346CONFIG_DM_MIRROR=m
343CONFIG_DM_ZERO=m 347CONFIG_DM_ZERO=m
348CONFIG_DM_MULTIPATH=m
349CONFIG_DM_MULTIPATH_EMC=m
344 350
345# 351#
346# Fusion MPT device support 352# Fusion MPT device support
@@ -371,7 +377,6 @@ CONFIG_NET=y
371# 377#
372CONFIG_PACKET=y 378CONFIG_PACKET=y
373# CONFIG_PACKET_MMAP is not set 379# CONFIG_PACKET_MMAP is not set
374# CONFIG_NETLINK_DEV is not set
375CONFIG_UNIX=y 380CONFIG_UNIX=y
376CONFIG_NET_KEY=m 381CONFIG_NET_KEY=m
377CONFIG_INET=y 382CONFIG_INET=y
@@ -539,7 +544,6 @@ CONFIG_PCNET32=y
539# CONFIG_DGRS is not set 544# CONFIG_DGRS is not set
540# CONFIG_EEPRO100 is not set 545# CONFIG_EEPRO100 is not set
541CONFIG_E100=y 546CONFIG_E100=y
542# CONFIG_E100_NAPI is not set
543# CONFIG_FEALNX is not set 547# CONFIG_FEALNX is not set
544# CONFIG_NATSEMI is not set 548# CONFIG_NATSEMI is not set
545# CONFIG_NE2K_PCI is not set 549# CONFIG_NE2K_PCI is not set
@@ -565,6 +569,8 @@ CONFIG_E1000=y
565# CONFIG_SK98LIN is not set 569# CONFIG_SK98LIN is not set
566# CONFIG_VIA_VELOCITY is not set 570# CONFIG_VIA_VELOCITY is not set
567CONFIG_TIGON3=y 571CONFIG_TIGON3=y
572# CONFIG_BNX2 is not set
573# CONFIG_MV643XX_ETH is not set
568 574
569# 575#
570# Ethernet (10000 Mbit) 576# Ethernet (10000 Mbit)
@@ -636,20 +642,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
636# CONFIG_INPUT_EVBUG is not set 642# CONFIG_INPUT_EVBUG is not set
637 643
638# 644#
639# Input I/O drivers
640#
641# CONFIG_GAMEPORT is not set
642CONFIG_SOUND_GAMEPORT=y
643CONFIG_SERIO=y
644CONFIG_SERIO_I8042=y
645# CONFIG_SERIO_SERPORT is not set
646# CONFIG_SERIO_CT82C710 is not set
647# CONFIG_SERIO_PARKBD is not set
648# CONFIG_SERIO_PCIPS2 is not set
649CONFIG_SERIO_LIBPS2=y
650# CONFIG_SERIO_RAW is not set
651
652#
653# Input Device Drivers 645# Input Device Drivers
654# 646#
655CONFIG_INPUT_KEYBOARD=y 647CONFIG_INPUT_KEYBOARD=y
@@ -669,6 +661,18 @@ CONFIG_INPUT_PCSPKR=m
669# CONFIG_INPUT_UINPUT is not set 661# CONFIG_INPUT_UINPUT is not set
670 662
671# 663#
664# Hardware I/O ports
665#
666CONFIG_SERIO=y
667CONFIG_SERIO_I8042=y
668# CONFIG_SERIO_SERPORT is not set
669# CONFIG_SERIO_PARKBD is not set
670# CONFIG_SERIO_PCIPS2 is not set
671CONFIG_SERIO_LIBPS2=y
672# CONFIG_SERIO_RAW is not set
673# CONFIG_GAMEPORT is not set
674
675#
672# Character devices 676# Character devices
673# 677#
674CONFIG_VT=y 678CONFIG_VT=y
@@ -689,8 +693,8 @@ CONFIG_SERIAL_8250_NR_UARTS=4
689# 693#
690CONFIG_SERIAL_CORE=y 694CONFIG_SERIAL_CORE=y
691CONFIG_SERIAL_CORE_CONSOLE=y 695CONFIG_SERIAL_CORE_CONSOLE=y
692# CONFIG_SERIAL_PMACZILOG is not set
693CONFIG_SERIAL_ICOM=m 696CONFIG_SERIAL_ICOM=m
697# CONFIG_SERIAL_JSM is not set
694CONFIG_UNIX98_PTYS=y 698CONFIG_UNIX98_PTYS=y
695CONFIG_LEGACY_PTYS=y 699CONFIG_LEGACY_PTYS=y
696CONFIG_LEGACY_PTY_COUNT=256 700CONFIG_LEGACY_PTY_COUNT=256
@@ -718,9 +722,16 @@ CONFIG_HVCS=m
718# 722#
719# Ftape, the floppy tape device driver 723# Ftape, the floppy tape device driver
720# 724#
725# CONFIG_AGP is not set
721# CONFIG_DRM is not set 726# CONFIG_DRM is not set
722CONFIG_RAW_DRIVER=y 727CONFIG_RAW_DRIVER=y
723CONFIG_MAX_RAW_DEVS=1024 728CONFIG_MAX_RAW_DEVS=1024
729# CONFIG_HANGCHECK_TIMER is not set
730
731#
732# TPM devices
733#
734# CONFIG_TCG_TPM is not set
724 735
725# 736#
726# I2C support 737# I2C support
@@ -745,8 +756,8 @@ CONFIG_I2C_ALGOBIT=y
745# CONFIG_I2C_AMD8111 is not set 756# CONFIG_I2C_AMD8111 is not set
746# CONFIG_I2C_I801 is not set 757# CONFIG_I2C_I801 is not set
747# CONFIG_I2C_I810 is not set 758# CONFIG_I2C_I810 is not set
759# CONFIG_I2C_PIIX4 is not set
748# CONFIG_I2C_ISA is not set 760# CONFIG_I2C_ISA is not set
749# CONFIG_I2C_MPC is not set
750# CONFIG_I2C_NFORCE2 is not set 761# CONFIG_I2C_NFORCE2 is not set
751# CONFIG_I2C_PARPORT is not set 762# CONFIG_I2C_PARPORT is not set
752# CONFIG_I2C_PARPORT_LIGHT is not set 763# CONFIG_I2C_PARPORT_LIGHT is not set
@@ -773,7 +784,9 @@ CONFIG_I2C_ALGOBIT=y
773# CONFIG_SENSORS_ASB100 is not set 784# CONFIG_SENSORS_ASB100 is not set
774# CONFIG_SENSORS_DS1621 is not set 785# CONFIG_SENSORS_DS1621 is not set
775# CONFIG_SENSORS_FSCHER is not set 786# CONFIG_SENSORS_FSCHER is not set
787# CONFIG_SENSORS_FSCPOS is not set
776# CONFIG_SENSORS_GL518SM is not set 788# CONFIG_SENSORS_GL518SM is not set
789# CONFIG_SENSORS_GL520SM is not set
777# CONFIG_SENSORS_IT87 is not set 790# CONFIG_SENSORS_IT87 is not set
778# CONFIG_SENSORS_LM63 is not set 791# CONFIG_SENSORS_LM63 is not set
779# CONFIG_SENSORS_LM75 is not set 792# CONFIG_SENSORS_LM75 is not set
@@ -784,9 +797,11 @@ CONFIG_I2C_ALGOBIT=y
784# CONFIG_SENSORS_LM85 is not set 797# CONFIG_SENSORS_LM85 is not set
785# CONFIG_SENSORS_LM87 is not set 798# CONFIG_SENSORS_LM87 is not set
786# CONFIG_SENSORS_LM90 is not set 799# CONFIG_SENSORS_LM90 is not set
800# CONFIG_SENSORS_LM92 is not set
787# CONFIG_SENSORS_MAX1619 is not set 801# CONFIG_SENSORS_MAX1619 is not set
788# CONFIG_SENSORS_PC87360 is not set 802# CONFIG_SENSORS_PC87360 is not set
789# CONFIG_SENSORS_SMSC47B397 is not set 803# CONFIG_SENSORS_SMSC47B397 is not set
804# CONFIG_SENSORS_SIS5595 is not set
790# CONFIG_SENSORS_SMSC47M1 is not set 805# CONFIG_SENSORS_SMSC47M1 is not set
791# CONFIG_SENSORS_VIA686A is not set 806# CONFIG_SENSORS_VIA686A is not set
792# CONFIG_SENSORS_W83781D is not set 807# CONFIG_SENSORS_W83781D is not set
@@ -796,6 +811,7 @@ CONFIG_I2C_ALGOBIT=y
796# 811#
797# Other I2C Chip support 812# Other I2C Chip support
798# 813#
814# CONFIG_SENSORS_DS1337 is not set
799# CONFIG_SENSORS_EEPROM is not set 815# CONFIG_SENSORS_EEPROM is not set
800# CONFIG_SENSORS_PCF8574 is not set 816# CONFIG_SENSORS_PCF8574 is not set
801# CONFIG_SENSORS_PCF8591 is not set 817# CONFIG_SENSORS_PCF8591 is not set
@@ -828,8 +844,13 @@ CONFIG_I2C_ALGOBIT=y
828# Graphics support 844# Graphics support
829# 845#
830CONFIG_FB=y 846CONFIG_FB=y
847CONFIG_FB_CFB_FILLRECT=y
848CONFIG_FB_CFB_COPYAREA=y
849CONFIG_FB_CFB_IMAGEBLIT=y
850CONFIG_FB_SOFT_CURSOR=y
851CONFIG_FB_MACMODES=y
831CONFIG_FB_MODE_HELPERS=y 852CONFIG_FB_MODE_HELPERS=y
832# CONFIG_FB_TILEBLITTING is not set 853CONFIG_FB_TILEBLITTING=y
833# CONFIG_FB_CIRRUS is not set 854# CONFIG_FB_CIRRUS is not set
834# CONFIG_FB_PM2 is not set 855# CONFIG_FB_PM2 is not set
835# CONFIG_FB_CYBER2000 is not set 856# CONFIG_FB_CYBER2000 is not set
@@ -838,6 +859,7 @@ CONFIG_FB_OF=y
838# CONFIG_FB_ASILIANT is not set 859# CONFIG_FB_ASILIANT is not set
839# CONFIG_FB_IMSTT is not set 860# CONFIG_FB_IMSTT is not set
840# CONFIG_FB_VGA16 is not set 861# CONFIG_FB_VGA16 is not set
862# CONFIG_FB_NVIDIA is not set
841# CONFIG_FB_RIVA is not set 863# CONFIG_FB_RIVA is not set
842CONFIG_FB_MATROX=y 864CONFIG_FB_MATROX=y
843CONFIG_FB_MATROX_MILLENIUM=y 865CONFIG_FB_MATROX_MILLENIUM=y
@@ -858,6 +880,7 @@ CONFIG_FB_RADEON_I2C=y
858# CONFIG_FB_3DFX is not set 880# CONFIG_FB_3DFX is not set
859# CONFIG_FB_VOODOO1 is not set 881# CONFIG_FB_VOODOO1 is not set
860# CONFIG_FB_TRIDENT is not set 882# CONFIG_FB_TRIDENT is not set
883# CONFIG_FB_S1D13XXX is not set
861# CONFIG_FB_VIRTUAL is not set 884# CONFIG_FB_VIRTUAL is not set
862 885
863# 886#
@@ -891,6 +914,8 @@ CONFIG_LCD_DEVICE=y
891# 914#
892# USB support 915# USB support
893# 916#
917CONFIG_USB_ARCH_HAS_HCD=y
918CONFIG_USB_ARCH_HAS_OHCI=y
894CONFIG_USB=y 919CONFIG_USB=y
895# CONFIG_USB_DEBUG is not set 920# CONFIG_USB_DEBUG is not set
896 921
@@ -901,8 +926,6 @@ CONFIG_USB_DEVICEFS=y
901# CONFIG_USB_BANDWIDTH is not set 926# CONFIG_USB_BANDWIDTH is not set
902# CONFIG_USB_DYNAMIC_MINORS is not set 927# CONFIG_USB_DYNAMIC_MINORS is not set
903# CONFIG_USB_OTG is not set 928# CONFIG_USB_OTG is not set
904CONFIG_USB_ARCH_HAS_HCD=y
905CONFIG_USB_ARCH_HAS_OHCI=y
906 929
907# 930#
908# USB Host Controller Drivers 931# USB Host Controller Drivers
@@ -911,6 +934,8 @@ CONFIG_USB_EHCI_HCD=y
911# CONFIG_USB_EHCI_SPLIT_ISO is not set 934# CONFIG_USB_EHCI_SPLIT_ISO is not set
912# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 935# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
913CONFIG_USB_OHCI_HCD=y 936CONFIG_USB_OHCI_HCD=y
937# CONFIG_USB_OHCI_BIG_ENDIAN is not set
938CONFIG_USB_OHCI_LITTLE_ENDIAN=y
914# CONFIG_USB_UHCI_HCD is not set 939# CONFIG_USB_UHCI_HCD is not set
915# CONFIG_USB_SL811_HCD is not set 940# CONFIG_USB_SL811_HCD is not set
916 941
@@ -926,12 +951,11 @@ CONFIG_USB_OHCI_HCD=y
926# 951#
927CONFIG_USB_STORAGE=y 952CONFIG_USB_STORAGE=y
928# CONFIG_USB_STORAGE_DEBUG is not set 953# CONFIG_USB_STORAGE_DEBUG is not set
929# CONFIG_USB_STORAGE_RW_DETECT is not set
930# CONFIG_USB_STORAGE_DATAFAB is not set 954# CONFIG_USB_STORAGE_DATAFAB is not set
931# CONFIG_USB_STORAGE_FREECOM is not set 955# CONFIG_USB_STORAGE_FREECOM is not set
932# CONFIG_USB_STORAGE_ISD200 is not set 956# CONFIG_USB_STORAGE_ISD200 is not set
933# CONFIG_USB_STORAGE_DPCM is not set 957# CONFIG_USB_STORAGE_DPCM is not set
934# CONFIG_USB_STORAGE_HP8200e is not set 958# CONFIG_USB_STORAGE_USBAT is not set
935# CONFIG_USB_STORAGE_SDDR09 is not set 959# CONFIG_USB_STORAGE_SDDR09 is not set
936# CONFIG_USB_STORAGE_SDDR55 is not set 960# CONFIG_USB_STORAGE_SDDR55 is not set
937# CONFIG_USB_STORAGE_JUMPSHOT is not set 961# CONFIG_USB_STORAGE_JUMPSHOT is not set
@@ -975,6 +999,7 @@ CONFIG_USB_HIDDEV=y
975# CONFIG_USB_PEGASUS is not set 999# CONFIG_USB_PEGASUS is not set
976# CONFIG_USB_RTL8150 is not set 1000# CONFIG_USB_RTL8150 is not set
977# CONFIG_USB_USBNET is not set 1001# CONFIG_USB_USBNET is not set
1002CONFIG_USB_MON=y
978 1003
979# 1004#
980# USB port drivers 1005# USB port drivers
@@ -1000,6 +1025,7 @@ CONFIG_USB_HIDDEV=y
1000# CONFIG_USB_PHIDGETKIT is not set 1025# CONFIG_USB_PHIDGETKIT is not set
1001# CONFIG_USB_PHIDGETSERVO is not set 1026# CONFIG_USB_PHIDGETSERVO is not set
1002# CONFIG_USB_IDMOUSE is not set 1027# CONFIG_USB_IDMOUSE is not set
1028# CONFIG_USB_SISUSBVGA is not set
1003# CONFIG_USB_TEST is not set 1029# CONFIG_USB_TEST is not set
1004 1030
1005# 1031#
@@ -1208,10 +1234,13 @@ CONFIG_OPROFILE=y
1208# 1234#
1209# Kernel hacking 1235# Kernel hacking
1210# 1236#
1237# CONFIG_PRINTK_TIME is not set
1211CONFIG_DEBUG_KERNEL=y 1238CONFIG_DEBUG_KERNEL=y
1212CONFIG_MAGIC_SYSRQ=y 1239CONFIG_MAGIC_SYSRQ=y
1240CONFIG_LOG_BUF_SHIFT=17
1213# CONFIG_SCHEDSTATS is not set 1241# CONFIG_SCHEDSTATS is not set
1214# CONFIG_DEBUG_SLAB is not set 1242# CONFIG_DEBUG_SLAB is not set
1243# CONFIG_DEBUG_SPINLOCK is not set
1215# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1244# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1216# CONFIG_DEBUG_KOBJECT is not set 1245# CONFIG_DEBUG_KOBJECT is not set
1217# CONFIG_DEBUG_INFO is not set 1246# CONFIG_DEBUG_INFO is not set
@@ -1243,6 +1272,7 @@ CONFIG_CRYPTO_SHA1=m
1243CONFIG_CRYPTO_SHA256=m 1272CONFIG_CRYPTO_SHA256=m
1244CONFIG_CRYPTO_SHA512=m 1273CONFIG_CRYPTO_SHA512=m
1245CONFIG_CRYPTO_WP512=m 1274CONFIG_CRYPTO_WP512=m
1275CONFIG_CRYPTO_TGR192=m
1246CONFIG_CRYPTO_DES=y 1276CONFIG_CRYPTO_DES=y
1247CONFIG_CRYPTO_BLOWFISH=m 1277CONFIG_CRYPTO_BLOWFISH=m
1248CONFIG_CRYPTO_TWOFISH=m 1278CONFIG_CRYPTO_TWOFISH=m
diff --git a/arch/ppc64/defconfig b/arch/ppc64/defconfig
index 537b1cc82eab..2f31bf3046f9 100644
--- a/arch/ppc64/defconfig
+++ b/arch/ppc64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc3-bk6 3# Linux kernel version: 2.6.12-rc5-git9
4# Wed Feb 9 23:34:51 2005 4# Sun Jun 5 09:26:47 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -11,7 +11,7 @@ CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y 11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y 12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y 13CONFIG_COMPAT=y
14CONFIG_FRAME_POINTER=y 14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13 15CONFIG_FORCE_MAX_ZONEORDER=13
16 16
17# 17#
@@ -20,6 +20,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
20CONFIG_EXPERIMENTAL=y 20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y 21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y 22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
23 24
24# 25#
25# General setup 26# General setup
@@ -30,24 +31,28 @@ CONFIG_SYSVIPC=y
30CONFIG_POSIX_MQUEUE=y 31CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
33CONFIG_LOG_BUF_SHIFT=17 34# CONFIG_AUDIT is not set
34CONFIG_HOTPLUG=y 35CONFIG_HOTPLUG=y
35CONFIG_KOBJECT_UEVENT=y 36CONFIG_KOBJECT_UEVENT=y
36CONFIG_IKCONFIG=y 37CONFIG_IKCONFIG=y
37CONFIG_IKCONFIG_PROC=y 38CONFIG_IKCONFIG_PROC=y
39CONFIG_CPUSETS=y
38# CONFIG_EMBEDDED is not set 40# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y 41CONFIG_KALLSYMS=y
40# CONFIG_KALLSYMS_ALL is not set 42# CONFIG_KALLSYMS_ALL is not set
41# CONFIG_KALLSYMS_EXTRA_PASS is not set 43# CONFIG_KALLSYMS_EXTRA_PASS is not set
44CONFIG_PRINTK=y
45CONFIG_BUG=y
46CONFIG_BASE_FULL=y
42CONFIG_FUTEX=y 47CONFIG_FUTEX=y
43CONFIG_EPOLL=y 48CONFIG_EPOLL=y
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SHMEM=y 49CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0 50CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0 51CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0 52CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0 53CONFIG_CC_ALIGN_JUMPS=0
50# CONFIG_TINY_SHMEM is not set 54# CONFIG_TINY_SHMEM is not set
55CONFIG_BASE_SMALL=0
51 56
52# 57#
53# Loadable module support 58# Loadable module support
@@ -91,9 +96,12 @@ CONFIG_DISCONTIGMEM=y
91CONFIG_EEH=y 96CONFIG_EEH=y
92CONFIG_GENERIC_HARDIRQS=y 97CONFIG_GENERIC_HARDIRQS=y
93CONFIG_PPC_RTAS=y 98CONFIG_PPC_RTAS=y
99CONFIG_RTAS_PROC=y
94CONFIG_RTAS_FLASH=m 100CONFIG_RTAS_FLASH=m
95CONFIG_SCANLOG=m 101CONFIG_SCANLOG=m
96CONFIG_LPARCFG=y 102CONFIG_LPARCFG=y
103CONFIG_SECCOMP=y
104CONFIG_ISA_DMA_API=y
97 105
98# 106#
99# General setup 107# General setup
@@ -104,6 +112,7 @@ CONFIG_BINFMT_ELF=y
104CONFIG_BINFMT_MISC=m 112CONFIG_BINFMT_MISC=m
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
107CONFIG_HOTPLUG_CPU=y 116CONFIG_HOTPLUG_CPU=y
108 117
109# 118#
@@ -112,10 +121,6 @@ CONFIG_HOTPLUG_CPU=y
112# CONFIG_PCCARD is not set 121# CONFIG_PCCARD is not set
113 122
114# 123#
115# PC-card bridges
116#
117
118#
119# PCI Hotplug Support 124# PCI Hotplug Support
120# 125#
121CONFIG_HOTPLUG_PCI=m 126CONFIG_HOTPLUG_PCI=m
@@ -149,11 +154,10 @@ CONFIG_FW_LOADER=y
149# 154#
150CONFIG_PARPORT=m 155CONFIG_PARPORT=m
151CONFIG_PARPORT_PC=m 156CONFIG_PARPORT_PC=m
152CONFIG_PARPORT_PC_CML1=m
153# CONFIG_PARPORT_SERIAL is not set 157# CONFIG_PARPORT_SERIAL is not set
154# CONFIG_PARPORT_PC_FIFO is not set 158# CONFIG_PARPORT_PC_FIFO is not set
155# CONFIG_PARPORT_PC_SUPERIO is not set 159# CONFIG_PARPORT_PC_SUPERIO is not set
156# CONFIG_PARPORT_OTHER is not set 160# CONFIG_PARPORT_GSC is not set
157# CONFIG_PARPORT_1284 is not set 161# CONFIG_PARPORT_1284 is not set
158 162
159# 163#
@@ -301,6 +305,7 @@ CONFIG_SCSI_SATA_SVW=y
301# CONFIG_SCSI_ATA_PIIX is not set 305# CONFIG_SCSI_ATA_PIIX is not set
302# CONFIG_SCSI_SATA_NV is not set 306# CONFIG_SCSI_SATA_NV is not set
303# CONFIG_SCSI_SATA_PROMISE is not set 307# CONFIG_SCSI_SATA_PROMISE is not set
308# CONFIG_SCSI_SATA_QSTOR is not set
304# CONFIG_SCSI_SATA_SX4 is not set 309# CONFIG_SCSI_SATA_SX4 is not set
305# CONFIG_SCSI_SATA_SIL is not set 310# CONFIG_SCSI_SATA_SIL is not set
306# CONFIG_SCSI_SATA_SIS is not set 311# CONFIG_SCSI_SATA_SIS is not set
@@ -310,7 +315,6 @@ CONFIG_SCSI_SATA_SVW=y
310# CONFIG_SCSI_BUSLOGIC is not set 315# CONFIG_SCSI_BUSLOGIC is not set
311# CONFIG_SCSI_DMX3191D is not set 316# CONFIG_SCSI_DMX3191D is not set
312# CONFIG_SCSI_EATA is not set 317# CONFIG_SCSI_EATA is not set
313# CONFIG_SCSI_EATA_PIO is not set
314# CONFIG_SCSI_FUTURE_DOMAIN is not set 318# CONFIG_SCSI_FUTURE_DOMAIN is not set
315# CONFIG_SCSI_GDTH is not set 319# CONFIG_SCSI_GDTH is not set
316# CONFIG_SCSI_IPS is not set 320# CONFIG_SCSI_IPS is not set
@@ -327,7 +331,6 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
327CONFIG_SCSI_IPR=y 331CONFIG_SCSI_IPR=y
328CONFIG_SCSI_IPR_TRACE=y 332CONFIG_SCSI_IPR_TRACE=y
329CONFIG_SCSI_IPR_DUMP=y 333CONFIG_SCSI_IPR_DUMP=y
330# CONFIG_SCSI_QLOGIC_ISP is not set
331# CONFIG_SCSI_QLOGIC_FC is not set 334# CONFIG_SCSI_QLOGIC_FC is not set
332# CONFIG_SCSI_QLOGIC_1280 is not set 335# CONFIG_SCSI_QLOGIC_1280 is not set
333CONFIG_SCSI_QLA2XXX=y 336CONFIG_SCSI_QLA2XXX=y
@@ -336,6 +339,7 @@ CONFIG_SCSI_QLA22XX=m
336CONFIG_SCSI_QLA2300=m 339CONFIG_SCSI_QLA2300=m
337CONFIG_SCSI_QLA2322=m 340CONFIG_SCSI_QLA2322=m
338CONFIG_SCSI_QLA6312=m 341CONFIG_SCSI_QLA6312=m
342CONFIG_SCSI_LPFC=m
339# CONFIG_SCSI_DC395x is not set 343# CONFIG_SCSI_DC395x is not set
340# CONFIG_SCSI_DC390T is not set 344# CONFIG_SCSI_DC390T is not set
341CONFIG_SCSI_DEBUG=m 345CONFIG_SCSI_DEBUG=m
@@ -358,6 +362,8 @@ CONFIG_DM_CRYPT=m
358CONFIG_DM_SNAPSHOT=m 362CONFIG_DM_SNAPSHOT=m
359CONFIG_DM_MIRROR=m 363CONFIG_DM_MIRROR=m
360CONFIG_DM_ZERO=m 364CONFIG_DM_ZERO=m
365CONFIG_DM_MULTIPATH=m
366CONFIG_DM_MULTIPATH_EMC=m
361 367
362# 368#
363# Fusion MPT device support 369# Fusion MPT device support
@@ -405,6 +411,7 @@ CONFIG_IEEE1394_AMDTP=m
405# 411#
406CONFIG_ADB=y 412CONFIG_ADB=y
407CONFIG_ADB_PMU=y 413CONFIG_ADB_PMU=y
414CONFIG_PMAC_SMU=y
408# CONFIG_PMAC_PBOOK is not set 415# CONFIG_PMAC_PBOOK is not set
409# CONFIG_PMAC_BACKLIGHT is not set 416# CONFIG_PMAC_BACKLIGHT is not set
410# CONFIG_INPUT_ADBHID is not set 417# CONFIG_INPUT_ADBHID is not set
@@ -420,7 +427,6 @@ CONFIG_NET=y
420# 427#
421CONFIG_PACKET=y 428CONFIG_PACKET=y
422# CONFIG_PACKET_MMAP is not set 429# CONFIG_PACKET_MMAP is not set
423# CONFIG_NETLINK_DEV is not set
424CONFIG_UNIX=y 430CONFIG_UNIX=y
425CONFIG_NET_KEY=m 431CONFIG_NET_KEY=m
426CONFIG_INET=y 432CONFIG_INET=y
@@ -588,7 +594,6 @@ CONFIG_PCNET32=y
588# CONFIG_DGRS is not set 594# CONFIG_DGRS is not set
589# CONFIG_EEPRO100 is not set 595# CONFIG_EEPRO100 is not set
590CONFIG_E100=y 596CONFIG_E100=y
591# CONFIG_E100_NAPI is not set
592# CONFIG_FEALNX is not set 597# CONFIG_FEALNX is not set
593# CONFIG_NATSEMI is not set 598# CONFIG_NATSEMI is not set
594# CONFIG_NE2K_PCI is not set 599# CONFIG_NE2K_PCI is not set
@@ -614,6 +619,8 @@ CONFIG_E1000=y
614# CONFIG_SK98LIN is not set 619# CONFIG_SK98LIN is not set
615# CONFIG_VIA_VELOCITY is not set 620# CONFIG_VIA_VELOCITY is not set
616CONFIG_TIGON3=y 621CONFIG_TIGON3=y
622# CONFIG_BNX2 is not set
623# CONFIG_MV643XX_ETH is not set
617 624
618# 625#
619# Ethernet (10000 Mbit) 626# Ethernet (10000 Mbit)
@@ -683,20 +690,6 @@ CONFIG_INPUT_EVDEV=m
683# CONFIG_INPUT_EVBUG is not set 690# CONFIG_INPUT_EVBUG is not set
684 691
685# 692#
686# Input I/O drivers
687#
688# CONFIG_GAMEPORT is not set
689CONFIG_SOUND_GAMEPORT=y
690CONFIG_SERIO=y
691CONFIG_SERIO_I8042=y
692# CONFIG_SERIO_SERPORT is not set
693# CONFIG_SERIO_CT82C710 is not set
694# CONFIG_SERIO_PARKBD is not set
695# CONFIG_SERIO_PCIPS2 is not set
696CONFIG_SERIO_LIBPS2=y
697# CONFIG_SERIO_RAW is not set
698
699#
700# Input Device Drivers 693# Input Device Drivers
701# 694#
702CONFIG_INPUT_KEYBOARD=y 695CONFIG_INPUT_KEYBOARD=y
@@ -716,6 +709,18 @@ CONFIG_INPUT_PCSPKR=m
716# CONFIG_INPUT_UINPUT is not set 709# CONFIG_INPUT_UINPUT is not set
717 710
718# 711#
712# Hardware I/O ports
713#
714CONFIG_SERIO=y
715CONFIG_SERIO_I8042=y
716# CONFIG_SERIO_SERPORT is not set
717# CONFIG_SERIO_PARKBD is not set
718# CONFIG_SERIO_PCIPS2 is not set
719CONFIG_SERIO_LIBPS2=y
720# CONFIG_SERIO_RAW is not set
721# CONFIG_GAMEPORT is not set
722
723#
719# Character devices 724# Character devices
720# 725#
721CONFIG_VT=y 726CONFIG_VT=y
@@ -738,6 +743,7 @@ CONFIG_SERIAL_CORE=y
738CONFIG_SERIAL_CORE_CONSOLE=y 743CONFIG_SERIAL_CORE_CONSOLE=y
739# CONFIG_SERIAL_PMACZILOG is not set 744# CONFIG_SERIAL_PMACZILOG is not set
740CONFIG_SERIAL_ICOM=m 745CONFIG_SERIAL_ICOM=m
746CONFIG_SERIAL_JSM=m
741CONFIG_UNIX98_PTYS=y 747CONFIG_UNIX98_PTYS=y
742CONFIG_LEGACY_PTYS=y 748CONFIG_LEGACY_PTYS=y
743CONFIG_LEGACY_PTY_COUNT=256 749CONFIG_LEGACY_PTY_COUNT=256
@@ -766,9 +772,16 @@ CONFIG_HVCS=m
766# 772#
767# Ftape, the floppy tape device driver 773# Ftape, the floppy tape device driver
768# 774#
775# CONFIG_AGP is not set
769# CONFIG_DRM is not set 776# CONFIG_DRM is not set
770CONFIG_RAW_DRIVER=y 777CONFIG_RAW_DRIVER=y
771CONFIG_MAX_RAW_DEVS=256 778CONFIG_MAX_RAW_DEVS=256
779# CONFIG_HANGCHECK_TIMER is not set
780
781#
782# TPM devices
783#
784# CONFIG_TCG_TPM is not set
772 785
773# 786#
774# I2C support 787# I2C support
@@ -793,9 +806,9 @@ CONFIG_I2C_ALGOBIT=y
793CONFIG_I2C_AMD8111=y 806CONFIG_I2C_AMD8111=y
794# CONFIG_I2C_I801 is not set 807# CONFIG_I2C_I801 is not set
795# CONFIG_I2C_I810 is not set 808# CONFIG_I2C_I810 is not set
809# CONFIG_I2C_PIIX4 is not set
796# CONFIG_I2C_ISA is not set 810# CONFIG_I2C_ISA is not set
797CONFIG_I2C_KEYWEST=y 811CONFIG_I2C_KEYWEST=y
798# CONFIG_I2C_MPC is not set
799# CONFIG_I2C_NFORCE2 is not set 812# CONFIG_I2C_NFORCE2 is not set
800# CONFIG_I2C_PARPORT is not set 813# CONFIG_I2C_PARPORT is not set
801# CONFIG_I2C_PARPORT_LIGHT is not set 814# CONFIG_I2C_PARPORT_LIGHT is not set
@@ -822,7 +835,9 @@ CONFIG_I2C_KEYWEST=y
822# CONFIG_SENSORS_ASB100 is not set 835# CONFIG_SENSORS_ASB100 is not set
823# CONFIG_SENSORS_DS1621 is not set 836# CONFIG_SENSORS_DS1621 is not set
824# CONFIG_SENSORS_FSCHER is not set 837# CONFIG_SENSORS_FSCHER is not set
838# CONFIG_SENSORS_FSCPOS is not set
825# CONFIG_SENSORS_GL518SM is not set 839# CONFIG_SENSORS_GL518SM is not set
840# CONFIG_SENSORS_GL520SM is not set
826# CONFIG_SENSORS_IT87 is not set 841# CONFIG_SENSORS_IT87 is not set
827# CONFIG_SENSORS_LM63 is not set 842# CONFIG_SENSORS_LM63 is not set
828# CONFIG_SENSORS_LM75 is not set 843# CONFIG_SENSORS_LM75 is not set
@@ -833,9 +848,11 @@ CONFIG_I2C_KEYWEST=y
833# CONFIG_SENSORS_LM85 is not set 848# CONFIG_SENSORS_LM85 is not set
834# CONFIG_SENSORS_LM87 is not set 849# CONFIG_SENSORS_LM87 is not set
835# CONFIG_SENSORS_LM90 is not set 850# CONFIG_SENSORS_LM90 is not set
851# CONFIG_SENSORS_LM92 is not set
836# CONFIG_SENSORS_MAX1619 is not set 852# CONFIG_SENSORS_MAX1619 is not set
837# CONFIG_SENSORS_PC87360 is not set 853# CONFIG_SENSORS_PC87360 is not set
838# CONFIG_SENSORS_SMSC47B397 is not set 854# CONFIG_SENSORS_SMSC47B397 is not set
855# CONFIG_SENSORS_SIS5595 is not set
839# CONFIG_SENSORS_SMSC47M1 is not set 856# CONFIG_SENSORS_SMSC47M1 is not set
840# CONFIG_SENSORS_VIA686A is not set 857# CONFIG_SENSORS_VIA686A is not set
841# CONFIG_SENSORS_W83781D is not set 858# CONFIG_SENSORS_W83781D is not set
@@ -845,6 +862,7 @@ CONFIG_I2C_KEYWEST=y
845# 862#
846# Other I2C Chip support 863# Other I2C Chip support
847# 864#
865# CONFIG_SENSORS_DS1337 is not set
848# CONFIG_SENSORS_EEPROM is not set 866# CONFIG_SENSORS_EEPROM is not set
849# CONFIG_SENSORS_PCF8574 is not set 867# CONFIG_SENSORS_PCF8574 is not set
850# CONFIG_SENSORS_PCF8591 is not set 868# CONFIG_SENSORS_PCF8591 is not set
@@ -877,6 +895,11 @@ CONFIG_I2C_KEYWEST=y
877# Graphics support 895# Graphics support
878# 896#
879CONFIG_FB=y 897CONFIG_FB=y
898CONFIG_FB_CFB_FILLRECT=y
899CONFIG_FB_CFB_COPYAREA=y
900CONFIG_FB_CFB_IMAGEBLIT=y
901CONFIG_FB_SOFT_CURSOR=y
902CONFIG_FB_MACMODES=y
880CONFIG_FB_MODE_HELPERS=y 903CONFIG_FB_MODE_HELPERS=y
881CONFIG_FB_TILEBLITTING=y 904CONFIG_FB_TILEBLITTING=y
882# CONFIG_FB_CIRRUS is not set 905# CONFIG_FB_CIRRUS is not set
@@ -890,9 +913,8 @@ CONFIG_FB_OF=y
890# CONFIG_FB_ASILIANT is not set 913# CONFIG_FB_ASILIANT is not set
891# CONFIG_FB_IMSTT is not set 914# CONFIG_FB_IMSTT is not set
892# CONFIG_FB_VGA16 is not set 915# CONFIG_FB_VGA16 is not set
893CONFIG_FB_RIVA=y 916# CONFIG_FB_NVIDIA is not set
894CONFIG_FB_RIVA_I2C=y 917# CONFIG_FB_RIVA is not set
895# CONFIG_FB_RIVA_DEBUG is not set
896CONFIG_FB_MATROX=y 918CONFIG_FB_MATROX=y
897CONFIG_FB_MATROX_MILLENIUM=y 919CONFIG_FB_MATROX_MILLENIUM=y
898CONFIG_FB_MATROX_MYSTIQUE=y 920CONFIG_FB_MATROX_MYSTIQUE=y
@@ -913,6 +935,7 @@ CONFIG_FB_RADEON_I2C=y
913# CONFIG_FB_3DFX is not set 935# CONFIG_FB_3DFX is not set
914# CONFIG_FB_VOODOO1 is not set 936# CONFIG_FB_VOODOO1 is not set
915# CONFIG_FB_TRIDENT is not set 937# CONFIG_FB_TRIDENT is not set
938# CONFIG_FB_S1D13XXX is not set
916# CONFIG_FB_VIRTUAL is not set 939# CONFIG_FB_VIRTUAL is not set
917 940
918# 941#
@@ -946,6 +969,8 @@ CONFIG_LCD_DEVICE=y
946# 969#
947# USB support 970# USB support
948# 971#
972CONFIG_USB_ARCH_HAS_HCD=y
973CONFIG_USB_ARCH_HAS_OHCI=y
949CONFIG_USB=y 974CONFIG_USB=y
950# CONFIG_USB_DEBUG is not set 975# CONFIG_USB_DEBUG is not set
951 976
@@ -956,8 +981,6 @@ CONFIG_USB_DEVICEFS=y
956# CONFIG_USB_BANDWIDTH is not set 981# CONFIG_USB_BANDWIDTH is not set
957# CONFIG_USB_DYNAMIC_MINORS is not set 982# CONFIG_USB_DYNAMIC_MINORS is not set
958# CONFIG_USB_OTG is not set 983# CONFIG_USB_OTG is not set
959CONFIG_USB_ARCH_HAS_HCD=y
960CONFIG_USB_ARCH_HAS_OHCI=y
961 984
962# 985#
963# USB Host Controller Drivers 986# USB Host Controller Drivers
@@ -966,6 +989,8 @@ CONFIG_USB_EHCI_HCD=y
966# CONFIG_USB_EHCI_SPLIT_ISO is not set 989# CONFIG_USB_EHCI_SPLIT_ISO is not set
967# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 990# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
968CONFIG_USB_OHCI_HCD=y 991CONFIG_USB_OHCI_HCD=y
992# CONFIG_USB_OHCI_BIG_ENDIAN is not set
993CONFIG_USB_OHCI_LITTLE_ENDIAN=y
969# CONFIG_USB_UHCI_HCD is not set 994# CONFIG_USB_UHCI_HCD is not set
970# CONFIG_USB_SL811_HCD is not set 995# CONFIG_USB_SL811_HCD is not set
971 996
@@ -981,12 +1006,11 @@ CONFIG_USB_OHCI_HCD=y
981# 1006#
982CONFIG_USB_STORAGE=m 1007CONFIG_USB_STORAGE=m
983# CONFIG_USB_STORAGE_DEBUG is not set 1008# CONFIG_USB_STORAGE_DEBUG is not set
984CONFIG_USB_STORAGE_RW_DETECT=y
985# CONFIG_USB_STORAGE_DATAFAB is not set 1009# CONFIG_USB_STORAGE_DATAFAB is not set
986# CONFIG_USB_STORAGE_FREECOM is not set 1010# CONFIG_USB_STORAGE_FREECOM is not set
987# CONFIG_USB_STORAGE_ISD200 is not set 1011# CONFIG_USB_STORAGE_ISD200 is not set
988# CONFIG_USB_STORAGE_DPCM is not set 1012# CONFIG_USB_STORAGE_DPCM is not set
989# CONFIG_USB_STORAGE_HP8200e is not set 1013# CONFIG_USB_STORAGE_USBAT is not set
990# CONFIG_USB_STORAGE_SDDR09 is not set 1014# CONFIG_USB_STORAGE_SDDR09 is not set
991# CONFIG_USB_STORAGE_SDDR55 is not set 1015# CONFIG_USB_STORAGE_SDDR55 is not set
992# CONFIG_USB_STORAGE_JUMPSHOT is not set 1016# CONFIG_USB_STORAGE_JUMPSHOT is not set
@@ -1030,6 +1054,7 @@ CONFIG_USB_HIDDEV=y
1030CONFIG_USB_PEGASUS=y 1054CONFIG_USB_PEGASUS=y
1031# CONFIG_USB_RTL8150 is not set 1055# CONFIG_USB_RTL8150 is not set
1032# CONFIG_USB_USBNET is not set 1056# CONFIG_USB_USBNET is not set
1057# CONFIG_USB_MON is not set
1033 1058
1034# 1059#
1035# USB port drivers 1060# USB port drivers
@@ -1055,6 +1080,7 @@ CONFIG_USB_PEGASUS=y
1055# CONFIG_USB_PHIDGETKIT is not set 1080# CONFIG_USB_PHIDGETKIT is not set
1056# CONFIG_USB_PHIDGETSERVO is not set 1081# CONFIG_USB_PHIDGETSERVO is not set
1057# CONFIG_USB_IDMOUSE is not set 1082# CONFIG_USB_IDMOUSE is not set
1083# CONFIG_USB_SISUSBVGA is not set
1058# CONFIG_USB_TEST is not set 1084# CONFIG_USB_TEST is not set
1059 1085
1060# 1086#
@@ -1276,10 +1302,13 @@ CONFIG_OPROFILE=y
1276# 1302#
1277# Kernel hacking 1303# Kernel hacking
1278# 1304#
1305# CONFIG_PRINTK_TIME is not set
1279CONFIG_DEBUG_KERNEL=y 1306CONFIG_DEBUG_KERNEL=y
1280CONFIG_MAGIC_SYSRQ=y 1307CONFIG_MAGIC_SYSRQ=y
1308CONFIG_LOG_BUF_SHIFT=17
1281# CONFIG_SCHEDSTATS is not set 1309# CONFIG_SCHEDSTATS is not set
1282# CONFIG_DEBUG_SLAB is not set 1310# CONFIG_DEBUG_SLAB is not set
1311# CONFIG_DEBUG_SPINLOCK is not set
1283# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1312# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1284# CONFIG_DEBUG_KOBJECT is not set 1313# CONFIG_DEBUG_KOBJECT is not set
1285# CONFIG_DEBUG_INFO is not set 1314# CONFIG_DEBUG_INFO is not set
@@ -1311,6 +1340,7 @@ CONFIG_CRYPTO_SHA1=m
1311CONFIG_CRYPTO_SHA256=m 1340CONFIG_CRYPTO_SHA256=m
1312CONFIG_CRYPTO_SHA512=m 1341CONFIG_CRYPTO_SHA512=m
1313CONFIG_CRYPTO_WP512=m 1342CONFIG_CRYPTO_WP512=m
1343CONFIG_CRYPTO_TGR192=m
1314CONFIG_CRYPTO_DES=y 1344CONFIG_CRYPTO_DES=y
1315CONFIG_CRYPTO_BLOWFISH=m 1345CONFIG_CRYPTO_BLOWFISH=m
1316CONFIG_CRYPTO_TWOFISH=m 1346CONFIG_CRYPTO_TWOFISH=m
diff --git a/arch/ppc64/kernel/HvLpEvent.c b/arch/ppc64/kernel/HvLpEvent.c
index f8f19637f73f..90032b138902 100644
--- a/arch/ppc64/kernel/HvLpEvent.c
+++ b/arch/ppc64/kernel/HvLpEvent.c
@@ -12,7 +12,7 @@
12#include <asm/system.h> 12#include <asm/system.h>
13#include <asm/iSeries/HvLpEvent.h> 13#include <asm/iSeries/HvLpEvent.h>
14#include <asm/iSeries/HvCallEvent.h> 14#include <asm/iSeries/HvCallEvent.h>
15#include <asm/iSeries/LparData.h> 15#include <asm/iSeries/ItLpNaca.h>
16 16
17/* Array of LpEvent handler functions */ 17/* Array of LpEvent handler functions */
18LpEventHandler lpEventHandler[HvLpEvent_Type_NumTypes]; 18LpEventHandler lpEventHandler[HvLpEvent_Type_NumTypes];
diff --git a/arch/ppc64/kernel/ItLpQueue.c b/arch/ppc64/kernel/ItLpQueue.c
index c923a815760e..cdea00d7707f 100644
--- a/arch/ppc64/kernel/ItLpQueue.c
+++ b/arch/ppc64/kernel/ItLpQueue.c
@@ -16,7 +16,6 @@
16#include <asm/iSeries/ItLpQueue.h> 16#include <asm/iSeries/ItLpQueue.h>
17#include <asm/iSeries/HvLpEvent.h> 17#include <asm/iSeries/HvLpEvent.h>
18#include <asm/iSeries/HvCallEvent.h> 18#include <asm/iSeries/HvCallEvent.h>
19#include <asm/iSeries/LparData.h>
20 19
21static __inline__ int set_inUse( struct ItLpQueue * lpQueue ) 20static __inline__ int set_inUse( struct ItLpQueue * lpQueue )
22{ 21{
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile
index 96d90b0c5119..b5e167cf1a05 100644
--- a/arch/ppc64/kernel/Makefile
+++ b/arch/ppc64/kernel/Makefile
@@ -16,14 +16,13 @@ obj-y += vdso32/ vdso64/
16 16
17obj-$(CONFIG_PPC_OF) += of_device.o 17obj-$(CONFIG_PPC_OF) += of_device.o
18 18
19pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o iSeries_pci_reset.o 19pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o iSeries_irq.o \
20 iSeries_VpdInfo.o
20pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o 21pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o
21 22
22obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y) 23obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y)
23 24
24obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \ 25obj-$(CONFIG_PPC_ISERIES) += HvCall.o HvLpConfig.o LparData.o \
25 iSeries_VpdInfo.o XmPciLpEvent.o \
26 HvCall.o HvLpConfig.o LparData.o \
27 iSeries_setup.o ItLpQueue.o hvCall.o \ 26 iSeries_setup.o ItLpQueue.o hvCall.o \
28 mf.o HvLpEvent.o iSeries_proc.o iSeries_htab.o \ 27 mf.o HvLpEvent.o iSeries_proc.o iSeries_htab.o \
29 iSeries_iommu.o 28 iSeries_iommu.o
diff --git a/arch/ppc64/kernel/XmPciLpEvent.c b/arch/ppc64/kernel/XmPciLpEvent.c
deleted file mode 100644
index 809c9bc6678b..000000000000
--- a/arch/ppc64/kernel/XmPciLpEvent.c
+++ /dev/null
@@ -1,190 +0,0 @@
1/*
2 * File XmPciLpEvent.h created by Wayne Holm on Mon Jan 15 2001.
3 *
4 * This module handles PCI interrupt events sent by the iSeries Hypervisor.
5*/
6
7#include <linux/config.h>
8#include <linux/pci.h>
9#include <linux/init.h>
10#include <linux/threads.h>
11#include <linux/smp.h>
12#include <linux/param.h>
13#include <linux/string.h>
14#include <linux/bootmem.h>
15#include <linux/ide.h>
16
17#include <asm/iSeries/HvTypes.h>
18#include <asm/iSeries/HvLpEvent.h>
19#include <asm/iSeries/HvCallPci.h>
20#include <asm/iSeries/XmPciLpEvent.h>
21#include <asm/ppcdebug.h>
22
23static long Pci_Interrupt_Count;
24static long Pci_Event_Count;
25
26enum XmPciLpEvent_Subtype {
27 XmPciLpEvent_BusCreated = 0, // PHB has been created
28 XmPciLpEvent_BusError = 1, // PHB has failed
29 XmPciLpEvent_BusFailed = 2, // Msg to Secondary, Primary failed bus
30 XmPciLpEvent_NodeFailed = 4, // Multi-adapter bridge has failed
31 XmPciLpEvent_NodeRecovered = 5, // Multi-adapter bridge has recovered
32 XmPciLpEvent_BusRecovered = 12, // PHB has been recovered
33 XmPciLpEvent_UnQuiesceBus = 18, // Secondary bus unqiescing
34 XmPciLpEvent_BridgeError = 21, // Bridge Error
35 XmPciLpEvent_SlotInterrupt = 22 // Slot interrupt
36};
37
38struct XmPciLpEvent_BusInterrupt {
39 HvBusNumber busNumber;
40 HvSubBusNumber subBusNumber;
41};
42
43struct XmPciLpEvent_NodeInterrupt {
44 HvBusNumber busNumber;
45 HvSubBusNumber subBusNumber;
46 HvAgentId deviceId;
47};
48
49struct XmPciLpEvent {
50 struct HvLpEvent hvLpEvent;
51
52 union {
53 u64 alignData; // Align on an 8-byte boundary
54
55 struct {
56 u32 fisr;
57 HvBusNumber busNumber;
58 HvSubBusNumber subBusNumber;
59 HvAgentId deviceId;
60 } slotInterrupt;
61
62 struct XmPciLpEvent_BusInterrupt busFailed;
63 struct XmPciLpEvent_BusInterrupt busRecovered;
64 struct XmPciLpEvent_BusInterrupt busCreated;
65
66 struct XmPciLpEvent_NodeInterrupt nodeFailed;
67 struct XmPciLpEvent_NodeInterrupt nodeRecovered;
68
69 } eventData;
70
71};
72
73static void intReceived(struct XmPciLpEvent *eventParm,
74 struct pt_regs *regsParm);
75
76static void XmPciLpEvent_handler(struct HvLpEvent *eventParm,
77 struct pt_regs *regsParm)
78{
79#ifdef CONFIG_PCI
80#if 0
81 PPCDBG(PPCDBG_BUSWALK, "XmPciLpEvent_handler, type 0x%x\n",
82 eventParm->xType);
83#endif
84 ++Pci_Event_Count;
85
86 if (eventParm && (eventParm->xType == HvLpEvent_Type_PciIo)) {
87 switch (eventParm->xFlags.xFunction) {
88 case HvLpEvent_Function_Int:
89 intReceived((struct XmPciLpEvent *)eventParm, regsParm);
90 break;
91 case HvLpEvent_Function_Ack:
92 printk(KERN_ERR
93 "XmPciLpEvent.c: unexpected ack received\n");
94 break;
95 default:
96 printk(KERN_ERR
97 "XmPciLpEvent.c: unexpected event function %d\n",
98 (int)eventParm->xFlags.xFunction);
99 break;
100 }
101 } else if (eventParm)
102 printk(KERN_ERR
103 "XmPciLpEvent.c: Unrecognized PCI event type 0x%x\n",
104 (int)eventParm->xType);
105 else
106 printk(KERN_ERR "XmPciLpEvent.c: NULL event received\n");
107#endif
108}
109
110static void intReceived(struct XmPciLpEvent *eventParm,
111 struct pt_regs *regsParm)
112{
113 int irq;
114
115 ++Pci_Interrupt_Count;
116#if 0
117 PPCDBG(PPCDBG_BUSWALK, "PCI: XmPciLpEvent.c: intReceived\n");
118#endif
119
120 switch (eventParm->hvLpEvent.xSubtype) {
121 case XmPciLpEvent_SlotInterrupt:
122 irq = eventParm->hvLpEvent.xCorrelationToken;
123 /* Dispatch the interrupt handlers for this irq */
124 ppc_irq_dispatch_handler(regsParm, irq);
125 HvCallPci_eoi(eventParm->eventData.slotInterrupt.busNumber,
126 eventParm->eventData.slotInterrupt.subBusNumber,
127 eventParm->eventData.slotInterrupt.deviceId);
128 break;
129 /* Ignore error recovery events for now */
130 case XmPciLpEvent_BusCreated:
131 printk(KERN_INFO "XmPciLpEvent.c: system bus %d created\n",
132 eventParm->eventData.busCreated.busNumber);
133 break;
134 case XmPciLpEvent_BusError:
135 case XmPciLpEvent_BusFailed:
136 printk(KERN_INFO "XmPciLpEvent.c: system bus %d failed\n",
137 eventParm->eventData.busFailed.busNumber);
138 break;
139 case XmPciLpEvent_BusRecovered:
140 case XmPciLpEvent_UnQuiesceBus:
141 printk(KERN_INFO "XmPciLpEvent.c: system bus %d recovered\n",
142 eventParm->eventData.busRecovered.busNumber);
143 break;
144 case XmPciLpEvent_NodeFailed:
145 case XmPciLpEvent_BridgeError:
146 printk(KERN_INFO
147 "XmPciLpEvent.c: multi-adapter bridge %d/%d/%d failed\n",
148 eventParm->eventData.nodeFailed.busNumber,
149 eventParm->eventData.nodeFailed.subBusNumber,
150 eventParm->eventData.nodeFailed.deviceId);
151 break;
152 case XmPciLpEvent_NodeRecovered:
153 printk(KERN_INFO
154 "XmPciLpEvent.c: multi-adapter bridge %d/%d/%d recovered\n",
155 eventParm->eventData.nodeRecovered.busNumber,
156 eventParm->eventData.nodeRecovered.subBusNumber,
157 eventParm->eventData.nodeRecovered.deviceId);
158 break;
159 default:
160 printk(KERN_ERR
161 "XmPciLpEvent.c: unrecognized event subtype 0x%x\n",
162 eventParm->hvLpEvent.xSubtype);
163 break;
164 }
165}
166
167
168/* This should be called sometime prior to buswalk (init_IRQ would be good) */
169int XmPciLpEvent_init()
170{
171 int xRc;
172
173 PPCDBG(PPCDBG_BUSWALK,
174 "XmPciLpEvent_init, Register Event type 0x%04X\n",
175 HvLpEvent_Type_PciIo);
176
177 xRc = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo,
178 &XmPciLpEvent_handler);
179 if (xRc == 0) {
180 xRc = HvLpEvent_openPath(HvLpEvent_Type_PciIo, 0);
181 if (xRc != 0)
182 printk(KERN_ERR
183 "XmPciLpEvent.c: open event path failed with rc 0x%x\n",
184 xRc);
185 } else
186 printk(KERN_ERR
187 "XmPciLpEvent.c: register handler failed with rc 0x%x\n",
188 xRc);
189 return xRc;
190}
diff --git a/arch/ppc64/kernel/asm-offsets.c b/arch/ppc64/kernel/asm-offsets.c
index 0094ac79a18c..abb9e5b5da03 100644
--- a/arch/ppc64/kernel/asm-offsets.c
+++ b/arch/ppc64/kernel/asm-offsets.c
@@ -31,7 +31,6 @@
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/ItLpQueue.h>
35#include <asm/iSeries/HvLpEvent.h> 34#include <asm/iSeries/HvLpEvent.h>
36#include <asm/rtas.h> 35#include <asm/rtas.h>
37#include <asm/cputable.h> 36#include <asm/cputable.h>
diff --git a/arch/ppc64/kernel/dma.c b/arch/ppc64/kernel/dma.c
index ce714c927134..4da8e31b2b61 100644
--- a/arch/ppc64/kernel/dma.c
+++ b/arch/ppc64/kernel/dma.c
@@ -15,8 +15,10 @@
15 15
16static struct dma_mapping_ops *get_dma_ops(struct device *dev) 16static struct dma_mapping_ops *get_dma_ops(struct device *dev)
17{ 17{
18#ifdef CONFIG_PCI
18 if (dev->bus == &pci_bus_type) 19 if (dev->bus == &pci_bus_type)
19 return &pci_dma_ops; 20 return &pci_dma_ops;
21#endif
20#ifdef CONFIG_IBMVIO 22#ifdef CONFIG_IBMVIO
21 if (dev->bus == &vio_bus_type) 23 if (dev->bus == &vio_bus_type)
22 return &vio_dma_ops; 24 return &vio_dma_ops;
@@ -37,8 +39,10 @@ EXPORT_SYMBOL(dma_supported);
37 39
38int dma_set_mask(struct device *dev, u64 dma_mask) 40int dma_set_mask(struct device *dev, u64 dma_mask)
39{ 41{
42#ifdef CONFIG_PCI
40 if (dev->bus == &pci_bus_type) 43 if (dev->bus == &pci_bus_type)
41 return pci_set_dma_mask(to_pci_dev(dev), dma_mask); 44 return pci_set_dma_mask(to_pci_dev(dev), dma_mask);
45#endif
42#ifdef CONFIG_IBMVIO 46#ifdef CONFIG_IBMVIO
43 if (dev->bus == &vio_bus_type) 47 if (dev->bus == &vio_bus_type)
44 return -EIO; 48 return -EIO;
diff --git a/arch/ppc64/kernel/eeh.c b/arch/ppc64/kernel/eeh.c
index d63d41f3eecf..af5272fedadf 100644
--- a/arch/ppc64/kernel/eeh.c
+++ b/arch/ppc64/kernel/eeh.c
@@ -505,7 +505,7 @@ static inline unsigned long eeh_token_to_phys(unsigned long token)
505 pte_t *ptep; 505 pte_t *ptep;
506 unsigned long pa; 506 unsigned long pa;
507 507
508 ptep = find_linux_pte(ioremap_mm.pgd, token); 508 ptep = find_linux_pte(init_mm.pgd, token);
509 if (!ptep) 509 if (!ptep)
510 return token; 510 return token;
511 pa = pte_pfn(*ptep) << PAGE_SHIFT; 511 pa = pte_pfn(*ptep) << PAGE_SHIFT;
diff --git a/arch/ppc64/kernel/entry.S b/arch/ppc64/kernel/entry.S
index d3604056e1a9..b61572eb2a71 100644
--- a/arch/ppc64/kernel/entry.S
+++ b/arch/ppc64/kernel/entry.S
@@ -436,15 +436,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
436 REST_8GPRS(14, r1) 436 REST_8GPRS(14, r1)
437 REST_10GPRS(22, r1) 437 REST_10GPRS(22, r1)
438 438
439#ifdef CONFIG_PPC_ISERIES
440 clrrdi r7,r1,THREAD_SHIFT /* get current_thread_info() */
441 ld r7,TI_FLAGS(r7) /* Get run light flag */
442 mfspr r9,CTRLF
443 srdi r7,r7,TIF_RUN_LIGHT
444 insrdi r9,r7,1,63 /* Insert run light into CTRL */
445 mtspr CTRLT,r9
446#endif
447
448 /* convert old thread to its task_struct for return value */ 439 /* convert old thread to its task_struct for return value */
449 addi r3,r3,-THREAD 440 addi r3,r3,-THREAD
450 ld r7,_NIP(r1) /* Return to _switch caller in new task */ 441 ld r7,_NIP(r1) /* Return to _switch caller in new task */
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
index 92a744c31ab1..02c8f4e3e4bc 100644
--- a/arch/ppc64/kernel/head.S
+++ b/arch/ppc64/kernel/head.S
@@ -626,10 +626,10 @@ system_reset_iSeries:
626 lhz r24,PACAPACAINDEX(r13) /* Get processor # */ 626 lhz r24,PACAPACAINDEX(r13) /* Get processor # */
627 cmpwi 0,r24,0 /* Are we processor 0? */ 627 cmpwi 0,r24,0 /* Are we processor 0? */
628 beq .__start_initialization_iSeries /* Start up the first processor */ 628 beq .__start_initialization_iSeries /* Start up the first processor */
629 mfspr r4,CTRLF 629 mfspr r4,SPRN_CTRLF
630 li r5,RUNLATCH /* Turn off the run light */ 630 li r5,CTRL_RUNLATCH /* Turn off the run light */
631 andc r4,r4,r5 631 andc r4,r4,r5
632 mtspr CTRLT,r4 632 mtspr SPRN_CTRLT,r4
633 633
6341: 6341:
635 HMT_LOW 635 HMT_LOW
@@ -2082,9 +2082,9 @@ _GLOBAL(hmt_start_secondary)
2082 mfspr r4, HID0 2082 mfspr r4, HID0
2083 ori r4, r4, 0x1 2083 ori r4, r4, 0x1
2084 mtspr HID0, r4 2084 mtspr HID0, r4
2085 mfspr r4, CTRLF 2085 mfspr r4, SPRN_CTRLF
2086 oris r4, r4, 0x40 2086 oris r4, r4, 0x40
2087 mtspr CTRLT, r4 2087 mtspr SPRN_CTRLT, r4
2088 blr 2088 blr
2089#endif 2089#endif
2090 2090
@@ -2121,10 +2121,6 @@ empty_zero_page:
2121swapper_pg_dir: 2121swapper_pg_dir:
2122 .space 4096 2122 .space 4096
2123 2123
2124 .globl ioremap_dir
2125ioremap_dir:
2126 .space 4096
2127
2128#ifdef CONFIG_SMP 2124#ifdef CONFIG_SMP
2129/* 1 page segment table per cpu (max 48, cpu0 allocated at STAB0_PHYS_ADDR) */ 2125/* 1 page segment table per cpu (max 48, cpu0 allocated at STAB0_PHYS_ADDR) */
2130 .globl stab_array 2126 .globl stab_array
diff --git a/arch/ppc64/kernel/iSeries_VpdInfo.c b/arch/ppc64/kernel/iSeries_VpdInfo.c
index a6f0ff2d0239..d11c732daf81 100644
--- a/arch/ppc64/kernel/iSeries_VpdInfo.c
+++ b/arch/ppc64/kernel/iSeries_VpdInfo.c
@@ -1,31 +1,31 @@
1/************************************************************************/ 1/*
2/* File iSeries_vpdInfo.c created by Allan Trautman on Fri Feb 2 2001. */ 2 * File iSeries_vpdInfo.c created by Allan Trautman on Fri Feb 2 2001.
3/************************************************************************/ 3 *
4/* This code gets the card location of the hardware */ 4 * This code gets the card location of the hardware
5/* Copyright (C) 20yy <Allan H Trautman> <IBM Corp> */ 5 * Copyright (C) 2001 <Allan H Trautman> <IBM Corp>
6/* */ 6 * Copyright (C) 2005 Stephen Rothwel, IBM Corp
7/* This program is free software; you can redistribute it and/or modify */ 7 *
8/* it under the terms of the GNU General Public License as published by */ 8 * This program is free software; you can redistribute it and/or modify
9/* the Free Software Foundation; either version 2 of the License, or */ 9 * it under the terms of the GNU General Public License as published by
10/* (at your option) any later version. */ 10 * the Free Software Foundation; either version 2 of the License, or
11/* */ 11 * (at your option) any later version.
12/* This program is distributed in the hope that it will be useful, */ 12 *
13/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 13 * This program is distributed in the hope that it will be useful,
14/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15/* GNU General Public License for more details. */ 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16/* */ 16 * GNU General Public License for more details.
17/* You should have received a copy of the GNU General Public License */ 17 *
18/* along with this program; if not, write to the: */ 18 * You should have received a copy of the GNU General Public License
19/* Free Software Foundation, Inc., */ 19 * along with this program; if not, write to the:
20/* 59 Temple Place, Suite 330, */ 20 * Free Software Foundation, Inc.,
21/* Boston, MA 02111-1307 USA */ 21 * 59 Temple Place, Suite 330,
22/************************************************************************/ 22 * Boston, MA 02111-1307 USA
23/* Change Activity: */ 23 *
24/* Created, Feb 2, 2001 */ 24 * Change Activity:
25/* Ported to ppc64, August 20, 2001 */ 25 * Created, Feb 2, 2001
26/* End Change Activity */ 26 * Ported to ppc64, August 20, 2001
27/************************************************************************/ 27 * End Change Activity
28#include <linux/config.h> 28 */
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/pci.h> 31#include <linux/pci.h>
@@ -34,30 +34,25 @@
34 34
35#include <asm/iSeries/HvCallPci.h> 35#include <asm/iSeries/HvCallPci.h>
36#include <asm/iSeries/HvTypes.h> 36#include <asm/iSeries/HvTypes.h>
37#include <asm/iSeries/mf.h>
38#include <asm/iSeries/LparData.h>
39#include <asm/iSeries/iSeries_pci.h> 37#include <asm/iSeries/iSeries_pci.h>
40#include "pci.h"
41 38
42/* 39/*
43 * Size of Bus VPD data 40 * Size of Bus VPD data
44 */ 41 */
45#define BUS_VPDSIZE 1024 42#define BUS_VPDSIZE 1024
43
46/* 44/*
47 * Bus Vpd Tags 45 * Bus Vpd Tags
48 */ 46 */
49#define VpdEndOfDataTag 0x78
50#define VpdEndOfAreaTag 0x79 47#define VpdEndOfAreaTag 0x79
51#define VpdIdStringTag 0x82 48#define VpdIdStringTag 0x82
52#define VpdVendorAreaTag 0x84 49#define VpdVendorAreaTag 0x84
50
53/* 51/*
54 * Mfg Area Tags 52 * Mfg Area Tags
55 */ 53 */
56#define VpdFruFlag 0x4647 // "FG"
57#define VpdFruFrameId 0x4649 // "FI" 54#define VpdFruFrameId 0x4649 // "FI"
58#define VpdSlotMapFormat 0x4D46 // "MF" 55#define VpdSlotMapFormat 0x4D46 // "MF"
59#define VpdAsmPartNumber 0x504E // "PN"
60#define VpdFruSerial 0x534E // "SN"
61#define VpdSlotMap 0x534D // "SM" 56#define VpdSlotMap 0x534D // "SM"
62 57
63/* 58/*
@@ -79,74 +74,33 @@ struct SlotMapStruct {
79 char CardLocation[3]; 74 char CardLocation[3];
80 char Parms[8]; 75 char Parms[8];
81 char Reserved[2]; 76 char Reserved[2];
82}; 77};
83typedef struct SlotMapStruct SlotMap; 78typedef struct SlotMapStruct SlotMap;
84#define SLOT_ENTRY_SIZE 16 79#define SLOT_ENTRY_SIZE 16
85 80
86/* 81/*
87 * Formats the device information.
88 * - Pass in pci_dev* pointer to the device.
89 * - Pass in buffer to place the data. Danger here is the buffer must
90 * be as big as the client says it is. Should be at least 128 bytes.
91 * Return will the length of the string data put in the buffer.
92 * Format:
93 * PCI: Bus 0, Device 26, Vendor 0x12AE Frame 1, Card C10 Ethernet
94 * controller
95 */
96int iSeries_Device_Information(struct pci_dev *PciDev, char *buffer,
97 int BufferSize)
98{
99 struct iSeries_Device_Node *DevNode =
100 (struct iSeries_Device_Node *)PciDev->sysdata;
101 int len;
102
103 if (DevNode == NULL)
104 return sprintf(buffer,
105 "PCI: iSeries_Device_Information DevNode is NULL");
106
107 if (BufferSize < 128)
108 return 0;
109
110 len = sprintf(buffer, "PCI: Bus%3d, Device%3d, Vendor %04X ",
111 ISERIES_BUS(DevNode), PCI_SLOT(PciDev->devfn),
112 PciDev->vendor);
113 len += sprintf(buffer + len, "Frame%3d, Card %4s ",
114 DevNode->FrameId, DevNode->CardLocation);
115#ifdef CONFIG_PCI
116 if (pci_class_name(PciDev->class >> 8) == 0)
117 len += sprintf(buffer + len, "0x%04X ",
118 (int)(PciDev->class >> 8));
119 else
120 len += sprintf(buffer + len, "%s",
121 pci_class_name(PciDev->class >> 8));
122#endif
123 return len;
124}
125
126/*
127 * Parse the Slot Area 82 * Parse the Slot Area
128 */ 83 */
129void iSeries_Parse_SlotArea(SlotMap *MapPtr, int MapLen, 84static void __init iSeries_Parse_SlotArea(SlotMap *MapPtr, int MapLen,
130 struct iSeries_Device_Node *DevNode) 85 HvAgentId agent, u8 *PhbId, char card[4])
131{ 86{
132 int SlotMapLen = MapLen; 87 int SlotMapLen = MapLen;
133 SlotMap *SlotMapPtr = MapPtr; 88 SlotMap *SlotMapPtr = MapPtr;
134 89
135 /* 90 /*
136 * Parse Slot label until we find the one requrested 91 * Parse Slot label until we find the one requested
137 */ 92 */
138 while (SlotMapLen > 0) { 93 while (SlotMapLen > 0) {
139 if (SlotMapPtr->AgentId == DevNode->AgentId ) { 94 if (SlotMapPtr->AgentId == agent) {
140 /* 95 /*
141 * If Phb wasn't found, grab the entry first one found. 96 * If Phb wasn't found, grab the entry first one found.
142 */ 97 */
143 if (DevNode->PhbId == 0xff) 98 if (*PhbId == 0xff)
144 DevNode->PhbId = SlotMapPtr->PhbId; 99 *PhbId = SlotMapPtr->PhbId;
145 /* Found it, extract the data. */ 100 /* Found it, extract the data. */
146 if (SlotMapPtr->PhbId == DevNode->PhbId ) { 101 if (SlotMapPtr->PhbId == *PhbId) {
147 memcpy(&DevNode->CardLocation, 102 memcpy(card, &SlotMapPtr->CardLocation, 3);
148 &SlotMapPtr->CardLocation, 3); 103 card[3] = 0;
149 DevNode->CardLocation[3] = 0;
150 break; 104 break;
151 } 105 }
152 } 106 }
@@ -159,8 +113,9 @@ void iSeries_Parse_SlotArea(SlotMap *MapPtr, int MapLen,
159/* 113/*
160 * Parse the Mfg Area 114 * Parse the Mfg Area
161 */ 115 */
162static void iSeries_Parse_MfgArea(u8 *AreaData, int AreaLen, 116static void __init iSeries_Parse_MfgArea(u8 *AreaData, int AreaLen,
163 struct iSeries_Device_Node *DevNode) 117 HvAgentId agent, u8 *PhbId,
118 u8 *frame, char card[4])
164{ 119{
165 MfgArea *MfgAreaPtr = (MfgArea *)AreaData; 120 MfgArea *MfgAreaPtr = (MfgArea *)AreaData;
166 int MfgAreaLen = AreaLen; 121 int MfgAreaLen = AreaLen;
@@ -171,7 +126,7 @@ static void iSeries_Parse_MfgArea(u8 *AreaData, int AreaLen,
171 int MfgTagLen = MfgAreaPtr->TagLength; 126 int MfgTagLen = MfgAreaPtr->TagLength;
172 /* Frame ID (FI 4649020310 ) */ 127 /* Frame ID (FI 4649020310 ) */
173 if (MfgAreaPtr->Tag == VpdFruFrameId) /* FI */ 128 if (MfgAreaPtr->Tag == VpdFruFrameId) /* FI */
174 DevNode->FrameId = MfgAreaPtr->AreaData1; 129 *frame = MfgAreaPtr->AreaData1;
175 /* Slot Map Format (MF 4D46020004 ) */ 130 /* Slot Map Format (MF 4D46020004 ) */
176 else if (MfgAreaPtr->Tag == VpdSlotMapFormat) /* MF */ 131 else if (MfgAreaPtr->Tag == VpdSlotMapFormat) /* MF */
177 SlotMapFmt = (MfgAreaPtr->AreaData1 * 256) 132 SlotMapFmt = (MfgAreaPtr->AreaData1 * 256)
@@ -183,10 +138,11 @@ static void iSeries_Parse_MfgArea(u8 *AreaData, int AreaLen,
183 if (SlotMapFmt == 0x1004) 138 if (SlotMapFmt == 0x1004)
184 SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr 139 SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr
185 + MFG_ENTRY_SIZE + 1); 140 + MFG_ENTRY_SIZE + 1);
186 else 141 else
187 SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr 142 SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr
188 + MFG_ENTRY_SIZE); 143 + MFG_ENTRY_SIZE);
189 iSeries_Parse_SlotArea(SlotMapPtr, MfgTagLen, DevNode); 144 iSeries_Parse_SlotArea(SlotMapPtr, MfgTagLen,
145 agent, PhbId, card);
190 } 146 }
191 /* 147 /*
192 * Point to the next Mfg Area 148 * Point to the next Mfg Area
@@ -194,19 +150,19 @@ static void iSeries_Parse_MfgArea(u8 *AreaData, int AreaLen,
194 */ 150 */
195 MfgAreaPtr = (MfgArea *)((char *)MfgAreaPtr + MfgTagLen 151 MfgAreaPtr = (MfgArea *)((char *)MfgAreaPtr + MfgTagLen
196 + MFG_ENTRY_SIZE); 152 + MFG_ENTRY_SIZE);
197 MfgAreaLen -= (MfgTagLen + MFG_ENTRY_SIZE); 153 MfgAreaLen -= (MfgTagLen + MFG_ENTRY_SIZE);
198 } 154 }
199} 155}
200 156
201/* 157/*
202 * Look for "BUS".. Data is not Null terminated. 158 * Look for "BUS".. Data is not Null terminated.
203 * PHBID of 0xFF indicates PHB was not found in VPD Data. 159 * PHBID of 0xFF indicates PHB was not found in VPD Data.
204 */ 160 */
205static int iSeries_Parse_PhbId(u8 *AreaPtr, int AreaLength) 161static int __init iSeries_Parse_PhbId(u8 *AreaPtr, int AreaLength)
206{ 162{
207 u8 *PhbPtr = AreaPtr; 163 u8 *PhbPtr = AreaPtr;
208 int DataLen = AreaLength; 164 int DataLen = AreaLength;
209 char PhbId = 0xFF; 165 char PhbId = 0xFF;
210 166
211 while (DataLen > 0) { 167 while (DataLen > 0) {
212 if ((*PhbPtr == 'B') && (*(PhbPtr + 1) == 'U') 168 if ((*PhbPtr == 'B') && (*(PhbPtr + 1) == 'U')
@@ -216,7 +172,7 @@ static int iSeries_Parse_PhbId(u8 *AreaPtr, int AreaLength)
216 ++PhbPtr; 172 ++PhbPtr;
217 PhbId = (*PhbPtr & 0x0F); 173 PhbId = (*PhbPtr & 0x0F);
218 break; 174 break;
219 } 175 }
220 ++PhbPtr; 176 ++PhbPtr;
221 --DataLen; 177 --DataLen;
222 } 178 }
@@ -226,52 +182,90 @@ static int iSeries_Parse_PhbId(u8 *AreaPtr, int AreaLength)
226/* 182/*
227 * Parse out the VPD Areas 183 * Parse out the VPD Areas
228 */ 184 */
229static void iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen, 185static void __init iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen,
230 struct iSeries_Device_Node *DevNode) 186 HvAgentId agent, u8 *frame, char card[4])
231{ 187{
232 u8 *TagPtr = VpdData; 188 u8 *TagPtr = VpdData;
233 int DataLen = VpdDataLen - 3; 189 int DataLen = VpdDataLen - 3;
190 u8 PhbId;
234 191
235 while ((*TagPtr != VpdEndOfAreaTag) && (DataLen > 0)) { 192 while ((*TagPtr != VpdEndOfAreaTag) && (DataLen > 0)) {
236 int AreaLen = *(TagPtr + 1) + (*(TagPtr + 2) * 256); 193 int AreaLen = *(TagPtr + 1) + (*(TagPtr + 2) * 256);
237 u8 *AreaData = TagPtr + 3; 194 u8 *AreaData = TagPtr + 3;
238 195
239 if (*TagPtr == VpdIdStringTag) 196 if (*TagPtr == VpdIdStringTag)
240 DevNode->PhbId = iSeries_Parse_PhbId(AreaData, AreaLen); 197 PhbId = iSeries_Parse_PhbId(AreaData, AreaLen);
241 else if (*TagPtr == VpdVendorAreaTag) 198 else if (*TagPtr == VpdVendorAreaTag)
242 iSeries_Parse_MfgArea(AreaData, AreaLen, DevNode); 199 iSeries_Parse_MfgArea(AreaData, AreaLen,
200 agent, &PhbId, frame, card);
243 /* Point to next Area. */ 201 /* Point to next Area. */
244 TagPtr = AreaData + AreaLen; 202 TagPtr = AreaData + AreaLen;
245 DataLen -= AreaLen; 203 DataLen -= AreaLen;
246 } 204 }
247} 205}
248 206
249void iSeries_Get_Location_Code(struct iSeries_Device_Node *DevNode) 207static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent,
208 u8 *frame, char card[4])
250{ 209{
251 int BusVpdLen = 0; 210 int BusVpdLen = 0;
252 u8 *BusVpdPtr = (u8 *)kmalloc(BUS_VPDSIZE, GFP_KERNEL); 211 u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL);
253 212
254 if (BusVpdPtr == NULL) { 213 if (BusVpdPtr == NULL) {
255 printk("PCI: Bus VPD Buffer allocation failure.\n"); 214 printk("PCI: Bus VPD Buffer allocation failure.\n");
256 return; 215 return;
257 } 216 }
258 BusVpdLen = HvCallPci_getBusVpd(ISERIES_BUS(DevNode), 217 BusVpdLen = HvCallPci_getBusVpd(bus, ISERIES_HV_ADDR(BusVpdPtr),
259 ISERIES_HV_ADDR(BusVpdPtr),
260 BUS_VPDSIZE); 218 BUS_VPDSIZE);
261 if (BusVpdLen == 0) { 219 if (BusVpdLen == 0) {
262 kfree(BusVpdPtr);
263 printk("PCI: Bus VPD Buffer zero length.\n"); 220 printk("PCI: Bus VPD Buffer zero length.\n");
264 return; 221 goto out_free;
265 } 222 }
266 /* printk("PCI: BusVpdPtr: %p, %d\n",BusVpdPtr, BusVpdLen); */ 223 /* printk("PCI: BusVpdPtr: %p, %d\n",BusVpdPtr, BusVpdLen); */
267 /* Make sure this is what I think it is */ 224 /* Make sure this is what I think it is */
268 if (*BusVpdPtr != VpdIdStringTag) { /* 0x82 */ 225 if (*BusVpdPtr != VpdIdStringTag) { /* 0x82 */
269 printk("PCI: Bus VPD Buffer missing starting tag.\n"); 226 printk("PCI: Bus VPD Buffer missing starting tag.\n");
270 kfree(BusVpdPtr); 227 goto out_free;
271 return;
272 } 228 }
273 iSeries_Parse_Vpd(BusVpdPtr,BusVpdLen, DevNode); 229 iSeries_Parse_Vpd(BusVpdPtr, BusVpdLen, agent, frame, card);
274 sprintf(DevNode->Location, "Frame%3d, Card %-4s", DevNode->FrameId, 230out_free:
275 DevNode->CardLocation);
276 kfree(BusVpdPtr); 231 kfree(BusVpdPtr);
277} 232}
233
234/*
235 * Prints the device information.
236 * - Pass in pci_dev* pointer to the device.
237 * - Pass in the device count
238 *
239 * Format:
240 * PCI: Bus 0, Device 26, Vendor 0x12AE Frame 1, Card C10 Ethernet
241 * controller
242 */
243void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
244{
245 struct iSeries_Device_Node *DevNode = PciDev->sysdata;
246 u16 bus;
247 u8 frame;
248 char card[4];
249 HvSubBusNumber subbus;
250 HvAgentId agent;
251
252 if (DevNode == NULL) {
253 printk("%d. PCI: iSeries_Device_Information DevNode is NULL\n",
254 count);
255 return;
256 }
257
258 bus = ISERIES_BUS(DevNode);
259 subbus = ISERIES_SUBBUS(DevNode);
260 agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
261 ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
262 iSeries_Get_Location_Code(bus, agent, &frame, card);
263
264 printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, Card %4s ",
265 count, bus, PCI_SLOT(PciDev->devfn), PciDev->vendor,
266 frame, card);
267 if (pci_class_name(PciDev->class >> 8) == 0)
268 printk("0x%04X\n", (int)(PciDev->class >> 8));
269 else
270 printk("%s\n", pci_class_name(PciDev->class >> 8));
271}
diff --git a/arch/ppc64/kernel/iSeries_iommu.c b/arch/ppc64/kernel/iSeries_iommu.c
index 4e1a47c8a802..f8ff1bb054dc 100644
--- a/arch/ppc64/kernel/iSeries_iommu.c
+++ b/arch/ppc64/kernel/iSeries_iommu.c
@@ -83,7 +83,7 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
83 } 83 }
84} 84}
85 85
86 86#ifdef CONFIG_PCI
87/* 87/*
88 * This function compares the known tables to find an iommu_table 88 * This function compares the known tables to find an iommu_table
89 * that has already been built for hardware TCEs. 89 * that has already been built for hardware TCEs.
@@ -159,6 +159,7 @@ void iommu_devnode_init_iSeries(struct iSeries_Device_Node *dn)
159 else 159 else
160 kfree(tbl); 160 kfree(tbl);
161} 161}
162#endif
162 163
163static void iommu_dev_setup_iSeries(struct pci_dev *dev) { } 164static void iommu_dev_setup_iSeries(struct pci_dev *dev) { }
164static void iommu_bus_setup_iSeries(struct pci_bus *bus) { } 165static void iommu_bus_setup_iSeries(struct pci_bus *bus) { }
diff --git a/arch/ppc64/kernel/iSeries_irq.c b/arch/ppc64/kernel/iSeries_irq.c
index f831d259dbb7..77376c1bd611 100644
--- a/arch/ppc64/kernel/iSeries_irq.c
+++ b/arch/ppc64/kernel/iSeries_irq.c
@@ -1,27 +1,29 @@
1/************************************************************************/ 1/*
2/* This module supports the iSeries PCI bus interrupt handling */ 2 * This module supports the iSeries PCI bus interrupt handling
3/* Copyright (C) 20yy <Robert L Holtorf> <IBM Corp> */ 3 * Copyright (C) 20yy <Robert L Holtorf> <IBM Corp>
4/* */ 4 * Copyright (C) 2004-2005 IBM Corporation
5/* This program is free software; you can redistribute it and/or modify */ 5 *
6/* it under the terms of the GNU General Public License as published by */ 6 * This program is free software; you can redistribute it and/or modify
7/* the Free Software Foundation; either version 2 of the License, or */ 7 * it under the terms of the GNU General Public License as published by
8/* (at your option) any later version. */ 8 * the Free Software Foundation; either version 2 of the License, or
9/* */ 9 * (at your option) any later version.
10/* This program is distributed in the hope that it will be useful, */ 10 *
11/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 11 * This program is distributed in the hope that it will be useful,
12/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13/* GNU General Public License for more details. */ 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14/* */ 14 * GNU General Public License for more details.
15/* You should have received a copy of the GNU General Public License */ 15 *
16/* along with this program; if not, write to the: */ 16 * You should have received a copy of the GNU General Public License
17/* Free Software Foundation, Inc., */ 17 * along with this program; if not, write to the:
18/* 59 Temple Place, Suite 330, */ 18 * Free Software Foundation, Inc.,
19/* Boston, MA 02111-1307 USA */ 19 * 59 Temple Place, Suite 330,
20/************************************************************************/ 20 * Boston, MA 02111-1307 USA
21/* Change Activity: */ 21 *
22/* Created, December 13, 2000 by Wayne Holm */ 22 * Change Activity:
23/* End Change Activity */ 23 * Created, December 13, 2000 by Wayne Holm
24/************************************************************************/ 24 * End Change Activity
25 */
26#include <linux/config.h>
25#include <linux/pci.h> 27#include <linux/pci.h>
26#include <linux/init.h> 28#include <linux/init.h>
27#include <linux/threads.h> 29#include <linux/threads.h>
@@ -30,30 +32,15 @@
30#include <linux/string.h> 32#include <linux/string.h>
31#include <linux/bootmem.h> 33#include <linux/bootmem.h>
32#include <linux/ide.h> 34#include <linux/ide.h>
33
34#include <linux/irq.h> 35#include <linux/irq.h>
35#include <linux/spinlock.h> 36#include <linux/spinlock.h>
36#include <asm/ppcdebug.h>
37 37
38#include <asm/ppcdebug.h>
39#include <asm/iSeries/HvTypes.h>
40#include <asm/iSeries/HvLpEvent.h>
38#include <asm/iSeries/HvCallPci.h> 41#include <asm/iSeries/HvCallPci.h>
39#include <asm/iSeries/HvCallXm.h> 42#include <asm/iSeries/HvCallXm.h>
40#include <asm/iSeries/iSeries_irq.h> 43#include <asm/iSeries/iSeries_irq.h>
41#include <asm/iSeries/XmPciLpEvent.h>
42
43static unsigned int iSeries_startup_IRQ(unsigned int irq);
44static void iSeries_shutdown_IRQ(unsigned int irq);
45static void iSeries_enable_IRQ(unsigned int irq);
46static void iSeries_disable_IRQ(unsigned int irq);
47static void iSeries_end_IRQ(unsigned int irq);
48
49static hw_irq_controller iSeries_IRQ_handler = {
50 .typename = "iSeries irq controller",
51 .startup = iSeries_startup_IRQ,
52 .shutdown = iSeries_shutdown_IRQ,
53 .enable = iSeries_enable_IRQ,
54 .disable = iSeries_disable_IRQ,
55 .end = iSeries_end_IRQ
56};
57 44
58/* This maps virtual irq numbers to real irqs */ 45/* This maps virtual irq numbers to real irqs */
59unsigned int virt_irq_to_real_map[NR_IRQS]; 46unsigned int virt_irq_to_real_map[NR_IRQS];
@@ -62,37 +49,187 @@ unsigned int virt_irq_to_real_map[NR_IRQS];
62/* Note: the pcnet32 driver assumes irq numbers < 2 aren't valid. :( */ 49/* Note: the pcnet32 driver assumes irq numbers < 2 aren't valid. :( */
63static int next_virtual_irq = 2; 50static int next_virtual_irq = 2;
64 51
65/* This is called by init_IRQ. set in ppc_md.init_IRQ by iSeries_setup.c */ 52static long Pci_Interrupt_Count;
66void __init iSeries_init_IRQ(void) 53static long Pci_Event_Count;
54
55enum XmPciLpEvent_Subtype {
56 XmPciLpEvent_BusCreated = 0, // PHB has been created
57 XmPciLpEvent_BusError = 1, // PHB has failed
58 XmPciLpEvent_BusFailed = 2, // Msg to Secondary, Primary failed bus
59 XmPciLpEvent_NodeFailed = 4, // Multi-adapter bridge has failed
60 XmPciLpEvent_NodeRecovered = 5, // Multi-adapter bridge has recovered
61 XmPciLpEvent_BusRecovered = 12, // PHB has been recovered
62 XmPciLpEvent_UnQuiesceBus = 18, // Secondary bus unqiescing
63 XmPciLpEvent_BridgeError = 21, // Bridge Error
64 XmPciLpEvent_SlotInterrupt = 22 // Slot interrupt
65};
66
67struct XmPciLpEvent_BusInterrupt {
68 HvBusNumber busNumber;
69 HvSubBusNumber subBusNumber;
70};
71
72struct XmPciLpEvent_NodeInterrupt {
73 HvBusNumber busNumber;
74 HvSubBusNumber subBusNumber;
75 HvAgentId deviceId;
76};
77
78struct XmPciLpEvent {
79 struct HvLpEvent hvLpEvent;
80
81 union {
82 u64 alignData; // Align on an 8-byte boundary
83
84 struct {
85 u32 fisr;
86 HvBusNumber busNumber;
87 HvSubBusNumber subBusNumber;
88 HvAgentId deviceId;
89 } slotInterrupt;
90
91 struct XmPciLpEvent_BusInterrupt busFailed;
92 struct XmPciLpEvent_BusInterrupt busRecovered;
93 struct XmPciLpEvent_BusInterrupt busCreated;
94
95 struct XmPciLpEvent_NodeInterrupt nodeFailed;
96 struct XmPciLpEvent_NodeInterrupt nodeRecovered;
97
98 } eventData;
99
100};
101
102static void intReceived(struct XmPciLpEvent *eventParm,
103 struct pt_regs *regsParm)
67{ 104{
68 /* Register PCI event handler and open an event path */ 105 int irq;
69 XmPciLpEvent_init(); 106
107 ++Pci_Interrupt_Count;
108
109 switch (eventParm->hvLpEvent.xSubtype) {
110 case XmPciLpEvent_SlotInterrupt:
111 irq = eventParm->hvLpEvent.xCorrelationToken;
112 /* Dispatch the interrupt handlers for this irq */
113 ppc_irq_dispatch_handler(regsParm, irq);
114 HvCallPci_eoi(eventParm->eventData.slotInterrupt.busNumber,
115 eventParm->eventData.slotInterrupt.subBusNumber,
116 eventParm->eventData.slotInterrupt.deviceId);
117 break;
118 /* Ignore error recovery events for now */
119 case XmPciLpEvent_BusCreated:
120 printk(KERN_INFO "intReceived: system bus %d created\n",
121 eventParm->eventData.busCreated.busNumber);
122 break;
123 case XmPciLpEvent_BusError:
124 case XmPciLpEvent_BusFailed:
125 printk(KERN_INFO "intReceived: system bus %d failed\n",
126 eventParm->eventData.busFailed.busNumber);
127 break;
128 case XmPciLpEvent_BusRecovered:
129 case XmPciLpEvent_UnQuiesceBus:
130 printk(KERN_INFO "intReceived: system bus %d recovered\n",
131 eventParm->eventData.busRecovered.busNumber);
132 break;
133 case XmPciLpEvent_NodeFailed:
134 case XmPciLpEvent_BridgeError:
135 printk(KERN_INFO
136 "intReceived: multi-adapter bridge %d/%d/%d failed\n",
137 eventParm->eventData.nodeFailed.busNumber,
138 eventParm->eventData.nodeFailed.subBusNumber,
139 eventParm->eventData.nodeFailed.deviceId);
140 break;
141 case XmPciLpEvent_NodeRecovered:
142 printk(KERN_INFO
143 "intReceived: multi-adapter bridge %d/%d/%d recovered\n",
144 eventParm->eventData.nodeRecovered.busNumber,
145 eventParm->eventData.nodeRecovered.subBusNumber,
146 eventParm->eventData.nodeRecovered.deviceId);
147 break;
148 default:
149 printk(KERN_ERR
150 "intReceived: unrecognized event subtype 0x%x\n",
151 eventParm->hvLpEvent.xSubtype);
152 break;
153 }
154}
155
156static void XmPciLpEvent_handler(struct HvLpEvent *eventParm,
157 struct pt_regs *regsParm)
158{
159#ifdef CONFIG_PCI
160 ++Pci_Event_Count;
161
162 if (eventParm && (eventParm->xType == HvLpEvent_Type_PciIo)) {
163 switch (eventParm->xFlags.xFunction) {
164 case HvLpEvent_Function_Int:
165 intReceived((struct XmPciLpEvent *)eventParm, regsParm);
166 break;
167 case HvLpEvent_Function_Ack:
168 printk(KERN_ERR
169 "XmPciLpEvent_handler: unexpected ack received\n");
170 break;
171 default:
172 printk(KERN_ERR
173 "XmPciLpEvent_handler: unexpected event function %d\n",
174 (int)eventParm->xFlags.xFunction);
175 break;
176 }
177 } else if (eventParm)
178 printk(KERN_ERR
179 "XmPciLpEvent_handler: Unrecognized PCI event type 0x%x\n",
180 (int)eventParm->xType);
181 else
182 printk(KERN_ERR "XmPciLpEvent_handler: NULL event received\n");
183#endif
70} 184}
71 185
72/* 186/*
73 * This is called out of iSeries_scan_slot to allocate an IRQ for an EADS slot 187 * This is called by init_IRQ. set in ppc_md.init_IRQ by iSeries_setup.c
74 * It calculates the irq value for the slot. 188 * It must be called before the bus walk.
75 * Note that subBusNumber is always 0 (at the moment at least).
76 */ 189 */
77int __init iSeries_allocate_IRQ(HvBusNumber busNumber, 190void __init iSeries_init_IRQ(void)
78 HvSubBusNumber subBusNumber, HvAgentId deviceId)
79{ 191{
80 unsigned int realirq, virtirq; 192 /* Register PCI event handler and open an event path */
81 u8 idsel = (deviceId >> 4); 193 int xRc;
82 u8 function = deviceId & 7;
83
84 virtirq = next_virtual_irq++;
85 realirq = ((busNumber - 1) << 6) + ((idsel - 1) << 3) + function;
86 virt_irq_to_real_map[virtirq] = realirq;
87 194
88 irq_desc[virtirq].handler = &iSeries_IRQ_handler; 195 xRc = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo,
89 return virtirq; 196 &XmPciLpEvent_handler);
197 if (xRc == 0) {
198 xRc = HvLpEvent_openPath(HvLpEvent_Type_PciIo, 0);
199 if (xRc != 0)
200 printk(KERN_ERR "iSeries_init_IRQ: open event path "
201 "failed with rc 0x%x\n", xRc);
202 } else
203 printk(KERN_ERR "iSeries_init_IRQ: register handler "
204 "failed with rc 0x%x\n", xRc);
90} 205}
91 206
92#define REAL_IRQ_TO_BUS(irq) ((((irq) >> 6) & 0xff) + 1) 207#define REAL_IRQ_TO_BUS(irq) ((((irq) >> 6) & 0xff) + 1)
93#define REAL_IRQ_TO_IDSEL(irq) ((((irq) >> 3) & 7) + 1) 208#define REAL_IRQ_TO_IDSEL(irq) ((((irq) >> 3) & 7) + 1)
94#define REAL_IRQ_TO_FUNC(irq) ((irq) & 7) 209#define REAL_IRQ_TO_FUNC(irq) ((irq) & 7)
95 210
211/*
212 * This will be called by device drivers (via enable_IRQ)
213 * to enable INTA in the bridge interrupt status register.
214 */
215static void iSeries_enable_IRQ(unsigned int irq)
216{
217 u32 bus, deviceId, function, mask;
218 const u32 subBus = 0;
219 unsigned int rirq = virt_irq_to_real_map[irq];
220
221 /* The IRQ has already been locked by the caller */
222 bus = REAL_IRQ_TO_BUS(rirq);
223 function = REAL_IRQ_TO_FUNC(rirq);
224 deviceId = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function;
225
226 /* Unmask secondary INTA */
227 mask = 0x80000000;
228 HvCallPci_unmaskInterrupts(bus, subBus, deviceId, mask);
229 PPCDBG(PPCDBG_BUSWALK, "iSeries_enable_IRQ 0x%02X.%02X.%02X 0x%04X\n",
230 bus, subBus, deviceId, irq);
231}
232
96/* This is called by iSeries_activate_IRQs */ 233/* This is called by iSeries_activate_IRQs */
97static unsigned int iSeries_startup_IRQ(unsigned int irq) 234static unsigned int iSeries_startup_IRQ(unsigned int irq)
98{ 235{
@@ -131,7 +268,7 @@ void __init iSeries_activate_IRQs()
131 desc->handler->startup(irq); 268 desc->handler->startup(irq);
132 spin_unlock_irqrestore(&desc->lock, flags); 269 spin_unlock_irqrestore(&desc->lock, flags);
133 } 270 }
134 } 271 }
135} 272}
136 273
137/* this is not called anywhere currently */ 274/* this is not called anywhere currently */
@@ -173,29 +310,7 @@ static void iSeries_disable_IRQ(unsigned int irq)
173 mask = 0x80000000; 310 mask = 0x80000000;
174 HvCallPci_maskInterrupts(bus, subBus, deviceId, mask); 311 HvCallPci_maskInterrupts(bus, subBus, deviceId, mask);
175 PPCDBG(PPCDBG_BUSWALK, "iSeries_disable_IRQ 0x%02X.%02X.%02X 0x%04X\n", 312 PPCDBG(PPCDBG_BUSWALK, "iSeries_disable_IRQ 0x%02X.%02X.%02X 0x%04X\n",
176 bus, subBus, deviceId, irq); 313 bus, subBus, deviceId, irq);
177}
178
179/*
180 * This will be called by device drivers (via enable_IRQ)
181 * to enable INTA in the bridge interrupt status register.
182 */
183static void iSeries_enable_IRQ(unsigned int irq)
184{
185 u32 bus, deviceId, function, mask;
186 const u32 subBus = 0;
187 unsigned int rirq = virt_irq_to_real_map[irq];
188
189 /* The IRQ has already been locked by the caller */
190 bus = REAL_IRQ_TO_BUS(rirq);
191 function = REAL_IRQ_TO_FUNC(rirq);
192 deviceId = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function;
193
194 /* Unmask secondary INTA */
195 mask = 0x80000000;
196 HvCallPci_unmaskInterrupts(bus, subBus, deviceId, mask);
197 PPCDBG(PPCDBG_BUSWALK, "iSeries_enable_IRQ 0x%02X.%02X.%02X 0x%04X\n",
198 bus, subBus, deviceId, irq);
199} 314}
200 315
201/* 316/*
@@ -207,3 +322,32 @@ static void iSeries_enable_IRQ(unsigned int irq)
207static void iSeries_end_IRQ(unsigned int irq) 322static void iSeries_end_IRQ(unsigned int irq)
208{ 323{
209} 324}
325
326static hw_irq_controller iSeries_IRQ_handler = {
327 .typename = "iSeries irq controller",
328 .startup = iSeries_startup_IRQ,
329 .shutdown = iSeries_shutdown_IRQ,
330 .enable = iSeries_enable_IRQ,
331 .disable = iSeries_disable_IRQ,
332 .end = iSeries_end_IRQ
333};
334
335/*
336 * This is called out of iSeries_scan_slot to allocate an IRQ for an EADS slot
337 * It calculates the irq value for the slot.
338 * Note that subBusNumber is always 0 (at the moment at least).
339 */
340int __init iSeries_allocate_IRQ(HvBusNumber busNumber,
341 HvSubBusNumber subBusNumber, HvAgentId deviceId)
342{
343 unsigned int realirq, virtirq;
344 u8 idsel = (deviceId >> 4);
345 u8 function = deviceId & 7;
346
347 virtirq = next_virtual_irq++;
348 realirq = ((busNumber - 1) << 6) + ((idsel - 1) << 3) + function;
349 virt_irq_to_real_map[virtirq] = realirq;
350
351 irq_desc[virtirq].handler = &iSeries_IRQ_handler;
352 return virtirq;
353}
diff --git a/arch/ppc64/kernel/iSeries_pci.c b/arch/ppc64/kernel/iSeries_pci.c
index bd4c2554f1a0..356e4fd9a94f 100644
--- a/arch/ppc64/kernel/iSeries_pci.c
+++ b/arch/ppc64/kernel/iSeries_pci.c
@@ -38,9 +38,7 @@
38#include <asm/iommu.h> 38#include <asm/iommu.h>
39 39
40#include <asm/iSeries/HvCallPci.h> 40#include <asm/iSeries/HvCallPci.h>
41#include <asm/iSeries/HvCallSm.h>
42#include <asm/iSeries/HvCallXm.h> 41#include <asm/iSeries/HvCallXm.h>
43#include <asm/iSeries/LparData.h>
44#include <asm/iSeries/iSeries_irq.h> 42#include <asm/iSeries/iSeries_irq.h>
45#include <asm/iSeries/iSeries_pci.h> 43#include <asm/iSeries/iSeries_pci.h>
46#include <asm/iSeries/mf.h> 44#include <asm/iSeries/mf.h>
@@ -225,10 +223,7 @@ static struct iSeries_Device_Node *build_device_node(HvBusNumber Bus,
225 node->DsaAddr.Dsa.busNumber = Bus; 223 node->DsaAddr.Dsa.busNumber = Bus;
226 node->DsaAddr.Dsa.subBusNumber = SubBus; 224 node->DsaAddr.Dsa.subBusNumber = SubBus;
227 node->DsaAddr.Dsa.deviceId = 0x10; 225 node->DsaAddr.Dsa.deviceId = 0x10;
228 node->AgentId = AgentId;
229 node->DevFn = PCI_DEVFN(ISERIES_ENCODE_DEVICE(AgentId), Function); 226 node->DevFn = PCI_DEVFN(ISERIES_ENCODE_DEVICE(AgentId), Function);
230 node->IoRetry = 0;
231 iSeries_Get_Location_Code(node);
232 return node; 227 return node;
233} 228}
234 229
@@ -302,7 +297,6 @@ void __init iSeries_pci_final_fixup(void)
302{ 297{
303 struct pci_dev *pdev = NULL; 298 struct pci_dev *pdev = NULL;
304 struct iSeries_Device_Node *node; 299 struct iSeries_Device_Node *node;
305 char Buffer[256];
306 int DeviceCount = 0; 300 int DeviceCount = 0;
307 301
308 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n"); 302 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n");
@@ -324,9 +318,7 @@ void __init iSeries_pci_final_fixup(void)
324 "pdev 0x%p <==> DevNode 0x%p\n", 318 "pdev 0x%p <==> DevNode 0x%p\n",
325 pdev, node); 319 pdev, node);
326 allocate_device_bars(pdev); 320 allocate_device_bars(pdev);
327 iSeries_Device_Information(pdev, Buffer, 321 iSeries_Device_Information(pdev, DeviceCount);
328 sizeof(Buffer));
329 printk("%d. %s\n", DeviceCount, Buffer);
330 iommu_devnode_init_iSeries(node); 322 iommu_devnode_init_iSeries(node);
331 } else 323 } else
332 printk("PCI: Device Tree not found for 0x%016lX\n", 324 printk("PCI: Device Tree not found for 0x%016lX\n",
@@ -499,7 +491,6 @@ static int scan_bridge_slot(HvBusNumber Bus,
499 491
500 ++DeviceCount; 492 ++DeviceCount;
501 node = build_device_node(Bus, SubBus, EADsIdSel, Function); 493 node = build_device_node(Bus, SubBus, EADsIdSel, Function);
502 node->Vendor = VendorId;
503 node->Irq = Irq; 494 node->Irq = Irq;
504 node->LogicalSlot = BridgeInfo->logicalSlotNumber; 495 node->LogicalSlot = BridgeInfo->logicalSlotNumber;
505 496
@@ -661,38 +652,34 @@ static struct pci_ops iSeries_pci_ops = {
661 * Check Return Code 652 * Check Return Code
662 * -> On Failure, print and log information. 653 * -> On Failure, print and log information.
663 * Increment Retry Count, if exceeds max, panic partition. 654 * Increment Retry Count, if exceeds max, panic partition.
664 * -> If in retry, print and log success
665 * 655 *
666 * PCI: Device 23.90 ReadL I/O Error( 0): 0x1234 656 * PCI: Device 23.90 ReadL I/O Error( 0): 0x1234
667 * PCI: Device 23.90 ReadL Retry( 1) 657 * PCI: Device 23.90 ReadL Retry( 1)
668 * PCI: Device 23.90 ReadL Retry Successful(1) 658 * PCI: Device 23.90 ReadL Retry Successful(1)
669 */ 659 */
670static int CheckReturnCode(char *TextHdr, struct iSeries_Device_Node *DevNode, 660static int CheckReturnCode(char *TextHdr, struct iSeries_Device_Node *DevNode,
671 u64 ret) 661 int *retry, u64 ret)
672{ 662{
673 if (ret != 0) { 663 if (ret != 0) {
674 ++Pci_Error_Count; 664 ++Pci_Error_Count;
675 ++DevNode->IoRetry; 665 (*retry)++;
676 printk("PCI: %s: Device 0x%04X:%02X I/O Error(%2d): 0x%04X\n", 666 printk("PCI: %s: Device 0x%04X:%02X I/O Error(%2d): 0x%04X\n",
677 TextHdr, DevNode->DsaAddr.Dsa.busNumber, DevNode->DevFn, 667 TextHdr, DevNode->DsaAddr.Dsa.busNumber, DevNode->DevFn,
678 DevNode->IoRetry, (int)ret); 668 *retry, (int)ret);
679 /* 669 /*
680 * Bump the retry and check for retry count exceeded. 670 * Bump the retry and check for retry count exceeded.
681 * If, Exceeded, panic the system. 671 * If, Exceeded, panic the system.
682 */ 672 */
683 if ((DevNode->IoRetry > Pci_Retry_Max) && 673 if (((*retry) > Pci_Retry_Max) &&
684 (Pci_Error_Flag > 0)) { 674 (Pci_Error_Flag > 0)) {
685 mf_display_src(0xB6000103); 675 mf_display_src(0xB6000103);
686 panic_timeout = 0; 676 panic_timeout = 0;
687 panic("PCI: Hardware I/O Error, SRC B6000103, " 677 panic("PCI: Hardware I/O Error, SRC B6000103, "
688 "Automatic Reboot Disabled.\n"); 678 "Automatic Reboot Disabled.\n");
689 } 679 }
690 return -1; /* Retry Try */ 680 return -1; /* Retry Try */
691 } 681 }
692 /* If retry was in progress, log success and rest retry count */ 682 return 0;
693 if (DevNode->IoRetry > 0)
694 DevNode->IoRetry = 0;
695 return 0;
696} 683}
697 684
698/* 685/*
@@ -738,6 +725,7 @@ u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
738{ 725{
739 u64 BarOffset; 726 u64 BarOffset;
740 u64 dsa; 727 u64 dsa;
728 int retry = 0;
741 struct HvCallPci_LoadReturn ret; 729 struct HvCallPci_LoadReturn ret;
742 struct iSeries_Device_Node *DevNode = 730 struct iSeries_Device_Node *DevNode =
743 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 731 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
@@ -757,7 +745,7 @@ u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
757 do { 745 do {
758 ++Pci_Io_Read_Count; 746 ++Pci_Io_Read_Count;
759 HvCall3Ret16(HvCallPciBarLoad8, &ret, dsa, BarOffset, 0); 747 HvCall3Ret16(HvCallPciBarLoad8, &ret, dsa, BarOffset, 0);
760 } while (CheckReturnCode("RDB", DevNode, ret.rc) != 0); 748 } while (CheckReturnCode("RDB", DevNode, &retry, ret.rc) != 0);
761 749
762 return (u8)ret.value; 750 return (u8)ret.value;
763} 751}
@@ -767,6 +755,7 @@ u16 iSeries_Read_Word(const volatile void __iomem *IoAddress)
767{ 755{
768 u64 BarOffset; 756 u64 BarOffset;
769 u64 dsa; 757 u64 dsa;
758 int retry = 0;
770 struct HvCallPci_LoadReturn ret; 759 struct HvCallPci_LoadReturn ret;
771 struct iSeries_Device_Node *DevNode = 760 struct iSeries_Device_Node *DevNode =
772 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 761 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
@@ -787,7 +776,7 @@ u16 iSeries_Read_Word(const volatile void __iomem *IoAddress)
787 ++Pci_Io_Read_Count; 776 ++Pci_Io_Read_Count;
788 HvCall3Ret16(HvCallPciBarLoad16, &ret, dsa, 777 HvCall3Ret16(HvCallPciBarLoad16, &ret, dsa,
789 BarOffset, 0); 778 BarOffset, 0);
790 } while (CheckReturnCode("RDW", DevNode, ret.rc) != 0); 779 } while (CheckReturnCode("RDW", DevNode, &retry, ret.rc) != 0);
791 780
792 return swab16((u16)ret.value); 781 return swab16((u16)ret.value);
793} 782}
@@ -797,6 +786,7 @@ u32 iSeries_Read_Long(const volatile void __iomem *IoAddress)
797{ 786{
798 u64 BarOffset; 787 u64 BarOffset;
799 u64 dsa; 788 u64 dsa;
789 int retry = 0;
800 struct HvCallPci_LoadReturn ret; 790 struct HvCallPci_LoadReturn ret;
801 struct iSeries_Device_Node *DevNode = 791 struct iSeries_Device_Node *DevNode =
802 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 792 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
@@ -817,7 +807,7 @@ u32 iSeries_Read_Long(const volatile void __iomem *IoAddress)
817 ++Pci_Io_Read_Count; 807 ++Pci_Io_Read_Count;
818 HvCall3Ret16(HvCallPciBarLoad32, &ret, dsa, 808 HvCall3Ret16(HvCallPciBarLoad32, &ret, dsa,
819 BarOffset, 0); 809 BarOffset, 0);
820 } while (CheckReturnCode("RDL", DevNode, ret.rc) != 0); 810 } while (CheckReturnCode("RDL", DevNode, &retry, ret.rc) != 0);
821 811
822 return swab32((u32)ret.value); 812 return swab32((u32)ret.value);
823} 813}
@@ -834,6 +824,7 @@ void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress)
834{ 824{
835 u64 BarOffset; 825 u64 BarOffset;
836 u64 dsa; 826 u64 dsa;
827 int retry = 0;
837 u64 rc; 828 u64 rc;
838 struct iSeries_Device_Node *DevNode = 829 struct iSeries_Device_Node *DevNode =
839 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 830 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
@@ -853,7 +844,7 @@ void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress)
853 do { 844 do {
854 ++Pci_Io_Write_Count; 845 ++Pci_Io_Write_Count;
855 rc = HvCall4(HvCallPciBarStore8, dsa, BarOffset, data, 0); 846 rc = HvCall4(HvCallPciBarStore8, dsa, BarOffset, data, 0);
856 } while (CheckReturnCode("WWB", DevNode, rc) != 0); 847 } while (CheckReturnCode("WWB", DevNode, &retry, rc) != 0);
857} 848}
858EXPORT_SYMBOL(iSeries_Write_Byte); 849EXPORT_SYMBOL(iSeries_Write_Byte);
859 850
@@ -861,6 +852,7 @@ void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress)
861{ 852{
862 u64 BarOffset; 853 u64 BarOffset;
863 u64 dsa; 854 u64 dsa;
855 int retry = 0;
864 u64 rc; 856 u64 rc;
865 struct iSeries_Device_Node *DevNode = 857 struct iSeries_Device_Node *DevNode =
866 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 858 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
@@ -880,7 +872,7 @@ void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress)
880 do { 872 do {
881 ++Pci_Io_Write_Count; 873 ++Pci_Io_Write_Count;
882 rc = HvCall4(HvCallPciBarStore16, dsa, BarOffset, swab16(data), 0); 874 rc = HvCall4(HvCallPciBarStore16, dsa, BarOffset, swab16(data), 0);
883 } while (CheckReturnCode("WWW", DevNode, rc) != 0); 875 } while (CheckReturnCode("WWW", DevNode, &retry, rc) != 0);
884} 876}
885EXPORT_SYMBOL(iSeries_Write_Word); 877EXPORT_SYMBOL(iSeries_Write_Word);
886 878
@@ -888,6 +880,7 @@ void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress)
888{ 880{
889 u64 BarOffset; 881 u64 BarOffset;
890 u64 dsa; 882 u64 dsa;
883 int retry = 0;
891 u64 rc; 884 u64 rc;
892 struct iSeries_Device_Node *DevNode = 885 struct iSeries_Device_Node *DevNode =
893 xlate_iomm_address(IoAddress, &dsa, &BarOffset); 886 xlate_iomm_address(IoAddress, &dsa, &BarOffset);
@@ -907,6 +900,6 @@ void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress)
907 do { 900 do {
908 ++Pci_Io_Write_Count; 901 ++Pci_Io_Write_Count;
909 rc = HvCall4(HvCallPciBarStore32, dsa, BarOffset, swab32(data), 0); 902 rc = HvCall4(HvCallPciBarStore32, dsa, BarOffset, swab32(data), 0);
910 } while (CheckReturnCode("WWL", DevNode, rc) != 0); 903 } while (CheckReturnCode("WWL", DevNode, &retry, rc) != 0);
911} 904}
912EXPORT_SYMBOL(iSeries_Write_Long); 905EXPORT_SYMBOL(iSeries_Write_Long);
diff --git a/arch/ppc64/kernel/iSeries_pci_reset.c b/arch/ppc64/kernel/iSeries_pci_reset.c
deleted file mode 100644
index 0f785e4584f7..000000000000
--- a/arch/ppc64/kernel/iSeries_pci_reset.c
+++ /dev/null
@@ -1,104 +0,0 @@
1#define PCIFR(...)
2/************************************************************************/
3/* File iSeries_pci_reset.c created by Allan Trautman on Mar 21 2001. */
4/************************************************************************/
5/* This code supports the pci interface on the IBM iSeries systems. */
6/* Copyright (C) 20yy <Allan H Trautman> <IBM Corp> */
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: */
20/* Free Software Foundation, Inc., */
21/* 59 Temple Place, Suite 330, */
22/* Boston, MA 02111-1307 USA */
23/************************************************************************/
24/* Change Activity: */
25/* Created, March 20, 2001 */
26/* April 30, 2001, Added return codes on functions. */
27/* September 10, 2001, Ported to ppc64. */
28/* End Change Activity */
29/************************************************************************/
30#include <linux/kernel.h>
31#include <linux/init.h>
32#include <linux/module.h>
33#include <linux/pci.h>
34#include <linux/irq.h>
35#include <linux/delay.h>
36
37#include <asm/io.h>
38#include <asm/iSeries/HvCallPci.h>
39#include <asm/iSeries/HvTypes.h>
40#include <asm/iSeries/mf.h>
41#include <asm/pci.h>
42
43#include <asm/iSeries/iSeries_pci.h>
44#include "pci.h"
45
46/*
47 * Interface to toggle the reset line
48 * Time is in .1 seconds, need for seconds.
49 */
50int iSeries_Device_ToggleReset(struct pci_dev *PciDev, int AssertTime,
51 int DelayTime)
52{
53 unsigned int AssertDelay, WaitDelay;
54 struct iSeries_Device_Node *DeviceNode =
55 (struct iSeries_Device_Node *)PciDev->sysdata;
56
57 if (DeviceNode == NULL) {
58 printk("PCI: Pci Reset Failed, Device Node not found for pci_dev %p\n",
59 PciDev);
60 return -1;
61 }
62 /*
63 * Set defaults, Assert is .5 second, Wait is 3 seconds.
64 */
65 if (AssertTime == 0)
66 AssertDelay = 500;
67 else
68 AssertDelay = AssertTime * 100;
69
70 if (DelayTime == 0)
71 WaitDelay = 3000;
72 else
73 WaitDelay = DelayTime * 100;
74
75 /*
76 * Assert reset
77 */
78 DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode),
79 0x00, DeviceNode->AgentId, 1);
80 if (DeviceNode->ReturnCode == 0) {
81 msleep(AssertDelay); /* Sleep for the time */
82 DeviceNode->ReturnCode =
83 HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode),
84 0x00, DeviceNode->AgentId, 0);
85
86 /*
87 * Wait for device to reset
88 */
89 msleep(WaitDelay);
90 }
91 if (DeviceNode->ReturnCode == 0)
92 PCIFR("Slot 0x%04X.%02 Reset\n", ISERIES_BUS(DeviceNode),
93 DeviceNode->AgentId);
94 else {
95 printk("PCI: Slot 0x%04X.%02X Reset Failed, RCode: %04X\n",
96 ISERIES_BUS(DeviceNode), DeviceNode->AgentId,
97 DeviceNode->ReturnCode);
98 PCIFR("Slot 0x%04X.%02X Reset Failed, RCode: %04X\n",
99 ISERIES_BUS(DeviceNode), DeviceNode->AgentId,
100 DeviceNode->ReturnCode);
101 }
102 return DeviceNode->ReturnCode;
103}
104EXPORT_SYMBOL(iSeries_Device_ToggleReset);
diff --git a/arch/ppc64/kernel/iSeries_proc.c b/arch/ppc64/kernel/iSeries_proc.c
index 0cc58ddf48de..356bd9931fcc 100644
--- a/arch/ppc64/kernel/iSeries_proc.c
+++ b/arch/ppc64/kernel/iSeries_proc.c
@@ -28,8 +28,7 @@
28#include <asm/iSeries/ItLpQueue.h> 28#include <asm/iSeries/ItLpQueue.h>
29#include <asm/iSeries/HvCallXm.h> 29#include <asm/iSeries/HvCallXm.h>
30#include <asm/iSeries/IoHriMainStore.h> 30#include <asm/iSeries/IoHriMainStore.h>
31#include <asm/iSeries/LparData.h> 31#include <asm/iSeries/IoHriProcessorVpd.h>
32#include <asm/iSeries/iSeries_proc.h>
33 32
34static int __init iseries_proc_create(void) 33static int __init iseries_proc_create(void)
35{ 34{
diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c
index da20120f2261..b31962436fe3 100644
--- a/arch/ppc64/kernel/iSeries_setup.c
+++ b/arch/ppc64/kernel/iSeries_setup.c
@@ -47,7 +47,7 @@
47#include <asm/paca.h> 47#include <asm/paca.h>
48#include <asm/cache.h> 48#include <asm/cache.h>
49#include <asm/sections.h> 49#include <asm/sections.h>
50#include <asm/iSeries/LparData.h> 50#include <asm/abs_addr.h>
51#include <asm/iSeries/HvCallHpt.h> 51#include <asm/iSeries/HvCallHpt.h>
52#include <asm/iSeries/HvLpConfig.h> 52#include <asm/iSeries/HvLpConfig.h>
53#include <asm/iSeries/HvCallEvent.h> 53#include <asm/iSeries/HvCallEvent.h>
@@ -55,10 +55,12 @@
55#include <asm/iSeries/HvCallXm.h> 55#include <asm/iSeries/HvCallXm.h>
56#include <asm/iSeries/ItLpQueue.h> 56#include <asm/iSeries/ItLpQueue.h>
57#include <asm/iSeries/IoHriMainStore.h> 57#include <asm/iSeries/IoHriMainStore.h>
58#include <asm/iSeries/iSeries_proc.h>
59#include <asm/iSeries/mf.h> 58#include <asm/iSeries/mf.h>
60#include <asm/iSeries/HvLpEvent.h> 59#include <asm/iSeries/HvLpEvent.h>
61#include <asm/iSeries/iSeries_irq.h> 60#include <asm/iSeries/iSeries_irq.h>
61#include <asm/iSeries/IoHriProcessorVpd.h>
62#include <asm/iSeries/ItVpdAreas.h>
63#include <asm/iSeries/LparMap.h>
62 64
63extern void hvlog(char *fmt, ...); 65extern void hvlog(char *fmt, ...);
64 66
@@ -74,7 +76,11 @@ extern void ppcdbg_initialize(void);
74static void build_iSeries_Memory_Map(void); 76static void build_iSeries_Memory_Map(void);
75static void setup_iSeries_cache_sizes(void); 77static void setup_iSeries_cache_sizes(void);
76static void iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr); 78static void iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr);
79#ifdef CONFIG_PCI
77extern void iSeries_pci_final_fixup(void); 80extern void iSeries_pci_final_fixup(void);
81#else
82static void iSeries_pci_final_fixup(void) { }
83#endif
78 84
79/* Global Variables */ 85/* Global Variables */
80static unsigned long procFreqHz; 86static unsigned long procFreqHz;
@@ -852,6 +858,32 @@ static int __init iSeries_src_init(void)
852 858
853late_initcall(iSeries_src_init); 859late_initcall(iSeries_src_init);
854 860
861static int set_spread_lpevents(char *str)
862{
863 unsigned long i;
864 unsigned long val = simple_strtoul(str, NULL, 0);
865
866 /*
867 * The parameter is the number of processors to share in processing
868 * lp events.
869 */
870 if (( val > 0) && (val <= NR_CPUS)) {
871 for (i = 1; i < val; ++i)
872 paca[i].lpqueue_ptr = paca[0].lpqueue_ptr;
873
874 printk("lpevent processing spread over %ld processors\n", val);
875 } else {
876 printk("invalid spread_lpevents %ld\n", val);
877 }
878
879 return 1;
880}
881__setup("spread_lpevents=", set_spread_lpevents);
882
883#ifndef CONFIG_PCI
884void __init iSeries_init_IRQ(void) { }
885#endif
886
855void __init iSeries_early_setup(void) 887void __init iSeries_early_setup(void)
856{ 888{
857 iSeries_fixup_klimit(); 889 iSeries_fixup_klimit();
diff --git a/arch/ppc64/kernel/iSeries_smp.c b/arch/ppc64/kernel/iSeries_smp.c
index ba1f084d5462..f74386e31638 100644
--- a/arch/ppc64/kernel/iSeries_smp.c
+++ b/arch/ppc64/kernel/iSeries_smp.c
@@ -38,9 +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/LparData.h>
42#include <asm/iSeries/HvCall.h> 41#include <asm/iSeries/HvCall.h>
43#include <asm/iSeries/HvCallCfg.h>
44#include <asm/time.h> 42#include <asm/time.h>
45#include <asm/ppcdebug.h> 43#include <asm/ppcdebug.h>
46#include <asm/machdep.h> 44#include <asm/machdep.h>
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index 6abc621d3ba0..bdf13b4dc1c8 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -42,6 +42,11 @@ static int (*idle_loop)(void);
42static unsigned long maxYieldTime = 0; 42static unsigned long maxYieldTime = 0;
43static unsigned long minYieldTime = 0xffffffffffffffffUL; 43static unsigned long minYieldTime = 0xffffffffffffffffUL;
44 44
45static inline void process_iSeries_events(void)
46{
47 asm volatile ("li 0,0x5555; sc" : : : "r0", "r3");
48}
49
45static void yield_shared_processor(void) 50static void yield_shared_processor(void)
46{ 51{
47 unsigned long tb; 52 unsigned long tb;
@@ -75,13 +80,9 @@ static int iSeries_idle(void)
75{ 80{
76 struct paca_struct *lpaca; 81 struct paca_struct *lpaca;
77 long oldval; 82 long oldval;
78 unsigned long CTRL;
79 83
80 /* ensure iSeries run light will be out when idle */ 84 /* ensure iSeries run light will be out when idle */
81 clear_thread_flag(TIF_RUN_LIGHT); 85 ppc64_runlatch_off();
82 CTRL = mfspr(CTRLF);
83 CTRL &= ~RUNLATCH;
84 mtspr(CTRLT, CTRL);
85 86
86 lpaca = get_paca(); 87 lpaca = get_paca();
87 88
@@ -111,7 +112,9 @@ static int iSeries_idle(void)
111 } 112 }
112 } 113 }
113 114
115 ppc64_runlatch_on();
114 schedule(); 116 schedule();
117 ppc64_runlatch_off();
115 } 118 }
116 119
117 return 0; 120 return 0;
@@ -294,7 +297,7 @@ static int native_idle(void)
294 if (need_resched()) 297 if (need_resched())
295 schedule(); 298 schedule();
296 299
297 if (cpu_is_offline(_smp_processor_id()) && 300 if (cpu_is_offline(raw_smp_processor_id()) &&
298 system_state == SYSTEM_RUNNING) 301 system_state == SYSTEM_RUNNING)
299 cpu_die(); 302 cpu_die();
300 } 303 }
diff --git a/arch/ppc64/kernel/iommu.c b/arch/ppc64/kernel/iommu.c
index 344164681d2c..8316426ccaf6 100644
--- a/arch/ppc64/kernel/iommu.c
+++ b/arch/ppc64/kernel/iommu.c
@@ -423,6 +423,9 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl)
423 tbl->it_largehint = tbl->it_halfpoint; 423 tbl->it_largehint = tbl->it_halfpoint;
424 spin_lock_init(&tbl->it_lock); 424 spin_lock_init(&tbl->it_lock);
425 425
426 /* Clear the hardware table in case firmware left allocations in it */
427 ppc_md.tce_free(tbl, tbl->it_offset, tbl->it_size);
428
426 if (!welcomed) { 429 if (!welcomed) {
427 printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n", 430 printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
428 novmerge ? "disabled" : "enabled"); 431 novmerge ? "disabled" : "enabled");
diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c
index 4fd7f203c1e3..d860467b8f09 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/LparData.h> 55#include <asm/iSeries/ItLpQueue.h>
56#include <asm/machdep.h> 56#include <asm/machdep.h>
57#include <asm/paca.h> 57#include <asm/paca.h>
58 58
diff --git a/arch/ppc64/kernel/kprobes.c b/arch/ppc64/kernel/kprobes.c
index 103daaf73573..e950a2058a19 100644
--- a/arch/ppc64/kernel/kprobes.c
+++ b/arch/ppc64/kernel/kprobes.c
@@ -45,12 +45,17 @@ static struct pt_regs jprobe_saved_regs;
45 45
46int arch_prepare_kprobe(struct kprobe *p) 46int arch_prepare_kprobe(struct kprobe *p)
47{ 47{
48 int ret = 0;
48 kprobe_opcode_t insn = *p->addr; 49 kprobe_opcode_t insn = *p->addr;
49 50
50 if (IS_MTMSRD(insn) || IS_RFID(insn)) 51 if ((unsigned long)p->addr & 0x03) {
51 /* cannot put bp on RFID/MTMSRD */ 52 printk("Attempt to register kprobe at an unaligned address\n");
52 return 1; 53 ret = -EINVAL;
53 return 0; 54 } else if (IS_MTMSRD(insn) || IS_RFID(insn)) {
55 printk("Cannot register a kprobe on rfid or mtmsrd\n");
56 ret = -EINVAL;
57 }
58 return ret;
54} 59}
55 60
56void arch_copy_kprobe(struct kprobe *p) 61void arch_copy_kprobe(struct kprobe *p)
@@ -172,8 +177,6 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs)
172 ret = emulate_step(regs, p->ainsn.insn[0]); 177 ret = emulate_step(regs, p->ainsn.insn[0]);
173 if (ret == 0) 178 if (ret == 0)
174 regs->nip = (unsigned long)p->addr + 4; 179 regs->nip = (unsigned long)p->addr + 4;
175
176 regs->msr &= ~MSR_SE;
177} 180}
178 181
179static inline int post_kprobe_handler(struct pt_regs *regs) 182static inline int post_kprobe_handler(struct pt_regs *regs)
@@ -210,6 +213,7 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
210 213
211 if (kprobe_status & KPROBE_HIT_SS) { 214 if (kprobe_status & KPROBE_HIT_SS) {
212 resume_execution(current_kprobe, regs); 215 resume_execution(current_kprobe, regs);
216 regs->msr &= ~MSR_SE;
213 regs->msr |= kprobe_saved_msr; 217 regs->msr |= kprobe_saved_msr;
214 218
215 unlock_kprobes(); 219 unlock_kprobes();
@@ -233,8 +237,6 @@ int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val,
233 */ 237 */
234 preempt_disable(); 238 preempt_disable();
235 switch (val) { 239 switch (val) {
236 case DIE_IABR_MATCH:
237 case DIE_DABR_MATCH:
238 case DIE_BPT: 240 case DIE_BPT:
239 if (kprobe_handler(args->regs)) 241 if (kprobe_handler(args->regs))
240 ret = NOTIFY_STOP; 242 ret = NOTIFY_STOP;
diff --git a/arch/ppc64/kernel/lparcfg.c b/arch/ppc64/kernel/lparcfg.c
index a8fd32df848b..387923fcf9b0 100644
--- a/arch/ppc64/kernel/lparcfg.c
+++ b/arch/ppc64/kernel/lparcfg.c
@@ -28,12 +28,12 @@
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/iSeries/HvLpConfig.h> 29#include <asm/iSeries/HvLpConfig.h>
30#include <asm/lppaca.h> 30#include <asm/lppaca.h>
31#include <asm/iSeries/LparData.h>
32#include <asm/hvcall.h> 31#include <asm/hvcall.h>
33#include <asm/cputable.h> 32#include <asm/cputable.h>
34#include <asm/rtas.h> 33#include <asm/rtas.h>
35#include <asm/system.h> 34#include <asm/system.h>
36#include <asm/time.h> 35#include <asm/time.h>
36#include <asm/iSeries/ItExtVpdPanel.h>
37 37
38#define MODULE_VERS "1.6" 38#define MODULE_VERS "1.6"
39#define MODULE_NAME "lparcfg" 39#define MODULE_NAME "lparcfg"
diff --git a/arch/ppc64/kernel/mf.c b/arch/ppc64/kernel/mf.c
index 1bd52ece497c..d98bebf7042f 100644
--- a/arch/ppc64/kernel/mf.c
+++ b/arch/ppc64/kernel/mf.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * mf.c 2 * mf.c
3 * Copyright (C) 2001 Troy D. Armstrong IBM Corporation 3 * Copyright (C) 2001 Troy D. Armstrong IBM Corporation
4 * Copyright (C) 2004 Stephen Rothwell IBM Corporation 4 * Copyright (C) 2004-2005 Stephen Rothwell IBM Corporation
5 * 5 *
6 * This modules exists as an interface between a Linux secondary partition 6 * This modules exists as an interface between a Linux secondary partition
7 * running on an iSeries and the primary partition's Virtual Service 7 * running on an iSeries and the primary partition's Virtual Service
@@ -36,10 +36,11 @@
36 36
37#include <asm/time.h> 37#include <asm/time.h>
38#include <asm/uaccess.h> 38#include <asm/uaccess.h>
39#include <asm/paca.h>
39#include <asm/iSeries/vio.h> 40#include <asm/iSeries/vio.h>
40#include <asm/iSeries/mf.h> 41#include <asm/iSeries/mf.h>
41#include <asm/iSeries/HvLpConfig.h> 42#include <asm/iSeries/HvLpConfig.h>
42#include <asm/iSeries/ItSpCommArea.h> 43#include <asm/iSeries/ItLpQueue.h>
43 44
44/* 45/*
45 * This is the structure layout for the Machine Facilites LPAR event 46 * This is the structure layout for the Machine Facilites LPAR event
@@ -696,36 +697,23 @@ static void get_rtc_time_complete(void *token, struct ce_msg_data *ce_msg)
696 complete(&rtc->com); 697 complete(&rtc->com);
697} 698}
698 699
699int mf_get_rtc(struct rtc_time *tm) 700static int rtc_set_tm(int rc, u8 *ce_msg, struct rtc_time *tm)
700{ 701{
701 struct ce_msg_comp_data ce_complete;
702 struct rtc_time_data rtc_data;
703 int rc;
704
705 memset(&ce_complete, 0, sizeof(ce_complete));
706 memset(&rtc_data, 0, sizeof(rtc_data));
707 init_completion(&rtc_data.com);
708 ce_complete.handler = &get_rtc_time_complete;
709 ce_complete.token = &rtc_data;
710 rc = signal_ce_msg_simple(0x40, &ce_complete);
711 if (rc)
712 return rc;
713 wait_for_completion(&rtc_data.com);
714 tm->tm_wday = 0; 702 tm->tm_wday = 0;
715 tm->tm_yday = 0; 703 tm->tm_yday = 0;
716 tm->tm_isdst = 0; 704 tm->tm_isdst = 0;
717 if (rtc_data.rc) { 705 if (rc) {
718 tm->tm_sec = 0; 706 tm->tm_sec = 0;
719 tm->tm_min = 0; 707 tm->tm_min = 0;
720 tm->tm_hour = 0; 708 tm->tm_hour = 0;
721 tm->tm_mday = 15; 709 tm->tm_mday = 15;
722 tm->tm_mon = 5; 710 tm->tm_mon = 5;
723 tm->tm_year = 52; 711 tm->tm_year = 52;
724 return rtc_data.rc; 712 return rc;
725 } 713 }
726 714
727 if ((rtc_data.ce_msg.ce_msg[2] == 0xa9) || 715 if ((ce_msg[2] == 0xa9) ||
728 (rtc_data.ce_msg.ce_msg[2] == 0xaf)) { 716 (ce_msg[2] == 0xaf)) {
729 /* TOD clock is not set */ 717 /* TOD clock is not set */
730 tm->tm_sec = 1; 718 tm->tm_sec = 1;
731 tm->tm_min = 1; 719 tm->tm_min = 1;
@@ -736,7 +724,6 @@ int mf_get_rtc(struct rtc_time *tm)
736 mf_set_rtc(tm); 724 mf_set_rtc(tm);
737 } 725 }
738 { 726 {
739 u8 *ce_msg = rtc_data.ce_msg.ce_msg;
740 u8 year = ce_msg[5]; 727 u8 year = ce_msg[5];
741 u8 sec = ce_msg[6]; 728 u8 sec = ce_msg[6];
742 u8 min = ce_msg[7]; 729 u8 min = ce_msg[7];
@@ -765,6 +752,63 @@ int mf_get_rtc(struct rtc_time *tm)
765 return 0; 752 return 0;
766} 753}
767 754
755int mf_get_rtc(struct rtc_time *tm)
756{
757 struct ce_msg_comp_data ce_complete;
758 struct rtc_time_data rtc_data;
759 int rc;
760
761 memset(&ce_complete, 0, sizeof(ce_complete));
762 memset(&rtc_data, 0, sizeof(rtc_data));
763 init_completion(&rtc_data.com);
764 ce_complete.handler = &get_rtc_time_complete;
765 ce_complete.token = &rtc_data;
766 rc = signal_ce_msg_simple(0x40, &ce_complete);
767 if (rc)
768 return rc;
769 wait_for_completion(&rtc_data.com);
770 return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm);
771}
772
773struct boot_rtc_time_data {
774 int busy;
775 struct ce_msg_data ce_msg;
776 int rc;
777};
778
779static void get_boot_rtc_time_complete(void *token, struct ce_msg_data *ce_msg)
780{
781 struct boot_rtc_time_data *rtc = token;
782
783 memcpy(&rtc->ce_msg, ce_msg, sizeof(rtc->ce_msg));
784 rtc->rc = 0;
785 rtc->busy = 0;
786}
787
788int mf_get_boot_rtc(struct rtc_time *tm)
789{
790 struct ce_msg_comp_data ce_complete;
791 struct boot_rtc_time_data rtc_data;
792 int rc;
793
794 memset(&ce_complete, 0, sizeof(ce_complete));
795 memset(&rtc_data, 0, sizeof(rtc_data));
796 rtc_data.busy = 1;
797 ce_complete.handler = &get_boot_rtc_time_complete;
798 ce_complete.token = &rtc_data;
799 rc = signal_ce_msg_simple(0x40, &ce_complete);
800 if (rc)
801 return rc;
802 /* We need to poll here as we are not yet taking interrupts */
803 while (rtc_data.busy) {
804 extern unsigned long lpevent_count;
805 struct ItLpQueue *lpq = get_paca()->lpqueue_ptr;
806 if (lpq && ItLpQueue_isLpIntPending(lpq))
807 lpevent_count += ItLpQueue_process(lpq, NULL);
808 }
809 return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm);
810}
811
768int mf_set_rtc(struct rtc_time *tm) 812int mf_set_rtc(struct rtc_time *tm)
769{ 813{
770 char ce_time[12]; 814 char ce_time[12];
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index b944717c1dbd..e3c73b3425dc 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -792,7 +792,7 @@ _GLOBAL(sys_call_table32)
792 .llong .compat_sys_newstat 792 .llong .compat_sys_newstat
793 .llong .compat_sys_newlstat 793 .llong .compat_sys_newlstat
794 .llong .compat_sys_newfstat 794 .llong .compat_sys_newfstat
795 .llong .sys_uname 795 .llong .sys32_uname
796 .llong .sys_ni_syscall /* 110 old iopl syscall */ 796 .llong .sys_ni_syscall /* 110 old iopl syscall */
797 .llong .sys_vhangup 797 .llong .sys_vhangup
798 .llong .sys_ni_syscall /* old idle syscall */ 798 .llong .sys_ni_syscall /* old idle syscall */
diff --git a/arch/ppc64/kernel/of_device.c b/arch/ppc64/kernel/of_device.c
index f4c825a69fa0..66bd5ab7c25a 100644
--- a/arch/ppc64/kernel/of_device.c
+++ b/arch/ppc64/kernel/of_device.c
@@ -161,7 +161,7 @@ void of_unregister_driver(struct of_platform_driver *drv)
161} 161}
162 162
163 163
164static ssize_t dev_show_devspec(struct device *dev, char *buf) 164static ssize_t dev_show_devspec(struct device *dev, struct device_attribute *attr, char *buf)
165{ 165{
166 struct of_device *ofdev; 166 struct of_device *ofdev;
167 167
diff --git a/arch/ppc64/kernel/pSeries_reconfig.c b/arch/ppc64/kernel/pSeries_reconfig.c
index cb5443f2e49b..dc2a69d412a2 100644
--- a/arch/ppc64/kernel/pSeries_reconfig.c
+++ b/arch/ppc64/kernel/pSeries_reconfig.c
@@ -47,14 +47,6 @@ static void remove_node_proc_entries(struct device_node *np)
47 remove_proc_entry(pp->name, np->pde); 47 remove_proc_entry(pp->name, np->pde);
48 pp = pp->next; 48 pp = pp->next;
49 } 49 }
50
51 /* Assuming that symlinks have the same parent directory as
52 * np->pde.
53 */
54 if (np->name_link)
55 remove_proc_entry(np->name_link->name, parent->pde);
56 if (np->addr_link)
57 remove_proc_entry(np->addr_link->name, parent->pde);
58 if (np->pde) 50 if (np->pde)
59 remove_proc_entry(np->pde->name, parent->pde); 51 remove_proc_entry(np->pde->name, parent->pde);
60} 52}
diff --git a/arch/ppc64/kernel/pSeries_smp.c b/arch/ppc64/kernel/pSeries_smp.c
index fbad349ec58c..4203bd020c82 100644
--- a/arch/ppc64/kernel/pSeries_smp.c
+++ b/arch/ppc64/kernel/pSeries_smp.c
@@ -375,7 +375,7 @@ static int smp_pSeries_cpu_bootable(unsigned int nr)
375 * cpus are assumed to be secondary threads. 375 * cpus are assumed to be secondary threads.
376 */ 376 */
377 if (system_state < SYSTEM_RUNNING && 377 if (system_state < SYSTEM_RUNNING &&
378 cur_cpu_spec->cpu_features & CPU_FTR_SMT && 378 cpu_has_feature(CPU_FTR_SMT) &&
379 !smt_enabled_at_boot && nr % 2 != 0) 379 !smt_enabled_at_boot && nr % 2 != 0)
380 return 0; 380 return 0;
381 381
@@ -419,8 +419,8 @@ void __init smp_init_pSeries(void)
419#endif 419#endif
420 420
421 /* Mark threads which are still spinning in hold loops. */ 421 /* Mark threads which are still spinning in hold loops. */
422 if (cur_cpu_spec->cpu_features & CPU_FTR_SMT) 422 if (cpu_has_feature(CPU_FTR_SMT)) {
423 for_each_present_cpu(i) { 423 for_each_present_cpu(i) {
424 if (i % 2 == 0) 424 if (i % 2 == 0)
425 /* 425 /*
426 * Even-numbered logical cpus correspond to 426 * Even-numbered logical cpus correspond to
@@ -428,8 +428,9 @@ void __init smp_init_pSeries(void)
428 */ 428 */
429 cpu_set(i, of_spin_map); 429 cpu_set(i, of_spin_map);
430 } 430 }
431 else 431 } else {
432 of_spin_map = cpu_present_map; 432 of_spin_map = cpu_present_map;
433 }
433 434
434 cpu_clear(boot_cpuid, of_spin_map); 435 cpu_clear(boot_cpuid, of_spin_map);
435 436
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index d786d4b6af0b..2bf0513f3eca 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -507,7 +507,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
507} 507}
508 508
509#ifdef CONFIG_PPC_MULTIPLATFORM 509#ifdef CONFIG_PPC_MULTIPLATFORM
510static ssize_t pci_show_devspec(struct device *dev, char *buf) 510static ssize_t pci_show_devspec(struct device *dev, struct device_attribute *attr, char *buf)
511{ 511{
512 struct pci_dev *pdev; 512 struct pci_dev *pdev;
513 struct device_node *np; 513 struct device_node *np;
diff --git a/arch/ppc64/kernel/pmac_smp.c b/arch/ppc64/kernel/pmac_smp.c
index c27588ede2fe..a23de37227bf 100644
--- a/arch/ppc64/kernel/pmac_smp.c
+++ b/arch/ppc64/kernel/pmac_smp.c
@@ -68,6 +68,7 @@ extern struct smp_ops_t *smp_ops;
68 68
69static void (*pmac_tb_freeze)(int freeze); 69static void (*pmac_tb_freeze)(int freeze);
70static struct device_node *pmac_tb_clock_chip_host; 70static struct device_node *pmac_tb_clock_chip_host;
71static u8 pmac_tb_pulsar_addr;
71static DEFINE_SPINLOCK(timebase_lock); 72static DEFINE_SPINLOCK(timebase_lock);
72static unsigned long timebase; 73static unsigned long timebase;
73 74
@@ -106,12 +107,9 @@ static void smp_core99_pulsar_tb_freeze(int freeze)
106 u8 data; 107 u8 data;
107 int rc; 108 int rc;
108 109
109 /* Strangely, the device-tree says address is 0xd2, but darwin
110 * accesses 0xd0 ...
111 */
112 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_combined); 110 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_combined);
113 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, 111 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host,
114 0xd4 | pmac_low_i2c_read, 112 pmac_tb_pulsar_addr | pmac_low_i2c_read,
115 0x2e, &data, 1); 113 0x2e, &data, 1);
116 if (rc != 0) 114 if (rc != 0)
117 goto bail; 115 goto bail;
@@ -120,7 +118,7 @@ static void smp_core99_pulsar_tb_freeze(int freeze)
120 118
121 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub); 119 pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub);
122 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, 120 rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host,
123 0xd4 | pmac_low_i2c_write, 121 pmac_tb_pulsar_addr | pmac_low_i2c_write,
124 0x2e, &data, 1); 122 0x2e, &data, 1);
125 bail: 123 bail:
126 if (rc != 0) { 124 if (rc != 0) {
@@ -185,6 +183,12 @@ static int __init smp_core99_probe(void)
185 if (ncpus <= 1) 183 if (ncpus <= 1)
186 return 1; 184 return 1;
187 185
186 /* HW sync only on these platforms */
187 if (!machine_is_compatible("PowerMac7,2") &&
188 !machine_is_compatible("PowerMac7,3") &&
189 !machine_is_compatible("RackMac3,1"))
190 goto nohwsync;
191
188 /* Look for the clock chip */ 192 /* Look for the clock chip */
189 for (cc = NULL; (cc = of_find_node_by_name(cc, "i2c-hwclock")) != NULL;) { 193 for (cc = NULL; (cc = of_find_node_by_name(cc, "i2c-hwclock")) != NULL;) {
190 struct device_node *p = of_get_parent(cc); 194 struct device_node *p = of_get_parent(cc);
@@ -198,11 +202,18 @@ static int __init smp_core99_probe(void)
198 goto next; 202 goto next;
199 switch (*reg) { 203 switch (*reg) {
200 case 0xd2: 204 case 0xd2:
201 pmac_tb_freeze = smp_core99_cypress_tb_freeze; 205 if (device_is_compatible(cc, "pulsar-legacy-slewing")) {
202 printk(KERN_INFO "Timebase clock is Cypress chip\n"); 206 pmac_tb_freeze = smp_core99_pulsar_tb_freeze;
207 pmac_tb_pulsar_addr = 0xd2;
208 printk(KERN_INFO "Timebase clock is Pulsar chip\n");
209 } else if (device_is_compatible(cc, "cy28508")) {
210 pmac_tb_freeze = smp_core99_cypress_tb_freeze;
211 printk(KERN_INFO "Timebase clock is Cypress chip\n");
212 }
203 break; 213 break;
204 case 0xd4: 214 case 0xd4:
205 pmac_tb_freeze = smp_core99_pulsar_tb_freeze; 215 pmac_tb_freeze = smp_core99_pulsar_tb_freeze;
216 pmac_tb_pulsar_addr = 0xd4;
206 printk(KERN_INFO "Timebase clock is Pulsar chip\n"); 217 printk(KERN_INFO "Timebase clock is Pulsar chip\n");
207 break; 218 break;
208 } 219 }
@@ -210,12 +221,15 @@ static int __init smp_core99_probe(void)
210 pmac_tb_clock_chip_host = p; 221 pmac_tb_clock_chip_host = p;
211 smp_ops->give_timebase = smp_core99_give_timebase; 222 smp_ops->give_timebase = smp_core99_give_timebase;
212 smp_ops->take_timebase = smp_core99_take_timebase; 223 smp_ops->take_timebase = smp_core99_take_timebase;
224 of_node_put(cc);
225 of_node_put(p);
213 break; 226 break;
214 } 227 }
215 next: 228 next:
216 of_node_put(p); 229 of_node_put(p);
217 } 230 }
218 231
232 nohwsync:
219 mpic_request_ipis(); 233 mpic_request_ipis();
220 234
221 return ncpus; 235 return ncpus;
diff --git a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c
index 8b0686122738..aba89554d89d 100644
--- a/arch/ppc64/kernel/process.c
+++ b/arch/ppc64/kernel/process.c
@@ -58,14 +58,6 @@ struct task_struct *last_task_used_math = NULL;
58struct task_struct *last_task_used_altivec = NULL; 58struct task_struct *last_task_used_altivec = NULL;
59#endif 59#endif
60 60
61struct mm_struct ioremap_mm = {
62 .pgd = ioremap_dir,
63 .mm_users = ATOMIC_INIT(2),
64 .mm_count = ATOMIC_INIT(1),
65 .cpu_vm_mask = CPU_MASK_ALL,
66 .page_table_lock = SPIN_LOCK_UNLOCKED,
67};
68
69/* 61/*
70 * Make sure the floating-point register state in the 62 * Make sure the floating-point register state in the
71 * the thread_struct is up to date for task tsk. 63 * the thread_struct is up to date for task tsk.
@@ -378,9 +370,6 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
378 childregs->gpr[1] = sp + sizeof(struct pt_regs); 370 childregs->gpr[1] = sp + sizeof(struct pt_regs);
379 p->thread.regs = NULL; /* no user register state */ 371 p->thread.regs = NULL; /* no user register state */
380 clear_ti_thread_flag(p->thread_info, TIF_32BIT); 372 clear_ti_thread_flag(p->thread_info, TIF_32BIT);
381#ifdef CONFIG_PPC_ISERIES
382 set_ti_thread_flag(p->thread_info, TIF_RUN_LIGHT);
383#endif
384 } else { 373 } else {
385 childregs->gpr[1] = usp; 374 childregs->gpr[1] = usp;
386 p->thread.regs = childregs; 375 p->thread.regs = childregs;
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c
index eb6538b58008..47727a6f7346 100644
--- a/arch/ppc64/kernel/prom.c
+++ b/arch/ppc64/kernel/prom.c
@@ -884,6 +884,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
884{ 884{
885 char *type = get_flat_dt_prop(node, "device_type", NULL); 885 char *type = get_flat_dt_prop(node, "device_type", NULL);
886 u32 *prop; 886 u32 *prop;
887 unsigned long size;
887 888
888 /* We are scanning "cpu" nodes only */ 889 /* We are scanning "cpu" nodes only */
889 if (type == NULL || strcmp(type, "cpu") != 0) 890 if (type == NULL || strcmp(type, "cpu") != 0)
@@ -929,6 +930,17 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
929 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; 930 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
930 } 931 }
931 932
933 /*
934 * Check for an SMT capable CPU and set the CPU feature. We do
935 * this by looking at the size of the ibm,ppc-interrupt-server#s
936 * property
937 */
938 prop = (u32 *)get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s",
939 &size);
940 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT;
941 if (prop && ((size / sizeof(u32)) > 1))
942 cur_cpu_spec->cpu_features |= CPU_FTR_SMT;
943
932 return 0; 944 return 0;
933} 945}
934 946
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c
index 35ec42de962e..b7683abfbe6a 100644
--- a/arch/ppc64/kernel/prom_init.c
+++ b/arch/ppc64/kernel/prom_init.c
@@ -211,13 +211,23 @@ struct {
211 */ 211 */
212#define ADDR(x) (u32) ((unsigned long)(x) - offset) 212#define ADDR(x) (u32) ((unsigned long)(x) - offset)
213 213
214/*
215 * Error results ... some OF calls will return "-1" on error, some
216 * will return 0, some will return either. To simplify, here are
217 * macros to use with any ihandle or phandle return value to check if
218 * it is valid
219 */
220
221#define PROM_ERROR (-1u)
222#define PHANDLE_VALID(p) ((p) != 0 && (p) != PROM_ERROR)
223#define IHANDLE_VALID(i) ((i) != 0 && (i) != PROM_ERROR)
224
225
214/* This is the one and *ONLY* place where we actually call open 226/* This is the one and *ONLY* place where we actually call open
215 * firmware from, since we need to make sure we're running in 32b 227 * firmware from, since we need to make sure we're running in 32b
216 * mode when we do. We switch back to 64b mode upon return. 228 * mode when we do. We switch back to 64b mode upon return.
217 */ 229 */
218 230
219#define PROM_ERROR (-1)
220
221static int __init call_prom(const char *service, int nargs, int nret, ...) 231static int __init call_prom(const char *service, int nargs, int nret, ...)
222{ 232{
223 int i; 233 int i;
@@ -587,14 +597,13 @@ static void __init prom_send_capabilities(void)
587{ 597{
588 unsigned long offset = reloc_offset(); 598 unsigned long offset = reloc_offset();
589 ihandle elfloader; 599 ihandle elfloader;
590 int ret;
591 600
592 elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader")); 601 elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader"));
593 if (elfloader == 0) { 602 if (elfloader == 0) {
594 prom_printf("couldn't open /packages/elf-loader\n"); 603 prom_printf("couldn't open /packages/elf-loader\n");
595 return; 604 return;
596 } 605 }
597 ret = call_prom("call-method", 3, 1, ADDR("process-elf-header"), 606 call_prom("call-method", 3, 1, ADDR("process-elf-header"),
598 elfloader, ADDR(&fake_elf)); 607 elfloader, ADDR(&fake_elf));
599 call_prom("close", 1, 0, elfloader); 608 call_prom("close", 1, 0, elfloader);
600} 609}
@@ -646,7 +655,7 @@ static unsigned long __init alloc_up(unsigned long size, unsigned long align)
646 base = _ALIGN_UP(base + 0x100000, align)) { 655 base = _ALIGN_UP(base + 0x100000, align)) {
647 prom_debug(" trying: 0x%x\n\r", base); 656 prom_debug(" trying: 0x%x\n\r", base);
648 addr = (unsigned long)prom_claim(base, size, 0); 657 addr = (unsigned long)prom_claim(base, size, 0);
649 if ((int)addr != PROM_ERROR) 658 if (addr != PROM_ERROR)
650 break; 659 break;
651 addr = 0; 660 addr = 0;
652 if (align == 0) 661 if (align == 0)
@@ -708,7 +717,7 @@ static unsigned long __init alloc_down(unsigned long size, unsigned long align,
708 for(; base > RELOC(alloc_bottom); base = _ALIGN_DOWN(base - 0x100000, align)) { 717 for(; base > RELOC(alloc_bottom); base = _ALIGN_DOWN(base - 0x100000, align)) {
709 prom_debug(" trying: 0x%x\n\r", base); 718 prom_debug(" trying: 0x%x\n\r", base);
710 addr = (unsigned long)prom_claim(base, size, 0); 719 addr = (unsigned long)prom_claim(base, size, 0);
711 if ((int)addr != PROM_ERROR) 720 if (addr != PROM_ERROR)
712 break; 721 break;
713 addr = 0; 722 addr = 0;
714 } 723 }
@@ -902,18 +911,19 @@ static void __init prom_instantiate_rtas(void)
902{ 911{
903 unsigned long offset = reloc_offset(); 912 unsigned long offset = reloc_offset();
904 struct prom_t *_prom = PTRRELOC(&prom); 913 struct prom_t *_prom = PTRRELOC(&prom);
905 phandle prom_rtas, rtas_node; 914 phandle rtas_node;
915 ihandle rtas_inst;
906 u32 base, entry = 0; 916 u32 base, entry = 0;
907 u32 size = 0; 917 u32 size = 0;
908 918
909 prom_debug("prom_instantiate_rtas: start...\n"); 919 prom_debug("prom_instantiate_rtas: start...\n");
910 920
911 prom_rtas = call_prom("finddevice", 1, 1, ADDR("/rtas")); 921 rtas_node = call_prom("finddevice", 1, 1, ADDR("/rtas"));
912 prom_debug("prom_rtas: %x\n", prom_rtas); 922 prom_debug("rtas_node: %x\n", rtas_node);
913 if (prom_rtas == (phandle) -1) 923 if (!PHANDLE_VALID(rtas_node))
914 return; 924 return;
915 925
916 prom_getprop(prom_rtas, "rtas-size", &size, sizeof(size)); 926 prom_getprop(rtas_node, "rtas-size", &size, sizeof(size));
917 if (size == 0) 927 if (size == 0)
918 return; 928 return;
919 929
@@ -922,14 +932,18 @@ static void __init prom_instantiate_rtas(void)
922 prom_printf("RTAS allocation failed !\n"); 932 prom_printf("RTAS allocation failed !\n");
923 return; 933 return;
924 } 934 }
925 prom_printf("instantiating rtas at 0x%x", base);
926 935
927 rtas_node = call_prom("open", 1, 1, ADDR("/rtas")); 936 rtas_inst = call_prom("open", 1, 1, ADDR("/rtas"));
928 prom_printf("..."); 937 if (!IHANDLE_VALID(rtas_inst)) {
938 prom_printf("opening rtas package failed");
939 return;
940 }
941
942 prom_printf("instantiating rtas at 0x%x ...", base);
929 943
930 if (call_prom("call-method", 3, 2, 944 if (call_prom("call-method", 3, 2,
931 ADDR("instantiate-rtas"), 945 ADDR("instantiate-rtas"),
932 rtas_node, base) != PROM_ERROR) { 946 rtas_inst, base) != PROM_ERROR) {
933 entry = (long)_prom->args.rets[1]; 947 entry = (long)_prom->args.rets[1];
934 } 948 }
935 if (entry == 0) { 949 if (entry == 0) {
@@ -940,8 +954,8 @@ static void __init prom_instantiate_rtas(void)
940 954
941 reserve_mem(base, size); 955 reserve_mem(base, size);
942 956
943 prom_setprop(prom_rtas, "linux,rtas-base", &base, sizeof(base)); 957 prom_setprop(rtas_node, "linux,rtas-base", &base, sizeof(base));
944 prom_setprop(prom_rtas, "linux,rtas-entry", &entry, sizeof(entry)); 958 prom_setprop(rtas_node, "linux,rtas-entry", &entry, sizeof(entry));
945 959
946 prom_debug("rtas base = 0x%x\n", base); 960 prom_debug("rtas base = 0x%x\n", base);
947 prom_debug("rtas entry = 0x%x\n", entry); 961 prom_debug("rtas entry = 0x%x\n", entry);
@@ -1062,7 +1076,7 @@ static void __init prom_initialize_tce_table(void)
1062 1076
1063 prom_printf("opening PHB %s", path); 1077 prom_printf("opening PHB %s", path);
1064 phb_node = call_prom("open", 1, 1, path); 1078 phb_node = call_prom("open", 1, 1, path);
1065 if ( (long)phb_node <= 0) 1079 if (phb_node == 0)
1066 prom_printf("... failed\n"); 1080 prom_printf("... failed\n");
1067 else 1081 else
1068 prom_printf("... done\n"); 1082 prom_printf("... done\n");
@@ -1279,12 +1293,12 @@ static void __init prom_init_client_services(unsigned long pp)
1279 1293
1280 /* get a handle for the stdout device */ 1294 /* get a handle for the stdout device */
1281 _prom->chosen = call_prom("finddevice", 1, 1, ADDR("/chosen")); 1295 _prom->chosen = call_prom("finddevice", 1, 1, ADDR("/chosen"));
1282 if ((long)_prom->chosen <= 0) 1296 if (!PHANDLE_VALID(_prom->chosen))
1283 prom_panic("cannot find chosen"); /* msg won't be printed :( */ 1297 prom_panic("cannot find chosen"); /* msg won't be printed :( */
1284 1298
1285 /* get device tree root */ 1299 /* get device tree root */
1286 _prom->root = call_prom("finddevice", 1, 1, ADDR("/")); 1300 _prom->root = call_prom("finddevice", 1, 1, ADDR("/"));
1287 if ((long)_prom->root <= 0) 1301 if (!PHANDLE_VALID(_prom->root))
1288 prom_panic("cannot find device tree root"); /* msg won't be printed :( */ 1302 prom_panic("cannot find device tree root"); /* msg won't be printed :( */
1289} 1303}
1290 1304
@@ -1356,9 +1370,8 @@ static int __init prom_find_machine_type(void)
1356 } 1370 }
1357 /* Default to pSeries. We need to know if we are running LPAR */ 1371 /* Default to pSeries. We need to know if we are running LPAR */
1358 rtas = call_prom("finddevice", 1, 1, ADDR("/rtas")); 1372 rtas = call_prom("finddevice", 1, 1, ADDR("/rtas"));
1359 if (rtas != (phandle) -1) { 1373 if (PHANDLE_VALID(rtas)) {
1360 unsigned long x; 1374 int x = prom_getproplen(rtas, "ibm,hypertas-functions");
1361 x = prom_getproplen(rtas, "ibm,hypertas-functions");
1362 if (x != PROM_ERROR) { 1375 if (x != PROM_ERROR) {
1363 prom_printf("Hypertas detected, assuming LPAR !\n"); 1376 prom_printf("Hypertas detected, assuming LPAR !\n");
1364 return PLATFORM_PSERIES_LPAR; 1377 return PLATFORM_PSERIES_LPAR;
@@ -1426,12 +1439,13 @@ static void __init prom_check_displays(void)
1426 * leave some room at the end of the path for appending extra 1439 * leave some room at the end of the path for appending extra
1427 * arguments 1440 * arguments
1428 */ 1441 */
1429 if (call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-10) < 0) 1442 if (call_prom("package-to-path", 3, 1, node, path,
1443 PROM_SCRATCH_SIZE-10) == PROM_ERROR)
1430 continue; 1444 continue;
1431 prom_printf("found display : %s, opening ... ", path); 1445 prom_printf("found display : %s, opening ... ", path);
1432 1446
1433 ih = call_prom("open", 1, 1, path); 1447 ih = call_prom("open", 1, 1, path);
1434 if (ih == (ihandle)0 || ih == (ihandle)-1) { 1448 if (ih == 0) {
1435 prom_printf("failed\n"); 1449 prom_printf("failed\n");
1436 continue; 1450 continue;
1437 } 1451 }
@@ -1514,6 +1528,12 @@ static unsigned long __init dt_find_string(char *str)
1514 return 0; 1528 return 0;
1515} 1529}
1516 1530
1531/*
1532 * The Open Firmware 1275 specification states properties must be 31 bytes or
1533 * less, however not all firmwares obey this. Make it 64 bytes to be safe.
1534 */
1535#define MAX_PROPERTY_NAME 64
1536
1517static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start, 1537static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
1518 unsigned long *mem_end) 1538 unsigned long *mem_end)
1519{ 1539{
@@ -1527,10 +1547,12 @@ static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
1527 /* get and store all property names */ 1547 /* get and store all property names */
1528 prev_name = RELOC(""); 1548 prev_name = RELOC("");
1529 for (;;) { 1549 for (;;) {
1530 1550 int rc;
1531 /* 32 is max len of name including nul. */ 1551
1532 namep = make_room(mem_start, mem_end, 32, 1); 1552 /* 64 is max len of name including nul. */
1533 if (call_prom("nextprop", 3, 1, node, prev_name, namep) <= 0) { 1553 namep = make_room(mem_start, mem_end, MAX_PROPERTY_NAME, 1);
1554 rc = call_prom("nextprop", 3, 1, node, prev_name, namep);
1555 if (rc != 1) {
1534 /* No more nodes: unwind alloc */ 1556 /* No more nodes: unwind alloc */
1535 *mem_start = (unsigned long)namep; 1557 *mem_start = (unsigned long)namep;
1536 break; 1558 break;
@@ -1555,18 +1577,12 @@ static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
1555 } 1577 }
1556} 1578}
1557 1579
1558/*
1559 * The Open Firmware 1275 specification states properties must be 31 bytes or
1560 * less, however not all firmwares obey this. Make it 64 bytes to be safe.
1561 */
1562#define MAX_PROPERTY_NAME 64
1563
1564static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start, 1580static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1565 unsigned long *mem_end) 1581 unsigned long *mem_end)
1566{ 1582{
1567 int l, align; 1583 int l, align;
1568 phandle child; 1584 phandle child;
1569 char *namep, *prev_name, *sstart; 1585 char *namep, *prev_name, *sstart, *p, *ep;
1570 unsigned long soff; 1586 unsigned long soff;
1571 unsigned char *valp; 1587 unsigned char *valp;
1572 unsigned long offset = reloc_offset(); 1588 unsigned long offset = reloc_offset();
@@ -1588,6 +1604,14 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1588 call_prom("package-to-path", 3, 1, node, namep, l); 1604 call_prom("package-to-path", 3, 1, node, namep, l);
1589 } 1605 }
1590 namep[l] = '\0'; 1606 namep[l] = '\0';
1607 /* Fixup an Apple bug where they have bogus \0 chars in the
1608 * middle of the path in some properties
1609 */
1610 for (p = namep, ep = namep + l; p < ep; p++)
1611 if (*p == '\0') {
1612 memmove(p, p+1, ep - p);
1613 ep--; l--;
1614 }
1591 *mem_start = _ALIGN(((unsigned long) namep) + strlen(namep) + 1, 4); 1615 *mem_start = _ALIGN(((unsigned long) namep) + strlen(namep) + 1, 4);
1592 } 1616 }
1593 1617
@@ -1599,7 +1623,10 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1599 prev_name = RELOC(""); 1623 prev_name = RELOC("");
1600 sstart = (char *)RELOC(dt_string_start); 1624 sstart = (char *)RELOC(dt_string_start);
1601 for (;;) { 1625 for (;;) {
1602 if (call_prom("nextprop", 3, 1, node, prev_name, pname) <= 0) 1626 int rc;
1627
1628 rc = call_prom("nextprop", 3, 1, node, prev_name, pname);
1629 if (rc != 1)
1603 break; 1630 break;
1604 1631
1605 /* find string offset */ 1632 /* find string offset */
@@ -1615,7 +1642,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1615 l = call_prom("getproplen", 2, 1, node, pname); 1642 l = call_prom("getproplen", 2, 1, node, pname);
1616 1643
1617 /* sanity checks */ 1644 /* sanity checks */
1618 if (l < 0) 1645 if (l == PROM_ERROR)
1619 continue; 1646 continue;
1620 if (l > MAX_PROPERTY_LENGTH) { 1647 if (l > MAX_PROPERTY_LENGTH) {
1621 prom_printf("WARNING: ignoring large property "); 1648 prom_printf("WARNING: ignoring large property ");
@@ -1750,7 +1777,45 @@ static void __init flatten_device_tree(void)
1750 prom_printf("Device tree struct 0x%x -> 0x%x\n", 1777 prom_printf("Device tree struct 0x%x -> 0x%x\n",
1751 RELOC(dt_struct_start), RELOC(dt_struct_end)); 1778 RELOC(dt_struct_start), RELOC(dt_struct_end));
1752 1779
1753 } 1780}
1781
1782
1783static void __init fixup_device_tree(void)
1784{
1785 unsigned long offset = reloc_offset();
1786 phandle u3, i2c, mpic;
1787 u32 u3_rev;
1788 u32 interrupts[2];
1789 u32 parent;
1790
1791 /* Some G5s have a missing interrupt definition, fix it up here */
1792 u3 = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000"));
1793 if (!PHANDLE_VALID(u3))
1794 return;
1795 i2c = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/i2c@f8001000"));
1796 if (!PHANDLE_VALID(i2c))
1797 return;
1798 mpic = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/mpic@f8040000"));
1799 if (!PHANDLE_VALID(mpic))
1800 return;
1801
1802 /* check if proper rev of u3 */
1803 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))
1804 == PROM_ERROR)
1805 return;
1806 if (u3_rev != 0x35)
1807 return;
1808 /* does it need fixup ? */
1809 if (prom_getproplen(i2c, "interrupts") > 0)
1810 return;
1811 /* interrupt on this revision of u3 is number 0 and level */
1812 interrupts[0] = 0;
1813 interrupts[1] = 1;
1814 prom_setprop(i2c, "interrupts", &interrupts, sizeof(interrupts));
1815 parent = (u32)mpic;
1816 prom_setprop(i2c, "interrupt-parent", &parent, sizeof(parent));
1817}
1818
1754 1819
1755static void __init prom_find_boot_cpu(void) 1820static void __init prom_find_boot_cpu(void)
1756{ 1821{
@@ -1844,6 +1909,12 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long
1844 &getprop_rval, sizeof(getprop_rval)); 1909 &getprop_rval, sizeof(getprop_rval));
1845 1910
1846 /* 1911 /*
1912 * On pSeries, inform the firmware about our capabilities
1913 */
1914 if (RELOC(of_platform) & PLATFORM_PSERIES)
1915 prom_send_capabilities();
1916
1917 /*
1847 * On pSeries, copy the CPU hold code 1918 * On pSeries, copy the CPU hold code
1848 */ 1919 */
1849 if (RELOC(of_platform) & PLATFORM_PSERIES) 1920 if (RELOC(of_platform) & PLATFORM_PSERIES)
@@ -1920,6 +1991,11 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long
1920 } 1991 }
1921 1992
1922 /* 1993 /*
1994 * Fixup any known bugs in the device-tree
1995 */
1996 fixup_device_tree();
1997
1998 /*
1923 * Now finally create the flattened device-tree 1999 * Now finally create the flattened device-tree
1924 */ 2000 */
1925 prom_printf("copying OF device tree ...\n"); 2001 prom_printf("copying OF device tree ...\n");
diff --git a/arch/ppc64/kernel/ras.c b/arch/ppc64/kernel/ras.c
index 1c4c796b212b..3c00f7bfc1b5 100644
--- a/arch/ppc64/kernel/ras.c
+++ b/arch/ppc64/kernel/ras.c
@@ -47,7 +47,6 @@
47#include <asm/cache.h> 47#include <asm/cache.h>
48#include <asm/prom.h> 48#include <asm/prom.h>
49#include <asm/ptrace.h> 49#include <asm/ptrace.h>
50#include <asm/iSeries/LparData.h>
51#include <asm/machdep.h> 50#include <asm/machdep.h>
52#include <asm/rtas.h> 51#include <asm/rtas.h>
53#include <asm/ppcdebug.h> 52#include <asm/ppcdebug.h>
diff --git a/arch/ppc64/kernel/rtasd.c b/arch/ppc64/kernel/rtasd.c
index ff65dc33320e..b0c3b829fe47 100644
--- a/arch/ppc64/kernel/rtasd.c
+++ b/arch/ppc64/kernel/rtasd.c
@@ -440,7 +440,7 @@ static int rtasd(void *unused)
440 goto error; 440 goto error;
441 } 441 }
442 442
443 printk(KERN_ERR "RTAS daemon started\n"); 443 printk(KERN_INFO "RTAS daemon started\n");
444 444
445 DEBUG("will sleep for %d jiffies\n", (HZ*60/rtas_event_scan_rate) / 2); 445 DEBUG("will sleep for %d jiffies\n", (HZ*60/rtas_event_scan_rate) / 2);
446 446
@@ -485,7 +485,7 @@ static int __init rtas_init(void)
485 /* No RTAS, only warn if we are on a pSeries box */ 485 /* No RTAS, only warn if we are on a pSeries box */
486 if (rtas_token("event-scan") == RTAS_UNKNOWN_SERVICE) { 486 if (rtas_token("event-scan") == RTAS_UNKNOWN_SERVICE) {
487 if (systemcfg->platform & PLATFORM_PSERIES) 487 if (systemcfg->platform & PLATFORM_PSERIES)
488 printk(KERN_ERR "rtasd: no event-scan on system\n"); 488 printk(KERN_INFO "rtasd: no event-scan on system\n");
489 return 1; 489 return 1;
490 } 490 }
491 491
diff --git a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c
index 3e70b91375fc..de02aedbe080 100644
--- a/arch/ppc64/kernel/rtc.c
+++ b/arch/ppc64/kernel/rtc.c
@@ -42,10 +42,8 @@
42#include <asm/time.h> 42#include <asm/time.h>
43#include <asm/rtas.h> 43#include <asm/rtas.h>
44 44
45#include <asm/iSeries/LparData.h>
46#include <asm/iSeries/mf.h> 45#include <asm/iSeries/mf.h>
47#include <asm/machdep.h> 46#include <asm/machdep.h>
48#include <asm/iSeries/ItSpCommArea.h>
49 47
50extern int piranha_simulator; 48extern int piranha_simulator;
51 49
@@ -292,47 +290,10 @@ int iSeries_set_rtc_time(struct rtc_time *tm)
292 290
293void iSeries_get_boot_time(struct rtc_time *tm) 291void iSeries_get_boot_time(struct rtc_time *tm)
294{ 292{
295 unsigned long time;
296 static unsigned long lastsec = 1;
297
298 u32 dataWord1 = *((u32 *)(&xSpCommArea.xBcdTimeAtIplStart));
299 u32 dataWord2 = *(((u32 *)&(xSpCommArea.xBcdTimeAtIplStart)) + 1);
300 int year = 1970;
301 int year1 = ( dataWord1 >> 24 ) & 0x000000FF;
302 int year2 = ( dataWord1 >> 16 ) & 0x000000FF;
303 int sec = ( dataWord1 >> 8 ) & 0x000000FF;
304 int min = dataWord1 & 0x000000FF;
305 int hour = ( dataWord2 >> 24 ) & 0x000000FF;
306 int day = ( dataWord2 >> 8 ) & 0x000000FF;
307 int mon = dataWord2 & 0x000000FF;
308
309 if ( piranha_simulator ) 293 if ( piranha_simulator )
310 return; 294 return;
311 295
312 BCD_TO_BIN(sec); 296 mf_get_boot_rtc(tm);
313 BCD_TO_BIN(min);
314 BCD_TO_BIN(hour);
315 BCD_TO_BIN(day);
316 BCD_TO_BIN(mon);
317 BCD_TO_BIN(year1);
318 BCD_TO_BIN(year2);
319 year = year1 * 100 + year2;
320
321 time = mktime(year, mon, day, hour, min, sec);
322 time += ( jiffies / HZ );
323
324 /* Now THIS is a nasty hack!
325 * It ensures that the first two calls get different answers.
326 * That way the loop in init_time (time.c) will not think
327 * the clock is stuck.
328 */
329 if ( lastsec ) {
330 time -= lastsec;
331 --lastsec;
332 }
333
334 to_tm(time, tm);
335 tm->tm_year -= 1900;
336 tm->tm_mon -= 1; 297 tm->tm_mon -= 1;
337} 298}
338#endif 299#endif
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c
index 21c57f539c29..8e439a817642 100644
--- a/arch/ppc64/kernel/setup.c
+++ b/arch/ppc64/kernel/setup.c
@@ -41,7 +41,6 @@
41#include <asm/smp.h> 41#include <asm/smp.h>
42#include <asm/elf.h> 42#include <asm/elf.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/iSeries/LparData.h>
45#include <asm/paca.h> 44#include <asm/paca.h>
46#include <asm/ppcdebug.h> 45#include <asm/ppcdebug.h>
47#include <asm/time.h> 46#include <asm/time.h>
@@ -57,6 +56,8 @@
57#include <asm/cache.h> 56#include <asm/cache.h>
58#include <asm/page.h> 57#include <asm/page.h>
59#include <asm/mmu.h> 58#include <asm/mmu.h>
59#include <asm/lmb.h>
60#include <asm/iSeries/ItLpNaca.h>
60 61
61#ifdef DEBUG 62#ifdef DEBUG
62#define DBG(fmt...) udbg_printf(fmt) 63#define DBG(fmt...) udbg_printf(fmt)
@@ -103,11 +104,6 @@ extern void unflatten_device_tree(void);
103 104
104extern void smp_release_cpus(void); 105extern void smp_release_cpus(void);
105 106
106unsigned long decr_overclock = 1;
107unsigned long decr_overclock_proc0 = 1;
108unsigned long decr_overclock_set = 0;
109unsigned long decr_overclock_proc0_set = 0;
110
111int have_of = 1; 107int have_of = 1;
112int boot_cpuid = 0; 108int boot_cpuid = 0;
113int boot_cpuid_phys = 0; 109int boot_cpuid_phys = 0;
@@ -1120,64 +1116,15 @@ void ppc64_dump_msg(unsigned int src, const char *msg)
1120 printk("[dump]%04x %s\n", src, msg); 1116 printk("[dump]%04x %s\n", src, msg);
1121} 1117}
1122 1118
1123int set_spread_lpevents( char * str )
1124{
1125 /* The parameter is the number of processors to share in processing lp events */
1126 unsigned long i;
1127 unsigned long val = simple_strtoul( str, NULL, 0 );
1128 if ( ( val > 0 ) && ( val <= NR_CPUS ) ) {
1129 for ( i=1; i<val; ++i )
1130 paca[i].lpqueue_ptr = paca[0].lpqueue_ptr;
1131 printk("lpevent processing spread over %ld processors\n", val);
1132 }
1133 else
1134 printk("invalid spreaqd_lpevents %ld\n", val);
1135 return 1;
1136}
1137
1138/* This should only be called on processor 0 during calibrate decr */ 1119/* This should only be called on processor 0 during calibrate decr */
1139void setup_default_decr(void) 1120void setup_default_decr(void)
1140{ 1121{
1141 struct paca_struct *lpaca = get_paca(); 1122 struct paca_struct *lpaca = get_paca();
1142 1123
1143 if ( decr_overclock_set && !decr_overclock_proc0_set ) 1124 lpaca->default_decr = tb_ticks_per_jiffy;
1144 decr_overclock_proc0 = decr_overclock;
1145
1146 lpaca->default_decr = tb_ticks_per_jiffy / decr_overclock_proc0;
1147 lpaca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy; 1125 lpaca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy;
1148} 1126}
1149 1127
1150int set_decr_overclock_proc0( char * str )
1151{
1152 unsigned long val = simple_strtoul( str, NULL, 0 );
1153 if ( ( val >= 1 ) && ( val <= 48 ) ) {
1154 decr_overclock_proc0_set = 1;
1155 decr_overclock_proc0 = val;
1156 printk("proc 0 decrementer overclock factor of %ld\n", val);
1157 }
1158 else
1159 printk("invalid proc 0 decrementer overclock factor of %ld\n", val);
1160 return 1;
1161}
1162
1163int set_decr_overclock( char * str )
1164{
1165 unsigned long val = simple_strtoul( str, NULL, 0 );
1166 if ( ( val >= 1 ) && ( val <= 48 ) ) {
1167 decr_overclock_set = 1;
1168 decr_overclock = val;
1169 printk("decrementer overclock factor of %ld\n", val);
1170 }
1171 else
1172 printk("invalid decrementer overclock factor of %ld\n", val);
1173 return 1;
1174
1175}
1176
1177__setup("spread_lpevents=", set_spread_lpevents );
1178__setup("decr_overclock_proc0=", set_decr_overclock_proc0 );
1179__setup("decr_overclock=", set_decr_overclock );
1180
1181#ifndef CONFIG_PPC_ISERIES 1128#ifndef CONFIG_PPC_ISERIES
1182/* 1129/*
1183 * This function can be used by platforms to "find" legacy serial ports. 1130 * This function can be used by platforms to "find" legacy serial ports.
diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c
index 3b906cd94037..9ef5d36d6b25 100644
--- a/arch/ppc64/kernel/smp.c
+++ b/arch/ppc64/kernel/smp.c
@@ -334,7 +334,6 @@ void smp_call_function_interrupt(void)
334 } 334 }
335} 335}
336 336
337extern unsigned long decr_overclock;
338extern struct gettimeofday_struct do_gtod; 337extern struct gettimeofday_struct do_gtod;
339 338
340struct thread_info *current_set[NR_CPUS]; 339struct thread_info *current_set[NR_CPUS];
@@ -491,7 +490,7 @@ int __devinit __cpu_up(unsigned int cpu)
491 if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu)) 490 if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu))
492 return -EINVAL; 491 return -EINVAL;
493 492
494 paca[cpu].default_decr = tb_ticks_per_jiffy / decr_overclock; 493 paca[cpu].default_decr = tb_ticks_per_jiffy;
495 494
496 if (!cpu_has_feature(CPU_FTR_SLB)) { 495 if (!cpu_has_feature(CPU_FTR_SLB)) {
497 void *tmp; 496 void *tmp;
diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
index 7cf7a9600025..118436e8085a 100644
--- a/arch/ppc64/kernel/sys_ppc32.c
+++ b/arch/ppc64/kernel/sys_ppc32.c
@@ -741,6 +741,7 @@ asmlinkage int sys32_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubu
741 741
742asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn) 742asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
743{ 743{
744#ifdef CONFIG_PCI
744 struct pci_controller* hose; 745 struct pci_controller* hose;
745 struct list_head *ln; 746 struct list_head *ln;
746 struct pci_bus *bus = NULL; 747 struct pci_bus *bus = NULL;
@@ -786,36 +787,11 @@ asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
786 case IOBASE_ISA_MEM: 787 case IOBASE_ISA_MEM:
787 return -EINVAL; 788 return -EINVAL;
788 } 789 }
789 790#endif /* CONFIG_PCI */
790 return -EOPNOTSUPP; 791 return -EOPNOTSUPP;
791} 792}
792 793
793 794
794asmlinkage int ppc64_newuname(struct new_utsname __user * name)
795{
796 int errno = sys_newuname(name);
797
798 if (current->personality == PER_LINUX32 && !errno) {
799 if(copy_to_user(name->machine, "ppc\0\0", 8)) {
800 errno = -EFAULT;
801 }
802 }
803 return errno;
804}
805
806asmlinkage int ppc64_personality(unsigned long personality)
807{
808 int ret;
809 if (current->personality == PER_LINUX32 && personality == PER_LINUX)
810 personality = PER_LINUX32;
811 ret = sys_personality(personality);
812 if (ret == PER_LINUX32)
813 ret = PER_LINUX;
814 return ret;
815}
816
817
818
819/* Note: it is necessary to treat mode as an unsigned int, 795/* Note: it is necessary to treat mode as an unsigned int,
820 * with the corresponding cast to a signed int to insure that the 796 * with the corresponding cast to a signed int to insure that the
821 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 797 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -1158,26 +1134,47 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
1158} 1134}
1159#endif 1135#endif
1160 1136
1137asmlinkage int sys32_uname(struct old_utsname __user * name)
1138{
1139 int err = 0;
1140
1141 down_read(&uts_sem);
1142 if (copy_to_user(name, &system_utsname, sizeof(*name)))
1143 err = -EFAULT;
1144 up_read(&uts_sem);
1145 if (!err && personality(current->personality) == PER_LINUX32) {
1146 /* change "ppc64" to "ppc" */
1147 if (__put_user(0, name->machine + 3)
1148 || __put_user(0, name->machine + 4))
1149 err = -EFAULT;
1150 }
1151 return err;
1152}
1153
1161asmlinkage int sys32_olduname(struct oldold_utsname __user * name) 1154asmlinkage int sys32_olduname(struct oldold_utsname __user * name)
1162{ 1155{
1163 int error; 1156 int error;
1164 1157
1165 if (!name)
1166 return -EFAULT;
1167 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) 1158 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
1168 return -EFAULT; 1159 return -EFAULT;
1169 1160
1170 down_read(&uts_sem); 1161 down_read(&uts_sem);
1171 error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); 1162 error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
1172 error -= __put_user(0,name->sysname+__OLD_UTS_LEN); 1163 error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
1173 error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); 1164 error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
1174 error -= __put_user(0,name->nodename+__OLD_UTS_LEN); 1165 error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
1175 error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); 1166 error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
1176 error -= __put_user(0,name->release+__OLD_UTS_LEN); 1167 error |= __put_user(0,name->release+__OLD_UTS_LEN);
1177 error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); 1168 error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
1178 error -= __put_user(0,name->version+__OLD_UTS_LEN); 1169 error |= __put_user(0,name->version+__OLD_UTS_LEN);
1179 error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); 1170 error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
1180 error = __put_user(0,name->machine+__OLD_UTS_LEN); 1171 error |= __put_user(0,name->machine+__OLD_UTS_LEN);
1172 if (personality(current->personality) == PER_LINUX32) {
1173 /* change "ppc64" to "ppc" */
1174 error |= __put_user(0, name->machine + 3);
1175 error |= __put_user(0, name->machine + 4);
1176 }
1177
1181 up_read(&uts_sem); 1178 up_read(&uts_sem);
1182 1179
1183 error = error ? -EFAULT : 0; 1180 error = error ? -EFAULT : 0;
diff --git a/arch/ppc64/kernel/syscalls.c b/arch/ppc64/kernel/syscalls.c
index f2865ff8d2f9..a8cbb202b8cd 100644
--- a/arch/ppc64/kernel/syscalls.c
+++ b/arch/ppc64/kernel/syscalls.c
@@ -199,24 +199,33 @@ out:
199 return ret; 199 return ret;
200} 200}
201 201
202static int __init set_fakeppc(char *str) 202long ppc64_personality(unsigned long personality)
203{ 203{
204 if (*str) 204 long ret;
205 return 0; 205
206 init_task.personality = PER_LINUX32; 206 if (personality(current->personality) == PER_LINUX32
207 return 1; 207 && personality == PER_LINUX)
208 personality = PER_LINUX32;
209 ret = sys_personality(personality);
210 if (ret == PER_LINUX32)
211 ret = PER_LINUX;
212 return ret;
208} 213}
209__setup("fakeppc", set_fakeppc);
210 214
211asmlinkage int sys_uname(struct old_utsname __user * name) 215long ppc64_newuname(struct new_utsname __user * name)
212{ 216{
213 int err = -EFAULT; 217 int err = 0;
214 218
215 down_read(&uts_sem); 219 down_read(&uts_sem);
216 if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) 220 if (copy_to_user(name, &system_utsname, sizeof(*name)))
217 err = 0; 221 err = -EFAULT;
218 up_read(&uts_sem); 222 up_read(&uts_sem);
219 223 if (!err && personality(current->personality) == PER_LINUX32) {
224 /* change ppc64 to ppc */
225 if (__put_user(0, name->machine + 3)
226 || __put_user(0, name->machine + 4))
227 err = -EFAULT;
228 }
220 return err; 229 return err;
221} 230}
222 231
diff --git a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c
index 0925694c3ce5..c8fa6569b2fd 100644
--- a/arch/ppc64/kernel/sysfs.c
+++ b/arch/ppc64/kernel/sysfs.c
@@ -113,7 +113,6 @@ void ppc64_enable_pmcs(void)
113#ifdef CONFIG_PPC_PSERIES 113#ifdef CONFIG_PPC_PSERIES
114 unsigned long set, reset; 114 unsigned long set, reset;
115 int ret; 115 int ret;
116 unsigned int ctrl;
117#endif /* CONFIG_PPC_PSERIES */ 116#endif /* CONFIG_PPC_PSERIES */
118 117
119 /* Only need to enable them once */ 118 /* Only need to enable them once */
@@ -167,11 +166,8 @@ void ppc64_enable_pmcs(void)
167 * On SMT machines we have to set the run latch in the ctrl register 166 * On SMT machines we have to set the run latch in the ctrl register
168 * in order to make PMC6 spin. 167 * in order to make PMC6 spin.
169 */ 168 */
170 if (cpu_has_feature(CPU_FTR_SMT)) { 169 if (cpu_has_feature(CPU_FTR_SMT))
171 ctrl = mfspr(CTRLF); 170 ppc64_runlatch_on();
172 ctrl |= RUNLATCH;
173 mtspr(CTRLT, ctrl);
174 }
175#endif /* CONFIG_PPC_PSERIES */ 171#endif /* CONFIG_PPC_PSERIES */
176} 172}
177 173
diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c
index 772a465b49f9..33364a7d2cd2 100644
--- a/arch/ppc64/kernel/time.c
+++ b/arch/ppc64/kernel/time.c
@@ -325,9 +325,7 @@ int timer_interrupt(struct pt_regs * regs)
325 325
326 irq_enter(); 326 irq_enter();
327 327
328#ifndef CONFIG_PPC_ISERIES
329 profile_tick(CPU_PROFILING, regs); 328 profile_tick(CPU_PROFILING, regs);
330#endif
331 329
332 lpaca->lppaca.int_dword.fields.decr_int = 0; 330 lpaca->lppaca.int_dword.fields.decr_int = 0;
333 331
@@ -515,6 +513,7 @@ void __init time_init(void)
515 do_gtod.varp = &do_gtod.vars[0]; 513 do_gtod.varp = &do_gtod.vars[0];
516 do_gtod.var_idx = 0; 514 do_gtod.var_idx = 0;
517 do_gtod.varp->tb_orig_stamp = tb_last_stamp; 515 do_gtod.varp->tb_orig_stamp = tb_last_stamp;
516 get_paca()->next_jiffy_update_tb = tb_last_stamp + tb_ticks_per_jiffy;
518 do_gtod.varp->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC; 517 do_gtod.varp->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC;
519 do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; 518 do_gtod.tb_ticks_per_sec = tb_ticks_per_sec;
520 do_gtod.varp->tb_to_xs = tb_to_xs; 519 do_gtod.varp->tb_to_xs = tb_to_xs;
diff --git a/arch/ppc64/kernel/vio.c b/arch/ppc64/kernel/vio.c
index cdd830cb2768..0c0ba71ac0e8 100644
--- a/arch/ppc64/kernel/vio.c
+++ b/arch/ppc64/kernel/vio.c
@@ -41,20 +41,25 @@ static const struct vio_device_id *vio_match_device(
41static struct iommu_table *vio_build_iommu_table(struct vio_dev *); 41static struct iommu_table *vio_build_iommu_table(struct vio_dev *);
42static int vio_num_address_cells; 42static int vio_num_address_cells;
43#endif 43#endif
44static struct vio_dev *vio_bus_device; /* fake "parent" device */
45
46#ifdef CONFIG_PPC_ISERIES 44#ifdef CONFIG_PPC_ISERIES
47static struct vio_dev *__init vio_register_device_iseries(char *type,
48 uint32_t unit_num);
49
50static struct iommu_table veth_iommu_table; 45static struct iommu_table veth_iommu_table;
51static struct iommu_table vio_iommu_table; 46static struct iommu_table vio_iommu_table;
52 47#endif
53static struct vio_dev _vio_dev = { 48static struct vio_dev vio_bus_device = { /* fake "parent" device */
49 .name = vio_bus_device.dev.bus_id,
50 .type = "",
51#ifdef CONFIG_PPC_ISERIES
54 .iommu_table = &vio_iommu_table, 52 .iommu_table = &vio_iommu_table,
55 .dev.bus = &vio_bus_type 53#endif
54 .dev.bus_id = "vio",
55 .dev.bus = &vio_bus_type,
56}; 56};
57struct device *iSeries_vio_dev = &_vio_dev.dev; 57
58#ifdef CONFIG_PPC_ISERIES
59static struct vio_dev *__init vio_register_device_iseries(char *type,
60 uint32_t unit_num);
61
62struct device *iSeries_vio_dev = &vio_bus_device.dev;
58EXPORT_SYMBOL(iSeries_vio_dev); 63EXPORT_SYMBOL(iSeries_vio_dev);
59 64
60#define device_is_compatible(a, b) 1 65#define device_is_compatible(a, b) 1
@@ -260,18 +265,10 @@ static int __init vio_bus_init(void)
260 } 265 }
261 266
262 /* the fake parent of all vio devices, just to give us a nice directory */ 267 /* the fake parent of all vio devices, just to give us a nice directory */
263 vio_bus_device = kmalloc(sizeof(struct vio_dev), GFP_KERNEL); 268 err = device_register(&vio_bus_device.dev);
264 if (!vio_bus_device) {
265 return 1;
266 }
267 memset(vio_bus_device, 0, sizeof(struct vio_dev));
268 strcpy(vio_bus_device->dev.bus_id, "vio");
269
270 err = device_register(&vio_bus_device->dev);
271 if (err) { 269 if (err) {
272 printk(KERN_WARNING "%s: device_register returned %i\n", __FUNCTION__, 270 printk(KERN_WARNING "%s: device_register returned %i\n", __FUNCTION__,
273 err); 271 err);
274 kfree(vio_bus_device);
275 return err; 272 return err;
276 } 273 }
277 274
@@ -300,7 +297,7 @@ static void __devinit vio_dev_release(struct device *dev)
300} 297}
301 298
302#ifdef CONFIG_PPC_PSERIES 299#ifdef CONFIG_PPC_PSERIES
303static ssize_t viodev_show_devspec(struct device *dev, char *buf) 300static ssize_t viodev_show_devspec(struct device *dev, struct device_attribute *attr, char *buf)
304{ 301{
305 struct device_node *of_node = dev->platform_data; 302 struct device_node *of_node = dev->platform_data;
306 303
@@ -309,7 +306,7 @@ static ssize_t viodev_show_devspec(struct device *dev, char *buf)
309DEVICE_ATTR(devspec, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_devspec, NULL); 306DEVICE_ATTR(devspec, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_devspec, NULL);
310#endif 307#endif
311 308
312static ssize_t viodev_show_name(struct device *dev, char *buf) 309static ssize_t viodev_show_name(struct device *dev, struct device_attribute *attr, char *buf)
313{ 310{
314 return sprintf(buf, "%s\n", to_vio_dev(dev)->name); 311 return sprintf(buf, "%s\n", to_vio_dev(dev)->name);
315} 312}
@@ -326,7 +323,7 @@ static struct vio_dev * __devinit vio_register_device_common(
326 viodev->unit_address = unit_address; 323 viodev->unit_address = unit_address;
327 viodev->iommu_table = iommu_table; 324 viodev->iommu_table = iommu_table;
328 /* init generic 'struct device' fields: */ 325 /* init generic 'struct device' fields: */
329 viodev->dev.parent = &vio_bus_device->dev; 326 viodev->dev.parent = &vio_bus_device.dev;
330 viodev->dev.bus = &vio_bus_type; 327 viodev->dev.bus = &vio_bus_type;
331 viodev->dev.release = vio_dev_release; 328 viodev->dev.release = vio_dev_release;
332 329
@@ -636,5 +633,3 @@ struct bus_type vio_bus_type = {
636 .name = "vio", 633 .name = "vio",
637 .match = vio_bus_match, 634 .match = vio_bus_match,
638}; 635};
639
640EXPORT_SYMBOL(vio_bus_type);
diff --git a/arch/ppc64/kernel/viopath.c b/arch/ppc64/kernel/viopath.c
index 2ed8ee075680..2a6c4f01c45e 100644
--- a/arch/ppc64/kernel/viopath.c
+++ b/arch/ppc64/kernel/viopath.c
@@ -43,12 +43,10 @@
43#include <asm/system.h> 43#include <asm/system.h>
44#include <asm/uaccess.h> 44#include <asm/uaccess.h>
45#include <asm/iSeries/HvTypes.h> 45#include <asm/iSeries/HvTypes.h>
46#include <asm/iSeries/LparData.h> 46#include <asm/iSeries/ItExtVpdPanel.h>
47#include <asm/iSeries/HvLpEvent.h> 47#include <asm/iSeries/HvLpEvent.h>
48#include <asm/iSeries/HvLpConfig.h> 48#include <asm/iSeries/HvLpConfig.h>
49#include <asm/iSeries/HvCallCfg.h>
50#include <asm/iSeries/mf.h> 49#include <asm/iSeries/mf.h>
51#include <asm/iSeries/iSeries_proc.h>
52#include <asm/iSeries/vio.h> 50#include <asm/iSeries/vio.h>
53 51
54/* Status of the path to each other partition in the system. 52/* Status of the path to each other partition in the system.
@@ -365,7 +363,7 @@ void vio_set_hostlp(void)
365 * while we're active 363 * while we're active
366 */ 364 */
367 viopath_ourLp = HvLpConfig_getLpIndex(); 365 viopath_ourLp = HvLpConfig_getLpIndex();
368 viopath_hostLp = HvCallCfg_getHostingLpIndex(viopath_ourLp); 366 viopath_hostLp = HvLpConfig_getHostingLpIndex(viopath_ourLp);
369 367
370 if (viopath_hostLp != HvLpIndexInvalid) 368 if (viopath_hostLp != HvLpIndexInvalid)
371 vio_setHandler(viomajorsubtype_config, handleConfig); 369 vio_setHandler(viomajorsubtype_config, handleConfig);
@@ -487,7 +485,7 @@ int viopath_open(HvLpIndex remoteLp, int subtype, int numReq)
487 unsigned long flags; 485 unsigned long flags;
488 int tempNumAllocated; 486 int tempNumAllocated;
489 487
490 if ((remoteLp >= HvMaxArchitectedLps) || (remoteLp == HvLpIndexInvalid)) 488 if ((remoteLp >= HVMAXARCHITECTEDLPS) || (remoteLp == HvLpIndexInvalid))
491 return -EINVAL; 489 return -EINVAL;
492 490
493 subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT; 491 subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;
@@ -558,7 +556,7 @@ int viopath_close(HvLpIndex remoteLp, int subtype, int numReq)
558 int numOpen; 556 int numOpen;
559 struct alloc_parms parms; 557 struct alloc_parms parms;
560 558
561 if ((remoteLp >= HvMaxArchitectedLps) || (remoteLp == HvLpIndexInvalid)) 559 if ((remoteLp >= HVMAXARCHITECTEDLPS) || (remoteLp == HvLpIndexInvalid))
562 return -EINVAL; 560 return -EINVAL;
563 561
564 subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT; 562 subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;
diff --git a/arch/ppc64/lib/Makefile b/arch/ppc64/lib/Makefile
index bf7b5bbfc04e..76fbfa9f706f 100644
--- a/arch/ppc64/lib/Makefile
+++ b/arch/ppc64/lib/Makefile
@@ -12,7 +12,7 @@ lib-$(CONFIG_SMP) += locks.o
12 12
13# e2a provides EBCDIC to ASCII conversions. 13# e2a provides EBCDIC to ASCII conversions.
14ifdef CONFIG_PPC_ISERIES 14ifdef CONFIG_PPC_ISERIES
15obj-$(CONFIG_PCI) += e2a.o 15obj-y += e2a.o
16endif 16endif
17 17
18lib-$(CONFIG_DEBUG_KERNEL) += sstep.o 18lib-$(CONFIG_DEBUG_KERNEL) += sstep.o
diff --git a/arch/ppc64/mm/hash_utils.c b/arch/ppc64/mm/hash_utils.c
index 0a0f97008d02..1647b1c6f28e 100644
--- a/arch/ppc64/mm/hash_utils.c
+++ b/arch/ppc64/mm/hash_utils.c
@@ -195,7 +195,7 @@ void __init htab_initialize(void)
195 memset((void *)table, 0, htab_size_bytes); 195 memset((void *)table, 0, htab_size_bytes);
196 } 196 }
197 197
198 mode_rw = _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX; 198 mode_rw = _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX;
199 199
200 /* On U3 based machines, we need to reserve the DART area and 200 /* On U3 based machines, we need to reserve the DART area and
201 * _NOT_ map it to avoid cache paradoxes as it's remapped non 201 * _NOT_ map it to avoid cache paradoxes as it's remapped non
@@ -310,10 +310,6 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
310 310
311 vsid = get_vsid(mm->context.id, ea); 311 vsid = get_vsid(mm->context.id, ea);
312 break; 312 break;
313 case IO_REGION_ID:
314 mm = &ioremap_mm;
315 vsid = get_kernel_vsid(ea);
316 break;
317 case VMALLOC_REGION_ID: 313 case VMALLOC_REGION_ID:
318 mm = &init_mm; 314 mm = &init_mm;
319 vsid = get_kernel_vsid(ea); 315 vsid = get_kernel_vsid(ea);
diff --git a/arch/ppc64/mm/hugetlbpage.c b/arch/ppc64/mm/hugetlbpage.c
index d3bf86a5c1ad..fdcfe97c75c1 100644
--- a/arch/ppc64/mm/hugetlbpage.c
+++ b/arch/ppc64/mm/hugetlbpage.c
@@ -121,7 +121,7 @@ static pte_t *hugepte_alloc(struct mm_struct *mm, pud_t *dir, unsigned long addr
121 return hugepte_offset(dir, addr); 121 return hugepte_offset(dir, addr);
122} 122}
123 123
124static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) 124pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
125{ 125{
126 pud_t *pud; 126 pud_t *pud;
127 127
@@ -134,7 +134,7 @@ static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
134 return hugepte_offset(pud, addr); 134 return hugepte_offset(pud, addr);
135} 135}
136 136
137static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) 137pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
138{ 138{
139 pud_t *pud; 139 pud_t *pud;
140 140
@@ -147,25 +147,6 @@ static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
147 return hugepte_alloc(mm, pud, addr); 147 return hugepte_alloc(mm, pud, addr);
148} 148}
149 149
150static void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma,
151 unsigned long addr, struct page *page,
152 pte_t *ptep, int write_access)
153{
154 pte_t entry;
155
156 add_mm_counter(mm, rss, HPAGE_SIZE / PAGE_SIZE);
157 if (write_access) {
158 entry =
159 pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
160 } else {
161 entry = pte_wrprotect(mk_pte(page, vma->vm_page_prot));
162 }
163 entry = pte_mkyoung(entry);
164 entry = pte_mkhuge(entry);
165
166 set_pte_at(mm, addr, ptep, entry);
167}
168
169/* 150/*
170 * This function checks for proper alignment of input addr and len parameters. 151 * This function checks for proper alignment of input addr and len parameters.
171 */ 152 */
@@ -259,80 +240,6 @@ int prepare_hugepage_range(unsigned long addr, unsigned long len)
259 return -EINVAL; 240 return -EINVAL;
260} 241}
261 242
262int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
263 struct vm_area_struct *vma)
264{
265 pte_t *src_pte, *dst_pte, entry;
266 struct page *ptepage;
267 unsigned long addr = vma->vm_start;
268 unsigned long end = vma->vm_end;
269 int err = -ENOMEM;
270
271 while (addr < end) {
272 dst_pte = huge_pte_alloc(dst, addr);
273 if (!dst_pte)
274 goto out;
275
276 src_pte = huge_pte_offset(src, addr);
277 entry = *src_pte;
278
279 ptepage = pte_page(entry);
280 get_page(ptepage);
281 add_mm_counter(dst, rss, HPAGE_SIZE / PAGE_SIZE);
282 set_pte_at(dst, addr, dst_pte, entry);
283
284 addr += HPAGE_SIZE;
285 }
286
287 err = 0;
288 out:
289 return err;
290}
291
292int
293follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
294 struct page **pages, struct vm_area_struct **vmas,
295 unsigned long *position, int *length, int i)
296{
297 unsigned long vpfn, vaddr = *position;
298 int remainder = *length;
299
300 WARN_ON(!is_vm_hugetlb_page(vma));
301
302 vpfn = vaddr/PAGE_SIZE;
303 while (vaddr < vma->vm_end && remainder) {
304 if (pages) {
305 pte_t *pte;
306 struct page *page;
307
308 pte = huge_pte_offset(mm, vaddr);
309
310 /* hugetlb should be locked, and hence, prefaulted */
311 WARN_ON(!pte || pte_none(*pte));
312
313 page = &pte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)];
314
315 WARN_ON(!PageCompound(page));
316
317 get_page(page);
318 pages[i] = page;
319 }
320
321 if (vmas)
322 vmas[i] = vma;
323
324 vaddr += PAGE_SIZE;
325 ++vpfn;
326 --remainder;
327 ++i;
328 }
329
330 *length = remainder;
331 *position = vaddr;
332
333 return i;
334}
335
336struct page * 243struct page *
337follow_huge_addr(struct mm_struct *mm, unsigned long address, int write) 244follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
338{ 245{
@@ -363,89 +270,6 @@ follow_huge_pmd(struct mm_struct *mm, unsigned long address,
363 return NULL; 270 return NULL;
364} 271}
365 272
366void unmap_hugepage_range(struct vm_area_struct *vma,
367 unsigned long start, unsigned long end)
368{
369 struct mm_struct *mm = vma->vm_mm;
370 unsigned long addr;
371 pte_t *ptep;
372 struct page *page;
373
374 WARN_ON(!is_vm_hugetlb_page(vma));
375 BUG_ON((start % HPAGE_SIZE) != 0);
376 BUG_ON((end % HPAGE_SIZE) != 0);
377
378 for (addr = start; addr < end; addr += HPAGE_SIZE) {
379 pte_t pte;
380
381 ptep = huge_pte_offset(mm, addr);
382 if (!ptep || pte_none(*ptep))
383 continue;
384
385 pte = *ptep;
386 page = pte_page(pte);
387 pte_clear(mm, addr, ptep);
388
389 put_page(page);
390 }
391 add_mm_counter(mm, rss, -((end - start) >> PAGE_SHIFT));
392 flush_tlb_pending();
393}
394
395int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
396{
397 struct mm_struct *mm = current->mm;
398 unsigned long addr;
399 int ret = 0;
400
401 WARN_ON(!is_vm_hugetlb_page(vma));
402 BUG_ON((vma->vm_start % HPAGE_SIZE) != 0);
403 BUG_ON((vma->vm_end % HPAGE_SIZE) != 0);
404
405 spin_lock(&mm->page_table_lock);
406 for (addr = vma->vm_start; addr < vma->vm_end; addr += HPAGE_SIZE) {
407 unsigned long idx;
408 pte_t *pte = huge_pte_alloc(mm, addr);
409 struct page *page;
410
411 if (!pte) {
412 ret = -ENOMEM;
413 goto out;
414 }
415 if (! pte_none(*pte))
416 continue;
417
418 idx = ((addr - vma->vm_start) >> HPAGE_SHIFT)
419 + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
420 page = find_get_page(mapping, idx);
421 if (!page) {
422 /* charge the fs quota first */
423 if (hugetlb_get_quota(mapping)) {
424 ret = -ENOMEM;
425 goto out;
426 }
427 page = alloc_huge_page();
428 if (!page) {
429 hugetlb_put_quota(mapping);
430 ret = -ENOMEM;
431 goto out;
432 }
433 ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
434 if (! ret) {
435 unlock_page(page);
436 } else {
437 hugetlb_put_quota(mapping);
438 free_huge_page(page);
439 goto out;
440 }
441 }
442 set_huge_pte(mm, vma, addr, page, pte, vma->vm_flags & VM_WRITE);
443 }
444out:
445 spin_unlock(&mm->page_table_lock);
446 return ret;
447}
448
449/* Because we have an exclusive hugepage region which lies within the 273/* Because we have an exclusive hugepage region which lies within the
450 * normal user address space, we have to take special measures to make 274 * normal user address space, we have to take special measures to make
451 * non-huge mmap()s evade the hugepage reserved regions. */ 275 * non-huge mmap()s evade the hugepage reserved regions. */
@@ -468,7 +292,12 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
468 && !is_hugepage_only_range(mm, addr,len)) 292 && !is_hugepage_only_range(mm, addr,len))
469 return addr; 293 return addr;
470 } 294 }
471 start_addr = addr = mm->free_area_cache; 295 if (len > mm->cached_hole_size) {
296 start_addr = addr = mm->free_area_cache;
297 } else {
298 start_addr = addr = TASK_UNMAPPED_BASE;
299 mm->cached_hole_size = 0;
300 }
472 301
473full_search: 302full_search:
474 vma = find_vma(mm, addr); 303 vma = find_vma(mm, addr);
@@ -492,6 +321,8 @@ full_search:
492 mm->free_area_cache = addr + len; 321 mm->free_area_cache = addr + len;
493 return addr; 322 return addr;
494 } 323 }
324 if (addr + mm->cached_hole_size < vma->vm_start)
325 mm->cached_hole_size = vma->vm_start - addr;
495 addr = vma->vm_end; 326 addr = vma->vm_end;
496 vma = vma->vm_next; 327 vma = vma->vm_next;
497 } 328 }
@@ -499,6 +330,7 @@ full_search:
499 /* Make sure we didn't miss any holes */ 330 /* Make sure we didn't miss any holes */
500 if (start_addr != TASK_UNMAPPED_BASE) { 331 if (start_addr != TASK_UNMAPPED_BASE) {
501 start_addr = addr = TASK_UNMAPPED_BASE; 332 start_addr = addr = TASK_UNMAPPED_BASE;
333 mm->cached_hole_size = 0;
502 goto full_search; 334 goto full_search;
503 } 335 }
504 return -ENOMEM; 336 return -ENOMEM;
@@ -520,6 +352,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
520 struct vm_area_struct *vma, *prev_vma; 352 struct vm_area_struct *vma, *prev_vma;
521 struct mm_struct *mm = current->mm; 353 struct mm_struct *mm = current->mm;
522 unsigned long base = mm->mmap_base, addr = addr0; 354 unsigned long base = mm->mmap_base, addr = addr0;
355 unsigned long largest_hole = mm->cached_hole_size;
523 int first_time = 1; 356 int first_time = 1;
524 357
525 /* requested length too big for entire address space */ 358 /* requested length too big for entire address space */
@@ -540,6 +373,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
540 return addr; 373 return addr;
541 } 374 }
542 375
376 if (len <= largest_hole) {
377 largest_hole = 0;
378 mm->free_area_cache = base;
379 }
543try_again: 380try_again:
544 /* make sure it can fit in the remaining address space */ 381 /* make sure it can fit in the remaining address space */
545 if (mm->free_area_cache < len) 382 if (mm->free_area_cache < len)
@@ -568,13 +405,21 @@ hugepage_recheck:
568 * vma->vm_start, use it: 405 * vma->vm_start, use it:
569 */ 406 */
570 if (addr+len <= vma->vm_start && 407 if (addr+len <= vma->vm_start &&
571 (!prev_vma || (addr >= prev_vma->vm_end))) 408 (!prev_vma || (addr >= prev_vma->vm_end))) {
572 /* remember the address as a hint for next time */ 409 /* remember the address as a hint for next time */
573 return (mm->free_area_cache = addr); 410 mm->cached_hole_size = largest_hole;
574 else 411 return (mm->free_area_cache = addr);
412 } else {
575 /* pull free_area_cache down to the first hole */ 413 /* pull free_area_cache down to the first hole */
576 if (mm->free_area_cache == vma->vm_end) 414 if (mm->free_area_cache == vma->vm_end) {
577 mm->free_area_cache = vma->vm_start; 415 mm->free_area_cache = vma->vm_start;
416 mm->cached_hole_size = largest_hole;
417 }
418 }
419
420 /* remember the largest hole we saw so far */
421 if (addr + largest_hole < vma->vm_start)
422 largest_hole = vma->vm_start - addr;
578 423
579 /* try just below the current vma->vm_start */ 424 /* try just below the current vma->vm_start */
580 addr = vma->vm_start-len; 425 addr = vma->vm_start-len;
@@ -587,6 +432,7 @@ fail:
587 */ 432 */
588 if (first_time) { 433 if (first_time) {
589 mm->free_area_cache = base; 434 mm->free_area_cache = base;
435 largest_hole = 0;
590 first_time = 0; 436 first_time = 0;
591 goto try_again; 437 goto try_again;
592 } 438 }
@@ -597,11 +443,13 @@ fail:
597 * allocations. 443 * allocations.
598 */ 444 */
599 mm->free_area_cache = TASK_UNMAPPED_BASE; 445 mm->free_area_cache = TASK_UNMAPPED_BASE;
446 mm->cached_hole_size = ~0UL;
600 addr = arch_get_unmapped_area(filp, addr0, len, pgoff, flags); 447 addr = arch_get_unmapped_area(filp, addr0, len, pgoff, flags);
601 /* 448 /*
602 * Restore the topdown base: 449 * Restore the topdown base:
603 */ 450 */
604 mm->free_area_cache = base; 451 mm->free_area_cache = base;
452 mm->cached_hole_size = ~0UL;
605 453
606 return addr; 454 return addr;
607} 455}
diff --git a/arch/ppc64/mm/imalloc.c b/arch/ppc64/mm/imalloc.c
index cb8727f3267a..b6e75b891ac0 100644
--- a/arch/ppc64/mm/imalloc.c
+++ b/arch/ppc64/mm/imalloc.c
@@ -15,6 +15,7 @@
15#include <asm/pgtable.h> 15#include <asm/pgtable.h>
16#include <asm/semaphore.h> 16#include <asm/semaphore.h>
17#include <asm/imalloc.h> 17#include <asm/imalloc.h>
18#include <asm/cacheflush.h>
18 19
19static DECLARE_MUTEX(imlist_sem); 20static DECLARE_MUTEX(imlist_sem);
20struct vm_struct * imlist = NULL; 21struct vm_struct * imlist = NULL;
@@ -285,29 +286,32 @@ struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size,
285 return area; 286 return area;
286} 287}
287 288
288unsigned long im_free(void * addr) 289void im_free(void * addr)
289{ 290{
290 struct vm_struct **p, *tmp; 291 struct vm_struct **p, *tmp;
291 unsigned long ret_size = 0;
292 292
293 if (!addr) 293 if (!addr)
294 return ret_size; 294 return;
295 if ((PAGE_SIZE-1) & (unsigned long) addr) { 295 if ((unsigned long) addr & ~PAGE_MASK) {
296 printk(KERN_ERR "Trying to %s bad address (%p)\n", __FUNCTION__, addr); 296 printk(KERN_ERR "Trying to %s bad address (%p)\n", __FUNCTION__, addr);
297 return ret_size; 297 return;
298 } 298 }
299 down(&imlist_sem); 299 down(&imlist_sem);
300 for (p = &imlist ; (tmp = *p) ; p = &tmp->next) { 300 for (p = &imlist ; (tmp = *p) ; p = &tmp->next) {
301 if (tmp->addr == addr) { 301 if (tmp->addr == addr) {
302 ret_size = tmp->size;
303 *p = tmp->next; 302 *p = tmp->next;
303
304 /* XXX: do we need the lock? */
305 spin_lock(&init_mm.page_table_lock);
306 unmap_vm_area(tmp);
307 spin_unlock(&init_mm.page_table_lock);
308
304 kfree(tmp); 309 kfree(tmp);
305 up(&imlist_sem); 310 up(&imlist_sem);
306 return ret_size; 311 return;
307 } 312 }
308 } 313 }
309 up(&imlist_sem); 314 up(&imlist_sem);
310 printk(KERN_ERR "Trying to %s nonexistent area (%p)\n", __FUNCTION__, 315 printk(KERN_ERR "Trying to %s nonexistent area (%p)\n", __FUNCTION__,
311 addr); 316 addr);
312 return ret_size;
313} 317}
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
index 4b42aff74d73..6fa1e6490b57 100644
--- a/arch/ppc64/mm/init.c
+++ b/arch/ppc64/mm/init.c
@@ -73,9 +73,6 @@ static unsigned long phbs_io_bot = PHBS_IO_BASE;
73extern pgd_t swapper_pg_dir[]; 73extern pgd_t swapper_pg_dir[];
74extern struct task_struct *current_set[NR_CPUS]; 74extern struct task_struct *current_set[NR_CPUS];
75 75
76extern pgd_t ioremap_dir[];
77pgd_t * ioremap_pgd = (pgd_t *)&ioremap_dir;
78
79unsigned long klimit = (unsigned long)_end; 76unsigned long klimit = (unsigned long)_end;
80 77
81unsigned long _SDR1=0; 78unsigned long _SDR1=0;
@@ -137,69 +134,6 @@ void iounmap(volatile void __iomem *addr)
137 134
138#else 135#else
139 136
140static void unmap_im_area_pte(pmd_t *pmd, unsigned long addr,
141 unsigned long end)
142{
143 pte_t *pte;
144
145 pte = pte_offset_kernel(pmd, addr);
146 do {
147 pte_t ptent = ptep_get_and_clear(&ioremap_mm, addr, pte);
148 WARN_ON(!pte_none(ptent) && !pte_present(ptent));
149 } while (pte++, addr += PAGE_SIZE, addr != end);
150}
151
152static inline void unmap_im_area_pmd(pud_t *pud, unsigned long addr,
153 unsigned long end)
154{
155 pmd_t *pmd;
156 unsigned long next;
157
158 pmd = pmd_offset(pud, addr);
159 do {
160 next = pmd_addr_end(addr, end);
161 if (pmd_none_or_clear_bad(pmd))
162 continue;
163 unmap_im_area_pte(pmd, addr, next);
164 } while (pmd++, addr = next, addr != end);
165}
166
167static inline void unmap_im_area_pud(pgd_t *pgd, unsigned long addr,
168 unsigned long end)
169{
170 pud_t *pud;
171 unsigned long next;
172
173 pud = pud_offset(pgd, addr);
174 do {
175 next = pud_addr_end(addr, end);
176 if (pud_none_or_clear_bad(pud))
177 continue;
178 unmap_im_area_pmd(pud, addr, next);
179 } while (pud++, addr = next, addr != end);
180}
181
182static void unmap_im_area(unsigned long addr, unsigned long end)
183{
184 struct mm_struct *mm = &ioremap_mm;
185 unsigned long next;
186 pgd_t *pgd;
187
188 spin_lock(&mm->page_table_lock);
189
190 pgd = pgd_offset_i(addr);
191 flush_cache_vunmap(addr, end);
192 do {
193 next = pgd_addr_end(addr, end);
194 if (pgd_none_or_clear_bad(pgd))
195 continue;
196 unmap_im_area_pud(pgd, addr, next);
197 } while (pgd++, addr = next, addr != end);
198 flush_tlb_kernel_range(start, end);
199
200 spin_unlock(&mm->page_table_lock);
201}
202
203/* 137/*
204 * map_io_page currently only called by __ioremap 138 * map_io_page currently only called by __ioremap
205 * map_io_page adds an entry to the ioremap page table 139 * map_io_page adds an entry to the ioremap page table
@@ -214,21 +148,21 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
214 unsigned long vsid; 148 unsigned long vsid;
215 149
216 if (mem_init_done) { 150 if (mem_init_done) {
217 spin_lock(&ioremap_mm.page_table_lock); 151 spin_lock(&init_mm.page_table_lock);
218 pgdp = pgd_offset_i(ea); 152 pgdp = pgd_offset_k(ea);
219 pudp = pud_alloc(&ioremap_mm, pgdp, ea); 153 pudp = pud_alloc(&init_mm, pgdp, ea);
220 if (!pudp) 154 if (!pudp)
221 return -ENOMEM; 155 return -ENOMEM;
222 pmdp = pmd_alloc(&ioremap_mm, pudp, ea); 156 pmdp = pmd_alloc(&init_mm, pudp, ea);
223 if (!pmdp) 157 if (!pmdp)
224 return -ENOMEM; 158 return -ENOMEM;
225 ptep = pte_alloc_kernel(&ioremap_mm, pmdp, ea); 159 ptep = pte_alloc_kernel(&init_mm, pmdp, ea);
226 if (!ptep) 160 if (!ptep)
227 return -ENOMEM; 161 return -ENOMEM;
228 pa = abs_to_phys(pa); 162 pa = abs_to_phys(pa);
229 set_pte_at(&ioremap_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT, 163 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
230 __pgprot(flags))); 164 __pgprot(flags)));
231 spin_unlock(&ioremap_mm.page_table_lock); 165 spin_unlock(&init_mm.page_table_lock);
232 } else { 166 } else {
233 unsigned long va, vpn, hash, hpteg; 167 unsigned long va, vpn, hash, hpteg;
234 168
@@ -267,13 +201,9 @@ static void __iomem * __ioremap_com(unsigned long addr, unsigned long pa,
267 201
268 for (i = 0; i < size; i += PAGE_SIZE) 202 for (i = 0; i < size; i += PAGE_SIZE)
269 if (map_io_page(ea+i, pa+i, flags)) 203 if (map_io_page(ea+i, pa+i, flags))
270 goto failure; 204 return NULL;
271 205
272 return (void __iomem *) (ea + (addr & ~PAGE_MASK)); 206 return (void __iomem *) (ea + (addr & ~PAGE_MASK));
273 failure:
274 if (mem_init_done)
275 unmap_im_area(ea, ea + size);
276 return NULL;
277} 207}
278 208
279 209
@@ -381,19 +311,14 @@ int __ioremap_explicit(unsigned long pa, unsigned long ea,
381 */ 311 */
382void iounmap(volatile void __iomem *token) 312void iounmap(volatile void __iomem *token)
383{ 313{
384 unsigned long address, size;
385 void *addr; 314 void *addr;
386 315
387 if (!mem_init_done) 316 if (!mem_init_done)
388 return; 317 return;
389 318
390 addr = (void *) ((unsigned long __force) token & PAGE_MASK); 319 addr = (void *) ((unsigned long __force) token & PAGE_MASK);
391
392 if ((size = im_free(addr)) == 0)
393 return;
394 320
395 address = (unsigned long)addr; 321 im_free(addr);
396 unmap_im_area(address, address + size);
397} 322}
398 323
399static int iounmap_subset_regions(unsigned long addr, unsigned long size) 324static int iounmap_subset_regions(unsigned long addr, unsigned long size)
diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c
index 3c0ccb2623ae..7f6e13a4b71e 100644
--- a/arch/ppc64/xmon/xmon.c
+++ b/arch/ppc64/xmon/xmon.c
@@ -2247,7 +2247,14 @@ scanhex(unsigned long *vp)
2247 tmpstr[i] = c; 2247 tmpstr[i] = c;
2248 } 2248 }
2249 tmpstr[i++] = 0; 2249 tmpstr[i++] = 0;
2250 *vp = kallsyms_lookup_name(tmpstr); 2250 *vp = 0;
2251 if (setjmp(bus_error_jmp) == 0) {
2252 catch_memory_errors = 1;
2253 sync();
2254 *vp = kallsyms_lookup_name(tmpstr);
2255 sync();
2256 }
2257 catch_memory_errors = 0;
2251 if (!(*vp)) { 2258 if (!(*vp)) {
2252 printf("unknown symbol '%s'\n", tmpstr); 2259 printf("unknown symbol '%s'\n", tmpstr);
2253 return 0; 2260 return 0;
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 01ae1964c938..c067435bae45 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -28,6 +28,7 @@
28//#include <linux/kernel_stat.h> 28//#include <linux/kernel_stat.h>
29#include <linux/notifier.h> 29#include <linux/notifier.h>
30#include <linux/cpu.h> 30#include <linux/cpu.h>
31#include <linux/workqueue.h>
31 32
32#include "appldata.h" 33#include "appldata.h"
33 34
@@ -133,9 +134,12 @@ static int appldata_interval = APPLDATA_CPU_INTERVAL;
133static int appldata_timer_active; 134static int appldata_timer_active;
134 135
135/* 136/*
136 * Tasklet 137 * Work queue
137 */ 138 */
138static struct tasklet_struct appldata_tasklet_struct; 139static struct workqueue_struct *appldata_wq;
140static void appldata_work_fn(void *data);
141static DECLARE_WORK(appldata_work, appldata_work_fn, NULL);
142
139 143
140/* 144/*
141 * Ops list 145 * Ops list
@@ -144,11 +148,11 @@ static DEFINE_SPINLOCK(appldata_ops_lock);
144static LIST_HEAD(appldata_ops_list); 148static LIST_HEAD(appldata_ops_list);
145 149
146 150
147/************************* timer, tasklet, DIAG ******************************/ 151/*************************** timer, work, DIAG *******************************/
148/* 152/*
149 * appldata_timer_function() 153 * appldata_timer_function()
150 * 154 *
151 * schedule tasklet and reschedule timer 155 * schedule work and reschedule timer
152 */ 156 */
153static void appldata_timer_function(unsigned long data, struct pt_regs *regs) 157static void appldata_timer_function(unsigned long data, struct pt_regs *regs)
154{ 158{
@@ -157,22 +161,22 @@ static void appldata_timer_function(unsigned long data, struct pt_regs *regs)
157 atomic_read(&appldata_expire_count)); 161 atomic_read(&appldata_expire_count));
158 if (atomic_dec_and_test(&appldata_expire_count)) { 162 if (atomic_dec_and_test(&appldata_expire_count)) {
159 atomic_set(&appldata_expire_count, num_online_cpus()); 163 atomic_set(&appldata_expire_count, num_online_cpus());
160 tasklet_schedule((struct tasklet_struct *) data); 164 queue_work(appldata_wq, (struct work_struct *) data);
161 } 165 }
162} 166}
163 167
164/* 168/*
165 * appldata_tasklet_function() 169 * appldata_work_fn()
166 * 170 *
167 * call data gathering function for each (active) module 171 * call data gathering function for each (active) module
168 */ 172 */
169static void appldata_tasklet_function(unsigned long data) 173static void appldata_work_fn(void *data)
170{ 174{
171 struct list_head *lh; 175 struct list_head *lh;
172 struct appldata_ops *ops; 176 struct appldata_ops *ops;
173 int i; 177 int i;
174 178
175 P_DEBUG(" -= Tasklet =-\n"); 179 P_DEBUG(" -= Work Queue =-\n");
176 i = 0; 180 i = 0;
177 spin_lock(&appldata_ops_lock); 181 spin_lock(&appldata_ops_lock);
178 list_for_each(lh, &appldata_ops_list) { 182 list_for_each(lh, &appldata_ops_list) {
@@ -231,7 +235,7 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
231 : "=d" (ry) : "d" (&(appldata_parameter_list)) : "cc"); 235 : "=d" (ry) : "d" (&(appldata_parameter_list)) : "cc");
232 return (int) ry; 236 return (int) ry;
233} 237}
234/********************** timer, tasklet, DIAG <END> ***************************/ 238/************************ timer, work, DIAG <END> ****************************/
235 239
236 240
237/****************************** /proc stuff **********************************/ 241/****************************** /proc stuff **********************************/
@@ -411,7 +415,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
411 struct list_head *lh; 415 struct list_head *lh;
412 416
413 found = 0; 417 found = 0;
414 spin_lock_bh(&appldata_ops_lock); 418 spin_lock(&appldata_ops_lock);
415 list_for_each(lh, &appldata_ops_list) { 419 list_for_each(lh, &appldata_ops_list) {
416 tmp_ops = list_entry(lh, struct appldata_ops, list); 420 tmp_ops = list_entry(lh, struct appldata_ops, list);
417 if (&tmp_ops->ctl_table[2] == ctl) { 421 if (&tmp_ops->ctl_table[2] == ctl) {
@@ -419,15 +423,15 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
419 } 423 }
420 } 424 }
421 if (!found) { 425 if (!found) {
422 spin_unlock_bh(&appldata_ops_lock); 426 spin_unlock(&appldata_ops_lock);
423 return -ENODEV; 427 return -ENODEV;
424 } 428 }
425 ops = ctl->data; 429 ops = ctl->data;
426 if (!try_module_get(ops->owner)) { // protect this function 430 if (!try_module_get(ops->owner)) { // protect this function
427 spin_unlock_bh(&appldata_ops_lock); 431 spin_unlock(&appldata_ops_lock);
428 return -ENODEV; 432 return -ENODEV;
429 } 433 }
430 spin_unlock_bh(&appldata_ops_lock); 434 spin_unlock(&appldata_ops_lock);
431 435
432 if (!*lenp || *ppos) { 436 if (!*lenp || *ppos) {
433 *lenp = 0; 437 *lenp = 0;
@@ -451,10 +455,11 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
451 return -EFAULT; 455 return -EFAULT;
452 } 456 }
453 457
454 spin_lock_bh(&appldata_ops_lock); 458 spin_lock(&appldata_ops_lock);
455 if ((buf[0] == '1') && (ops->active == 0)) { 459 if ((buf[0] == '1') && (ops->active == 0)) {
456 if (!try_module_get(ops->owner)) { // protect tasklet 460 // protect work queue callback
457 spin_unlock_bh(&appldata_ops_lock); 461 if (!try_module_get(ops->owner)) {
462 spin_unlock(&appldata_ops_lock);
458 module_put(ops->owner); 463 module_put(ops->owner);
459 return -ENODEV; 464 return -ENODEV;
460 } 465 }
@@ -485,7 +490,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
485 } 490 }
486 module_put(ops->owner); 491 module_put(ops->owner);
487 } 492 }
488 spin_unlock_bh(&appldata_ops_lock); 493 spin_unlock(&appldata_ops_lock);
489out: 494out:
490 *lenp = len; 495 *lenp = len;
491 *ppos += len; 496 *ppos += len;
@@ -529,7 +534,7 @@ int appldata_register_ops(struct appldata_ops *ops)
529 } 534 }
530 memset(ops->ctl_table, 0, 4*sizeof(struct ctl_table)); 535 memset(ops->ctl_table, 0, 4*sizeof(struct ctl_table));
531 536
532 spin_lock_bh(&appldata_ops_lock); 537 spin_lock(&appldata_ops_lock);
533 list_for_each(lh, &appldata_ops_list) { 538 list_for_each(lh, &appldata_ops_list) {
534 tmp_ops = list_entry(lh, struct appldata_ops, list); 539 tmp_ops = list_entry(lh, struct appldata_ops, list);
535 P_DEBUG("register_ops loop: %i) name = %s, ctl = %i\n", 540 P_DEBUG("register_ops loop: %i) name = %s, ctl = %i\n",
@@ -541,18 +546,18 @@ int appldata_register_ops(struct appldata_ops *ops)
541 APPLDATA_PROC_NAME_LENGTH) == 0) { 546 APPLDATA_PROC_NAME_LENGTH) == 0) {
542 P_ERROR("Name \"%s\" already registered!\n", ops->name); 547 P_ERROR("Name \"%s\" already registered!\n", ops->name);
543 kfree(ops->ctl_table); 548 kfree(ops->ctl_table);
544 spin_unlock_bh(&appldata_ops_lock); 549 spin_unlock(&appldata_ops_lock);
545 return -EBUSY; 550 return -EBUSY;
546 } 551 }
547 if (tmp_ops->ctl_nr == ops->ctl_nr) { 552 if (tmp_ops->ctl_nr == ops->ctl_nr) {
548 P_ERROR("ctl_nr %i already registered!\n", ops->ctl_nr); 553 P_ERROR("ctl_nr %i already registered!\n", ops->ctl_nr);
549 kfree(ops->ctl_table); 554 kfree(ops->ctl_table);
550 spin_unlock_bh(&appldata_ops_lock); 555 spin_unlock(&appldata_ops_lock);
551 return -EBUSY; 556 return -EBUSY;
552 } 557 }
553 } 558 }
554 list_add(&ops->list, &appldata_ops_list); 559 list_add(&ops->list, &appldata_ops_list);
555 spin_unlock_bh(&appldata_ops_lock); 560 spin_unlock(&appldata_ops_lock);
556 561
557 ops->ctl_table[0].ctl_name = CTL_APPLDATA; 562 ops->ctl_table[0].ctl_name = CTL_APPLDATA;
558 ops->ctl_table[0].procname = appldata_proc_name; 563 ops->ctl_table[0].procname = appldata_proc_name;
@@ -583,12 +588,12 @@ int appldata_register_ops(struct appldata_ops *ops)
583 */ 588 */
584void appldata_unregister_ops(struct appldata_ops *ops) 589void appldata_unregister_ops(struct appldata_ops *ops)
585{ 590{
586 spin_lock_bh(&appldata_ops_lock); 591 spin_lock(&appldata_ops_lock);
587 unregister_sysctl_table(ops->sysctl_header); 592 unregister_sysctl_table(ops->sysctl_header);
588 list_del(&ops->list); 593 list_del(&ops->list);
589 kfree(ops->ctl_table); 594 kfree(ops->ctl_table);
590 ops->ctl_table = NULL; 595 ops->ctl_table = NULL;
591 spin_unlock_bh(&appldata_ops_lock); 596 spin_unlock(&appldata_ops_lock);
592 P_INFO("%s-ops unregistered!\n", ops->name); 597 P_INFO("%s-ops unregistered!\n", ops->name);
593} 598}
594/********************** module-ops management <END> **************************/ 599/********************** module-ops management <END> **************************/
@@ -602,7 +607,7 @@ appldata_online_cpu(int cpu)
602 init_virt_timer(&per_cpu(appldata_timer, cpu)); 607 init_virt_timer(&per_cpu(appldata_timer, cpu));
603 per_cpu(appldata_timer, cpu).function = appldata_timer_function; 608 per_cpu(appldata_timer, cpu).function = appldata_timer_function;
604 per_cpu(appldata_timer, cpu).data = (unsigned long) 609 per_cpu(appldata_timer, cpu).data = (unsigned long)
605 &appldata_tasklet_struct; 610 &appldata_work;
606 atomic_inc(&appldata_expire_count); 611 atomic_inc(&appldata_expire_count);
607 spin_lock(&appldata_timer_lock); 612 spin_lock(&appldata_timer_lock);
608 __appldata_vtimer_setup(APPLDATA_MOD_TIMER); 613 __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
@@ -615,7 +620,7 @@ appldata_offline_cpu(int cpu)
615 del_virt_timer(&per_cpu(appldata_timer, cpu)); 620 del_virt_timer(&per_cpu(appldata_timer, cpu));
616 if (atomic_dec_and_test(&appldata_expire_count)) { 621 if (atomic_dec_and_test(&appldata_expire_count)) {
617 atomic_set(&appldata_expire_count, num_online_cpus()); 622 atomic_set(&appldata_expire_count, num_online_cpus());
618 tasklet_schedule(&appldata_tasklet_struct); 623 queue_work(appldata_wq, &appldata_work);
619 } 624 }
620 spin_lock(&appldata_timer_lock); 625 spin_lock(&appldata_timer_lock);
621 __appldata_vtimer_setup(APPLDATA_MOD_TIMER); 626 __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
@@ -648,7 +653,7 @@ static struct notifier_block __devinitdata appldata_nb = {
648/* 653/*
649 * appldata_init() 654 * appldata_init()
650 * 655 *
651 * init timer and tasklet, register /proc entries 656 * init timer, register /proc entries
652 */ 657 */
653static int __init appldata_init(void) 658static int __init appldata_init(void)
654{ 659{
@@ -657,6 +662,12 @@ static int __init appldata_init(void)
657 P_DEBUG("sizeof(parameter_list) = %lu\n", 662 P_DEBUG("sizeof(parameter_list) = %lu\n",
658 sizeof(struct appldata_parameter_list)); 663 sizeof(struct appldata_parameter_list));
659 664
665 appldata_wq = create_singlethread_workqueue("appldata");
666 if (!appldata_wq) {
667 P_ERROR("Could not create work queue\n");
668 return -ENOMEM;
669 }
670
660 for_each_online_cpu(i) 671 for_each_online_cpu(i)
661 appldata_online_cpu(i); 672 appldata_online_cpu(i);
662 673
@@ -670,7 +681,6 @@ static int __init appldata_init(void)
670 appldata_table[1].de->owner = THIS_MODULE; 681 appldata_table[1].de->owner = THIS_MODULE;
671#endif 682#endif
672 683
673 tasklet_init(&appldata_tasklet_struct, appldata_tasklet_function, 0);
674 P_DEBUG("Base interface initialized.\n"); 684 P_DEBUG("Base interface initialized.\n");
675 return 0; 685 return 0;
676} 686}
@@ -678,7 +688,7 @@ static int __init appldata_init(void)
678/* 688/*
679 * appldata_exit() 689 * appldata_exit()
680 * 690 *
681 * stop timer and tasklet, unregister /proc entries 691 * stop timer, unregister /proc entries
682 */ 692 */
683static void __exit appldata_exit(void) 693static void __exit appldata_exit(void)
684{ 694{
@@ -690,7 +700,7 @@ static void __exit appldata_exit(void)
690 /* 700 /*
691 * ops list should be empty, but just in case something went wrong... 701 * ops list should be empty, but just in case something went wrong...
692 */ 702 */
693 spin_lock_bh(&appldata_ops_lock); 703 spin_lock(&appldata_ops_lock);
694 list_for_each(lh, &appldata_ops_list) { 704 list_for_each(lh, &appldata_ops_list) {
695 ops = list_entry(lh, struct appldata_ops, list); 705 ops = list_entry(lh, struct appldata_ops, list);
696 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, 706 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
@@ -700,7 +710,7 @@ static void __exit appldata_exit(void)
700 "return code: %d\n", ops->name, rc); 710 "return code: %d\n", ops->name, rc);
701 } 711 }
702 } 712 }
703 spin_unlock_bh(&appldata_ops_lock); 713 spin_unlock(&appldata_ops_lock);
704 714
705 for_each_online_cpu(i) 715 for_each_online_cpu(i)
706 appldata_offline_cpu(i); 716 appldata_offline_cpu(i);
@@ -709,7 +719,7 @@ static void __exit appldata_exit(void)
709 719
710 unregister_sysctl_table(appldata_sysctl_header); 720 unregister_sysctl_table(appldata_sysctl_header);
711 721
712 tasklet_kill(&appldata_tasklet_struct); 722 destroy_workqueue(appldata_wq);
713 P_DEBUG("... module unloaded!\n"); 723 P_DEBUG("... module unloaded!\n");
714} 724}
715/**************************** init / exit <END> ******************************/ 725/**************************** init / exit <END> ******************************/
diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c
index 462ee9a84e76..f0e2fbed3d4c 100644
--- a/arch/s390/appldata/appldata_mem.c
+++ b/arch/s390/appldata/appldata_mem.c
@@ -68,7 +68,7 @@ struct appldata_mem_data {
68 u64 pgmajfault; /* page faults (major only) */ 68 u64 pgmajfault; /* page faults (major only) */
69// <-- New in 2.6 69// <-- New in 2.6
70 70
71} appldata_mem_data; 71} __attribute__((packed)) appldata_mem_data;
72 72
73 73
74static inline void appldata_debug_print(struct appldata_mem_data *mem_data) 74static inline void appldata_debug_print(struct appldata_mem_data *mem_data)
diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c
index dd61638d3027..2a4c7432db4a 100644
--- a/arch/s390/appldata/appldata_net_sum.c
+++ b/arch/s390/appldata/appldata_net_sum.c
@@ -57,7 +57,7 @@ struct appldata_net_sum_data {
57 u64 rx_dropped; /* no space in linux buffers */ 57 u64 rx_dropped; /* no space in linux buffers */
58 u64 tx_dropped; /* no space available in linux */ 58 u64 tx_dropped; /* no space available in linux */
59 u64 collisions; /* collisions while transmitting */ 59 u64 collisions; /* collisions while transmitting */
60} appldata_net_sum_data; 60} __attribute__((packed)) appldata_net_sum_data;
61 61
62 62
63static inline void appldata_print_debug(struct appldata_net_sum_data *net_data) 63static inline void appldata_print_debug(struct appldata_net_sum_data *net_data)
diff --git a/arch/s390/appldata/appldata_os.c b/arch/s390/appldata/appldata_os.c
index b83f07484551..e0a476bf4fd6 100644
--- a/arch/s390/appldata/appldata_os.c
+++ b/arch/s390/appldata/appldata_os.c
@@ -49,7 +49,7 @@ struct appldata_os_per_cpu {
49 u32 per_cpu_softirq; /* ... spent in softirqs */ 49 u32 per_cpu_softirq; /* ... spent in softirqs */
50 u32 per_cpu_iowait; /* ... spent while waiting for I/O */ 50 u32 per_cpu_iowait; /* ... spent while waiting for I/O */
51// <-- New in 2.6 51// <-- New in 2.6
52}; 52} __attribute__((packed));
53 53
54struct appldata_os_data { 54struct appldata_os_data {
55 u64 timestamp; 55 u64 timestamp;
@@ -75,7 +75,7 @@ struct appldata_os_data {
75 75
76 /* per cpu data */ 76 /* per cpu data */
77 struct appldata_os_per_cpu os_cpu[0]; 77 struct appldata_os_per_cpu os_cpu[0];
78}; 78} __attribute__((packed));
79 79
80static struct appldata_os_data *appldata_os_data; 80static struct appldata_os_data *appldata_os_data;
81 81
diff --git a/arch/s390/kernel/compat_ioctl.c b/arch/s390/kernel/compat_ioctl.c
index 03d03c6d3cbb..24a1e9f069a7 100644
--- a/arch/s390/kernel/compat_ioctl.c
+++ b/arch/s390/kernel/compat_ioctl.c
@@ -42,7 +42,6 @@ struct ioctl_trans ioctl_start[] = {
42#include "../../../fs/compat_ioctl.c" 42#include "../../../fs/compat_ioctl.c"
43 43
44/* s390 only ioctls */ 44/* s390 only ioctls */
45#if defined(CONFIG_DASD) || defined(CONFIG_DASD_MODULE)
46COMPATIBLE_IOCTL(DASDAPIVER) 45COMPATIBLE_IOCTL(DASDAPIVER)
47COMPATIBLE_IOCTL(BIODASDDISABLE) 46COMPATIBLE_IOCTL(BIODASDDISABLE)
48COMPATIBLE_IOCTL(BIODASDENABLE) 47COMPATIBLE_IOCTL(BIODASDENABLE)
@@ -59,16 +58,11 @@ COMPATIBLE_IOCTL(BIODASDPRRD)
59COMPATIBLE_IOCTL(BIODASDPSRD) 58COMPATIBLE_IOCTL(BIODASDPSRD)
60COMPATIBLE_IOCTL(BIODASDGATTR) 59COMPATIBLE_IOCTL(BIODASDGATTR)
61COMPATIBLE_IOCTL(BIODASDSATTR) 60COMPATIBLE_IOCTL(BIODASDSATTR)
62#if defined(CONFIG_DASD_CMB) || defined(CONFIG_DASD_CMB_MODULE)
63COMPATIBLE_IOCTL(BIODASDCMFENABLE) 61COMPATIBLE_IOCTL(BIODASDCMFENABLE)
64COMPATIBLE_IOCTL(BIODASDCMFDISABLE) 62COMPATIBLE_IOCTL(BIODASDCMFDISABLE)
65COMPATIBLE_IOCTL(BIODASDREADALLCMB) 63COMPATIBLE_IOCTL(BIODASDREADALLCMB)
66#endif
67#endif
68 64
69#if defined(CONFIG_S390_TAPE) || defined(CONFIG_S390_TAPE_MODULE)
70COMPATIBLE_IOCTL(TAPE390_DISPLAY) 65COMPATIBLE_IOCTL(TAPE390_DISPLAY)
71#endif
72 66
73/* s390 doesn't need handlers here */ 67/* s390 doesn't need handlers here */
74COMPATIBLE_IOCTL(TIOCGSERIAL) 68COMPATIBLE_IOCTL(TIOCGSERIAL)
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index b804c55bd919..fc8bf5e285f6 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -345,10 +345,25 @@ iplstart:
345 bno .Lnoreset 345 bno .Lnoreset
346 la %r2,.Lreset 346 la %r2,.Lreset
347 lhi %r3,26 347 lhi %r3,26
348 .long 0x83230008 348 diag %r2,%r3,8
349 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw
350.Lwaitrdrirq:
351 lpsw .Lrdrwaitpsw
352.Lrdrint:
353 c %r1,0xb8 # compare subchannel number
354 bne .Lwaitrdrirq
355 la %r5,.Lirb
356 tsch 0(%r5)
349.Lnoreset: 357.Lnoreset:
358 b .Lnoload
359
360 .align 8
361.Lrdrnewpsw:
362 .long 0x00080000,0x80000000+.Lrdrint
363.Lrdrwaitpsw:
364 .long 0x020a0000,0x80000000+.Lrdrint
350#endif 365#endif
351 366
352# 367#
353# everything loaded, go for it 368# everything loaded, go for it
354# 369#
@@ -517,10 +532,10 @@ startup:basr %r13,0 # get base
517 l %r2, .Lrcp2-.LPG1(%r13) # try with Read SCP 532 l %r2, .Lrcp2-.LPG1(%r13) # try with Read SCP
518 b .Lservicecall-.LPG1(%r13) 533 b .Lservicecall-.LPG1(%r13)
519.Lprocsccb: 534.Lprocsccb:
520 lh %r1,.Lscpincr1-PARMAREA(%r4) # use this one if != 0 535 lhi %r1,0
521 chi %r1,0x00 536 icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
522 jne .Lscnd 537 jnz .Lscnd
523 l %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one 538 l %r1,.Lscpincr2-PARMAREA+4(%r4) # otherwise use this one
524.Lscnd: 539.Lscnd:
525 xr %r3,%r3 # same logic 540 xr %r3,%r3 # same logic
526 ic %r3,.Lscpa1-PARMAREA(%r4) 541 ic %r3,.Lscpa1-PARMAREA(%r4)
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index 8366793bc371..f525c0c21250 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -344,10 +344,25 @@ iplstart:
344 bno .Lnoreset 344 bno .Lnoreset
345 la %r2,.Lreset 345 la %r2,.Lreset
346 lhi %r3,26 346 lhi %r3,26
347 .long 0x83230008 347 diag %r2,%r3,8
348 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw
349.Lwaitrdrirq:
350 lpsw .Lrdrwaitpsw
351.Lrdrint:
352 c %r1,0xb8 # compare subchannel number
353 bne .Lwaitrdrirq
354 la %r5,.Lirb
355 tsch 0(%r5)
348.Lnoreset: 356.Lnoreset:
357 b .Lnoload
358
359 .align 8
360.Lrdrnewpsw:
361 .long 0x00080000,0x80000000+.Lrdrint
362.Lrdrwaitpsw:
363 .long 0x020a0000,0x80000000+.Lrdrint
349#endif 364#endif
350 365
351# 366#
352# everything loaded, go for it 367# everything loaded, go for it
353# 368#
@@ -518,9 +533,9 @@ startup:basr %r13,0 # get base
518 l %r2,.Lrcp2-.LPG1(%r13) # try with Read SCP 533 l %r2,.Lrcp2-.LPG1(%r13) # try with Read SCP
519 b .Lservicecall-.LPG1(%r13) 534 b .Lservicecall-.LPG1(%r13)
520.Lprocsccb: 535.Lprocsccb:
521 lh %r1,.Lscpincr1-PARMAREA(%r4) # use this one if != 0 536 lghi %r1,0
522 chi %r1,0x00 537 icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
523 jne .Lscnd 538 jnz .Lscnd
524 lg %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one 539 lg %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one
525.Lscnd: 540.Lscnd:
526 xr %r3,%r3 # same logic 541 xr %r3,%r3 # same logic
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 26889366929a..06afa3103ace 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -40,6 +40,7 @@
40#include <asm/pgalloc.h> 40#include <asm/pgalloc.h>
41#include <asm/system.h> 41#include <asm/system.h>
42#include <asm/uaccess.h> 42#include <asm/uaccess.h>
43#include <asm/unistd.h>
43 44
44#ifdef CONFIG_S390_SUPPORT 45#ifdef CONFIG_S390_SUPPORT
45#include "compat_ptrace.h" 46#include "compat_ptrace.h"
@@ -130,13 +131,19 @@ static int
130peek_user(struct task_struct *child, addr_t addr, addr_t data) 131peek_user(struct task_struct *child, addr_t addr, addr_t data)
131{ 132{
132 struct user *dummy = NULL; 133 struct user *dummy = NULL;
133 addr_t offset, tmp; 134 addr_t offset, tmp, mask;
134 135
135 /* 136 /*
136 * Stupid gdb peeks/pokes the access registers in 64 bit with 137 * Stupid gdb peeks/pokes the access registers in 64 bit with
137 * an alignment of 4. Programmers from hell... 138 * an alignment of 4. Programmers from hell...
138 */ 139 */
139 if ((addr & 3) || addr > sizeof(struct user) - __ADDR_MASK) 140 mask = __ADDR_MASK;
141#ifdef CONFIG_ARCH_S390X
142 if (addr >= (addr_t) &dummy->regs.acrs &&
143 addr < (addr_t) &dummy->regs.orig_gpr2)
144 mask = 3;
145#endif
146 if ((addr & mask) || addr > sizeof(struct user) - __ADDR_MASK)
140 return -EIO; 147 return -EIO;
141 148
142 if (addr < (addr_t) &dummy->regs.acrs) { 149 if (addr < (addr_t) &dummy->regs.acrs) {
@@ -153,6 +160,16 @@ peek_user(struct task_struct *child, addr_t addr, addr_t data)
153 * access registers are stored in the thread structure 160 * access registers are stored in the thread structure
154 */ 161 */
155 offset = addr - (addr_t) &dummy->regs.acrs; 162 offset = addr - (addr_t) &dummy->regs.acrs;
163#ifdef CONFIG_ARCH_S390X
164 /*
165 * Very special case: old & broken 64 bit gdb reading
166 * from acrs[15]. Result is a 64 bit value. Read the
167 * 32 bit acrs[15] value and shift it by 32. Sick...
168 */
169 if (addr == (addr_t) &dummy->regs.acrs[15])
170 tmp = ((unsigned long) child->thread.acrs[15]) << 32;
171 else
172#endif
156 tmp = *(addr_t *)((addr_t) &child->thread.acrs + offset); 173 tmp = *(addr_t *)((addr_t) &child->thread.acrs + offset);
157 174
158 } else if (addr == (addr_t) &dummy->regs.orig_gpr2) { 175 } else if (addr == (addr_t) &dummy->regs.orig_gpr2) {
@@ -167,6 +184,9 @@ peek_user(struct task_struct *child, addr_t addr, addr_t data)
167 */ 184 */
168 offset = addr - (addr_t) &dummy->regs.fp_regs; 185 offset = addr - (addr_t) &dummy->regs.fp_regs;
169 tmp = *(addr_t *)((addr_t) &child->thread.fp_regs + offset); 186 tmp = *(addr_t *)((addr_t) &child->thread.fp_regs + offset);
187 if (addr == (addr_t) &dummy->regs.fp_regs.fpc)
188 tmp &= (unsigned long) FPC_VALID_MASK
189 << (BITS_PER_LONG - 32);
170 190
171 } else if (addr < (addr_t) (&dummy->regs.per_info + 1)) { 191 } else if (addr < (addr_t) (&dummy->regs.per_info + 1)) {
172 /* 192 /*
@@ -191,13 +211,19 @@ static int
191poke_user(struct task_struct *child, addr_t addr, addr_t data) 211poke_user(struct task_struct *child, addr_t addr, addr_t data)
192{ 212{
193 struct user *dummy = NULL; 213 struct user *dummy = NULL;
194 addr_t offset; 214 addr_t offset, mask;
195 215
196 /* 216 /*
197 * Stupid gdb peeks/pokes the access registers in 64 bit with 217 * Stupid gdb peeks/pokes the access registers in 64 bit with
198 * an alignment of 4. Programmers from hell indeed... 218 * an alignment of 4. Programmers from hell indeed...
199 */ 219 */
200 if ((addr & 3) || addr > sizeof(struct user) - __ADDR_MASK) 220 mask = __ADDR_MASK;
221#ifdef CONFIG_ARCH_S390X
222 if (addr >= (addr_t) &dummy->regs.acrs &&
223 addr < (addr_t) &dummy->regs.orig_gpr2)
224 mask = 3;
225#endif
226 if ((addr & mask) || addr > sizeof(struct user) - __ADDR_MASK)
201 return -EIO; 227 return -EIO;
202 228
203 if (addr < (addr_t) &dummy->regs.acrs) { 229 if (addr < (addr_t) &dummy->regs.acrs) {
@@ -224,6 +250,17 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data)
224 * access registers are stored in the thread structure 250 * access registers are stored in the thread structure
225 */ 251 */
226 offset = addr - (addr_t) &dummy->regs.acrs; 252 offset = addr - (addr_t) &dummy->regs.acrs;
253#ifdef CONFIG_ARCH_S390X
254 /*
255 * Very special case: old & broken 64 bit gdb writing
256 * to acrs[15] with a 64 bit value. Ignore the lower
257 * half of the value and write the upper 32 bit to
258 * acrs[15]. Sick...
259 */
260 if (addr == (addr_t) &dummy->regs.acrs[15])
261 child->thread.acrs[15] = (unsigned int) (data >> 32);
262 else
263#endif
227 *(addr_t *)((addr_t) &child->thread.acrs + offset) = data; 264 *(addr_t *)((addr_t) &child->thread.acrs + offset) = data;
228 265
229 } else if (addr == (addr_t) &dummy->regs.orig_gpr2) { 266 } else if (addr == (addr_t) &dummy->regs.orig_gpr2) {
@@ -237,7 +274,8 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data)
237 * floating point regs. are stored in the thread structure 274 * floating point regs. are stored in the thread structure
238 */ 275 */
239 if (addr == (addr_t) &dummy->regs.fp_regs.fpc && 276 if (addr == (addr_t) &dummy->regs.fp_regs.fpc &&
240 (data & ~FPC_VALID_MASK) != 0) 277 (data & ~((unsigned long) FPC_VALID_MASK
278 << (BITS_PER_LONG - 32))) != 0)
241 return -EINVAL; 279 return -EINVAL;
242 offset = addr - (addr_t) &dummy->regs.fp_regs; 280 offset = addr - (addr_t) &dummy->regs.fp_regs;
243 *(addr_t *)((addr_t) &child->thread.fp_regs + offset) = data; 281 *(addr_t *)((addr_t) &child->thread.fp_regs + offset) = data;
@@ -723,6 +761,13 @@ syscall_trace(struct pt_regs *regs, int entryexit)
723 ? 0x80 : 0)); 761 ? 0x80 : 0));
724 762
725 /* 763 /*
764 * If the debuffer has set an invalid system call number,
765 * we prepare to skip the system call restart handling.
766 */
767 if (!entryexit && regs->gprs[2] >= NR_syscalls)
768 regs->trap = -1;
769
770 /*
726 * this isn't the same as continuing with a signal, but it will do 771 * this isn't the same as continuing with a signal, but it will do
727 * for normal use. strace only continues with a signal if the 772 * for normal use. strace only continues with a signal if the
728 * stopping signal is not SIGTRAP. -brl 773 * stopping signal is not SIGTRAP. -brl
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 8b90e9528b91..ca34b6f34b38 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -668,7 +668,10 @@ asmlinkage void space_switch_exception(struct pt_regs * regs, long int_code)
668 668
669asmlinkage void kernel_stack_overflow(struct pt_regs * regs) 669asmlinkage void kernel_stack_overflow(struct pt_regs * regs)
670{ 670{
671 die("Kernel stack overflow", regs, 0); 671 bust_spinlocks(1);
672 printk("Kernel stack overflow.\n");
673 show_regs(regs);
674 bust_spinlocks(0);
672 panic("Corrupt kernel stack, can't continue."); 675 panic("Corrupt kernel stack, can't continue.");
673} 676}
674 677
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index f5a5bc09b8fa..2d5cb1385753 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -21,7 +21,7 @@
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22 22
23static char *sender = "VMRMSVM"; 23static char *sender = "VMRMSVM";
24module_param(sender, charp, 0); 24module_param(sender, charp, 0400);
25MODULE_PARM_DESC(sender, 25MODULE_PARM_DESC(sender,
26 "Guest name that may send SMSG messages (default VMRMSVM)"); 26 "Guest name that may send SMSG messages (default VMRMSVM)");
27 27
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 80306bc8c799..75fde949d125 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -207,7 +207,7 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection)
207 * we are not in an interrupt and that there is a 207 * we are not in an interrupt and that there is a
208 * user context. 208 * user context.
209 */ 209 */
210 if (user_address == 0 || in_interrupt() || !mm) 210 if (user_address == 0 || in_atomic() || !mm)
211 goto no_context; 211 goto no_context;
212 212
213 /* 213 /*
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c
index df5ac294c379..917b2f32f260 100644
--- a/arch/sh/kernel/sys_sh.c
+++ b/arch/sh/kernel/sys_sh.c
@@ -79,6 +79,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
79 (!vma || addr + len <= vma->vm_start)) 79 (!vma || addr + len <= vma->vm_start))
80 return addr; 80 return addr;
81 } 81 }
82 if (len <= mm->cached_hole_size) {
83 mm->cached_hole_size = 0;
84 mm->free_area_cache = TASK_UNMAPPED_BASE;
85 }
82 if (flags & MAP_PRIVATE) 86 if (flags & MAP_PRIVATE)
83 addr = PAGE_ALIGN(mm->free_area_cache); 87 addr = PAGE_ALIGN(mm->free_area_cache);
84 else 88 else
@@ -95,6 +99,7 @@ full_search:
95 */ 99 */
96 if (start_addr != TASK_UNMAPPED_BASE) { 100 if (start_addr != TASK_UNMAPPED_BASE) {
97 start_addr = addr = TASK_UNMAPPED_BASE; 101 start_addr = addr = TASK_UNMAPPED_BASE;
102 mm->cached_hole_size = 0;
98 goto full_search; 103 goto full_search;
99 } 104 }
100 return -ENOMEM; 105 return -ENOMEM;
@@ -106,6 +111,9 @@ full_search:
106 mm->free_area_cache = addr + len; 111 mm->free_area_cache = addr + len;
107 return addr; 112 return addr;
108 } 113 }
114 if (addr + mm->cached_hole_size < vma->vm_start)
115 mm->cached_hole_size = vma->vm_start - addr;
116
109 addr = vma->vm_end; 117 addr = vma->vm_end;
110 if (!(flags & MAP_PRIVATE)) 118 if (!(flags & MAP_PRIVATE))
111 addr = COLOUR_ALIGN(addr); 119 addr = COLOUR_ALIGN(addr);
diff --git a/arch/sh/lib/delay.c b/arch/sh/lib/delay.c
index 50b36037d86b..351714694d6d 100644
--- a/arch/sh/lib/delay.c
+++ b/arch/sh/lib/delay.c
@@ -24,7 +24,7 @@ inline void __const_udelay(unsigned long xloops)
24 __asm__("dmulu.l %0, %2\n\t" 24 __asm__("dmulu.l %0, %2\n\t"
25 "sts mach, %0" 25 "sts mach, %0"
26 : "=r" (xloops) 26 : "=r" (xloops)
27 : "0" (xloops), "r" (cpu_data[_smp_processor_id()].loops_per_jiffy) 27 : "0" (xloops), "r" (cpu_data[raw_smp_processor_id()].loops_per_jiffy)
28 : "macl", "mach"); 28 : "macl", "mach");
29 __delay(xloops * HZ); 29 __delay(xloops * HZ);
30} 30}
diff --git a/arch/sh/mm/hugetlbpage.c b/arch/sh/mm/hugetlbpage.c
index 1f897bab2318..95bb1a6c6060 100644
--- a/arch/sh/mm/hugetlbpage.c
+++ b/arch/sh/mm/hugetlbpage.c
@@ -24,7 +24,7 @@
24#include <asm/tlbflush.h> 24#include <asm/tlbflush.h>
25#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
26 26
27static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) 27pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
28{ 28{
29 pgd_t *pgd; 29 pgd_t *pgd;
30 pmd_t *pmd; 30 pmd_t *pmd;
@@ -39,7 +39,7 @@ static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
39 return pte; 39 return pte;
40} 40}
41 41
42static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) 42pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
43{ 43{
44 pgd_t *pgd; 44 pgd_t *pgd;
45 pmd_t *pmd; 45 pmd_t *pmd;
@@ -56,28 +56,34 @@ static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
56 56
57#define mk_pte_huge(entry) do { pte_val(entry) |= _PAGE_SZHUGE; } while (0) 57#define mk_pte_huge(entry) do { pte_val(entry) |= _PAGE_SZHUGE; } while (0)
58 58
59static void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma, 59void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
60 struct page *page, pte_t * page_table, int write_access) 60 pte_t *ptep, pte_t entry)
61{ 61{
62 unsigned long i; 62 int i;
63 pte_t entry;
64 63
65 add_mm_counter(mm, rss, HPAGE_SIZE / PAGE_SIZE); 64 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
65 set_pte_at(mm, addr, ptep, entry);
66 ptep++;
67 addr += PAGE_SIZE;
68 pte_val(entry) += PAGE_SIZE;
69 }
70}
66 71
67 if (write_access) 72pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
68 entry = pte_mkwrite(pte_mkdirty(mk_pte(page, 73 pte_t *ptep)
69 vma->vm_page_prot))); 74{
70 else 75 pte_t entry;
71 entry = pte_wrprotect(mk_pte(page, vma->vm_page_prot)); 76 int i;
72 entry = pte_mkyoung(entry);
73 mk_pte_huge(entry);
74 77
75 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { 78 entry = *ptep;
76 set_pte(page_table, entry);
77 page_table++;
78 79
79 pte_val(entry) += PAGE_SIZE; 80 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
81 pte_clear(mm, addr, ptep);
82 addr += PAGE_SIZE;
83 ptep++;
80 } 84 }
85
86 return entry;
81} 87}
82 88
83/* 89/*
@@ -92,79 +98,6 @@ int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
92 return 0; 98 return 0;
93} 99}
94 100
95int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
96 struct vm_area_struct *vma)
97{
98 pte_t *src_pte, *dst_pte, entry;
99 struct page *ptepage;
100 unsigned long addr = vma->vm_start;
101 unsigned long end = vma->vm_end;
102 int i;
103
104 while (addr < end) {
105 dst_pte = huge_pte_alloc(dst, addr);
106 if (!dst_pte)
107 goto nomem;
108 src_pte = huge_pte_offset(src, addr);
109 BUG_ON(!src_pte || pte_none(*src_pte));
110 entry = *src_pte;
111 ptepage = pte_page(entry);
112 get_page(ptepage);
113 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
114 set_pte(dst_pte, entry);
115 pte_val(entry) += PAGE_SIZE;
116 dst_pte++;
117 }
118 add_mm_counter(dst, rss, HPAGE_SIZE / PAGE_SIZE);
119 addr += HPAGE_SIZE;
120 }
121 return 0;
122
123nomem:
124 return -ENOMEM;
125}
126
127int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
128 struct page **pages, struct vm_area_struct **vmas,
129 unsigned long *position, int *length, int i)
130{
131 unsigned long vaddr = *position;
132 int remainder = *length;
133
134 WARN_ON(!is_vm_hugetlb_page(vma));
135
136 while (vaddr < vma->vm_end && remainder) {
137 if (pages) {
138 pte_t *pte;
139 struct page *page;
140
141 pte = huge_pte_offset(mm, vaddr);
142
143 /* hugetlb should be locked, and hence, prefaulted */
144 BUG_ON(!pte || pte_none(*pte));
145
146 page = pte_page(*pte);
147
148 WARN_ON(!PageCompound(page));
149
150 get_page(page);
151 pages[i] = page;
152 }
153
154 if (vmas)
155 vmas[i] = vma;
156
157 vaddr += PAGE_SIZE;
158 --remainder;
159 ++i;
160 }
161
162 *length = remainder;
163 *position = vaddr;
164
165 return i;
166}
167
168struct page *follow_huge_addr(struct mm_struct *mm, 101struct page *follow_huge_addr(struct mm_struct *mm,
169 unsigned long address, int write) 102 unsigned long address, int write)
170{ 103{
@@ -181,84 +114,3 @@ struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
181{ 114{
182 return NULL; 115 return NULL;
183} 116}
184
185void unmap_hugepage_range(struct vm_area_struct *vma,
186 unsigned long start, unsigned long end)
187{
188 struct mm_struct *mm = vma->vm_mm;
189 unsigned long address;
190 pte_t *pte;
191 struct page *page;
192 int i;
193
194 BUG_ON(start & (HPAGE_SIZE - 1));
195 BUG_ON(end & (HPAGE_SIZE - 1));
196
197 for (address = start; address < end; address += HPAGE_SIZE) {
198 pte = huge_pte_offset(mm, address);
199 BUG_ON(!pte);
200 if (pte_none(*pte))
201 continue;
202 page = pte_page(*pte);
203 put_page(page);
204 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
205 pte_clear(mm, address+(i*PAGE_SIZE), pte);
206 pte++;
207 }
208 }
209 add_mm_counter(mm, rss, -((end - start) >> PAGE_SHIFT));
210 flush_tlb_range(vma, start, end);
211}
212
213int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
214{
215 struct mm_struct *mm = current->mm;
216 unsigned long addr;
217 int ret = 0;
218
219 BUG_ON(vma->vm_start & ~HPAGE_MASK);
220 BUG_ON(vma->vm_end & ~HPAGE_MASK);
221
222 spin_lock(&mm->page_table_lock);
223 for (addr = vma->vm_start; addr < vma->vm_end; addr += HPAGE_SIZE) {
224 unsigned long idx;
225 pte_t *pte = huge_pte_alloc(mm, addr);
226 struct page *page;
227
228 if (!pte) {
229 ret = -ENOMEM;
230 goto out;
231 }
232 if (!pte_none(*pte))
233 continue;
234
235 idx = ((addr - vma->vm_start) >> HPAGE_SHIFT)
236 + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
237 page = find_get_page(mapping, idx);
238 if (!page) {
239 /* charge the fs quota first */
240 if (hugetlb_get_quota(mapping)) {
241 ret = -ENOMEM;
242 goto out;
243 }
244 page = alloc_huge_page();
245 if (!page) {
246 hugetlb_put_quota(mapping);
247 ret = -ENOMEM;
248 goto out;
249 }
250 ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
251 if (! ret) {
252 unlock_page(page);
253 } else {
254 hugetlb_put_quota(mapping);
255 free_huge_page(page);
256 goto out;
257 }
258 }
259 set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE);
260 }
261out:
262 spin_unlock(&mm->page_table_lock);
263 return ret;
264}
diff --git a/arch/sh64/mm/hugetlbpage.c b/arch/sh64/mm/hugetlbpage.c
index bcad2aefa4ee..dcd9c8a8baf8 100644
--- a/arch/sh64/mm/hugetlbpage.c
+++ b/arch/sh64/mm/hugetlbpage.c
@@ -24,7 +24,7 @@
24#include <asm/tlbflush.h> 24#include <asm/tlbflush.h>
25#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
26 26
27static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) 27pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
28{ 28{
29 pgd_t *pgd; 29 pgd_t *pgd;
30 pmd_t *pmd; 30 pmd_t *pmd;
@@ -39,7 +39,7 @@ static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
39 return pte; 39 return pte;
40} 40}
41 41
42static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) 42pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
43{ 43{
44 pgd_t *pgd; 44 pgd_t *pgd;
45 pmd_t *pmd; 45 pmd_t *pmd;
@@ -80,6 +80,20 @@ static void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma,
80 } 80 }
81} 81}
82 82
83pte_t huge_ptep_get_and_clear(pte_t *ptep)
84{
85 pte_t entry;
86
87 entry = *ptep;
88
89 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
90 pte_clear(pte);
91 pte++;
92 }
93
94 return entry;
95}
96
83/* 97/*
84 * This function checks for proper alignment of input addr and len parameters. 98 * This function checks for proper alignment of input addr and len parameters.
85 */ 99 */
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
index a2dea69b2f07..ec2e05028a10 100644
--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -384,7 +384,6 @@ void map_high_region(unsigned long start_pfn, unsigned long end_pfn)
384 struct page *page = pfn_to_page(tmp); 384 struct page *page = pfn_to_page(tmp);
385 385
386 ClearPageReserved(page); 386 ClearPageReserved(page);
387 set_bit(PG_highmem, &page->flags);
388 set_page_count(page, 1); 387 set_page_count(page, 1);
389 __free_page(page); 388 __free_page(page);
390 totalhigh_pages++; 389 totalhigh_pages++;
diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c
index 292983413ae2..2803bc7c2c79 100644
--- a/arch/sparc64/kernel/pci_iommu.c
+++ b/arch/sparc64/kernel/pci_iommu.c
@@ -8,6 +8,7 @@
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <linux/delay.h>
11 12
12#include <asm/pbm.h> 13#include <asm/pbm.h>
13 14
@@ -195,6 +196,34 @@ static iopte_t *alloc_consistent_cluster(struct pci_iommu *iommu, unsigned long
195 return NULL; 196 return NULL;
196} 197}
197 198
199static int iommu_alloc_ctx(struct pci_iommu *iommu)
200{
201 int lowest = iommu->ctx_lowest_free;
202 int sz = IOMMU_NUM_CTXS - lowest;
203 int n = find_next_zero_bit(iommu->ctx_bitmap, sz, lowest);
204
205 if (unlikely(n == sz)) {
206 n = find_next_zero_bit(iommu->ctx_bitmap, lowest, 1);
207 if (unlikely(n == lowest)) {
208 printk(KERN_WARNING "IOMMU: Ran out of contexts.\n");
209 n = 0;
210 }
211 }
212 if (n)
213 __set_bit(n, iommu->ctx_bitmap);
214
215 return n;
216}
217
218static inline void iommu_free_ctx(struct pci_iommu *iommu, int ctx)
219{
220 if (likely(ctx)) {
221 __clear_bit(ctx, iommu->ctx_bitmap);
222 if (ctx < iommu->ctx_lowest_free)
223 iommu->ctx_lowest_free = ctx;
224 }
225}
226
198/* Allocate and map kernel buffer of size SIZE using consistent mode 227/* Allocate and map kernel buffer of size SIZE using consistent mode
199 * DMA for PCI device PDEV. Return non-NULL cpu-side address if 228 * DMA for PCI device PDEV. Return non-NULL cpu-side address if
200 * successful and set *DMA_ADDRP to the PCI side dma address. 229 * successful and set *DMA_ADDRP to the PCI side dma address.
@@ -235,7 +264,7 @@ void *pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_ad
235 npages = size >> IO_PAGE_SHIFT; 264 npages = size >> IO_PAGE_SHIFT;
236 ctx = 0; 265 ctx = 0;
237 if (iommu->iommu_ctxflush) 266 if (iommu->iommu_ctxflush)
238 ctx = iommu->iommu_cur_ctx++; 267 ctx = iommu_alloc_ctx(iommu);
239 first_page = __pa(first_page); 268 first_page = __pa(first_page);
240 while (npages--) { 269 while (npages--) {
241 iopte_val(*iopte) = (IOPTE_CONSISTENT(ctx) | 270 iopte_val(*iopte) = (IOPTE_CONSISTENT(ctx) |
@@ -316,6 +345,8 @@ void pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu, dma_addr_
316 } 345 }
317 } 346 }
318 347
348 iommu_free_ctx(iommu, ctx);
349
319 spin_unlock_irqrestore(&iommu->lock, flags); 350 spin_unlock_irqrestore(&iommu->lock, flags);
320 351
321 order = get_order(size); 352 order = get_order(size);
@@ -359,7 +390,7 @@ dma_addr_t pci_map_single(struct pci_dev *pdev, void *ptr, size_t sz, int direct
359 base_paddr = __pa(oaddr & IO_PAGE_MASK); 390 base_paddr = __pa(oaddr & IO_PAGE_MASK);
360 ctx = 0; 391 ctx = 0;
361 if (iommu->iommu_ctxflush) 392 if (iommu->iommu_ctxflush)
362 ctx = iommu->iommu_cur_ctx++; 393 ctx = iommu_alloc_ctx(iommu);
363 if (strbuf->strbuf_enabled) 394 if (strbuf->strbuf_enabled)
364 iopte_protection = IOPTE_STREAMING(ctx); 395 iopte_protection = IOPTE_STREAMING(ctx);
365 else 396 else
@@ -379,6 +410,70 @@ bad:
379 return PCI_DMA_ERROR_CODE; 410 return PCI_DMA_ERROR_CODE;
380} 411}
381 412
413static void pci_strbuf_flush(struct pci_strbuf *strbuf, struct pci_iommu *iommu, u32 vaddr, unsigned long ctx, unsigned long npages, int direction)
414{
415 int limit;
416
417 if (strbuf->strbuf_ctxflush &&
418 iommu->iommu_ctxflush) {
419 unsigned long matchreg, flushreg;
420 u64 val;
421
422 flushreg = strbuf->strbuf_ctxflush;
423 matchreg = PCI_STC_CTXMATCH_ADDR(strbuf, ctx);
424
425 pci_iommu_write(flushreg, ctx);
426 val = pci_iommu_read(matchreg);
427 val &= 0xffff;
428 if (!val)
429 goto do_flush_sync;
430
431 while (val) {
432 if (val & 0x1)
433 pci_iommu_write(flushreg, ctx);
434 val >>= 1;
435 }
436 val = pci_iommu_read(matchreg);
437 if (unlikely(val)) {
438 printk(KERN_WARNING "pci_strbuf_flush: ctx flush "
439 "timeout matchreg[%lx] ctx[%lx]\n",
440 val, ctx);
441 goto do_page_flush;
442 }
443 } else {
444 unsigned long i;
445
446 do_page_flush:
447 for (i = 0; i < npages; i++, vaddr += IO_PAGE_SIZE)
448 pci_iommu_write(strbuf->strbuf_pflush, vaddr);
449 }
450
451do_flush_sync:
452 /* If the device could not have possibly put dirty data into
453 * the streaming cache, no flush-flag synchronization needs
454 * to be performed.
455 */
456 if (direction == PCI_DMA_TODEVICE)
457 return;
458
459 PCI_STC_FLUSHFLAG_INIT(strbuf);
460 pci_iommu_write(strbuf->strbuf_fsync, strbuf->strbuf_flushflag_pa);
461 (void) pci_iommu_read(iommu->write_complete_reg);
462
463 limit = 100000;
464 while (!PCI_STC_FLUSHFLAG_SET(strbuf)) {
465 limit--;
466 if (!limit)
467 break;
468 udelay(1);
469 membar("#LoadLoad");
470 }
471 if (!limit)
472 printk(KERN_WARNING "pci_strbuf_flush: flushflag timeout "
473 "vaddr[%08x] ctx[%lx] npages[%ld]\n",
474 vaddr, ctx, npages);
475}
476
382/* Unmap a single streaming mode DMA translation. */ 477/* Unmap a single streaming mode DMA translation. */
383void pci_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction) 478void pci_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction)
384{ 479{
@@ -386,7 +481,7 @@ void pci_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int
386 struct pci_iommu *iommu; 481 struct pci_iommu *iommu;
387 struct pci_strbuf *strbuf; 482 struct pci_strbuf *strbuf;
388 iopte_t *base; 483 iopte_t *base;
389 unsigned long flags, npages, i, ctx; 484 unsigned long flags, npages, ctx;
390 485
391 if (direction == PCI_DMA_NONE) 486 if (direction == PCI_DMA_NONE)
392 BUG(); 487 BUG();
@@ -414,29 +509,8 @@ void pci_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int
414 ctx = (iopte_val(*base) & IOPTE_CONTEXT) >> 47UL; 509 ctx = (iopte_val(*base) & IOPTE_CONTEXT) >> 47UL;
415 510
416 /* Step 1: Kick data out of streaming buffers if necessary. */ 511 /* Step 1: Kick data out of streaming buffers if necessary. */
417 if (strbuf->strbuf_enabled) { 512 if (strbuf->strbuf_enabled)
418 u32 vaddr = bus_addr; 513 pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
419
420 PCI_STC_FLUSHFLAG_INIT(strbuf);
421 if (strbuf->strbuf_ctxflush &&
422 iommu->iommu_ctxflush) {
423 unsigned long matchreg, flushreg;
424
425 flushreg = strbuf->strbuf_ctxflush;
426 matchreg = PCI_STC_CTXMATCH_ADDR(strbuf, ctx);
427 do {
428 pci_iommu_write(flushreg, ctx);
429 } while(((long)pci_iommu_read(matchreg)) < 0L);
430 } else {
431 for (i = 0; i < npages; i++, vaddr += IO_PAGE_SIZE)
432 pci_iommu_write(strbuf->strbuf_pflush, vaddr);
433 }
434
435 pci_iommu_write(strbuf->strbuf_fsync, strbuf->strbuf_flushflag_pa);
436 (void) pci_iommu_read(iommu->write_complete_reg);
437 while (!PCI_STC_FLUSHFLAG_SET(strbuf))
438 membar("#LoadLoad");
439 }
440 514
441 /* Step 2: Clear out first TSB entry. */ 515 /* Step 2: Clear out first TSB entry. */
442 iopte_make_dummy(iommu, base); 516 iopte_make_dummy(iommu, base);
@@ -444,6 +518,8 @@ void pci_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int
444 free_streaming_cluster(iommu, bus_addr - iommu->page_table_map_base, 518 free_streaming_cluster(iommu, bus_addr - iommu->page_table_map_base,
445 npages, ctx); 519 npages, ctx);
446 520
521 iommu_free_ctx(iommu, ctx);
522
447 spin_unlock_irqrestore(&iommu->lock, flags); 523 spin_unlock_irqrestore(&iommu->lock, flags);
448} 524}
449 525
@@ -583,7 +659,7 @@ int pci_map_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int
583 /* Step 4: Choose a context if necessary. */ 659 /* Step 4: Choose a context if necessary. */
584 ctx = 0; 660 ctx = 0;
585 if (iommu->iommu_ctxflush) 661 if (iommu->iommu_ctxflush)
586 ctx = iommu->iommu_cur_ctx++; 662 ctx = iommu_alloc_ctx(iommu);
587 663
588 /* Step 5: Create the mappings. */ 664 /* Step 5: Create the mappings. */
589 if (strbuf->strbuf_enabled) 665 if (strbuf->strbuf_enabled)
@@ -647,29 +723,8 @@ void pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems,
647 ctx = (iopte_val(*base) & IOPTE_CONTEXT) >> 47UL; 723 ctx = (iopte_val(*base) & IOPTE_CONTEXT) >> 47UL;
648 724
649 /* Step 1: Kick data out of streaming buffers if necessary. */ 725 /* Step 1: Kick data out of streaming buffers if necessary. */
650 if (strbuf->strbuf_enabled) { 726 if (strbuf->strbuf_enabled)
651 u32 vaddr = (u32) bus_addr; 727 pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
652
653 PCI_STC_FLUSHFLAG_INIT(strbuf);
654 if (strbuf->strbuf_ctxflush &&
655 iommu->iommu_ctxflush) {
656 unsigned long matchreg, flushreg;
657
658 flushreg = strbuf->strbuf_ctxflush;
659 matchreg = PCI_STC_CTXMATCH_ADDR(strbuf, ctx);
660 do {
661 pci_iommu_write(flushreg, ctx);
662 } while(((long)pci_iommu_read(matchreg)) < 0L);
663 } else {
664 for (i = 0; i < npages; i++, vaddr += IO_PAGE_SIZE)
665 pci_iommu_write(strbuf->strbuf_pflush, vaddr);
666 }
667
668 pci_iommu_write(strbuf->strbuf_fsync, strbuf->strbuf_flushflag_pa);
669 (void) pci_iommu_read(iommu->write_complete_reg);
670 while (!PCI_STC_FLUSHFLAG_SET(strbuf))
671 membar("#LoadLoad");
672 }
673 728
674 /* Step 2: Clear out first TSB entry. */ 729 /* Step 2: Clear out first TSB entry. */
675 iopte_make_dummy(iommu, base); 730 iopte_make_dummy(iommu, base);
@@ -677,6 +732,8 @@ void pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems,
677 free_streaming_cluster(iommu, bus_addr - iommu->page_table_map_base, 732 free_streaming_cluster(iommu, bus_addr - iommu->page_table_map_base,
678 npages, ctx); 733 npages, ctx);
679 734
735 iommu_free_ctx(iommu, ctx);
736
680 spin_unlock_irqrestore(&iommu->lock, flags); 737 spin_unlock_irqrestore(&iommu->lock, flags);
681} 738}
682 739
@@ -715,28 +772,7 @@ void pci_dma_sync_single_for_cpu(struct pci_dev *pdev, dma_addr_t bus_addr, size
715 } 772 }
716 773
717 /* Step 2: Kick data out of streaming buffers. */ 774 /* Step 2: Kick data out of streaming buffers. */
718 PCI_STC_FLUSHFLAG_INIT(strbuf); 775 pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
719 if (iommu->iommu_ctxflush &&
720 strbuf->strbuf_ctxflush) {
721 unsigned long matchreg, flushreg;
722
723 flushreg = strbuf->strbuf_ctxflush;
724 matchreg = PCI_STC_CTXMATCH_ADDR(strbuf, ctx);
725 do {
726 pci_iommu_write(flushreg, ctx);
727 } while(((long)pci_iommu_read(matchreg)) < 0L);
728 } else {
729 unsigned long i;
730
731 for (i = 0; i < npages; i++, bus_addr += IO_PAGE_SIZE)
732 pci_iommu_write(strbuf->strbuf_pflush, bus_addr);
733 }
734
735 /* Step 3: Perform flush synchronization sequence. */
736 pci_iommu_write(strbuf->strbuf_fsync, strbuf->strbuf_flushflag_pa);
737 (void) pci_iommu_read(iommu->write_complete_reg);
738 while (!PCI_STC_FLUSHFLAG_SET(strbuf))
739 membar("#LoadLoad");
740 776
741 spin_unlock_irqrestore(&iommu->lock, flags); 777 spin_unlock_irqrestore(&iommu->lock, flags);
742} 778}
@@ -749,7 +785,8 @@ void pci_dma_sync_sg_for_cpu(struct pci_dev *pdev, struct scatterlist *sglist, i
749 struct pcidev_cookie *pcp; 785 struct pcidev_cookie *pcp;
750 struct pci_iommu *iommu; 786 struct pci_iommu *iommu;
751 struct pci_strbuf *strbuf; 787 struct pci_strbuf *strbuf;
752 unsigned long flags, ctx; 788 unsigned long flags, ctx, npages, i;
789 u32 bus_addr;
753 790
754 pcp = pdev->sysdata; 791 pcp = pdev->sysdata;
755 iommu = pcp->pbm->iommu; 792 iommu = pcp->pbm->iommu;
@@ -772,36 +809,14 @@ void pci_dma_sync_sg_for_cpu(struct pci_dev *pdev, struct scatterlist *sglist, i
772 } 809 }
773 810
774 /* Step 2: Kick data out of streaming buffers. */ 811 /* Step 2: Kick data out of streaming buffers. */
775 PCI_STC_FLUSHFLAG_INIT(strbuf); 812 bus_addr = sglist[0].dma_address & IO_PAGE_MASK;
776 if (iommu->iommu_ctxflush && 813 for(i = 1; i < nelems; i++)
777 strbuf->strbuf_ctxflush) { 814 if (!sglist[i].dma_length)
778 unsigned long matchreg, flushreg; 815 break;
779 816 i--;
780 flushreg = strbuf->strbuf_ctxflush; 817 npages = (IO_PAGE_ALIGN(sglist[i].dma_address + sglist[i].dma_length)
781 matchreg = PCI_STC_CTXMATCH_ADDR(strbuf, ctx); 818 - bus_addr) >> IO_PAGE_SHIFT;
782 do { 819 pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
783 pci_iommu_write(flushreg, ctx);
784 } while (((long)pci_iommu_read(matchreg)) < 0L);
785 } else {
786 unsigned long i, npages;
787 u32 bus_addr;
788
789 bus_addr = sglist[0].dma_address & IO_PAGE_MASK;
790
791 for(i = 1; i < nelems; i++)
792 if (!sglist[i].dma_length)
793 break;
794 i--;
795 npages = (IO_PAGE_ALIGN(sglist[i].dma_address + sglist[i].dma_length) - bus_addr) >> IO_PAGE_SHIFT;
796 for (i = 0; i < npages; i++, bus_addr += IO_PAGE_SIZE)
797 pci_iommu_write(strbuf->strbuf_pflush, bus_addr);
798 }
799
800 /* Step 3: Perform flush synchronization sequence. */
801 pci_iommu_write(strbuf->strbuf_fsync, strbuf->strbuf_flushflag_pa);
802 (void) pci_iommu_read(iommu->write_complete_reg);
803 while (!PCI_STC_FLUSHFLAG_SET(strbuf))
804 membar("#LoadLoad");
805 820
806 spin_unlock_irqrestore(&iommu->lock, flags); 821 spin_unlock_irqrestore(&iommu->lock, flags);
807} 822}
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c
index 3567fa879e1f..534320ef0db2 100644
--- a/arch/sparc64/kernel/pci_psycho.c
+++ b/arch/sparc64/kernel/pci_psycho.c
@@ -1212,7 +1212,7 @@ static void __init psycho_iommu_init(struct pci_controller_info *p)
1212 1212
1213 /* Setup initial software IOMMU state. */ 1213 /* Setup initial software IOMMU state. */
1214 spin_lock_init(&iommu->lock); 1214 spin_lock_init(&iommu->lock);
1215 iommu->iommu_cur_ctx = 0; 1215 iommu->ctx_lowest_free = 1;
1216 1216
1217 /* Register addresses. */ 1217 /* Register addresses. */
1218 iommu->iommu_control = p->pbm_A.controller_regs + PSYCHO_IOMMU_CONTROL; 1218 iommu->iommu_control = p->pbm_A.controller_regs + PSYCHO_IOMMU_CONTROL;
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c
index 5525d1ec4af8..53d333b4a4e8 100644
--- a/arch/sparc64/kernel/pci_sabre.c
+++ b/arch/sparc64/kernel/pci_sabre.c
@@ -1265,7 +1265,7 @@ static void __init sabre_iommu_init(struct pci_controller_info *p,
1265 1265
1266 /* Setup initial software IOMMU state. */ 1266 /* Setup initial software IOMMU state. */
1267 spin_lock_init(&iommu->lock); 1267 spin_lock_init(&iommu->lock);
1268 iommu->iommu_cur_ctx = 0; 1268 iommu->ctx_lowest_free = 1;
1269 1269
1270 /* Register addresses. */ 1270 /* Register addresses. */
1271 iommu->iommu_control = p->pbm_A.controller_regs + SABRE_IOMMU_CONTROL; 1271 iommu->iommu_control = p->pbm_A.controller_regs + SABRE_IOMMU_CONTROL;
diff --git a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c
index e93fcadc3722..5753175b94e6 100644
--- a/arch/sparc64/kernel/pci_schizo.c
+++ b/arch/sparc64/kernel/pci_schizo.c
@@ -1753,7 +1753,7 @@ static void schizo_pbm_iommu_init(struct pci_pbm_info *pbm)
1753 1753
1754 /* Setup initial software IOMMU state. */ 1754 /* Setup initial software IOMMU state. */
1755 spin_lock_init(&iommu->lock); 1755 spin_lock_init(&iommu->lock);
1756 iommu->iommu_cur_ctx = 0; 1756 iommu->ctx_lowest_free = 1;
1757 1757
1758 /* Register addresses, SCHIZO has iommu ctx flushing. */ 1758 /* Register addresses, SCHIZO has iommu ctx flushing. */
1759 iommu->iommu_control = pbm->pbm_regs + SCHIZO_IOMMU_CONTROL; 1759 iommu->iommu_control = pbm->pbm_regs + SCHIZO_IOMMU_CONTROL;
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index 14d9c3a21b9a..89f5e019f24c 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -117,19 +117,42 @@ static void iommu_flush(struct sbus_iommu *iommu, u32 base, unsigned long npages
117 117
118#define STRBUF_TAG_VALID 0x02UL 118#define STRBUF_TAG_VALID 0x02UL
119 119
120static void strbuf_flush(struct sbus_iommu *iommu, u32 base, unsigned long npages) 120static void sbus_strbuf_flush(struct sbus_iommu *iommu, u32 base, unsigned long npages, int direction)
121{ 121{
122 iommu->strbuf_flushflag = 0UL; 122 unsigned long n;
123 while (npages--) 123 int limit;
124 upa_writeq(base + (npages << IO_PAGE_SHIFT), 124
125 n = npages;
126 while (n--)
127 upa_writeq(base + (n << IO_PAGE_SHIFT),
125 iommu->strbuf_regs + STRBUF_PFLUSH); 128 iommu->strbuf_regs + STRBUF_PFLUSH);
126 129
130 /* If the device could not have possibly put dirty data into
131 * the streaming cache, no flush-flag synchronization needs
132 * to be performed.
133 */
134 if (direction == SBUS_DMA_TODEVICE)
135 return;
136
137 iommu->strbuf_flushflag = 0UL;
138
127 /* Whoopee cushion! */ 139 /* Whoopee cushion! */
128 upa_writeq(__pa(&iommu->strbuf_flushflag), 140 upa_writeq(__pa(&iommu->strbuf_flushflag),
129 iommu->strbuf_regs + STRBUF_FSYNC); 141 iommu->strbuf_regs + STRBUF_FSYNC);
130 upa_readq(iommu->sbus_control_reg); 142 upa_readq(iommu->sbus_control_reg);
131 while (iommu->strbuf_flushflag == 0UL) 143
144 limit = 100000;
145 while (iommu->strbuf_flushflag == 0UL) {
146 limit--;
147 if (!limit)
148 break;
149 udelay(1);
132 membar("#LoadLoad"); 150 membar("#LoadLoad");
151 }
152 if (!limit)
153 printk(KERN_WARNING "sbus_strbuf_flush: flushflag timeout "
154 "vaddr[%08x] npages[%ld]\n",
155 base, npages);
133} 156}
134 157
135static iopte_t *alloc_streaming_cluster(struct sbus_iommu *iommu, unsigned long npages) 158static iopte_t *alloc_streaming_cluster(struct sbus_iommu *iommu, unsigned long npages)
@@ -406,7 +429,7 @@ void sbus_unmap_single(struct sbus_dev *sdev, dma_addr_t dma_addr, size_t size,
406 429
407 spin_lock_irqsave(&iommu->lock, flags); 430 spin_lock_irqsave(&iommu->lock, flags);
408 free_streaming_cluster(iommu, dma_base, size >> IO_PAGE_SHIFT); 431 free_streaming_cluster(iommu, dma_base, size >> IO_PAGE_SHIFT);
409 strbuf_flush(iommu, dma_base, size >> IO_PAGE_SHIFT); 432 sbus_strbuf_flush(iommu, dma_base, size >> IO_PAGE_SHIFT, direction);
410 spin_unlock_irqrestore(&iommu->lock, flags); 433 spin_unlock_irqrestore(&iommu->lock, flags);
411} 434}
412 435
@@ -569,7 +592,7 @@ void sbus_unmap_sg(struct sbus_dev *sdev, struct scatterlist *sg, int nents, int
569 iommu = sdev->bus->iommu; 592 iommu = sdev->bus->iommu;
570 spin_lock_irqsave(&iommu->lock, flags); 593 spin_lock_irqsave(&iommu->lock, flags);
571 free_streaming_cluster(iommu, dvma_base, size >> IO_PAGE_SHIFT); 594 free_streaming_cluster(iommu, dvma_base, size >> IO_PAGE_SHIFT);
572 strbuf_flush(iommu, dvma_base, size >> IO_PAGE_SHIFT); 595 sbus_strbuf_flush(iommu, dvma_base, size >> IO_PAGE_SHIFT, direction);
573 spin_unlock_irqrestore(&iommu->lock, flags); 596 spin_unlock_irqrestore(&iommu->lock, flags);
574} 597}
575 598
@@ -581,7 +604,7 @@ void sbus_dma_sync_single_for_cpu(struct sbus_dev *sdev, dma_addr_t base, size_t
581 size = (IO_PAGE_ALIGN(base + size) - (base & IO_PAGE_MASK)); 604 size = (IO_PAGE_ALIGN(base + size) - (base & IO_PAGE_MASK));
582 605
583 spin_lock_irqsave(&iommu->lock, flags); 606 spin_lock_irqsave(&iommu->lock, flags);
584 strbuf_flush(iommu, base & IO_PAGE_MASK, size >> IO_PAGE_SHIFT); 607 sbus_strbuf_flush(iommu, base & IO_PAGE_MASK, size >> IO_PAGE_SHIFT, direction);
585 spin_unlock_irqrestore(&iommu->lock, flags); 608 spin_unlock_irqrestore(&iommu->lock, flags);
586} 609}
587 610
@@ -605,7 +628,7 @@ void sbus_dma_sync_sg_for_cpu(struct sbus_dev *sdev, struct scatterlist *sg, int
605 size = IO_PAGE_ALIGN(sg[i].dma_address + sg[i].dma_length) - base; 628 size = IO_PAGE_ALIGN(sg[i].dma_address + sg[i].dma_length) - base;
606 629
607 spin_lock_irqsave(&iommu->lock, flags); 630 spin_lock_irqsave(&iommu->lock, flags);
608 strbuf_flush(iommu, base, size >> IO_PAGE_SHIFT); 631 sbus_strbuf_flush(iommu, base, size >> IO_PAGE_SHIFT, direction);
609 spin_unlock_irqrestore(&iommu->lock, flags); 632 spin_unlock_irqrestore(&iommu->lock, flags);
610} 633}
611 634
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index 12c3d84b7460..b7e6a91952b2 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -383,6 +383,17 @@ static void __init process_switch(char c)
383 /* Use PROM debug console. */ 383 /* Use PROM debug console. */
384 register_console(&prom_debug_console); 384 register_console(&prom_debug_console);
385 break; 385 break;
386 case 'P':
387 /* Force UltraSPARC-III P-Cache on. */
388 if (tlb_type != cheetah) {
389 printk("BOOT: Ignoring P-Cache force option.\n");
390 break;
391 }
392 cheetah_pcache_forced_on = 1;
393 add_taint(TAINT_MACHINE_CHECK);
394 cheetah_enable_pcache();
395 break;
396
386 default: 397 default:
387 printk("Unknown boot switch (-%c)\n", c); 398 printk("Unknown boot switch (-%c)\n", c);
388 break; 399 break;
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 6dff06a44e76..e5b9c7a27789 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -123,6 +123,9 @@ void __init smp_callin(void)
123 123
124 smp_setup_percpu_timer(); 124 smp_setup_percpu_timer();
125 125
126 if (cheetah_pcache_forced_on)
127 cheetah_enable_pcache();
128
126 local_irq_enable(); 129 local_irq_enable();
127 130
128 calibrate_delay(); 131 calibrate_delay();
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index 0077f02f4b37..5f8c822a2b4a 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -84,6 +84,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
84 return addr; 84 return addr;
85 } 85 }
86 86
87 if (len <= mm->cached_hole_size) {
88 mm->cached_hole_size = 0;
89 mm->free_area_cache = TASK_UNMAPPED_BASE;
90 }
87 start_addr = addr = mm->free_area_cache; 91 start_addr = addr = mm->free_area_cache;
88 92
89 task_size -= len; 93 task_size -= len;
@@ -103,6 +107,7 @@ full_search:
103 if (task_size < addr) { 107 if (task_size < addr) {
104 if (start_addr != TASK_UNMAPPED_BASE) { 108 if (start_addr != TASK_UNMAPPED_BASE) {
105 start_addr = addr = TASK_UNMAPPED_BASE; 109 start_addr = addr = TASK_UNMAPPED_BASE;
110 mm->cached_hole_size = 0;
106 goto full_search; 111 goto full_search;
107 } 112 }
108 return -ENOMEM; 113 return -ENOMEM;
@@ -114,6 +119,9 @@ full_search:
114 mm->free_area_cache = addr + len; 119 mm->free_area_cache = addr + len;
115 return addr; 120 return addr;
116 } 121 }
122 if (addr + mm->cached_hole_size < vma->vm_start)
123 mm->cached_hole_size = vma->vm_start - addr;
124
117 addr = vma->vm_end; 125 addr = vma->vm_end;
118 if (do_color_align) 126 if (do_color_align)
119 addr = COLOUR_ALIGN(addr, pgoff); 127 addr = COLOUR_ALIGN(addr, pgoff);
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 56b203a2af69..a9f4596d7c2b 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -421,6 +421,25 @@ asmlinkage void cee_log(unsigned long ce_status,
421 } 421 }
422} 422}
423 423
424int cheetah_pcache_forced_on;
425
426void cheetah_enable_pcache(void)
427{
428 unsigned long dcr;
429
430 printk("CHEETAH: Enabling P-Cache on cpu %d.\n",
431 smp_processor_id());
432
433 __asm__ __volatile__("ldxa [%%g0] %1, %0"
434 : "=r" (dcr)
435 : "i" (ASI_DCU_CONTROL_REG));
436 dcr |= (DCU_PE | DCU_HPE | DCU_SPE | DCU_SL);
437 __asm__ __volatile__("stxa %0, [%%g0] %1\n\t"
438 "membar #Sync"
439 : /* no outputs */
440 : "r" (dcr), "i" (ASI_DCU_CONTROL_REG));
441}
442
424/* Cheetah error trap handling. */ 443/* Cheetah error trap handling. */
425static unsigned long ecache_flush_physbase; 444static unsigned long ecache_flush_physbase;
426static unsigned long ecache_flush_linesize; 445static unsigned long ecache_flush_linesize;
diff --git a/arch/sparc64/lib/delay.c b/arch/sparc64/lib/delay.c
index f6b4c784d53e..e8808727617a 100644
--- a/arch/sparc64/lib/delay.c
+++ b/arch/sparc64/lib/delay.c
@@ -31,7 +31,7 @@ void __const_udelay(unsigned long n)
31{ 31{
32 n *= 4; 32 n *= 4;
33 33
34 n *= (cpu_data(_smp_processor_id()).udelay_val * (HZ/4)); 34 n *= (cpu_data(raw_smp_processor_id()).udelay_val * (HZ/4));
35 n >>= 32; 35 n >>= 32;
36 36
37 __delay(n + 1); 37 __delay(n + 1);
diff --git a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c
index 5a1f831b2de1..625cbb336a23 100644
--- a/arch/sparc64/mm/hugetlbpage.c
+++ b/arch/sparc64/mm/hugetlbpage.c
@@ -22,7 +22,7 @@
22#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
23#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
24 24
25static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) 25pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
26{ 26{
27 pgd_t *pgd; 27 pgd_t *pgd;
28 pud_t *pud; 28 pud_t *pud;
@@ -41,7 +41,7 @@ static pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
41 return pte; 41 return pte;
42} 42}
43 43
44static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) 44pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
45{ 45{
46 pgd_t *pgd; 46 pgd_t *pgd;
47 pud_t *pud; 47 pud_t *pud;
@@ -62,30 +62,34 @@ static pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
62 62
63#define mk_pte_huge(entry) do { pte_val(entry) |= _PAGE_SZHUGE; } while (0) 63#define mk_pte_huge(entry) do { pte_val(entry) |= _PAGE_SZHUGE; } while (0)
64 64
65static void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma, 65void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
66 unsigned long addr, 66 pte_t *ptep, pte_t entry)
67 struct page *page, pte_t * page_table, int write_access)
68{ 67{
69 unsigned long i; 68 int i;
70 pte_t entry; 69
70 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
71 set_pte_at(mm, addr, ptep, entry);
72 ptep++;
73 addr += PAGE_SIZE;
74 pte_val(entry) += PAGE_SIZE;
75 }
76}
71 77
72 add_mm_counter(mm, rss, HPAGE_SIZE / PAGE_SIZE); 78pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
79 pte_t *ptep)
80{
81 pte_t entry;
82 int i;
73 83
74 if (write_access) 84 entry = *ptep;
75 entry = pte_mkwrite(pte_mkdirty(mk_pte(page,
76 vma->vm_page_prot)));
77 else
78 entry = pte_wrprotect(mk_pte(page, vma->vm_page_prot));
79 entry = pte_mkyoung(entry);
80 mk_pte_huge(entry);
81 85
82 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { 86 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
83 set_pte_at(mm, addr, page_table, entry); 87 pte_clear(mm, addr, ptep);
84 page_table++;
85 addr += PAGE_SIZE; 88 addr += PAGE_SIZE;
86 89 ptep++;
87 pte_val(entry) += PAGE_SIZE;
88 } 90 }
91
92 return entry;
89} 93}
90 94
91/* 95/*
@@ -100,79 +104,6 @@ int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
100 return 0; 104 return 0;
101} 105}
102 106
103int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
104 struct vm_area_struct *vma)
105{
106 pte_t *src_pte, *dst_pte, entry;
107 struct page *ptepage;
108 unsigned long addr = vma->vm_start;
109 unsigned long end = vma->vm_end;
110 int i;
111
112 while (addr < end) {
113 dst_pte = huge_pte_alloc(dst, addr);
114 if (!dst_pte)
115 goto nomem;
116 src_pte = huge_pte_offset(src, addr);
117 BUG_ON(!src_pte || pte_none(*src_pte));
118 entry = *src_pte;
119 ptepage = pte_page(entry);
120 get_page(ptepage);
121 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
122 set_pte_at(dst, addr, dst_pte, entry);
123 pte_val(entry) += PAGE_SIZE;
124 dst_pte++;
125 addr += PAGE_SIZE;
126 }
127 add_mm_counter(dst, rss, HPAGE_SIZE / PAGE_SIZE);
128 }
129 return 0;
130
131nomem:
132 return -ENOMEM;
133}
134
135int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
136 struct page **pages, struct vm_area_struct **vmas,
137 unsigned long *position, int *length, int i)
138{
139 unsigned long vaddr = *position;
140 int remainder = *length;
141
142 WARN_ON(!is_vm_hugetlb_page(vma));
143
144 while (vaddr < vma->vm_end && remainder) {
145 if (pages) {
146 pte_t *pte;
147 struct page *page;
148
149 pte = huge_pte_offset(mm, vaddr);
150
151 /* hugetlb should be locked, and hence, prefaulted */
152 BUG_ON(!pte || pte_none(*pte));
153
154 page = pte_page(*pte);
155
156 WARN_ON(!PageCompound(page));
157
158 get_page(page);
159 pages[i] = page;
160 }
161
162 if (vmas)
163 vmas[i] = vma;
164
165 vaddr += PAGE_SIZE;
166 --remainder;
167 ++i;
168 }
169
170 *length = remainder;
171 *position = vaddr;
172
173 return i;
174}
175
176struct page *follow_huge_addr(struct mm_struct *mm, 107struct page *follow_huge_addr(struct mm_struct *mm,
177 unsigned long address, int write) 108 unsigned long address, int write)
178{ 109{
@@ -190,34 +121,6 @@ struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
190 return NULL; 121 return NULL;
191} 122}
192 123
193void unmap_hugepage_range(struct vm_area_struct *vma,
194 unsigned long start, unsigned long end)
195{
196 struct mm_struct *mm = vma->vm_mm;
197 unsigned long address;
198 pte_t *pte;
199 struct page *page;
200 int i;
201
202 BUG_ON(start & (HPAGE_SIZE - 1));
203 BUG_ON(end & (HPAGE_SIZE - 1));
204
205 for (address = start; address < end; address += HPAGE_SIZE) {
206 pte = huge_pte_offset(mm, address);
207 BUG_ON(!pte);
208 if (pte_none(*pte))
209 continue;
210 page = pte_page(*pte);
211 put_page(page);
212 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
213 pte_clear(mm, address+(i*PAGE_SIZE), pte);
214 pte++;
215 }
216 }
217 add_mm_counter(mm, rss, -((end - start) >> PAGE_SHIFT));
218 flush_tlb_range(vma, start, end);
219}
220
221static void context_reload(void *__data) 124static void context_reload(void *__data)
222{ 125{
223 struct mm_struct *mm = __data; 126 struct mm_struct *mm = __data;
@@ -226,12 +129,8 @@ static void context_reload(void *__data)
226 load_secondary_context(mm); 129 load_secondary_context(mm);
227} 130}
228 131
229int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma) 132void hugetlb_prefault_arch_hook(struct mm_struct *mm)
230{ 133{
231 struct mm_struct *mm = current->mm;
232 unsigned long addr;
233 int ret = 0;
234
235 /* On UltraSPARC-III+ and later, configure the second half of 134 /* On UltraSPARC-III+ and later, configure the second half of
236 * the Data-TLB for huge pages. 135 * the Data-TLB for huge pages.
237 */ 136 */
@@ -261,50 +160,4 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
261 } 160 }
262 spin_unlock(&ctx_alloc_lock); 161 spin_unlock(&ctx_alloc_lock);
263 } 162 }
264
265 BUG_ON(vma->vm_start & ~HPAGE_MASK);
266 BUG_ON(vma->vm_end & ~HPAGE_MASK);
267
268 spin_lock(&mm->page_table_lock);
269 for (addr = vma->vm_start; addr < vma->vm_end; addr += HPAGE_SIZE) {
270 unsigned long idx;
271 pte_t *pte = huge_pte_alloc(mm, addr);
272 struct page *page;
273
274 if (!pte) {
275 ret = -ENOMEM;
276 goto out;
277 }
278 if (!pte_none(*pte))
279 continue;
280
281 idx = ((addr - vma->vm_start) >> HPAGE_SHIFT)
282 + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
283 page = find_get_page(mapping, idx);
284 if (!page) {
285 /* charge the fs quota first */
286 if (hugetlb_get_quota(mapping)) {
287 ret = -ENOMEM;
288 goto out;
289 }
290 page = alloc_huge_page();
291 if (!page) {
292 hugetlb_put_quota(mapping);
293 ret = -ENOMEM;
294 goto out;
295 }
296 ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
297 if (! ret) {
298 unlock_page(page);
299 } else {
300 hugetlb_put_quota(mapping);
301 free_huge_page(page);
302 goto out;
303 }
304 }
305 set_huge_pte(mm, vma, addr, page, pte, vma->vm_flags & VM_WRITE);
306 }
307out:
308 spin_unlock(&mm->page_table_lock);
309 return ret;
310} 163}
diff --git a/arch/sparc64/solaris/socket.c b/arch/sparc64/solaris/socket.c
index ec8e074c4eac..06740582717e 100644
--- a/arch/sparc64/solaris/socket.c
+++ b/arch/sparc64/solaris/socket.c
@@ -317,8 +317,10 @@ asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsi
317 unsigned long *kcmsg; 317 unsigned long *kcmsg;
318 compat_size_t cmlen; 318 compat_size_t cmlen;
319 319
320 if(kern_msg.msg_controllen > sizeof(ctl) && 320 if (kern_msg.msg_controllen <= sizeof(compat_size_t))
321 kern_msg.msg_controllen <= 256) { 321 return -EINVAL;
322
323 if(kern_msg.msg_controllen > sizeof(ctl)) {
322 err = -ENOBUFS; 324 err = -ENOBUFS;
323 ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL); 325 ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL);
324 if(!ctl_buf) 326 if(!ctl_buf)
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index c5292181a664..b8e952c88fd1 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -35,6 +35,11 @@ config GENERIC_CALIBRATE_DELAY
35 bool 35 bool
36 default y 36 default y
37 37
38# Used in kernel/irq/manage.c and include/linux/irq.h
39config IRQ_RELEASE_METHOD
40 bool
41 default y
42
38menu "UML-specific options" 43menu "UML-specific options"
39 44
40config MODE_TT 45config MODE_TT
diff --git a/arch/um/Kconfig.debug b/arch/um/Kconfig.debug
index b89989de364d..bd41e4286d0d 100644
--- a/arch/um/Kconfig.debug
+++ b/arch/um/Kconfig.debug
@@ -2,10 +2,6 @@ menu "Kernel hacking"
2 2
3source "lib/Kconfig.debug" 3source "lib/Kconfig.debug"
4 4
5config FRAME_POINTER
6 bool
7 default y if DEBUG_INFO
8
9config PT_PROXY 5config PT_PROXY
10 bool "Enable ptrace proxy" 6 bool "Enable ptrace proxy"
11 depends on XTERM_CHAN && DEBUG_INFO && MODE_TT 7 depends on XTERM_CHAN && DEBUG_INFO && MODE_TT
diff --git a/arch/um/Kconfig_char b/arch/um/Kconfig_char
index 3e50fdb67626..62d87b71179b 100644
--- a/arch/um/Kconfig_char
+++ b/arch/um/Kconfig_char
@@ -204,5 +204,11 @@ config UML_RANDOM
204 http://sourceforge.net/projects/gkernel/). rngd periodically reads 204 http://sourceforge.net/projects/gkernel/). rngd periodically reads
205 /dev/hwrng and injects the entropy into /dev/random. 205 /dev/hwrng and injects the entropy into /dev/random.
206 206
207config MMAPPER
208 tristate "iomem emulation driver"
209 help
210 This driver allows a host file to be used as emulated IO memory inside
211 UML.
212
207endmenu 213endmenu
208 214
diff --git a/arch/um/Kconfig_x86_64 b/arch/um/Kconfig_x86_64
index fd8d7e8982b1..f162f50f0b17 100644
--- a/arch/um/Kconfig_x86_64
+++ b/arch/um/Kconfig_x86_64
@@ -6,6 +6,10 @@ config 64BIT
6 bool 6 bool
7 default y 7 default y
8 8
9config TOP_ADDR
10 hex
11 default 0x80000000
12
9config 3_LEVEL_PGTABLES 13config 3_LEVEL_PGTABLES
10 bool 14 bool
11 default y 15 default y
diff --git a/arch/um/Makefile b/arch/um/Makefile
index f2a0c40a9204..3f073902351f 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -122,7 +122,7 @@ endif
122CPPFLAGS_vmlinux.lds = $(shell echo -U$(SUBARCH) \ 122CPPFLAGS_vmlinux.lds = $(shell echo -U$(SUBARCH) \
123 -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \ 123 -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \
124 -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE-y) \ 124 -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE-y) \
125 -DKERNEL_STACK_SIZE=$(STACK_SIZE)) 125 -DKERNEL_STACK_SIZE=$(STACK_SIZE) -DSUBARCH=$(SUBARCH))
126 126
127#The wrappers will select whether using "malloc" or the kernel allocator. 127#The wrappers will select whether using "malloc" or the kernel allocator.
128LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc 128LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index 323f72c64cd2..b2de9916c32c 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -22,8 +22,8 @@ obj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o
22obj-$(CONFIG_SSL) += ssl.o 22obj-$(CONFIG_SSL) += ssl.o
23obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o 23obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o
24 24
25obj-$(CONFIG_UML_NET_SLIP) += slip.o 25obj-$(CONFIG_UML_NET_SLIP) += slip.o slip_common.o
26obj-$(CONFIG_UML_NET_SLIRP) += slirp.o 26obj-$(CONFIG_UML_NET_SLIRP) += slirp.o slip_common.o
27obj-$(CONFIG_UML_NET_DAEMON) += daemon.o 27obj-$(CONFIG_UML_NET_DAEMON) += daemon.o
28obj-$(CONFIG_UML_NET_MCAST) += mcast.o 28obj-$(CONFIG_UML_NET_MCAST) += mcast.o
29#obj-$(CONFIG_UML_NET_PCAP) += pcap.o $(PCAP) 29#obj-$(CONFIG_UML_NET_PCAP) += pcap.o $(PCAP)
@@ -41,6 +41,6 @@ obj-$(CONFIG_UML_WATCHDOG) += harddog.o
41obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o 41obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
42obj-$(CONFIG_UML_RANDOM) += random.o 42obj-$(CONFIG_UML_RANDOM) += random.o
43 43
44USER_OBJS := fd.o null.o pty.o tty.o xterm.o 44USER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o
45 45
46include arch/um/scripts/Makefile.rules 46include arch/um/scripts/Makefile.rules
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index 0150038af795..14a12d6b3df6 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -20,9 +20,17 @@
20#include "os.h" 20#include "os.h"
21 21
22#ifdef CONFIG_NOCONFIG_CHAN 22#ifdef CONFIG_NOCONFIG_CHAN
23
24/* The printk's here are wrong because we are complaining that there is no
25 * output device, but printk is printing to that output device. The user will
26 * never see the error. printf would be better, except it can't run on a
27 * kernel stack because it will overflow it.
28 * Use printk for now since that will avoid crashing.
29 */
30
23static void *not_configged_init(char *str, int device, struct chan_opts *opts) 31static void *not_configged_init(char *str, int device, struct chan_opts *opts)
24{ 32{
25 printf(KERN_ERR "Using a channel type which is configured out of " 33 printk(KERN_ERR "Using a channel type which is configured out of "
26 "UML\n"); 34 "UML\n");
27 return(NULL); 35 return(NULL);
28} 36}
@@ -30,27 +38,27 @@ static void *not_configged_init(char *str, int device, struct chan_opts *opts)
30static int not_configged_open(int input, int output, int primary, void *data, 38static int not_configged_open(int input, int output, int primary, void *data,
31 char **dev_out) 39 char **dev_out)
32{ 40{
33 printf(KERN_ERR "Using a channel type which is configured out of " 41 printk(KERN_ERR "Using a channel type which is configured out of "
34 "UML\n"); 42 "UML\n");
35 return(-ENODEV); 43 return(-ENODEV);
36} 44}
37 45
38static void not_configged_close(int fd, void *data) 46static void not_configged_close(int fd, void *data)
39{ 47{
40 printf(KERN_ERR "Using a channel type which is configured out of " 48 printk(KERN_ERR "Using a channel type which is configured out of "
41 "UML\n"); 49 "UML\n");
42} 50}
43 51
44static int not_configged_read(int fd, char *c_out, void *data) 52static int not_configged_read(int fd, char *c_out, void *data)
45{ 53{
46 printf(KERN_ERR "Using a channel type which is configured out of " 54 printk(KERN_ERR "Using a channel type which is configured out of "
47 "UML\n"); 55 "UML\n");
48 return(-EIO); 56 return(-EIO);
49} 57}
50 58
51static int not_configged_write(int fd, const char *buf, int len, void *data) 59static int not_configged_write(int fd, const char *buf, int len, void *data)
52{ 60{
53 printf(KERN_ERR "Using a channel type which is configured out of " 61 printk(KERN_ERR "Using a channel type which is configured out of "
54 "UML\n"); 62 "UML\n");
55 return(-EIO); 63 return(-EIO);
56} 64}
@@ -58,7 +66,7 @@ static int not_configged_write(int fd, const char *buf, int len, void *data)
58static int not_configged_console_write(int fd, const char *buf, int len, 66static int not_configged_console_write(int fd, const char *buf, int len,
59 void *data) 67 void *data)
60{ 68{
61 printf(KERN_ERR "Using a channel type which is configured out of " 69 printk(KERN_ERR "Using a channel type which is configured out of "
62 "UML\n"); 70 "UML\n");
63 return(-EIO); 71 return(-EIO);
64} 72}
@@ -66,7 +74,7 @@ static int not_configged_console_write(int fd, const char *buf, int len,
66static int not_configged_window_size(int fd, void *data, unsigned short *rows, 74static int not_configged_window_size(int fd, void *data, unsigned short *rows,
67 unsigned short *cols) 75 unsigned short *cols)
68{ 76{
69 printf(KERN_ERR "Using a channel type which is configured out of " 77 printk(KERN_ERR "Using a channel type which is configured out of "
70 "UML\n"); 78 "UML\n");
71 return(-ENODEV); 79 return(-ENODEV);
72} 80}
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index 583b8e137c33..5d3768156c92 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -143,22 +143,22 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out)
143{ 143{
144 struct winch_data data; 144 struct winch_data data;
145 unsigned long stack; 145 unsigned long stack;
146 int fds[2], pid, n, err; 146 int fds[2], n, err;
147 char c; 147 char c;
148 148
149 err = os_pipe(fds, 1, 1); 149 err = os_pipe(fds, 1, 1);
150 if(err < 0){ 150 if(err < 0){
151 printk("winch_tramp : os_pipe failed, err = %d\n", -err); 151 printk("winch_tramp : os_pipe failed, err = %d\n", -err);
152 return(err); 152 goto out;
153 } 153 }
154 154
155 data = ((struct winch_data) { .pty_fd = fd, 155 data = ((struct winch_data) { .pty_fd = fd,
156 .pipe_fd = fds[1], 156 .pipe_fd = fds[1],
157 .close_me = fds[0] } ); 157 .close_me = fds[0] } );
158 pid = run_helper_thread(winch_thread, &data, 0, &stack, 0); 158 err = run_helper_thread(winch_thread, &data, 0, &stack, 0);
159 if(pid < 0){ 159 if(err < 0){
160 printk("fork of winch_thread failed - errno = %d\n", errno); 160 printk("fork of winch_thread failed - errno = %d\n", errno);
161 return(pid); 161 goto out_close;
162 } 162 }
163 163
164 os_close_file(fds[1]); 164 os_close_file(fds[1]);
@@ -168,14 +168,22 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out)
168 printk("winch_tramp : failed to read synchronization byte\n"); 168 printk("winch_tramp : failed to read synchronization byte\n");
169 printk("read failed, err = %d\n", -n); 169 printk("read failed, err = %d\n", -n);
170 printk("fd %d will not support SIGWINCH\n", fd); 170 printk("fd %d will not support SIGWINCH\n", fd);
171 *fd_out = -1; 171 err = -EINVAL;
172 goto out_close1;
172 } 173 }
173 return(pid); 174 return err ;
175
176 out_close:
177 os_close_file(fds[1]);
178 out_close1:
179 os_close_file(fds[0]);
180 out:
181 return err;
174} 182}
175 183
176void register_winch(int fd, struct tty_struct *tty) 184void register_winch(int fd, struct tty_struct *tty)
177{ 185{
178 int pid, thread, thread_fd; 186 int pid, thread, thread_fd = -1;
179 int count; 187 int count;
180 char c = 1; 188 char c = 1;
181 189
@@ -186,7 +194,7 @@ void register_winch(int fd, struct tty_struct *tty)
186 if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd, 194 if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd,
187 tty) && (pid == -1)){ 195 tty) && (pid == -1)){
188 thread = winch_tramp(fd, tty, &thread_fd); 196 thread = winch_tramp(fd, tty, &thread_fd);
189 if(fd != -1){ 197 if(thread > 0){
190 register_winch_irq(thread_fd, fd, thread, tty); 198 register_winch_irq(thread_fd, fd, thread, tty);
191 199
192 count = os_write_file(thread_fd, &c, sizeof(c)); 200 count = os_write_file(thread_fd, &c, sizeof(c));
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 025d3be8aca4..0f59736db329 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -406,14 +406,12 @@ void line_disable(struct tty_struct *tty, int current_irq)
406 if(line->driver->read_irq == current_irq) 406 if(line->driver->read_irq == current_irq)
407 free_irq_later(line->driver->read_irq, tty); 407 free_irq_later(line->driver->read_irq, tty);
408 else { 408 else {
409 free_irq_by_irq_and_dev(line->driver->read_irq, tty);
410 free_irq(line->driver->read_irq, tty); 409 free_irq(line->driver->read_irq, tty);
411 } 410 }
412 411
413 if(line->driver->write_irq == current_irq) 412 if(line->driver->write_irq == current_irq)
414 free_irq_later(line->driver->write_irq, tty); 413 free_irq_later(line->driver->write_irq, tty);
415 else { 414 else {
416 free_irq_by_irq_and_dev(line->driver->write_irq, tty);
417 free_irq(line->driver->write_irq, tty); 415 free_irq(line->driver->write_irq, tty);
418 } 416 }
419 417
@@ -758,7 +756,6 @@ static void unregister_winch(struct tty_struct *tty)
758 if(winch->pid != -1) 756 if(winch->pid != -1)
759 os_kill_process(winch->pid, 1); 757 os_kill_process(winch->pid, 1);
760 758
761 free_irq_by_irq_and_dev(WINCH_IRQ, winch);
762 free_irq(WINCH_IRQ, winch); 759 free_irq(WINCH_IRQ, winch);
763 list_del(&winch->list); 760 list_del(&winch->list);
764 kfree(winch); 761 kfree(winch);
diff --git a/arch/um/drivers/mcast_kern.c b/arch/um/drivers/mcast_kern.c
index faf714e87b5b..217438cdef33 100644
--- a/arch/um/drivers/mcast_kern.c
+++ b/arch/um/drivers/mcast_kern.c
@@ -73,7 +73,6 @@ int mcast_setup(char *str, char **mac_out, void *data)
73 struct mcast_init *init = data; 73 struct mcast_init *init = data;
74 char *port_str = NULL, *ttl_str = NULL, *remain; 74 char *port_str = NULL, *ttl_str = NULL, *remain;
75 char *last; 75 char *last;
76 int n;
77 76
78 *init = ((struct mcast_init) 77 *init = ((struct mcast_init)
79 { .addr = "239.192.168.1", 78 { .addr = "239.192.168.1",
@@ -89,13 +88,12 @@ int mcast_setup(char *str, char **mac_out, void *data)
89 } 88 }
90 89
91 if(port_str != NULL){ 90 if(port_str != NULL){
92 n = simple_strtoul(port_str, &last, 10); 91 init->port = simple_strtoul(port_str, &last, 10);
93 if((*last != '\0') || (last == port_str)){ 92 if((*last != '\0') || (last == port_str)){
94 printk(KERN_ERR "mcast_setup - Bad port : '%s'\n", 93 printk(KERN_ERR "mcast_setup - Bad port : '%s'\n",
95 port_str); 94 port_str);
96 return(0); 95 return(0);
97 } 96 }
98 init->port = htons(n);
99 } 97 }
100 98
101 if(ttl_str != NULL){ 99 if(ttl_str != NULL){
diff --git a/arch/um/drivers/mcast_user.c b/arch/um/drivers/mcast_user.c
index 0fe1d9fa9139..7a0d115b29d0 100644
--- a/arch/um/drivers/mcast_user.c
+++ b/arch/um/drivers/mcast_user.c
@@ -38,7 +38,7 @@ static struct sockaddr_in *new_addr(char *addr, unsigned short port)
38 } 38 }
39 sin->sin_family = AF_INET; 39 sin->sin_family = AF_INET;
40 sin->sin_addr.s_addr = in_aton(addr); 40 sin->sin_addr.s_addr = in_aton(addr);
41 sin->sin_port = port; 41 sin->sin_port = htons(port);
42 return(sin); 42 return(sin);
43} 43}
44 44
@@ -55,28 +55,25 @@ static int mcast_open(void *data)
55 struct mcast_data *pri = data; 55 struct mcast_data *pri = data;
56 struct sockaddr_in *sin = pri->mcast_addr; 56 struct sockaddr_in *sin = pri->mcast_addr;
57 struct ip_mreq mreq; 57 struct ip_mreq mreq;
58 int fd, yes = 1; 58 int fd = -EINVAL, yes = 1, err = -EINVAL;;
59 59
60 60
61 if ((sin->sin_addr.s_addr == 0) || (sin->sin_port == 0)) { 61 if ((sin->sin_addr.s_addr == 0) || (sin->sin_port == 0))
62 fd = -EINVAL;
63 goto out; 62 goto out;
64 }
65 63
66 fd = socket(AF_INET, SOCK_DGRAM, 0); 64 fd = socket(AF_INET, SOCK_DGRAM, 0);
65
67 if (fd < 0){ 66 if (fd < 0){
68 printk("mcast_open : data socket failed, errno = %d\n", 67 printk("mcast_open : data socket failed, errno = %d\n",
69 errno); 68 errno);
70 fd = -ENOMEM; 69 fd = -errno;
71 goto out; 70 goto out;
72 } 71 }
73 72
74 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) { 73 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) {
75 printk("mcast_open: SO_REUSEADDR failed, errno = %d\n", 74 printk("mcast_open: SO_REUSEADDR failed, errno = %d\n",
76 errno); 75 errno);
77 os_close_file(fd); 76 goto out_close;
78 fd = -EINVAL;
79 goto out;
80 } 77 }
81 78
82 /* set ttl according to config */ 79 /* set ttl according to config */
@@ -84,26 +81,20 @@ static int mcast_open(void *data)
84 sizeof(pri->ttl)) < 0) { 81 sizeof(pri->ttl)) < 0) {
85 printk("mcast_open: IP_MULTICAST_TTL failed, error = %d\n", 82 printk("mcast_open: IP_MULTICAST_TTL failed, error = %d\n",
86 errno); 83 errno);
87 os_close_file(fd); 84 goto out_close;
88 fd = -EINVAL;
89 goto out;
90 } 85 }
91 86
92 /* set LOOP, so data does get fed back to local sockets */ 87 /* set LOOP, so data does get fed back to local sockets */
93 if (setsockopt(fd, SOL_IP, IP_MULTICAST_LOOP, &yes, sizeof(yes)) < 0) { 88 if (setsockopt(fd, SOL_IP, IP_MULTICAST_LOOP, &yes, sizeof(yes)) < 0) {
94 printk("mcast_open: IP_MULTICAST_LOOP failed, error = %d\n", 89 printk("mcast_open: IP_MULTICAST_LOOP failed, error = %d\n",
95 errno); 90 errno);
96 os_close_file(fd); 91 goto out_close;
97 fd = -EINVAL;
98 goto out;
99 } 92 }
100 93
101 /* bind socket to mcast address */ 94 /* bind socket to mcast address */
102 if (bind(fd, (struct sockaddr *) sin, sizeof(*sin)) < 0) { 95 if (bind(fd, (struct sockaddr *) sin, sizeof(*sin)) < 0) {
103 printk("mcast_open : data bind failed, errno = %d\n", errno); 96 printk("mcast_open : data bind failed, errno = %d\n", errno);
104 os_close_file(fd); 97 goto out_close;
105 fd = -EINVAL;
106 goto out;
107 } 98 }
108 99
109 /* subscribe to the multicast group */ 100 /* subscribe to the multicast group */
@@ -117,12 +108,15 @@ static int mcast_open(void *data)
117 "interface on the host.\n"); 108 "interface on the host.\n");
118 printk("eth0 should be configured in order to use the " 109 printk("eth0 should be configured in order to use the "
119 "multicast transport.\n"); 110 "multicast transport.\n");
120 os_close_file(fd); 111 goto out_close;
121 fd = -EINVAL;
122 } 112 }
123 113
124 out: 114 out:
125 return(fd); 115 return fd;
116
117 out_close:
118 os_close_file(fd);
119 return err;
126} 120}
127 121
128static void mcast_close(int fd, void *data) 122static void mcast_close(int fd, void *data)
@@ -164,14 +158,3 @@ struct net_user_info mcast_user_info = {
164 .delete_address = NULL, 158 .delete_address = NULL,
165 .max_packet = MAX_PACKET - ETH_HEADER_OTHER 159 .max_packet = MAX_PACKET - ETH_HEADER_OTHER
166}; 160};
167
168/*
169 * Overrides for Emacs so that we follow Linus's tabbing style.
170 * Emacs will notice this stuff at the end of the file and automatically
171 * adjust the settings for this buffer only. This must remain at the end
172 * of the file.
173 * ---------------------------------------------------------------------------
174 * Local variables:
175 * c-file-style: "linux"
176 * End:
177 */
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c
index a63231dffe05..a37a5ac13c22 100644
--- a/arch/um/drivers/mmapper_kern.c
+++ b/arch/um/drivers/mmapper_kern.c
@@ -18,6 +18,7 @@
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/smp_lock.h> 20#include <linux/smp_lock.h>
21#include <linux/miscdevice.h>
21#include <asm/uaccess.h> 22#include <asm/uaccess.h>
22#include <asm/irq.h> 23#include <asm/irq.h>
23#include <asm/pgtable.h> 24#include <asm/pgtable.h>
@@ -117,24 +118,39 @@ static struct file_operations mmapper_fops = {
117 .release = mmapper_release, 118 .release = mmapper_release,
118}; 119};
119 120
121static struct miscdevice mmapper_dev = {
122 .minor = MISC_DYNAMIC_MINOR,
123 .name = "mmapper",
124 .fops = &mmapper_fops
125};
126
120static int __init mmapper_init(void) 127static int __init mmapper_init(void)
121{ 128{
129 int err;
130
122 printk(KERN_INFO "Mapper v0.1\n"); 131 printk(KERN_INFO "Mapper v0.1\n");
123 132
124 v_buf = (char *) find_iomem("mmapper", &mmapper_size); 133 v_buf = (char *) find_iomem("mmapper", &mmapper_size);
125 if(mmapper_size == 0){ 134 if(mmapper_size == 0){
126 printk(KERN_ERR "mmapper_init - find_iomem failed\n"); 135 printk(KERN_ERR "mmapper_init - find_iomem failed\n");
127 return(0); 136 goto out;
128 } 137 }
129 138
130 p_buf = __pa(v_buf); 139 err = misc_register(&mmapper_dev);
140 if(err){
141 printk(KERN_ERR "mmapper - misc_register failed, err = %d\n",
142 err);
143 goto out;
144 }
131 145
132 devfs_mk_cdev(MKDEV(30, 0), S_IFCHR|S_IRUGO|S_IWUGO, "mmapper"); 146 p_buf = __pa(v_buf);
133 return(0); 147out:
148 return 0;
134} 149}
135 150
136static void mmapper_exit(void) 151static void mmapper_exit(void)
137{ 152{
153 misc_deregister(&mmapper_dev);
138} 154}
139 155
140module_init(mmapper_init); 156module_init(mmapper_init);
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 4eeaf88c1e97..5388a7428691 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -146,7 +146,6 @@ static int uml_net_close(struct net_device *dev)
146 netif_stop_queue(dev); 146 netif_stop_queue(dev);
147 spin_lock(&lp->lock); 147 spin_lock(&lp->lock);
148 148
149 free_irq_by_irq_and_dev(dev->irq, dev);
150 free_irq(dev->irq, dev); 149 free_irq(dev->irq, dev);
151 if(lp->close != NULL) 150 if(lp->close != NULL)
152 (*lp->close)(lp->fd, &lp->user); 151 (*lp->close)(lp->fd, &lp->user);
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c
index 47229fe4a813..3730d4f12713 100644
--- a/arch/um/drivers/net_user.c
+++ b/arch/um/drivers/net_user.c
@@ -32,7 +32,7 @@ int tap_open_common(void *dev, char *gate_addr)
32 return(0); 32 return(0);
33} 33}
34 34
35void tap_check_ips(char *gate_addr, char *eth_addr) 35void tap_check_ips(char *gate_addr, unsigned char *eth_addr)
36{ 36{
37 int tap_addr[4]; 37 int tap_addr[4];
38 38
diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c
index b5ee07472f79..c41efd207fcc 100644
--- a/arch/um/drivers/port_kern.c
+++ b/arch/um/drivers/port_kern.c
@@ -257,7 +257,6 @@ int port_wait(void *data)
257 * connection. Then we loop here throwing out failed 257 * connection. Then we loop here throwing out failed
258 * connections until a good one is found. 258 * connections until a good one is found.
259 */ 259 */
260 free_irq_by_irq_and_dev(TELNETD_IRQ, conn);
261 free_irq(TELNETD_IRQ, conn); 260 free_irq(TELNETD_IRQ, conn);
262 261
263 if(conn->fd >= 0) break; 262 if(conn->fd >= 0) break;
diff --git a/arch/um/drivers/random.c b/arch/um/drivers/random.c
index d43e9fab05a7..f9e22198e011 100644
--- a/arch/um/drivers/random.c
+++ b/arch/um/drivers/random.c
@@ -1,5 +1,10 @@
1/* Much of this ripped from hw_random.c */ 1/* Copyright (C) 2005 Jeff Dike <jdike@addtoit.com> */
2 2/* Much of this ripped from drivers/char/hw_random.c, see there for other
3 * copyright.
4 *
5 * This software may be used and distributed according to the terms
6 * of the GNU General Public License, incorporated herein by reference.
7 */
3#include <linux/module.h> 8#include <linux/module.h>
4#include <linux/fs.h> 9#include <linux/fs.h>
5#include <linux/miscdevice.h> 10#include <linux/miscdevice.h>
@@ -12,8 +17,6 @@
12 */ 17 */
13#define RNG_VERSION "1.0.0" 18#define RNG_VERSION "1.0.0"
14#define RNG_MODULE_NAME "random" 19#define RNG_MODULE_NAME "random"
15#define RNG_DRIVER_NAME RNG_MODULE_NAME " virtual driver " RNG_VERSION
16#define PFX RNG_MODULE_NAME ": "
17 20
18#define RNG_MISCDEV_MINOR 183 /* official */ 21#define RNG_MISCDEV_MINOR 183 /* official */
19 22
@@ -98,7 +101,7 @@ static int __init rng_init (void)
98 101
99 err = misc_register (&rng_miscdev); 102 err = misc_register (&rng_miscdev);
100 if (err) { 103 if (err) {
101 printk (KERN_ERR PFX "misc device register failed\n"); 104 printk (KERN_ERR RNG_MODULE_NAME ": misc device register failed\n");
102 goto err_out_cleanup_hw; 105 goto err_out_cleanup_hw;
103 } 106 }
104 107
@@ -120,3 +123,6 @@ static void __exit rng_cleanup (void)
120 123
121module_init (rng_init); 124module_init (rng_init);
122module_exit (rng_cleanup); 125module_exit (rng_cleanup);
126
127MODULE_DESCRIPTION("UML Host Random Number Generator (RNG) driver");
128MODULE_LICENSE("GPL");
diff --git a/arch/um/drivers/slip.h b/arch/um/drivers/slip.h
index 495f2f1b1420..bb0dab41c2e4 100644
--- a/arch/um/drivers/slip.h
+++ b/arch/um/drivers/slip.h
@@ -1,10 +1,7 @@
1#ifndef __UM_SLIP_H 1#ifndef __UM_SLIP_H
2#define __UM_SLIP_H 2#define __UM_SLIP_H
3 3
4#define BUF_SIZE 1500 4#include "slip_common.h"
5 /* two bytes each for a (pathological) max packet of escaped chars + *
6 * terminating END char + initial END char */
7#define ENC_BUF_SIZE (2 * BUF_SIZE + 2)
8 5
9struct slip_data { 6struct slip_data {
10 void *dev; 7 void *dev;
@@ -12,28 +9,12 @@ struct slip_data {
12 char *addr; 9 char *addr;
13 char *gate_addr; 10 char *gate_addr;
14 int slave; 11 int slave;
15 char ibuf[ENC_BUF_SIZE]; 12 struct slip_proto slip;
16 char obuf[ENC_BUF_SIZE];
17 int more; /* more data: do not read fd until ibuf has been drained */
18 int pos;
19 int esc;
20}; 13};
21 14
22extern struct net_user_info slip_user_info; 15extern struct net_user_info slip_user_info;
23 16
24extern int set_umn_addr(int fd, char *addr, char *ptp_addr);
25extern int slip_user_read(int fd, void *buf, int len, struct slip_data *pri); 17extern int slip_user_read(int fd, void *buf, int len, struct slip_data *pri);
26extern int slip_user_write(int fd, void *buf, int len, struct slip_data *pri); 18extern int slip_user_write(int fd, void *buf, int len, struct slip_data *pri);
27 19
28#endif 20#endif
29
30/*
31 * Overrides for Emacs so that we follow Linus's tabbing style.
32 * Emacs will notice this stuff at the end of the file and automatically
33 * adjust the settings for this buffer only. This must remain at the end
34 * of the file.
35 * ---------------------------------------------------------------------------
36 * Local variables:
37 * c-file-style: "linux"
38 * End:
39 */
diff --git a/arch/um/drivers/slip_common.c b/arch/um/drivers/slip_common.c
new file mode 100644
index 000000000000..e89cfc68fc3e
--- /dev/null
+++ b/arch/um/drivers/slip_common.c
@@ -0,0 +1,54 @@
1#include <string.h>
2#include "slip_common.h"
3#include "net_user.h"
4
5int slip_proto_read(int fd, void *buf, int len, struct slip_proto *slip)
6{
7 int i, n, size, start;
8
9 if(slip->more > 0){
10 i = 0;
11 while(i < slip->more){
12 size = slip_unesc(slip->ibuf[i++], slip->ibuf,
13 &slip->pos, &slip->esc);
14 if(size){
15 memcpy(buf, slip->ibuf, size);
16 memmove(slip->ibuf, &slip->ibuf[i],
17 slip->more - i);
18 slip->more = slip->more - i;
19 return size;
20 }
21 }
22 slip->more = 0;
23 }
24
25 n = net_read(fd, &slip->ibuf[slip->pos],
26 sizeof(slip->ibuf) - slip->pos);
27 if(n <= 0)
28 return n;
29
30 start = slip->pos;
31 for(i = 0; i < n; i++){
32 size = slip_unesc(slip->ibuf[start + i], slip->ibuf,&slip->pos,
33 &slip->esc);
34 if(size){
35 memcpy(buf, slip->ibuf, size);
36 memmove(slip->ibuf, &slip->ibuf[start+i+1],
37 n - (i + 1));
38 slip->more = n - (i + 1);
39 return size;
40 }
41 }
42 return 0;
43}
44
45int slip_proto_write(int fd, void *buf, int len, struct slip_proto *slip)
46{
47 int actual, n;
48
49 actual = slip_esc(buf, slip->obuf, len);
50 n = net_write(fd, slip->obuf, actual);
51 if(n < 0)
52 return n;
53 else return len;
54}
diff --git a/arch/um/drivers/slip_proto.h b/arch/um/drivers/slip_common.h
index 7206361ace45..2ae76d8f1be1 100644
--- a/arch/um/drivers/slip_proto.h
+++ b/arch/um/drivers/slip_common.h
@@ -1,10 +1,10 @@
1/* 1#ifndef __UM_SLIP_COMMON_H
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2#define __UM_SLIP_COMMON_H
3 * Licensed under the GPL
4 */
5 3
6#ifndef __UM_SLIP_PROTO_H__ 4#define BUF_SIZE 1500
7#define __UM_SLIP_PROTO_H__ 5 /* two bytes each for a (pathological) max packet of escaped chars + *
6 * terminating END char + initial END char */
7#define ENC_BUF_SIZE (2 * BUF_SIZE + 2)
8 8
9/* SLIP protocol characters. */ 9/* SLIP protocol characters. */
10#define SLIP_END 0300 /* indicates end of frame */ 10#define SLIP_END 0300 /* indicates end of frame */
@@ -12,7 +12,8 @@
12#define SLIP_ESC_END 0334 /* ESC ESC_END means END 'data' */ 12#define SLIP_ESC_END 0334 /* ESC ESC_END means END 'data' */
13#define SLIP_ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */ 13#define SLIP_ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */
14 14
15static inline int slip_unesc(unsigned char c,char *buf,int *pos, int *esc) 15static inline int slip_unesc(unsigned char c, unsigned char *buf, int *pos,
16 int *esc)
16{ 17{
17 int ret; 18 int ret;
18 19
@@ -79,15 +80,25 @@ static inline int slip_esc(unsigned char *s, unsigned char *d, int len)
79 return (ptr - d); 80 return (ptr - d);
80} 81}
81 82
82#endif 83struct slip_proto {
84 unsigned char ibuf[ENC_BUF_SIZE];
85 unsigned char obuf[ENC_BUF_SIZE];
86 int more; /* more data: do not read fd until ibuf has been drained */
87 int pos;
88 int esc;
89};
90
91#define SLIP_PROTO_INIT { \
92 .ibuf = { '\0' }, \
93 .obuf = { '\0' }, \
94 .more = 0, \
95 .pos = 0, \
96 .esc = 0 \
97}
83 98
84/* 99extern int slip_proto_read(int fd, void *buf, int len,
85 * Overrides for Emacs so that we follow Linus's tabbing style. 100 struct slip_proto *slip);
86 * Emacs will notice this stuff at the end of the file and automatically 101extern int slip_proto_write(int fd, void *buf, int len,
87 * adjust the settings for this buffer only. This must remain at the end 102 struct slip_proto *slip);
88 * of the file. 103
89 * --------------------------------------------------------------------------- 104#endif
90 * Local variables:
91 * c-file-style: "linux"
92 * End:
93 */
diff --git a/arch/um/drivers/slip_kern.c b/arch/um/drivers/slip_kern.c
index 0886eedba213..9a6f5c85f902 100644
--- a/arch/um/drivers/slip_kern.c
+++ b/arch/um/drivers/slip_kern.c
@@ -26,16 +26,16 @@ void slip_init(struct net_device *dev, void *data)
26 .addr = NULL, 26 .addr = NULL,
27 .gate_addr = init->gate_addr, 27 .gate_addr = init->gate_addr,
28 .slave = -1, 28 .slave = -1,
29 .ibuf = { '\0' }, 29 .slip = SLIP_PROTO_INIT,
30 .obuf = { '\0' },
31 .pos = 0,
32 .esc = 0,
33 .dev = dev }); 30 .dev = dev });
34 31
35 dev->init = NULL; 32 dev->init = NULL;
33 dev->header_cache_update = NULL;
34 dev->hard_header_cache = NULL;
35 dev->hard_header = NULL;
36 dev->hard_header_len = 0; 36 dev->hard_header_len = 0;
37 dev->addr_len = 4; 37 dev->addr_len = 0;
38 dev->type = ARPHRD_ETHER; 38 dev->type = ARPHRD_SLIP;
39 dev->tx_queue_len = 256; 39 dev->tx_queue_len = 256;
40 dev->flags = IFF_NOARP; 40 dev->flags = IFF_NOARP;
41 printk("SLIP backend - SLIP IP = %s\n", spri->gate_addr); 41 printk("SLIP backend - SLIP IP = %s\n", spri->gate_addr);
diff --git a/arch/um/drivers/slip_user.c b/arch/um/drivers/slip_user.c
index d94846b1b4cf..71af444e591f 100644
--- a/arch/um/drivers/slip_user.c
+++ b/arch/um/drivers/slip_user.c
@@ -13,7 +13,7 @@
13#include "user.h" 13#include "user.h"
14#include "net_user.h" 14#include "net_user.h"
15#include "slip.h" 15#include "slip.h"
16#include "slip_proto.h" 16#include "slip_common.h"
17#include "helper.h" 17#include "helper.h"
18#include "os.h" 18#include "os.h"
19 19
@@ -77,41 +77,51 @@ static int slip_tramp(char **argv, int fd)
77 err = os_pipe(fds, 1, 0); 77 err = os_pipe(fds, 1, 0);
78 if(err < 0){ 78 if(err < 0){
79 printk("slip_tramp : pipe failed, err = %d\n", -err); 79 printk("slip_tramp : pipe failed, err = %d\n", -err);
80 return(err); 80 goto out;
81 } 81 }
82 82
83 err = 0; 83 err = 0;
84 pe_data.stdin = fd; 84 pe_data.stdin = fd;
85 pe_data.stdout = fds[1]; 85 pe_data.stdout = fds[1];
86 pe_data.close_me = fds[0]; 86 pe_data.close_me = fds[0];
87 pid = run_helper(slip_pre_exec, &pe_data, argv, NULL); 87 err = run_helper(slip_pre_exec, &pe_data, argv, NULL);
88 if(err < 0)
89 goto out_close;
90 pid = err;
91
92 output_len = page_size();
93 output = um_kmalloc(output_len);
94 if(output == NULL){
95 printk("slip_tramp : failed to allocate output buffer\n");
96 os_kill_process(pid, 1);
97 err = -ENOMEM;
98 goto out_free;
99 }
88 100
89 if(pid < 0) err = pid; 101 os_close_file(fds[1]);
90 else { 102 read_output(fds[0], output, output_len);
91 output_len = page_size(); 103 printk("%s", output);
92 output = um_kmalloc(output_len); 104
93 if(output == NULL) 105 CATCH_EINTR(err = waitpid(pid, &status, 0));
94 printk("slip_tramp : failed to allocate output " 106 if(err < 0)
95 "buffer\n"); 107 err = errno;
96 108 else if(!WIFEXITED(status) || (WEXITSTATUS(status) != 0)){
97 os_close_file(fds[1]); 109 printk("'%s' didn't exit with status 0\n", argv[0]);
98 read_output(fds[0], output, output_len); 110 err = -EINVAL;
99 if(output != NULL){
100 printk("%s", output);
101 kfree(output);
102 }
103 CATCH_EINTR(err = waitpid(pid, &status, 0));
104 if(err < 0)
105 err = errno;
106 else if(!WIFEXITED(status) || (WEXITSTATUS(status) != 0)){
107 printk("'%s' didn't exit with status 0\n", argv[0]);
108 err = -EINVAL;
109 }
110 } 111 }
112 else err = 0;
111 113
112 os_close_file(fds[0]); 114 os_close_file(fds[0]);
113 115
114 return(err); 116out_free:
117 kfree(output);
118 return err;
119
120out_close:
121 os_close_file(fds[0]);
122 os_close_file(fds[1]);
123out:
124 return err;
115} 125}
116 126
117static int slip_open(void *data) 127static int slip_open(void *data)
@@ -123,21 +133,26 @@ static int slip_open(void *data)
123 NULL }; 133 NULL };
124 int sfd, mfd, err; 134 int sfd, mfd, err;
125 135
126 mfd = get_pty(); 136 err = get_pty();
127 if(mfd < 0){ 137 if(err < 0){
128 printk("umn : Failed to open pty, err = %d\n", -mfd); 138 printk("slip-open : Failed to open pty, err = %d\n", -err);
129 return(mfd); 139 goto out;
130 } 140 }
131 sfd = os_open_file(ptsname(mfd), of_rdwr(OPENFLAGS()), 0); 141 mfd = err;
132 if(sfd < 0){ 142
133 printk("Couldn't open tty for slip line, err = %d\n", -sfd); 143 err = os_open_file(ptsname(mfd), of_rdwr(OPENFLAGS()), 0);
134 os_close_file(mfd); 144 if(err < 0){
135 return(sfd); 145 printk("Couldn't open tty for slip line, err = %d\n", -err);
146 goto out_close;
136 } 147 }
137 if(set_up_tty(sfd)) return(-1); 148 sfd = err;
149
150 if(set_up_tty(sfd))
151 goto out_close2;
152
138 pri->slave = sfd; 153 pri->slave = sfd;
139 pri->pos = 0; 154 pri->slip.pos = 0;
140 pri->esc = 0; 155 pri->slip.esc = 0;
141 if(pri->gate_addr != NULL){ 156 if(pri->gate_addr != NULL){
142 sprintf(version_buf, "%d", UML_NET_VERSION); 157 sprintf(version_buf, "%d", UML_NET_VERSION);
143 strcpy(gate_buf, pri->gate_addr); 158 strcpy(gate_buf, pri->gate_addr);
@@ -146,12 +161,12 @@ static int slip_open(void *data)
146 161
147 if(err < 0){ 162 if(err < 0){
148 printk("slip_tramp failed - err = %d\n", -err); 163 printk("slip_tramp failed - err = %d\n", -err);
149 return(err); 164 goto out_close2;
150 } 165 }
151 err = os_get_ifname(pri->slave, pri->name); 166 err = os_get_ifname(pri->slave, pri->name);
152 if(err < 0){ 167 if(err < 0){
153 printk("get_ifname failed, err = %d\n", -err); 168 printk("get_ifname failed, err = %d\n", -err);
154 return(err); 169 goto out_close2;
155 } 170 }
156 iter_addresses(pri->dev, open_addr, pri->name); 171 iter_addresses(pri->dev, open_addr, pri->name);
157 } 172 }
@@ -160,10 +175,16 @@ static int slip_open(void *data)
160 if(err < 0){ 175 if(err < 0){
161 printk("Failed to set slip discipline encapsulation - " 176 printk("Failed to set slip discipline encapsulation - "
162 "err = %d\n", -err); 177 "err = %d\n", -err);
163 return(err); 178 goto out_close2;
164 } 179 }
165 } 180 }
166 return(mfd); 181 return(mfd);
182out_close2:
183 os_close_file(sfd);
184out_close:
185 os_close_file(mfd);
186out:
187 return err;
167} 188}
168 189
169static void slip_close(int fd, void *data) 190static void slip_close(int fd, void *data)
@@ -190,48 +211,12 @@ static void slip_close(int fd, void *data)
190 211
191int slip_user_read(int fd, void *buf, int len, struct slip_data *pri) 212int slip_user_read(int fd, void *buf, int len, struct slip_data *pri)
192{ 213{
193 int i, n, size, start; 214 return slip_proto_read(fd, buf, len, &pri->slip);
194
195 if(pri->more>0) {
196 i = 0;
197 while(i < pri->more) {
198 size = slip_unesc(pri->ibuf[i++],
199 pri->ibuf, &pri->pos, &pri->esc);
200 if(size){
201 memcpy(buf, pri->ibuf, size);
202 memmove(pri->ibuf, &pri->ibuf[i], pri->more-i);
203 pri->more=pri->more-i;
204 return(size);
205 }
206 }
207 pri->more=0;
208 }
209
210 n = net_read(fd, &pri->ibuf[pri->pos], sizeof(pri->ibuf) - pri->pos);
211 if(n <= 0) return(n);
212
213 start = pri->pos;
214 for(i = 0; i < n; i++){
215 size = slip_unesc(pri->ibuf[start + i],
216 pri->ibuf, &pri->pos, &pri->esc);
217 if(size){
218 memcpy(buf, pri->ibuf, size);
219 memmove(pri->ibuf, &pri->ibuf[start+i+1], n-(i+1));
220 pri->more=n-(i+1);
221 return(size);
222 }
223 }
224 return(0);
225} 215}
226 216
227int slip_user_write(int fd, void *buf, int len, struct slip_data *pri) 217int slip_user_write(int fd, void *buf, int len, struct slip_data *pri)
228{ 218{
229 int actual, n; 219 return slip_proto_write(fd, buf, len, &pri->slip);
230
231 actual = slip_esc(buf, pri->obuf, len);
232 n = net_write(fd, pri->obuf, actual);
233 if(n < 0) return(n);
234 else return(len);
235} 220}
236 221
237static int slip_set_mtu(int mtu, void *data) 222static int slip_set_mtu(int mtu, void *data)
@@ -267,14 +252,3 @@ struct net_user_info slip_user_info = {
267 .delete_address = slip_del_addr, 252 .delete_address = slip_del_addr,
268 .max_packet = BUF_SIZE 253 .max_packet = BUF_SIZE
269}; 254};
270
271/*
272 * Overrides for Emacs so that we follow Linus's tabbing style.
273 * Emacs will notice this stuff at the end of the file and automatically
274 * adjust the settings for this buffer only. This must remain at the end
275 * of the file.
276 * ---------------------------------------------------------------------------
277 * Local variables:
278 * c-file-style: "linux"
279 * End:
280 */
diff --git a/arch/um/drivers/slirp.h b/arch/um/drivers/slirp.h
index 04e407d1e44a..6cf88ab580c9 100644
--- a/arch/um/drivers/slirp.h
+++ b/arch/um/drivers/slirp.h
@@ -1,10 +1,7 @@
1#ifndef __UM_SLIRP_H 1#ifndef __UM_SLIRP_H
2#define __UM_SLIRP_H 2#define __UM_SLIRP_H
3 3
4#define BUF_SIZE 1500 4#include "slip_common.h"
5 /* two bytes each for a (pathological) max packet of escaped chars + *
6 * terminating END char + initial END char */
7#define ENC_BUF_SIZE (2 * BUF_SIZE + 2)
8 5
9#define SLIRP_MAX_ARGS 100 6#define SLIRP_MAX_ARGS 100
10/* 7/*
@@ -24,28 +21,13 @@ struct slirp_data {
24 struct arg_list_dummy_wrapper argw; 21 struct arg_list_dummy_wrapper argw;
25 int pid; 22 int pid;
26 int slave; 23 int slave;
27 char ibuf[ENC_BUF_SIZE]; 24 struct slip_proto slip;
28 char obuf[ENC_BUF_SIZE];
29 int more; /* more data: do not read fd until ibuf has been drained */
30 int pos;
31 int esc;
32}; 25};
33 26
34extern struct net_user_info slirp_user_info; 27extern struct net_user_info slirp_user_info;
35 28
36extern int set_umn_addr(int fd, char *addr, char *ptp_addr);
37extern int slirp_user_read(int fd, void *buf, int len, struct slirp_data *pri); 29extern int slirp_user_read(int fd, void *buf, int len, struct slirp_data *pri);
38extern int slirp_user_write(int fd, void *buf, int len, struct slirp_data *pri); 30extern int slirp_user_write(int fd, void *buf, int len,
31 struct slirp_data *pri);
39 32
40#endif 33#endif
41
42/*
43 * Overrides for Emacs so that we follow Linus's tabbing style.
44 * Emacs will notice this stuff at the end of the file and automatically
45 * adjust the settings for this buffer only. This must remain at the end
46 * of the file.
47 * ---------------------------------------------------------------------------
48 * Local variables:
49 * c-file-style: "linux"
50 * End:
51 */
diff --git a/arch/um/drivers/slirp_kern.c b/arch/um/drivers/slirp_kern.c
index c9d6b52a831d..9864d27afdbe 100644
--- a/arch/um/drivers/slirp_kern.c
+++ b/arch/um/drivers/slirp_kern.c
@@ -25,10 +25,7 @@ void slirp_init(struct net_device *dev, void *data)
25 { .argw = init->argw, 25 { .argw = init->argw,
26 .pid = -1, 26 .pid = -1,
27 .slave = -1, 27 .slave = -1,
28 .ibuf = { '\0' }, 28 .slip = SLIP_PROTO_INIT,
29 .obuf = { '\0' },
30 .pos = 0,
31 .esc = 0,
32 .dev = dev }); 29 .dev = dev });
33 30
34 dev->init = NULL; 31 dev->init = NULL;
diff --git a/arch/um/drivers/slirp_user.c b/arch/um/drivers/slirp_user.c
index c322515c71cc..8d91f663d82c 100644
--- a/arch/um/drivers/slirp_user.c
+++ b/arch/um/drivers/slirp_user.c
@@ -12,7 +12,7 @@
12#include "user.h" 12#include "user.h"
13#include "net_user.h" 13#include "net_user.h"
14#include "slirp.h" 14#include "slirp.h"
15#include "slip_proto.h" 15#include "slip_common.h"
16#include "helper.h" 16#include "helper.h"
17#include "os.h" 17#include "os.h"
18 18
@@ -48,47 +48,32 @@ static int slirp_tramp(char **argv, int fd)
48 return(pid); 48 return(pid);
49} 49}
50 50
51/* XXX This is just a trivial wrapper around os_pipe */
52static int slirp_datachan(int *mfd, int *sfd)
53{
54 int fds[2], err;
55
56 err = os_pipe(fds, 1, 1);
57 if(err < 0){
58 printk("slirp_datachan: Failed to open pipe, err = %d\n", -err);
59 return(err);
60 }
61
62 *mfd = fds[0];
63 *sfd = fds[1];
64 return(0);
65}
66
67static int slirp_open(void *data) 51static int slirp_open(void *data)
68{ 52{
69 struct slirp_data *pri = data; 53 struct slirp_data *pri = data;
70 int sfd, mfd, pid, err; 54 int fds[2], pid, err;
71 55
72 err = slirp_datachan(&mfd, &sfd); 56 err = os_pipe(fds, 1, 1);
73 if(err) 57 if(err)
74 return(err); 58 return(err);
75 59
76 pid = slirp_tramp(pri->argw.argv, sfd); 60 err = slirp_tramp(pri->argw.argv, fds[1]);
77 61 if(err < 0){
78 if(pid < 0){ 62 printk("slirp_tramp failed - errno = %d\n", -err);
79 printk("slirp_tramp failed - errno = %d\n", -pid); 63 goto out;
80 os_close_file(sfd);
81 os_close_file(mfd);
82 return(pid);
83 } 64 }
84 65 pid = err;
85 pri->slave = sfd; 66
86 pri->pos = 0; 67 pri->slave = fds[1];
87 pri->esc = 0; 68 pri->slip.pos = 0;
88 69 pri->slip.esc = 0;
89 pri->pid = pid; 70 pri->pid = err;
90 71
91 return(mfd); 72 return(fds[0]);
73out:
74 os_close_file(fds[0]);
75 os_close_file(fds[1]);
76 return err;
92} 77}
93 78
94static void slirp_close(int fd, void *data) 79static void slirp_close(int fd, void *data)
@@ -129,48 +114,12 @@ static void slirp_close(int fd, void *data)
129 114
130int slirp_user_read(int fd, void *buf, int len, struct slirp_data *pri) 115int slirp_user_read(int fd, void *buf, int len, struct slirp_data *pri)
131{ 116{
132 int i, n, size, start; 117 return slip_proto_read(fd, buf, len, &pri->slip);
133
134 if(pri->more>0) {
135 i = 0;
136 while(i < pri->more) {
137 size = slip_unesc(pri->ibuf[i++],
138 pri->ibuf,&pri->pos,&pri->esc);
139 if(size){
140 memcpy(buf, pri->ibuf, size);
141 memmove(pri->ibuf, &pri->ibuf[i], pri->more-i);
142 pri->more=pri->more-i;
143 return(size);
144 }
145 }
146 pri->more=0;
147 }
148
149 n = net_read(fd, &pri->ibuf[pri->pos], sizeof(pri->ibuf) - pri->pos);
150 if(n <= 0) return(n);
151
152 start = pri->pos;
153 for(i = 0; i < n; i++){
154 size = slip_unesc(pri->ibuf[start + i],
155 pri->ibuf,&pri->pos,&pri->esc);
156 if(size){
157 memcpy(buf, pri->ibuf, size);
158 memmove(pri->ibuf, &pri->ibuf[start+i+1], n-(i+1));
159 pri->more=n-(i+1);
160 return(size);
161 }
162 }
163 return(0);
164} 118}
165 119
166int slirp_user_write(int fd, void *buf, int len, struct slirp_data *pri) 120int slirp_user_write(int fd, void *buf, int len, struct slirp_data *pri)
167{ 121{
168 int actual, n; 122 return slip_proto_write(fd, buf, len, &pri->slip);
169
170 actual = slip_esc(buf, pri->obuf, len);
171 n = net_write(fd, pri->obuf, actual);
172 if(n < 0) return(n);
173 else return(len);
174} 123}
175 124
176static int slirp_set_mtu(int mtu, void *data) 125static int slirp_set_mtu(int mtu, void *data)
@@ -188,14 +137,3 @@ struct net_user_info slirp_user_info = {
188 .delete_address = NULL, 137 .delete_address = NULL,
189 .max_packet = BUF_SIZE 138 .max_packet = BUF_SIZE
190}; 139};
191
192/*
193 * Overrides for Emacs so that we follow Linus's tabbing style.
194 * Emacs will notice this stuff at the end of the file and automatically
195 * adjust the settings for this buffer only. This must remain at the end
196 * of the file.
197 * ---------------------------------------------------------------------------
198 * Local variables:
199 * c-file-style: "linux"
200 * End:
201 */
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c
index a2bac429f3d4..b32a77010fbe 100644
--- a/arch/um/drivers/ssl.c
+++ b/arch/um/drivers/ssl.c
@@ -22,7 +22,6 @@
22#include "init.h" 22#include "init.h"
23#include "irq_user.h" 23#include "irq_user.h"
24#include "mconsole_kern.h" 24#include "mconsole_kern.h"
25#include "2_5compat.h"
26 25
27static int ssl_version = 1; 26static int ssl_version = 1;
28 27
diff --git a/arch/um/drivers/stderr_console.c b/arch/um/drivers/stderr_console.c
index 98565b53d170..429ae8e6c7e5 100644
--- a/arch/um/drivers/stderr_console.c
+++ b/arch/um/drivers/stderr_console.c
@@ -22,9 +22,9 @@ static void stderr_console_write(struct console *console, const char *string,
22} 22}
23 23
24static struct console stderr_console = { 24static struct console stderr_console = {
25 .name "stderr", 25 .name = "stderr",
26 .write stderr_console_write, 26 .write = stderr_console_write,
27 .flags CON_PRINTBUFFER, 27 .flags = CON_PRINTBUFFER,
28}; 28};
29 29
30static int __init stderr_console_init(void) 30static int __init stderr_console_init(void)
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c
index 361d0be342b3..afbe1e71ed83 100644
--- a/arch/um/drivers/stdio_console.c
+++ b/arch/um/drivers/stdio_console.c
@@ -28,7 +28,6 @@
28#include "irq_user.h" 28#include "irq_user.h"
29#include "mconsole_kern.h" 29#include "mconsole_kern.h"
30#include "init.h" 30#include "init.h"
31#include "2_5compat.h"
32 31
33#define MAX_TTYS (16) 32#define MAX_TTYS (16)
34 33
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 9a56ff94308d..2a7f6892c55c 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -49,13 +49,12 @@
49#include "irq_user.h" 49#include "irq_user.h"
50#include "irq_kern.h" 50#include "irq_kern.h"
51#include "ubd_user.h" 51#include "ubd_user.h"
52#include "2_5compat.h"
53#include "os.h" 52#include "os.h"
54#include "mem.h" 53#include "mem.h"
55#include "mem_kern.h" 54#include "mem_kern.h"
56#include "cow.h" 55#include "cow.h"
57 56
58enum ubd_req { UBD_READ, UBD_WRITE, UBD_MMAP }; 57enum ubd_req { UBD_READ, UBD_WRITE };
59 58
60struct io_thread_req { 59struct io_thread_req {
61 enum ubd_req op; 60 enum ubd_req op;
@@ -68,8 +67,6 @@ struct io_thread_req {
68 unsigned long sector_mask; 67 unsigned long sector_mask;
69 unsigned long long cow_offset; 68 unsigned long long cow_offset;
70 unsigned long bitmap_words[2]; 69 unsigned long bitmap_words[2];
71 int map_fd;
72 unsigned long long map_offset;
73 int error; 70 int error;
74}; 71};
75 72
@@ -122,10 +119,6 @@ static int ubd_ioctl(struct inode * inode, struct file * file,
122 119
123#define MAX_DEV (8) 120#define MAX_DEV (8)
124 121
125/* Changed in early boot */
126static int ubd_do_mmap = 0;
127#define UBD_MMAP_BLOCK_SIZE PAGE_SIZE
128
129static struct block_device_operations ubd_blops = { 122static struct block_device_operations ubd_blops = {
130 .owner = THIS_MODULE, 123 .owner = THIS_MODULE,
131 .open = ubd_open, 124 .open = ubd_open,
@@ -175,12 +168,6 @@ struct ubd {
175 int no_cow; 168 int no_cow;
176 struct cow cow; 169 struct cow cow;
177 struct platform_device pdev; 170 struct platform_device pdev;
178
179 int map_writes;
180 int map_reads;
181 int nomap_writes;
182 int nomap_reads;
183 int write_maps;
184}; 171};
185 172
186#define DEFAULT_COW { \ 173#define DEFAULT_COW { \
@@ -200,11 +187,6 @@ struct ubd {
200 .openflags = OPEN_FLAGS, \ 187 .openflags = OPEN_FLAGS, \
201 .no_cow = 0, \ 188 .no_cow = 0, \
202 .cow = DEFAULT_COW, \ 189 .cow = DEFAULT_COW, \
203 .map_writes = 0, \
204 .map_reads = 0, \
205 .nomap_writes = 0, \
206 .nomap_reads = 0, \
207 .write_maps = 0, \
208} 190}
209 191
210struct ubd ubd_dev[MAX_DEV] = { [ 0 ... MAX_DEV - 1 ] = DEFAULT_UBD }; 192struct ubd ubd_dev[MAX_DEV] = { [ 0 ... MAX_DEV - 1 ] = DEFAULT_UBD };
@@ -314,13 +296,6 @@ static int ubd_setup_common(char *str, int *index_out)
314 int major; 296 int major;
315 297
316 str++; 298 str++;
317 if(!strcmp(str, "mmap")){
318 CHOOSE_MODE(printk("mmap not supported by the ubd "
319 "driver in tt mode\n"),
320 ubd_do_mmap = 1);
321 return(0);
322 }
323
324 if(!strcmp(str, "sync")){ 299 if(!strcmp(str, "sync")){
325 global_openflags = of_sync(global_openflags); 300 global_openflags = of_sync(global_openflags);
326 return(0); 301 return(0);
@@ -464,9 +439,9 @@ static int udb_setup(char *str)
464__setup("udb", udb_setup); 439__setup("udb", udb_setup);
465__uml_help(udb_setup, 440__uml_help(udb_setup,
466"udb\n" 441"udb\n"
467" This option is here solely to catch ubd -> udb typos, which can be\n\n" 442" This option is here solely to catch ubd -> udb typos, which can be\n"
468" to impossible to catch visually unless you specifically look for\n\n" 443" to impossible to catch visually unless you specifically look for\n"
469" them. The only result of any option starting with 'udb' is an error\n\n" 444" them. The only result of any option starting with 'udb' is an error\n"
470" in the boot output.\n\n" 445" in the boot output.\n\n"
471); 446);
472 447
@@ -524,7 +499,7 @@ static void ubd_handler(void)
524{ 499{
525 struct io_thread_req req; 500 struct io_thread_req req;
526 struct request *rq = elv_next_request(ubd_queue); 501 struct request *rq = elv_next_request(ubd_queue);
527 int n, err; 502 int n;
528 503
529 do_ubd = NULL; 504 do_ubd = NULL;
530 intr_count++; 505 intr_count++;
@@ -538,19 +513,6 @@ static void ubd_handler(void)
538 return; 513 return;
539 } 514 }
540 515
541 if((req.op != UBD_MMAP) &&
542 ((req.offset != ((__u64) (rq->sector)) << 9) ||
543 (req.length != (rq->current_nr_sectors) << 9)))
544 panic("I/O op mismatch");
545
546 if(req.map_fd != -1){
547 err = physmem_subst_mapping(req.buffer, req.map_fd,
548 req.map_offset, 1);
549 if(err)
550 printk("ubd_handler - physmem_subst_mapping failed, "
551 "err = %d\n", -err);
552 }
553
554 ubd_finish(rq, req.error); 516 ubd_finish(rq, req.error);
555 reactivate_fd(thread_fd, UBD_IRQ); 517 reactivate_fd(thread_fd, UBD_IRQ);
556 do_ubd_request(ubd_queue); 518 do_ubd_request(ubd_queue);
@@ -583,14 +545,10 @@ static int ubd_file_size(struct ubd *dev, __u64 *size_out)
583 545
584static void ubd_close(struct ubd *dev) 546static void ubd_close(struct ubd *dev)
585{ 547{
586 if(ubd_do_mmap)
587 physmem_forget_descriptor(dev->fd);
588 os_close_file(dev->fd); 548 os_close_file(dev->fd);
589 if(dev->cow.file == NULL) 549 if(dev->cow.file == NULL)
590 return; 550 return;
591 551
592 if(ubd_do_mmap)
593 physmem_forget_descriptor(dev->cow.fd);
594 os_close_file(dev->cow.fd); 552 os_close_file(dev->cow.fd);
595 vfree(dev->cow.bitmap); 553 vfree(dev->cow.bitmap);
596 dev->cow.bitmap = NULL; 554 dev->cow.bitmap = NULL;
@@ -1010,94 +968,13 @@ static void cowify_req(struct io_thread_req *req, unsigned long *bitmap,
1010 req->bitmap_words, bitmap_len); 968 req->bitmap_words, bitmap_len);
1011} 969}
1012 970
1013static int mmap_fd(struct request *req, struct ubd *dev, __u64 offset)
1014{
1015 __u64 sector;
1016 unsigned char *bitmap;
1017 int bit, i;
1018
1019 /* mmap must have been requested on the command line */
1020 if(!ubd_do_mmap)
1021 return(-1);
1022
1023 /* The buffer must be page aligned */
1024 if(((unsigned long) req->buffer % UBD_MMAP_BLOCK_SIZE) != 0)
1025 return(-1);
1026
1027 /* The request must be a page long */
1028 if((req->current_nr_sectors << 9) != PAGE_SIZE)
1029 return(-1);
1030
1031 if(dev->cow.file == NULL)
1032 return(dev->fd);
1033
1034 sector = offset >> 9;
1035 bitmap = (unsigned char *) dev->cow.bitmap;
1036 bit = ubd_test_bit(sector, bitmap);
1037
1038 for(i = 1; i < req->current_nr_sectors; i++){
1039 if(ubd_test_bit(sector + i, bitmap) != bit)
1040 return(-1);
1041 }
1042
1043 if(bit || (rq_data_dir(req) == WRITE))
1044 offset += dev->cow.data_offset;
1045
1046 /* The data on disk must be page aligned */
1047 if((offset % UBD_MMAP_BLOCK_SIZE) != 0)
1048 return(-1);
1049
1050 return(bit ? dev->fd : dev->cow.fd);
1051}
1052
1053static int prepare_mmap_request(struct ubd *dev, int fd, __u64 offset,
1054 struct request *req,
1055 struct io_thread_req *io_req)
1056{
1057 int err;
1058
1059 if(rq_data_dir(req) == WRITE){
1060 /* Writes are almost no-ops since the new data is already in the
1061 * host page cache
1062 */
1063 dev->map_writes++;
1064 if(dev->cow.file != NULL)
1065 cowify_bitmap(io_req->offset, io_req->length,
1066 &io_req->sector_mask, &io_req->cow_offset,
1067 dev->cow.bitmap, dev->cow.bitmap_offset,
1068 io_req->bitmap_words,
1069 dev->cow.bitmap_len);
1070 }
1071 else {
1072 int w;
1073
1074 if((dev->cow.file != NULL) && (fd == dev->cow.fd))
1075 w = 0;
1076 else w = dev->openflags.w;
1077
1078 if((dev->cow.file != NULL) && (fd == dev->fd))
1079 offset += dev->cow.data_offset;
1080
1081 err = physmem_subst_mapping(req->buffer, fd, offset, w);
1082 if(err){
1083 printk("physmem_subst_mapping failed, err = %d\n",
1084 -err);
1085 return(1);
1086 }
1087 dev->map_reads++;
1088 }
1089 io_req->op = UBD_MMAP;
1090 io_req->buffer = req->buffer;
1091 return(0);
1092}
1093
1094/* Called with ubd_io_lock held */ 971/* Called with ubd_io_lock held */
1095static int prepare_request(struct request *req, struct io_thread_req *io_req) 972static int prepare_request(struct request *req, struct io_thread_req *io_req)
1096{ 973{
1097 struct gendisk *disk = req->rq_disk; 974 struct gendisk *disk = req->rq_disk;
1098 struct ubd *dev = disk->private_data; 975 struct ubd *dev = disk->private_data;
1099 __u64 offset; 976 __u64 offset;
1100 int len, fd; 977 int len;
1101 978
1102 if(req->rq_status == RQ_INACTIVE) return(1); 979 if(req->rq_status == RQ_INACTIVE) return(1);
1103 980
@@ -1114,34 +991,12 @@ static int prepare_request(struct request *req, struct io_thread_req *io_req)
1114 991
1115 io_req->fds[0] = (dev->cow.file != NULL) ? dev->cow.fd : dev->fd; 992 io_req->fds[0] = (dev->cow.file != NULL) ? dev->cow.fd : dev->fd;
1116 io_req->fds[1] = dev->fd; 993 io_req->fds[1] = dev->fd;
1117 io_req->map_fd = -1;
1118 io_req->cow_offset = -1; 994 io_req->cow_offset = -1;
1119 io_req->offset = offset; 995 io_req->offset = offset;
1120 io_req->length = len; 996 io_req->length = len;
1121 io_req->error = 0; 997 io_req->error = 0;
1122 io_req->sector_mask = 0; 998 io_req->sector_mask = 0;
1123 999
1124 fd = mmap_fd(req, dev, io_req->offset);
1125 if(fd > 0){
1126 /* If mmapping is otherwise OK, but the first access to the
1127 * page is a write, then it's not mapped in yet. So we have
1128 * to write the data to disk first, then we can map the disk
1129 * page in and continue normally from there.
1130 */
1131 if((rq_data_dir(req) == WRITE) && !is_remapped(req->buffer)){
1132 io_req->map_fd = dev->fd;
1133 io_req->map_offset = io_req->offset +
1134 dev->cow.data_offset;
1135 dev->write_maps++;
1136 }
1137 else return(prepare_mmap_request(dev, fd, io_req->offset, req,
1138 io_req));
1139 }
1140
1141 if(rq_data_dir(req) == READ)
1142 dev->nomap_reads++;
1143 else dev->nomap_writes++;
1144
1145 io_req->op = (rq_data_dir(req) == READ) ? UBD_READ : UBD_WRITE; 1000 io_req->op = (rq_data_dir(req) == READ) ? UBD_READ : UBD_WRITE;
1146 io_req->offsets[0] = 0; 1001 io_req->offsets[0] = 0;
1147 io_req->offsets[1] = dev->cow.data_offset; 1002 io_req->offsets[1] = dev->cow.data_offset;
@@ -1229,143 +1084,6 @@ static int ubd_ioctl(struct inode * inode, struct file * file,
1229 return(-EINVAL); 1084 return(-EINVAL);
1230} 1085}
1231 1086
1232static int ubd_check_remapped(int fd, unsigned long address, int is_write,
1233 __u64 offset)
1234{
1235 __u64 bitmap_offset;
1236 unsigned long new_bitmap[2];
1237 int i, err, n;
1238
1239 /* If it's not a write access, we can't do anything about it */
1240 if(!is_write)
1241 return(0);
1242
1243 /* We have a write */
1244 for(i = 0; i < sizeof(ubd_dev) / sizeof(ubd_dev[0]); i++){
1245 struct ubd *dev = &ubd_dev[i];
1246
1247 if((dev->fd != fd) && (dev->cow.fd != fd))
1248 continue;
1249
1250 /* It's a write to a ubd device */
1251
1252 /* This should be impossible now */
1253 if(!dev->openflags.w){
1254 /* It's a write access on a read-only device - probably
1255 * shouldn't happen. If the kernel is trying to change
1256 * something with no intention of writing it back out,
1257 * then this message will clue us in that this needs
1258 * fixing
1259 */
1260 printk("Write access to mapped page from readonly ubd "
1261 "device %d\n", i);
1262 return(0);
1263 }
1264
1265 /* It's a write to a writeable ubd device - it must be COWed
1266 * because, otherwise, the page would have been mapped in
1267 * writeable
1268 */
1269
1270 if(!dev->cow.file)
1271 panic("Write fault on writeable non-COW ubd device %d",
1272 i);
1273
1274 /* It should also be an access to the backing file since the
1275 * COW pages should be mapped in read-write
1276 */
1277
1278 if(fd == dev->fd)
1279 panic("Write fault on a backing page of ubd "
1280 "device %d\n", i);
1281
1282 /* So, we do the write, copying the backing data to the COW
1283 * file...
1284 */
1285
1286 err = os_seek_file(dev->fd, offset + dev->cow.data_offset);
1287 if(err < 0)
1288 panic("Couldn't seek to %lld in COW file of ubd "
1289 "device %d, err = %d",
1290 offset + dev->cow.data_offset, i, -err);
1291
1292 n = os_write_file(dev->fd, (void *) address, PAGE_SIZE);
1293 if(n != PAGE_SIZE)
1294 panic("Couldn't copy data to COW file of ubd "
1295 "device %d, err = %d", i, -n);
1296
1297 /* ... updating the COW bitmap... */
1298
1299 cowify_bitmap(offset, PAGE_SIZE, NULL, &bitmap_offset,
1300 dev->cow.bitmap, dev->cow.bitmap_offset,
1301 new_bitmap, dev->cow.bitmap_len);
1302
1303 err = os_seek_file(dev->fd, bitmap_offset);
1304 if(err < 0)
1305 panic("Couldn't seek to %lld in COW file of ubd "
1306 "device %d, err = %d", bitmap_offset, i, -err);
1307
1308 n = os_write_file(dev->fd, new_bitmap, sizeof(new_bitmap));
1309 if(n != sizeof(new_bitmap))
1310 panic("Couldn't update bitmap of ubd device %d, "
1311 "err = %d", i, -n);
1312
1313 /* Maybe we can map the COW page in, and maybe we can't. If
1314 * it is a pre-V3 COW file, we can't, since the alignment will
1315 * be wrong. If it is a V3 or later COW file which has been
1316 * moved to a system with a larger page size, then maybe we
1317 * can't, depending on the exact location of the page.
1318 */
1319
1320 offset += dev->cow.data_offset;
1321
1322 /* Remove the remapping, putting the original anonymous page
1323 * back. If the COW file can be mapped in, that is done.
1324 * Otherwise, the COW page is read in.
1325 */
1326
1327 if(!physmem_remove_mapping((void *) address))
1328 panic("Address 0x%lx not remapped by ubd device %d",
1329 address, i);
1330 if((offset % UBD_MMAP_BLOCK_SIZE) == 0)
1331 physmem_subst_mapping((void *) address, dev->fd,
1332 offset, 1);
1333 else {
1334 err = os_seek_file(dev->fd, offset);
1335 if(err < 0)
1336 panic("Couldn't seek to %lld in COW file of "
1337 "ubd device %d, err = %d", offset, i,
1338 -err);
1339
1340 n = os_read_file(dev->fd, (void *) address, PAGE_SIZE);
1341 if(n != PAGE_SIZE)
1342 panic("Failed to read page from offset %llx of "
1343 "COW file of ubd device %d, err = %d",
1344 offset, i, -n);
1345 }
1346
1347 return(1);
1348 }
1349
1350 /* It's not a write on a ubd device */
1351 return(0);
1352}
1353
1354static struct remapper ubd_remapper = {
1355 .list = LIST_HEAD_INIT(ubd_remapper.list),
1356 .proc = ubd_check_remapped,
1357};
1358
1359static int ubd_remapper_setup(void)
1360{
1361 if(ubd_do_mmap)
1362 register_remapper(&ubd_remapper);
1363
1364 return(0);
1365}
1366
1367__initcall(ubd_remapper_setup);
1368
1369static int same_backing_files(char *from_cmdline, char *from_cow, char *cow) 1087static int same_backing_files(char *from_cmdline, char *from_cow, char *cow)
1370{ 1088{
1371 struct uml_stat buf1, buf2; 1089 struct uml_stat buf1, buf2;
@@ -1568,15 +1286,6 @@ void do_io(struct io_thread_req *req)
1568 int err; 1286 int err;
1569 __u64 off; 1287 __u64 off;
1570 1288
1571 if(req->op == UBD_MMAP){
1572 /* Touch the page to force the host to do any necessary IO to
1573 * get it into memory
1574 */
1575 n = *((volatile int *) req->buffer);
1576 req->error = update_bitmap(req);
1577 return;
1578 }
1579
1580 nsectors = req->length / req->sectorsize; 1289 nsectors = req->length / req->sectorsize;
1581 start = 0; 1290 start = 0;
1582 do { 1291 do {
diff --git a/arch/um/drivers/xterm_kern.c b/arch/um/drivers/xterm_kern.c
index a4fdf3584ad2..d269a80f4b0c 100644
--- a/arch/um/drivers/xterm_kern.c
+++ b/arch/um/drivers/xterm_kern.c
@@ -69,7 +69,6 @@ int xterm_fd(int socket, int *pid_out)
69 * isn't set) this will hang... */ 69 * isn't set) this will hang... */
70 wait_for_completion(&data->ready); 70 wait_for_completion(&data->ready);
71 71
72 free_irq_by_irq_and_dev(XTERM_IRQ, data);
73 free_irq(XTERM_IRQ, data); 72 free_irq(XTERM_IRQ, data);
74 73
75 ret = data->new_fd; 74 ret = data->new_fd;
diff --git a/arch/um/include/2_5compat.h b/arch/um/include/2_5compat.h
deleted file mode 100644
index abdb015a4d71..000000000000
--- a/arch/um/include/2_5compat.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2001 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#ifndef __2_5_COMPAT_H__
7#define __2_5_COMPAT_H__
8
9#define INIT_HARDSECT(arr, maj, sizes)
10
11#define SET_PRI(task) do ; while(0)
12
13#endif
14
15/*
16 * Overrides for Emacs so that we follow Linus's tabbing style.
17 * Emacs will notice this stuff at the end of the file and automatically
18 * adjust the settings for this buffer only. This must remain at the end
19 * of the file.
20 * ---------------------------------------------------------------------------
21 * Local variables:
22 * c-file-style: "linux"
23 * End:
24 */
diff --git a/arch/um/include/mconsole.h b/arch/um/include/mconsole.h
index 9fbe3083fdd8..cfa368e045a5 100644
--- a/arch/um/include/mconsole.h
+++ b/arch/um/include/mconsole.h
@@ -56,7 +56,7 @@ struct mc_request
56 int as_interrupt; 56 int as_interrupt;
57 57
58 int originating_fd; 58 int originating_fd;
59 int originlen; 59 unsigned int originlen;
60 unsigned char origin[128]; /* sockaddr_un */ 60 unsigned char origin[128]; /* sockaddr_un */
61 61
62 struct mconsole_request request; 62 struct mconsole_request request;
diff --git a/arch/um/include/net_user.h b/arch/um/include/net_user.h
index 36807b796e9f..89885a77a771 100644
--- a/arch/um/include/net_user.h
+++ b/arch/um/include/net_user.h
@@ -35,7 +35,7 @@ extern void *get_output_buffer(int *len_out);
35extern void free_output_buffer(void *buffer); 35extern void free_output_buffer(void *buffer);
36 36
37extern int tap_open_common(void *dev, char *gate_addr); 37extern int tap_open_common(void *dev, char *gate_addr);
38extern void tap_check_ips(char *gate_addr, char *eth_addr); 38extern void tap_check_ips(char *gate_addr, unsigned char *eth_addr);
39 39
40extern void read_output(int fd, char *output_out, int len); 40extern void read_output(int fd, char *output_out, int len);
41 41
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index d246d5a24609..881d2988d2d8 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -136,7 +136,7 @@ extern int os_seek_file(int fd, __u64 offset);
136extern int os_open_file(char *file, struct openflags flags, int mode); 136extern int os_open_file(char *file, struct openflags flags, int mode);
137extern int os_read_file(int fd, void *buf, int len); 137extern int os_read_file(int fd, void *buf, int len);
138extern int os_write_file(int fd, const void *buf, int count); 138extern int os_write_file(int fd, const void *buf, int count);
139extern int os_file_size(char *file, long long *size_out); 139extern int os_file_size(char *file, unsigned long long *size_out);
140extern int os_file_modtime(char *file, unsigned long *modtime); 140extern int os_file_modtime(char *file, unsigned long *modtime);
141extern int os_pipe(int *fd, int stream, int close_on_exec); 141extern int os_pipe(int *fd, int stream, int close_on_exec);
142extern int os_set_fd_async(int fd, int owner); 142extern int os_set_fd_async(int fd, int owner);
diff --git a/arch/um/include/sysdep-i386/ptrace.h b/arch/um/include/sysdep-i386/ptrace.h
index 84ec7ff5cf8c..c8ee9559f3ab 100644
--- a/arch/um/include/sysdep-i386/ptrace.h
+++ b/arch/um/include/sysdep-i386/ptrace.h
@@ -8,6 +8,8 @@
8 8
9#include "uml-config.h" 9#include "uml-config.h"
10#include "user_constants.h" 10#include "user_constants.h"
11#include "sysdep/faultinfo.h"
12#include "choose-mode.h"
11 13
12#define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long)) 14#define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long))
13#define MAX_REG_OFFSET (UM_FRAME_SIZE) 15#define MAX_REG_OFFSET (UM_FRAME_SIZE)
@@ -31,7 +33,6 @@ extern int sysemu_supported;
31#ifdef UML_CONFIG_MODE_SKAS 33#ifdef UML_CONFIG_MODE_SKAS
32 34
33#include "skas_ptregs.h" 35#include "skas_ptregs.h"
34#include "sysdep/faultinfo.h"
35 36
36#define REGS_IP(r) ((r)[HOST_IP]) 37#define REGS_IP(r) ((r)[HOST_IP])
37#define REGS_SP(r) ((r)[HOST_SP]) 38#define REGS_SP(r) ((r)[HOST_SP])
@@ -59,8 +60,6 @@ extern int sysemu_supported;
59#define PTRACE_SYSEMU_SINGLESTEP 32 60#define PTRACE_SYSEMU_SINGLESTEP 32
60#endif 61#endif
61 62
62#include "choose-mode.h"
63
64union uml_pt_regs { 63union uml_pt_regs {
65#ifdef UML_CONFIG_MODE_TT 64#ifdef UML_CONFIG_MODE_TT
66 struct tt_regs { 65 struct tt_regs {
diff --git a/arch/um/include/sysdep-x86_64/checksum.h b/arch/um/include/sysdep-x86_64/checksum.h
index 572c6c19be33..ea97005af694 100644
--- a/arch/um/include/sysdep-x86_64/checksum.h
+++ b/arch/um/include/sysdep-x86_64/checksum.h
@@ -9,8 +9,6 @@
9#include "linux/in6.h" 9#include "linux/in6.h"
10#include "asm/uaccess.h" 10#include "asm/uaccess.h"
11 11
12extern unsigned int csum_partial_copy_from(const unsigned char *src, unsigned char *dst, int len,
13 int sum, int *err_ptr);
14extern unsigned csum_partial(const unsigned char *buff, unsigned len, 12extern unsigned csum_partial(const unsigned char *buff, unsigned len,
15 unsigned sum); 13 unsigned sum);
16 14
@@ -31,10 +29,15 @@ unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *
31} 29}
32 30
33static __inline__ 31static __inline__
34unsigned int csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, 32unsigned int csum_partial_copy_from_user(const unsigned char *src,
35 int len, int sum, int *err_ptr) 33 unsigned char *dst, int len, int sum,
34 int *err_ptr)
36{ 35{
37 return csum_partial_copy_from(src, dst, len, sum, err_ptr); 36 if(copy_from_user(dst, src, len)){
37 *err_ptr = -EFAULT;
38 return(-1);
39 }
40 return csum_partial(dst, len, sum);
38} 41}
39 42
40/** 43/**
@@ -137,15 +140,6 @@ static inline unsigned add32_with_carry(unsigned a, unsigned b)
137 return a; 140 return a;
138} 141}
139 142
140#endif 143extern unsigned short ip_compute_csum(unsigned char * buff, int len);
141 144
142/* 145#endif
143 * Overrides for Emacs so that we follow Linus's tabbing style.
144 * Emacs will notice this stuff at the end of the file and automatically
145 * adjust the settings for this buffer only. This must remain at the end
146 * of the file.
147 * ---------------------------------------------------------------------------
148 * Local variables:
149 * c-file-style: "linux"
150 * End:
151 */
diff --git a/arch/um/include/sysdep-x86_64/ptrace.h b/arch/um/include/sysdep-x86_64/ptrace.h
index 348e8fcd513f..be8acd5efd97 100644
--- a/arch/um/include/sysdep-x86_64/ptrace.h
+++ b/arch/um/include/sysdep-x86_64/ptrace.h
@@ -135,6 +135,7 @@ extern int mode_tt;
135 __CHOOSE_MODE(SC_EFLAGS(UPT_SC(r)), REGS_EFLAGS((r)->skas.regs)) 135 __CHOOSE_MODE(SC_EFLAGS(UPT_SC(r)), REGS_EFLAGS((r)->skas.regs))
136#define UPT_SC(r) ((r)->tt.sc) 136#define UPT_SC(r) ((r)->tt.sc)
137#define UPT_SYSCALL_NR(r) __CHOOSE_MODE((r)->tt.syscall, (r)->skas.syscall) 137#define UPT_SYSCALL_NR(r) __CHOOSE_MODE((r)->tt.syscall, (r)->skas.syscall)
138#define UPT_SYSCALL_RET(r) UPT_RAX(r)
138 139
139extern int user_context(unsigned long sp); 140extern int user_context(unsigned long sp);
140 141
@@ -196,32 +197,32 @@ struct syscall_args {
196 197
197 198
198#define UPT_SET(regs, reg, val) \ 199#define UPT_SET(regs, reg, val) \
199 ({ unsigned long val; \ 200 ({ unsigned long __upt_val = val; \
200 switch(reg){ \ 201 switch(reg){ \
201 case R8: UPT_R8(regs) = val; break; \ 202 case R8: UPT_R8(regs) = __upt_val; break; \
202 case R9: UPT_R9(regs) = val; break; \ 203 case R9: UPT_R9(regs) = __upt_val; break; \
203 case R10: UPT_R10(regs) = val; break; \ 204 case R10: UPT_R10(regs) = __upt_val; break; \
204 case R11: UPT_R11(regs) = val; break; \ 205 case R11: UPT_R11(regs) = __upt_val; break; \
205 case R12: UPT_R12(regs) = val; break; \ 206 case R12: UPT_R12(regs) = __upt_val; break; \
206 case R13: UPT_R13(regs) = val; break; \ 207 case R13: UPT_R13(regs) = __upt_val; break; \
207 case R14: UPT_R14(regs) = val; break; \ 208 case R14: UPT_R14(regs) = __upt_val; break; \
208 case R15: UPT_R15(regs) = val; break; \ 209 case R15: UPT_R15(regs) = __upt_val; break; \
209 case RIP: UPT_IP(regs) = val; break; \ 210 case RIP: UPT_IP(regs) = __upt_val; break; \
210 case RSP: UPT_SP(regs) = val; break; \ 211 case RSP: UPT_SP(regs) = __upt_val; break; \
211 case RAX: UPT_RAX(regs) = val; break; \ 212 case RAX: UPT_RAX(regs) = __upt_val; break; \
212 case RBX: UPT_RBX(regs) = val; break; \ 213 case RBX: UPT_RBX(regs) = __upt_val; break; \
213 case RCX: UPT_RCX(regs) = val; break; \ 214 case RCX: UPT_RCX(regs) = __upt_val; break; \
214 case RDX: UPT_RDX(regs) = val; break; \ 215 case RDX: UPT_RDX(regs) = __upt_val; break; \
215 case RSI: UPT_RSI(regs) = val; break; \ 216 case RSI: UPT_RSI(regs) = __upt_val; break; \
216 case RDI: UPT_RDI(regs) = val; break; \ 217 case RDI: UPT_RDI(regs) = __upt_val; break; \
217 case RBP: UPT_RBP(regs) = val; break; \ 218 case RBP: UPT_RBP(regs) = __upt_val; break; \
218 case ORIG_RAX: UPT_ORIG_RAX(regs) = val; break; \ 219 case ORIG_RAX: UPT_ORIG_RAX(regs) = __upt_val; break; \
219 case CS: UPT_CS(regs) = val; break; \ 220 case CS: UPT_CS(regs) = __upt_val; break; \
220 case DS: UPT_DS(regs) = val; break; \ 221 case DS: UPT_DS(regs) = __upt_val; break; \
221 case ES: UPT_ES(regs) = val; break; \ 222 case ES: UPT_ES(regs) = __upt_val; break; \
222 case FS: UPT_FS(regs) = val; break; \ 223 case FS: UPT_FS(regs) = __upt_val; break; \
223 case GS: UPT_GS(regs) = val; break; \ 224 case GS: UPT_GS(regs) = __upt_val; break; \
224 case EFLAGS: UPT_EFLAGS(regs) = val; break; \ 225 case EFLAGS: UPT_EFLAGS(regs) = __upt_val; break; \
225 default : \ 226 default : \
226 panic("Bad register in UPT_SET : %d\n", reg); \ 227 panic("Bad register in UPT_SET : %d\n", reg); \
227 break; \ 228 break; \
@@ -245,14 +246,3 @@ struct syscall_args {
245 CHOOSE_MODE((&(r)->tt.faultinfo), (&(r)->skas.faultinfo)) 246 CHOOSE_MODE((&(r)->tt.faultinfo), (&(r)->skas.faultinfo))
246 247
247#endif 248#endif
248
249/*
250 * Overrides for Emacs so that we follow Linus's tabbing style.
251 * Emacs will notice this stuff at the end of the file and automatically
252 * adjust the settings for this buffer only. This must remain at the end
253 * of the file.
254 * ---------------------------------------------------------------------------
255 * Local variables:
256 * c-file-style: "linux"
257 * End:
258 */
diff --git a/arch/um/include/sysrq.h b/arch/um/include/sysrq.h
index 2ce9423460b3..c8d332b56b98 100644
--- a/arch/um/include/sysrq.h
+++ b/arch/um/include/sysrq.h
@@ -1,6 +1,7 @@
1#ifndef __UM_SYSRQ_H 1#ifndef __UM_SYSRQ_H
2#define __UM_SYSRQ_H 2#define __UM_SYSRQ_H
3 3
4extern void show_trace(unsigned long *stack); 4struct task_struct;
5extern void show_trace(struct task_struct* task, unsigned long *stack);
5 6
6#endif 7#endif
diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h
index b8c5b8a95250..7b6a24dfd302 100644
--- a/arch/um/include/user_util.h
+++ b/arch/um/include/user_util.h
@@ -41,9 +41,6 @@ extern unsigned long highmem;
41extern char host_info[]; 41extern char host_info[];
42 42
43extern char saved_command_line[]; 43extern char saved_command_line[];
44extern char command_line[];
45
46extern char *tempdir;
47 44
48extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end; 45extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end;
49extern unsigned long _unprotected_end; 46extern unsigned long _unprotected_end;
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index 9736ca27c5f0..a8918e80df96 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -14,7 +14,7 @@ obj-y = config.o exec_kern.o exitcode.o \
14 tlb.o trap_kern.o trap_user.o uaccess_user.o um_arch.o umid.o \ 14 tlb.o trap_kern.o trap_user.o uaccess_user.o um_arch.o umid.o \
15 user_util.o 15 user_util.o
16 16
17obj-$(CONFIG_BLK_DEV_INITRD) += initrd_kern.o initrd_user.o 17obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
18obj-$(CONFIG_GPROF) += gprof_syms.o 18obj-$(CONFIG_GPROF) += gprof_syms.o
19obj-$(CONFIG_GCOV) += gmon_syms.o 19obj-$(CONFIG_GCOV) += gmon_syms.o
20obj-$(CONFIG_TTY_LOG) += tty_log.o 20obj-$(CONFIG_TTY_LOG) += tty_log.o
diff --git a/arch/um/kernel/checksum.c b/arch/um/kernel/checksum.c
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/arch/um/kernel/checksum.c
+++ /dev/null
diff --git a/arch/um/kernel/exec_kern.c b/arch/um/kernel/exec_kern.c
index 49ddabe69be7..efd222ffe20e 100644
--- a/arch/um/kernel/exec_kern.c
+++ b/arch/um/kernel/exec_kern.c
@@ -16,7 +16,6 @@
16#include "kern.h" 16#include "kern.h"
17#include "irq_user.h" 17#include "irq_user.h"
18#include "tlb.h" 18#include "tlb.h"
19#include "2_5compat.h"
20#include "os.h" 19#include "os.h"
21#include "time_user.h" 20#include "time_user.h"
22#include "choose-mode.h" 21#include "choose-mode.h"
diff --git a/arch/um/kernel/initrd_kern.c b/arch/um/kernel/initrd.c
index fc568af468b9..82ecf904b09c 100644
--- a/arch/um/kernel/initrd_kern.c
+++ b/arch/um/kernel/initrd.c
@@ -41,12 +41,31 @@ static int __init uml_initrd_setup(char *line, int *add)
41 return 0; 41 return 0;
42} 42}
43 43
44__uml_setup("initrd=", uml_initrd_setup, 44__uml_setup("initrd=", uml_initrd_setup,
45"initrd=<initrd image>\n" 45"initrd=<initrd image>\n"
46" This is used to boot UML from an initrd image. The argument is the\n" 46" This is used to boot UML from an initrd image. The argument is the\n"
47" name of the file containing the image.\n\n" 47" name of the file containing the image.\n\n"
48); 48);
49 49
50int load_initrd(char *filename, void *buf, int size)
51{
52 int fd, n;
53
54 fd = os_open_file(filename, of_read(OPENFLAGS()), 0);
55 if(fd < 0){
56 printk("Opening '%s' failed - err = %d\n", filename, -fd);
57 return(-1);
58 }
59 n = os_read_file(fd, buf, size);
60 if(n != size){
61 printk("Read of %d bytes from '%s' failed, err = %d\n", size,
62 filename, -n);
63 return(-1);
64 }
65
66 os_close_file(fd);
67 return(0);
68}
50/* 69/*
51 * Overrides for Emacs so that we follow Linus's tabbing style. 70 * Overrides for Emacs so that we follow Linus's tabbing style.
52 * Emacs will notice this stuff at the end of the file and automatically 71 * Emacs will notice this stuff at the end of the file and automatically
diff --git a/arch/um/kernel/initrd_user.c b/arch/um/kernel/initrd_user.c
deleted file mode 100644
index cb90681e151c..000000000000
--- a/arch/um/kernel/initrd_user.c
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <unistd.h>
7#include <sys/types.h>
8#include <sys/stat.h>
9#include <errno.h>
10
11#include "user_util.h"
12#include "kern_util.h"
13#include "user.h"
14#include "initrd.h"
15#include "os.h"
16
17int load_initrd(char *filename, void *buf, int size)
18{
19 int fd, n;
20
21 fd = os_open_file(filename, of_read(OPENFLAGS()), 0);
22 if(fd < 0){
23 printk("Opening '%s' failed - err = %d\n", filename, -fd);
24 return(-1);
25 }
26 n = os_read_file(fd, buf, size);
27 if(n != size){
28 printk("Read of %d bytes from '%s' failed, err = %d\n", size,
29 filename, -n);
30 return(-1);
31 }
32
33 os_close_file(fd);
34 return(0);
35}
36
37/*
38 * Overrides for Emacs so that we follow Linus's tabbing style.
39 * Emacs will notice this stuff at the end of the file and automatically
40 * adjust the settings for this buffer only. This must remain at the end
41 * of the file.
42 * ---------------------------------------------------------------------------
43 * Local variables:
44 * c-file-style: "linux"
45 * End:
46 */
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index d44fb5282547..9f18061ef4c9 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -124,14 +124,16 @@ void irq_unlock(unsigned long flags)
124 spin_unlock_irqrestore(&irq_spinlock, flags); 124 spin_unlock_irqrestore(&irq_spinlock, flags);
125} 125}
126 126
127/* presently hw_interrupt_type must define (startup || enable) && 127/* hw_interrupt_type must define (startup || enable) &&
128 * disable && end */ 128 * (shutdown || disable) && end */
129static void dummy(unsigned int irq) 129static void dummy(unsigned int irq)
130{ 130{
131} 131}
132 132
133static struct hw_interrupt_type SIGIO_irq_type = { 133/* This is used for everything else than the timer. */
134static struct hw_interrupt_type normal_irq_type = {
134 .typename = "SIGIO", 135 .typename = "SIGIO",
136 .release = free_irq_by_irq_and_dev,
135 .disable = dummy, 137 .disable = dummy,
136 .enable = dummy, 138 .enable = dummy,
137 .ack = dummy, 139 .ack = dummy,
@@ -140,6 +142,7 @@ static struct hw_interrupt_type SIGIO_irq_type = {
140 142
141static struct hw_interrupt_type SIGVTALRM_irq_type = { 143static struct hw_interrupt_type SIGVTALRM_irq_type = {
142 .typename = "SIGVTALRM", 144 .typename = "SIGVTALRM",
145 .release = free_irq_by_irq_and_dev,
143 .shutdown = dummy, /* never called */ 146 .shutdown = dummy, /* never called */
144 .disable = dummy, 147 .disable = dummy,
145 .enable = dummy, 148 .enable = dummy,
@@ -160,7 +163,7 @@ void __init init_IRQ(void)
160 irq_desc[i].status = IRQ_DISABLED; 163 irq_desc[i].status = IRQ_DISABLED;
161 irq_desc[i].action = NULL; 164 irq_desc[i].action = NULL;
162 irq_desc[i].depth = 1; 165 irq_desc[i].depth = 1;
163 irq_desc[i].handler = &SIGIO_irq_type; 166 irq_desc[i].handler = &normal_irq_type;
164 enable_irq(i); 167 enable_irq(i);
165 } 168 }
166} 169}
diff --git a/arch/um/kernel/irq_user.c b/arch/um/kernel/irq_user.c
index 6d6f9484b884..c3ccaf24f3e0 100644
--- a/arch/um/kernel/irq_user.c
+++ b/arch/um/kernel/irq_user.c
@@ -85,8 +85,6 @@ void sigio_handler(int sig, union uml_pt_regs *regs)
85 next = irq_fd->next; 85 next = irq_fd->next;
86 if(irq_fd->freed){ 86 if(irq_fd->freed){
87 free_irq(irq_fd->irq, irq_fd->id); 87 free_irq(irq_fd->irq, irq_fd->id);
88 free_irq_by_irq_and_dev(irq_fd->irq,
89 irq_fd->id);
90 } 88 }
91 } 89 }
92 } 90 }
@@ -236,9 +234,15 @@ static void free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg)
236 (*prev)->fd, pollfds[i].fd); 234 (*prev)->fd, pollfds[i].fd);
237 goto out; 235 goto out;
238 } 236 }
239 memcpy(&pollfds[i], &pollfds[i + 1], 237
240 (pollfds_num - i - 1) * sizeof(pollfds[0]));
241 pollfds_num--; 238 pollfds_num--;
239
240 /* This moves the *whole* array after pollfds[i] (though
241 * it doesn't spot as such)! */
242
243 memmove(&pollfds[i], &pollfds[i + 1],
244 (pollfds_num - i) * sizeof(pollfds[0]));
245
242 if(last_irq_ptr == &old_fd->next) 246 if(last_irq_ptr == &old_fd->next)
243 last_irq_ptr = prev; 247 last_irq_ptr = prev;
244 *prev = (*prev)->next; 248 *prev = (*prev)->next;
diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c
index 78d69dc74b26..99439fa15ef4 100644
--- a/arch/um/kernel/ksyms.c
+++ b/arch/um/kernel/ksyms.c
@@ -57,6 +57,7 @@ EXPORT_SYMBOL(copy_to_user_tt);
57EXPORT_SYMBOL(strncpy_from_user_skas); 57EXPORT_SYMBOL(strncpy_from_user_skas);
58EXPORT_SYMBOL(copy_to_user_skas); 58EXPORT_SYMBOL(copy_to_user_skas);
59EXPORT_SYMBOL(copy_from_user_skas); 59EXPORT_SYMBOL(copy_from_user_skas);
60EXPORT_SYMBOL(clear_user_skas);
60#endif 61#endif
61EXPORT_SYMBOL(uml_strdup); 62EXPORT_SYMBOL(uml_strdup);
62 63
diff --git a/arch/um/kernel/main.c b/arch/um/kernel/main.c
index a17c49703f9b..e59f58152678 100644
--- a/arch/um/kernel/main.c
+++ b/arch/um/kernel/main.c
@@ -24,8 +24,6 @@
24#include "mode.h" 24#include "mode.h"
25#include "choose-mode.h" 25#include "choose-mode.h"
26#include "uml-config.h" 26#include "uml-config.h"
27#include "irq_user.h"
28#include "time_user.h"
29#include "os.h" 27#include "os.h"
30 28
31/* Set in set_stklim, which is called from main and __wrap_malloc. 29/* Set in set_stklim, which is called from main and __wrap_malloc.
@@ -71,7 +69,7 @@ static __init void do_uml_initcalls(void)
71 69
72static void last_ditch_exit(int sig) 70static void last_ditch_exit(int sig)
73{ 71{
74 CHOOSE_MODE(kmalloc_ok = 0, (void) 0); 72 kmalloc_ok = 0;
75 signal(SIGINT, SIG_DFL); 73 signal(SIGINT, SIG_DFL);
76 signal(SIGTERM, SIG_DFL); 74 signal(SIGTERM, SIG_DFL);
77 signal(SIGHUP, SIG_DFL); 75 signal(SIGHUP, SIG_DFL);
@@ -87,7 +85,7 @@ int main(int argc, char **argv, char **envp)
87{ 85{
88 char **new_argv; 86 char **new_argv;
89 sigset_t mask; 87 sigset_t mask;
90 int ret, i; 88 int ret, i, err;
91 89
92 /* Enable all signals except SIGIO - in some environments, we can 90 /* Enable all signals except SIGIO - in some environments, we can
93 * enter with some signals blocked 91 * enter with some signals blocked
@@ -160,27 +158,29 @@ int main(int argc, char **argv, char **envp)
160 */ 158 */
161 change_sig(SIGPROF, 0); 159 change_sig(SIGPROF, 0);
162 160
163 /* Reboot */ 161 /* This signal stuff used to be in the reboot case. However,
164 if(ret){ 162 * sometimes a SIGVTALRM can come in when we're halting (reproducably
165 int err; 163 * when writing out gcov information, presumably because that takes
164 * some time) and cause a segfault.
165 */
166 166
167 printf("\n"); 167 /* stop timers and set SIG*ALRM to be ignored */
168 disable_timer();
168 169
169 /* stop timers and set SIG*ALRM to be ignored */ 170 /* disable SIGIO for the fds and set SIGIO to be ignored */
170 disable_timer(); 171 err = deactivate_all_fds();
172 if(err)
173 printf("deactivate_all_fds failed, errno = %d\n", -err);
171 174
172 /* disable SIGIO for the fds and set SIGIO to be ignored */ 175 /* Let any pending signals fire now. This ensures
173 err = deactivate_all_fds(); 176 * that they won't be delivered after the exec, when
174 if(err) 177 * they are definitely not expected.
175 printf("deactivate_all_fds failed, errno = %d\n", 178 */
176 -err); 179 unblock_signals();
177
178 /* Let any pending signals fire now. This ensures
179 * that they won't be delivered after the exec, when
180 * they are definitely not expected.
181 */
182 unblock_signals();
183 180
181 /* Reboot */
182 if(ret){
183 printf("\n");
184 execvp(new_argv[0], new_argv); 184 execvp(new_argv[0], new_argv);
185 perror("Failed to exec kernel"); 185 perror("Failed to exec kernel");
186 ret = 1; 186 ret = 1;
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index f156661781cb..5597bd39e6b5 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -53,7 +53,6 @@ static void setup_highmem(unsigned long highmem_start,
53 for(i = 0; i < highmem_len >> PAGE_SHIFT; i++){ 53 for(i = 0; i < highmem_len >> PAGE_SHIFT; i++){
54 page = &mem_map[highmem_pfn + i]; 54 page = &mem_map[highmem_pfn + i];
55 ClearPageReserved(page); 55 ClearPageReserved(page);
56 set_bit(PG_highmem, &page->flags);
57 set_page_count(page, 1); 56 set_page_count(page, 1);
58 __free_page(page); 57 __free_page(page);
59 } 58 }
@@ -100,12 +99,37 @@ void mem_init(void)
100#endif 99#endif
101} 100}
102 101
102/*
103 * Create a page table and place a pointer to it in a middle page
104 * directory entry.
105 */
106static void __init one_page_table_init(pmd_t *pmd)
107{
108 if (pmd_none(*pmd)) {
109 pte_t *pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
110 set_pmd(pmd, __pmd(_KERNPG_TABLE +
111 (unsigned long) __pa(pte)));
112 if (pte != pte_offset_kernel(pmd, 0))
113 BUG();
114 }
115}
116
117static void __init one_md_table_init(pud_t *pud)
118{
119#ifdef CONFIG_3_LEVEL_PGTABLES
120 pmd_t *pmd_table = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE);
121 set_pud(pud, __pud(_KERNPG_TABLE + (unsigned long) __pa(pmd_table)));
122 if (pmd_table != pmd_offset(pud, 0))
123 BUG();
124#endif
125}
126
103static void __init fixrange_init(unsigned long start, unsigned long end, 127static void __init fixrange_init(unsigned long start, unsigned long end,
104 pgd_t *pgd_base) 128 pgd_t *pgd_base)
105{ 129{
106 pgd_t *pgd; 130 pgd_t *pgd;
131 pud_t *pud;
107 pmd_t *pmd; 132 pmd_t *pmd;
108 pte_t *pte;
109 int i, j; 133 int i, j;
110 unsigned long vaddr; 134 unsigned long vaddr;
111 135
@@ -115,15 +139,12 @@ static void __init fixrange_init(unsigned long start, unsigned long end,
115 pgd = pgd_base + i; 139 pgd = pgd_base + i;
116 140
117 for ( ; (i < PTRS_PER_PGD) && (vaddr < end); pgd++, i++) { 141 for ( ; (i < PTRS_PER_PGD) && (vaddr < end); pgd++, i++) {
118 pmd = (pmd_t *)pgd; 142 pud = pud_offset(pgd, vaddr);
143 if (pud_none(*pud))
144 one_md_table_init(pud);
145 pmd = pmd_offset(pud, vaddr);
119 for (; (j < PTRS_PER_PMD) && (vaddr != end); pmd++, j++) { 146 for (; (j < PTRS_PER_PMD) && (vaddr != end); pmd++, j++) {
120 if (pmd_none(*pmd)) { 147 one_page_table_init(pmd);
121 pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
122 set_pmd(pmd, __pmd(_KERNPG_TABLE +
123 (unsigned long) __pa(pte)));
124 if (pte != pte_offset_kernel(pmd, 0))
125 BUG();
126 }
127 vaddr += PMD_SIZE; 148 vaddr += PMD_SIZE;
128 } 149 }
129 j = 0; 150 j = 0;
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index 51f8e5a8ac6a..1b5ef3e96c71 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -30,7 +30,6 @@
30#include "init.h" 30#include "init.h"
31#include "os.h" 31#include "os.h"
32#include "uml-config.h" 32#include "uml-config.h"
33#include "ptrace_user.h"
34#include "choose-mode.h" 33#include "choose-mode.h"
35#include "mode.h" 34#include "mode.h"
36#ifdef UML_CONFIG_MODE_SKAS 35#ifdef UML_CONFIG_MODE_SKAS
@@ -131,7 +130,7 @@ int start_fork_tramp(void *thread_arg, unsigned long temp_stack,
131 return(arg.pid); 130 return(arg.pid);
132} 131}
133 132
134static int ptrace_child(void *arg) 133static int ptrace_child(void)
135{ 134{
136 int ret; 135 int ret;
137 int pid = os_getpid(), ppid = getppid(); 136 int pid = os_getpid(), ppid = getppid();
@@ -160,20 +159,16 @@ static int ptrace_child(void *arg)
160 _exit(ret); 159 _exit(ret);
161} 160}
162 161
163static int start_ptraced_child(void **stack_out) 162static int start_ptraced_child(void)
164{ 163{
165 void *stack;
166 unsigned long sp;
167 int pid, n, status; 164 int pid, n, status;
168 165
169 stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, 166 pid = fork();
170 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); 167 if(pid == 0)
171 if(stack == MAP_FAILED) 168 ptrace_child();
172 panic("check_ptrace : mmap failed, errno = %d", errno); 169
173 sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *);
174 pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL);
175 if(pid < 0) 170 if(pid < 0)
176 panic("check_ptrace : clone failed, errno = %d", errno); 171 panic("check_ptrace : fork failed, errno = %d", errno);
177 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); 172 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));
178 if(n < 0) 173 if(n < 0)
179 panic("check_ptrace : wait failed, errno = %d", errno); 174 panic("check_ptrace : wait failed, errno = %d", errno);
@@ -181,7 +176,6 @@ static int start_ptraced_child(void **stack_out)
181 panic("check_ptrace : expected SIGSTOP, got status = %d", 176 panic("check_ptrace : expected SIGSTOP, got status = %d",
182 status); 177 status);
183 178
184 *stack_out = stack;
185 return(pid); 179 return(pid);
186} 180}
187 181
@@ -189,12 +183,12 @@ static int start_ptraced_child(void **stack_out)
189 * just avoid using sysemu, not panic, but only if SYSEMU features are broken. 183 * just avoid using sysemu, not panic, but only if SYSEMU features are broken.
190 * So only for SYSEMU features we test mustpanic, while normal host features 184 * So only for SYSEMU features we test mustpanic, while normal host features
191 * must work anyway!*/ 185 * must work anyway!*/
192static int stop_ptraced_child(int pid, void *stack, int exitcode, int mustpanic) 186static int stop_ptraced_child(int pid, int exitcode, int mustexit)
193{ 187{
194 int status, n, ret = 0; 188 int status, n, ret = 0;
195 189
196 if(ptrace(PTRACE_CONT, pid, 0, 0) < 0) 190 if(ptrace(PTRACE_CONT, pid, 0, 0) < 0)
197 panic("check_ptrace : ptrace failed, errno = %d", errno); 191 panic("stop_ptraced_child : ptrace failed, errno = %d", errno);
198 CATCH_EINTR(n = waitpid(pid, &status, 0)); 192 CATCH_EINTR(n = waitpid(pid, &status, 0));
199 if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) { 193 if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {
200 int exit_with = WEXITSTATUS(status); 194 int exit_with = WEXITSTATUS(status);
@@ -205,15 +199,13 @@ static int stop_ptraced_child(int pid, void *stack, int exitcode, int mustpanic)
205 printk("check_ptrace : child exited with exitcode %d, while " 199 printk("check_ptrace : child exited with exitcode %d, while "
206 "expecting %d; status 0x%x", exit_with, 200 "expecting %d; status 0x%x", exit_with,
207 exitcode, status); 201 exitcode, status);
208 if (mustpanic) 202 if (mustexit)
209 panic("\n"); 203 panic("\n");
210 else 204 else
211 printk("\n"); 205 printk("\n");
212 ret = -1; 206 ret = -1;
213 } 207 }
214 208
215 if(munmap(stack, PAGE_SIZE) < 0)
216 panic("check_ptrace : munmap failed, errno = %d", errno);
217 return ret; 209 return ret;
218} 210}
219 211
@@ -235,12 +227,11 @@ __uml_setup("nosysemu", nosysemu_cmd_param,
235 227
236static void __init check_sysemu(void) 228static void __init check_sysemu(void)
237{ 229{
238 void *stack;
239 int pid, syscall, n, status, count=0; 230 int pid, syscall, n, status, count=0;
240 231
241 printk("Checking syscall emulation patch for ptrace..."); 232 printk("Checking syscall emulation patch for ptrace...");
242 sysemu_supported = 0; 233 sysemu_supported = 0;
243 pid = start_ptraced_child(&stack); 234 pid = start_ptraced_child();
244 235
245 if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0) 236 if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0)
246 goto fail; 237 goto fail;
@@ -258,7 +249,7 @@ static void __init check_sysemu(void)
258 panic("check_sysemu : failed to modify system " 249 panic("check_sysemu : failed to modify system "
259 "call return, errno = %d", errno); 250 "call return, errno = %d", errno);
260 251
261 if (stop_ptraced_child(pid, stack, 0, 0) < 0) 252 if (stop_ptraced_child(pid, 0, 0) < 0)
262 goto fail_stopped; 253 goto fail_stopped;
263 254
264 sysemu_supported = 1; 255 sysemu_supported = 1;
@@ -266,7 +257,7 @@ static void __init check_sysemu(void)
266 set_using_sysemu(!force_sysemu_disabled); 257 set_using_sysemu(!force_sysemu_disabled);
267 258
268 printk("Checking advanced syscall emulation patch for ptrace..."); 259 printk("Checking advanced syscall emulation patch for ptrace...");
269 pid = start_ptraced_child(&stack); 260 pid = start_ptraced_child();
270 while(1){ 261 while(1){
271 count++; 262 count++;
272 if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0) 263 if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0)
@@ -291,7 +282,7 @@ static void __init check_sysemu(void)
291 break; 282 break;
292 } 283 }
293 } 284 }
294 if (stop_ptraced_child(pid, stack, 0, 0) < 0) 285 if (stop_ptraced_child(pid, 0, 0) < 0)
295 goto fail_stopped; 286 goto fail_stopped;
296 287
297 sysemu_supported = 2; 288 sysemu_supported = 2;
@@ -302,18 +293,17 @@ static void __init check_sysemu(void)
302 return; 293 return;
303 294
304fail: 295fail:
305 stop_ptraced_child(pid, stack, 1, 0); 296 stop_ptraced_child(pid, 1, 0);
306fail_stopped: 297fail_stopped:
307 printk("missing\n"); 298 printk("missing\n");
308} 299}
309 300
310void __init check_ptrace(void) 301void __init check_ptrace(void)
311{ 302{
312 void *stack;
313 int pid, syscall, n, status; 303 int pid, syscall, n, status;
314 304
315 printk("Checking that ptrace can change system call numbers..."); 305 printk("Checking that ptrace can change system call numbers...");
316 pid = start_ptraced_child(&stack); 306 pid = start_ptraced_child();
317 307
318 if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0) 308 if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0)
319 panic("check_ptrace: PTRACE_SETOPTIONS failed, errno = %d", errno); 309 panic("check_ptrace: PTRACE_SETOPTIONS failed, errno = %d", errno);
@@ -340,7 +330,7 @@ void __init check_ptrace(void)
340 break; 330 break;
341 } 331 }
342 } 332 }
343 stop_ptraced_child(pid, stack, 0, 1); 333 stop_ptraced_child(pid, 0, 1);
344 printk("OK\n"); 334 printk("OK\n");
345 check_sysemu(); 335 check_sysemu();
346} 336}
@@ -372,11 +362,10 @@ void forward_pending_sigio(int target)
372static inline int check_skas3_ptrace_support(void) 362static inline int check_skas3_ptrace_support(void)
373{ 363{
374 struct ptrace_faultinfo fi; 364 struct ptrace_faultinfo fi;
375 void *stack;
376 int pid, n, ret = 1; 365 int pid, n, ret = 1;
377 366
378 printf("Checking for the skas3 patch in the host..."); 367 printf("Checking for the skas3 patch in the host...");
379 pid = start_ptraced_child(&stack); 368 pid = start_ptraced_child();
380 369
381 n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi); 370 n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi);
382 if (n < 0) { 371 if (n < 0) {
@@ -391,7 +380,7 @@ static inline int check_skas3_ptrace_support(void)
391 } 380 }
392 381
393 init_registers(pid); 382 init_registers(pid);
394 stop_ptraced_child(pid, stack, 1, 1); 383 stop_ptraced_child(pid, 1, 1);
395 384
396 return(ret); 385 return(ret);
397} 386}
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c
index c1adf7ba3fd1..804c6bbdf67c 100644
--- a/arch/um/kernel/process_kern.c
+++ b/arch/um/kernel/process_kern.c
@@ -43,7 +43,6 @@
43#include "tlb.h" 43#include "tlb.h"
44#include "frame_kern.h" 44#include "frame_kern.h"
45#include "sigcontext.h" 45#include "sigcontext.h"
46#include "2_5compat.h"
47#include "os.h" 46#include "os.h"
48#include "mode.h" 47#include "mode.h"
49#include "mode_kern.h" 48#include "mode_kern.h"
@@ -55,18 +54,6 @@
55 */ 54 */
56struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } }; 55struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } };
57 56
58struct task_struct *get_task(int pid, int require)
59{
60 struct task_struct *ret;
61
62 read_lock(&tasklist_lock);
63 ret = find_task_by_pid(pid);
64 read_unlock(&tasklist_lock);
65
66 if(require && (ret == NULL)) panic("get_task couldn't find a task\n");
67 return(ret);
68}
69
70int external_pid(void *t) 57int external_pid(void *t)
71{ 58{
72 struct task_struct *task = t ? t : current; 59 struct task_struct *task = t ? t : current;
@@ -189,7 +176,6 @@ void default_idle(void)
189 176
190 while(1){ 177 while(1){
191 /* endless idle loop with no priority at all */ 178 /* endless idle loop with no priority at all */
192 SET_PRI(current);
193 179
194 /* 180 /*
195 * although we are an idle CPU, we do not want to 181 * although we are an idle CPU, we do not want to
@@ -212,11 +198,6 @@ int page_size(void)
212 return(PAGE_SIZE); 198 return(PAGE_SIZE);
213} 199}
214 200
215unsigned long page_mask(void)
216{
217 return(PAGE_MASK);
218}
219
220void *um_virt_to_phys(struct task_struct *task, unsigned long addr, 201void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
221 pte_t *pte_out) 202 pte_t *pte_out)
222{ 203{
@@ -349,11 +330,6 @@ char *uml_strdup(char *string)
349 return(new); 330 return(new);
350} 331}
351 332
352void *get_init_task(void)
353{
354 return(&init_thread_union.thread_info.task);
355}
356
357int copy_to_user_proc(void __user *to, void *from, int size) 333int copy_to_user_proc(void __user *to, void *from, int size)
358{ 334{
359 return(copy_to_user(to, from, size)); 335 return(copy_to_user(to, from, size));
@@ -480,15 +456,3 @@ unsigned long arch_align_stack(unsigned long sp)
480 return sp & ~0xf; 456 return sp & ~0xf;
481} 457}
482#endif 458#endif
483
484
485/*
486 * Overrides for Emacs so that we follow Linus's tabbing style.
487 * Emacs will notice this stuff at the end of the file and automatically
488 * adjust the settings for this buffer only. This must remain at the end
489 * of the file.
490 * ---------------------------------------------------------------------------
491 * Local variables:
492 * c-file-style: "linux"
493 * End:
494 */
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 2b75d8d9ba73..71af4d503899 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -28,9 +28,9 @@ static inline void set_singlestepping(struct task_struct *child, int on)
28 child->thread.singlestep_syscall = 0; 28 child->thread.singlestep_syscall = 0;
29 29
30#ifdef SUBARCH_SET_SINGLESTEPPING 30#ifdef SUBARCH_SET_SINGLESTEPPING
31 SUBARCH_SET_SINGLESTEPPING(child, on) 31 SUBARCH_SET_SINGLESTEPPING(child, on);
32#endif 32#endif
33 } 33}
34 34
35/* 35/*
36 * Called by kernel/ptrace.c when detaching.. 36 * Called by kernel/ptrace.c when detaching..
@@ -83,7 +83,7 @@ long sys_ptrace(long request, long pid, long addr, long data)
83 } 83 }
84 84
85#ifdef SUBACH_PTRACE_SPECIAL 85#ifdef SUBACH_PTRACE_SPECIAL
86 SUBARCH_PTRACE_SPECIAL(child,request,addr,data) 86 SUBARCH_PTRACE_SPECIAL(child,request,addr,data);
87#endif 87#endif
88 88
89 ret = ptrace_check_attach(child, request == PTRACE_KILL); 89 ret = ptrace_check_attach(child, request == PTRACE_KILL);
@@ -322,11 +322,9 @@ void syscall_trace(union uml_pt_regs *regs, int entryexit)
322 UPT_SYSCALL_ARG2(regs), 322 UPT_SYSCALL_ARG2(regs),
323 UPT_SYSCALL_ARG3(regs), 323 UPT_SYSCALL_ARG3(regs),
324 UPT_SYSCALL_ARG4(regs)); 324 UPT_SYSCALL_ARG4(regs));
325 else { 325 else audit_syscall_exit(current,
326 int res = UPT_SYSCALL_RET(regs); 326 AUDITSC_RESULT(UPT_SYSCALL_RET(regs)),
327 audit_syscall_exit(current, AUDITSC_RESULT(res), 327 UPT_SYSCALL_RET(regs));
328 res);
329 }
330 } 328 }
331 329
332 /* Fake a debug trap */ 330 /* Fake a debug trap */
@@ -356,14 +354,3 @@ void syscall_trace(union uml_pt_regs *regs, int entryexit)
356 current->exit_code = 0; 354 current->exit_code = 0;
357 } 355 }
358} 356}
359
360/*
361 * Overrides for Emacs so that we follow Linus's tabbing style.
362 * Emacs will notice this stuff at the end of the file and automatically
363 * adjust the settings for this buffer only. This must remain at the end
364 * of the file.
365 * ---------------------------------------------------------------------------
366 * Local variables:
367 * c-file-style: "linux"
368 * End:
369 */
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c
index ab5d3271da0b..fc71ef295782 100644
--- a/arch/um/kernel/skas/process_kern.c
+++ b/arch/um/kernel/skas/process_kern.c
@@ -68,8 +68,11 @@ void new_thread_handler(int sig)
68 * 0 if it just exits 68 * 0 if it just exits
69 */ 69 */
70 n = run_kernel_thread(fn, arg, &current->thread.exec_buf); 70 n = run_kernel_thread(fn, arg, &current->thread.exec_buf);
71 if(n == 1) 71 if(n == 1){
72 /* Handle any immediate reschedules or signals */
73 interrupt_end();
72 userspace(&current->thread.regs.regs); 74 userspace(&current->thread.regs.regs);
75 }
73 else do_exit(0); 76 else do_exit(0);
74} 77}
75 78
@@ -96,6 +99,8 @@ void fork_handler(int sig)
96 schedule_tail(current->thread.prev_sched); 99 schedule_tail(current->thread.prev_sched);
97 current->thread.prev_sched = NULL; 100 current->thread.prev_sched = NULL;
98 101
102 /* Handle any immediate reschedules or signals */
103 interrupt_end();
99 userspace(&current->thread.regs.regs); 104 userspace(&current->thread.regs.regs);
100} 105}
101 106
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c
index e630438f9e73..f80850091e79 100644
--- a/arch/um/kernel/sysrq.c
+++ b/arch/um/kernel/sysrq.c
@@ -3,6 +3,7 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "linux/config.h"
6#include "linux/sched.h" 7#include "linux/sched.h"
7#include "linux/kernel.h" 8#include "linux/kernel.h"
8#include "linux/module.h" 9#include "linux/module.h"
@@ -12,14 +13,14 @@
12#include "sysrq.h" 13#include "sysrq.h"
13#include "user_util.h" 14#include "user_util.h"
14 15
15void show_trace(unsigned long * stack) 16/* Catch non-i386 SUBARCH's. */
17#if !defined(CONFIG_UML_X86) || defined(CONFIG_64BIT)
18void show_trace(struct task_struct *task, unsigned long * stack)
16{ 19{
17 /* XXX: Copy the CONFIG_FRAME_POINTER stack-walking backtrace from
18 * arch/i386/kernel/traps.c, and then move this to sys-i386/sysrq.c.*/
19 unsigned long addr; 20 unsigned long addr;
20 21
21 if (!stack) { 22 if (!stack) {
22 stack = (unsigned long*) &stack; 23 stack = (unsigned long*) &stack;
23 WARN_ON(1); 24 WARN_ON(1);
24 } 25 }
25 26
@@ -35,6 +36,7 @@ void show_trace(unsigned long * stack)
35 } 36 }
36 printk("\n"); 37 printk("\n");
37} 38}
39#endif
38 40
39/* 41/*
40 * stack dumps generator - this is used by arch-independent code. 42 * stack dumps generator - this is used by arch-independent code.
@@ -44,7 +46,7 @@ void dump_stack(void)
44{ 46{
45 unsigned long stack; 47 unsigned long stack;
46 48
47 show_trace(&stack); 49 show_trace(current, &stack);
48} 50}
49EXPORT_SYMBOL(dump_stack); 51EXPORT_SYMBOL(dump_stack);
50 52
@@ -59,7 +61,11 @@ void show_stack(struct task_struct *task, unsigned long *esp)
59 int i; 61 int i;
60 62
61 if (esp == NULL) { 63 if (esp == NULL) {
62 if (task != current) { 64 if (task != current && task != NULL) {
65 /* XXX: Isn't this bogus? I.e. isn't this the
66 * *userspace* stack of this task? If not so, use this
67 * even when task == current (as in i386).
68 */
63 esp = (unsigned long *) KSTK_ESP(task); 69 esp = (unsigned long *) KSTK_ESP(task);
64 /* Which one? No actual difference - just coding style.*/ 70 /* Which one? No actual difference - just coding style.*/
65 //esp = (unsigned long *) PT_REGS_IP(&task->thread.regs); 71 //esp = (unsigned long *) PT_REGS_IP(&task->thread.regs);
@@ -77,5 +83,6 @@ void show_stack(struct task_struct *task, unsigned long *esp)
77 printk("%08lx ", *stack++); 83 printk("%08lx ", *stack++);
78 } 84 }
79 85
80 show_trace(esp); 86 printk("Call Trace: \n");
87 show_trace(current, esp);
81} 88}
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c
index 5fca2c61eb98..c20aef120598 100644
--- a/arch/um/kernel/trap_kern.c
+++ b/arch/um/kernel/trap_kern.c
@@ -23,7 +23,6 @@
23#include "kern.h" 23#include "kern.h"
24#include "chan_kern.h" 24#include "chan_kern.h"
25#include "mconsole_kern.h" 25#include "mconsole_kern.h"
26#include "2_5compat.h"
27#include "mem.h" 26#include "mem.h"
28#include "mem_kern.h" 27#include "mem_kern.h"
29 28
@@ -57,10 +56,11 @@ int handle_page_fault(unsigned long address, unsigned long ip,
57 *code_out = SEGV_ACCERR; 56 *code_out = SEGV_ACCERR;
58 if(is_write && !(vma->vm_flags & VM_WRITE)) 57 if(is_write && !(vma->vm_flags & VM_WRITE))
59 goto out; 58 goto out;
59
60 if(!(vma->vm_flags & (VM_READ | VM_EXEC)))
61 goto out;
62
60 page = address & PAGE_MASK; 63 page = address & PAGE_MASK;
61 pgd = pgd_offset(mm, page);
62 pud = pud_offset(pgd, page);
63 pmd = pmd_offset(pud, page);
64 do { 64 do {
65 survive: 65 survive:
66 switch (handle_mm_fault(mm, vma, address, is_write)){ 66 switch (handle_mm_fault(mm, vma, address, is_write)){
@@ -106,33 +106,6 @@ out_of_memory:
106 goto out; 106 goto out;
107} 107}
108 108
109LIST_HEAD(physmem_remappers);
110
111void register_remapper(struct remapper *info)
112{
113 list_add(&info->list, &physmem_remappers);
114}
115
116static int check_remapped_addr(unsigned long address, int is_write)
117{
118 struct remapper *remapper;
119 struct list_head *ele;
120 __u64 offset;
121 int fd;
122
123 fd = phys_mapping(__pa(address), &offset);
124 if(fd == -1)
125 return(0);
126
127 list_for_each(ele, &physmem_remappers){
128 remapper = list_entry(ele, struct remapper, list);
129 if((*remapper->proc)(fd, address, is_write, offset))
130 return(1);
131 }
132
133 return(0);
134}
135
136/* 109/*
137 * We give a *copy* of the faultinfo in the regs to segv. 110 * We give a *copy* of the faultinfo in the regs to segv.
138 * This must be done, since nesting SEGVs could overwrite 111 * This must be done, since nesting SEGVs could overwrite
@@ -151,8 +124,6 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
151 flush_tlb_kernel_vm(); 124 flush_tlb_kernel_vm();
152 return(0); 125 return(0);
153 } 126 }
154 else if(check_remapped_addr(address & PAGE_MASK, is_write))
155 return(0);
156 else if(current->mm == NULL) 127 else if(current->mm == NULL)
157 panic("Segfault with no mm"); 128 panic("Segfault with no mm");
158 err = handle_page_fault(address, ip, is_write, is_user, &si.si_code); 129 err = handle_page_fault(address, ip, is_write, is_user, &si.si_code);
diff --git a/arch/um/kernel/tt/Makefile b/arch/um/kernel/tt/Makefile
index c3faea21a996..3fd2554e60b6 100644
--- a/arch/um/kernel/tt/Makefile
+++ b/arch/um/kernel/tt/Makefile
@@ -3,10 +3,6 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6extra-y := unmap_fin.o
7targets := unmap.o
8clean-files := unmap_tmp.o
9
10obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \ 6obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \
11 syscall_kern.o syscall_user.o time.o tlb.o tracer.o trap_user.o \ 7 syscall_kern.o syscall_user.o time.o tlb.o tracer.o trap_user.o \
12 uaccess.o uaccess_user.o 8 uaccess.o uaccess_user.o
@@ -16,14 +12,3 @@ obj-$(CONFIG_PT_PROXY) += gdb_kern.o ptproxy/
16USER_OBJS := gdb.o time.o tracer.o 12USER_OBJS := gdb.o time.o tracer.o
17 13
18include arch/um/scripts/Makefile.rules 14include arch/um/scripts/Makefile.rules
19
20UNMAP_CFLAGS := $(patsubst -pg -DPROFILING,,$(USER_CFLAGS))
21UNMAP_CFLAGS := $(patsubst -fprofile-arcs -ftest-coverage,,$(UNMAP_CFLAGS))
22
23#XXX: partially copied from arch/um/scripts/Makefile.rules
24$(obj)/unmap.o: c_flags = -Wp,-MD,$(depfile) $(UNMAP_CFLAGS)
25
26$(obj)/unmap_fin.o : $(obj)/unmap.o
27 $(LD) -r -o $(obj)/unmap_tmp.o $< $(shell $(CC) -print-file-name=libc.a)
28 $(OBJCOPY) $(obj)/unmap_tmp.o $@ -G switcheroo
29
diff --git a/arch/um/kernel/tt/ksyms.c b/arch/um/kernel/tt/ksyms.c
index 92ec85d67c7c..84a9385a8fef 100644
--- a/arch/um/kernel/tt/ksyms.c
+++ b/arch/um/kernel/tt/ksyms.c
@@ -12,6 +12,7 @@ EXPORT_SYMBOL(__do_copy_to_user);
12EXPORT_SYMBOL(__do_strncpy_from_user); 12EXPORT_SYMBOL(__do_strncpy_from_user);
13EXPORT_SYMBOL(__do_strnlen_user); 13EXPORT_SYMBOL(__do_strnlen_user);
14EXPORT_SYMBOL(__do_clear_user); 14EXPORT_SYMBOL(__do_clear_user);
15EXPORT_SYMBOL(clear_user_tt);
15 16
16EXPORT_SYMBOL(tracing_pid); 17EXPORT_SYMBOL(tracing_pid);
17EXPORT_SYMBOL(honeypot); 18EXPORT_SYMBOL(honeypot);
diff --git a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c
index df810ca8fc12..776310fd5b8b 100644
--- a/arch/um/kernel/tt/process_kern.c
+++ b/arch/um/kernel/tt/process_kern.c
@@ -32,10 +32,6 @@ void *switch_to_tt(void *prev, void *next, void *last)
32 unsigned long flags; 32 unsigned long flags;
33 int err, vtalrm, alrm, prof, cpu; 33 int err, vtalrm, alrm, prof, cpu;
34 char c; 34 char c;
35 /* jailing and SMP are incompatible, so this doesn't need to be
36 * made per-cpu
37 */
38 static int reading;
39 35
40 from = prev; 36 from = prev;
41 to = next; 37 to = next;
@@ -59,13 +55,11 @@ void *switch_to_tt(void *prev, void *next, void *last)
59 c = 0; 55 c = 0;
60 set_current(to); 56 set_current(to);
61 57
62 reading = 0;
63 err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c)); 58 err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c));
64 if(err != sizeof(c)) 59 if(err != sizeof(c))
65 panic("write of switch_pipe failed, err = %d", -err); 60 panic("write of switch_pipe failed, err = %d", -err);
66 61
67 reading = 1; 62 if(from->thread.mode.tt.switch_pipe[0] == -1)
68 if(from->thread.mode.tt.switch_pipe[0] == -1)
69 os_kill_process(os_getpid(), 0); 63 os_kill_process(os_getpid(), 0);
70 64
71 err = os_read_file(from->thread.mode.tt.switch_pipe[0], &c, sizeof(c)); 65 err = os_read_file(from->thread.mode.tt.switch_pipe[0], &c, sizeof(c));
diff --git a/arch/um/kernel/tt/unmap.c b/arch/um/kernel/tt/unmap.c
deleted file mode 100644
index 3f7aecdbe532..000000000000
--- a/arch/um/kernel/tt/unmap.c
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <sys/mman.h>
7
8int switcheroo(int fd, int prot, void *from, void *to, int size)
9{
10 if(munmap(to, size) < 0){
11 return(-1);
12 }
13 if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){
14 return(-1);
15 }
16 if(munmap(from, size) < 0){
17 return(-1);
18 }
19 return(0);
20}
21
22/*
23 * Overrides for Emacs so that we follow Linus's tabbing style.
24 * Emacs will notice this stuff at the end of the file and automatically
25 * adjust the settings for this buffer only. This must remain at the end
26 * of the file.
27 * ---------------------------------------------------------------------------
28 * Local variables:
29 * c-file-style: "linux"
30 * End:
31 */
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 4d10ec372a67..8736d098f0ee 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -26,7 +26,6 @@
26#include "asm/setup.h" 26#include "asm/setup.h"
27#include "ubd_user.h" 27#include "ubd_user.h"
28#include "asm/current.h" 28#include "asm/current.h"
29#include "asm/setup.h"
30#include "user_util.h" 29#include "user_util.h"
31#include "kern_util.h" 30#include "kern_util.h"
32#include "kern.h" 31#include "kern.h"
@@ -111,12 +110,6 @@ struct seq_operations cpuinfo_op = {
111 .show = show_cpuinfo, 110 .show = show_cpuinfo,
112}; 111};
113 112
114pte_t * __bad_pagetable(void)
115{
116 panic("Someone should implement __bad_pagetable");
117 return(NULL);
118}
119
120/* Set in linux_main */ 113/* Set in linux_main */
121unsigned long host_task_size; 114unsigned long host_task_size;
122unsigned long task_size; 115unsigned long task_size;
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index 76eadb309189..61dfd4fef752 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -14,19 +14,10 @@ SECTIONS
14 /* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start 14 /* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start
15 * is remapped.*/ 15 * is remapped.*/
16 __binary_start = .; 16 __binary_start = .;
17#ifdef MODE_TT
18 .thread_private : {
19 __start_thread_private = .;
20 errno = .;
21 . += 4;
22 arch/um/kernel/tt/unmap_fin.o (.data)
23 __end_thread_private = .;
24 }
25 . = ALIGN(4096);
26 .remap : { arch/um/kernel/tt/unmap_fin.o (.text) }
27 17
28 /* We want it only if we are in MODE_TT. In both cases, however, when MODE_TT 18#ifdef MODE_TT
29 * is off the resulting binary segfaults.*/ 19 .remap_data : { arch/um/sys-SUBARCH/unmap_fin.o (.data .bss) }
20 .remap : { arch/um/sys-SUBARCH/unmap_fin.o (.text) }
30 21
31 . = ALIGN(4096); /* Init code and data */ 22 . = ALIGN(4096); /* Init code and data */
32#endif 23#endif
@@ -73,6 +64,8 @@ SECTIONS
73 64
74 .got : { *(.got.plt) *(.got) } 65 .got : { *(.got.plt) *(.got) }
75 .dynamic : { *(.dynamic) } 66 .dynamic : { *(.dynamic) }
67 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
68 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
76 /* We want the small data sections together, so single-instruction offsets 69 /* We want the small data sections together, so single-instruction offsets
77 can access them all, and initialized data all before uninitialized, so 70 can access them all, and initialized data all before uninitialized, so
78 we can shorten the on-disk segment size. */ 71 we can shorten the on-disk segment size. */
diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c
index 9aee0b62ebca..f0d6060e3e57 100644
--- a/arch/um/os-Linux/elf_aux.c
+++ b/arch/um/os-Linux/elf_aux.c
@@ -45,7 +45,11 @@ __init void scan_elf_aux( char **envp)
45 elf_aux_hwcap = auxv->a_un.a_val; 45 elf_aux_hwcap = auxv->a_un.a_val;
46 break; 46 break;
47 case AT_PLATFORM: 47 case AT_PLATFORM:
48 elf_aux_platform = auxv->a_un.a_ptr; 48 /* elf.h removed the pointer elements from
49 * a_un, so we have to use a_val, which is
50 * all that's left.
51 */
52 elf_aux_platform = (char *) auxv->a_un.a_val;
49 break; 53 break;
50 case AT_PAGESZ: 54 case AT_PAGESZ:
51 page_size = auxv->a_un.a_val; 55 page_size = auxv->a_un.a_val;
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index 77d4066d1af8..fd45bb260907 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -363,7 +363,7 @@ int os_write_file(int fd, const void *buf, int len)
363 (int (*)(int, void *, int)) write, copy_to_user_proc)); 363 (int (*)(int, void *, int)) write, copy_to_user_proc));
364} 364}
365 365
366int os_file_size(char *file, long long *size_out) 366int os_file_size(char *file, unsigned long long *size_out)
367{ 367{
368 struct uml_stat buf; 368 struct uml_stat buf;
369 int err; 369 int err;
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index 0b2491883d9c..7459d09c233e 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -10,11 +10,17 @@ USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
10$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) \ 10$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) \
11 $(CFLAGS_$(notdir $@)) 11 $(CFLAGS_$(notdir $@))
12 12
13# The stubs and unmap.o can't try to call mcount or update basic block data
14define unprofile
15 $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1)))
16endef
17
18
13quiet_cmd_make_link = SYMLINK $@ 19quiet_cmd_make_link = SYMLINK $@
14cmd_make_link = ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@ 20cmd_make_link = ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@
15 21
16# this needs to be before the foreach, because targets does not accept 22# this needs to be before the foreach, because targets does not accept
17# complete paths like $(obj)/$(f). To make sure this works, use a := assignment, 23# complete paths like $(obj)/$(f). To make sure this works, use a := assignment
18# or we will get $(obj)/$(f) in the "targets" value. 24# or we will get $(obj)/$(f) in the "targets" value.
19# Also, this forces you to use the := syntax when assigning to targets. 25# Also, this forces you to use the := syntax when assigning to targets.
20# Otherwise the line below will cause an infinite loop (if you don't know why, 26# Otherwise the line below will cause an infinite loop (if you don't know why,
diff --git a/arch/um/scripts/Makefile.unmap b/arch/um/scripts/Makefile.unmap
new file mode 100644
index 000000000000..37a8f9765295
--- /dev/null
+++ b/arch/um/scripts/Makefile.unmap
@@ -0,0 +1,22 @@
1clean-files += unmap_tmp.o unmap_fin.o unmap.o
2
3ifdef CONFIG_MODE_TT
4
5#Always build unmap_fin.o
6extra-y += unmap_fin.o
7#Do dependency tracking for unmap.o (it will be always built, but won't get the tracking unless we use this).
8targets += unmap.o
9
10#XXX: partially copied from arch/um/scripts/Makefile.rules
11$(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS))
12
13quiet_cmd_wrapld = LD $@
14define cmd_wrapld
15 $(LD) -r -o $(obj)/unmap_tmp.o $< $(shell $(CC) -print-file-name=libc.a); \
16 $(OBJCOPY) $(obj)/unmap_tmp.o $@ -G switcheroo
17endef
18
19$(obj)/unmap_fin.o : $(obj)/unmap.o FORCE
20 $(call if_changed,wrapld)
21
22endif
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile
index fcd67c3414e4..095bcdb0b9cc 100644
--- a/arch/um/sys-i386/Makefile
+++ b/arch/um/sys-i386/Makefile
@@ -9,6 +9,8 @@ USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o
9 9
10SYMLINKS = bitops.c semaphore.c highmem.c module.c 10SYMLINKS = bitops.c semaphore.c highmem.c module.c
11 11
12include arch/um/scripts/Makefile.rules
13
12bitops.c-dir = lib 14bitops.c-dir = lib
13semaphore.c-dir = kernel 15semaphore.c-dir = kernel
14highmem.c-dir = mm 16highmem.c-dir = mm
@@ -16,4 +18,4 @@ module.c-dir = kernel
16 18
17subdir- := util 19subdir- := util
18 20
19include arch/um/scripts/Makefile.rules 21include arch/um/scripts/Makefile.unmap
diff --git a/arch/um/sys-i386/delay.c b/arch/um/sys-i386/delay.c
index e9892eef51ce..2c11b9770e8b 100644
--- a/arch/um/sys-i386/delay.c
+++ b/arch/um/sys-i386/delay.c
@@ -1,5 +1,7 @@
1#include "linux/delay.h" 1#include <linux/module.h>
2#include "asm/param.h" 2#include <linux/kernel.h>
3#include <linux/delay.h>
4#include <asm/param.h>
3 5
4void __delay(unsigned long time) 6void __delay(unsigned long time)
5{ 7{
@@ -20,13 +22,19 @@ void __udelay(unsigned long usecs)
20 int i, n; 22 int i, n;
21 23
22 n = (loops_per_jiffy * HZ * usecs) / MILLION; 24 n = (loops_per_jiffy * HZ * usecs) / MILLION;
23 for(i=0;i<n;i++) ; 25 for(i=0;i<n;i++)
26 cpu_relax();
24} 27}
25 28
29EXPORT_SYMBOL(__udelay);
30
26void __const_udelay(unsigned long usecs) 31void __const_udelay(unsigned long usecs)
27{ 32{
28 int i, n; 33 int i, n;
29 34
30 n = (loops_per_jiffy * HZ * usecs) / MILLION; 35 n = (loops_per_jiffy * HZ * usecs) / MILLION;
31 for(i=0;i<n;i++) ; 36 for(i=0;i<n;i++)
37 cpu_relax();
32} 38}
39
40EXPORT_SYMBOL(__const_udelay);
diff --git a/arch/um/sys-i386/sysrq.c b/arch/um/sys-i386/sysrq.c
index 281fc7b8ca00..e3706d15c4f5 100644
--- a/arch/um/sys-i386/sysrq.c
+++ b/arch/um/sys-i386/sysrq.c
@@ -3,12 +3,15 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "linux/config.h"
6#include "linux/kernel.h" 7#include "linux/kernel.h"
7#include "linux/smp.h" 8#include "linux/smp.h"
8#include "linux/sched.h" 9#include "linux/sched.h"
10#include "linux/kallsyms.h"
9#include "asm/ptrace.h" 11#include "asm/ptrace.h"
10#include "sysrq.h" 12#include "sysrq.h"
11 13
14/* This is declared by <linux/sched.h> */
12void show_regs(struct pt_regs *regs) 15void show_regs(struct pt_regs *regs)
13{ 16{
14 printk("\n"); 17 printk("\n");
@@ -31,5 +34,80 @@ void show_regs(struct pt_regs *regs)
31 0xffff & PT_REGS_DS(regs), 34 0xffff & PT_REGS_DS(regs),
32 0xffff & PT_REGS_ES(regs)); 35 0xffff & PT_REGS_ES(regs));
33 36
34 show_trace((unsigned long *) &regs); 37 show_trace(NULL, (unsigned long *) &regs);
35} 38}
39
40/* Copied from i386. */
41static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
42{
43 return p > (void *)tinfo &&
44 p < (void *)tinfo + THREAD_SIZE - 3;
45}
46
47/* Adapted from i386 (we also print the address we read from). */
48static inline unsigned long print_context_stack(struct thread_info *tinfo,
49 unsigned long *stack, unsigned long ebp)
50{
51 unsigned long addr;
52
53#ifdef CONFIG_FRAME_POINTER
54 while (valid_stack_ptr(tinfo, (void *)ebp)) {
55 addr = *(unsigned long *)(ebp + 4);
56 printk("%08lx: [<%08lx>]", ebp + 4, addr);
57 print_symbol(" %s", addr);
58 printk("\n");
59 ebp = *(unsigned long *)ebp;
60 }
61#else
62 while (valid_stack_ptr(tinfo, stack)) {
63 addr = *stack;
64 if (__kernel_text_address(addr)) {
65 printk("%08lx: [<%08lx>]", (unsigned long) stack, addr);
66 print_symbol(" %s", addr);
67 printk("\n");
68 }
69 stack++;
70 }
71#endif
72 return ebp;
73}
74
75void show_trace(struct task_struct* task, unsigned long * stack)
76{
77 unsigned long ebp;
78 struct thread_info *context;
79
80 /* Turn this into BUG_ON if possible. */
81 if (!stack) {
82 stack = (unsigned long*) &stack;
83 printk("show_trace: got NULL stack, implicit assumption task == current");
84 WARN_ON(1);
85 }
86
87 if (!task)
88 task = current;
89
90 if (task != current) {
91 //ebp = (unsigned long) KSTK_EBP(task);
92 /* Which one? No actual difference - just coding style.*/
93 ebp = (unsigned long) PT_REGS_EBP(&task->thread.regs);
94 } else {
95 asm ("movl %%ebp, %0" : "=r" (ebp) : );
96 }
97
98 context = (struct thread_info *)
99 ((unsigned long)stack & (~(THREAD_SIZE - 1)));
100 print_context_stack(context, stack, ebp);
101
102 /*while (((long) stack & (THREAD_SIZE-1)) != 0) {
103 addr = *stack;
104 if (__kernel_text_address(addr)) {
105 printk("%08lx: [<%08lx>]", (unsigned long) stack, addr);
106 print_symbol(" %s", addr);
107 printk("\n");
108 }
109 stack++;
110 }*/
111 printk("\n");
112}
113
diff --git a/arch/um/sys-i386/unmap.c b/arch/um/sys-i386/unmap.c
new file mode 100644
index 000000000000..136875263d27
--- /dev/null
+++ b/arch/um/sys-i386/unmap.c
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <linux/mman.h>
7#include <asm/unistd.h>
8
9static int errno;
10
11static inline _syscall2(int,munmap,void *,start,size_t,len)
12static inline _syscall6(void *,mmap2,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset)
13int switcheroo(int fd, int prot, void *from, void *to, int size)
14{
15 if(munmap(to, size) < 0){
16 return(-1);
17 }
18 if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){
19 return(-1);
20 }
21 if(munmap(from, size) < 0){
22 return(-1);
23 }
24 return(0);
25}
diff --git a/arch/um/sys-ppc/sysrq.c b/arch/um/sys-ppc/sysrq.c
index 82d6e9335bb6..2f816f1a0ff4 100644
--- a/arch/um/sys-ppc/sysrq.c
+++ b/arch/um/sys-ppc/sysrq.c
@@ -27,17 +27,5 @@ void show_regs(struct pt_regs_subarch *regs)
27 0xffff & regs->xds, 0xffff & regs->xes); 27 0xffff & regs->xds, 0xffff & regs->xes);
28#endif 28#endif
29 29
30 show_trace(&regs->gpr[1]); 30 show_trace(current, &regs->gpr[1]);
31} 31}
32
33
34/*
35 * Overrides for Emacs so that we follow Linus's tabbing style.
36 * Emacs will notice this stuff at the end of the file and automatically
37 * adjust the settings for this buffer only. This must remain at the end
38 * of the file.
39 * ---------------------------------------------------------------------------
40 * Local variables:
41 * c-file-style: "linux"
42 * End:
43 */
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile
index 3d7da911cc8c..2bc6f6849010 100644
--- a/arch/um/sys-x86_64/Makefile
+++ b/arch/um/sys-x86_64/Makefile
@@ -14,11 +14,11 @@ 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
17include arch/um/scripts/Makefile.rules
18
19SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \ 17SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \
20 semaphore.c thunk.S module.c 18 semaphore.c thunk.S module.c
21 19
20include arch/um/scripts/Makefile.rules
21
22bitops.c-dir = lib 22bitops.c-dir = lib
23csum-copy.S-dir = lib 23csum-copy.S-dir = lib
24csum-partial.c-dir = lib 24csum-partial.c-dir = lib
@@ -28,6 +28,6 @@ semaphore.c-dir = kernel
28thunk.S-dir = lib 28thunk.S-dir = lib
29module.c-dir = kernel 29module.c-dir = kernel
30 30
31CFLAGS_csum-partial.o := -Dcsum_partial=arch_csum_partial
32
33subdir- := util 31subdir- := util
32
33include arch/um/scripts/Makefile.unmap
diff --git a/arch/um/sys-x86_64/delay.c b/arch/um/sys-x86_64/delay.c
index 651332aeec22..137f4446b439 100644
--- a/arch/um/sys-x86_64/delay.c
+++ b/arch/um/sys-x86_64/delay.c
@@ -5,40 +5,37 @@
5 * Licensed under the GPL 5 * Licensed under the GPL
6 */ 6 */
7 7
8#include "linux/delay.h" 8#include <linux/module.h>
9#include "asm/processor.h" 9#include <linux/delay.h>
10#include "asm/param.h" 10#include <asm/processor.h>
11#include <asm/param.h>
11 12
12void __delay(unsigned long loops) 13void __delay(unsigned long loops)
13{ 14{
14 unsigned long i; 15 unsigned long i;
15 16
16 for(i = 0; i < loops; i++) ; 17 for(i = 0; i < loops; i++)
18 cpu_relax();
17} 19}
18 20
19void __udelay(unsigned long usecs) 21void __udelay(unsigned long usecs)
20{ 22{
21 int i, n; 23 unsigned long i, n;
22 24
23 n = (loops_per_jiffy * HZ * usecs) / MILLION; 25 n = (loops_per_jiffy * HZ * usecs) / MILLION;
24 for(i=0;i<n;i++) ; 26 for(i=0;i<n;i++)
27 cpu_relax();
25} 28}
26 29
30EXPORT_SYMBOL(__udelay);
31
27void __const_udelay(unsigned long usecs) 32void __const_udelay(unsigned long usecs)
28{ 33{
29 int i, n; 34 unsigned long i, n;
30 35
31 n = (loops_per_jiffy * HZ * usecs) / MILLION; 36 n = (loops_per_jiffy * HZ * usecs) / MILLION;
32 for(i=0;i<n;i++) ; 37 for(i=0;i<n;i++)
38 cpu_relax();
33} 39}
34 40
35/* 41EXPORT_SYMBOL(__const_udelay);
36 * Overrides for Emacs so that we follow Linus's tabbing style.
37 * Emacs will notice this stuff at the end of the file and automatically
38 * adjust the settings for this buffer only. This must remain at the end
39 * of the file.
40 * ---------------------------------------------------------------------------
41 * Local variables:
42 * c-file-style: "linux"
43 * End:
44 */
diff --git a/arch/um/sys-x86_64/ksyms.c b/arch/um/sys-x86_64/ksyms.c
index a27f0ee6a4f6..859273808203 100644
--- a/arch/um/sys-x86_64/ksyms.c
+++ b/arch/um/sys-x86_64/ksyms.c
@@ -16,5 +16,4 @@ EXPORT_SYMBOL(__up_wakeup);
16EXPORT_SYMBOL(__memcpy); 16EXPORT_SYMBOL(__memcpy);
17 17
18/* Networking helper routines. */ 18/* Networking helper routines. */
19/*EXPORT_SYMBOL(csum_partial_copy_from); 19EXPORT_SYMBOL(ip_compute_csum);
20EXPORT_SYMBOL(csum_partial_copy_to);*/
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c
index b593bb256f2c..74eee5c7c6dd 100644
--- a/arch/um/sys-x86_64/ptrace.c
+++ b/arch/um/sys-x86_64/ptrace.c
@@ -5,10 +5,11 @@
5 */ 5 */
6 6
7#define __FRAME_OFFSETS 7#define __FRAME_OFFSETS
8#include "asm/ptrace.h" 8#include <asm/ptrace.h>
9#include "linux/sched.h" 9#include <linux/sched.h>
10#include "linux/errno.h" 10#include <linux/errno.h>
11#include "asm/elf.h" 11#include <asm/uaccess.h>
12#include <asm/elf.h>
12 13
13/* XXX x86_64 */ 14/* XXX x86_64 */
14unsigned long not_ss; 15unsigned long not_ss;
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index dd9914642b8e..6f44f40204ed 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -15,6 +15,7 @@
15#include "asm/unistd.h" 15#include "asm/unistd.h"
16#include "asm/prctl.h" /* XXX This should get the constants from libc */ 16#include "asm/prctl.h" /* XXX This should get the constants from libc */
17#include "choose-mode.h" 17#include "choose-mode.h"
18#include "kern.h"
18 19
19asmlinkage long sys_uname64(struct new_utsname __user * name) 20asmlinkage long sys_uname64(struct new_utsname __user * name)
20{ 21{
@@ -132,23 +133,27 @@ static long arch_prctl_tt(int code, unsigned long addr)
132 133
133#ifdef CONFIG_MODE_SKAS 134#ifdef CONFIG_MODE_SKAS
134 135
136/* XXX: Must also call arch_prctl in the host, beside saving the segment bases! */
135static long arch_prctl_skas(int code, unsigned long addr) 137static long arch_prctl_skas(int code, unsigned long addr)
136{ 138{
137 long ret = 0; 139 long ret = 0;
138 140
139 switch(code){ 141 switch(code){
140 case ARCH_SET_GS:
141 current->thread.regs.regs.skas.regs[GS_BASE / sizeof(unsigned long)] = addr;
142 break;
143 case ARCH_SET_FS: 142 case ARCH_SET_FS:
144 current->thread.regs.regs.skas.regs[FS_BASE / sizeof(unsigned long)] = addr; 143 current->thread.regs.regs.skas.regs[FS_BASE / sizeof(unsigned long)] = addr;
145 break; 144 break;
145 case ARCH_SET_GS:
146 current->thread.regs.regs.skas.regs[GS_BASE / sizeof(unsigned long)] = addr;
147 break;
146 case ARCH_GET_FS: 148 case ARCH_GET_FS:
147 ret = put_user(current->thread.regs.regs.skas.regs[GS / sizeof(unsigned long)], &addr); 149 ret = put_user(current->thread.regs.regs.skas.
150 regs[FS_BASE / sizeof(unsigned long)],
151 (unsigned long __user *)addr);
148 break; 152 break;
149 case ARCH_GET_GS: 153 case ARCH_GET_GS:
150 ret = put_user(current->thread.regs.regs.skas.regs[FS / sizeof(unsigned \ 154 ret = put_user(current->thread.regs.regs.skas.
151long)], &addr); 155 regs[GS_BASE / sizeof(unsigned long)],
156 (unsigned long __user *)addr);
152 break; 157 break;
153 default: 158 default:
154 ret = -EINVAL; 159 ret = -EINVAL;
diff --git a/arch/um/sys-x86_64/sysrq.c b/arch/um/sys-x86_64/sysrq.c
index ddf74691a610..d0a25af19a5b 100644
--- a/arch/um/sys-x86_64/sysrq.c
+++ b/arch/um/sys-x86_64/sysrq.c
@@ -36,14 +36,5 @@ void __show_regs(struct pt_regs * regs)
36void show_regs(struct pt_regs *regs) 36void show_regs(struct pt_regs *regs)
37{ 37{
38 __show_regs(regs); 38 __show_regs(regs);
39 show_trace((unsigned long *) &regs); 39 show_trace(current, (unsigned long *) &regs);
40} 40}
41
42/* Emacs will notice this stuff at the end of the file and automatically
43 * adjust the settings for this buffer only. This must remain at the end
44 * of the file.
45 * ---------------------------------------------------------------------------
46 * Local variables:
47 * c-file-style: "linux"
48 * End:
49 */
diff --git a/arch/um/sys-x86_64/unmap.c b/arch/um/sys-x86_64/unmap.c
new file mode 100644
index 000000000000..bc7094cce47e
--- /dev/null
+++ b/arch/um/sys-x86_64/unmap.c
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <linux/mman.h>
7#include <asm/unistd.h>
8
9static int errno;
10
11static inline _syscall2(int,munmap,void *,start,size_t,len)
12static inline _syscall6(void *,mmap,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset)
13int switcheroo(int fd, int prot, void *from, void *to, int size)
14{
15 if(munmap(to, size) < 0){
16 return(-1);
17 }
18 if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){
19 return(-1);
20 }
21 if(munmap(from, size) < 0){
22 return(-1);
23 }
24 return(0);
25}
diff --git a/arch/um/sys-x86_64/user-offsets.c b/arch/um/sys-x86_64/user-offsets.c
index 5e14792e4838..513d17ceafd4 100644
--- a/arch/um/sys-x86_64/user-offsets.c
+++ b/arch/um/sys-x86_64/user-offsets.c
@@ -3,6 +3,14 @@
3#include <signal.h> 3#include <signal.h>
4#define __FRAME_OFFSETS 4#define __FRAME_OFFSETS
5#include <asm/ptrace.h> 5#include <asm/ptrace.h>
6#include <asm/types.h>
7/* For some reason, x86_64 defines u64 and u32 only in <pci/types.h>, which I
8 * refuse to include here, even though they're used throughout the headers.
9 * These are used in asm/user.h, and that include can't be avoided because of
10 * the sizeof(struct user_regs_struct) below.
11 */
12typedef __u64 u64;
13typedef __u32 u32;
6#include <asm/user.h> 14#include <asm/user.h>
7 15
8#define DEFINE(sym, val) \ 16#define DEFINE(sym, val) \
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 44ee7f6acf7b..289f448ac89c 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -303,6 +303,21 @@ config HPET_TIMER
303 as it is off-chip. You can find the HPET spec at 303 as it is off-chip. You can find the HPET spec at
304 <http://www.intel.com/labs/platcomp/hpet/hpetspec.htm>. 304 <http://www.intel.com/labs/platcomp/hpet/hpetspec.htm>.
305 305
306config X86_PM_TIMER
307 bool "PM timer"
308 depends on ACPI
309 default y
310 help
311 Support the ACPI PM timer for time keeping. This is slow,
312 but is useful on some chipsets without HPET on systems with more
313 than one CPU. On a single processor or single socket multi core
314 system it is normally not required.
315 When the PM timer is active 64bit vsyscalls are disabled
316 and should not be enabled (/proc/sys/kernel/vsyscall64 should
317 not be changed).
318 The kernel selects the PM timer only as a last resort, so it is
319 useful to enable just in case.
320
306config HPET_EMULATE_RTC 321config HPET_EMULATE_RTC
307 bool "Provide RTC interrupt" 322 bool "Provide RTC interrupt"
308 depends on HPET_TIMER && RTC=y 323 depends on HPET_TIMER && RTC=y
@@ -407,7 +422,7 @@ config PCI_DIRECT
407 422
408config PCI_MMCONFIG 423config PCI_MMCONFIG
409 bool "Support mmconfig PCI config space access" 424 bool "Support mmconfig PCI config space access"
410 depends on PCI 425 depends on PCI && ACPI
411 select ACPI_BOOT 426 select ACPI_BOOT
412 427
413config UNORDERED_IO 428config UNORDERED_IO
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 9ce51dee30b3..569595b74c7c 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-bk7 3# Linux kernel version: 2.6.12-rc4
4# Sat Mar 12 23:43:44 2005 4# Fri May 13 06:39:11 2005
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -11,8 +11,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
11CONFIG_GENERIC_CALIBRATE_DELAY=y 11CONFIG_GENERIC_CALIBRATE_DELAY=y
12CONFIG_X86_CMPXCHG=y 12CONFIG_X86_CMPXCHG=y
13CONFIG_EARLY_PRINTK=y 13CONFIG_EARLY_PRINTK=y
14CONFIG_HPET_TIMER=y
15CONFIG_HPET_EMULATE_RTC=y
16CONFIG_GENERIC_ISA_DMA=y 14CONFIG_GENERIC_ISA_DMA=y
17CONFIG_GENERIC_IOMAP=y 15CONFIG_GENERIC_IOMAP=y
18 16
@@ -22,6 +20,7 @@ CONFIG_GENERIC_IOMAP=y
22CONFIG_EXPERIMENTAL=y 20CONFIG_EXPERIMENTAL=y
23CONFIG_CLEAN_COMPILE=y 21CONFIG_CLEAN_COMPILE=y
24CONFIG_LOCK_KERNEL=y 22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
25 24
26# 25#
27# General setup 26# General setup
@@ -33,7 +32,6 @@ CONFIG_POSIX_MQUEUE=y
33# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
34CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
35# CONFIG_AUDIT is not set 34# CONFIG_AUDIT is not set
36CONFIG_LOG_BUF_SHIFT=18
37# CONFIG_HOTPLUG is not set 35# CONFIG_HOTPLUG is not set
38CONFIG_KOBJECT_UEVENT=y 36CONFIG_KOBJECT_UEVENT=y
39CONFIG_IKCONFIG=y 37CONFIG_IKCONFIG=y
@@ -43,10 +41,11 @@ CONFIG_IKCONFIG_PROC=y
43CONFIG_KALLSYMS=y 41CONFIG_KALLSYMS=y
44CONFIG_KALLSYMS_ALL=y 42CONFIG_KALLSYMS_ALL=y
45# CONFIG_KALLSYMS_EXTRA_PASS is not set 43# CONFIG_KALLSYMS_EXTRA_PASS is not set
44CONFIG_PRINTK=y
45CONFIG_BUG=y
46CONFIG_BASE_FULL=y 46CONFIG_BASE_FULL=y
47CONFIG_FUTEX=y 47CONFIG_FUTEX=y
48CONFIG_EPOLL=y 48CONFIG_EPOLL=y
49# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
50CONFIG_SHMEM=y 49CONFIG_SHMEM=y
51CONFIG_CC_ALIGN_FUNCTIONS=0 50CONFIG_CC_ALIGN_FUNCTIONS=0
52CONFIG_CC_ALIGN_LABELS=0 51CONFIG_CC_ALIGN_LABELS=0
@@ -93,6 +92,9 @@ CONFIG_DISCONTIGMEM=y
93CONFIG_NUMA=y 92CONFIG_NUMA=y
94CONFIG_HAVE_DEC_LOCK=y 93CONFIG_HAVE_DEC_LOCK=y
95CONFIG_NR_CPUS=8 94CONFIG_NR_CPUS=8
95CONFIG_HPET_TIMER=y
96CONFIG_X86_PM_TIMER=y
97CONFIG_HPET_EMULATE_RTC=y
96CONFIG_GART_IOMMU=y 98CONFIG_GART_IOMMU=y
97CONFIG_SWIOTLB=y 99CONFIG_SWIOTLB=y
98CONFIG_X86_MCE=y 100CONFIG_X86_MCE=y
@@ -100,6 +102,7 @@ CONFIG_X86_MCE_INTEL=y
100CONFIG_SECCOMP=y 102CONFIG_SECCOMP=y
101CONFIG_GENERIC_HARDIRQS=y 103CONFIG_GENERIC_HARDIRQS=y
102CONFIG_GENERIC_IRQ_PROBE=y 104CONFIG_GENERIC_IRQ_PROBE=y
105CONFIG_ISA_DMA_API=y
103 106
104# 107#
105# Power management options 108# Power management options
@@ -129,7 +132,7 @@ CONFIG_ACPI_NUMA=y
129# CONFIG_ACPI_IBM is not set 132# CONFIG_ACPI_IBM is not set
130CONFIG_ACPI_TOSHIBA=y 133CONFIG_ACPI_TOSHIBA=y
131CONFIG_ACPI_BLACKLIST_YEAR=2001 134CONFIG_ACPI_BLACKLIST_YEAR=2001
132CONFIG_ACPI_DEBUG=y 135# CONFIG_ACPI_DEBUG is not set
133CONFIG_ACPI_BUS=y 136CONFIG_ACPI_BUS=y
134CONFIG_ACPI_EC=y 137CONFIG_ACPI_EC=y
135CONFIG_ACPI_POWER=y 138CONFIG_ACPI_POWER=y
@@ -141,6 +144,7 @@ CONFIG_ACPI_SYSTEM=y
141# CPU Frequency scaling 144# CPU Frequency scaling
142# 145#
143CONFIG_CPU_FREQ=y 146CONFIG_CPU_FREQ=y
147CONFIG_CPU_FREQ_TABLE=y
144# CONFIG_CPU_FREQ_DEBUG is not set 148# CONFIG_CPU_FREQ_DEBUG is not set
145CONFIG_CPU_FREQ_STAT=y 149CONFIG_CPU_FREQ_STAT=y
146# CONFIG_CPU_FREQ_STAT_DETAILS is not set 150# CONFIG_CPU_FREQ_STAT_DETAILS is not set
@@ -150,7 +154,6 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
150# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 154# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
151CONFIG_CPU_FREQ_GOV_USERSPACE=y 155CONFIG_CPU_FREQ_GOV_USERSPACE=y
152CONFIG_CPU_FREQ_GOV_ONDEMAND=y 156CONFIG_CPU_FREQ_GOV_ONDEMAND=y
153CONFIG_CPU_FREQ_TABLE=y
154 157
155# 158#
156# CPUFreq processor drivers 159# CPUFreq processor drivers
@@ -164,6 +167,7 @@ CONFIG_X86_ACPI_CPUFREQ=y
164# shared options 167# shared options
165# 168#
166CONFIG_X86_ACPI_CPUFREQ_PROC_INTF=y 169CONFIG_X86_ACPI_CPUFREQ_PROC_INTF=y
170# CONFIG_X86_SPEEDSTEP_LIB is not set
167 171
168# 172#
169# Bus options (PCI etc.) 173# Bus options (PCI etc.)
@@ -172,9 +176,11 @@ CONFIG_PCI=y
172CONFIG_PCI_DIRECT=y 176CONFIG_PCI_DIRECT=y
173CONFIG_PCI_MMCONFIG=y 177CONFIG_PCI_MMCONFIG=y
174CONFIG_UNORDERED_IO=y 178CONFIG_UNORDERED_IO=y
179# CONFIG_PCIEPORTBUS is not set
175CONFIG_PCI_MSI=y 180CONFIG_PCI_MSI=y
176# CONFIG_PCI_LEGACY_PROC is not set 181# CONFIG_PCI_LEGACY_PROC is not set
177# CONFIG_PCI_NAMES is not set 182# CONFIG_PCI_NAMES is not set
183# CONFIG_PCI_DEBUG is not set
178 184
179# 185#
180# PCCARD (PCMCIA/CardBus) support 186# PCCARD (PCMCIA/CardBus) support
@@ -182,10 +188,6 @@ CONFIG_PCI_MSI=y
182# CONFIG_PCCARD is not set 188# CONFIG_PCCARD is not set
183 189
184# 190#
185# PC-card bridges
186#
187
188#
189# PCI Hotplug Support 191# PCI Hotplug Support
190# 192#
191# CONFIG_HOTPLUG_PCI is not set 193# CONFIG_HOTPLUG_PCI is not set
@@ -254,7 +256,7 @@ CONFIG_LBD=y
254# IO Schedulers 256# IO Schedulers
255# 257#
256CONFIG_IOSCHED_NOOP=y 258CONFIG_IOSCHED_NOOP=y
257CONFIG_IOSCHED_AS=y 259# CONFIG_IOSCHED_AS is not set
258CONFIG_IOSCHED_DEADLINE=y 260CONFIG_IOSCHED_DEADLINE=y
259CONFIG_IOSCHED_CFQ=y 261CONFIG_IOSCHED_CFQ=y
260# CONFIG_ATA_OVER_ETH is not set 262# CONFIG_ATA_OVER_ETH is not set
@@ -308,7 +310,8 @@ CONFIG_BLK_DEV_AMD74XX=y
308CONFIG_BLK_DEV_PIIX=y 310CONFIG_BLK_DEV_PIIX=y
309# CONFIG_BLK_DEV_NS87415 is not set 311# CONFIG_BLK_DEV_NS87415 is not set
310# CONFIG_BLK_DEV_PDC202XX_OLD is not set 312# CONFIG_BLK_DEV_PDC202XX_OLD is not set
311# CONFIG_BLK_DEV_PDC202XX_NEW is not set 313CONFIG_BLK_DEV_PDC202XX_NEW=y
314# CONFIG_PDC202XX_FORCE is not set
312# CONFIG_BLK_DEV_SVWKS is not set 315# CONFIG_BLK_DEV_SVWKS is not set
313# CONFIG_BLK_DEV_SIIMAGE is not set 316# CONFIG_BLK_DEV_SIIMAGE is not set
314# CONFIG_BLK_DEV_SIS5513 is not set 317# CONFIG_BLK_DEV_SIS5513 is not set
@@ -353,7 +356,7 @@ CONFIG_BLK_DEV_SD=y
353# 356#
354# SCSI low-level drivers 357# SCSI low-level drivers
355# 358#
356CONFIG_BLK_DEV_3W_XXXX_RAID=y 359# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
357# CONFIG_SCSI_3W_9XXX is not set 360# CONFIG_SCSI_3W_9XXX is not set
358# CONFIG_SCSI_ACARD is not set 361# CONFIG_SCSI_ACARD is not set
359# CONFIG_SCSI_AACRAID is not set 362# CONFIG_SCSI_AACRAID is not set
@@ -384,7 +387,6 @@ CONFIG_SCSI_SATA_VIA=y
384# CONFIG_SCSI_BUSLOGIC is not set 387# CONFIG_SCSI_BUSLOGIC is not set
385# CONFIG_SCSI_DMX3191D is not set 388# CONFIG_SCSI_DMX3191D is not set
386# CONFIG_SCSI_EATA is not set 389# CONFIG_SCSI_EATA is not set
387# CONFIG_SCSI_EATA_PIO is not set
388# CONFIG_SCSI_FUTURE_DOMAIN is not set 390# CONFIG_SCSI_FUTURE_DOMAIN is not set
389# CONFIG_SCSI_GDTH is not set 391# CONFIG_SCSI_GDTH is not set
390# CONFIG_SCSI_IPS is not set 392# CONFIG_SCSI_IPS is not set
@@ -392,7 +394,6 @@ CONFIG_SCSI_SATA_VIA=y
392# CONFIG_SCSI_INIA100 is not set 394# CONFIG_SCSI_INIA100 is not set
393# CONFIG_SCSI_SYM53C8XX_2 is not set 395# CONFIG_SCSI_SYM53C8XX_2 is not set
394# CONFIG_SCSI_IPR is not set 396# CONFIG_SCSI_IPR is not set
395# CONFIG_SCSI_QLOGIC_ISP is not set
396# CONFIG_SCSI_QLOGIC_FC is not set 397# CONFIG_SCSI_QLOGIC_FC is not set
397# CONFIG_SCSI_QLOGIC_1280 is not set 398# CONFIG_SCSI_QLOGIC_1280 is not set
398CONFIG_SCSI_QLA2XXX=y 399CONFIG_SCSI_QLA2XXX=y
@@ -401,6 +402,7 @@ CONFIG_SCSI_QLA2XXX=y
401# CONFIG_SCSI_QLA2300 is not set 402# CONFIG_SCSI_QLA2300 is not set
402# CONFIG_SCSI_QLA2322 is not set 403# CONFIG_SCSI_QLA2322 is not set
403# CONFIG_SCSI_QLA6312 is not set 404# CONFIG_SCSI_QLA6312 is not set
405# CONFIG_SCSI_LPFC is not set
404# CONFIG_SCSI_DC395x is not set 406# CONFIG_SCSI_DC395x is not set
405# CONFIG_SCSI_DC390T is not set 407# CONFIG_SCSI_DC390T is not set
406# CONFIG_SCSI_DEBUG is not set 408# CONFIG_SCSI_DEBUG is not set
@@ -437,7 +439,6 @@ CONFIG_NET=y
437# 439#
438CONFIG_PACKET=y 440CONFIG_PACKET=y
439# CONFIG_PACKET_MMAP is not set 441# CONFIG_PACKET_MMAP is not set
440# CONFIG_NETLINK_DEV is not set
441CONFIG_UNIX=y 442CONFIG_UNIX=y
442# CONFIG_NET_KEY is not set 443# CONFIG_NET_KEY is not set
443CONFIG_INET=y 444CONFIG_INET=y
@@ -502,7 +503,7 @@ CONFIG_NETDEVICES=y
502# CONFIG_DUMMY is not set 503# CONFIG_DUMMY is not set
503# CONFIG_BONDING is not set 504# CONFIG_BONDING is not set
504# CONFIG_EQUALIZER is not set 505# CONFIG_EQUALIZER is not set
505# CONFIG_TUN is not set 506CONFIG_TUN=y
506 507
507# 508#
508# ARCnet devices 509# ARCnet devices
@@ -525,8 +526,7 @@ CONFIG_MII=y
525# CONFIG_HP100 is not set 526# CONFIG_HP100 is not set
526CONFIG_NET_PCI=y 527CONFIG_NET_PCI=y
527# CONFIG_PCNET32 is not set 528# CONFIG_PCNET32 is not set
528CONFIG_AMD8111_ETH=y 529# CONFIG_AMD8111_ETH is not set
529# CONFIG_AMD8111E_NAPI is not set
530# CONFIG_ADAPTEC_STARFIRE is not set 530# CONFIG_ADAPTEC_STARFIRE is not set
531# CONFIG_B44 is not set 531# CONFIG_B44 is not set
532CONFIG_FORCEDETH=y 532CONFIG_FORCEDETH=y
@@ -536,7 +536,7 @@ CONFIG_FORCEDETH=y
536# CONFIG_FEALNX is not set 536# CONFIG_FEALNX is not set
537# CONFIG_NATSEMI is not set 537# CONFIG_NATSEMI is not set
538# CONFIG_NE2K_PCI is not set 538# CONFIG_NE2K_PCI is not set
539CONFIG_8139CP=m 539CONFIG_8139CP=y
540CONFIG_8139TOO=y 540CONFIG_8139TOO=y
541# CONFIG_8139TOO_PIO is not set 541# CONFIG_8139TOO_PIO is not set
542# CONFIG_8139TOO_TUNE_TWISTER is not set 542# CONFIG_8139TOO_TUNE_TWISTER is not set
@@ -671,6 +671,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
671# 671#
672CONFIG_SERIAL_CORE=y 672CONFIG_SERIAL_CORE=y
673CONFIG_SERIAL_CORE_CONSOLE=y 673CONFIG_SERIAL_CORE_CONSOLE=y
674# CONFIG_SERIAL_JSM is not set
674CONFIG_UNIX98_PTYS=y 675CONFIG_UNIX98_PTYS=y
675CONFIG_LEGACY_PTYS=y 676CONFIG_LEGACY_PTYS=y
676CONFIG_LEGACY_PTY_COUNT=256 677CONFIG_LEGACY_PTY_COUNT=256
@@ -696,6 +697,7 @@ CONFIG_RTC=y
696# 697#
697CONFIG_AGP=y 698CONFIG_AGP=y
698CONFIG_AGP_AMD64=y 699CONFIG_AGP_AMD64=y
700CONFIG_AGP_INTEL=y
699# CONFIG_DRM is not set 701# CONFIG_DRM is not set
700# CONFIG_MWAVE is not set 702# CONFIG_MWAVE is not set
701CONFIG_RAW_DRIVER=y 703CONFIG_RAW_DRIVER=y
@@ -703,7 +705,7 @@ CONFIG_HPET=y
703# CONFIG_HPET_RTC_IRQ is not set 705# CONFIG_HPET_RTC_IRQ is not set
704CONFIG_HPET_MMAP=y 706CONFIG_HPET_MMAP=y
705CONFIG_MAX_RAW_DEVS=256 707CONFIG_MAX_RAW_DEVS=256
706CONFIG_HANGCHECK_TIMER=y 708# CONFIG_HANGCHECK_TIMER is not set
707 709
708# 710#
709# TPM devices 711# TPM devices
@@ -786,6 +788,8 @@ CONFIG_SOUND_ICH=y
786# 788#
787# USB support 789# USB support
788# 790#
791CONFIG_USB_ARCH_HAS_HCD=y
792CONFIG_USB_ARCH_HAS_OHCI=y
789CONFIG_USB=y 793CONFIG_USB=y
790# CONFIG_USB_DEBUG is not set 794# CONFIG_USB_DEBUG is not set
791 795
@@ -797,8 +801,6 @@ CONFIG_USB_DEVICEFS=y
797# CONFIG_USB_DYNAMIC_MINORS is not set 801# CONFIG_USB_DYNAMIC_MINORS is not set
798# CONFIG_USB_SUSPEND is not set 802# CONFIG_USB_SUSPEND is not set
799# CONFIG_USB_OTG is not set 803# CONFIG_USB_OTG is not set
800CONFIG_USB_ARCH_HAS_HCD=y
801CONFIG_USB_ARCH_HAS_OHCI=y
802 804
803# 805#
804# USB Host Controller Drivers 806# USB Host Controller Drivers
@@ -826,7 +828,6 @@ CONFIG_USB_PRINTER=y
826# 828#
827CONFIG_USB_STORAGE=y 829CONFIG_USB_STORAGE=y
828# CONFIG_USB_STORAGE_DEBUG is not set 830# CONFIG_USB_STORAGE_DEBUG is not set
829# CONFIG_USB_STORAGE_RW_DETECT is not set
830# CONFIG_USB_STORAGE_DATAFAB is not set 831# CONFIG_USB_STORAGE_DATAFAB is not set
831# CONFIG_USB_STORAGE_FREECOM is not set 832# CONFIG_USB_STORAGE_FREECOM is not set
832# CONFIG_USB_STORAGE_ISD200 is not set 833# CONFIG_USB_STORAGE_ISD200 is not set
@@ -965,7 +966,7 @@ CONFIG_AUTOFS_FS=y
965# CD-ROM/DVD Filesystems 966# CD-ROM/DVD Filesystems
966# 967#
967CONFIG_ISO9660_FS=y 968CONFIG_ISO9660_FS=y
968# CONFIG_JOLIET is not set 969CONFIG_JOLIET=y
969# CONFIG_ZISOFS is not set 970# CONFIG_ZISOFS is not set
970# CONFIG_UDF_FS is not set 971# CONFIG_UDF_FS is not set
971 972
@@ -1092,9 +1093,10 @@ CONFIG_OPROFILE=y
1092# 1093#
1093# Kernel hacking 1094# Kernel hacking
1094# 1095#
1096# CONFIG_PRINTK_TIME is not set
1095CONFIG_DEBUG_KERNEL=y 1097CONFIG_DEBUG_KERNEL=y
1096CONFIG_MAGIC_SYSRQ=y 1098CONFIG_MAGIC_SYSRQ=y
1097# CONFIG_PRINTK_TIME is not set 1099CONFIG_LOG_BUF_SHIFT=18
1098# CONFIG_SCHEDSTATS is not set 1100# CONFIG_SCHEDSTATS is not set
1099# CONFIG_DEBUG_SLAB is not set 1101# CONFIG_DEBUG_SLAB is not set
1100# CONFIG_DEBUG_SPINLOCK is not set 1102# CONFIG_DEBUG_SPINLOCK is not set
diff --git a/arch/x86_64/ia32/ia32_aout.c b/arch/x86_64/ia32/ia32_aout.c
index 1965efc974dc..c12edf5d97f0 100644
--- a/arch/x86_64/ia32/ia32_aout.c
+++ b/arch/x86_64/ia32/ia32_aout.c
@@ -312,6 +312,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
312 current->mm->brk = ex.a_bss + 312 current->mm->brk = ex.a_bss +
313 (current->mm->start_brk = N_BSSADDR(ex)); 313 (current->mm->start_brk = N_BSSADDR(ex));
314 current->mm->free_area_cache = TASK_UNMAPPED_BASE; 314 current->mm->free_area_cache = TASK_UNMAPPED_BASE;
315 current->mm->cached_hole_size = 0;
315 316
316 set_mm_counter(current->mm, rss, 0); 317 set_mm_counter(current->mm, rss, 0);
317 current->mm->mmap = NULL; 318 current->mm->mmap = NULL;
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
index 99b522052d16..c8131f342cfc 100644
--- a/arch/x86_64/ia32/ia32_binfmt.c
+++ b/arch/x86_64/ia32/ia32_binfmt.c
@@ -46,7 +46,7 @@ struct elf_phdr;
46 46
47#define IA32_EMULATOR 1 47#define IA32_EMULATOR 1
48 48
49#define ELF_ET_DYN_BASE (TASK_UNMAPPED_32 + 0x1000000) 49#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000)
50 50
51#undef ELF_ARCH 51#undef ELF_ARCH
52#define ELF_ARCH EM_386 52#define ELF_ARCH EM_386
@@ -307,9 +307,6 @@ MODULE_AUTHOR("Eric Youngdale, Andi Kleen");
307 307
308#define elf_addr_t __u32 308#define elf_addr_t __u32
309 309
310#undef TASK_SIZE
311#define TASK_SIZE 0xffffffff
312
313static void elf32_init(struct pt_regs *); 310static void elf32_init(struct pt_regs *);
314 311
315#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 312#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
index 0a3318e08ab6..5ca4a4598fda 100644
--- a/arch/x86_64/kernel/Makefile
+++ b/arch/x86_64/kernel/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_GART_IOMMU) += pci-gart.o aperture.o
28obj-$(CONFIG_DUMMY_IOMMU) += pci-nommu.o pci-dma.o 28obj-$(CONFIG_DUMMY_IOMMU) += pci-nommu.o pci-dma.o
29obj-$(CONFIG_SWIOTLB) += swiotlb.o 29obj-$(CONFIG_SWIOTLB) += swiotlb.o
30obj-$(CONFIG_KPROBES) += kprobes.o 30obj-$(CONFIG_KPROBES) += kprobes.o
31obj-$(CONFIG_X86_PM_TIMER) += pmtimer.o
31 32
32obj-$(CONFIG_MODULES) += module.o 33obj-$(CONFIG_MODULES) += module.o
33 34
diff --git a/arch/x86_64/kernel/aperture.c b/arch/x86_64/kernel/aperture.c
index a491f72cc966..504e63474993 100644
--- a/arch/x86_64/kernel/aperture.c
+++ b/arch/x86_64/kernel/aperture.c
@@ -33,12 +33,10 @@ int fallback_aper_force __initdata = 0;
33 33
34int fix_aperture __initdata = 1; 34int fix_aperture __initdata = 1;
35 35
36#define NB_ID_3 (PCI_VENDOR_ID_AMD | (0x1103<<16)) 36/* This code runs before the PCI subsystem is initialized, so just
37 access the northbridge directly. */
37 38
38static struct resource aper_res = { 39#define NB_ID_3 (PCI_VENDOR_ID_AMD | (0x1103<<16))
39 .name = "Aperture",
40 .flags = IORESOURCE_MEM,
41};
42 40
43static u32 __init allocate_aperture(void) 41static u32 __init allocate_aperture(void)
44{ 42{
@@ -55,24 +53,11 @@ static u32 __init allocate_aperture(void)
55 aper_size = (32 * 1024 * 1024) << fallback_aper_order; 53 aper_size = (32 * 1024 * 1024) << fallback_aper_order;
56 54
57 /* 55 /*
58 * Aperture has to be naturally aligned. This means an 2GB 56 * Aperture has to be naturally aligned. This means an 2GB aperture won't
59 * aperture won't have much chances to find a place in the 57 * have much chances to find a place in the lower 4GB of memory.
60 * lower 4GB of memory. Unfortunately we cannot move it up 58 * Unfortunately we cannot move it up because that would make the
61 * because that would make the IOMMU useless. 59 * IOMMU useless.
62 */ 60 */
63
64 /* First try to find some free unused space */
65 if (!allocate_resource(&iomem_resource, &aper_res,
66 aper_size,
67 0, 0xffffffff,
68 aper_size,
69 NULL, NULL)) {
70 printk(KERN_INFO "Putting aperture at %lx-%lx\n",
71 aper_res.start, aper_res.end);
72 return aper_res.start;
73 }
74
75 /* No free space found. Go on to waste some memory... */
76 p = __alloc_bootmem_node(nd0, aper_size, aper_size, 0); 61 p = __alloc_bootmem_node(nd0, aper_size, aper_size, 0);
77 if (!p || __pa(p)+aper_size > 0xffffffff) { 62 if (!p || __pa(p)+aper_size > 0xffffffff) {
78 printk("Cannot allocate aperture memory hole (%p,%uK)\n", 63 printk("Cannot allocate aperture memory hole (%p,%uK)\n",
@@ -81,7 +66,7 @@ static u32 __init allocate_aperture(void)
81 free_bootmem_node(nd0, (unsigned long)p, aper_size); 66 free_bootmem_node(nd0, (unsigned long)p, aper_size);
82 return 0; 67 return 0;
83 } 68 }
84 printk("Mapping aperture over %d KB of precious RAM @ %lx\n", 69 printk("Mapping aperture over %d KB of RAM @ %lx\n",
85 aper_size >> 10, __pa(p)); 70 aper_size >> 10, __pa(p));
86 return (u32)__pa(p); 71 return (u32)__pa(p);
87} 72}
@@ -102,16 +87,10 @@ static int __init aperture_valid(char *name, u64 aper_base, u32 aper_size)
102 printk("Aperture from %s pointing to e820 RAM. Ignoring.\n",name); 87 printk("Aperture from %s pointing to e820 RAM. Ignoring.\n",name);
103 return 0; 88 return 0;
104 } 89 }
105 /* Don't check the resource here because the aperture is usually
106 in an e820 reserved area, and we allocated these earlier. */
107 return 1; 90 return 1;
108} 91}
109 92
110/* 93/* Find a PCI capability */
111 * Find a PCI capability.
112 * This code runs before the PCI subsystem is initialized, so just
113 * access the northbridge directly.
114 */
115static __u32 __init find_cap(int num, int slot, int func, int cap) 94static __u32 __init find_cap(int num, int slot, int func, int cap)
116{ 95{
117 u8 pos; 96 u8 pos;
@@ -276,6 +255,8 @@ void __init iommu_hole_init(void)
276 fallback_aper_force) { 255 fallback_aper_force) {
277 printk("Your BIOS doesn't leave a aperture memory hole\n"); 256 printk("Your BIOS doesn't leave a aperture memory hole\n");
278 printk("Please enable the IOMMU option in the BIOS setup\n"); 257 printk("Please enable the IOMMU option in the BIOS setup\n");
258 printk("This costs you %d MB of RAM\n",
259 32 << fallback_aper_order);
279 260
280 aper_order = fallback_aper_order; 261 aper_order = fallback_aper_order;
281 aper_alloc = allocate_aperture(); 262 aper_alloc = allocate_aperture();
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
index 7e13545748e0..f8e6cc4fecd4 100644
--- a/arch/x86_64/kernel/apic.c
+++ b/arch/x86_64/kernel/apic.c
@@ -33,6 +33,7 @@
33#include <asm/mpspec.h> 33#include <asm/mpspec.h>
34#include <asm/pgalloc.h> 34#include <asm/pgalloc.h>
35#include <asm/mach_apic.h> 35#include <asm/mach_apic.h>
36#include <asm/nmi.h>
36 37
37int apic_verbosity; 38int apic_verbosity;
38 39
@@ -925,7 +926,7 @@ __init int oem_force_hpet_timer(void)
925 unsigned id; 926 unsigned id;
926 DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS); 927 DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS);
927 928
928 bitmap_empty(clustermap, NUM_APIC_CLUSTERS); 929 bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
929 930
930 for (i = 0; i < NR_CPUS; i++) { 931 for (i = 0; i < NR_CPUS; i++) {
931 id = bios_cpu_apicid[i]; 932 id = bios_cpu_apicid[i];
@@ -1056,7 +1057,7 @@ int __init APIC_init_uniprocessor (void)
1056 nr_ioapics = 0; 1057 nr_ioapics = 0;
1057#endif 1058#endif
1058 setup_boot_APIC_clock(); 1059 setup_boot_APIC_clock();
1059 1060 check_nmi_watchdog();
1060 return 0; 1061 return 0;
1061} 1062}
1062 1063
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 1086b5fcac21..28817490fdc6 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -220,13 +220,18 @@ sysret_careful:
220 jmp sysret_check 220 jmp sysret_check
221 221
222 /* Handle a signal */ 222 /* Handle a signal */
223 /* edx: work flags (arg3) */
224sysret_signal: 223sysret_signal:
225 sti 224 sti
225 testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
226 jz 1f
227
228 /* Really a signal */
229 /* edx: work flags (arg3) */
226 leaq do_notify_resume(%rip),%rax 230 leaq do_notify_resume(%rip),%rax
227 leaq -ARGOFFSET(%rsp),%rdi # &pt_regs -> arg1 231 leaq -ARGOFFSET(%rsp),%rdi # &pt_regs -> arg1
228 xorl %esi,%esi # oldset -> arg2 232 xorl %esi,%esi # oldset -> arg2
229 call ptregscall_common 233 call ptregscall_common
2341: movl $_TIF_NEED_RESCHED,%edi
230 jmp sysret_check 235 jmp sysret_check
231 236
232 /* Do syscall tracing */ 237 /* Do syscall tracing */
@@ -484,6 +489,8 @@ retint_careful:
484 jmp retint_check 489 jmp retint_check
485 490
486retint_signal: 491retint_signal:
492 testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
493 jz retint_swapgs
487 sti 494 sti
488 SAVE_REST 495 SAVE_REST
489 movq $-1,ORIG_RAX(%rsp) 496 movq $-1,ORIG_RAX(%rsp)
@@ -492,8 +499,8 @@ retint_signal:
492 call do_notify_resume 499 call do_notify_resume
493 RESTORE_REST 500 RESTORE_REST
494 cli 501 cli
502 movl $_TIF_NEED_RESCHED,%edi
495 GET_THREAD_INFO(%rcx) 503 GET_THREAD_INFO(%rcx)
496 movl $_TIF_WORK_MASK,%edi
497 jmp retint_check 504 jmp retint_check
498 505
499#ifdef CONFIG_PREEMPT 506#ifdef CONFIG_PREEMPT
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 60be58617eb9..afd87e64d0a8 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -37,11 +37,14 @@
37#include <asm/desc.h> 37#include <asm/desc.h>
38#include <asm/proto.h> 38#include <asm/proto.h>
39#include <asm/mach_apic.h> 39#include <asm/mach_apic.h>
40#include <asm/acpi.h>
40 41
41#define __apicdebuginit __init 42#define __apicdebuginit __init
42 43
43int sis_apic_bug; /* not actually supported, dummy for compile */ 44int sis_apic_bug; /* not actually supported, dummy for compile */
44 45
46static int no_timer_check;
47
45static DEFINE_SPINLOCK(ioapic_lock); 48static DEFINE_SPINLOCK(ioapic_lock);
46 49
47/* 50/*
@@ -1601,7 +1604,7 @@ static inline void check_timer(void)
1601 * Ok, does IRQ0 through the IOAPIC work? 1604 * Ok, does IRQ0 through the IOAPIC work?
1602 */ 1605 */
1603 unmask_IO_APIC_irq(0); 1606 unmask_IO_APIC_irq(0);
1604 if (timer_irq_works()) { 1607 if (!no_timer_check && timer_irq_works()) {
1605 nmi_watchdog_default(); 1608 nmi_watchdog_default();
1606 if (nmi_watchdog == NMI_IO_APIC) { 1609 if (nmi_watchdog == NMI_IO_APIC) {
1607 disable_8259A_irq(0); 1610 disable_8259A_irq(0);
@@ -1671,6 +1674,13 @@ static inline void check_timer(void)
1671 panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n"); 1674 panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n");
1672} 1675}
1673 1676
1677static int __init notimercheck(char *s)
1678{
1679 no_timer_check = 1;
1680 return 1;
1681}
1682__setup("no_timer_check", notimercheck);
1683
1674/* 1684/*
1675 * 1685 *
1676 * IRQ's that are handled by the PIC in the MPS IOAPIC case. 1686 * IRQ's that are handled by the PIC in the MPS IOAPIC case.
@@ -1804,76 +1814,6 @@ device_initcall(ioapic_init_sysfs);
1804 1814
1805#define IO_APIC_MAX_ID 0xFE 1815#define IO_APIC_MAX_ID 0xFE
1806 1816
1807int __init io_apic_get_unique_id (int ioapic, int apic_id)
1808{
1809 union IO_APIC_reg_00 reg_00;
1810 static physid_mask_t apic_id_map;
1811 unsigned long flags;
1812 int i = 0;
1813
1814 /*
1815 * The P4 platform supports up to 256 APIC IDs on two separate APIC
1816 * buses (one for LAPICs, one for IOAPICs), where predecessors only
1817 * supports up to 16 on one shared APIC bus.
1818 *
1819 * TBD: Expand LAPIC/IOAPIC support on P4-class systems to take full
1820 * advantage of new APIC bus architecture.
1821 */
1822
1823 if (physids_empty(apic_id_map))
1824 apic_id_map = phys_cpu_present_map;
1825
1826 spin_lock_irqsave(&ioapic_lock, flags);
1827 reg_00.raw = io_apic_read(ioapic, 0);
1828 spin_unlock_irqrestore(&ioapic_lock, flags);
1829
1830 if (apic_id >= IO_APIC_MAX_ID) {
1831 apic_printk(APIC_QUIET, KERN_WARNING "IOAPIC[%d]: Invalid apic_id %d, trying "
1832 "%d\n", ioapic, apic_id, reg_00.bits.ID);
1833 apic_id = reg_00.bits.ID;
1834 }
1835
1836 /*
1837 * Every APIC in a system must have a unique ID or we get lots of nice
1838 * 'stuck on smp_invalidate_needed IPI wait' messages.
1839 */
1840 if (physid_isset(apic_id, apic_id_map)) {
1841
1842 for (i = 0; i < IO_APIC_MAX_ID; i++) {
1843 if (!physid_isset(i, apic_id_map))
1844 break;
1845 }
1846
1847 if (i == IO_APIC_MAX_ID)
1848 panic("Max apic_id exceeded!\n");
1849
1850 apic_printk(APIC_VERBOSE, KERN_WARNING "IOAPIC[%d]: apic_id %d already used, "
1851 "trying %d\n", ioapic, apic_id, i);
1852
1853 apic_id = i;
1854 }
1855
1856 physid_set(apic_id, apic_id_map);
1857
1858 if (reg_00.bits.ID != apic_id) {
1859 reg_00.bits.ID = apic_id;
1860
1861 spin_lock_irqsave(&ioapic_lock, flags);
1862 io_apic_write(ioapic, 0, reg_00.raw);
1863 reg_00.raw = io_apic_read(ioapic, 0);
1864 spin_unlock_irqrestore(&ioapic_lock, flags);
1865
1866 /* Sanity check */
1867 if (reg_00.bits.ID != apic_id)
1868 panic("IOAPIC[%d]: Unable change apic_id!\n", ioapic);
1869 }
1870
1871 apic_printk(APIC_VERBOSE,KERN_INFO "IOAPIC[%d]: Assigned apic_id %d\n", ioapic, apic_id);
1872
1873 return apic_id;
1874}
1875
1876
1877int __init io_apic_get_version (int ioapic) 1817int __init io_apic_get_version (int ioapic)
1878{ 1818{
1879 union IO_APIC_reg_01 reg_01; 1819 union IO_APIC_reg_01 reg_01;
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 7ec031c6ca10..61a63be6b294 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -30,6 +30,7 @@
30#include <asm/pgalloc.h> 30#include <asm/pgalloc.h>
31#include <asm/io_apic.h> 31#include <asm/io_apic.h>
32#include <asm/proto.h> 32#include <asm/proto.h>
33#include <asm/acpi.h>
33 34
34/* Have we found an MP table */ 35/* Have we found an MP table */
35int smp_found_config; 36int smp_found_config;
@@ -107,6 +108,7 @@ static int __init mpf_checksum(unsigned char *mp, int len)
107static void __init MP_processor_info (struct mpc_config_processor *m) 108static void __init MP_processor_info (struct mpc_config_processor *m)
108{ 109{
109 int ver; 110 int ver;
111 static int found_bsp=0;
110 112
111 if (!(m->mpc_cpuflag & CPU_ENABLED)) 113 if (!(m->mpc_cpuflag & CPU_ENABLED))
112 return; 114 return;
@@ -126,11 +128,6 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
126 " Processor ignored.\n", NR_CPUS); 128 " Processor ignored.\n", NR_CPUS);
127 return; 129 return;
128 } 130 }
129 if (num_processors >= maxcpus) {
130 printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
131 " Processor ignored.\n", maxcpus);
132 return;
133 }
134 131
135 num_processors++; 132 num_processors++;
136 133
@@ -150,7 +147,19 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
150 ver = 0x10; 147 ver = 0x10;
151 } 148 }
152 apic_version[m->mpc_apicid] = ver; 149 apic_version[m->mpc_apicid] = ver;
153 bios_cpu_apicid[num_processors - 1] = m->mpc_apicid; 150 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
151 /*
152 * bios_cpu_apicid is required to have processors listed
153 * in same order as logical cpu numbers. Hence the first
154 * entry is BSP, and so on.
155 */
156 bios_cpu_apicid[0] = m->mpc_apicid;
157 x86_cpu_to_apicid[0] = m->mpc_apicid;
158 found_bsp = 1;
159 } else {
160 bios_cpu_apicid[num_processors - found_bsp] = m->mpc_apicid;
161 x86_cpu_to_apicid[num_processors - found_bsp] = m->mpc_apicid;
162 }
154} 163}
155 164
156static void __init MP_bus_info (struct mpc_config_bus *m) 165static void __init MP_bus_info (struct mpc_config_bus *m)
@@ -759,7 +768,7 @@ void __init mp_register_ioapic (
759 mp_ioapics[idx].mpc_apicaddr = address; 768 mp_ioapics[idx].mpc_apicaddr = address;
760 769
761 set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); 770 set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
762 mp_ioapics[idx].mpc_apicid = io_apic_get_unique_id(idx, id); 771 mp_ioapics[idx].mpc_apicid = id;
763 mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx); 772 mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx);
764 773
765 /* 774 /*
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 61de0b34a01e..31c0f2e6ac91 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -33,6 +33,7 @@
33#include <asm/msr.h> 33#include <asm/msr.h>
34#include <asm/proto.h> 34#include <asm/proto.h>
35#include <asm/kdebug.h> 35#include <asm/kdebug.h>
36#include <asm/local.h>
36 37
37/* 38/*
38 * lapic_nmi_owner tracks the ownership of the lapic NMI hardware: 39 * lapic_nmi_owner tracks the ownership of the lapic NMI hardware:
@@ -59,7 +60,8 @@ int panic_on_timeout;
59 60
60unsigned int nmi_watchdog = NMI_DEFAULT; 61unsigned int nmi_watchdog = NMI_DEFAULT;
61static unsigned int nmi_hz = HZ; 62static unsigned int nmi_hz = HZ;
62unsigned int nmi_perfctr_msr; /* the MSR to reset in NMI handler */ 63static unsigned int nmi_perfctr_msr; /* the MSR to reset in NMI handler */
64static unsigned int nmi_p4_cccr_val;
63 65
64/* Note that these events don't tick when the CPU idles. This means 66/* Note that these events don't tick when the CPU idles. This means
65 the frequency varies with CPU load. */ 67 the frequency varies with CPU load. */
@@ -71,61 +73,87 @@ unsigned int nmi_perfctr_msr; /* the MSR to reset in NMI handler */
71#define K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING 0x76 73#define K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING 0x76
72#define K7_NMI_EVENT K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING 74#define K7_NMI_EVENT K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING
73 75
74#define P6_EVNTSEL0_ENABLE (1 << 22) 76#define MSR_P4_MISC_ENABLE 0x1A0
75#define P6_EVNTSEL_INT (1 << 20) 77#define MSR_P4_MISC_ENABLE_PERF_AVAIL (1<<7)
76#define P6_EVNTSEL_OS (1 << 17) 78#define MSR_P4_MISC_ENABLE_PEBS_UNAVAIL (1<<12)
77#define P6_EVNTSEL_USR (1 << 16) 79#define MSR_P4_PERFCTR0 0x300
78#define P6_EVENT_CPU_CLOCKS_NOT_HALTED 0x79 80#define MSR_P4_CCCR0 0x360
79#define P6_NMI_EVENT P6_EVENT_CPU_CLOCKS_NOT_HALTED 81#define P4_ESCR_EVENT_SELECT(N) ((N)<<25)
82#define P4_ESCR_OS (1<<3)
83#define P4_ESCR_USR (1<<2)
84#define P4_CCCR_OVF_PMI0 (1<<26)
85#define P4_CCCR_OVF_PMI1 (1<<27)
86#define P4_CCCR_THRESHOLD(N) ((N)<<20)
87#define P4_CCCR_COMPLEMENT (1<<19)
88#define P4_CCCR_COMPARE (1<<18)
89#define P4_CCCR_REQUIRED (3<<16)
90#define P4_CCCR_ESCR_SELECT(N) ((N)<<13)
91#define P4_CCCR_ENABLE (1<<12)
92/* Set up IQ_COUNTER0 to behave like a clock, by having IQ_CCCR0 filter
93 CRU_ESCR0 (with any non-null event selector) through a complemented
94 max threshold. [IA32-Vol3, Section 14.9.9] */
95#define MSR_P4_IQ_COUNTER0 0x30C
96#define P4_NMI_CRU_ESCR0 (P4_ESCR_EVENT_SELECT(0x3F)|P4_ESCR_OS|P4_ESCR_USR)
97#define P4_NMI_IQ_CCCR0 \
98 (P4_CCCR_OVF_PMI0|P4_CCCR_THRESHOLD(15)|P4_CCCR_COMPLEMENT| \
99 P4_CCCR_COMPARE|P4_CCCR_REQUIRED|P4_CCCR_ESCR_SELECT(4)|P4_CCCR_ENABLE)
100
101static __init inline int nmi_known_cpu(void)
102{
103 switch (boot_cpu_data.x86_vendor) {
104 case X86_VENDOR_AMD:
105 return boot_cpu_data.x86 == 15;
106 case X86_VENDOR_INTEL:
107 return boot_cpu_data.x86 == 15;
108 }
109 return 0;
110}
80 111
81/* Run after command line and cpu_init init, but before all other checks */ 112/* Run after command line and cpu_init init, but before all other checks */
82void __init nmi_watchdog_default(void) 113void __init nmi_watchdog_default(void)
83{ 114{
84 if (nmi_watchdog != NMI_DEFAULT) 115 if (nmi_watchdog != NMI_DEFAULT)
85 return; 116 return;
86 117 if (nmi_known_cpu())
87 /* For some reason the IO APIC watchdog doesn't work on the AMD 118 nmi_watchdog = NMI_LOCAL_APIC;
88 8111 chipset. For now switch to local APIC mode using 119 else
89 perfctr0 there. On Intel CPUs we don't have code to handle
90 the perfctr and the IO-APIC seems to work, so use that. */
91
92 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
93 nmi_watchdog = NMI_LOCAL_APIC;
94 printk(KERN_INFO
95 "Using local APIC NMI watchdog using perfctr0\n");
96 } else {
97 printk(KERN_INFO "Using IO APIC NMI watchdog\n");
98 nmi_watchdog = NMI_IO_APIC; 120 nmi_watchdog = NMI_IO_APIC;
99 }
100} 121}
101 122
102/* Why is there no CPUID flag for this? */ 123#ifdef CONFIG_SMP
103static __init int cpu_has_lapic(void) 124/* The performance counters used by NMI_LOCAL_APIC don't trigger when
125 * the CPU is idle. To make sure the NMI watchdog really ticks on all
126 * CPUs during the test make them busy.
127 */
128static __init void nmi_cpu_busy(void *data)
104{ 129{
105 switch (boot_cpu_data.x86_vendor) { 130 volatile int *endflag = data;
106 case X86_VENDOR_INTEL: 131 local_irq_enable();
107 case X86_VENDOR_AMD: 132 /* Intentionally don't use cpu_relax here. This is
108 return boot_cpu_data.x86 >= 6; 133 to make sure that the performance counter really ticks,
109 /* .... add more cpus here or find a different way to figure this out. */ 134 even if there is a simulator or similar that catches the
110 default: 135 pause instruction. On a real HT machine this is fine because
111 return 0; 136 all other CPUs are busy with "useless" delay loops and don't
112 } 137 care if they get somewhat less cycles. */
138 while (*endflag == 0)
139 barrier();
113} 140}
141#endif
114 142
115static int __init check_nmi_watchdog (void) 143int __init check_nmi_watchdog (void)
116{ 144{
117 int counts[NR_CPUS]; 145 volatile int endflag = 0;
146 int *counts;
118 int cpu; 147 int cpu;
119 148
120 if (nmi_watchdog == NMI_NONE) 149 counts = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL);
121 return 0; 150 if (!counts)
151 return -1;
122 152
123 if (nmi_watchdog == NMI_LOCAL_APIC && !cpu_has_lapic()) { 153 printk(KERN_INFO "testing NMI watchdog ... ");
124 nmi_watchdog = NMI_NONE;
125 return -1;
126 }
127 154
128 printk(KERN_INFO "Testing NMI watchdog ... "); 155 if (nmi_watchdog == NMI_LOCAL_APIC)
156 smp_call_function(nmi_cpu_busy, (void *)&endflag, 0, 0);
129 157
130 for (cpu = 0; cpu < NR_CPUS; cpu++) 158 for (cpu = 0; cpu < NR_CPUS; cpu++)
131 counts[cpu] = cpu_pda[cpu].__nmi_count; 159 counts[cpu] = cpu_pda[cpu].__nmi_count;
@@ -133,15 +161,22 @@ static int __init check_nmi_watchdog (void)
133 mdelay((10*1000)/nmi_hz); // wait 10 ticks 161 mdelay((10*1000)/nmi_hz); // wait 10 ticks
134 162
135 for (cpu = 0; cpu < NR_CPUS; cpu++) { 163 for (cpu = 0; cpu < NR_CPUS; cpu++) {
164 if (!cpu_online(cpu))
165 continue;
136 if (cpu_pda[cpu].__nmi_count - counts[cpu] <= 5) { 166 if (cpu_pda[cpu].__nmi_count - counts[cpu] <= 5) {
137 printk("CPU#%d: NMI appears to be stuck (%d)!\n", 167 endflag = 1;
168 printk("CPU#%d: NMI appears to be stuck (%d->%d)!\n",
138 cpu, 169 cpu,
170 counts[cpu],
139 cpu_pda[cpu].__nmi_count); 171 cpu_pda[cpu].__nmi_count);
140 nmi_active = 0; 172 nmi_active = 0;
141 lapic_nmi_owner &= ~LAPIC_NMI_WATCHDOG; 173 lapic_nmi_owner &= ~LAPIC_NMI_WATCHDOG;
174 nmi_perfctr_msr = 0;
175 kfree(counts);
142 return -1; 176 return -1;
143 } 177 }
144 } 178 }
179 endflag = 1;
145 printk("OK.\n"); 180 printk("OK.\n");
146 181
147 /* now that we know it works we can reduce NMI frequency to 182 /* now that we know it works we can reduce NMI frequency to
@@ -149,10 +184,9 @@ static int __init check_nmi_watchdog (void)
149 if (nmi_watchdog == NMI_LOCAL_APIC) 184 if (nmi_watchdog == NMI_LOCAL_APIC)
150 nmi_hz = 1; 185 nmi_hz = 1;
151 186
187 kfree(counts);
152 return 0; 188 return 0;
153} 189}
154/* Have this called later during boot so counters are updating */
155late_initcall(check_nmi_watchdog);
156 190
157int __init setup_nmi_watchdog(char *str) 191int __init setup_nmi_watchdog(char *str)
158{ 192{
@@ -170,7 +204,7 @@ int __init setup_nmi_watchdog(char *str)
170 204
171 if (nmi >= NMI_INVALID) 205 if (nmi >= NMI_INVALID)
172 return 0; 206 return 0;
173 nmi_watchdog = nmi; 207 nmi_watchdog = nmi;
174 return 1; 208 return 1;
175} 209}
176 210
@@ -185,7 +219,10 @@ static void disable_lapic_nmi_watchdog(void)
185 wrmsr(MSR_K7_EVNTSEL0, 0, 0); 219 wrmsr(MSR_K7_EVNTSEL0, 0, 0);
186 break; 220 break;
187 case X86_VENDOR_INTEL: 221 case X86_VENDOR_INTEL:
188 wrmsr(MSR_IA32_EVNTSEL0, 0, 0); 222 if (boot_cpu_data.x86 == 15) {
223 wrmsr(MSR_P4_IQ_CCCR0, 0, 0);
224 wrmsr(MSR_P4_CRU_ESCR0, 0, 0);
225 }
189 break; 226 break;
190 } 227 }
191 nmi_active = -1; 228 nmi_active = -1;
@@ -253,7 +290,7 @@ void enable_timer_nmi_watchdog(void)
253 290
254static int nmi_pm_active; /* nmi_active before suspend */ 291static int nmi_pm_active; /* nmi_active before suspend */
255 292
256static int lapic_nmi_suspend(struct sys_device *dev, pm_message_t state) 293static int lapic_nmi_suspend(struct sys_device *dev, u32 state)
257{ 294{
258 nmi_pm_active = nmi_active; 295 nmi_pm_active = nmi_active;
259 disable_lapic_nmi_watchdog(); 296 disable_lapic_nmi_watchdog();
@@ -300,22 +337,27 @@ late_initcall(init_lapic_nmi_sysfs);
300 * Original code written by Keith Owens. 337 * Original code written by Keith Owens.
301 */ 338 */
302 339
340static void clear_msr_range(unsigned int base, unsigned int n)
341{
342 unsigned int i;
343
344 for(i = 0; i < n; ++i)
345 wrmsr(base+i, 0, 0);
346}
347
303static void setup_k7_watchdog(void) 348static void setup_k7_watchdog(void)
304{ 349{
305 int i; 350 int i;
306 unsigned int evntsel; 351 unsigned int evntsel;
307 352
308 /* No check, so can start with slow frequency */
309 nmi_hz = 1;
310
311 /* XXX should check these in EFER */
312
313 nmi_perfctr_msr = MSR_K7_PERFCTR0; 353 nmi_perfctr_msr = MSR_K7_PERFCTR0;
314 354
315 for(i = 0; i < 4; ++i) { 355 for(i = 0; i < 4; ++i) {
316 /* Simulator may not support it */ 356 /* Simulator may not support it */
317 if (checking_wrmsrl(MSR_K7_EVNTSEL0+i, 0UL)) 357 if (checking_wrmsrl(MSR_K7_EVNTSEL0+i, 0UL)) {
358 nmi_perfctr_msr = 0;
318 return; 359 return;
360 }
319 wrmsrl(MSR_K7_PERFCTR0+i, 0UL); 361 wrmsrl(MSR_K7_PERFCTR0+i, 0UL);
320 } 362 }
321 363
@@ -325,12 +367,54 @@ static void setup_k7_watchdog(void)
325 | K7_NMI_EVENT; 367 | K7_NMI_EVENT;
326 368
327 wrmsr(MSR_K7_EVNTSEL0, evntsel, 0); 369 wrmsr(MSR_K7_EVNTSEL0, evntsel, 0);
328 wrmsrl(MSR_K7_PERFCTR0, -((u64)cpu_khz*1000) / nmi_hz); 370 wrmsr(MSR_K7_PERFCTR0, -(cpu_khz/nmi_hz*1000), -1);
329 apic_write(APIC_LVTPC, APIC_DM_NMI); 371 apic_write(APIC_LVTPC, APIC_DM_NMI);
330 evntsel |= K7_EVNTSEL_ENABLE; 372 evntsel |= K7_EVNTSEL_ENABLE;
331 wrmsr(MSR_K7_EVNTSEL0, evntsel, 0); 373 wrmsr(MSR_K7_EVNTSEL0, evntsel, 0);
332} 374}
333 375
376
377static int setup_p4_watchdog(void)
378{
379 unsigned int misc_enable, dummy;
380
381 rdmsr(MSR_P4_MISC_ENABLE, misc_enable, dummy);
382 if (!(misc_enable & MSR_P4_MISC_ENABLE_PERF_AVAIL))
383 return 0;
384
385 nmi_perfctr_msr = MSR_P4_IQ_COUNTER0;
386 nmi_p4_cccr_val = P4_NMI_IQ_CCCR0;
387#ifdef CONFIG_SMP
388 if (smp_num_siblings == 2)
389 nmi_p4_cccr_val |= P4_CCCR_OVF_PMI1;
390#endif
391
392 if (!(misc_enable & MSR_P4_MISC_ENABLE_PEBS_UNAVAIL))
393 clear_msr_range(0x3F1, 2);
394 /* MSR 0x3F0 seems to have a default value of 0xFC00, but current
395 docs doesn't fully define it, so leave it alone for now. */
396 if (boot_cpu_data.x86_model >= 0x3) {
397 /* MSR_P4_IQ_ESCR0/1 (0x3ba/0x3bb) removed */
398 clear_msr_range(0x3A0, 26);
399 clear_msr_range(0x3BC, 3);
400 } else {
401 clear_msr_range(0x3A0, 31);
402 }
403 clear_msr_range(0x3C0, 6);
404 clear_msr_range(0x3C8, 6);
405 clear_msr_range(0x3E0, 2);
406 clear_msr_range(MSR_P4_CCCR0, 18);
407 clear_msr_range(MSR_P4_PERFCTR0, 18);
408
409 wrmsr(MSR_P4_CRU_ESCR0, P4_NMI_CRU_ESCR0, 0);
410 wrmsr(MSR_P4_IQ_CCCR0, P4_NMI_IQ_CCCR0 & ~P4_CCCR_ENABLE, 0);
411 Dprintk("setting P4_IQ_COUNTER0 to 0x%08lx\n", -(cpu_khz/nmi_hz*1000));
412 wrmsr(MSR_P4_IQ_COUNTER0, -(cpu_khz/nmi_hz*1000), -1);
413 apic_write(APIC_LVTPC, APIC_DM_NMI);
414 wrmsr(MSR_P4_IQ_CCCR0, nmi_p4_cccr_val, 0);
415 return 1;
416}
417
334void setup_apic_nmi_watchdog(void) 418void setup_apic_nmi_watchdog(void)
335{ 419{
336 switch (boot_cpu_data.x86_vendor) { 420 switch (boot_cpu_data.x86_vendor) {
@@ -341,6 +425,13 @@ void setup_apic_nmi_watchdog(void)
341 return; 425 return;
342 setup_k7_watchdog(); 426 setup_k7_watchdog();
343 break; 427 break;
428 case X86_VENDOR_INTEL:
429 if (boot_cpu_data.x86 != 15)
430 return;
431 if (!setup_p4_watchdog())
432 return;
433 break;
434
344 default: 435 default:
345 return; 436 return;
346 } 437 }
@@ -355,56 +446,67 @@ void setup_apic_nmi_watchdog(void)
355 * 446 *
356 * as these watchdog NMI IRQs are generated on every CPU, we only 447 * as these watchdog NMI IRQs are generated on every CPU, we only
357 * have to check the current processor. 448 * have to check the current processor.
358 *
359 * since NMIs don't listen to _any_ locks, we have to be extremely
360 * careful not to rely on unsafe variables. The printk might lock
361 * up though, so we have to break up any console locks first ...
362 * [when there will be more tty-related locks, break them up
363 * here too!]
364 */ 449 */
365 450
366static unsigned int 451static DEFINE_PER_CPU(unsigned, last_irq_sum);
367 last_irq_sums [NR_CPUS], 452static DEFINE_PER_CPU(local_t, alert_counter);
368 alert_counter [NR_CPUS]; 453static DEFINE_PER_CPU(int, nmi_touch);
369 454
370void touch_nmi_watchdog (void) 455void touch_nmi_watchdog (void)
371{ 456{
372 int i; 457 int i;
373 458
374 /* 459 /*
375 * Just reset the alert counters, (other CPUs might be 460 * Tell other CPUs to reset their alert counters. We cannot
376 * spinning on locks we hold): 461 * do it ourselves because the alert count increase is not
462 * atomic.
377 */ 463 */
378 for (i = 0; i < NR_CPUS; i++) 464 for (i = 0; i < NR_CPUS; i++)
379 alert_counter[i] = 0; 465 per_cpu(nmi_touch, i) = 1;
380} 466}
381 467
382void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason) 468void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason)
383{ 469{
384 int sum, cpu; 470 int sum;
471 int touched = 0;
385 472
386 cpu = safe_smp_processor_id();
387 sum = read_pda(apic_timer_irqs); 473 sum = read_pda(apic_timer_irqs);
388 if (last_irq_sums[cpu] == sum) { 474 if (__get_cpu_var(nmi_touch)) {
475 __get_cpu_var(nmi_touch) = 0;
476 touched = 1;
477 }
478 if (!touched && __get_cpu_var(last_irq_sum) == sum) {
389 /* 479 /*
390 * Ayiee, looks like this CPU is stuck ... 480 * Ayiee, looks like this CPU is stuck ...
391 * wait a few IRQs (5 seconds) before doing the oops ... 481 * wait a few IRQs (5 seconds) before doing the oops ...
392 */ 482 */
393 alert_counter[cpu]++; 483 local_inc(&__get_cpu_var(alert_counter));
394 if (alert_counter[cpu] == 5*nmi_hz) { 484 if (local_read(&__get_cpu_var(alert_counter)) == 5*nmi_hz) {
395 if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) 485 if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT)
396 == NOTIFY_STOP) { 486 == NOTIFY_STOP) {
397 alert_counter[cpu] = 0; 487 local_set(&__get_cpu_var(alert_counter), 0);
398 return; 488 return;
399 } 489 }
400 die_nmi("NMI Watchdog detected LOCKUP on CPU%d", regs); 490 die_nmi("NMI Watchdog detected LOCKUP on CPU%d", regs);
401 } 491 }
402 } else { 492 } else {
403 last_irq_sums[cpu] = sum; 493 __get_cpu_var(last_irq_sum) = sum;
404 alert_counter[cpu] = 0; 494 local_set(&__get_cpu_var(alert_counter), 0);
405 } 495 }
406 if (nmi_perfctr_msr) 496 if (nmi_perfctr_msr) {
497 if (nmi_perfctr_msr == MSR_P4_IQ_COUNTER0) {
498 /*
499 * P4 quirks:
500 * - An overflown perfctr will assert its interrupt
501 * until the OVF flag in its CCCR is cleared.
502 * - LVTPC is masked on interrupt and must be
503 * unmasked by the LVTPC handler.
504 */
505 wrmsr(MSR_P4_IQ_CCCR0, nmi_p4_cccr_val, 0);
506 apic_write(APIC_LVTPC, APIC_DM_NMI);
507 }
407 wrmsr(nmi_perfctr_msr, -(cpu_khz/nmi_hz*1000), -1); 508 wrmsr(nmi_perfctr_msr, -(cpu_khz/nmi_hz*1000), -1);
509 }
408} 510}
409 511
410static int dummy_nmi_callback(struct pt_regs * regs, int cpu) 512static int dummy_nmi_callback(struct pt_regs * regs, int cpu)
diff --git a/arch/x86_64/kernel/pmtimer.c b/arch/x86_64/kernel/pmtimer.c
new file mode 100644
index 000000000000..feb5f108dd26
--- /dev/null
+++ b/arch/x86_64/kernel/pmtimer.c
@@ -0,0 +1,101 @@
1/* Ported over from i386 by AK, original copyright was:
2 *
3 * (C) Dominik Brodowski <linux@brodo.de> 2003
4 *
5 * Driver to use the Power Management Timer (PMTMR) available in some
6 * southbridges as primary timing source for the Linux kernel.
7 *
8 * Based on parts of linux/drivers/acpi/hardware/hwtimer.c, timer_pit.c,
9 * timer_hpet.c, and on Arjan van de Ven's implementation for 2.4.
10 *
11 * This file is licensed under the GPL v2.
12 *
13 * Dropped all the hardware bug workarounds for now. Hopefully they
14 * are not needed on 64bit chipsets.
15 */
16
17#include <linux/jiffies.h>
18#include <linux/kernel.h>
19#include <linux/time.h>
20#include <linux/init.h>
21#include <linux/cpumask.h>
22#include <asm/io.h>
23#include <asm/proto.h>
24#include <asm/msr.h>
25#include <asm/vsyscall.h>
26
27/* The I/O port the PMTMR resides at.
28 * The location is detected during setup_arch(),
29 * in arch/i386/kernel/acpi/boot.c */
30u32 pmtmr_ioport;
31
32/* value of the Power timer at last timer interrupt */
33static u32 offset_delay;
34static u32 last_pmtmr_tick;
35
36#define ACPI_PM_MASK 0xFFFFFF /* limit it to 24 bits */
37
38static inline u32 cyc2us(u32 cycles)
39{
40 /* The Power Management Timer ticks at 3.579545 ticks per microsecond.
41 * 1 / PM_TIMER_FREQUENCY == 0.27936511 =~ 286/1024 [error: 0.024%]
42 *
43 * Even with HZ = 100, delta is at maximum 35796 ticks, so it can
44 * easily be multiplied with 286 (=0x11E) without having to fear
45 * u32 overflows.
46 */
47 cycles *= 286;
48 return (cycles >> 10);
49}
50
51int pmtimer_mark_offset(void)
52{
53 static int first_run = 1;
54 unsigned long tsc;
55 u32 lost;
56
57 u32 tick = inl(pmtmr_ioport);
58 u32 delta;
59
60 delta = cyc2us((tick - last_pmtmr_tick) & ACPI_PM_MASK);
61
62 last_pmtmr_tick = tick;
63 monotonic_base += delta * NSEC_PER_USEC;
64
65 delta += offset_delay;
66
67 lost = delta / (USEC_PER_SEC / HZ);
68 offset_delay = delta % (USEC_PER_SEC / HZ);
69
70 rdtscll(tsc);
71 vxtime.last_tsc = tsc - offset_delay * cpu_khz;
72
73 /* don't calculate delay for first run,
74 or if we've got less then a tick */
75 if (first_run || (lost < 1)) {
76 first_run = 0;
77 offset_delay = 0;
78 }
79
80 return lost - 1;
81}
82
83unsigned int do_gettimeoffset_pm(void)
84{
85 u32 now, offset, delta = 0;
86
87 offset = last_pmtmr_tick;
88 now = inl(pmtmr_ioport);
89 delta = (now - offset) & ACPI_PM_MASK;
90
91 return offset_delay + cyc2us(delta);
92}
93
94
95static int __init nopmtimer_setup(char *s)
96{
97 pmtmr_ioport = 0;
98 return 0;
99}
100
101__setup("nopmtimer", nopmtimer_setup);
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 761b6d35e338..dce8bab4306c 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -656,7 +656,7 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr)
656 656
657 switch (code) { 657 switch (code) {
658 case ARCH_SET_GS: 658 case ARCH_SET_GS:
659 if (addr >= TASK_SIZE) 659 if (addr >= TASK_SIZE_OF(task))
660 return -EPERM; 660 return -EPERM;
661 cpu = get_cpu(); 661 cpu = get_cpu();
662 /* handle small bases via the GDT because that's faster to 662 /* handle small bases via the GDT because that's faster to
@@ -682,7 +682,7 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr)
682 case ARCH_SET_FS: 682 case ARCH_SET_FS:
683 /* Not strictly needed for fs, but do it for symmetry 683 /* Not strictly needed for fs, but do it for symmetry
684 with gs */ 684 with gs */
685 if (addr >= TASK_SIZE) 685 if (addr >= TASK_SIZE_OF(task))
686 return -EPERM; 686 return -EPERM;
687 cpu = get_cpu(); 687 cpu = get_cpu();
688 /* handle small bases via the GDT because that's faster to 688 /* handle small bases via the GDT because that's faster to
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c
index e26e86bb56fe..bbf64b59a21e 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86_64/kernel/ptrace.c
@@ -257,13 +257,13 @@ static int putreg(struct task_struct *child,
257 value &= 0xffff; 257 value &= 0xffff;
258 return 0; 258 return 0;
259 case offsetof(struct user_regs_struct,fs_base): 259 case offsetof(struct user_regs_struct,fs_base):
260 if (!((value >> 48) == 0 || (value >> 48) == 0xffff)) 260 if (value >= TASK_SIZE_OF(child))
261 return -EIO; 261 return -EIO;
262 child->thread.fs = value; 262 child->thread.fs = value;
263 return 0; 263 return 0;
264 case offsetof(struct user_regs_struct,gs_base): 264 case offsetof(struct user_regs_struct,gs_base):
265 if (!((value >> 48) == 0 || (value >> 48) == 0xffff)) 265 if (value >= TASK_SIZE_OF(child))
266 return -EIO; 266 return -EIO;
267 child->thread.gs = value; 267 child->thread.gs = value;
268 return 0; 268 return 0;
269 case offsetof(struct user_regs_struct, eflags): 269 case offsetof(struct user_regs_struct, eflags):
@@ -277,6 +277,11 @@ static int putreg(struct task_struct *child,
277 return -EIO; 277 return -EIO;
278 value &= 0xffff; 278 value &= 0xffff;
279 break; 279 break;
280 case offsetof(struct user_regs_struct, rip):
281 /* Check if the new RIP address is canonical */
282 if (value >= TASK_SIZE_OF(child))
283 return -EIO;
284 break;
280 } 285 }
281 put_stack_long(child, regno - sizeof(struct pt_regs), value); 286 put_stack_long(child, regno - sizeof(struct pt_regs), value);
282 return 0; 287 return 0;
@@ -375,7 +380,7 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
375 break; 380 break;
376 381
377 switch (addr) { 382 switch (addr) {
378 case 0 ... sizeof(struct user_regs_struct): 383 case 0 ... sizeof(struct user_regs_struct) - sizeof(long):
379 tmp = getreg(child, addr); 384 tmp = getreg(child, addr);
380 break; 385 break;
381 case offsetof(struct user, u_debugreg[0]): 386 case offsetof(struct user, u_debugreg[0]):
@@ -414,33 +419,35 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
414 break; 419 break;
415 420
416 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ 421 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
422 {
423 int dsize = test_tsk_thread_flag(child, TIF_IA32) ? 3 : 7;
417 ret = -EIO; 424 ret = -EIO;
418 if ((addr & 7) || 425 if ((addr & 7) ||
419 addr > sizeof(struct user) - 7) 426 addr > sizeof(struct user) - 7)
420 break; 427 break;
421 428
422 switch (addr) { 429 switch (addr) {
423 case 0 ... sizeof(struct user_regs_struct): 430 case 0 ... sizeof(struct user_regs_struct) - sizeof(long):
424 ret = putreg(child, addr, data); 431 ret = putreg(child, addr, data);
425 break; 432 break;
426 /* Disallows to set a breakpoint into the vsyscall */ 433 /* Disallows to set a breakpoint into the vsyscall */
427 case offsetof(struct user, u_debugreg[0]): 434 case offsetof(struct user, u_debugreg[0]):
428 if (data >= TASK_SIZE-7) break; 435 if (data >= TASK_SIZE_OF(child) - dsize) break;
429 child->thread.debugreg0 = data; 436 child->thread.debugreg0 = data;
430 ret = 0; 437 ret = 0;
431 break; 438 break;
432 case offsetof(struct user, u_debugreg[1]): 439 case offsetof(struct user, u_debugreg[1]):
433 if (data >= TASK_SIZE-7) break; 440 if (data >= TASK_SIZE_OF(child) - dsize) break;
434 child->thread.debugreg1 = data; 441 child->thread.debugreg1 = data;
435 ret = 0; 442 ret = 0;
436 break; 443 break;
437 case offsetof(struct user, u_debugreg[2]): 444 case offsetof(struct user, u_debugreg[2]):
438 if (data >= TASK_SIZE-7) break; 445 if (data >= TASK_SIZE_OF(child) - dsize) break;
439 child->thread.debugreg2 = data; 446 child->thread.debugreg2 = data;
440 ret = 0; 447 ret = 0;
441 break; 448 break;
442 case offsetof(struct user, u_debugreg[3]): 449 case offsetof(struct user, u_debugreg[3]):
443 if (data >= TASK_SIZE-7) break; 450 if (data >= TASK_SIZE_OF(child) - dsize) break;
444 child->thread.debugreg3 = data; 451 child->thread.debugreg3 = data;
445 ret = 0; 452 ret = 0;
446 break; 453 break;
@@ -464,6 +471,7 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
464 break; 471 break;
465 } 472 }
466 break; 473 break;
474 }
467 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ 475 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
468 case PTRACE_CONT: /* restart after signal. */ 476 case PTRACE_CONT: /* restart after signal. */
469 477
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 2129cf9ba6b2..99f038ede23c 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -719,7 +719,6 @@ static void __init display_cacheinfo(struct cpuinfo_x86 *c)
719 } 719 }
720} 720}
721 721
722#ifdef CONFIG_SMP
723/* 722/*
724 * On a AMD dual core setup the lower bits of the APIC id distingush the cores. 723 * On a AMD dual core setup the lower bits of the APIC id distingush the cores.
725 * Assumes number of cores is a power of two. 724 * Assumes number of cores is a power of two.
@@ -727,17 +726,26 @@ static void __init display_cacheinfo(struct cpuinfo_x86 *c)
727static void __init amd_detect_cmp(struct cpuinfo_x86 *c) 726static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
728{ 727{
729#ifdef CONFIG_SMP 728#ifdef CONFIG_SMP
730 int cpu = c->x86_apicid; 729 int cpu = smp_processor_id();
731 int node = 0; 730 int node = 0;
731 unsigned bits;
732 if (c->x86_num_cores == 1) 732 if (c->x86_num_cores == 1)
733 return; 733 return;
734 cpu_core_id[cpu] = cpu >> hweight32(c->x86_num_cores - 1); 734
735 bits = 0;
736 while ((1 << bits) < c->x86_num_cores)
737 bits++;
738
739 /* Low order bits define the core id (index of core in socket) */
740 cpu_core_id[cpu] = phys_proc_id[cpu] & ((1 << bits)-1);
741 /* Convert the APIC ID into the socket ID */
742 phys_proc_id[cpu] >>= bits;
735 743
736#ifdef CONFIG_NUMA 744#ifdef CONFIG_NUMA
737 /* When an ACPI SRAT table is available use the mappings from SRAT 745 /* When an ACPI SRAT table is available use the mappings from SRAT
738 instead. */ 746 instead. */
739 if (acpi_numa <= 0) { 747 if (acpi_numa <= 0) {
740 node = cpu_core_id[cpu]; 748 node = phys_proc_id[cpu];
741 if (!node_online(node)) 749 if (!node_online(node))
742 node = first_node(node_online_map); 750 node = first_node(node_online_map);
743 cpu_to_node[cpu] = node; 751 cpu_to_node[cpu] = node;
@@ -745,15 +753,11 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
745 node = cpu_to_node[cpu]; 753 node = cpu_to_node[cpu];
746 } 754 }
747#endif 755#endif
756
748 printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n", 757 printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n",
749 cpu, c->x86_num_cores, node, cpu_core_id[cpu]); 758 cpu, c->x86_num_cores, node, cpu_core_id[cpu]);
750#endif 759#endif
751} 760}
752#else
753static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
754{
755}
756#endif
757 761
758static int __init init_amd(struct cpuinfo_x86 *c) 762static int __init init_amd(struct cpuinfo_x86 *c)
759{ 763{
@@ -925,7 +929,6 @@ void __init early_identify_cpu(struct cpuinfo_x86 *c)
925 c->x86_clflush_size = 64; 929 c->x86_clflush_size = 64;
926 c->x86_cache_alignment = c->x86_clflush_size; 930 c->x86_cache_alignment = c->x86_clflush_size;
927 c->x86_num_cores = 1; 931 c->x86_num_cores = 1;
928 c->x86_apicid = c == &boot_cpu_data ? 0 : c - cpu_data;
929 c->extended_cpuid_level = 0; 932 c->extended_cpuid_level = 0;
930 memset(&c->x86_capability, 0, sizeof c->x86_capability); 933 memset(&c->x86_capability, 0, sizeof c->x86_capability);
931 934
@@ -954,11 +957,14 @@ void __init early_identify_cpu(struct cpuinfo_x86 *c)
954 } 957 }
955 if (c->x86_capability[0] & (1<<19)) 958 if (c->x86_capability[0] & (1<<19))
956 c->x86_clflush_size = ((misc >> 8) & 0xff) * 8; 959 c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
957 c->x86_apicid = misc >> 24;
958 } else { 960 } else {
959 /* Have CPUID level 0 only - unheard of */ 961 /* Have CPUID level 0 only - unheard of */
960 c->x86 = 4; 962 c->x86 = 4;
961 } 963 }
964
965#ifdef CONFIG_SMP
966 phys_proc_id[smp_processor_id()] = (cpuid_ebx(1) >> 24) & 0xff;
967#endif
962} 968}
963 969
964/* 970/*
@@ -1088,7 +1094,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1088 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1094 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1089 1095
1090 /* Other (Linux-defined) */ 1096 /* Other (Linux-defined) */
1091 "cxmmx", NULL, "cyrix_arr", "centaur_mcr", "k8c+", 1097 "cxmmx", NULL, "cyrix_arr", "centaur_mcr", NULL,
1092 "constant_tsc", NULL, NULL, 1098 "constant_tsc", NULL, NULL,
1093 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1099 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1094 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1100 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
diff --git a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c
index d439ced150c6..429c0269dc4e 100644
--- a/arch/x86_64/kernel/signal.c
+++ b/arch/x86_64/kernel/signal.c
@@ -28,6 +28,7 @@
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/i387.h> 29#include <asm/i387.h>
30#include <asm/proto.h> 30#include <asm/proto.h>
31#include <asm/ia32_unistd.h>
31 32
32/* #define DEBUG_SIG 1 */ 33/* #define DEBUG_SIG 1 */
33 34
@@ -452,7 +453,9 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
452 regs->rip -= 2; 453 regs->rip -= 2;
453 } 454 }
454 if (regs->rax == (unsigned long)-ERESTART_RESTARTBLOCK) { 455 if (regs->rax == (unsigned long)-ERESTART_RESTARTBLOCK) {
455 regs->rax = __NR_restart_syscall; 456 regs->rax = test_thread_flag(TIF_IA32) ?
457 __NR_ia32_restart_syscall :
458 __NR_restart_syscall;
456 regs->rip -= 2; 459 regs->rip -= 2;
457 } 460 }
458 } 461 }
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 73f7e8b9543a..f1ec0f345941 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -56,6 +56,7 @@
56#include <asm/kdebug.h> 56#include <asm/kdebug.h>
57#include <asm/tlbflush.h> 57#include <asm/tlbflush.h>
58#include <asm/proto.h> 58#include <asm/proto.h>
59#include <asm/nmi.h>
59 60
60/* Change for real CPU hotplug. Note other files need to be fixed 61/* Change for real CPU hotplug. Note other files need to be fixed
61 first too. */ 62 first too. */
@@ -93,6 +94,7 @@ int smp_threads_ready;
93 94
94cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned; 95cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned;
95cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; 96cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned;
97EXPORT_SYMBOL(cpu_core_map);
96 98
97/* 99/*
98 * Trampoline 80x86 program as an array. 100 * Trampoline 80x86 program as an array.
@@ -125,96 +127,210 @@ static void __cpuinit smp_store_cpu_info(int id)
125 127
126 *c = boot_cpu_data; 128 *c = boot_cpu_data;
127 identify_cpu(c); 129 identify_cpu(c);
130 print_cpu_info(c);
128} 131}
129 132
130/* 133/*
131 * Synchronize TSCs of CPUs 134 * New Funky TSC sync algorithm borrowed from IA64.
135 * Main advantage is that it doesn't reset the TSCs fully and
136 * in general looks more robust and it works better than my earlier
137 * attempts. I believe it was written by David Mosberger. Some minor
138 * adjustments for x86-64 by me -AK
132 * 139 *
133 * This new algorithm is less accurate than the old "zero TSCs" 140 * Original comment reproduced below.
134 * one, but we cannot zero TSCs anymore in the new hotplug CPU 141 *
135 * model. 142 * Synchronize TSC of the current (slave) CPU with the TSC of the
143 * MASTER CPU (normally the time-keeper CPU). We use a closed loop to
144 * eliminate the possibility of unaccounted-for errors (such as
145 * getting a machine check in the middle of a calibration step). The
146 * basic idea is for the slave to ask the master what itc value it has
147 * and to read its own itc before and after the master responds. Each
148 * iteration gives us three timestamps:
149 *
150 * slave master
151 *
152 * t0 ---\
153 * ---\
154 * --->
155 * tm
156 * /---
157 * /---
158 * t1 <---
159 *
160 *
161 * The goal is to adjust the slave's TSC such that tm falls exactly
162 * half-way between t0 and t1. If we achieve this, the clocks are
163 * synchronized provided the interconnect between the slave and the
164 * master is symmetric. Even if the interconnect were asymmetric, we
165 * would still know that the synchronization error is smaller than the
166 * roundtrip latency (t0 - t1).
167 *
168 * When the interconnect is quiet and symmetric, this lets us
169 * synchronize the TSC to within one or two cycles. However, we can
170 * only *guarantee* that the synchronization is accurate to within a
171 * round-trip time, which is typically in the range of several hundred
172 * cycles (e.g., ~500 cycles). In practice, this means that the TSCs
173 * are usually almost perfectly synchronized, but we shouldn't assume
174 * that the accuracy is much better than half a micro second or so.
175 *
176 * [there are other errors like the latency of RDTSC and of the
177 * WRMSR. These can also account to hundreds of cycles. So it's
178 * probably worse. It claims 153 cycles error on a dual Opteron,
179 * but I suspect the numbers are actually somewhat worse -AK]
136 */ 180 */
137 181
138static atomic_t __cpuinitdata tsc_flag; 182#define MASTER 0
183#define SLAVE (SMP_CACHE_BYTES/8)
184
185/* Intentionally don't use cpu_relax() while TSC synchronization
186 because we don't want to go into funky power save modi or cause
187 hypervisors to schedule us away. Going to sleep would likely affect
188 latency and low latency is the primary objective here. -AK */
189#define no_cpu_relax() barrier()
190
139static __cpuinitdata DEFINE_SPINLOCK(tsc_sync_lock); 191static __cpuinitdata DEFINE_SPINLOCK(tsc_sync_lock);
140static unsigned long long __cpuinitdata bp_tsc, ap_tsc; 192static volatile __cpuinitdata unsigned long go[SLAVE + 1];
193static int notscsync __cpuinitdata;
194
195#undef DEBUG_TSC_SYNC
141 196
142#define NR_LOOPS 5 197#define NUM_ROUNDS 64 /* magic value */
198#define NUM_ITERS 5 /* likewise */
143 199
144static void __cpuinit sync_tsc_bp_init(int init) 200/* Callback on boot CPU */
201static __cpuinit void sync_master(void *arg)
145{ 202{
146 if (init) 203 unsigned long flags, i;
147 _raw_spin_lock(&tsc_sync_lock); 204
148 else 205 if (smp_processor_id() != boot_cpu_id)
149 _raw_spin_unlock(&tsc_sync_lock); 206 return;
150 atomic_set(&tsc_flag, 0); 207
208 go[MASTER] = 0;
209
210 local_irq_save(flags);
211 {
212 for (i = 0; i < NUM_ROUNDS*NUM_ITERS; ++i) {
213 while (!go[MASTER])
214 no_cpu_relax();
215 go[MASTER] = 0;
216 rdtscll(go[SLAVE]);
217 }
218 }
219 local_irq_restore(flags);
151} 220}
152 221
153/* 222/*
154 * Synchronize TSC on AP with BP. 223 * Return the number of cycles by which our tsc differs from the tsc
224 * on the master (time-keeper) CPU. A positive number indicates our
225 * tsc is ahead of the master, negative that it is behind.
155 */ 226 */
156static void __cpuinit __sync_tsc_ap(void) 227static inline long
228get_delta(long *rt, long *master)
157{ 229{
158 if (!cpu_has_tsc) 230 unsigned long best_t0 = 0, best_t1 = ~0UL, best_tm = 0;
159 return; 231 unsigned long tcenter, t0, t1, tm;
160 Dprintk("AP %d syncing TSC\n", smp_processor_id()); 232 int i;
161 233
162 while (atomic_read(&tsc_flag) != 0) 234 for (i = 0; i < NUM_ITERS; ++i) {
163 cpu_relax(); 235 rdtscll(t0);
164 atomic_inc(&tsc_flag); 236 go[MASTER] = 1;
165 mb(); 237 while (!(tm = go[SLAVE]))
166 _raw_spin_lock(&tsc_sync_lock); 238 no_cpu_relax();
167 wrmsrl(MSR_IA32_TSC, bp_tsc); 239 go[SLAVE] = 0;
168 _raw_spin_unlock(&tsc_sync_lock); 240 rdtscll(t1);
169 rdtscll(ap_tsc); 241
170 mb(); 242 if (t1 - t0 < best_t1 - best_t0)
171 atomic_inc(&tsc_flag); 243 best_t0 = t0, best_t1 = t1, best_tm = tm;
172 mb(); 244 }
245
246 *rt = best_t1 - best_t0;
247 *master = best_tm - best_t0;
248
249 /* average best_t0 and best_t1 without overflow: */
250 tcenter = (best_t0/2 + best_t1/2);
251 if (best_t0 % 2 + best_t1 % 2 == 2)
252 ++tcenter;
253 return tcenter - best_tm;
173} 254}
174 255
175static void __cpuinit sync_tsc_ap(void) 256static __cpuinit void sync_tsc(void)
176{ 257{
177 int i; 258 int i, done = 0;
178 for (i = 0; i < NR_LOOPS; i++) 259 long delta, adj, adjust_latency = 0;
179 __sync_tsc_ap(); 260 unsigned long flags, rt, master_time_stamp, bound;
261#if DEBUG_TSC_SYNC
262 static struct syncdebug {
263 long rt; /* roundtrip time */
264 long master; /* master's timestamp */
265 long diff; /* difference between midpoint and master's timestamp */
266 long lat; /* estimate of tsc adjustment latency */
267 } t[NUM_ROUNDS] __cpuinitdata;
268#endif
269
270 go[MASTER] = 1;
271
272 smp_call_function(sync_master, NULL, 1, 0);
273
274 while (go[MASTER]) /* wait for master to be ready */
275 no_cpu_relax();
276
277 spin_lock_irqsave(&tsc_sync_lock, flags);
278 {
279 for (i = 0; i < NUM_ROUNDS; ++i) {
280 delta = get_delta(&rt, &master_time_stamp);
281 if (delta == 0) {
282 done = 1; /* let's lock on to this... */
283 bound = rt;
284 }
285
286 if (!done) {
287 unsigned long t;
288 if (i > 0) {
289 adjust_latency += -delta;
290 adj = -delta + adjust_latency/4;
291 } else
292 adj = -delta;
293
294 rdtscll(t);
295 wrmsrl(MSR_IA32_TSC, t + adj);
296 }
297#if DEBUG_TSC_SYNC
298 t[i].rt = rt;
299 t[i].master = master_time_stamp;
300 t[i].diff = delta;
301 t[i].lat = adjust_latency/4;
302#endif
303 }
304 }
305 spin_unlock_irqrestore(&tsc_sync_lock, flags);
306
307#if DEBUG_TSC_SYNC
308 for (i = 0; i < NUM_ROUNDS; ++i)
309 printk("rt=%5ld master=%5ld diff=%5ld adjlat=%5ld\n",
310 t[i].rt, t[i].master, t[i].diff, t[i].lat);
311#endif
312
313 printk(KERN_INFO
314 "CPU %d: synchronized TSC with CPU %u (last diff %ld cycles, "
315 "maxerr %lu cycles)\n",
316 smp_processor_id(), boot_cpu_id, delta, rt);
180} 317}
181 318
182/* 319static void __cpuinit tsc_sync_wait(void)
183 * Synchronize TSC from BP to AP.
184 */
185static void __cpuinit __sync_tsc_bp(int cpu)
186{ 320{
187 if (!cpu_has_tsc) 321 if (notscsync || !cpu_has_tsc)
188 return; 322 return;
189 323 printk(KERN_INFO "CPU %d: Syncing TSC to CPU %u.\n", smp_processor_id(),
190 /* Wait for AP */ 324 boot_cpu_id);
191 while (atomic_read(&tsc_flag) == 0) 325 sync_tsc();
192 cpu_relax();
193 /* Save BPs TSC */
194 sync_core();
195 rdtscll(bp_tsc);
196 /* Don't do the sync core here to avoid too much latency. */
197 mb();
198 /* Start the AP */
199 _raw_spin_unlock(&tsc_sync_lock);
200 /* Wait for AP again */
201 while (atomic_read(&tsc_flag) < 2)
202 cpu_relax();
203 rdtscl(bp_tsc);
204 barrier();
205} 326}
206 327
207static void __cpuinit sync_tsc_bp(int cpu) 328static __init int notscsync_setup(char *s)
208{ 329{
209 int i; 330 notscsync = 1;
210 for (i = 0; i < NR_LOOPS - 1; i++) { 331 return 0;
211 __sync_tsc_bp(cpu);
212 sync_tsc_bp_init(1);
213 }
214 __sync_tsc_bp(cpu);
215 printk(KERN_INFO "Synced TSC of CPU %d difference %Ld\n",
216 cpu, ap_tsc - bp_tsc);
217} 332}
333__setup("notscsync", notscsync_setup);
218 334
219static atomic_t init_deasserted __cpuinitdata; 335static atomic_t init_deasserted __cpuinitdata;
220 336
@@ -315,11 +431,6 @@ void __cpuinit start_secondary(void)
315 cpu_init(); 431 cpu_init();
316 smp_callin(); 432 smp_callin();
317 433
318 /*
319 * Synchronize the TSC with the BP
320 */
321 sync_tsc_ap();
322
323 /* otherwise gcc will move up the smp_processor_id before the cpu_init */ 434 /* otherwise gcc will move up the smp_processor_id before the cpu_init */
324 barrier(); 435 barrier();
325 436
@@ -334,7 +445,6 @@ void __cpuinit start_secondary(void)
334 enable_8259A_irq(0); 445 enable_8259A_irq(0);
335 } 446 }
336 447
337
338 enable_APIC_timer(); 448 enable_APIC_timer();
339 449
340 /* 450 /*
@@ -343,6 +453,11 @@ void __cpuinit start_secondary(void)
343 cpu_set(smp_processor_id(), cpu_online_map); 453 cpu_set(smp_processor_id(), cpu_online_map);
344 mb(); 454 mb();
345 455
456 /* Wait for TSC sync to not schedule things before.
457 We still process interrupts, which could see an inconsistent
458 time in that window unfortunately. */
459 tsc_sync_wait();
460
346 cpu_idle(); 461 cpu_idle();
347} 462}
348 463
@@ -531,7 +646,6 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
531 printk("failed fork for CPU %d\n", cpu); 646 printk("failed fork for CPU %d\n", cpu);
532 return PTR_ERR(idle); 647 return PTR_ERR(idle);
533 } 648 }
534 x86_cpu_to_apicid[cpu] = apicid;
535 649
536 cpu_pda[cpu].pcurrent = idle; 650 cpu_pda[cpu].pcurrent = idle;
537 651
@@ -600,8 +714,6 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
600 714
601 if (cpu_isset(cpu, cpu_callin_map)) { 715 if (cpu_isset(cpu, cpu_callin_map)) {
602 /* number CPUs logically, starting from 1 (BSP is 0) */ 716 /* number CPUs logically, starting from 1 (BSP is 0) */
603 Dprintk("OK.\n");
604 print_cpu_info(&cpu_data[cpu]);
605 Dprintk("CPU has booted.\n"); 717 Dprintk("CPU has booted.\n");
606 } else { 718 } else {
607 boot_error = 1; 719 boot_error = 1;
@@ -842,7 +954,6 @@ void __cpuinit smp_prepare_cpus(unsigned int max_cpus)
842 GET_APIC_ID(apic_read(APIC_ID)), boot_cpu_id); 954 GET_APIC_ID(apic_read(APIC_ID)), boot_cpu_id);
843 /* Or can we switch back to PIC here? */ 955 /* Or can we switch back to PIC here? */
844 } 956 }
845 x86_cpu_to_apicid[0] = boot_cpu_id;
846 957
847 /* 958 /*
848 * Now start the IO-APICs 959 * Now start the IO-APICs
@@ -889,18 +1000,14 @@ int __cpuinit __cpu_up(unsigned int cpu)
889 printk("__cpu_up: bad cpu %d\n", cpu); 1000 printk("__cpu_up: bad cpu %d\n", cpu);
890 return -EINVAL; 1001 return -EINVAL;
891 } 1002 }
892 sync_tsc_bp_init(1);
893 1003
894 /* Boot it! */ 1004 /* Boot it! */
895 err = do_boot_cpu(cpu, apicid); 1005 err = do_boot_cpu(cpu, apicid);
896 if (err < 0) { 1006 if (err < 0) {
897 sync_tsc_bp_init(0);
898 Dprintk("do_boot_cpu failed %d\n", err); 1007 Dprintk("do_boot_cpu failed %d\n", err);
899 return err; 1008 return err;
900 } 1009 }
901 1010
902 sync_tsc_bp(cpu);
903
904 /* Unleash the CPU! */ 1011 /* Unleash the CPU! */
905 Dprintk("waiting for cpu %d\n", cpu); 1012 Dprintk("waiting for cpu %d\n", cpu);
906 1013
@@ -923,4 +1030,6 @@ void __cpuinit smp_cpus_done(unsigned int max_cpus)
923 1030
924 detect_siblings(); 1031 detect_siblings();
925 time_init_gtod(); 1032 time_init_gtod();
1033
1034 check_nmi_watchdog();
926} 1035}
diff --git a/arch/x86_64/kernel/sys_x86_64.c b/arch/x86_64/kernel/sys_x86_64.c
index dbebd5ccba6b..cc7821c68851 100644
--- a/arch/x86_64/kernel/sys_x86_64.c
+++ b/arch/x86_64/kernel/sys_x86_64.c
@@ -68,13 +68,7 @@ out:
68static void find_start_end(unsigned long flags, unsigned long *begin, 68static void find_start_end(unsigned long flags, unsigned long *begin,
69 unsigned long *end) 69 unsigned long *end)
70{ 70{
71#ifdef CONFIG_IA32_EMULATION 71 if (!test_thread_flag(TIF_IA32) && (flags & MAP_32BIT)) {
72 if (test_thread_flag(TIF_IA32)) {
73 *begin = TASK_UNMAPPED_32;
74 *end = IA32_PAGE_OFFSET;
75 } else
76#endif
77 if (flags & MAP_32BIT) {
78 /* This is usually used needed to map code in small 72 /* This is usually used needed to map code in small
79 model, so it needs to be in the first 31bit. Limit 73 model, so it needs to be in the first 31bit. Limit
80 it to that. This means we need to move the 74 it to that. This means we need to move the
@@ -84,10 +78,10 @@ static void find_start_end(unsigned long flags, unsigned long *begin,
84 of playground for now. -AK */ 78 of playground for now. -AK */
85 *begin = 0x40000000; 79 *begin = 0x40000000;
86 *end = 0x80000000; 80 *end = 0x80000000;
87 } else { 81 } else {
88 *begin = TASK_UNMAPPED_64; 82 *begin = TASK_UNMAPPED_BASE;
89 *end = TASK_SIZE; 83 *end = TASK_SIZE;
90 } 84 }
91} 85}
92 86
93unsigned long 87unsigned long
@@ -111,6 +105,11 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
111 (!vma || addr + len <= vma->vm_start)) 105 (!vma || addr + len <= vma->vm_start))
112 return addr; 106 return addr;
113 } 107 }
108 if (((flags & MAP_32BIT) || test_thread_flag(TIF_IA32))
109 && len <= mm->cached_hole_size) {
110 mm->cached_hole_size = 0;
111 mm->free_area_cache = begin;
112 }
114 addr = mm->free_area_cache; 113 addr = mm->free_area_cache;
115 if (addr < begin) 114 if (addr < begin)
116 addr = begin; 115 addr = begin;
@@ -126,6 +125,7 @@ full_search:
126 */ 125 */
127 if (start_addr != begin) { 126 if (start_addr != begin) {
128 start_addr = addr = begin; 127 start_addr = addr = begin;
128 mm->cached_hole_size = 0;
129 goto full_search; 129 goto full_search;
130 } 130 }
131 return -ENOMEM; 131 return -ENOMEM;
@@ -137,6 +137,9 @@ full_search:
137 mm->free_area_cache = addr + len; 137 mm->free_area_cache = addr + len;
138 return addr; 138 return addr;
139 } 139 }
140 if (addr + mm->cached_hole_size < vma->vm_start)
141 mm->cached_hole_size = vma->vm_start - addr;
142
140 addr = vma->vm_end; 143 addr = vma->vm_end;
141 } 144 }
142} 145}
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 0e3b60e1ac5b..fb8c809b4cd9 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -26,6 +26,10 @@
26#include <linux/sysdev.h> 26#include <linux/sysdev.h>
27#include <linux/bcd.h> 27#include <linux/bcd.h>
28#include <linux/kallsyms.h> 28#include <linux/kallsyms.h>
29#include <linux/acpi.h>
30#ifdef CONFIG_ACPI
31#include <acpi/achware.h> /* for PM timer frequency */
32#endif
29#include <asm/8253pit.h> 33#include <asm/8253pit.h>
30#include <asm/pgtable.h> 34#include <asm/pgtable.h>
31#include <asm/vsyscall.h> 35#include <asm/vsyscall.h>
@@ -396,6 +400,10 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
396 (offset - vxtime.last)*(NSEC_PER_SEC/HZ) / hpet_tick; 400 (offset - vxtime.last)*(NSEC_PER_SEC/HZ) / hpet_tick;
397 401
398 vxtime.last = offset; 402 vxtime.last = offset;
403#ifdef CONFIG_X86_PM_TIMER
404 } else if (vxtime.mode == VXTIME_PMTMR) {
405 lost = pmtimer_mark_offset();
406#endif
399 } else { 407 } else {
400 offset = (((tsc - vxtime.last_tsc) * 408 offset = (((tsc - vxtime.last_tsc) *
401 vxtime.tsc_quot) >> 32) - (USEC_PER_SEC / HZ); 409 vxtime.tsc_quot) >> 32) - (USEC_PER_SEC / HZ);
@@ -898,6 +906,13 @@ void __init time_init(void)
898 hpet_period; 906 hpet_period;
899 cpu_khz = hpet_calibrate_tsc(); 907 cpu_khz = hpet_calibrate_tsc();
900 timename = "HPET"; 908 timename = "HPET";
909#ifdef CONFIG_X86_PM_TIMER
910 } else if (pmtmr_ioport) {
911 vxtime_hz = PM_TIMER_FREQUENCY;
912 timename = "PM";
913 pit_init();
914 cpu_khz = pit_calibrate_tsc();
915#endif
901 } else { 916 } else {
902 pit_init(); 917 pit_init();
903 cpu_khz = pit_calibrate_tsc(); 918 cpu_khz = pit_calibrate_tsc();
@@ -923,35 +938,50 @@ void __init time_init(void)
923} 938}
924 939
925/* 940/*
941 * Make an educated guess if the TSC is trustworthy and synchronized
942 * over all CPUs.
943 */
944static __init int unsynchronized_tsc(void)
945{
946#ifdef CONFIG_SMP
947 if (oem_force_hpet_timer())
948 return 1;
949 /* Intel systems are normally all synchronized. Exceptions
950 are handled in the OEM check above. */
951 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
952 return 0;
953 /* All in a single socket - should be synchronized */
954 if (cpus_weight(cpu_core_map[0]) == num_online_cpus())
955 return 0;
956#endif
957 /* Assume multi socket systems are not synchronized */
958 return num_online_cpus() > 1;
959}
960
961/*
926 * Decide after all CPUs are booted what mode gettimeofday should use. 962 * Decide after all CPUs are booted what mode gettimeofday should use.
927 */ 963 */
928void __init time_init_gtod(void) 964void __init time_init_gtod(void)
929{ 965{
930 char *timetype; 966 char *timetype;
931 967
932 /* 968 if (unsynchronized_tsc())
933 * AMD systems with more than one CPU don't have fully synchronized
934 * TSCs. Always use HPET gettimeofday for these, although it is slower.
935 * Intel SMP systems usually have synchronized TSCs, so use always
936 * the TSC.
937 *
938 * Exceptions:
939 * IBM Summit2 checked by oem_force_hpet_timer().
940 * AMD dual core may also not need HPET. Check me.
941 *
942 * Can be turned off with "notsc".
943 */
944 if (num_online_cpus() > 1 &&
945 boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
946 notsc = 1;
947 /* Some systems will want to disable TSC and use HPET. */
948 if (oem_force_hpet_timer())
949 notsc = 1; 969 notsc = 1;
950 if (vxtime.hpet_address && notsc) { 970 if (vxtime.hpet_address && notsc) {
951 timetype = "HPET"; 971 timetype = "HPET";
952 vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; 972 vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
953 vxtime.mode = VXTIME_HPET; 973 vxtime.mode = VXTIME_HPET;
954 do_gettimeoffset = do_gettimeoffset_hpet; 974 do_gettimeoffset = do_gettimeoffset_hpet;
975#ifdef CONFIG_X86_PM_TIMER
976 /* Using PM for gettimeofday is quite slow, but we have no other
977 choice because the TSC is too unreliable on some systems. */
978 } else if (pmtmr_ioport && !vxtime.hpet_address && notsc) {
979 timetype = "PM";
980 do_gettimeoffset = do_gettimeoffset_pm;
981 vxtime.mode = VXTIME_PMTMR;
982 sysctl_vsyscall = 0;
983 printk(KERN_INFO "Disabling vsyscall due to use of PM timer\n");
984#endif
955 } else { 985 } else {
956 timetype = vxtime.hpet_address ? "HPET/TSC" : "PIT/TSC"; 986 timetype = vxtime.hpet_address ? "HPET/TSC" : "PIT/TSC";
957 vxtime.mode = VXTIME_TSC; 987 vxtime.mode = VXTIME_TSC;
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 65a37f52c56e..3dfec8fdabcd 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -332,10 +332,12 @@ void handle_BUG(struct pt_regs *regs)
332 printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", f.filename, f.line); 332 printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", f.filename, f.line);
333} 333}
334 334
335#ifdef CONFIG_BUG
335void out_of_line_bug(void) 336void out_of_line_bug(void)
336{ 337{
337 BUG(); 338 BUG();
338} 339}
340#endif
339 341
340static DEFINE_SPINLOCK(die_lock); 342static DEFINE_SPINLOCK(die_lock);
341static int die_owner = -1; 343static int die_owner = -1;
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c
index b4b8dc59663a..2e5734425949 100644
--- a/arch/x86_64/kernel/vsyscall.c
+++ b/arch/x86_64/kernel/vsyscall.c
@@ -65,7 +65,7 @@ static force_inline void do_vgettimeofday(struct timeval * tv)
65 usec = (__xtime.tv_nsec / 1000) + 65 usec = (__xtime.tv_nsec / 1000) +
66 (__jiffies - __wall_jiffies) * (1000000 / HZ); 66 (__jiffies - __wall_jiffies) * (1000000 / HZ);
67 67
68 if (__vxtime.mode == VXTIME_TSC) { 68 if (__vxtime.mode != VXTIME_HPET) {
69 sync_core(); 69 sync_core();
70 rdtscll(t); 70 rdtscll(t);
71 if (t < __vxtime.last_tsc) 71 if (t < __vxtime.last_tsc)
@@ -217,8 +217,9 @@ static int __init vsyscall_init(void)
217 BUG_ON((unsigned long) &vtime != VSYSCALL_ADDR(__NR_vtime)); 217 BUG_ON((unsigned long) &vtime != VSYSCALL_ADDR(__NR_vtime));
218 BUG_ON((VSYSCALL_ADDR(0) != __fix_to_virt(VSYSCALL_FIRST_PAGE))); 218 BUG_ON((VSYSCALL_ADDR(0) != __fix_to_virt(VSYSCALL_FIRST_PAGE)));
219 map_vsyscall(); 219 map_vsyscall();
220 sysctl_vsyscall = 1; 220#ifdef CONFIG_SYSCTL
221 register_sysctl_table(kernel_root_table2, 0); 221 register_sysctl_table(kernel_root_table2, 0);
222#endif
222 return 0; 223 return 0;
223} 224}
224 225
diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c
index a43dedb58fa2..68ec03070e5a 100644
--- a/arch/x86_64/kernel/x8664_ksyms.c
+++ b/arch/x86_64/kernel/x8664_ksyms.c
@@ -193,8 +193,9 @@ EXPORT_SYMBOL(smp_num_siblings);
193extern void do_softirq_thunk(void); 193extern void do_softirq_thunk(void);
194EXPORT_SYMBOL(do_softirq_thunk); 194EXPORT_SYMBOL(do_softirq_thunk);
195 195
196void out_of_line_bug(void); 196#ifdef CONFIG_BUG
197EXPORT_SYMBOL(out_of_line_bug); 197EXPORT_SYMBOL(out_of_line_bug);
198#endif
198 199
199EXPORT_SYMBOL(init_level4_pgt); 200EXPORT_SYMBOL(init_level4_pgt);
200 201
diff --git a/arch/x86_64/lib/delay.c b/arch/x86_64/lib/delay.c
index 6e2d66472eb1..aed61a668a1b 100644
--- a/arch/x86_64/lib/delay.c
+++ b/arch/x86_64/lib/delay.c
@@ -34,7 +34,7 @@ void __delay(unsigned long loops)
34 34
35inline void __const_udelay(unsigned long xloops) 35inline void __const_udelay(unsigned long xloops)
36{ 36{
37 __delay(((xloops * cpu_data[_smp_processor_id()].loops_per_jiffy) >> 32) * HZ); 37 __delay(((xloops * cpu_data[raw_smp_processor_id()].loops_per_jiffy) >> 32) * HZ);
38} 38}
39 39
40void __udelay(unsigned long usecs) 40void __udelay(unsigned long usecs)
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index e03309216764..57d3ab15a5c7 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -234,6 +234,8 @@ static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs,
234 234
235/* 235/*
236 * Handle a fault on the vmalloc or module mapping area 236 * Handle a fault on the vmalloc or module mapping area
237 *
238 * This assumes no large pages in there.
237 */ 239 */
238static int vmalloc_fault(unsigned long address) 240static int vmalloc_fault(unsigned long address)
239{ 241{
@@ -272,7 +274,10 @@ static int vmalloc_fault(unsigned long address)
272 if (!pte_present(*pte_ref)) 274 if (!pte_present(*pte_ref))
273 return -1; 275 return -1;
274 pte = pte_offset_kernel(pmd, address); 276 pte = pte_offset_kernel(pmd, address);
275 if (!pte_present(*pte) || pte_page(*pte) != pte_page(*pte_ref)) 277 /* Don't use pte_page here, because the mappings can point
278 outside mem_map, and the NUMA hash lookup cannot handle
279 that. */
280 if (!pte_present(*pte) || pte_pfn(*pte) != pte_pfn(*pte_ref))
276 BUG(); 281 BUG();
277 __flush_tlb_all(); 282 __flush_tlb_all();
278 return 0; 283 return 0;
@@ -345,8 +350,10 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
345 * (error_code & 4) == 0, and that the fault was not a 350 * (error_code & 4) == 0, and that the fault was not a
346 * protection error (error_code & 1) == 0. 351 * protection error (error_code & 1) == 0.
347 */ 352 */
348 if (unlikely(address >= TASK_SIZE)) { 353 if (unlikely(address >= TASK_SIZE64)) {
349 if (!(error_code & 5)) { 354 if (!(error_code & 5) &&
355 ((address >= VMALLOC_START && address < VMALLOC_END) ||
356 (address >= MODULES_VADDR && address < MODULES_END))) {
350 if (vmalloc_fault(address) < 0) 357 if (vmalloc_fault(address) < 0)
351 goto bad_area_nosemaphore; 358 goto bad_area_nosemaphore;
352 return; 359 return;
diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c
index 74ec8554b195..58aac23760ef 100644
--- a/arch/x86_64/mm/ioremap.c
+++ b/arch/x86_64/mm/ioremap.c
@@ -133,7 +133,7 @@ ioremap_change_attr(unsigned long phys_addr, unsigned long size,
133 unsigned long flags) 133 unsigned long flags)
134{ 134{
135 int err = 0; 135 int err = 0;
136 if (flags && phys_addr + size - 1 < (end_pfn_map << PAGE_SHIFT)) { 136 if (phys_addr + size - 1 < (end_pfn_map << PAGE_SHIFT)) {
137 unsigned long npages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; 137 unsigned long npages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
138 unsigned long vaddr = (unsigned long) __va(phys_addr); 138 unsigned long vaddr = (unsigned long) __va(phys_addr);
139 139
@@ -214,7 +214,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
214 remove_vm_area((void *)(PAGE_MASK & (unsigned long) addr)); 214 remove_vm_area((void *)(PAGE_MASK & (unsigned long) addr));
215 return NULL; 215 return NULL;
216 } 216 }
217 if (ioremap_change_attr(phys_addr, size, flags) < 0) { 217 if (flags && ioremap_change_attr(phys_addr, size, flags) < 0) {
218 area->flags &= 0xffffff; 218 area->flags &= 0xffffff;
219 vunmap(addr); 219 vunmap(addr);
220 return NULL; 220 return NULL;
@@ -251,7 +251,7 @@ void __iomem *ioremap_nocache (unsigned long phys_addr, unsigned long size)
251 251
252void iounmap(volatile void __iomem *addr) 252void iounmap(volatile void __iomem *addr)
253{ 253{
254 struct vm_struct *p, **pprev; 254 struct vm_struct *p;
255 255
256 if (addr <= high_memory) 256 if (addr <= high_memory)
257 return; 257 return;
@@ -260,24 +260,11 @@ void iounmap(volatile void __iomem *addr)
260 return; 260 return;
261 261
262 write_lock(&vmlist_lock); 262 write_lock(&vmlist_lock);
263 for (p = vmlist, pprev = &vmlist; p != NULL; pprev = &p->next, p = *pprev) 263 p = __remove_vm_area((void *)((unsigned long)addr & PAGE_MASK));
264 if (p->addr == (void *)(PAGE_MASK & (unsigned long)addr)) 264 if (!p)
265 break; 265 printk("iounmap: bad address %p\n", addr);
266 if (!p) { 266 else if (p->flags >> 20)
267 printk("__iounmap: bad address %p\n", addr); 267 ioremap_change_attr(p->phys_addr, p->size, 0);
268 goto out_unlock;
269 }
270 *pprev = p->next;
271 unmap_vm_area(p);
272 if ((p->flags >> 20) &&
273 p->phys_addr + p->size - 1 < virt_to_phys(high_memory)) {
274 /* p->size includes the guard page, but cpa doesn't like that */
275 change_page_attr(virt_to_page(__va(p->phys_addr)),
276 p->size >> PAGE_SHIFT,
277 PAGE_KERNEL);
278 global_flush_tlb();
279 }
280out_unlock:
281 write_unlock(&vmlist_lock); 268 write_unlock(&vmlist_lock);
282 kfree(p); 269 kfree(p);
283} 270}