aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/irq_alpha.c2
-rw-r--r--arch/alpha/kernel/traps.c2
-rw-r--r--arch/arm/Kconfig5
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/configs/omnimeter_defconfig803
-rw-r--r--arch/arm/kernel/armksyms.c6
-rw-r--r--arch/arm/kernel/head.S20
-rw-r--r--arch/arm/kernel/process.c5
-rw-r--r--arch/arm/kernel/setup.c7
-rw-r--r--arch/arm/kernel/smp.c123
-rw-r--r--arch/arm/kernel/time.c10
-rw-r--r--arch/arm/kernel/traps.c12
-rw-r--r--arch/arm/lib/Makefile2
-rw-r--r--arch/arm/lib/longlong.h183
-rw-r--r--arch/arm/lib/udivdi3.c222
-rw-r--r--arch/arm/mach-aaec2000/Makefile.boot1
-rw-r--r--arch/arm/mach-aaec2000/aaed2000.c10
-rw-r--r--arch/arm/mach-aaec2000/core.c4
-rw-r--r--arch/arm/mach-clps711x/autcpu12.c12
-rw-r--r--arch/arm/mach-clps711x/cdb89712.c12
-rw-r--r--arch/arm/mach-clps711x/ceiva.c12
-rw-r--r--arch/arm/mach-clps711x/clep7312.c14
-rw-r--r--arch/arm/mach-clps711x/edb7211-arch.c14
-rw-r--r--arch/arm/mach-clps711x/fortunet.c14
-rw-r--r--arch/arm/mach-clps711x/p720t.c14
-rw-r--r--arch/arm/mach-clps711x/time.c4
-rw-r--r--arch/arm/mach-clps7500/core.c18
-rw-r--r--arch/arm/mach-ebsa110/core.c22
-rw-r--r--arch/arm/mach-epxa10db/arch.c10
-rw-r--r--arch/arm/mach-epxa10db/time.c4
-rw-r--r--arch/arm/mach-footbridge/cats-hw.c16
-rw-r--r--arch/arm/mach-footbridge/co285.c12
-rw-r--r--arch/arm/mach-footbridge/dc21285-timer.c2
-rw-r--r--arch/arm/mach-footbridge/ebsa285.c15
-rw-r--r--arch/arm/mach-footbridge/isa-timer.c2
-rw-r--r--arch/arm/mach-footbridge/netwinder-hw.c21
-rw-r--r--arch/arm/mach-footbridge/personal.c12
-rw-r--r--arch/arm/mach-h720x/cpu-h7201.c4
-rw-r--r--arch/arm/mach-h720x/cpu-h7202.c4
-rw-r--r--arch/arm/mach-h720x/h7201-eval.c14
-rw-r--r--arch/arm/mach-h720x/h7202-eval.c16
-rw-r--r--arch/arm/mach-imx/mx1ads.c14
-rw-r--r--arch/arm/mach-imx/time.c4
-rw-r--r--arch/arm/mach-integrator/core.c45
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c14
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c14
-rw-r--r--arch/arm/mach-iop3xx/iop321-setup.c28
-rw-r--r--arch/arm/mach-iop3xx/iop321-time.c2
-rw-r--r--arch/arm/mach-iop3xx/iop331-setup.c30
-rw-r--r--arch/arm/mach-iop3xx/iop331-time.c2
-rw-r--r--arch/arm/mach-ixp2000/core.c9
-rw-r--r--arch/arm/mach-ixp2000/enp2611.c14
-rw-r--r--arch/arm/mach-ixp2000/ixdp2400.c14
-rw-r--r--arch/arm/mach-ixp2000/ixdp2800.c20
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x01.c28
-rw-r--r--arch/arm/mach-ixp4xx/common.c4
-rw-r--r--arch/arm/mach-ixp4xx/coyote-setup.c30
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c17
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c60
-rw-r--r--arch/arm/mach-l7200/core.c10
-rw-r--r--arch/arm/mach-lh7a40x/arch-kev7a400.c12
-rw-r--r--arch/arm/mach-lh7a40x/arch-lpd7a40x.c28
-rw-r--r--arch/arm/mach-lh7a40x/time.c4
-rw-r--r--arch/arm/mach-omap/board-generic.c14
-rw-r--r--arch/arm/mach-omap/board-h2.c14
-rw-r--r--arch/arm/mach-omap/board-h3.c14
-rw-r--r--arch/arm/mach-omap/board-innovator.c14
-rw-r--r--arch/arm/mach-omap/board-netstar.c16
-rw-r--r--arch/arm/mach-omap/board-osk.c14
-rw-r--r--arch/arm/mach-omap/board-perseus2.c14
-rw-r--r--arch/arm/mach-omap/board-voiceblue.c16
-rw-r--r--arch/arm/mach-omap/pm.c16
-rw-r--r--arch/arm/mach-omap/time.c54
-rw-r--r--arch/arm/mach-omap/usb.c9
-rw-r--r--arch/arm/mach-pxa/Makefile4
-rw-r--r--arch/arm/mach-pxa/corgi.c42
-rw-r--r--arch/arm/mach-pxa/idp.c12
-rw-r--r--arch/arm/mach-pxa/lubbock.c12
-rw-r--r--arch/arm/mach-pxa/mainstone.c12
-rw-r--r--arch/arm/mach-pxa/poodle.c14
-rw-r--r--arch/arm/mach-pxa/pxa27x.c9
-rw-r--r--arch/arm/mach-pxa/standby.S32
-rw-r--r--arch/arm/mach-pxa/time.c4
-rw-r--r--arch/arm/mach-rpc/riscpc.c16
-rw-r--r--arch/arm/mach-s3c2410/Kconfig5
-rw-r--r--arch/arm/mach-s3c2410/Makefile1
-rw-r--r--arch/arm/mach-s3c2410/devs.c4
-rw-r--r--arch/arm/mach-s3c2410/irq.c7
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c46
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c12
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c9
-rw-r--r--arch/arm/mach-s3c2410/mach-nexcoder.c8
-rw-r--r--arch/arm/mach-s3c2410/mach-otom.c8
-rw-r--r--arch/arm/mach-s3c2410/mach-rx3715.c14
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2410.c12
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2440.c8
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c16
-rw-r--r--arch/arm/mach-s3c2410/pm-simtec.c65
-rw-r--r--arch/arm/mach-s3c2410/time.c4
-rw-r--r--arch/arm/mach-sa1100/assabet.c12
-rw-r--r--arch/arm/mach-sa1100/badge4.c10
-rw-r--r--arch/arm/mach-sa1100/cerf.c10
-rw-r--r--arch/arm/mach-sa1100/collie.c8
-rw-r--r--arch/arm/mach-sa1100/cpu-sa1110.c3
-rw-r--r--arch/arm/mach-sa1100/h3600.c32
-rw-r--r--arch/arm/mach-sa1100/hackkit.c10
-rw-r--r--arch/arm/mach-sa1100/jornada720.c10
-rw-r--r--arch/arm/mach-sa1100/lart.c10
-rw-r--r--arch/arm/mach-sa1100/pleb.c8
-rw-r--r--arch/arm/mach-sa1100/shannon.c10
-rw-r--r--arch/arm/mach-sa1100/simpad.c12
-rw-r--r--arch/arm/mach-sa1100/time.c4
-rw-r--r--arch/arm/mach-shark/core.c16
-rw-r--r--arch/arm/mach-versatile/core.c65
-rw-r--r--arch/arm/mach-versatile/versatile_ab.c14
-rw-r--r--arch/arm/mach-versatile/versatile_pb.c14
-rw-r--r--arch/arm/mm/blockops.c3
-rw-r--r--arch/arm/mm/fault.c75
-rw-r--r--arch/arm/mm/init.c73
-rw-r--r--arch/arm/mm/mm-armv.c89
-rw-r--r--arch/arm/mm/proc-arm1020.S4
-rw-r--r--arch/arm/mm/proc-arm1020e.S4
-rw-r--r--arch/arm/oprofile/Makefile2
-rw-r--r--arch/arm/oprofile/backtrace.c144
-rw-r--r--arch/arm/oprofile/init.c2
-rw-r--r--arch/arm/oprofile/op_arm_model.h2
-rw-r--r--arch/arm/tools/mach-types69
-rw-r--r--arch/arm/vfp/vfp.h15
-rw-r--r--arch/arm/vfp/vfpdouble.c2
-rw-r--r--arch/arm/vfp/vfpmodule.c2
-rw-r--r--arch/arm/vfp/vfpsingle.c14
-rw-r--r--arch/i386/boot/tools/build.c3
-rw-r--r--arch/i386/kernel/acpi/boot.c57
-rw-r--r--arch/i386/kernel/apic.c2
-rw-r--r--arch/i386/kernel/apm.c5
-rw-r--r--arch/i386/kernel/cpu/cpufreq/gx-suspmod.c2
-rw-r--r--arch/i386/kernel/io_apic.c2
-rw-r--r--arch/i386/kernel/kprobes.c133
-rw-r--r--arch/i386/kernel/process.c29
-rw-r--r--arch/i386/kernel/syscall_table.S2
-rw-r--r--arch/i386/kernel/time.c5
-rw-r--r--arch/i386/kernel/timers/timer_cyclone.c4
-rw-r--r--arch/i386/kernel/timers/timer_pit.c4
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c3
-rw-r--r--arch/i386/mach-voyager/voyager_basic.c2
-rw-r--r--arch/i386/pci/common.c9
-rw-r--r--arch/i386/pci/i386.c11
-rw-r--r--arch/i386/pci/irq.c51
-rw-r--r--arch/i386/pci/legacy.c2
-rw-r--r--arch/i386/pci/mmconfig.c39
-rw-r--r--arch/i386/pci/numa.c2
-rw-r--r--arch/i386/pci/pci.h1
-rw-r--r--arch/ia64/configs/sn2_defconfig4
-rw-r--r--arch/ia64/configs/tiger_defconfig39
-rw-r--r--arch/ia64/configs/zx1_defconfig166
-rw-r--r--arch/ia64/hp/common/sba_iommu.c4
-rw-r--r--arch/ia64/hp/sim/simserial.c16
-rw-r--r--arch/ia64/kernel/acpi.c30
-rw-r--r--arch/ia64/kernel/entry.S114
-rw-r--r--arch/ia64/kernel/fsys.S147
-rw-r--r--arch/ia64/kernel/gate.S62
-rw-r--r--arch/ia64/kernel/ia64_ksyms.c3
-rw-r--r--arch/ia64/kernel/iosapic.c134
-rw-r--r--arch/ia64/kernel/ivt.S198
-rw-r--r--arch/ia64/kernel/kprobes.c128
-rw-r--r--arch/ia64/kernel/process.c16
-rw-r--r--arch/ia64/kernel/ptrace.c22
-rw-r--r--arch/ia64/kernel/setup.c12
-rw-r--r--arch/ia64/kernel/smp.c3
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S7
-rw-r--r--arch/ia64/pci/pci.c38
-rw-r--r--arch/ia64/sn/kernel/io_init.c2
-rw-r--r--arch/ia64/sn/kernel/iomv.c6
-rw-r--r--arch/ia64/sn/kernel/setup.c43
-rw-r--r--arch/ia64/sn/kernel/sn2/ptc_deadlock.S1
-rw-r--r--arch/ia64/sn/kernel/tiocx.c14
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c8
-rw-r--r--arch/mips/kernel/signal.c2
-rw-r--r--arch/parisc/configs/712_defconfig2
-rw-r--r--arch/parisc/configs/a500_defconfig2
-rw-r--r--arch/parisc/configs/b180_defconfig2
-rw-r--r--arch/parisc/configs/c3000_defconfig2
-rw-r--r--arch/parisc/defconfig2
-rw-r--r--arch/ppc/8xx_io/enet.c52
-rw-r--r--arch/ppc/Kconfig22
-rw-r--r--arch/ppc/configs/mpc86x_ads_defconfig633
-rw-r--r--arch/ppc/configs/mpc885ads_defconfig622
-rw-r--r--arch/ppc/kernel/misc.S2
-rw-r--r--arch/ppc/kernel/pci.c21
-rw-r--r--arch/ppc/kernel/relocate_kernel.S4
-rw-r--r--arch/ppc/kernel/time.c13
-rw-r--r--arch/ppc/mm/init.c14
-rw-r--r--arch/ppc/platforms/85xx/mpc8540_ads.c2
-rw-r--r--arch/ppc/platforms/fads.h109
-rw-r--r--arch/ppc/platforms/mpc885ads.h92
-rw-r--r--arch/ppc/platforms/pmac_sleep.S4
-rw-r--r--arch/ppc/platforms/pmac_time.c8
-rw-r--r--arch/ppc/platforms/sandpoint.c1
-rw-r--r--arch/ppc/syslib/open_pic.c26
-rw-r--r--arch/ppc/syslib/ppc4xx_pic.c4
-rw-r--r--arch/ppc64/boot/Makefile5
-rw-r--r--arch/ppc64/boot/main.c8
-rw-r--r--arch/ppc64/boot/mknote.c43
-rw-r--r--arch/ppc64/boot/piggyback.c83
-rw-r--r--arch/ppc64/boot/prom.c16
-rw-r--r--arch/ppc64/kernel/ItLpQueue.c294
-rw-r--r--arch/ppc64/kernel/LparData.c11
-rw-r--r--arch/ppc64/kernel/iSeries_proc.c48
-rw-r--r--arch/ppc64/kernel/iSeries_setup.c43
-rw-r--r--arch/ppc64/kernel/idle.c4
-rw-r--r--arch/ppc64/kernel/irq.c9
-rw-r--r--arch/ppc64/kernel/kprobes.c125
-rw-r--r--arch/ppc64/kernel/mf.c6
-rw-r--r--arch/ppc64/kernel/nvram.c8
-rw-r--r--arch/ppc64/kernel/pacaData.c212
-rw-r--r--arch/ppc64/kernel/pci.c22
-rw-r--r--arch/ppc64/kernel/ppc_ksyms.c1
-rw-r--r--arch/ppc64/kernel/process.c4
-rw-r--r--arch/ppc64/kernel/sysfs.c7
-rw-r--r--arch/ppc64/kernel/time.c9
-rw-r--r--arch/sparc/Kconfig56
-rw-r--r--arch/sparc64/Kconfig18
-rw-r--r--arch/sparc64/kernel/auxio.c2
-rw-r--r--arch/sparc64/kernel/entry.S137
-rw-r--r--arch/sparc64/kernel/irq.c752
-rw-r--r--arch/sparc64/kernel/kprobes.c5
-rw-r--r--arch/sparc64/kernel/pci_psycho.c3
-rw-r--r--arch/sparc64/kernel/pci_sabre.c46
-rw-r--r--arch/sparc64/kernel/pci_schizo.c78
-rw-r--r--arch/sparc64/kernel/semaphore.c12
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c1
-rw-r--r--arch/sparc64/kernel/time.c2
-rw-r--r--arch/sparc64/kernel/trampoline.S3
-rw-r--r--arch/sparc64/lib/U1memcpy.S103
-rw-r--r--arch/sparc64/lib/VISsave.S15
-rw-r--r--arch/sparc64/lib/atomic.S42
-rw-r--r--arch/sparc64/lib/bitops.S31
-rw-r--r--arch/sparc64/lib/debuglocks.c6
-rw-r--r--arch/sparc64/lib/dec_and_lock.S6
-rw-r--r--arch/sparc64/lib/rwsem.S15
-rw-r--r--arch/sparc64/mm/init.c6
-rw-r--r--arch/sparc64/mm/ultra.S8
-rw-r--r--arch/x86_64/kernel/io_apic.c1
-rw-r--r--arch/x86_64/kernel/kprobes.c236
-rw-r--r--arch/x86_64/kernel/process.c29
-rw-r--r--arch/x86_64/pci/mmconfig.c68
-rw-r--r--arch/xtensa/Kconfig4
-rw-r--r--arch/xtensa/Makefile48
-rw-r--r--arch/xtensa/boot/Makefile10
-rw-r--r--arch/xtensa/boot/boot-elf/Makefile4
-rw-r--r--arch/xtensa/boot/boot-redboot/Makefile10
-rw-r--r--arch/xtensa/boot/include/zlib.h433
-rw-r--r--arch/xtensa/boot/lib/Makefile13
-rw-r--r--arch/xtensa/boot/lib/memcpy.S36
-rw-r--r--arch/xtensa/boot/lib/zlib.c2150
-rw-r--r--arch/xtensa/boot/lib/zmem.c20
-rw-r--r--arch/xtensa/kernel/pci.c95
-rw-r--r--arch/xtensa/kernel/ptrace.c5
258 files changed, 5277 insertions, 6825 deletions
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index e6ded33c6e22..9d34ce26e5ef 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -55,6 +55,8 @@ do_entInt(unsigned long type, unsigned long vector,
55#ifdef CONFIG_SMP 55#ifdef CONFIG_SMP
56 { 56 {
57 long cpu; 57 long cpu;
58
59 local_irq_disable();
58 smp_percpu_timer_interrupt(regs); 60 smp_percpu_timer_interrupt(regs);
59 cpu = smp_processor_id(); 61 cpu = smp_processor_id();
60 if (cpu != boot_cpuid) { 62 if (cpu != boot_cpuid) {
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
index fd7bd17cc960..6f509a644bdd 100644
--- a/arch/alpha/kernel/traps.c
+++ b/arch/alpha/kernel/traps.c
@@ -240,7 +240,7 @@ do_entIF(unsigned long type, struct pt_regs *regs)
240 siginfo_t info; 240 siginfo_t info;
241 int signo, code; 241 int signo, code;
242 242
243 if (regs->ps == 0) { 243 if ((regs->ps & ~IPL_MAX) == 0) {
244 if (type == 1) { 244 if (type == 1) {
245 const unsigned int *data 245 const unsigned int *data
246 = (const unsigned int *) regs->pc; 246 = (const unsigned int *) regs->pc;
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c8d94dcd8ef7..620f2ca94ed2 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -361,6 +361,11 @@ config NO_IDLE_HZ
361 Alternatively, if you want dynamic tick automatically enabled 361 Alternatively, if you want dynamic tick automatically enabled
362 during boot, pass "dyntick=enable" via the kernel command string. 362 during boot, pass "dyntick=enable" via the kernel command string.
363 363
364 Please note that dynamic tick may affect the accuracy of
365 timekeeping on some platforms depending on the implementation.
366 Currently at least OMAP platform is known to have accurate
367 timekeeping with dynamic tick.
368
364config ARCH_DISCONTIGMEM_ENABLE 369config ARCH_DISCONTIGMEM_ENABLE
365 bool 370 bool
366 default (ARCH_LH7A40X && !LH7A40X_CONTIGMEM) 371 default (ARCH_LH7A40X && !LH7A40X_CONTIGMEM)
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 8330495e2448..eb933dcafba0 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -56,7 +56,7 @@ tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110)
56tune-$(CONFIG_CPU_V6) :=-mtune=strongarm 56tune-$(CONFIG_CPU_V6) :=-mtune=strongarm
57 57
58# Need -Uarm for gcc < 3.x 58# Need -Uarm for gcc < 3.x
59CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) 59CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
60CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm 60CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
61AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float 61AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float
62 62
diff --git a/arch/arm/configs/omnimeter_defconfig b/arch/arm/configs/omnimeter_defconfig
deleted file mode 100644
index 78fdb4a428b1..000000000000
--- a/arch/arm/configs/omnimeter_defconfig
+++ /dev/null
@@ -1,803 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 21:31:45 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51CONFIG_MODULES=y
52# CONFIG_MODULE_UNLOAD is not set
53CONFIG_OBSOLETE_MODPARM=y
54# CONFIG_MODVERSIONS is not set
55# CONFIG_MODULE_SRCVERSION_ALL is not set
56CONFIG_KMOD=y
57
58#
59# System Type
60#
61# CONFIG_ARCH_CLPS7500 is not set
62# CONFIG_ARCH_CLPS711X is not set
63# CONFIG_ARCH_CO285 is not set
64# CONFIG_ARCH_EBSA110 is not set
65# CONFIG_ARCH_CAMELOT is not set
66# CONFIG_ARCH_FOOTBRIDGE is not set
67# CONFIG_ARCH_INTEGRATOR is not set
68# CONFIG_ARCH_IOP3XX is not set
69# CONFIG_ARCH_IXP4XX is not set
70# CONFIG_ARCH_IXP2000 is not set
71# CONFIG_ARCH_L7200 is not set
72# CONFIG_ARCH_PXA is not set
73# CONFIG_ARCH_RPC is not set
74CONFIG_ARCH_SA1100=y
75# CONFIG_ARCH_S3C2410 is not set
76# CONFIG_ARCH_SHARK is not set
77# CONFIG_ARCH_LH7A40X is not set
78# CONFIG_ARCH_OMAP is not set
79# CONFIG_ARCH_VERSATILE is not set
80# CONFIG_ARCH_IMX is not set
81# CONFIG_ARCH_H720X is not set
82
83#
84# SA11x0 Implementations
85#
86# CONFIG_SA1100_ASSABET is not set
87# CONFIG_SA1100_CERF is not set
88# CONFIG_SA1100_COLLIE is not set
89# CONFIG_SA1100_H3100 is not set
90# CONFIG_SA1100_H3600 is not set
91# CONFIG_SA1100_H3800 is not set
92# CONFIG_SA1100_BADGE4 is not set
93# CONFIG_SA1100_JORNADA720 is not set
94# CONFIG_SA1100_HACKKIT is not set
95# CONFIG_SA1100_LART is not set
96# CONFIG_SA1100_PLEB is not set
97# CONFIG_SA1100_SHANNON is not set
98# CONFIG_SA1100_SIMPAD is not set
99# CONFIG_SA1100_SSP is not set
100
101#
102# Processor Type
103#
104CONFIG_CPU_32=y
105CONFIG_CPU_SA1100=y
106CONFIG_CPU_32v4=y
107CONFIG_CPU_ABRT_EV4=y
108CONFIG_CPU_CACHE_V4WB=y
109CONFIG_CPU_CACHE_VIVT=y
110CONFIG_CPU_TLB_V4WB=y
111CONFIG_CPU_MINICACHE=y
112
113#
114# Processor Features
115#
116
117#
118# Bus support
119#
120CONFIG_ISA=y
121
122#
123# PCCARD (PCMCIA/CardBus) support
124#
125CONFIG_PCCARD=y
126# CONFIG_PCMCIA_DEBUG is not set
127CONFIG_PCMCIA=y
128
129#
130# PC-card bridges
131#
132CONFIG_I82365=y
133# CONFIG_TCIC is not set
134CONFIG_PCMCIA_SA1100=y
135CONFIG_PCCARD_NONSTATIC=y
136
137#
138# Kernel Features
139#
140# CONFIG_PREEMPT is not set
141CONFIG_DISCONTIGMEM=y
142# CONFIG_LEDS is not set
143CONFIG_ALIGNMENT_TRAP=y
144
145#
146# Boot options
147#
148CONFIG_ZBOOT_ROM_TEXT=0x0
149CONFIG_ZBOOT_ROM_BSS=0x0
150CONFIG_CMDLINE="keepinitrd mem=16M root=/dev/ram ramdisk=8192 initrd=0xd0000000,4M"
151# CONFIG_XIP_KERNEL is not set
152
153#
154# CPU Frequency scaling
155#
156# CONFIG_CPU_FREQ is not set
157
158#
159# Floating point emulation
160#
161
162#
163# At least one emulation must be selected
164#
165# CONFIG_FPE_NWFPE is not set
166# CONFIG_FPE_FASTFPE is not set
167
168#
169# Userspace binary formats
170#
171CONFIG_BINFMT_ELF=y
172CONFIG_BINFMT_AOUT=y
173# CONFIG_BINFMT_MISC is not set
174# CONFIG_ARTHUR is not set
175
176#
177# Power management options
178#
179# CONFIG_PM is not set
180
181#
182# Device Drivers
183#
184
185#
186# Generic Driver Options
187#
188CONFIG_STANDALONE=y
189CONFIG_PREVENT_FIRMWARE_BUILD=y
190# CONFIG_FW_LOADER is not set
191
192#
193# Memory Technology Devices (MTD)
194#
195# CONFIG_MTD is not set
196
197#
198# Parallel port support
199#
200# CONFIG_PARPORT is not set
201
202#
203# Plug and Play support
204#
205# CONFIG_PNP is not set
206
207#
208# Block devices
209#
210# CONFIG_BLK_DEV_FD is not set
211# CONFIG_BLK_DEV_XD is not set
212# CONFIG_BLK_DEV_COW_COMMON is not set
213CONFIG_BLK_DEV_LOOP=m
214# CONFIG_BLK_DEV_CRYPTOLOOP is not set
215CONFIG_BLK_DEV_NBD=m
216# CONFIG_BLK_DEV_RAM is not set
217CONFIG_BLK_DEV_RAM_COUNT=16
218CONFIG_INITRAMFS_SOURCE=""
219# CONFIG_CDROM_PKTCDVD is not set
220
221#
222# IO Schedulers
223#
224CONFIG_IOSCHED_NOOP=y
225CONFIG_IOSCHED_AS=y
226CONFIG_IOSCHED_DEADLINE=y
227CONFIG_IOSCHED_CFQ=y
228# CONFIG_ATA_OVER_ETH is not set
229
230#
231# ATA/ATAPI/MFM/RLL support
232#
233CONFIG_IDE=y
234CONFIG_BLK_DEV_IDE=y
235
236#
237# Please see Documentation/ide.txt for help/info on IDE drives
238#
239# CONFIG_BLK_DEV_IDE_SATA is not set
240CONFIG_BLK_DEV_IDEDISK=y
241# CONFIG_IDEDISK_MULTI_MODE is not set
242# CONFIG_BLK_DEV_IDECS is not set
243# CONFIG_BLK_DEV_IDECD is not set
244# CONFIG_BLK_DEV_IDETAPE is not set
245# CONFIG_BLK_DEV_IDEFLOPPY is not set
246# CONFIG_IDE_TASK_IOCTL is not set
247
248#
249# IDE chipset support/bugfixes
250#
251CONFIG_IDE_GENERIC=y
252# CONFIG_IDE_ARM is not set
253# CONFIG_IDE_CHIPSETS is not set
254# CONFIG_BLK_DEV_IDEDMA is not set
255# CONFIG_IDEDMA_AUTO is not set
256# CONFIG_BLK_DEV_HD is not set
257
258#
259# SCSI device support
260#
261# CONFIG_SCSI is not set
262
263#
264# Multi-device support (RAID and LVM)
265#
266# CONFIG_MD is not set
267
268#
269# Fusion MPT device support
270#
271
272#
273# IEEE 1394 (FireWire) support
274#
275
276#
277# I2O device support
278#
279
280#
281# Networking support
282#
283CONFIG_NET=y
284
285#
286# Networking options
287#
288CONFIG_PACKET=y
289CONFIG_PACKET_MMAP=y
290# CONFIG_NETLINK_DEV is not set
291CONFIG_UNIX=y
292# CONFIG_NET_KEY is not set
293CONFIG_INET=y
294CONFIG_IP_MULTICAST=y
295# CONFIG_IP_ADVANCED_ROUTER is not set
296# CONFIG_IP_PNP is not set
297# CONFIG_NET_IPIP is not set
298# CONFIG_NET_IPGRE is not set
299# CONFIG_IP_MROUTE is not set
300# CONFIG_ARPD is not set
301# CONFIG_SYN_COOKIES is not set
302# CONFIG_INET_AH is not set
303# CONFIG_INET_ESP is not set
304# CONFIG_INET_IPCOMP is not set
305# CONFIG_INET_TUNNEL is not set
306CONFIG_IP_TCPDIAG=y
307# CONFIG_IP_TCPDIAG_IPV6 is not set
308
309#
310# IP: Virtual Server Configuration
311#
312# CONFIG_IP_VS is not set
313# CONFIG_IPV6 is not set
314CONFIG_NETFILTER=y
315# CONFIG_NETFILTER_DEBUG is not set
316
317#
318# IP: Netfilter Configuration
319#
320# CONFIG_IP_NF_CONNTRACK is not set
321# CONFIG_IP_NF_CONNTRACK_MARK is not set
322# CONFIG_IP_NF_QUEUE is not set
323# CONFIG_IP_NF_IPTABLES is not set
324# CONFIG_IP_NF_ARPTABLES 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# ARCnet devices
366#
367# CONFIG_ARCNET is not set
368
369#
370# Ethernet (10 or 100Mbit)
371#
372CONFIG_NET_ETHERNET=y
373# CONFIG_MII is not set
374# CONFIG_NET_VENDOR_3COM is not set
375# CONFIG_LANCE is not set
376# CONFIG_NET_VENDOR_SMC is not set
377# CONFIG_SMC91X is not set
378# CONFIG_NET_VENDOR_RACAL is not set
379# CONFIG_AT1700 is not set
380# CONFIG_DEPCA is not set
381# CONFIG_HP100 is not set
382# CONFIG_NET_ISA is not set
383# CONFIG_NET_PCI is not set
384# CONFIG_NET_POCKET is not set
385
386#
387# Ethernet (1000 Mbit)
388#
389
390#
391# Ethernet (10000 Mbit)
392#
393
394#
395# Token Ring devices
396#
397# CONFIG_TR is not set
398
399#
400# Wireless LAN (non-hamradio)
401#
402CONFIG_NET_RADIO=y
403
404#
405# Obsolete Wireless cards support (pre-802.11)
406#
407# CONFIG_STRIP is not set
408# CONFIG_ARLAN is not set
409# CONFIG_WAVELAN is not set
410CONFIG_PCMCIA_WAVELAN=y
411# CONFIG_PCMCIA_NETWAVE is not set
412
413#
414# Wireless 802.11 Frequency Hopping cards support
415#
416# CONFIG_PCMCIA_RAYCS is not set
417
418#
419# Wireless 802.11b ISA/PCI cards support
420#
421# CONFIG_HERMES is not set
422# CONFIG_ATMEL is not set
423
424#
425# Wireless 802.11b Pcmcia/Cardbus cards support
426#
427CONFIG_AIRO_CS=y
428CONFIG_PCMCIA_WL3501=y
429CONFIG_NET_WIRELESS=y
430
431#
432# PCMCIA network device support
433#
434CONFIG_NET_PCMCIA=y
435CONFIG_PCMCIA_3C589=y
436# CONFIG_PCMCIA_3C574 is not set
437# CONFIG_PCMCIA_FMVJ18X is not set
438CONFIG_PCMCIA_PCNET=y
439# CONFIG_PCMCIA_NMCLAN is not set
440# CONFIG_PCMCIA_SMC91C92 is not set
441# CONFIG_PCMCIA_XIRC2PS is not set
442# CONFIG_PCMCIA_AXNET is not set
443
444#
445# Wan interfaces
446#
447# CONFIG_WAN is not set
448# CONFIG_PPP is not set
449# CONFIG_SLIP is not set
450# CONFIG_SHAPER is not set
451# CONFIG_NETCONSOLE is not set
452
453#
454# ISDN subsystem
455#
456# CONFIG_ISDN is not set
457
458#
459# Input device support
460#
461CONFIG_INPUT=y
462
463#
464# Userland interfaces
465#
466CONFIG_INPUT_MOUSEDEV=y
467CONFIG_INPUT_MOUSEDEV_PSAUX=y
468CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
469CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
470# CONFIG_INPUT_JOYDEV is not set
471# CONFIG_INPUT_TSDEV is not set
472# CONFIG_INPUT_EVDEV is not set
473# CONFIG_INPUT_EVBUG is not set
474
475#
476# Input Device Drivers
477#
478CONFIG_INPUT_KEYBOARD=y
479CONFIG_KEYBOARD_ATKBD=y
480# CONFIG_KEYBOARD_SUNKBD is not set
481# CONFIG_KEYBOARD_LKKBD is not set
482# CONFIG_KEYBOARD_XTKBD is not set
483# CONFIG_KEYBOARD_NEWTON is not set
484CONFIG_INPUT_MOUSE=y
485CONFIG_MOUSE_PS2=y
486# CONFIG_MOUSE_SERIAL is not set
487# CONFIG_MOUSE_INPORT is not set
488# CONFIG_MOUSE_LOGIBM is not set
489# CONFIG_MOUSE_PC110PAD is not set
490# CONFIG_MOUSE_VSXXXAA is not set
491# CONFIG_INPUT_JOYSTICK is not set
492# CONFIG_INPUT_TOUCHSCREEN is not set
493# CONFIG_INPUT_MISC is not set
494
495#
496# Hardware I/O ports
497#
498CONFIG_SERIO=y
499CONFIG_SERIO_SERPORT=y
500CONFIG_SERIO_LIBPS2=y
501# CONFIG_SERIO_RAW is not set
502# CONFIG_GAMEPORT is not set
503CONFIG_SOUND_GAMEPORT=y
504
505#
506# Character devices
507#
508CONFIG_VT=y
509CONFIG_VT_CONSOLE=y
510CONFIG_HW_CONSOLE=y
511# CONFIG_SERIAL_NONSTANDARD is not set
512
513#
514# Serial drivers
515#
516# CONFIG_SERIAL_8250 is not set
517
518#
519# Non-8250 serial port support
520#
521CONFIG_SERIAL_SA1100=y
522CONFIG_SERIAL_SA1100_CONSOLE=y
523CONFIG_SERIAL_CORE=y
524CONFIG_SERIAL_CORE_CONSOLE=y
525CONFIG_UNIX98_PTYS=y
526CONFIG_LEGACY_PTYS=y
527CONFIG_LEGACY_PTY_COUNT=256
528
529#
530# IPMI
531#
532# CONFIG_IPMI_HANDLER is not set
533
534#
535# Watchdog Cards
536#
537# CONFIG_WATCHDOG is not set
538# CONFIG_NVRAM is not set
539# CONFIG_RTC is not set
540# CONFIG_DTLK is not set
541# CONFIG_R3964 is not set
542
543#
544# Ftape, the floppy tape device driver
545#
546# CONFIG_DRM is not set
547
548#
549# PCMCIA character devices
550#
551# CONFIG_SYNCLINK_CS is not set
552# CONFIG_RAW_DRIVER is not set
553
554#
555# TPM devices
556#
557# CONFIG_TCG_TPM is not set
558
559#
560# I2C support
561#
562# CONFIG_I2C is not set
563
564#
565# Misc devices
566#
567
568#
569# Multimedia devices
570#
571# CONFIG_VIDEO_DEV is not set
572
573#
574# Digital Video Broadcasting Devices
575#
576# CONFIG_DVB is not set
577
578#
579# Graphics support
580#
581CONFIG_FB=y
582CONFIG_FB_CFB_FILLRECT=y
583CONFIG_FB_CFB_COPYAREA=y
584CONFIG_FB_CFB_IMAGEBLIT=y
585CONFIG_FB_SOFT_CURSOR=y
586# CONFIG_FB_MODE_HELPERS is not set
587# CONFIG_FB_TILEBLITTING is not set
588CONFIG_FB_SA1100=y
589# CONFIG_FB_VIRTUAL is not set
590
591#
592# Console display driver support
593#
594# CONFIG_VGA_CONSOLE is not set
595# CONFIG_MDA_CONSOLE is not set
596CONFIG_DUMMY_CONSOLE=y
597CONFIG_FRAMEBUFFER_CONSOLE=y
598CONFIG_FONTS=y
599CONFIG_FONT_8x8=y
600# CONFIG_FONT_8x16 is not set
601# CONFIG_FONT_6x11 is not set
602# CONFIG_FONT_PEARL_8x8 is not set
603# CONFIG_FONT_ACORN_8x8 is not set
604# CONFIG_FONT_MINI_4x6 is not set
605# CONFIG_FONT_SUN8x16 is not set
606# CONFIG_FONT_SUN12x22 is not set
607
608#
609# Logo configuration
610#
611# CONFIG_LOGO is not set
612# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
613
614#
615# Sound
616#
617# CONFIG_SOUND is not set
618
619#
620# USB support
621#
622CONFIG_USB_ARCH_HAS_HCD=y
623# CONFIG_USB_ARCH_HAS_OHCI is not set
624# CONFIG_USB is not set
625
626#
627# USB Gadget Support
628#
629# CONFIG_USB_GADGET is not set
630
631#
632# MMC/SD Card support
633#
634# CONFIG_MMC is not set
635
636#
637# File systems
638#
639CONFIG_EXT2_FS=y
640# CONFIG_EXT2_FS_XATTR is not set
641# CONFIG_EXT3_FS is not set
642# CONFIG_JBD is not set
643# CONFIG_REISERFS_FS is not set
644# CONFIG_JFS_FS is not set
645
646#
647# XFS support
648#
649# CONFIG_XFS_FS is not set
650# CONFIG_MINIX_FS is not set
651# CONFIG_ROMFS_FS is not set
652# CONFIG_QUOTA is not set
653CONFIG_DNOTIFY=y
654# CONFIG_AUTOFS_FS is not set
655# CONFIG_AUTOFS4_FS is not set
656
657#
658# CD-ROM/DVD Filesystems
659#
660# CONFIG_ISO9660_FS is not set
661# CONFIG_UDF_FS is not set
662
663#
664# DOS/FAT/NT Filesystems
665#
666CONFIG_FAT_FS=y
667CONFIG_MSDOS_FS=y
668# CONFIG_VFAT_FS is not set
669CONFIG_FAT_DEFAULT_CODEPAGE=437
670# CONFIG_NTFS_FS is not set
671
672#
673# Pseudo filesystems
674#
675CONFIG_PROC_FS=y
676CONFIG_SYSFS=y
677# CONFIG_DEVFS_FS is not set
678# CONFIG_DEVPTS_FS_XATTR is not set
679# CONFIG_TMPFS is not set
680# CONFIG_HUGETLB_PAGE is not set
681CONFIG_RAMFS=y
682
683#
684# Miscellaneous filesystems
685#
686# CONFIG_ADFS_FS is not set
687# CONFIG_AFFS_FS is not set
688# CONFIG_HFS_FS is not set
689# CONFIG_HFSPLUS_FS is not set
690# CONFIG_BEFS_FS is not set
691# CONFIG_BFS_FS is not set
692# CONFIG_EFS_FS is not set
693# CONFIG_CRAMFS is not set
694# CONFIG_VXFS_FS is not set
695# CONFIG_HPFS_FS is not set
696# CONFIG_QNX4FS_FS is not set
697# CONFIG_SYSV_FS is not set
698# CONFIG_UFS_FS is not set
699
700#
701# Network File Systems
702#
703CONFIG_NFS_FS=y
704# CONFIG_NFS_V3 is not set
705# CONFIG_NFS_V4 is not set
706# CONFIG_NFS_DIRECTIO is not set
707# CONFIG_NFSD is not set
708CONFIG_LOCKD=y
709CONFIG_SUNRPC=y
710# CONFIG_RPCSEC_GSS_KRB5 is not set
711# CONFIG_RPCSEC_GSS_SPKM3 is not set
712# CONFIG_SMB_FS is not set
713# CONFIG_CIFS is not set
714# CONFIG_NCP_FS is not set
715# CONFIG_CODA_FS is not set
716# CONFIG_AFS_FS is not set
717
718#
719# Partition Types
720#
721# CONFIG_PARTITION_ADVANCED is not set
722CONFIG_MSDOS_PARTITION=y
723
724#
725# Native Language Support
726#
727CONFIG_NLS=y
728CONFIG_NLS_DEFAULT="iso8859-1"
729# CONFIG_NLS_CODEPAGE_437 is not set
730# CONFIG_NLS_CODEPAGE_737 is not set
731# CONFIG_NLS_CODEPAGE_775 is not set
732# CONFIG_NLS_CODEPAGE_850 is not set
733# CONFIG_NLS_CODEPAGE_852 is not set
734# CONFIG_NLS_CODEPAGE_855 is not set
735# CONFIG_NLS_CODEPAGE_857 is not set
736# CONFIG_NLS_CODEPAGE_860 is not set
737# CONFIG_NLS_CODEPAGE_861 is not set
738# CONFIG_NLS_CODEPAGE_862 is not set
739# CONFIG_NLS_CODEPAGE_863 is not set
740# CONFIG_NLS_CODEPAGE_864 is not set
741# CONFIG_NLS_CODEPAGE_865 is not set
742# CONFIG_NLS_CODEPAGE_866 is not set
743# CONFIG_NLS_CODEPAGE_869 is not set
744# CONFIG_NLS_CODEPAGE_936 is not set
745# CONFIG_NLS_CODEPAGE_950 is not set
746# CONFIG_NLS_CODEPAGE_932 is not set
747# CONFIG_NLS_CODEPAGE_949 is not set
748# CONFIG_NLS_CODEPAGE_874 is not set
749# CONFIG_NLS_ISO8859_8 is not set
750# CONFIG_NLS_CODEPAGE_1250 is not set
751# CONFIG_NLS_CODEPAGE_1251 is not set
752# CONFIG_NLS_ASCII is not set
753# CONFIG_NLS_ISO8859_1 is not set
754# CONFIG_NLS_ISO8859_2 is not set
755# CONFIG_NLS_ISO8859_3 is not set
756# CONFIG_NLS_ISO8859_4 is not set
757# CONFIG_NLS_ISO8859_5 is not set
758# CONFIG_NLS_ISO8859_6 is not set
759# CONFIG_NLS_ISO8859_7 is not set
760# CONFIG_NLS_ISO8859_9 is not set
761# CONFIG_NLS_ISO8859_13 is not set
762# CONFIG_NLS_ISO8859_14 is not set
763# CONFIG_NLS_ISO8859_15 is not set
764# CONFIG_NLS_KOI8_R is not set
765# CONFIG_NLS_KOI8_U is not set
766# CONFIG_NLS_UTF8 is not set
767
768#
769# Profiling support
770#
771# CONFIG_PROFILING is not set
772
773#
774# Kernel hacking
775#
776# CONFIG_PRINTK_TIME is not set
777# CONFIG_DEBUG_KERNEL is not set
778CONFIG_LOG_BUF_SHIFT=14
779CONFIG_DEBUG_BUGVERBOSE=y
780CONFIG_FRAME_POINTER=y
781# CONFIG_DEBUG_USER is not set
782
783#
784# Security options
785#
786# CONFIG_KEYS is not set
787# CONFIG_SECURITY is not set
788
789#
790# Cryptographic options
791#
792# CONFIG_CRYPTO is not set
793
794#
795# Hardware crypto devices
796#
797
798#
799# Library routines
800#
801# CONFIG_CRC_CCITT is not set
802CONFIG_CRC32=y
803# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 4c38bd8bc298..b713c44c6fb4 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -30,9 +30,6 @@ extern void __lshrdi3(void);
30extern void __modsi3(void); 30extern void __modsi3(void);
31extern void __muldi3(void); 31extern void __muldi3(void);
32extern void __ucmpdi2(void); 32extern void __ucmpdi2(void);
33extern void __udivdi3(void);
34extern void __umoddi3(void);
35extern void __udivmoddi4(void);
36extern void __udivsi3(void); 33extern void __udivsi3(void);
37extern void __umodsi3(void); 34extern void __umodsi3(void);
38extern void __do_div64(void); 35extern void __do_div64(void);
@@ -134,9 +131,6 @@ EXPORT_SYMBOL(__lshrdi3);
134EXPORT_SYMBOL(__modsi3); 131EXPORT_SYMBOL(__modsi3);
135EXPORT_SYMBOL(__muldi3); 132EXPORT_SYMBOL(__muldi3);
136EXPORT_SYMBOL(__ucmpdi2); 133EXPORT_SYMBOL(__ucmpdi2);
137EXPORT_SYMBOL(__udivdi3);
138EXPORT_SYMBOL(__umoddi3);
139EXPORT_SYMBOL(__udivmoddi4);
140EXPORT_SYMBOL(__udivsi3); 134EXPORT_SYMBOL(__udivsi3);
141EXPORT_SYMBOL(__umodsi3); 135EXPORT_SYMBOL(__umodsi3);
142EXPORT_SYMBOL(__do_div64); 136EXPORT_SYMBOL(__do_div64);
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index bd4823c74645..1155cf07c871 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -344,9 +344,9 @@ __create_page_tables:
344 str r6, [r0] 344 str r6, [r0]
345#endif 345#endif
346 346
347#ifdef CONFIG_DEBUG_LL
347 bic r7, r7, #0x0c @ turn off cacheable 348 bic r7, r7, #0x0c @ turn off cacheable
348 @ and bufferable bits 349 @ and bufferable bits
349#ifdef CONFIG_DEBUG_LL
350 /* 350 /*
351 * Map in IO space for serial debugging. 351 * Map in IO space for serial debugging.
352 * This allows debug messages to be output 352 * This allows debug messages to be output
@@ -372,28 +372,24 @@ __create_page_tables:
372 teq r1, #MACH_TYPE_NETWINDER 372 teq r1, #MACH_TYPE_NETWINDER
373 teqne r1, #MACH_TYPE_CATS 373 teqne r1, #MACH_TYPE_CATS
374 bne 1f 374 bne 1f
375 add r0, r4, #0x3fc0 @ ff000000 375 add r0, r4, #0xff000000 >> 18
376 mov r3, #0x7c000000 376 orr r3, r7, #0x7c000000
377 orr r3, r3, r7 377 str r3, [r0]
378 str r3, [r0], #4
379 add r3, r3, #1 << 20
380 str r3, [r0], #4
3811: 3781:
382#endif 379#endif
383#endif
384#ifdef CONFIG_ARCH_RPC 380#ifdef CONFIG_ARCH_RPC
385 /* 381 /*
386 * Map in screen at 0x02000000 & SCREEN2_BASE 382 * Map in screen at 0x02000000 & SCREEN2_BASE
387 * Similar reasons here - for debug. This is 383 * Similar reasons here - for debug. This is
388 * only for Acorn RiscPC architectures. 384 * only for Acorn RiscPC architectures.
389 */ 385 */
390 add r0, r4, #0x80 @ 02000000 386 add r0, r4, #0x02000000 >> 18
391 mov r3, #0x02000000 387 orr r3, r7, #0x02000000
392 orr r3, r3, r7
393 str r3, [r0] 388 str r3, [r0]
394 add r0, r4, #0x3600 @ d8000000 389 add r0, r4, #0xd8000000 >> 18
395 str r3, [r0] 390 str r3, [r0]
396#endif 391#endif
392#endif
397 mov pc, lr 393 mov pc, lr
398 .ltorg 394 .ltorg
399 395
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 8f146a4b4752..bbea636ff687 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -32,6 +32,7 @@
32#include <asm/leds.h> 32#include <asm/leds.h>
33#include <asm/processor.h> 33#include <asm/processor.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35#include <asm/mach/time.h>
35 36
36extern const char *processor_modes[]; 37extern const char *processor_modes[];
37extern void setup_mm_for_reboot(char mode); 38extern void setup_mm_for_reboot(char mode);
@@ -85,8 +86,10 @@ EXPORT_SYMBOL(pm_power_off);
85void default_idle(void) 86void default_idle(void)
86{ 87{
87 local_irq_disable(); 88 local_irq_disable();
88 if (!need_resched() && !hlt_counter) 89 if (!need_resched() && !hlt_counter) {
90 timer_dyn_reprogram();
89 arch_idle(); 91 arch_idle();
92 }
90 local_irq_enable(); 93 local_irq_enable();
91} 94}
92 95
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 8cf733daa800..c9b69771f92e 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -359,7 +359,8 @@ void cpu_init(void)
359 "I" (offsetof(struct stack, abt[0])), 359 "I" (offsetof(struct stack, abt[0])),
360 "I" (PSR_F_BIT | PSR_I_BIT | UND_MODE), 360 "I" (PSR_F_BIT | PSR_I_BIT | UND_MODE),
361 "I" (offsetof(struct stack, und[0])), 361 "I" (offsetof(struct stack, und[0])),
362 "I" (PSR_F_BIT | PSR_I_BIT | SVC_MODE)); 362 "I" (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
363 : "r14");
363} 364}
364 365
365static struct machine_desc * __init setup_machine(unsigned int nr) 366static struct machine_desc * __init setup_machine(unsigned int nr)
@@ -736,8 +737,8 @@ void __init setup_arch(char **cmdline_p)
736 if (mdesc->soft_reboot) 737 if (mdesc->soft_reboot)
737 reboot_setup("s"); 738 reboot_setup("s");
738 739
739 if (mdesc->param_offset) 740 if (mdesc->boot_params)
740 tags = phys_to_virt(mdesc->param_offset); 741 tags = phys_to_virt(mdesc->boot_params);
741 742
742 /* 743 /*
743 * If we have the old style parameters, convert them to 744 * If we have the old style parameters, convert them to
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 34892758f098..a931409c8fe4 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -502,3 +502,126 @@ int __init setup_profiling_timer(unsigned int multiplier)
502{ 502{
503 return -EINVAL; 503 return -EINVAL;
504} 504}
505
506static int
507on_each_cpu_mask(void (*func)(void *), void *info, int retry, int wait,
508 cpumask_t mask)
509{
510 int ret = 0;
511
512 preempt_disable();
513
514 ret = smp_call_function_on_cpu(func, info, retry, wait, mask);
515 if (cpu_isset(smp_processor_id(), mask))
516 func(info);
517
518 preempt_enable();
519
520 return ret;
521}
522
523/**********************************************************************/
524
525/*
526 * TLB operations
527 */
528struct tlb_args {
529 struct vm_area_struct *ta_vma;
530 unsigned long ta_start;
531 unsigned long ta_end;
532};
533
534static inline void ipi_flush_tlb_all(void *ignored)
535{
536 local_flush_tlb_all();
537}
538
539static inline void ipi_flush_tlb_mm(void *arg)
540{
541 struct mm_struct *mm = (struct mm_struct *)arg;
542
543 local_flush_tlb_mm(mm);
544}
545
546static inline void ipi_flush_tlb_page(void *arg)
547{
548 struct tlb_args *ta = (struct tlb_args *)arg;
549
550 local_flush_tlb_page(ta->ta_vma, ta->ta_start);
551}
552
553static inline void ipi_flush_tlb_kernel_page(void *arg)
554{
555 struct tlb_args *ta = (struct tlb_args *)arg;
556
557 local_flush_tlb_kernel_page(ta->ta_start);
558}
559
560static inline void ipi_flush_tlb_range(void *arg)
561{
562 struct tlb_args *ta = (struct tlb_args *)arg;
563
564 local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end);
565}
566
567static inline void ipi_flush_tlb_kernel_range(void *arg)
568{
569 struct tlb_args *ta = (struct tlb_args *)arg;
570
571 local_flush_tlb_kernel_range(ta->ta_start, ta->ta_end);
572}
573
574void flush_tlb_all(void)
575{
576 on_each_cpu(ipi_flush_tlb_all, NULL, 1, 1);
577}
578
579void flush_tlb_mm(struct mm_struct *mm)
580{
581 cpumask_t mask = mm->cpu_vm_mask;
582
583 on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, 1, mask);
584}
585
586void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
587{
588 cpumask_t mask = vma->vm_mm->cpu_vm_mask;
589 struct tlb_args ta;
590
591 ta.ta_vma = vma;
592 ta.ta_start = uaddr;
593
594 on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, 1, mask);
595}
596
597void flush_tlb_kernel_page(unsigned long kaddr)
598{
599 struct tlb_args ta;
600
601 ta.ta_start = kaddr;
602
603 on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1, 1);
604}
605
606void flush_tlb_range(struct vm_area_struct *vma,
607 unsigned long start, unsigned long end)
608{
609 cpumask_t mask = vma->vm_mm->cpu_vm_mask;
610 struct tlb_args ta;
611
612 ta.ta_vma = vma;
613 ta.ta_start = start;
614 ta.ta_end = end;
615
616 on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, 1, mask);
617}
618
619void flush_tlb_kernel_range(unsigned long start, unsigned long end)
620{
621 struct tlb_args ta;
622
623 ta.ta_start = start;
624 ta.ta_end = end;
625
626 on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1, 1);
627}
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 06054c9ba074..1b7fcd50c3e2 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -424,15 +424,19 @@ static int timer_dyn_tick_disable(void)
424 return ret; 424 return ret;
425} 425}
426 426
427/*
428 * Reprogram the system timer for at least the calculated time interval.
429 * This function should be called from the idle thread with IRQs disabled,
430 * immediately before sleeping.
431 */
427void timer_dyn_reprogram(void) 432void timer_dyn_reprogram(void)
428{ 433{
429 struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick; 434 struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick;
430 unsigned long flags;
431 435
432 write_seqlock_irqsave(&xtime_lock, flags); 436 write_seqlock(&xtime_lock);
433 if (dyn_tick->state & DYN_TICK_ENABLED) 437 if (dyn_tick->state & DYN_TICK_ENABLED)
434 dyn_tick->reprogram(next_timer_interrupt() - jiffies); 438 dyn_tick->reprogram(next_timer_interrupt() - jiffies);
435 write_sequnlock_irqrestore(&xtime_lock, flags); 439 write_sequnlock(&xtime_lock);
436} 440}
437 441
438static ssize_t timer_show_dyn_tick(struct sys_device *dev, char *buf) 442static ssize_t timer_show_dyn_tick(struct sys_device *dev, char *buf)
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 2fb0a4cfb37a..df2cb06ce424 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -230,16 +230,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
230 do_exit(SIGSEGV); 230 do_exit(SIGSEGV);
231} 231}
232 232
233void die_if_kernel(const char *str, struct pt_regs *regs, int err) 233void notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
234{ 234 unsigned long err, unsigned long trap)
235 if (user_mode(regs))
236 return;
237
238 die(str, regs, err);
239}
240
241static void notify_die(const char *str, struct pt_regs *regs, siginfo_t *info,
242 unsigned long err, unsigned long trap)
243{ 235{
244 if (user_mode(regs)) { 236 if (user_mode(regs)) {
245 current->thread.error_code = err; 237 current->thread.error_code = err;
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index c0e65833ffc4..8725d63e4219 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -11,7 +11,7 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
11 strnlen_user.o strchr.o strrchr.o testchangebit.o \ 11 strnlen_user.o strchr.o strrchr.o testchangebit.o \
12 testclearbit.o testsetbit.o uaccess.o getuser.o \ 12 testclearbit.o testsetbit.o uaccess.o getuser.o \
13 putuser.o ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ 13 putuser.o ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
14 ucmpdi2.o udivdi3.o lib1funcs.o div64.o \ 14 ucmpdi2.o lib1funcs.o div64.o \
15 io-readsb.o io-writesb.o io-readsl.o io-writesl.o 15 io-readsb.o io-writesb.o io-readsl.o io-writesl.o
16 16
17ifeq ($(CONFIG_CPU_32v3),y) 17ifeq ($(CONFIG_CPU_32v3),y)
diff --git a/arch/arm/lib/longlong.h b/arch/arm/lib/longlong.h
deleted file mode 100644
index 90ae647e4d76..000000000000
--- a/arch/arm/lib/longlong.h
+++ /dev/null
@@ -1,183 +0,0 @@
1/* longlong.h -- based on code from gcc-2.95.3
2
3 definitions for mixed size 32/64 bit arithmetic.
4 Copyright (C) 1991, 92, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
5
6 This definition file is free software; you can redistribute it
7 and/or modify it under the terms of the GNU General Public
8 License as published by the Free Software Foundation; either
9 version 2, or (at your option) any later version.
10
11 This definition file is distributed in the hope that it will be
12 useful, but WITHOUT ANY WARRANTY; without even the implied
13 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 See the GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21/* Borrowed from GCC 2.95.3, I Molton 29/07/01 */
22
23#ifndef SI_TYPE_SIZE
24#define SI_TYPE_SIZE 32
25#endif
26
27#define __BITS4 (SI_TYPE_SIZE / 4)
28#define __ll_B (1L << (SI_TYPE_SIZE / 2))
29#define __ll_lowpart(t) ((u32) (t) % __ll_B)
30#define __ll_highpart(t) ((u32) (t) / __ll_B)
31
32/* Define auxiliary asm macros.
33
34 1) umul_ppmm(high_prod, low_prod, multipler, multiplicand)
35 multiplies two u32 integers MULTIPLER and MULTIPLICAND,
36 and generates a two-part u32 product in HIGH_PROD and
37 LOW_PROD.
38
39 2) __umulsidi3(a,b) multiplies two u32 integers A and B,
40 and returns a u64 product. This is just a variant of umul_ppmm.
41
42 3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
43 denominator) divides a two-word unsigned integer, composed by the
44 integers HIGH_NUMERATOR and LOW_NUMERATOR, by DENOMINATOR and
45 places the quotient in QUOTIENT and the remainder in REMAINDER.
46 HIGH_NUMERATOR must be less than DENOMINATOR for correct operation.
47 If, in addition, the most significant bit of DENOMINATOR must be 1,
48 then the pre-processor symbol UDIV_NEEDS_NORMALIZATION is defined to 1.
49
50 4) sdiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
51 denominator). Like udiv_qrnnd but the numbers are signed. The
52 quotient is rounded towards 0.
53
54 5) count_leading_zeros(count, x) counts the number of zero-bits from
55 the msb to the first non-zero bit. This is the number of steps X
56 needs to be shifted left to set the msb. Undefined for X == 0.
57
58 6) add_ssaaaa(high_sum, low_sum, high_addend_1, low_addend_1,
59 high_addend_2, low_addend_2) adds two two-word unsigned integers,
60 composed by HIGH_ADDEND_1 and LOW_ADDEND_1, and HIGH_ADDEND_2 and
61 LOW_ADDEND_2 respectively. The result is placed in HIGH_SUM and
62 LOW_SUM. Overflow (i.e. carry out) is not stored anywhere, and is
63 lost.
64
65 7) sub_ddmmss(high_difference, low_difference, high_minuend,
66 low_minuend, high_subtrahend, low_subtrahend) subtracts two
67 two-word unsigned integers, composed by HIGH_MINUEND_1 and
68 LOW_MINUEND_1, and HIGH_SUBTRAHEND_2 and LOW_SUBTRAHEND_2
69 respectively. The result is placed in HIGH_DIFFERENCE and
70 LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere,
71 and is lost.
72
73 If any of these macros are left undefined for a particular CPU,
74 C macros are used. */
75
76#if defined (__arm__)
77#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
78 __asm__ ("adds %1, %4, %5 \n\
79 adc %0, %2, %3" \
80 : "=r" ((u32) (sh)), \
81 "=&r" ((u32) (sl)) \
82 : "%r" ((u32) (ah)), \
83 "rI" ((u32) (bh)), \
84 "%r" ((u32) (al)), \
85 "rI" ((u32) (bl)))
86#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
87 __asm__ ("subs %1, %4, %5 \n\
88 sbc %0, %2, %3" \
89 : "=r" ((u32) (sh)), \
90 "=&r" ((u32) (sl)) \
91 : "r" ((u32) (ah)), \
92 "rI" ((u32) (bh)), \
93 "r" ((u32) (al)), \
94 "rI" ((u32) (bl)))
95#define umul_ppmm(xh, xl, a, b) \
96{register u32 __t0, __t1, __t2; \
97 __asm__ ("%@ Inlined umul_ppmm \n\
98 mov %2, %5, lsr #16 \n\
99 mov %0, %6, lsr #16 \n\
100 bic %3, %5, %2, lsl #16 \n\
101 bic %4, %6, %0, lsl #16 \n\
102 mul %1, %3, %4 \n\
103 mul %4, %2, %4 \n\
104 mul %3, %0, %3 \n\
105 mul %0, %2, %0 \n\
106 adds %3, %4, %3 \n\
107 addcs %0, %0, #65536 \n\
108 adds %1, %1, %3, lsl #16 \n\
109 adc %0, %0, %3, lsr #16" \
110 : "=&r" ((u32) (xh)), \
111 "=r" ((u32) (xl)), \
112 "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \
113 : "r" ((u32) (a)), \
114 "r" ((u32) (b)));}
115#define UMUL_TIME 20
116#define UDIV_TIME 100
117#endif /* __arm__ */
118
119#define __umulsidi3(u, v) \
120 ({DIunion __w; \
121 umul_ppmm (__w.s.high, __w.s.low, u, v); \
122 __w.ll; })
123
124#define __udiv_qrnnd_c(q, r, n1, n0, d) \
125 do { \
126 u32 __d1, __d0, __q1, __q0; \
127 u32 __r1, __r0, __m; \
128 __d1 = __ll_highpart (d); \
129 __d0 = __ll_lowpart (d); \
130 \
131 __r1 = (n1) % __d1; \
132 __q1 = (n1) / __d1; \
133 __m = (u32) __q1 * __d0; \
134 __r1 = __r1 * __ll_B | __ll_highpart (n0); \
135 if (__r1 < __m) \
136 { \
137 __q1--, __r1 += (d); \
138 if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\
139 if (__r1 < __m) \
140 __q1--, __r1 += (d); \
141 } \
142 __r1 -= __m; \
143 \
144 __r0 = __r1 % __d1; \
145 __q0 = __r1 / __d1; \
146 __m = (u32) __q0 * __d0; \
147 __r0 = __r0 * __ll_B | __ll_lowpart (n0); \
148 if (__r0 < __m) \
149 { \
150 __q0--, __r0 += (d); \
151 if (__r0 >= (d)) \
152 if (__r0 < __m) \
153 __q0--, __r0 += (d); \
154 } \
155 __r0 -= __m; \
156 \
157 (q) = (u32) __q1 * __ll_B | __q0; \
158 (r) = __r0; \
159 } while (0)
160
161#define UDIV_NEEDS_NORMALIZATION 1
162#define udiv_qrnnd __udiv_qrnnd_c
163
164#define count_leading_zeros(count, x) \
165 do { \
166 u32 __xr = (x); \
167 u32 __a; \
168 \
169 if (SI_TYPE_SIZE <= 32) \
170 { \
171 __a = __xr < ((u32)1<<2*__BITS4) \
172 ? (__xr < ((u32)1<<__BITS4) ? 0 : __BITS4) \
173 : (__xr < ((u32)1<<3*__BITS4) ? 2*__BITS4 : 3*__BITS4); \
174 } \
175 else \
176 { \
177 for (__a = SI_TYPE_SIZE - 8; __a > 0; __a -= 8) \
178 if (((__xr >> __a) & 0xff) != 0) \
179 break; \
180 } \
181 \
182 (count) = SI_TYPE_SIZE - (__clz_tab[__xr >> __a] + __a); \
183 } while (0)
diff --git a/arch/arm/lib/udivdi3.c b/arch/arm/lib/udivdi3.c
deleted file mode 100644
index e343be4c6642..000000000000
--- a/arch/arm/lib/udivdi3.c
+++ /dev/null
@@ -1,222 +0,0 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33#include "longlong.h"
34
35static const u8 __clz_tab[] = {
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 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,
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,
41 7, 7, 7, 7, 7, 7, 7, 7,
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 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,
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,
52};
53
54u64 __udivmoddi4(u64 n, u64 d, u64 * rp)
55{
56 DIunion ww;
57 DIunion nn, dd;
58 DIunion rr;
59 u32 d0, d1, n0, n1, n2;
60 u32 q0, q1;
61 u32 b, bm;
62
63 nn.ll = n;
64 dd.ll = d;
65
66 d0 = dd.s.low;
67 d1 = dd.s.high;
68 n0 = nn.s.low;
69 n1 = nn.s.high;
70
71 if (d1 == 0) {
72 if (d0 > n1) {
73 /* 0q = nn / 0D */
74
75 count_leading_zeros(bm, d0);
76
77 if (bm != 0) {
78 /* Normalize, i.e. make the most significant bit of the
79 denominator set. */
80
81 d0 = d0 << bm;
82 n1 = (n1 << bm) | (n0 >> (SI_TYPE_SIZE - bm));
83 n0 = n0 << bm;
84 }
85
86 udiv_qrnnd(q0, n0, n1, n0, d0);
87 q1 = 0;
88
89 /* Remainder in n0 >> bm. */
90 } else {
91 /* qq = NN / 0d */
92
93 if (d0 == 0)
94 d0 = 1 / d0; /* Divide intentionally by zero. */
95
96 count_leading_zeros(bm, d0);
97
98 if (bm == 0) {
99 /* From (n1 >= d0) /\ (the most significant bit of d0 is set),
100 conclude (the most significant bit of n1 is set) /\ (the
101 leading quotient digit q1 = 1).
102
103 This special case is necessary, not an optimization.
104 (Shifts counts of SI_TYPE_SIZE are undefined.) */
105
106 n1 -= d0;
107 q1 = 1;
108 } else {
109 /* Normalize. */
110
111 b = SI_TYPE_SIZE - bm;
112
113 d0 = d0 << bm;
114 n2 = n1 >> b;
115 n1 = (n1 << bm) | (n0 >> b);
116 n0 = n0 << bm;
117
118 udiv_qrnnd(q1, n1, n2, n1, d0);
119 }
120
121 /* n1 != d0... */
122
123 udiv_qrnnd(q0, n0, n1, n0, d0);
124
125 /* Remainder in n0 >> bm. */
126 }
127
128 if (rp != 0) {
129 rr.s.low = n0 >> bm;
130 rr.s.high = 0;
131 *rp = rr.ll;
132 }
133 } else {
134 if (d1 > n1) {
135 /* 00 = nn / DD */
136
137 q0 = 0;
138 q1 = 0;
139
140 /* Remainder in n1n0. */
141 if (rp != 0) {
142 rr.s.low = n0;
143 rr.s.high = n1;
144 *rp = rr.ll;
145 }
146 } else {
147 /* 0q = NN / dd */
148
149 count_leading_zeros(bm, d1);
150 if (bm == 0) {
151 /* From (n1 >= d1) /\ (the most significant bit of d1 is set),
152 conclude (the most significant bit of n1 is set) /\ (the
153 quotient digit q0 = 0 or 1).
154
155 This special case is necessary, not an optimization. */
156
157 /* The condition on the next line takes advantage of that
158 n1 >= d1 (true due to program flow). */
159 if (n1 > d1 || n0 >= d0) {
160 q0 = 1;
161 sub_ddmmss(n1, n0, n1, n0, d1, d0);
162 } else
163 q0 = 0;
164
165 q1 = 0;
166
167 if (rp != 0) {
168 rr.s.low = n0;
169 rr.s.high = n1;
170 *rp = rr.ll;
171 }
172 } else {
173 u32 m1, m0;
174 /* Normalize. */
175
176 b = SI_TYPE_SIZE - bm;
177
178 d1 = (d1 << bm) | (d0 >> b);
179 d0 = d0 << bm;
180 n2 = n1 >> b;
181 n1 = (n1 << bm) | (n0 >> b);
182 n0 = n0 << bm;
183
184 udiv_qrnnd(q0, n1, n2, n1, d1);
185 umul_ppmm(m1, m0, q0, d0);
186
187 if (m1 > n1 || (m1 == n1 && m0 > n0)) {
188 q0--;
189 sub_ddmmss(m1, m0, m1, m0, d1, d0);
190 }
191
192 q1 = 0;
193
194 /* Remainder in (n1n0 - m1m0) >> bm. */
195 if (rp != 0) {
196 sub_ddmmss(n1, n0, n1, n0, m1, m0);
197 rr.s.low = (n1 << b) | (n0 >> bm);
198 rr.s.high = n1 >> bm;
199 *rp = rr.ll;
200 }
201 }
202 }
203 }
204
205 ww.s.low = q0;
206 ww.s.high = q1;
207 return ww.ll;
208}
209
210u64 __udivdi3(u64 n, u64 d)
211{
212 return __udivmoddi4(n, d, (u64 *) 0);
213}
214
215u64 __umoddi3(u64 u, u64 v)
216{
217 u64 w;
218
219 (void)__udivmoddi4(u, v, &w);
220
221 return w;
222}
diff --git a/arch/arm/mach-aaec2000/Makefile.boot b/arch/arm/mach-aaec2000/Makefile.boot
new file mode 100644
index 000000000000..8f5a8b7c53c7
--- /dev/null
+++ b/arch/arm/mach-aaec2000/Makefile.boot
@@ -0,0 +1 @@
zreladdr-y := 0xf0008000
diff --git a/arch/arm/mach-aaec2000/aaed2000.c b/arch/arm/mach-aaec2000/aaed2000.c
index 5417ca3f4621..c9d899886648 100644
--- a/arch/arm/mach-aaec2000/aaed2000.c
+++ b/arch/arm/mach-aaec2000/aaed2000.c
@@ -40,9 +40,11 @@ static void __init aaed2000_map_io(void)
40} 40}
41 41
42MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform") 42MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform")
43 MAINTAINER("Nicolas Bellido Y Ortega") 43 /* Maintainer: Nicolas Bellido Y Ortega */
44 BOOT_MEM(0xf0000000, PIO_BASE, VIO_BASE) 44 .phys_ram = 0xf0000000,
45 MAPIO(aaed2000_map_io) 45 .phys_io = PIO_BASE,
46 INITIRQ(aaed2000_init_irq) 46 .io_pg_offst = ((VIO_BASE) >> 18) & 0xfffc,
47 .map_io = aaed2000_map_io,
48 .init_irq = aaed2000_init_irq,
47 .timer = &aaec2000_timer, 49 .timer = &aaec2000_timer,
48MACHINE_END 50MACHINE_END
diff --git a/arch/arm/mach-aaec2000/core.c b/arch/arm/mach-aaec2000/core.c
index fc145b3768fa..aece0cd4f0a3 100644
--- a/arch/arm/mach-aaec2000/core.c
+++ b/arch/arm/mach-aaec2000/core.c
@@ -128,8 +128,8 @@ aaec2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
128 128
129static struct irqaction aaec2000_timer_irq = { 129static struct irqaction aaec2000_timer_irq = {
130 .name = "AAEC-2000 Timer Tick", 130 .name = "AAEC-2000 Timer Tick",
131 .flags = SA_INTERRUPT, 131 .flags = SA_INTERRUPT | SA_TIMER,
132 .handler = aaec2000_timer_interrupt 132 .handler = aaec2000_timer_interrupt,
133}; 133};
134 134
135static void __init aaec2000_timer_init(void) 135static void __init aaec2000_timer_init(void)
diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c
index c106704a2c34..dc73feb1ffb0 100644
--- a/arch/arm/mach-clps711x/autcpu12.c
+++ b/arch/arm/mach-clps711x/autcpu12.c
@@ -59,11 +59,13 @@ void __init autcpu12_map_io(void)
59} 59}
60 60
61MACHINE_START(AUTCPU12, "autronix autcpu12") 61MACHINE_START(AUTCPU12, "autronix autcpu12")
62 MAINTAINER("Thomas Gleixner") 62 /* Maintainer: Thomas Gleixner */
63 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 63 .phys_ram = 0xc0000000,
64 BOOT_PARAMS(0xc0020000) 64 .phys_io = 0x80000000,
65 MAPIO(autcpu12_map_io) 65 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
66 INITIRQ(clps711x_init_irq) 66 .boot_params = 0xc0020000,
67 .map_io = autcpu12_map_io,
68 .init_irq = clps711x_init_irq,
67 .timer = &clps711x_timer, 69 .timer = &clps711x_timer,
68MACHINE_END 70MACHINE_END
69 71
diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c
index 7664f9cf83b8..a46c82cd2711 100644
--- a/arch/arm/mach-clps711x/cdb89712.c
+++ b/arch/arm/mach-clps711x/cdb89712.c
@@ -49,10 +49,12 @@ static void __init cdb89712_map_io(void)
49} 49}
50 50
51MACHINE_START(CDB89712, "Cirrus-CDB89712") 51MACHINE_START(CDB89712, "Cirrus-CDB89712")
52 MAINTAINER("Ray Lehtiniemi") 52 /* Maintainer: Ray Lehtiniemi */
53 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 53 .phys_ram = 0xc0000000,
54 BOOT_PARAMS(0xc0000100) 54 .phys_io = 0x80000000,
55 MAPIO(cdb89712_map_io) 55 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
56 INITIRQ(clps711x_init_irq) 56 .boot_params = 0xc0000100,
57 .map_io = cdb89712_map_io,
58 .init_irq = clps711x_init_irq,
57 .timer = &clps711x_timer, 59 .timer = &clps711x_timer,
58MACHINE_END 60MACHINE_END
diff --git a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c
index e4093be3c4cb..780d91805984 100644
--- a/arch/arm/mach-clps711x/ceiva.c
+++ b/arch/arm/mach-clps711x/ceiva.c
@@ -53,10 +53,12 @@ static void __init ceiva_map_io(void)
53 53
54 54
55MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame") 55MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame")
56 MAINTAINER("Rob Scott") 56 /* Maintainer: Rob Scott */
57 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 57 .phys_ram = 0xc0000000,
58 BOOT_PARAMS(0xc0000100) 58 .phys_io = 0x80000000,
59 MAPIO(ceiva_map_io) 59 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
60 INITIRQ(clps711x_init_irq) 60 .boot_params = 0xc0000100,
61 .map_io = ceiva_map_io,
62 .init_irq = clps711x_init_irq,
61 .timer = &clps711x_timer, 63 .timer = &clps711x_timer,
62MACHINE_END 64MACHINE_END
diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c
index 9ca21cb481ba..c83f3fd68fcd 100644
--- a/arch/arm/mach-clps711x/clep7312.c
+++ b/arch/arm/mach-clps711x/clep7312.c
@@ -37,12 +37,14 @@ fixup_clep7312(struct machine_desc *desc, struct tag *tags,
37 37
38 38
39MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312") 39MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
40 MAINTAINER("Nobody") 40 /* Maintainer: Nobody */
41 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 41 .phys_ram = 0xc0000000,
42 BOOT_PARAMS(0xc0000100) 42 .phys_io = 0x80000000,
43 FIXUP(fixup_clep7312) 43 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
44 MAPIO(clps711x_map_io) 44 .boot_params = 0xc0000100,
45 INITIRQ(clps711x_init_irq) 45 .fixup = fixup_clep7312,
46 .map_io = clps711x_map_io,
47 .init_irq = clps711x_init_irq,
46 .timer = &clps711x_timer, 48 .timer = &clps711x_timer,
47MACHINE_END 49MACHINE_END
48 50
diff --git a/arch/arm/mach-clps711x/edb7211-arch.c b/arch/arm/mach-clps711x/edb7211-arch.c
index c6c46324a2e3..255c98b63e15 100644
--- a/arch/arm/mach-clps711x/edb7211-arch.c
+++ b/arch/arm/mach-clps711x/edb7211-arch.c
@@ -51,11 +51,13 @@ fixup_edb7211(struct machine_desc *desc, struct tag *tags,
51} 51}
52 52
53MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") 53MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
54 MAINTAINER("Jon McClintock") 54 /* Maintainer: Jon McClintock */
55 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 55 .phys_ram = 0xc0000000,
56 BOOT_PARAMS(0xc0020100) /* 0xc0000000 - 0xc001ffff can be video RAM */ 56 .phys_io = 0x80000000,
57 FIXUP(fixup_edb7211) 57 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
58 MAPIO(edb7211_map_io) 58 .boot_params = 0xc0020100, /* 0xc0000000 - 0xc001ffff can be video RAM */
59 INITIRQ(clps711x_init_irq) 59 .fixup = fixup_edb7211,
60 .map_io = edb7211_map_io,
61 .init_irq = clps711x_init_irq,
60 .timer = &clps711x_timer, 62 .timer = &clps711x_timer,
61MACHINE_END 63MACHINE_END
diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
index c1c5b8e01549..f83a59761e02 100644
--- a/arch/arm/mach-clps711x/fortunet.c
+++ b/arch/arm/mach-clps711x/fortunet.c
@@ -75,11 +75,13 @@ fortunet_fixup(struct machine_desc *desc, struct tag *tags,
75} 75}
76 76
77MACHINE_START(FORTUNET, "ARM-FortuNet") 77MACHINE_START(FORTUNET, "ARM-FortuNet")
78 MAINTAINER("FortuNet Inc.") 78 /* Maintainer: FortuNet Inc. */
79 BOOT_MEM(0xc0000000, 0x80000000, 0xf0000000) 79 .phys_ram = 0xc0000000,
80 BOOT_PARAMS(0x00000000) 80 .phys_io = 0x80000000,
81 FIXUP(fortunet_fixup) 81 .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc,
82 MAPIO(clps711x_map_io) 82 .boot_params = 0x00000000,
83 INITIRQ(clps711x_init_irq) 83 .fixup = fortunet_fixup,
84 .map_io = clps711x_map_io,
85 .init_irq = clps711x_init_irq,
84 .timer = &clps711x_timer, 86 .timer = &clps711x_timer,
85MACHINE_END 87MACHINE_END
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
index 29269df054f5..5bdb90edf992 100644
--- a/arch/arm/mach-clps711x/p720t.c
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -79,12 +79,14 @@ static void __init p720t_map_io(void)
79} 79}
80 80
81MACHINE_START(P720T, "ARM-Prospector720T") 81MACHINE_START(P720T, "ARM-Prospector720T")
82 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") 82 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
83 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 83 .phys_ram = 0xc0000000,
84 BOOT_PARAMS(0xc0000100) 84 .phys_io = 0x80000000,
85 FIXUP(fixup_p720t) 85 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
86 MAPIO(p720t_map_io) 86 .boot_params = 0xc0000100,
87 INITIRQ(clps711x_init_irq) 87 .fixup = fixup_p720t,
88 .map_io = p720t_map_io,
89 .init_irq = clps711x_init_irq,
88 .timer = &clps711x_timer, 90 .timer = &clps711x_timer,
89MACHINE_END 91MACHINE_END
90 92
diff --git a/arch/arm/mach-clps711x/time.c b/arch/arm/mach-clps711x/time.c
index 383d4e0c6e35..1a23f0dcd4b8 100644
--- a/arch/arm/mach-clps711x/time.c
+++ b/arch/arm/mach-clps711x/time.c
@@ -57,8 +57,8 @@ p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
57 57
58static struct irqaction clps711x_timer_irq = { 58static struct irqaction clps711x_timer_irq = {
59 .name = "CLPS711x Timer Tick", 59 .name = "CLPS711x Timer Tick",
60 .flags = SA_INTERRUPT, 60 .flags = SA_INTERRUPT | SA_TIMER,
61 .handler = p720t_timer_interrupt 61 .handler = p720t_timer_interrupt,
62}; 62};
63 63
64static void __init clps711x_timer_init(void) 64static void __init clps711x_timer_init(void)
diff --git a/arch/arm/mach-clps7500/core.c b/arch/arm/mach-clps7500/core.c
index 0bc7da488612..112f1d68fb2b 100644
--- a/arch/arm/mach-clps7500/core.c
+++ b/arch/arm/mach-clps7500/core.c
@@ -298,8 +298,8 @@ clps7500_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
298 298
299static struct irqaction clps7500_timer_irq = { 299static struct irqaction clps7500_timer_irq = {
300 .name = "CLPS7500 Timer Tick", 300 .name = "CLPS7500 Timer Tick",
301 .flags = SA_INTERRUPT, 301 .flags = SA_INTERRUPT | SA_TIMER,
302 .handler = clps7500_timer_interrupt 302 .handler = clps7500_timer_interrupt,
303}; 303};
304 304
305/* 305/*
@@ -366,11 +366,13 @@ static void __init clps7500_init(void)
366} 366}
367 367
368MACHINE_START(CLPS7500, "CL-PS7500") 368MACHINE_START(CLPS7500, "CL-PS7500")
369 MAINTAINER("Philip Blundell") 369 /* Maintainer: Philip Blundell */
370 BOOT_MEM(0x10000000, 0x03000000, 0xe0000000) 370 .phys_ram = 0x10000000,
371 MAPIO(clps7500_map_io) 371 .phys_io = 0x03000000,
372 INITIRQ(clps7500_init_irq) 372 .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
373 .init_machine = clps7500_init, 373 .map_io = clps7500_map_io,
374 .timer = &clps7500_timer, 374 .init_irq = clps7500_init_irq,
375 .init_machine = clps7500_init,
376 .timer = &clps7500_timer,
375MACHINE_END 377MACHINE_END
376 378
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
index ef362d44949d..23c4da10101b 100644
--- a/arch/arm/mach-ebsa110/core.c
+++ b/arch/arm/mach-ebsa110/core.c
@@ -173,8 +173,8 @@ ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
173 173
174static struct irqaction ebsa110_timer_irq = { 174static struct irqaction ebsa110_timer_irq = {
175 .name = "EBSA110 Timer Tick", 175 .name = "EBSA110 Timer Tick",
176 .flags = SA_INTERRUPT, 176 .flags = SA_INTERRUPT | SA_TIMER,
177 .handler = ebsa110_timer_interrupt 177 .handler = ebsa110_timer_interrupt,
178}; 178};
179 179
180/* 180/*
@@ -233,13 +233,15 @@ static int __init ebsa110_init(void)
233arch_initcall(ebsa110_init); 233arch_initcall(ebsa110_init);
234 234
235MACHINE_START(EBSA110, "EBSA110") 235MACHINE_START(EBSA110, "EBSA110")
236 MAINTAINER("Russell King") 236 /* Maintainer: Russell King */
237 BOOT_MEM(0x00000000, 0xe0000000, 0xe0000000) 237 .phys_ram = 0x00000000,
238 BOOT_PARAMS(0x00000400) 238 .phys_io = 0xe0000000,
239 DISABLE_PARPORT(0) 239 .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
240 DISABLE_PARPORT(2) 240 .boot_params = 0x00000400,
241 SOFT_REBOOT 241 .reserve_lp0 = 1,
242 MAPIO(ebsa110_map_io) 242 .reserve_lp2 = 1,
243 INITIRQ(ebsa110_init_irq) 243 .soft_reboot = 1,
244 .map_io = ebsa110_map_io,
245 .init_irq = ebsa110_init_irq,
244 .timer = &ebsa110_timer, 246 .timer = &ebsa110_timer,
245MACHINE_END 247MACHINE_END
diff --git a/arch/arm/mach-epxa10db/arch.c b/arch/arm/mach-epxa10db/arch.c
index 1b40340e8a21..7daa021676d0 100644
--- a/arch/arm/mach-epxa10db/arch.c
+++ b/arch/arm/mach-epxa10db/arch.c
@@ -63,10 +63,12 @@ extern void epxa10db_init_irq(void);
63extern struct sys_timer epxa10db_timer; 63extern struct sys_timer epxa10db_timer;
64 64
65MACHINE_START(CAMELOT, "Altera Epxa10db") 65MACHINE_START(CAMELOT, "Altera Epxa10db")
66 MAINTAINER("Altera Corporation") 66 /* Maintainer: Altera Corporation */
67 BOOT_MEM(0x00000000, 0x7fffc000, 0xffffc000) 67 .phys_ram = 0x00000000,
68 MAPIO(epxa10db_map_io) 68 .phys_io = 0x7fffc000,
69 INITIRQ(epxa10db_init_irq) 69 .io_pg_offst = ((0xffffc000) >> 18) & 0xfffc,
70 .map_io = epxa10db_map_io,
71 .init_irq = epxa10db_init_irq,
70 .timer = &epxa10db_timer, 72 .timer = &epxa10db_timer,
71MACHINE_END 73MACHINE_END
72 74
diff --git a/arch/arm/mach-epxa10db/time.c b/arch/arm/mach-epxa10db/time.c
index 1b991f3cc3c6..4b1084dde8dd 100644
--- a/arch/arm/mach-epxa10db/time.c
+++ b/arch/arm/mach-epxa10db/time.c
@@ -56,8 +56,8 @@ epxa10db_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
56 56
57static struct irqaction epxa10db_timer_irq = { 57static struct irqaction epxa10db_timer_irq = {
58 .name = "Excalibur Timer Tick", 58 .name = "Excalibur Timer Tick",
59 .flags = SA_INTERRUPT, 59 .flags = SA_INTERRUPT | SA_TIMER,
60 .handler = epxa10db_timer_interrupt 60 .handler = epxa10db_timer_interrupt,
61}; 61};
62 62
63/* 63/*
diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c
index d1ced86c379c..49b898af0032 100644
--- a/arch/arm/mach-footbridge/cats-hw.c
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -84,12 +84,14 @@ fixup_cats(struct machine_desc *desc, struct tag *tags,
84} 84}
85 85
86MACHINE_START(CATS, "Chalice-CATS") 86MACHINE_START(CATS, "Chalice-CATS")
87 MAINTAINER("Philip Blundell") 87 /* Maintainer: Philip Blundell */
88 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000) 88 .phys_ram = 0x00000000,
89 BOOT_PARAMS(0x00000100) 89 .phys_io = DC21285_ARMCSR_BASE,
90 SOFT_REBOOT 90 .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc,
91 FIXUP(fixup_cats) 91 .boot_params = 0x00000100,
92 MAPIO(footbridge_map_io) 92 .soft_reboot = 1,
93 INITIRQ(footbridge_init_irq) 93 .fixup = fixup_cats,
94 .map_io = footbridge_map_io,
95 .init_irq = footbridge_init_irq,
94 .timer = &isa_timer, 96 .timer = &isa_timer,
95MACHINE_END 97MACHINE_END
diff --git a/arch/arm/mach-footbridge/co285.c b/arch/arm/mach-footbridge/co285.c
index e1541914fdcd..548a79081688 100644
--- a/arch/arm/mach-footbridge/co285.c
+++ b/arch/arm/mach-footbridge/co285.c
@@ -28,11 +28,13 @@ fixup_coebsa285(struct machine_desc *desc, struct tag *tags,
28} 28}
29 29
30MACHINE_START(CO285, "co-EBSA285") 30MACHINE_START(CO285, "co-EBSA285")
31 MAINTAINER("Mark van Doesburg") 31 /* Maintainer: Mark van Doesburg */
32 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0x7cf00000) 32 .phys_ram = 0x00000000,
33 FIXUP(fixup_coebsa285) 33 .phys_io = DC21285_ARMCSR_BASE,
34 MAPIO(footbridge_map_io) 34 .io_pg_offst = ((0x7cf00000) >> 18) & 0xfffc,
35 INITIRQ(footbridge_init_irq) 35 .fixup = fixup_coebsa285,
36 .map_io = footbridge_map_io,
37 .init_irq = footbridge_init_irq,
36 .timer = &footbridge_timer, 38 .timer = &footbridge_timer,
37MACHINE_END 39MACHINE_END
38 40
diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c
index da5b9b7623ca..14a62d6008fe 100644
--- a/arch/arm/mach-footbridge/dc21285-timer.c
+++ b/arch/arm/mach-footbridge/dc21285-timer.c
@@ -43,7 +43,7 @@ timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
43static struct irqaction footbridge_timer_irq = { 43static struct irqaction footbridge_timer_irq = {
44 .name = "Timer1 timer tick", 44 .name = "Timer1 timer tick",
45 .handler = timer1_interrupt, 45 .handler = timer1_interrupt,
46 .flags = SA_INTERRUPT, 46 .flags = SA_INTERRUPT | SA_TIMER,
47}; 47};
48 48
49/* 49/*
diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c
index d0931f5a63c8..1c37605268d5 100644
--- a/arch/arm/mach-footbridge/ebsa285.c
+++ b/arch/arm/mach-footbridge/ebsa285.c
@@ -13,12 +13,15 @@
13#include "common.h" 13#include "common.h"
14 14
15MACHINE_START(EBSA285, "EBSA285") 15MACHINE_START(EBSA285, "EBSA285")
16 MAINTAINER("Russell King") 16 /* Maintainer: Russell King */
17 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000) 17 .phys_ram = 0x00000000,
18 BOOT_PARAMS(0x00000100) 18 .phys_io = DC21285_ARMCSR_BASE,
19 VIDEO(0x000a0000, 0x000bffff) 19 .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc,
20 MAPIO(footbridge_map_io) 20 .boot_params = 0x00000100,
21 INITIRQ(footbridge_init_irq) 21 .video_start = 0x000a0000,
22 .video_end = 0x000bffff,
23 .map_io = footbridge_map_io,
24 .init_irq = footbridge_init_irq,
22 .timer = &footbridge_timer, 25 .timer = &footbridge_timer,
23MACHINE_END 26MACHINE_END
24 27
diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c
index a4fefa0bb5a1..c1d74f7ab669 100644
--- a/arch/arm/mach-footbridge/isa-timer.c
+++ b/arch/arm/mach-footbridge/isa-timer.c
@@ -72,7 +72,7 @@ isa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
72static struct irqaction isa_timer_irq = { 72static struct irqaction isa_timer_irq = {
73 .name = "ISA timer tick", 73 .name = "ISA timer tick",
74 .handler = isa_timer_interrupt, 74 .handler = isa_timer_interrupt,
75 .flags = SA_INTERRUPT, 75 .flags = SA_INTERRUPT | SA_TIMER,
76}; 76};
77 77
78static void __init isa_timer_init(void) 78static void __init isa_timer_init(void)
diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
index 1e1dfd79f4fe..775f85fc8513 100644
--- a/arch/arm/mach-footbridge/netwinder-hw.c
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -647,14 +647,17 @@ fixup_netwinder(struct machine_desc *desc, struct tag *tags,
647} 647}
648 648
649MACHINE_START(NETWINDER, "Rebel-NetWinder") 649MACHINE_START(NETWINDER, "Rebel-NetWinder")
650 MAINTAINER("Russell King/Rebel.com") 650 /* Maintainer: Russell King/Rebel.com */
651 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000) 651 .phys_ram = 0x00000000,
652 BOOT_PARAMS(0x00000100) 652 .phys_io = DC21285_ARMCSR_BASE,
653 VIDEO(0x000a0000, 0x000bffff) 653 .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc,
654 DISABLE_PARPORT(0) 654 .boot_params = 0x00000100,
655 DISABLE_PARPORT(2) 655 .video_start = 0x000a0000,
656 FIXUP(fixup_netwinder) 656 .video_end = 0x000bffff,
657 MAPIO(footbridge_map_io) 657 .reserve_lp0 = 1,
658 INITIRQ(footbridge_init_irq) 658 .reserve_lp2 = 1,
659 .fixup = fixup_netwinder,
660 .map_io = footbridge_map_io,
661 .init_irq = footbridge_init_irq,
659 .timer = &isa_timer, 662 .timer = &isa_timer,
660MACHINE_END 663MACHINE_END
diff --git a/arch/arm/mach-footbridge/personal.c b/arch/arm/mach-footbridge/personal.c
index 415086d7bbee..0146b8bb59da 100644
--- a/arch/arm/mach-footbridge/personal.c
+++ b/arch/arm/mach-footbridge/personal.c
@@ -13,11 +13,13 @@
13#include "common.h" 13#include "common.h"
14 14
15MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer") 15MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer")
16 MAINTAINER("Jamey Hicks / George France") 16 /* Maintainer: Jamey Hicks / George France */
17 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000) 17 .phys_ram = 0x00000000,
18 BOOT_PARAMS(0x00000100) 18 .phys_io = DC21285_ARMCSR_BASE,
19 MAPIO(footbridge_map_io) 19 .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc,
20 INITIRQ(footbridge_init_irq) 20 .boot_params = 0x00000100,
21 .map_io = footbridge_map_io,
22 .init_irq = footbridge_init_irq,
21 .timer = &footbridge_timer, 23 .timer = &footbridge_timer,
22MACHINE_END 24MACHINE_END
23 25
diff --git a/arch/arm/mach-h720x/cpu-h7201.c b/arch/arm/mach-h720x/cpu-h7201.c
index 743656881ed6..af9e4a5d5ea7 100644
--- a/arch/arm/mach-h720x/cpu-h7201.c
+++ b/arch/arm/mach-h720x/cpu-h7201.c
@@ -41,8 +41,8 @@ h7201_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
41 41
42static struct irqaction h7201_timer_irq = { 42static struct irqaction h7201_timer_irq = {
43 .name = "h7201 Timer Tick", 43 .name = "h7201 Timer Tick",
44 .flags = SA_INTERRUPT, 44 .flags = SA_INTERRUPT | SA_TIMER,
45 .handler = h7201_timer_interrupt 45 .handler = h7201_timer_interrupt,
46}; 46};
47 47
48/* 48/*
diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c
index 21b8fb6122cd..593b6a2a30e1 100644
--- a/arch/arm/mach-h720x/cpu-h7202.c
+++ b/arch/arm/mach-h720x/cpu-h7202.c
@@ -171,8 +171,8 @@ static struct irqchip h7202_timerx_chip = {
171 171
172static struct irqaction h7202_timer_irq = { 172static struct irqaction h7202_timer_irq = {
173 .name = "h7202 Timer Tick", 173 .name = "h7202 Timer Tick",
174 .flags = SA_INTERRUPT, 174 .flags = SA_INTERRUPT | SA_TIMER,
175 .handler = h7202_timer_interrupt 175 .handler = h7202_timer_interrupt,
176}; 176};
177 177
178/* 178/*
diff --git a/arch/arm/mach-h720x/h7201-eval.c b/arch/arm/mach-h720x/h7201-eval.c
index 9b24b9b0db15..fa59e9e2a5c8 100644
--- a/arch/arm/mach-h720x/h7201-eval.c
+++ b/arch/arm/mach-h720x/h7201-eval.c
@@ -30,10 +30,12 @@
30#include "common.h" 30#include "common.h"
31 31
32MACHINE_START(H7201, "Hynix GMS30C7201") 32MACHINE_START(H7201, "Hynix GMS30C7201")
33 MAINTAINER("Robert Schwebel, Pengutronix") 33 /* Maintainer: Robert Schwebel, Pengutronix */
34 BOOT_MEM(0x40000000, 0x80000000, 0xf0000000) 34 .phys_ram = 0x40000000,
35 BOOT_PARAMS(0xc0001000) 35 .phys_io = 0x80000000,
36 MAPIO(h720x_map_io) 36 .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc,
37 INITIRQ(h720x_init_irq) 37 .boot_params = 0xc0001000,
38 .timer = &h7201_timer, 38 .map_io = h720x_map_io,
39 .init_irq = h720x_init_irq,
40 .timer = &h7201_timer,
39MACHINE_END 41MACHINE_END
diff --git a/arch/arm/mach-h720x/h7202-eval.c b/arch/arm/mach-h720x/h7202-eval.c
index 3456a00d5f5c..db9078ad008c 100644
--- a/arch/arm/mach-h720x/h7202-eval.c
+++ b/arch/arm/mach-h720x/h7202-eval.c
@@ -71,11 +71,13 @@ static void __init init_eval_h7202(void)
71} 71}
72 72
73MACHINE_START(H7202, "Hynix HMS30C7202") 73MACHINE_START(H7202, "Hynix HMS30C7202")
74 MAINTAINER("Robert Schwebel, Pengutronix") 74 /* Maintainer: Robert Schwebel, Pengutronix */
75 BOOT_MEM(0x40000000, 0x80000000, 0xf0000000) 75 .phys_ram = 0x40000000,
76 BOOT_PARAMS(0x40000100) 76 .phys_io = 0x80000000,
77 MAPIO(h720x_map_io) 77 .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc,
78 INITIRQ(h7202_init_irq) 78 .boot_params = 0x40000100,
79 .timer = &h7202_timer, 79 .map_io = h720x_map_io,
80 INIT_MACHINE(init_eval_h7202) 80 .init_irq = h7202_init_irq,
81 .timer = &h7202_timer,
82 .init_machine = init_eval_h7202,
81MACHINE_END 83MACHINE_END
diff --git a/arch/arm/mach-imx/mx1ads.c b/arch/arm/mach-imx/mx1ads.c
index 625dd01c2578..5d25434d332c 100644
--- a/arch/arm/mach-imx/mx1ads.c
+++ b/arch/arm/mach-imx/mx1ads.c
@@ -78,11 +78,13 @@ mx1ads_map_io(void)
78} 78}
79 79
80MACHINE_START(MX1ADS, "Motorola MX1ADS") 80MACHINE_START(MX1ADS, "Motorola MX1ADS")
81 MAINTAINER("Sascha Hauer, Pengutronix") 81 /* Maintainer: Sascha Hauer, Pengutronix */
82 BOOT_MEM(0x08000000, 0x00200000, 0xe0200000) 82 .phys_ram = 0x08000000,
83 BOOT_PARAMS(0x08000100) 83 .phys_io = 0x00200000,
84 MAPIO(mx1ads_map_io) 84 .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
85 INITIRQ(imx_init_irq) 85 .boot_params = 0x08000100,
86 .map_io = mx1ads_map_io,
87 .init_irq = imx_init_irq,
86 .timer = &imx_timer, 88 .timer = &imx_timer,
87 INIT_MACHINE(mx1ads_init) 89 .init_machine = mx1ads_init,
88MACHINE_END 90MACHINE_END
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index 11f1e56c36bc..ea805bfa5e54 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -72,8 +72,8 @@ imx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
72 72
73static struct irqaction imx_timer_irq = { 73static struct irqaction imx_timer_irq = {
74 .name = "i.MX Timer Tick", 74 .name = "i.MX Timer Tick",
75 .flags = SA_INTERRUPT, 75 .flags = SA_INTERRUPT | SA_TIMER,
76 .handler = imx_timer_interrupt 76 .handler = imx_timer_interrupt,
77}; 77};
78 78
79/* 79/*
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index bd1e5e3c9d34..dacbf504dae2 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -20,6 +20,7 @@
20#include <asm/irq.h> 20#include <asm/irq.h>
21#include <asm/io.h> 21#include <asm/io.h>
22#include <asm/hardware/amba.h> 22#include <asm/hardware/amba.h>
23#include <asm/hardware/arm_timer.h>
23#include <asm/arch/cm.h> 24#include <asm/arch/cm.h>
24#include <asm/system.h> 25#include <asm/system.h>
25#include <asm/leds.h> 26#include <asm/leds.h>
@@ -156,16 +157,6 @@ EXPORT_SYMBOL(cm_control);
156#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) 157#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
157#endif 158#endif
158 159
159/*
160 * What does it look like?
161 */
162typedef struct TimerStruct {
163 unsigned long TimerLoad;
164 unsigned long TimerValue;
165 unsigned long TimerControl;
166 unsigned long TimerClear;
167} TimerStruct_t;
168
169static unsigned long timer_reload; 160static unsigned long timer_reload;
170 161
171/* 162/*
@@ -174,7 +165,6 @@ static unsigned long timer_reload;
174 */ 165 */
175unsigned long integrator_gettimeoffset(void) 166unsigned long integrator_gettimeoffset(void)
176{ 167{
177 volatile TimerStruct_t *timer1 = (TimerStruct_t *)TIMER1_VA_BASE;
178 unsigned long ticks1, ticks2, status; 168 unsigned long ticks1, ticks2, status;
179 169
180 /* 170 /*
@@ -183,11 +173,11 @@ unsigned long integrator_gettimeoffset(void)
183 * an interrupt. We get around this by ensuring that the 173 * an interrupt. We get around this by ensuring that the
184 * counter has not reloaded between our two reads. 174 * counter has not reloaded between our two reads.
185 */ 175 */
186 ticks2 = timer1->TimerValue & 0xffff; 176 ticks2 = readl(TIMER1_VA_BASE + TIMER_VALUE) & 0xffff;
187 do { 177 do {
188 ticks1 = ticks2; 178 ticks1 = ticks2;
189 status = __raw_readl(VA_IC_BASE + IRQ_RAW_STATUS); 179 status = __raw_readl(VA_IC_BASE + IRQ_RAW_STATUS);
190 ticks2 = timer1->TimerValue & 0xffff; 180 ticks2 = readl(TIMER1_VA_BASE + TIMER_VALUE) & 0xffff;
191 } while (ticks2 > ticks1); 181 } while (ticks2 > ticks1);
192 182
193 /* 183 /*
@@ -213,14 +203,12 @@ unsigned long integrator_gettimeoffset(void)
213static irqreturn_t 203static irqreturn_t
214integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 204integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
215{ 205{
216 volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
217
218 write_seqlock(&xtime_lock); 206 write_seqlock(&xtime_lock);
219 207
220 /* 208 /*
221 * clear the interrupt 209 * clear the interrupt
222 */ 210 */
223 timer1->TimerClear = 1; 211 writel(1, TIMER1_VA_BASE + TIMER_INTCLR);
224 212
225 /* 213 /*
226 * the clock tick routines are only processed on the 214 * the clock tick routines are only processed on the
@@ -247,8 +235,8 @@ integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
247 235
248static struct irqaction integrator_timer_irq = { 236static struct irqaction integrator_timer_irq = {
249 .name = "Integrator Timer Tick", 237 .name = "Integrator Timer Tick",
250 .flags = SA_INTERRUPT, 238 .flags = SA_INTERRUPT | SA_TIMER,
251 .handler = integrator_timer_interrupt 239 .handler = integrator_timer_interrupt,
252}; 240};
253 241
254/* 242/*
@@ -256,32 +244,29 @@ static struct irqaction integrator_timer_irq = {
256 */ 244 */
257void __init integrator_time_init(unsigned long reload, unsigned int ctrl) 245void __init integrator_time_init(unsigned long reload, unsigned int ctrl)
258{ 246{
259 volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE; 247 unsigned int timer_ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC;
260 volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
261 volatile TimerStruct_t *timer2 = (volatile TimerStruct_t *)TIMER2_VA_BASE;
262 unsigned int timer_ctrl = 0x80 | 0x40; /* periodic */
263 248
264 timer_reload = reload; 249 timer_reload = reload;
265 timer_ctrl |= ctrl; 250 timer_ctrl |= ctrl;
266 251
267 if (timer_reload > 0x100000) { 252 if (timer_reload > 0x100000) {
268 timer_reload >>= 8; 253 timer_reload >>= 8;
269 timer_ctrl |= 0x08; /* /256 */ 254 timer_ctrl |= TIMER_CTRL_DIV256;
270 } else if (timer_reload > 0x010000) { 255 } else if (timer_reload > 0x010000) {
271 timer_reload >>= 4; 256 timer_reload >>= 4;
272 timer_ctrl |= 0x04; /* /16 */ 257 timer_ctrl |= TIMER_CTRL_DIV16;
273 } 258 }
274 259
275 /* 260 /*
276 * Initialise to a known state (all timers off) 261 * Initialise to a known state (all timers off)
277 */ 262 */
278 timer0->TimerControl = 0; 263 writel(0, TIMER0_VA_BASE + TIMER_CTRL);
279 timer1->TimerControl = 0; 264 writel(0, TIMER1_VA_BASE + TIMER_CTRL);
280 timer2->TimerControl = 0; 265 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
281 266
282 timer1->TimerLoad = timer_reload; 267 writel(timer_reload, TIMER1_VA_BASE + TIMER_LOAD);
283 timer1->TimerValue = timer_reload; 268 writel(timer_reload, TIMER1_VA_BASE + TIMER_VALUE);
284 timer1->TimerControl = timer_ctrl; 269 writel(timer_ctrl, TIMER1_VA_BASE + TIMER_CTRL);
285 270
286 /* 271 /*
287 * Make irqs happen for the system timer 272 * Make irqs happen for the system timer
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 91ba9fd79c87..36e2b6eb67b7 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -292,11 +292,13 @@ static struct sys_timer ap_timer = {
292}; 292};
293 293
294MACHINE_START(INTEGRATOR, "ARM-Integrator") 294MACHINE_START(INTEGRATOR, "ARM-Integrator")
295 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") 295 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
296 BOOT_MEM(0x00000000, 0x16000000, 0xf1600000) 296 .phys_ram = 0x00000000,
297 BOOT_PARAMS(0x00000100) 297 .phys_io = 0x16000000,
298 MAPIO(ap_map_io) 298 .io_pg_offst = ((0xf1600000) >> 18) & 0xfffc,
299 INITIRQ(ap_init_irq) 299 .boot_params = 0x00000100,
300 .map_io = ap_map_io,
301 .init_irq = ap_init_irq,
300 .timer = &ap_timer, 302 .timer = &ap_timer,
301 INIT_MACHINE(ap_init) 303 .init_machine = ap_init,
302MACHINE_END 304MACHINE_END
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index e0a01eef0993..569f328c479d 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -532,11 +532,13 @@ static struct sys_timer cp_timer = {
532}; 532};
533 533
534MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") 534MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
535 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") 535 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
536 BOOT_MEM(0x00000000, 0x16000000, 0xf1600000) 536 .phys_ram = 0x00000000,
537 BOOT_PARAMS(0x00000100) 537 .phys_io = 0x16000000,
538 MAPIO(intcp_map_io) 538 .io_pg_offst = ((0xf1600000) >> 18) & 0xfffc,
539 INITIRQ(intcp_init_irq) 539 .boot_params = 0x00000100,
540 .map_io = intcp_map_io,
541 .init_irq = intcp_init_irq,
540 .timer = &cp_timer, 542 .timer = &cp_timer,
541 INIT_MACHINE(intcp_init) 543 .init_machine = intcp_init,
542MACHINE_END 544MACHINE_END
diff --git a/arch/arm/mach-iop3xx/iop321-setup.c b/arch/arm/mach-iop3xx/iop321-setup.c
index bf23e0fd2843..0f921ba2750c 100644
--- a/arch/arm/mach-iop3xx/iop321-setup.c
+++ b/arch/arm/mach-iop3xx/iop321-setup.c
@@ -146,23 +146,27 @@ extern void iop321_init_time(void);
146 146
147#if defined(CONFIG_ARCH_IQ80321) 147#if defined(CONFIG_ARCH_IQ80321)
148MACHINE_START(IQ80321, "Intel IQ80321") 148MACHINE_START(IQ80321, "Intel IQ80321")
149 MAINTAINER("Intel Corporation") 149 /* Maintainer: Intel Corporation */
150 BOOT_MEM(PHYS_OFFSET, IQ80321_UART, IQ80321_UART) 150 .phys_ram = PHYS_OFFSET,
151 MAPIO(iq80321_map_io) 151 .phys_io = IQ80321_UART,
152 INITIRQ(iop321_init_irq) 152 .io_pg_offst = ((IQ80321_UART) >> 18) & 0xfffc,
153 .map_io = iq80321_map_io,
154 .init_irq = iop321_init_irq,
153 .timer = &iop321_timer, 155 .timer = &iop321_timer,
154 BOOT_PARAMS(0xa0000100) 156 .boot_params = 0xa0000100,
155 INIT_MACHINE(iop32x_init) 157 .init_machine = iop32x_init,
156MACHINE_END 158MACHINE_END
157#elif defined(CONFIG_ARCH_IQ31244) 159#elif defined(CONFIG_ARCH_IQ31244)
158MACHINE_START(IQ31244, "Intel IQ31244") 160MACHINE_START(IQ31244, "Intel IQ31244")
159 MAINTAINER("Intel Corp.") 161 /* Maintainer: Intel Corp. */
160 BOOT_MEM(PHYS_OFFSET, IQ31244_UART, IQ31244_UART) 162 .phys_ram = PHYS_OFFSET,
161 MAPIO(iq31244_map_io) 163 .phys_io = IQ31244_UART,
162 INITIRQ(iop321_init_irq) 164 .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc,
165 .map_io = iq31244_map_io,
166 .init_irq = iop321_init_irq,
163 .timer = &iop321_timer, 167 .timer = &iop321_timer,
164 BOOT_PARAMS(0xa0000100) 168 .boot_params = 0xa0000100,
165 INIT_MACHINE(iop32x_init) 169 .init_machine = iop32x_init,
166MACHINE_END 170MACHINE_END
167#else 171#else
168#error No machine descriptor defined for this IOP3XX implementation 172#error No machine descriptor defined for this IOP3XX implementation
diff --git a/arch/arm/mach-iop3xx/iop321-time.c b/arch/arm/mach-iop3xx/iop321-time.c
index 9b7dd64d1b8f..d53af1669502 100644
--- a/arch/arm/mach-iop3xx/iop321-time.c
+++ b/arch/arm/mach-iop3xx/iop321-time.c
@@ -86,7 +86,7 @@ iop321_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
86static struct irqaction iop321_timer_irq = { 86static struct irqaction iop321_timer_irq = {
87 .name = "IOP321 Timer Tick", 87 .name = "IOP321 Timer Tick",
88 .handler = iop321_timer_interrupt, 88 .handler = iop321_timer_interrupt,
89 .flags = SA_INTERRUPT 89 .flags = SA_INTERRUPT | SA_TIMER,
90}; 90};
91 91
92static void __init iop321_timer_init(void) 92static void __init iop321_timer_init(void)
diff --git a/arch/arm/mach-iop3xx/iop331-setup.c b/arch/arm/mach-iop3xx/iop331-setup.c
index 622e7914819a..fc74b722f72f 100644
--- a/arch/arm/mach-iop3xx/iop331-setup.c
+++ b/arch/arm/mach-iop3xx/iop331-setup.c
@@ -148,26 +148,28 @@ extern void iq80332_map_io(void);
148 148
149#if defined(CONFIG_ARCH_IQ80331) 149#if defined(CONFIG_ARCH_IQ80331)
150MACHINE_START(IQ80331, "Intel IQ80331") 150MACHINE_START(IQ80331, "Intel IQ80331")
151 MAINTAINER("Intel Corp.") 151 /* Maintainer: Intel Corp. */
152 BOOT_MEM(PHYS_OFFSET, 0xfefff000, 0xfffff000) // virtual, physical 152 .phys_ram = PHYS_OFFSET,
153 //BOOT_MEM(PHYS_OFFSET, IOP331_UART0_VIRT, IOP331_UART0_PHYS) 153 .phys_io = 0xfefff000,
154 MAPIO(iq80331_map_io) 154 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
155 INITIRQ(iop331_init_irq) 155 .map_io = iq80331_map_io,
156 .init_irq = iop331_init_irq,
156 .timer = &iop331_timer, 157 .timer = &iop331_timer,
157 BOOT_PARAMS(0x0100) 158 .boot_params = 0x0100,
158 INIT_MACHINE(iop33x_init) 159 .init_machine = iop33x_init,
159MACHINE_END 160MACHINE_END
160 161
161#elif defined(CONFIG_MACH_IQ80332) 162#elif defined(CONFIG_MACH_IQ80332)
162MACHINE_START(IQ80332, "Intel IQ80332") 163MACHINE_START(IQ80332, "Intel IQ80332")
163 MAINTAINER("Intel Corp.") 164 /* Maintainer: Intel Corp. */
164 BOOT_MEM(PHYS_OFFSET, 0xfefff000, 0xfffff000) // virtual, physical 165 .phys_ram = PHYS_OFFSET,
165 //BOOT_MEM(PHYS_OFFSET, IOP331_UART0_VIRT, IOP331_UART0_PHYS) 166 .phys_io = 0xfefff000,
166 MAPIO(iq80332_map_io) 167 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
167 INITIRQ(iop331_init_irq) 168 .map_io = iq80332_map_io,
169 .init_irq = iop331_init_irq,
168 .timer = &iop331_timer, 170 .timer = &iop331_timer,
169 BOOT_PARAMS(0x0100) 171 .boot_params = 0x0100,
170 INIT_MACHINE(iop33x_init) 172 .init_machine = iop33x_init,
171MACHINE_END 173MACHINE_END
172 174
173#else 175#else
diff --git a/arch/arm/mach-iop3xx/iop331-time.c b/arch/arm/mach-iop3xx/iop331-time.c
index e01696769263..1a6d9d661e4b 100644
--- a/arch/arm/mach-iop3xx/iop331-time.c
+++ b/arch/arm/mach-iop3xx/iop331-time.c
@@ -83,7 +83,7 @@ iop331_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
83static struct irqaction iop331_timer_irq = { 83static struct irqaction iop331_timer_irq = {
84 .name = "IOP331 Timer Tick", 84 .name = "IOP331 Timer Tick",
85 .handler = iop331_timer_interrupt, 85 .handler = iop331_timer_interrupt,
86 .flags = SA_INTERRUPT 86 .flags = SA_INTERRUPT | SA_TIMER,
87}; 87};
88 88
89static void __init iop331_timer_init(void) 89static void __init iop331_timer_init(void)
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 0ee34acb8d7b..4b9d841e04c1 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -103,6 +103,11 @@ static struct map_desc ixp2000_io_desc[] __initdata = {
103 .length = IXP2000_PCI_CSR_SIZE, 103 .length = IXP2000_PCI_CSR_SIZE,
104 .type = MT_DEVICE 104 .type = MT_DEVICE
105 }, { 105 }, {
106 .virtual = IXP2000_MSF_VIRT_BASE,
107 .physical = IXP2000_MSF_PHYS_BASE,
108 .length = IXP2000_MSF_SIZE,
109 .type = MT_DEVICE
110 }, {
106 .virtual = IXP2000_PCI_IO_VIRT_BASE, 111 .virtual = IXP2000_PCI_IO_VIRT_BASE,
107 .physical = IXP2000_PCI_IO_PHYS_BASE, 112 .physical = IXP2000_PCI_IO_PHYS_BASE,
108 .length = IXP2000_PCI_IO_SIZE, 113 .length = IXP2000_PCI_IO_SIZE,
@@ -194,8 +199,8 @@ static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
194 199
195static struct irqaction ixp2000_timer_irq = { 200static struct irqaction ixp2000_timer_irq = {
196 .name = "IXP2000 Timer Tick", 201 .name = "IXP2000 Timer Tick",
197 .flags = SA_INTERRUPT, 202 .flags = SA_INTERRUPT | SA_TIMER,
198 .handler = ixp2000_timer_interrupt 203 .handler = ixp2000_timer_interrupt,
199}; 204};
200 205
201void __init ixp2000_init_time(unsigned long tick_rate) 206void __init ixp2000_init_time(unsigned long tick_rate)
diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c
index f3a291b6a9fb..b7ebf3898fc5 100644
--- a/arch/arm/mach-ixp2000/enp2611.c
+++ b/arch/arm/mach-ixp2000/enp2611.c
@@ -223,13 +223,15 @@ static void __init enp2611_init_machine(void)
223 223
224 224
225MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board") 225MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board")
226 MAINTAINER("Lennert Buytenhek <buytenh@wantstofly.org>") 226 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
227 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE) 227 .phys_ram = 0x00000000,
228 BOOT_PARAMS(0x00000100) 228 .phys_io = IXP2000_UART_PHYS_BASE,
229 MAPIO(ixp2000_map_io) 229 .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
230 INITIRQ(ixp2000_init_irq) 230 .boot_params = 0x00000100,
231 .map_io = ixp2000_map_io,
232 .init_irq = ixp2000_init_irq,
231 .timer = &enp2611_timer, 233 .timer = &enp2611_timer,
232 INIT_MACHINE(enp2611_init_machine) 234 .init_machine = enp2611_init_machine,
233MACHINE_END 235MACHINE_END
234 236
235 237
diff --git a/arch/arm/mach-ixp2000/ixdp2400.c b/arch/arm/mach-ixp2000/ixdp2400.c
index df3ff26c8cdd..fd280a93637e 100644
--- a/arch/arm/mach-ixp2000/ixdp2400.c
+++ b/arch/arm/mach-ixp2000/ixdp2400.c
@@ -168,12 +168,14 @@ void ixdp2400_init_irq(void)
168} 168}
169 169
170MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform") 170MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform")
171 MAINTAINER("MontaVista Software, Inc.") 171 /* Maintainer: MontaVista Software, Inc. */
172 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE) 172 .phys_ram = 0x00000000,
173 BOOT_PARAMS(0x00000100) 173 .phys_io = IXP2000_UART_PHYS_BASE,
174 MAPIO(ixdp2x00_map_io) 174 .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
175 INITIRQ(ixdp2400_init_irq) 175 .boot_params = 0x00000100,
176 .map_io = ixdp2x00_map_io,
177 .init_irq = ixdp2400_init_irq,
176 .timer = &ixdp2400_timer, 178 .timer = &ixdp2400_timer,
177 INIT_MACHINE(ixdp2x00_init_machine) 179 .init_machine = ixdp2x00_init_machine,
178MACHINE_END 180MACHINE_END
179 181
diff --git a/arch/arm/mach-ixp2000/ixdp2800.c b/arch/arm/mach-ixp2000/ixdp2800.c
index aec13c7108a9..f9073aa28615 100644
--- a/arch/arm/mach-ixp2000/ixdp2800.c
+++ b/arch/arm/mach-ixp2000/ixdp2800.c
@@ -42,12 +42,6 @@
42#include <asm/mach/flash.h> 42#include <asm/mach/flash.h>
43#include <asm/mach/arch.h> 43#include <asm/mach/arch.h>
44 44
45
46void ixdp2400_init_irq(void)
47{
48 ixdp2x00_init_irq(IXDP2800_CPLD_INT_STAT, IXDP2800_CPLD_INT_MASK, IXDP2400_NR_IRQS);
49}
50
51/************************************************************************* 45/*************************************************************************
52 * IXDP2800 timer tick 46 * IXDP2800 timer tick
53 *************************************************************************/ 47 *************************************************************************/
@@ -290,12 +284,14 @@ void ixdp2800_init_irq(void)
290} 284}
291 285
292MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform") 286MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform")
293 MAINTAINER("MontaVista Software, Inc.") 287 /* Maintainer: MontaVista Software, Inc. */
294 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE) 288 .phys_ram = 0x00000000,
295 BOOT_PARAMS(0x00000100) 289 .phys_io = IXP2000_UART_PHYS_BASE,
296 MAPIO(ixdp2x00_map_io) 290 .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
297 INITIRQ(ixdp2800_init_irq) 291 .boot_params = 0x00000100,
292 .map_io = ixdp2x00_map_io,
293 .init_irq = ixdp2800_init_irq,
298 .timer = &ixdp2800_timer, 294 .timer = &ixdp2800_timer,
299 INIT_MACHINE(ixdp2x00_init_machine) 295 .init_machine = ixdp2x00_init_machine,
300MACHINE_END 296MACHINE_END
301 297
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c
index e94dace3d412..c73588743ee1 100644
--- a/arch/arm/mach-ixp2000/ixdp2x01.c
+++ b/arch/arm/mach-ixp2000/ixdp2x01.c
@@ -375,25 +375,29 @@ static void __init ixdp2x01_init_machine(void)
375 375
376#ifdef CONFIG_ARCH_IXDP2401 376#ifdef CONFIG_ARCH_IXDP2401
377MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform") 377MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform")
378 MAINTAINER("MontaVista Software, Inc.") 378 /* Maintainer: MontaVista Software, Inc. */
379 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE) 379 .phys_ram = 0x00000000,
380 BOOT_PARAMS(0x00000100) 380 .phys_io = IXP2000_UART_PHYS_BASE,
381 MAPIO(ixdp2x01_map_io) 381 .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
382 INITIRQ(ixdp2x01_init_irq) 382 .boot_params = 0x00000100,
383 .map_io = ixdp2x01_map_io,
384 .init_irq = ixdp2x01_init_irq,
383 .timer = &ixdp2x01_timer, 385 .timer = &ixdp2x01_timer,
384 INIT_MACHINE(ixdp2x01_init_machine) 386 .init_machine = ixdp2x01_init_machine,
385MACHINE_END 387MACHINE_END
386#endif 388#endif
387 389
388#ifdef CONFIG_ARCH_IXDP2801 390#ifdef CONFIG_ARCH_IXDP2801
389MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform") 391MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform")
390 MAINTAINER("MontaVista Software, Inc.") 392 /* Maintainer: MontaVista Software, Inc. */
391 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE) 393 .phys_ram = 0x00000000,
392 BOOT_PARAMS(0x00000100) 394 .phys_io = IXP2000_UART_PHYS_BASE,
393 MAPIO(ixdp2x01_map_io) 395 .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
394 INITIRQ(ixdp2x01_init_irq) 396 .boot_params = 0x00000100,
397 .map_io = ixdp2x01_map_io,
398 .init_irq = ixdp2x01_init_irq,
395 .timer = &ixdp2x01_timer, 399 .timer = &ixdp2x01_timer,
396 INIT_MACHINE(ixdp2x01_init_machine) 400 .init_machine = ixdp2x01_init_machine,
397MACHINE_END 401MACHINE_END
398#endif 402#endif
399 403
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index f39e8408488f..04490a9f8f6e 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -298,8 +298,8 @@ static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id, struct pt_regs
298 298
299static struct irqaction ixp4xx_timer_irq = { 299static struct irqaction ixp4xx_timer_irq = {
300 .name = "IXP4xx Timer Tick", 300 .name = "IXP4xx Timer Tick",
301 .flags = SA_INTERRUPT, 301 .flags = SA_INTERRUPT | SA_TIMER,
302 .handler = ixp4xx_timer_interrupt 302 .handler = ixp4xx_timer_interrupt,
303}; 303};
304 304
305static void __init ixp4xx_timer_init(void) 305static void __init ixp4xx_timer_init(void)
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
index 8a05a1227e5f..c6335f51907d 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -100,14 +100,15 @@ static void __init coyote_init(void)
100 100
101#ifdef CONFIG_ARCH_ADI_COYOTE 101#ifdef CONFIG_ARCH_ADI_COYOTE
102MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote") 102MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
103 MAINTAINER("MontaVista Software, Inc.") 103 /* Maintainer: MontaVista Software, Inc. */
104 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 104 .phys_ram = PHYS_OFFSET,
105 IXP4XX_PERIPHERAL_BASE_VIRT) 105 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
106 MAPIO(coyote_map_io) 106 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
107 INITIRQ(ixp4xx_init_irq) 107 .map_io = coyote_map_io,
108 .init_irq = ixp4xx_init_irq,
108 .timer = &ixp4xx_timer, 109 .timer = &ixp4xx_timer,
109 BOOT_PARAMS(0x0100) 110 .boot_params = 0x0100,
110 INIT_MACHINE(coyote_init) 111 .init_machine = coyote_init,
111MACHINE_END 112MACHINE_END
112#endif 113#endif
113 114
@@ -117,14 +118,15 @@ MACHINE_END
117 */ 118 */
118#ifdef CONFIG_MACH_IXDPG425 119#ifdef CONFIG_MACH_IXDPG425
119MACHINE_START(IXDPG425, "Intel IXDPG425") 120MACHINE_START(IXDPG425, "Intel IXDPG425")
120 MAINTAINER("MontaVista Software, Inc.") 121 /* Maintainer: MontaVista Software, Inc. */
121 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 122 .phys_ram = PHYS_OFFSET,
122 IXP4XX_PERIPHERAL_BASE_VIRT) 123 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
123 MAPIO(coyote_map_io) 124 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
124 INITIRQ(ixp4xx_init_irq) 125 .map_io = coyote_map_io,
126 .init_irq = ixp4xx_init_irq,
125 .timer = &ixp4xx_timer, 127 .timer = &ixp4xx_timer,
126 BOOT_PARAMS(0x0100) 128 .boot_params = 0x0100,
127 INIT_MACHINE(coyote_init) 129 .init_machine = coyote_init,
128MACHINE_END 130MACHINE_END
129#endif 131#endif
130 132
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index e77c86efd21d..8ba1cd9406e7 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -140,14 +140,15 @@ static void __init gtwx5715_init(void)
140 140
141 141
142MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)") 142MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
143 MAINTAINER("George Joseph") 143 /* Maintainer: George Joseph */
144 BOOT_MEM(PHYS_OFFSET, IXP4XX_UART2_BASE_PHYS, 144 .phys_ram = PHYS_OFFSET,
145 IXP4XX_UART2_BASE_VIRT) 145 .phys_io = IXP4XX_UART2_BASE_PHYS,
146 MAPIO(gtwx5715_map_io) 146 .io_pg_offst = ((IXP4XX_UART2_BASE_VIRT) >> 18) & 0xfffc,
147 INITIRQ(ixp4xx_init_irq) 147 .map_io = gtwx5715_map_io,
148 .timer = &ixp4xx_timer, 148 .init_irq = ixp4xx_init_irq,
149 BOOT_PARAMS(0x0100) 149 .timer = &ixp4xx_timer,
150 INIT_MACHINE(gtwx5715_init) 150 .boot_params = 0x0100,
151 .init_machine = gtwx5715_init,
151MACHINE_END 152MACHINE_END
152 153
153 154
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index 77346c1f676b..f2e9c0ea0501 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -128,36 +128,39 @@ static void __init ixdp425_init(void)
128} 128}
129 129
130MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") 130MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
131 MAINTAINER("MontaVista Software, Inc.") 131 /* Maintainer: MontaVista Software, Inc. */
132 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 132 .phys_ram = PHYS_OFFSET,
133 IXP4XX_PERIPHERAL_BASE_VIRT) 133 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
134 MAPIO(ixdp425_map_io) 134 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
135 INITIRQ(ixp4xx_init_irq) 135 .map_io = ixdp425_map_io,
136 .init_irq = ixp4xx_init_irq,
136 .timer = &ixp4xx_timer, 137 .timer = &ixp4xx_timer,
137 BOOT_PARAMS(0x0100) 138 .boot_params = 0x0100,
138 INIT_MACHINE(ixdp425_init) 139 .init_machine = ixdp425_init,
139MACHINE_END 140MACHINE_END
140 141
141MACHINE_START(IXDP465, "Intel IXDP465 Development Platform") 142MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
142 MAINTAINER("MontaVista Software, Inc.") 143 /* Maintainer: MontaVista Software, Inc. */
143 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 144 .phys_ram = PHYS_OFFSET,
144 IXP4XX_PERIPHERAL_BASE_VIRT) 145 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
145 MAPIO(ixdp425_map_io) 146 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
146 INITIRQ(ixp4xx_init_irq) 147 .map_io = ixdp425_map_io,
148 .init_irq = ixp4xx_init_irq,
147 .timer = &ixp4xx_timer, 149 .timer = &ixp4xx_timer,
148 BOOT_PARAMS(0x0100) 150 .boot_params = 0x0100,
149 INIT_MACHINE(ixdp425_init) 151 .init_machine = ixdp425_init,
150MACHINE_END 152MACHINE_END
151 153
152MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform") 154MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
153 MAINTAINER("MontaVista Software, Inc.") 155 /* Maintainer: MontaVista Software, Inc. */
154 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 156 .phys_ram = PHYS_OFFSET,
155 IXP4XX_PERIPHERAL_BASE_VIRT) 157 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
156 MAPIO(ixdp425_map_io) 158 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
157 INITIRQ(ixp4xx_init_irq) 159 .map_io = ixdp425_map_io,
160 .init_irq = ixp4xx_init_irq,
158 .timer = &ixp4xx_timer, 161 .timer = &ixp4xx_timer,
159 BOOT_PARAMS(0x0100) 162 .boot_params = 0x0100,
160 INIT_MACHINE(ixdp425_init) 163 .init_machine = ixdp425_init,
161MACHINE_END 164MACHINE_END
162 165
163/* 166/*
@@ -168,14 +171,15 @@ MACHINE_END
168 */ 171 */
169#ifdef CONFIG_ARCH_AVILA 172#ifdef CONFIG_ARCH_AVILA
170MACHINE_START(AVILA, "Gateworks Avila Network Platform") 173MACHINE_START(AVILA, "Gateworks Avila Network Platform")
171 MAINTAINER("Deepak Saxena <dsaxena@plexity.net>") 174 /* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
172 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 175 .phys_ram = PHYS_OFFSET,
173 IXP4XX_PERIPHERAL_BASE_VIRT) 176 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
174 MAPIO(ixdp425_map_io) 177 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
175 INITIRQ(ixp4xx_init_irq) 178 .map_io = ixdp425_map_io,
179 .init_irq = ixp4xx_init_irq,
176 .timer = &ixp4xx_timer, 180 .timer = &ixp4xx_timer,
177 BOOT_PARAMS(0x0100) 181 .boot_params = 0x0100,
178 INIT_MACHINE(ixdp425_init) 182 .init_machine = ixdp425_init,
179MACHINE_END 183MACHINE_END
180#endif 184#endif
181 185
diff --git a/arch/arm/mach-l7200/core.c b/arch/arm/mach-l7200/core.c
index 606ca95f8217..2a7fee2a7635 100644
--- a/arch/arm/mach-l7200/core.c
+++ b/arch/arm/mach-l7200/core.c
@@ -81,9 +81,11 @@ static void __init l7200_map_io(void)
81} 81}
82 82
83MACHINE_START(L7200, "LinkUp Systems L7200") 83MACHINE_START(L7200, "LinkUp Systems L7200")
84 MAINTAINER("Steve Hill / Scott McConnell") 84 /* Maintainer: Steve Hill / Scott McConnell */
85 BOOT_MEM(0xf0000000, 0x80040000, 0xd0000000) 85 .phys_ram = 0xf0000000,
86 MAPIO(l7200_map_io) 86 .phys_io = 0x80040000,
87 INITIRQ(l7200_init_irq) 87 .io_pg_offst = ((0xd0000000) >> 18) & 0xfffc,
88 .map_io = l7200_map_io,
89 .init_irq = l7200_init_irq,
88MACHINE_END 90MACHINE_END
89 91
diff --git a/arch/arm/mach-lh7a40x/arch-kev7a400.c b/arch/arm/mach-lh7a40x/arch-kev7a400.c
index be5d17fe9dcb..cb3dcd3bd00a 100644
--- a/arch/arm/mach-lh7a40x/arch-kev7a400.c
+++ b/arch/arm/mach-lh7a40x/arch-kev7a400.c
@@ -102,10 +102,12 @@ void __init lh7a40x_init_board_irq (void)
102} 102}
103 103
104MACHINE_START (KEV7A400, "Sharp KEV7a400") 104MACHINE_START (KEV7A400, "Sharp KEV7a400")
105 MAINTAINER ("Marc Singer") 105 /* Maintainer: Marc Singer */
106 BOOT_MEM (0xc0000000, 0x80000000, io_p2v (0x80000000)) 106 .phys_ram = 0xc0000000,
107 BOOT_PARAMS (0xc0000100) 107 .phys_io = 0x80000000,
108 MAPIO (kev7a400_map_io) 108 .io_pg_offst = ((io_p2v (0x80000000))>>18) & 0xfffc,
109 INITIRQ (lh7a400_init_irq) 109 .boot_params = 0xc0000100,
110 .map_io = kev7a400_map_io,
111 .init_irq = lh7a400_init_irq,
110 .timer = &lh7a40x_timer, 112 .timer = &lh7a40x_timer,
111MACHINE_END 113MACHINE_END
diff --git a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
index c823447a150f..6eb61a17c63b 100644
--- a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
+++ b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
@@ -260,13 +260,15 @@ lpd7a400_map_io(void)
260#ifdef CONFIG_MACH_LPD7A400 260#ifdef CONFIG_MACH_LPD7A400
261 261
262MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10") 262MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10")
263 MAINTAINER ("Marc Singer") 263 /* Maintainer: Marc Singer */
264 BOOT_MEM (0xc0000000, 0x80000000, io_p2v (0x80000000)) 264 .phys_ram = 0xc0000000,
265 BOOT_PARAMS (0xc0000100) 265 .phys_io = 0x80000000,
266 MAPIO (lpd7a400_map_io) 266 .io_pg_offst = ((io_p2v (0x80000000))>>18) & 0xfffc,
267 INITIRQ (lh7a400_init_irq) 267 .boot_params = 0xc0000100,
268 .map_io = lpd7a400_map_io,
269 .init_irq = lh7a400_init_irq,
268 .timer = &lh7a40x_timer, 270 .timer = &lh7a40x_timer,
269 INIT_MACHINE (lpd7a40x_init) 271 .init_machine = lpd7a40x_init,
270MACHINE_END 272MACHINE_END
271 273
272#endif 274#endif
@@ -274,13 +276,15 @@ MACHINE_END
274#ifdef CONFIG_MACH_LPD7A404 276#ifdef CONFIG_MACH_LPD7A404
275 277
276MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10") 278MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10")
277 MAINTAINER ("Marc Singer") 279 /* Maintainer: Marc Singer */
278 BOOT_MEM (0xc0000000, 0x80000000, io_p2v (0x80000000)) 280 .phys_ram = 0xc0000000,
279 BOOT_PARAMS (0xc0000100) 281 .phys_io = 0x80000000,
280 MAPIO (lpd7a400_map_io) 282 .io_pg_offst = ((io_p2v (0x80000000))>>18) & 0xfffc,
281 INITIRQ (lh7a404_init_irq) 283 .boot_params = 0xc0000100,
284 .map_io = lpd7a400_map_io,
285 .init_irq = lh7a404_init_irq,
282 .timer = &lh7a40x_timer, 286 .timer = &lh7a40x_timer,
283 INIT_MACHINE (lpd7a40x_init) 287 .init_machine = lpd7a40x_init,
284MACHINE_END 288MACHINE_END
285 289
286#endif 290#endif
diff --git a/arch/arm/mach-lh7a40x/time.c b/arch/arm/mach-lh7a40x/time.c
index 51e1c814b400..be377e331f25 100644
--- a/arch/arm/mach-lh7a40x/time.c
+++ b/arch/arm/mach-lh7a40x/time.c
@@ -53,8 +53,8 @@ lh7a40x_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
53 53
54static struct irqaction lh7a40x_timer_irq = { 54static struct irqaction lh7a40x_timer_irq = {
55 .name = "LHA740x Timer Tick", 55 .name = "LHA740x Timer Tick",
56 .flags = SA_INTERRUPT, 56 .flags = SA_INTERRUPT | SA_TIMER,
57 .handler = lh7a40x_timer_interrupt 57 .handler = lh7a40x_timer_interrupt,
58}; 58};
59 59
60static void __init lh7a40x_timer_init(void) 60static void __init lh7a40x_timer_init(void)
diff --git a/arch/arm/mach-omap/board-generic.c b/arch/arm/mach-omap/board-generic.c
index 2102a2cd1013..384bc7cec1db 100644
--- a/arch/arm/mach-omap/board-generic.c
+++ b/arch/arm/mach-omap/board-generic.c
@@ -88,11 +88,13 @@ static void __init omap_generic_map_io(void)
88} 88}
89 89
90MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710") 90MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
91 MAINTAINER("Tony Lindgren <tony@atomide.com>") 91 /* Maintainer: Tony Lindgren <tony@atomide.com> */
92 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 92 .phys_ram = 0x10000000,
93 BOOT_PARAMS(0x10000100) 93 .phys_io = 0xfff00000,
94 MAPIO(omap_generic_map_io) 94 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
95 INITIRQ(omap_generic_init_irq) 95 .boot_params = 0x10000100,
96 INIT_MACHINE(omap_generic_init) 96 .map_io = omap_generic_map_io,
97 .init_irq = omap_generic_init_irq,
98 .init_machine = omap_generic_init,
97 .timer = &omap_timer, 99 .timer = &omap_timer,
98MACHINE_END 100MACHINE_END
diff --git a/arch/arm/mach-omap/board-h2.c b/arch/arm/mach-omap/board-h2.c
index 1f067830d1fc..f37c76a9b163 100644
--- a/arch/arm/mach-omap/board-h2.c
+++ b/arch/arm/mach-omap/board-h2.c
@@ -177,11 +177,13 @@ static void __init h2_map_io(void)
177} 177}
178 178
179MACHINE_START(OMAP_H2, "TI-H2") 179MACHINE_START(OMAP_H2, "TI-H2")
180 MAINTAINER("Imre Deak <imre.deak@nokia.com>") 180 /* Maintainer: Imre Deak <imre.deak@nokia.com> */
181 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 181 .phys_ram = 0x10000000,
182 BOOT_PARAMS(0x10000100) 182 .phys_io = 0xfff00000,
183 MAPIO(h2_map_io) 183 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
184 INITIRQ(h2_init_irq) 184 .boot_params = 0x10000100,
185 INIT_MACHINE(h2_init) 185 .map_io = h2_map_io,
186 .init_irq = h2_init_irq,
187 .init_machine = h2_init,
186 .timer = &omap_timer, 188 .timer = &omap_timer,
187MACHINE_END 189MACHINE_END
diff --git a/arch/arm/mach-omap/board-h3.c b/arch/arm/mach-omap/board-h3.c
index 486a5a006c9a..705e48594e9a 100644
--- a/arch/arm/mach-omap/board-h3.c
+++ b/arch/arm/mach-omap/board-h3.c
@@ -195,11 +195,13 @@ static void __init h3_map_io(void)
195} 195}
196 196
197MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") 197MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
198 MAINTAINER("Texas Instruments, Inc.") 198 /* Maintainer: Texas Instruments, Inc. */
199 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 199 .phys_ram = 0x10000000,
200 BOOT_PARAMS(0x10000100) 200 .phys_io = 0xfff00000,
201 MAPIO(h3_map_io) 201 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
202 INITIRQ(h3_init_irq) 202 .boot_params = 0x10000100,
203 INIT_MACHINE(h3_init) 203 .map_io = h3_map_io,
204 .init_irq = h3_init_irq,
205 .init_machine = h3_init,
204 .timer = &omap_timer, 206 .timer = &omap_timer,
205MACHINE_END 207MACHINE_END
diff --git a/arch/arm/mach-omap/board-innovator.c b/arch/arm/mach-omap/board-innovator.c
index 57cf4da88d55..523363f18cc0 100644
--- a/arch/arm/mach-omap/board-innovator.c
+++ b/arch/arm/mach-omap/board-innovator.c
@@ -270,11 +270,13 @@ static void __init innovator_map_io(void)
270} 270}
271 271
272MACHINE_START(OMAP_INNOVATOR, "TI-Innovator") 272MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
273 MAINTAINER("MontaVista Software, Inc.") 273 /* Maintainer: MontaVista Software, Inc. */
274 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 274 .phys_ram = 0x10000000,
275 BOOT_PARAMS(0x10000100) 275 .phys_io = 0xfff00000,
276 MAPIO(innovator_map_io) 276 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
277 INITIRQ(innovator_init_irq) 277 .boot_params = 0x10000100,
278 INIT_MACHINE(innovator_init) 278 .map_io = innovator_map_io,
279 .init_irq = innovator_init_irq,
280 .init_machine = innovator_init,
279 .timer = &omap_timer, 281 .timer = &omap_timer,
280MACHINE_END 282MACHINE_END
diff --git a/arch/arm/mach-omap/board-netstar.c b/arch/arm/mach-omap/board-netstar.c
index 54acbd215c4b..8c653734d5a3 100644
--- a/arch/arm/mach-omap/board-netstar.c
+++ b/arch/arm/mach-omap/board-netstar.c
@@ -141,11 +141,13 @@ static int __init netstar_late_init(void)
141postcore_initcall(netstar_late_init); 141postcore_initcall(netstar_late_init);
142 142
143MACHINE_START(NETSTAR, "NetStar OMAP5910") 143MACHINE_START(NETSTAR, "NetStar OMAP5910")
144 MAINTAINER("Ladislav Michl <michl@2n.cz>") 144 /* Maintainer: Ladislav Michl <michl@2n.cz> */
145 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 145 .phys_ram = 0x10000000,
146 BOOT_PARAMS(0x10000100) 146 .phys_io = 0xfff00000,
147 MAPIO(netstar_map_io) 147 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
148 INITIRQ(netstar_init_irq) 148 .boot_params = 0x10000100,
149 INIT_MACHINE(netstar_init) 149 .map_io = netstar_map_io,
150 .timer = &omap_timer, 150 .init_irq = netstar_init_irq,
151 .init_machine = netstar_init,
152 .timer = &omap_timer,
151MACHINE_END 153MACHINE_END
diff --git a/arch/arm/mach-omap/board-osk.c b/arch/arm/mach-omap/board-osk.c
index a951fc82459b..cb433436aa08 100644
--- a/arch/arm/mach-omap/board-osk.c
+++ b/arch/arm/mach-omap/board-osk.c
@@ -159,11 +159,13 @@ static void __init osk_map_io(void)
159} 159}
160 160
161MACHINE_START(OMAP_OSK, "TI-OSK") 161MACHINE_START(OMAP_OSK, "TI-OSK")
162 MAINTAINER("Dirk Behme <dirk.behme@de.bosch.com>") 162 /* Maintainer: Dirk Behme <dirk.behme@de.bosch.com> */
163 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 163 .phys_ram = 0x10000000,
164 BOOT_PARAMS(0x10000100) 164 .phys_io = 0xfff00000,
165 MAPIO(osk_map_io) 165 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
166 INITIRQ(osk_init_irq) 166 .boot_params = 0x10000100,
167 INIT_MACHINE(osk_init) 167 .map_io = osk_map_io,
168 .init_irq = osk_init_irq,
169 .init_machine = osk_init,
168 .timer = &omap_timer, 170 .timer = &omap_timer,
169MACHINE_END 171MACHINE_END
diff --git a/arch/arm/mach-omap/board-perseus2.c b/arch/arm/mach-omap/board-perseus2.c
index 64515aeb49cf..d5342043d48f 100644
--- a/arch/arm/mach-omap/board-perseus2.c
+++ b/arch/arm/mach-omap/board-perseus2.c
@@ -179,11 +179,13 @@ static void __init omap_perseus2_map_io(void)
179} 179}
180 180
181MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") 181MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
182 MAINTAINER("Kevin Hilman <kjh@hilman.org>") 182 /* Maintainer: Kevin Hilman <kjh@hilman.org> */
183 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 183 .phys_ram = 0x10000000,
184 BOOT_PARAMS(0x10000100) 184 .phys_io = 0xfff00000,
185 MAPIO(omap_perseus2_map_io) 185 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
186 INITIRQ(omap_perseus2_init_irq) 186 .boot_params = 0x10000100,
187 INIT_MACHINE(omap_perseus2_init) 187 .map_io = omap_perseus2_map_io,
188 .init_irq = omap_perseus2_init_irq,
189 .init_machine = omap_perseus2_init,
188 .timer = &omap_timer, 190 .timer = &omap_timer,
189MACHINE_END 191MACHINE_END
diff --git a/arch/arm/mach-omap/board-voiceblue.c b/arch/arm/mach-omap/board-voiceblue.c
index f1a5bffac666..6b0c5003d719 100644
--- a/arch/arm/mach-omap/board-voiceblue.c
+++ b/arch/arm/mach-omap/board-voiceblue.c
@@ -246,11 +246,13 @@ EXPORT_SYMBOL(voiceblue_wdt_disable);
246EXPORT_SYMBOL(voiceblue_wdt_ping); 246EXPORT_SYMBOL(voiceblue_wdt_ping);
247 247
248MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") 248MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
249 MAINTAINER("Ladislav Michl <michl@2n.cz>") 249 /* Maintainer: Ladislav Michl <michl@2n.cz> */
250 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 250 .phys_ram = 0x10000000,
251 BOOT_PARAMS(0x10000100) 251 .phys_io = 0xfff00000,
252 MAPIO(voiceblue_map_io) 252 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
253 INITIRQ(voiceblue_init_irq) 253 .boot_params = 0x10000100,
254 INIT_MACHINE(voiceblue_init) 254 .map_io = voiceblue_map_io,
255 .timer = &omap_timer, 255 .init_irq = voiceblue_init_irq,
256 .init_machine = voiceblue_init,
257 .timer = &omap_timer,
256MACHINE_END 258MACHINE_END
diff --git a/arch/arm/mach-omap/pm.c b/arch/arm/mach-omap/pm.c
index 00fac155df2a..6b03ccdc1e92 100644
--- a/arch/arm/mach-omap/pm.c
+++ b/arch/arm/mach-omap/pm.c
@@ -41,7 +41,9 @@
41#include <linux/pm.h> 41#include <linux/pm.h>
42 42
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/mach/time.h>
44#include <asm/mach-types.h> 45#include <asm/mach-types.h>
46
45#include <asm/arch/omap16xx.h> 47#include <asm/arch/omap16xx.h>
46#include <asm/arch/pm.h> 48#include <asm/arch/pm.h>
47#include <asm/arch/mux.h> 49#include <asm/arch/mux.h>
@@ -80,13 +82,13 @@ void omap_pm_idle(void)
80 return; 82 return;
81 } 83 }
82 mask32 = omap_readl(ARM_SYSST); 84 mask32 = omap_readl(ARM_SYSST);
83 local_fiq_enable();
84 local_irq_enable();
85 85
86#if defined(CONFIG_OMAP_32K_TIMER) && defined(CONFIG_NO_IDLE_HZ) 86 /*
87 /* Override timer to use VST for the next cycle */ 87 * Since an interrupt may set up a timer, we don't want to
88 omap_32k_timer_next_vst_interrupt(); 88 * reprogram the hardware timer with interrupts enabled.
89#endif 89 * Re-enable interrupts only after returning from idle.
90 */
91 timer_dyn_reprogram();
90 92
91 if ((mask32 & DSP_IDLE) == 0) { 93 if ((mask32 & DSP_IDLE) == 0) {
92 __asm__ volatile ("mcr p15, 0, r0, c7, c0, 4"); 94 __asm__ volatile ("mcr p15, 0, r0, c7, c0, 4");
@@ -102,6 +104,8 @@ void omap_pm_idle(void)
102 104
103 func_ptr(); 105 func_ptr();
104 } 106 }
107 local_fiq_enable();
108 local_irq_enable();
105} 109}
106 110
107/* 111/*
diff --git a/arch/arm/mach-omap/time.c b/arch/arm/mach-omap/time.c
index 4205fdcb632c..dd34e9f4c413 100644
--- a/arch/arm/mach-omap/time.c
+++ b/arch/arm/mach-omap/time.c
@@ -4,7 +4,7 @@
4 * OMAP Timers 4 * OMAP Timers
5 * 5 *
6 * Copyright (C) 2004 Nokia Corporation 6 * Copyright (C) 2004 Nokia Corporation
7 * Partial timer rewrite and additional VST timer support by 7 * Partial timer rewrite and additional dynamic tick timer support by
8 * Tony Lindgen <tony@atomide.com> and 8 * Tony Lindgen <tony@atomide.com> and
9 * Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> 9 * Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
10 * 10 *
@@ -188,8 +188,8 @@ static irqreturn_t omap_mpu_timer_interrupt(int irq, void *dev_id,
188 188
189static struct irqaction omap_mpu_timer_irq = { 189static struct irqaction omap_mpu_timer_irq = {
190 .name = "mpu timer", 190 .name = "mpu timer",
191 .flags = SA_INTERRUPT, 191 .flags = SA_INTERRUPT | SA_TIMER,
192 .handler = omap_mpu_timer_interrupt 192 .handler = omap_mpu_timer_interrupt,
193}; 193};
194 194
195static unsigned long omap_mpu_timer1_overflows; 195static unsigned long omap_mpu_timer1_overflows;
@@ -203,7 +203,7 @@ static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id,
203static struct irqaction omap_mpu_timer1_irq = { 203static struct irqaction omap_mpu_timer1_irq = {
204 .name = "mpu timer1 overflow", 204 .name = "mpu timer1 overflow",
205 .flags = SA_INTERRUPT, 205 .flags = SA_INTERRUPT,
206 .handler = omap_mpu_timer1_interrupt 206 .handler = omap_mpu_timer1_interrupt,
207}; 207};
208 208
209static __init void omap_init_mpu_timer(void) 209static __init void omap_init_mpu_timer(void)
@@ -261,7 +261,6 @@ unsigned long long sched_clock(void)
261 * so with HZ = 100, TVR = 327.68. 261 * so with HZ = 100, TVR = 327.68.
262 */ 262 */
263#define OMAP_32K_TIMER_TICK_PERIOD ((32768 / HZ) - 1) 263#define OMAP_32K_TIMER_TICK_PERIOD ((32768 / HZ) - 1)
264#define MAX_SKIP_JIFFIES 25
265#define TIMER_32K_SYNCHRONIZED 0xfffbc410 264#define TIMER_32K_SYNCHRONIZED 0xfffbc410
266 265
267#define JIFFIES_TO_HW_TICKS(nr_jiffies, clock_rate) \ 266#define JIFFIES_TO_HW_TICKS(nr_jiffies, clock_rate) \
@@ -347,14 +346,55 @@ static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id,
347 return IRQ_HANDLED; 346 return IRQ_HANDLED;
348} 347}
349 348
349#ifdef CONFIG_NO_IDLE_HZ
350/*
351 * Programs the next timer interrupt needed. Called when dynamic tick is
352 * enabled, and to reprogram the ticks to skip from pm_idle. Note that
353 * we can keep the timer continuous, and don't need to set it to run in
354 * one-shot mode. This is because the timer will get reprogrammed again
355 * after next interrupt.
356 */
357void omap_32k_timer_reprogram(unsigned long next_tick)
358{
359 omap_32k_timer_start(JIFFIES_TO_HW_TICKS(next_tick, 32768) + 1);
360}
361
362static struct irqaction omap_32k_timer_irq;
363extern struct timer_update_handler timer_update;
364
365static int omap_32k_timer_enable_dyn_tick(void)
366{
367 /* No need to reprogram timer, just use the next interrupt */
368 return 0;
369}
370
371static int omap_32k_timer_disable_dyn_tick(void)
372{
373 omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD);
374 return 0;
375}
376
377static struct dyn_tick_timer omap_dyn_tick_timer = {
378 .enable = omap_32k_timer_enable_dyn_tick,
379 .disable = omap_32k_timer_disable_dyn_tick,
380 .reprogram = omap_32k_timer_reprogram,
381 .handler = omap_32k_timer_interrupt,
382};
383#endif /* CONFIG_NO_IDLE_HZ */
384
350static struct irqaction omap_32k_timer_irq = { 385static struct irqaction omap_32k_timer_irq = {
351 .name = "32KHz timer", 386 .name = "32KHz timer",
352 .flags = SA_INTERRUPT, 387 .flags = SA_INTERRUPT | SA_TIMER,
353 .handler = omap_32k_timer_interrupt 388 .handler = omap_32k_timer_interrupt,
354}; 389};
355 390
356static __init void omap_init_32k_timer(void) 391static __init void omap_init_32k_timer(void)
357{ 392{
393
394#ifdef CONFIG_NO_IDLE_HZ
395 omap_timer.dyn_tick = &omap_dyn_tick_timer;
396#endif
397
358 setup_irq(INT_OS_TIMER, &omap_32k_timer_irq); 398 setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
359 omap_timer.offset = omap_32k_timer_gettimeoffset; 399 omap_timer.offset = omap_32k_timer_gettimeoffset;
360 omap_32k_last_tick = omap_32k_sync_timer_read(); 400 omap_32k_last_tick = omap_32k_sync_timer_read();
diff --git a/arch/arm/mach-omap/usb.c b/arch/arm/mach-omap/usb.c
index 6e805d451d0e..fd483ff9f8fe 100644
--- a/arch/arm/mach-omap/usb.c
+++ b/arch/arm/mach-omap/usb.c
@@ -41,7 +41,6 @@
41 41
42/* These routines should handle the standard chip-specific modes 42/* These routines should handle the standard chip-specific modes
43 * for usb0/1/2 ports, covering basic mux and transceiver setup. 43 * for usb0/1/2 ports, covering basic mux and transceiver setup.
44 * Call omap_usb_init() once, from INIT_MACHINE().
45 * 44 *
46 * Some board-*.c files will need to set up additional mux options, 45 * Some board-*.c files will need to set up additional mux options,
47 * like for suspend handling, vbus sensing, GPIOs, and the D+ pullup. 46 * like for suspend handling, vbus sensing, GPIOs, and the D+ pullup.
@@ -288,8 +287,8 @@ static void usb_release(struct device *dev)
288static struct resource udc_resources[] = { 287static struct resource udc_resources[] = {
289 /* order is significant! */ 288 /* order is significant! */
290 { /* registers */ 289 { /* registers */
291 .start = IO_ADDRESS(UDC_BASE), 290 .start = UDC_BASE,
292 .end = IO_ADDRESS(UDC_BASE + 0xff), 291 .end = UDC_BASE + 0xff,
293 .flags = IORESOURCE_MEM, 292 .flags = IORESOURCE_MEM,
294 }, { /* general IRQ */ 293 }, { /* general IRQ */
295 .start = IH2_BASE + 20, 294 .start = IH2_BASE + 20,
@@ -355,8 +354,8 @@ static struct platform_device ohci_device = {
355static struct resource otg_resources[] = { 354static struct resource otg_resources[] = {
356 /* order is significant! */ 355 /* order is significant! */
357 { 356 {
358 .start = IO_ADDRESS(OTG_BASE), 357 .start = OTG_BASE,
359 .end = IO_ADDRESS(OTG_BASE + 0xff), 358 .end = OTG_BASE + 0xff,
360 .flags = IORESOURCE_MEM, 359 .flags = IORESOURCE_MEM,
361 }, { 360 }, {
362 .start = IH2_BASE + 8, 361 .start = IH2_BASE + 8,
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index c4e6d2523585..efc2f657184e 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -24,3 +24,7 @@ obj-$(CONFIG_LEDS) += $(led-y)
24 24
25# Misc features 25# Misc features
26obj-$(CONFIG_PM) += pm.o sleep.o 26obj-$(CONFIG_PM) += pm.o sleep.o
27
28ifeq ($(CONFIG_PXA27x),y)
29obj-$(CONFIG_PM) += standby.o
30endif
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index f691cf77d390..86b862f56e7e 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -287,34 +287,40 @@ static void __init corgi_map_io(void)
287 287
288#ifdef CONFIG_MACH_CORGI 288#ifdef CONFIG_MACH_CORGI
289MACHINE_START(CORGI, "SHARP Corgi") 289MACHINE_START(CORGI, "SHARP Corgi")
290 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 290 .phys_ram = 0xa0000000,
291 FIXUP(fixup_corgi) 291 .phys_io = 0x40000000,
292 MAPIO(corgi_map_io) 292 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
293 INITIRQ(corgi_init_irq) 293 .fixup = fixup_corgi,
294 .init_machine = corgi_init, 294 .map_io = corgi_map_io,
295 .timer = &pxa_timer, 295 .init_irq = corgi_init_irq,
296 .init_machine = corgi_init,
297 .timer = &pxa_timer,
296MACHINE_END 298MACHINE_END
297#endif 299#endif
298 300
299#ifdef CONFIG_MACH_SHEPHERD 301#ifdef CONFIG_MACH_SHEPHERD
300MACHINE_START(SHEPHERD, "SHARP Shepherd") 302MACHINE_START(SHEPHERD, "SHARP Shepherd")
301 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 303 .phys_ram = 0xa0000000,
302 FIXUP(fixup_corgi) 304 .phys_io = 0x40000000,
303 MAPIO(corgi_map_io) 305 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
304 INITIRQ(corgi_init_irq) 306 .fixup = fixup_corgi,
305 .init_machine = corgi_init, 307 .map_io = corgi_map_io,
306 .timer = &pxa_timer, 308 .init_irq = corgi_init_irq,
309 .init_machine = corgi_init,
310 .timer = &pxa_timer,
307MACHINE_END 311MACHINE_END
308#endif 312#endif
309 313
310#ifdef CONFIG_MACH_HUSKY 314#ifdef CONFIG_MACH_HUSKY
311MACHINE_START(HUSKY, "SHARP Husky") 315MACHINE_START(HUSKY, "SHARP Husky")
312 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 316 .phys_ram = 0xa0000000,
313 FIXUP(fixup_corgi) 317 .phys_io = 0x40000000,
314 MAPIO(corgi_map_io) 318 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
315 INITIRQ(corgi_init_irq) 319 .fixup = fixup_corgi,
316 .init_machine = corgi_init, 320 .map_io = corgi_map_io,
317 .timer = &pxa_timer, 321 .init_irq = corgi_init_irq,
322 .init_machine = corgi_init,
323 .timer = &pxa_timer,
318MACHINE_END 324MACHINE_END
319#endif 325#endif
320 326
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index c5a66bf4d3d5..386e107b53cc 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -181,10 +181,12 @@ static void __init idp_map_io(void)
181 181
182 182
183MACHINE_START(PXA_IDP, "Vibren PXA255 IDP") 183MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
184 MAINTAINER("Vibren Technologies") 184 /* Maintainer: Vibren Technologies */
185 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 185 .phys_ram = 0xa0000000,
186 MAPIO(idp_map_io) 186 .phys_io = 0x40000000,
187 INITIRQ(idp_init_irq) 187 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
188 .map_io = idp_map_io,
189 .init_irq = idp_init_irq,
188 .timer = &pxa_timer, 190 .timer = &pxa_timer,
189 INIT_MACHINE(idp_init) 191 .init_machine = idp_init,
190MACHINE_END 192MACHINE_END
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index f2c9e0d2b24b..6309853b59be 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -268,10 +268,12 @@ static void __init lubbock_map_io(void)
268} 268}
269 269
270MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)") 270MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
271 MAINTAINER("MontaVista Software Inc.") 271 /* Maintainer: MontaVista Software Inc. */
272 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 272 .phys_ram = 0xa0000000,
273 MAPIO(lubbock_map_io) 273 .phys_io = 0x40000000,
274 INITIRQ(lubbock_init_irq) 274 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
275 .map_io = lubbock_map_io,
276 .init_irq = lubbock_init_irq,
275 .timer = &pxa_timer, 277 .timer = &pxa_timer,
276 INIT_MACHINE(lubbock_init) 278 .init_machine = lubbock_init,
277MACHINE_END 279MACHINE_END
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 9896afca751f..827b7b5a5be8 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -345,10 +345,12 @@ static void __init mainstone_map_io(void)
345} 345}
346 346
347MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") 347MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
348 MAINTAINER("MontaVista Software Inc.") 348 /* Maintainer: MontaVista Software Inc. */
349 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 349 .phys_ram = 0xa0000000,
350 MAPIO(mainstone_map_io) 350 .phys_io = 0x40000000,
351 INITIRQ(mainstone_init_irq) 351 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
352 .map_io = mainstone_map_io,
353 .init_irq = mainstone_init_irq,
352 .timer = &pxa_timer, 354 .timer = &pxa_timer,
353 INIT_MACHINE(mainstone_init) 355 .init_machine = mainstone_init,
354MACHINE_END 356MACHINE_END
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index b6c746ea3830..0e4f6fab100a 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -180,10 +180,12 @@ static void __init poodle_map_io(void)
180} 180}
181 181
182MACHINE_START(POODLE, "SHARP Poodle") 182MACHINE_START(POODLE, "SHARP Poodle")
183 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 183 .phys_ram = 0xa0000000,
184 FIXUP(fixup_poodle) 184 .phys_io = 0x40000000,
185 MAPIO(poodle_map_io) 185 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
186 INITIRQ(pxa_init_irq) 186 .fixup = fixup_poodle,
187 .timer = &pxa_timer, 187 .map_io = poodle_map_io,
188 .init_machine = poodle_init, 188 .init_irq = pxa_init_irq,
189 .timer = &pxa_timer,
190 .init_machine = poodle_init,
189MACHINE_END 191MACHINE_END
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 893964fb9659..9a791b07118d 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -126,6 +126,7 @@ int pxa_cpu_pm_prepare(suspend_state_t state)
126{ 126{
127 switch (state) { 127 switch (state) {
128 case PM_SUSPEND_MEM: 128 case PM_SUSPEND_MEM:
129 case PM_SUSPEND_STANDBY:
129 return 0; 130 return 0;
130 default: 131 default:
131 return -EINVAL; 132 return -EINVAL;
@@ -138,7 +139,10 @@ void pxa_cpu_pm_enter(suspend_state_t state)
138 extern void pxa_cpu_suspend(unsigned int); 139 extern void pxa_cpu_suspend(unsigned int);
139 extern void pxa_cpu_resume(void); 140 extern void pxa_cpu_resume(void);
140 141
141 CKEN = CKEN22_MEMC | CKEN9_OSTIMER; 142 if (state == PM_SUSPEND_STANDBY)
143 CKEN = CKEN22_MEMC | CKEN9_OSTIMER | CKEN16_LCD |CKEN0_PWM0;
144 else
145 CKEN = CKEN22_MEMC | CKEN9_OSTIMER;
142 146
143 /* ensure voltage-change sequencer not initiated, which hangs */ 147 /* ensure voltage-change sequencer not initiated, which hangs */
144 PCFR &= ~PCFR_FVC; 148 PCFR &= ~PCFR_FVC;
@@ -147,6 +151,9 @@ void pxa_cpu_pm_enter(suspend_state_t state)
147 PEDR = 0xDF12FE1B; 151 PEDR = 0xDF12FE1B;
148 152
149 switch (state) { 153 switch (state) {
154 case PM_SUSPEND_STANDBY:
155 pxa_cpu_standby();
156 break;
150 case PM_SUSPEND_MEM: 157 case PM_SUSPEND_MEM:
151 /* set resume return address */ 158 /* set resume return address */
152 PSPR = virt_to_phys(pxa_cpu_resume); 159 PSPR = virt_to_phys(pxa_cpu_resume);
diff --git a/arch/arm/mach-pxa/standby.S b/arch/arm/mach-pxa/standby.S
new file mode 100644
index 000000000000..8a3f27b76784
--- /dev/null
+++ b/arch/arm/mach-pxa/standby.S
@@ -0,0 +1,32 @@
1/*
2 * PXA27x standby mode
3 *
4 * Author: David Burrage
5 *
6 * 2005 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/config.h>
13#include <linux/linkage.h>
14#include <asm/assembler.h>
15#include <asm/hardware.h>
16
17#include <asm/arch/pxa-regs.h>
18
19 .text
20
21ENTRY(pxa_cpu_standby)
22 ldr r0, =PSSR
23 mov r1, #(PSSR_PH | PSSR_STS)
24 mov r2, #2
25 mov r3, #UNCACHED_PHYS_0 @ Read mem context in.
26 ldr ip, [r3]
27 b 1f
28
29 .align 5
301: mcr p14, 0, r2, c7, c0, 0 @ put the system into Standby
31 str r1, [r0] @ make sure PSSR_PH/STS are clear
32 mov pc, lr
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 473fb6173f72..6e5202154f91 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -105,8 +105,8 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
105 105
106static struct irqaction pxa_timer_irq = { 106static struct irqaction pxa_timer_irq = {
107 .name = "PXA Timer Tick", 107 .name = "PXA Timer Tick",
108 .flags = SA_INTERRUPT, 108 .flags = SA_INTERRUPT | SA_TIMER,
109 .handler = pxa_timer_interrupt 109 .handler = pxa_timer_interrupt,
110}; 110};
111 111
112static void __init pxa_timer_init(void) 112static void __init pxa_timer_init(void)
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index 437106881436..a10268618f74 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -163,12 +163,14 @@ arch_initcall(rpc_init);
163extern struct sys_timer ioc_timer; 163extern struct sys_timer ioc_timer;
164 164
165MACHINE_START(RISCPC, "Acorn-RiscPC") 165MACHINE_START(RISCPC, "Acorn-RiscPC")
166 MAINTAINER("Russell King") 166 /* Maintainer: Russell King */
167 BOOT_MEM(0x10000000, 0x03000000, 0xe0000000) 167 .phys_ram = 0x10000000,
168 BOOT_PARAMS(0x10000100) 168 .phys_io = 0x03000000,
169 DISABLE_PARPORT(0) 169 .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
170 DISABLE_PARPORT(1) 170 .boot_params = 0x10000100,
171 MAPIO(rpc_map_io) 171 .reserve_lp0 = 1,
172 INITIRQ(rpc_init_irq) 172 .reserve_lp1 = 1,
173 .map_io = rpc_map_io,
174 .init_irq = rpc_init_irq,
173 .timer = &ioc_timer, 175 .timer = &ioc_timer,
174MACHINE_END 176MACHINE_END
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 534df0c6c770..d4d03d0daaec 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -154,6 +154,11 @@ config S3C2410_PM_CHECK_CHUNKSIZE
154 the CRC data block will take more memory, but wil identify any 154 the CRC data block will take more memory, but wil identify any
155 faults with better precision. 155 faults with better precision.
156 156
157config PM_SIMTEC
158 bool
159 depends on PM && (ARCH_BAST || MACH_VR1000)
160 default y
161
157config S3C2410_LOWLEVEL_UART_PORT 162config S3C2410_LOWLEVEL_UART_PORT
158 int "S3C2410 UART to use for low-level messages" 163 int "S3C2410 UART to use for low-level messages"
159 default 0 164 default 0
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
index 7c379aad5d62..f99b689e4392 100644
--- a/arch/arm/mach-s3c2410/Makefile
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_S3C2410_DMA) += dma.o
18# Power Management support 18# Power Management support
19 19
20obj-$(CONFIG_PM) += pm.o sleep.o 20obj-$(CONFIG_PM) += pm.o sleep.o
21obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o
21 22
22# S3C2440 support 23# S3C2440 support
23 24
diff --git a/arch/arm/mach-s3c2410/devs.c b/arch/arm/mach-s3c2410/devs.c
index 64792f678668..4664bd11adc1 100644
--- a/arch/arm/mach-s3c2410/devs.c
+++ b/arch/arm/mach-s3c2410/devs.c
@@ -96,8 +96,8 @@ struct platform_device s3c_device_lcd = {
96 .num_resources = ARRAY_SIZE(s3c_lcd_resource), 96 .num_resources = ARRAY_SIZE(s3c_lcd_resource),
97 .resource = s3c_lcd_resource, 97 .resource = s3c_lcd_resource,
98 .dev = { 98 .dev = {
99 .dma_mask = &s3c_device_lcd_dmamask, 99 .dma_mask = &s3c_device_lcd_dmamask,
100 .coherent_dma_mask = 0xffffffffUL 100 .coherent_dma_mask = 0xffffffffUL
101 } 101 }
102}; 102};
103 103
diff --git a/arch/arm/mach-s3c2410/irq.c b/arch/arm/mach-s3c2410/irq.c
index b668c48f4399..cf9f46d88061 100644
--- a/arch/arm/mach-s3c2410/irq.c
+++ b/arch/arm/mach-s3c2410/irq.c
@@ -40,8 +40,11 @@
40 * 04-Nov-2004 Ben Dooks 40 * 04-Nov-2004 Ben Dooks
41 * Fix standard IRQ wake for EINT0..4 and RTC 41 * Fix standard IRQ wake for EINT0..4 and RTC
42 * 42 *
43 * 22-Feb-2004 Ben Dooks 43 * 22-Feb-2005 Ben Dooks
44 * Fixed edge-triggering on ADC IRQ 44 * Fixed edge-triggering on ADC IRQ
45 *
46 * 28-Jun-2005 Ben Dooks
47 * Mark IRQ_LCD valid
45*/ 48*/
46 49
47#include <linux/init.h> 50#include <linux/init.h>
@@ -366,7 +369,6 @@ static struct irqchip s3c_irq_eint0t4 = {
366#define INTMSK_UART1 (1UL << (IRQ_UART1 - IRQ_EINT0)) 369#define INTMSK_UART1 (1UL << (IRQ_UART1 - IRQ_EINT0))
367#define INTMSK_UART2 (1UL << (IRQ_UART2 - IRQ_EINT0)) 370#define INTMSK_UART2 (1UL << (IRQ_UART2 - IRQ_EINT0))
368#define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0)) 371#define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))
369#define INTMSK_LCD (1UL << (IRQ_LCD - IRQ_EINT0))
370 372
371static inline void 373static inline void
372s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit, 374s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
@@ -716,7 +718,6 @@ void __init s3c24xx_init_irq(void)
716 case IRQ_UART0: 718 case IRQ_UART0:
717 case IRQ_UART1: 719 case IRQ_UART1:
718 case IRQ_UART2: 720 case IRQ_UART2:
719 case IRQ_LCD:
720 case IRQ_ADCPARENT: 721 case IRQ_ADCPARENT:
721 set_irq_chip(irqno, &s3c_irq_level_chip); 722 set_irq_chip(irqno, &s3c_irq_level_chip);
722 set_irq_handler(irqno, do_level_IRQ); 723 set_irq_handler(irqno, do_level_IRQ);
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index f3e970039b65..ccb6bcefa46c 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -27,6 +27,7 @@
27 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 27 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
28 * 14-Mar-2006 BJD Updated for __iomem changes 28 * 14-Mar-2006 BJD Updated for __iomem changes
29 * 22-Jun-2006 BJD Added DM9000 platform information 29 * 22-Jun-2006 BJD Added DM9000 platform information
30 * 28-Jun-2006 BJD Moved pm functionality out to common code
30*/ 31*/
31 32
32#include <linux/kernel.h> 33#include <linux/kernel.h>
@@ -67,7 +68,6 @@
67#include "devs.h" 68#include "devs.h"
68#include "cpu.h" 69#include "cpu.h"
69#include "usb-simtec.h" 70#include "usb-simtec.h"
70#include "pm.h"
71 71
72#define COPYRIGHT ", (c) 2004-2005 Simtec Electronics" 72#define COPYRIGHT ", (c) 2004-2005 Simtec Electronics"
73 73
@@ -405,44 +405,14 @@ void __init bast_map_io(void)
405 usb_simtec_init(); 405 usb_simtec_init();
406} 406}
407 407
408void __init bast_init_irq(void)
409{
410 s3c24xx_init_irq();
411}
412
413#ifdef CONFIG_PM
414
415/* bast_init_machine
416 *
417 * enable the power management functions for the EB2410ITX
418*/
419
420static __init void bast_init_machine(void)
421{
422 unsigned long gstatus4;
423
424 printk(KERN_INFO "BAST Power Manangement" COPYRIGHT "\n");
425
426 gstatus4 = (__raw_readl(S3C2410_BANKCON7) & 0x3) << 30;
427 gstatus4 |= (__raw_readl(S3C2410_BANKCON6) & 0x3) << 28;
428 gstatus4 |= (__raw_readl(S3C2410_BANKSIZE) & S3C2410_BANKSIZE_MASK);
429
430 __raw_writel(gstatus4, S3C2410_GSTATUS4);
431
432 s3c2410_pm_init();
433}
434
435#else
436#define bast_init_machine NULL
437#endif
438
439 408
440MACHINE_START(BAST, "Simtec-BAST") 409MACHINE_START(BAST, "Simtec-BAST")
441 MAINTAINER("Ben Dooks <ben@simtec.co.uk>") 410 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
442 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 411 .phys_ram = S3C2410_SDRAM_PA,
443 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 412 .phys_io = S3C2410_PA_UART,
444 MAPIO(bast_map_io) 413 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
445 INITIRQ(bast_init_irq) 414 .boot_params = S3C2410_SDRAM_PA + 0x100,
446 .init_machine = bast_init_machine, 415 .map_io = bast_map_io,
416 .init_irq = s3c24xx_init_irq,
447 .timer = &s3c24xx_timer, 417 .timer = &s3c24xx_timer,
448MACHINE_END 418MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 2924afc068a4..ea4fb1a97a50 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -117,10 +117,12 @@ void __init h1940_init_irq(void)
117} 117}
118 118
119MACHINE_START(H1940, "IPAQ-H1940") 119MACHINE_START(H1940, "IPAQ-H1940")
120 MAINTAINER("Ben Dooks <ben@fluff.org>") 120 /* Maintainer: Ben Dooks <ben@fluff.org> */
121 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 121 .phys_ram = S3C2410_SDRAM_PA,
122 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 122 .phys_io = S3C2410_PA_UART,
123 MAPIO(h1940_map_io) 123 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
124 INITIRQ(h1940_init_irq) 124 .boot_params = S3C2410_SDRAM_PA + 0x100,
125 .map_io = h1940_map_io,
126 .init_irq = h1940_init_irq,
125 .timer = &s3c24xx_timer, 127 .timer = &s3c24xx_timer,
126MACHINE_END 128MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index bd15998c129b..79044d9bce38 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -137,10 +137,11 @@ void __init n30_init(void)
137} 137}
138 138
139MACHINE_START(N30, "Acer-N30") 139MACHINE_START(N30, "Acer-N30")
140 MAINTAINER("Christer Weinigel <christer@weinigel.se>, Ben Dooks <ben-linux@fluff.org>") 140 /* Maintainer: Christer Weinigel <christer@weinigel.se>, Ben Dooks <ben-linux@fluff.org> */
141 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 141 .phys_ram = S3C2410_SDRAM_PA,
142 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 142 .phys_io = S3C2410_PA_UART,
143 143 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
144 .boot_params = S3C2410_SDRAM_PA + 0x100,
144 .timer = &s3c24xx_timer, 145 .timer = &s3c24xx_timer,
145 .init_machine = n30_init, 146 .init_machine = n30_init,
146 .init_irq = n30_init_irq, 147 .init_irq = n30_init_irq,
diff --git a/arch/arm/mach-s3c2410/mach-nexcoder.c b/arch/arm/mach-s3c2410/mach-nexcoder.c
index 70487bf4b71e..d24c242414ca 100644
--- a/arch/arm/mach-s3c2410/mach-nexcoder.c
+++ b/arch/arm/mach-s3c2410/mach-nexcoder.c
@@ -147,9 +147,11 @@ void __init nexcoder_map_io(void)
147 147
148 148
149MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440") 149MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
150 MAINTAINER("Guillaume GOURAT <guillaume.gourat@nexvision.tv>") 150 /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
151 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 151 .phys_ram = S3C2410_SDRAM_PA,
152 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 152 .phys_io = S3C2410_PA_UART,
153 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
154 .boot_params = S3C2410_SDRAM_PA + 0x100,
153 .map_io = nexcoder_map_io, 155 .map_io = nexcoder_map_io,
154 .init_irq = s3c24xx_init_irq, 156 .init_irq = s3c24xx_init_irq,
155 .timer = &s3c24xx_timer, 157 .timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c2410/mach-otom.c
index 67d8ce8fb00f..d901ed492ff5 100644
--- a/arch/arm/mach-s3c2410/mach-otom.c
+++ b/arch/arm/mach-s3c2410/mach-otom.c
@@ -115,9 +115,11 @@ void __init otom11_map_io(void)
115 115
116 116
117MACHINE_START(OTOM, "Nex Vision - Otom 1.1") 117MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
118 MAINTAINER("Guillaume GOURAT <guillaume.gourat@nexvision.tv>") 118 /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
119 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 119 .phys_ram = S3C2410_SDRAM_PA,
120 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 120 .phys_io = S3C2410_PA_UART,
121 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
122 .boot_params = S3C2410_SDRAM_PA + 0x100,
121 .map_io = otom11_map_io, 123 .map_io = otom11_map_io,
122 .init_irq = s3c24xx_init_irq, 124 .init_irq = s3c24xx_init_irq,
123 .timer = &s3c24xx_timer, 125 .timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-rx3715.c b/arch/arm/mach-s3c2410/mach-rx3715.c
index f8d3a9784e71..a73d61c1de46 100644
--- a/arch/arm/mach-s3c2410/mach-rx3715.c
+++ b/arch/arm/mach-s3c2410/mach-rx3715.c
@@ -131,11 +131,13 @@ static void __init rx3715_init_machine(void)
131#endif 131#endif
132 132
133MACHINE_START(RX3715, "IPAQ-RX3715") 133MACHINE_START(RX3715, "IPAQ-RX3715")
134 MAINTAINER("Ben Dooks <ben@fluff.org>") 134 /* Maintainer: Ben Dooks <ben@fluff.org> */
135 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 135 .phys_ram = S3C2410_SDRAM_PA,
136 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 136 .phys_io = S3C2410_PA_UART,
137 MAPIO(rx3715_map_io) 137 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
138 INITIRQ(rx3715_init_irq) 138 .boot_params = S3C2410_SDRAM_PA + 0x100,
139 INIT_MACHINE(rx3715_init_machine) 139 .map_io = rx3715_map_io,
140 .init_irq = rx3715_init_irq,
141 .init_machine = rx3715_init_machine,
140 .timer = &s3c24xx_timer, 142 .timer = &s3c24xx_timer,
141MACHINE_END 143MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
index c1a4a1420ea0..67e903a700d3 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -112,11 +112,13 @@ void __init smdk2410_init_irq(void)
112 112
113MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch 113MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
114 * to SMDK2410 */ 114 * to SMDK2410 */
115 MAINTAINER("Jonas Dietsche") 115 /* Maintainer: Jonas Dietsche */
116 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 116 .phys_ram = S3C2410_SDRAM_PA,
117 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 117 .phys_io = S3C2410_PA_UART,
118 MAPIO(smdk2410_map_io) 118 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
119 INITIRQ(smdk2410_init_irq) 119 .boot_params = S3C2410_SDRAM_PA + 0x100,
120 .map_io = smdk2410_map_io,
121 .init_irq = smdk2410_init_irq,
120 .timer = &s3c24xx_timer, 122 .timer = &s3c24xx_timer,
121MACHINE_END 123MACHINE_END
122 124
diff --git a/arch/arm/mach-s3c2410/mach-smdk2440.c b/arch/arm/mach-s3c2410/mach-smdk2440.c
index 7857176d9bcb..357522106f68 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2440.c
@@ -124,9 +124,11 @@ void __init smdk2440_machine_init(void)
124} 124}
125 125
126MACHINE_START(S3C2440, "SMDK2440") 126MACHINE_START(S3C2440, "SMDK2440")
127 MAINTAINER("Ben Dooks <ben@fluff.org>") 127 /* Maintainer: Ben Dooks <ben@fluff.org> */
128 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 128 .phys_ram = S3C2410_SDRAM_PA,
129 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 129 .phys_io = S3C2410_PA_UART,
130 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
131 .boot_params = S3C2410_SDRAM_PA + 0x100,
130 132
131 .init_irq = s3c24xx_init_irq, 133 .init_irq = s3c24xx_init_irq,
132 .map_io = smdk2440_map_io, 134 .map_io = smdk2440_map_io,
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 76be074944a0..924e8464c212 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -371,16 +371,14 @@ void __init vr1000_map_io(void)
371 usb_simtec_init(); 371 usb_simtec_init();
372} 372}
373 373
374void __init vr1000_init_irq(void)
375{
376 s3c24xx_init_irq();
377}
378 374
379MACHINE_START(VR1000, "Thorcom-VR1000") 375MACHINE_START(VR1000, "Thorcom-VR1000")
380 MAINTAINER("Ben Dooks <ben@simtec.co.uk>") 376 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
381 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 377 .phys_ram = S3C2410_SDRAM_PA,
382 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 378 .phys_io = S3C2410_PA_UART,
383 MAPIO(vr1000_map_io) 379 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
384 INITIRQ(vr1000_init_irq) 380 .boot_params = S3C2410_SDRAM_PA + 0x100,
381 .map_io = vr1000_map_io,
382 .init_irq = s3c24xx_init_irq,
385 .timer = &s3c24xx_timer, 383 .timer = &s3c24xx_timer,
386MACHINE_END 384MACHINE_END
diff --git a/arch/arm/mach-s3c2410/pm-simtec.c b/arch/arm/mach-s3c2410/pm-simtec.c
new file mode 100644
index 000000000000..2cb798832223
--- /dev/null
+++ b/arch/arm/mach-s3c2410/pm-simtec.c
@@ -0,0 +1,65 @@
1/* linux/arch/arm/mach-s3c2410/pm-simtec.c
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://armlinux.simtec.co.uk/
7 *
8 * Power Management helpers for Simtec S3C24XX implementations
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/interrupt.h>
18#include <linux/list.h>
19#include <linux/timer.h>
20#include <linux/init.h>
21#include <linux/device.h>
22
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25
26#include <asm/hardware.h>
27#include <asm/io.h>
28
29#include <asm/arch/map.h>
30#include <asm/arch/regs-serial.h>
31#include <asm/arch/regs-gpio.h>
32#include <asm/arch/regs-mem.h>
33
34#include <asm/mach-types.h>
35
36#include "pm.h"
37
38#define COPYRIGHT ", (c) 2005 Simtec Electronics"
39
40/* pm_simtec_init
41 *
42 * enable the power management functions
43*/
44
45static __init int pm_simtec_init(void)
46{
47 unsigned long gstatus4;
48
49 /* check which machine we are running on */
50
51 if (!machine_is_bast() && !machine_is_vr1000())
52 return 0;
53
54 printk(KERN_INFO "Simtec Board Power Manangement" COPYRIGHT "\n");
55
56 gstatus4 = (__raw_readl(S3C2410_BANKCON7) & 0x3) << 30;
57 gstatus4 |= (__raw_readl(S3C2410_BANKCON6) & 0x3) << 28;
58 gstatus4 |= (__raw_readl(S3C2410_BANKSIZE) & S3C2410_BANKSIZE_MASK);
59
60 __raw_writel(gstatus4, S3C2410_GSTATUS4);
61
62 return s3c2410_pm_init();
63}
64
65arch_initcall(pm_simtec_init);
diff --git a/arch/arm/mach-s3c2410/time.c b/arch/arm/mach-s3c2410/time.c
index 179f0e031af4..765a3a9ae032 100644
--- a/arch/arm/mach-s3c2410/time.c
+++ b/arch/arm/mach-s3c2410/time.c
@@ -137,8 +137,8 @@ s3c2410_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
137 137
138static struct irqaction s3c2410_timer_irq = { 138static struct irqaction s3c2410_timer_irq = {
139 .name = "S3C2410 Timer Tick", 139 .name = "S3C2410 Timer Tick",
140 .flags = SA_INTERRUPT, 140 .flags = SA_INTERRUPT | SA_TIMER,
141 .handler = s3c2410_timer_interrupt 141 .handler = s3c2410_timer_interrupt,
142}; 142};
143 143
144/* 144/*
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index bedf88fafe08..4d4d303ee3a8 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -431,11 +431,13 @@ static void __init assabet_map_io(void)
431 431
432 432
433MACHINE_START(ASSABET, "Intel-Assabet") 433MACHINE_START(ASSABET, "Intel-Assabet")
434 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 434 .phys_ram = 0xc0000000,
435 BOOT_PARAMS(0xc0000100) 435 .phys_io = 0x80000000,
436 FIXUP(fixup_assabet) 436 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
437 MAPIO(assabet_map_io) 437 .boot_params = 0xc0000100,
438 INITIRQ(sa1100_init_irq) 438 .fixup = fixup_assabet,
439 .map_io = assabet_map_io,
440 .init_irq = sa1100_init_irq,
439 .timer = &sa1100_timer, 441 .timer = &sa1100_timer,
440 .init_machine = assabet_init, 442 .init_machine = assabet_init,
441MACHINE_END 443MACHINE_END
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index 6a60b497ab42..b6169cb09196 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -285,9 +285,11 @@ static void __init badge4_map_io(void)
285} 285}
286 286
287MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4") 287MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
288 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 288 .phys_ram = 0xc0000000,
289 BOOT_PARAMS(0xc0000100) 289 .phys_io = 0x80000000,
290 MAPIO(badge4_map_io) 290 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
291 INITIRQ(sa1100_init_irq) 291 .boot_params = 0xc0000100,
292 .map_io = badge4_map_io,
293 .init_irq = sa1100_init_irq,
292 .timer = &sa1100_timer, 294 .timer = &sa1100_timer,
293MACHINE_END 295MACHINE_END
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index f8edde5e7cbf..0aa918e24c31 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -123,10 +123,12 @@ static void __init cerf_init(void)
123} 123}
124 124
125MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") 125MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
126 MAINTAINER("support@intrinsyc.com") 126 /* Maintainer: support@intrinsyc.com */
127 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 127 .phys_ram = 0xc0000000,
128 MAPIO(cerf_map_io) 128 .phys_io = 0x80000000,
129 INITIRQ(cerf_init_irq) 129 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
130 .map_io = cerf_map_io,
131 .init_irq = cerf_init_irq,
130 .timer = &sa1100_timer, 132 .timer = &sa1100_timer,
131 .init_machine = cerf_init, 133 .init_machine = cerf_init,
132MACHINE_END 134MACHINE_END
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 99287890d396..8cb69113a57c 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -184,9 +184,11 @@ static void __init collie_map_io(void)
184} 184}
185 185
186MACHINE_START(COLLIE, "Sharp-Collie") 186MACHINE_START(COLLIE, "Sharp-Collie")
187 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 187 .phys_ram = 0xc0000000,
188 MAPIO(collie_map_io) 188 .phys_io = 0x80000000,
189 INITIRQ(sa1100_init_irq) 189 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
190 .map_io = collie_map_io,
191 .init_irq = sa1100_init_irq,
190 .timer = &sa1100_timer, 192 .timer = &sa1100_timer,
191 .init_machine = collie_init, 193 .init_machine = collie_init,
192MACHINE_END 194MACHINE_END
diff --git a/arch/arm/mach-sa1100/cpu-sa1110.c b/arch/arm/mach-sa1100/cpu-sa1110.c
index 8d2a89a2ea01..04c94ab6c18b 100644
--- a/arch/arm/mach-sa1100/cpu-sa1110.c
+++ b/arch/arm/mach-sa1100/cpu-sa1110.c
@@ -271,8 +271,7 @@ static int sa1110_target(struct cpufreq_policy *policy,
271 */ 271 */
272 sdram_set_refresh(2); 272 sdram_set_refresh(2);
273 if (!irqs_disabled()) { 273 if (!irqs_disabled()) {
274 set_current_state(TASK_UNINTERRUPTIBLE); 274 msleep(20);
275 schedule_timeout(20 * HZ / 1000);
276 } else { 275 } else {
277 mdelay(20); 276 mdelay(20);
278 } 277 }
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index 84c86543501a..e7aa2681ca64 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -380,10 +380,12 @@ static void __init h3100_map_io(void)
380} 380}
381 381
382MACHINE_START(H3100, "Compaq iPAQ H3100") 382MACHINE_START(H3100, "Compaq iPAQ H3100")
383 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 383 .phys_ram = 0xc0000000,
384 BOOT_PARAMS(0xc0000100) 384 .phys_io = 0x80000000,
385 MAPIO(h3100_map_io) 385 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
386 INITIRQ(sa1100_init_irq) 386 .boot_params = 0xc0000100,
387 .map_io = h3100_map_io,
388 .init_irq = sa1100_init_irq,
387 .timer = &sa1100_timer, 389 .timer = &sa1100_timer,
388 .init_machine = h3xxx_mach_init, 390 .init_machine = h3xxx_mach_init,
389MACHINE_END 391MACHINE_END
@@ -496,10 +498,12 @@ static void __init h3600_map_io(void)
496} 498}
497 499
498MACHINE_START(H3600, "Compaq iPAQ H3600") 500MACHINE_START(H3600, "Compaq iPAQ H3600")
499 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 501 .phys_ram = 0xc0000000,
500 BOOT_PARAMS(0xc0000100) 502 .phys_io = 0x80000000,
501 MAPIO(h3600_map_io) 503 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
502 INITIRQ(sa1100_init_irq) 504 .boot_params = 0xc0000100,
505 .map_io = h3600_map_io,
506 .init_irq = sa1100_init_irq,
503 .timer = &sa1100_timer, 507 .timer = &sa1100_timer,
504 .init_machine = h3xxx_mach_init, 508 .init_machine = h3xxx_mach_init,
505MACHINE_END 509MACHINE_END
@@ -727,7 +731,7 @@ static void h3800_IRQ_demux(unsigned int irq, struct irqdesc *desc, struct pt_re
727static struct irqaction h3800_irq = { 731static struct irqaction h3800_irq = {
728 .name = "h3800_asic", 732 .name = "h3800_asic",
729 .handler = h3800_IRQ_demux, 733 .handler = h3800_IRQ_demux,
730 .flags = SA_INTERRUPT, 734 .flags = SA_INTERRUPT | SA_TIMER,
731}; 735};
732 736
733u32 kpio_int_shadow = 0; 737u32 kpio_int_shadow = 0;
@@ -881,10 +885,12 @@ static void __init h3800_map_io(void)
881} 885}
882 886
883MACHINE_START(H3800, "Compaq iPAQ H3800") 887MACHINE_START(H3800, "Compaq iPAQ H3800")
884 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 888 .phys_ram = 0xc0000000,
885 BOOT_PARAMS(0xc0000100) 889 .phys_io = 0x80000000,
886 MAPIO(h3800_map_io) 890 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
887 INITIRQ(h3800_init_irq) 891 .boot_params = 0xc0000100,
892 .map_io = h3800_map_io,
893 .init_irq = h3800_init_irq,
888 .timer = &sa1100_timer, 894 .timer = &sa1100_timer,
889 .init_machine = h3xxx_mach_init, 895 .init_machine = h3xxx_mach_init,
890MACHINE_END 896MACHINE_END
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index 570841779714..502d65cfe654 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -191,10 +191,12 @@ static void __init hackkit_init(void)
191 */ 191 */
192 192
193MACHINE_START(HACKKIT, "HackKit Cpu Board") 193MACHINE_START(HACKKIT, "HackKit Cpu Board")
194 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 194 .phys_ram = 0xc0000000,
195 BOOT_PARAMS(0xc0000100) 195 .phys_io = 0x80000000,
196 MAPIO(hackkit_map_io) 196 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
197 INITIRQ(sa1100_init_irq) 197 .boot_params = 0xc0000100,
198 .map_io = hackkit_map_io,
199 .init_irq = sa1100_init_irq,
198 .timer = &sa1100_timer, 200 .timer = &sa1100_timer,
199 .init_machine = hackkit_init, 201 .init_machine = hackkit_init,
200MACHINE_END 202MACHINE_END
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index 6be78291a878..eee3cbc5ec4f 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -97,9 +97,11 @@ static void __init jornada720_map_io(void)
97} 97}
98 98
99MACHINE_START(JORNADA720, "HP Jornada 720") 99MACHINE_START(JORNADA720, "HP Jornada 720")
100 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 100 .phys_ram = 0xc0000000,
101 BOOT_PARAMS(0xc0000100) 101 .phys_io = 0x80000000,
102 MAPIO(jornada720_map_io) 102 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
103 INITIRQ(sa1100_init_irq) 103 .boot_params = 0xc0000100,
104 .map_io = jornada720_map_io,
105 .init_irq = sa1100_init_irq,
104 .timer = &sa1100_timer, 106 .timer = &sa1100_timer,
105MACHINE_END 107MACHINE_END
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index 51c08ccfb8db..870b488aeda4 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -41,9 +41,11 @@ static void __init lart_map_io(void)
41} 41}
42 42
43MACHINE_START(LART, "LART") 43MACHINE_START(LART, "LART")
44 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 44 .phys_ram = 0xc0000000,
45 BOOT_PARAMS(0xc0000100) 45 .phys_io = 0x80000000,
46 MAPIO(lart_map_io) 46 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
47 INITIRQ(sa1100_init_irq) 47 .boot_params = 0xc0000100,
48 .map_io = lart_map_io,
49 .init_irq = sa1100_init_irq,
48 .timer = &sa1100_timer, 50 .timer = &sa1100_timer,
49MACHINE_END 51MACHINE_END
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c
index 5606bd71b024..e17b58fb9c9c 100644
--- a/arch/arm/mach-sa1100/pleb.c
+++ b/arch/arm/mach-sa1100/pleb.c
@@ -146,9 +146,11 @@ static void __init pleb_map_io(void)
146} 146}
147 147
148MACHINE_START(PLEB, "PLEB") 148MACHINE_START(PLEB, "PLEB")
149 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 149 .phys_ram = 0xc0000000,
150 MAPIO(pleb_map_io) 150 .phys_io = 0x80000000,
151 INITIRQ(sa1100_init_irq) 151 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
152 .map_io = pleb_map_io,
153 .init_irq = sa1100_init_irq,
152 .timer = &sa1100_timer, 154 .timer = &sa1100_timer,
153 .init_machine = pleb_init, 155 .init_machine = pleb_init,
154MACHINE_END 156MACHINE_END
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index edddd559be02..43a00359fcdd 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -76,10 +76,12 @@ static void __init shannon_map_io(void)
76} 76}
77 77
78MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)") 78MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
79 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 79 .phys_ram = 0xc0000000,
80 BOOT_PARAMS(0xc0000100) 80 .phys_io = 0x80000000,
81 MAPIO(shannon_map_io) 81 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
82 INITIRQ(sa1100_init_irq) 82 .boot_params = 0xc0000100,
83 .map_io = shannon_map_io,
84 .init_irq = sa1100_init_irq,
83 .timer = &sa1100_timer, 85 .timer = &sa1100_timer,
84 .init_machine = shannon_init, 86 .init_machine = shannon_init,
85MACHINE_END 87MACHINE_END
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index 8d113d629867..77978586b126 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -215,10 +215,12 @@ arch_initcall(simpad_init);
215 215
216 216
217MACHINE_START(SIMPAD, "Simpad") 217MACHINE_START(SIMPAD, "Simpad")
218 MAINTAINER("Holger Freyther") 218 /* Maintainer: Holger Freyther */
219 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 219 .phys_ram = 0xc0000000,
220 BOOT_PARAMS(0xc0000100) 220 .phys_io = 0x80000000,
221 MAPIO(simpad_map_io) 221 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
222 INITIRQ(sa1100_init_irq) 222 .boot_params = 0xc0000100,
223 .map_io = simpad_map_io,
224 .init_irq = sa1100_init_irq,
223 .timer = &sa1100_timer, 225 .timer = &sa1100_timer,
224MACHINE_END 226MACHINE_END
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 19b0c0fd6377..0eeb3616ffea 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -99,8 +99,8 @@ sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
99 99
100static struct irqaction sa1100_timer_irq = { 100static struct irqaction sa1100_timer_irq = {
101 .name = "SA11xx Timer Tick", 101 .name = "SA11xx Timer Tick",
102 .flags = SA_INTERRUPT, 102 .flags = SA_INTERRUPT | SA_TIMER,
103 .handler = sa1100_timer_interrupt 103 .handler = sa1100_timer_interrupt,
104}; 104};
105 105
106static void __init sa1100_timer_init(void) 106static void __init sa1100_timer_init(void)
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index a9bc5d0dbd85..726445895b5c 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -84,8 +84,8 @@ shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
84 84
85static struct irqaction shark_timer_irq = { 85static struct irqaction shark_timer_irq = {
86 .name = "Shark Timer Tick", 86 .name = "Shark Timer Tick",
87 .flags = SA_INTERRUPT, 87 .flags = SA_INTERRUPT | SA_TIMER,
88 .handler = shark_timer_interrupt 88 .handler = shark_timer_interrupt,
89}; 89};
90 90
91/* 91/*
@@ -105,10 +105,12 @@ static struct sys_timer shark_timer = {
105}; 105};
106 106
107MACHINE_START(SHARK, "Shark") 107MACHINE_START(SHARK, "Shark")
108 MAINTAINER("Alexander Schulz") 108 /* Maintainer: Alexander Schulz */
109 BOOT_MEM(0x08000000, 0x40000000, 0xe0000000) 109 .phys_ram = 0x08000000,
110 BOOT_PARAMS(0x08003000) 110 .phys_io = 0x40000000,
111 MAPIO(shark_map_io) 111 .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
112 INITIRQ(shark_init_irq) 112 .boot_params = 0x08003000,
113 .map_io = shark_map_io,
114 .init_irq = shark_init_irq,
113 .timer = &shark_timer, 115 .timer = &shark_timer,
114MACHINE_END 116MACHINE_END
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 6a7cbea5e098..f01c0f8a2bb3 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -33,6 +33,7 @@
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/hardware/amba.h> 34#include <asm/hardware/amba.h>
35#include <asm/hardware/amba_clcd.h> 35#include <asm/hardware/amba_clcd.h>
36#include <asm/hardware/arm_timer.h>
36#include <asm/hardware/icst307.h> 37#include <asm/hardware/icst307.h>
37 38
38#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
@@ -788,38 +789,25 @@ void __init versatile_init(void)
788 */ 789 */
789#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) 790#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
790#if TIMER_INTERVAL >= 0x100000 791#if TIMER_INTERVAL >= 0x100000
791#define TIMER_RELOAD (TIMER_INTERVAL >> 8) /* Divide by 256 */ 792#define TIMER_RELOAD (TIMER_INTERVAL >> 8)
792#define TIMER_CTRL 0x88 /* Enable, Clock / 256 */ 793#define TIMER_DIVISOR (TIMER_CTRL_DIV256)
793#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) 794#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
794#elif TIMER_INTERVAL >= 0x10000 795#elif TIMER_INTERVAL >= 0x10000
795#define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */ 796#define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */
796#define TIMER_CTRL 0x84 /* Enable, Clock / 16 */ 797#define TIMER_DIVISOR (TIMER_CTRL_DIV16)
797#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) 798#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
798#else 799#else
799#define TIMER_RELOAD (TIMER_INTERVAL) 800#define TIMER_RELOAD (TIMER_INTERVAL)
800#define TIMER_CTRL 0x80 /* Enable */ 801#define TIMER_DIVISOR (TIMER_CTRL_DIV1)
801#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) 802#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
802#endif 803#endif
803 804
804#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */
805
806/*
807 * What does it look like?
808 */
809typedef struct TimerStruct {
810 unsigned long TimerLoad;
811 unsigned long TimerValue;
812 unsigned long TimerControl;
813 unsigned long TimerClear;
814} TimerStruct_t;
815
816/* 805/*
817 * Returns number of ms since last clock interrupt. Note that interrupts 806 * Returns number of ms since last clock interrupt. Note that interrupts
818 * will have been disabled by do_gettimeoffset() 807 * will have been disabled by do_gettimeoffset()
819 */ 808 */
820static unsigned long versatile_gettimeoffset(void) 809static unsigned long versatile_gettimeoffset(void)
821{ 810{
822 volatile TimerStruct_t *timer0 = (TimerStruct_t *)TIMER0_VA_BASE;
823 unsigned long ticks1, ticks2, status; 811 unsigned long ticks1, ticks2, status;
824 812
825 /* 813 /*
@@ -828,11 +816,11 @@ static unsigned long versatile_gettimeoffset(void)
828 * an interrupt. We get around this by ensuring that the 816 * an interrupt. We get around this by ensuring that the
829 * counter has not reloaded between our two reads. 817 * counter has not reloaded between our two reads.
830 */ 818 */
831 ticks2 = timer0->TimerValue & 0xffff; 819 ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff;
832 do { 820 do {
833 ticks1 = ticks2; 821 ticks1 = ticks2;
834 status = __raw_readl(VA_IC_BASE + VIC_IRQ_RAW_STATUS); 822 status = __raw_readl(VA_IC_BASE + VIC_IRQ_RAW_STATUS);
835 ticks2 = timer0->TimerValue & 0xffff; 823 ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff;
836 } while (ticks2 > ticks1); 824 } while (ticks2 > ticks1);
837 825
838 /* 826 /*
@@ -859,12 +847,10 @@ static unsigned long versatile_gettimeoffset(void)
859 */ 847 */
860static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 848static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
861{ 849{
862 volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE;
863
864 write_seqlock(&xtime_lock); 850 write_seqlock(&xtime_lock);
865 851
866 // ...clear the interrupt 852 // ...clear the interrupt
867 timer0->TimerClear = 1; 853 writel(1, TIMER0_VA_BASE + TIMER_INTCLR);
868 854
869 timer_tick(regs); 855 timer_tick(regs);
870 856
@@ -875,8 +861,8 @@ static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id, struct pt_re
875 861
876static struct irqaction versatile_timer_irq = { 862static struct irqaction versatile_timer_irq = {
877 .name = "Versatile Timer Tick", 863 .name = "Versatile Timer Tick",
878 .flags = SA_INTERRUPT, 864 .flags = SA_INTERRUPT | SA_TIMER,
879 .handler = versatile_timer_interrupt 865 .handler = versatile_timer_interrupt,
880}; 866};
881 867
882/* 868/*
@@ -884,31 +870,32 @@ static struct irqaction versatile_timer_irq = {
884 */ 870 */
885static void __init versatile_timer_init(void) 871static void __init versatile_timer_init(void)
886{ 872{
887 volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE; 873 u32 val;
888 volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
889 volatile TimerStruct_t *timer2 = (volatile TimerStruct_t *)TIMER2_VA_BASE;
890 volatile TimerStruct_t *timer3 = (volatile TimerStruct_t *)TIMER3_VA_BASE;
891 874
892 /* 875 /*
893 * set clock frequency: 876 * set clock frequency:
894 * VERSATILE_REFCLK is 32KHz 877 * VERSATILE_REFCLK is 32KHz
895 * VERSATILE_TIMCLK is 1MHz 878 * VERSATILE_TIMCLK is 1MHz
896 */ 879 */
897 *(volatile unsigned int *)IO_ADDRESS(VERSATILE_SCTL_BASE) |= 880 val = readl(IO_ADDRESS(VERSATILE_SCTL_BASE));
898 ((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) | (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) | 881 writel((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) |
899 (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) | (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel)); 882 (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) |
883 (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) |
884 (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel) | val,
885 IO_ADDRESS(VERSATILE_SCTL_BASE));
900 886
901 /* 887 /*
902 * Initialise to a known state (all timers off) 888 * Initialise to a known state (all timers off)
903 */ 889 */
904 timer0->TimerControl = 0; 890 writel(0, TIMER0_VA_BASE + TIMER_CTRL);
905 timer1->TimerControl = 0; 891 writel(0, TIMER1_VA_BASE + TIMER_CTRL);
906 timer2->TimerControl = 0; 892 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
907 timer3->TimerControl = 0; 893 writel(0, TIMER3_VA_BASE + TIMER_CTRL);
908 894
909 timer0->TimerLoad = TIMER_RELOAD; 895 writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD);
910 timer0->TimerValue = TIMER_RELOAD; 896 writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_VALUE);
911 timer0->TimerControl = TIMER_CTRL | 0x40 | TIMER_CTRL_IE; /* periodic + IE */ 897 writel(TIMER_DIVISOR | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC |
898 TIMER_CTRL_IE, TIMER0_VA_BASE + TIMER_CTRL);
912 899
913 /* 900 /*
914 * Make irqs happen for the system timer 901 * Make irqs happen for the system timer
diff --git a/arch/arm/mach-versatile/versatile_ab.c b/arch/arm/mach-versatile/versatile_ab.c
index d332084586cf..8b0b3bef24ae 100644
--- a/arch/arm/mach-versatile/versatile_ab.c
+++ b/arch/arm/mach-versatile/versatile_ab.c
@@ -35,11 +35,13 @@
35#include "core.h" 35#include "core.h"
36 36
37MACHINE_START(VERSATILE_AB, "ARM-Versatile AB") 37MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
38 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") 38 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
39 BOOT_MEM(0x00000000, 0x101f1000, 0xf11f1000) 39 .phys_ram = 0x00000000,
40 BOOT_PARAMS(0x00000100) 40 .phys_io = 0x101f1000,
41 MAPIO(versatile_map_io) 41 .io_pg_offst = ((0xf11f1000) >> 18) & 0xfffc,
42 INITIRQ(versatile_init_irq) 42 .boot_params = 0x00000100,
43 .map_io = versatile_map_io,
44 .init_irq = versatile_init_irq,
43 .timer = &versatile_timer, 45 .timer = &versatile_timer,
44 INIT_MACHINE(versatile_init) 46 .init_machine = versatile_init,
45MACHINE_END 47MACHINE_END
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c
index 2702099a68f3..7c3078c38916 100644
--- a/arch/arm/mach-versatile/versatile_pb.c
+++ b/arch/arm/mach-versatile/versatile_pb.c
@@ -99,11 +99,13 @@ static int __init versatile_pb_init(void)
99arch_initcall(versatile_pb_init); 99arch_initcall(versatile_pb_init);
100 100
101MACHINE_START(VERSATILE_PB, "ARM-Versatile PB") 101MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
102 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") 102 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
103 BOOT_MEM(0x00000000, 0x101f1000, 0xf11f1000) 103 .phys_ram = 0x00000000,
104 BOOT_PARAMS(0x00000100) 104 .phys_io = 0x101f1000,
105 MAPIO(versatile_map_io) 105 .io_pg_offst = ((0xf11f1000) >> 18) & 0xfffc,
106 INITIRQ(versatile_init_irq) 106 .boot_params = 0x00000100,
107 .map_io = versatile_map_io,
108 .init_irq = versatile_init_irq,
107 .timer = &versatile_timer, 109 .timer = &versatile_timer,
108 INIT_MACHINE(versatile_init) 110 .init_machine = versatile_init,
109MACHINE_END 111MACHINE_END
diff --git a/arch/arm/mm/blockops.c b/arch/arm/mm/blockops.c
index 806c6eeb1b0c..4f5ee2d08996 100644
--- a/arch/arm/mm/blockops.c
+++ b/arch/arm/mm/blockops.c
@@ -25,13 +25,14 @@ blk_flush_kern_dcache_page(void *kaddr)
25{ 25{
26 asm( 26 asm(
27 "add r1, r0, %0 \n\ 27 "add r1, r0, %0 \n\
28 sub r1, r1, %1 \n\
281: .word 0xec401f0e @ mcrr p15, 0, r0, r1, c14, 0 @ blocking \n\ 291: .word 0xec401f0e @ mcrr p15, 0, r0, r1, c14, 0 @ blocking \n\
29 mov r0, #0 \n\ 30 mov r0, #0 \n\
30 mcr p15, 0, r0, c7, c5, 0 \n\ 31 mcr p15, 0, r0, c7, c5, 0 \n\
31 mcr p15, 0, r0, c7, c10, 4 \n\ 32 mcr p15, 0, r0, c7, c10, 4 \n\
32 mov pc, lr" 33 mov pc, lr"
33 : 34 :
34 : "I" (PAGE_SIZE)); 35 : "I" (PAGE_SIZE), "I" (L1_CACHE_BYTES));
35} 36}
36 37
37/* 38/*
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index e25b4fd8412c..65bfe84b6d67 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -372,49 +372,50 @@ do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
372static struct fsr_info { 372static struct fsr_info {
373 int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs); 373 int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
374 int sig; 374 int sig;
375 int code;
375 const char *name; 376 const char *name;
376} fsr_info[] = { 377} fsr_info[] = {
377 /* 378 /*
378 * The following are the standard ARMv3 and ARMv4 aborts. ARMv5 379 * The following are the standard ARMv3 and ARMv4 aborts. ARMv5
379 * defines these to be "precise" aborts. 380 * defines these to be "precise" aborts.
380 */ 381 */
381 { do_bad, SIGSEGV, "vector exception" }, 382 { do_bad, SIGSEGV, 0, "vector exception" },
382 { do_bad, SIGILL, "alignment exception" }, 383 { do_bad, SIGILL, BUS_ADRALN, "alignment exception" },
383 { do_bad, SIGKILL, "terminal exception" }, 384 { do_bad, SIGKILL, 0, "terminal exception" },
384 { do_bad, SIGILL, "alignment exception" }, 385 { do_bad, SIGILL, BUS_ADRALN, "alignment exception" },
385 { do_bad, SIGBUS, "external abort on linefetch" }, 386 { do_bad, SIGBUS, 0, "external abort on linefetch" },
386 { do_translation_fault, SIGSEGV, "section translation fault" }, 387 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" },
387 { do_bad, SIGBUS, "external abort on linefetch" }, 388 { do_bad, SIGBUS, 0, "external abort on linefetch" },
388 { do_page_fault, SIGSEGV, "page translation fault" }, 389 { do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" },
389 { do_bad, SIGBUS, "external abort on non-linefetch" }, 390 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
390 { do_bad, SIGSEGV, "section domain fault" }, 391 { do_bad, SIGSEGV, SEGV_ACCERR, "section domain fault" },
391 { do_bad, SIGBUS, "external abort on non-linefetch" }, 392 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
392 { do_bad, SIGSEGV, "page domain fault" }, 393 { do_bad, SIGSEGV, SEGV_ACCERR, "page domain fault" },
393 { do_bad, SIGBUS, "external abort on translation" }, 394 { do_bad, SIGBUS, 0, "external abort on translation" },
394 { do_sect_fault, SIGSEGV, "section permission fault" }, 395 { do_sect_fault, SIGSEGV, SEGV_ACCERR, "section permission fault" },
395 { do_bad, SIGBUS, "external abort on translation" }, 396 { do_bad, SIGBUS, 0, "external abort on translation" },
396 { do_page_fault, SIGSEGV, "page permission fault" }, 397 { do_page_fault, SIGSEGV, SEGV_ACCERR, "page permission fault" },
397 /* 398 /*
398 * The following are "imprecise" aborts, which are signalled by bit 399 * The following are "imprecise" aborts, which are signalled by bit
399 * 10 of the FSR, and may not be recoverable. These are only 400 * 10 of the FSR, and may not be recoverable. These are only
400 * supported if the CPU abort handler supports bit 10. 401 * supported if the CPU abort handler supports bit 10.
401 */ 402 */
402 { do_bad, SIGBUS, "unknown 16" }, 403 { do_bad, SIGBUS, 0, "unknown 16" },
403 { do_bad, SIGBUS, "unknown 17" }, 404 { do_bad, SIGBUS, 0, "unknown 17" },
404 { do_bad, SIGBUS, "unknown 18" }, 405 { do_bad, SIGBUS, 0, "unknown 18" },
405 { do_bad, SIGBUS, "unknown 19" }, 406 { do_bad, SIGBUS, 0, "unknown 19" },
406 { do_bad, SIGBUS, "lock abort" }, /* xscale */ 407 { do_bad, SIGBUS, 0, "lock abort" }, /* xscale */
407 { do_bad, SIGBUS, "unknown 21" }, 408 { do_bad, SIGBUS, 0, "unknown 21" },
408 { do_bad, SIGBUS, "imprecise external abort" }, /* xscale */ 409 { do_bad, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
409 { do_bad, SIGBUS, "unknown 23" }, 410 { do_bad, SIGBUS, 0, "unknown 23" },
410 { do_bad, SIGBUS, "dcache parity error" }, /* xscale */ 411 { do_bad, SIGBUS, 0, "dcache parity error" }, /* xscale */
411 { do_bad, SIGBUS, "unknown 25" }, 412 { do_bad, SIGBUS, 0, "unknown 25" },
412 { do_bad, SIGBUS, "unknown 26" }, 413 { do_bad, SIGBUS, 0, "unknown 26" },
413 { do_bad, SIGBUS, "unknown 27" }, 414 { do_bad, SIGBUS, 0, "unknown 27" },
414 { do_bad, SIGBUS, "unknown 28" }, 415 { do_bad, SIGBUS, 0, "unknown 28" },
415 { do_bad, SIGBUS, "unknown 29" }, 416 { do_bad, SIGBUS, 0, "unknown 29" },
416 { do_bad, SIGBUS, "unknown 30" }, 417 { do_bad, SIGBUS, 0, "unknown 30" },
417 { do_bad, SIGBUS, "unknown 31" } 418 { do_bad, SIGBUS, 0, "unknown 31" }
418}; 419};
419 420
420void __init 421void __init
@@ -435,15 +436,19 @@ asmlinkage void
435do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) 436do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
436{ 437{
437 const struct fsr_info *inf = fsr_info + (fsr & 15) + ((fsr & (1 << 10)) >> 6); 438 const struct fsr_info *inf = fsr_info + (fsr & 15) + ((fsr & (1 << 10)) >> 6);
439 struct siginfo info;
438 440
439 if (!inf->fn(addr, fsr, regs)) 441 if (!inf->fn(addr, fsr, regs))
440 return; 442 return;
441 443
442 printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n", 444 printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n",
443 inf->name, fsr, addr); 445 inf->name, fsr, addr);
444 force_sig(inf->sig, current); 446
445 show_pte(current->mm, addr); 447 info.si_signo = inf->sig;
446 die_if_kernel("Oops", regs, 0); 448 info.si_errno = 0;
449 info.si_code = inf->code;
450 info.si_addr = (void __user *)addr;
451 notify_die("", regs, &info, fsr, 0);
447} 452}
448 453
449asmlinkage void 454asmlinkage void
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index c08710b1ff02..edffa47a4b2a 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -437,7 +437,7 @@ void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
437 memtable_init(mi); 437 memtable_init(mi);
438 if (mdesc->map_io) 438 if (mdesc->map_io)
439 mdesc->map_io(); 439 mdesc->map_io();
440 flush_tlb_all(); 440 local_flush_tlb_all();
441 441
442 /* 442 /*
443 * initialise the zones within each node 443 * initialise the zones within each node
@@ -522,6 +522,69 @@ static inline void free_area(unsigned long addr, unsigned long end, char *s)
522 printk(KERN_INFO "Freeing %s memory: %dK\n", s, size); 522 printk(KERN_INFO "Freeing %s memory: %dK\n", s, size);
523} 523}
524 524
525static inline void
526free_memmap(int node, unsigned long start_pfn, unsigned long end_pfn)
527{
528 struct page *start_pg, *end_pg;
529 unsigned long pg, pgend;
530
531 /*
532 * Convert start_pfn/end_pfn to a struct page pointer.
533 */
534 start_pg = pfn_to_page(start_pfn);
535 end_pg = pfn_to_page(end_pfn);
536
537 /*
538 * Convert to physical addresses, and
539 * round start upwards and end downwards.
540 */
541 pg = PAGE_ALIGN(__pa(start_pg));
542 pgend = __pa(end_pg) & PAGE_MASK;
543
544 /*
545 * If there are free pages between these,
546 * free the section of the memmap array.
547 */
548 if (pg < pgend)
549 free_bootmem_node(NODE_DATA(node), pg, pgend - pg);
550}
551
552/*
553 * The mem_map array can get very big. Free the unused area of the memory map.
554 */
555static void __init free_unused_memmap_node(int node, struct meminfo *mi)
556{
557 unsigned long bank_start, prev_bank_end = 0;
558 unsigned int i;
559
560 /*
561 * [FIXME] This relies on each bank being in address order. This
562 * may not be the case, especially if the user has provided the
563 * information on the command line.
564 */
565 for (i = 0; i < mi->nr_banks; i++) {
566 if (mi->bank[i].size == 0 || mi->bank[i].node != node)
567 continue;
568
569 bank_start = mi->bank[i].start >> PAGE_SHIFT;
570 if (bank_start < prev_bank_end) {
571 printk(KERN_ERR "MEM: unordered memory banks. "
572 "Not freeing memmap.\n");
573 break;
574 }
575
576 /*
577 * If we had a previous bank, and there is a space
578 * between the current bank and the previous, free it.
579 */
580 if (prev_bank_end && prev_bank_end != bank_start)
581 free_memmap(node, prev_bank_end, bank_start);
582
583 prev_bank_end = (mi->bank[i].start +
584 mi->bank[i].size) >> PAGE_SHIFT;
585 }
586}
587
525/* 588/*
526 * mem_init() marks the free areas in the mem_map and tells us how much 589 * mem_init() marks the free areas in the mem_map and tells us how much
527 * memory is free. This is done after various parts of the system have 590 * memory is free. This is done after various parts of the system have
@@ -540,16 +603,12 @@ void __init mem_init(void)
540 max_mapnr = virt_to_page(high_memory) - mem_map; 603 max_mapnr = virt_to_page(high_memory) - mem_map;
541#endif 604#endif
542 605
543 /*
544 * We may have non-contiguous memory.
545 */
546 if (meminfo.nr_banks != 1)
547 create_memmap_holes(&meminfo);
548
549 /* this will put all unused low memory onto the freelists */ 606 /* this will put all unused low memory onto the freelists */
550 for_each_online_node(node) { 607 for_each_online_node(node) {
551 pg_data_t *pgdat = NODE_DATA(node); 608 pg_data_t *pgdat = NODE_DATA(node);
552 609
610 free_unused_memmap_node(node, &meminfo);
611
553 if (pgdat->node_spanned_pages != 0) 612 if (pgdat->node_spanned_pages != 0)
554 totalram_pages += free_all_bootmem_node(pgdat); 613 totalram_pages += free_all_bootmem_node(pgdat);
555 } 614 }
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index 2c2b93d77d43..c3bd503b43a2 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -169,7 +169,14 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
169 169
170 memzero(new_pgd, FIRST_KERNEL_PGD_NR * sizeof(pgd_t)); 170 memzero(new_pgd, FIRST_KERNEL_PGD_NR * sizeof(pgd_t));
171 171
172 /*
173 * Copy over the kernel and IO PGD entries
174 */
172 init_pgd = pgd_offset_k(0); 175 init_pgd = pgd_offset_k(0);
176 memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR,
177 (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t));
178
179 clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t));
173 180
174 if (!vectors_high()) { 181 if (!vectors_high()) {
175 /* 182 /*
@@ -198,14 +205,6 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
198 spin_unlock(&mm->page_table_lock); 205 spin_unlock(&mm->page_table_lock);
199 } 206 }
200 207
201 /*
202 * Copy over the kernel and IO PGD entries
203 */
204 memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR,
205 (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t));
206
207 clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t));
208
209 return new_pgd; 208 return new_pgd;
210 209
211no_pte: 210no_pte:
@@ -683,7 +682,7 @@ void __init memtable_init(struct meminfo *mi)
683 } 682 }
684 683
685 flush_cache_all(); 684 flush_cache_all();
686 flush_tlb_all(); 685 local_flush_tlb_all();
687 686
688 top_pmd = pmd_off_k(0xffff0000); 687 top_pmd = pmd_off_k(0xffff0000);
689} 688}
@@ -698,75 +697,3 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
698 for (i = 0; i < nr; i++) 697 for (i = 0; i < nr; i++)
699 create_mapping(io_desc + i); 698 create_mapping(io_desc + i);
700} 699}
701
702static inline void
703free_memmap(int node, unsigned long start_pfn, unsigned long end_pfn)
704{
705 struct page *start_pg, *end_pg;
706 unsigned long pg, pgend;
707
708 /*
709 * Convert start_pfn/end_pfn to a struct page pointer.
710 */
711 start_pg = pfn_to_page(start_pfn);
712 end_pg = pfn_to_page(end_pfn);
713
714 /*
715 * Convert to physical addresses, and
716 * round start upwards and end downwards.
717 */
718 pg = PAGE_ALIGN(__pa(start_pg));
719 pgend = __pa(end_pg) & PAGE_MASK;
720
721 /*
722 * If there are free pages between these,
723 * free the section of the memmap array.
724 */
725 if (pg < pgend)
726 free_bootmem_node(NODE_DATA(node), pg, pgend - pg);
727}
728
729static inline void free_unused_memmap_node(int node, struct meminfo *mi)
730{
731 unsigned long bank_start, prev_bank_end = 0;
732 unsigned int i;
733
734 /*
735 * [FIXME] This relies on each bank being in address order. This
736 * may not be the case, especially if the user has provided the
737 * information on the command line.
738 */
739 for (i = 0; i < mi->nr_banks; i++) {
740 if (mi->bank[i].size == 0 || mi->bank[i].node != node)
741 continue;
742
743 bank_start = mi->bank[i].start >> PAGE_SHIFT;
744 if (bank_start < prev_bank_end) {
745 printk(KERN_ERR "MEM: unordered memory banks. "
746 "Not freeing memmap.\n");
747 break;
748 }
749
750 /*
751 * If we had a previous bank, and there is a space
752 * between the current bank and the previous, free it.
753 */
754 if (prev_bank_end && prev_bank_end != bank_start)
755 free_memmap(node, prev_bank_end, bank_start);
756
757 prev_bank_end = PAGE_ALIGN(mi->bank[i].start +
758 mi->bank[i].size) >> PAGE_SHIFT;
759 }
760}
761
762/*
763 * The mem_map array can get very big. Free
764 * the unused area of the memory map.
765 */
766void __init create_memmap_holes(struct meminfo *mi)
767{
768 int node;
769
770 for_each_online_node(node)
771 free_unused_memmap_node(node, mi);
772}
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
index 1f325231b9e4..5c0ae5260d1c 100644
--- a/arch/arm/mm/proc-arm1020.S
+++ b/arch/arm/mm/proc-arm1020.S
@@ -445,14 +445,14 @@ __arm1020_setup:
445 /* 445 /*
446 * R 446 * R
447 * .RVI ZFRS BLDP WCAM 447 * .RVI ZFRS BLDP WCAM
448 * .0.1 1001 ..11 0101 /* FIXME: why no V bit? */ 448 * .011 1001 ..11 0101
449 */ 449 */
450 .type arm1020_cr1_clear, #object 450 .type arm1020_cr1_clear, #object
451 .type arm1020_cr1_set, #object 451 .type arm1020_cr1_set, #object
452arm1020_cr1_clear: 452arm1020_cr1_clear:
453 .word 0x593f 453 .word 0x593f
454arm1020_cr1_set: 454arm1020_cr1_set:
455 .word 0x1935 455 .word 0x3935
456 456
457 __INITDATA 457 __INITDATA
458 458
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
index 142a2c2d6f0b..d69389c4d4ba 100644
--- a/arch/arm/mm/proc-arm1020e.S
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -427,14 +427,14 @@ __arm1020e_setup:
427 /* 427 /*
428 * R 428 * R
429 * .RVI ZFRS BLDP WCAM 429 * .RVI ZFRS BLDP WCAM
430 * .0.1 1001 ..11 0101 /* FIXME: why no V bit? */ 430 * .011 1001 ..11 0101
431 */ 431 */
432 .type arm1020e_cr1_clear, #object 432 .type arm1020e_cr1_clear, #object
433 .type arm1020e_cr1_set, #object 433 .type arm1020e_cr1_set, #object
434arm1020e_cr1_clear: 434arm1020e_cr1_clear:
435 .word 0x5f3f 435 .word 0x5f3f
436arm1020e_cr1_set: 436arm1020e_cr1_set:
437 .word 0x1935 437 .word 0x3935
438 438
439 __INITDATA 439 __INITDATA
440 440
diff --git a/arch/arm/oprofile/Makefile b/arch/arm/oprofile/Makefile
index ba1a6e9f2b28..8ffb523e6c77 100644
--- a/arch/arm/oprofile/Makefile
+++ b/arch/arm/oprofile/Makefile
@@ -6,6 +6,6 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
6 oprofilefs.o oprofile_stats.o \ 6 oprofilefs.o oprofile_stats.o \
7 timer_int.o ) 7 timer_int.o )
8 8
9oprofile-y := $(DRIVER_OBJS) init.o 9oprofile-y := $(DRIVER_OBJS) init.o backtrace.o
10oprofile-$(CONFIG_CPU_XSCALE) += common.o op_model_xscale.o 10oprofile-$(CONFIG_CPU_XSCALE) += common.o op_model_xscale.o
11 11
diff --git a/arch/arm/oprofile/backtrace.c b/arch/arm/oprofile/backtrace.c
new file mode 100644
index 000000000000..ec58d3e2eb8b
--- /dev/null
+++ b/arch/arm/oprofile/backtrace.c
@@ -0,0 +1,144 @@
1/*
2 * Arm specific backtracing code for oprofile
3 *
4 * Copyright 2005 Openedhand Ltd.
5 *
6 * Author: Richard Purdie <rpurdie@openedhand.com>
7 *
8 * Based on i386 oprofile backtrace code by John Levon, David Smith
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 */
15
16#include <linux/oprofile.h>
17#include <linux/sched.h>
18#include <linux/mm.h>
19#include <asm/ptrace.h>
20#include <asm/uaccess.h>
21
22
23/*
24 * The registers we're interested in are at the end of the variable
25 * length saved register structure. The fp points at the end of this
26 * structure so the address of this struct is:
27 * (struct frame_tail *)(xxx->fp)-1
28 */
29struct frame_tail {
30 struct frame_tail *fp;
31 unsigned long sp;
32 unsigned long lr;
33} __attribute__((packed));
34
35
36#ifdef CONFIG_FRAME_POINTER
37static struct frame_tail* kernel_backtrace(struct frame_tail *tail)
38{
39 oprofile_add_trace(tail->lr);
40
41 /* frame pointers should strictly progress back up the stack
42 * (towards higher addresses) */
43 if (tail >= tail->fp)
44 return NULL;
45
46 return tail->fp-1;
47}
48#endif
49
50static struct frame_tail* user_backtrace(struct frame_tail *tail)
51{
52 struct frame_tail buftail;
53
54 /* hardware pte might not be valid due to dirty/accessed bit emulation
55 * so we use copy_from_user and benefit from exception fixups */
56 if (copy_from_user(&buftail, tail, sizeof(struct frame_tail)))
57 return NULL;
58
59 oprofile_add_trace(buftail.lr);
60
61 /* frame pointers should strictly progress back up the stack
62 * (towards higher addresses) */
63 if (tail >= buftail.fp)
64 return NULL;
65
66 return buftail.fp-1;
67}
68
69/* Compare two addresses and see if they're on the same page */
70#define CMP_ADDR_EQUAL(x,y,offset) ((((unsigned long) x) >> PAGE_SHIFT) \
71 == ((((unsigned long) y) + offset) >> PAGE_SHIFT))
72
73/* check that the page(s) containing the frame tail are present */
74static int pages_present(struct frame_tail *tail)
75{
76 struct mm_struct * mm = current->mm;
77
78 if (!check_user_page_readable(mm, (unsigned long)tail))
79 return 0;
80
81 if (CMP_ADDR_EQUAL(tail, tail, 8))
82 return 1;
83
84 if (!check_user_page_readable(mm, ((unsigned long)tail) + 8))
85 return 0;
86
87 return 1;
88}
89
90/*
91 * | | /\ Higher addresses
92 * | |
93 * --------------- stack base (address of current_thread_info)
94 * | thread info |
95 * . .
96 * | stack |
97 * --------------- saved regs->ARM_fp value if valid (frame_tail address)
98 * . .
99 * --------------- struct pt_regs stored on stack (struct pt_regs *)
100 * | |
101 * . .
102 * | |
103 * --------------- %esp
104 * | |
105 * | | \/ Lower addresses
106 *
107 * Thus, &pt_regs <-> stack base restricts the valid(ish) fp values
108 */
109static int valid_kernel_stack(struct frame_tail *tail, struct pt_regs *regs)
110{
111 unsigned long tailaddr = (unsigned long)tail;
112 unsigned long stack = (unsigned long)regs;
113 unsigned long stack_base = (stack & ~(THREAD_SIZE - 1)) + THREAD_SIZE;
114
115 return (tailaddr > stack) && (tailaddr < stack_base);
116}
117
118void arm_backtrace(struct pt_regs const *regs, unsigned int depth)
119{
120 struct frame_tail *tail;
121 unsigned long last_address = 0;
122
123 tail = ((struct frame_tail *) regs->ARM_fp) - 1;
124
125 if (!user_mode(regs)) {
126
127#ifdef CONFIG_FRAME_POINTER
128 while (depth-- && tail && valid_kernel_stack(tail, regs)) {
129 tail = kernel_backtrace(tail);
130 }
131#endif
132 return;
133 }
134
135 while (depth-- && tail && !((unsigned long) tail & 3)) {
136 if ((!CMP_ADDR_EQUAL(last_address, tail, 0)
137 || !CMP_ADDR_EQUAL(last_address, tail, 8))
138 && !pages_present(tail))
139 return;
140 last_address = (unsigned long) tail;
141 tail = user_backtrace(tail);
142 }
143}
144
diff --git a/arch/arm/oprofile/init.c b/arch/arm/oprofile/init.c
index cce3d3015eb7..d315a3a86c86 100644
--- a/arch/arm/oprofile/init.c
+++ b/arch/arm/oprofile/init.c
@@ -20,6 +20,8 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
20 ret = pmu_init(ops, &op_xscale_spec); 20 ret = pmu_init(ops, &op_xscale_spec);
21#endif 21#endif
22 22
23 ops->backtrace = arm_backtrace;
24
23 return ret; 25 return ret;
24} 26}
25 27
diff --git a/arch/arm/oprofile/op_arm_model.h b/arch/arm/oprofile/op_arm_model.h
index 2d4caf4781ad..2148d07484b7 100644
--- a/arch/arm/oprofile/op_arm_model.h
+++ b/arch/arm/oprofile/op_arm_model.h
@@ -24,6 +24,8 @@ struct op_arm_model_spec {
24extern struct op_arm_model_spec op_xscale_spec; 24extern struct op_arm_model_spec op_xscale_spec;
25#endif 25#endif
26 26
27extern void arm_backtrace(struct pt_regs * const regs, unsigned int depth);
28
27extern int __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec); 29extern int __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec);
28extern void pmu_exit(void); 30extern void pmu_exit(void);
29#endif /* OP_ARM_MODEL_H */ 31#endif /* OP_ARM_MODEL_H */
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 30c1dfbb052f..6d3a79e5fef8 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -6,7 +6,7 @@
6# To add an entry into this database, please see Documentation/arm/README, 6# To add an entry into this database, please see Documentation/arm/README,
7# or contact rmk@arm.linux.org.uk 7# or contact rmk@arm.linux.org.uk
8# 8#
9# Last update: Thu Mar 24 14:34:50 2005 9# Last update: Thu Jun 23 20:19:33 2005
10# 10#
11# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 11# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
12# 12#
@@ -243,7 +243,7 @@ yoho ARCH_YOHO YOHO 231
243jasper ARCH_JASPER JASPER 232 243jasper ARCH_JASPER JASPER 232
244dsc25 ARCH_DSC25 DSC25 233 244dsc25 ARCH_DSC25 DSC25 233
245omap_innovator MACH_OMAP_INNOVATOR OMAP_INNOVATOR 234 245omap_innovator MACH_OMAP_INNOVATOR OMAP_INNOVATOR 234
246ramses ARCH_RAMSES RAMSES 235 246mnci ARCH_RAMSES RAMSES 235
247s28x ARCH_S28X S28X 236 247s28x ARCH_S28X S28X 236
248mport3 ARCH_MPORT3 MPORT3 237 248mport3 ARCH_MPORT3 MPORT3 237
249pxa_eagle250 ARCH_PXA_EAGLE250 PXA_EAGLE250 238 249pxa_eagle250 ARCH_PXA_EAGLE250 PXA_EAGLE250 238
@@ -323,7 +323,7 @@ nimbra29x ARCH_NIMBRA29X NIMBRA29X 311
323nimbra210 ARCH_NIMBRA210 NIMBRA210 312 323nimbra210 ARCH_NIMBRA210 NIMBRA210 312
324hhp_d95xx ARCH_HHP_D95XX HHP_D95XX 313 324hhp_d95xx ARCH_HHP_D95XX HHP_D95XX 313
325labarm ARCH_LABARM LABARM 314 325labarm ARCH_LABARM LABARM 314
326m825xx ARCH_M825XX M825XX 315 326comcerto ARCH_M825XX M825XX 315
327m7100 SA1100_M7100 M7100 316 327m7100 SA1100_M7100 M7100 316
328nipc2 ARCH_NIPC2 NIPC2 317 328nipc2 ARCH_NIPC2 NIPC2 317
329fu7202 ARCH_FU7202 FU7202 318 329fu7202 ARCH_FU7202 FU7202 318
@@ -724,3 +724,66 @@ lpc22xx MACH_LPC22XX LPC22XX 715
724omap_comet3 MACH_COMET3 COMET3 716 724omap_comet3 MACH_COMET3 COMET3 716
725omap_comet4 MACH_COMET4 COMET4 717 725omap_comet4 MACH_COMET4 COMET4 717
726csb625 MACH_CSB625 CSB625 718 726csb625 MACH_CSB625 CSB625 718
727fortunet2 MACH_FORTUNET2 FORTUNET2 719
728s5h2200 MACH_S5H2200 S5H2200 720
729optorm920 MACH_OPTORM920 OPTORM920 721
730adsbitsyxb MACH_ADSBITSYXB ADSBITSYXB 722
731adssphere MACH_ADSSPHERE ADSSPHERE 723
732adsportal MACH_ADSPORTAL ADSPORTAL 724
733ln2410sbc MACH_LN2410SBC LN2410SBC 725
734cb3rufc MACH_CB3RUFC CB3RUFC 726
735mp2usb MACH_MP2USB MP2USB 727
736ntnp425c MACH_NTNP425C NTNP425C 728
737colibri MACH_COLIBRI COLIBRI 729
738pcm7220 MACH_PCM7220 PCM7220 730
739gateway7001 MACH_GATEWAY7001 GATEWAY7001 731
740pcm027 MACH_PCM027 PCM027 732
741cmpxa MACH_CMPXA CMPXA 733
742anubis MACH_ANUBIS ANUBIS 734
743ite8152 MACH_ITE8152 ITE8152 735
744lpc3xxx MACH_LPC3XXX LPC3XXX 736
745puppeteer MACH_PUPPETEER PUPPETEER 737
746vt001 MACH_MACH_VADATECH MACH_VADATECH 738
747e570 MACH_E570 E570 739
748x50 MACH_X50 X50 740
749recon MACH_RECON RECON 741
750xboardgp8 MACH_XBOARDGP8 XBOARDGP8 742
751fpic2 MACH_FPIC2 FPIC2 743
752akita MACH_AKITA AKITA 744
753a81 MACH_A81 A81 745
754svm_sc25x MACH_SVM_SC25X SVM_SC25X 746
755vt020 MACH_VADATECH020 VADATECH020 747
756tli MACH_TLI TLI 748
757edb9315lc MACH_EDB9315LC EDB9315LC 749
758passec MACH_PASSEC PASSEC 750
759ds_tiger MACH_DS_TIGER DS_TIGER 751
760e310 MACH_E310 E310 752
761e330 MACH_E330 E330 753
762rt3000 MACH_RT3000 RT3000 754
763nokia770 MACH_NOKIA770 NOKIA770 755
764pnx0106 MACH_PNX0106 PNX0106 756
765hx21xx MACH_HX21XX HX21XX 757
766faraday MACH_FARADAY FARADAY 758
767sbc9312 MACH_SBC9312 SBC9312 759
768batman MACH_BATMAN BATMAN 760
769jpd201 MACH_JPD201 JPD201 761
770mipsa MACH_MIPSA MIPSA 762
771kacom MACH_KACOM KACOM 763
772swarcocpu MACH_SWARCOCPU SWARCOCPU 764
773swarcodsl MACH_SWARCODSL SWARCODSL 765
774blueangel MACH_BLUEANGEL BLUEANGEL 766
775hairygrama MACH_HAIRYGRAMA HAIRYGRAMA 767
776banff MACH_BANFF BANFF 768
777carmeva MACH_CARMEVA CARMEVA 769
778sam255 MACH_SAM255 SAM255 770
779ppm10 MACH_PPM10 PPM10 771
780edb9315a MACH_EDB9315A EDB9315A 772
781sunset MACH_SUNSET SUNSET 773
782stargate2 MACH_STARGATE2 STARGATE2 774
783intelmote2 MACH_INTELMOTE2 INTELMOTE2 775
784trizeps4 MACH_TRIZEPS4 TRIZEPS4 776
785mainstone2 MACH_MAINSTONE2 MAINSTONE2 777
786ez_ixp42x MACH_EZ_IXP42X EZ_IXP42X 778
787tapwave_zodiac MACH_TAPWAVE_ZODIAC TAPWAVE_ZODIAC 779
788universalmeter MACH_UNIVERSALMETER UNIVERSALMETER 780
789hicoarm9 MACH_HICOARM9 HICOARM9 781
diff --git a/arch/arm/vfp/vfp.h b/arch/arm/vfp/vfp.h
index 55a02bc994a3..4b97950984e9 100644
--- a/arch/arm/vfp/vfp.h
+++ b/arch/arm/vfp/vfp.h
@@ -117,7 +117,13 @@ static inline u64 vfp_estimate_div128to64(u64 nh, u64 nl, u64 m)
117 if (nh >= m) 117 if (nh >= m)
118 return ~0ULL; 118 return ~0ULL;
119 mh = m >> 32; 119 mh = m >> 32;
120 z = (mh << 32 <= nh) ? 0xffffffff00000000ULL : (nh / mh) << 32; 120 if (mh << 32 <= nh) {
121 z = 0xffffffff00000000ULL;
122 } else {
123 z = nh;
124 do_div(z, mh);
125 z <<= 32;
126 }
121 mul64to128(&termh, &terml, m, z); 127 mul64to128(&termh, &terml, m, z);
122 sub128(&remh, &reml, nh, nl, termh, terml); 128 sub128(&remh, &reml, nh, nl, termh, terml);
123 ml = m << 32; 129 ml = m << 32;
@@ -126,7 +132,12 @@ static inline u64 vfp_estimate_div128to64(u64 nh, u64 nl, u64 m)
126 add128(&remh, &reml, remh, reml, mh, ml); 132 add128(&remh, &reml, remh, reml, mh, ml);
127 } 133 }
128 remh = (remh << 32) | (reml >> 32); 134 remh = (remh << 32) | (reml >> 32);
129 z |= (mh << 32 <= remh) ? 0xffffffff : remh / mh; 135 if (mh << 32 <= remh) {
136 z |= 0xffffffff;
137 } else {
138 do_div(remh, mh);
139 z |= remh;
140 }
130 return z; 141 return z;
131} 142}
132 143
diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c
index fa3053e84db5..b801cd66b6ea 100644
--- a/arch/arm/vfp/vfpdouble.c
+++ b/arch/arm/vfp/vfpdouble.c
@@ -32,6 +32,8 @@
32 */ 32 */
33#include <linux/kernel.h> 33#include <linux/kernel.h>
34#include <linux/bitops.h> 34#include <linux/bitops.h>
35
36#include <asm/div64.h>
35#include <asm/ptrace.h> 37#include <asm/ptrace.h>
36#include <asm/vfp.h> 38#include <asm/vfp.h>
37 39
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 3aeedd2afc70..22f3da4e0829 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -89,7 +89,7 @@ void vfp_raise_sigfpe(unsigned int sicode, struct pt_regs *regs)
89 current->thread.error_code = 0; 89 current->thread.error_code = 0;
90 current->thread.trap_no = 6; 90 current->thread.trap_no = 6;
91 91
92 force_sig_info(SIGFPE, &info, current); 92 send_sig_info(SIGFPE, &info, current);
93} 93}
94 94
95static void vfp_panic(char *reason) 95static void vfp_panic(char *reason)
diff --git a/arch/arm/vfp/vfpsingle.c b/arch/arm/vfp/vfpsingle.c
index 6849fe35cb2e..14dd696ddeb1 100644
--- a/arch/arm/vfp/vfpsingle.c
+++ b/arch/arm/vfp/vfpsingle.c
@@ -32,6 +32,8 @@
32 */ 32 */
33#include <linux/kernel.h> 33#include <linux/kernel.h>
34#include <linux/bitops.h> 34#include <linux/bitops.h>
35
36#include <asm/div64.h>
35#include <asm/ptrace.h> 37#include <asm/ptrace.h>
36#include <asm/vfp.h> 38#include <asm/vfp.h>
37 39
@@ -303,7 +305,11 @@ u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand)
303 if (z <= a) 305 if (z <= a)
304 return (s32)a >> 1; 306 return (s32)a >> 1;
305 } 307 }
306 return (u32)(((u64)a << 31) / z) + (z >> 1); 308 {
309 u64 v = (u64)a << 31;
310 do_div(v, z);
311 return v + (z >> 1);
312 }
307} 313}
308 314
309static u32 vfp_single_fsqrt(int sd, int unused, s32 m, u32 fpscr) 315static u32 vfp_single_fsqrt(int sd, int unused, s32 m, u32 fpscr)
@@ -1107,7 +1113,11 @@ static u32 vfp_single_fdiv(int sd, int sn, s32 m, u32 fpscr)
1107 vsn.significand >>= 1; 1113 vsn.significand >>= 1;
1108 vsd.exponent++; 1114 vsd.exponent++;
1109 } 1115 }
1110 vsd.significand = ((u64)vsn.significand << 32) / vsm.significand; 1116 {
1117 u64 significand = (u64)vsn.significand << 32;
1118 do_div(significand, vsm.significand);
1119 vsd.significand = significand;
1120 }
1111 if ((vsd.significand & 0x3f) == 0) 1121 if ((vsd.significand & 0x3f) == 0)
1112 vsd.significand |= ((u64)vsm.significand * vsd.significand != (u64)vsn.significand << 32); 1122 vsd.significand |= ((u64)vsm.significand * vsd.significand != (u64)vsn.significand << 32);
1113 1123
diff --git a/arch/i386/boot/tools/build.c b/arch/i386/boot/tools/build.c
index 4a17956512e1..6835f6d47c31 100644
--- a/arch/i386/boot/tools/build.c
+++ b/arch/i386/boot/tools/build.c
@@ -70,7 +70,8 @@ void usage(void)
70 70
71int main(int argc, char ** argv) 71int main(int argc, char ** argv)
72{ 72{
73 unsigned int i, c, sz, setup_sectors; 73 unsigned int i, sz, setup_sectors;
74 int c;
74 u32 sys_size; 75 u32 sys_size;
75 byte major_root, minor_root; 76 byte major_root, minor_root;
76 struct stat sb; 77 struct stat sb;
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 9f63ae0f404b..b7808a89d945 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -159,9 +159,15 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
159#endif 159#endif
160 160
161#ifdef CONFIG_PCI_MMCONFIG 161#ifdef CONFIG_PCI_MMCONFIG
162static int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size) 162/* The physical address of the MMCONFIG aperture. Set from ACPI tables. */
163struct acpi_table_mcfg_config *pci_mmcfg_config;
164int pci_mmcfg_config_num;
165
166int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
163{ 167{
164 struct acpi_table_mcfg *mcfg; 168 struct acpi_table_mcfg *mcfg;
169 unsigned long i;
170 int config_size;
165 171
166 if (!phys_addr || !size) 172 if (!phys_addr || !size)
167 return -EINVAL; 173 return -EINVAL;
@@ -172,18 +178,38 @@ static int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
172 return -ENODEV; 178 return -ENODEV;
173 } 179 }
174 180
175 if (mcfg->base_reserved) { 181 /* how many config structures do we have */
176 printk(KERN_ERR PREFIX "MMCONFIG not in low 4GB of memory\n"); 182 pci_mmcfg_config_num = 0;
183 i = size - sizeof(struct acpi_table_mcfg);
184 while (i >= sizeof(struct acpi_table_mcfg_config)) {
185 ++pci_mmcfg_config_num;
186 i -= sizeof(struct acpi_table_mcfg_config);
187 };
188 if (pci_mmcfg_config_num == 0) {
189 printk(KERN_ERR PREFIX "MMCONFIG has no entries\n");
177 return -ENODEV; 190 return -ENODEV;
178 } 191 }
179 192
180 pci_mmcfg_base_addr = mcfg->base_address; 193 config_size = pci_mmcfg_config_num * sizeof(*pci_mmcfg_config);
194 pci_mmcfg_config = kmalloc(config_size, GFP_KERNEL);
195 if (!pci_mmcfg_config) {
196 printk(KERN_WARNING PREFIX
197 "No memory for MCFG config tables\n");
198 return -ENOMEM;
199 }
200
201 memcpy(pci_mmcfg_config, &mcfg->config, config_size);
202 for (i = 0; i < pci_mmcfg_config_num; ++i) {
203 if (mcfg->config[i].base_reserved) {
204 printk(KERN_ERR PREFIX
205 "MMCONFIG not in low 4GB of memory\n");
206 return -ENODEV;
207 }
208 }
181 209
182 return 0; 210 return 0;
183} 211}
184#else 212#endif /* CONFIG_PCI_MMCONFIG */
185#define acpi_parse_mcfg NULL
186#endif /* !CONFIG_PCI_MMCONFIG */
187 213
188#ifdef CONFIG_X86_LOCAL_APIC 214#ifdef CONFIG_X86_LOCAL_APIC
189static int __init 215static int __init
@@ -507,6 +533,22 @@ acpi_unmap_lsapic(int cpu)
507EXPORT_SYMBOL(acpi_unmap_lsapic); 533EXPORT_SYMBOL(acpi_unmap_lsapic);
508#endif /* CONFIG_ACPI_HOTPLUG_CPU */ 534#endif /* CONFIG_ACPI_HOTPLUG_CPU */
509 535
536int
537acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
538{
539 /* TBD */
540 return -EINVAL;
541}
542EXPORT_SYMBOL(acpi_register_ioapic);
543
544int
545acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
546{
547 /* TBD */
548 return -EINVAL;
549}
550EXPORT_SYMBOL(acpi_unregister_ioapic);
551
510static unsigned long __init 552static unsigned long __init
511acpi_scan_rsdp ( 553acpi_scan_rsdp (
512 unsigned long start, 554 unsigned long start,
@@ -1123,7 +1165,6 @@ int __init acpi_boot_init(void)
1123 acpi_process_madt(); 1165 acpi_process_madt();
1124 1166
1125 acpi_table_parse(ACPI_HPET, acpi_parse_hpet); 1167 acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
1126 acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg);
1127 1168
1128 return 0; 1169 return 0;
1129} 1170}
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index 93df90bbb87e..bd1dbf3bd223 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -35,6 +35,7 @@
35#include <asm/desc.h> 35#include <asm/desc.h>
36#include <asm/arch_hooks.h> 36#include <asm/arch_hooks.h>
37#include <asm/hpet.h> 37#include <asm/hpet.h>
38#include <asm/i8253.h>
38 39
39#include <mach_apic.h> 40#include <mach_apic.h>
40 41
@@ -879,7 +880,6 @@ fake_ioapic_page:
879 */ 880 */
880static unsigned int __devinit get_8254_timer_count(void) 881static unsigned int __devinit get_8254_timer_count(void)
881{ 882{
882 extern spinlock_t i8253_lock;
883 unsigned long flags; 883 unsigned long flags;
884 884
885 unsigned int count; 885 unsigned int count;
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index d48ce9290963..064211d5f41b 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -228,10 +228,10 @@
228#include <asm/system.h> 228#include <asm/system.h>
229#include <asm/uaccess.h> 229#include <asm/uaccess.h>
230#include <asm/desc.h> 230#include <asm/desc.h>
231#include <asm/i8253.h>
231 232
232#include "io_ports.h" 233#include "io_ports.h"
233 234
234extern spinlock_t i8253_lock;
235extern unsigned long get_cmos_time(void); 235extern unsigned long get_cmos_time(void);
236extern void machine_real_restart(unsigned char *, int); 236extern void machine_real_restart(unsigned char *, int);
237 237
@@ -1168,8 +1168,7 @@ static void get_time_diff(void)
1168static void reinit_timer(void) 1168static void reinit_timer(void)
1169{ 1169{
1170#ifdef INIT_TIMER_AFTER_SUSPEND 1170#ifdef INIT_TIMER_AFTER_SUSPEND
1171 unsigned long flags; 1171 unsigned long flags;
1172 extern spinlock_t i8253_lock;
1173 1172
1174 spin_lock_irqsave(&i8253_lock, flags); 1173 spin_lock_irqsave(&i8253_lock, flags);
1175 /* set the clock to 100 Hz */ 1174 /* set the clock to 100 Hz */
diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
index 1a49adb1f4a6..e86ea486c311 100644
--- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
+++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
@@ -190,7 +190,7 @@ static __init struct pci_dev *gx_detect_chipset(void)
190 190
191 /* detect which companion chip is used */ 191 /* detect which companion chip is used */
192 while ((gx_pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) { 192 while ((gx_pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) {
193 if ((pci_match_device (gx_chipset_tbl, gx_pci)) != NULL) { 193 if ((pci_match_id(gx_chipset_tbl, gx_pci)) != NULL) {
194 return gx_pci; 194 return gx_pci;
195 } 195 }
196 } 196 }
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 35eb8e29c485..6578f40bd501 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -37,6 +37,7 @@
37#include <asm/smp.h> 37#include <asm/smp.h>
38#include <asm/desc.h> 38#include <asm/desc.h>
39#include <asm/timer.h> 39#include <asm/timer.h>
40#include <asm/i8259.h>
40 41
41#include <mach_apic.h> 42#include <mach_apic.h>
42 43
@@ -1566,7 +1567,6 @@ void print_all_local_APICs (void)
1566 1567
1567void /*__init*/ print_PIC(void) 1568void /*__init*/ print_PIC(void)
1568{ 1569{
1569 extern spinlock_t i8259A_lock;
1570 unsigned int v; 1570 unsigned int v;
1571 unsigned long flags; 1571 unsigned long flags;
1572 1572
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index 3762f6b35ab2..a6d8c45961d3 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -127,48 +127,23 @@ static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
127 regs->eip = (unsigned long)&p->ainsn.insn; 127 regs->eip = (unsigned long)&p->ainsn.insn;
128} 128}
129 129
130struct task_struct *arch_get_kprobe_task(void *ptr)
131{
132 return ((struct thread_info *) (((unsigned long) ptr) &
133 (~(THREAD_SIZE -1))))->task;
134}
135
136void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs) 130void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs)
137{ 131{
138 unsigned long *sara = (unsigned long *)&regs->esp; 132 unsigned long *sara = (unsigned long *)&regs->esp;
139 struct kretprobe_instance *ri; 133 struct kretprobe_instance *ri;
140 static void *orig_ret_addr; 134
135 if ((ri = get_free_rp_inst(rp)) != NULL) {
136 ri->rp = rp;
137 ri->task = current;
138 ri->ret_addr = (kprobe_opcode_t *) *sara;
141 139
142 /*
143 * Save the return address when the return probe hits
144 * the first time, and use it to populate the (krprobe
145 * instance)->ret_addr for subsequent return probes at
146 * the same addrress since stack address would have
147 * the kretprobe_trampoline by then.
148 */
149 if (((void*) *sara) != kretprobe_trampoline)
150 orig_ret_addr = (void*) *sara;
151
152 if ((ri = get_free_rp_inst(rp)) != NULL) {
153 ri->rp = rp;
154 ri->stack_addr = sara;
155 ri->ret_addr = orig_ret_addr;
156 add_rp_inst(ri);
157 /* Replace the return addr with trampoline addr */ 140 /* Replace the return addr with trampoline addr */
158 *sara = (unsigned long) &kretprobe_trampoline; 141 *sara = (unsigned long) &kretprobe_trampoline;
159 } else {
160 rp->nmissed++;
161 }
162}
163 142
164void arch_kprobe_flush_task(struct task_struct *tk) 143 add_rp_inst(ri);
165{ 144 } else {
166 struct kretprobe_instance *ri; 145 rp->nmissed++;
167 while ((ri = get_rp_inst_tsk(tk)) != NULL) { 146 }
168 *((unsigned long *)(ri->stack_addr)) =
169 (unsigned long) ri->ret_addr;
170 recycle_rp_inst(ri);
171 }
172} 147}
173 148
174/* 149/*
@@ -286,36 +261,59 @@ no_kprobe:
286 */ 261 */
287int trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) 262int trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
288{ 263{
289 struct task_struct *tsk; 264 struct kretprobe_instance *ri = NULL;
290 struct kretprobe_instance *ri; 265 struct hlist_head *head;
291 struct hlist_head *head; 266 struct hlist_node *node, *tmp;
292 struct hlist_node *node; 267 unsigned long orig_ret_address = 0;
293 unsigned long *sara = ((unsigned long *) &regs->esp) - 1; 268 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
294
295 tsk = arch_get_kprobe_task(sara);
296 head = kretprobe_inst_table_head(tsk);
297
298 hlist_for_each_entry(ri, node, head, hlist) {
299 if (ri->stack_addr == sara && ri->rp) {
300 if (ri->rp->handler)
301 ri->rp->handler(ri, regs);
302 }
303 }
304 return 0;
305}
306 269
307void trampoline_post_handler(struct kprobe *p, struct pt_regs *regs, 270 head = kretprobe_inst_table_head(current);
308 unsigned long flags)
309{
310 struct kretprobe_instance *ri;
311 /* RA already popped */
312 unsigned long *sara = ((unsigned long *)&regs->esp) - 1;
313 271
314 while ((ri = get_rp_inst(sara))) { 272 /*
315 regs->eip = (unsigned long)ri->ret_addr; 273 * It is possible to have multiple instances associated with a given
274 * task either because an multiple functions in the call path
275 * have a return probe installed on them, and/or more then one return
276 * return probe was registered for a target function.
277 *
278 * We can handle this because:
279 * - instances are always inserted at the head of the list
280 * - when multiple return probes are registered for the same
281 * function, the first instance's ret_addr will point to the
282 * real return address, and all the rest will point to
283 * kretprobe_trampoline
284 */
285 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
286 if (ri->task != current)
287 /* another task is sharing our hash bucket */
288 continue;
289
290 if (ri->rp && ri->rp->handler)
291 ri->rp->handler(ri, regs);
292
293 orig_ret_address = (unsigned long)ri->ret_addr;
316 recycle_rp_inst(ri); 294 recycle_rp_inst(ri);
295
296 if (orig_ret_address != trampoline_address)
297 /*
298 * This is the real return address. Any other
299 * instances associated with this task are for
300 * other calls deeper on the call stack
301 */
302 break;
317 } 303 }
318 regs->eflags &= ~TF_MASK; 304
305 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
306 regs->eip = orig_ret_address;
307
308 unlock_kprobes();
309 preempt_enable_no_resched();
310
311 /*
312 * By returning a non-zero value, we are telling
313 * kprobe_handler() that we have handled unlocking
314 * and re-enabling preemption.
315 */
316 return 1;
319} 317}
320 318
321/* 319/*
@@ -403,8 +401,7 @@ static inline int post_kprobe_handler(struct pt_regs *regs)
403 current_kprobe->post_handler(current_kprobe, regs, 0); 401 current_kprobe->post_handler(current_kprobe, regs, 0);
404 } 402 }
405 403
406 if (current_kprobe->post_handler != trampoline_post_handler) 404 resume_execution(current_kprobe, regs);
407 resume_execution(current_kprobe, regs);
408 regs->eflags |= kprobe_saved_eflags; 405 regs->eflags |= kprobe_saved_eflags;
409 406
410 /*Restore back the original saved kprobes variables and continue. */ 407 /*Restore back the original saved kprobes variables and continue. */
@@ -534,3 +531,13 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
534 } 531 }
535 return 0; 532 return 0;
536} 533}
534
535static struct kprobe trampoline_p = {
536 .addr = (kprobe_opcode_t *) &kretprobe_trampoline,
537 .pre_handler = trampoline_probe_handler
538};
539
540int __init arch_init_kprobes(void)
541{
542 return register_kprobe(&trampoline_p);
543}
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 5f8cfa6b7940..ba243a4cc119 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -617,6 +617,33 @@ handle_io_bitmap(struct thread_struct *next, struct tss_struct *tss)
617} 617}
618 618
619/* 619/*
620 * This function selects if the context switch from prev to next
621 * has to tweak the TSC disable bit in the cr4.
622 */
623static inline void disable_tsc(struct task_struct *prev_p,
624 struct task_struct *next_p)
625{
626 struct thread_info *prev, *next;
627
628 /*
629 * gcc should eliminate the ->thread_info dereference if
630 * has_secure_computing returns 0 at compile time (SECCOMP=n).
631 */
632 prev = prev_p->thread_info;
633 next = next_p->thread_info;
634
635 if (has_secure_computing(prev) || has_secure_computing(next)) {
636 /* slow path here */
637 if (has_secure_computing(prev) &&
638 !has_secure_computing(next)) {
639 write_cr4(read_cr4() & ~X86_CR4_TSD);
640 } else if (!has_secure_computing(prev) &&
641 has_secure_computing(next))
642 write_cr4(read_cr4() | X86_CR4_TSD);
643 }
644}
645
646/*
620 * switch_to(x,yn) should switch tasks from x to y. 647 * switch_to(x,yn) should switch tasks from x to y.
621 * 648 *
622 * We fsave/fwait so that an exception goes off at the right time 649 * We fsave/fwait so that an exception goes off at the right time
@@ -695,6 +722,8 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
695 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) 722 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr))
696 handle_io_bitmap(next, tss); 723 handle_io_bitmap(next, tss);
697 724
725 disable_tsc(prev_p, next_p);
726
698 return prev_p; 727 return prev_p;
699} 728}
700 729
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index 442a6e937b19..3db9a04aec6e 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -289,3 +289,5 @@ ENTRY(sys_call_table)
289 .long sys_add_key 289 .long sys_add_key
290 .long sys_request_key 290 .long sys_request_key
291 .long sys_keyctl 291 .long sys_keyctl
292 .long sys_ioprio_set
293 .long sys_ioprio_get /* 290 */
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
index e68d9fdb0759..2854c357377f 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -68,7 +68,8 @@
68 68
69#include "io_ports.h" 69#include "io_ports.h"
70 70
71extern spinlock_t i8259A_lock; 71#include <asm/i8259.h>
72
72int pit_latch_buggy; /* extern */ 73int pit_latch_buggy; /* extern */
73 74
74#include "do_timer.h" 75#include "do_timer.h"
@@ -85,6 +86,8 @@ extern unsigned long wall_jiffies;
85DEFINE_SPINLOCK(rtc_lock); 86DEFINE_SPINLOCK(rtc_lock);
86EXPORT_SYMBOL(rtc_lock); 87EXPORT_SYMBOL(rtc_lock);
87 88
89#include <asm/i8253.h>
90
88DEFINE_SPINLOCK(i8253_lock); 91DEFINE_SPINLOCK(i8253_lock);
89EXPORT_SYMBOL(i8253_lock); 92EXPORT_SYMBOL(i8253_lock);
90 93
diff --git a/arch/i386/kernel/timers/timer_cyclone.c b/arch/i386/kernel/timers/timer_cyclone.c
index f6f1206a11bb..13892a65c941 100644
--- a/arch/i386/kernel/timers/timer_cyclone.c
+++ b/arch/i386/kernel/timers/timer_cyclone.c
@@ -17,9 +17,9 @@
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19#include <asm/fixmap.h> 19#include <asm/fixmap.h>
20#include "io_ports.h" 20#include <asm/i8253.h>
21 21
22extern spinlock_t i8253_lock; 22#include "io_ports.h"
23 23
24/* Number of usecs that the last interrupt was delayed */ 24/* Number of usecs that the last interrupt was delayed */
25static int delay_at_last_interrupt; 25static int delay_at_last_interrupt;
diff --git a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c
index 967d5453cd0e..06de036a820c 100644
--- a/arch/i386/kernel/timers/timer_pit.c
+++ b/arch/i386/kernel/timers/timer_pit.c
@@ -15,9 +15,8 @@
15#include <asm/smp.h> 15#include <asm/smp.h>
16#include <asm/io.h> 16#include <asm/io.h>
17#include <asm/arch_hooks.h> 17#include <asm/arch_hooks.h>
18#include <asm/i8253.h>
18 19
19extern spinlock_t i8259A_lock;
20extern spinlock_t i8253_lock;
21#include "do_timer.h" 20#include "do_timer.h"
22#include "io_ports.h" 21#include "io_ports.h"
23 22
@@ -166,7 +165,6 @@ struct init_timer_opts __initdata timer_pit_init = {
166 165
167void setup_pit_timer(void) 166void setup_pit_timer(void)
168{ 167{
169 extern spinlock_t i8253_lock;
170 unsigned long flags; 168 unsigned long flags;
171 169
172 spin_lock_irqsave(&i8253_lock, flags); 170 spin_lock_irqsave(&i8253_lock, flags);
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index f46e625bab67..8f4e4d5bc560 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -24,6 +24,7 @@
24#include "mach_timer.h" 24#include "mach_timer.h"
25 25
26#include <asm/hpet.h> 26#include <asm/hpet.h>
27#include <asm/i8253.h>
27 28
28#ifdef CONFIG_HPET_TIMER 29#ifdef CONFIG_HPET_TIMER
29static unsigned long hpet_usec_quotient; 30static unsigned long hpet_usec_quotient;
@@ -35,8 +36,6 @@ static inline void cpufreq_delayed_get(void);
35 36
36int tsc_disable __devinitdata = 0; 37int tsc_disable __devinitdata = 0;
37 38
38extern spinlock_t i8253_lock;
39
40static int use_tsc; 39static int use_tsc;
41/* Number of usecs that the last interrupt was delayed */ 40/* Number of usecs that the last interrupt was delayed */
42static int delay_at_last_interrupt; 41static int delay_at_last_interrupt;
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c
index 602aea240e9b..3e439ce5e1b2 100644
--- a/arch/i386/mach-voyager/voyager_basic.c
+++ b/arch/i386/mach-voyager/voyager_basic.c
@@ -30,6 +30,7 @@
30#include <linux/irq.h> 30#include <linux/irq.h>
31#include <asm/tlbflush.h> 31#include <asm/tlbflush.h>
32#include <asm/arch_hooks.h> 32#include <asm/arch_hooks.h>
33#include <asm/i8253.h>
33 34
34/* 35/*
35 * Power off function, if any 36 * Power off function, if any
@@ -182,7 +183,6 @@ voyager_timer_interrupt(struct pt_regs *regs)
182 * and swiftly introduce it to something sharp and 183 * and swiftly introduce it to something sharp and
183 * pointy. */ 184 * pointy. */
184 __u16 val; 185 __u16 val;
185 extern spinlock_t i8253_lock;
186 186
187 spin_lock(&i8253_lock); 187 spin_lock(&i8253_lock);
188 188
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c
index 720975e1af50..70bcd53451f6 100644
--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -25,7 +25,8 @@ unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 |
25 25
26int pci_routeirq; 26int pci_routeirq;
27int pcibios_last_bus = -1; 27int pcibios_last_bus = -1;
28struct pci_bus *pci_root_bus = NULL; 28unsigned long pirq_table_addr;
29struct pci_bus *pci_root_bus;
29struct pci_raw_ops *raw_pci_ops; 30struct pci_raw_ops *raw_pci_ops;
30 31
31static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) 32static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
@@ -133,7 +134,7 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum)
133 134
134 printk("PCI: Probing PCI hardware (bus %02x)\n", busnum); 135 printk("PCI: Probing PCI hardware (bus %02x)\n", busnum);
135 136
136 return pci_scan_bus(busnum, &pci_root_ops, NULL); 137 return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, NULL);
137} 138}
138 139
139extern u8 pci_cache_line_size; 140extern u8 pci_cache_line_size;
@@ -164,6 +165,7 @@ static int __init pcibios_init(void)
164 if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT)) 165 if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT))
165 pcibios_sort(); 166 pcibios_sort();
166#endif 167#endif
168 pci_assign_unassigned_resources();
167 return 0; 169 return 0;
168} 170}
169 171
@@ -188,6 +190,9 @@ char * __devinit pcibios_setup(char *str)
188 } else if (!strcmp(str, "biosirq")) { 190 } else if (!strcmp(str, "biosirq")) {
189 pci_probe |= PCI_BIOS_IRQ_SCAN; 191 pci_probe |= PCI_BIOS_IRQ_SCAN;
190 return NULL; 192 return NULL;
193 } else if (!strncmp(str, "pirqaddr=", 9)) {
194 pirq_table_addr = simple_strtoul(str+9, NULL, 0);
195 return NULL;
191 } 196 }
192#endif 197#endif
193#ifdef CONFIG_PCI_DIRECT 198#ifdef CONFIG_PCI_DIRECT
diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c
index c205ea7e233b..93a364c82150 100644
--- a/arch/i386/pci/i386.c
+++ b/arch/i386/pci/i386.c
@@ -106,11 +106,16 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
106 if ((dev = bus->self)) { 106 if ((dev = bus->self)) {
107 for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { 107 for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) {
108 r = &dev->resource[idx]; 108 r = &dev->resource[idx];
109 if (!r->start) 109 if (!r->flags)
110 continue; 110 continue;
111 pr = pci_find_parent_resource(dev, r); 111 pr = pci_find_parent_resource(dev, r);
112 if (!pr || request_resource(pr, r) < 0) 112 if (!r->start || !pr || request_resource(pr, r) < 0) {
113 printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev)); 113 printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev));
114 /* Something is wrong with the region.
115 Invalidate the resource to prevent child
116 resource allocations in this range. */
117 r->flags = 0;
118 }
114 } 119 }
115 } 120 }
116 pcibios_allocate_bus_resources(&bus->children); 121 pcibios_allocate_bus_resources(&bus->children);
@@ -227,7 +232,7 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask)
227 232
228 pci_read_config_word(dev, PCI_COMMAND, &cmd); 233 pci_read_config_word(dev, PCI_COMMAND, &cmd);
229 old_cmd = cmd; 234 old_cmd = cmd;
230 for(idx=0; idx<6; idx++) { 235 for(idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
231 /* Only set up the requested stuff */ 236 /* Only set up the requested stuff */
232 if (!(mask & (1<<idx))) 237 if (!(mask & (1<<idx)))
233 continue; 238 continue;
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index 83458f81e661..78ca1ecbb907 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -58,6 +58,35 @@ struct irq_router_handler {
58int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL; 58int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL;
59 59
60/* 60/*
61 * Check passed address for the PCI IRQ Routing Table signature
62 * and perform checksum verification.
63 */
64
65static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr)
66{
67 struct irq_routing_table *rt;
68 int i;
69 u8 sum;
70
71 rt = (struct irq_routing_table *) addr;
72 if (rt->signature != PIRQ_SIGNATURE ||
73 rt->version != PIRQ_VERSION ||
74 rt->size % 16 ||
75 rt->size < sizeof(struct irq_routing_table))
76 return NULL;
77 sum = 0;
78 for (i=0; i < rt->size; i++)
79 sum += addr[i];
80 if (!sum) {
81 DBG("PCI: Interrupt Routing Table found at 0x%p\n", rt);
82 return rt;
83 }
84 return NULL;
85}
86
87
88
89/*
61 * Search 0xf0000 -- 0xfffff for the PCI IRQ Routing Table. 90 * Search 0xf0000 -- 0xfffff for the PCI IRQ Routing Table.
62 */ 91 */
63 92
@@ -65,23 +94,17 @@ static struct irq_routing_table * __init pirq_find_routing_table(void)
65{ 94{
66 u8 *addr; 95 u8 *addr;
67 struct irq_routing_table *rt; 96 struct irq_routing_table *rt;
68 int i;
69 u8 sum;
70 97
98 if (pirq_table_addr) {
99 rt = pirq_check_routing_table((u8 *) __va(pirq_table_addr));
100 if (rt)
101 return rt;
102 printk(KERN_WARNING "PCI: PIRQ table NOT found at pirqaddr\n");
103 }
71 for(addr = (u8 *) __va(0xf0000); addr < (u8 *) __va(0x100000); addr += 16) { 104 for(addr = (u8 *) __va(0xf0000); addr < (u8 *) __va(0x100000); addr += 16) {
72 rt = (struct irq_routing_table *) addr; 105 rt = pirq_check_routing_table(addr);
73 if (rt->signature != PIRQ_SIGNATURE || 106 if (rt)
74 rt->version != PIRQ_VERSION ||
75 rt->size % 16 ||
76 rt->size < sizeof(struct irq_routing_table))
77 continue;
78 sum = 0;
79 for(i=0; i<rt->size; i++)
80 sum += addr[i];
81 if (!sum) {
82 DBG("PCI: Interrupt Routing Table found at 0x%p\n", rt);
83 return rt; 107 return rt;
84 }
85 } 108 }
86 return NULL; 109 return NULL;
87} 110}
diff --git a/arch/i386/pci/legacy.c b/arch/i386/pci/legacy.c
index 1492e3753869..149a9588c256 100644
--- a/arch/i386/pci/legacy.c
+++ b/arch/i386/pci/legacy.c
@@ -45,6 +45,8 @@ static int __init pci_legacy_init(void)
45 45
46 printk("PCI: Probing PCI hardware\n"); 46 printk("PCI: Probing PCI hardware\n");
47 pci_root_bus = pcibios_scan_root(0); 47 pci_root_bus = pcibios_scan_root(0);
48 if (pci_root_bus)
49 pci_bus_add_devices(pci_root_bus);
48 50
49 pcibios_fixup_peer_bridges(); 51 pcibios_fixup_peer_bridges();
50 52
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index 021a50aa51f4..60f0e7a1162a 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -11,11 +11,9 @@
11 11
12#include <linux/pci.h> 12#include <linux/pci.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/acpi.h>
14#include "pci.h" 15#include "pci.h"
15 16
16/* The physical address of the MMCONFIG aperture. Set from ACPI tables. */
17u32 pci_mmcfg_base_addr;
18
19#define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG)) 17#define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG))
20 18
21/* The base address of the last MMCONFIG device accessed */ 19/* The base address of the last MMCONFIG device accessed */
@@ -24,10 +22,31 @@ static u32 mmcfg_last_accessed_device;
24/* 22/*
25 * Functions for accessing PCI configuration space with MMCONFIG accesses 23 * Functions for accessing PCI configuration space with MMCONFIG accesses
26 */ 24 */
25static u32 get_base_addr(unsigned int seg, int bus)
26{
27 int cfg_num = -1;
28 struct acpi_table_mcfg_config *cfg;
29
30 while (1) {
31 ++cfg_num;
32 if (cfg_num >= pci_mmcfg_config_num) {
33 /* something bad is going on, no cfg table is found. */
34 /* so we fall back to the old way we used to do this */
35 /* and just rely on the first entry to be correct. */
36 return pci_mmcfg_config[0].base_address;
37 }
38 cfg = &pci_mmcfg_config[cfg_num];
39 if (cfg->pci_segment_group_number != seg)
40 continue;
41 if ((cfg->start_bus_number <= bus) &&
42 (cfg->end_bus_number >= bus))
43 return cfg->base_address;
44 }
45}
27 46
28static inline void pci_exp_set_dev_base(int bus, int devfn) 47static inline void pci_exp_set_dev_base(unsigned int seg, int bus, int devfn)
29{ 48{
30 u32 dev_base = pci_mmcfg_base_addr | (bus << 20) | (devfn << 12); 49 u32 dev_base = get_base_addr(seg, bus) | (bus << 20) | (devfn << 12);
31 if (dev_base != mmcfg_last_accessed_device) { 50 if (dev_base != mmcfg_last_accessed_device) {
32 mmcfg_last_accessed_device = dev_base; 51 mmcfg_last_accessed_device = dev_base;
33 set_fixmap_nocache(FIX_PCIE_MCFG, dev_base); 52 set_fixmap_nocache(FIX_PCIE_MCFG, dev_base);
@@ -44,7 +63,7 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
44 63
45 spin_lock_irqsave(&pci_config_lock, flags); 64 spin_lock_irqsave(&pci_config_lock, flags);
46 65
47 pci_exp_set_dev_base(bus, devfn); 66 pci_exp_set_dev_base(seg, bus, devfn);
48 67
49 switch (len) { 68 switch (len) {
50 case 1: 69 case 1:
@@ -73,7 +92,7 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
73 92
74 spin_lock_irqsave(&pci_config_lock, flags); 93 spin_lock_irqsave(&pci_config_lock, flags);
75 94
76 pci_exp_set_dev_base(bus, devfn); 95 pci_exp_set_dev_base(seg, bus, devfn);
77 96
78 switch (len) { 97 switch (len) {
79 case 1: 98 case 1:
@@ -101,7 +120,11 @@ static int __init pci_mmcfg_init(void)
101{ 120{
102 if ((pci_probe & PCI_PROBE_MMCONF) == 0) 121 if ((pci_probe & PCI_PROBE_MMCONF) == 0)
103 goto out; 122 goto out;
104 if (!pci_mmcfg_base_addr) 123
124 acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg);
125 if ((pci_mmcfg_config_num == 0) ||
126 (pci_mmcfg_config == NULL) ||
127 (pci_mmcfg_config[0].base_address == 0))
105 goto out; 128 goto out;
106 129
107 /* Kludge for now. Don't use mmconfig on AMD systems because 130 /* Kludge for now. Don't use mmconfig on AMD systems because
diff --git a/arch/i386/pci/numa.c b/arch/i386/pci/numa.c
index 9e3695461899..adbe17a38f6f 100644
--- a/arch/i386/pci/numa.c
+++ b/arch/i386/pci/numa.c
@@ -115,6 +115,8 @@ static int __init pci_numa_init(void)
115 return 0; 115 return 0;
116 116
117 pci_root_bus = pcibios_scan_root(0); 117 pci_root_bus = pcibios_scan_root(0);
118 if (pci_root_bus)
119 pci_bus_add_devices(pci_root_bus);
118 if (num_online_nodes() > 1) 120 if (num_online_nodes() > 1)
119 for_each_online_node(quad) { 121 for_each_online_node(quad) {
120 if (quad == 0) 122 if (quad == 0)
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
index a8fc80ca69f3..a80f0f55ff51 100644
--- a/arch/i386/pci/pci.h
+++ b/arch/i386/pci/pci.h
@@ -27,6 +27,7 @@
27#define PCI_ASSIGN_ALL_BUSSES 0x4000 27#define PCI_ASSIGN_ALL_BUSSES 0x4000
28 28
29extern unsigned int pci_probe; 29extern unsigned int pci_probe;
30extern unsigned long pirq_table_addr;
30 31
31/* pci-i386.c */ 32/* pci-i386.c */
32 33
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index 487d2e36b0a6..c05613980300 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -99,7 +99,7 @@ CONFIG_ACPI_DEALLOCATE_IRQ=y
99# Firmware Drivers 99# Firmware Drivers
100# 100#
101CONFIG_EFI_VARS=y 101CONFIG_EFI_VARS=y
102# CONFIG_EFI_PCDP is not set 102CONFIG_EFI_PCDP=y
103CONFIG_BINFMT_ELF=y 103CONFIG_BINFMT_ELF=y
104# CONFIG_BINFMT_MISC is not set 104# CONFIG_BINFMT_MISC is not set
105 105
@@ -650,7 +650,7 @@ CONFIG_MMTIMER=y
650# 650#
651# Console display driver support 651# Console display driver support
652# 652#
653# CONFIG_VGA_CONSOLE is not set 653CONFIG_VGA_CONSOLE=y
654CONFIG_DUMMY_CONSOLE=y 654CONFIG_DUMMY_CONSOLE=y
655 655
656# 656#
diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig
index 47f45341ac62..73454eee26f1 100644
--- a/arch/ia64/configs/tiger_defconfig
+++ b/arch/ia64/configs/tiger_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-20050621 3# Linux kernel version: 2.6.13-rc1-20050629
4# Tue Jun 21 14:03:24 2005 4# Wed Jun 29 15:28:12 2005
5# 5#
6 6
7# 7#
@@ -80,18 +80,29 @@ CONFIG_MCKINLEY=y
80# CONFIG_IA64_PAGE_SIZE_8KB is not set 80# CONFIG_IA64_PAGE_SIZE_8KB is not set
81CONFIG_IA64_PAGE_SIZE_16KB=y 81CONFIG_IA64_PAGE_SIZE_16KB=y
82# CONFIG_IA64_PAGE_SIZE_64KB is not set 82# CONFIG_IA64_PAGE_SIZE_64KB is not set
83# CONFIG_HZ_100 is not set
84CONFIG_HZ_250=y
85# CONFIG_HZ_1000 is not set
86CONFIG_HZ=250
83CONFIG_IA64_L1_CACHE_SHIFT=7 87CONFIG_IA64_L1_CACHE_SHIFT=7
84# CONFIG_NUMA is not set 88# CONFIG_NUMA is not set
85CONFIG_VIRTUAL_MEM_MAP=y 89CONFIG_VIRTUAL_MEM_MAP=y
86CONFIG_HOLES_IN_ZONE=y 90CONFIG_HOLES_IN_ZONE=y
87CONFIG_IA64_CYCLONE=y 91CONFIG_IA64_CYCLONE=y
88CONFIG_IOSAPIC=y 92CONFIG_IOSAPIC=y
93# CONFIG_IA64_SGI_SN_XP is not set
89CONFIG_FORCE_MAX_ZONEORDER=18 94CONFIG_FORCE_MAX_ZONEORDER=18
90CONFIG_SMP=y 95CONFIG_SMP=y
91CONFIG_NR_CPUS=4 96CONFIG_NR_CPUS=4
92CONFIG_HOTPLUG_CPU=y 97CONFIG_HOTPLUG_CPU=y
93# CONFIG_SCHED_SMT is not set 98# CONFIG_SCHED_SMT is not set
94# CONFIG_PREEMPT is not set 99# CONFIG_PREEMPT is not set
100CONFIG_SELECT_MEMORY_MODEL=y
101CONFIG_FLATMEM_MANUAL=y
102# CONFIG_DISCONTIGMEM_MANUAL is not set
103# CONFIG_SPARSEMEM_MANUAL is not set
104CONFIG_FLATMEM=y
105CONFIG_FLAT_NODE_MEM_MAP=y
95CONFIG_HAVE_DEC_LOCK=y 106CONFIG_HAVE_DEC_LOCK=y
96CONFIG_IA32_SUPPORT=y 107CONFIG_IA32_SUPPORT=y
97CONFIG_COMPAT=y 108CONFIG_COMPAT=y
@@ -257,6 +268,7 @@ CONFIG_BLK_DEV_CMD64X=y
257# CONFIG_BLK_DEV_HPT366 is not set 268# CONFIG_BLK_DEV_HPT366 is not set
258# CONFIG_BLK_DEV_SC1200 is not set 269# CONFIG_BLK_DEV_SC1200 is not set
259CONFIG_BLK_DEV_PIIX=y 270CONFIG_BLK_DEV_PIIX=y
271# CONFIG_BLK_DEV_IT821X is not set
260# CONFIG_BLK_DEV_NS87415 is not set 272# CONFIG_BLK_DEV_NS87415 is not set
261# CONFIG_BLK_DEV_PDC202XX_OLD is not set 273# CONFIG_BLK_DEV_PDC202XX_OLD is not set
262# CONFIG_BLK_DEV_PDC202XX_NEW is not set 274# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -395,6 +407,7 @@ CONFIG_UNIX=y
395CONFIG_INET=y 407CONFIG_INET=y
396CONFIG_IP_MULTICAST=y 408CONFIG_IP_MULTICAST=y
397# CONFIG_IP_ADVANCED_ROUTER is not set 409# CONFIG_IP_ADVANCED_ROUTER is not set
410CONFIG_IP_FIB_HASH=y
398# CONFIG_IP_PNP is not set 411# CONFIG_IP_PNP is not set
399# CONFIG_NET_IPIP is not set 412# CONFIG_NET_IPIP is not set
400# CONFIG_NET_IPGRE is not set 413# CONFIG_NET_IPGRE is not set
@@ -407,6 +420,8 @@ CONFIG_SYN_COOKIES=y
407# CONFIG_INET_TUNNEL is not set 420# CONFIG_INET_TUNNEL is not set
408CONFIG_IP_TCPDIAG=y 421CONFIG_IP_TCPDIAG=y
409# CONFIG_IP_TCPDIAG_IPV6 is not set 422# CONFIG_IP_TCPDIAG_IPV6 is not set
423# CONFIG_TCP_CONG_ADVANCED is not set
424CONFIG_TCP_CONG_BIC=y
410# CONFIG_IPV6 is not set 425# CONFIG_IPV6 is not set
411# CONFIG_NETFILTER is not set 426# CONFIG_NETFILTER is not set
412 427
@@ -598,9 +613,7 @@ CONFIG_GAMEPORT=m
598# CONFIG_GAMEPORT_NS558 is not set 613# CONFIG_GAMEPORT_NS558 is not set
599# CONFIG_GAMEPORT_L4 is not set 614# CONFIG_GAMEPORT_L4 is not set
600# CONFIG_GAMEPORT_EMU10K1 is not set 615# CONFIG_GAMEPORT_EMU10K1 is not set
601# CONFIG_GAMEPORT_VORTEX is not set
602# CONFIG_GAMEPORT_FM801 is not set 616# CONFIG_GAMEPORT_FM801 is not set
603# CONFIG_GAMEPORT_CS461X is not set
604 617
605# 618#
606# Character devices 619# Character devices
@@ -629,7 +642,6 @@ CONFIG_SERIAL_8250_NR_UARTS=6
629CONFIG_SERIAL_8250_EXTENDED=y 642CONFIG_SERIAL_8250_EXTENDED=y
630CONFIG_SERIAL_8250_SHARE_IRQ=y 643CONFIG_SERIAL_8250_SHARE_IRQ=y
631# CONFIG_SERIAL_8250_DETECT_IRQ is not set 644# CONFIG_SERIAL_8250_DETECT_IRQ is not set
632# CONFIG_SERIAL_8250_MULTIPORT is not set
633# CONFIG_SERIAL_8250_RSA is not set 645# CONFIG_SERIAL_8250_RSA is not set
634 646
635# 647#
@@ -743,6 +755,7 @@ CONFIG_USB_DEVICEFS=y
743CONFIG_USB_EHCI_HCD=m 755CONFIG_USB_EHCI_HCD=m
744# CONFIG_USB_EHCI_SPLIT_ISO is not set 756# CONFIG_USB_EHCI_SPLIT_ISO is not set
745# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 757# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
758# CONFIG_USB_ISP116X_HCD is not set
746CONFIG_USB_OHCI_HCD=m 759CONFIG_USB_OHCI_HCD=m
747# CONFIG_USB_OHCI_BIG_ENDIAN is not set 760# CONFIG_USB_OHCI_BIG_ENDIAN is not set
748CONFIG_USB_OHCI_LITTLE_ENDIAN=y 761CONFIG_USB_OHCI_LITTLE_ENDIAN=y
@@ -779,9 +792,11 @@ CONFIG_USB_HIDINPUT=y
779# CONFIG_USB_HIDDEV is not set 792# CONFIG_USB_HIDDEV is not set
780# CONFIG_USB_AIPTEK is not set 793# CONFIG_USB_AIPTEK is not set
781# CONFIG_USB_WACOM is not set 794# CONFIG_USB_WACOM is not set
795# CONFIG_USB_ACECAD is not set
782# CONFIG_USB_KBTAB is not set 796# CONFIG_USB_KBTAB is not set
783# CONFIG_USB_POWERMATE is not set 797# CONFIG_USB_POWERMATE is not set
784# CONFIG_USB_MTOUCH is not set 798# CONFIG_USB_MTOUCH is not set
799# CONFIG_USB_ITMTOUCH is not set
785# CONFIG_USB_EGALAX is not set 800# CONFIG_USB_EGALAX is not set
786# CONFIG_USB_XPAD is not set 801# CONFIG_USB_XPAD is not set
787# CONFIG_USB_ATI_REMOTE is not set 802# CONFIG_USB_ATI_REMOTE is not set
@@ -838,7 +853,7 @@ CONFIG_USB_HIDINPUT=y
838# CONFIG_USB_TEST is not set 853# CONFIG_USB_TEST is not set
839 854
840# 855#
841# USB ATM/DSL drivers 856# USB DSL modem support
842# 857#
843 858
844# 859#
@@ -857,12 +872,17 @@ CONFIG_USB_HIDINPUT=y
857# CONFIG_INFINIBAND is not set 872# CONFIG_INFINIBAND is not set
858 873
859# 874#
875# SN Devices
876#
877
878#
860# File systems 879# File systems
861# 880#
862CONFIG_EXT2_FS=y 881CONFIG_EXT2_FS=y
863CONFIG_EXT2_FS_XATTR=y 882CONFIG_EXT2_FS_XATTR=y
864CONFIG_EXT2_FS_POSIX_ACL=y 883CONFIG_EXT2_FS_POSIX_ACL=y
865CONFIG_EXT2_FS_SECURITY=y 884CONFIG_EXT2_FS_SECURITY=y
885# CONFIG_EXT2_FS_XIP is not set
866CONFIG_EXT3_FS=y 886CONFIG_EXT3_FS=y
867CONFIG_EXT3_FS_XATTR=y 887CONFIG_EXT3_FS_XATTR=y
868CONFIG_EXT3_FS_POSIX_ACL=y 888CONFIG_EXT3_FS_POSIX_ACL=y
@@ -922,7 +942,6 @@ CONFIG_NTFS_FS=m
922CONFIG_PROC_FS=y 942CONFIG_PROC_FS=y
923CONFIG_PROC_KCORE=y 943CONFIG_PROC_KCORE=y
924CONFIG_SYSFS=y 944CONFIG_SYSFS=y
925# CONFIG_DEVFS_FS is not set
926# CONFIG_DEVPTS_FS_XATTR is not set 945# CONFIG_DEVPTS_FS_XATTR is not set
927CONFIG_TMPFS=y 946CONFIG_TMPFS=y
928CONFIG_TMPFS_XATTR=y 947CONFIG_TMPFS_XATTR=y
@@ -953,15 +972,18 @@ CONFIG_RAMFS=y
953# 972#
954CONFIG_NFS_FS=m 973CONFIG_NFS_FS=m
955CONFIG_NFS_V3=y 974CONFIG_NFS_V3=y
975# CONFIG_NFS_V3_ACL is not set
956CONFIG_NFS_V4=y 976CONFIG_NFS_V4=y
957CONFIG_NFS_DIRECTIO=y 977CONFIG_NFS_DIRECTIO=y
958CONFIG_NFSD=m 978CONFIG_NFSD=m
959CONFIG_NFSD_V3=y 979CONFIG_NFSD_V3=y
980# CONFIG_NFSD_V3_ACL is not set
960CONFIG_NFSD_V4=y 981CONFIG_NFSD_V4=y
961CONFIG_NFSD_TCP=y 982CONFIG_NFSD_TCP=y
962CONFIG_LOCKD=m 983CONFIG_LOCKD=m
963CONFIG_LOCKD_V4=y 984CONFIG_LOCKD_V4=y
964CONFIG_EXPORTFS=y 985CONFIG_EXPORTFS=y
986CONFIG_NFS_COMMON=y
965CONFIG_SUNRPC=m 987CONFIG_SUNRPC=m
966CONFIG_SUNRPC_GSS=m 988CONFIG_SUNRPC_GSS=m
967CONFIG_RPCSEC_GSS_KRB5=m 989CONFIG_RPCSEC_GSS_KRB5=m
@@ -1069,6 +1091,7 @@ CONFIG_LOG_BUF_SHIFT=20
1069# CONFIG_DEBUG_KOBJECT is not set 1091# CONFIG_DEBUG_KOBJECT is not set
1070# CONFIG_DEBUG_INFO is not set 1092# CONFIG_DEBUG_INFO is not set
1071# CONFIG_DEBUG_FS is not set 1093# CONFIG_DEBUG_FS is not set
1094# CONFIG_KPROBES is not set
1072CONFIG_IA64_GRANULE_16MB=y 1095CONFIG_IA64_GRANULE_16MB=y
1073# CONFIG_IA64_GRANULE_64MB is not set 1096# CONFIG_IA64_GRANULE_64MB is not set
1074# CONFIG_IA64_PRINT_HAZARDS is not set 1097# CONFIG_IA64_PRINT_HAZARDS is not set
@@ -1090,7 +1113,7 @@ CONFIG_CRYPTO=y
1090# CONFIG_CRYPTO_HMAC is not set 1113# CONFIG_CRYPTO_HMAC is not set
1091# CONFIG_CRYPTO_NULL is not set 1114# CONFIG_CRYPTO_NULL is not set
1092# CONFIG_CRYPTO_MD4 is not set 1115# CONFIG_CRYPTO_MD4 is not set
1093CONFIG_CRYPTO_MD5=m 1116CONFIG_CRYPTO_MD5=y
1094# CONFIG_CRYPTO_SHA1 is not set 1117# CONFIG_CRYPTO_SHA1 is not set
1095# CONFIG_CRYPTO_SHA256 is not set 1118# CONFIG_CRYPTO_SHA256 is not set
1096# CONFIG_CRYPTO_SHA512 is not set 1119# CONFIG_CRYPTO_SHA512 is not set
diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig
index 21d6f9bab5e9..b7755e4436d2 100644
--- a/arch/ia64/configs/zx1_defconfig
+++ b/arch/ia64/configs/zx1_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.10 3# Linux kernel version: 2.6.13-rc1-20050629
4# Wed Dec 29 09:05:48 2004 4# Wed Jun 29 15:31:11 2005
5# 5#
6 6
7# 7#
@@ -12,6 +12,7 @@ CONFIG_EXPERIMENTAL=y
12CONFIG_BROKEN=y 12CONFIG_BROKEN=y
13CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_LOCK_KERNEL=y 14CONFIG_LOCK_KERNEL=y
15CONFIG_INIT_ENV_ARG_LIMIT=32
15 16
16# 17#
17# General setup 18# General setup
@@ -24,23 +25,26 @@ CONFIG_BSD_PROCESS_ACCT=y
24# CONFIG_BSD_PROCESS_ACCT_V3 is not set 25# CONFIG_BSD_PROCESS_ACCT_V3 is not set
25CONFIG_SYSCTL=y 26CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set 27# CONFIG_AUDIT is not set
27CONFIG_LOG_BUF_SHIFT=17
28CONFIG_HOTPLUG=y 28CONFIG_HOTPLUG=y
29CONFIG_KOBJECT_UEVENT=y 29CONFIG_KOBJECT_UEVENT=y
30# CONFIG_IKCONFIG is not set 30# CONFIG_IKCONFIG is not set
31# CONFIG_CPUSETS is not set
31# CONFIG_EMBEDDED is not set 32# CONFIG_EMBEDDED is not set
32CONFIG_KALLSYMS=y 33CONFIG_KALLSYMS=y
33# CONFIG_KALLSYMS_ALL is not set 34# CONFIG_KALLSYMS_ALL is not set
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_PRINTK=y
37CONFIG_BUG=y
38CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 39CONFIG_FUTEX=y
36CONFIG_EPOLL=y 40CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
38CONFIG_SHMEM=y 41CONFIG_SHMEM=y
39CONFIG_CC_ALIGN_FUNCTIONS=0 42CONFIG_CC_ALIGN_FUNCTIONS=0
40CONFIG_CC_ALIGN_LABELS=0 43CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 44CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 45CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
44 48
45# 49#
46# Loadable module support 50# Loadable module support
@@ -59,12 +63,15 @@ CONFIG_IA64=y
59CONFIG_64BIT=y 63CONFIG_64BIT=y
60CONFIG_MMU=y 64CONFIG_MMU=y
61CONFIG_RWSEM_XCHGADD_ALGORITHM=y 65CONFIG_RWSEM_XCHGADD_ALGORITHM=y
66CONFIG_GENERIC_CALIBRATE_DELAY=y
62CONFIG_TIME_INTERPOLATION=y 67CONFIG_TIME_INTERPOLATION=y
63CONFIG_EFI=y 68CONFIG_EFI=y
64CONFIG_GENERIC_IOMAP=y 69CONFIG_GENERIC_IOMAP=y
70CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
65# CONFIG_IA64_GENERIC is not set 71# CONFIG_IA64_GENERIC is not set
66# CONFIG_IA64_DIG is not set 72# CONFIG_IA64_DIG is not set
67CONFIG_IA64_HP_ZX1=y 73CONFIG_IA64_HP_ZX1=y
74# CONFIG_IA64_HP_ZX1_SWIOTLB is not set
68# CONFIG_IA64_SGI_SN2 is not set 75# CONFIG_IA64_SGI_SN2 is not set
69# CONFIG_IA64_HP_SIM is not set 76# CONFIG_IA64_HP_SIM is not set
70# CONFIG_ITANIUM is not set 77# CONFIG_ITANIUM is not set
@@ -73,22 +80,36 @@ CONFIG_MCKINLEY=y
73# CONFIG_IA64_PAGE_SIZE_8KB is not set 80# CONFIG_IA64_PAGE_SIZE_8KB is not set
74CONFIG_IA64_PAGE_SIZE_16KB=y 81CONFIG_IA64_PAGE_SIZE_16KB=y
75# CONFIG_IA64_PAGE_SIZE_64KB is not set 82# CONFIG_IA64_PAGE_SIZE_64KB is not set
83# CONFIG_HZ_100 is not set
84CONFIG_HZ_250=y
85# CONFIG_HZ_1000 is not set
86CONFIG_HZ=250
76CONFIG_IA64_L1_CACHE_SHIFT=7 87CONFIG_IA64_L1_CACHE_SHIFT=7
77# CONFIG_NUMA is not set 88# CONFIG_NUMA is not set
78CONFIG_VIRTUAL_MEM_MAP=y 89CONFIG_VIRTUAL_MEM_MAP=y
90CONFIG_HOLES_IN_ZONE=y
79# CONFIG_IA64_CYCLONE is not set 91# CONFIG_IA64_CYCLONE is not set
80CONFIG_IOSAPIC=y 92CONFIG_IOSAPIC=y
93# CONFIG_IA64_SGI_SN_XP is not set
81CONFIG_FORCE_MAX_ZONEORDER=18 94CONFIG_FORCE_MAX_ZONEORDER=18
82CONFIG_SMP=y 95CONFIG_SMP=y
83CONFIG_NR_CPUS=16 96CONFIG_NR_CPUS=16
84# CONFIG_HOTPLUG_CPU is not set 97# CONFIG_HOTPLUG_CPU is not set
98# CONFIG_SCHED_SMT is not set
85# CONFIG_PREEMPT is not set 99# CONFIG_PREEMPT is not set
100CONFIG_SELECT_MEMORY_MODEL=y
101CONFIG_FLATMEM_MANUAL=y
102# CONFIG_DISCONTIGMEM_MANUAL is not set
103# CONFIG_SPARSEMEM_MANUAL is not set
104CONFIG_FLATMEM=y
105CONFIG_FLAT_NODE_MEM_MAP=y
86CONFIG_HAVE_DEC_LOCK=y 106CONFIG_HAVE_DEC_LOCK=y
87CONFIG_IA32_SUPPORT=y 107CONFIG_IA32_SUPPORT=y
88CONFIG_COMPAT=y 108CONFIG_COMPAT=y
89CONFIG_IA64_MCA_RECOVERY=y 109CONFIG_IA64_MCA_RECOVERY=y
90CONFIG_PERFMON=y 110CONFIG_PERFMON=y
91CONFIG_IA64_PALINFO=y 111CONFIG_IA64_PALINFO=y
112CONFIG_ACPI_DEALLOCATE_IRQ=y
92 113
93# 114#
94# Firmware Drivers 115# Firmware Drivers
@@ -120,6 +141,7 @@ CONFIG_ACPI_BUS=y
120CONFIG_ACPI_POWER=y 141CONFIG_ACPI_POWER=y
121CONFIG_ACPI_PCI=y 142CONFIG_ACPI_PCI=y
122CONFIG_ACPI_SYSTEM=y 143CONFIG_ACPI_SYSTEM=y
144# CONFIG_ACPI_CONTAINER is not set
123 145
124# 146#
125# Bus options (PCI, PCMCIA) 147# Bus options (PCI, PCMCIA)
@@ -129,6 +151,7 @@ CONFIG_PCI_DOMAINS=y
129# CONFIG_PCI_MSI is not set 151# CONFIG_PCI_MSI is not set
130CONFIG_PCI_LEGACY_PROC=y 152CONFIG_PCI_LEGACY_PROC=y
131CONFIG_PCI_NAMES=y 153CONFIG_PCI_NAMES=y
154# CONFIG_PCI_DEBUG is not set
132 155
133# 156#
134# PCI Hotplug Support 157# PCI Hotplug Support
@@ -138,7 +161,6 @@ CONFIG_HOTPLUG_PCI=y
138CONFIG_HOTPLUG_PCI_ACPI=y 161CONFIG_HOTPLUG_PCI_ACPI=y
139# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set 162# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set
140# CONFIG_HOTPLUG_PCI_CPCI is not set 163# CONFIG_HOTPLUG_PCI_CPCI is not set
141# CONFIG_HOTPLUG_PCI_PCIE is not set
142# CONFIG_HOTPLUG_PCI_SHPC is not set 164# CONFIG_HOTPLUG_PCI_SHPC is not set
143 165
144# 166#
@@ -147,10 +169,6 @@ CONFIG_HOTPLUG_PCI_ACPI=y
147# CONFIG_PCCARD is not set 169# CONFIG_PCCARD is not set
148 170
149# 171#
150# PC-card bridges
151#
152
153#
154# Device Drivers 172# Device Drivers
155# 173#
156 174
@@ -184,6 +202,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
184# CONFIG_BLK_CPQ_CISS_DA is not set 202# CONFIG_BLK_CPQ_CISS_DA is not set
185# CONFIG_BLK_DEV_DAC960 is not set 203# CONFIG_BLK_DEV_DAC960 is not set
186# CONFIG_BLK_DEV_UMEM is not set 204# CONFIG_BLK_DEV_UMEM is not set
205# CONFIG_BLK_DEV_COW_COMMON is not set
187CONFIG_BLK_DEV_LOOP=y 206CONFIG_BLK_DEV_LOOP=y
188# CONFIG_BLK_DEV_CRYPTOLOOP is not set 207# CONFIG_BLK_DEV_CRYPTOLOOP is not set
189# CONFIG_BLK_DEV_NBD is not set 208# CONFIG_BLK_DEV_NBD is not set
@@ -203,6 +222,7 @@ CONFIG_IOSCHED_NOOP=y
203CONFIG_IOSCHED_AS=y 222CONFIG_IOSCHED_AS=y
204CONFIG_IOSCHED_DEADLINE=y 223CONFIG_IOSCHED_DEADLINE=y
205CONFIG_IOSCHED_CFQ=y 224CONFIG_IOSCHED_CFQ=y
225# CONFIG_ATA_OVER_ETH is not set
206 226
207# 227#
208# ATA/ATAPI/MFM/RLL support 228# ATA/ATAPI/MFM/RLL support
@@ -246,6 +266,7 @@ CONFIG_BLK_DEV_CMD64X=y
246# CONFIG_BLK_DEV_HPT366 is not set 266# CONFIG_BLK_DEV_HPT366 is not set
247# CONFIG_BLK_DEV_SC1200 is not set 267# CONFIG_BLK_DEV_SC1200 is not set
248# CONFIG_BLK_DEV_PIIX is not set 268# CONFIG_BLK_DEV_PIIX is not set
269# CONFIG_BLK_DEV_IT821X is not set
249# CONFIG_BLK_DEV_NS87415 is not set 270# CONFIG_BLK_DEV_NS87415 is not set
250# CONFIG_BLK_DEV_PDC202XX_OLD is not set 271# CONFIG_BLK_DEV_PDC202XX_OLD is not set
251# CONFIG_BLK_DEV_PDC202XX_NEW is not set 272# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -275,6 +296,7 @@ CONFIG_CHR_DEV_OSST=y
275CONFIG_BLK_DEV_SR=y 296CONFIG_BLK_DEV_SR=y
276CONFIG_BLK_DEV_SR_VENDOR=y 297CONFIG_BLK_DEV_SR_VENDOR=y
277CONFIG_CHR_DEV_SG=y 298CONFIG_CHR_DEV_SG=y
299# CONFIG_CHR_DEV_SCH is not set
278 300
279# 301#
280# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 302# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -288,6 +310,7 @@ CONFIG_SCSI_LOGGING=y
288# 310#
289CONFIG_SCSI_SPI_ATTRS=y 311CONFIG_SCSI_SPI_ATTRS=y
290# CONFIG_SCSI_FC_ATTRS is not set 312# CONFIG_SCSI_FC_ATTRS is not set
313# CONFIG_SCSI_ISCSI_ATTRS is not set
291 314
292# 315#
293# SCSI low-level drivers 316# SCSI low-level drivers
@@ -303,13 +326,10 @@ CONFIG_SCSI_SPI_ATTRS=y
303# CONFIG_MEGARAID_NEWGEN is not set 326# CONFIG_MEGARAID_NEWGEN is not set
304# CONFIG_MEGARAID_LEGACY is not set 327# CONFIG_MEGARAID_LEGACY is not set
305# CONFIG_SCSI_SATA is not set 328# CONFIG_SCSI_SATA is not set
306# CONFIG_SCSI_BUSLOGIC is not set
307# CONFIG_SCSI_CPQFCTS is not set 329# CONFIG_SCSI_CPQFCTS is not set
308# CONFIG_SCSI_DMX3191D is not set 330# CONFIG_SCSI_DMX3191D is not set
309# CONFIG_SCSI_EATA is not set
310# CONFIG_SCSI_EATA_PIO is not set 331# CONFIG_SCSI_EATA_PIO is not set
311# CONFIG_SCSI_FUTURE_DOMAIN is not set 332# CONFIG_SCSI_FUTURE_DOMAIN is not set
312# CONFIG_SCSI_GDTH is not set
313# CONFIG_SCSI_IPS is not set 333# CONFIG_SCSI_IPS is not set
314# CONFIG_SCSI_INITIO is not set 334# CONFIG_SCSI_INITIO is not set
315# CONFIG_SCSI_INIA100 is not set 335# CONFIG_SCSI_INIA100 is not set
@@ -319,8 +339,6 @@ CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
319CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 339CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
320# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 340# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
321# CONFIG_SCSI_IPR is not set 341# CONFIG_SCSI_IPR is not set
322# CONFIG_SCSI_PCI2000 is not set
323# CONFIG_SCSI_PCI2220I is not set
324# CONFIG_SCSI_QLOGIC_ISP is not set 342# CONFIG_SCSI_QLOGIC_ISP is not set
325# CONFIG_SCSI_QLOGIC_FC is not set 343# CONFIG_SCSI_QLOGIC_FC is not set
326CONFIG_SCSI_QLOGIC_1280=y 344CONFIG_SCSI_QLOGIC_1280=y
@@ -331,7 +349,7 @@ CONFIG_SCSI_QLA2XXX=y
331# CONFIG_SCSI_QLA2300 is not set 349# CONFIG_SCSI_QLA2300 is not set
332# CONFIG_SCSI_QLA2322 is not set 350# CONFIG_SCSI_QLA2322 is not set
333# CONFIG_SCSI_QLA6312 is not set 351# CONFIG_SCSI_QLA6312 is not set
334# CONFIG_SCSI_QLA6322 is not set 352# CONFIG_SCSI_LPFC is not set
335# CONFIG_SCSI_DC395x is not set 353# CONFIG_SCSI_DC395x is not set
336# CONFIG_SCSI_DC390T is not set 354# CONFIG_SCSI_DC390T is not set
337# CONFIG_SCSI_DEBUG is not set 355# CONFIG_SCSI_DEBUG is not set
@@ -344,9 +362,9 @@ CONFIG_SCSI_QLA2XXX=y
344# 362#
345# Fusion MPT device support 363# Fusion MPT device support
346# 364#
347CONFIG_FUSION=y 365# CONFIG_FUSION is not set
348CONFIG_FUSION_MAX_SGE=40 366# CONFIG_FUSION_SPI is not set
349# CONFIG_FUSION_CTL is not set 367# CONFIG_FUSION_FC is not set
350 368
351# 369#
352# IEEE 1394 (FireWire) support 370# IEEE 1394 (FireWire) support
@@ -368,12 +386,12 @@ CONFIG_NET=y
368# 386#
369CONFIG_PACKET=y 387CONFIG_PACKET=y
370# CONFIG_PACKET_MMAP is not set 388# CONFIG_PACKET_MMAP is not set
371# CONFIG_NETLINK_DEV is not set
372CONFIG_UNIX=y 389CONFIG_UNIX=y
373# CONFIG_NET_KEY is not set 390# CONFIG_NET_KEY is not set
374CONFIG_INET=y 391CONFIG_INET=y
375CONFIG_IP_MULTICAST=y 392CONFIG_IP_MULTICAST=y
376# CONFIG_IP_ADVANCED_ROUTER is not set 393# CONFIG_IP_ADVANCED_ROUTER is not set
394CONFIG_IP_FIB_HASH=y
377# CONFIG_IP_PNP is not set 395# CONFIG_IP_PNP is not set
378# CONFIG_NET_IPIP is not set 396# CONFIG_NET_IPIP is not set
379# CONFIG_NET_IPGRE is not set 397# CONFIG_NET_IPGRE is not set
@@ -386,6 +404,8 @@ CONFIG_IP_MULTICAST=y
386# CONFIG_INET_TUNNEL is not set 404# CONFIG_INET_TUNNEL is not set
387# CONFIG_IP_TCPDIAG is not set 405# CONFIG_IP_TCPDIAG is not set
388# CONFIG_IP_TCPDIAG_IPV6 is not set 406# CONFIG_IP_TCPDIAG_IPV6 is not set
407# CONFIG_TCP_CONG_ADVANCED is not set
408CONFIG_TCP_CONG_BIC=y
389 409
390# 410#
391# IP: Virtual Server Configuration 411# IP: Virtual Server Configuration
@@ -405,8 +425,6 @@ CONFIG_NETFILTER=y
405CONFIG_IP_NF_ARPTABLES=y 425CONFIG_IP_NF_ARPTABLES=y
406# CONFIG_IP_NF_ARPFILTER is not set 426# CONFIG_IP_NF_ARPFILTER is not set
407# CONFIG_IP_NF_ARP_MANGLE is not set 427# CONFIG_IP_NF_ARP_MANGLE is not set
408# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
409# CONFIG_IP_NF_COMPAT_IPFWADM is not set
410 428
411# 429#
412# SCTP Configuration (EXPERIMENTAL) 430# SCTP Configuration (EXPERIMENTAL)
@@ -483,7 +501,6 @@ CONFIG_NET_PCI=y
483# CONFIG_DGRS is not set 501# CONFIG_DGRS is not set
484# CONFIG_EEPRO100 is not set 502# CONFIG_EEPRO100 is not set
485CONFIG_E100=y 503CONFIG_E100=y
486# CONFIG_E100_NAPI is not set
487# CONFIG_FEALNX is not set 504# CONFIG_FEALNX is not set
488# CONFIG_NATSEMI is not set 505# CONFIG_NATSEMI is not set
489# CONFIG_NE2K_PCI is not set 506# CONFIG_NE2K_PCI is not set
@@ -505,9 +522,11 @@ CONFIG_E1000=y
505# CONFIG_HAMACHI is not set 522# CONFIG_HAMACHI is not set
506# CONFIG_YELLOWFIN is not set 523# CONFIG_YELLOWFIN is not set
507# CONFIG_R8169 is not set 524# CONFIG_R8169 is not set
525# CONFIG_SKGE is not set
508# CONFIG_SK98LIN is not set 526# CONFIG_SK98LIN is not set
509# CONFIG_VIA_VELOCITY is not set 527# CONFIG_VIA_VELOCITY is not set
510CONFIG_TIGON3=y 528CONFIG_TIGON3=y
529# CONFIG_BNX2 is not set
511 530
512# 531#
513# Ethernet (10000 Mbit) 532# Ethernet (10000 Mbit)
@@ -565,18 +584,6 @@ CONFIG_INPUT_EVDEV=y
565# CONFIG_INPUT_EVBUG is not set 584# CONFIG_INPUT_EVBUG is not set
566 585
567# 586#
568# Input I/O drivers
569#
570# CONFIG_GAMEPORT is not set
571CONFIG_SOUND_GAMEPORT=y
572CONFIG_SERIO=y
573# CONFIG_SERIO_I8042 is not set
574# CONFIG_SERIO_SERPORT is not set
575# CONFIG_SERIO_CT82C710 is not set
576# CONFIG_SERIO_PCIPS2 is not set
577# CONFIG_SERIO_RAW is not set
578
579#
580# Input Device Drivers 587# Input Device Drivers
581# 588#
582# CONFIG_INPUT_KEYBOARD is not set 589# CONFIG_INPUT_KEYBOARD is not set
@@ -586,6 +593,16 @@ CONFIG_SERIO=y
586# CONFIG_INPUT_MISC is not set 593# CONFIG_INPUT_MISC is not set
587 594
588# 595#
596# Hardware I/O ports
597#
598CONFIG_SERIO=y
599# CONFIG_SERIO_I8042 is not set
600# CONFIG_SERIO_SERPORT is not set
601# CONFIG_SERIO_PCIPS2 is not set
602# CONFIG_SERIO_RAW is not set
603# CONFIG_GAMEPORT is not set
604
605#
589# Character devices 606# Character devices
590# 607#
591CONFIG_VT=y 608CONFIG_VT=y
@@ -603,7 +620,6 @@ CONFIG_SERIAL_8250_NR_UARTS=8
603CONFIG_SERIAL_8250_EXTENDED=y 620CONFIG_SERIAL_8250_EXTENDED=y
604CONFIG_SERIAL_8250_SHARE_IRQ=y 621CONFIG_SERIAL_8250_SHARE_IRQ=y
605# CONFIG_SERIAL_8250_DETECT_IRQ is not set 622# CONFIG_SERIAL_8250_DETECT_IRQ is not set
606# CONFIG_SERIAL_8250_MULTIPORT is not set
607# CONFIG_SERIAL_8250_RSA is not set 623# CONFIG_SERIAL_8250_RSA is not set
608 624
609# 625#
@@ -611,6 +627,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
611# 627#
612CONFIG_SERIAL_CORE=y 628CONFIG_SERIAL_CORE=y
613CONFIG_SERIAL_CORE_CONSOLE=y 629CONFIG_SERIAL_CORE_CONSOLE=y
630# CONFIG_SERIAL_JSM is not set
614CONFIG_UNIX98_PTYS=y 631CONFIG_UNIX98_PTYS=y
615CONFIG_LEGACY_PTYS=y 632CONFIG_LEGACY_PTYS=y
616CONFIG_LEGACY_PTY_COUNT=256 633CONFIG_LEGACY_PTY_COUNT=256
@@ -644,6 +661,12 @@ CONFIG_DRM_RADEON=y
644# CONFIG_DRM_SIS is not set 661# CONFIG_DRM_SIS is not set
645# CONFIG_RAW_DRIVER is not set 662# CONFIG_RAW_DRIVER is not set
646# CONFIG_HPET is not set 663# CONFIG_HPET is not set
664# CONFIG_HANGCHECK_TIMER is not set
665
666#
667# TPM devices
668#
669# CONFIG_TCG_TPM is not set
647 670
648# 671#
649# I2C support 672# I2C support
@@ -668,6 +691,7 @@ CONFIG_I2C_ALGOPCF=y
668# CONFIG_I2C_AMD8111 is not set 691# CONFIG_I2C_AMD8111 is not set
669# CONFIG_I2C_I801 is not set 692# CONFIG_I2C_I801 is not set
670# CONFIG_I2C_I810 is not set 693# CONFIG_I2C_I810 is not set
694# CONFIG_I2C_PIIX4 is not set
671# CONFIG_I2C_ISA is not set 695# CONFIG_I2C_ISA is not set
672# CONFIG_I2C_NFORCE2 is not set 696# CONFIG_I2C_NFORCE2 is not set
673# CONFIG_I2C_PARPORT_LIGHT is not set 697# CONFIG_I2C_PARPORT_LIGHT is not set
@@ -691,10 +715,14 @@ CONFIG_I2C_ALGOPCF=y
691# CONFIG_SENSORS_ADM1025 is not set 715# CONFIG_SENSORS_ADM1025 is not set
692# CONFIG_SENSORS_ADM1026 is not set 716# CONFIG_SENSORS_ADM1026 is not set
693# CONFIG_SENSORS_ADM1031 is not set 717# CONFIG_SENSORS_ADM1031 is not set
718# CONFIG_SENSORS_ADM9240 is not set
694# CONFIG_SENSORS_ASB100 is not set 719# CONFIG_SENSORS_ASB100 is not set
720# CONFIG_SENSORS_ATXP1 is not set
695# CONFIG_SENSORS_DS1621 is not set 721# CONFIG_SENSORS_DS1621 is not set
696# CONFIG_SENSORS_FSCHER is not set 722# CONFIG_SENSORS_FSCHER is not set
723# CONFIG_SENSORS_FSCPOS is not set
697# CONFIG_SENSORS_GL518SM is not set 724# CONFIG_SENSORS_GL518SM is not set
725# CONFIG_SENSORS_GL520SM is not set
698# CONFIG_SENSORS_IT87 is not set 726# CONFIG_SENSORS_IT87 is not set
699# CONFIG_SENSORS_LM63 is not set 727# CONFIG_SENSORS_LM63 is not set
700# CONFIG_SENSORS_LM75 is not set 728# CONFIG_SENSORS_LM75 is not set
@@ -705,21 +733,29 @@ CONFIG_I2C_ALGOPCF=y
705# CONFIG_SENSORS_LM85 is not set 733# CONFIG_SENSORS_LM85 is not set
706# CONFIG_SENSORS_LM87 is not set 734# CONFIG_SENSORS_LM87 is not set
707# CONFIG_SENSORS_LM90 is not set 735# CONFIG_SENSORS_LM90 is not set
736# CONFIG_SENSORS_LM92 is not set
708# CONFIG_SENSORS_MAX1619 is not set 737# CONFIG_SENSORS_MAX1619 is not set
709# CONFIG_SENSORS_PC87360 is not set 738# CONFIG_SENSORS_PC87360 is not set
739# CONFIG_SENSORS_SMSC47B397 is not set
740# CONFIG_SENSORS_SIS5595 is not set
710# CONFIG_SENSORS_SMSC47M1 is not set 741# CONFIG_SENSORS_SMSC47M1 is not set
711# CONFIG_SENSORS_VIA686A is not set 742# CONFIG_SENSORS_VIA686A is not set
712# CONFIG_SENSORS_W83781D is not set 743# CONFIG_SENSORS_W83781D is not set
713# CONFIG_SENSORS_W83L785TS is not set 744# CONFIG_SENSORS_W83L785TS is not set
714# CONFIG_SENSORS_W83627HF is not set 745# CONFIG_SENSORS_W83627HF is not set
746# CONFIG_SENSORS_W83627EHF is not set
715 747
716# 748#
717# Other I2C Chip support 749# Other I2C Chip support
718# 750#
751# CONFIG_SENSORS_DS1337 is not set
752# CONFIG_SENSORS_DS1374 is not set
719# CONFIG_SENSORS_EEPROM is not set 753# CONFIG_SENSORS_EEPROM is not set
720# CONFIG_SENSORS_PCF8574 is not set 754# CONFIG_SENSORS_PCF8574 is not set
755# CONFIG_SENSORS_PCA9539 is not set
721# CONFIG_SENSORS_PCF8591 is not set 756# CONFIG_SENSORS_PCF8591 is not set
722# CONFIG_SENSORS_RTC8564 is not set 757# CONFIG_SENSORS_RTC8564 is not set
758# CONFIG_SENSORS_MAX6875 is not set
723# CONFIG_I2C_DEBUG_CORE is not set 759# CONFIG_I2C_DEBUG_CORE is not set
724# CONFIG_I2C_DEBUG_ALGO is not set 760# CONFIG_I2C_DEBUG_ALGO is not set
725# CONFIG_I2C_DEBUG_BUS is not set 761# CONFIG_I2C_DEBUG_BUS is not set
@@ -746,6 +782,7 @@ CONFIG_VIDEO_DEV=y
746# 782#
747# Video Adapters 783# Video Adapters
748# 784#
785# CONFIG_TUNER_MULTI_I2C is not set
749# CONFIG_VIDEO_BT848 is not set 786# CONFIG_VIDEO_BT848 is not set
750# CONFIG_VIDEO_CPIA is not set 787# CONFIG_VIDEO_CPIA is not set
751# CONFIG_VIDEO_SAA5246A is not set 788# CONFIG_VIDEO_SAA5246A is not set
@@ -778,6 +815,11 @@ CONFIG_VIDEO_DEV=y
778# Graphics support 815# Graphics support
779# 816#
780CONFIG_FB=y 817CONFIG_FB=y
818CONFIG_FB_CFB_FILLRECT=y
819CONFIG_FB_CFB_COPYAREA=y
820CONFIG_FB_CFB_IMAGEBLIT=y
821CONFIG_FB_SOFT_CURSOR=y
822# CONFIG_FB_MACMODES is not set
781CONFIG_FB_MODE_HELPERS=y 823CONFIG_FB_MODE_HELPERS=y
782# CONFIG_FB_TILEBLITTING is not set 824# CONFIG_FB_TILEBLITTING is not set
783# CONFIG_FB_CIRRUS is not set 825# CONFIG_FB_CIRRUS is not set
@@ -785,6 +827,7 @@ CONFIG_FB_MODE_HELPERS=y
785# CONFIG_FB_CYBER2000 is not set 827# CONFIG_FB_CYBER2000 is not set
786# CONFIG_FB_ASILIANT is not set 828# CONFIG_FB_ASILIANT is not set
787# CONFIG_FB_IMSTT is not set 829# CONFIG_FB_IMSTT is not set
830# CONFIG_FB_NVIDIA is not set
788# CONFIG_FB_RIVA is not set 831# CONFIG_FB_RIVA is not set
789# CONFIG_FB_MATROX is not set 832# CONFIG_FB_MATROX is not set
790# CONFIG_FB_RADEON_OLD is not set 833# CONFIG_FB_RADEON_OLD is not set
@@ -801,6 +844,7 @@ CONFIG_FB_RADEON_DEBUG=y
801# CONFIG_FB_VOODOO1 is not set 844# CONFIG_FB_VOODOO1 is not set
802# CONFIG_FB_TRIDENT is not set 845# CONFIG_FB_TRIDENT is not set
803# CONFIG_FB_PM3 is not set 846# CONFIG_FB_PM3 is not set
847# CONFIG_FB_S1D13XXX is not set
804# CONFIG_FB_VIRTUAL is not set 848# CONFIG_FB_VIRTUAL is not set
805 849
806# 850#
@@ -820,6 +864,7 @@ CONFIG_LOGO=y
820# CONFIG_LOGO_LINUX_MONO is not set 864# CONFIG_LOGO_LINUX_MONO is not set
821# CONFIG_LOGO_LINUX_VGA16 is not set 865# CONFIG_LOGO_LINUX_VGA16 is not set
822CONFIG_LOGO_LINUX_CLUT224=y 866CONFIG_LOGO_LINUX_CLUT224=y
867# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
823 868
824# 869#
825# Sound 870# Sound
@@ -869,6 +914,8 @@ CONFIG_SND_AC97_CODEC=y
869# CONFIG_SND_CS46XX is not set 914# CONFIG_SND_CS46XX is not set
870# CONFIG_SND_CS4281 is not set 915# CONFIG_SND_CS4281 is not set
871# CONFIG_SND_EMU10K1 is not set 916# CONFIG_SND_EMU10K1 is not set
917# CONFIG_SND_EMU10K1X is not set
918# CONFIG_SND_CA0106 is not set
872# CONFIG_SND_KORG1212 is not set 919# CONFIG_SND_KORG1212 is not set
873# CONFIG_SND_MIXART is not set 920# CONFIG_SND_MIXART is not set
874# CONFIG_SND_NM256 is not set 921# CONFIG_SND_NM256 is not set
@@ -876,6 +923,7 @@ CONFIG_SND_AC97_CODEC=y
876# CONFIG_SND_RME96 is not set 923# CONFIG_SND_RME96 is not set
877# CONFIG_SND_RME9652 is not set 924# CONFIG_SND_RME9652 is not set
878# CONFIG_SND_HDSP is not set 925# CONFIG_SND_HDSP is not set
926# CONFIG_SND_HDSPM is not set
879# CONFIG_SND_TRIDENT is not set 927# CONFIG_SND_TRIDENT is not set
880# CONFIG_SND_YMFPCI is not set 928# CONFIG_SND_YMFPCI is not set
881# CONFIG_SND_ALS4000 is not set 929# CONFIG_SND_ALS4000 is not set
@@ -893,13 +941,14 @@ CONFIG_SND_FM801_TEA575X=y
893# CONFIG_SND_INTEL8X0M is not set 941# CONFIG_SND_INTEL8X0M is not set
894# CONFIG_SND_SONICVIBES is not set 942# CONFIG_SND_SONICVIBES is not set
895# CONFIG_SND_VIA82XX is not set 943# CONFIG_SND_VIA82XX is not set
944# CONFIG_SND_VIA82XX_MODEM is not set
896# CONFIG_SND_VX222 is not set 945# CONFIG_SND_VX222 is not set
946# CONFIG_SND_HDA_INTEL is not set
897 947
898# 948#
899# USB devices 949# USB devices
900# 950#
901# CONFIG_SND_USB_AUDIO is not set 951# CONFIG_SND_USB_AUDIO is not set
902# CONFIG_SND_USB_USX2Y is not set
903 952
904# 953#
905# Open Sound System 954# Open Sound System
@@ -909,6 +958,8 @@ CONFIG_SND_FM801_TEA575X=y
909# 958#
910# USB support 959# USB support
911# 960#
961CONFIG_USB_ARCH_HAS_HCD=y
962CONFIG_USB_ARCH_HAS_OHCI=y
912CONFIG_USB=y 963CONFIG_USB=y
913# CONFIG_USB_DEBUG is not set 964# CONFIG_USB_DEBUG is not set
914 965
@@ -920,8 +971,6 @@ CONFIG_USB_BANDWIDTH=y
920# CONFIG_USB_DYNAMIC_MINORS is not set 971# CONFIG_USB_DYNAMIC_MINORS is not set
921# CONFIG_USB_SUSPEND is not set 972# CONFIG_USB_SUSPEND is not set
922# CONFIG_USB_OTG is not set 973# CONFIG_USB_OTG is not set
923CONFIG_USB_ARCH_HAS_HCD=y
924CONFIG_USB_ARCH_HAS_OHCI=y
925 974
926# 975#
927# USB Host Controller Drivers 976# USB Host Controller Drivers
@@ -929,7 +978,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y
929CONFIG_USB_EHCI_HCD=y 978CONFIG_USB_EHCI_HCD=y
930# CONFIG_USB_EHCI_SPLIT_ISO is not set 979# CONFIG_USB_EHCI_SPLIT_ISO is not set
931# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 980# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
981# CONFIG_USB_ISP116X_HCD is not set
932CONFIG_USB_OHCI_HCD=y 982CONFIG_USB_OHCI_HCD=y
983# CONFIG_USB_OHCI_BIG_ENDIAN is not set
984CONFIG_USB_OHCI_LITTLE_ENDIAN=y
933CONFIG_USB_UHCI_HCD=y 985CONFIG_USB_UHCI_HCD=y
934# CONFIG_USB_SL811_HCD is not set 986# CONFIG_USB_SL811_HCD is not set
935 987
@@ -947,12 +999,11 @@ CONFIG_USB_UHCI_HCD=y
947# 999#
948CONFIG_USB_STORAGE=y 1000CONFIG_USB_STORAGE=y
949# CONFIG_USB_STORAGE_DEBUG is not set 1001# CONFIG_USB_STORAGE_DEBUG is not set
950# CONFIG_USB_STORAGE_RW_DETECT is not set
951# CONFIG_USB_STORAGE_DATAFAB is not set 1002# CONFIG_USB_STORAGE_DATAFAB is not set
952# CONFIG_USB_STORAGE_FREECOM is not set 1003# CONFIG_USB_STORAGE_FREECOM is not set
953# CONFIG_USB_STORAGE_ISD200 is not set 1004# CONFIG_USB_STORAGE_ISD200 is not set
954# CONFIG_USB_STORAGE_DPCM is not set 1005# CONFIG_USB_STORAGE_DPCM is not set
955# CONFIG_USB_STORAGE_HP8200e is not set 1006# CONFIG_USB_STORAGE_USBAT is not set
956# CONFIG_USB_STORAGE_SDDR09 is not set 1007# CONFIG_USB_STORAGE_SDDR09 is not set
957# CONFIG_USB_STORAGE_SDDR55 is not set 1008# CONFIG_USB_STORAGE_SDDR55 is not set
958# CONFIG_USB_STORAGE_JUMPSHOT is not set 1009# CONFIG_USB_STORAGE_JUMPSHOT is not set
@@ -966,9 +1017,11 @@ CONFIG_USB_HIDINPUT=y
966CONFIG_USB_HIDDEV=y 1017CONFIG_USB_HIDDEV=y
967# CONFIG_USB_AIPTEK is not set 1018# CONFIG_USB_AIPTEK is not set
968# CONFIG_USB_WACOM is not set 1019# CONFIG_USB_WACOM is not set
1020# CONFIG_USB_ACECAD is not set
969# CONFIG_USB_KBTAB is not set 1021# CONFIG_USB_KBTAB is not set
970# CONFIG_USB_POWERMATE is not set 1022# CONFIG_USB_POWERMATE is not set
971# CONFIG_USB_MTOUCH is not set 1023# CONFIG_USB_MTOUCH is not set
1024# CONFIG_USB_ITMTOUCH is not set
972# CONFIG_USB_EGALAX is not set 1025# CONFIG_USB_EGALAX is not set
973# CONFIG_USB_XPAD is not set 1026# CONFIG_USB_XPAD is not set
974# CONFIG_USB_ATI_REMOTE is not set 1027# CONFIG_USB_ATI_REMOTE is not set
@@ -978,7 +1031,6 @@ CONFIG_USB_HIDDEV=y
978# 1031#
979# CONFIG_USB_MDC800 is not set 1032# CONFIG_USB_MDC800 is not set
980# CONFIG_USB_MICROTEK is not set 1033# CONFIG_USB_MICROTEK is not set
981# CONFIG_USB_HPUSBSCSI is not set
982 1034
983# 1035#
984# USB Multimedia devices 1036# USB Multimedia devices
@@ -992,6 +1044,7 @@ CONFIG_USB_HIDDEV=y
992# CONFIG_USB_SE401 is not set 1044# CONFIG_USB_SE401 is not set
993# CONFIG_USB_SN9C102 is not set 1045# CONFIG_USB_SN9C102 is not set
994# CONFIG_USB_STV680 is not set 1046# CONFIG_USB_STV680 is not set
1047# CONFIG_USB_PWC is not set
995 1048
996# 1049#
997# USB Network Adapters 1050# USB Network Adapters
@@ -1001,6 +1054,7 @@ CONFIG_USB_HIDDEV=y
1001# CONFIG_USB_PEGASUS is not set 1054# CONFIG_USB_PEGASUS is not set
1002# CONFIG_USB_RTL8150 is not set 1055# CONFIG_USB_RTL8150 is not set
1003# CONFIG_USB_USBNET is not set 1056# CONFIG_USB_USBNET is not set
1057CONFIG_USB_MON=y
1004 1058
1005# 1059#
1006# USB port drivers 1060# USB port drivers
@@ -1016,7 +1070,6 @@ CONFIG_USB_HIDDEV=y
1016# 1070#
1017# CONFIG_USB_EMI62 is not set 1071# CONFIG_USB_EMI62 is not set
1018# CONFIG_USB_EMI26 is not set 1072# CONFIG_USB_EMI26 is not set
1019# CONFIG_USB_TIGL is not set
1020# CONFIG_USB_AUERSWALD is not set 1073# CONFIG_USB_AUERSWALD is not set
1021# CONFIG_USB_RIO500 is not set 1074# CONFIG_USB_RIO500 is not set
1022# CONFIG_USB_LEGOTOWER is not set 1075# CONFIG_USB_LEGOTOWER is not set
@@ -1025,9 +1078,11 @@ CONFIG_USB_HIDDEV=y
1025# CONFIG_USB_CYTHERM is not set 1078# CONFIG_USB_CYTHERM is not set
1026# CONFIG_USB_PHIDGETKIT is not set 1079# CONFIG_USB_PHIDGETKIT is not set
1027# CONFIG_USB_PHIDGETSERVO is not set 1080# CONFIG_USB_PHIDGETSERVO is not set
1081# CONFIG_USB_IDMOUSE is not set
1082# CONFIG_USB_SISUSBVGA is not set
1028 1083
1029# 1084#
1030# USB ATM/DSL drivers 1085# USB DSL modem support
1031# 1086#
1032 1087
1033# 1088#
@@ -1041,12 +1096,22 @@ CONFIG_USB_HIDDEV=y
1041# CONFIG_MMC is not set 1096# CONFIG_MMC is not set
1042 1097
1043# 1098#
1099# InfiniBand support
1100#
1101# CONFIG_INFINIBAND is not set
1102
1103#
1104# SN Devices
1105#
1106
1107#
1044# File systems 1108# File systems
1045# 1109#
1046CONFIG_EXT2_FS=y 1110CONFIG_EXT2_FS=y
1047CONFIG_EXT2_FS_XATTR=y 1111CONFIG_EXT2_FS_XATTR=y
1048# CONFIG_EXT2_FS_POSIX_ACL is not set 1112# CONFIG_EXT2_FS_POSIX_ACL is not set
1049# CONFIG_EXT2_FS_SECURITY is not set 1113# CONFIG_EXT2_FS_SECURITY is not set
1114# CONFIG_EXT2_FS_XIP is not set
1050CONFIG_EXT3_FS=y 1115CONFIG_EXT3_FS=y
1051CONFIG_EXT3_FS_XATTR=y 1116CONFIG_EXT3_FS_XATTR=y
1052# CONFIG_EXT3_FS_POSIX_ACL is not set 1117# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -1056,6 +1121,10 @@ CONFIG_JBD=y
1056CONFIG_FS_MBCACHE=y 1121CONFIG_FS_MBCACHE=y
1057# CONFIG_REISERFS_FS is not set 1122# CONFIG_REISERFS_FS is not set
1058# CONFIG_JFS_FS is not set 1123# CONFIG_JFS_FS is not set
1124
1125#
1126# XFS support
1127#
1059# CONFIG_XFS_FS is not set 1128# CONFIG_XFS_FS is not set
1060# CONFIG_MINIX_FS is not set 1129# CONFIG_MINIX_FS is not set
1061# CONFIG_ROMFS_FS is not set 1130# CONFIG_ROMFS_FS is not set
@@ -1089,7 +1158,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1089CONFIG_PROC_FS=y 1158CONFIG_PROC_FS=y
1090CONFIG_PROC_KCORE=y 1159CONFIG_PROC_KCORE=y
1091CONFIG_SYSFS=y 1160CONFIG_SYSFS=y
1092# CONFIG_DEVFS_FS is not set
1093# CONFIG_DEVPTS_FS_XATTR is not set 1161# CONFIG_DEVPTS_FS_XATTR is not set
1094CONFIG_TMPFS=y 1162CONFIG_TMPFS=y
1095CONFIG_TMPFS_XATTR=y 1163CONFIG_TMPFS_XATTR=y
@@ -1120,15 +1188,18 @@ CONFIG_RAMFS=y
1120# 1188#
1121CONFIG_NFS_FS=y 1189CONFIG_NFS_FS=y
1122CONFIG_NFS_V3=y 1190CONFIG_NFS_V3=y
1191# CONFIG_NFS_V3_ACL is not set
1123CONFIG_NFS_V4=y 1192CONFIG_NFS_V4=y
1124# CONFIG_NFS_DIRECTIO is not set 1193# CONFIG_NFS_DIRECTIO is not set
1125CONFIG_NFSD=y 1194CONFIG_NFSD=y
1126CONFIG_NFSD_V3=y 1195CONFIG_NFSD_V3=y
1196# CONFIG_NFSD_V3_ACL is not set
1127# CONFIG_NFSD_V4 is not set 1197# CONFIG_NFSD_V4 is not set
1128# CONFIG_NFSD_TCP is not set 1198# CONFIG_NFSD_TCP is not set
1129CONFIG_LOCKD=y 1199CONFIG_LOCKD=y
1130CONFIG_LOCKD_V4=y 1200CONFIG_LOCKD_V4=y
1131CONFIG_EXPORTFS=y 1201CONFIG_EXPORTFS=y
1202CONFIG_NFS_COMMON=y
1132CONFIG_SUNRPC=y 1203CONFIG_SUNRPC=y
1133CONFIG_SUNRPC_GSS=y 1204CONFIG_SUNRPC_GSS=y
1134CONFIG_RPCSEC_GSS_KRB5=y 1205CONFIG_RPCSEC_GSS_KRB5=y
@@ -1209,6 +1280,8 @@ CONFIG_NLS_UTF8=y
1209# CONFIG_CRC_CCITT is not set 1280# CONFIG_CRC_CCITT is not set
1210CONFIG_CRC32=y 1281CONFIG_CRC32=y
1211# CONFIG_LIBCRC32C is not set 1282# CONFIG_LIBCRC32C is not set
1283CONFIG_GENERIC_HARDIRQS=y
1284CONFIG_GENERIC_IRQ_PROBE=y
1212 1285
1213# 1286#
1214# Profiling support 1287# Profiling support
@@ -1218,14 +1291,18 @@ CONFIG_CRC32=y
1218# 1291#
1219# Kernel hacking 1292# Kernel hacking
1220# 1293#
1294# CONFIG_PRINTK_TIME is not set
1221CONFIG_DEBUG_KERNEL=y 1295CONFIG_DEBUG_KERNEL=y
1222CONFIG_MAGIC_SYSRQ=y 1296CONFIG_MAGIC_SYSRQ=y
1297CONFIG_LOG_BUF_SHIFT=17
1223# CONFIG_SCHEDSTATS is not set 1298# CONFIG_SCHEDSTATS is not set
1224# CONFIG_DEBUG_SLAB is not set 1299# CONFIG_DEBUG_SLAB is not set
1225# CONFIG_DEBUG_SPINLOCK is not set 1300# CONFIG_DEBUG_SPINLOCK is not set
1226# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1301# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1227# CONFIG_DEBUG_KOBJECT is not set 1302# CONFIG_DEBUG_KOBJECT is not set
1228# CONFIG_DEBUG_INFO is not set 1303# CONFIG_DEBUG_INFO is not set
1304# CONFIG_DEBUG_FS is not set
1305CONFIG_KPROBES=y
1229CONFIG_IA64_GRANULE_16MB=y 1306CONFIG_IA64_GRANULE_16MB=y
1230# CONFIG_IA64_GRANULE_64MB is not set 1307# CONFIG_IA64_GRANULE_64MB is not set
1231CONFIG_IA64_PRINT_HAZARDS=y 1308CONFIG_IA64_PRINT_HAZARDS=y
@@ -1252,6 +1329,7 @@ CONFIG_CRYPTO_MD5=y
1252# CONFIG_CRYPTO_SHA256 is not set 1329# CONFIG_CRYPTO_SHA256 is not set
1253# CONFIG_CRYPTO_SHA512 is not set 1330# CONFIG_CRYPTO_SHA512 is not set
1254# CONFIG_CRYPTO_WP512 is not set 1331# CONFIG_CRYPTO_WP512 is not set
1332# CONFIG_CRYPTO_TGR192 is not set
1255CONFIG_CRYPTO_DES=y 1333CONFIG_CRYPTO_DES=y
1256# CONFIG_CRYPTO_BLOWFISH is not set 1334# CONFIG_CRYPTO_BLOWFISH is not set
1257# CONFIG_CRYPTO_TWOFISH is not set 1335# CONFIG_CRYPTO_TWOFISH is not set
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index b8db6e3e5e81..11957598a8b9 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -156,10 +156,13 @@
156*/ 156*/
157#define DELAYED_RESOURCE_CNT 64 157#define DELAYED_RESOURCE_CNT 64
158 158
159#define PCI_DEVICE_ID_HP_SX2000_IOC 0x12ec
160
159#define ZX1_IOC_ID ((PCI_DEVICE_ID_HP_ZX1_IOC << 16) | PCI_VENDOR_ID_HP) 161#define ZX1_IOC_ID ((PCI_DEVICE_ID_HP_ZX1_IOC << 16) | PCI_VENDOR_ID_HP)
160#define ZX2_IOC_ID ((PCI_DEVICE_ID_HP_ZX2_IOC << 16) | PCI_VENDOR_ID_HP) 162#define ZX2_IOC_ID ((PCI_DEVICE_ID_HP_ZX2_IOC << 16) | PCI_VENDOR_ID_HP)
161#define REO_IOC_ID ((PCI_DEVICE_ID_HP_REO_IOC << 16) | PCI_VENDOR_ID_HP) 163#define REO_IOC_ID ((PCI_DEVICE_ID_HP_REO_IOC << 16) | PCI_VENDOR_ID_HP)
162#define SX1000_IOC_ID ((PCI_DEVICE_ID_HP_SX1000_IOC << 16) | PCI_VENDOR_ID_HP) 164#define SX1000_IOC_ID ((PCI_DEVICE_ID_HP_SX1000_IOC << 16) | PCI_VENDOR_ID_HP)
165#define SX2000_IOC_ID ((PCI_DEVICE_ID_HP_SX2000_IOC << 16) | PCI_VENDOR_ID_HP)
163 166
164#define ZX1_IOC_OFFSET 0x1000 /* ACPI reports SBA, we want IOC */ 167#define ZX1_IOC_OFFSET 0x1000 /* ACPI reports SBA, we want IOC */
165 168
@@ -1726,6 +1729,7 @@ static struct ioc_iommu ioc_iommu_info[] __initdata = {
1726 { ZX1_IOC_ID, "zx1", ioc_zx1_init }, 1729 { ZX1_IOC_ID, "zx1", ioc_zx1_init },
1727 { ZX2_IOC_ID, "zx2", NULL }, 1730 { ZX2_IOC_ID, "zx2", NULL },
1728 { SX1000_IOC_ID, "sx1000", NULL }, 1731 { SX1000_IOC_ID, "sx1000", NULL },
1732 { SX2000_IOC_ID, "sx2000", NULL },
1729}; 1733};
1730 1734
1731static struct ioc * __init 1735static struct ioc * __init
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index 786e70718ce4..7a8ae0f4b387 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -30,6 +30,7 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/serial.h> 31#include <linux/serial.h>
32#include <linux/serialP.h> 32#include <linux/serialP.h>
33#include <linux/sysrq.h>
33 34
34#include <asm/irq.h> 35#include <asm/irq.h>
35#include <asm/hw_irq.h> 36#include <asm/hw_irq.h>
@@ -149,12 +150,17 @@ static void receive_chars(struct tty_struct *tty, struct pt_regs *regs)
149 seen_esc = 2; 150 seen_esc = 2;
150 continue; 151 continue;
151 } else if ( seen_esc == 2 ) { 152 } else if ( seen_esc == 2 ) {
152 if ( ch == 'P' ) show_state(); /* F1 key */ 153 if ( ch == 'P' ) /* F1 */
153#ifdef CONFIG_KDB 154 show_state();
154 if ( ch == 'S' ) 155#ifdef CONFIG_MAGIC_SYSRQ
155 kdb(KDB_REASON_KEYBOARD, 0, (kdb_eframe_t) regs); 156 if ( ch == 'S' ) { /* F4 */
157 do
158 ch = ia64_ssc(0, 0, 0, 0,
159 SSC_GETCHAR);
160 while (!ch);
161 handle_sysrq(ch, regs, NULL);
162 }
156#endif 163#endif
157
158 seen_esc = 0; 164 seen_esc = 0;
159 continue; 165 continue;
160 } 166 }
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 72dfd9e7de0f..cda06f88c66e 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -236,9 +236,7 @@ acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end)
236 if (BAD_MADT_ENTRY(iosapic, end)) 236 if (BAD_MADT_ENTRY(iosapic, end))
237 return -EINVAL; 237 return -EINVAL;
238 238
239 iosapic_init(iosapic->address, iosapic->global_irq_base); 239 return iosapic_init(iosapic->address, iosapic->global_irq_base);
240
241 return 0;
242} 240}
243 241
244 242
@@ -772,7 +770,7 @@ EXPORT_SYMBOL(acpi_unmap_lsapic);
772 770
773 771
774#ifdef CONFIG_ACPI_NUMA 772#ifdef CONFIG_ACPI_NUMA
775acpi_status __init 773acpi_status __devinit
776acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret) 774acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
777{ 775{
778 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; 776 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
@@ -825,4 +823,28 @@ acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
825 return AE_OK; 823 return AE_OK;
826} 824}
827#endif /* CONFIG_NUMA */ 825#endif /* CONFIG_NUMA */
826
827int
828acpi_register_ioapic (acpi_handle handle, u64 phys_addr, u32 gsi_base)
829{
830 int err;
831
832 if ((err = iosapic_init(phys_addr, gsi_base)))
833 return err;
834
835#if CONFIG_ACPI_NUMA
836 acpi_map_iosapic(handle, 0, NULL, NULL);
837#endif /* CONFIG_ACPI_NUMA */
838
839 return 0;
840}
841EXPORT_SYMBOL(acpi_register_ioapic);
842
843int
844acpi_unregister_ioapic (acpi_handle handle, u32 gsi_base)
845{
846 return iosapic_remove(gsi_base);
847}
848EXPORT_SYMBOL(acpi_unregister_ioapic);
849
828#endif /* CONFIG_ACPI_BOOT */ 850#endif /* CONFIG_ACPI_BOOT */
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index b1d5d3d5276c..69f88d561d62 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -470,18 +470,6 @@ ENTRY(load_switch_stack)
470 br.cond.sptk.many b7 470 br.cond.sptk.many b7
471END(load_switch_stack) 471END(load_switch_stack)
472 472
473GLOBAL_ENTRY(__ia64_syscall)
474 .regstk 6,0,0,0
475 mov r15=in5 // put syscall number in place
476 break __BREAK_SYSCALL
477 movl r2=errno
478 cmp.eq p6,p7=-1,r10
479 ;;
480(p6) st4 [r2]=r8
481(p6) mov r8=-1
482 br.ret.sptk.many rp
483END(__ia64_syscall)
484
485GLOBAL_ENTRY(execve) 473GLOBAL_ENTRY(execve)
486 mov r15=__NR_execve // put syscall number in place 474 mov r15=__NR_execve // put syscall number in place
487 break __BREAK_SYSCALL 475 break __BREAK_SYSCALL
@@ -637,7 +625,7 @@ END(ia64_ret_from_syscall)
637 * r8-r11: restored (syscall return value(s)) 625 * r8-r11: restored (syscall return value(s))
638 * r12: restored (user-level stack pointer) 626 * r12: restored (user-level stack pointer)
639 * r13: restored (user-level thread pointer) 627 * r13: restored (user-level thread pointer)
640 * r14: cleared 628 * r14: set to __kernel_syscall_via_epc
641 * r15: restored (syscall #) 629 * r15: restored (syscall #)
642 * r16-r17: cleared 630 * r16-r17: cleared
643 * r18: user-level b6 631 * r18: user-level b6
@@ -658,7 +646,7 @@ END(ia64_ret_from_syscall)
658 * pr: restored (user-level pr) 646 * pr: restored (user-level pr)
659 * b0: restored (user-level rp) 647 * b0: restored (user-level rp)
660 * b6: restored 648 * b6: restored
661 * b7: cleared 649 * b7: set to __kernel_syscall_via_epc
662 * ar.unat: restored (user-level ar.unat) 650 * ar.unat: restored (user-level ar.unat)
663 * ar.pfs: restored (user-level ar.pfs) 651 * ar.pfs: restored (user-level ar.pfs)
664 * ar.rsc: restored (user-level ar.rsc) 652 * ar.rsc: restored (user-level ar.rsc)
@@ -704,72 +692,79 @@ ENTRY(ia64_leave_syscall)
704 ;; 692 ;;
705(p6) ld4 r31=[r18] // load current_thread_info()->flags 693(p6) ld4 r31=[r18] // load current_thread_info()->flags
706 ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs" 694 ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs"
707 mov b7=r0 // clear b7 695 nop.i 0
708 ;; 696 ;;
709 ld8 r23=[r3],PT(R11)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage) 697 mov r16=ar.bsp // M2 get existing backing store pointer
710 ld8 r18=[r2],PT(R9)-PT(B6) // load b6 698 ld8 r18=[r2],PT(R9)-PT(B6) // load b6
711(p6) and r15=TIF_WORK_MASK,r31 // any work other than TIF_SYSCALL_TRACE? 699(p6) and r15=TIF_WORK_MASK,r31 // any work other than TIF_SYSCALL_TRACE?
712 ;; 700 ;;
713 mov r16=ar.bsp // M2 get existing backing store pointer 701 ld8 r23=[r3],PT(R11)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage)
714(p6) cmp4.ne.unc p6,p0=r15, r0 // any special work pending? 702(p6) cmp4.ne.unc p6,p0=r15, r0 // any special work pending?
715(p6) br.cond.spnt .work_pending_syscall 703(p6) br.cond.spnt .work_pending_syscall
716 ;; 704 ;;
717 // start restoring the state saved on the kernel stack (struct pt_regs): 705 // start restoring the state saved on the kernel stack (struct pt_regs):
718 ld8 r9=[r2],PT(CR_IPSR)-PT(R9) 706 ld8 r9=[r2],PT(CR_IPSR)-PT(R9)
719 ld8 r11=[r3],PT(CR_IIP)-PT(R11) 707 ld8 r11=[r3],PT(CR_IIP)-PT(R11)
720 mov f6=f0 // clear f6 708(pNonSys) break 0 // bug check: we shouldn't be here if pNonSys is TRUE!
721 ;; 709 ;;
722 invala // M0|1 invalidate ALAT 710 invala // M0|1 invalidate ALAT
723 rsm psr.i | psr.ic // M2 initiate turning off of interrupt and interruption collection 711 rsm psr.i | psr.ic // M2 turn off interrupts and interruption collection
724 mov f9=f0 // clear f9 712 cmp.eq p9,p0=r0,r0 // A set p9 to indicate that we should restore cr.ifs
725 713
726 ld8 r29=[r2],16 // load cr.ipsr 714 ld8 r29=[r2],16 // M0|1 load cr.ipsr
727 ld8 r28=[r3],16 // load cr.iip 715 ld8 r28=[r3],16 // M0|1 load cr.iip
728 mov f8=f0 // clear f8 716 mov r22=r0 // A clear r22
729 ;; 717 ;;
730 ld8 r30=[r2],16 // M0|1 load cr.ifs 718 ld8 r30=[r2],16 // M0|1 load cr.ifs
731 ld8 r25=[r3],16 // M0|1 load ar.unat 719 ld8 r25=[r3],16 // M0|1 load ar.unat
732 cmp.eq p9,p0=r0,r0 // set p9 to indicate that we should restore cr.ifs 720(pUStk) add r14=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
733 ;; 721 ;;
734 ld8 r26=[r2],PT(B0)-PT(AR_PFS) // M0|1 load ar.pfs 722 ld8 r26=[r2],PT(B0)-PT(AR_PFS) // M0|1 load ar.pfs
735(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled 723(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled
736 mov f10=f0 // clear f10 724 nop 0
737 ;; 725 ;;
738 ld8 r21=[r2],PT(AR_RNAT)-PT(B0) // load b0 726 ld8 r21=[r2],PT(AR_RNAT)-PT(B0) // M0|1 load b0
739 ld8 r27=[r3],PT(PR)-PT(AR_RSC) // load ar.rsc 727 ld8 r27=[r3],PT(PR)-PT(AR_RSC) // M0|1 load ar.rsc
740 mov f11=f0 // clear f11 728 mov f6=f0 // F clear f6
741 ;; 729 ;;
742 ld8 r24=[r2],PT(AR_FPSR)-PT(AR_RNAT) // load ar.rnat (may be garbage) 730 ld8 r24=[r2],PT(AR_FPSR)-PT(AR_RNAT) // M0|1 load ar.rnat (may be garbage)
743 ld8 r31=[r3],PT(R1)-PT(PR) // load predicates 731 ld8 r31=[r3],PT(R1)-PT(PR) // M0|1 load predicates
744(pUStk) add r14=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13 732 mov f7=f0 // F clear f7
745 ;; 733 ;;
746 ld8 r20=[r2],PT(R12)-PT(AR_FPSR) // load ar.fpsr 734 ld8 r20=[r2],PT(R12)-PT(AR_FPSR) // M0|1 load ar.fpsr
747 ld8.fill r1=[r3],16 // load r1 735 ld8.fill r1=[r3],16 // M0|1 load r1
748(pUStk) mov r17=1 736(pUStk) mov r17=1 // A
749 ;; 737 ;;
750 srlz.d // M0 ensure interruption collection is off 738(pUStk) st1 [r14]=r17 // M2|3
751 ld8.fill r13=[r3],16 739 ld8.fill r13=[r3],16 // M0|1
752 mov f7=f0 // clear f7 740 mov f8=f0 // F clear f8
753 ;; 741 ;;
754 ld8.fill r12=[r2] // restore r12 (sp) 742 ld8.fill r12=[r2] // M0|1 restore r12 (sp)
755 mov.m ar.ssd=r0 // M2 clear ar.ssd 743 ld8.fill r15=[r3] // M0|1 restore r15
756 mov r22=r0 // clear r22 744 mov b6=r18 // I0 restore b6
757 745
758 ld8.fill r15=[r3] // restore r15 746 addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0 // A
759(pUStk) st1 [r14]=r17 747 mov f9=f0 // F clear f9
760 addl r3=THIS_CPU(ia64_phys_stacked_size_p8),r0 748(pKStk) br.cond.dpnt.many skip_rbs_switch // B
749
750 srlz.d // M0 ensure interruption collection is off (for cover)
751 shr.u r18=r19,16 // I0|1 get byte size of existing "dirty" partition
752 cover // B add current frame into dirty partition & set cr.ifs
761 ;; 753 ;;
762(pUStk) ld4 r17=[r3] // r17 = cpu_data->phys_stacked_size_p8 754(pUStk) ld4 r17=[r17] // M0|1 r17 = cpu_data->phys_stacked_size_p8
763 mov.m ar.csd=r0 // M2 clear ar.csd 755 mov r19=ar.bsp // M2 get new backing store pointer
764 mov b6=r18 // I0 restore b6 756 mov f10=f0 // F clear f10
757
758 nop.m 0
759 movl r14=__kernel_syscall_via_epc // X
765 ;; 760 ;;
766 mov r14=r0 // clear r14 761 mov.m ar.csd=r0 // M2 clear ar.csd
767 shr.u r18=r19,16 // I0|1 get byte size of existing "dirty" partition 762 mov.m ar.ccv=r0 // M2 clear ar.ccv
768(pKStk) br.cond.dpnt.many skip_rbs_switch 763 mov b7=r14 // I0 clear b7 (hint with __kernel_syscall_via_epc)
769 764
770 mov.m ar.ccv=r0 // clear ar.ccv 765 mov.m ar.ssd=r0 // M2 clear ar.ssd
771(pNonSys) br.cond.dpnt.many dont_preserve_current_frame 766 mov f11=f0 // F clear f11
772 br.cond.sptk.many rbs_switch 767 br.cond.sptk.many rbs_switch // B
773END(ia64_leave_syscall) 768END(ia64_leave_syscall)
774 769
775#ifdef CONFIG_IA32_SUPPORT 770#ifdef CONFIG_IA32_SUPPORT
@@ -885,7 +880,7 @@ GLOBAL_ENTRY(ia64_leave_kernel)
885 ldf.fill f7=[r2],PT(F11)-PT(F7) 880 ldf.fill f7=[r2],PT(F11)-PT(F7)
886 ldf.fill f8=[r3],32 881 ldf.fill f8=[r3],32
887 ;; 882 ;;
888 srlz.i // ensure interruption collection is off 883 srlz.d // ensure that inter. collection is off (VHPT is don't care, since text is pinned)
889 mov ar.ccv=r15 884 mov ar.ccv=r15
890 ;; 885 ;;
891 ldf.fill f11=[r2] 886 ldf.fill f11=[r2]
@@ -945,11 +940,10 @@ GLOBAL_ENTRY(ia64_leave_kernel)
945 * NOTE: alloc, loadrs, and cover can't be predicated. 940 * NOTE: alloc, loadrs, and cover can't be predicated.
946 */ 941 */
947(pNonSys) br.cond.dpnt dont_preserve_current_frame 942(pNonSys) br.cond.dpnt dont_preserve_current_frame
948
949rbs_switch:
950 cover // add current frame into dirty partition and set cr.ifs 943 cover // add current frame into dirty partition and set cr.ifs
951 ;; 944 ;;
952 mov r19=ar.bsp // get new backing store pointer 945 mov r19=ar.bsp // get new backing store pointer
946rbs_switch:
953 sub r16=r16,r18 // krbs = old bsp - size of dirty partition 947 sub r16=r16,r18 // krbs = old bsp - size of dirty partition
954 cmp.ne p9,p0=r0,r0 // clear p9 to skip restore of cr.ifs 948 cmp.ne p9,p0=r0,r0 // clear p9 to skip restore of cr.ifs
955 ;; 949 ;;
@@ -1024,14 +1018,14 @@ rse_clear_invalid:
1024 mov loc5=0 1018 mov loc5=0
1025 mov loc6=0 1019 mov loc6=0
1026 mov loc7=0 1020 mov loc7=0
1027(pRecurse) br.call.sptk.few b0=rse_clear_invalid 1021(pRecurse) br.call.dptk.few b0=rse_clear_invalid
1028 ;; 1022 ;;
1029 mov loc8=0 1023 mov loc8=0
1030 mov loc9=0 1024 mov loc9=0
1031 cmp.ne pReturn,p0=r0,in1 // if recursion count != 0, we need to do a br.ret 1025 cmp.ne pReturn,p0=r0,in1 // if recursion count != 0, we need to do a br.ret
1032 mov loc10=0 1026 mov loc10=0
1033 mov loc11=0 1027 mov loc11=0
1034(pReturn) br.ret.sptk.many b0 1028(pReturn) br.ret.dptk.many b0
1035#endif /* !CONFIG_ITANIUM */ 1029#endif /* !CONFIG_ITANIUM */
1036# undef pRecurse 1030# undef pRecurse
1037# undef pReturn 1031# undef pReturn
@@ -1577,8 +1571,8 @@ sys_call_table:
1577 data8 sys_add_key 1571 data8 sys_add_key
1578 data8 sys_request_key 1572 data8 sys_request_key
1579 data8 sys_keyctl 1573 data8 sys_keyctl
1580 data8 sys_ni_syscall 1574 data8 sys_ioprio_set
1581 data8 sys_ni_syscall // 1275 1575 data8 sys_ioprio_get // 1275
1582 data8 sys_set_zone_reclaim 1576 data8 sys_set_zone_reclaim
1583 data8 sys_ni_syscall 1577 data8 sys_ni_syscall
1584 data8 sys_ni_syscall 1578 data8 sys_ni_syscall
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
index 962b6c4e32b5..7d7684a369d3 100644
--- a/arch/ia64/kernel/fsys.S
+++ b/arch/ia64/kernel/fsys.S
@@ -531,93 +531,114 @@ GLOBAL_ENTRY(fsys_bubble_down)
531 .altrp b6 531 .altrp b6
532 .body 532 .body
533 /* 533 /*
534 * We get here for syscalls that don't have a lightweight handler. For those, we 534 * We get here for syscalls that don't have a lightweight
535 * need to bubble down into the kernel and that requires setting up a minimal 535 * handler. For those, we need to bubble down into the kernel
536 * pt_regs structure, and initializing the CPU state more or less as if an 536 * and that requires setting up a minimal pt_regs structure,
537 * interruption had occurred. To make syscall-restarts work, we setup pt_regs 537 * and initializing the CPU state more or less as if an
538 * such that cr_iip points to the second instruction in syscall_via_break. 538 * interruption had occurred. To make syscall-restarts work,
539 * Decrementing the IP hence will restart the syscall via break and not 539 * we setup pt_regs such that cr_iip points to the second
540 * decrementing IP will return us to the caller, as usual. Note that we preserve 540 * instruction in syscall_via_break. Decrementing the IP
541 * the value of psr.pp rather than initializing it from dcr.pp. This makes it 541 * hence will restart the syscall via break and not
542 * possible to distinguish fsyscall execution from other privileged execution. 542 * decrementing IP will return us to the caller, as usual.
543 * Note that we preserve the value of psr.pp rather than
544 * initializing it from dcr.pp. This makes it possible to
545 * distinguish fsyscall execution from other privileged
546 * execution.
543 * 547 *
544 * On entry: 548 * On entry:
545 * - normal fsyscall handler register usage, except that we also have: 549 * - normal fsyscall handler register usage, except
550 * that we also have:
546 * - r18: address of syscall entry point 551 * - r18: address of syscall entry point
547 * - r21: ar.fpsr 552 * - r21: ar.fpsr
548 * - r26: ar.pfs 553 * - r26: ar.pfs
549 * - r27: ar.rsc 554 * - r27: ar.rsc
550 * - r29: psr 555 * - r29: psr
556 *
557 * We used to clear some PSR bits here but that requires slow
558 * serialization. Fortuntely, that isn't really necessary.
559 * The rationale is as follows: we used to clear bits
560 * ~PSR_PRESERVED_BITS in PSR.L. Since
561 * PSR_PRESERVED_BITS==PSR.{UP,MFL,MFH,PK,DT,PP,SP,RT,IC}, we
562 * ended up clearing PSR.{BE,AC,I,DFL,DFH,DI,DB,SI,TB}.
563 * However,
564 *
565 * PSR.BE : already is turned off in __kernel_syscall_via_epc()
566 * PSR.AC : don't care (kernel normally turns PSR.AC on)
567 * PSR.I : already turned off by the time fsys_bubble_down gets
568 * invoked
569 * PSR.DFL: always 0 (kernel never turns it on)
570 * PSR.DFH: don't care --- kernel never touches f32-f127 on its own
571 * initiative
572 * PSR.DI : always 0 (kernel never turns it on)
573 * PSR.SI : always 0 (kernel never turns it on)
574 * PSR.DB : don't care --- kernel never enables kernel-level
575 * breakpoints
576 * PSR.TB : must be 0 already; if it wasn't zero on entry to
577 * __kernel_syscall_via_epc, the branch to fsys_bubble_down
578 * will trigger a taken branch; the taken-trap-handler then
579 * converts the syscall into a break-based system-call.
551 */ 580 */
552# define PSR_PRESERVED_BITS (IA64_PSR_UP | IA64_PSR_MFL | IA64_PSR_MFH | IA64_PSR_PK \
553 | IA64_PSR_DT | IA64_PSR_PP | IA64_PSR_SP | IA64_PSR_RT \
554 | IA64_PSR_IC)
555 /* 581 /*
556 * Reading psr.l gives us only bits 0-31, psr.it, and psr.mc. The rest we have 582 * Reading psr.l gives us only bits 0-31, psr.it, and psr.mc.
557 * to synthesize. 583 * The rest we have to synthesize.
558 */ 584 */
559# define PSR_ONE_BITS ((3 << IA64_PSR_CPL0_BIT) | (0x1 << IA64_PSR_RI_BIT) \ 585# define PSR_ONE_BITS ((3 << IA64_PSR_CPL0_BIT) \
586 | (0x1 << IA64_PSR_RI_BIT) \
560 | IA64_PSR_BN | IA64_PSR_I) 587 | IA64_PSR_BN | IA64_PSR_I)
561 588
562 invala 589 invala // M0|1
563 movl r8=PSR_ONE_BITS 590 movl r14=ia64_ret_from_syscall // X
564 591
565 mov r25=ar.unat // save ar.unat (5 cyc) 592 nop.m 0
566 movl r9=PSR_PRESERVED_BITS 593 movl r28=__kernel_syscall_via_break // X create cr.iip
594 ;;
567 595
568 mov ar.rsc=0 // set enforced lazy mode, pl 0, little-endian, loadrs=0 596 mov r2=r16 // A get task addr to addl-addressable register
569 movl r28=__kernel_syscall_via_break 597 adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r16 // A
598 mov r31=pr // I0 save pr (2 cyc)
570 ;; 599 ;;
571 mov r23=ar.bspstore // save ar.bspstore (12 cyc) 600 st1 [r16]=r0 // M2|3 clear current->thread.on_ustack flag
572 mov r31=pr // save pr (2 cyc) 601 addl r22=IA64_RBS_OFFSET,r2 // A compute base of RBS
573 mov r20=r1 // save caller's gp in r20 602 add r3=TI_FLAGS+IA64_TASK_SIZE,r2 // A
574 ;; 603 ;;
575 mov r2=r16 // copy current task addr to addl-addressable register 604 ld4 r3=[r3] // M0|1 r3 = current_thread_info()->flags
576 and r9=r9,r29 605 lfetch.fault.excl.nt1 [r22] // M0|1 prefetch register backing-store
577 mov r19=b6 // save b6 (2 cyc) 606 nop.i 0
578 ;; 607 ;;
579 mov psr.l=r9 // slam the door (17 cyc to srlz.i) 608 mov ar.rsc=0 // M2 set enforced lazy mode, pl 0, LE, loadrs=0
580 or r29=r8,r29 // construct cr.ipsr value to save 609 nop.m 0
581 addl r22=IA64_RBS_OFFSET,r2 // compute base of RBS 610 nop.i 0
582 ;; 611 ;;
583 // GAS reports a spurious RAW hazard on the read of ar.rnat because it thinks 612 mov r23=ar.bspstore // M2 (12 cyc) save ar.bspstore
584 // we may be reading ar.itc after writing to psr.l. Avoid that message with 613 mov.m r24=ar.rnat // M2 (5 cyc) read ar.rnat (dual-issues!)
585 // this directive: 614 nop.i 0
586 dv_serialize_data
587 mov.m r24=ar.rnat // read ar.rnat (5 cyc lat)
588 lfetch.fault.excl.nt1 [r22]
589 adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r2
590
591 // ensure previous insn group is issued before we stall for srlz.i:
592 ;; 615 ;;
593 srlz.i // ensure new psr.l has been established 616 mov ar.bspstore=r22 // M2 (6 cyc) switch to kernel RBS
594 ///////////////////////////////////////////////////////////////////////////// 617 movl r8=PSR_ONE_BITS // X
595 ////////// from this point on, execution is not interruptible anymore
596 /////////////////////////////////////////////////////////////////////////////
597 addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2 // compute base of memory stack
598 cmp.ne pKStk,pUStk=r0,r0 // set pKStk <- 0, pUStk <- 1
599 ;; 618 ;;
600 st1 [r16]=r0 // clear current->thread.on_ustack flag 619 mov r25=ar.unat // M2 (5 cyc) save ar.unat
601 mov ar.bspstore=r22 // switch to kernel RBS 620 mov r19=b6 // I0 save b6 (2 cyc)
602 mov b6=r18 // copy syscall entry-point to b6 (7 cyc) 621 mov r20=r1 // A save caller's gp in r20
603 add r3=TI_FLAGS+IA64_TASK_SIZE,r2
604 ;; 622 ;;
605 ld4 r3=[r3] // r2 = current_thread_info()->flags 623 or r29=r8,r29 // A construct cr.ipsr value to save
606 mov r18=ar.bsp // save (kernel) ar.bsp (12 cyc) 624 mov b6=r18 // I0 copy syscall entry-point to b6 (7 cyc)
607 mov ar.rsc=0x3 // set eager mode, pl 0, little-endian, loadrs=0 625 addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2 // A compute base of memory stack
608 br.call.sptk.many b7=ia64_syscall_setup 626
609 ;; 627 mov r18=ar.bsp // M2 save (kernel) ar.bsp (12 cyc)
610 ssm psr.i 628 cmp.ne pKStk,pUStk=r0,r0 // A set pKStk <- 0, pUStk <- 1
611 movl r2=ia64_ret_from_syscall 629 br.call.sptk.many b7=ia64_syscall_setup // B
612 ;; 630 ;;
613 mov rp=r2 // set the real return addr 631 mov ar.rsc=0x3 // M2 set eager mode, pl 0, LE, loadrs=0
614 and r3=_TIF_SYSCALL_TRACEAUDIT,r3 632 mov rp=r14 // I0 set the real return addr
633 and r3=_TIF_SYSCALL_TRACEAUDIT,r3 // A
615 ;; 634 ;;
616 cmp.eq p8,p0=r3,r0 635 ssm psr.i // M2 we're on kernel stacks now, reenable irqs
636 cmp.eq p8,p0=r3,r0 // A
637(p10) br.cond.spnt.many ia64_ret_from_syscall // B return if bad call-frame or r15 is a NaT
617 638
618(p10) br.cond.spnt.many ia64_ret_from_syscall // p10==true means out registers are more than 8 639 nop.m 0
619(p8) br.call.sptk.many b6=b6 // ignore this return addr 640(p8) br.call.sptk.many b6=b6 // B (ignore return address)
620 br.cond.sptk ia64_trace_syscall 641 br.cond.spnt ia64_trace_syscall // B
621END(fsys_bubble_down) 642END(fsys_bubble_down)
622 643
623 .rodata 644 .rodata
diff --git a/arch/ia64/kernel/gate.S b/arch/ia64/kernel/gate.S
index facf75acdc85..86948ce63e43 100644
--- a/arch/ia64/kernel/gate.S
+++ b/arch/ia64/kernel/gate.S
@@ -72,38 +72,40 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc)
72 * bundle get executed. The remaining code must be safe even if 72 * bundle get executed. The remaining code must be safe even if
73 * they do not get executed. 73 * they do not get executed.
74 */ 74 */
75 adds r17=-1024,r15 75 adds r17=-1024,r15 // A
76 mov r10=0 // default to successful syscall execution 76 mov r10=0 // A default to successful syscall execution
77 epc 77 epc // B causes split-issue
78} 78}
79 ;; 79 ;;
80 rsm psr.be // note: on McKinley "rsm psr.be/srlz.d" is slightly faster than "rum psr.be" 80 rsm psr.be | psr.i // M2 (5 cyc to srlz.d)
81 LOAD_FSYSCALL_TABLE(r14) 81 LOAD_FSYSCALL_TABLE(r14) // X
82
83 mov r16=IA64_KR(CURRENT) // 12 cycle read latency
84 tnat.nz p10,p9=r15
85 mov r19=NR_syscalls-1
86 ;; 82 ;;
87 shladd r18=r17,3,r14 83 mov r16=IA64_KR(CURRENT) // M2 (12 cyc)
88 84 shladd r18=r17,3,r14 // A
89 srlz.d 85 mov r19=NR_syscalls-1 // A
90 cmp.ne p8,p0=r0,r0 // p8 <- FALSE 86 ;;
91 /* Note: if r17 is a NaT, p6 will be set to zero. */ 87 lfetch [r18] // M0|1
92 cmp.geu p6,p7=r19,r17 // (syscall > 0 && syscall < 1024+NR_syscalls)? 88 mov r29=psr // M2 (12 cyc)
93 ;; 89 // If r17 is a NaT, p6 will be zero
94(p6) ld8 r18=[r18] 90 cmp.geu p6,p7=r19,r17 // A (sysnr > 0 && sysnr < 1024+NR_syscalls)?
95 mov r21=ar.fpsr 91 ;;
96 add r14=-8,r14 // r14 <- addr of fsys_bubble_down entry 92 mov r21=ar.fpsr // M2 (12 cyc)
97 ;; 93 tnat.nz p10,p9=r15 // I0
98(p6) mov b7=r18 94 mov.i r26=ar.pfs // I0 (would stall anyhow due to srlz.d...)
99(p6) tbit.z p8,p0=r18,0 95 ;;
100(p8) br.dptk.many b7 96 srlz.d // M0 (forces split-issue) ensure PSR.BE==0
101 97(p6) ld8 r18=[r18] // M0|1
102(p6) rsm psr.i 98 nop.i 0
103 mov r27=ar.rsc 99 ;;
104 mov r26=ar.pfs 100 nop.m 0
101(p6) tbit.z.unc p8,p0=r18,0 // I0 (dual-issues with "mov b7=r18"!)
102 nop.i 0
105 ;; 103 ;;
106 mov r29=psr // read psr (12 cyc load latency) 104(p8) ssm psr.i
105(p6) mov b7=r18 // I0
106(p8) br.dptk.many b7 // B
107
108 mov r27=ar.rsc // M2 (12 cyc)
107/* 109/*
108 * brl.cond doesn't work as intended because the linker would convert this branch 110 * brl.cond doesn't work as intended because the linker would convert this branch
109 * into a branch to a PLT. Perhaps there will be a way to avoid this with some 111 * into a branch to a PLT. Perhaps there will be a way to avoid this with some
@@ -111,6 +113,8 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc)
111 * instead. 113 * instead.
112 */ 114 */
113#ifdef CONFIG_ITANIUM 115#ifdef CONFIG_ITANIUM
116(p6) add r14=-8,r14 // r14 <- addr of fsys_bubble_down entry
117 ;;
114(p6) ld8 r14=[r14] // r14 <- fsys_bubble_down 118(p6) ld8 r14=[r14] // r14 <- fsys_bubble_down
115 ;; 119 ;;
116(p6) mov b7=r14 120(p6) mov b7=r14
@@ -118,7 +122,7 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc)
118#else 122#else
119 BRL_COND_FSYS_BUBBLE_DOWN(p6) 123 BRL_COND_FSYS_BUBBLE_DOWN(p6)
120#endif 124#endif
121 125 ssm psr.i
122 mov r10=-1 126 mov r10=-1
123(p10) mov r8=EINVAL 127(p10) mov r8=EINVAL
124(p9) mov r8=ENOSYS 128(p9) mov r8=ENOSYS
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
index 7bbf019c9867..01572814abe4 100644
--- a/arch/ia64/kernel/ia64_ksyms.c
+++ b/arch/ia64/kernel/ia64_ksyms.c
@@ -58,9 +58,6 @@ EXPORT_SYMBOL(__strlen_user);
58EXPORT_SYMBOL(__strncpy_from_user); 58EXPORT_SYMBOL(__strncpy_from_user);
59EXPORT_SYMBOL(__strnlen_user); 59EXPORT_SYMBOL(__strnlen_user);
60 60
61#include <asm/unistd.h>
62EXPORT_SYMBOL(__ia64_syscall);
63
64/* from arch/ia64/lib */ 61/* from arch/ia64/lib */
65extern void __divsi3(void); 62extern void __divsi3(void);
66extern void __udivsi3(void); 63extern void __udivsi3(void);
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index 88b014381df5..c170be095ccd 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -129,14 +129,13 @@ static struct iosapic {
129 char __iomem *addr; /* base address of IOSAPIC */ 129 char __iomem *addr; /* base address of IOSAPIC */
130 unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */ 130 unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */
131 unsigned short num_rte; /* number of RTE in this IOSAPIC */ 131 unsigned short num_rte; /* number of RTE in this IOSAPIC */
132 int rtes_inuse; /* # of RTEs in use on this IOSAPIC */
132#ifdef CONFIG_NUMA 133#ifdef CONFIG_NUMA
133 unsigned short node; /* numa node association via pxm */ 134 unsigned short node; /* numa node association via pxm */
134#endif 135#endif
135} iosapic_lists[NR_IOSAPICS]; 136} iosapic_lists[NR_IOSAPICS];
136 137
137static int num_iosapic; 138static unsigned char pcat_compat __devinitdata; /* 8259 compatibility flag */
138
139static unsigned char pcat_compat __initdata; /* 8259 compatibility flag */
140 139
141static int iosapic_kmalloc_ok; 140static int iosapic_kmalloc_ok;
142static LIST_HEAD(free_rte_list); 141static LIST_HEAD(free_rte_list);
@@ -149,7 +148,7 @@ find_iosapic (unsigned int gsi)
149{ 148{
150 int i; 149 int i;
151 150
152 for (i = 0; i < num_iosapic; i++) { 151 for (i = 0; i < NR_IOSAPICS; i++) {
153 if ((unsigned) (gsi - iosapic_lists[i].gsi_base) < iosapic_lists[i].num_rte) 152 if ((unsigned) (gsi - iosapic_lists[i].gsi_base) < iosapic_lists[i].num_rte)
154 return i; 153 return i;
155 } 154 }
@@ -598,6 +597,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
598 rte->refcnt++; 597 rte->refcnt++;
599 list_add_tail(&rte->rte_list, &iosapic_intr_info[vector].rtes); 598 list_add_tail(&rte->rte_list, &iosapic_intr_info[vector].rtes);
600 iosapic_intr_info[vector].count++; 599 iosapic_intr_info[vector].count++;
600 iosapic_lists[index].rtes_inuse++;
601 } 601 }
602 else if (vector_is_shared(vector)) { 602 else if (vector_is_shared(vector)) {
603 struct iosapic_intr_info *info = &iosapic_intr_info[vector]; 603 struct iosapic_intr_info *info = &iosapic_intr_info[vector];
@@ -778,7 +778,7 @@ void
778iosapic_unregister_intr (unsigned int gsi) 778iosapic_unregister_intr (unsigned int gsi)
779{ 779{
780 unsigned long flags; 780 unsigned long flags;
781 int irq, vector; 781 int irq, vector, index;
782 irq_desc_t *idesc; 782 irq_desc_t *idesc;
783 u32 low32; 783 u32 low32;
784 unsigned long trigger, polarity; 784 unsigned long trigger, polarity;
@@ -819,6 +819,9 @@ iosapic_unregister_intr (unsigned int gsi)
819 list_del(&rte->rte_list); 819 list_del(&rte->rte_list);
820 iosapic_intr_info[vector].count--; 820 iosapic_intr_info[vector].count--;
821 iosapic_free_rte(rte); 821 iosapic_free_rte(rte);
822 index = find_iosapic(gsi);
823 iosapic_lists[index].rtes_inuse--;
824 WARN_ON(iosapic_lists[index].rtes_inuse < 0);
822 825
823 trigger = iosapic_intr_info[vector].trigger; 826 trigger = iosapic_intr_info[vector].trigger;
824 polarity = iosapic_intr_info[vector].polarity; 827 polarity = iosapic_intr_info[vector].polarity;
@@ -952,30 +955,86 @@ iosapic_system_init (int system_pcat_compat)
952 } 955 }
953} 956}
954 957
955void __init 958static inline int
959iosapic_alloc (void)
960{
961 int index;
962
963 for (index = 0; index < NR_IOSAPICS; index++)
964 if (!iosapic_lists[index].addr)
965 return index;
966
967 printk(KERN_WARNING "%s: failed to allocate iosapic\n", __FUNCTION__);
968 return -1;
969}
970
971static inline void
972iosapic_free (int index)
973{
974 memset(&iosapic_lists[index], 0, sizeof(iosapic_lists[0]));
975}
976
977static inline int
978iosapic_check_gsi_range (unsigned int gsi_base, unsigned int ver)
979{
980 int index;
981 unsigned int gsi_end, base, end;
982
983 /* check gsi range */
984 gsi_end = gsi_base + ((ver >> 16) & 0xff);
985 for (index = 0; index < NR_IOSAPICS; index++) {
986 if (!iosapic_lists[index].addr)
987 continue;
988
989 base = iosapic_lists[index].gsi_base;
990 end = base + iosapic_lists[index].num_rte - 1;
991
992 if (gsi_base < base && gsi_end < base)
993 continue;/* OK */
994
995 if (gsi_base > end && gsi_end > end)
996 continue; /* OK */
997
998 return -EBUSY;
999 }
1000 return 0;
1001}
1002
1003int __devinit
956iosapic_init (unsigned long phys_addr, unsigned int gsi_base) 1004iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
957{ 1005{
958 int num_rte; 1006 int num_rte, err, index;
959 unsigned int isa_irq, ver; 1007 unsigned int isa_irq, ver;
960 char __iomem *addr; 1008 char __iomem *addr;
1009 unsigned long flags;
1010
1011 spin_lock_irqsave(&iosapic_lock, flags);
1012 {
1013 addr = ioremap(phys_addr, 0);
1014 ver = iosapic_version(addr);
961 1015
962 addr = ioremap(phys_addr, 0); 1016 if ((err = iosapic_check_gsi_range(gsi_base, ver))) {
963 ver = iosapic_version(addr); 1017 iounmap(addr);
1018 spin_unlock_irqrestore(&iosapic_lock, flags);
1019 return err;
1020 }
964 1021
965 /* 1022 /*
966 * The MAX_REDIR register holds the highest input pin 1023 * The MAX_REDIR register holds the highest input pin
967 * number (starting from 0). 1024 * number (starting from 0).
968 * We add 1 so that we can use it for number of pins (= RTEs) 1025 * We add 1 so that we can use it for number of pins (= RTEs)
969 */ 1026 */
970 num_rte = ((ver >> 16) & 0xff) + 1; 1027 num_rte = ((ver >> 16) & 0xff) + 1;
971 1028
972 iosapic_lists[num_iosapic].addr = addr; 1029 index = iosapic_alloc();
973 iosapic_lists[num_iosapic].gsi_base = gsi_base; 1030 iosapic_lists[index].addr = addr;
974 iosapic_lists[num_iosapic].num_rte = num_rte; 1031 iosapic_lists[index].gsi_base = gsi_base;
1032 iosapic_lists[index].num_rte = num_rte;
975#ifdef CONFIG_NUMA 1033#ifdef CONFIG_NUMA
976 iosapic_lists[num_iosapic].node = MAX_NUMNODES; 1034 iosapic_lists[index].node = MAX_NUMNODES;
977#endif 1035#endif
978 num_iosapic++; 1036 }
1037 spin_unlock_irqrestore(&iosapic_lock, flags);
979 1038
980 if ((gsi_base == 0) && pcat_compat) { 1039 if ((gsi_base == 0) && pcat_compat) {
981 /* 1040 /*
@@ -986,10 +1045,43 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
986 for (isa_irq = 0; isa_irq < 16; ++isa_irq) 1045 for (isa_irq = 0; isa_irq < 16; ++isa_irq)
987 iosapic_override_isa_irq(isa_irq, isa_irq, IOSAPIC_POL_HIGH, IOSAPIC_EDGE); 1046 iosapic_override_isa_irq(isa_irq, isa_irq, IOSAPIC_POL_HIGH, IOSAPIC_EDGE);
988 } 1047 }
1048 return 0;
1049}
1050
1051#ifdef CONFIG_HOTPLUG
1052int
1053iosapic_remove (unsigned int gsi_base)
1054{
1055 int index, err = 0;
1056 unsigned long flags;
1057
1058 spin_lock_irqsave(&iosapic_lock, flags);
1059 {
1060 index = find_iosapic(gsi_base);
1061 if (index < 0) {
1062 printk(KERN_WARNING "%s: No IOSAPIC for GSI base %u\n",
1063 __FUNCTION__, gsi_base);
1064 goto out;
1065 }
1066
1067 if (iosapic_lists[index].rtes_inuse) {
1068 err = -EBUSY;
1069 printk(KERN_WARNING "%s: IOSAPIC for GSI base %u is busy\n",
1070 __FUNCTION__, gsi_base);
1071 goto out;
1072 }
1073
1074 iounmap(iosapic_lists[index].addr);
1075 iosapic_free(index);
1076 }
1077 out:
1078 spin_unlock_irqrestore(&iosapic_lock, flags);
1079 return err;
989} 1080}
1081#endif /* CONFIG_HOTPLUG */
990 1082
991#ifdef CONFIG_NUMA 1083#ifdef CONFIG_NUMA
992void __init 1084void __devinit
993map_iosapic_to_node(unsigned int gsi_base, int node) 1085map_iosapic_to_node(unsigned int gsi_base, int node)
994{ 1086{
995 int index; 1087 int index;
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index 2bc085a73e30..3bb3a13c4047 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/ia64/kernel/ivt.S 2 * arch/ia64/kernel/ivt.S
3 * 3 *
4 * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co 4 * Copyright (C) 1998-2001, 2003, 2005 Hewlett-Packard Co
5 * Stephane Eranian <eranian@hpl.hp.com> 5 * Stephane Eranian <eranian@hpl.hp.com>
6 * David Mosberger <davidm@hpl.hp.com> 6 * David Mosberger <davidm@hpl.hp.com>
7 * Copyright (C) 2000, 2002-2003 Intel Co 7 * Copyright (C) 2000, 2002-2003 Intel Co
@@ -692,82 +692,118 @@ ENTRY(break_fault)
692 * to prevent leaking bits from kernel to user level. 692 * to prevent leaking bits from kernel to user level.
693 */ 693 */
694 DBG_FAULT(11) 694 DBG_FAULT(11)
695 mov r16=IA64_KR(CURRENT) // r16 = current task; 12 cycle read lat. 695 mov.m r16=IA64_KR(CURRENT) // M2 r16 <- current task (12 cyc)
696 mov r17=cr.iim 696 mov r29=cr.ipsr // M2 (12 cyc)
697 mov r18=__IA64_BREAK_SYSCALL 697 mov r31=pr // I0 (2 cyc)
698 mov r21=ar.fpsr 698
699 mov r29=cr.ipsr 699 mov r17=cr.iim // M2 (2 cyc)
700 mov r19=b6 700 mov.m r27=ar.rsc // M2 (12 cyc)
701 mov r25=ar.unat 701 mov r18=__IA64_BREAK_SYSCALL // A
702 mov r27=ar.rsc 702
703 mov r26=ar.pfs 703 mov.m ar.rsc=0 // M2
704 mov r28=cr.iip 704 mov.m r21=ar.fpsr // M2 (12 cyc)
705 mov r31=pr // prepare to save predicates 705 mov r19=b6 // I0 (2 cyc)
706 mov r20=r1 706 ;;
707 ;; 707 mov.m r23=ar.bspstore // M2 (12 cyc)
708 mov.m r24=ar.rnat // M2 (5 cyc)
709 mov.i r26=ar.pfs // I0 (2 cyc)
710
711 invala // M0|1
712 nop.m 0 // M
713 mov r20=r1 // A save r1
714
715 nop.m 0
716 movl r30=sys_call_table // X
717
718 mov r28=cr.iip // M2 (2 cyc)
719 cmp.eq p0,p7=r18,r17 // I0 is this a system call?
720(p7) br.cond.spnt non_syscall // B no ->
721 //
722 // From this point on, we are definitely on the syscall-path
723 // and we can use (non-banked) scratch registers.
724 //
725///////////////////////////////////////////////////////////////////////
726 mov r1=r16 // A move task-pointer to "addl"-addressable reg
727 mov r2=r16 // A setup r2 for ia64_syscall_setup
728 add r9=TI_FLAGS+IA64_TASK_SIZE,r16 // A r9 = &current_thread_info()->flags
729
708 adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r16 730 adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r16
709 cmp.eq p0,p7=r18,r17 // is this a system call? (p7 <- false, if so) 731 adds r15=-1024,r15 // A subtract 1024 from syscall number
710(p7) br.cond.spnt non_syscall 732 mov r3=NR_syscalls - 1
711 ;; 733 ;;
712 ld1 r17=[r16] // load current->thread.on_ustack flag 734 ld1.bias r17=[r16] // M0|1 r17 = current->thread.on_ustack flag
713 st1 [r16]=r0 // clear current->thread.on_ustack flag 735 ld4 r9=[r9] // M0|1 r9 = current_thread_info()->flags
714 add r1=-IA64_TASK_THREAD_ON_USTACK_OFFSET,r16 // set r1 for MINSTATE_START_SAVE_MIN_VIRT 736 extr.u r8=r29,41,2 // I0 extract ei field from cr.ipsr
737
738 shladd r30=r15,3,r30 // A r30 = sys_call_table + 8*(syscall-1024)
739 addl r22=IA64_RBS_OFFSET,r1 // A compute base of RBS
740 cmp.leu p6,p7=r15,r3 // A syscall number in range?
715 ;; 741 ;;
716 invala
717 742
718 /* adjust return address so we skip over the break instruction: */ 743 lfetch.fault.excl.nt1 [r22] // M0|1 prefetch RBS
744(p6) ld8 r30=[r30] // M0|1 load address of syscall entry point
745 tnat.nz.or p7,p0=r15 // I0 is syscall nr a NaT?
719 746
720 extr.u r8=r29,41,2 // extract ei field from cr.ipsr 747 mov.m ar.bspstore=r22 // M2 switch to kernel RBS
721 ;; 748 cmp.eq p8,p9=2,r8 // A isr.ei==2?
722 cmp.eq p6,p7=2,r8 // isr.ei==2?
723 mov r2=r1 // setup r2 for ia64_syscall_setup
724 ;;
725(p6) mov r8=0 // clear ei to 0
726(p6) adds r28=16,r28 // switch cr.iip to next bundle cr.ipsr.ei wrapped
727(p7) adds r8=1,r8 // increment ei to next slot
728 ;;
729 cmp.eq pKStk,pUStk=r0,r17 // are we in kernel mode already?
730 dep r29=r8,r29,41,2 // insert new ei into cr.ipsr
731 ;; 749 ;;
732 750
733 // switch from user to kernel RBS: 751(p8) mov r8=0 // A clear ei to 0
734 MINSTATE_START_SAVE_MIN_VIRT 752(p7) movl r30=sys_ni_syscall // X
735 br.call.sptk.many b7=ia64_syscall_setup
736 ;;
737 MINSTATE_END_SAVE_MIN_VIRT // switch to bank 1
738 ssm psr.ic | PSR_DEFAULT_BITS
739 ;;
740 srlz.i // guarantee that interruption collection is on
741 mov r3=NR_syscalls - 1
742 ;;
743(p15) ssm psr.i // restore psr.i
744 // p10==true means out registers are more than 8 or r15's Nat is true
745(p10) br.cond.spnt.many ia64_ret_from_syscall
746 ;;
747 movl r16=sys_call_table
748 753
749 adds r15=-1024,r15 // r15 contains the syscall number---subtract 1024 754(p8) adds r28=16,r28 // A switch cr.iip to next bundle
750 movl r2=ia64_ret_from_syscall 755(p9) adds r8=1,r8 // A increment ei to next slot
751 ;; 756 nop.i 0
752 shladd r20=r15,3,r16 // r20 = sys_call_table + 8*(syscall-1024)
753 cmp.leu p6,p7=r15,r3 // (syscall > 0 && syscall < 1024 + NR_syscalls) ?
754 mov rp=r2 // set the real return addr
755 ;; 757 ;;
756(p6) ld8 r20=[r20] // load address of syscall entry point
757(p7) movl r20=sys_ni_syscall
758 758
759 add r2=TI_FLAGS+IA64_TASK_SIZE,r13 759 mov.m r25=ar.unat // M2 (5 cyc)
760 ;; 760 dep r29=r8,r29,41,2 // I0 insert new ei into cr.ipsr
761 ld4 r2=[r2] // r2 = current_thread_info()->flags 761 adds r15=1024,r15 // A restore original syscall number
762 ;; 762 //
763 and r2=_TIF_SYSCALL_TRACEAUDIT,r2 // mask trace or audit 763 // If any of the above loads miss in L1D, we'll stall here until
764 // the data arrives.
765 //
766///////////////////////////////////////////////////////////////////////
767 st1 [r16]=r0 // M2|3 clear current->thread.on_ustack flag
768 mov b6=r30 // I0 setup syscall handler branch reg early
769 cmp.eq pKStk,pUStk=r0,r17 // A were we on kernel stacks already?
770
771 and r9=_TIF_SYSCALL_TRACEAUDIT,r9 // A mask trace or audit
772 mov r18=ar.bsp // M2 (12 cyc)
773(pKStk) br.cond.spnt .break_fixup // B we're already in kernel-mode -- fix up RBS
774 ;;
775.back_from_break_fixup:
776(pUStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1 // A compute base of memory stack
777 cmp.eq p14,p0=r9,r0 // A are syscalls being traced/audited?
778 br.call.sptk.many b7=ia64_syscall_setup // B
7791:
780 mov ar.rsc=0x3 // M2 set eager mode, pl 0, LE, loadrs=0
781 nop 0
782 bsw.1 // B (6 cyc) regs are saved, switch to bank 1
764 ;; 783 ;;
765 cmp.eq p8,p0=r2,r0 784
766 mov b6=r20 785 ssm psr.ic | PSR_DEFAULT_BITS // M2 now it's safe to re-enable intr.-collection
786 movl r3=ia64_ret_from_syscall // X
767 ;; 787 ;;
768(p8) br.call.sptk.many b6=b6 // ignore this return addr 788
769 br.cond.sptk ia64_trace_syscall 789 srlz.i // M0 ensure interruption collection is on
790 mov rp=r3 // I0 set the real return addr
791(p10) br.cond.spnt.many ia64_ret_from_syscall // B return if bad call-frame or r15 is a NaT
792
793(p15) ssm psr.i // M2 restore psr.i
794(p14) br.call.sptk.many b6=b6 // B invoke syscall-handker (ignore return addr)
795 br.cond.spnt.many ia64_trace_syscall // B do syscall-tracing thingamagic
770 // NOT REACHED 796 // NOT REACHED
797///////////////////////////////////////////////////////////////////////
798 // On entry, we optimistically assumed that we're coming from user-space.
799 // For the rare cases where a system-call is done from within the kernel,
800 // we fix things up at this point:
801.break_fixup:
802 add r1=-IA64_PT_REGS_SIZE,sp // A allocate space for pt_regs structure
803 mov ar.rnat=r24 // M2 restore kernel's AR.RNAT
804 ;;
805 mov ar.bspstore=r23 // M2 restore kernel's AR.BSPSTORE
806 br.cond.sptk .back_from_break_fixup
771END(break_fault) 807END(break_fault)
772 808
773 .org ia64_ivt+0x3000 809 .org ia64_ivt+0x3000
@@ -842,8 +878,6 @@ END(interrupt)
842 * - r31: saved pr 878 * - r31: saved pr
843 * - b0: original contents (to be saved) 879 * - b0: original contents (to be saved)
844 * On exit: 880 * On exit:
845 * - executing on bank 1 registers
846 * - psr.ic enabled, interrupts restored
847 * - p10: TRUE if syscall is invoked with more than 8 out 881 * - p10: TRUE if syscall is invoked with more than 8 out
848 * registers or r15's Nat is true 882 * registers or r15's Nat is true
849 * - r1: kernel's gp 883 * - r1: kernel's gp
@@ -851,8 +885,11 @@ END(interrupt)
851 * - r8: -EINVAL if p10 is true 885 * - r8: -EINVAL if p10 is true
852 * - r12: points to kernel stack 886 * - r12: points to kernel stack
853 * - r13: points to current task 887 * - r13: points to current task
888 * - r14: preserved (same as on entry)
889 * - p13: preserved
854 * - p15: TRUE if interrupts need to be re-enabled 890 * - p15: TRUE if interrupts need to be re-enabled
855 * - ar.fpsr: set to kernel settings 891 * - ar.fpsr: set to kernel settings
892 * - b6: preserved (same as on entry)
856 */ 893 */
857GLOBAL_ENTRY(ia64_syscall_setup) 894GLOBAL_ENTRY(ia64_syscall_setup)
858#if PT(B6) != 0 895#if PT(B6) != 0
@@ -920,10 +957,10 @@ GLOBAL_ENTRY(ia64_syscall_setup)
920(p13) mov in5=-1 957(p13) mov in5=-1
921 ;; 958 ;;
922 st8 [r16]=r21,PT(R8)-PT(AR_FPSR) // save ar.fpsr 959 st8 [r16]=r21,PT(R8)-PT(AR_FPSR) // save ar.fpsr
923 tnat.nz p14,p0=in6 960 tnat.nz p13,p0=in6
924 cmp.lt p10,p9=r11,r8 // frame size can't be more than local+8 961 cmp.lt p10,p9=r11,r8 // frame size can't be more than local+8
925 ;; 962 ;;
926 stf8 [r16]=f1 // ensure pt_regs.r8 != 0 (see handle_syscall_error) 963 mov r8=1
927(p9) tnat.nz p10,p0=r15 964(p9) tnat.nz p10,p0=r15
928 adds r12=-16,r1 // switch to kernel memory stack (with 16 bytes of scratch) 965 adds r12=-16,r1 // switch to kernel memory stack (with 16 bytes of scratch)
929 966
@@ -934,9 +971,9 @@ GLOBAL_ENTRY(ia64_syscall_setup)
934 mov r13=r2 // establish `current' 971 mov r13=r2 // establish `current'
935 movl r1=__gp // establish kernel global pointer 972 movl r1=__gp // establish kernel global pointer
936 ;; 973 ;;
937(p14) mov in6=-1 974 st8 [r16]=r8 // ensure pt_regs.r8 != 0 (see handle_syscall_error)
975(p13) mov in6=-1
938(p8) mov in7=-1 976(p8) mov in7=-1
939 nop.i 0
940 977
941 cmp.eq pSys,pNonSys=r0,r0 // set pSys=1, pNonSys=0 978 cmp.eq pSys,pNonSys=r0,r0 // set pSys=1, pNonSys=0
942 movl r17=FPSR_DEFAULT 979 movl r17=FPSR_DEFAULT
@@ -1007,6 +1044,8 @@ END(dispatch_illegal_op_fault)
1007 FAULT(17) 1044 FAULT(17)
1008 1045
1009ENTRY(non_syscall) 1046ENTRY(non_syscall)
1047 mov ar.rsc=r27 // restore ar.rsc before SAVE_MIN_WITH_COVER
1048 ;;
1010 SAVE_MIN_WITH_COVER 1049 SAVE_MIN_WITH_COVER
1011 1050
1012 // There is no particular reason for this code to be here, other than that 1051 // There is no particular reason for this code to be here, other than that
@@ -1204,6 +1243,25 @@ END(disabled_fp_reg)
1204// 0x5600 Entry 26 (size 16 bundles) Nat Consumption (11,23,37,50) 1243// 0x5600 Entry 26 (size 16 bundles) Nat Consumption (11,23,37,50)
1205ENTRY(nat_consumption) 1244ENTRY(nat_consumption)
1206 DBG_FAULT(26) 1245 DBG_FAULT(26)
1246
1247 mov r16=cr.ipsr
1248 mov r17=cr.isr
1249 mov r31=pr // save PR
1250 ;;
1251 and r18=0xf,r17 // r18 = cr.ipsr.code{3:0}
1252 tbit.z p6,p0=r17,IA64_ISR_NA_BIT
1253 ;;
1254 cmp.ne.or p6,p0=IA64_ISR_CODE_LFETCH,r18
1255 dep r16=-1,r16,IA64_PSR_ED_BIT,1
1256(p6) br.cond.spnt 1f // branch if (cr.ispr.na == 0 || cr.ipsr.code{3:0} != LFETCH)
1257 ;;
1258 mov cr.ipsr=r16 // set cr.ipsr.na
1259 mov pr=r31,-1
1260 ;;
1261 rfi
1262
12631: mov pr=r31,-1
1264 ;;
1207 FAULT(26) 1265 FAULT(26)
1208END(nat_consumption) 1266END(nat_consumption)
1209 1267
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 5978823d5c63..884f5cd27d8a 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -34,6 +34,7 @@
34 34
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/kdebug.h> 36#include <asm/kdebug.h>
37#include <asm/sections.h>
37 38
38extern void jprobe_inst_return(void); 39extern void jprobe_inst_return(void);
39 40
@@ -263,13 +264,33 @@ static inline void get_kprobe_inst(bundle_t *bundle, uint slot,
263 } 264 }
264} 265}
265 266
267/* Returns non-zero if the addr is in the Interrupt Vector Table */
268static inline int in_ivt_functions(unsigned long addr)
269{
270 return (addr >= (unsigned long)__start_ivt_text
271 && addr < (unsigned long)__end_ivt_text);
272}
273
266static int valid_kprobe_addr(int template, int slot, unsigned long addr) 274static int valid_kprobe_addr(int template, int slot, unsigned long addr)
267{ 275{
268 if ((slot > 2) || ((bundle_encoding[template][1] == L) && slot > 1)) { 276 if ((slot > 2) || ((bundle_encoding[template][1] == L) && slot > 1)) {
269 printk(KERN_WARNING "Attempting to insert unaligned kprobe at 0x%lx\n", 277 printk(KERN_WARNING "Attempting to insert unaligned kprobe "
270 addr); 278 "at 0x%lx\n", addr);
271 return -EINVAL; 279 return -EINVAL;
272 } 280 }
281
282 if (in_ivt_functions(addr)) {
283 printk(KERN_WARNING "Kprobes can't be inserted inside "
284 "IVT functions at 0x%lx\n", addr);
285 return -EINVAL;
286 }
287
288 if (slot == 1 && bundle_encoding[template][1] != L) {
289 printk(KERN_WARNING "Inserting kprobes on slot #1 "
290 "is not supported\n");
291 return -EINVAL;
292 }
293
273 return 0; 294 return 0;
274} 295}
275 296
@@ -290,6 +311,94 @@ static inline void set_current_kprobe(struct kprobe *p)
290 current_kprobe = p; 311 current_kprobe = p;
291} 312}
292 313
314static void kretprobe_trampoline(void)
315{
316}
317
318/*
319 * At this point the target function has been tricked into
320 * returning into our trampoline. Lookup the associated instance
321 * and then:
322 * - call the handler function
323 * - cleanup by marking the instance as unused
324 * - long jump back to the original return address
325 */
326int trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
327{
328 struct kretprobe_instance *ri = NULL;
329 struct hlist_head *head;
330 struct hlist_node *node, *tmp;
331 unsigned long orig_ret_address = 0;
332 unsigned long trampoline_address =
333 ((struct fnptr *)kretprobe_trampoline)->ip;
334
335 head = kretprobe_inst_table_head(current);
336
337 /*
338 * It is possible to have multiple instances associated with a given
339 * task either because an multiple functions in the call path
340 * have a return probe installed on them, and/or more then one return
341 * return probe was registered for a target function.
342 *
343 * We can handle this because:
344 * - instances are always inserted at the head of the list
345 * - when multiple return probes are registered for the same
346 * function, the first instance's ret_addr will point to the
347 * real return address, and all the rest will point to
348 * kretprobe_trampoline
349 */
350 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
351 if (ri->task != current)
352 /* another task is sharing our hash bucket */
353 continue;
354
355 if (ri->rp && ri->rp->handler)
356 ri->rp->handler(ri, regs);
357
358 orig_ret_address = (unsigned long)ri->ret_addr;
359 recycle_rp_inst(ri);
360
361 if (orig_ret_address != trampoline_address)
362 /*
363 * This is the real return address. Any other
364 * instances associated with this task are for
365 * other calls deeper on the call stack
366 */
367 break;
368 }
369
370 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
371 regs->cr_iip = orig_ret_address;
372
373 unlock_kprobes();
374 preempt_enable_no_resched();
375
376 /*
377 * By returning a non-zero value, we are telling
378 * kprobe_handler() that we have handled unlocking
379 * and re-enabling preemption.
380 */
381 return 1;
382}
383
384void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs)
385{
386 struct kretprobe_instance *ri;
387
388 if ((ri = get_free_rp_inst(rp)) != NULL) {
389 ri->rp = rp;
390 ri->task = current;
391 ri->ret_addr = (kprobe_opcode_t *)regs->b0;
392
393 /* Replace the return addr with trampoline addr */
394 regs->b0 = ((struct fnptr *)kretprobe_trampoline)->ip;
395
396 add_rp_inst(ri);
397 } else {
398 rp->nmissed++;
399 }
400}
401
293int arch_prepare_kprobe(struct kprobe *p) 402int arch_prepare_kprobe(struct kprobe *p)
294{ 403{
295 unsigned long addr = (unsigned long) p->addr; 404 unsigned long addr = (unsigned long) p->addr;
@@ -492,8 +601,8 @@ static int pre_kprobes_handler(struct die_args *args)
492 if (p->pre_handler && p->pre_handler(p, regs)) 601 if (p->pre_handler && p->pre_handler(p, regs))
493 /* 602 /*
494 * Our pre-handler is specifically requesting that we just 603 * Our pre-handler is specifically requesting that we just
495 * do a return. This is handling the case where the 604 * do a return. This is used for both the jprobe pre-handler
496 * pre-handler is really our special jprobe pre-handler. 605 * and the kretprobe trampoline
497 */ 606 */
498 return 1; 607 return 1;
499 608
@@ -599,3 +708,14 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
599 *regs = jprobe_saved_regs; 708 *regs = jprobe_saved_regs;
600 return 1; 709 return 1;
601} 710}
711
712static struct kprobe trampoline_p = {
713 .pre_handler = trampoline_probe_handler
714};
715
716int __init arch_init_kprobes(void)
717{
718 trampoline_p.addr =
719 (kprobe_opcode_t *)((struct fnptr *)kretprobe_trampoline)->ip;
720 return register_kprobe(&trampoline_p);
721}
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index ebb71f3d6d19..6e35bff05d59 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -27,6 +27,7 @@
27#include <linux/efi.h> 27#include <linux/efi.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/kprobes.h>
30 31
31#include <asm/cpu.h> 32#include <asm/cpu.h>
32#include <asm/delay.h> 33#include <asm/delay.h>
@@ -707,6 +708,13 @@ kernel_thread_helper (int (*fn)(void *), void *arg)
707void 708void
708flush_thread (void) 709flush_thread (void)
709{ 710{
711 /*
712 * Remove function-return probe instances associated with this task
713 * and put them back on the free list. Do not insert an exit probe for
714 * this function, it will be disabled by kprobe_flush_task if you do.
715 */
716 kprobe_flush_task(current);
717
710 /* drop floating-point and debug-register state if it exists: */ 718 /* drop floating-point and debug-register state if it exists: */
711 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID); 719 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID);
712 ia64_drop_fpu(current); 720 ia64_drop_fpu(current);
@@ -721,6 +729,14 @@ flush_thread (void)
721void 729void
722exit_thread (void) 730exit_thread (void)
723{ 731{
732
733 /*
734 * Remove function-return probe instances associated with this task
735 * and put them back on the free list. Do not insert an exit probe for
736 * this function, it will be disabled by kprobe_flush_task if you do.
737 */
738 kprobe_flush_task(current);
739
724 ia64_drop_fpu(current); 740 ia64_drop_fpu(current);
725#ifdef CONFIG_PERFMON 741#ifdef CONFIG_PERFMON
726 /* if needed, stop monitoring and flush state to perfmon context */ 742 /* if needed, stop monitoring and flush state to perfmon context */
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 6d57aebad485..bbb8bc7c0552 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -725,12 +725,32 @@ convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt,
725 break; 725 break;
726 } 726 }
727 727
728 /*
729 * Note: at the time of this call, the target task is blocked
730 * in notify_resume_user() and by clearling PRED_LEAVE_SYSCALL
731 * (aka, "pLvSys") we redirect execution from
732 * .work_pending_syscall_end to .work_processed_kernel.
733 */
728 unw_get_pr(&prev_info, &pr); 734 unw_get_pr(&prev_info, &pr);
729 pr &= ~(1UL << PRED_SYSCALL); 735 pr &= ~((1UL << PRED_SYSCALL) | (1UL << PRED_LEAVE_SYSCALL));
730 pr |= (1UL << PRED_NON_SYSCALL); 736 pr |= (1UL << PRED_NON_SYSCALL);
731 unw_set_pr(&prev_info, pr); 737 unw_set_pr(&prev_info, pr);
732 738
733 pt->cr_ifs = (1UL << 63) | cfm; 739 pt->cr_ifs = (1UL << 63) | cfm;
740 /*
741 * Clear the memory that is NOT written on syscall-entry to
742 * ensure we do not leak kernel-state to user when execution
743 * resumes.
744 */
745 pt->r2 = 0;
746 pt->r3 = 0;
747 pt->r14 = 0;
748 memset(&pt->r16, 0, 16*8); /* clear r16-r31 */
749 memset(&pt->f6, 0, 6*16); /* clear f6-f11 */
750 pt->b7 = 0;
751 pt->ar_ccv = 0;
752 pt->ar_csd = 0;
753 pt->ar_ssd = 0;
734} 754}
735 755
736static int 756static int
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index d14692e0920a..2693e1522d7c 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -72,6 +72,8 @@ DEFINE_PER_CPU(unsigned long, ia64_phys_stacked_size_p8);
72unsigned long ia64_cycles_per_usec; 72unsigned long ia64_cycles_per_usec;
73struct ia64_boot_param *ia64_boot_param; 73struct ia64_boot_param *ia64_boot_param;
74struct screen_info screen_info; 74struct screen_info screen_info;
75unsigned long vga_console_iobase;
76unsigned long vga_console_membase;
75 77
76unsigned long ia64_max_cacheline_size; 78unsigned long ia64_max_cacheline_size;
77unsigned long ia64_iobase; /* virtual address for I/O accesses */ 79unsigned long ia64_iobase; /* virtual address for I/O accesses */
@@ -273,23 +275,25 @@ io_port_init (void)
273static inline int __init 275static inline int __init
274early_console_setup (char *cmdline) 276early_console_setup (char *cmdline)
275{ 277{
278 int earlycons = 0;
279
276#ifdef CONFIG_SERIAL_SGI_L1_CONSOLE 280#ifdef CONFIG_SERIAL_SGI_L1_CONSOLE
277 { 281 {
278 extern int sn_serial_console_early_setup(void); 282 extern int sn_serial_console_early_setup(void);
279 if (!sn_serial_console_early_setup()) 283 if (!sn_serial_console_early_setup())
280 return 0; 284 earlycons++;
281 } 285 }
282#endif 286#endif
283#ifdef CONFIG_EFI_PCDP 287#ifdef CONFIG_EFI_PCDP
284 if (!efi_setup_pcdp_console(cmdline)) 288 if (!efi_setup_pcdp_console(cmdline))
285 return 0; 289 earlycons++;
286#endif 290#endif
287#ifdef CONFIG_SERIAL_8250_CONSOLE 291#ifdef CONFIG_SERIAL_8250_CONSOLE
288 if (!early_serial_console_init(cmdline)) 292 if (!early_serial_console_init(cmdline))
289 return 0; 293 earlycons++;
290#endif 294#endif
291 295
292 return -1; 296 return (earlycons) ? 0 : -1;
293} 297}
294 298
295static inline void 299static inline void
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
index b49d4ddaab93..0166a9847095 100644
--- a/arch/ia64/kernel/smp.c
+++ b/arch/ia64/kernel/smp.c
@@ -231,13 +231,16 @@ smp_flush_tlb_all (void)
231void 231void
232smp_flush_tlb_mm (struct mm_struct *mm) 232smp_flush_tlb_mm (struct mm_struct *mm)
233{ 233{
234 preempt_disable();
234 /* this happens for the common case of a single-threaded fork(): */ 235 /* this happens for the common case of a single-threaded fork(): */
235 if (likely(mm == current->active_mm && atomic_read(&mm->mm_users) == 1)) 236 if (likely(mm == current->active_mm && atomic_read(&mm->mm_users) == 1))
236 { 237 {
237 local_finish_flush_tlb_mm(mm); 238 local_finish_flush_tlb_mm(mm);
239 preempt_enable();
238 return; 240 return;
239 } 241 }
240 242
243 preempt_enable();
241 /* 244 /*
242 * We could optimize this further by using mm->cpu_vm_mask to track which CPUs 245 * We could optimize this further by using mm->cpu_vm_mask to track which CPUs
243 * have been running in the address space. It's not clear that this is worth the 246 * have been running in the address space. It's not clear that this is worth the
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index b9f0db4c1b04..a676e79e0681 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -8,6 +8,11 @@
8#define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE) 8#define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE)
9#include <asm-generic/vmlinux.lds.h> 9#include <asm-generic/vmlinux.lds.h>
10 10
11#define IVT_TEXT \
12 VMLINUX_SYMBOL(__start_ivt_text) = .; \
13 *(.text.ivt) \
14 VMLINUX_SYMBOL(__end_ivt_text) = .;
15
11OUTPUT_FORMAT("elf64-ia64-little") 16OUTPUT_FORMAT("elf64-ia64-little")
12OUTPUT_ARCH(ia64) 17OUTPUT_ARCH(ia64)
13ENTRY(phys_start) 18ENTRY(phys_start)
@@ -39,7 +44,7 @@ SECTIONS
39 44
40 .text : AT(ADDR(.text) - LOAD_OFFSET) 45 .text : AT(ADDR(.text) - LOAD_OFFSET)
41 { 46 {
42 *(.text.ivt) 47 IVT_TEXT
43 *(.text) 48 *(.text)
44 SCHED_TEXT 49 SCHED_TEXT
45 LOCK_TEXT 50 LOCK_TEXT
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index e3fc4edea113..720a861f88be 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -312,7 +312,7 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus)
312 acpi_walk_resources(device->handle, METHOD_NAME__CRS, add_window, 312 acpi_walk_resources(device->handle, METHOD_NAME__CRS, add_window,
313 &info); 313 &info);
314 314
315 pbus = pci_scan_bus(bus, &pci_root_ops, controller); 315 pbus = pci_scan_bus_parented(NULL, bus, &pci_root_ops, controller);
316 if (pbus) 316 if (pbus)
317 pcibios_setup_root_windows(pbus, controller); 317 pcibios_setup_root_windows(pbus, controller);
318 318
@@ -373,6 +373,25 @@ void pcibios_bus_to_resource(struct pci_dev *dev,
373 res->end = region->end + offset; 373 res->end = region->end + offset;
374} 374}
375 375
376static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
377{
378 unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;
379 struct resource *devr = &dev->resource[idx];
380
381 if (!dev->bus)
382 return 0;
383 for (i=0; i<PCI_BUS_NUM_RESOURCES; i++) {
384 struct resource *busr = dev->bus->resource[i];
385
386 if (!busr || ((busr->flags ^ devr->flags) & type_mask))
387 continue;
388 if ((devr->start) && (devr->start >= busr->start) &&
389 (devr->end <= busr->end))
390 return 1;
391 }
392 return 0;
393}
394
376static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) 395static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
377{ 396{
378 struct pci_bus_region region; 397 struct pci_bus_region region;
@@ -386,7 +405,8 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
386 region.start = dev->resource[i].start; 405 region.start = dev->resource[i].start;
387 region.end = dev->resource[i].end; 406 region.end = dev->resource[i].end;
388 pcibios_bus_to_resource(dev, &dev->resource[i], &region); 407 pcibios_bus_to_resource(dev, &dev->resource[i], &region);
389 pci_claim_resource(dev, i); 408 if ((is_valid_resource(dev, i)))
409 pci_claim_resource(dev, i);
390 } 410 }
391} 411}
392 412
@@ -398,6 +418,10 @@ pcibios_fixup_bus (struct pci_bus *b)
398{ 418{
399 struct pci_dev *dev; 419 struct pci_dev *dev;
400 420
421 if (b->self) {
422 pci_read_bridge_bases(b);
423 pcibios_fixup_device_resources(b->self);
424 }
401 list_for_each_entry(dev, &b->devices, bus_list) 425 list_for_each_entry(dev, &b->devices, bus_list)
402 pcibios_fixup_device_resources(dev); 426 pcibios_fixup_device_resources(dev);
403 427
@@ -418,18 +442,24 @@ pcibios_enable_resources (struct pci_dev *dev, int mask)
418 u16 cmd, old_cmd; 442 u16 cmd, old_cmd;
419 int idx; 443 int idx;
420 struct resource *r; 444 struct resource *r;
445 unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM;
421 446
422 if (!dev) 447 if (!dev)
423 return -EINVAL; 448 return -EINVAL;
424 449
425 pci_read_config_word(dev, PCI_COMMAND, &cmd); 450 pci_read_config_word(dev, PCI_COMMAND, &cmd);
426 old_cmd = cmd; 451 old_cmd = cmd;
427 for (idx=0; idx<6; idx++) { 452 for (idx=0; idx<PCI_NUM_RESOURCES; idx++) {
428 /* Only set up the desired resources. */ 453 /* Only set up the desired resources. */
429 if (!(mask & (1 << idx))) 454 if (!(mask & (1 << idx)))
430 continue; 455 continue;
431 456
432 r = &dev->resource[idx]; 457 r = &dev->resource[idx];
458 if (!(r->flags & type_mask))
459 continue;
460 if ((idx == PCI_ROM_RESOURCE) &&
461 (!(r->flags & IORESOURCE_ROM_ENABLE)))
462 continue;
433 if (!r->start && r->end) { 463 if (!r->start && r->end) {
434 printk(KERN_ERR 464 printk(KERN_ERR
435 "PCI: Device %s not available because of resource collisions\n", 465 "PCI: Device %s not available because of resource collisions\n",
@@ -441,8 +471,6 @@ pcibios_enable_resources (struct pci_dev *dev, int mask)
441 if (r->flags & IORESOURCE_MEM) 471 if (r->flags & IORESOURCE_MEM)
442 cmd |= PCI_COMMAND_MEMORY; 472 cmd |= PCI_COMMAND_MEMORY;
443 } 473 }
444 if (dev->resource[PCI_ROM_RESOURCE].start)
445 cmd |= PCI_COMMAND_MEMORY;
446 if (cmd != old_cmd) { 474 if (cmd != old_cmd) {
447 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd); 475 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd);
448 pci_write_config_word(dev, PCI_COMMAND, cmd); 476 pci_write_config_word(dev, PCI_COMMAND, cmd);
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index 9e07f5463f21..783eb4323847 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -384,7 +384,7 @@ static int __init sn_pci_init(void)
384 extern void register_sn_procfs(void); 384 extern void register_sn_procfs(void);
385#endif 385#endif
386 386
387 if (!ia64_platform_is("sn2") || IS_RUNNING_ON_SIMULATOR()) 387 if (!ia64_platform_is("sn2") || IS_RUNNING_ON_FAKE_PROM())
388 return 0; 388 return 0;
389 389
390 /* 390 /*
diff --git a/arch/ia64/sn/kernel/iomv.c b/arch/ia64/sn/kernel/iomv.c
index fec6d8b8237b..7ce3cdad627b 100644
--- a/arch/ia64/sn/kernel/iomv.c
+++ b/arch/ia64/sn/kernel/iomv.c
@@ -9,12 +9,16 @@
9#include <linux/module.h> 9#include <linux/module.h>
10#include <asm/io.h> 10#include <asm/io.h>
11#include <asm/delay.h> 11#include <asm/delay.h>
12#include <asm/vga.h>
12#include <asm/sn/nodepda.h> 13#include <asm/sn/nodepda.h>
13#include <asm/sn/simulator.h> 14#include <asm/sn/simulator.h>
14#include <asm/sn/pda.h> 15#include <asm/sn/pda.h>
15#include <asm/sn/sn_cpuid.h> 16#include <asm/sn/sn_cpuid.h>
16#include <asm/sn/shub_mmr.h> 17#include <asm/sn/shub_mmr.h>
17 18
19#define IS_LEGACY_VGA_IOPORT(p) \
20 (((p) >= 0x3b0 && (p) <= 0x3bb) || ((p) >= 0x3c0 && (p) <= 0x3df))
21
18/** 22/**
19 * sn_io_addr - convert an in/out port to an i/o address 23 * sn_io_addr - convert an in/out port to an i/o address
20 * @port: port to convert 24 * @port: port to convert
@@ -26,6 +30,8 @@
26void *sn_io_addr(unsigned long port) 30void *sn_io_addr(unsigned long port)
27{ 31{
28 if (!IS_RUNNING_ON_SIMULATOR()) { 32 if (!IS_RUNNING_ON_SIMULATOR()) {
33 if (IS_LEGACY_VGA_IOPORT(port))
34 port += vga_console_iobase;
29 /* On sn2, legacy I/O ports don't point at anything */ 35 /* On sn2, legacy I/O ports don't point at anything */
30 if (port < (64 * 1024)) 36 if (port < (64 * 1024))
31 return NULL; 37 return NULL;
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 44bfc7f318cb..22e10d282c7f 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -36,6 +36,7 @@
36#include <asm/machvec.h> 36#include <asm/machvec.h>
37#include <asm/system.h> 37#include <asm/system.h>
38#include <asm/processor.h> 38#include <asm/processor.h>
39#include <asm/vga.h>
39#include <asm/sn/arch.h> 40#include <asm/sn/arch.h>
40#include <asm/sn/addrs.h> 41#include <asm/sn/addrs.h>
41#include <asm/sn/pda.h> 42#include <asm/sn/pda.h>
@@ -95,6 +96,7 @@ u8 sn_coherency_id;
95EXPORT_SYMBOL(sn_coherency_id); 96EXPORT_SYMBOL(sn_coherency_id);
96u8 sn_region_size; 97u8 sn_region_size;
97EXPORT_SYMBOL(sn_region_size); 98EXPORT_SYMBOL(sn_region_size);
99int sn_prom_type; /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */
98 100
99short physical_node_map[MAX_PHYSNODE_ID]; 101short physical_node_map[MAX_PHYSNODE_ID];
100 102
@@ -273,14 +275,17 @@ void __init sn_setup(char **cmdline_p)
273 275
274 ia64_sn_plat_set_error_handling_features(); 276 ia64_sn_plat_set_error_handling_features();
275 277
278#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
276 /* 279 /*
277 * If the generic code has enabled vga console support - lets 280 * If there was a primary vga adapter identified through the
278 * get rid of it again. This is a kludge for the fact that ACPI 281 * EFI PCDP table, make it the preferred console. Otherwise
279 * currtently has no way of informing us if legacy VGA is available 282 * zero out conswitchp.
280 * or not.
281 */ 283 */
282#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) 284
283 if (conswitchp == &vga_con) { 285 if (vga_console_membase) {
286 /* usable vga ... make tty0 the preferred default console */
287 add_preferred_console("tty", 0, NULL);
288 } else {
284 printk(KERN_DEBUG "SGI: Disabling VGA console\n"); 289 printk(KERN_DEBUG "SGI: Disabling VGA console\n");
285#ifdef CONFIG_DUMMY_CONSOLE 290#ifdef CONFIG_DUMMY_CONSOLE
286 conswitchp = &dummy_con; 291 conswitchp = &dummy_con;
@@ -350,7 +355,7 @@ void __init sn_setup(char **cmdline_p)
350 355
351 ia64_mark_idle = &snidle; 356 ia64_mark_idle = &snidle;
352 357
353 /* 358 /*
354 * For the bootcpu, we do this here. All other cpus will make the 359 * For the bootcpu, we do this here. All other cpus will make the
355 * call as part of cpu_init in slave cpu initialization. 360 * call as part of cpu_init in slave cpu initialization.
356 */ 361 */
@@ -397,7 +402,7 @@ static void __init sn_init_pdas(char **cmdline_p)
397 nodepdaindr[cnode] = 402 nodepdaindr[cnode] =
398 alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t)); 403 alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t));
399 memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); 404 memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
400 memset(nodepdaindr[cnode]->phys_cpuid, -1, 405 memset(nodepdaindr[cnode]->phys_cpuid, -1,
401 sizeof(nodepdaindr[cnode]->phys_cpuid)); 406 sizeof(nodepdaindr[cnode]->phys_cpuid));
402 } 407 }
403 408
@@ -427,7 +432,7 @@ static void __init sn_init_pdas(char **cmdline_p)
427 } 432 }
428 433
429 /* 434 /*
430 * Initialize the per node hubdev. This includes IO Nodes and 435 * Initialize the per node hubdev. This includes IO Nodes and
431 * headless/memless nodes. 436 * headless/memless nodes.
432 */ 437 */
433 for (cnode = 0; cnode < numionodes; cnode++) { 438 for (cnode = 0; cnode < numionodes; cnode++) {
@@ -455,6 +460,14 @@ void __init sn_cpu_init(void)
455 int i; 460 int i;
456 static int wars_have_been_checked; 461 static int wars_have_been_checked;
457 462
463 if (smp_processor_id() == 0 && IS_MEDUSA()) {
464 if (ia64_sn_is_fake_prom())
465 sn_prom_type = 2;
466 else
467 sn_prom_type = 1;
468 printk("Running on medusa with %s PROM\n", (sn_prom_type == 1) ? "real" : "fake");
469 }
470
458 memset(pda, 0, sizeof(pda)); 471 memset(pda, 0, sizeof(pda));
459 if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, &sn_hub_info->nasid_bitmask, &sn_hub_info->nasid_shift, 472 if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, &sn_hub_info->nasid_bitmask, &sn_hub_info->nasid_shift,
460 &sn_system_size, &sn_sharing_domain_size, &sn_partition_id, 473 &sn_system_size, &sn_sharing_domain_size, &sn_partition_id,
@@ -520,7 +533,7 @@ void __init sn_cpu_init(void)
520 */ 533 */
521 { 534 {
522 u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, SH1_PIO_WRITE_STATUS_1, 0}; 535 u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, SH1_PIO_WRITE_STATUS_1, 0};
523 u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1, 536 u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1,
524 SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3}; 537 SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3};
525 u64 *pio; 538 u64 *pio;
526 pio = is_shub1() ? pio1 : pio2; 539 pio = is_shub1() ? pio1 : pio2;
@@ -552,6 +565,10 @@ static void __init scan_for_ionodes(void)
552 int nasid = 0; 565 int nasid = 0;
553 lboard_t *brd; 566 lboard_t *brd;
554 567
568 /* fakeprom does not support klgraph */
569 if (IS_RUNNING_ON_FAKE_PROM())
570 return;
571
555 /* Setup ionodes with memory */ 572 /* Setup ionodes with memory */
556 for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { 573 for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) {
557 char *klgraph_header; 574 char *klgraph_header;
@@ -563,8 +580,6 @@ static void __init scan_for_ionodes(void)
563 cnodeid = -1; 580 cnodeid = -1;
564 klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid)); 581 klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid));
565 if (!klgraph_header) { 582 if (!klgraph_header) {
566 if (IS_RUNNING_ON_SIMULATOR())
567 continue;
568 BUG(); /* All nodes must have klconfig tables! */ 583 BUG(); /* All nodes must have klconfig tables! */
569 } 584 }
570 cnodeid = nasid_to_cnodeid(nasid); 585 cnodeid = nasid_to_cnodeid(nasid);
@@ -630,8 +645,8 @@ int
630nasid_slice_to_cpuid(int nasid, int slice) 645nasid_slice_to_cpuid(int nasid, int slice)
631{ 646{
632 long cpu; 647 long cpu;
633 648
634 for (cpu=0; cpu < NR_CPUS; cpu++) 649 for (cpu=0; cpu < NR_CPUS; cpu++)
635 if (cpuid_to_nasid(cpu) == nasid && 650 if (cpuid_to_nasid(cpu) == nasid &&
636 cpuid_to_slice(cpu) == slice) 651 cpuid_to_slice(cpu) == slice)
637 return cpu; 652 return cpu;
diff --git a/arch/ia64/sn/kernel/sn2/ptc_deadlock.S b/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
index 7947312801ec..96cb71d15682 100644
--- a/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
+++ b/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
@@ -6,6 +6,7 @@
6 * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <asm/types.h>
9#include <asm/sn/shub_mmr.h> 10#include <asm/sn/shub_mmr.h>
10 11
11#define DEADLOCKBIT SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT 12#define DEADLOCKBIT SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index a087b274847e..8716f4d5314b 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -204,8 +204,8 @@ cx_device_register(nasid_t nasid, int part_num, int mfg_num,
204 cx_dev->dev.parent = NULL; 204 cx_dev->dev.parent = NULL;
205 cx_dev->dev.bus = &tiocx_bus_type; 205 cx_dev->dev.bus = &tiocx_bus_type;
206 cx_dev->dev.release = tiocx_bus_release; 206 cx_dev->dev.release = tiocx_bus_release;
207 snprintf(cx_dev->dev.bus_id, BUS_ID_SIZE, "%d.0x%x", 207 snprintf(cx_dev->dev.bus_id, BUS_ID_SIZE, "%d",
208 cx_dev->cx_id.nasid, cx_dev->cx_id.part_num); 208 cx_dev->cx_id.nasid);
209 device_register(&cx_dev->dev); 209 device_register(&cx_dev->dev);
210 get_device(&cx_dev->dev); 210 get_device(&cx_dev->dev);
211 211
@@ -236,7 +236,6 @@ int cx_device_unregister(struct cx_dev *cx_dev)
236 */ 236 */
237static int cx_device_reload(struct cx_dev *cx_dev) 237static int cx_device_reload(struct cx_dev *cx_dev)
238{ 238{
239 device_remove_file(&cx_dev->dev, &dev_attr_cxdev_control);
240 cx_device_unregister(cx_dev); 239 cx_device_unregister(cx_dev);
241 return cx_device_register(cx_dev->cx_id.nasid, cx_dev->cx_id.part_num, 240 return cx_device_register(cx_dev->cx_id.nasid, cx_dev->cx_id.part_num,
242 cx_dev->cx_id.mfg_num, cx_dev->hubdev); 241 cx_dev->cx_id.mfg_num, cx_dev->hubdev);
@@ -383,6 +382,7 @@ static int is_fpga_brick(int nasid)
383 switch (tiocx_btchar_get(nasid)) { 382 switch (tiocx_btchar_get(nasid)) {
384 case L1_BRICKTYPE_SA: 383 case L1_BRICKTYPE_SA:
385 case L1_BRICKTYPE_ATHENA: 384 case L1_BRICKTYPE_ATHENA:
385 case L1_BRICKTYPE_DAYTONA:
386 return 1; 386 return 1;
387 } 387 }
388 return 0; 388 return 0;
@@ -409,7 +409,7 @@ static int tiocx_reload(struct cx_dev *cx_dev)
409 uint64_t cx_id; 409 uint64_t cx_id;
410 410
411 cx_id = 411 cx_id =
412 *(volatile int32_t *)(TIO_SWIN_BASE(nasid, TIOCX_CORELET) + 412 *(volatile uint64_t *)(TIO_SWIN_BASE(nasid, TIOCX_CORELET) +
413 WIDGET_ID); 413 WIDGET_ID);
414 part_num = XWIDGET_PART_NUM(cx_id); 414 part_num = XWIDGET_PART_NUM(cx_id);
415 mfg_num = XWIDGET_MFG_NUM(cx_id); 415 mfg_num = XWIDGET_MFG_NUM(cx_id);
@@ -458,6 +458,10 @@ static ssize_t store_cxdev_control(struct device *dev, struct device_attribute *
458 458
459 switch (n) { 459 switch (n) {
460 case 1: 460 case 1:
461 tio_corelet_reset(cx_dev->cx_id.nasid, TIOCX_CORELET);
462 tiocx_reload(cx_dev);
463 break;
464 case 2:
461 tiocx_reload(cx_dev); 465 tiocx_reload(cx_dev);
462 break; 466 break;
463 case 3: 467 case 3:
@@ -537,7 +541,7 @@ static void __exit tiocx_exit(void)
537 bus_unregister(&tiocx_bus_type); 541 bus_unregister(&tiocx_bus_type);
538} 542}
539 543
540module_init(tiocx_init); 544subsys_initcall(tiocx_init);
541module_exit(tiocx_exit); 545module_exit(tiocx_exit);
542 546
543/************************************************************************ 547/************************************************************************
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 8dae9eb45456..05aa8c2fe9bb 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -336,7 +336,7 @@ tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr)
336 if (!ct_addr) 336 if (!ct_addr)
337 return 0; 337 return 0;
338 338
339 bus_addr = (dma_addr_t) (ct_addr & 0xffffffffffff); 339 bus_addr = (dma_addr_t) (ct_addr & 0xffffffffffffUL);
340 node_upper = ct_addr >> 48; 340 node_upper = ct_addr >> 48;
341 341
342 if (node_upper > 64) { 342 if (node_upper > 64) {
@@ -464,7 +464,7 @@ map_return:
464 * For mappings created using the direct modes (64 or 48) there are no 464 * For mappings created using the direct modes (64 or 48) there are no
465 * resources to release. 465 * resources to release.
466 */ 466 */
467void 467static void
468tioca_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir) 468tioca_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir)
469{ 469{
470 int i, entry; 470 int i, entry;
@@ -514,7 +514,7 @@ tioca_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir)
514 * The mapping mode used is based on the devices dma_mask. As a last resort 514 * The mapping mode used is based on the devices dma_mask. As a last resort
515 * use the GART mapped mode. 515 * use the GART mapped mode.
516 */ 516 */
517uint64_t 517static uint64_t
518tioca_dma_map(struct pci_dev *pdev, uint64_t paddr, size_t byte_count) 518tioca_dma_map(struct pci_dev *pdev, uint64_t paddr, size_t byte_count)
519{ 519{
520 uint64_t mapaddr; 520 uint64_t mapaddr;
@@ -580,7 +580,7 @@ tioca_error_intr_handler(int irq, void *arg, struct pt_regs *pt)
580 * On successful setup, returns the kernel version of tioca_common back to 580 * On successful setup, returns the kernel version of tioca_common back to
581 * the caller. 581 * the caller.
582 */ 582 */
583void * 583static void *
584tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft) 584tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft)
585{ 585{
586 struct tioca_common *tioca_common; 586 struct tioca_common *tioca_common;
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 508026ae5842..65ee15396ffd 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -457,7 +457,7 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs)
457 if (!user_mode(regs)) 457 if (!user_mode(regs))
458 return 1; 458 return 1;
459 459
460 if (try_to_freeze(0)) 460 if (try_to_freeze())
461 goto no_signal; 461 goto no_signal;
462 462
463 if (!oldset) 463 if (!oldset)
diff --git a/arch/parisc/configs/712_defconfig b/arch/parisc/configs/712_defconfig
index 872085dea8a8..6efaa9293eef 100644
--- a/arch/parisc/configs/712_defconfig
+++ b/arch/parisc/configs/712_defconfig
@@ -506,7 +506,7 @@ CONFIG_HW_CONSOLE=y
506# 506#
507CONFIG_SERIAL_8250=y 507CONFIG_SERIAL_8250=y
508CONFIG_SERIAL_8250_CONSOLE=y 508CONFIG_SERIAL_8250_CONSOLE=y
509CONFIG_SERIAL_8250_NR_UARTS=8 509CONFIG_SERIAL_8250_NR_UARTS=17
510CONFIG_SERIAL_8250_EXTENDED=y 510CONFIG_SERIAL_8250_EXTENDED=y
511CONFIG_SERIAL_8250_MANY_PORTS=y 511CONFIG_SERIAL_8250_MANY_PORTS=y
512CONFIG_SERIAL_8250_SHARE_IRQ=y 512CONFIG_SERIAL_8250_SHARE_IRQ=y
diff --git a/arch/parisc/configs/a500_defconfig b/arch/parisc/configs/a500_defconfig
index d28ebfa1070d..30fc03ed0cfb 100644
--- a/arch/parisc/configs/a500_defconfig
+++ b/arch/parisc/configs/a500_defconfig
@@ -662,7 +662,7 @@ CONFIG_HW_CONSOLE=y
662CONFIG_SERIAL_8250=y 662CONFIG_SERIAL_8250=y
663CONFIG_SERIAL_8250_CONSOLE=y 663CONFIG_SERIAL_8250_CONSOLE=y
664CONFIG_SERIAL_8250_CS=m 664CONFIG_SERIAL_8250_CS=m
665CONFIG_SERIAL_8250_NR_UARTS=8 665CONFIG_SERIAL_8250_NR_UARTS=17
666CONFIG_SERIAL_8250_EXTENDED=y 666CONFIG_SERIAL_8250_EXTENDED=y
667CONFIG_SERIAL_8250_MANY_PORTS=y 667CONFIG_SERIAL_8250_MANY_PORTS=y
668CONFIG_SERIAL_8250_SHARE_IRQ=y 668CONFIG_SERIAL_8250_SHARE_IRQ=y
diff --git a/arch/parisc/configs/b180_defconfig b/arch/parisc/configs/b180_defconfig
index 1700d7aec686..46c9511f3229 100644
--- a/arch/parisc/configs/b180_defconfig
+++ b/arch/parisc/configs/b180_defconfig
@@ -514,7 +514,7 @@ CONFIG_HW_CONSOLE=y
514# 514#
515CONFIG_SERIAL_8250=y 515CONFIG_SERIAL_8250=y
516CONFIG_SERIAL_8250_CONSOLE=y 516CONFIG_SERIAL_8250_CONSOLE=y
517CONFIG_SERIAL_8250_NR_UARTS=4 517CONFIG_SERIAL_8250_NR_UARTS=13
518CONFIG_SERIAL_8250_EXTENDED=y 518CONFIG_SERIAL_8250_EXTENDED=y
519CONFIG_SERIAL_8250_MANY_PORTS=y 519CONFIG_SERIAL_8250_MANY_PORTS=y
520CONFIG_SERIAL_8250_SHARE_IRQ=y 520CONFIG_SERIAL_8250_SHARE_IRQ=y
diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig
index b27980161c31..67aca6ccc9b0 100644
--- a/arch/parisc/configs/c3000_defconfig
+++ b/arch/parisc/configs/c3000_defconfig
@@ -661,7 +661,7 @@ CONFIG_HW_CONSOLE=y
661# 661#
662CONFIG_SERIAL_8250=y 662CONFIG_SERIAL_8250=y
663CONFIG_SERIAL_8250_CONSOLE=y 663CONFIG_SERIAL_8250_CONSOLE=y
664CONFIG_SERIAL_8250_NR_UARTS=4 664CONFIG_SERIAL_8250_NR_UARTS=13
665CONFIG_SERIAL_8250_EXTENDED=y 665CONFIG_SERIAL_8250_EXTENDED=y
666CONFIG_SERIAL_8250_MANY_PORTS=y 666CONFIG_SERIAL_8250_MANY_PORTS=y
667CONFIG_SERIAL_8250_SHARE_IRQ=y 667CONFIG_SERIAL_8250_SHARE_IRQ=y
diff --git a/arch/parisc/defconfig b/arch/parisc/defconfig
index ebd6301aa599..fdae21c503d7 100644
--- a/arch/parisc/defconfig
+++ b/arch/parisc/defconfig
@@ -517,7 +517,7 @@ CONFIG_HW_CONSOLE=y
517# 517#
518CONFIG_SERIAL_8250=y 518CONFIG_SERIAL_8250=y
519CONFIG_SERIAL_8250_CONSOLE=y 519CONFIG_SERIAL_8250_CONSOLE=y
520CONFIG_SERIAL_8250_NR_UARTS=4 520CONFIG_SERIAL_8250_NR_UARTS=13
521CONFIG_SERIAL_8250_EXTENDED=y 521CONFIG_SERIAL_8250_EXTENDED=y
522CONFIG_SERIAL_8250_MANY_PORTS=y 522CONFIG_SERIAL_8250_MANY_PORTS=y
523CONFIG_SERIAL_8250_SHARE_IRQ=y 523CONFIG_SERIAL_8250_SHARE_IRQ=y
diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c
index 4ea7158e5062..ece6a9fbe09b 100644
--- a/arch/ppc/8xx_io/enet.c
+++ b/arch/ppc/8xx_io/enet.c
@@ -714,16 +714,24 @@ static int __init scc_enet_init(void)
714 immap->im_ioport.iop_pcdat &= ~PC_ENET_LBK; /* Disable Loopback */ 714 immap->im_ioport.iop_pcdat &= ~PC_ENET_LBK; /* Disable Loopback */
715#endif /* PC_ENET_LBK */ 715#endif /* PC_ENET_LBK */
716 716
717 /* Configure port C pins to enable CLSN and RENA. 717#ifdef PE_ENET_TCLK
718 /* Configure port E for TCLK and RCLK.
718 */ 719 */
719 immap->im_ioport.iop_pcpar &= ~(PC_ENET_CLSN | PC_ENET_RENA); 720 cp->cp_pepar |= (PE_ENET_TCLK | PE_ENET_RCLK);
720 immap->im_ioport.iop_pcdir &= ~(PC_ENET_CLSN | PC_ENET_RENA); 721 cp->cp_pedir &= ~(PE_ENET_TCLK | PE_ENET_RCLK);
721 immap->im_ioport.iop_pcso |= (PC_ENET_CLSN | PC_ENET_RENA); 722 cp->cp_peso &= ~(PE_ENET_TCLK | PE_ENET_RCLK);
722 723#else
723 /* Configure port A for TCLK and RCLK. 724 /* Configure port A for TCLK and RCLK.
724 */ 725 */
725 immap->im_ioport.iop_papar |= (PA_ENET_TCLK | PA_ENET_RCLK); 726 immap->im_ioport.iop_papar |= (PA_ENET_TCLK | PA_ENET_RCLK);
726 immap->im_ioport.iop_padir &= ~(PA_ENET_TCLK | PA_ENET_RCLK); 727 immap->im_ioport.iop_padir &= ~(PA_ENET_TCLK | PA_ENET_RCLK);
728#endif
729
730 /* Configure port C pins to enable CLSN and RENA.
731 */
732 immap->im_ioport.iop_pcpar &= ~(PC_ENET_CLSN | PC_ENET_RENA);
733 immap->im_ioport.iop_pcdir &= ~(PC_ENET_CLSN | PC_ENET_RENA);
734 immap->im_ioport.iop_pcso |= (PC_ENET_CLSN | PC_ENET_RENA);
727 735
728 /* Configure Serial Interface clock routing. 736 /* Configure Serial Interface clock routing.
729 * First, clear all SCC bits to zero, then set the ones we want. 737 * First, clear all SCC bits to zero, then set the ones we want.
@@ -896,14 +904,18 @@ static int __init scc_enet_init(void)
896 /* It is now OK to enable the Ethernet transmitter. 904 /* It is now OK to enable the Ethernet transmitter.
897 * Unfortunately, there are board implementation differences here. 905 * Unfortunately, there are board implementation differences here.
898 */ 906 */
899#if (!defined (PB_ENET_TENA) && defined (PC_ENET_TENA)) 907#if (!defined (PB_ENET_TENA) && defined (PC_ENET_TENA) && !defined (PE_ENET_TENA))
900 immap->im_ioport.iop_pcpar |= PC_ENET_TENA; 908 immap->im_ioport.iop_pcpar |= PC_ENET_TENA;
901 immap->im_ioport.iop_pcdir &= ~PC_ENET_TENA; 909 immap->im_ioport.iop_pcdir &= ~PC_ENET_TENA;
902#elif ( defined (PB_ENET_TENA) && !defined (PC_ENET_TENA)) 910#elif ( defined (PB_ENET_TENA) && !defined (PC_ENET_TENA) && !defined (PE_ENET_TENA))
903 cp->cp_pbpar |= PB_ENET_TENA; 911 cp->cp_pbpar |= PB_ENET_TENA;
904 cp->cp_pbdir |= PB_ENET_TENA; 912 cp->cp_pbdir |= PB_ENET_TENA;
913#elif ( !defined (PB_ENET_TENA) && !defined (PC_ENET_TENA) && defined (PE_ENET_TENA))
914 cp->cp_pepar |= PE_ENET_TENA;
915 cp->cp_pedir &= ~PE_ENET_TENA;
916 cp->cp_peso |= PE_ENET_TENA;
905#else 917#else
906#error Configuration Error: define exactly ONE of PB_ENET_TENA, PC_ENET_TENA 918#error Configuration Error: define exactly ONE of PB_ENET_TENA, PC_ENET_TENA, PE_ENET_TENA
907#endif 919#endif
908 920
909#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) 921#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC)
@@ -936,6 +948,29 @@ static int __init scc_enet_init(void)
936 *((volatile uint *)BCSR1) &= ~BCSR1_ETHEN; 948 *((volatile uint *)BCSR1) &= ~BCSR1_ETHEN;
937#endif 949#endif
938 950
951#ifdef CONFIG_MPC885ADS
952
953 /* Deassert PHY reset and enable the PHY.
954 */
955 {
956 volatile uint __iomem *bcsr = ioremap(BCSR_ADDR, BCSR_SIZE);
957 uint tmp;
958
959 tmp = in_be32(bcsr + 1 /* BCSR1 */);
960 tmp |= BCSR1_ETHEN;
961 out_be32(bcsr + 1, tmp);
962 tmp = in_be32(bcsr + 4 /* BCSR4 */);
963 tmp |= BCSR4_ETH10_RST;
964 out_be32(bcsr + 4, tmp);
965 iounmap(bcsr);
966 }
967
968 /* On MPC885ADS SCC ethernet PHY defaults to the full duplex mode
969 * upon reset. SCC is set to half duplex by default. So this
970 * inconsistency should be better fixed by the software.
971 */
972#endif
973
939 dev->base_addr = (unsigned long)ep; 974 dev->base_addr = (unsigned long)ep;
940#if 0 975#if 0
941 dev->name = "CPM_ENET"; 976 dev->name = "CPM_ENET";
@@ -969,3 +1004,4 @@ static int __init scc_enet_init(void)
969} 1004}
970 1005
971module_init(scc_enet_init); 1006module_init(scc_enet_init);
1007
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index a7835cd3f51f..23b0d2f662c5 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -284,6 +284,9 @@ endmenu
284 284
285menu "Platform options" 285menu "Platform options"
286 286
287config FADS
288 bool
289
287choice 290choice
288 prompt "8xx Machine Type" 291 prompt "8xx Machine Type"
289 depends on 8xx 292 depends on 8xx
@@ -399,8 +402,25 @@ config BSEIP
399 26MB DRAM, 4MB flash, Ethernet, a 16K-gate FPGA, USB, an LCD/video 402 26MB DRAM, 4MB flash, Ethernet, a 16K-gate FPGA, USB, an LCD/video
400 controller, and two RS232 ports. 403 controller, and two RS232 ports.
401 404
402config FADS 405config MPC8XXFADS
403 bool "FADS" 406 bool "FADS"
407 select FADS
408
409config MPC86XADS
410 bool "MPC86XADS"
411 help
412 MPC86x Application Development System by Freescale Semiconductor.
413 The MPC86xADS is meant to serve as a platform for s/w and h/w
414 development around the MPC86X processor families.
415 select FADS
416
417config MPC885ADS
418 bool "MPC885ADS"
419 help
420 Freescale Semiconductor MPC885 Application Development System (ADS).
421 Also known as DUET.
422 The MPC885ADS is meant to serve as a platform for s/w and h/w
423 development around the MPC885 processor family.
404 424
405config TQM823L 425config TQM823L
406 bool "TQM823L" 426 bool "TQM823L"
diff --git a/arch/ppc/configs/mpc86x_ads_defconfig b/arch/ppc/configs/mpc86x_ads_defconfig
new file mode 100644
index 000000000000..f63c6f59d68a
--- /dev/null
+++ b/arch/ppc/configs/mpc86x_ads_defconfig
@@ -0,0 +1,633 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc4
4# Tue Jun 14 13:36:35 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
20# CONFIG_CLEAN_COMPILE is not set
21CONFIG_BROKEN=y
22CONFIG_BROKEN_ON_SMP=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
24
25#
26# General setup
27#
28CONFIG_LOCALVERSION=""
29# CONFIG_SWAP is not set
30CONFIG_SYSVIPC=y
31# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set
33CONFIG_SYSCTL=y
34# CONFIG_AUDIT is not set
35# CONFIG_HOTPLUG is not set
36CONFIG_KOBJECT_UEVENT=y
37# CONFIG_IKCONFIG is not set
38CONFIG_EMBEDDED=y
39# CONFIG_KALLSYMS is not set
40CONFIG_PRINTK=y
41CONFIG_BUG=y
42# CONFIG_BASE_FULL is not set
43CONFIG_FUTEX=y
44# CONFIG_EPOLL is not set
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46# CONFIG_SHMEM is not set
47CONFIG_CC_ALIGN_FUNCTIONS=0
48CONFIG_CC_ALIGN_LABELS=0
49CONFIG_CC_ALIGN_LOOPS=0
50CONFIG_CC_ALIGN_JUMPS=0
51CONFIG_TINY_SHMEM=y
52CONFIG_BASE_SMALL=1
53
54#
55# Loadable module support
56#
57CONFIG_MODULES=y
58# CONFIG_MODULE_UNLOAD is not set
59CONFIG_OBSOLETE_MODPARM=y
60# CONFIG_MODVERSIONS is not set
61# CONFIG_MODULE_SRCVERSION_ALL is not set
62# CONFIG_KMOD is not set
63
64#
65# Processor
66#
67# CONFIG_6xx is not set
68# CONFIG_40x is not set
69# CONFIG_44x is not set
70# CONFIG_POWER3 is not set
71# CONFIG_POWER4 is not set
72CONFIG_8xx=y
73# CONFIG_E500 is not set
74# CONFIG_MATH_EMULATION is not set
75# CONFIG_CPU_FREQ is not set
76CONFIG_EMBEDDEDBOOT=y
77# CONFIG_PM is not set
78CONFIG_NOT_COHERENT_CACHE=y
79
80#
81# Platform options
82#
83CONFIG_FADS=y
84# CONFIG_RPXLITE is not set
85# CONFIG_RPXCLASSIC is not set
86# CONFIG_BSEIP is not set
87# CONFIG_MPC8XXFADS is not set
88CONFIG_MPC86XADS=y
89# CONFIG_TQM823L is not set
90# CONFIG_TQM850L is not set
91# CONFIG_TQM855L is not set
92# CONFIG_TQM860L is not set
93# CONFIG_FPS850L is not set
94# CONFIG_SPD823TS is not set
95# CONFIG_IVMS8 is not set
96# CONFIG_IVML24 is not set
97# CONFIG_SM850 is not set
98# CONFIG_HERMES_PRO is not set
99# CONFIG_IP860 is not set
100# CONFIG_LWMON is not set
101# CONFIG_PCU_E is not set
102# CONFIG_CCM is not set
103# CONFIG_LANTEC is not set
104# CONFIG_MBX is not set
105# CONFIG_WINCEPT is not set
106# CONFIG_SMP is not set
107# CONFIG_PREEMPT is not set
108# CONFIG_HIGHMEM is not set
109CONFIG_BINFMT_ELF=y
110# CONFIG_BINFMT_MISC is not set
111# CONFIG_CMDLINE_BOOL is not set
112CONFIG_ISA_DMA_API=y
113
114#
115# Bus options
116#
117# CONFIG_PCI is not set
118# CONFIG_PCI_DOMAINS is not set
119# CONFIG_PCI_QSPAN is not set
120
121#
122# PCCARD (PCMCIA/CardBus) support
123#
124# CONFIG_PCCARD is not set
125
126#
127# Advanced setup
128#
129# CONFIG_ADVANCED_OPTIONS is not set
130
131#
132# Default settings for advanced configuration options are used
133#
134CONFIG_HIGHMEM_START=0xfe000000
135CONFIG_LOWMEM_SIZE=0x30000000
136CONFIG_KERNEL_START=0xc0000000
137CONFIG_TASK_SIZE=0x80000000
138CONFIG_CONSISTENT_START=0xff100000
139CONFIG_CONSISTENT_SIZE=0x00200000
140CONFIG_BOOT_LOAD=0x00400000
141
142#
143# Device Drivers
144#
145
146#
147# Generic Driver Options
148#
149# CONFIG_STANDALONE is not set
150CONFIG_PREVENT_FIRMWARE_BUILD=y
151# CONFIG_FW_LOADER is not set
152
153#
154# Memory Technology Devices (MTD)
155#
156# CONFIG_MTD is not set
157
158#
159# Parallel port support
160#
161# CONFIG_PARPORT is not set
162
163#
164# Plug and Play support
165#
166
167#
168# Block devices
169#
170# CONFIG_BLK_DEV_FD is not set
171# CONFIG_BLK_DEV_COW_COMMON is not set
172CONFIG_BLK_DEV_LOOP=y
173# CONFIG_BLK_DEV_CRYPTOLOOP is not set
174# CONFIG_BLK_DEV_NBD is not set
175# CONFIG_BLK_DEV_RAM is not set
176CONFIG_BLK_DEV_RAM_COUNT=16
177CONFIG_INITRAMFS_SOURCE=""
178# CONFIG_LBD is not set
179# CONFIG_CDROM_PKTCDVD is not set
180
181#
182# IO Schedulers
183#
184CONFIG_IOSCHED_NOOP=y
185CONFIG_IOSCHED_AS=y
186CONFIG_IOSCHED_DEADLINE=y
187CONFIG_IOSCHED_CFQ=y
188# CONFIG_ATA_OVER_ETH is not set
189
190#
191# ATA/ATAPI/MFM/RLL support
192#
193# CONFIG_IDE is not set
194
195#
196# SCSI device support
197#
198# CONFIG_SCSI is not set
199
200#
201# Multi-device support (RAID and LVM)
202#
203# CONFIG_MD is not set
204
205#
206# Fusion MPT device support
207#
208
209#
210# IEEE 1394 (FireWire) support
211#
212# CONFIG_IEEE1394 is not set
213
214#
215# I2O device support
216#
217
218#
219# Macintosh device drivers
220#
221
222#
223# Networking support
224#
225CONFIG_NET=y
226
227#
228# Networking options
229#
230CONFIG_PACKET=y
231# CONFIG_PACKET_MMAP is not set
232CONFIG_UNIX=y
233# CONFIG_NET_KEY is not set
234CONFIG_INET=y
235# CONFIG_IP_MULTICAST is not set
236# CONFIG_IP_ADVANCED_ROUTER is not set
237CONFIG_IP_PNP=y
238CONFIG_IP_PNP_DHCP=y
239# CONFIG_IP_PNP_BOOTP is not set
240# CONFIG_IP_PNP_RARP is not set
241# CONFIG_NET_IPIP is not set
242# CONFIG_NET_IPGRE is not set
243# CONFIG_ARPD is not set
244# CONFIG_SYN_COOKIES is not set
245# CONFIG_INET_AH is not set
246# CONFIG_INET_ESP is not set
247# CONFIG_INET_IPCOMP is not set
248# CONFIG_INET_TUNNEL is not set
249CONFIG_IP_TCPDIAG=y
250# CONFIG_IP_TCPDIAG_IPV6 is not set
251CONFIG_IPV6=m
252# CONFIG_IPV6_PRIVACY is not set
253# CONFIG_INET6_AH is not set
254# CONFIG_INET6_ESP is not set
255# CONFIG_INET6_IPCOMP is not set
256# CONFIG_INET6_TUNNEL is not set
257# CONFIG_IPV6_TUNNEL is not set
258# CONFIG_NETFILTER is not set
259
260#
261# SCTP Configuration (EXPERIMENTAL)
262#
263# CONFIG_IP_SCTP is not set
264# CONFIG_ATM is not set
265# CONFIG_BRIDGE is not set
266# CONFIG_VLAN_8021Q is not set
267# CONFIG_DECNET is not set
268# CONFIG_LLC2 is not set
269# CONFIG_IPX is not set
270# CONFIG_ATALK is not set
271# CONFIG_X25 is not set
272# CONFIG_LAPB is not set
273# CONFIG_NET_DIVERT is not set
274# CONFIG_ECONET is not set
275# CONFIG_WAN_ROUTER is not set
276
277#
278# QoS and/or fair queueing
279#
280# CONFIG_NET_SCHED is not set
281# CONFIG_NET_CLS_ROUTE is not set
282
283#
284# Network testing
285#
286# CONFIG_NET_PKTGEN is not set
287# CONFIG_NETPOLL is not set
288# CONFIG_NET_POLL_CONTROLLER is not set
289# CONFIG_HAMRADIO is not set
290# CONFIG_IRDA is not set
291# CONFIG_BT is not set
292CONFIG_NETDEVICES=y
293# CONFIG_DUMMY is not set
294# CONFIG_BONDING is not set
295# CONFIG_EQUALIZER is not set
296# CONFIG_TUN is not set
297
298#
299# Ethernet (10 or 100Mbit)
300#
301CONFIG_NET_ETHERNET=y
302# CONFIG_MII is not set
303# CONFIG_OAKNET is not set
304
305#
306# Ethernet (1000 Mbit)
307#
308
309#
310# Ethernet (10000 Mbit)
311#
312
313#
314# Token Ring devices
315#
316
317#
318# Wireless LAN (non-hamradio)
319#
320# CONFIG_NET_RADIO is not set
321
322#
323# Wan interfaces
324#
325# CONFIG_WAN is not set
326# CONFIG_PPP is not set
327# CONFIG_SLIP is not set
328# CONFIG_SHAPER is not set
329# CONFIG_NETCONSOLE is not set
330
331#
332# ISDN subsystem
333#
334# CONFIG_ISDN is not set
335
336#
337# Telephony Support
338#
339# CONFIG_PHONE is not set
340
341#
342# Input device support
343#
344# CONFIG_INPUT is not set
345
346#
347# Hardware I/O ports
348#
349# CONFIG_SERIO is not set
350# CONFIG_GAMEPORT is not set
351CONFIG_SOUND_GAMEPORT=y
352
353#
354# Character devices
355#
356# CONFIG_VT is not set
357# CONFIG_SERIAL_NONSTANDARD is not set
358
359#
360# Serial drivers
361#
362# CONFIG_SERIAL_8250 is not set
363
364#
365# Non-8250 serial port support
366#
367CONFIG_SERIAL_CORE=y
368CONFIG_SERIAL_CORE_CONSOLE=y
369CONFIG_SERIAL_CPM=y
370CONFIG_SERIAL_CPM_CONSOLE=y
371# CONFIG_SERIAL_CPM_SCC1 is not set
372# CONFIG_SERIAL_CPM_SCC2 is not set
373# CONFIG_SERIAL_CPM_SCC3 is not set
374# CONFIG_SERIAL_CPM_SCC4 is not set
375CONFIG_SERIAL_CPM_SMC1=y
376# CONFIG_SERIAL_CPM_SMC2 is not set
377CONFIG_UNIX98_PTYS=y
378# CONFIG_LEGACY_PTYS is not set
379
380#
381# IPMI
382#
383# CONFIG_IPMI_HANDLER is not set
384
385#
386# Watchdog Cards
387#
388# CONFIG_WATCHDOG is not set
389# CONFIG_NVRAM is not set
390# CONFIG_GEN_RTC is not set
391# CONFIG_DTLK is not set
392# CONFIG_R3964 is not set
393
394#
395# Ftape, the floppy tape device driver
396#
397# CONFIG_AGP is not set
398# CONFIG_DRM is not set
399# CONFIG_RAW_DRIVER is not set
400
401#
402# TPM devices
403#
404
405#
406# I2C support
407#
408# CONFIG_I2C is not set
409
410#
411# Dallas's 1-wire bus
412#
413# CONFIG_W1 is not set
414
415#
416# Misc devices
417#
418
419#
420# Multimedia devices
421#
422# CONFIG_VIDEO_DEV is not set
423
424#
425# Digital Video Broadcasting Devices
426#
427# CONFIG_DVB is not set
428
429#
430# Graphics support
431#
432# CONFIG_FB is not set
433
434#
435# Sound
436#
437# CONFIG_SOUND is not set
438
439#
440# USB support
441#
442# CONFIG_USB_ARCH_HAS_HCD is not set
443# CONFIG_USB_ARCH_HAS_OHCI is not set
444
445#
446# USB Gadget Support
447#
448# CONFIG_USB_GADGET is not set
449
450#
451# MMC/SD Card support
452#
453# CONFIG_MMC is not set
454
455#
456# InfiniBand support
457#
458# CONFIG_INFINIBAND is not set
459
460#
461# File systems
462#
463# CONFIG_EXT2_FS is not set
464CONFIG_EXT3_FS=y
465# CONFIG_EXT3_FS_XATTR is not set
466CONFIG_JBD=y
467# CONFIG_JBD_DEBUG is not set
468# CONFIG_REISERFS_FS is not set
469# CONFIG_JFS_FS is not set
470
471#
472# XFS support
473#
474# CONFIG_XFS_FS is not set
475# CONFIG_MINIX_FS is not set
476# CONFIG_ROMFS_FS is not set
477# CONFIG_QUOTA is not set
478# CONFIG_DNOTIFY is not set
479# CONFIG_AUTOFS_FS is not set
480# CONFIG_AUTOFS4_FS is not set
481
482#
483# CD-ROM/DVD Filesystems
484#
485# CONFIG_ISO9660_FS is not set
486# CONFIG_UDF_FS is not set
487
488#
489# DOS/FAT/NT Filesystems
490#
491# CONFIG_MSDOS_FS is not set
492# CONFIG_VFAT_FS is not set
493# CONFIG_NTFS_FS is not set
494
495#
496# Pseudo filesystems
497#
498CONFIG_PROC_FS=y
499CONFIG_PROC_KCORE=y
500CONFIG_SYSFS=y
501# CONFIG_DEVFS_FS is not set
502# CONFIG_DEVPTS_FS_XATTR is not set
503# CONFIG_TMPFS is not set
504# CONFIG_HUGETLBFS is not set
505# CONFIG_HUGETLB_PAGE is not set
506CONFIG_RAMFS=y
507
508#
509# Miscellaneous filesystems
510#
511# CONFIG_ADFS_FS is not set
512# CONFIG_AFFS_FS is not set
513# CONFIG_HFS_FS is not set
514# CONFIG_HFSPLUS_FS is not set
515# CONFIG_BEFS_FS is not set
516# CONFIG_BFS_FS is not set
517# CONFIG_EFS_FS is not set
518# CONFIG_CRAMFS is not set
519# CONFIG_VXFS_FS is not set
520# CONFIG_HPFS_FS is not set
521# CONFIG_QNX4FS_FS is not set
522# CONFIG_SYSV_FS is not set
523# CONFIG_UFS_FS is not set
524
525#
526# Network File Systems
527#
528CONFIG_NFS_FS=y
529CONFIG_NFS_V3=y
530CONFIG_NFS_V4=y
531# CONFIG_NFS_DIRECTIO is not set
532# CONFIG_NFSD is not set
533CONFIG_ROOT_NFS=y
534CONFIG_LOCKD=y
535CONFIG_LOCKD_V4=y
536CONFIG_SUNRPC=y
537CONFIG_SUNRPC_GSS=y
538CONFIG_RPCSEC_GSS_KRB5=y
539# CONFIG_RPCSEC_GSS_SPKM3 is not set
540# CONFIG_SMB_FS is not set
541# CONFIG_CIFS is not set
542# CONFIG_NCP_FS is not set
543# CONFIG_CODA_FS is not set
544# CONFIG_AFS_FS is not set
545
546#
547# Partition Types
548#
549# CONFIG_PARTITION_ADVANCED is not set
550CONFIG_MSDOS_PARTITION=y
551
552#
553# Native Language Support
554#
555# CONFIG_NLS is not set
556
557#
558# MPC8xx CPM Options
559#
560CONFIG_SCC_ENET=y
561CONFIG_SCC1_ENET=y
562# CONFIG_SCC2_ENET is not set
563# CONFIG_SCC3_ENET is not set
564# CONFIG_FEC_ENET is not set
565# CONFIG_ENET_BIG_BUFFERS is not set
566
567#
568# Generic MPC8xx Options
569#
570# CONFIG_8xx_COPYBACK is not set
571# CONFIG_8xx_CPU6 is not set
572CONFIG_NO_UCODE_PATCH=y
573# CONFIG_USB_SOF_UCODE_PATCH is not set
574# CONFIG_I2C_SPI_UCODE_PATCH is not set
575# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
576
577#
578# Library routines
579#
580# CONFIG_CRC_CCITT is not set
581# CONFIG_CRC32 is not set
582# CONFIG_LIBCRC32C is not set
583
584#
585# Profiling support
586#
587# CONFIG_PROFILING is not set
588
589#
590# Kernel hacking
591#
592# CONFIG_PRINTK_TIME is not set
593# CONFIG_DEBUG_KERNEL is not set
594CONFIG_LOG_BUF_SHIFT=14
595
596#
597# Security options
598#
599# CONFIG_KEYS is not set
600# CONFIG_SECURITY is not set
601
602#
603# Cryptographic options
604#
605CONFIG_CRYPTO=y
606# CONFIG_CRYPTO_HMAC is not set
607# CONFIG_CRYPTO_NULL is not set
608# CONFIG_CRYPTO_MD4 is not set
609CONFIG_CRYPTO_MD5=y
610# CONFIG_CRYPTO_SHA1 is not set
611# CONFIG_CRYPTO_SHA256 is not set
612# CONFIG_CRYPTO_SHA512 is not set
613# CONFIG_CRYPTO_WP512 is not set
614# CONFIG_CRYPTO_TGR192 is not set
615CONFIG_CRYPTO_DES=y
616# CONFIG_CRYPTO_BLOWFISH is not set
617# CONFIG_CRYPTO_TWOFISH is not set
618# CONFIG_CRYPTO_SERPENT is not set
619# CONFIG_CRYPTO_AES is not set
620# CONFIG_CRYPTO_CAST5 is not set
621# CONFIG_CRYPTO_CAST6 is not set
622# CONFIG_CRYPTO_TEA is not set
623# CONFIG_CRYPTO_ARC4 is not set
624# CONFIG_CRYPTO_KHAZAD is not set
625# CONFIG_CRYPTO_ANUBIS is not set
626# CONFIG_CRYPTO_DEFLATE is not set
627# CONFIG_CRYPTO_MICHAEL_MIC is not set
628# CONFIG_CRYPTO_CRC32C is not set
629# CONFIG_CRYPTO_TEST is not set
630
631#
632# Hardware crypto devices
633#
diff --git a/arch/ppc/configs/mpc885ads_defconfig b/arch/ppc/configs/mpc885ads_defconfig
new file mode 100644
index 000000000000..016f94d9325f
--- /dev/null
+++ b/arch/ppc/configs/mpc885ads_defconfig
@@ -0,0 +1,622 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc6
4# Thu Jun 9 21:17:29 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
20# CONFIG_CLEAN_COMPILE is not set
21CONFIG_BROKEN=y
22CONFIG_BROKEN_ON_SMP=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
24
25#
26# General setup
27#
28CONFIG_LOCALVERSION=""
29# CONFIG_SWAP is not set
30CONFIG_SYSVIPC=y
31# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set
33CONFIG_SYSCTL=y
34# CONFIG_AUDIT is not set
35CONFIG_HOTPLUG=y
36CONFIG_KOBJECT_UEVENT=y
37# CONFIG_IKCONFIG is not set
38CONFIG_EMBEDDED=y
39# CONFIG_KALLSYMS is not set
40CONFIG_PRINTK=y
41CONFIG_BUG=y
42CONFIG_BASE_FULL=y
43CONFIG_FUTEX=y
44# CONFIG_EPOLL is not set
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SHMEM=y
47CONFIG_CC_ALIGN_FUNCTIONS=0
48CONFIG_CC_ALIGN_LABELS=0
49CONFIG_CC_ALIGN_LOOPS=0
50CONFIG_CC_ALIGN_JUMPS=0
51# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0
53
54#
55# Loadable module support
56#
57# CONFIG_MODULES is not set
58
59#
60# Processor
61#
62# CONFIG_6xx is not set
63# CONFIG_40x is not set
64# CONFIG_44x is not set
65# CONFIG_POWER3 is not set
66# CONFIG_POWER4 is not set
67CONFIG_8xx=y
68# CONFIG_E500 is not set
69# CONFIG_MATH_EMULATION is not set
70# CONFIG_CPU_FREQ is not set
71CONFIG_EMBEDDEDBOOT=y
72# CONFIG_PM is not set
73CONFIG_NOT_COHERENT_CACHE=y
74
75#
76# Platform options
77#
78# CONFIG_RPXLITE is not set
79# CONFIG_RPXCLASSIC is not set
80# CONFIG_BSEIP is not set
81# CONFIG_FADS is not set
82CONFIG_MPC885ADS=y
83# CONFIG_TQM823L is not set
84# CONFIG_TQM850L is not set
85# CONFIG_TQM855L is not set
86# CONFIG_TQM860L is not set
87# CONFIG_FPS850L is not set
88# CONFIG_SPD823TS is not set
89# CONFIG_IVMS8 is not set
90# CONFIG_IVML24 is not set
91# CONFIG_SM850 is not set
92# CONFIG_HERMES_PRO is not set
93# CONFIG_IP860 is not set
94# CONFIG_LWMON is not set
95# CONFIG_PCU_E is not set
96# CONFIG_CCM is not set
97# CONFIG_LANTEC is not set
98# CONFIG_MBX is not set
99# CONFIG_WINCEPT is not set
100# CONFIG_SMP is not set
101# CONFIG_PREEMPT is not set
102# CONFIG_HIGHMEM is not set
103CONFIG_BINFMT_ELF=y
104# CONFIG_BINFMT_MISC is not set
105# CONFIG_CMDLINE_BOOL is not set
106CONFIG_ISA_DMA_API=y
107
108#
109# Bus options
110#
111# CONFIG_PCI is not set
112# CONFIG_PCI_DOMAINS is not set
113# CONFIG_PCI_QSPAN is not set
114
115#
116# PCCARD (PCMCIA/CardBus) support
117#
118# CONFIG_PCCARD is not set
119
120#
121# Advanced setup
122#
123# CONFIG_ADVANCED_OPTIONS is not set
124
125#
126# Default settings for advanced configuration options are used
127#
128CONFIG_HIGHMEM_START=0xfe000000
129CONFIG_LOWMEM_SIZE=0x30000000
130CONFIG_KERNEL_START=0xc0000000
131CONFIG_TASK_SIZE=0x80000000
132CONFIG_CONSISTENT_START=0xff100000
133CONFIG_CONSISTENT_SIZE=0x00200000
134CONFIG_BOOT_LOAD=0x00400000
135
136#
137# Device Drivers
138#
139
140#
141# Generic Driver Options
142#
143CONFIG_STANDALONE=y
144CONFIG_PREVENT_FIRMWARE_BUILD=y
145# CONFIG_FW_LOADER is not set
146
147#
148# Memory Technology Devices (MTD)
149#
150# CONFIG_MTD is not set
151
152#
153# Parallel port support
154#
155# CONFIG_PARPORT is not set
156
157#
158# Plug and Play support
159#
160
161#
162# Block devices
163#
164# CONFIG_BLK_DEV_FD is not set
165# CONFIG_BLK_DEV_COW_COMMON is not set
166# CONFIG_BLK_DEV_LOOP is not set
167# CONFIG_BLK_DEV_NBD is not set
168# CONFIG_BLK_DEV_RAM is not set
169CONFIG_BLK_DEV_RAM_COUNT=16
170CONFIG_INITRAMFS_SOURCE=""
171# CONFIG_LBD is not set
172# CONFIG_CDROM_PKTCDVD is not set
173
174#
175# IO Schedulers
176#
177CONFIG_IOSCHED_NOOP=y
178# CONFIG_IOSCHED_AS is not set
179# CONFIG_IOSCHED_DEADLINE is not set
180# CONFIG_IOSCHED_CFQ is not set
181# CONFIG_ATA_OVER_ETH is not set
182
183#
184# ATA/ATAPI/MFM/RLL support
185#
186# CONFIG_IDE is not set
187
188#
189# SCSI device support
190#
191# CONFIG_SCSI is not set
192
193#
194# Multi-device support (RAID and LVM)
195#
196# CONFIG_MD is not set
197
198#
199# Fusion MPT device support
200#
201
202#
203# IEEE 1394 (FireWire) support
204#
205# CONFIG_IEEE1394 is not set
206
207#
208# I2O device support
209#
210
211#
212# Macintosh device drivers
213#
214
215#
216# Networking support
217#
218CONFIG_NET=y
219
220#
221# Networking options
222#
223CONFIG_PACKET=y
224# CONFIG_PACKET_MMAP is not set
225CONFIG_UNIX=y
226# CONFIG_NET_KEY is not set
227CONFIG_INET=y
228# CONFIG_IP_MULTICAST is not set
229# CONFIG_IP_ADVANCED_ROUTER is not set
230CONFIG_IP_PNP=y
231CONFIG_IP_PNP_DHCP=y
232CONFIG_IP_PNP_BOOTP=y
233# CONFIG_IP_PNP_RARP is not set
234# CONFIG_NET_IPIP is not set
235# CONFIG_NET_IPGRE is not set
236# CONFIG_ARPD is not set
237# CONFIG_SYN_COOKIES is not set
238# CONFIG_INET_AH is not set
239# CONFIG_INET_ESP is not set
240# CONFIG_INET_IPCOMP is not set
241# CONFIG_INET_TUNNEL is not set
242CONFIG_IP_TCPDIAG=y
243# CONFIG_IP_TCPDIAG_IPV6 is not set
244# CONFIG_IPV6 is not set
245# CONFIG_NETFILTER is not set
246
247#
248# SCTP Configuration (EXPERIMENTAL)
249#
250# CONFIG_IP_SCTP is not set
251# CONFIG_ATM is not set
252# CONFIG_BRIDGE is not set
253# CONFIG_VLAN_8021Q is not set
254# CONFIG_DECNET is not set
255# CONFIG_LLC2 is not set
256# CONFIG_IPX is not set
257# CONFIG_ATALK is not set
258# CONFIG_X25 is not set
259# CONFIG_LAPB is not set
260# CONFIG_NET_DIVERT is not set
261# CONFIG_ECONET is not set
262# CONFIG_WAN_ROUTER is not set
263
264#
265# QoS and/or fair queueing
266#
267# CONFIG_NET_SCHED is not set
268# CONFIG_NET_CLS_ROUTE is not set
269
270#
271# Network testing
272#
273# CONFIG_NET_PKTGEN is not set
274# CONFIG_NETPOLL is not set
275# CONFIG_NET_POLL_CONTROLLER is not set
276# CONFIG_HAMRADIO is not set
277# CONFIG_IRDA is not set
278# CONFIG_BT is not set
279CONFIG_NETDEVICES=y
280# CONFIG_DUMMY is not set
281# CONFIG_BONDING is not set
282# CONFIG_EQUALIZER is not set
283# CONFIG_TUN is not set
284
285#
286# Ethernet (10 or 100Mbit)
287#
288CONFIG_NET_ETHERNET=y
289CONFIG_MII=y
290# CONFIG_OAKNET is not set
291
292#
293# Ethernet (1000 Mbit)
294#
295
296#
297# Ethernet (10000 Mbit)
298#
299
300#
301# Token Ring devices
302#
303
304#
305# Wireless LAN (non-hamradio)
306#
307# CONFIG_NET_RADIO is not set
308
309#
310# Wan interfaces
311#
312# CONFIG_WAN is not set
313CONFIG_PPP=y
314# CONFIG_PPP_MULTILINK is not set
315# CONFIG_PPP_FILTER is not set
316CONFIG_PPP_ASYNC=y
317CONFIG_PPP_SYNC_TTY=y
318CONFIG_PPP_DEFLATE=y
319# CONFIG_PPP_BSDCOMP is not set
320# CONFIG_PPPOE is not set
321# CONFIG_SLIP is not set
322# CONFIG_SHAPER is not set
323# CONFIG_NETCONSOLE is not set
324
325#
326# ISDN subsystem
327#
328# CONFIG_ISDN is not set
329
330#
331# Telephony Support
332#
333# CONFIG_PHONE is not set
334
335#
336# Input device support
337#
338# CONFIG_INPUT is not set
339
340#
341# Hardware I/O ports
342#
343# CONFIG_SERIO is not set
344# CONFIG_GAMEPORT is not set
345
346#
347# Character devices
348#
349# CONFIG_VT is not set
350# CONFIG_SERIAL_NONSTANDARD is not set
351
352#
353# Serial drivers
354#
355# CONFIG_SERIAL_8250 is not set
356
357#
358# Non-8250 serial port support
359#
360CONFIG_SERIAL_CORE=y
361CONFIG_SERIAL_CORE_CONSOLE=y
362CONFIG_SERIAL_CPM=y
363CONFIG_SERIAL_CPM_CONSOLE=y
364# CONFIG_SERIAL_CPM_SCC1 is not set
365# CONFIG_SERIAL_CPM_SCC2 is not set
366# CONFIG_SERIAL_CPM_SCC3 is not set
367# CONFIG_SERIAL_CPM_SCC4 is not set
368CONFIG_SERIAL_CPM_SMC1=y
369CONFIG_SERIAL_CPM_SMC2=y
370CONFIG_UNIX98_PTYS=y
371# CONFIG_LEGACY_PTYS is not set
372
373#
374# IPMI
375#
376# CONFIG_IPMI_HANDLER is not set
377
378#
379# Watchdog Cards
380#
381# CONFIG_WATCHDOG is not set
382# CONFIG_NVRAM is not set
383# CONFIG_GEN_RTC is not set
384# CONFIG_DTLK is not set
385# CONFIG_R3964 is not set
386
387#
388# Ftape, the floppy tape device driver
389#
390# CONFIG_AGP is not set
391# CONFIG_DRM is not set
392# CONFIG_RAW_DRIVER is not set
393
394#
395# TPM devices
396#
397
398#
399# I2C support
400#
401# CONFIG_I2C is not set
402
403#
404# Dallas's 1-wire bus
405#
406# CONFIG_W1 is not set
407
408#
409# Misc devices
410#
411
412#
413# Multimedia devices
414#
415# CONFIG_VIDEO_DEV is not set
416
417#
418# Digital Video Broadcasting Devices
419#
420# CONFIG_DVB is not set
421
422#
423# Graphics support
424#
425# CONFIG_FB is not set
426
427#
428# Sound
429#
430# CONFIG_SOUND is not set
431
432#
433# USB support
434#
435# CONFIG_USB_ARCH_HAS_HCD is not set
436# CONFIG_USB_ARCH_HAS_OHCI is not set
437
438#
439# USB Gadget Support
440#
441# CONFIG_USB_GADGET is not set
442
443#
444# MMC/SD Card support
445#
446# CONFIG_MMC is not set
447
448#
449# InfiniBand support
450#
451# CONFIG_INFINIBAND is not set
452
453#
454# File systems
455#
456CONFIG_EXT2_FS=y
457CONFIG_EXT2_FS_XATTR=y
458# CONFIG_EXT2_FS_POSIX_ACL is not set
459# CONFIG_EXT2_FS_SECURITY is not set
460CONFIG_EXT3_FS=y
461CONFIG_EXT3_FS_XATTR=y
462# CONFIG_EXT3_FS_POSIX_ACL is not set
463# CONFIG_EXT3_FS_SECURITY is not set
464CONFIG_JBD=y
465# CONFIG_JBD_DEBUG is not set
466CONFIG_FS_MBCACHE=y
467# CONFIG_REISERFS_FS is not set
468# CONFIG_JFS_FS is not set
469
470#
471# XFS support
472#
473# CONFIG_XFS_FS is not set
474# CONFIG_MINIX_FS is not set
475# CONFIG_ROMFS_FS is not set
476# CONFIG_QUOTA is not set
477# CONFIG_DNOTIFY is not set
478# CONFIG_AUTOFS_FS is not set
479# CONFIG_AUTOFS4_FS is not set
480
481#
482# CD-ROM/DVD Filesystems
483#
484# CONFIG_ISO9660_FS is not set
485# CONFIG_UDF_FS is not set
486
487#
488# DOS/FAT/NT Filesystems
489#
490# CONFIG_MSDOS_FS is not set
491# CONFIG_VFAT_FS is not set
492# CONFIG_NTFS_FS is not set
493
494#
495# Pseudo filesystems
496#
497CONFIG_PROC_FS=y
498# CONFIG_PROC_KCORE is not set
499CONFIG_SYSFS=y
500# CONFIG_DEVFS_FS is not set
501# CONFIG_DEVPTS_FS_XATTR is not set
502# CONFIG_TMPFS is not set
503# CONFIG_HUGETLBFS is not set
504# CONFIG_HUGETLB_PAGE is not set
505CONFIG_RAMFS=y
506
507#
508# Miscellaneous filesystems
509#
510# CONFIG_ADFS_FS is not set
511# CONFIG_AFFS_FS is not set
512# CONFIG_HFS_FS is not set
513# CONFIG_HFSPLUS_FS is not set
514# CONFIG_BEFS_FS is not set
515# CONFIG_BFS_FS is not set
516# CONFIG_EFS_FS is not set
517# CONFIG_CRAMFS is not set
518# CONFIG_VXFS_FS is not set
519# CONFIG_HPFS_FS is not set
520# CONFIG_QNX4FS_FS is not set
521# CONFIG_SYSV_FS is not set
522# CONFIG_UFS_FS is not set
523
524#
525# Network File Systems
526#
527CONFIG_NFS_FS=y
528# CONFIG_NFS_V3 is not set
529# CONFIG_NFS_V4 is not set
530# CONFIG_NFS_DIRECTIO is not set
531# CONFIG_NFSD is not set
532CONFIG_ROOT_NFS=y
533CONFIG_LOCKD=y
534CONFIG_SUNRPC=y
535# CONFIG_RPCSEC_GSS_KRB5 is not set
536# CONFIG_RPCSEC_GSS_SPKM3 is not set
537# CONFIG_SMB_FS is not set
538# CONFIG_CIFS is not set
539# CONFIG_NCP_FS is not set
540# CONFIG_CODA_FS is not set
541# CONFIG_AFS_FS is not set
542
543#
544# Partition Types
545#
546CONFIG_PARTITION_ADVANCED=y
547# CONFIG_ACORN_PARTITION is not set
548# CONFIG_OSF_PARTITION is not set
549# CONFIG_AMIGA_PARTITION is not set
550# CONFIG_ATARI_PARTITION is not set
551# CONFIG_MAC_PARTITION is not set
552CONFIG_MSDOS_PARTITION=y
553# CONFIG_BSD_DISKLABEL is not set
554# CONFIG_MINIX_SUBPARTITION is not set
555# CONFIG_SOLARIS_X86_PARTITION is not set
556# CONFIG_UNIXWARE_DISKLABEL is not set
557# CONFIG_LDM_PARTITION is not set
558# CONFIG_SGI_PARTITION is not set
559# CONFIG_ULTRIX_PARTITION is not set
560# CONFIG_SUN_PARTITION is not set
561# CONFIG_EFI_PARTITION is not set
562
563#
564# Native Language Support
565#
566# CONFIG_NLS is not set
567
568#
569# MPC8xx CPM Options
570#
571CONFIG_SCC_ENET=y
572# CONFIG_SCC1_ENET is not set
573# CONFIG_SCC2_ENET is not set
574CONFIG_SCC3_ENET=y
575# CONFIG_FEC_ENET is not set
576# CONFIG_ENET_BIG_BUFFERS is not set
577
578#
579# Generic MPC8xx Options
580#
581CONFIG_8xx_COPYBACK=y
582CONFIG_8xx_CPU6=y
583CONFIG_NO_UCODE_PATCH=y
584# CONFIG_USB_SOF_UCODE_PATCH is not set
585# CONFIG_I2C_SPI_UCODE_PATCH is not set
586# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
587
588#
589# Library routines
590#
591CONFIG_CRC_CCITT=y
592# CONFIG_CRC32 is not set
593# CONFIG_LIBCRC32C is not set
594CONFIG_ZLIB_INFLATE=y
595CONFIG_ZLIB_DEFLATE=y
596
597#
598# Profiling support
599#
600# CONFIG_PROFILING is not set
601
602#
603# Kernel hacking
604#
605# CONFIG_PRINTK_TIME is not set
606# CONFIG_DEBUG_KERNEL is not set
607CONFIG_LOG_BUF_SHIFT=14
608
609#
610# Security options
611#
612# CONFIG_KEYS is not set
613# CONFIG_SECURITY is not set
614
615#
616# Cryptographic options
617#
618# CONFIG_CRYPTO is not set
619
620#
621# Hardware crypto devices
622#
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index b6a63a49a232..191a8def3bdb 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -1449,3 +1449,5 @@ _GLOBAL(sys_call_table)
1449 .long sys_request_key /* 270 */ 1449 .long sys_request_key /* 270 */
1450 .long sys_keyctl 1450 .long sys_keyctl
1451 .long sys_waitid 1451 .long sys_waitid
1452 .long sys_ioprio_set
1453 .long sys_ioprio_get
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 6d7b92d72458..70cfb6ffd877 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -1495,7 +1495,7 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev,
1495 *offset += hose->pci_mem_offset; 1495 *offset += hose->pci_mem_offset;
1496 res_bit = IORESOURCE_MEM; 1496 res_bit = IORESOURCE_MEM;
1497 } else { 1497 } else {
1498 io_offset = (unsigned long)hose->io_base_virt; 1498 io_offset = hose->io_base_virt - ___IO_BASE;
1499 *offset += io_offset; 1499 *offset += io_offset;
1500 res_bit = IORESOURCE_IO; 1500 res_bit = IORESOURCE_IO;
1501 } 1501 }
@@ -1522,7 +1522,7 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev,
1522 1522
1523 /* found it! construct the final physical address */ 1523 /* found it! construct the final physical address */
1524 if (mmap_state == pci_mmap_io) 1524 if (mmap_state == pci_mmap_io)
1525 *offset += hose->io_base_phys - _IO_BASE; 1525 *offset += hose->io_base_phys - io_offset;
1526 return rp; 1526 return rp;
1527 } 1527 }
1528 1528
@@ -1739,6 +1739,23 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
1739 return result; 1739 return result;
1740} 1740}
1741 1741
1742void pci_resource_to_user(const struct pci_dev *dev, int bar,
1743 const struct resource *rsrc,
1744 u64 *start, u64 *end)
1745{
1746 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
1747 unsigned long offset = 0;
1748
1749 if (hose == NULL)
1750 return;
1751
1752 if (rsrc->flags & IORESOURCE_IO)
1753 offset = ___IO_BASE - hose->io_base_virt + hose->io_base_phys;
1754
1755 *start = rsrc->start + offset;
1756 *end = rsrc->end + offset;
1757}
1758
1742void __init 1759void __init
1743pci_init_resource(struct resource *res, unsigned long start, unsigned long end, 1760pci_init_resource(struct resource *res, unsigned long start, unsigned long end,
1744 int flags, char *name) 1761 int flags, char *name)
diff --git a/arch/ppc/kernel/relocate_kernel.S b/arch/ppc/kernel/relocate_kernel.S
index 7ff69c4af920..9b2ad48e988c 100644
--- a/arch/ppc/kernel/relocate_kernel.S
+++ b/arch/ppc/kernel/relocate_kernel.S
@@ -34,9 +34,9 @@ relocate_new_kernel:
34 34
35 mr r8, r0 35 mr r8, r0
36 ori r8, r8, MSR_RI|MSR_ME 36 ori r8, r8, MSR_RI|MSR_ME
37 mtspr SRR1, r8 37 mtspr SPRN_SRR1, r8
38 addi r8, r4, 1f - relocate_new_kernel 38 addi r8, r4, 1f - relocate_new_kernel
39 mtspr SRR0, r8 39 mtspr SPRN_SRR0, r8
40 sync 40 sync
41 rfi 41 rfi
42 42
diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
index 735866559199..bf4ddca5e853 100644
--- a/arch/ppc/kernel/time.c
+++ b/arch/ppc/kernel/time.c
@@ -89,6 +89,9 @@ unsigned long tb_to_ns_scale;
89 89
90extern unsigned long wall_jiffies; 90extern unsigned long wall_jiffies;
91 91
92/* used for timezone offset */
93static long timezone_offset;
94
92DEFINE_SPINLOCK(rtc_lock); 95DEFINE_SPINLOCK(rtc_lock);
93 96
94EXPORT_SYMBOL(rtc_lock); 97EXPORT_SYMBOL(rtc_lock);
@@ -170,7 +173,7 @@ void timer_interrupt(struct pt_regs * regs)
170 xtime.tv_sec - last_rtc_update >= 659 && 173 xtime.tv_sec - last_rtc_update >= 659 &&
171 abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ && 174 abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ &&
172 jiffies - wall_jiffies == 1) { 175 jiffies - wall_jiffies == 1) {
173 if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) == 0) 176 if (ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) == 0)
174 last_rtc_update = xtime.tv_sec+1; 177 last_rtc_update = xtime.tv_sec+1;
175 else 178 else
176 /* Try again one minute later */ 179 /* Try again one minute later */
@@ -286,7 +289,7 @@ void __init time_init(void)
286 unsigned old_stamp, stamp, elapsed; 289 unsigned old_stamp, stamp, elapsed;
287 290
288 if (ppc_md.time_init != NULL) 291 if (ppc_md.time_init != NULL)
289 time_offset = ppc_md.time_init(); 292 timezone_offset = ppc_md.time_init();
290 293
291 if (__USE_RTC()) { 294 if (__USE_RTC()) {
292 /* 601 processor: dec counts down by 128 every 128ns */ 295 /* 601 processor: dec counts down by 128 every 128ns */
@@ -331,10 +334,10 @@ void __init time_init(void)
331 set_dec(tb_ticks_per_jiffy); 334 set_dec(tb_ticks_per_jiffy);
332 335
333 /* If platform provided a timezone (pmac), we correct the time */ 336 /* If platform provided a timezone (pmac), we correct the time */
334 if (time_offset) { 337 if (timezone_offset) {
335 sys_tz.tz_minuteswest = -time_offset / 60; 338 sys_tz.tz_minuteswest = -timezone_offset / 60;
336 sys_tz.tz_dsttime = 0; 339 sys_tz.tz_dsttime = 0;
337 xtime.tv_sec -= time_offset; 340 xtime.tv_sec -= timezone_offset;
338 } 341 }
339 set_normalized_timespec(&wall_to_monotonic, 342 set_normalized_timespec(&wall_to_monotonic,
340 -xtime.tv_sec, -xtime.tv_nsec); 343 -xtime.tv_sec, -xtime.tv_nsec);
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index 334ef4150d92..6164a2b34733 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -606,9 +606,19 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
606 struct page *page = pfn_to_page(pfn); 606 struct page *page = pfn_to_page(pfn);
607 if (!PageReserved(page) 607 if (!PageReserved(page)
608 && !test_bit(PG_arch_1, &page->flags)) { 608 && !test_bit(PG_arch_1, &page->flags)) {
609 if (vma->vm_mm == current->active_mm) 609 if (vma->vm_mm == current->active_mm) {
610#ifdef CONFIG_8xx
611 /* On 8xx, cache control instructions (particularly
612 * "dcbst" from flush_dcache_icache) fault as write
613 * operation if there is an unpopulated TLB entry
614 * for the address in question. To workaround that,
615 * we invalidate the TLB here, thus avoiding dcbst
616 * misbehaviour.
617 */
618 _tlbie(address);
619#endif
610 __flush_dcache_icache((void *) address); 620 __flush_dcache_icache((void *) address);
611 else 621 } else
612 flush_dcache_icache_page(page); 622 flush_dcache_icache_page(page);
613 set_bit(PG_arch_1, &page->flags); 623 set_bit(PG_arch_1, &page->flags);
614 } 624 }
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c
index ddd2e9a5bb12..f761fdf160db 100644
--- a/arch/ppc/platforms/85xx/mpc8540_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -111,8 +111,8 @@ mpc8540ads_setup_arch(void)
111 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 111 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
112 } 112 }
113 113
114 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC);
114 if (pdata) { 115 if (pdata) {
115 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC);
116 pdata->board_flags = 0; 116 pdata->board_flags = 0;
117 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 117 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
118 pdata->phyid = 3; 118 pdata->phyid = 3;
diff --git a/arch/ppc/platforms/fads.h b/arch/ppc/platforms/fads.h
index 632b8178ce66..b60c56450b67 100644
--- a/arch/ppc/platforms/fads.h
+++ b/arch/ppc/platforms/fads.h
@@ -3,7 +3,18 @@
3 * the Motorola 860T FADS board. Copied from the MBX stuff. 3 * the Motorola 860T FADS board. Copied from the MBX stuff.
4 * 4 *
5 * Copyright (c) 1998 Dan Malek (dmalek@jlc.net) 5 * Copyright (c) 1998 Dan Malek (dmalek@jlc.net)
6 *
7 * Added MPC86XADS support.
8 * The MPC86xADS manual says the board "is compatible with the MPC8xxFADS
9 * for SW point of view". This is 99% correct.
10 *
11 * Author: MontaVista Software, Inc.
12 * source@mvista.com
13 * 2005 (c) MontaVista Software, Inc. This file is licensed under the
14 * terms of the GNU General Public License version 2. This program is licensed
15 * "as is" without any warranty of any kind, whether express or implied.
6 */ 16 */
17
7#ifdef __KERNEL__ 18#ifdef __KERNEL__
8#ifndef __ASM_FADS_H__ 19#ifndef __ASM_FADS_H__
9#define __ASM_FADS_H__ 20#define __ASM_FADS_H__
@@ -12,18 +23,45 @@
12 23
13#include <asm/ppcboot.h> 24#include <asm/ppcboot.h>
14 25
26#if defined(CONFIG_MPC86XADS)
27
28/* U-Boot maps BCSR to 0xff080000 */
29#define BCSR_ADDR ((uint)0xff080000)
30
31/* MPC86XADS has one more CPLD and an additional BCSR.
32 */
33#define CFG_PHYDEV_ADDR ((uint)0xff0a0000)
34#define BCSR5 ((uint)(CFG_PHYDEV_ADDR + 0x300))
35
36#define BCSR5_T1_RST 0x10
37#define BCSR5_ATM155_RST 0x08
38#define BCSR5_ATM25_RST 0x04
39#define BCSR5_MII1_EN 0x02
40#define BCSR5_MII1_RST 0x01
41
42/* There is no PHY link change interrupt */
43#define PHY_INTERRUPT (-1)
44
45#else /* FADS */
46
15/* Memory map is configured by the PROM startup. 47/* Memory map is configured by the PROM startup.
16 * I tried to follow the FADS manual, although the startup PROM 48 * I tried to follow the FADS manual, although the startup PROM
17 * dictates this and we simply have to move some of the physical 49 * dictates this and we simply have to move some of the physical
18 * addresses for Linux. 50 * addresses for Linux.
19 */ 51 */
20#define BCSR_ADDR ((uint)0xff010000) 52#define BCSR_ADDR ((uint)0xff010000)
53
54/* PHY link change interrupt */
55#define PHY_INTERRUPT SIU_IRQ2
56
57#endif /* CONFIG_MPC86XADS */
58
21#define BCSR_SIZE ((uint)(64 * 1024)) 59#define BCSR_SIZE ((uint)(64 * 1024))
22#define BCSR0 ((uint)0xff010000) 60#define BCSR0 ((uint)(BCSR_ADDR + 0x00))
23#define BCSR1 ((uint)0xff010004) 61#define BCSR1 ((uint)(BCSR_ADDR + 0x04))
24#define BCSR2 ((uint)0xff010008) 62#define BCSR2 ((uint)(BCSR_ADDR + 0x08))
25#define BCSR3 ((uint)0xff01000c) 63#define BCSR3 ((uint)(BCSR_ADDR + 0x0c))
26#define BCSR4 ((uint)0xff010010) 64#define BCSR4 ((uint)(BCSR_ADDR + 0x10))
27 65
28#define IMAP_ADDR ((uint)0xff000000) 66#define IMAP_ADDR ((uint)0xff000000)
29#define IMAP_SIZE ((uint)(64 * 1024)) 67#define IMAP_SIZE ((uint)(64 * 1024))
@@ -34,8 +72,17 @@
34/* Bits of interest in the BCSRs. 72/* Bits of interest in the BCSRs.
35 */ 73 */
36#define BCSR1_ETHEN ((uint)0x20000000) 74#define BCSR1_ETHEN ((uint)0x20000000)
75#define BCSR1_IRDAEN ((uint)0x10000000)
37#define BCSR1_RS232EN_1 ((uint)0x01000000) 76#define BCSR1_RS232EN_1 ((uint)0x01000000)
77#define BCSR1_PCCEN ((uint)0x00800000)
78#define BCSR1_PCCVCC0 ((uint)0x00400000)
79#define BCSR1_PCCVPP0 ((uint)0x00200000)
80#define BCSR1_PCCVPP1 ((uint)0x00100000)
81#define BCSR1_PCCVPP_MASK (BCSR1_PCCVPP0 | BCSR1_PCCVPP1)
38#define BCSR1_RS232EN_2 ((uint)0x00040000) 82#define BCSR1_RS232EN_2 ((uint)0x00040000)
83#define BCSR1_PCCVCC1 ((uint)0x00010000)
84#define BCSR1_PCCVCC_MASK (BCSR1_PCCVCC0 | BCSR1_PCCVCC1)
85
39#define BCSR4_ETHLOOP ((uint)0x80000000) /* EEST Loopback */ 86#define BCSR4_ETHLOOP ((uint)0x80000000) /* EEST Loopback */
40#define BCSR4_EEFDX ((uint)0x40000000) /* EEST FDX enable */ 87#define BCSR4_EEFDX ((uint)0x40000000) /* EEST FDX enable */
41#define BCSR4_FETH_EN ((uint)0x08000000) /* PHY enable */ 88#define BCSR4_FETH_EN ((uint)0x08000000) /* PHY enable */
@@ -44,14 +91,64 @@
44#define BCSR4_FETHFDE ((uint)0x02000000) /* PHY FDX advertise */ 91#define BCSR4_FETHFDE ((uint)0x02000000) /* PHY FDX advertise */
45#define BCSR4_FETHRST ((uint)0x00200000) /* PHY Reset */ 92#define BCSR4_FETHRST ((uint)0x00200000) /* PHY Reset */
46 93
94/* IO_BASE definition for pcmcia.
95 */
96#define _IO_BASE 0x80000000
97#define _IO_BASE_SIZE 0x1000
98
99#ifdef CONFIG_IDE
100#define MAX_HWIFS 1
101#endif
102
47/* Interrupt level assignments. 103/* Interrupt level assignments.
48 */ 104 */
49#define FEC_INTERRUPT SIU_LEVEL1 /* FEC interrupt */ 105#define FEC_INTERRUPT SIU_LEVEL1 /* FEC interrupt */
50#define PHY_INTERRUPT SIU_IRQ2 /* PHY link change interrupt */
51 106
52/* We don't use the 8259. 107/* We don't use the 8259.
53 */ 108 */
54#define NR_8259_INTS 0 109#define NR_8259_INTS 0
55 110
111/* CPM Ethernet through SCC1 or SCC2 */
112
113#ifdef CONFIG_SCC1_ENET /* Probably 860 variant */
114/* Bits in parallel I/O port registers that have to be set/cleared
115 * to configure the pins for SCC1 use.
116 * TCLK - CLK1, RCLK - CLK2.
117 */
118#define PA_ENET_RXD ((ushort)0x0001)
119#define PA_ENET_TXD ((ushort)0x0002)
120#define PA_ENET_TCLK ((ushort)0x0100)
121#define PA_ENET_RCLK ((ushort)0x0200)
122#define PB_ENET_TENA ((uint)0x00001000)
123#define PC_ENET_CLSN ((ushort)0x0010)
124#define PC_ENET_RENA ((ushort)0x0020)
125
126/* Control bits in the SICR to route TCLK (CLK1) and RCLK (CLK2) to
127 * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
128 */
129#define SICR_ENET_MASK ((uint)0x000000ff)
130#define SICR_ENET_CLKRT ((uint)0x0000002c)
131#endif /* CONFIG_SCC1_ENET */
132
133#ifdef CONFIG_SCC2_ENET /* Probably 823/850 variant */
134/* Bits in parallel I/O port registers that have to be set/cleared
135 * to configure the pins for SCC1 use.
136 * TCLK - CLK1, RCLK - CLK2.
137 */
138#define PA_ENET_RXD ((ushort)0x0004)
139#define PA_ENET_TXD ((ushort)0x0008)
140#define PA_ENET_TCLK ((ushort)0x0400)
141#define PA_ENET_RCLK ((ushort)0x0200)
142#define PB_ENET_TENA ((uint)0x00002000)
143#define PC_ENET_CLSN ((ushort)0x0040)
144#define PC_ENET_RENA ((ushort)0x0080)
145
146/* Control bits in the SICR to route TCLK and RCLK to
147 * SCC2. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
148 */
149#define SICR_ENET_MASK ((uint)0x0000ff00)
150#define SICR_ENET_CLKRT ((uint)0x00002e00)
151#endif /* CONFIG_SCC2_ENET */
152
56#endif /* __ASM_FADS_H__ */ 153#endif /* __ASM_FADS_H__ */
57#endif /* __KERNEL__ */ 154#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/mpc885ads.h b/arch/ppc/platforms/mpc885ads.h
new file mode 100644
index 000000000000..eb386635b0fd
--- /dev/null
+++ b/arch/ppc/platforms/mpc885ads.h
@@ -0,0 +1,92 @@
1/*
2 * A collection of structures, addresses, and values associated with
3 * the Freescale MPC885ADS board.
4 * Copied from the FADS stuff.
5 *
6 * Author: MontaVista Software, Inc.
7 * source@mvista.com
8 *
9 * 2005 (c) MontaVista Software, Inc. This file is licensed under the
10 * terms of the GNU General Public License version 2. This program is licensed
11 * "as is" without any warranty of any kind, whether express or implied.
12 */
13
14#ifdef __KERNEL__
15#ifndef __ASM_MPC885ADS_H__
16#define __ASM_MPC885ADS_H__
17
18#include <linux/config.h>
19
20#include <asm/ppcboot.h>
21
22/* U-Boot maps BCSR to 0xff080000 */
23#define BCSR_ADDR ((uint)0xff080000)
24#define BCSR_SIZE ((uint)32)
25#define BCSR0 ((uint)(BCSR_ADDR + 0x00))
26#define BCSR1 ((uint)(BCSR_ADDR + 0x04))
27#define BCSR2 ((uint)(BCSR_ADDR + 0x08))
28#define BCSR3 ((uint)(BCSR_ADDR + 0x0c))
29#define BCSR4 ((uint)(BCSR_ADDR + 0x10))
30
31#define CFG_PHYDEV_ADDR ((uint)0xff0a0000)
32#define BCSR5 ((uint)(CFG_PHYDEV_ADDR + 0x300))
33
34#define IMAP_ADDR ((uint)0xff000000)
35#define IMAP_SIZE ((uint)(64 * 1024))
36
37#define PCMCIA_MEM_ADDR ((uint)0xff020000)
38#define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
39
40/* Bits of interest in the BCSRs.
41 */
42#define BCSR1_ETHEN ((uint)0x20000000)
43#define BCSR1_IRDAEN ((uint)0x10000000)
44#define BCSR1_RS232EN_1 ((uint)0x01000000)
45#define BCSR1_PCCEN ((uint)0x00800000)
46#define BCSR1_PCCVCC0 ((uint)0x00400000)
47#define BCSR1_PCCVPP0 ((uint)0x00200000)
48#define BCSR1_PCCVPP1 ((uint)0x00100000)
49#define BCSR1_PCCVPP_MASK (BCSR1_PCCVPP0 | BCSR1_PCCVPP1)
50#define BCSR1_RS232EN_2 ((uint)0x00040000)
51#define BCSR1_PCCVCC1 ((uint)0x00010000)
52#define BCSR1_PCCVCC_MASK (BCSR1_PCCVCC0 | BCSR1_PCCVCC1)
53
54#define BCSR4_ETH10_RST ((uint)0x80000000) /* 10Base-T PHY reset*/
55#define BCSR4_USB_LO_SPD ((uint)0x04000000)
56#define BCSR4_USB_VCC ((uint)0x02000000)
57#define BCSR4_USB_FULL_SPD ((uint)0x00040000)
58#define BCSR4_USB_EN ((uint)0x00020000)
59
60#define BCSR5_MII2_EN 0x40
61#define BCSR5_MII2_RST 0x20
62#define BCSR5_T1_RST 0x10
63#define BCSR5_ATM155_RST 0x08
64#define BCSR5_ATM25_RST 0x04
65#define BCSR5_MII1_EN 0x02
66#define BCSR5_MII1_RST 0x01
67
68/* Interrupt level assignments */
69#define PHY_INTERRUPT SIU_IRQ7 /* PHY link change interrupt */
70#define SIU_INT_FEC1 SIU_LEVEL1 /* FEC1 interrupt */
71#define SIU_INT_FEC2 SIU_LEVEL3 /* FEC2 interrupt */
72#define FEC_INTERRUPT SIU_INT_FEC1 /* FEC interrupt */
73
74/* We don't use the 8259 */
75#define NR_8259_INTS 0
76
77/* CPM Ethernet through SCC3 */
78#define PA_ENET_RXD ((ushort)0x0040)
79#define PA_ENET_TXD ((ushort)0x0080)
80#define PE_ENET_TCLK ((uint)0x00004000)
81#define PE_ENET_RCLK ((uint)0x00008000)
82#define PE_ENET_TENA ((uint)0x00000010)
83#define PC_ENET_CLSN ((ushort)0x0400)
84#define PC_ENET_RENA ((ushort)0x0800)
85
86/* Control bits in the SICR to route TCLK (CLK5) and RCLK (CLK6) to
87 * SCC3. Also, make sure GR3 (bit 8) and SC3 (bit 9) are zero */
88#define SICR_ENET_MASK ((uint)0x00ff0000)
89#define SICR_ENET_CLKRT ((uint)0x002c0000)
90
91#endif /* __ASM_MPC885ADS_H__ */
92#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/pmac_sleep.S b/arch/ppc/platforms/pmac_sleep.S
index f459ade1bd63..016a74649155 100644
--- a/arch/ppc/platforms/pmac_sleep.S
+++ b/arch/ppc/platforms/pmac_sleep.S
@@ -46,7 +46,7 @@
46 .section .text 46 .section .text
47 .align 5 47 .align 5
48 48
49#if defined(CONFIG_PMAC_PBOOK) || defined(CONFIG_CPU_FREQ_PMAC) 49#if defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ_PMAC)
50 50
51/* This gets called by via-pmu.c late during the sleep process. 51/* This gets called by via-pmu.c late during the sleep process.
52 * The PMU was already send the sleep command and will shut us down 52 * The PMU was already send the sleep command and will shut us down
@@ -382,7 +382,7 @@ turn_on_mmu:
382 isync 382 isync
383 rfi 383 rfi
384 384
385#endif /* defined(CONFIG_PMAC_PBOOK) || defined(CONFIG_CPU_FREQ) */ 385#endif /* defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ) */
386 386
387 .section .data 387 .section .data
388 .balign L1_CACHE_LINE_SIZE 388 .balign L1_CACHE_LINE_SIZE
diff --git a/arch/ppc/platforms/pmac_time.c b/arch/ppc/platforms/pmac_time.c
index de60ccc7db9f..778ce4fec368 100644
--- a/arch/ppc/platforms/pmac_time.c
+++ b/arch/ppc/platforms/pmac_time.c
@@ -206,7 +206,7 @@ via_calibrate_decr(void)
206 return 1; 206 return 1;
207} 207}
208 208
209#ifdef CONFIG_PMAC_PBOOK 209#ifdef CONFIG_PM
210/* 210/*
211 * Reset the time after a sleep. 211 * Reset the time after a sleep.
212 */ 212 */
@@ -238,7 +238,7 @@ time_sleep_notify(struct pmu_sleep_notifier *self, int when)
238static struct pmu_sleep_notifier time_sleep_notifier __pmacdata = { 238static struct pmu_sleep_notifier time_sleep_notifier __pmacdata = {
239 time_sleep_notify, SLEEP_LEVEL_MISC, 239 time_sleep_notify, SLEEP_LEVEL_MISC,
240}; 240};
241#endif /* CONFIG_PMAC_PBOOK */ 241#endif /* CONFIG_PM */
242 242
243/* 243/*
244 * Query the OF and get the decr frequency. 244 * Query the OF and get the decr frequency.
@@ -251,9 +251,9 @@ pmac_calibrate_decr(void)
251 struct device_node *cpu; 251 struct device_node *cpu;
252 unsigned int freq, *fp; 252 unsigned int freq, *fp;
253 253
254#ifdef CONFIG_PMAC_PBOOK 254#ifdef CONFIG_PM
255 pmu_register_sleep_notifier(&time_sleep_notifier); 255 pmu_register_sleep_notifier(&time_sleep_notifier);
256#endif /* CONFIG_PMAC_PBOOK */ 256#endif /* CONFIG_PM */
257 257
258 /* We assume MacRISC2 machines have correct device-tree 258 /* We assume MacRISC2 machines have correct device-tree
259 * calibration. That's better since the VIA itself seems 259 * calibration. That's better since the VIA itself seems
diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c
index 70e58f43f2b8..8b149c2fc54f 100644
--- a/arch/ppc/platforms/sandpoint.c
+++ b/arch/ppc/platforms/sandpoint.c
@@ -324,6 +324,7 @@ sandpoint_setup_arch(void)
324 pdata[1].irq = 0; 324 pdata[1].irq = 0;
325 pdata[1].mapbase = 0; 325 pdata[1].mapbase = 0;
326 } 326 }
327 }
327 328
328 printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n"); 329 printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n");
329 printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n"); 330 printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n");
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
index b45d8268bf93..ad39b86ca92c 100644
--- a/arch/ppc/syslib/open_pic.c
+++ b/arch/ppc/syslib/open_pic.c
@@ -370,8 +370,9 @@ void __init openpic_init(int offset)
370 /* Initialize IPI interrupts */ 370 /* Initialize IPI interrupts */
371 if ( ppc_md.progress ) ppc_md.progress("openpic: ipi",0x3bb); 371 if ( ppc_md.progress ) ppc_md.progress("openpic: ipi",0x3bb);
372 for (i = 0; i < OPENPIC_NUM_IPI; i++) { 372 for (i = 0; i < OPENPIC_NUM_IPI; i++) {
373 /* Disabled, Priority 10..13 */ 373 /* Disabled, increased priorities 10..13 */
374 openpic_initipi(i, 10+i, OPENPIC_VEC_IPI+i+offset); 374 openpic_initipi(i, OPENPIC_PRIORITY_IPI_BASE+i,
375 OPENPIC_VEC_IPI+i+offset);
375 /* IPIs are per-CPU */ 376 /* IPIs are per-CPU */
376 irq_desc[OPENPIC_VEC_IPI+i+offset].status |= IRQ_PER_CPU; 377 irq_desc[OPENPIC_VEC_IPI+i+offset].status |= IRQ_PER_CPU;
377 irq_desc[OPENPIC_VEC_IPI+i+offset].handler = &open_pic_ipi; 378 irq_desc[OPENPIC_VEC_IPI+i+offset].handler = &open_pic_ipi;
@@ -399,8 +400,9 @@ void __init openpic_init(int offset)
399 if (sense & IRQ_SENSE_MASK) 400 if (sense & IRQ_SENSE_MASK)
400 irq_desc[i+offset].status = IRQ_LEVEL; 401 irq_desc[i+offset].status = IRQ_LEVEL;
401 402
402 /* Enabled, Priority 8 */ 403 /* Enabled, Default priority */
403 openpic_initirq(i, 8, i+offset, (sense & IRQ_POLARITY_MASK), 404 openpic_initirq(i, OPENPIC_PRIORITY_DEFAULT, i+offset,
405 (sense & IRQ_POLARITY_MASK),
404 (sense & IRQ_SENSE_MASK)); 406 (sense & IRQ_SENSE_MASK));
405 /* Processor 0 */ 407 /* Processor 0 */
406 openpic_mapirq(i, CPU_MASK_CPU0, CPU_MASK_NONE); 408 openpic_mapirq(i, CPU_MASK_CPU0, CPU_MASK_NONE);
@@ -656,6 +658,18 @@ static void __init openpic_maptimer(u_int timer, cpumask_t cpumask)
656} 658}
657 659
658/* 660/*
661 * Change the priority of an interrupt
662 */
663void __init
664openpic_set_irq_priority(u_int irq, u_int pri)
665{
666 check_arg_irq(irq);
667 openpic_safe_writefield(&ISR[irq - open_pic_irq_offset]->Vector_Priority,
668 OPENPIC_PRIORITY_MASK,
669 pri << OPENPIC_PRIORITY_SHIFT);
670}
671
672/*
659 * Initalize the interrupt source which will generate an NMI. 673 * Initalize the interrupt source which will generate an NMI.
660 * This raises the interrupt's priority from 8 to 9. 674 * This raises the interrupt's priority from 8 to 9.
661 * 675 *
@@ -665,9 +679,7 @@ void __init
665openpic_init_nmi_irq(u_int irq) 679openpic_init_nmi_irq(u_int irq)
666{ 680{
667 check_arg_irq(irq); 681 check_arg_irq(irq);
668 openpic_safe_writefield(&ISR[irq - open_pic_irq_offset]->Vector_Priority, 682 openpic_set_irq_priority(irq, OPENPIC_PRIORITY_NMI);
669 OPENPIC_PRIORITY_MASK,
670 9 << OPENPIC_PRIORITY_SHIFT);
671} 683}
672 684
673/* 685/*
diff --git a/arch/ppc/syslib/ppc4xx_pic.c b/arch/ppc/syslib/ppc4xx_pic.c
index 05686fa73545..40086212b9c3 100644
--- a/arch/ppc/syslib/ppc4xx_pic.c
+++ b/arch/ppc/syslib/ppc4xx_pic.c
@@ -110,6 +110,10 @@ static int ppc4xx_pic_get_irq(struct pt_regs *regs)
110 110
111static void __init ppc4xx_pic_impl_init(void) 111static void __init ppc4xx_pic_impl_init(void)
112{ 112{
113#if defined(CONFIG_440GX)
114 /* Disable 440GP compatibility mode if it was enabled in firmware */
115 SDR_WRITE(DCRN_SDR_MFR, SDR_READ(DCRN_SDR_MFR) & ~DCRN_SDR_MFR_PCM);
116#endif
113 /* Configure Base UIC */ 117 /* Configure Base UIC */
114 mtdcr(DCRN_UIC_CR(UICB), 0); 118 mtdcr(DCRN_UIC_CR(UICB), 0);
115 mtdcr(DCRN_UIC_TR(UICB), 0); 119 mtdcr(DCRN_UIC_TR(UICB), 0);
diff --git a/arch/ppc64/boot/Makefile b/arch/ppc64/boot/Makefile
index d3e1d6af9203..683b2d43c15f 100644
--- a/arch/ppc64/boot/Makefile
+++ b/arch/ppc64/boot/Makefile
@@ -52,7 +52,7 @@ obj-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.o, $(section)))
52src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section))) 52src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section)))
53gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section))) 53gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section)))
54 54
55hostprogs-y := piggy addnote addRamDisk 55hostprogs-y := addnote addRamDisk
56targets += zImage zImage.initrd imagesize.c \ 56targets += zImage zImage.initrd imagesize.c \
57 $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \ 57 $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \
58 $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \ 58 $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \
@@ -78,9 +78,6 @@ addsection = $(CROSS32OBJCOPY) $(1) \
78quiet_cmd_addnote = ADDNOTE $@ 78quiet_cmd_addnote = ADDNOTE $@
79 cmd_addnote = $(CROSS32LD) $(BOOTLFLAGS) -o $@ $(obj-boot) && $(obj)/addnote $@ 79 cmd_addnote = $(CROSS32LD) $(BOOTLFLAGS) -o $@ $(obj-boot) && $(obj)/addnote $@
80 80
81quiet_cmd_piggy = PIGGY $@
82 cmd_piggy = $(obj)/piggyback $(@:.o=) < $< | $(CROSS32AS) -o $@
83
84$(call gz-sec, $(required)): $(obj)/kernel-%.gz: % FORCE 81$(call gz-sec, $(required)): $(obj)/kernel-%.gz: % FORCE
85 $(call if_changed,gzip) 82 $(call if_changed,gzip)
86 83
diff --git a/arch/ppc64/boot/main.c b/arch/ppc64/boot/main.c
index da12ea2ca464..199d9804f61c 100644
--- a/arch/ppc64/boot/main.c
+++ b/arch/ppc64/boot/main.c
@@ -17,7 +17,6 @@
17 17
18extern void *finddevice(const char *); 18extern void *finddevice(const char *);
19extern int getprop(void *, const char *, void *, int); 19extern int getprop(void *, const char *, void *, int);
20extern void printk(char *fmt, ...);
21extern void printf(const char *fmt, ...); 20extern void printf(const char *fmt, ...);
22extern int sprintf(char *buf, const char *fmt, ...); 21extern int sprintf(char *buf, const char *fmt, ...);
23void gunzip(void *, int, unsigned char *, int *); 22void gunzip(void *, int, unsigned char *, int *);
@@ -147,10 +146,10 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
147 } 146 }
148 a1 = initrd.addr; 147 a1 = initrd.addr;
149 a2 = initrd.size; 148 a2 = initrd.size;
150 printf("initial ramdisk moving 0x%lx <- 0x%lx (%lx bytes)\n\r", 149 printf("initial ramdisk moving 0x%lx <- 0x%lx (0x%lx bytes)\n\r",
151 initrd.addr, (unsigned long)_initrd_start, initrd.size); 150 initrd.addr, (unsigned long)_initrd_start, initrd.size);
152 memmove((void *)initrd.addr, (void *)_initrd_start, initrd.size); 151 memmove((void *)initrd.addr, (void *)_initrd_start, initrd.size);
153 printf("initrd head: 0x%lx\n\r", *((u32 *)initrd.addr)); 152 printf("initrd head: 0x%lx\n\r", *((unsigned long *)initrd.addr));
154 } 153 }
155 154
156 /* Eventually gunzip the kernel */ 155 /* Eventually gunzip the kernel */
@@ -201,9 +200,6 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
201 200
202 flush_cache((void *)vmlinux.addr, vmlinux.size); 201 flush_cache((void *)vmlinux.addr, vmlinux.size);
203 202
204 if (a1)
205 printf("initrd head: 0x%lx\n\r", *((u32 *)initrd.addr));
206
207 kernel_entry = (kernel_entry_t)vmlinux.addr; 203 kernel_entry = (kernel_entry_t)vmlinux.addr;
208#ifdef DEBUG 204#ifdef DEBUG
209 printf( "kernel:\n\r" 205 printf( "kernel:\n\r"
diff --git a/arch/ppc64/boot/mknote.c b/arch/ppc64/boot/mknote.c
deleted file mode 100644
index 120cc1d89739..000000000000
--- a/arch/ppc64/boot/mknote.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Copyright (C) Cort Dougan 1999.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *
9 * Generate a note section as per the CHRP specification.
10 *
11 */
12
13#include <stdio.h>
14
15#define PL(x) printf("%c%c%c%c", ((x)>>24)&0xff, ((x)>>16)&0xff, ((x)>>8)&0xff, (x)&0xff );
16
17int main(void)
18{
19/* header */
20 /* namesz */
21 PL(strlen("PowerPC")+1);
22 /* descrsz */
23 PL(6*4);
24 /* type */
25 PL(0x1275);
26 /* name */
27 printf("PowerPC"); printf("%c", 0);
28
29/* descriptor */
30 /* real-mode */
31 PL(0xffffffff);
32 /* real-base */
33 PL(0x00c00000);
34 /* real-size */
35 PL(0xffffffff);
36 /* virt-base */
37 PL(0xffffffff);
38 /* virt-size */
39 PL(0xffffffff);
40 /* load-base */
41 PL(0x4000);
42 return 0;
43}
diff --git a/arch/ppc64/boot/piggyback.c b/arch/ppc64/boot/piggyback.c
deleted file mode 100644
index 235c7a87269c..000000000000
--- a/arch/ppc64/boot/piggyback.c
+++ /dev/null
@@ -1,83 +0,0 @@
1/*
2 * Copyright 2001 IBM Corp
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#include <stdio.h>
10#include <unistd.h>
11#include <string.h>
12
13extern long ce_exec_config[];
14
15int main(int argc, char *argv[])
16{
17 int i, cnt, pos, len;
18 unsigned int cksum, val;
19 unsigned char *lp;
20 unsigned char buf[8192];
21 char *varname;
22 if (argc != 2)
23 {
24 fprintf(stderr, "usage: %s name <in-file >out-file\n",
25 argv[0]);
26 exit(1);
27 }
28
29 varname = strrchr(argv[1], '/');
30 if (varname)
31 varname++;
32 else
33 varname = argv[1];
34
35 fprintf(stdout, "#\n");
36 fprintf(stdout, "# Miscellaneous data structures:\n");
37 fprintf(stdout, "# WARNING - this file is automatically generated!\n");
38 fprintf(stdout, "#\n");
39 fprintf(stdout, "\n");
40 fprintf(stdout, "\t.data\n");
41 fprintf(stdout, "\t.globl %s_data\n", varname);
42 fprintf(stdout, "%s_data:\n", varname);
43 pos = 0;
44 cksum = 0;
45 while ((len = read(0, buf, sizeof(buf))) > 0)
46 {
47 cnt = 0;
48 lp = (unsigned char *)buf;
49 len = (len + 3) & ~3; /* Round up to longwords */
50 for (i = 0; i < len; i += 4)
51 {
52 if (cnt == 0)
53 {
54 fprintf(stdout, "\t.long\t");
55 }
56 fprintf(stdout, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]);
57 val = *(unsigned long *)lp;
58 cksum ^= val;
59 lp += 4;
60 if (++cnt == 4)
61 {
62 cnt = 0;
63 fprintf(stdout, " # %x \n", pos+i-12);
64 fflush(stdout);
65 } else
66 {
67 fprintf(stdout, ",");
68 }
69 }
70 if (cnt)
71 {
72 fprintf(stdout, "0\n");
73 }
74 pos += len;
75 }
76 fprintf(stdout, "\t.globl %s_len\n", varname);
77 fprintf(stdout, "%s_len:\t.long\t0x%x\n", varname, pos);
78 fflush(stdout);
79 fclose(stdout);
80 fprintf(stderr, "cksum = %x\n", cksum);
81 exit(0);
82}
83
diff --git a/arch/ppc64/boot/prom.c b/arch/ppc64/boot/prom.c
index d5218b15824e..5e48b80ff5a0 100644
--- a/arch/ppc64/boot/prom.c
+++ b/arch/ppc64/boot/prom.c
@@ -40,7 +40,7 @@ void *finddevice(const char *name);
40int getprop(void *phandle, const char *name, void *buf, int buflen); 40int getprop(void *phandle, const char *name, void *buf, int buflen);
41void chrpboot(int a1, int a2, void *prom); /* in main.c */ 41void chrpboot(int a1, int a2, void *prom); /* in main.c */
42 42
43void printk(char *fmt, ...); 43int printf(char *fmt, ...);
44 44
45/* there is no convenient header to get this from... -- paulus */ 45/* there is no convenient header to get this from... -- paulus */
46extern unsigned long strlen(const char *); 46extern unsigned long strlen(const char *);
@@ -220,7 +220,7 @@ readchar(void)
220 case 1: 220 case 1:
221 return ch; 221 return ch;
222 case -1: 222 case -1:
223 printk("read(stdin) returned -1\r\n"); 223 printf("read(stdin) returned -1\r\n");
224 return -1; 224 return -1;
225 } 225 }
226 } 226 }
@@ -627,18 +627,6 @@ int sprintf(char * buf, const char *fmt, ...)
627 627
628static char sprint_buf[1024]; 628static char sprint_buf[1024];
629 629
630void
631printk(char *fmt, ...)
632{
633 va_list args;
634 int n;
635
636 va_start(args, fmt);
637 n = vsprintf(sprint_buf, fmt, args);
638 va_end(args);
639 write(stdout, sprint_buf, n);
640}
641
642int 630int
643printf(char *fmt, ...) 631printf(char *fmt, ...)
644{ 632{
diff --git a/arch/ppc64/kernel/ItLpQueue.c b/arch/ppc64/kernel/ItLpQueue.c
index cdea00d7707f..4231861288a3 100644
--- a/arch/ppc64/kernel/ItLpQueue.c
+++ b/arch/ppc64/kernel/ItLpQueue.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * ItLpQueue.c 2 * ItLpQueue.c
3 * Copyright (C) 2001 Mike Corrigan IBM Corporation 3 * Copyright (C) 2001 Mike Corrigan IBM Corporation
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or 7 * the Free Software Foundation; either version 2 of the License, or
@@ -11,156 +11,252 @@
11#include <linux/stddef.h> 11#include <linux/stddef.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/bootmem.h>
15#include <linux/seq_file.h>
16#include <linux/proc_fs.h>
14#include <asm/system.h> 17#include <asm/system.h>
15#include <asm/paca.h> 18#include <asm/paca.h>
16#include <asm/iSeries/ItLpQueue.h> 19#include <asm/iSeries/ItLpQueue.h>
17#include <asm/iSeries/HvLpEvent.h> 20#include <asm/iSeries/HvLpEvent.h>
18#include <asm/iSeries/HvCallEvent.h> 21#include <asm/iSeries/HvCallEvent.h>
19 22
20static __inline__ int set_inUse( struct ItLpQueue * lpQueue ) 23/*
21{ 24 * The LpQueue is used to pass event data from the hypervisor to
22 int t; 25 * the partition. This is where I/O interrupt events are communicated.
23 u32 * inUseP = &(lpQueue->xInUseWord); 26 *
24 27 * It is written to by the hypervisor so cannot end up in the BSS.
25 __asm__ __volatile__("\n\ 28 */
261: lwarx %0,0,%2 \n\ 29struct hvlpevent_queue hvlpevent_queue __attribute__((__section__(".data")));
27 cmpwi 0,%0,0 \n\
28 li %0,0 \n\
29 bne- 2f \n\
30 addi %0,%0,1 \n\
31 stwcx. %0,0,%2 \n\
32 bne- 1b \n\
332: eieio"
34 : "=&r" (t), "=m" (lpQueue->xInUseWord)
35 : "r" (inUseP), "m" (lpQueue->xInUseWord)
36 : "cc");
37
38 return t;
39}
40 30
41static __inline__ void clear_inUse( struct ItLpQueue * lpQueue ) 31DEFINE_PER_CPU(unsigned long[HvLpEvent_Type_NumTypes], hvlpevent_counts);
42{ 32
43 lpQueue->xInUseWord = 0; 33static char *event_types[HvLpEvent_Type_NumTypes] = {
44} 34 "Hypervisor",
35 "Machine Facilities",
36 "Session Manager",
37 "SPD I/O",
38 "Virtual Bus",
39 "PCI I/O",
40 "RIO I/O",
41 "Virtual Lan",
42 "Virtual I/O"
43};
45 44
46/* Array of LpEvent handler functions */ 45/* Array of LpEvent handler functions */
47extern LpEventHandler lpEventHandler[HvLpEvent_Type_NumTypes]; 46extern LpEventHandler lpEventHandler[HvLpEvent_Type_NumTypes];
48unsigned long ItLpQueueInProcess = 0;
49 47
50struct HvLpEvent * ItLpQueue_getNextLpEvent( struct ItLpQueue * lpQueue ) 48static struct HvLpEvent * get_next_hvlpevent(void)
51{ 49{
52 struct HvLpEvent * nextLpEvent = 50 struct HvLpEvent * event;
53 (struct HvLpEvent *)lpQueue->xSlicCurEventPtr; 51 event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;
54 if ( nextLpEvent->xFlags.xValid ) { 52
53 if (event->xFlags.xValid) {
55 /* rmb() needed only for weakly consistent machines (regatta) */ 54 /* rmb() needed only for weakly consistent machines (regatta) */
56 rmb(); 55 rmb();
57 /* Set pointer to next potential event */ 56 /* Set pointer to next potential event */
58 lpQueue->xSlicCurEventPtr += ((nextLpEvent->xSizeMinus1 + 57 hvlpevent_queue.xSlicCurEventPtr += ((event->xSizeMinus1 +
59 LpEventAlign ) / 58 LpEventAlign) / LpEventAlign) * LpEventAlign;
60 LpEventAlign ) * 59
61 LpEventAlign;
62 /* Wrap to beginning if no room at end */ 60 /* Wrap to beginning if no room at end */
63 if (lpQueue->xSlicCurEventPtr > lpQueue->xSlicLastValidEventPtr) 61 if (hvlpevent_queue.xSlicCurEventPtr >
64 lpQueue->xSlicCurEventPtr = lpQueue->xSlicEventStackPtr; 62 hvlpevent_queue.xSlicLastValidEventPtr) {
63 hvlpevent_queue.xSlicCurEventPtr =
64 hvlpevent_queue.xSlicEventStackPtr;
65 }
66 } else {
67 event = NULL;
65 } 68 }
66 else
67 nextLpEvent = NULL;
68 69
69 return nextLpEvent; 70 return event;
70} 71}
71 72
72int ItLpQueue_isLpIntPending( struct ItLpQueue * lpQueue ) 73static unsigned long spread_lpevents = NR_CPUS;
74
75int hvlpevent_is_pending(void)
73{ 76{
74 int retval = 0; 77 struct HvLpEvent *next_event;
75 struct HvLpEvent * nextLpEvent; 78
76 if ( lpQueue ) { 79 if (smp_processor_id() >= spread_lpevents)
77 nextLpEvent = (struct HvLpEvent *)lpQueue->xSlicCurEventPtr; 80 return 0;
78 retval = nextLpEvent->xFlags.xValid | lpQueue->xPlicOverflowIntPending; 81
79 } 82 next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;
80 return retval; 83
84 return next_event->xFlags.xValid |
85 hvlpevent_queue.xPlicOverflowIntPending;
81} 86}
82 87
83void ItLpQueue_clearValid( struct HvLpEvent * event ) 88static void hvlpevent_clear_valid(struct HvLpEvent * event)
84{ 89{
85 /* Clear the valid bit of the event 90 /* Tell the Hypervisor that we're done with this event.
86 * Also clear bits within this event that might 91 * Also clear bits within this event that might look like valid bits.
87 * look like valid bits (on 64-byte boundaries) 92 * ie. on 64-byte boundaries.
88 */ 93 */
89 unsigned extra = (( event->xSizeMinus1 + LpEventAlign ) / 94 struct HvLpEvent *tmp;
90 LpEventAlign ) - 1; 95 unsigned extra = ((event->xSizeMinus1 + LpEventAlign) /
91 switch ( extra ) { 96 LpEventAlign) - 1;
92 case 3: 97
93 ((struct HvLpEvent*)((char*)event+3*LpEventAlign))->xFlags.xValid=0; 98 switch (extra) {
94 case 2: 99 case 3:
95 ((struct HvLpEvent*)((char*)event+2*LpEventAlign))->xFlags.xValid=0; 100 tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign);
96 case 1: 101 tmp->xFlags.xValid = 0;
97 ((struct HvLpEvent*)((char*)event+1*LpEventAlign))->xFlags.xValid=0; 102 case 2:
98 case 0: 103 tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign);
99 ; 104 tmp->xFlags.xValid = 0;
105 case 1:
106 tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign);
107 tmp->xFlags.xValid = 0;
100 } 108 }
109
101 mb(); 110 mb();
111
102 event->xFlags.xValid = 0; 112 event->xFlags.xValid = 0;
103} 113}
104 114
105unsigned ItLpQueue_process( struct ItLpQueue * lpQueue, struct pt_regs *regs ) 115void process_hvlpevents(struct pt_regs *regs)
106{ 116{
107 unsigned numIntsProcessed = 0; 117 struct HvLpEvent * event;
108 struct HvLpEvent * nextLpEvent;
109 118
110 /* If we have recursed, just return */ 119 /* If we have recursed, just return */
111 if ( !set_inUse( lpQueue ) ) 120 if (!spin_trylock(&hvlpevent_queue.lock))
112 return 0; 121 return;
113
114 if (ItLpQueueInProcess == 0)
115 ItLpQueueInProcess = 1;
116 else
117 BUG();
118 122
119 for (;;) { 123 for (;;) {
120 nextLpEvent = ItLpQueue_getNextLpEvent( lpQueue ); 124 event = get_next_hvlpevent();
121 if ( nextLpEvent ) { 125 if (event) {
122 /* Count events to return to caller 126 /* Call appropriate handler here, passing
123 * and count processed events in lpQueue
124 */
125 ++numIntsProcessed;
126 lpQueue->xLpIntCount++;
127 /* Call appropriate handler here, passing
128 * a pointer to the LpEvent. The handler 127 * a pointer to the LpEvent. The handler
129 * must make a copy of the LpEvent if it 128 * must make a copy of the LpEvent if it
130 * needs it in a bottom half. (perhaps for 129 * needs it in a bottom half. (perhaps for
131 * an ACK) 130 * an ACK)
132 * 131 *
133 * Handlers are responsible for ACK processing 132 * Handlers are responsible for ACK processing
134 * 133 *
135 * The Hypervisor guarantees that LpEvents will 134 * The Hypervisor guarantees that LpEvents will
136 * only be delivered with types that we have 135 * only be delivered with types that we have
137 * registered for, so no type check is necessary 136 * registered for, so no type check is necessary
138 * here! 137 * here!
139 */ 138 */
140 if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes ) 139 if (event->xType < HvLpEvent_Type_NumTypes)
141 lpQueue->xLpIntCountByType[nextLpEvent->xType]++; 140 __get_cpu_var(hvlpevent_counts)[event->xType]++;
142 if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes && 141 if (event->xType < HvLpEvent_Type_NumTypes &&
143 lpEventHandler[nextLpEvent->xType] ) 142 lpEventHandler[event->xType])
144 lpEventHandler[nextLpEvent->xType](nextLpEvent, regs); 143 lpEventHandler[event->xType](event, regs);
145 else 144 else
146 printk(KERN_INFO "Unexpected Lp Event type=%d\n", nextLpEvent->xType ); 145 printk(KERN_INFO "Unexpected Lp Event type=%d\n", event->xType );
147 146
148 ItLpQueue_clearValid( nextLpEvent ); 147 hvlpevent_clear_valid(event);
149 } else if ( lpQueue->xPlicOverflowIntPending ) 148 } else if (hvlpevent_queue.xPlicOverflowIntPending)
150 /* 149 /*
151 * No more valid events. If overflow events are 150 * No more valid events. If overflow events are
152 * pending process them 151 * pending process them
153 */ 152 */
154 HvCallEvent_getOverflowLpEvents( lpQueue->xIndex); 153 HvCallEvent_getOverflowLpEvents(hvlpevent_queue.xIndex);
155 else 154 else
156 break; 155 break;
157 } 156 }
158 157
159 ItLpQueueInProcess = 0; 158 spin_unlock(&hvlpevent_queue.lock);
160 mb(); 159}
161 clear_inUse( lpQueue ); 160
161static int set_spread_lpevents(char *str)
162{
163 unsigned long val = simple_strtoul(str, NULL, 0);
164
165 /*
166 * The parameter is the number of processors to share in processing
167 * lp events.
168 */
169 if (( val > 0) && (val <= NR_CPUS)) {
170 spread_lpevents = val;
171 printk("lpevent processing spread over %ld processors\n", val);
172 } else {
173 printk("invalid spread_lpevents %ld\n", val);
174 }
162 175
163 get_paca()->lpevent_count += numIntsProcessed; 176 return 1;
177}
178__setup("spread_lpevents=", set_spread_lpevents);
179
180void setup_hvlpevent_queue(void)
181{
182 void *eventStack;
183
184 /*
185 * Allocate a page for the Event Stack. The Hypervisor needs the
186 * absolute real address, so we subtract out the KERNELBASE and add
187 * in the absolute real address of the kernel load area.
188 */
189 eventStack = alloc_bootmem_pages(LpEventStackSize);
190 memset(eventStack, 0, LpEventStackSize);
191
192 /* Invoke the hypervisor to initialize the event stack */
193 HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize);
194
195 hvlpevent_queue.xSlicEventStackPtr = (char *)eventStack;
196 hvlpevent_queue.xSlicCurEventPtr = (char *)eventStack;
197 hvlpevent_queue.xSlicLastValidEventPtr = (char *)eventStack +
198 (LpEventStackSize - LpEventMaxSize);
199 hvlpevent_queue.xIndex = 0;
200}
201
202static int proc_lpevents_show(struct seq_file *m, void *v)
203{
204 int cpu, i;
205 unsigned long sum;
206 static unsigned long cpu_totals[NR_CPUS];
207
208 /* FIXME: do we care that there's no locking here? */
209 sum = 0;
210 for_each_online_cpu(cpu) {
211 cpu_totals[cpu] = 0;
212 for (i = 0; i < HvLpEvent_Type_NumTypes; i++) {
213 cpu_totals[cpu] += per_cpu(hvlpevent_counts, cpu)[i];
214 }
215 sum += cpu_totals[cpu];
216 }
217
218 seq_printf(m, "LpEventQueue 0\n");
219 seq_printf(m, " events processed:\t%lu\n", sum);
220
221 for (i = 0; i < HvLpEvent_Type_NumTypes; ++i) {
222 sum = 0;
223 for_each_online_cpu(cpu) {
224 sum += per_cpu(hvlpevent_counts, cpu)[i];
225 }
226
227 seq_printf(m, " %-20s %10lu\n", event_types[i], sum);
228 }
229
230 seq_printf(m, "\n events processed by processor:\n");
231
232 for_each_online_cpu(cpu) {
233 seq_printf(m, " CPU%02d %10lu\n", cpu, cpu_totals[cpu]);
234 }
235
236 return 0;
237}
238
239static int proc_lpevents_open(struct inode *inode, struct file *file)
240{
241 return single_open(file, proc_lpevents_show, NULL);
242}
164 243
165 return numIntsProcessed; 244static struct file_operations proc_lpevents_operations = {
245 .open = proc_lpevents_open,
246 .read = seq_read,
247 .llseek = seq_lseek,
248 .release = single_release,
249};
250
251static int __init proc_lpevents_init(void)
252{
253 struct proc_dir_entry *e;
254
255 e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL);
256 if (e)
257 e->proc_fops = &proc_lpevents_operations;
258
259 return 0;
166} 260}
261__initcall(proc_lpevents_init);
262
diff --git a/arch/ppc64/kernel/LparData.c b/arch/ppc64/kernel/LparData.c
index badc5a443614..6ffcf67dd507 100644
--- a/arch/ppc64/kernel/LparData.c
+++ b/arch/ppc64/kernel/LparData.c
@@ -28,13 +28,6 @@
28#include <asm/iSeries/IoHriProcessorVpd.h> 28#include <asm/iSeries/IoHriProcessorVpd.h>
29#include <asm/iSeries/ItSpCommArea.h> 29#include <asm/iSeries/ItSpCommArea.h>
30 30
31/* The LpQueue is used to pass event data from the hypervisor to
32 * the partition. This is where I/O interrupt events are communicated.
33 */
34
35/* May be filled in by the hypervisor so cannot end up in the BSS */
36struct ItLpQueue xItLpQueue __attribute__((__section__(".data")));
37
38 31
39/* The HvReleaseData is the root of the information shared between 32/* The HvReleaseData is the root of the information shared between
40 * the hypervisor and Linux. 33 * the hypervisor and Linux.
@@ -200,7 +193,7 @@ struct ItVpdAreas itVpdAreas = {
200 0,0,0, /* 13 - 15 */ 193 0,0,0, /* 13 - 15 */
201 sizeof(struct IoHriProcessorVpd),/* 16 length of Proc Vpd */ 194 sizeof(struct IoHriProcessorVpd),/* 16 length of Proc Vpd */
202 0,0,0,0,0,0, /* 17 - 22 */ 195 0,0,0,0,0,0, /* 17 - 22 */
203 sizeof(struct ItLpQueue),/* 23 length of Lp Queue */ 196 sizeof(struct hvlpevent_queue), /* 23 length of Lp Queue */
204 0,0 /* 24 - 25 */ 197 0,0 /* 24 - 25 */
205 }, 198 },
206 .xSlicVpdAdrs = { /* VPD addresses */ 199 .xSlicVpdAdrs = { /* VPD addresses */
@@ -218,7 +211,7 @@ struct ItVpdAreas itVpdAreas = {
218 0,0,0, /* 13 - 15 */ 211 0,0,0, /* 13 - 15 */
219 &xIoHriProcessorVpd, /* 16 Proc Vpd */ 212 &xIoHriProcessorVpd, /* 16 Proc Vpd */
220 0,0,0,0,0,0, /* 17 - 22 */ 213 0,0,0,0,0,0, /* 17 - 22 */
221 &xItLpQueue, /* 23 Lp Queue */ 214 &hvlpevent_queue, /* 23 Lp Queue */
222 0,0 215 0,0
223 } 216 }
224}; 217};
diff --git a/arch/ppc64/kernel/iSeries_proc.c b/arch/ppc64/kernel/iSeries_proc.c
index 356bd9931fcc..0fe3116eba29 100644
--- a/arch/ppc64/kernel/iSeries_proc.c
+++ b/arch/ppc64/kernel/iSeries_proc.c
@@ -40,50 +40,6 @@ static int __init iseries_proc_create(void)
40} 40}
41core_initcall(iseries_proc_create); 41core_initcall(iseries_proc_create);
42 42
43static char *event_types[9] = {
44 "Hypervisor\t\t",
45 "Machine Facilities\t",
46 "Session Manager\t",
47 "SPD I/O\t\t",
48 "Virtual Bus\t\t",
49 "PCI I/O\t\t",
50 "RIO I/O\t\t",
51 "Virtual Lan\t\t",
52 "Virtual I/O\t\t"
53};
54
55static int proc_lpevents_show(struct seq_file *m, void *v)
56{
57 unsigned int i;
58
59 seq_printf(m, "LpEventQueue 0\n");
60 seq_printf(m, " events processed:\t%lu\n",
61 (unsigned long)xItLpQueue.xLpIntCount);
62
63 for (i = 0; i < 9; ++i)
64 seq_printf(m, " %s %10lu\n", event_types[i],
65 (unsigned long)xItLpQueue.xLpIntCountByType[i]);
66
67 seq_printf(m, "\n events processed by processor:\n");
68
69 for_each_online_cpu(i)
70 seq_printf(m, " CPU%02d %10u\n", i, paca[i].lpevent_count);
71
72 return 0;
73}
74
75static int proc_lpevents_open(struct inode *inode, struct file *file)
76{
77 return single_open(file, proc_lpevents_show, NULL);
78}
79
80static struct file_operations proc_lpevents_operations = {
81 .open = proc_lpevents_open,
82 .read = seq_read,
83 .llseek = seq_lseek,
84 .release = single_release,
85};
86
87static unsigned long startTitan = 0; 43static unsigned long startTitan = 0;
88static unsigned long startTb = 0; 44static unsigned long startTb = 0;
89 45
@@ -148,10 +104,6 @@ static int __init iseries_proc_init(void)
148{ 104{
149 struct proc_dir_entry *e; 105 struct proc_dir_entry *e;
150 106
151 e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL);
152 if (e)
153 e->proc_fops = &proc_lpevents_operations;
154
155 e = create_proc_entry("iSeries/titanTod", S_IFREG|S_IRUGO, NULL); 107 e = create_proc_entry("iSeries/titanTod", S_IFREG|S_IRUGO, NULL);
156 if (e) 108 if (e)
157 e->proc_fops = &proc_titantod_operations; 109 e->proc_fops = &proc_titantod_operations;
diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c
index 86966ce76b58..b3f770f6d402 100644
--- a/arch/ppc64/kernel/iSeries_setup.c
+++ b/arch/ppc64/kernel/iSeries_setup.c
@@ -24,7 +24,6 @@
24#include <linux/smp.h> 24#include <linux/smp.h>
25#include <linux/param.h> 25#include <linux/param.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/bootmem.h>
28#include <linux/initrd.h> 27#include <linux/initrd.h>
29#include <linux/seq_file.h> 28#include <linux/seq_file.h>
30#include <linux/kdev_t.h> 29#include <linux/kdev_t.h>
@@ -676,7 +675,6 @@ static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr)
676 */ 675 */
677static void __init iSeries_setup_arch(void) 676static void __init iSeries_setup_arch(void)
678{ 677{
679 void *eventStack;
680 unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index; 678 unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index;
681 679
682 /* Add an eye catcher and the systemcfg layout version number */ 680 /* Add an eye catcher and the systemcfg layout version number */
@@ -685,24 +683,7 @@ static void __init iSeries_setup_arch(void)
685 systemcfg->version.minor = SYSTEMCFG_MINOR; 683 systemcfg->version.minor = SYSTEMCFG_MINOR;
686 684
687 /* Setup the Lp Event Queue */ 685 /* Setup the Lp Event Queue */
688 686 setup_hvlpevent_queue();
689 /* Allocate a page for the Event Stack
690 * The hypervisor wants the absolute real address, so
691 * we subtract out the KERNELBASE and add in the
692 * absolute real address of the kernel load area
693 */
694 eventStack = alloc_bootmem_pages(LpEventStackSize);
695 memset(eventStack, 0, LpEventStackSize);
696
697 /* Invoke the hypervisor to initialize the event stack */
698 HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize);
699
700 /* Initialize fields in our Lp Event Queue */
701 xItLpQueue.xSlicEventStackPtr = (char *)eventStack;
702 xItLpQueue.xSlicCurEventPtr = (char *)eventStack;
703 xItLpQueue.xSlicLastValidEventPtr = (char *)eventStack +
704 (LpEventStackSize - LpEventMaxSize);
705 xItLpQueue.xIndex = 0;
706 687
707 /* Compute processor frequency */ 688 /* Compute processor frequency */
708 procFreqHz = ((1UL << 34) * 1000000) / 689 procFreqHz = ((1UL << 34) * 1000000) /
@@ -853,28 +834,6 @@ static int __init iSeries_src_init(void)
853 834
854late_initcall(iSeries_src_init); 835late_initcall(iSeries_src_init);
855 836
856static int set_spread_lpevents(char *str)
857{
858 unsigned long i;
859 unsigned long val = simple_strtoul(str, NULL, 0);
860
861 /*
862 * The parameter is the number of processors to share in processing
863 * lp events.
864 */
865 if (( val > 0) && (val <= NR_CPUS)) {
866 for (i = 1; i < val; ++i)
867 paca[i].lpqueue_ptr = paca[0].lpqueue_ptr;
868
869 printk("lpevent processing spread over %ld processors\n", val);
870 } else {
871 printk("invalid spread_lpevents %ld\n", val);
872 }
873
874 return 1;
875}
876__setup("spread_lpevents=", set_spread_lpevents);
877
878#ifndef CONFIG_PCI 837#ifndef CONFIG_PCI
879void __init iSeries_init_IRQ(void) { } 838void __init iSeries_init_IRQ(void) { }
880#endif 839#endif
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index bdf13b4dc1c8..08952c7e6216 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -88,7 +88,7 @@ static int iSeries_idle(void)
88 88
89 while (1) { 89 while (1) {
90 if (lpaca->lppaca.shared_proc) { 90 if (lpaca->lppaca.shared_proc) {
91 if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr)) 91 if (hvlpevent_is_pending())
92 process_iSeries_events(); 92 process_iSeries_events();
93 if (!need_resched()) 93 if (!need_resched())
94 yield_shared_processor(); 94 yield_shared_processor();
@@ -100,7 +100,7 @@ static int iSeries_idle(void)
100 100
101 while (!need_resched()) { 101 while (!need_resched()) {
102 HMT_medium(); 102 HMT_medium();
103 if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr)) 103 if (hvlpevent_is_pending())
104 process_iSeries_events(); 104 process_iSeries_events();
105 HMT_low(); 105 HMT_low();
106 } 106 }
diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c
index 3defc8c33adf..f41afe545045 100644
--- a/arch/ppc64/kernel/irq.c
+++ b/arch/ppc64/kernel/irq.c
@@ -66,7 +66,6 @@ EXPORT_SYMBOL(irq_desc);
66int distribute_irqs = 1; 66int distribute_irqs = 1;
67int __irq_offset_value; 67int __irq_offset_value;
68int ppc_spurious_interrupts; 68int ppc_spurious_interrupts;
69unsigned long lpevent_count;
70u64 ppc64_interrupt_controller; 69u64 ppc64_interrupt_controller;
71 70
72int show_interrupts(struct seq_file *p, void *v) 71int show_interrupts(struct seq_file *p, void *v)
@@ -245,7 +244,7 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
245 244
246 spin_lock(&desc->lock); 245 spin_lock(&desc->lock);
247 if (!noirqdebug) 246 if (!noirqdebug)
248 note_interrupt(irq, desc, action_ret); 247 note_interrupt(irq, desc, action_ret, regs);
249 if (likely(!(desc->status & IRQ_PENDING))) 248 if (likely(!(desc->status & IRQ_PENDING)))
250 break; 249 break;
251 desc->status &= ~IRQ_PENDING; 250 desc->status &= ~IRQ_PENDING;
@@ -269,7 +268,6 @@ out:
269void do_IRQ(struct pt_regs *regs) 268void do_IRQ(struct pt_regs *regs)
270{ 269{
271 struct paca_struct *lpaca; 270 struct paca_struct *lpaca;
272 struct ItLpQueue *lpq;
273 271
274 irq_enter(); 272 irq_enter();
275 273
@@ -295,9 +293,8 @@ void do_IRQ(struct pt_regs *regs)
295 iSeries_smp_message_recv(regs); 293 iSeries_smp_message_recv(regs);
296 } 294 }
297#endif /* CONFIG_SMP */ 295#endif /* CONFIG_SMP */
298 lpq = lpaca->lpqueue_ptr; 296 if (hvlpevent_is_pending())
299 if (lpq && ItLpQueue_isLpIntPending(lpq)) 297 process_hvlpevents(regs);
300 lpevent_count += ItLpQueue_process(lpq, regs);
301 298
302 irq_exit(); 299 irq_exit();
303 300
diff --git a/arch/ppc64/kernel/kprobes.c b/arch/ppc64/kernel/kprobes.c
index 782ce3efa2c1..a3d519518fb8 100644
--- a/arch/ppc64/kernel/kprobes.c
+++ b/arch/ppc64/kernel/kprobes.c
@@ -36,6 +36,8 @@
36#include <asm/kdebug.h> 36#include <asm/kdebug.h>
37#include <asm/sstep.h> 37#include <asm/sstep.h>
38 38
39static DECLARE_MUTEX(kprobe_mutex);
40
39static struct kprobe *current_kprobe; 41static struct kprobe *current_kprobe;
40static unsigned long kprobe_status, kprobe_saved_msr; 42static unsigned long kprobe_status, kprobe_saved_msr;
41static struct kprobe *kprobe_prev; 43static struct kprobe *kprobe_prev;
@@ -54,6 +56,15 @@ int arch_prepare_kprobe(struct kprobe *p)
54 printk("Cannot register a kprobe on rfid or mtmsrd\n"); 56 printk("Cannot register a kprobe on rfid or mtmsrd\n");
55 ret = -EINVAL; 57 ret = -EINVAL;
56 } 58 }
59
60 /* insn must be on a special executable page on ppc64 */
61 if (!ret) {
62 up(&kprobe_mutex);
63 p->ainsn.insn = get_insn_slot();
64 down(&kprobe_mutex);
65 if (!p->ainsn.insn)
66 ret = -ENOMEM;
67 }
57 return ret; 68 return ret;
58} 69}
59 70
@@ -79,16 +90,22 @@ void arch_disarm_kprobe(struct kprobe *p)
79 90
80void arch_remove_kprobe(struct kprobe *p) 91void arch_remove_kprobe(struct kprobe *p)
81{ 92{
93 up(&kprobe_mutex);
94 free_insn_slot(p->ainsn.insn);
95 down(&kprobe_mutex);
82} 96}
83 97
84static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 98static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
85{ 99{
100 kprobe_opcode_t insn = *p->ainsn.insn;
101
86 regs->msr |= MSR_SE; 102 regs->msr |= MSR_SE;
87 /*single step inline if it a breakpoint instruction*/ 103
88 if (p->opcode == BREAKPOINT_INSTRUCTION) 104 /* single step inline if it is a trap variant */
105 if (IS_TW(insn) || IS_TD(insn) || IS_TWI(insn) || IS_TDI(insn))
89 regs->nip = (unsigned long)p->addr; 106 regs->nip = (unsigned long)p->addr;
90 else 107 else
91 regs->nip = (unsigned long)&p->ainsn.insn; 108 regs->nip = (unsigned long)p->ainsn.insn;
92} 109}
93 110
94static inline void save_previous_kprobe(void) 111static inline void save_previous_kprobe(void)
@@ -105,6 +122,23 @@ static inline void restore_previous_kprobe(void)
105 kprobe_saved_msr = kprobe_saved_msr_prev; 122 kprobe_saved_msr = kprobe_saved_msr_prev;
106} 123}
107 124
125void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs)
126{
127 struct kretprobe_instance *ri;
128
129 if ((ri = get_free_rp_inst(rp)) != NULL) {
130 ri->rp = rp;
131 ri->task = current;
132 ri->ret_addr = (kprobe_opcode_t *)regs->link;
133
134 /* Replace the return addr with trampoline addr */
135 regs->link = (unsigned long)kretprobe_trampoline;
136 add_rp_inst(ri);
137 } else {
138 rp->nmissed++;
139 }
140}
141
108static inline int kprobe_handler(struct pt_regs *regs) 142static inline int kprobe_handler(struct pt_regs *regs)
109{ 143{
110 struct kprobe *p; 144 struct kprobe *p;
@@ -195,6 +229,78 @@ no_kprobe:
195} 229}
196 230
197/* 231/*
232 * Function return probe trampoline:
233 * - init_kprobes() establishes a probepoint here
234 * - When the probed function returns, this probe
235 * causes the handlers to fire
236 */
237void kretprobe_trampoline_holder(void)
238{
239 asm volatile(".global kretprobe_trampoline\n"
240 "kretprobe_trampoline:\n"
241 "nop\n");
242}
243
244/*
245 * Called when the probe at kretprobe trampoline is hit
246 */
247int trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
248{
249 struct kretprobe_instance *ri = NULL;
250 struct hlist_head *head;
251 struct hlist_node *node, *tmp;
252 unsigned long orig_ret_address = 0;
253 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
254
255 head = kretprobe_inst_table_head(current);
256
257 /*
258 * It is possible to have multiple instances associated with a given
259 * task either because an multiple functions in the call path
260 * have a return probe installed on them, and/or more then one return
261 * return probe was registered for a target function.
262 *
263 * We can handle this because:
264 * - instances are always inserted at the head of the list
265 * - when multiple return probes are registered for the same
266 * function, the first instance's ret_addr will point to the
267 * real return address, and all the rest will point to
268 * kretprobe_trampoline
269 */
270 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
271 if (ri->task != current)
272 /* another task is sharing our hash bucket */
273 continue;
274
275 if (ri->rp && ri->rp->handler)
276 ri->rp->handler(ri, regs);
277
278 orig_ret_address = (unsigned long)ri->ret_addr;
279 recycle_rp_inst(ri);
280
281 if (orig_ret_address != trampoline_address)
282 /*
283 * This is the real return address. Any other
284 * instances associated with this task are for
285 * other calls deeper on the call stack
286 */
287 break;
288 }
289
290 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
291 regs->nip = orig_ret_address;
292
293 unlock_kprobes();
294
295 /*
296 * By returning a non-zero value, we are telling
297 * kprobe_handler() that we have handled unlocking
298 * and re-enabling preemption.
299 */
300 return 1;
301}
302
303/*
198 * Called after single-stepping. p->addr is the address of the 304 * Called after single-stepping. p->addr is the address of the
199 * instruction whose first byte has been replaced by the "breakpoint" 305 * instruction whose first byte has been replaced by the "breakpoint"
200 * instruction. To avoid the SMP problems that can occur when we 306 * instruction. To avoid the SMP problems that can occur when we
@@ -205,9 +311,10 @@ no_kprobe:
205static void resume_execution(struct kprobe *p, struct pt_regs *regs) 311static void resume_execution(struct kprobe *p, struct pt_regs *regs)
206{ 312{
207 int ret; 313 int ret;
314 unsigned int insn = *p->ainsn.insn;
208 315
209 regs->nip = (unsigned long)p->addr; 316 regs->nip = (unsigned long)p->addr;
210 ret = emulate_step(regs, p->ainsn.insn[0]); 317 ret = emulate_step(regs, insn);
211 if (ret == 0) 318 if (ret == 0)
212 regs->nip = (unsigned long)p->addr + 4; 319 regs->nip = (unsigned long)p->addr + 4;
213} 320}
@@ -331,3 +438,13 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
331 memcpy(regs, &jprobe_saved_regs, sizeof(struct pt_regs)); 438 memcpy(regs, &jprobe_saved_regs, sizeof(struct pt_regs));
332 return 1; 439 return 1;
333} 440}
441
442static struct kprobe trampoline_p = {
443 .addr = (kprobe_opcode_t *) &kretprobe_trampoline,
444 .pre_handler = trampoline_probe_handler
445};
446
447int __init arch_init_kprobes(void)
448{
449 return register_kprobe(&trampoline_p);
450}
diff --git a/arch/ppc64/kernel/mf.c b/arch/ppc64/kernel/mf.c
index d98bebf7042f..ef4a338ebd01 100644
--- a/arch/ppc64/kernel/mf.c
+++ b/arch/ppc64/kernel/mf.c
@@ -801,10 +801,8 @@ int mf_get_boot_rtc(struct rtc_time *tm)
801 return rc; 801 return rc;
802 /* We need to poll here as we are not yet taking interrupts */ 802 /* We need to poll here as we are not yet taking interrupts */
803 while (rtc_data.busy) { 803 while (rtc_data.busy) {
804 extern unsigned long lpevent_count; 804 if (hvlpevent_is_pending())
805 struct ItLpQueue *lpq = get_paca()->lpqueue_ptr; 805 process_hvlpevents(NULL);
806 if (lpq && ItLpQueue_isLpIntPending(lpq))
807 lpevent_count += ItLpQueue_process(lpq, NULL);
808 } 806 }
809 return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm); 807 return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm);
810} 808}
diff --git a/arch/ppc64/kernel/nvram.c b/arch/ppc64/kernel/nvram.c
index 4e71781a4414..4fb1a9f5060d 100644
--- a/arch/ppc64/kernel/nvram.c
+++ b/arch/ppc64/kernel/nvram.c
@@ -338,9 +338,8 @@ static int nvram_remove_os_partition(void)
338 */ 338 */
339static int nvram_create_os_partition(void) 339static int nvram_create_os_partition(void)
340{ 340{
341 struct list_head * p; 341 struct nvram_partition *part;
342 struct nvram_partition *part = NULL; 342 struct nvram_partition *new_part;
343 struct nvram_partition *new_part = NULL;
344 struct nvram_partition *free_part = NULL; 343 struct nvram_partition *free_part = NULL;
345 int seq_init[2] = { 0, 0 }; 344 int seq_init[2] = { 0, 0 };
346 loff_t tmp_index; 345 loff_t tmp_index;
@@ -349,8 +348,7 @@ static int nvram_create_os_partition(void)
349 348
350 /* Find a free partition that will give us the maximum needed size 349 /* Find a free partition that will give us the maximum needed size
351 If can't find one that will give us the minimum size needed */ 350 If can't find one that will give us the minimum size needed */
352 list_for_each(p, &nvram_part->partition) { 351 list_for_each_entry(part, &nvram_part->partition, partition) {
353 part = list_entry(p, struct nvram_partition, partition);
354 if (part->header.signature != NVRAM_SIG_FREE) 352 if (part->header.signature != NVRAM_SIG_FREE)
355 continue; 353 continue;
356 354
diff --git a/arch/ppc64/kernel/pacaData.c b/arch/ppc64/kernel/pacaData.c
index a3e0975c26c1..6316188737b6 100644
--- a/arch/ppc64/kernel/pacaData.c
+++ b/arch/ppc64/kernel/pacaData.c
@@ -42,21 +42,7 @@ extern unsigned long __toc_start;
42 * processors. The processor VPD array needs one entry per physical 42 * processors. The processor VPD array needs one entry per physical
43 * processor (not thread). 43 * processor (not thread).
44 */ 44 */
45#ifdef CONFIG_PPC_ISERIES 45#define PACA_INIT_COMMON(number, start, asrr, asrv) \
46#define EXTRA_INITS(number, lpq) \
47 .lppaca_ptr = &paca[number].lppaca, \
48 .lpqueue_ptr = (lpq), /* &xItLpQueue, */ \
49 .reg_save_ptr = &paca[number].reg_save, \
50 .reg_save = { \
51 .xDesc = 0xd397d9e2, /* "LpRS" */ \
52 .xSize = sizeof(struct ItLpRegSave) \
53 },
54#else
55#define EXTRA_INITS(number, lpq)
56#endif
57
58#define PACAINITDATA(number,start,lpq,asrr,asrv) \
59{ \
60 .lock_token = 0x8000, \ 46 .lock_token = 0x8000, \
61 .paca_index = (number), /* Paca Index */ \ 47 .paca_index = (number), /* Paca Index */ \
62 .default_decr = 0x00ff0000, /* Initial Decr */ \ 48 .default_decr = 0x00ff0000, /* Initial Decr */ \
@@ -74,147 +60,79 @@ extern unsigned long __toc_start;
74 .end_of_quantum = 0xfffffffffffffffful, \ 60 .end_of_quantum = 0xfffffffffffffffful, \
75 .slb_count = 64, \ 61 .slb_count = 64, \
76 }, \ 62 }, \
77 EXTRA_INITS((number), (lpq)) \
78}
79 63
80struct paca_struct paca[] = {
81#ifdef CONFIG_PPC_ISERIES 64#ifdef CONFIG_PPC_ISERIES
82 PACAINITDATA( 0, 1, &xItLpQueue, 0, STAB0_VIRT_ADDR), 65#define PACA_INIT_ISERIES(number) \
66 .lppaca_ptr = &paca[number].lppaca, \
67 .reg_save_ptr = &paca[number].reg_save, \
68 .reg_save = { \
69 .xDesc = 0xd397d9e2, /* "LpRS" */ \
70 .xSize = sizeof(struct ItLpRegSave) \
71 }
72
73#define PACA_INIT(number) \
74{ \
75 PACA_INIT_COMMON(number, 0, 0, 0) \
76 PACA_INIT_ISERIES(number) \
77}
78
79#define BOOTCPU_PACA_INIT(number) \
80{ \
81 PACA_INIT_COMMON(number, 1, 0, STAB0_VIRT_ADDR) \
82 PACA_INIT_ISERIES(number) \
83}
84
83#else 85#else
84 PACAINITDATA( 0, 1, NULL, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR), 86#define PACA_INIT(number) \
87{ \
88 PACA_INIT_COMMON(number, 0, 0, 0) \
89}
90
91#define BOOTCPU_PACA_INIT(number) \
92{ \
93 PACA_INIT_COMMON(number, 1, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR) \
94}
85#endif 95#endif
96
97struct paca_struct paca[] = {
98 BOOTCPU_PACA_INIT(0),
86#if NR_CPUS > 1 99#if NR_CPUS > 1
87 PACAINITDATA( 1, 0, NULL, 0, 0), 100 PACA_INIT( 1), PACA_INIT( 2), PACA_INIT( 3),
88 PACAINITDATA( 2, 0, NULL, 0, 0),
89 PACAINITDATA( 3, 0, NULL, 0, 0),
90#if NR_CPUS > 4 101#if NR_CPUS > 4
91 PACAINITDATA( 4, 0, NULL, 0, 0), 102 PACA_INIT( 4), PACA_INIT( 5), PACA_INIT( 6), PACA_INIT( 7),
92 PACAINITDATA( 5, 0, NULL, 0, 0),
93 PACAINITDATA( 6, 0, NULL, 0, 0),
94 PACAINITDATA( 7, 0, NULL, 0, 0),
95#if NR_CPUS > 8 103#if NR_CPUS > 8
96 PACAINITDATA( 8, 0, NULL, 0, 0), 104 PACA_INIT( 8), PACA_INIT( 9), PACA_INIT( 10), PACA_INIT( 11),
97 PACAINITDATA( 9, 0, NULL, 0, 0), 105 PACA_INIT( 12), PACA_INIT( 13), PACA_INIT( 14), PACA_INIT( 15),
98 PACAINITDATA(10, 0, NULL, 0, 0), 106 PACA_INIT( 16), PACA_INIT( 17), PACA_INIT( 18), PACA_INIT( 19),
99 PACAINITDATA(11, 0, NULL, 0, 0), 107 PACA_INIT( 20), PACA_INIT( 21), PACA_INIT( 22), PACA_INIT( 23),
100 PACAINITDATA(12, 0, NULL, 0, 0), 108 PACA_INIT( 24), PACA_INIT( 25), PACA_INIT( 26), PACA_INIT( 27),
101 PACAINITDATA(13, 0, NULL, 0, 0), 109 PACA_INIT( 28), PACA_INIT( 29), PACA_INIT( 30), PACA_INIT( 31),
102 PACAINITDATA(14, 0, NULL, 0, 0),
103 PACAINITDATA(15, 0, NULL, 0, 0),
104 PACAINITDATA(16, 0, NULL, 0, 0),
105 PACAINITDATA(17, 0, NULL, 0, 0),
106 PACAINITDATA(18, 0, NULL, 0, 0),
107 PACAINITDATA(19, 0, NULL, 0, 0),
108 PACAINITDATA(20, 0, NULL, 0, 0),
109 PACAINITDATA(21, 0, NULL, 0, 0),
110 PACAINITDATA(22, 0, NULL, 0, 0),
111 PACAINITDATA(23, 0, NULL, 0, 0),
112 PACAINITDATA(24, 0, NULL, 0, 0),
113 PACAINITDATA(25, 0, NULL, 0, 0),
114 PACAINITDATA(26, 0, NULL, 0, 0),
115 PACAINITDATA(27, 0, NULL, 0, 0),
116 PACAINITDATA(28, 0, NULL, 0, 0),
117 PACAINITDATA(29, 0, NULL, 0, 0),
118 PACAINITDATA(30, 0, NULL, 0, 0),
119 PACAINITDATA(31, 0, NULL, 0, 0),
120#if NR_CPUS > 32 110#if NR_CPUS > 32
121 PACAINITDATA(32, 0, NULL, 0, 0), 111 PACA_INIT( 32), PACA_INIT( 33), PACA_INIT( 34), PACA_INIT( 35),
122 PACAINITDATA(33, 0, NULL, 0, 0), 112 PACA_INIT( 36), PACA_INIT( 37), PACA_INIT( 38), PACA_INIT( 39),
123 PACAINITDATA(34, 0, NULL, 0, 0), 113 PACA_INIT( 40), PACA_INIT( 41), PACA_INIT( 42), PACA_INIT( 43),
124 PACAINITDATA(35, 0, NULL, 0, 0), 114 PACA_INIT( 44), PACA_INIT( 45), PACA_INIT( 46), PACA_INIT( 47),
125 PACAINITDATA(36, 0, NULL, 0, 0), 115 PACA_INIT( 48), PACA_INIT( 49), PACA_INIT( 50), PACA_INIT( 51),
126 PACAINITDATA(37, 0, NULL, 0, 0), 116 PACA_INIT( 52), PACA_INIT( 53), PACA_INIT( 54), PACA_INIT( 55),
127 PACAINITDATA(38, 0, NULL, 0, 0), 117 PACA_INIT( 56), PACA_INIT( 57), PACA_INIT( 58), PACA_INIT( 59),
128 PACAINITDATA(39, 0, NULL, 0, 0), 118 PACA_INIT( 60), PACA_INIT( 61), PACA_INIT( 62), PACA_INIT( 63),
129 PACAINITDATA(40, 0, NULL, 0, 0),
130 PACAINITDATA(41, 0, NULL, 0, 0),
131 PACAINITDATA(42, 0, NULL, 0, 0),
132 PACAINITDATA(43, 0, NULL, 0, 0),
133 PACAINITDATA(44, 0, NULL, 0, 0),
134 PACAINITDATA(45, 0, NULL, 0, 0),
135 PACAINITDATA(46, 0, NULL, 0, 0),
136 PACAINITDATA(47, 0, NULL, 0, 0),
137 PACAINITDATA(48, 0, NULL, 0, 0),
138 PACAINITDATA(49, 0, NULL, 0, 0),
139 PACAINITDATA(50, 0, NULL, 0, 0),
140 PACAINITDATA(51, 0, NULL, 0, 0),
141 PACAINITDATA(52, 0, NULL, 0, 0),
142 PACAINITDATA(53, 0, NULL, 0, 0),
143 PACAINITDATA(54, 0, NULL, 0, 0),
144 PACAINITDATA(55, 0, NULL, 0, 0),
145 PACAINITDATA(56, 0, NULL, 0, 0),
146 PACAINITDATA(57, 0, NULL, 0, 0),
147 PACAINITDATA(58, 0, NULL, 0, 0),
148 PACAINITDATA(59, 0, NULL, 0, 0),
149 PACAINITDATA(60, 0, NULL, 0, 0),
150 PACAINITDATA(61, 0, NULL, 0, 0),
151 PACAINITDATA(62, 0, NULL, 0, 0),
152 PACAINITDATA(63, 0, NULL, 0, 0),
153#if NR_CPUS > 64 119#if NR_CPUS > 64
154 PACAINITDATA(64, 0, NULL, 0, 0), 120 PACA_INIT( 64), PACA_INIT( 65), PACA_INIT( 66), PACA_INIT( 67),
155 PACAINITDATA(65, 0, NULL, 0, 0), 121 PACA_INIT( 68), PACA_INIT( 69), PACA_INIT( 70), PACA_INIT( 71),
156 PACAINITDATA(66, 0, NULL, 0, 0), 122 PACA_INIT( 72), PACA_INIT( 73), PACA_INIT( 74), PACA_INIT( 75),
157 PACAINITDATA(67, 0, NULL, 0, 0), 123 PACA_INIT( 76), PACA_INIT( 77), PACA_INIT( 78), PACA_INIT( 79),
158 PACAINITDATA(68, 0, NULL, 0, 0), 124 PACA_INIT( 80), PACA_INIT( 81), PACA_INIT( 82), PACA_INIT( 83),
159 PACAINITDATA(69, 0, NULL, 0, 0), 125 PACA_INIT( 84), PACA_INIT( 85), PACA_INIT( 86), PACA_INIT( 87),
160 PACAINITDATA(70, 0, NULL, 0, 0), 126 PACA_INIT( 88), PACA_INIT( 89), PACA_INIT( 90), PACA_INIT( 91),
161 PACAINITDATA(71, 0, NULL, 0, 0), 127 PACA_INIT( 92), PACA_INIT( 93), PACA_INIT( 94), PACA_INIT( 95),
162 PACAINITDATA(72, 0, NULL, 0, 0), 128 PACA_INIT( 96), PACA_INIT( 97), PACA_INIT( 98), PACA_INIT( 99),
163 PACAINITDATA(73, 0, NULL, 0, 0), 129 PACA_INIT(100), PACA_INIT(101), PACA_INIT(102), PACA_INIT(103),
164 PACAINITDATA(74, 0, NULL, 0, 0), 130 PACA_INIT(104), PACA_INIT(105), PACA_INIT(106), PACA_INIT(107),
165 PACAINITDATA(75, 0, NULL, 0, 0), 131 PACA_INIT(108), PACA_INIT(109), PACA_INIT(110), PACA_INIT(111),
166 PACAINITDATA(76, 0, NULL, 0, 0), 132 PACA_INIT(112), PACA_INIT(113), PACA_INIT(114), PACA_INIT(115),
167 PACAINITDATA(77, 0, NULL, 0, 0), 133 PACA_INIT(116), PACA_INIT(117), PACA_INIT(118), PACA_INIT(119),
168 PACAINITDATA(78, 0, NULL, 0, 0), 134 PACA_INIT(120), PACA_INIT(121), PACA_INIT(122), PACA_INIT(123),
169 PACAINITDATA(79, 0, NULL, 0, 0), 135 PACA_INIT(124), PACA_INIT(125), PACA_INIT(126), PACA_INIT(127),
170 PACAINITDATA(80, 0, NULL, 0, 0),
171 PACAINITDATA(81, 0, NULL, 0, 0),
172 PACAINITDATA(82, 0, NULL, 0, 0),
173 PACAINITDATA(83, 0, NULL, 0, 0),
174 PACAINITDATA(84, 0, NULL, 0, 0),
175 PACAINITDATA(85, 0, NULL, 0, 0),
176 PACAINITDATA(86, 0, NULL, 0, 0),
177 PACAINITDATA(87, 0, NULL, 0, 0),
178 PACAINITDATA(88, 0, NULL, 0, 0),
179 PACAINITDATA(89, 0, NULL, 0, 0),
180 PACAINITDATA(90, 0, NULL, 0, 0),
181 PACAINITDATA(91, 0, NULL, 0, 0),
182 PACAINITDATA(92, 0, NULL, 0, 0),
183 PACAINITDATA(93, 0, NULL, 0, 0),
184 PACAINITDATA(94, 0, NULL, 0, 0),
185 PACAINITDATA(95, 0, NULL, 0, 0),
186 PACAINITDATA(96, 0, NULL, 0, 0),
187 PACAINITDATA(97, 0, NULL, 0, 0),
188 PACAINITDATA(98, 0, NULL, 0, 0),
189 PACAINITDATA(99, 0, NULL, 0, 0),
190 PACAINITDATA(100, 0, NULL, 0, 0),
191 PACAINITDATA(101, 0, NULL, 0, 0),
192 PACAINITDATA(102, 0, NULL, 0, 0),
193 PACAINITDATA(103, 0, NULL, 0, 0),
194 PACAINITDATA(104, 0, NULL, 0, 0),
195 PACAINITDATA(105, 0, NULL, 0, 0),
196 PACAINITDATA(106, 0, NULL, 0, 0),
197 PACAINITDATA(107, 0, NULL, 0, 0),
198 PACAINITDATA(108, 0, NULL, 0, 0),
199 PACAINITDATA(109, 0, NULL, 0, 0),
200 PACAINITDATA(110, 0, NULL, 0, 0),
201 PACAINITDATA(111, 0, NULL, 0, 0),
202 PACAINITDATA(112, 0, NULL, 0, 0),
203 PACAINITDATA(113, 0, NULL, 0, 0),
204 PACAINITDATA(114, 0, NULL, 0, 0),
205 PACAINITDATA(115, 0, NULL, 0, 0),
206 PACAINITDATA(116, 0, NULL, 0, 0),
207 PACAINITDATA(117, 0, NULL, 0, 0),
208 PACAINITDATA(118, 0, NULL, 0, 0),
209 PACAINITDATA(119, 0, NULL, 0, 0),
210 PACAINITDATA(120, 0, NULL, 0, 0),
211 PACAINITDATA(121, 0, NULL, 0, 0),
212 PACAINITDATA(122, 0, NULL, 0, 0),
213 PACAINITDATA(123, 0, NULL, 0, 0),
214 PACAINITDATA(124, 0, NULL, 0, 0),
215 PACAINITDATA(125, 0, NULL, 0, 0),
216 PACAINITDATA(126, 0, NULL, 0, 0),
217 PACAINITDATA(127, 0, NULL, 0, 0),
218#endif 136#endif
219#endif 137#endif
220#endif 138#endif
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index 580676f87d23..ae6f579d3fa0 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -351,7 +351,7 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev,
351 *offset += hose->pci_mem_offset; 351 *offset += hose->pci_mem_offset;
352 res_bit = IORESOURCE_MEM; 352 res_bit = IORESOURCE_MEM;
353 } else { 353 } else {
354 io_offset = (unsigned long)hose->io_base_virt; 354 io_offset = (unsigned long)hose->io_base_virt - pci_io_base;
355 *offset += io_offset; 355 *offset += io_offset;
356 res_bit = IORESOURCE_IO; 356 res_bit = IORESOURCE_IO;
357 } 357 }
@@ -378,7 +378,7 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev,
378 378
379 /* found it! construct the final physical address */ 379 /* found it! construct the final physical address */
380 if (mmap_state == pci_mmap_io) 380 if (mmap_state == pci_mmap_io)
381 *offset += hose->io_base_phys - io_offset; 381 *offset += hose->io_base_phys - io_offset;
382 return rp; 382 return rp;
383 } 383 }
384 384
@@ -944,4 +944,22 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
944} 944}
945EXPORT_SYMBOL(pci_read_irq_line); 945EXPORT_SYMBOL(pci_read_irq_line);
946 946
947void pci_resource_to_user(const struct pci_dev *dev, int bar,
948 const struct resource *rsrc,
949 u64 *start, u64 *end)
950{
951 struct pci_controller *hose = pci_bus_to_host(dev->bus);
952 unsigned long offset = 0;
953
954 if (hose == NULL)
955 return;
956
957 if (rsrc->flags & IORESOURCE_IO)
958 offset = pci_io_base - (unsigned long)hose->io_base_virt +
959 hose->io_base_phys;
960
961 *start = rsrc->start + offset;
962 *end = rsrc->end + offset;
963}
964
947#endif /* CONFIG_PPC_MULTIPLATFORM */ 965#endif /* CONFIG_PPC_MULTIPLATFORM */
diff --git a/arch/ppc64/kernel/ppc_ksyms.c b/arch/ppc64/kernel/ppc_ksyms.c
index b230a63fe4c8..705742f4eec6 100644
--- a/arch/ppc64/kernel/ppc_ksyms.c
+++ b/arch/ppc64/kernel/ppc_ksyms.c
@@ -75,6 +75,7 @@ EXPORT_SYMBOL(giveup_fpu);
75EXPORT_SYMBOL(giveup_altivec); 75EXPORT_SYMBOL(giveup_altivec);
76#endif 76#endif
77EXPORT_SYMBOL(__flush_icache_range); 77EXPORT_SYMBOL(__flush_icache_range);
78EXPORT_SYMBOL(flush_dcache_range);
78 79
79#ifdef CONFIG_SMP 80#ifdef CONFIG_SMP
80#ifdef CONFIG_PPC_ISERIES 81#ifdef CONFIG_PPC_ISERIES
diff --git a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c
index aba89554d89d..f7cae05e40fb 100644
--- a/arch/ppc64/kernel/process.c
+++ b/arch/ppc64/kernel/process.c
@@ -36,6 +36,7 @@
36#include <linux/kallsyms.h> 36#include <linux/kallsyms.h>
37#include <linux/interrupt.h> 37#include <linux/interrupt.h>
38#include <linux/utsname.h> 38#include <linux/utsname.h>
39#include <linux/kprobes.h>
39 40
40#include <asm/pgtable.h> 41#include <asm/pgtable.h>
41#include <asm/uaccess.h> 42#include <asm/uaccess.h>
@@ -307,6 +308,8 @@ void show_regs(struct pt_regs * regs)
307 308
308void exit_thread(void) 309void exit_thread(void)
309{ 310{
311 kprobe_flush_task(current);
312
310#ifndef CONFIG_SMP 313#ifndef CONFIG_SMP
311 if (last_task_used_math == current) 314 if (last_task_used_math == current)
312 last_task_used_math = NULL; 315 last_task_used_math = NULL;
@@ -321,6 +324,7 @@ void flush_thread(void)
321{ 324{
322 struct thread_info *t = current_thread_info(); 325 struct thread_info *t = current_thread_info();
323 326
327 kprobe_flush_task(current);
324 if (t->flags & _TIF_ABI_PENDING) 328 if (t->flags & _TIF_ABI_PENDING)
325 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); 329 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);
326 330
diff --git a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c
index c8fa6569b2fd..2f704a2cafb1 100644
--- a/arch/ppc64/kernel/sysfs.c
+++ b/arch/ppc64/kernel/sysfs.c
@@ -400,7 +400,12 @@ static int __init topology_init(void)
400 struct cpu *c = &per_cpu(cpu_devices, cpu); 400 struct cpu *c = &per_cpu(cpu_devices, cpu);
401 401
402#ifdef CONFIG_NUMA 402#ifdef CONFIG_NUMA
403 parent = &node_devices[cpu_to_node(cpu)]; 403 /* The node to which a cpu belongs can't be known
404 * until the cpu is made present.
405 */
406 parent = NULL;
407 if (cpu_present(cpu))
408 parent = &node_devices[cpu_to_node(cpu)];
404#endif 409#endif
405 /* 410 /*
406 * For now, we just see if the system supports making 411 * For now, we just see if the system supports making
diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c
index 2348a75e050d..909462e1adea 100644
--- a/arch/ppc64/kernel/time.c
+++ b/arch/ppc64/kernel/time.c
@@ -91,6 +91,7 @@ unsigned long tb_to_xs;
91unsigned tb_to_us; 91unsigned tb_to_us;
92unsigned long processor_freq; 92unsigned long processor_freq;
93DEFINE_SPINLOCK(rtc_lock); 93DEFINE_SPINLOCK(rtc_lock);
94EXPORT_SYMBOL_GPL(rtc_lock);
94 95
95unsigned long tb_to_ns_scale; 96unsigned long tb_to_ns_scale;
96unsigned long tb_to_ns_shift; 97unsigned long tb_to_ns_shift;
@@ -98,7 +99,6 @@ unsigned long tb_to_ns_shift;
98struct gettimeofday_struct do_gtod; 99struct gettimeofday_struct do_gtod;
99 100
100extern unsigned long wall_jiffies; 101extern unsigned long wall_jiffies;
101extern unsigned long lpevent_count;
102extern int smp_tb_synchronized; 102extern int smp_tb_synchronized;
103 103
104extern struct timezone sys_tz; 104extern struct timezone sys_tz;
@@ -366,11 +366,8 @@ int timer_interrupt(struct pt_regs * regs)
366 set_dec(next_dec); 366 set_dec(next_dec);
367 367
368#ifdef CONFIG_PPC_ISERIES 368#ifdef CONFIG_PPC_ISERIES
369 { 369 if (hvlpevent_is_pending())
370 struct ItLpQueue *lpq = lpaca->lpqueue_ptr; 370 process_hvlpevents(regs);
371 if (lpq && ItLpQueue_isLpIntPending(lpq))
372 lpevent_count += ItLpQueue_process(lpq, regs);
373 }
374#endif 371#endif
375 372
376/* collect purr register values often, for accurate calculations */ 373/* collect purr register values often, for accurate calculations */
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 262e13d086fe..7a117ef473c5 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -270,66 +270,10 @@ endmenu
270 270
271source "drivers/Kconfig" 271source "drivers/Kconfig"
272 272
273config PRINTER
274 tristate "Parallel printer support"
275 depends on PARPORT
276 ---help---
277 If you intend to attach a printer to the parallel port of your Linux
278 box (as opposed to using a serial printer; if the connector at the
279 printer has 9 or 25 holes ["female"], then it's serial), say Y.
280 Also read the Printing-HOWTO, available from
281 <http://www.tldp.org/docs.html#howto>.
282
283 It is possible to share one parallel port among several devices
284 (e.g. printer and ZIP drive) and it is safe to compile the
285 corresponding drivers into the kernel. If you want to compile this
286 driver as a module however, choose M here and read
287 <file:Documentation/parport.txt>. The module will be called lp.
288
289 If you have several parallel ports, you can specify which ports to
290 use with the "lp" kernel command line option. (Try "man bootparam"
291 or see the documentation of your boot loader (silo) about how to pass
292 options to the kernel at boot time.) The syntax of the "lp" command
293 line option can be found in <file:drivers/char/lp.c>.
294
295 If you have more than 8 printers, you need to increase the LP_NO
296 macro in lp.c and the PARPORT_MAX macro in parport.h.
297
298source "mm/Kconfig"
299
300endmenu
301
302source "drivers/base/Kconfig"
303
304source "drivers/video/Kconfig"
305
306source "drivers/mtd/Kconfig"
307
308source "drivers/serial/Kconfig"
309
310if !SUN4 273if !SUN4
311source "drivers/sbus/char/Kconfig" 274source "drivers/sbus/char/Kconfig"
312endif 275endif
313 276
314source "drivers/block/Kconfig"
315
316# Don't frighten a common SBus user
317if PCI
318
319source "drivers/ide/Kconfig"
320
321endif
322
323source "drivers/isdn/Kconfig"
324
325source "drivers/scsi/Kconfig"
326
327source "drivers/fc4/Kconfig"
328
329source "drivers/md/Kconfig"
330
331source "net/Kconfig"
332
333# This one must be before the filesystem configs. -DaveM 277# This one must be before the filesystem configs. -DaveM
334 278
335menu "Unix98 PTY support" 279menu "Unix98 PTY support"
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index e2b050eb3b96..d78bc13ebbb9 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -444,6 +444,24 @@ config PRINTER
444 If you have more than 8 printers, you need to increase the LP_NO 444 If you have more than 8 printers, you need to increase the LP_NO
445 macro in lp.c and the PARPORT_MAX macro in parport.h. 445 macro in lp.c and the PARPORT_MAX macro in parport.h.
446 446
447config PPDEV
448 tristate "Support for user-space parallel port device drivers"
449 depends on PARPORT
450 ---help---
451 Saying Y to this adds support for /dev/parport device nodes. This
452 is needed for programs that want portable access to the parallel
453 port, for instance deviceid (which displays Plug-and-Play device
454 IDs).
455
456 This is the parallel port equivalent of SCSI generic support (sg).
457 It is safe to say N to this -- it is not needed for normal printing
458 or parallel port CD-ROM/disk support.
459
460 To compile this driver as a module, choose M here: the
461 module will be called ppdev.
462
463 If unsure, say N.
464
447config ENVCTRL 465config ENVCTRL
448 tristate "SUNW, envctrl support" 466 tristate "SUNW, envctrl support"
449 depends on PCI 467 depends on PCI
diff --git a/arch/sparc64/kernel/auxio.c b/arch/sparc64/kernel/auxio.c
index a0716ccc2f4a..8852c20c8d99 100644
--- a/arch/sparc64/kernel/auxio.c
+++ b/arch/sparc64/kernel/auxio.c
@@ -16,7 +16,7 @@
16#include <asm/ebus.h> 16#include <asm/ebus.h>
17#include <asm/auxio.h> 17#include <asm/auxio.h>
18 18
19/* This cannot be static, as it is referenced in entry.S */ 19/* This cannot be static, as it is referenced in irq.c */
20void __iomem *auxio_register = NULL; 20void __iomem *auxio_register = NULL;
21 21
22enum auxio_type { 22enum auxio_type {
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index a47f2d0b1a29..d3973d8a7195 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -271,8 +271,9 @@ cplus_fptrap_insn_1:
271 fmuld %f0, %f2, %f26 271 fmuld %f0, %f2, %f26
272 faddd %f0, %f2, %f28 272 faddd %f0, %f2, %f28
273 fmuld %f0, %f2, %f30 273 fmuld %f0, %f2, %f30
274 membar #Sync
274 b,pt %xcc, fpdis_exit 275 b,pt %xcc, fpdis_exit
275 membar #Sync 276 nop
2762: andcc %g5, FPRS_DU, %g0 2772: andcc %g5, FPRS_DU, %g0
277 bne,pt %icc, 3f 278 bne,pt %icc, 3f
278 fzero %f32 279 fzero %f32
@@ -301,8 +302,9 @@ cplus_fptrap_insn_2:
301 fmuld %f32, %f34, %f58 302 fmuld %f32, %f34, %f58
302 faddd %f32, %f34, %f60 303 faddd %f32, %f34, %f60
303 fmuld %f32, %f34, %f62 304 fmuld %f32, %f34, %f62
305 membar #Sync
304 ba,pt %xcc, fpdis_exit 306 ba,pt %xcc, fpdis_exit
305 membar #Sync 307 nop
3063: mov SECONDARY_CONTEXT, %g3 3083: mov SECONDARY_CONTEXT, %g3
307 add %g6, TI_FPREGS, %g1 309 add %g6, TI_FPREGS, %g1
308 ldxa [%g3] ASI_DMMU, %g5 310 ldxa [%g3] ASI_DMMU, %g5
@@ -551,13 +553,11 @@ do_ivec:
551 sllx %g3, 5, %g3 553 sllx %g3, 5, %g3
552 or %g2, %lo(ivector_table), %g2 554 or %g2, %lo(ivector_table), %g2
553 add %g2, %g3, %g3 555 add %g2, %g3, %g3
554 ldx [%g3 + 0x08], %g2 /* irq_info */
555 ldub [%g3 + 0x04], %g4 /* pil */ 556 ldub [%g3 + 0x04], %g4 /* pil */
556 brz,pn %g2, do_ivec_spurious 557 mov 1, %g2
557 mov 1, %g2
558
559 sllx %g2, %g4, %g2 558 sllx %g2, %g4, %g2
560 sllx %g4, 2, %g4 559 sllx %g4, 2, %g4
560
561 lduw [%g6 + %g4], %g5 /* g5 = irq_work(cpu, pil) */ 561 lduw [%g6 + %g4], %g5 /* g5 = irq_work(cpu, pil) */
562 stw %g5, [%g3 + 0x00] /* bucket->irq_chain = g5 */ 562 stw %g5, [%g3 + 0x00] /* bucket->irq_chain = g5 */
563 stw %g3, [%g6 + %g4] /* irq_work(cpu, pil) = bucket */ 563 stw %g3, [%g6 + %g4] /* irq_work(cpu, pil) = bucket */
@@ -565,9 +565,9 @@ do_ivec:
565 retry 565 retry
566do_ivec_xcall: 566do_ivec_xcall:
567 mov 0x50, %g1 567 mov 0x50, %g1
568
569 ldxa [%g1 + %g0] ASI_INTR_R, %g1 568 ldxa [%g1 + %g0] ASI_INTR_R, %g1
570 srl %g3, 0, %g3 569 srl %g3, 0, %g3
570
571 mov 0x60, %g7 571 mov 0x60, %g7
572 ldxa [%g7 + %g0] ASI_INTR_R, %g7 572 ldxa [%g7 + %g0] ASI_INTR_R, %g7
573 stxa %g0, [%g0] ASI_INTR_RECEIVE 573 stxa %g0, [%g0] ASI_INTR_RECEIVE
@@ -579,19 +579,6 @@ do_ivec_xcall:
5791: jmpl %g3, %g0 5791: jmpl %g3, %g0
580 nop 580 nop
581 581
582do_ivec_spurious:
583 stw %g3, [%g6 + 0x00] /* irq_work(cpu, 0) = bucket */
584 rdpr %pstate, %g5
585
586 wrpr %g5, PSTATE_IG | PSTATE_AG, %pstate
587 sethi %hi(109f), %g7
588 ba,pt %xcc, etrap
589109: or %g7, %lo(109b), %g7
590 call catch_disabled_ivec
591 add %sp, PTREGS_OFF, %o0
592 ba,pt %xcc, rtrap
593 clr %l6
594
595 .globl save_alternate_globals 582 .globl save_alternate_globals
596save_alternate_globals: /* %o0 = save_area */ 583save_alternate_globals: /* %o0 = save_area */
597 rdpr %pstate, %o5 584 rdpr %pstate, %o5
@@ -699,116 +686,6 @@ utrap_ill:
699 ba,pt %xcc, rtrap 686 ba,pt %xcc, rtrap
700 clr %l6 687 clr %l6
701 688
702#ifdef CONFIG_BLK_DEV_FD
703 .globl floppy_hardint
704floppy_hardint:
705 wr %g0, (1 << 11), %clear_softint
706 sethi %hi(doing_pdma), %g1
707 ld [%g1 + %lo(doing_pdma)], %g2
708 brz,pn %g2, floppy_dosoftint
709 sethi %hi(fdc_status), %g3
710 ldx [%g3 + %lo(fdc_status)], %g3
711 sethi %hi(pdma_vaddr), %g5
712 ldx [%g5 + %lo(pdma_vaddr)], %g4
713 sethi %hi(pdma_size), %g5
714 ldx [%g5 + %lo(pdma_size)], %g5
715
716next_byte:
717 lduba [%g3] ASI_PHYS_BYPASS_EC_E, %g7
718 andcc %g7, 0x80, %g0
719 be,pn %icc, floppy_fifo_emptied
720 andcc %g7, 0x20, %g0
721 be,pn %icc, floppy_overrun
722 andcc %g7, 0x40, %g0
723 be,pn %icc, floppy_write
724 sub %g5, 1, %g5
725
726 inc %g3
727 lduba [%g3] ASI_PHYS_BYPASS_EC_E, %g7
728 dec %g3
729 orcc %g0, %g5, %g0
730 stb %g7, [%g4]
731 bne,pn %xcc, next_byte
732 add %g4, 1, %g4
733
734 b,pt %xcc, floppy_tdone
735 nop
736
737floppy_write:
738 ldub [%g4], %g7
739 orcc %g0, %g5, %g0
740 inc %g3
741 stba %g7, [%g3] ASI_PHYS_BYPASS_EC_E
742 dec %g3
743 bne,pn %xcc, next_byte
744 add %g4, 1, %g4
745
746floppy_tdone:
747 sethi %hi(pdma_vaddr), %g1
748 stx %g4, [%g1 + %lo(pdma_vaddr)]
749 sethi %hi(pdma_size), %g1
750 stx %g5, [%g1 + %lo(pdma_size)]
751 sethi %hi(auxio_register), %g1
752 ldx [%g1 + %lo(auxio_register)], %g7
753 lduba [%g7] ASI_PHYS_BYPASS_EC_E, %g5
754 or %g5, AUXIO_AUX1_FTCNT, %g5
755/* andn %g5, AUXIO_AUX1_MASK, %g5 */
756 stba %g5, [%g7] ASI_PHYS_BYPASS_EC_E
757 andn %g5, AUXIO_AUX1_FTCNT, %g5
758/* andn %g5, AUXIO_AUX1_MASK, %g5 */
759
760 nop; nop; nop; nop; nop; nop;
761 nop; nop; nop; nop; nop; nop;
762
763 stba %g5, [%g7] ASI_PHYS_BYPASS_EC_E
764 sethi %hi(doing_pdma), %g1
765 b,pt %xcc, floppy_dosoftint
766 st %g0, [%g1 + %lo(doing_pdma)]
767
768floppy_fifo_emptied:
769 sethi %hi(pdma_vaddr), %g1
770 stx %g4, [%g1 + %lo(pdma_vaddr)]
771 sethi %hi(pdma_size), %g1
772 stx %g5, [%g1 + %lo(pdma_size)]
773 sethi %hi(irq_action), %g1
774 or %g1, %lo(irq_action), %g1
775 ldx [%g1 + (11 << 3)], %g3 ! irqaction[floppy_irq]
776 ldx [%g3 + 0x08], %g4 ! action->flags>>48==ino
777 sethi %hi(ivector_table), %g3
778 srlx %g4, 48, %g4
779 or %g3, %lo(ivector_table), %g3
780 sllx %g4, 5, %g4
781 ldx [%g3 + %g4], %g4 ! &ivector_table[ino]
782 ldx [%g4 + 0x10], %g4 ! bucket->iclr
783 stwa %g0, [%g4] ASI_PHYS_BYPASS_EC_E ! ICLR_IDLE
784 membar #Sync ! probably not needed...
785 retry
786
787floppy_overrun:
788 sethi %hi(pdma_vaddr), %g1
789 stx %g4, [%g1 + %lo(pdma_vaddr)]
790 sethi %hi(pdma_size), %g1
791 stx %g5, [%g1 + %lo(pdma_size)]
792 sethi %hi(doing_pdma), %g1
793 st %g0, [%g1 + %lo(doing_pdma)]
794
795floppy_dosoftint:
796 rdpr %pil, %g2
797 wrpr %g0, 15, %pil
798 sethi %hi(109f), %g7
799 b,pt %xcc, etrap_irq
800109: or %g7, %lo(109b), %g7
801
802 mov 11, %o0
803 mov 0, %o1
804 call sparc_floppy_irq
805 add %sp, PTREGS_OFF, %o2
806
807 b,pt %xcc, rtrap_irq
808 nop
809
810#endif /* CONFIG_BLK_DEV_FD */
811
812 /* XXX Here is stuff we still need to write... -DaveM XXX */ 689 /* XXX Here is stuff we still need to write... -DaveM XXX */
813 .globl netbsd_syscall 690 .globl netbsd_syscall
814netbsd_syscall: 691netbsd_syscall:
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 4dcb8af94090..74a2e0808cbc 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -37,6 +37,7 @@
37#include <asm/uaccess.h> 37#include <asm/uaccess.h>
38#include <asm/cache.h> 38#include <asm/cache.h>
39#include <asm/cpudata.h> 39#include <asm/cpudata.h>
40#include <asm/auxio.h>
40 41
41#ifdef CONFIG_SMP 42#ifdef CONFIG_SMP
42static void distribute_irqs(void); 43static void distribute_irqs(void);
@@ -70,31 +71,7 @@ struct irq_work_struct {
70struct irq_work_struct __irq_work[NR_CPUS]; 71struct irq_work_struct __irq_work[NR_CPUS];
71#define irq_work(__cpu, __pil) &(__irq_work[(__cpu)].irq_worklists[(__pil)]) 72#define irq_work(__cpu, __pil) &(__irq_work[(__cpu)].irq_worklists[(__pil)])
72 73
73#ifdef CONFIG_PCI 74static struct irqaction *irq_action[NR_IRQS+1];
74/* This is a table of physical addresses used to deal with IBF_DMA_SYNC.
75 * It is used for PCI only to synchronize DMA transfers with IRQ delivery
76 * for devices behind busses other than APB on Sabre systems.
77 *
78 * Currently these physical addresses are just config space accesses
79 * to the command register for that device.
80 */
81unsigned long pci_dma_wsync;
82unsigned long dma_sync_reg_table[256];
83unsigned char dma_sync_reg_table_entry = 0;
84#endif
85
86/* This is based upon code in the 32-bit Sparc kernel written mostly by
87 * David Redman (djhr@tadpole.co.uk).
88 */
89#define MAX_STATIC_ALLOC 4
90static struct irqaction static_irqaction[MAX_STATIC_ALLOC];
91static int static_irq_count;
92
93/* This is exported so that fast IRQ handlers can get at it... -DaveM */
94struct irqaction *irq_action[NR_IRQS+1] = {
95 NULL, NULL, NULL, NULL, NULL, NULL , NULL, NULL,
96 NULL, NULL, NULL, NULL, NULL, NULL , NULL, NULL
97};
98 75
99/* This only synchronizes entities which modify IRQ handler 76/* This only synchronizes entities which modify IRQ handler
100 * state and some selected user-level spots that want to 77 * state and some selected user-level spots that want to
@@ -240,17 +217,22 @@ void disable_irq(unsigned int irq)
240 * the CPU %tick register and not by some normal vectored interrupt 217 * the CPU %tick register and not by some normal vectored interrupt
241 * source. To handle this special case, we use this dummy INO bucket. 218 * source. To handle this special case, we use this dummy INO bucket.
242 */ 219 */
220static struct irq_desc pil0_dummy_desc;
243static struct ino_bucket pil0_dummy_bucket = { 221static struct ino_bucket pil0_dummy_bucket = {
244 0, /* irq_chain */ 222 .irq_info = &pil0_dummy_desc,
245 0, /* pil */
246 0, /* pending */
247 0, /* flags */
248 0, /* __unused */
249 NULL, /* irq_info */
250 0UL, /* iclr */
251 0UL, /* imap */
252}; 223};
253 224
225static void build_irq_error(const char *msg, unsigned int ino, int pil, int inofixup,
226 unsigned long iclr, unsigned long imap,
227 struct ino_bucket *bucket)
228{
229 prom_printf("IRQ: INO %04x (%d:%016lx:%016lx) --> "
230 "(%d:%d:%016lx:%016lx), halting...\n",
231 ino, bucket->pil, bucket->iclr, bucket->imap,
232 pil, inofixup, iclr, imap);
233 prom_halt();
234}
235
254unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap) 236unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap)
255{ 237{
256 struct ino_bucket *bucket; 238 struct ino_bucket *bucket;
@@ -279,28 +261,35 @@ unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long
279 prom_halt(); 261 prom_halt();
280 } 262 }
281 263
282 /* Ok, looks good, set it up. Don't touch the irq_chain or
283 * the pending flag.
284 */
285 bucket = &ivector_table[ino]; 264 bucket = &ivector_table[ino];
286 if ((bucket->flags & IBF_ACTIVE) || 265 if (bucket->flags & IBF_ACTIVE)
287 (bucket->irq_info != NULL)) { 266 build_irq_error("IRQ: Trying to build active INO bucket.\n",
288 /* This is a gross fatal error if it happens here. */ 267 ino, pil, inofixup, iclr, imap, bucket);
289 prom_printf("IRQ: Trying to reinit INO bucket, fatal error.\n"); 268
290 prom_printf("IRQ: Request INO %04x (%d:%d:%016lx:%016lx)\n", 269 if (bucket->irq_info) {
291 ino, pil, inofixup, iclr, imap); 270 if (bucket->imap != imap || bucket->iclr != iclr)
292 prom_printf("IRQ: Existing (%d:%016lx:%016lx)\n", 271 build_irq_error("IRQ: Trying to reinit INO bucket.\n",
293 bucket->pil, bucket->iclr, bucket->imap); 272 ino, pil, inofixup, iclr, imap, bucket);
294 prom_printf("IRQ: Cannot continue, halting...\n"); 273
274 goto out;
275 }
276
277 bucket->irq_info = kmalloc(sizeof(struct irq_desc), GFP_ATOMIC);
278 if (!bucket->irq_info) {
279 prom_printf("IRQ: Error, kmalloc(irq_desc) failed.\n");
295 prom_halt(); 280 prom_halt();
296 } 281 }
282 memset(bucket->irq_info, 0, sizeof(struct irq_desc));
283
284 /* Ok, looks good, set it up. Don't touch the irq_chain or
285 * the pending flag.
286 */
297 bucket->imap = imap; 287 bucket->imap = imap;
298 bucket->iclr = iclr; 288 bucket->iclr = iclr;
299 bucket->pil = pil; 289 bucket->pil = pil;
300 bucket->flags = 0; 290 bucket->flags = 0;
301 291
302 bucket->irq_info = NULL; 292out:
303
304 return __irq(bucket); 293 return __irq(bucket);
305} 294}
306 295
@@ -318,26 +307,65 @@ static void atomic_bucket_insert(struct ino_bucket *bucket)
318 __asm__ __volatile__("wrpr %0, 0x0, %%pstate" : : "r" (pstate)); 307 __asm__ __volatile__("wrpr %0, 0x0, %%pstate" : : "r" (pstate));
319} 308}
320 309
310static int check_irq_sharing(int pil, unsigned long irqflags)
311{
312 struct irqaction *action, *tmp;
313
314 action = *(irq_action + pil);
315 if (action) {
316 if ((action->flags & SA_SHIRQ) && (irqflags & SA_SHIRQ)) {
317 for (tmp = action; tmp->next; tmp = tmp->next)
318 ;
319 } else {
320 return -EBUSY;
321 }
322 }
323 return 0;
324}
325
326static void append_irq_action(int pil, struct irqaction *action)
327{
328 struct irqaction **pp = irq_action + pil;
329
330 while (*pp)
331 pp = &((*pp)->next);
332 *pp = action;
333}
334
335static struct irqaction *get_action_slot(struct ino_bucket *bucket)
336{
337 struct irq_desc *desc = bucket->irq_info;
338 int max_irq, i;
339
340 max_irq = 1;
341 if (bucket->flags & IBF_PCI)
342 max_irq = MAX_IRQ_DESC_ACTION;
343 for (i = 0; i < max_irq; i++) {
344 struct irqaction *p = &desc->action[i];
345 u32 mask = (1 << i);
346
347 if (desc->action_active_mask & mask)
348 continue;
349
350 desc->action_active_mask |= mask;
351 return p;
352 }
353 return NULL;
354}
355
321int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), 356int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *),
322 unsigned long irqflags, const char *name, void *dev_id) 357 unsigned long irqflags, const char *name, void *dev_id)
323{ 358{
324 struct irqaction *action, *tmp = NULL; 359 struct irqaction *action;
325 struct ino_bucket *bucket = __bucket(irq); 360 struct ino_bucket *bucket = __bucket(irq);
326 unsigned long flags; 361 unsigned long flags;
327 int pending = 0; 362 int pending = 0;
328 363
329 if ((bucket != &pil0_dummy_bucket) && 364 if (unlikely(!handler))
330 (bucket < &ivector_table[0] ||
331 bucket >= &ivector_table[NUM_IVECS])) {
332 unsigned int *caller;
333
334 __asm__ __volatile__("mov %%i7, %0" : "=r" (caller));
335 printk(KERN_CRIT "request_irq: Old style IRQ registry attempt "
336 "from %p, irq %08x.\n", caller, irq);
337 return -EINVAL; 365 return -EINVAL;
338 } 366
339 if (!handler) 367 if (unlikely(!bucket->irq_info))
340 return -EINVAL; 368 return -ENODEV;
341 369
342 if ((bucket != &pil0_dummy_bucket) && (irqflags & SA_SAMPLE_RANDOM)) { 370 if ((bucket != &pil0_dummy_bucket) && (irqflags & SA_SAMPLE_RANDOM)) {
343 /* 371 /*
@@ -355,93 +383,20 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_
355 383
356 spin_lock_irqsave(&irq_action_lock, flags); 384 spin_lock_irqsave(&irq_action_lock, flags);
357 385
358 action = *(bucket->pil + irq_action); 386 if (check_irq_sharing(bucket->pil, irqflags)) {
359 if (action) { 387 spin_unlock_irqrestore(&irq_action_lock, flags);
360 if ((action->flags & SA_SHIRQ) && (irqflags & SA_SHIRQ)) 388 return -EBUSY;
361 for (tmp = action; tmp->next; tmp = tmp->next)
362 ;
363 else {
364 spin_unlock_irqrestore(&irq_action_lock, flags);
365 return -EBUSY;
366 }
367 action = NULL; /* Or else! */
368 } 389 }
369 390
370 /* If this is flagged as statically allocated then we use our 391 action = get_action_slot(bucket);
371 * private struct which is never freed.
372 */
373 if (irqflags & SA_STATIC_ALLOC) {
374 if (static_irq_count < MAX_STATIC_ALLOC)
375 action = &static_irqaction[static_irq_count++];
376 else
377 printk("Request for IRQ%d (%s) SA_STATIC_ALLOC failed "
378 "using kmalloc\n", irq, name);
379 }
380 if (action == NULL)
381 action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
382 GFP_ATOMIC);
383
384 if (!action) { 392 if (!action) {
385 spin_unlock_irqrestore(&irq_action_lock, flags); 393 spin_unlock_irqrestore(&irq_action_lock, flags);
386 return -ENOMEM; 394 return -ENOMEM;
387 } 395 }
388 396
389 if (bucket == &pil0_dummy_bucket) { 397 bucket->flags |= IBF_ACTIVE;
390 bucket->irq_info = action; 398 pending = 0;
391 bucket->flags |= IBF_ACTIVE; 399 if (bucket != &pil0_dummy_bucket) {
392 } else {
393 if ((bucket->flags & IBF_ACTIVE) != 0) {
394 void *orig = bucket->irq_info;
395 void **vector = NULL;
396
397 if ((bucket->flags & IBF_PCI) == 0) {
398 printk("IRQ: Trying to share non-PCI bucket.\n");
399 goto free_and_ebusy;
400 }
401 if ((bucket->flags & IBF_MULTI) == 0) {
402 vector = kmalloc(sizeof(void *) * 4, GFP_ATOMIC);
403 if (vector == NULL)
404 goto free_and_enomem;
405
406 /* We might have slept. */
407 if ((bucket->flags & IBF_MULTI) != 0) {
408 int ent;
409
410 kfree(vector);
411 vector = (void **)bucket->irq_info;
412 for(ent = 0; ent < 4; ent++) {
413 if (vector[ent] == NULL) {
414 vector[ent] = action;
415 break;
416 }
417 }
418 if (ent == 4)
419 goto free_and_ebusy;
420 } else {
421 vector[0] = orig;
422 vector[1] = action;
423 vector[2] = NULL;
424 vector[3] = NULL;
425 bucket->irq_info = vector;
426 bucket->flags |= IBF_MULTI;
427 }
428 } else {
429 int ent;
430
431 vector = (void **)orig;
432 for (ent = 0; ent < 4; ent++) {
433 if (vector[ent] == NULL) {
434 vector[ent] = action;
435 break;
436 }
437 }
438 if (ent == 4)
439 goto free_and_ebusy;
440 }
441 } else {
442 bucket->irq_info = action;
443 bucket->flags |= IBF_ACTIVE;
444 }
445 pending = bucket->pending; 400 pending = bucket->pending;
446 if (pending) 401 if (pending)
447 bucket->pending = 0; 402 bucket->pending = 0;
@@ -455,10 +410,7 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_
455 put_ino_in_irqaction(action, irq); 410 put_ino_in_irqaction(action, irq);
456 put_smpaff_in_irqaction(action, CPU_MASK_NONE); 411 put_smpaff_in_irqaction(action, CPU_MASK_NONE);
457 412
458 if (tmp) 413 append_irq_action(bucket->pil, action);
459 tmp->next = action;
460 else
461 *(bucket->pil + irq_action) = action;
462 414
463 enable_irq(irq); 415 enable_irq(irq);
464 416
@@ -467,147 +419,103 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_
467 atomic_bucket_insert(bucket); 419 atomic_bucket_insert(bucket);
468 set_softint(1 << bucket->pil); 420 set_softint(1 << bucket->pil);
469 } 421 }
422
470 spin_unlock_irqrestore(&irq_action_lock, flags); 423 spin_unlock_irqrestore(&irq_action_lock, flags);
471 if ((bucket != &pil0_dummy_bucket) && (!(irqflags & SA_STATIC_ALLOC))) 424
425 if (bucket != &pil0_dummy_bucket)
472 register_irq_proc(__irq_ino(irq)); 426 register_irq_proc(__irq_ino(irq));
473 427
474#ifdef CONFIG_SMP 428#ifdef CONFIG_SMP
475 distribute_irqs(); 429 distribute_irqs();
476#endif 430#endif
477 return 0; 431 return 0;
478
479free_and_ebusy:
480 kfree(action);
481 spin_unlock_irqrestore(&irq_action_lock, flags);
482 return -EBUSY;
483
484free_and_enomem:
485 kfree(action);
486 spin_unlock_irqrestore(&irq_action_lock, flags);
487 return -ENOMEM;
488} 432}
489 433
490EXPORT_SYMBOL(request_irq); 434EXPORT_SYMBOL(request_irq);
491 435
492void free_irq(unsigned int irq, void *dev_id) 436static struct irqaction *unlink_irq_action(unsigned int irq, void *dev_id)
493{ 437{
494 struct irqaction *action; 438 struct ino_bucket *bucket = __bucket(irq);
495 struct irqaction *tmp = NULL; 439 struct irqaction *action, **pp;
496 unsigned long flags;
497 struct ino_bucket *bucket = __bucket(irq), *bp;
498 440
499 if ((bucket != &pil0_dummy_bucket) && 441 pp = irq_action + bucket->pil;
500 (bucket < &ivector_table[0] || 442 action = *pp;
501 bucket >= &ivector_table[NUM_IVECS])) { 443 if (unlikely(!action))
502 unsigned int *caller; 444 return NULL;
503 445
504 __asm__ __volatile__("mov %%i7, %0" : "=r" (caller)); 446 if (unlikely(!action->handler)) {
505 printk(KERN_CRIT "free_irq: Old style IRQ removal attempt "
506 "from %p, irq %08x.\n", caller, irq);
507 return;
508 }
509
510 spin_lock_irqsave(&irq_action_lock, flags);
511
512 action = *(bucket->pil + irq_action);
513 if (!action->handler) {
514 printk("Freeing free IRQ %d\n", bucket->pil); 447 printk("Freeing free IRQ %d\n", bucket->pil);
515 return; 448 return NULL;
516 }
517 if (dev_id) {
518 for ( ; action; action = action->next) {
519 if (action->dev_id == dev_id)
520 break;
521 tmp = action;
522 }
523 if (!action) {
524 printk("Trying to free free shared IRQ %d\n", bucket->pil);
525 spin_unlock_irqrestore(&irq_action_lock, flags);
526 return;
527 }
528 } else if (action->flags & SA_SHIRQ) {
529 printk("Trying to free shared IRQ %d with NULL device ID\n", bucket->pil);
530 spin_unlock_irqrestore(&irq_action_lock, flags);
531 return;
532 } 449 }
533 450
534 if (action->flags & SA_STATIC_ALLOC) { 451 while (action && action->dev_id != dev_id) {
535 printk("Attempt to free statically allocated IRQ %d (%s)\n", 452 pp = &action->next;
536 bucket->pil, action->name); 453 action = *pp;
537 spin_unlock_irqrestore(&irq_action_lock, flags);
538 return;
539 } 454 }
540 455
541 if (action && tmp) 456 if (likely(action))
542 tmp->next = action->next; 457 *pp = action->next;
543 else 458
544 *(bucket->pil + irq_action) = action->next; 459 return action;
460}
461
462void free_irq(unsigned int irq, void *dev_id)
463{
464 struct irqaction *action;
465 struct ino_bucket *bucket;
466 unsigned long flags;
467
468 spin_lock_irqsave(&irq_action_lock, flags);
469
470 action = unlink_irq_action(irq, dev_id);
545 471
546 spin_unlock_irqrestore(&irq_action_lock, flags); 472 spin_unlock_irqrestore(&irq_action_lock, flags);
547 473
474 if (unlikely(!action))
475 return;
476
548 synchronize_irq(irq); 477 synchronize_irq(irq);
549 478
550 spin_lock_irqsave(&irq_action_lock, flags); 479 spin_lock_irqsave(&irq_action_lock, flags);
551 480
481 bucket = __bucket(irq);
552 if (bucket != &pil0_dummy_bucket) { 482 if (bucket != &pil0_dummy_bucket) {
483 struct irq_desc *desc = bucket->irq_info;
553 unsigned long imap = bucket->imap; 484 unsigned long imap = bucket->imap;
554 void **vector, *orig; 485 int ent, i;
555 int ent;
556
557 orig = bucket->irq_info;
558 vector = (void **)orig;
559
560 if ((bucket->flags & IBF_MULTI) != 0) {
561 int other = 0;
562 void *orphan = NULL;
563 for (ent = 0; ent < 4; ent++) {
564 if (vector[ent] == action)
565 vector[ent] = NULL;
566 else if (vector[ent] != NULL) {
567 orphan = vector[ent];
568 other++;
569 }
570 }
571 486
572 /* Only free when no other shared irq 487 for (i = 0; i < MAX_IRQ_DESC_ACTION; i++) {
573 * uses this bucket. 488 struct irqaction *p = &desc->action[i];
574 */ 489
575 if (other) { 490 if (p == action) {
576 if (other == 1) { 491 desc->action_active_mask &= ~(1 << i);
577 /* Convert back to non-shared bucket. */ 492 break;
578 bucket->irq_info = orphan;
579 bucket->flags &= ~(IBF_MULTI);
580 kfree(vector);
581 }
582 goto out;
583 } 493 }
584 } else {
585 bucket->irq_info = NULL;
586 } 494 }
587 495
588 /* This unique interrupt source is now inactive. */ 496 if (!desc->action_active_mask) {
589 bucket->flags &= ~IBF_ACTIVE; 497 /* This unique interrupt source is now inactive. */
498 bucket->flags &= ~IBF_ACTIVE;
590 499
591 /* See if any other buckets share this bucket's IMAP 500 /* See if any other buckets share this bucket's IMAP
592 * and are still active. 501 * and are still active.
593 */ 502 */
594 for (ent = 0; ent < NUM_IVECS; ent++) { 503 for (ent = 0; ent < NUM_IVECS; ent++) {
595 bp = &ivector_table[ent]; 504 struct ino_bucket *bp = &ivector_table[ent];
596 if (bp != bucket && 505 if (bp != bucket &&
597 bp->imap == imap && 506 bp->imap == imap &&
598 (bp->flags & IBF_ACTIVE) != 0) 507 (bp->flags & IBF_ACTIVE) != 0)
599 break; 508 break;
600 } 509 }
601 510
602 /* Only disable when no other sub-irq levels of 511 /* Only disable when no other sub-irq levels of
603 * the same IMAP are active. 512 * the same IMAP are active.
604 */ 513 */
605 if (ent == NUM_IVECS) 514 if (ent == NUM_IVECS)
606 disable_irq(irq); 515 disable_irq(irq);
516 }
607 } 517 }
608 518
609out:
610 kfree(action);
611 spin_unlock_irqrestore(&irq_action_lock, flags); 519 spin_unlock_irqrestore(&irq_action_lock, flags);
612} 520}
613 521
@@ -646,99 +554,55 @@ void synchronize_irq(unsigned int irq)
646} 554}
647#endif /* CONFIG_SMP */ 555#endif /* CONFIG_SMP */
648 556
649void catch_disabled_ivec(struct pt_regs *regs) 557static void process_bucket(int irq, struct ino_bucket *bp, struct pt_regs *regs)
650{
651 int cpu = smp_processor_id();
652 struct ino_bucket *bucket = __bucket(*irq_work(cpu, 0));
653
654 /* We can actually see this on Ultra/PCI PCI cards, which are bridges
655 * to other devices. Here a single IMAP enabled potentially multiple
656 * unique interrupt sources (which each do have a unique ICLR register.
657 *
658 * So what we do is just register that the IVEC arrived, when registered
659 * for real the request_irq() code will check the bit and signal
660 * a local CPU interrupt for it.
661 */
662#if 0
663 printk("IVEC: Spurious interrupt vector (%x) received at (%016lx)\n",
664 bucket - &ivector_table[0], regs->tpc);
665#endif
666 *irq_work(cpu, 0) = 0;
667 bucket->pending = 1;
668}
669
670/* Tune this... */
671#define FORWARD_VOLUME 12
672
673#ifdef CONFIG_SMP
674
675static inline void redirect_intr(int cpu, struct ino_bucket *bp)
676{ 558{
677 /* Ok, here is what is going on: 559 struct irq_desc *desc = bp->irq_info;
678 * 1) Retargeting IRQs on Starfire is very 560 unsigned char flags = bp->flags;
679 * expensive so just forget about it on them. 561 u32 action_mask, i;
680 * 2) Moving around very high priority interrupts 562 int random;
681 * is a losing game.
682 * 3) If the current cpu is idle, interrupts are
683 * useful work, so keep them here. But do not
684 * pass to our neighbour if he is not very idle.
685 * 4) If sysadmin explicitly asks for directed intrs,
686 * Just Do It.
687 */
688 struct irqaction *ap = bp->irq_info;
689 cpumask_t cpu_mask;
690 unsigned int buddy, ticks;
691 563
692 cpu_mask = get_smpaff_in_irqaction(ap); 564 bp->flags |= IBF_INPROGRESS;
693 cpus_and(cpu_mask, cpu_mask, cpu_online_map);
694 if (cpus_empty(cpu_mask))
695 cpu_mask = cpu_online_map;
696 565
697 if (this_is_starfire != 0 || 566 if (unlikely(!(flags & IBF_ACTIVE))) {
698 bp->pil >= 10 || current->pid == 0) 567 bp->pending = 1;
699 goto out; 568 goto out;
700
701 /* 'cpu' is the MID (ie. UPAID), calculate the MID
702 * of our buddy.
703 */
704 buddy = cpu + 1;
705 if (buddy >= NR_CPUS)
706 buddy = 0;
707
708 ticks = 0;
709 while (!cpu_isset(buddy, cpu_mask)) {
710 if (++buddy >= NR_CPUS)
711 buddy = 0;
712 if (++ticks > NR_CPUS) {
713 put_smpaff_in_irqaction(ap, CPU_MASK_NONE);
714 goto out;
715 }
716 } 569 }
717 570
718 if (buddy == cpu) 571 if (desc->pre_handler)
719 goto out; 572 desc->pre_handler(bp,
573 desc->pre_handler_arg1,
574 desc->pre_handler_arg2);
720 575
721 /* Voo-doo programming. */ 576 action_mask = desc->action_active_mask;
722 if (cpu_data(buddy).idle_volume < FORWARD_VOLUME) 577 random = 0;
723 goto out; 578 for (i = 0; i < MAX_IRQ_DESC_ACTION; i++) {
579 struct irqaction *p = &desc->action[i];
580 u32 mask = (1 << i);
724 581
725 /* This just so happens to be correct on Cheetah 582 if (!(action_mask & mask))
726 * at the moment. 583 continue;
727 */
728 buddy <<= 26;
729 584
730 /* Push it to our buddy. */ 585 action_mask &= ~mask;
731 upa_writel(buddy | IMAP_VALID, bp->imap);
732 586
587 if (p->handler(__irq(bp), p->dev_id, regs) == IRQ_HANDLED)
588 random |= p->flags;
589
590 if (!action_mask)
591 break;
592 }
593 if (bp->pil != 0) {
594 upa_writel(ICLR_IDLE, bp->iclr);
595 /* Test and add entropy */
596 if (random & SA_SAMPLE_RANDOM)
597 add_interrupt_randomness(irq);
598 }
733out: 599out:
734 return; 600 bp->flags &= ~IBF_INPROGRESS;
735} 601}
736 602
737#endif
738
739void handler_irq(int irq, struct pt_regs *regs) 603void handler_irq(int irq, struct pt_regs *regs)
740{ 604{
741 struct ino_bucket *bp, *nbp; 605 struct ino_bucket *bp;
742 int cpu = smp_processor_id(); 606 int cpu = smp_processor_id();
743 607
744#ifndef CONFIG_SMP 608#ifndef CONFIG_SMP
@@ -756,8 +620,6 @@ void handler_irq(int irq, struct pt_regs *regs)
756 clear_softint(clr_mask); 620 clear_softint(clr_mask);
757 } 621 }
758#else 622#else
759 int should_forward = 0;
760
761 clear_softint(1 << irq); 623 clear_softint(1 << irq);
762#endif 624#endif
763 625
@@ -772,199 +634,76 @@ void handler_irq(int irq, struct pt_regs *regs)
772#else 634#else
773 bp = __bucket(xchg32(irq_work(cpu, irq), 0)); 635 bp = __bucket(xchg32(irq_work(cpu, irq), 0));
774#endif 636#endif
775 for ( ; bp != NULL; bp = nbp) { 637 while (bp) {
776 unsigned char flags = bp->flags; 638 struct ino_bucket *nbp = __bucket(bp->irq_chain);
777 unsigned char random = 0;
778 639
779 nbp = __bucket(bp->irq_chain);
780 bp->irq_chain = 0; 640 bp->irq_chain = 0;
781 641 process_bucket(irq, bp, regs);
782 bp->flags |= IBF_INPROGRESS; 642 bp = nbp;
783
784 if ((flags & IBF_ACTIVE) != 0) {
785#ifdef CONFIG_PCI
786 if ((flags & IBF_DMA_SYNC) != 0) {
787 upa_readl(dma_sync_reg_table[bp->synctab_ent]);
788 upa_readq(pci_dma_wsync);
789 }
790#endif
791 if ((flags & IBF_MULTI) == 0) {
792 struct irqaction *ap = bp->irq_info;
793 int ret;
794
795 ret = ap->handler(__irq(bp), ap->dev_id, regs);
796 if (ret == IRQ_HANDLED)
797 random |= ap->flags;
798 } else {
799 void **vector = (void **)bp->irq_info;
800 int ent;
801 for (ent = 0; ent < 4; ent++) {
802 struct irqaction *ap = vector[ent];
803 if (ap != NULL) {
804 int ret;
805
806 ret = ap->handler(__irq(bp),
807 ap->dev_id,
808 regs);
809 if (ret == IRQ_HANDLED)
810 random |= ap->flags;
811 }
812 }
813 }
814 /* Only the dummy bucket lacks IMAP/ICLR. */
815 if (bp->pil != 0) {
816#ifdef CONFIG_SMP
817 if (should_forward) {
818 redirect_intr(cpu, bp);
819 should_forward = 0;
820 }
821#endif
822 upa_writel(ICLR_IDLE, bp->iclr);
823
824 /* Test and add entropy */
825 if (random & SA_SAMPLE_RANDOM)
826 add_interrupt_randomness(irq);
827 }
828 } else
829 bp->pending = 1;
830
831 bp->flags &= ~IBF_INPROGRESS;
832 } 643 }
833 irq_exit(); 644 irq_exit();
834} 645}
835 646
836#ifdef CONFIG_BLK_DEV_FD 647#ifdef CONFIG_BLK_DEV_FD
837extern void floppy_interrupt(int irq, void *dev_cookie, struct pt_regs *regs); 648extern irqreturn_t floppy_interrupt(int, void *, struct pt_regs *);;
838
839void sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs)
840{
841 struct irqaction *action = *(irq + irq_action);
842 struct ino_bucket *bucket;
843 int cpu = smp_processor_id();
844
845 irq_enter();
846 kstat_this_cpu.irqs[irq]++;
847
848 *(irq_work(cpu, irq)) = 0;
849 bucket = get_ino_in_irqaction(action) + ivector_table;
850
851 bucket->flags |= IBF_INPROGRESS;
852
853 floppy_interrupt(irq, dev_cookie, regs);
854 upa_writel(ICLR_IDLE, bucket->iclr);
855 649
856 bucket->flags &= ~IBF_INPROGRESS; 650/* XXX No easy way to include asm/floppy.h XXX */
651extern unsigned char *pdma_vaddr;
652extern unsigned long pdma_size;
653extern volatile int doing_pdma;
654extern unsigned long fdc_status;
857 655
858 irq_exit(); 656irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs)
859}
860#endif
861
862/* The following assumes that the branch lies before the place we
863 * are branching to. This is the case for a trap vector...
864 * You have been warned.
865 */
866#define SPARC_BRANCH(dest_addr, inst_addr) \
867 (0x10800000 | ((((dest_addr)-(inst_addr))>>2)&0x3fffff))
868
869#define SPARC_NOP (0x01000000)
870
871static void install_fast_irq(unsigned int cpu_irq,
872 irqreturn_t (*handler)(int, void *, struct pt_regs *))
873{ 657{
874 extern unsigned long sparc64_ttable_tl0; 658 if (likely(doing_pdma)) {
875 unsigned long ttent = (unsigned long) &sparc64_ttable_tl0; 659 void __iomem *stat = (void __iomem *) fdc_status;
876 unsigned int *insns; 660 unsigned char *vaddr = pdma_vaddr;
877 661 unsigned long size = pdma_size;
878 ttent += 0x820; 662 u8 val;
879 ttent += (cpu_irq - 1) << 5; 663
880 insns = (unsigned int *) ttent; 664 while (size) {
881 insns[0] = SPARC_BRANCH(((unsigned long) handler), 665 val = readb(stat);
882 ((unsigned long)&insns[0])); 666 if (unlikely(!(val & 0x80))) {
883 insns[1] = SPARC_NOP; 667 pdma_vaddr = vaddr;
884 __asm__ __volatile__("membar #StoreStore; flush %0" : : "r" (ttent)); 668 pdma_size = size;
885} 669 return IRQ_HANDLED;
886 670 }
887int request_fast_irq(unsigned int irq, 671 if (unlikely(!(val & 0x20))) {
888 irqreturn_t (*handler)(int, void *, struct pt_regs *), 672 pdma_vaddr = vaddr;
889 unsigned long irqflags, const char *name, void *dev_id) 673 pdma_size = size;
890{ 674 doing_pdma = 0;
891 struct irqaction *action; 675 goto main_interrupt;
892 struct ino_bucket *bucket = __bucket(irq); 676 }
893 unsigned long flags; 677 if (val & 0x40) {
894 678 /* read */
895 /* No pil0 dummy buckets allowed here. */ 679 *vaddr++ = readb(stat + 1);
896 if (bucket < &ivector_table[0] || 680 } else {
897 bucket >= &ivector_table[NUM_IVECS]) { 681 unsigned char data = *vaddr++;
898 unsigned int *caller;
899
900 __asm__ __volatile__("mov %%i7, %0" : "=r" (caller));
901 printk(KERN_CRIT "request_fast_irq: Old style IRQ registry attempt "
902 "from %p, irq %08x.\n", caller, irq);
903 return -EINVAL;
904 }
905
906 if (!handler)
907 return -EINVAL;
908 682
909 if ((bucket->pil == 0) || (bucket->pil == 14)) { 683 /* write */
910 printk("request_fast_irq: Trying to register shared IRQ 0 or 14.\n"); 684 writeb(data, stat + 1);
911 return -EBUSY; 685 }
912 } 686 size--;
687 }
913 688
914 spin_lock_irqsave(&irq_action_lock, flags); 689 pdma_vaddr = vaddr;
690 pdma_size = size;
915 691
916 action = *(bucket->pil + irq_action); 692 /* Send Terminal Count pulse to floppy controller. */
917 if (action) { 693 val = readb(auxio_register);
918 if (action->flags & SA_SHIRQ) 694 val |= AUXIO_AUX1_FTCNT;
919 panic("Trying to register fast irq when already shared.\n"); 695 writeb(val, auxio_register);
920 if (irqflags & SA_SHIRQ) 696 val &= AUXIO_AUX1_FTCNT;
921 panic("Trying to register fast irq as shared.\n"); 697 writeb(val, auxio_register);
922 printk("request_fast_irq: Trying to register yet already owned.\n");
923 spin_unlock_irqrestore(&irq_action_lock, flags);
924 return -EBUSY;
925 }
926 698
927 /* 699 doing_pdma = 0;
928 * We do not check for SA_SAMPLE_RANDOM in this path. Neither do we
929 * support smp intr affinity in this path.
930 */
931 if (irqflags & SA_STATIC_ALLOC) {
932 if (static_irq_count < MAX_STATIC_ALLOC)
933 action = &static_irqaction[static_irq_count++];
934 else
935 printk("Request for IRQ%d (%s) SA_STATIC_ALLOC failed "
936 "using kmalloc\n", bucket->pil, name);
937 }
938 if (action == NULL)
939 action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
940 GFP_ATOMIC);
941 if (!action) {
942 spin_unlock_irqrestore(&irq_action_lock, flags);
943 return -ENOMEM;
944 } 700 }
945 install_fast_irq(bucket->pil, handler);
946
947 bucket->irq_info = action;
948 bucket->flags |= IBF_ACTIVE;
949
950 action->handler = handler;
951 action->flags = irqflags;
952 action->dev_id = NULL;
953 action->name = name;
954 action->next = NULL;
955 put_ino_in_irqaction(action, irq);
956 put_smpaff_in_irqaction(action, CPU_MASK_NONE);
957
958 *(bucket->pil + irq_action) = action;
959 enable_irq(irq);
960 701
961 spin_unlock_irqrestore(&irq_action_lock, flags); 702main_interrupt:
962 703 return floppy_interrupt(irq, dev_cookie, regs);
963#ifdef CONFIG_SMP
964 distribute_irqs();
965#endif
966 return 0;
967} 704}
705EXPORT_SYMBOL(sparc_floppy_irq);
706#endif
968 707
969/* We really don't need these at all on the Sparc. We only have 708/* We really don't need these at all on the Sparc. We only have
970 * stubs here because they are exported to modules. 709 * stubs here because they are exported to modules.
@@ -1030,7 +769,10 @@ static void distribute_irqs(void)
1030 */ 769 */
1031 for (level = 1; level < NR_IRQS; level++) { 770 for (level = 1; level < NR_IRQS; level++) {
1032 struct irqaction *p = irq_action[level]; 771 struct irqaction *p = irq_action[level];
1033 if (level == 12) continue; 772
773 if (level == 12)
774 continue;
775
1034 while(p) { 776 while(p) {
1035 cpu = retarget_one_irq(p, cpu); 777 cpu = retarget_one_irq(p, cpu);
1036 p = p->next; 778 p = p->next;
diff --git a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c
index bdac631cf011..bbf11f85dab1 100644
--- a/arch/sparc64/kernel/kprobes.c
+++ b/arch/sparc64/kernel/kprobes.c
@@ -433,3 +433,8 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
433 return 0; 433 return 0;
434} 434}
435 435
436/* architecture specific initialization */
437int arch_init_kprobes(void)
438{
439 return 0;
440}
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c
index 534320ef0db2..91ab466d6c66 100644
--- a/arch/sparc64/kernel/pci_psycho.c
+++ b/arch/sparc64/kernel/pci_psycho.c
@@ -1303,8 +1303,7 @@ static void psycho_controller_hwinit(struct pci_controller_info *p)
1303{ 1303{
1304 u64 tmp; 1304 u64 tmp;
1305 1305
1306 /* PROM sets the IRQ retry value too low, increase it. */ 1306 psycho_write(p->pbm_A.controller_regs + PSYCHO_IRQ_RETRY, 5);
1307 psycho_write(p->pbm_A.controller_regs + PSYCHO_IRQ_RETRY, 0xff);
1308 1307
1309 /* Enable arbiter for all PCI slots. */ 1308 /* Enable arbiter for all PCI slots. */
1310 tmp = psycho_read(p->pbm_A.controller_regs + PSYCHO_PCIA_CTRL); 1309 tmp = psycho_read(p->pbm_A.controller_regs + PSYCHO_PCIA_CTRL);
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c
index 53d333b4a4e8..52bf3431a422 100644
--- a/arch/sparc64/kernel/pci_sabre.c
+++ b/arch/sparc64/kernel/pci_sabre.c
@@ -595,6 +595,23 @@ static int __init sabre_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
595 return ret; 595 return ret;
596} 596}
597 597
598/* When a device lives behind a bridge deeper in the PCI bus topology
599 * than APB, a special sequence must run to make sure all pending DMA
600 * transfers at the time of IRQ delivery are visible in the coherency
601 * domain by the cpu. This sequence is to perform a read on the far
602 * side of the non-APB bridge, then perform a read of Sabre's DMA
603 * write-sync register.
604 */
605static void sabre_wsync_handler(struct ino_bucket *bucket, void *_arg1, void *_arg2)
606{
607 struct pci_dev *pdev = _arg1;
608 unsigned long sync_reg = (unsigned long) _arg2;
609 u16 _unused;
610
611 pci_read_config_word(pdev, PCI_VENDOR_ID, &_unused);
612 sabre_read(sync_reg);
613}
614
598static unsigned int __init sabre_irq_build(struct pci_pbm_info *pbm, 615static unsigned int __init sabre_irq_build(struct pci_pbm_info *pbm,
599 struct pci_dev *pdev, 616 struct pci_dev *pdev,
600 unsigned int ino) 617 unsigned int ino)
@@ -639,24 +656,14 @@ static unsigned int __init sabre_irq_build(struct pci_pbm_info *pbm,
639 if (pdev) { 656 if (pdev) {
640 struct pcidev_cookie *pcp = pdev->sysdata; 657 struct pcidev_cookie *pcp = pdev->sysdata;
641 658
642 /* When a device lives behind a bridge deeper in the
643 * PCI bus topology than APB, a special sequence must
644 * run to make sure all pending DMA transfers at the
645 * time of IRQ delivery are visible in the coherency
646 * domain by the cpu. This sequence is to perform
647 * a read on the far side of the non-APB bridge, then
648 * perform a read of Sabre's DMA write-sync register.
649 *
650 * Currently, the PCI_CONFIG register for the device
651 * is used for this read from the far side of the bridge.
652 */
653 if (pdev->bus->number != pcp->pbm->pci_first_busno) { 659 if (pdev->bus->number != pcp->pbm->pci_first_busno) {
654 bucket->flags |= IBF_DMA_SYNC; 660 struct pci_controller_info *p = pcp->pbm->parent;
655 bucket->synctab_ent = dma_sync_reg_table_entry++; 661 struct irq_desc *d = bucket->irq_info;
656 dma_sync_reg_table[bucket->synctab_ent] = 662
657 (unsigned long) sabre_pci_config_mkaddr( 663 d->pre_handler = sabre_wsync_handler;
658 pcp->pbm, 664 d->pre_handler_arg1 = pdev;
659 pdev->bus->number, pdev->devfn, PCI_COMMAND); 665 d->pre_handler_arg2 = (void *)
666 p->pbm_A.controller_regs + SABRE_WRSYNC;
660 } 667 }
661 } 668 }
662 return __irq(bucket); 669 return __irq(bucket);
@@ -1626,10 +1633,9 @@ void __init sabre_init(int pnode, char *model_name)
1626 */ 1633 */
1627 p->pbm_A.controller_regs = pr_regs[0].phys_addr; 1634 p->pbm_A.controller_regs = pr_regs[0].phys_addr;
1628 p->pbm_B.controller_regs = pr_regs[0].phys_addr; 1635 p->pbm_B.controller_regs = pr_regs[0].phys_addr;
1629 pci_dma_wsync = p->pbm_A.controller_regs + SABRE_WRSYNC;
1630 1636
1631 printk("PCI: Found SABRE, main regs at %016lx, wsync at %016lx\n", 1637 printk("PCI: Found SABRE, main regs at %016lx\n",
1632 p->pbm_A.controller_regs, pci_dma_wsync); 1638 p->pbm_A.controller_regs);
1633 1639
1634 /* Clear interrupts */ 1640 /* Clear interrupts */
1635 1641
diff --git a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c
index 5753175b94e6..6a182bb66281 100644
--- a/arch/sparc64/kernel/pci_schizo.c
+++ b/arch/sparc64/kernel/pci_schizo.c
@@ -15,6 +15,7 @@
15#include <asm/iommu.h> 15#include <asm/iommu.h>
16#include <asm/irq.h> 16#include <asm/irq.h>
17#include <asm/upa.h> 17#include <asm/upa.h>
18#include <asm/pstate.h>
18 19
19#include "pci_impl.h" 20#include "pci_impl.h"
20#include "iommu_common.h" 21#include "iommu_common.h"
@@ -326,6 +327,44 @@ static int __init schizo_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
326 return ret; 327 return ret;
327} 328}
328 329
330static void tomatillo_wsync_handler(struct ino_bucket *bucket, void *_arg1, void *_arg2)
331{
332 unsigned long sync_reg = (unsigned long) _arg2;
333 u64 mask = 1 << (__irq_ino(__irq(bucket)) & IMAP_INO);
334 u64 val;
335 int limit;
336
337 schizo_write(sync_reg, mask);
338
339 limit = 100000;
340 val = 0;
341 while (--limit) {
342 val = schizo_read(sync_reg);
343 if (!(val & mask))
344 break;
345 }
346 if (limit <= 0) {
347 printk("tomatillo_wsync_handler: DMA won't sync [%lx:%lx]\n",
348 val, mask);
349 }
350
351 if (_arg1) {
352 static unsigned char cacheline[64]
353 __attribute__ ((aligned (64)));
354
355 __asm__ __volatile__("rd %%fprs, %0\n\t"
356 "or %0, %4, %1\n\t"
357 "wr %1, 0x0, %%fprs\n\t"
358 "stda %%f0, [%5] %6\n\t"
359 "wr %0, 0x0, %%fprs\n\t"
360 "membar #Sync"
361 : "=&r" (mask), "=&r" (val)
362 : "0" (mask), "1" (val),
363 "i" (FPRS_FEF), "r" (&cacheline[0]),
364 "i" (ASI_BLK_COMMIT_P));
365 }
366}
367
329static unsigned int schizo_irq_build(struct pci_pbm_info *pbm, 368static unsigned int schizo_irq_build(struct pci_pbm_info *pbm,
330 struct pci_dev *pdev, 369 struct pci_dev *pdev,
331 unsigned int ino) 370 unsigned int ino)
@@ -369,6 +408,15 @@ static unsigned int schizo_irq_build(struct pci_pbm_info *pbm,
369 bucket = __bucket(build_irq(pil, ign_fixup, iclr, imap)); 408 bucket = __bucket(build_irq(pil, ign_fixup, iclr, imap));
370 bucket->flags |= IBF_PCI; 409 bucket->flags |= IBF_PCI;
371 410
411 if (pdev && pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO) {
412 struct irq_desc *p = bucket->irq_info;
413
414 p->pre_handler = tomatillo_wsync_handler;
415 p->pre_handler_arg1 = ((pbm->chip_version <= 4) ?
416 (void *) 1 : (void *) 0);
417 p->pre_handler_arg2 = (void *) pbm->sync_reg;
418 }
419
372 return __irq(bucket); 420 return __irq(bucket);
373} 421}
374 422
@@ -885,6 +933,7 @@ static irqreturn_t schizo_ce_intr(int irq, void *dev_id, struct pt_regs *regs)
885 933
886#define SCHIZO_PCI_CTRL (0x2000UL) 934#define SCHIZO_PCI_CTRL (0x2000UL)
887#define SCHIZO_PCICTRL_BUS_UNUS (1UL << 63UL) /* Safari */ 935#define SCHIZO_PCICTRL_BUS_UNUS (1UL << 63UL) /* Safari */
936#define SCHIZO_PCICTRL_DTO_INT (1UL << 61UL) /* Tomatillo */
888#define SCHIZO_PCICTRL_ARB_PRIO (0x1ff << 52UL) /* Tomatillo */ 937#define SCHIZO_PCICTRL_ARB_PRIO (0x1ff << 52UL) /* Tomatillo */
889#define SCHIZO_PCICTRL_ESLCK (1UL << 51UL) /* Safari */ 938#define SCHIZO_PCICTRL_ESLCK (1UL << 51UL) /* Safari */
890#define SCHIZO_PCICTRL_ERRSLOT (7UL << 48UL) /* Safari */ 939#define SCHIZO_PCICTRL_ERRSLOT (7UL << 48UL) /* Safari */
@@ -1887,37 +1936,27 @@ static void __init schizo_pbm_hw_init(struct pci_pbm_info *pbm)
1887{ 1936{
1888 u64 tmp; 1937 u64 tmp;
1889 1938
1890 /* Set IRQ retry to infinity. */ 1939 schizo_write(pbm->pbm_regs + SCHIZO_PCI_IRQ_RETRY, 5);
1891 schizo_write(pbm->pbm_regs + SCHIZO_PCI_IRQ_RETRY,
1892 SCHIZO_IRQ_RETRY_INF);
1893 1940
1894 /* Enable arbiter for all PCI slots. Also, disable PCI interval
1895 * timer so that DTO (Discard TimeOuts) are not reported because
1896 * some Schizo revisions report them erroneously.
1897 */
1898 tmp = schizo_read(pbm->pbm_regs + SCHIZO_PCI_CTRL); 1941 tmp = schizo_read(pbm->pbm_regs + SCHIZO_PCI_CTRL);
1899 if (pbm->chip_type == PBM_CHIP_TYPE_SCHIZO_PLUS &&
1900 pbm->chip_version == 0x5 &&
1901 pbm->chip_revision == 0x1)
1902 tmp |= 0x0f;
1903 else
1904 tmp |= 0xff;
1905 1942
1906 tmp &= ~SCHIZO_PCICTRL_PTO; 1943 /* Enable arbiter for all PCI slots. */
1944 tmp |= 0xff;
1945
1907 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO && 1946 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO &&
1908 pbm->chip_version >= 0x2) 1947 pbm->chip_version >= 0x2)
1909 tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT; 1948 tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT;
1910 else
1911 tmp |= 0x1UL << SCHIZO_PCICTRL_PTO_SHIFT;
1912 1949
1913 if (!prom_getbool(pbm->prom_node, "no-bus-parking")) 1950 if (!prom_getbool(pbm->prom_node, "no-bus-parking"))
1914 tmp |= SCHIZO_PCICTRL_PARK; 1951 tmp |= SCHIZO_PCICTRL_PARK;
1952 else
1953 tmp &= ~SCHIZO_PCICTRL_PARK;
1915 1954
1916 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO && 1955 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO &&
1917 pbm->chip_version <= 0x1) 1956 pbm->chip_version <= 0x1)
1918 tmp |= (1UL << 61); 1957 tmp |= SCHIZO_PCICTRL_DTO_INT;
1919 else 1958 else
1920 tmp &= ~(1UL << 61); 1959 tmp &= ~SCHIZO_PCICTRL_DTO_INT;
1921 1960
1922 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO) 1961 if (pbm->chip_type == PBM_CHIP_TYPE_TOMATILLO)
1923 tmp |= (SCHIZO_PCICTRL_MRM_PREF | 1962 tmp |= (SCHIZO_PCICTRL_MRM_PREF |
@@ -2015,6 +2054,9 @@ static void __init schizo_pbm_init(struct pci_controller_info *p,
2015 pbm->pbm_regs = pr_regs[0].phys_addr; 2054 pbm->pbm_regs = pr_regs[0].phys_addr;
2016 pbm->controller_regs = pr_regs[1].phys_addr - 0x10000UL; 2055 pbm->controller_regs = pr_regs[1].phys_addr - 0x10000UL;
2017 2056
2057 if (chip_type == PBM_CHIP_TYPE_TOMATILLO)
2058 pbm->sync_reg = pr_regs[3].phys_addr + 0x1a18UL;
2059
2018 sprintf(pbm->name, 2060 sprintf(pbm->name,
2019 (chip_type == PBM_CHIP_TYPE_TOMATILLO ? 2061 (chip_type == PBM_CHIP_TYPE_TOMATILLO ?
2020 "TOMATILLO%d PBM%c" : 2062 "TOMATILLO%d PBM%c" :
diff --git a/arch/sparc64/kernel/semaphore.c b/arch/sparc64/kernel/semaphore.c
index 63496c43fe17..a809e63f03ef 100644
--- a/arch/sparc64/kernel/semaphore.c
+++ b/arch/sparc64/kernel/semaphore.c
@@ -32,8 +32,9 @@ static __inline__ int __sem_update_count(struct semaphore *sem, int incr)
32" add %1, %4, %1\n" 32" add %1, %4, %1\n"
33" cas [%3], %0, %1\n" 33" cas [%3], %0, %1\n"
34" cmp %0, %1\n" 34" cmp %0, %1\n"
35" membar #StoreLoad | #StoreStore\n"
35" bne,pn %%icc, 1b\n" 36" bne,pn %%icc, 1b\n"
36" membar #StoreLoad | #StoreStore\n" 37" nop\n"
37 : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count) 38 : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count)
38 : "r" (&sem->count), "r" (incr), "m" (sem->count) 39 : "r" (&sem->count), "r" (incr), "m" (sem->count)
39 : "cc"); 40 : "cc");
@@ -71,8 +72,9 @@ void up(struct semaphore *sem)
71" cmp %%g1, %%g7\n" 72" cmp %%g1, %%g7\n"
72" bne,pn %%icc, 1b\n" 73" bne,pn %%icc, 1b\n"
73" addcc %%g7, 1, %%g0\n" 74" addcc %%g7, 1, %%g0\n"
75" membar #StoreLoad | #StoreStore\n"
74" ble,pn %%icc, 3f\n" 76" ble,pn %%icc, 3f\n"
75" membar #StoreLoad | #StoreStore\n" 77" nop\n"
76"2:\n" 78"2:\n"
77" .subsection 2\n" 79" .subsection 2\n"
78"3: mov %0, %%g1\n" 80"3: mov %0, %%g1\n"
@@ -128,8 +130,9 @@ void __sched down(struct semaphore *sem)
128" cmp %%g1, %%g7\n" 130" cmp %%g1, %%g7\n"
129" bne,pn %%icc, 1b\n" 131" bne,pn %%icc, 1b\n"
130" cmp %%g7, 1\n" 132" cmp %%g7, 1\n"
133" membar #StoreLoad | #StoreStore\n"
131" bl,pn %%icc, 3f\n" 134" bl,pn %%icc, 3f\n"
132" membar #StoreLoad | #StoreStore\n" 135" nop\n"
133"2:\n" 136"2:\n"
134" .subsection 2\n" 137" .subsection 2\n"
135"3: mov %0, %%g1\n" 138"3: mov %0, %%g1\n"
@@ -233,8 +236,9 @@ int __sched down_interruptible(struct semaphore *sem)
233" cmp %%g1, %%g7\n" 236" cmp %%g1, %%g7\n"
234" bne,pn %%icc, 1b\n" 237" bne,pn %%icc, 1b\n"
235" cmp %%g7, 1\n" 238" cmp %%g7, 1\n"
239" membar #StoreLoad | #StoreStore\n"
236" bl,pn %%icc, 3f\n" 240" bl,pn %%icc, 3f\n"
237" membar #StoreLoad | #StoreStore\n" 241" nop\n"
238"2:\n" 242"2:\n"
239" .subsection 2\n" 243" .subsection 2\n"
240"3: mov %2, %%g1\n" 244"3: mov %2, %%g1\n"
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index e78cc53594fa..56cd96f4a5cd 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -227,7 +227,6 @@ EXPORT_SYMBOL(__flush_dcache_range);
227 227
228EXPORT_SYMBOL(mostek_lock); 228EXPORT_SYMBOL(mostek_lock);
229EXPORT_SYMBOL(mstk48t02_regs); 229EXPORT_SYMBOL(mstk48t02_regs);
230EXPORT_SYMBOL(request_fast_irq);
231#ifdef CONFIG_SUN_AUXIO 230#ifdef CONFIG_SUN_AUXIO
232EXPORT_SYMBOL(auxio_set_led); 231EXPORT_SYMBOL(auxio_set_led);
233EXPORT_SYMBOL(auxio_set_lte); 232EXPORT_SYMBOL(auxio_set_lte);
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 71b4e3807694..b40db389f90b 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -973,7 +973,7 @@ static void sparc64_start_timers(irqreturn_t (*cfunc)(int, void *, struct pt_reg
973 int err; 973 int err;
974 974
975 /* Register IRQ handler. */ 975 /* Register IRQ handler. */
976 err = request_irq(build_irq(0, 0, 0UL, 0UL), cfunc, SA_STATIC_ALLOC, 976 err = request_irq(build_irq(0, 0, 0UL, 0UL), cfunc, 0,
977 "timer", NULL); 977 "timer", NULL);
978 978
979 if (err) { 979 if (err) {
diff --git a/arch/sparc64/kernel/trampoline.S b/arch/sparc64/kernel/trampoline.S
index 2c8f9344b4ee..3a145fc39cf2 100644
--- a/arch/sparc64/kernel/trampoline.S
+++ b/arch/sparc64/kernel/trampoline.S
@@ -98,8 +98,9 @@ startup_continue:
98 98
99 sethi %hi(prom_entry_lock), %g2 99 sethi %hi(prom_entry_lock), %g2
1001: ldstub [%g2 + %lo(prom_entry_lock)], %g1 1001: ldstub [%g2 + %lo(prom_entry_lock)], %g1
101 membar #StoreLoad | #StoreStore
101 brnz,pn %g1, 1b 102 brnz,pn %g1, 1b
102 membar #StoreLoad | #StoreStore 103 nop
103 104
104 sethi %hi(p1275buf), %g2 105 sethi %hi(p1275buf), %g2
105 or %g2, %lo(p1275buf), %g2 106 or %g2, %lo(p1275buf), %g2
diff --git a/arch/sparc64/lib/U1memcpy.S b/arch/sparc64/lib/U1memcpy.S
index da9b520c7189..bafd2fc07acb 100644
--- a/arch/sparc64/lib/U1memcpy.S
+++ b/arch/sparc64/lib/U1memcpy.S
@@ -87,14 +87,17 @@
87#define LOOP_CHUNK3(src, dest, len, branch_dest) \ 87#define LOOP_CHUNK3(src, dest, len, branch_dest) \
88 MAIN_LOOP_CHUNK(src, dest, f32, f48, len, branch_dest) 88 MAIN_LOOP_CHUNK(src, dest, f32, f48, len, branch_dest)
89 89
90#define DO_SYNC membar #Sync;
90#define STORE_SYNC(dest, fsrc) \ 91#define STORE_SYNC(dest, fsrc) \
91 EX_ST(STORE_BLK(%fsrc, %dest)); \ 92 EX_ST(STORE_BLK(%fsrc, %dest)); \
92 add %dest, 0x40, %dest; 93 add %dest, 0x40, %dest; \
94 DO_SYNC
93 95
94#define STORE_JUMP(dest, fsrc, target) \ 96#define STORE_JUMP(dest, fsrc, target) \
95 EX_ST(STORE_BLK(%fsrc, %dest)); \ 97 EX_ST(STORE_BLK(%fsrc, %dest)); \
96 add %dest, 0x40, %dest; \ 98 add %dest, 0x40, %dest; \
97 ba,pt %xcc, target; 99 ba,pt %xcc, target; \
100 nop;
98 101
99#define FINISH_VISCHUNK(dest, f0, f1, left) \ 102#define FINISH_VISCHUNK(dest, f0, f1, left) \
100 subcc %left, 8, %left;\ 103 subcc %left, 8, %left;\
@@ -239,17 +242,17 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
239 ba,pt %xcc, 1b+4 242 ba,pt %xcc, 1b+4
240 faligndata %f0, %f2, %f48 243 faligndata %f0, %f2, %f48
2411: FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) 2441: FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32)
242 STORE_SYNC(o0, f48) membar #Sync 245 STORE_SYNC(o0, f48)
243 FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) 246 FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0)
244 STORE_JUMP(o0, f48, 40f) membar #Sync 247 STORE_JUMP(o0, f48, 40f)
2452: FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0) 2482: FREG_FROB(f32,f34,f36,f38,f40,f42,f44,f46,f0)
246 STORE_SYNC(o0, f48) membar #Sync 249 STORE_SYNC(o0, f48)
247 FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) 250 FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16)
248 STORE_JUMP(o0, f48, 48f) membar #Sync 251 STORE_JUMP(o0, f48, 48f)
2493: FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16) 2523: FREG_FROB(f0, f2, f4, f6, f8, f10,f12,f14,f16)
250 STORE_SYNC(o0, f48) membar #Sync 253 STORE_SYNC(o0, f48)
251 FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32) 254 FREG_FROB(f16,f18,f20,f22,f24,f26,f28,f30,f32)
252 STORE_JUMP(o0, f48, 56f) membar #Sync 255 STORE_JUMP(o0, f48, 56f)
253 256
2541: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) 2571: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18)
255 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f) 258 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f)
@@ -260,17 +263,17 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
260 ba,pt %xcc, 1b+4 263 ba,pt %xcc, 1b+4
261 faligndata %f2, %f4, %f48 264 faligndata %f2, %f4, %f48
2621: FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) 2651: FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34)
263 STORE_SYNC(o0, f48) membar #Sync 266 STORE_SYNC(o0, f48)
264 FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) 267 FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2)
265 STORE_JUMP(o0, f48, 41f) membar #Sync 268 STORE_JUMP(o0, f48, 41f)
2662: FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2) 2692: FREG_FROB(f34,f36,f38,f40,f42,f44,f46,f0, f2)
267 STORE_SYNC(o0, f48) membar #Sync 270 STORE_SYNC(o0, f48)
268 FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) 271 FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18)
269 STORE_JUMP(o0, f48, 49f) membar #Sync 272 STORE_JUMP(o0, f48, 49f)
2703: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18) 2733: FREG_FROB(f2, f4, f6, f8, f10,f12,f14,f16,f18)
271 STORE_SYNC(o0, f48) membar #Sync 274 STORE_SYNC(o0, f48)
272 FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34) 275 FREG_FROB(f18,f20,f22,f24,f26,f28,f30,f32,f34)
273 STORE_JUMP(o0, f48, 57f) membar #Sync 276 STORE_JUMP(o0, f48, 57f)
274 277
2751: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) 2781: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20)
276 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f) 279 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f)
@@ -281,17 +284,17 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
281 ba,pt %xcc, 1b+4 284 ba,pt %xcc, 1b+4
282 faligndata %f4, %f6, %f48 285 faligndata %f4, %f6, %f48
2831: FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) 2861: FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36)
284 STORE_SYNC(o0, f48) membar #Sync 287 STORE_SYNC(o0, f48)
285 FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) 288 FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4)
286 STORE_JUMP(o0, f48, 42f) membar #Sync 289 STORE_JUMP(o0, f48, 42f)
2872: FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4) 2902: FREG_FROB(f36,f38,f40,f42,f44,f46,f0, f2, f4)
288 STORE_SYNC(o0, f48) membar #Sync 291 STORE_SYNC(o0, f48)
289 FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) 292 FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20)
290 STORE_JUMP(o0, f48, 50f) membar #Sync 293 STORE_JUMP(o0, f48, 50f)
2913: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20) 2943: FREG_FROB(f4, f6, f8, f10,f12,f14,f16,f18,f20)
292 STORE_SYNC(o0, f48) membar #Sync 295 STORE_SYNC(o0, f48)
293 FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36) 296 FREG_FROB(f20,f22,f24,f26,f28,f30,f32,f34,f36)
294 STORE_JUMP(o0, f48, 58f) membar #Sync 297 STORE_JUMP(o0, f48, 58f)
295 298
2961: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) 2991: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22)
297 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f) 300 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f)
@@ -302,17 +305,17 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
302 ba,pt %xcc, 1b+4 305 ba,pt %xcc, 1b+4
303 faligndata %f6, %f8, %f48 306 faligndata %f6, %f8, %f48
3041: FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) 3071: FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38)
305 STORE_SYNC(o0, f48) membar #Sync 308 STORE_SYNC(o0, f48)
306 FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) 309 FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6)
307 STORE_JUMP(o0, f48, 43f) membar #Sync 310 STORE_JUMP(o0, f48, 43f)
3082: FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6) 3112: FREG_FROB(f38,f40,f42,f44,f46,f0, f2, f4, f6)
309 STORE_SYNC(o0, f48) membar #Sync 312 STORE_SYNC(o0, f48)
310 FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) 313 FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22)
311 STORE_JUMP(o0, f48, 51f) membar #Sync 314 STORE_JUMP(o0, f48, 51f)
3123: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22) 3153: FREG_FROB(f6, f8, f10,f12,f14,f16,f18,f20,f22)
313 STORE_SYNC(o0, f48) membar #Sync 316 STORE_SYNC(o0, f48)
314 FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38) 317 FREG_FROB(f22,f24,f26,f28,f30,f32,f34,f36,f38)
315 STORE_JUMP(o0, f48, 59f) membar #Sync 318 STORE_JUMP(o0, f48, 59f)
316 319
3171: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) 3201: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24)
318 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f) 321 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f)
@@ -323,17 +326,17 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
323 ba,pt %xcc, 1b+4 326 ba,pt %xcc, 1b+4
324 faligndata %f8, %f10, %f48 327 faligndata %f8, %f10, %f48
3251: FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) 3281: FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40)
326 STORE_SYNC(o0, f48) membar #Sync 329 STORE_SYNC(o0, f48)
327 FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) 330 FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8)
328 STORE_JUMP(o0, f48, 44f) membar #Sync 331 STORE_JUMP(o0, f48, 44f)
3292: FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8) 3322: FREG_FROB(f40,f42,f44,f46,f0, f2, f4, f6, f8)
330 STORE_SYNC(o0, f48) membar #Sync 333 STORE_SYNC(o0, f48)
331 FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) 334 FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24)
332 STORE_JUMP(o0, f48, 52f) membar #Sync 335 STORE_JUMP(o0, f48, 52f)
3333: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24) 3363: FREG_FROB(f8, f10,f12,f14,f16,f18,f20,f22,f24)
334 STORE_SYNC(o0, f48) membar #Sync 337 STORE_SYNC(o0, f48)
335 FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40) 338 FREG_FROB(f24,f26,f28,f30,f32,f34,f36,f38,f40)
336 STORE_JUMP(o0, f48, 60f) membar #Sync 339 STORE_JUMP(o0, f48, 60f)
337 340
3381: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) 3411: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26)
339 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f) 342 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f)
@@ -344,17 +347,17 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
344 ba,pt %xcc, 1b+4 347 ba,pt %xcc, 1b+4
345 faligndata %f10, %f12, %f48 348 faligndata %f10, %f12, %f48
3461: FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) 3491: FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42)
347 STORE_SYNC(o0, f48) membar #Sync 350 STORE_SYNC(o0, f48)
348 FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) 351 FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10)
349 STORE_JUMP(o0, f48, 45f) membar #Sync 352 STORE_JUMP(o0, f48, 45f)
3502: FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10) 3532: FREG_FROB(f42,f44,f46,f0, f2, f4, f6, f8, f10)
351 STORE_SYNC(o0, f48) membar #Sync 354 STORE_SYNC(o0, f48)
352 FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) 355 FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26)
353 STORE_JUMP(o0, f48, 53f) membar #Sync 356 STORE_JUMP(o0, f48, 53f)
3543: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26) 3573: FREG_FROB(f10,f12,f14,f16,f18,f20,f22,f24,f26)
355 STORE_SYNC(o0, f48) membar #Sync 358 STORE_SYNC(o0, f48)
356 FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42) 359 FREG_FROB(f26,f28,f30,f32,f34,f36,f38,f40,f42)
357 STORE_JUMP(o0, f48, 61f) membar #Sync 360 STORE_JUMP(o0, f48, 61f)
358 361
3591: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) 3621: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28)
360 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f) 363 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f)
@@ -365,17 +368,17 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
365 ba,pt %xcc, 1b+4 368 ba,pt %xcc, 1b+4
366 faligndata %f12, %f14, %f48 369 faligndata %f12, %f14, %f48
3671: FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) 3701: FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44)
368 STORE_SYNC(o0, f48) membar #Sync 371 STORE_SYNC(o0, f48)
369 FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) 372 FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12)
370 STORE_JUMP(o0, f48, 46f) membar #Sync 373 STORE_JUMP(o0, f48, 46f)
3712: FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12) 3742: FREG_FROB(f44,f46,f0, f2, f4, f6, f8, f10,f12)
372 STORE_SYNC(o0, f48) membar #Sync 375 STORE_SYNC(o0, f48)
373 FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) 376 FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28)
374 STORE_JUMP(o0, f48, 54f) membar #Sync 377 STORE_JUMP(o0, f48, 54f)
3753: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28) 3783: FREG_FROB(f12,f14,f16,f18,f20,f22,f24,f26,f28)
376 STORE_SYNC(o0, f48) membar #Sync 379 STORE_SYNC(o0, f48)
377 FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44) 380 FREG_FROB(f28,f30,f32,f34,f36,f38,f40,f42,f44)
378 STORE_JUMP(o0, f48, 62f) membar #Sync 381 STORE_JUMP(o0, f48, 62f)
379 382
3801: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) 3831: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30)
381 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f) 384 LOOP_CHUNK1(o1, o0, GLOBAL_SPARE, 1f)
@@ -386,17 +389,17 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
386 ba,pt %xcc, 1b+4 389 ba,pt %xcc, 1b+4
387 faligndata %f14, %f16, %f48 390 faligndata %f14, %f16, %f48
3881: FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) 3911: FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46)
389 STORE_SYNC(o0, f48) membar #Sync 392 STORE_SYNC(o0, f48)
390 FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) 393 FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14)
391 STORE_JUMP(o0, f48, 47f) membar #Sync 394 STORE_JUMP(o0, f48, 47f)
3922: FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14) 3952: FREG_FROB(f46,f0, f2, f4, f6, f8, f10,f12,f14)
393 STORE_SYNC(o0, f48) membar #Sync 396 STORE_SYNC(o0, f48)
394 FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) 397 FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30)
395 STORE_JUMP(o0, f48, 55f) membar #Sync 398 STORE_JUMP(o0, f48, 55f)
3963: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30) 3993: FREG_FROB(f14,f16,f18,f20,f22,f24,f26,f28,f30)
397 STORE_SYNC(o0, f48) membar #Sync 400 STORE_SYNC(o0, f48)
398 FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46) 401 FREG_FROB(f30,f32,f34,f36,f38,f40,f42,f44,f46)
399 STORE_JUMP(o0, f48, 63f) membar #Sync 402 STORE_JUMP(o0, f48, 63f)
400 403
40140: FINISH_VISCHUNK(o0, f0, f2, g3) 40440: FINISH_VISCHUNK(o0, f0, f2, g3)
40241: FINISH_VISCHUNK(o0, f2, f4, g3) 40541: FINISH_VISCHUNK(o0, f2, f4, g3)
diff --git a/arch/sparc64/lib/VISsave.S b/arch/sparc64/lib/VISsave.S
index 65e328d600a8..4e18989bd602 100644
--- a/arch/sparc64/lib/VISsave.S
+++ b/arch/sparc64/lib/VISsave.S
@@ -72,7 +72,11 @@ vis1: ldub [%g6 + TI_FPSAVED], %g3
72 72
73 stda %f48, [%g3 + %g1] ASI_BLK_P 73 stda %f48, [%g3 + %g1] ASI_BLK_P
745: membar #Sync 745: membar #Sync
75 jmpl %g7 + %g0, %g0 75 ba,pt %xcc, 80f
76 nop
77
78 .align 32
7980: jmpl %g7 + %g0, %g0
76 nop 80 nop
77 81
786: ldub [%g3 + TI_FPSAVED], %o5 826: ldub [%g3 + TI_FPSAVED], %o5
@@ -87,8 +91,11 @@ vis1: ldub [%g6 + TI_FPSAVED], %g3
87 stda %f32, [%g2 + %g1] ASI_BLK_P 91 stda %f32, [%g2 + %g1] ASI_BLK_P
88 stda %f48, [%g3 + %g1] ASI_BLK_P 92 stda %f48, [%g3 + %g1] ASI_BLK_P
89 membar #Sync 93 membar #Sync
90 jmpl %g7 + %g0, %g0 94 ba,pt %xcc, 80f
95 nop
91 96
97 .align 32
9880: jmpl %g7 + %g0, %g0
92 nop 99 nop
93 100
94 .align 32 101 .align 32
@@ -126,6 +133,10 @@ VISenterhalf:
126 stda %f0, [%g2 + %g1] ASI_BLK_P 133 stda %f0, [%g2 + %g1] ASI_BLK_P
127 stda %f16, [%g3 + %g1] ASI_BLK_P 134 stda %f16, [%g3 + %g1] ASI_BLK_P
128 membar #Sync 135 membar #Sync
136 ba,pt %xcc, 4f
137 nop
138
139 .align 32
1294: and %o5, FPRS_DU, %o5 1404: and %o5, FPRS_DU, %o5
130 jmpl %g7 + %g0, %g0 141 jmpl %g7 + %g0, %g0
131 wr %o5, FPRS_FEF, %fprs 142 wr %o5, FPRS_FEF, %fprs
diff --git a/arch/sparc64/lib/atomic.S b/arch/sparc64/lib/atomic.S
index e528b8d1a3e6..faf87c31598b 100644
--- a/arch/sparc64/lib/atomic.S
+++ b/arch/sparc64/lib/atomic.S
@@ -7,18 +7,6 @@
7#include <linux/config.h> 7#include <linux/config.h>
8#include <asm/asi.h> 8#include <asm/asi.h>
9 9
10 /* On SMP we need to use memory barriers to ensure
11 * correct memory operation ordering, nop these out
12 * for uniprocessor.
13 */
14#ifdef CONFIG_SMP
15#define ATOMIC_PRE_BARRIER membar #StoreLoad | #LoadLoad
16#define ATOMIC_POST_BARRIER membar #StoreLoad | #StoreStore
17#else
18#define ATOMIC_PRE_BARRIER nop
19#define ATOMIC_POST_BARRIER nop
20#endif
21
22 .text 10 .text
23 11
24 /* Two versions of the atomic routines, one that 12 /* Two versions of the atomic routines, one that
@@ -52,6 +40,24 @@ atomic_sub: /* %o0 = decrement, %o1 = atomic_ptr */
52 nop 40 nop
53 .size atomic_sub, .-atomic_sub 41 .size atomic_sub, .-atomic_sub
54 42
43 /* On SMP we need to use memory barriers to ensure
44 * correct memory operation ordering, nop these out
45 * for uniprocessor.
46 */
47#ifdef CONFIG_SMP
48
49#define ATOMIC_PRE_BARRIER membar #StoreLoad | #LoadLoad;
50#define ATOMIC_POST_BARRIER \
51 ba,pt %xcc, 80b; \
52 membar #StoreLoad | #StoreStore
53
5480: retl
55 nop
56#else
57#define ATOMIC_PRE_BARRIER
58#define ATOMIC_POST_BARRIER
59#endif
60
55 .globl atomic_add_ret 61 .globl atomic_add_ret
56 .type atomic_add_ret,#function 62 .type atomic_add_ret,#function
57atomic_add_ret: /* %o0 = increment, %o1 = atomic_ptr */ 63atomic_add_ret: /* %o0 = increment, %o1 = atomic_ptr */
@@ -62,9 +68,10 @@ atomic_add_ret: /* %o0 = increment, %o1 = atomic_ptr */
62 cmp %g1, %g7 68 cmp %g1, %g7
63 bne,pn %icc, 1b 69 bne,pn %icc, 1b
64 add %g7, %o0, %g7 70 add %g7, %o0, %g7
71 sra %g7, 0, %o0
65 ATOMIC_POST_BARRIER 72 ATOMIC_POST_BARRIER
66 retl 73 retl
67 sra %g7, 0, %o0 74 nop
68 .size atomic_add_ret, .-atomic_add_ret 75 .size atomic_add_ret, .-atomic_add_ret
69 76
70 .globl atomic_sub_ret 77 .globl atomic_sub_ret
@@ -77,9 +84,10 @@ atomic_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */
77 cmp %g1, %g7 84 cmp %g1, %g7
78 bne,pn %icc, 1b 85 bne,pn %icc, 1b
79 sub %g7, %o0, %g7 86 sub %g7, %o0, %g7
87 sra %g7, 0, %o0
80 ATOMIC_POST_BARRIER 88 ATOMIC_POST_BARRIER
81 retl 89 retl
82 sra %g7, 0, %o0 90 nop
83 .size atomic_sub_ret, .-atomic_sub_ret 91 .size atomic_sub_ret, .-atomic_sub_ret
84 92
85 .globl atomic64_add 93 .globl atomic64_add
@@ -118,9 +126,10 @@ atomic64_add_ret: /* %o0 = increment, %o1 = atomic_ptr */
118 cmp %g1, %g7 126 cmp %g1, %g7
119 bne,pn %xcc, 1b 127 bne,pn %xcc, 1b
120 add %g7, %o0, %g7 128 add %g7, %o0, %g7
129 mov %g7, %o0
121 ATOMIC_POST_BARRIER 130 ATOMIC_POST_BARRIER
122 retl 131 retl
123 mov %g7, %o0 132 nop
124 .size atomic64_add_ret, .-atomic64_add_ret 133 .size atomic64_add_ret, .-atomic64_add_ret
125 134
126 .globl atomic64_sub_ret 135 .globl atomic64_sub_ret
@@ -133,7 +142,8 @@ atomic64_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */
133 cmp %g1, %g7 142 cmp %g1, %g7
134 bne,pn %xcc, 1b 143 bne,pn %xcc, 1b
135 sub %g7, %o0, %g7 144 sub %g7, %o0, %g7
145 mov %g7, %o0
136 ATOMIC_POST_BARRIER 146 ATOMIC_POST_BARRIER
137 retl 147 retl
138 mov %g7, %o0 148 nop
139 .size atomic64_sub_ret, .-atomic64_sub_ret 149 .size atomic64_sub_ret, .-atomic64_sub_ret
diff --git a/arch/sparc64/lib/bitops.S b/arch/sparc64/lib/bitops.S
index 886dcd2b376a..31afbfe6c1e8 100644
--- a/arch/sparc64/lib/bitops.S
+++ b/arch/sparc64/lib/bitops.S
@@ -7,20 +7,26 @@
7#include <linux/config.h> 7#include <linux/config.h>
8#include <asm/asi.h> 8#include <asm/asi.h>
9 9
10 .text
11
10 /* On SMP we need to use memory barriers to ensure 12 /* On SMP we need to use memory barriers to ensure
11 * correct memory operation ordering, nop these out 13 * correct memory operation ordering, nop these out
12 * for uniprocessor. 14 * for uniprocessor.
13 */ 15 */
16
14#ifdef CONFIG_SMP 17#ifdef CONFIG_SMP
15#define BITOP_PRE_BARRIER membar #StoreLoad | #LoadLoad 18#define BITOP_PRE_BARRIER membar #StoreLoad | #LoadLoad
16#define BITOP_POST_BARRIER membar #StoreLoad | #StoreStore 19#define BITOP_POST_BARRIER \
20 ba,pt %xcc, 80b; \
21 membar #StoreLoad | #StoreStore
22
2380: retl
24 nop
17#else 25#else
18#define BITOP_PRE_BARRIER nop 26#define BITOP_PRE_BARRIER
19#define BITOP_POST_BARRIER nop 27#define BITOP_POST_BARRIER
20#endif 28#endif
21 29
22 .text
23
24 .globl test_and_set_bit 30 .globl test_and_set_bit
25 .type test_and_set_bit,#function 31 .type test_and_set_bit,#function
26test_and_set_bit: /* %o0=nr, %o1=addr */ 32test_and_set_bit: /* %o0=nr, %o1=addr */
@@ -37,10 +43,11 @@ test_and_set_bit: /* %o0=nr, %o1=addr */
37 cmp %g7, %g1 43 cmp %g7, %g1
38 bne,pn %xcc, 1b 44 bne,pn %xcc, 1b
39 and %g7, %o2, %g2 45 and %g7, %o2, %g2
40 BITOP_POST_BARRIER
41 clr %o0 46 clr %o0
47 movrne %g2, 1, %o0
48 BITOP_POST_BARRIER
42 retl 49 retl
43 movrne %g2, 1, %o0 50 nop
44 .size test_and_set_bit, .-test_and_set_bit 51 .size test_and_set_bit, .-test_and_set_bit
45 52
46 .globl test_and_clear_bit 53 .globl test_and_clear_bit
@@ -59,10 +66,11 @@ test_and_clear_bit: /* %o0=nr, %o1=addr */
59 cmp %g7, %g1 66 cmp %g7, %g1
60 bne,pn %xcc, 1b 67 bne,pn %xcc, 1b
61 and %g7, %o2, %g2 68 and %g7, %o2, %g2
62 BITOP_POST_BARRIER
63 clr %o0 69 clr %o0
70 movrne %g2, 1, %o0
71 BITOP_POST_BARRIER
64 retl 72 retl
65 movrne %g2, 1, %o0 73 nop
66 .size test_and_clear_bit, .-test_and_clear_bit 74 .size test_and_clear_bit, .-test_and_clear_bit
67 75
68 .globl test_and_change_bit 76 .globl test_and_change_bit
@@ -81,10 +89,11 @@ test_and_change_bit: /* %o0=nr, %o1=addr */
81 cmp %g7, %g1 89 cmp %g7, %g1
82 bne,pn %xcc, 1b 90 bne,pn %xcc, 1b
83 and %g7, %o2, %g2 91 and %g7, %o2, %g2
84 BITOP_POST_BARRIER
85 clr %o0 92 clr %o0
93 movrne %g2, 1, %o0
94 BITOP_POST_BARRIER
86 retl 95 retl
87 movrne %g2, 1, %o0 96 nop
88 .size test_and_change_bit, .-test_and_change_bit 97 .size test_and_change_bit, .-test_and_change_bit
89 98
90 .globl set_bit 99 .globl set_bit
diff --git a/arch/sparc64/lib/debuglocks.c b/arch/sparc64/lib/debuglocks.c
index c421e0c65325..f03344cf784e 100644
--- a/arch/sparc64/lib/debuglocks.c
+++ b/arch/sparc64/lib/debuglocks.c
@@ -252,8 +252,9 @@ wlock_again:
252" andn %%g1, %%g3, %%g7\n" 252" andn %%g1, %%g3, %%g7\n"
253" casx [%0], %%g1, %%g7\n" 253" casx [%0], %%g1, %%g7\n"
254" cmp %%g1, %%g7\n" 254" cmp %%g1, %%g7\n"
255" membar #StoreLoad | #StoreStore\n"
255" bne,pn %%xcc, 1b\n" 256" bne,pn %%xcc, 1b\n"
256" membar #StoreLoad | #StoreStore" 257" nop"
257 : /* no outputs */ 258 : /* no outputs */
258 : "r" (&(rw->lock)) 259 : "r" (&(rw->lock))
259 : "g3", "g1", "g7", "cc", "memory"); 260 : "g3", "g1", "g7", "cc", "memory");
@@ -351,8 +352,9 @@ int _do_write_trylock (rwlock_t *rw, char *str)
351" andn %%g1, %%g3, %%g7\n" 352" andn %%g1, %%g3, %%g7\n"
352" casx [%0], %%g1, %%g7\n" 353" casx [%0], %%g1, %%g7\n"
353" cmp %%g1, %%g7\n" 354" cmp %%g1, %%g7\n"
355" membar #StoreLoad | #StoreStore\n"
354" bne,pn %%xcc, 1b\n" 356" bne,pn %%xcc, 1b\n"
355" membar #StoreLoad | #StoreStore" 357" nop"
356 : /* no outputs */ 358 : /* no outputs */
357 : "r" (&(rw->lock)) 359 : "r" (&(rw->lock))
358 : "g3", "g1", "g7", "cc", "memory"); 360 : "g3", "g1", "g7", "cc", "memory");
diff --git a/arch/sparc64/lib/dec_and_lock.S b/arch/sparc64/lib/dec_and_lock.S
index 7e6fdaebedba..8ee288dd0afc 100644
--- a/arch/sparc64/lib/dec_and_lock.S
+++ b/arch/sparc64/lib/dec_and_lock.S
@@ -48,8 +48,9 @@ start_to_zero:
48#endif 48#endif
49to_zero: 49to_zero:
50 ldstub [%o1], %g3 50 ldstub [%o1], %g3
51 membar #StoreLoad | #StoreStore
51 brnz,pn %g3, spin_on_lock 52 brnz,pn %g3, spin_on_lock
52 membar #StoreLoad | #StoreStore 53 nop
53loop2: cas [%o0], %g2, %g7 /* ASSERT(g7 == 0) */ 54loop2: cas [%o0], %g2, %g7 /* ASSERT(g7 == 0) */
54 cmp %g2, %g7 55 cmp %g2, %g7
55 56
@@ -71,8 +72,9 @@ loop2: cas [%o0], %g2, %g7 /* ASSERT(g7 == 0) */
71 nop 72 nop
72spin_on_lock: 73spin_on_lock:
73 ldub [%o1], %g3 74 ldub [%o1], %g3
75 membar #LoadLoad
74 brnz,pt %g3, spin_on_lock 76 brnz,pt %g3, spin_on_lock
75 membar #LoadLoad 77 nop
76 ba,pt %xcc, to_zero 78 ba,pt %xcc, to_zero
77 nop 79 nop
78 nop 80 nop
diff --git a/arch/sparc64/lib/rwsem.S b/arch/sparc64/lib/rwsem.S
index 174ff7b9164c..75f0e6b951d6 100644
--- a/arch/sparc64/lib/rwsem.S
+++ b/arch/sparc64/lib/rwsem.S
@@ -17,8 +17,9 @@ __down_read:
17 bne,pn %icc, 1b 17 bne,pn %icc, 1b
18 add %g7, 1, %g7 18 add %g7, 1, %g7
19 cmp %g7, 0 19 cmp %g7, 0
20 membar #StoreLoad | #StoreStore
20 bl,pn %icc, 3f 21 bl,pn %icc, 3f
21 membar #StoreLoad | #StoreStore 22 nop
222: 232:
23 retl 24 retl
24 nop 25 nop
@@ -57,8 +58,9 @@ __down_write:
57 cmp %g3, %g7 58 cmp %g3, %g7
58 bne,pn %icc, 1b 59 bne,pn %icc, 1b
59 cmp %g7, 0 60 cmp %g7, 0
61 membar #StoreLoad | #StoreStore
60 bne,pn %icc, 3f 62 bne,pn %icc, 3f
61 membar #StoreLoad | #StoreStore 63 nop
622: retl 642: retl
63 nop 65 nop
643: 663:
@@ -97,8 +99,9 @@ __up_read:
97 cmp %g1, %g7 99 cmp %g1, %g7
98 bne,pn %icc, 1b 100 bne,pn %icc, 1b
99 cmp %g7, 0 101 cmp %g7, 0
102 membar #StoreLoad | #StoreStore
100 bl,pn %icc, 3f 103 bl,pn %icc, 3f
101 membar #StoreLoad | #StoreStore 104 nop
1022: retl 1052: retl
103 nop 106 nop
1043: sethi %hi(RWSEM_ACTIVE_MASK), %g1 1073: sethi %hi(RWSEM_ACTIVE_MASK), %g1
@@ -126,8 +129,9 @@ __up_write:
126 bne,pn %icc, 1b 129 bne,pn %icc, 1b
127 sub %g7, %g1, %g7 130 sub %g7, %g1, %g7
128 cmp %g7, 0 131 cmp %g7, 0
132 membar #StoreLoad | #StoreStore
129 bl,pn %icc, 3f 133 bl,pn %icc, 3f
130 membar #StoreLoad | #StoreStore 134 nop
1312: 1352:
132 retl 136 retl
133 nop 137 nop
@@ -151,8 +155,9 @@ __downgrade_write:
151 bne,pn %icc, 1b 155 bne,pn %icc, 1b
152 sub %g7, %g1, %g7 156 sub %g7, %g1, %g7
153 cmp %g7, 0 157 cmp %g7, 0
158 membar #StoreLoad | #StoreStore
154 bl,pn %icc, 3f 159 bl,pn %icc, 3f
155 membar #StoreLoad | #StoreStore 160 nop
1562: 1612:
157 retl 162 retl
158 nop 163 nop
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 9c5222075da9..8fc413cb6acd 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -136,8 +136,9 @@ static __inline__ void set_dcache_dirty(struct page *page, int this_cpu)
136 "or %%g1, %0, %%g1\n\t" 136 "or %%g1, %0, %%g1\n\t"
137 "casx [%2], %%g7, %%g1\n\t" 137 "casx [%2], %%g7, %%g1\n\t"
138 "cmp %%g7, %%g1\n\t" 138 "cmp %%g7, %%g1\n\t"
139 "membar #StoreLoad | #StoreStore\n\t"
139 "bne,pn %%xcc, 1b\n\t" 140 "bne,pn %%xcc, 1b\n\t"
140 " membar #StoreLoad | #StoreStore" 141 " nop"
141 : /* no outputs */ 142 : /* no outputs */
142 : "r" (mask), "r" (non_cpu_bits), "r" (&page->flags) 143 : "r" (mask), "r" (non_cpu_bits), "r" (&page->flags)
143 : "g1", "g7"); 144 : "g1", "g7");
@@ -157,8 +158,9 @@ static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long c
157 " andn %%g7, %1, %%g1\n\t" 158 " andn %%g7, %1, %%g1\n\t"
158 "casx [%2], %%g7, %%g1\n\t" 159 "casx [%2], %%g7, %%g1\n\t"
159 "cmp %%g7, %%g1\n\t" 160 "cmp %%g7, %%g1\n\t"
161 "membar #StoreLoad | #StoreStore\n\t"
160 "bne,pn %%xcc, 1b\n\t" 162 "bne,pn %%xcc, 1b\n\t"
161 " membar #StoreLoad | #StoreStore\n" 163 " nop\n"
162 "2:" 164 "2:"
163 : /* no outputs */ 165 : /* no outputs */
164 : "r" (cpu), "r" (mask), "r" (&page->flags), 166 : "r" (cpu), "r" (mask), "r" (&page->flags),
diff --git a/arch/sparc64/mm/ultra.S b/arch/sparc64/mm/ultra.S
index 7a0934321010..363770893797 100644
--- a/arch/sparc64/mm/ultra.S
+++ b/arch/sparc64/mm/ultra.S
@@ -72,6 +72,7 @@ __flush_tlb_pending:
72 flush %g6 72 flush %g6
73 retl 73 retl
74 wrpr %g7, 0x0, %pstate 74 wrpr %g7, 0x0, %pstate
75 nop
75 76
76 .align 32 77 .align 32
77 .globl __flush_tlb_kernel_range 78 .globl __flush_tlb_kernel_range
@@ -249,7 +250,7 @@ __cheetah_flush_tlb_mm: /* 15 insns */
249 retl 250 retl
250 wrpr %g7, 0x0, %pstate 251 wrpr %g7, 0x0, %pstate
251 252
252__cheetah_flush_tlb_pending: /* 22 insns */ 253__cheetah_flush_tlb_pending: /* 23 insns */
253 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */ 254 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
254 rdpr %pstate, %g7 255 rdpr %pstate, %g7
255 sllx %o1, 3, %o1 256 sllx %o1, 3, %o1
@@ -266,8 +267,9 @@ __cheetah_flush_tlb_pending: /* 22 insns */
266 andn %o3, 1, %o3 267 andn %o3, 1, %o3
267 stxa %g0, [%o3] ASI_IMMU_DEMAP 268 stxa %g0, [%o3] ASI_IMMU_DEMAP
2682: stxa %g0, [%o3] ASI_DMMU_DEMAP 2692: stxa %g0, [%o3] ASI_DMMU_DEMAP
270 membar #Sync
269 brnz,pt %o1, 1b 271 brnz,pt %o1, 1b
270 membar #Sync 272 nop
271 stxa %g2, [%o4] ASI_DMMU 273 stxa %g2, [%o4] ASI_DMMU
272 flush %g6 274 flush %g6
273 wrpr %g0, 0, %tl 275 wrpr %g0, 0, %tl
@@ -316,7 +318,7 @@ cheetah_patch_cachetlbops:
316 sethi %hi(__cheetah_flush_tlb_pending), %o1 318 sethi %hi(__cheetah_flush_tlb_pending), %o1
317 or %o1, %lo(__cheetah_flush_tlb_pending), %o1 319 or %o1, %lo(__cheetah_flush_tlb_pending), %o1
318 call cheetah_patch_one 320 call cheetah_patch_one
319 mov 22, %o2 321 mov 23, %o2
320 322
321#ifdef DCACHE_ALIASING_POSSIBLE 323#ifdef DCACHE_ALIASING_POSSIBLE
322 sethi %hi(__flush_dcache_page), %o0 324 sethi %hi(__flush_dcache_page), %o0
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 157190d986bb..d206d7e49cf5 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -1064,7 +1064,6 @@ void print_all_local_APICs (void)
1064 1064
1065void __apicdebuginit print_PIC(void) 1065void __apicdebuginit print_PIC(void)
1066{ 1066{
1067 extern spinlock_t i8259A_lock;
1068 unsigned int v; 1067 unsigned int v;
1069 unsigned long flags; 1068 unsigned long flags;
1070 1069
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c
index 4e680f87a75f..5c6dc7051482 100644
--- a/arch/x86_64/kernel/kprobes.c
+++ b/arch/x86_64/kernel/kprobes.c
@@ -38,7 +38,7 @@
38#include <linux/string.h> 38#include <linux/string.h>
39#include <linux/slab.h> 39#include <linux/slab.h>
40#include <linux/preempt.h> 40#include <linux/preempt.h>
41#include <linux/moduleloader.h> 41
42#include <asm/cacheflush.h> 42#include <asm/cacheflush.h>
43#include <asm/pgtable.h> 43#include <asm/pgtable.h>
44#include <asm/kdebug.h> 44#include <asm/kdebug.h>
@@ -51,8 +51,6 @@ static struct kprobe *kprobe_prev;
51static unsigned long kprobe_status_prev, kprobe_old_rflags_prev, kprobe_saved_rflags_prev; 51static unsigned long kprobe_status_prev, kprobe_old_rflags_prev, kprobe_saved_rflags_prev;
52static struct pt_regs jprobe_saved_regs; 52static struct pt_regs jprobe_saved_regs;
53static long *jprobe_saved_rsp; 53static long *jprobe_saved_rsp;
54static kprobe_opcode_t *get_insn_slot(void);
55static void free_insn_slot(kprobe_opcode_t *slot);
56void jprobe_return_end(void); 54void jprobe_return_end(void);
57 55
58/* copy of the kernel stack at the probe fire time */ 56/* copy of the kernel stack at the probe fire time */
@@ -274,48 +272,23 @@ static void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
274 regs->rip = (unsigned long)p->ainsn.insn; 272 regs->rip = (unsigned long)p->ainsn.insn;
275} 273}
276 274
277struct task_struct *arch_get_kprobe_task(void *ptr)
278{
279 return ((struct thread_info *) (((unsigned long) ptr) &
280 (~(THREAD_SIZE -1))))->task;
281}
282
283void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs) 275void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs)
284{ 276{
285 unsigned long *sara = (unsigned long *)regs->rsp; 277 unsigned long *sara = (unsigned long *)regs->rsp;
286 struct kretprobe_instance *ri; 278 struct kretprobe_instance *ri;
287 static void *orig_ret_addr; 279
280 if ((ri = get_free_rp_inst(rp)) != NULL) {
281 ri->rp = rp;
282 ri->task = current;
283 ri->ret_addr = (kprobe_opcode_t *) *sara;
288 284
289 /*
290 * Save the return address when the return probe hits
291 * the first time, and use it to populate the (krprobe
292 * instance)->ret_addr for subsequent return probes at
293 * the same addrress since stack address would have
294 * the kretprobe_trampoline by then.
295 */
296 if (((void*) *sara) != kretprobe_trampoline)
297 orig_ret_addr = (void*) *sara;
298
299 if ((ri = get_free_rp_inst(rp)) != NULL) {
300 ri->rp = rp;
301 ri->stack_addr = sara;
302 ri->ret_addr = orig_ret_addr;
303 add_rp_inst(ri);
304 /* Replace the return addr with trampoline addr */ 285 /* Replace the return addr with trampoline addr */
305 *sara = (unsigned long) &kretprobe_trampoline; 286 *sara = (unsigned long) &kretprobe_trampoline;
306 } else {
307 rp->nmissed++;
308 }
309}
310 287
311void arch_kprobe_flush_task(struct task_struct *tk) 288 add_rp_inst(ri);
312{ 289 } else {
313 struct kretprobe_instance *ri; 290 rp->nmissed++;
314 while ((ri = get_rp_inst_tsk(tk)) != NULL) { 291 }
315 *((unsigned long *)(ri->stack_addr)) =
316 (unsigned long) ri->ret_addr;
317 recycle_rp_inst(ri);
318 }
319} 292}
320 293
321/* 294/*
@@ -428,36 +401,59 @@ no_kprobe:
428 */ 401 */
429int trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) 402int trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
430{ 403{
431 struct task_struct *tsk; 404 struct kretprobe_instance *ri = NULL;
432 struct kretprobe_instance *ri; 405 struct hlist_head *head;
433 struct hlist_head *head; 406 struct hlist_node *node, *tmp;
434 struct hlist_node *node; 407 unsigned long orig_ret_address = 0;
435 unsigned long *sara = (unsigned long *)regs->rsp - 1; 408 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
436
437 tsk = arch_get_kprobe_task(sara);
438 head = kretprobe_inst_table_head(tsk);
439
440 hlist_for_each_entry(ri, node, head, hlist) {
441 if (ri->stack_addr == sara && ri->rp) {
442 if (ri->rp->handler)
443 ri->rp->handler(ri, regs);
444 }
445 }
446 return 0;
447}
448 409
449void trampoline_post_handler(struct kprobe *p, struct pt_regs *regs, 410 head = kretprobe_inst_table_head(current);
450 unsigned long flags)
451{
452 struct kretprobe_instance *ri;
453 /* RA already popped */
454 unsigned long *sara = ((unsigned long *)regs->rsp) - 1;
455 411
456 while ((ri = get_rp_inst(sara))) { 412 /*
457 regs->rip = (unsigned long)ri->ret_addr; 413 * It is possible to have multiple instances associated with a given
414 * task either because an multiple functions in the call path
415 * have a return probe installed on them, and/or more then one return
416 * return probe was registered for a target function.
417 *
418 * We can handle this because:
419 * - instances are always inserted at the head of the list
420 * - when multiple return probes are registered for the same
421 * function, the first instance's ret_addr will point to the
422 * real return address, and all the rest will point to
423 * kretprobe_trampoline
424 */
425 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
426 if (ri->task != current)
427 /* another task is sharing our hash bucket */
428 continue;
429
430 if (ri->rp && ri->rp->handler)
431 ri->rp->handler(ri, regs);
432
433 orig_ret_address = (unsigned long)ri->ret_addr;
458 recycle_rp_inst(ri); 434 recycle_rp_inst(ri);
435
436 if (orig_ret_address != trampoline_address)
437 /*
438 * This is the real return address. Any other
439 * instances associated with this task are for
440 * other calls deeper on the call stack
441 */
442 break;
459 } 443 }
460 regs->eflags &= ~TF_MASK; 444
445 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
446 regs->rip = orig_ret_address;
447
448 unlock_kprobes();
449 preempt_enable_no_resched();
450
451 /*
452 * By returning a non-zero value, we are telling
453 * kprobe_handler() that we have handled unlocking
454 * and re-enabling preemption.
455 */
456 return 1;
461} 457}
462 458
463/* 459/*
@@ -550,8 +546,7 @@ int post_kprobe_handler(struct pt_regs *regs)
550 current_kprobe->post_handler(current_kprobe, regs, 0); 546 current_kprobe->post_handler(current_kprobe, regs, 0);
551 } 547 }
552 548
553 if (current_kprobe->post_handler != trampoline_post_handler) 549 resume_execution(current_kprobe, regs);
554 resume_execution(current_kprobe, regs);
555 regs->eflags |= kprobe_saved_rflags; 550 regs->eflags |= kprobe_saved_rflags;
556 551
557 /* Restore the original saved kprobes variables and continue. */ 552 /* Restore the original saved kprobes variables and continue. */
@@ -682,111 +677,12 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
682 return 0; 677 return 0;
683} 678}
684 679
685/* 680static struct kprobe trampoline_p = {
686 * kprobe->ainsn.insn points to the copy of the instruction to be single-stepped. 681 .addr = (kprobe_opcode_t *) &kretprobe_trampoline,
687 * By default on x86_64, pages we get from kmalloc or vmalloc are not 682 .pre_handler = trampoline_probe_handler
688 * executable. Single-stepping an instruction on such a page yields an
689 * oops. So instead of storing the instruction copies in their respective
690 * kprobe objects, we allocate a page, map it executable, and store all the
691 * instruction copies there. (We can allocate additional pages if somebody
692 * inserts a huge number of probes.) Each page can hold up to INSNS_PER_PAGE
693 * instruction slots, each of which is MAX_INSN_SIZE*sizeof(kprobe_opcode_t)
694 * bytes.
695 */
696#define INSNS_PER_PAGE (PAGE_SIZE/(MAX_INSN_SIZE*sizeof(kprobe_opcode_t)))
697struct kprobe_insn_page {
698 struct hlist_node hlist;
699 kprobe_opcode_t *insns; /* page of instruction slots */
700 char slot_used[INSNS_PER_PAGE];
701 int nused;
702}; 683};
703 684
704static struct hlist_head kprobe_insn_pages; 685int __init arch_init_kprobes(void)
705
706/**
707 * get_insn_slot() - Find a slot on an executable page for an instruction.
708 * We allocate an executable page if there's no room on existing ones.
709 */
710static kprobe_opcode_t *get_insn_slot(void)
711{
712 struct kprobe_insn_page *kip;
713 struct hlist_node *pos;
714
715 hlist_for_each(pos, &kprobe_insn_pages) {
716 kip = hlist_entry(pos, struct kprobe_insn_page, hlist);
717 if (kip->nused < INSNS_PER_PAGE) {
718 int i;
719 for (i = 0; i < INSNS_PER_PAGE; i++) {
720 if (!kip->slot_used[i]) {
721 kip->slot_used[i] = 1;
722 kip->nused++;
723 return kip->insns + (i*MAX_INSN_SIZE);
724 }
725 }
726 /* Surprise! No unused slots. Fix kip->nused. */
727 kip->nused = INSNS_PER_PAGE;
728 }
729 }
730
731 /* All out of space. Need to allocate a new page. Use slot 0.*/
732 kip = kmalloc(sizeof(struct kprobe_insn_page), GFP_KERNEL);
733 if (!kip) {
734 return NULL;
735 }
736
737 /*
738 * For the %rip-relative displacement fixups to be doable, we
739 * need our instruction copy to be within +/- 2GB of any data it
740 * might access via %rip. That is, within 2GB of where the
741 * kernel image and loaded module images reside. So we allocate
742 * a page in the module loading area.
743 */
744 kip->insns = module_alloc(PAGE_SIZE);
745 if (!kip->insns) {
746 kfree(kip);
747 return NULL;
748 }
749 INIT_HLIST_NODE(&kip->hlist);
750 hlist_add_head(&kip->hlist, &kprobe_insn_pages);
751 memset(kip->slot_used, 0, INSNS_PER_PAGE);
752 kip->slot_used[0] = 1;
753 kip->nused = 1;
754 return kip->insns;
755}
756
757/**
758 * free_insn_slot() - Free instruction slot obtained from get_insn_slot().
759 */
760static void free_insn_slot(kprobe_opcode_t *slot)
761{ 686{
762 struct kprobe_insn_page *kip; 687 return register_kprobe(&trampoline_p);
763 struct hlist_node *pos;
764
765 hlist_for_each(pos, &kprobe_insn_pages) {
766 kip = hlist_entry(pos, struct kprobe_insn_page, hlist);
767 if (kip->insns <= slot
768 && slot < kip->insns+(INSNS_PER_PAGE*MAX_INSN_SIZE)) {
769 int i = (slot - kip->insns) / MAX_INSN_SIZE;
770 kip->slot_used[i] = 0;
771 kip->nused--;
772 if (kip->nused == 0) {
773 /*
774 * Page is no longer in use. Free it unless
775 * it's the last one. We keep the last one
776 * so as not to have to set it up again the
777 * next time somebody inserts a probe.
778 */
779 hlist_del(&kip->hlist);
780 if (hlist_empty(&kprobe_insn_pages)) {
781 INIT_HLIST_NODE(&kip->hlist);
782 hlist_add_head(&kip->hlist,
783 &kprobe_insn_pages);
784 } else {
785 module_free(NULL, kip->insns);
786 kfree(kip);
787 }
788 }
789 return;
790 }
791 }
792} 688}
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 1d91271796e5..7577f9d7a75d 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -482,6 +482,33 @@ out:
482} 482}
483 483
484/* 484/*
485 * This function selects if the context switch from prev to next
486 * has to tweak the TSC disable bit in the cr4.
487 */
488static inline void disable_tsc(struct task_struct *prev_p,
489 struct task_struct *next_p)
490{
491 struct thread_info *prev, *next;
492
493 /*
494 * gcc should eliminate the ->thread_info dereference if
495 * has_secure_computing returns 0 at compile time (SECCOMP=n).
496 */
497 prev = prev_p->thread_info;
498 next = next_p->thread_info;
499
500 if (has_secure_computing(prev) || has_secure_computing(next)) {
501 /* slow path here */
502 if (has_secure_computing(prev) &&
503 !has_secure_computing(next)) {
504 write_cr4(read_cr4() & ~X86_CR4_TSD);
505 } else if (!has_secure_computing(prev) &&
506 has_secure_computing(next))
507 write_cr4(read_cr4() | X86_CR4_TSD);
508 }
509}
510
511/*
485 * This special macro can be used to load a debugging register 512 * This special macro can be used to load a debugging register
486 */ 513 */
487#define loaddebug(thread,r) set_debug(thread->debugreg ## r, r) 514#define loaddebug(thread,r) set_debug(thread->debugreg ## r, r)
@@ -599,6 +626,8 @@ struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *
599 } 626 }
600 } 627 }
601 628
629 disable_tsc(prev_p, next_p);
630
602 return prev_p; 631 return prev_p;
603} 632}
604 633
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
index b693c232fd07..657e88aa0902 100644
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86_64/pci/mmconfig.c
@@ -7,25 +7,50 @@
7 7
8#include <linux/pci.h> 8#include <linux/pci.h>
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/acpi.h>
10#include "pci.h" 11#include "pci.h"
11 12
12#define MMCONFIG_APER_SIZE (256*1024*1024) 13#define MMCONFIG_APER_SIZE (256*1024*1024)
13 14
14/* The physical address of the MMCONFIG aperture. Set from ACPI tables. */
15u32 pci_mmcfg_base_addr;
16
17/* Static virtual mapping of the MMCONFIG aperture */ 15/* Static virtual mapping of the MMCONFIG aperture */
18char *pci_mmcfg_virt; 16struct mmcfg_virt {
17 struct acpi_table_mcfg_config *cfg;
18 char *virt;
19};
20static struct mmcfg_virt *pci_mmcfg_virt;
19 21
20static inline char *pci_dev_base(unsigned int bus, unsigned int devfn) 22static char *get_virt(unsigned int seg, int bus)
21{ 23{
22 return pci_mmcfg_virt + ((bus << 20) | (devfn << 12)); 24 int cfg_num = -1;
25 struct acpi_table_mcfg_config *cfg;
26
27 while (1) {
28 ++cfg_num;
29 if (cfg_num >= pci_mmcfg_config_num) {
30 /* something bad is going on, no cfg table is found. */
31 /* so we fall back to the old way we used to do this */
32 /* and just rely on the first entry to be correct. */
33 return pci_mmcfg_virt[0].virt;
34 }
35 cfg = pci_mmcfg_virt[cfg_num].cfg;
36 if (cfg->pci_segment_group_number != seg)
37 continue;
38 if ((cfg->start_bus_number <= bus) &&
39 (cfg->end_bus_number >= bus))
40 return pci_mmcfg_virt[cfg_num].virt;
41 }
42}
43
44static inline char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
45{
46
47 return get_virt(seg, bus) + ((bus << 20) | (devfn << 12));
23} 48}
24 49
25static int pci_mmcfg_read(unsigned int seg, unsigned int bus, 50static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
26 unsigned int devfn, int reg, int len, u32 *value) 51 unsigned int devfn, int reg, int len, u32 *value)
27{ 52{
28 char *addr = pci_dev_base(bus, devfn); 53 char *addr = pci_dev_base(seg, bus, devfn);
29 54
30 if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095))) 55 if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095)))
31 return -EINVAL; 56 return -EINVAL;
@@ -48,7 +73,7 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
48static int pci_mmcfg_write(unsigned int seg, unsigned int bus, 73static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
49 unsigned int devfn, int reg, int len, u32 value) 74 unsigned int devfn, int reg, int len, u32 value)
50{ 75{
51 char *addr = pci_dev_base(bus,devfn); 76 char *addr = pci_dev_base(seg, bus, devfn);
52 77
53 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) 78 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
54 return -EINVAL; 79 return -EINVAL;
@@ -75,9 +100,15 @@ static struct pci_raw_ops pci_mmcfg = {
75 100
76static int __init pci_mmcfg_init(void) 101static int __init pci_mmcfg_init(void)
77{ 102{
103 int i;
104
78 if ((pci_probe & PCI_PROBE_MMCONF) == 0) 105 if ((pci_probe & PCI_PROBE_MMCONF) == 0)
79 return 0; 106 return 0;
80 if (!pci_mmcfg_base_addr) 107
108 acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg);
109 if ((pci_mmcfg_config_num == 0) ||
110 (pci_mmcfg_config == NULL) ||
111 (pci_mmcfg_config[0].base_address == 0))
81 return 0; 112 return 0;
82 113
83 /* Kludge for now. Don't use mmconfig on AMD systems because 114 /* Kludge for now. Don't use mmconfig on AMD systems because
@@ -88,13 +119,22 @@ static int __init pci_mmcfg_init(void)
88 return 0; 119 return 0;
89 120
90 /* RED-PEN i386 doesn't do _nocache right now */ 121 /* RED-PEN i386 doesn't do _nocache right now */
91 pci_mmcfg_virt = ioremap_nocache(pci_mmcfg_base_addr, MMCONFIG_APER_SIZE); 122 pci_mmcfg_virt = kmalloc(sizeof(*pci_mmcfg_virt) * pci_mmcfg_config_num, GFP_KERNEL);
92 if (!pci_mmcfg_virt) { 123 if (pci_mmcfg_virt == NULL) {
93 printk("PCI: Cannot map mmconfig aperture\n"); 124 printk("PCI: Can not allocate memory for mmconfig structures\n");
94 return 0; 125 return 0;
95 } 126 }
127 for (i = 0; i < pci_mmcfg_config_num; ++i) {
128 pci_mmcfg_virt[i].cfg = &pci_mmcfg_config[i];
129 pci_mmcfg_virt[i].virt = ioremap_nocache(pci_mmcfg_config[i].base_address, MMCONFIG_APER_SIZE);
130 if (!pci_mmcfg_virt[i].virt) {
131 printk("PCI: Cannot map mmconfig aperture for segment %d\n",
132 pci_mmcfg_config[i].pci_segment_group_number);
133 return 0;
134 }
135 printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_config[i].base_address);
136 }
96 137
97 printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_base_addr);
98 raw_pci_ops = &pci_mmcfg; 138 raw_pci_ops = &pci_mmcfg;
99 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; 139 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
100 140
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 3e89767cea72..c9b5d298e3c4 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -132,7 +132,7 @@ config XTENSA_CPU_CLOCK
132config GENERIC_CALIBRATE_DELAY 132config GENERIC_CALIBRATE_DELAY
133 bool "Auto calibration of the BogoMIPS value" 133 bool "Auto calibration of the BogoMIPS value"
134 ---help--- 134 ---help---
135 The BogoMIPS value can easily derived from the CPU frequency. 135 The BogoMIPS value can easily be derived from the CPU frequency.
136 136
137config CMDLINE_BOOL 137config CMDLINE_BOOL
138 bool "Default bootloader kernel arguments" 138 bool "Default bootloader kernel arguments"
@@ -158,6 +158,8 @@ config XTENSA_ISS_NETWORK
158 depends on XTENSA_PLATFORM_ISS 158 depends on XTENSA_PLATFORM_ISS
159 default y 159 default y
160 160
161source "mm/Kconfig"
162
161endmenu 163endmenu
162 164
163menu "Bus options" 165menu "Bus options"
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 4fa27453b1f9..27847e4ffcbf 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -21,23 +21,17 @@ export CPU
21 21
22# Platform configuration 22# Platform configuration
23 23
24platform-y := common
25platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 24platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
26platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss 25platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
27 26
28PLATFORM = $(platform-y) 27PLATFORM = $(platform-y)
29export PLATFORM 28export PLATFORM
30 29
31#LDFLAGS_vmlinux := -T$(word 1,$(LINKSCRIPT)) 30CPPFLAGS += $(if $(KBUILD_SRC),-I$(srctree)/include/asm-xtensa/)
32AFLAGS_vmlinux.lds.o := -Uxtensa 31CPPFLAGS += -Iinclude/asm
33CPPFLAGS += -Iarch/xtensa -Iinclude/asm -mlongcalls -g 32CFLAGS += -pipe -mlongcalls
34AFLAGS += -Iarch/xtensa -Iinclude/asm
35CPP = $(CC) -E $(CFLAGS)
36 33
37cflags-y += -Iarch/xtensa -pipe -mlongcalls 34KBUILD_DEFCONFIG := iss_defconfig
38
39
40KBUILD_DEFCONFIG := common_defconfig
41 35
42# ramdisk/initrd support 36# ramdisk/initrd support
43# You need a compressed ramdisk image, named ramdisk.gz in 37# You need a compressed ramdisk image, named ramdisk.gz in
@@ -62,30 +56,36 @@ endif
62LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) 56LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
63 57
64head-y := arch/xtensa/kernel/head.o 58head-y := arch/xtensa/kernel/head.o
65core-y += arch/xtensa/kernel/ \ 59core-y += arch/xtensa/kernel/ arch/xtensa/mm/
66 arch/xtensa/mm/ arch/xtensa/platform-$(PLATFORM)/ 60ifneq ($(PLATFORM),)
61core-y += arch/xtensa/platform-$(PLATFORM)/
62endif
67libs-y += arch/xtensa/lib/ $(LIBGCC) 63libs-y += arch/xtensa/lib/ $(LIBGCC)
68 64
69boot := arch/xtensa/boot 65boot := arch/xtensa/boot
66
67archinc := include/asm-xtensa
70 68
71arch/xtensa/kernel/asm-offsets.s: \ 69arch/xtensa/kernel/asm-offsets.s: \
72 arch/xtensa/kernel/asm-offsets.c \ 70 arch/xtensa/kernel/asm-offsets.c $(archinc)/.platform
73 include/asm-xtensa/.platform
74 71
75include/asm-xtensa/offsets.h: arch/xtensa/kernel/asm-offsets.s 72include/asm-xtensa/offsets.h: arch/xtensa/kernel/asm-offsets.s
76 $(call filechk,gen-asm-offsets) 73 $(call filechk,gen-asm-offsets)
77 74
78prepare: include/asm-xtensa/.platform include/asm-xtensa/offsets.h 75prepare: $(archinc)/.platform $(archinc)/offsets.h
79 76
80# Update machine cpu and platform symlinks if something which affects 77# Update machine cpu and platform symlinks if something which affects
81# them changed. 78# them changed.
82 79
83include/asm-xtensa/.platform: $(wildcard include/config/arch/*.h) 80$(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/MARKER
84 @echo ' Setting up cpu ($(CPU)) and platform ($(PLATFORM)) symlinks' 81 @echo ' SYMLINK $(archinc)/xtensa/config -> $(archinc)/xtensa/config-$(CPU)'
85 $(Q)rm -f include/asm-xtensa/platform 82 $(Q)mkdir -p $(archinc)
86 $(Q)rm -f include/asm-xtensa/xtensa/config 83 $(Q)mkdir -p $(archinc)/xtensa
87 $(Q)(cd include/asm-xtensa/; ln -sf platform-$(PLATFORM) platform) 84 $(Q)ln -fsn $(srctree)/$(archinc)/xtensa/config-$(CPU) $(archinc)/xtensa/config
88 $(Q)(cd include/asm-xtensa/xtensa; ln -sf config-$(CPU) config) 85 @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
86 $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
87 @touch $@
88
89 89
90all: zImage 90all: zImage
91 91
@@ -94,7 +94,9 @@ bzImage : zImage
94zImage zImage.initrd: vmlinux 94zImage zImage.initrd: vmlinux
95 $(Q)$(MAKE) $(build)=$(boot) $@ 95 $(Q)$(MAKE) $(build)=$(boot) $@
96 96
97CLEAN_FILES += arch/xtensa/vmlinux.lds include/asm-xtensa/offset.h 97CLEAN_FILES += arch/xtensa/vmlinux.lds $(archinc)/offset.h \
98 $(archinc)/platform $(archinc)/xtensa/config \
99 $(archinc)/.platform
98 100
99define archhelp 101define archhelp
100 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' 102 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
diff --git a/arch/xtensa/boot/Makefile b/arch/xtensa/boot/Makefile
index 260f456ccf0b..820b31d10ae4 100644
--- a/arch/xtensa/boot/Makefile
+++ b/arch/xtensa/boot/Makefile
@@ -11,21 +11,19 @@
11CFLAGS += -fno-builtin -Iarch/$(ARCH)/boot/include 11CFLAGS += -fno-builtin -Iarch/$(ARCH)/boot/include
12HOSTFLAGS += -Iarch/$(ARCH)/boot/include 12HOSTFLAGS += -Iarch/$(ARCH)/boot/include
13 13
14BIG_ENDIAN := $(shell echo -e "\#ifdef __XTENSA_EL__\nint little;\n\#else\nint big;\n\#endif" | $(CC) -E -|grep -c big) 14BIG_ENDIAN := $(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
15
16 15
17export CFLAGS 16export CFLAGS
18export AFLAGS 17export AFLAGS
19export BIG_ENDIAN 18export BIG_ENDIAN
20 19
20subdir-y := lib
21
21# Subdirs for the boot loader(s) 22# Subdirs for the boot loader(s)
22 23
23bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf 24bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf
24bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf 25bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf
25 26
26subdir-y := lib/
27
28subdir-y += boot-elf/ boot-redboot/
29 27
30zImage zImage.initrd Image Image.initrd: $(bootdir-y) 28zImage zImage.initrd Image Image.initrd: $(bootdir-y)
31 29
@@ -33,5 +31,3 @@ $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
33 $(addprefix $(obj)/,$(host-progs)) 31 $(addprefix $(obj)/,$(host-progs))
34 $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) 32 $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
35 33
36
37
diff --git a/arch/xtensa/boot/boot-elf/Makefile b/arch/xtensa/boot/boot-elf/Makefile
index f6ef6a369667..734db7f76583 100644
--- a/arch/xtensa/boot/boot-elf/Makefile
+++ b/arch/xtensa/boot/boot-elf/Makefile
@@ -27,7 +27,7 @@ Image: vmlinux $(OBJS)
27 --set-section-flags image=contents,alloc,load,load,data \ 27 --set-section-flags image=contents,alloc,load,load,data \
28 $(OBJS) $@.tmp 28 $(OBJS) $@.tmp
29 $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \ 29 $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
30 -T arch/$(ARCH)/boot/boot-elf/boot.ld \ 30 -T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \
31 -o arch/$(ARCH)/boot/$@.elf $@.tmp 31 -o arch/$(ARCH)/boot/$@.elf $@.tmp
32 rm -f $@.tmp vmlinux.tmp 32 rm -f $@.tmp vmlinux.tmp
33 33
@@ -41,7 +41,7 @@ Image.initrd: vmlinux $(OBJS)
41 --set-section-flags image=contents,alloc,load,load,data \ 41 --set-section-flags image=contents,alloc,load,load,data \
42 $(OBJS) $@.tmp 42 $(OBJS) $@.tmp
43 $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \ 43 $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
44 -T arch/$(ARCH)/boot/boot-elf/boot.ld \ 44 -T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \
45 -o arch/$(ARCH)/boot/$@.elf $@.tmp 45 -o arch/$(ARCH)/boot/$@.elf $@.tmp
46 rm -f $@.tmp vmlinux.tmp 46 rm -f $@.tmp vmlinux.tmp
47 47
diff --git a/arch/xtensa/boot/boot-redboot/Makefile b/arch/xtensa/boot/boot-redboot/Makefile
index ca8a68bc8472..f53262c2e1f3 100644
--- a/arch/xtensa/boot/boot-redboot/Makefile
+++ b/arch/xtensa/boot/boot-redboot/Makefile
@@ -12,24 +12,24 @@ else
12OBJCOPY_ARGS := -O elf32-xtensa-le 12OBJCOPY_ARGS := -O elf32-xtensa-le
13endif 13endif
14 14
15LD_ARGS = -T $(obj)/boot.ld 15LD_ARGS = -T $(srctree)/$(obj)/boot.ld
16 16
17boot-y := bootstrap.o 17boot-y := bootstrap.o
18 18
19OBJS := $(addprefix $(obj)/,$(boot-y)) 19OBJS := $(addprefix $(obj)/,$(boot-y))
20LIBS := arch/$(ARCH)/boot/lib/lib.a arch/$(ARCH)/lib/lib.a 20LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
21 21
22LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) 22LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
23 23
24zImage: vmlinux $(OBJS) $(LIBS) 24zImage: vmlinux $(OBJS) $(LIBS)
25 $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \ 25 $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \
26 $(TOPDIR)/vmlinux vmlinux.tmp 26 vmlinux vmlinux.tmp
27 gzip -vf9 vmlinux.tmp 27 gzip -vf9 vmlinux.tmp
28 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ 28 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
29 --add-section image=vmlinux.tmp.gz \ 29 --add-section image=vmlinux.tmp.gz \
30 --set-section-flags image=contents,alloc,load,load,data \ 30 --set-section-flags image=contents,alloc,load,load,data \
31 $(OBJS) $@.tmp 31 $(OBJS) $@.tmp
32 $(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC) 32 $(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC)
33 $(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/images/$@.redboot 33 $(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/$@.redboot
34# rm -f $@.tmp $@.elf vmlinux.tmp.gz 34 rm -f $@.tmp $@.elf vmlinux.tmp.gz
35 35
diff --git a/arch/xtensa/boot/include/zlib.h b/arch/xtensa/boot/include/zlib.h
deleted file mode 100644
index ea29b6237852..000000000000
--- a/arch/xtensa/boot/include/zlib.h
+++ /dev/null
@@ -1,433 +0,0 @@
1/*
2 * BK Id: SCCS/s.zlib.h 1.8 05/18/01 15:17:23 cort
3 */
4/*
5 * This file is derived from zlib.h and zconf.h from the zlib-0.95
6 * distribution by Jean-loup Gailly and Mark Adler, with some additions
7 * by Paul Mackerras to aid in implementing Deflate compression and
8 * decompression for PPP packets.
9 */
10
11/*
12 * ==FILEVERSION 960122==
13 *
14 * This marker is used by the Linux installation script to determine
15 * whether an up-to-date version of this file is already installed.
16 */
17
18/* zlib.h -- interface of the 'zlib' general purpose compression library
19 version 0.95, Aug 16th, 1995.
20
21 Copyright (C) 1995 Jean-loup Gailly and Mark Adler
22
23 This software is provided 'as-is', without any express or implied
24 warranty. In no event will the authors be held liable for any damages
25 arising from the use of this software.
26
27 Permission is granted to anyone to use this software for any purpose,
28 including commercial applications, and to alter it and redistribute it
29 freely, subject to the following restrictions:
30
31 1. The origin of this software must not be misrepresented; you must not
32 claim that you wrote the original software. If you use this software
33 in a product, an acknowledgment in the product documentation would be
34 appreciated but is not required.
35 2. Altered source versions must be plainly marked as such, and must not be
36 misrepresented as being the original software.
37 3. This notice may not be removed or altered from any source distribution.
38
39 Jean-loup Gailly Mark Adler
40 gzip@prep.ai.mit.edu madler@alumni.caltech.edu
41 */
42
43#ifndef _ZLIB_H
44#define _ZLIB_H
45
46/* #include "zconf.h" */ /* included directly here */
47
48/* zconf.h -- configuration of the zlib compression library
49 * Copyright (C) 1995 Jean-loup Gailly.
50 * For conditions of distribution and use, see copyright notice in zlib.h
51 */
52
53/* From: zconf.h,v 1.12 1995/05/03 17:27:12 jloup Exp */
54
55/*
56 The library does not install any signal handler. It is recommended to
57 add at least a handler for SIGSEGV when decompressing; the library checks
58 the consistency of the input data whenever possible but may go nuts
59 for some forms of corrupted input.
60 */
61
62/*
63 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
64 * than 64k bytes at a time (needed on systems with 16-bit int).
65 * Compile with -DUNALIGNED_OK if it is OK to access shorts or ints
66 * at addresses which are not a multiple of their size.
67 * Under DOS, -DFAR=far or -DFAR=__far may be needed.
68 */
69
70#ifndef STDC
71# if defined(MSDOS) || defined(__STDC__) || defined(__cplusplus)
72# define STDC
73# endif
74#endif
75
76#ifdef __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */
77# include <unix.h>
78#endif
79
80/* Maximum value for memLevel in deflateInit2 */
81#ifndef MAX_MEM_LEVEL
82# ifdef MAXSEG_64K
83# define MAX_MEM_LEVEL 8
84# else
85# define MAX_MEM_LEVEL 9
86# endif
87#endif
88
89#ifndef FAR
90# define FAR
91#endif
92
93/* Maximum value for windowBits in deflateInit2 and inflateInit2 */
94#ifndef MAX_WBITS
95# define MAX_WBITS 15 /* 32K LZ77 window */
96#endif
97
98/* The memory requirements for deflate are (in bytes):
99 1 << (windowBits+2) + 1 << (memLevel+9)
100 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
101 plus a few kilobytes for small objects. For example, if you want to reduce
102 the default memory requirements from 256K to 128K, compile with
103 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
104 Of course this will generally degrade compression (there's no free lunch).
105
106 The memory requirements for inflate are (in bytes) 1 << windowBits
107 that is, 32K for windowBits=15 (default value) plus a few kilobytes
108 for small objects.
109*/
110
111 /* Type declarations */
112
113#ifndef OF /* function prototypes */
114# ifdef STDC
115# define OF(args) args
116# else
117# define OF(args) ()
118# endif
119#endif
120
121typedef unsigned char Byte; /* 8 bits */
122typedef unsigned int uInt; /* 16 bits or more */
123typedef unsigned long uLong; /* 32 bits or more */
124
125typedef Byte FAR Bytef;
126typedef char FAR charf;
127typedef int FAR intf;
128typedef uInt FAR uIntf;
129typedef uLong FAR uLongf;
130
131#ifdef STDC
132 typedef void FAR *voidpf;
133 typedef void *voidp;
134#else
135 typedef Byte FAR *voidpf;
136 typedef Byte *voidp;
137#endif
138
139/* end of original zconf.h */
140
141#define ZLIB_VERSION "0.95P"
142
143/*
144 The 'zlib' compression library provides in-memory compression and
145 decompression functions, including integrity checks of the uncompressed
146 data. This version of the library supports only one compression method
147 (deflation) but other algorithms may be added later and will have the same
148 stream interface.
149
150 For compression the application must provide the output buffer and
151 may optionally provide the input buffer for optimization. For decompression,
152 the application must provide the input buffer and may optionally provide
153 the output buffer for optimization.
154
155 Compression can be done in a single step if the buffers are large
156 enough (for example if an input file is mmap'ed), or can be done by
157 repeated calls of the compression function. In the latter case, the
158 application must provide more input and/or consume the output
159 (providing more output space) before each call.
160*/
161
162typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
163typedef void (*free_func) OF((voidpf opaque, voidpf address, uInt nbytes));
164
165struct internal_state;
166
167typedef struct z_stream_s {
168 Bytef *next_in; /* next input byte */
169 uInt avail_in; /* number of bytes available at next_in */
170 uLong total_in; /* total nb of input bytes read so far */
171
172 Bytef *next_out; /* next output byte should be put there */
173 uInt avail_out; /* remaining free space at next_out */
174 uLong total_out; /* total nb of bytes output so far */
175
176 char *msg; /* last error message, NULL if no error */
177 struct internal_state FAR *state; /* not visible by applications */
178
179 alloc_func zalloc; /* used to allocate the internal state */
180 free_func zfree; /* used to free the internal state */
181 voidp opaque; /* private data object passed to zalloc and zfree */
182
183 Byte data_type; /* best guess about the data type: ascii or binary */
184
185} z_stream;
186
187/*
188 The application must update next_in and avail_in when avail_in has
189 dropped to zero. It must update next_out and avail_out when avail_out
190 has dropped to zero. The application must initialize zalloc, zfree and
191 opaque before calling the init function. All other fields are set by the
192 compression library and must not be updated by the application.
193
194 The opaque value provided by the application will be passed as the first
195 parameter for calls of zalloc and zfree. This can be useful for custom
196 memory management. The compression library attaches no meaning to the
197 opaque value.
198
199 zalloc must return Z_NULL if there is not enough memory for the object.
200 On 16-bit systems, the functions zalloc and zfree must be able to allocate
201 exactly 65536 bytes, but will not be required to allocate more than this
202 if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
203 pointers returned by zalloc for objects of exactly 65536 bytes *must*
204 have their offset normalized to zero. The default allocation function
205 provided by this library ensures this (see zutil.c). To reduce memory
206 requirements and avoid any allocation of 64K objects, at the expense of
207 compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
208
209 The fields total_in and total_out can be used for statistics or
210 progress reports. After compression, total_in holds the total size of
211 the uncompressed data and may be saved for use in the decompressor
212 (particularly if the decompressor wants to decompress everything in
213 a single step).
214*/
215
216 /* constants */
217
218#define Z_NO_FLUSH 0
219#define Z_PARTIAL_FLUSH 1
220#define Z_FULL_FLUSH 2
221#define Z_SYNC_FLUSH 3 /* experimental: partial_flush + byte align */
222#define Z_FINISH 4
223#define Z_PACKET_FLUSH 5
224/* See deflate() below for the usage of these constants */
225
226#define Z_OK 0
227#define Z_STREAM_END 1
228#define Z_ERRNO (-1)
229#define Z_STREAM_ERROR (-2)
230#define Z_DATA_ERROR (-3)
231#define Z_MEM_ERROR (-4)
232#define Z_BUF_ERROR (-5)
233/* error codes for the compression/decompression functions */
234
235#define Z_BEST_SPEED 1
236#define Z_BEST_COMPRESSION 9
237#define Z_DEFAULT_COMPRESSION (-1)
238/* compression levels */
239
240#define Z_FILTERED 1
241#define Z_HUFFMAN_ONLY 2
242#define Z_DEFAULT_STRATEGY 0
243
244#define Z_BINARY 0
245#define Z_ASCII 1
246#define Z_UNKNOWN 2
247/* Used to set the data_type field */
248
249#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
250
251extern char *zlib_version;
252/* The application can compare zlib_version and ZLIB_VERSION for consistency.
253 If the first character differs, the library code actually used is
254 not compatible with the zlib.h header file used by the application.
255 */
256
257 /* basic functions */
258
259extern int inflateInit OF((z_stream *strm));
260/*
261 Initializes the internal stream state for decompression. The fields
262 zalloc and zfree must be initialized before by the caller. If zalloc and
263 zfree are set to Z_NULL, inflateInit updates them to use default allocation
264 functions.
265
266 inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
267 enough memory. msg is set to null if there is no error message.
268 inflateInit does not perform any decompression: this will be done by
269 inflate().
270*/
271
272
273extern int inflate OF((z_stream *strm, int flush));
274/*
275 Performs one or both of the following actions:
276
277 - Decompress more input starting at next_in and update next_in and avail_in
278 accordingly. If not all input can be processed (because there is not
279 enough room in the output buffer), next_in is updated and processing
280 will resume at this point for the next call of inflate().
281
282 - Provide more output starting at next_out and update next_out and avail_out
283 accordingly. inflate() always provides as much output as possible
284 (until there is no more input data or no more space in the output buffer).
285
286 Before the call of inflate(), the application should ensure that at least
287 one of the actions is possible, by providing more input and/or consuming
288 more output, and updating the next_* and avail_* values accordingly.
289 The application can consume the uncompressed output when it wants, for
290 example when the output buffer is full (avail_out == 0), or after each
291 call of inflate().
292
293 If the parameter flush is set to Z_PARTIAL_FLUSH or Z_PACKET_FLUSH,
294 inflate flushes as much output as possible to the output buffer. The
295 flushing behavior of inflate is not specified for values of the flush
296 parameter other than Z_PARTIAL_FLUSH, Z_PACKET_FLUSH or Z_FINISH, but the
297 current implementation actually flushes as much output as possible
298 anyway. For Z_PACKET_FLUSH, inflate checks that once all the input data
299 has been consumed, it is expecting to see the length field of a stored
300 block; if not, it returns Z_DATA_ERROR.
301
302 inflate() should normally be called until it returns Z_STREAM_END or an
303 error. However if all decompression is to be performed in a single step
304 (a single call of inflate), the parameter flush should be set to
305 Z_FINISH. In this case all pending input is processed and all pending
306 output is flushed; avail_out must be large enough to hold all the
307 uncompressed data. (The size of the uncompressed data may have been saved
308 by the compressor for this purpose.) The next operation on this stream must
309 be inflateEnd to deallocate the decompression state. The use of Z_FINISH
310 is never required, but can be used to inform inflate that a faster routine
311 may be used for the single inflate() call.
312
313 inflate() returns Z_OK if some progress has been made (more input
314 processed or more output produced), Z_STREAM_END if the end of the
315 compressed data has been reached and all uncompressed output has been
316 produced, Z_DATA_ERROR if the input data was corrupted, Z_STREAM_ERROR if
317 the stream structure was inconsistent (for example if next_in or next_out
318 was NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no
319 progress is possible or if there was not enough room in the output buffer
320 when Z_FINISH is used. In the Z_DATA_ERROR case, the application may then
321 call inflateSync to look for a good compression block. */
322
323
324extern int inflateEnd OF((z_stream *strm));
325/*
326 All dynamically allocated data structures for this stream are freed.
327 This function discards any unprocessed input and does not flush any
328 pending output.
329
330 inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
331 was inconsistent. In the error case, msg may be set but then points to a
332 static string (which must not be deallocated).
333*/
334
335 /* advanced functions */
336
337extern int inflateInit2 OF((z_stream *strm,
338 int windowBits));
339/*
340 This is another version of inflateInit with more compression options. The
341 fields next_out, zalloc and zfree must be initialized before by the caller.
342
343 The windowBits parameter is the base two logarithm of the maximum window
344 size (the size of the history buffer). It should be in the range 8..15 for
345 this version of the library (the value 16 will be allowed soon). The
346 default value is 15 if inflateInit is used instead. If a compressed stream
347 with a larger window size is given as input, inflate() will return with
348 the error code Z_DATA_ERROR instead of trying to allocate a larger window.
349
350 If next_out is not null, the library will use this buffer for the history
351 buffer; the buffer must either be large enough to hold the entire output
352 data, or have at least 1<<windowBits bytes. If next_out is null, the
353 library will allocate its own buffer (and leave next_out null). next_in
354 need not be provided here but must be provided by the application for the
355 next call of inflate().
356
357 If the history buffer is provided by the application, next_out must
358 never be changed by the application since the decompressor maintains
359 history information inside this buffer from call to call; the application
360 can only reset next_out to the beginning of the history buffer when
361 avail_out is zero and all output has been consumed.
362
363 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was
364 not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as
365 windowBits < 8). msg is set to null if there is no error message.
366 inflateInit2 does not perform any decompression: this will be done by
367 inflate().
368*/
369
370extern int inflateSync OF((z_stream *strm));
371/*
372 Skips invalid compressed data until the special marker (see deflate()
373 above) can be found, or until all available input is skipped. No output
374 is provided.
375
376 inflateSync returns Z_OK if the special marker has been found, Z_BUF_ERROR
377 if no more input was provided, Z_DATA_ERROR if no marker has been found,
378 or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
379 case, the application may save the current current value of total_in which
380 indicates where valid compressed data was found. In the error case, the
381 application may repeatedly call inflateSync, providing more input each time,
382 until success or end of the input data.
383*/
384
385extern int inflateReset OF((z_stream *strm));
386/*
387 This function is equivalent to inflateEnd followed by inflateInit,
388 but does not free and reallocate all the internal decompression state.
389 The stream will keep attributes that may have been set by inflateInit2.
390
391 inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
392 stream state was inconsistent (such as zalloc or state being NULL).
393*/
394
395extern int inflateIncomp OF((z_stream *strm));
396/*
397 This function adds the data at next_in (avail_in bytes) to the output
398 history without performing any output. There must be no pending output,
399 and the decompressor must be expecting to see the start of a block.
400 Calling this function is equivalent to decompressing a stored block
401 containing the data at next_in (except that the data is not output).
402*/
403
404 /* checksum functions */
405
406/*
407 This function is not related to compression but is exported
408 anyway because it might be useful in applications using the
409 compression library.
410*/
411
412extern uLong adler32 OF((uLong adler, Bytef *buf, uInt len));
413
414/*
415 Update a running Adler-32 checksum with the bytes buf[0..len-1] and
416 return the updated checksum. If buf is NULL, this function returns
417 the required initial value for the checksum.
418 An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
419 much faster. Usage example:
420
421 uLong adler = adler32(0L, Z_NULL, 0);
422
423 while (read_buffer(buffer, length) != EOF) {
424 adler = adler32(adler, buffer, length);
425 }
426 if (adler != original_adler) error();
427*/
428
429#ifndef _Z_UTIL_H
430 struct internal_state {int dummy;}; /* hack for buggy compilers */
431#endif
432
433#endif /* _ZLIB_H */
diff --git a/arch/xtensa/boot/lib/Makefile b/arch/xtensa/boot/lib/Makefile
index c0a74dc3a0df..9e73bb8aeb7a 100644
--- a/arch/xtensa/boot/lib/Makefile
+++ b/arch/xtensa/boot/lib/Makefile
@@ -2,5 +2,16 @@
2# Makefile for some libs needed by zImage. 2# Makefile for some libs needed by zImage.
3# 3#
4 4
5zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c
5 6
6lib-y := zlib.o zmem.o 7lib-y += $(zlib:.c=.o) zmem.o
8
9EXTRA_CFLAGS += -Ilib/zlib_inflate
10
11quiet_cmd_copy_zlib = COPY $@
12 cmd_copy_zlib = cat $< > $@
13
14$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
15 $(call cmd,copy_zlib)
16
17clean-files := $(zlib)
diff --git a/arch/xtensa/boot/lib/memcpy.S b/arch/xtensa/boot/lib/memcpy.S
deleted file mode 100644
index a029f5df2d5c..000000000000
--- a/arch/xtensa/boot/lib/memcpy.S
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * arch/xtensa/lib/memcpy.S
3 *
4 * ANSI C standard library function memcpy
5 *
6 * This file is subject to the terms and conditions of the GNU General
7 * Public License. See the file "COPYING" in the main directory of
8 * this archive for more details.
9 *
10 * Copyright (C) 2002 Tensilica Inc.
11 */
12
13#define _ASMLANGUAGE
14#include <xtensa/config/core.h>
15
16.text
17.align 4
18.global bcopy
19.type bcopy,@function
20bcopy:
21 movi a14, xthal_bcopy // a14 safe to use regardless of whether caller
22 // used call4 or call8 (can't have used call12)
23 jx a14 // let the Core HAL do the work
24
25.text
26.align 4
27.global memcpy
28.type memcpy,@function
29memcpy:
30.global memmove
31.type memmove,@function
32memmove:
33 movi a14, xthal_memcpy // a14 safe to use regardless of whether caller
34 // used call4 or call8 (can't have used call12)
35 jx a14 // let the Core HAL do the work
36
diff --git a/arch/xtensa/boot/lib/zlib.c b/arch/xtensa/boot/lib/zlib.c
deleted file mode 100644
index e3859f631077..000000000000
--- a/arch/xtensa/boot/lib/zlib.c
+++ /dev/null
@@ -1,2150 +0,0 @@
1/*
2 * BK Id: SCCS/s.zlib.c 1.8 05/18/01 15:17:24 cort
3 */
4/*
5 * This file is derived from various .h and .c files from the zlib-0.95
6 * distribution by Jean-loup Gailly and Mark Adler, with some additions
7 * by Paul Mackerras to aid in implementing Deflate compression and
8 * decompression for PPP packets. See zlib.h for conditions of
9 * distribution and use.
10 *
11 * Changes that have been made include:
12 * - changed functions not used outside this file to "local"
13 * - added minCompression parameter to deflateInit2
14 * - added Z_PACKET_FLUSH (see zlib.h for details)
15 * - added inflateIncomp
16 *
17 */
18
19/*+++++*/
20/* zutil.h -- internal interface and configuration of the compression library
21 * Copyright (C) 1995 Jean-loup Gailly.
22 * For conditions of distribution and use, see copyright notice in zlib.h
23 */
24
25/* WARNING: this file should *not* be used by applications. It is
26 part of the implementation of the compression library and is
27 subject to change. Applications should only use zlib.h.
28 */
29
30/* From: zutil.h,v 1.9 1995/05/03 17:27:12 jloup Exp */
31
32#define _Z_UTIL_H
33
34#include "zlib.h"
35
36#ifndef local
37# define local static
38#endif
39/* compile with -Dlocal if your debugger can't find static symbols */
40
41#define FAR
42
43typedef unsigned char uch;
44typedef uch FAR uchf;
45typedef unsigned short ush;
46typedef ush FAR ushf;
47typedef unsigned long ulg;
48
49extern char *z_errmsg[]; /* indexed by 1-zlib_error */
50
51#define ERR_RETURN(strm,err) return (strm->msg=z_errmsg[1-err], err)
52/* To be used only when the state is known to be valid */
53
54#ifndef NULL
55#define NULL ((void *) 0)
56#endif
57
58 /* common constants */
59
60#define DEFLATED 8
61
62#ifndef DEF_WBITS
63# define DEF_WBITS MAX_WBITS
64#endif
65/* default windowBits for decompression. MAX_WBITS is for compression only */
66
67#if MAX_MEM_LEVEL >= 8
68# define DEF_MEM_LEVEL 8
69#else
70# define DEF_MEM_LEVEL MAX_MEM_LEVEL
71#endif
72/* default memLevel */
73
74#define STORED_BLOCK 0
75#define STATIC_TREES 1
76#define DYN_TREES 2
77/* The three kinds of block type */
78
79#define MIN_MATCH 3
80#define MAX_MATCH 258
81/* The minimum and maximum match lengths */
82
83 /* functions */
84
85#include <linux/string.h>
86#define zmemcpy memcpy
87#define zmemzero(dest, len) memset(dest, 0, len)
88
89/* Diagnostic functions */
90#ifdef DEBUG_ZLIB
91# include <stdio.h>
92# ifndef verbose
93# define verbose 0
94# endif
95# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
96# define Trace(x) fprintf x
97# define Tracev(x) {if (verbose) fprintf x ;}
98# define Tracevv(x) {if (verbose>1) fprintf x ;}
99# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
100# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
101#else
102# define Assert(cond,msg)
103# define Trace(x)
104# define Tracev(x)
105# define Tracevv(x)
106# define Tracec(c,x)
107# define Tracecv(c,x)
108#endif
109
110
111typedef uLong (*check_func) OF((uLong check, Bytef *buf, uInt len));
112
113/* voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); */
114/* void zcfree OF((voidpf opaque, voidpf ptr)); */
115
116#define ZALLOC(strm, items, size) \
117 (*((strm)->zalloc))((strm)->opaque, (items), (size))
118#define ZFREE(strm, addr, size) \
119 (*((strm)->zfree))((strm)->opaque, (voidpf)(addr), (size))
120#define TRY_FREE(s, p, n) {if (p) ZFREE(s, p, n);}
121
122/* deflate.h -- internal compression state
123 * Copyright (C) 1995 Jean-loup Gailly
124 * For conditions of distribution and use, see copyright notice in zlib.h
125 */
126
127/* WARNING: this file should *not* be used by applications. It is
128 part of the implementation of the compression library and is
129 subject to change. Applications should only use zlib.h.
130 */
131
132/*+++++*/
133/* infblock.h -- header to use infblock.c
134 * Copyright (C) 1995 Mark Adler
135 * For conditions of distribution and use, see copyright notice in zlib.h
136 */
137
138/* WARNING: this file should *not* be used by applications. It is
139 part of the implementation of the compression library and is
140 subject to change. Applications should only use zlib.h.
141 */
142
143struct inflate_blocks_state;
144typedef struct inflate_blocks_state FAR inflate_blocks_statef;
145
146local inflate_blocks_statef * inflate_blocks_new OF((
147 z_stream *z,
148 check_func c, /* check function */
149 uInt w)); /* window size */
150
151local int inflate_blocks OF((
152 inflate_blocks_statef *,
153 z_stream *,
154 int)); /* initial return code */
155
156local void inflate_blocks_reset OF((
157 inflate_blocks_statef *,
158 z_stream *,
159 uLongf *)); /* check value on output */
160
161local int inflate_blocks_free OF((
162 inflate_blocks_statef *,
163 z_stream *,
164 uLongf *)); /* check value on output */
165
166local int inflate_addhistory OF((
167 inflate_blocks_statef *,
168 z_stream *));
169
170local int inflate_packet_flush OF((
171 inflate_blocks_statef *));
172
173/*+++++*/
174/* inftrees.h -- header to use inftrees.c
175 * Copyright (C) 1995 Mark Adler
176 * For conditions of distribution and use, see copyright notice in zlib.h
177 */
178
179/* WARNING: this file should *not* be used by applications. It is
180 part of the implementation of the compression library and is
181 subject to change. Applications should only use zlib.h.
182 */
183
184/* Huffman code lookup table entry--this entry is four bytes for machines
185 that have 16-bit pointers (e.g. PC's in the small or medium model). */
186
187typedef struct inflate_huft_s FAR inflate_huft;
188
189struct inflate_huft_s {
190 union {
191 struct {
192 Byte Exop; /* number of extra bits or operation */
193 Byte Bits; /* number of bits in this code or subcode */
194 } what;
195 uInt Nalloc; /* number of these allocated here */
196 Bytef *pad; /* pad structure to a power of 2 (4 bytes for */
197 } word; /* 16-bit, 8 bytes for 32-bit machines) */
198 union {
199 uInt Base; /* literal, length base, or distance base */
200 inflate_huft *Next; /* pointer to next level of table */
201 } more;
202};
203
204#ifdef DEBUG_ZLIB
205 local uInt inflate_hufts;
206#endif
207
208local int inflate_trees_bits OF((
209 uIntf *, /* 19 code lengths */
210 uIntf *, /* bits tree desired/actual depth */
211 inflate_huft * FAR *, /* bits tree result */
212 z_stream *)); /* for zalloc, zfree functions */
213
214local int inflate_trees_dynamic OF((
215 uInt, /* number of literal/length codes */
216 uInt, /* number of distance codes */
217 uIntf *, /* that many (total) code lengths */
218 uIntf *, /* literal desired/actual bit depth */
219 uIntf *, /* distance desired/actual bit depth */
220 inflate_huft * FAR *, /* literal/length tree result */
221 inflate_huft * FAR *, /* distance tree result */
222 z_stream *)); /* for zalloc, zfree functions */
223
224local int inflate_trees_fixed OF((
225 uIntf *, /* literal desired/actual bit depth */
226 uIntf *, /* distance desired/actual bit depth */
227 inflate_huft * FAR *, /* literal/length tree result */
228 inflate_huft * FAR *)); /* distance tree result */
229
230local int inflate_trees_free OF((
231 inflate_huft *, /* tables to free */
232 z_stream *)); /* for zfree function */
233
234
235/*+++++*/
236/* infcodes.h -- header to use infcodes.c
237 * Copyright (C) 1995 Mark Adler
238 * For conditions of distribution and use, see copyright notice in zlib.h
239 */
240
241/* WARNING: this file should *not* be used by applications. It is
242 part of the implementation of the compression library and is
243 subject to change. Applications should only use zlib.h.
244 */
245
246struct inflate_codes_state;
247typedef struct inflate_codes_state FAR inflate_codes_statef;
248
249local inflate_codes_statef *inflate_codes_new OF((
250 uInt, uInt,
251 inflate_huft *, inflate_huft *,
252 z_stream *));
253
254local int inflate_codes OF((
255 inflate_blocks_statef *,
256 z_stream *,
257 int));
258
259local void inflate_codes_free OF((
260 inflate_codes_statef *,
261 z_stream *));
262
263
264/*+++++*/
265/* inflate.c -- zlib interface to inflate modules
266 * Copyright (C) 1995 Mark Adler
267 * For conditions of distribution and use, see copyright notice in zlib.h
268 */
269
270/* inflate private state */
271struct internal_state {
272
273 /* mode */
274 enum {
275 METHOD, /* waiting for method byte */
276 FLAG, /* waiting for flag byte */
277 BLOCKS, /* decompressing blocks */
278 CHECK4, /* four check bytes to go */
279 CHECK3, /* three check bytes to go */
280 CHECK2, /* two check bytes to go */
281 CHECK1, /* one check byte to go */
282 DONE, /* finished check, done */
283 BAD} /* got an error--stay here */
284 mode; /* current inflate mode */
285
286 /* mode dependent information */
287 union {
288 uInt method; /* if FLAGS, method byte */
289 struct {
290 uLong was; /* computed check value */
291 uLong need; /* stream check value */
292 } check; /* if CHECK, check values to compare */
293 uInt marker; /* if BAD, inflateSync's marker bytes count */
294 } sub; /* submode */
295
296 /* mode independent information */
297 int nowrap; /* flag for no wrapper */
298 uInt wbits; /* log2(window size) (8..15, defaults to 15) */
299 inflate_blocks_statef
300 *blocks; /* current inflate_blocks state */
301
302};
303
304
305int inflateReset(z)
306z_stream *z;
307{
308 uLong c;
309
310 if (z == Z_NULL || z->state == Z_NULL)
311 return Z_STREAM_ERROR;
312 z->total_in = z->total_out = 0;
313 z->msg = Z_NULL;
314 z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
315 inflate_blocks_reset(z->state->blocks, z, &c);
316 Trace((stderr, "inflate: reset\n"));
317 return Z_OK;
318}
319
320
321int inflateEnd(z)
322z_stream *z;
323{
324 uLong c;
325
326 if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
327 return Z_STREAM_ERROR;
328 if (z->state->blocks != Z_NULL)
329 inflate_blocks_free(z->state->blocks, z, &c);
330 ZFREE(z, z->state, sizeof(struct internal_state));
331 z->state = Z_NULL;
332 Trace((stderr, "inflate: end\n"));
333 return Z_OK;
334}
335
336
337int inflateInit2(z, w)
338z_stream *z;
339int w;
340{
341 /* initialize state */
342 if (z == Z_NULL)
343 return Z_STREAM_ERROR;
344/* if (z->zalloc == Z_NULL) z->zalloc = zcalloc; */
345/* if (z->zfree == Z_NULL) z->zfree = zcfree; */
346 if ((z->state = (struct internal_state FAR *)
347 ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)
348 return Z_MEM_ERROR;
349 z->state->blocks = Z_NULL;
350
351 /* handle undocumented nowrap option (no zlib header or check) */
352 z->state->nowrap = 0;
353 if (w < 0)
354 {
355 w = - w;
356 z->state->nowrap = 1;
357 }
358
359 /* set window size */
360 if (w < 8 || w > 15)
361 {
362 inflateEnd(z);
363 return Z_STREAM_ERROR;
364 }
365 z->state->wbits = (uInt)w;
366
367 /* create inflate_blocks state */
368 if ((z->state->blocks =
369 inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, 1 << w))
370 == Z_NULL)
371 {
372 inflateEnd(z);
373 return Z_MEM_ERROR;
374 }
375 Trace((stderr, "inflate: allocated\n"));
376
377 /* reset state */
378 inflateReset(z);
379 return Z_OK;
380}
381
382
383int inflateInit(z)
384z_stream *z;
385{
386 return inflateInit2(z, DEF_WBITS);
387}
388
389
390#define NEEDBYTE {if(z->avail_in==0)goto empty;r=Z_OK;}
391#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
392
393int inflate(z, f)
394z_stream *z;
395int f;
396{
397 int r;
398 uInt b;
399
400 if (z == Z_NULL || z->next_in == Z_NULL)
401 return Z_STREAM_ERROR;
402 r = Z_BUF_ERROR;
403 while (1) switch (z->state->mode)
404 {
405 case METHOD:
406 NEEDBYTE
407 if (((z->state->sub.method = NEXTBYTE) & 0xf) != DEFLATED)
408 {
409 z->state->mode = BAD;
410 z->msg = "unknown compression method";
411 z->state->sub.marker = 5; /* can't try inflateSync */
412 break;
413 }
414 if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
415 {
416 z->state->mode = BAD;
417 z->msg = "invalid window size";
418 z->state->sub.marker = 5; /* can't try inflateSync */
419 break;
420 }
421 z->state->mode = FLAG;
422 case FLAG:
423 NEEDBYTE
424 if ((b = NEXTBYTE) & 0x20)
425 {
426 z->state->mode = BAD;
427 z->msg = "invalid reserved bit";
428 z->state->sub.marker = 5; /* can't try inflateSync */
429 break;
430 }
431 if (((z->state->sub.method << 8) + b) % 31)
432 {
433 z->state->mode = BAD;
434 z->msg = "incorrect header check";
435 z->state->sub.marker = 5; /* can't try inflateSync */
436 break;
437 }
438 Trace((stderr, "inflate: zlib header ok\n"));
439 z->state->mode = BLOCKS;
440 case BLOCKS:
441 r = inflate_blocks(z->state->blocks, z, r);
442 if (f == Z_PACKET_FLUSH && z->avail_in == 0 && z->avail_out != 0)
443 r = inflate_packet_flush(z->state->blocks);
444 if (r == Z_DATA_ERROR)
445 {
446 z->state->mode = BAD;
447 z->state->sub.marker = 0; /* can try inflateSync */
448 break;
449 }
450 if (r != Z_STREAM_END)
451 return r;
452 r = Z_OK;
453 inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
454 if (z->state->nowrap)
455 {
456 z->state->mode = DONE;
457 break;
458 }
459 z->state->mode = CHECK4;
460 case CHECK4:
461 NEEDBYTE
462 z->state->sub.check.need = (uLong)NEXTBYTE << 24;
463 z->state->mode = CHECK3;
464 case CHECK3:
465 NEEDBYTE
466 z->state->sub.check.need += (uLong)NEXTBYTE << 16;
467 z->state->mode = CHECK2;
468 case CHECK2:
469 NEEDBYTE
470 z->state->sub.check.need += (uLong)NEXTBYTE << 8;
471 z->state->mode = CHECK1;
472 case CHECK1:
473 NEEDBYTE
474 z->state->sub.check.need += (uLong)NEXTBYTE;
475
476 if (z->state->sub.check.was != z->state->sub.check.need)
477 {
478 z->state->mode = BAD;
479 z->msg = "incorrect data check";
480 z->state->sub.marker = 5; /* can't try inflateSync */
481 break;
482 }
483 Trace((stderr, "inflate: zlib check ok\n"));
484 z->state->mode = DONE;
485 case DONE:
486 return Z_STREAM_END;
487 case BAD:
488 return Z_DATA_ERROR;
489 default:
490 return Z_STREAM_ERROR;
491 }
492
493 empty:
494 if (f != Z_PACKET_FLUSH)
495 return r;
496 z->state->mode = BAD;
497 z->state->sub.marker = 0; /* can try inflateSync */
498 return Z_DATA_ERROR;
499}
500
501/*
502 * This subroutine adds the data at next_in/avail_in to the output history
503 * without performing any output. The output buffer must be "caught up";
504 * i.e. no pending output (hence s->read equals s->write), and the state must
505 * be BLOCKS (i.e. we should be willing to see the start of a series of
506 * BLOCKS). On exit, the output will also be caught up, and the checksum
507 * will have been updated if need be.
508 */
509
510int inflateIncomp(z)
511z_stream *z;
512{
513 if (z->state->mode != BLOCKS)
514 return Z_DATA_ERROR;
515 return inflate_addhistory(z->state->blocks, z);
516}
517
518
519int inflateSync(z)
520z_stream *z;
521{
522 uInt n; /* number of bytes to look at */
523 Bytef *p; /* pointer to bytes */
524 uInt m; /* number of marker bytes found in a row */
525 uLong r, w; /* temporaries to save total_in and total_out */
526
527 /* set up */
528 if (z == Z_NULL || z->state == Z_NULL)
529 return Z_STREAM_ERROR;
530 if (z->state->mode != BAD)
531 {
532 z->state->mode = BAD;
533 z->state->sub.marker = 0;
534 }
535 if ((n = z->avail_in) == 0)
536 return Z_BUF_ERROR;
537 p = z->next_in;
538 m = z->state->sub.marker;
539
540 /* search */
541 while (n && m < 4)
542 {
543 if (*p == (Byte)(m < 2 ? 0 : 0xff))
544 m++;
545 else if (*p)
546 m = 0;
547 else
548 m = 4 - m;
549 p++, n--;
550 }
551
552 /* restore */
553 z->total_in += p - z->next_in;
554 z->next_in = p;
555 z->avail_in = n;
556 z->state->sub.marker = m;
557
558 /* return no joy or set up to restart on a new block */
559 if (m != 4)
560 return Z_DATA_ERROR;
561 r = z->total_in; w = z->total_out;
562 inflateReset(z);
563 z->total_in = r; z->total_out = w;
564 z->state->mode = BLOCKS;
565 return Z_OK;
566}
567
568#undef NEEDBYTE
569#undef NEXTBYTE
570
571/*+++++*/
572/* infutil.h -- types and macros common to blocks and codes
573 * Copyright (C) 1995 Mark Adler
574 * For conditions of distribution and use, see copyright notice in zlib.h
575 */
576
577/* WARNING: this file should *not* be used by applications. It is
578 part of the implementation of the compression library and is
579 subject to change. Applications should only use zlib.h.
580 */
581
582/* inflate blocks semi-private state */
583struct inflate_blocks_state {
584
585 /* mode */
586 enum {
587 TYPE, /* get type bits (3, including end bit) */
588 LENS, /* get lengths for stored */
589 STORED, /* processing stored block */
590 TABLE, /* get table lengths */
591 BTREE, /* get bit lengths tree for a dynamic block */
592 DTREE, /* get length, distance trees for a dynamic block */
593 CODES, /* processing fixed or dynamic block */
594 DRY, /* output remaining window bytes */
595 DONEB, /* finished last block, done */
596 BADB} /* got a data error--stuck here */
597 mode; /* current inflate_block mode */
598
599 /* mode dependent information */
600 union {
601 uInt left; /* if STORED, bytes left to copy */
602 struct {
603 uInt table; /* table lengths (14 bits) */
604 uInt index; /* index into blens (or border) */
605 uIntf *blens; /* bit lengths of codes */
606 uInt bb; /* bit length tree depth */
607 inflate_huft *tb; /* bit length decoding tree */
608 int nblens; /* # elements allocated at blens */
609 } trees; /* if DTREE, decoding info for trees */
610 struct {
611 inflate_huft *tl, *td; /* trees to free */
612 inflate_codes_statef
613 *codes;
614 } decode; /* if CODES, current state */
615 } sub; /* submode */
616 uInt last; /* true if this block is the last block */
617
618 /* mode independent information */
619 uInt bitk; /* bits in bit buffer */
620 uLong bitb; /* bit buffer */
621 Bytef *window; /* sliding window */
622 Bytef *end; /* one byte after sliding window */
623 Bytef *read; /* window read pointer */
624 Bytef *write; /* window write pointer */
625 check_func checkfn; /* check function */
626 uLong check; /* check on output */
627
628};
629
630
631/* defines for inflate input/output */
632/* update pointers and return */
633#define UPDBITS {s->bitb=b;s->bitk=k;}
634#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
635#define UPDOUT {s->write=q;}
636#define UPDATE {UPDBITS UPDIN UPDOUT}
637#define LEAVE {UPDATE return inflate_flush(s,z,r);}
638/* get bytes and bits */
639#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
640#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
641#define NEXTBYTE (n--,*p++)
642#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
643#define DUMPBITS(j) {b>>=(j);k-=(j);}
644/* output bytes */
645#define WAVAIL (q<s->read?s->read-q-1:s->end-q)
646#define LOADOUT {q=s->write;m=WAVAIL;}
647#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=WAVAIL;}}
648#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
649#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
650#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
651/* load local pointers */
652#define LOAD {LOADIN LOADOUT}
653
654/*
655 * The IBM 150 firmware munges the data right after _etext[]. This
656 * protects it. -- Cort
657 */
658local uInt protect_mask[] = {0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0 ,0};
659/* And'ing with mask[n] masks the lower n bits */
660local uInt inflate_mask[] = {
661 0x0000,
662 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
663 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
664};
665
666/* copy as much as possible from the sliding window to the output area */
667local int inflate_flush OF((
668 inflate_blocks_statef *,
669 z_stream *,
670 int));
671
672/*+++++*/
673/* inffast.h -- header to use inffast.c
674 * Copyright (C) 1995 Mark Adler
675 * For conditions of distribution and use, see copyright notice in zlib.h
676 */
677
678/* WARNING: this file should *not* be used by applications. It is
679 part of the implementation of the compression library and is
680 subject to change. Applications should only use zlib.h.
681 */
682
683local int inflate_fast OF((
684 uInt,
685 uInt,
686 inflate_huft *,
687 inflate_huft *,
688 inflate_blocks_statef *,
689 z_stream *));
690
691
692/*+++++*/
693/* infblock.c -- interpret and process block types to last block
694 * Copyright (C) 1995 Mark Adler
695 * For conditions of distribution and use, see copyright notice in zlib.h
696 */
697
698/* Table for deflate from PKZIP's appnote.txt. */
699local uInt border[] = { /* Order of the bit length code lengths */
700 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
701
702/*
703 Notes beyond the 1.93a appnote.txt:
704
705 1. Distance pointers never point before the beginning of the output
706 stream.
707 2. Distance pointers can point back across blocks, up to 32k away.
708 3. There is an implied maximum of 7 bits for the bit length table and
709 15 bits for the actual data.
710 4. If only one code exists, then it is encoded using one bit. (Zero
711 would be more efficient, but perhaps a little confusing.) If two
712 codes exist, they are coded using one bit each (0 and 1).
713 5. There is no way of sending zero distance codes--a dummy must be
714 sent if there are none. (History: a pre 2.0 version of PKZIP would
715 store blocks with no distance codes, but this was discovered to be
716 too harsh a criterion.) Valid only for 1.93a. 2.04c does allow
717 zero distance codes, which is sent as one code of zero bits in
718 length.
719 6. There are up to 286 literal/length codes. Code 256 represents the
720 end-of-block. Note however that the static length tree defines
721 288 codes just to fill out the Huffman codes. Codes 286 and 287
722 cannot be used though, since there is no length base or extra bits
723 defined for them. Similarily, there are up to 30 distance codes.
724 However, static trees define 32 codes (all 5 bits) to fill out the
725 Huffman codes, but the last two had better not show up in the data.
726 7. Unzip can check dynamic Huffman blocks for complete code sets.
727 The exception is that a single code would not be complete (see #4).
728 8. The five bits following the block type is really the number of
729 literal codes sent minus 257.
730 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
731 (1+6+6). Therefore, to output three times the length, you output
732 three codes (1+1+1), whereas to output four times the same length,
733 you only need two codes (1+3). Hmm.
734 10. In the tree reconstruction algorithm, Code = Code + Increment
735 only if BitLength(i) is not zero. (Pretty obvious.)
736 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
737 12. Note: length code 284 can represent 227-258, but length code 285
738 really is 258. The last length deserves its own, short code
739 since it gets used a lot in very redundant files. The length
740 258 is special since 258 - 3 (the min match length) is 255.
741 13. The literal/length and distance code bit lengths are read as a
742 single stream of lengths. It is possible (and advantageous) for
743 a repeat code (16, 17, or 18) to go across the boundary between
744 the two sets of lengths.
745 */
746
747
748local void inflate_blocks_reset(s, z, c)
749inflate_blocks_statef *s;
750z_stream *z;
751uLongf *c;
752{
753 if (s->checkfn != Z_NULL)
754 *c = s->check;
755 if (s->mode == BTREE || s->mode == DTREE)
756 ZFREE(z, s->sub.trees.blens, s->sub.trees.nblens * sizeof(uInt));
757 if (s->mode == CODES)
758 {
759 inflate_codes_free(s->sub.decode.codes, z);
760 inflate_trees_free(s->sub.decode.td, z);
761 inflate_trees_free(s->sub.decode.tl, z);
762 }
763 s->mode = TYPE;
764 s->bitk = 0;
765 s->bitb = 0;
766 s->read = s->write = s->window;
767 if (s->checkfn != Z_NULL)
768 s->check = (*s->checkfn)(0L, Z_NULL, 0);
769 Trace((stderr, "inflate: blocks reset\n"));
770}
771
772
773local inflate_blocks_statef *inflate_blocks_new(z, c, w)
774z_stream *z;
775check_func c;
776uInt w;
777{
778 inflate_blocks_statef *s;
779
780 if ((s = (inflate_blocks_statef *)ZALLOC
781 (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
782 return s;
783 if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
784 {
785 ZFREE(z, s, sizeof(struct inflate_blocks_state));
786 return Z_NULL;
787 }
788 s->end = s->window + w;
789 s->checkfn = c;
790 s->mode = TYPE;
791 Trace((stderr, "inflate: blocks allocated\n"));
792 inflate_blocks_reset(s, z, &s->check);
793 return s;
794}
795
796
797local int inflate_blocks(s, z, r)
798inflate_blocks_statef *s;
799z_stream *z;
800int r;
801{
802 uInt t; /* temporary storage */
803 uLong b; /* bit buffer */
804 uInt k; /* bits in bit buffer */
805 Bytef *p; /* input data pointer */
806 uInt n; /* bytes available there */
807 Bytef *q; /* output window write pointer */
808 uInt m; /* bytes to end of window or read pointer */
809
810 /* copy input/output information to locals (UPDATE macro restores) */
811 LOAD
812
813 /* process input based on current state */
814 while (1) switch (s->mode)
815 {
816 case TYPE:
817 NEEDBITS(3)
818 t = (uInt)b & 7;
819 s->last = t & 1;
820 switch (t >> 1)
821 {
822 case 0: /* stored */
823 Trace((stderr, "inflate: stored block%s\n",
824 s->last ? " (last)" : ""));
825 DUMPBITS(3)
826 t = k & 7; /* go to byte boundary */
827 DUMPBITS(t)
828 s->mode = LENS; /* get length of stored block */
829 break;
830 case 1: /* fixed */
831 Trace((stderr, "inflate: fixed codes block%s\n",
832 s->last ? " (last)" : ""));
833 {
834 uInt bl, bd;
835 inflate_huft *tl, *td;
836
837 inflate_trees_fixed(&bl, &bd, &tl, &td);
838 s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
839 if (s->sub.decode.codes == Z_NULL)
840 {
841 r = Z_MEM_ERROR;
842 LEAVE
843 }
844 s->sub.decode.tl = Z_NULL; /* don't try to free these */
845 s->sub.decode.td = Z_NULL;
846 }
847 DUMPBITS(3)
848 s->mode = CODES;
849 break;
850 case 2: /* dynamic */
851 Trace((stderr, "inflate: dynamic codes block%s\n",
852 s->last ? " (last)" : ""));
853 DUMPBITS(3)
854 s->mode = TABLE;
855 break;
856 case 3: /* illegal */
857 DUMPBITS(3)
858 s->mode = BADB;
859 z->msg = "invalid block type";
860 r = Z_DATA_ERROR;
861 LEAVE
862 }
863 break;
864 case LENS:
865 NEEDBITS(32)
866 if (((~b) >> 16) != (b & 0xffff))
867 {
868 s->mode = BADB;
869 z->msg = "invalid stored block lengths";
870 r = Z_DATA_ERROR;
871 LEAVE
872 }
873 s->sub.left = (uInt)b & 0xffff;
874 b = k = 0; /* dump bits */
875 Tracev((stderr, "inflate: stored length %u\n", s->sub.left));
876 s->mode = s->sub.left ? STORED : TYPE;
877 break;
878 case STORED:
879 if (n == 0)
880 LEAVE
881 NEEDOUT
882 t = s->sub.left;
883 if (t > n) t = n;
884 if (t > m) t = m;
885 zmemcpy(q, p, t);
886 p += t; n -= t;
887 q += t; m -= t;
888 if ((s->sub.left -= t) != 0)
889 break;
890 Tracev((stderr, "inflate: stored end, %lu total out\n",
891 z->total_out + (q >= s->read ? q - s->read :
892 (s->end - s->read) + (q - s->window))));
893 s->mode = s->last ? DRY : TYPE;
894 break;
895 case TABLE:
896 NEEDBITS(14)
897 s->sub.trees.table = t = (uInt)b & 0x3fff;
898#ifndef PKZIP_BUG_WORKAROUND
899 if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
900 {
901 s->mode = BADB;
902 z->msg = "too many length or distance symbols";
903 r = Z_DATA_ERROR;
904 LEAVE
905 }
906#endif
907 t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
908 if (t < 19)
909 t = 19;
910 if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
911 {
912 r = Z_MEM_ERROR;
913 LEAVE
914 }
915 s->sub.trees.nblens = t;
916 DUMPBITS(14)
917 s->sub.trees.index = 0;
918 Tracev((stderr, "inflate: table sizes ok\n"));
919 s->mode = BTREE;
920 case BTREE:
921 while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
922 {
923 NEEDBITS(3)
924 s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
925 DUMPBITS(3)
926 }
927 while (s->sub.trees.index < 19)
928 s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
929 s->sub.trees.bb = 7;
930 t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
931 &s->sub.trees.tb, z);
932 if (t != Z_OK)
933 {
934 r = t;
935 if (r == Z_DATA_ERROR)
936 s->mode = BADB;
937 LEAVE
938 }
939 s->sub.trees.index = 0;
940 Tracev((stderr, "inflate: bits tree ok\n"));
941 s->mode = DTREE;
942 case DTREE:
943 while (t = s->sub.trees.table,
944 s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
945 {
946 inflate_huft *h;
947 uInt i, j, c;
948
949 t = s->sub.trees.bb;
950 NEEDBITS(t)
951 h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
952 t = h->word.what.Bits;
953 c = h->more.Base;
954 if (c < 16)
955 {
956 DUMPBITS(t)
957 s->sub.trees.blens[s->sub.trees.index++] = c;
958 }
959 else /* c == 16..18 */
960 {
961 i = c == 18 ? 7 : c - 14;
962 j = c == 18 ? 11 : 3;
963 NEEDBITS(t + i)
964 DUMPBITS(t)
965 j += (uInt)b & inflate_mask[i];
966 DUMPBITS(i)
967 i = s->sub.trees.index;
968 t = s->sub.trees.table;
969 if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
970 (c == 16 && i < 1))
971 {
972 s->mode = BADB;
973 z->msg = "invalid bit length repeat";
974 r = Z_DATA_ERROR;
975 LEAVE
976 }
977 c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
978 do {
979 s->sub.trees.blens[i++] = c;
980 } while (--j);
981 s->sub.trees.index = i;
982 }
983 }
984 inflate_trees_free(s->sub.trees.tb, z);
985 s->sub.trees.tb = Z_NULL;
986 {
987 uInt bl, bd;
988 inflate_huft *tl, *td;
989 inflate_codes_statef *c;
990
991 bl = 9; /* must be <= 9 for lookahead assumptions */
992 bd = 6; /* must be <= 9 for lookahead assumptions */
993 t = s->sub.trees.table;
994 t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
995 s->sub.trees.blens, &bl, &bd, &tl, &td, z);
996 if (t != Z_OK)
997 {
998 if (t == (uInt)Z_DATA_ERROR)
999 s->mode = BADB;
1000 r = t;
1001 LEAVE
1002 }
1003 Tracev((stderr, "inflate: trees ok\n"));
1004 if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
1005 {
1006 inflate_trees_free(td, z);
1007 inflate_trees_free(tl, z);
1008 r = Z_MEM_ERROR;
1009 LEAVE
1010 }
1011 ZFREE(z, s->sub.trees.blens, s->sub.trees.nblens * sizeof(uInt));
1012 s->sub.decode.codes = c;
1013 s->sub.decode.tl = tl;
1014 s->sub.decode.td = td;
1015 }
1016 s->mode = CODES;
1017 case CODES:
1018 UPDATE
1019 if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
1020 return inflate_flush(s, z, r);
1021 r = Z_OK;
1022 inflate_codes_free(s->sub.decode.codes, z);
1023 inflate_trees_free(s->sub.decode.td, z);
1024 inflate_trees_free(s->sub.decode.tl, z);
1025 LOAD
1026 Tracev((stderr, "inflate: codes end, %lu total out\n",
1027 z->total_out + (q >= s->read ? q - s->read :
1028 (s->end - s->read) + (q - s->window))));
1029 if (!s->last)
1030 {
1031 s->mode = TYPE;
1032 break;
1033 }
1034 if (k > 7) /* return unused byte, if any */
1035 {
1036 Assert(k < 16, "inflate_codes grabbed too many bytes")
1037 k -= 8;
1038 n++;
1039 p--; /* can always return one */
1040 }
1041 s->mode = DRY;
1042 case DRY:
1043 FLUSH
1044 if (s->read != s->write)
1045 LEAVE
1046 s->mode = DONEB;
1047 case DONEB:
1048 r = Z_STREAM_END;
1049 LEAVE
1050 case BADB:
1051 r = Z_DATA_ERROR;
1052 LEAVE
1053 default:
1054 r = Z_STREAM_ERROR;
1055 LEAVE
1056 }
1057}
1058
1059
1060local int inflate_blocks_free(s, z, c)
1061inflate_blocks_statef *s;
1062z_stream *z;
1063uLongf *c;
1064{
1065 inflate_blocks_reset(s, z, c);
1066 ZFREE(z, s->window, s->end - s->window);
1067 ZFREE(z, s, sizeof(struct inflate_blocks_state));
1068 Trace((stderr, "inflate: blocks freed\n"));
1069 return Z_OK;
1070}
1071
1072/*
1073 * This subroutine adds the data at next_in/avail_in to the output history
1074 * without performing any output. The output buffer must be "caught up";
1075 * i.e. no pending output (hence s->read equals s->write), and the state must
1076 * be BLOCKS (i.e. we should be willing to see the start of a series of
1077 * BLOCKS). On exit, the output will also be caught up, and the checksum
1078 * will have been updated if need be.
1079 */
1080local int inflate_addhistory(s, z)
1081inflate_blocks_statef *s;
1082z_stream *z;
1083{
1084 uLong b; /* bit buffer */ /* NOT USED HERE */
1085 uInt k; /* bits in bit buffer */ /* NOT USED HERE */
1086 uInt t; /* temporary storage */
1087 Bytef *p; /* input data pointer */
1088 uInt n; /* bytes available there */
1089 Bytef *q; /* output window write pointer */
1090 uInt m; /* bytes to end of window or read pointer */
1091
1092 if (s->read != s->write)
1093 return Z_STREAM_ERROR;
1094 if (s->mode != TYPE)
1095 return Z_DATA_ERROR;
1096
1097 /* we're ready to rock */
1098 LOAD
1099 /* while there is input ready, copy to output buffer, moving
1100 * pointers as needed.
1101 */
1102 while (n) {
1103 t = n; /* how many to do */
1104 /* is there room until end of buffer? */
1105 if (t > m) t = m;
1106 /* update check information */
1107 if (s->checkfn != Z_NULL)
1108 s->check = (*s->checkfn)(s->check, q, t);
1109 zmemcpy(q, p, t);
1110 q += t;
1111 p += t;
1112 n -= t;
1113 z->total_out += t;
1114 s->read = q; /* drag read pointer forward */
1115/* WRAP */ /* expand WRAP macro by hand to handle s->read */
1116 if (q == s->end) {
1117 s->read = q = s->window;
1118 m = WAVAIL;
1119 }
1120 }
1121 UPDATE
1122 return Z_OK;
1123}
1124
1125
1126/*
1127 * At the end of a Deflate-compressed PPP packet, we expect to have seen
1128 * a `stored' block type value but not the (zero) length bytes.
1129 */
1130local int inflate_packet_flush(s)
1131 inflate_blocks_statef *s;
1132{
1133 if (s->mode != LENS)
1134 return Z_DATA_ERROR;
1135 s->mode = TYPE;
1136 return Z_OK;
1137}
1138
1139
1140/*+++++*/
1141/* inftrees.c -- generate Huffman trees for efficient decoding
1142 * Copyright (C) 1995 Mark Adler
1143 * For conditions of distribution and use, see copyright notice in zlib.h
1144 */
1145
1146/* simplify the use of the inflate_huft type with some defines */
1147#define base more.Base
1148#define next more.Next
1149#define exop word.what.Exop
1150#define bits word.what.Bits
1151
1152
1153local int huft_build OF((
1154 uIntf *, /* code lengths in bits */
1155 uInt, /* number of codes */
1156 uInt, /* number of "simple" codes */
1157 uIntf *, /* list of base values for non-simple codes */
1158 uIntf *, /* list of extra bits for non-simple codes */
1159 inflate_huft * FAR*,/* result: starting table */
1160 uIntf *, /* maximum lookup bits (returns actual) */
1161 z_stream *)); /* for zalloc function */
1162
1163local voidpf falloc OF((
1164 voidpf, /* opaque pointer (not used) */
1165 uInt, /* number of items */
1166 uInt)); /* size of item */
1167
1168local void ffree OF((
1169 voidpf q, /* opaque pointer (not used) */
1170 voidpf p, /* what to free (not used) */
1171 uInt n)); /* number of bytes (not used) */
1172
1173/* Tables for deflate from PKZIP's appnote.txt. */
1174local uInt cplens[] = { /* Copy lengths for literal codes 257..285 */
1175 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
1176 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
1177 /* actually lengths - 2; also see note #13 above about 258 */
1178local uInt cplext[] = { /* Extra bits for literal codes 257..285 */
1179 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
1180 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 192, 192}; /* 192==invalid */
1181local uInt cpdist[] = { /* Copy offsets for distance codes 0..29 */
1182 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
1183 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
1184 8193, 12289, 16385, 24577};
1185local uInt cpdext[] = { /* Extra bits for distance codes */
1186 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
1187 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
1188 12, 12, 13, 13};
1189
1190/*
1191 Huffman code decoding is performed using a multi-level table lookup.
1192 The fastest way to decode is to simply build a lookup table whose
1193 size is determined by the longest code. However, the time it takes
1194 to build this table can also be a factor if the data being decoded
1195 is not very long. The most common codes are necessarily the
1196 shortest codes, so those codes dominate the decoding time, and hence
1197 the speed. The idea is you can have a shorter table that decodes the
1198 shorter, more probable codes, and then point to subsidiary tables for
1199 the longer codes. The time it costs to decode the longer codes is
1200 then traded against the time it takes to make longer tables.
1201
1202 This results of this trade are in the variables lbits and dbits
1203 below. lbits is the number of bits the first level table for literal/
1204 length codes can decode in one step, and dbits is the same thing for
1205 the distance codes. Subsequent tables are also less than or equal to
1206 those sizes. These values may be adjusted either when all of the
1207 codes are shorter than that, in which case the longest code length in
1208 bits is used, or when the shortest code is *longer* than the requested
1209 table size, in which case the length of the shortest code in bits is
1210 used.
1211
1212 There are two different values for the two tables, since they code a
1213 different number of possibilities each. The literal/length table
1214 codes 286 possible values, or in a flat code, a little over eight
1215 bits. The distance table codes 30 possible values, or a little less
1216 than five bits, flat. The optimum values for speed end up being
1217 about one bit more than those, so lbits is 8+1 and dbits is 5+1.
1218 The optimum values may differ though from machine to machine, and
1219 possibly even between compilers. Your mileage may vary.
1220 */
1221
1222
1223/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
1224#define BMAX 15 /* maximum bit length of any code */
1225#define N_MAX 288 /* maximum number of codes in any set */
1226
1227#ifdef DEBUG_ZLIB
1228 uInt inflate_hufts;
1229#endif
1230
1231local int huft_build(b, n, s, d, e, t, m, zs)
1232uIntf *b; /* code lengths in bits (all assumed <= BMAX) */
1233uInt n; /* number of codes (assumed <= N_MAX) */
1234uInt s; /* number of simple-valued codes (0..s-1) */
1235uIntf *d; /* list of base values for non-simple codes */
1236uIntf *e; /* list of extra bits for non-simple codes */
1237inflate_huft * FAR *t; /* result: starting table */
1238uIntf *m; /* maximum lookup bits, returns actual */
1239z_stream *zs; /* for zalloc function */
1240/* Given a list of code lengths and a maximum table size, make a set of
1241 tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
1242 if the given code set is incomplete (the tables are still built in this
1243 case), Z_DATA_ERROR if the input is invalid (all zero length codes or an
1244 over-subscribed set of lengths), or Z_MEM_ERROR if not enough memory. */
1245{
1246
1247 uInt a; /* counter for codes of length k */
1248 uInt c[BMAX+1]; /* bit length count table */
1249 uInt f; /* i repeats in table every f entries */
1250 int g; /* maximum code length */
1251 int h; /* table level */
1252 register uInt i; /* counter, current code */
1253 register uInt j; /* counter */
1254 register int k; /* number of bits in current code */
1255 int l; /* bits per table (returned in m) */
1256 register uIntf *p; /* pointer into c[], b[], or v[] */
1257 inflate_huft *q; /* points to current table */
1258 struct inflate_huft_s r; /* table entry for structure assignment */
1259 inflate_huft *u[BMAX]; /* table stack */
1260 uInt v[N_MAX]; /* values in order of bit length */
1261 register int w; /* bits before this table == (l * h) */
1262 uInt x[BMAX+1]; /* bit offsets, then code stack */
1263 uIntf *xp; /* pointer into x */
1264 int y; /* number of dummy codes added */
1265 uInt z; /* number of entries in current table */
1266
1267
1268 /* Generate counts for each bit length */
1269 p = c;
1270#define C0 *p++ = 0;
1271#define C2 C0 C0 C0 C0
1272#define C4 C2 C2 C2 C2
1273 C4 /* clear c[]--assume BMAX+1 is 16 */
1274 p = b; i = n;
1275 do {
1276 c[*p++]++; /* assume all entries <= BMAX */
1277 } while (--i);
1278 if (c[0] == n) /* null input--all zero length codes */
1279 {
1280 *t = (inflate_huft *)Z_NULL;
1281 *m = 0;
1282 return Z_OK;
1283 }
1284
1285
1286 /* Find minimum and maximum length, bound *m by those */
1287 l = *m;
1288 for (j = 1; j <= BMAX; j++)
1289 if (c[j])
1290 break;
1291 k = j; /* minimum code length */
1292 if ((uInt)l < j)
1293 l = j;
1294 for (i = BMAX; i; i--)
1295 if (c[i])
1296 break;
1297 g = i; /* maximum code length */
1298 if ((uInt)l > i)
1299 l = i;
1300 *m = l;
1301
1302
1303 /* Adjust last length count to fill out codes, if needed */
1304 for (y = 1 << j; j < i; j++, y <<= 1)
1305 if ((y -= c[j]) < 0)
1306 return Z_DATA_ERROR;
1307 if ((y -= c[i]) < 0)
1308 return Z_DATA_ERROR;
1309 c[i] += y;
1310
1311
1312 /* Generate starting offsets into the value table for each length */
1313 x[1] = j = 0;
1314 p = c + 1; xp = x + 2;
1315 while (--i) { /* note that i == g from above */
1316 *xp++ = (j += *p++);
1317 }
1318
1319
1320 /* Make a table of values in order of bit lengths */
1321 p = b; i = 0;
1322 do {
1323 if ((j = *p++) != 0)
1324 v[x[j]++] = i;
1325 } while (++i < n);
1326
1327
1328 /* Generate the Huffman codes and for each, make the table entries */
1329 x[0] = i = 0; /* first Huffman code is zero */
1330 p = v; /* grab values in bit order */
1331 h = -1; /* no tables yet--level -1 */
1332 w = -l; /* bits decoded == (l * h) */
1333 u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */
1334 q = (inflate_huft *)Z_NULL; /* ditto */
1335 z = 0; /* ditto */
1336
1337 /* go through the bit lengths (k already is bits in shortest code) */
1338 for (; k <= g; k++)
1339 {
1340 a = c[k];
1341 while (a--)
1342 {
1343 /* here i is the Huffman code of length k bits for value *p */
1344 /* make tables up to required level */
1345 while (k > w + l)
1346 {
1347 h++;
1348 w += l; /* previous table always l bits */
1349
1350 /* compute minimum size table less than or equal to l bits */
1351 z = (z = g - w) > (uInt)l ? l : z; /* table size upper limit */
1352 if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
1353 { /* too few codes for k-w bit table */
1354 f -= a + 1; /* deduct codes from patterns left */
1355 xp = c + k;
1356 if (j < z)
1357 while (++j < z) /* try smaller tables up to z bits */
1358 {
1359 if ((f <<= 1) <= *++xp)
1360 break; /* enough codes to use up j bits */
1361 f -= *xp; /* else deduct codes from patterns */
1362 }
1363 }
1364 z = 1 << j; /* table entries for j-bit table */
1365
1366 /* allocate and link in new table */
1367 if ((q = (inflate_huft *)ZALLOC
1368 (zs,z + 1,sizeof(inflate_huft))) == Z_NULL)
1369 {
1370 if (h)
1371 inflate_trees_free(u[0], zs);
1372 return Z_MEM_ERROR; /* not enough memory */
1373 }
1374 q->word.Nalloc = z + 1;
1375#ifdef DEBUG_ZLIB
1376 inflate_hufts += z + 1;
1377#endif
1378 *t = q + 1; /* link to list for huft_free() */
1379 *(t = &(q->next)) = Z_NULL;
1380 u[h] = ++q; /* table starts after link */
1381
1382 /* connect to last table, if there is one */
1383 if (h)
1384 {
1385 x[h] = i; /* save pattern for backing up */
1386 r.bits = (Byte)l; /* bits to dump before this table */
1387 r.exop = (Byte)j; /* bits in this table */
1388 r.next = q; /* pointer to this table */
1389 j = i >> (w - l); /* (get around Turbo C bug) */
1390 u[h-1][j] = r; /* connect to last table */
1391 }
1392 }
1393
1394 /* set up table entry in r */
1395 r.bits = (Byte)(k - w);
1396 if (p >= v + n)
1397 r.exop = 128 + 64; /* out of values--invalid code */
1398 else if (*p < s)
1399 {
1400 r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */
1401 r.base = *p++; /* simple code is just the value */
1402 }
1403 else
1404 {
1405 r.exop = (Byte)e[*p - s] + 16 + 64; /* non-simple--look up in lists */
1406 r.base = d[*p++ - s];
1407 }
1408
1409 /* fill code-like entries with r */
1410 f = 1 << (k - w);
1411 for (j = i >> w; j < z; j += f)
1412 q[j] = r;
1413
1414 /* backwards increment the k-bit code i */
1415 for (j = 1 << (k - 1); i & j; j >>= 1)
1416 i ^= j;
1417 i ^= j;
1418
1419 /* backup over finished tables */
1420 while ((i & ((1 << w) - 1)) != x[h])
1421 {
1422 h--; /* don't need to update q */
1423 w -= l;
1424 }
1425 }
1426 }
1427
1428
1429 /* Return Z_BUF_ERROR if we were given an incomplete table */
1430 return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
1431}
1432
1433
1434local int inflate_trees_bits(c, bb, tb, z)
1435uIntf *c; /* 19 code lengths */
1436uIntf *bb; /* bits tree desired/actual depth */
1437inflate_huft * FAR *tb; /* bits tree result */
1438z_stream *z; /* for zfree function */
1439{
1440 int r;
1441
1442 r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL, tb, bb, z);
1443 if (r == Z_DATA_ERROR)
1444 z->msg = "oversubscribed dynamic bit lengths tree";
1445 else if (r == Z_BUF_ERROR)
1446 {
1447 inflate_trees_free(*tb, z);
1448 z->msg = "incomplete dynamic bit lengths tree";
1449 r = Z_DATA_ERROR;
1450 }
1451 return r;
1452}
1453
1454
1455local int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, z)
1456uInt nl; /* number of literal/length codes */
1457uInt nd; /* number of distance codes */
1458uIntf *c; /* that many (total) code lengths */
1459uIntf *bl; /* literal desired/actual bit depth */
1460uIntf *bd; /* distance desired/actual bit depth */
1461inflate_huft * FAR *tl; /* literal/length tree result */
1462inflate_huft * FAR *td; /* distance tree result */
1463z_stream *z; /* for zfree function */
1464{
1465 int r;
1466
1467 /* build literal/length tree */
1468 if ((r = huft_build(c, nl, 257, cplens, cplext, tl, bl, z)) != Z_OK)
1469 {
1470 if (r == Z_DATA_ERROR)
1471 z->msg = "oversubscribed literal/length tree";
1472 else if (r == Z_BUF_ERROR)
1473 {
1474 inflate_trees_free(*tl, z);
1475 z->msg = "incomplete literal/length tree";
1476 r = Z_DATA_ERROR;
1477 }
1478 return r;
1479 }
1480
1481 /* build distance tree */
1482 if ((r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, z)) != Z_OK)
1483 {
1484 if (r == Z_DATA_ERROR)
1485 z->msg = "oversubscribed literal/length tree";
1486 else if (r == Z_BUF_ERROR) {
1487#ifdef PKZIP_BUG_WORKAROUND
1488 r = Z_OK;
1489 }
1490#else
1491 inflate_trees_free(*td, z);
1492 z->msg = "incomplete literal/length tree";
1493 r = Z_DATA_ERROR;
1494 }
1495 inflate_trees_free(*tl, z);
1496 return r;
1497#endif
1498 }
1499
1500 /* done */
1501 return Z_OK;
1502}
1503
1504
1505/* build fixed tables only once--keep them here */
1506local int fixed_lock = 0;
1507local int fixed_built = 0;
1508#define FIXEDH 530 /* number of hufts used by fixed tables */
1509local uInt fixed_left = FIXEDH;
1510local inflate_huft fixed_mem[FIXEDH];
1511local uInt fixed_bl;
1512local uInt fixed_bd;
1513local inflate_huft *fixed_tl;
1514local inflate_huft *fixed_td;
1515
1516
1517local voidpf falloc(q, n, s)
1518voidpf q; /* opaque pointer (not used) */
1519uInt n; /* number of items */
1520uInt s; /* size of item */
1521{
1522 Assert(s == sizeof(inflate_huft) && n <= fixed_left,
1523 "inflate_trees falloc overflow");
1524 if (q) s++; /* to make some compilers happy */
1525 fixed_left -= n;
1526 return (voidpf)(fixed_mem + fixed_left);
1527}
1528
1529
1530local void ffree(q, p, n)
1531voidpf q;
1532voidpf p;
1533uInt n;
1534{
1535 Assert(0, "inflate_trees ffree called!");
1536 if (q) q = p; /* to make some compilers happy */
1537}
1538
1539
1540local int inflate_trees_fixed(bl, bd, tl, td)
1541uIntf *bl; /* literal desired/actual bit depth */
1542uIntf *bd; /* distance desired/actual bit depth */
1543inflate_huft * FAR *tl; /* literal/length tree result */
1544inflate_huft * FAR *td; /* distance tree result */
1545{
1546 /* build fixed tables if not built already--lock out other instances */
1547 while (++fixed_lock > 1)
1548 fixed_lock--;
1549 if (!fixed_built)
1550 {
1551 int k; /* temporary variable */
1552 unsigned c[288]; /* length list for huft_build */
1553 z_stream z; /* for falloc function */
1554
1555 /* set up fake z_stream for memory routines */
1556 z.zalloc = falloc;
1557 z.zfree = ffree;
1558 z.opaque = Z_NULL;
1559
1560 /* literal table */
1561 for (k = 0; k < 144; k++)
1562 c[k] = 8;
1563 for (; k < 256; k++)
1564 c[k] = 9;
1565 for (; k < 280; k++)
1566 c[k] = 7;
1567 for (; k < 288; k++)
1568 c[k] = 8;
1569 fixed_bl = 7;
1570 huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, &z);
1571
1572 /* distance table */
1573 for (k = 0; k < 30; k++)
1574 c[k] = 5;
1575 fixed_bd = 5;
1576 huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd, &z);
1577
1578 /* done */
1579 fixed_built = 1;
1580 }
1581 fixed_lock--;
1582 *bl = fixed_bl;
1583 *bd = fixed_bd;
1584 *tl = fixed_tl;
1585 *td = fixed_td;
1586 return Z_OK;
1587}
1588
1589
1590local int inflate_trees_free(t, z)
1591inflate_huft *t; /* table to free */
1592z_stream *z; /* for zfree function */
1593/* Free the malloc'ed tables built by huft_build(), which makes a linked
1594 list of the tables it made, with the links in a dummy first entry of
1595 each table. */
1596{
1597 register inflate_huft *p, *q;
1598
1599 /* Go through linked list, freeing from the malloced (t[-1]) address. */
1600 p = t;
1601 while (p != Z_NULL)
1602 {
1603 q = (--p)->next;
1604 ZFREE(z, p, p->word.Nalloc * sizeof(inflate_huft));
1605 p = q;
1606 }
1607 return Z_OK;
1608}
1609
1610/*+++++*/
1611/* infcodes.c -- process literals and length/distance pairs
1612 * Copyright (C) 1995 Mark Adler
1613 * For conditions of distribution and use, see copyright notice in zlib.h
1614 */
1615
1616/* simplify the use of the inflate_huft type with some defines */
1617#define base more.Base
1618#define next more.Next
1619#define exop word.what.Exop
1620#define bits word.what.Bits
1621
1622/* inflate codes private state */
1623struct inflate_codes_state {
1624
1625 /* mode */
1626 enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
1627 START, /* x: set up for LEN */
1628 LEN, /* i: get length/literal/eob next */
1629 LENEXT, /* i: getting length extra (have base) */
1630 DIST, /* i: get distance next */
1631 DISTEXT, /* i: getting distance extra */
1632 COPY, /* o: copying bytes in window, waiting for space */
1633 LIT, /* o: got literal, waiting for output space */
1634 WASH, /* o: got eob, possibly still output waiting */
1635 END, /* x: got eob and all data flushed */
1636 BADCODE} /* x: got error */
1637 mode; /* current inflate_codes mode */
1638
1639 /* mode dependent information */
1640 uInt len;
1641 union {
1642 struct {
1643 inflate_huft *tree; /* pointer into tree */
1644 uInt need; /* bits needed */
1645 } code; /* if LEN or DIST, where in tree */
1646 uInt lit; /* if LIT, literal */
1647 struct {
1648 uInt get; /* bits to get for extra */
1649 uInt dist; /* distance back to copy from */
1650 } copy; /* if EXT or COPY, where and how much */
1651 } sub; /* submode */
1652
1653 /* mode independent information */
1654 Byte lbits; /* ltree bits decoded per branch */
1655 Byte dbits; /* dtree bits decoder per branch */
1656 inflate_huft *ltree; /* literal/length/eob tree */
1657 inflate_huft *dtree; /* distance tree */
1658
1659};
1660
1661
1662local inflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z)
1663uInt bl, bd;
1664inflate_huft *tl, *td;
1665z_stream *z;
1666{
1667 inflate_codes_statef *c;
1668
1669 if ((c = (inflate_codes_statef *)
1670 ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)
1671 {
1672 c->mode = START;
1673 c->lbits = (Byte)bl;
1674 c->dbits = (Byte)bd;
1675 c->ltree = tl;
1676 c->dtree = td;
1677 Tracev((stderr, "inflate: codes new\n"));
1678 }
1679 return c;
1680}
1681
1682
1683local int inflate_codes(s, z, r)
1684inflate_blocks_statef *s;
1685z_stream *z;
1686int r;
1687{
1688 uInt j; /* temporary storage */
1689 inflate_huft *t; /* temporary pointer */
1690 uInt e; /* extra bits or operation */
1691 uLong b; /* bit buffer */
1692 uInt k; /* bits in bit buffer */
1693 Bytef *p; /* input data pointer */
1694 uInt n; /* bytes available there */
1695 Bytef *q; /* output window write pointer */
1696 uInt m; /* bytes to end of window or read pointer */
1697 Bytef *f; /* pointer to copy strings from */
1698 inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
1699
1700 /* copy input/output information to locals (UPDATE macro restores) */
1701 LOAD
1702
1703 /* process input and output based on current state */
1704 while (1) switch (c->mode)
1705 { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
1706 case START: /* x: set up for LEN */
1707#ifndef SLOW
1708 if (m >= 258 && n >= 10)
1709 {
1710 UPDATE
1711 r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
1712 LOAD
1713 if (r != Z_OK)
1714 {
1715 c->mode = r == Z_STREAM_END ? WASH : BADCODE;
1716 break;
1717 }
1718 }
1719#endif /* !SLOW */
1720 c->sub.code.need = c->lbits;
1721 c->sub.code.tree = c->ltree;
1722 c->mode = LEN;
1723 case LEN: /* i: get length/literal/eob next */
1724 j = c->sub.code.need;
1725 NEEDBITS(j)
1726 t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
1727 DUMPBITS(t->bits)
1728 e = (uInt)(t->exop);
1729 if (e == 0) /* literal */
1730 {
1731 c->sub.lit = t->base;
1732 Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
1733 "inflate: literal '%c'\n" :
1734 "inflate: literal 0x%02x\n", t->base));
1735 c->mode = LIT;
1736 break;
1737 }
1738 if (e & 16) /* length */
1739 {
1740 c->sub.copy.get = e & 15;
1741 c->len = t->base;
1742 c->mode = LENEXT;
1743 break;
1744 }
1745 if ((e & 64) == 0) /* next table */
1746 {
1747 c->sub.code.need = e;
1748 c->sub.code.tree = t->next;
1749 break;
1750 }
1751 if (e & 32) /* end of block */
1752 {
1753 Tracevv((stderr, "inflate: end of block\n"));
1754 c->mode = WASH;
1755 break;
1756 }
1757 c->mode = BADCODE; /* invalid code */
1758 z->msg = "invalid literal/length code";
1759 r = Z_DATA_ERROR;
1760 LEAVE
1761 case LENEXT: /* i: getting length extra (have base) */
1762 j = c->sub.copy.get;
1763 NEEDBITS(j)
1764 c->len += (uInt)b & inflate_mask[j];
1765 DUMPBITS(j)
1766 c->sub.code.need = c->dbits;
1767 c->sub.code.tree = c->dtree;
1768 Tracevv((stderr, "inflate: length %u\n", c->len));
1769 c->mode = DIST;
1770 case DIST: /* i: get distance next */
1771 j = c->sub.code.need;
1772 NEEDBITS(j)
1773 t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
1774 DUMPBITS(t->bits)
1775 e = (uInt)(t->exop);
1776 if (e & 16) /* distance */
1777 {
1778 c->sub.copy.get = e & 15;
1779 c->sub.copy.dist = t->base;
1780 c->mode = DISTEXT;
1781 break;
1782 }
1783 if ((e & 64) == 0) /* next table */
1784 {
1785 c->sub.code.need = e;
1786 c->sub.code.tree = t->next;
1787 break;
1788 }
1789 c->mode = BADCODE; /* invalid code */
1790 z->msg = "invalid distance code";
1791 r = Z_DATA_ERROR;
1792 LEAVE
1793 case DISTEXT: /* i: getting distance extra */
1794 j = c->sub.copy.get;
1795 NEEDBITS(j)
1796 c->sub.copy.dist += (uInt)b & inflate_mask[j];
1797 DUMPBITS(j)
1798 Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
1799 c->mode = COPY;
1800 case COPY: /* o: copying bytes in window, waiting for space */
1801#ifndef __TURBOC__ /* Turbo C bug for following expression */
1802 f = (uInt)(q - s->window) < c->sub.copy.dist ?
1803 s->end - (c->sub.copy.dist - (q - s->window)) :
1804 q - c->sub.copy.dist;
1805#else
1806 f = q - c->sub.copy.dist;
1807 if ((uInt)(q - s->window) < c->sub.copy.dist)
1808 f = s->end - (c->sub.copy.dist - (q - s->window));
1809#endif
1810 while (c->len)
1811 {
1812 NEEDOUT
1813 OUTBYTE(*f++)
1814 if (f == s->end)
1815 f = s->window;
1816 c->len--;
1817 }
1818 c->mode = START;
1819 break;
1820 case LIT: /* o: got literal, waiting for output space */
1821 NEEDOUT
1822 OUTBYTE(c->sub.lit)
1823 c->mode = START;
1824 break;
1825 case WASH: /* o: got eob, possibly more output */
1826 FLUSH
1827 if (s->read != s->write)
1828 LEAVE
1829 c->mode = END;
1830 case END:
1831 r = Z_STREAM_END;
1832 LEAVE
1833 case BADCODE: /* x: got error */
1834 r = Z_DATA_ERROR;
1835 LEAVE
1836 default:
1837 r = Z_STREAM_ERROR;
1838 LEAVE
1839 }
1840}
1841
1842
1843local void inflate_codes_free(c, z)
1844inflate_codes_statef *c;
1845z_stream *z;
1846{
1847 ZFREE(z, c, sizeof(struct inflate_codes_state));
1848 Tracev((stderr, "inflate: codes free\n"));
1849}
1850
1851/*+++++*/
1852/* inflate_util.c -- data and routines common to blocks and codes
1853 * Copyright (C) 1995 Mark Adler
1854 * For conditions of distribution and use, see copyright notice in zlib.h
1855 */
1856
1857/* copy as much as possible from the sliding window to the output area */
1858local int inflate_flush(s, z, r)
1859inflate_blocks_statef *s;
1860z_stream *z;
1861int r;
1862{
1863 uInt n;
1864 Bytef *p, *q;
1865
1866 /* local copies of source and destination pointers */
1867 p = z->next_out;
1868 q = s->read;
1869
1870 /* compute number of bytes to copy as far as end of window */
1871 n = (uInt)((q <= s->write ? s->write : s->end) - q);
1872 if (n > z->avail_out) n = z->avail_out;
1873 if (n && r == Z_BUF_ERROR) r = Z_OK;
1874
1875 /* update counters */
1876 z->avail_out -= n;
1877 z->total_out += n;
1878
1879 /* update check information */
1880 if (s->checkfn != Z_NULL)
1881 s->check = (*s->checkfn)(s->check, q, n);
1882
1883 /* copy as far as end of window */
1884 zmemcpy(p, q, n);
1885 p += n;
1886 q += n;
1887
1888 /* see if more to copy at beginning of window */
1889 if (q == s->end)
1890 {
1891 /* wrap pointers */
1892 q = s->window;
1893 if (s->write == s->end)
1894 s->write = s->window;
1895
1896 /* compute bytes to copy */
1897 n = (uInt)(s->write - q);
1898 if (n > z->avail_out) n = z->avail_out;
1899 if (n && r == Z_BUF_ERROR) r = Z_OK;
1900
1901 /* update counters */
1902 z->avail_out -= n;
1903 z->total_out += n;
1904
1905 /* update check information */
1906 if (s->checkfn != Z_NULL)
1907 s->check = (*s->checkfn)(s->check, q, n);
1908
1909 /* copy */
1910 zmemcpy(p, q, n);
1911 p += n;
1912 q += n;
1913 }
1914
1915 /* update pointers */
1916 z->next_out = p;
1917 s->read = q;
1918
1919 /* done */
1920 return r;
1921}
1922
1923
1924/*+++++*/
1925/* inffast.c -- process literals and length/distance pairs fast
1926 * Copyright (C) 1995 Mark Adler
1927 * For conditions of distribution and use, see copyright notice in zlib.h
1928 */
1929
1930/* simplify the use of the inflate_huft type with some defines */
1931#define base more.Base
1932#define next more.Next
1933#define exop word.what.Exop
1934#define bits word.what.Bits
1935
1936/* macros for bit input with no checking and for returning unused bytes */
1937#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
1938#define UNGRAB {n+=(c=k>>3);p-=c;k&=7;}
1939
1940/* Called with number of bytes left to write in window at least 258
1941 (the maximum string length) and number of input bytes available
1942 at least ten. The ten bytes are six bytes for the longest length/
1943 distance pair plus four bytes for overloading the bit buffer. */
1944
1945local int inflate_fast(bl, bd, tl, td, s, z)
1946uInt bl, bd;
1947inflate_huft *tl, *td;
1948inflate_blocks_statef *s;
1949z_stream *z;
1950{
1951 inflate_huft *t; /* temporary pointer */
1952 uInt e; /* extra bits or operation */
1953 uLong b; /* bit buffer */
1954 uInt k; /* bits in bit buffer */
1955 Bytef *p; /* input data pointer */
1956 uInt n; /* bytes available there */
1957 Bytef *q; /* output window write pointer */
1958 uInt m; /* bytes to end of window or read pointer */
1959 uInt ml; /* mask for literal/length tree */
1960 uInt md; /* mask for distance tree */
1961 uInt c; /* bytes to copy */
1962 uInt d; /* distance back to copy from */
1963 Bytef *r; /* copy source pointer */
1964
1965 /* load input, output, bit values */
1966 LOAD
1967
1968 /* initialize masks */
1969 ml = inflate_mask[bl];
1970 md = inflate_mask[bd];
1971
1972 /* do until not enough input or output space for fast loop */
1973 do { /* assume called with m >= 258 && n >= 10 */
1974 /* get literal/length code */
1975 GRABBITS(20) /* max bits for literal/length code */
1976 if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)
1977 {
1978 DUMPBITS(t->bits)
1979 Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
1980 "inflate: * literal '%c'\n" :
1981 "inflate: * literal 0x%02x\n", t->base));
1982 *q++ = (Byte)t->base;
1983 m--;
1984 continue;
1985 }
1986 do {
1987 DUMPBITS(t->bits)
1988 if (e & 16)
1989 {
1990 /* get extra bits for length */
1991 e &= 15;
1992 c = t->base + ((uInt)b & inflate_mask[e]);
1993 DUMPBITS(e)
1994 Tracevv((stderr, "inflate: * length %u\n", c));
1995
1996 /* decode distance base of block to copy */
1997 GRABBITS(15); /* max bits for distance code */
1998 e = (t = td + ((uInt)b & md))->exop;
1999 do {
2000 DUMPBITS(t->bits)
2001 if (e & 16)
2002 {
2003 /* get extra bits to add to distance base */
2004 e &= 15;
2005 GRABBITS(e) /* get extra bits (up to 13) */
2006 d = t->base + ((uInt)b & inflate_mask[e]);
2007 DUMPBITS(e)
2008 Tracevv((stderr, "inflate: * distance %u\n", d));
2009
2010 /* do the copy */
2011 m -= c;
2012 if ((uInt)(q - s->window) >= d) /* offset before dest */
2013 { /* just copy */
2014 r = q - d;
2015 *q++ = *r++; c--; /* minimum count is three, */
2016 *q++ = *r++; c--; /* so unroll loop a little */
2017 }
2018 else /* else offset after destination */
2019 {
2020 e = d - (q - s->window); /* bytes from offset to end */
2021 r = s->end - e; /* pointer to offset */
2022 if (c > e) /* if source crosses, */
2023 {
2024 c -= e; /* copy to end of window */
2025 do {
2026 *q++ = *r++;
2027 } while (--e);
2028 r = s->window; /* copy rest from start of window */
2029 }
2030 }
2031 do { /* copy all or what's left */
2032 *q++ = *r++;
2033 } while (--c);
2034 break;
2035 }
2036 else if ((e & 64) == 0)
2037 e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop;
2038 else
2039 {
2040 z->msg = "invalid distance code";
2041 UNGRAB
2042 UPDATE
2043 return Z_DATA_ERROR;
2044 }
2045 } while (1);
2046 break;
2047 }
2048 if ((e & 64) == 0)
2049 {
2050 if ((e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop) == 0)
2051 {
2052 DUMPBITS(t->bits)
2053 Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
2054 "inflate: * literal '%c'\n" :
2055 "inflate: * literal 0x%02x\n", t->base));
2056 *q++ = (Byte)t->base;
2057 m--;
2058 break;
2059 }
2060 }
2061 else if (e & 32)
2062 {
2063 Tracevv((stderr, "inflate: * end of block\n"));
2064 UNGRAB
2065 UPDATE
2066 return Z_STREAM_END;
2067 }
2068 else
2069 {
2070 z->msg = "invalid literal/length code";
2071 UNGRAB
2072 UPDATE
2073 return Z_DATA_ERROR;
2074 }
2075 } while (1);
2076 } while (m >= 258 && n >= 10);
2077
2078 /* not enough input or output--restore pointers and return */
2079 UNGRAB
2080 UPDATE
2081 return Z_OK;
2082}
2083
2084
2085/*+++++*/
2086/* zutil.c -- target dependent utility functions for the compression library
2087 * Copyright (C) 1995 Jean-loup Gailly.
2088 * For conditions of distribution and use, see copyright notice in zlib.h
2089 */
2090
2091/* From: zutil.c,v 1.8 1995/05/03 17:27:12 jloup Exp */
2092
2093char *zlib_version = ZLIB_VERSION;
2094
2095char *z_errmsg[] = {
2096"stream end", /* Z_STREAM_END 1 */
2097"", /* Z_OK 0 */
2098"file error", /* Z_ERRNO (-1) */
2099"stream error", /* Z_STREAM_ERROR (-2) */
2100"data error", /* Z_DATA_ERROR (-3) */
2101"insufficient memory", /* Z_MEM_ERROR (-4) */
2102"buffer error", /* Z_BUF_ERROR (-5) */
2103""};
2104
2105
2106/*+++++*/
2107/* adler32.c -- compute the Adler-32 checksum of a data stream
2108 * Copyright (C) 1995 Mark Adler
2109 * For conditions of distribution and use, see copyright notice in zlib.h
2110 */
2111
2112/* From: adler32.c,v 1.6 1995/05/03 17:27:08 jloup Exp */
2113
2114#define BASE 65521L /* largest prime smaller than 65536 */
2115#define NMAX 5552
2116/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
2117
2118#define DO1(buf) {s1 += *buf++; s2 += s1;}
2119#define DO2(buf) DO1(buf); DO1(buf);
2120#define DO4(buf) DO2(buf); DO2(buf);
2121#define DO8(buf) DO4(buf); DO4(buf);
2122#define DO16(buf) DO8(buf); DO8(buf);
2123
2124/* ========================================================================= */
2125uLong adler32(adler, buf, len)
2126 uLong adler;
2127 Bytef *buf;
2128 uInt len;
2129{
2130 unsigned long s1 = adler & 0xffff;
2131 unsigned long s2 = (adler >> 16) & 0xffff;
2132 int k;
2133
2134 if (buf == Z_NULL) return 1L;
2135
2136 while (len > 0) {
2137 k = len < NMAX ? len : NMAX;
2138 len -= k;
2139 while (k >= 16) {
2140 DO16(buf);
2141 k -= 16;
2142 }
2143 if (k != 0) do {
2144 DO1(buf);
2145 } while (--k);
2146 s1 %= BASE;
2147 s2 %= BASE;
2148 }
2149 return (s2 << 16) | s1;
2150}
diff --git a/arch/xtensa/boot/lib/zmem.c b/arch/xtensa/boot/lib/zmem.c
index 7848f126d67d..d9862aa8ca25 100644
--- a/arch/xtensa/boot/lib/zmem.c
+++ b/arch/xtensa/boot/lib/zmem.c
@@ -1,4 +1,4 @@
1#include "zlib.h" 1#include <linux/zlib.h>
2 2
3/* bits taken from ppc */ 3/* bits taken from ppc */
4 4
@@ -9,11 +9,10 @@ void exit (void)
9 for (;;); 9 for (;;);
10} 10}
11 11
12void *zalloc(void *x, unsigned items, unsigned size) 12void *zalloc(unsigned size)
13{ 13{
14 void *p = avail_ram; 14 void *p = avail_ram;
15 15
16 size *= items;
17 size = (size + 7) & -8; 16 size = (size + 7) & -8;
18 avail_ram += size; 17 avail_ram += size;
19 if (avail_ram > end_avail) { 18 if (avail_ram > end_avail) {
@@ -24,11 +23,6 @@ void *zalloc(void *x, unsigned items, unsigned size)
24 return p; 23 return p;
25} 24}
26 25
27void zfree(void *x, void *addr, unsigned nb)
28{
29}
30
31
32#define HEAD_CRC 2 26#define HEAD_CRC 2
33#define EXTRA_FIELD 4 27#define EXTRA_FIELD 4
34#define ORIG_NAME 8 28#define ORIG_NAME 8
@@ -43,7 +37,6 @@ void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp)
43 int r, i, flags; 37 int r, i, flags;
44 38
45 /* skip header */ 39 /* skip header */
46
47 i = 10; 40 i = 10;
48 flags = src[3]; 41 flags = src[3];
49 if (src[2] != DEFLATED || (flags & RESERVED) != 0) { 42 if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
@@ -65,9 +58,8 @@ void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp)
65 exit(); 58 exit();
66 } 59 }
67 60
68 s.zalloc = zalloc; 61 s.workspace = zalloc(zlib_inflate_workspacesize());
69 s.zfree = zfree; 62 r = zlib_inflateInit2(&s, -MAX_WBITS);
70 r = inflateInit2(&s, -MAX_WBITS);
71 if (r != Z_OK) { 63 if (r != Z_OK) {
72 //puts("inflateInit2 returned "); puthex(r); puts("\n"); 64 //puts("inflateInit2 returned "); puthex(r); puts("\n");
73 exit(); 65 exit();
@@ -76,12 +68,12 @@ void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp)
76 s.avail_in = *lenp - i; 68 s.avail_in = *lenp - i;
77 s.next_out = dst; 69 s.next_out = dst;
78 s.avail_out = dstlen; 70 s.avail_out = dstlen;
79 r = inflate(&s, Z_FINISH); 71 r = zlib_inflate(&s, Z_FINISH);
80 if (r != Z_OK && r != Z_STREAM_END) { 72 if (r != Z_OK && r != Z_STREAM_END) {
81 //puts("inflate returned "); puthex(r); puts("\n"); 73 //puts("inflate returned "); puthex(r); puts("\n");
82 exit(); 74 exit();
83 } 75 }
84 *lenp = s.next_out - (unsigned char *) dst; 76 *lenp = s.next_out - (unsigned char *) dst;
85 inflateEnd(&s); 77 zlib_inflateEnd(&s);
86} 78}
87 79
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c
index d29a81648637..09887c96e9a1 100644
--- a/arch/xtensa/kernel/pci.c
+++ b/arch/xtensa/kernel/pci.c
@@ -57,50 +57,6 @@ struct pci_controller** pci_ctrl_tail = &pci_ctrl_head;
57 57
58static int pci_bus_count; 58static int pci_bus_count;
59 59
60static void pcibios_fixup_resources(struct pci_dev* dev);
61
62#if 0 // FIXME
63struct pci_fixup pcibios_fixups[] = {
64 { DECLARE_PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources },
65 { 0 }
66};
67#endif
68
69void
70pcibios_update_resource(struct pci_dev *dev, struct resource *root,
71 struct resource *res, int resource)
72{
73 u32 new, check, mask;
74 int reg;
75 struct pci_controller* pci_ctrl = dev->sysdata;
76
77 new = res->start;
78 if (pci_ctrl && res->flags & IORESOURCE_IO) {
79 new -= pci_ctrl->io_space.base;
80 }
81 new |= (res->flags & PCI_REGION_FLAG_MASK);
82 if (resource < 6) {
83 reg = PCI_BASE_ADDRESS_0 + 4*resource;
84 } else if (resource == PCI_ROM_RESOURCE) {
85 res->flags |= PCI_ROM_ADDRESS_ENABLE;
86 reg = dev->rom_base_reg;
87 } else {
88 /* Somebody might have asked allocation of a non-standard resource */
89 return;
90 }
91
92 pci_write_config_dword(dev, reg, new);
93 pci_read_config_dword(dev, reg, &check);
94 mask = (new & PCI_BASE_ADDRESS_SPACE_IO) ?
95 PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK;
96
97 if ((new ^ check) & mask) {
98 printk(KERN_ERR "PCI: Error while updating region "
99 "%s/%d (%08x != %08x)\n", dev->slot_name, resource,
100 new, check);
101 }
102}
103
104/* 60/*
105 * We need to avoid collisions with `mirrored' VGA ports 61 * We need to avoid collisions with `mirrored' VGA ports
106 * and other strange ISA hardware, so we always want the 62 * and other strange ISA hardware, so we always want the
@@ -125,7 +81,7 @@ pcibios_align_resource(void *data, struct resource *res, unsigned long size,
125 81
126 if (size > 0x100) { 82 if (size > 0x100) {
127 printk(KERN_ERR "PCI: I/O Region %s/%d too large" 83 printk(KERN_ERR "PCI: I/O Region %s/%d too large"
128 " (%ld bytes)\n", dev->slot_name, 84 " (%ld bytes)\n", pci_name(dev),
129 dev->resource - res, size); 85 dev->resource - res, size);
130 } 86 }
131 87
@@ -149,7 +105,7 @@ pcibios_enable_resources(struct pci_dev *dev, int mask)
149 r = &dev->resource[idx]; 105 r = &dev->resource[idx];
150 if (!r->start && r->end) { 106 if (!r->start && r->end) {
151 printk (KERN_ERR "PCI: Device %s not available because " 107 printk (KERN_ERR "PCI: Device %s not available because "
152 "of resource collisions\n", dev->slot_name); 108 "of resource collisions\n", pci_name(dev));
153 return -EINVAL; 109 return -EINVAL;
154 } 110 }
155 if (r->flags & IORESOURCE_IO) 111 if (r->flags & IORESOURCE_IO)
@@ -161,7 +117,7 @@ pcibios_enable_resources(struct pci_dev *dev, int mask)
161 cmd |= PCI_COMMAND_MEMORY; 117 cmd |= PCI_COMMAND_MEMORY;
162 if (cmd != old_cmd) { 118 if (cmd != old_cmd) {
163 printk("PCI: Enabling device %s (%04x -> %04x)\n", 119 printk("PCI: Enabling device %s (%04x -> %04x)\n",
164 dev->slot_name, old_cmd, cmd); 120 pci_name(dev), old_cmd, cmd);
165 pci_write_config_word(dev, PCI_COMMAND, cmd); 121 pci_write_config_word(dev, PCI_COMMAND, cmd);
166 } 122 }
167 return 0; 123 return 0;
@@ -293,7 +249,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
293 r = &dev->resource[idx]; 249 r = &dev->resource[idx];
294 if (!r->start && r->end) { 250 if (!r->start && r->end) {
295 printk(KERN_ERR "PCI: Device %s not available because " 251 printk(KERN_ERR "PCI: Device %s not available because "
296 "of resource collisions\n", dev->slot_name); 252 "of resource collisions\n", pci_name(dev));
297 return -EINVAL; 253 return -EINVAL;
298 } 254 }
299 if (r->flags & IORESOURCE_IO) 255 if (r->flags & IORESOURCE_IO)
@@ -303,7 +259,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
303 } 259 }
304 if (cmd != old_cmd) { 260 if (cmd != old_cmd) {
305 printk("PCI: Enabling device %s (%04x -> %04x)\n", 261 printk("PCI: Enabling device %s (%04x -> %04x)\n",
306 dev->slot_name, old_cmd, cmd); 262 pci_name(dev), old_cmd, cmd);
307 pci_write_config_word(dev, PCI_COMMAND, cmd); 263 pci_write_config_word(dev, PCI_COMMAND, cmd);
308 } 264 }
309 265
@@ -325,47 +281,6 @@ pci_controller_num(struct pci_dev *dev)
325 281
326#endif /* CONFIG_PROC_FS */ 282#endif /* CONFIG_PROC_FS */
327 283
328
329static void
330pcibios_fixup_resources(struct pci_dev *dev)
331{
332 struct pci_controller* pci_ctrl = (struct pci_controller *)dev->sysdata;
333 int i;
334 unsigned long offset;
335
336 if (!pci_ctrl) {
337 printk(KERN_ERR "No pci_ctrl for PCI dev %s!\n",dev->slot_name);
338 return;
339 }
340 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
341 struct resource *res = dev->resource + i;
342 if (!res->start || !res->flags)
343 continue;
344 if (res->end == 0xffffffff) {
345 DBG("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n",
346 dev->slot_name, i, res->start, res->end);
347 res->end -= res->start;
348 res->start = 0;
349 continue;
350 }
351 offset = 0;
352 if (res->flags & IORESOURCE_IO)
353 offset = (unsigned long) pci_ctrl->io_space.base;
354 else if (res->flags & IORESOURCE_MEM)
355 offset = (unsigned long) pci_ctrl->mem_space.base;
356
357 if (offset != 0) {
358 res->start += offset;
359 res->end += offset;
360#ifdef DEBUG
361 printk("Fixup res %d (%lx) of dev %s: %lx -> %lx\n",
362 i, res->flags, dev->slot_name,
363 res->start - offset, res->start);
364#endif
365 }
366 }
367}
368
369/* 284/*
370 * Platform support for /proc/bus/pci/X/Y mmap()s, 285 * Platform support for /proc/bus/pci/X/Y mmap()s,
371 * modelled on the sparc64 implementation by Dave Miller. 286 * modelled on the sparc64 implementation by Dave Miller.
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c
index 9ef07a4dd2a2..2659efdd4e99 100644
--- a/arch/xtensa/kernel/ptrace.c
+++ b/arch/xtensa/kernel/ptrace.c
@@ -22,6 +22,7 @@
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/smp_lock.h> 23#include <linux/smp_lock.h>
24#include <linux/security.h> 24#include <linux/security.h>
25#include <linux/signal.h>
25 26
26#include <asm/pgtable.h> 27#include <asm/pgtable.h>
27#include <asm/page.h> 28#include <asm/page.h>
@@ -239,7 +240,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
239 case PTRACE_CONT: /* restart after signal. */ 240 case PTRACE_CONT: /* restart after signal. */
240 { 241 {
241 ret = -EIO; 242 ret = -EIO;
242 if ((unsigned long) data > _NSIG) 243 if (!valid_signal(data))
243 break; 244 break;
244 if (request == PTRACE_SYSCALL) 245 if (request == PTRACE_SYSCALL)
245 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 246 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
@@ -269,7 +270,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
269 270
270 case PTRACE_SINGLESTEP: 271 case PTRACE_SINGLESTEP:
271 ret = -EIO; 272 ret = -EIO;
272 if ((unsigned long) data > _NSIG) 273 if (!valid_signal(data))
273 break; 274 break;
274 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 275 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
275 child->ptrace |= PT_SINGLESTEP; 276 child->ptrace |= PT_SINGLESTEP;