Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
Linus Torvalds [Mon, 16 Jan 2006 00:43:29 +0000 (16:43 -0800)]
391 files changed:
Documentation/feature-removal-schedule.txt
Documentation/filesystems/tmpfs.txt
Documentation/kernel-parameters.txt
MAINTAINERS
Makefile
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/common/Kconfig
arch/arm/common/Makefile
arch/arm/common/vic.c [new file with mode: 0644]
arch/arm/kernel/Makefile
arch/arm/kernel/armksyms.c
arch/arm/kernel/calls.S
arch/arm/kernel/entry-armv.S
arch/arm/kernel/entry-common.S
arch/arm/kernel/entry-header.S
arch/arm/kernel/head.S
arch/arm/kernel/ptrace.c
arch/arm/kernel/semaphore.c
arch/arm/kernel/sys_arm.c
arch/arm/kernel/sys_oabi-compat.c [new file with mode: 0644]
arch/arm/kernel/traps.c
arch/arm/lib/ashldi3.S
arch/arm/lib/ashrdi3.S
arch/arm/lib/lib1funcs.S
arch/arm/lib/lshrdi3.S
arch/arm/lib/muldi3.S
arch/arm/lib/ucmpdi2.S
arch/arm/mach-aaec2000/aaed2000.c
arch/arm/mach-at91rm9200/board-csb337.c
arch/arm/mach-at91rm9200/board-csb637.c
arch/arm/mach-at91rm9200/board-dk.c
arch/arm/mach-at91rm9200/board-ek.c
arch/arm/mach-clps711x/autcpu12.c
arch/arm/mach-clps711x/cdb89712.c
arch/arm/mach-clps711x/ceiva.c
arch/arm/mach-clps711x/clep7312.c
arch/arm/mach-clps711x/edb7211-arch.c
arch/arm/mach-clps711x/fortunet.c
arch/arm/mach-clps711x/p720t.c
arch/arm/mach-clps7500/core.c
arch/arm/mach-ebsa110/core.c
arch/arm/mach-footbridge/cats-hw.c
arch/arm/mach-footbridge/co285.c
arch/arm/mach-footbridge/ebsa285.c
arch/arm/mach-footbridge/netwinder-hw.c
arch/arm/mach-footbridge/personal.c
arch/arm/mach-h720x/h7201-eval.c
arch/arm/mach-h720x/h7202-eval.c
arch/arm/mach-imx/mx1ads.c
arch/arm/mach-integrator/integrator_ap.c
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-iop3xx/iop321-setup.c
arch/arm/mach-iop3xx/iop331-setup.c
arch/arm/mach-ixp2000/core.c
arch/arm/mach-ixp2000/enp2611.c
arch/arm/mach-ixp2000/ixdp2400.c
arch/arm/mach-ixp2000/ixdp2800.c
arch/arm/mach-ixp2000/ixdp2x01.c
arch/arm/mach-ixp4xx/coyote-setup.c
arch/arm/mach-ixp4xx/gtwx5715-setup.c
arch/arm/mach-ixp4xx/ixdp425-setup.c
arch/arm/mach-ixp4xx/nas100d-setup.c
arch/arm/mach-ixp4xx/nslu2-setup.c
arch/arm/mach-l7200/core.c
arch/arm/mach-lh7a40x/arch-kev7a400.c
arch/arm/mach-lh7a40x/arch-lpd7a40x.c
arch/arm/mach-omap1/board-generic.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-netstar.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-omap1/board-perseus2.c
arch/arm/mach-omap1/board-voiceblue.c
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/idp.c
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-realview/Kconfig
arch/arm/mach-realview/realview_eb.c
arch/arm/mach-rpc/riscpc.c
arch/arm/mach-s3c2410/mach-anubis.c
arch/arm/mach-s3c2410/mach-bast.c
arch/arm/mach-s3c2410/mach-h1940.c
arch/arm/mach-s3c2410/mach-n30.c
arch/arm/mach-s3c2410/mach-nexcoder.c
arch/arm/mach-s3c2410/mach-otom.c
arch/arm/mach-s3c2410/mach-rx3715.c
arch/arm/mach-s3c2410/mach-smdk2410.c
arch/arm/mach-s3c2410/mach-smdk2440.c
arch/arm/mach-s3c2410/mach-vr1000.c
arch/arm/mach-sa1100/assabet.c
arch/arm/mach-sa1100/badge4.c
arch/arm/mach-sa1100/cerf.c
arch/arm/mach-sa1100/collie.c
arch/arm/mach-sa1100/h3600.c
arch/arm/mach-sa1100/hackkit.c
arch/arm/mach-sa1100/jornada720.c
arch/arm/mach-sa1100/lart.c
arch/arm/mach-sa1100/pleb.c
arch/arm/mach-sa1100/shannon.c
arch/arm/mach-sa1100/simpad.c
arch/arm/mach-shark/core.c
arch/arm/mach-versatile/Kconfig
arch/arm/mach-versatile/core.c
arch/arm/mach-versatile/versatile_ab.c
arch/arm/mach-versatile/versatile_pb.c
arch/arm/nwfpe/fpa11.h
arch/arm/plat-omap/Kconfig
arch/i386/Kconfig
arch/i386/Makefile
arch/i386/kernel/traps.c
arch/i386/pci/fixup.c
arch/ia64/configs/gensparse_defconfig
arch/ia64/configs/sn2_defconfig
arch/powerpc/Kconfig
arch/powerpc/boot/Makefile
arch/powerpc/boot/dummy.c [new file with mode: 0644]
arch/powerpc/configs/pmac32_defconfig
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/crash.c
arch/powerpc/kernel/pci_32.c [new file with mode: 0644]
arch/powerpc/kernel/prom_init.c
arch/powerpc/platforms/maple/pci.c
arch/powerpc/platforms/maple/setup.c
arch/powerpc/platforms/maple/time.c
arch/ppc/Kconfig
arch/ppc/boot/Makefile
arch/ppc/boot/openfirmware/Makefile
arch/ppc/boot/openfirmware/coffmain.c [deleted file]
arch/ppc/boot/openfirmware/newworldmain.c [deleted file]
arch/ppc/kernel/Makefile
arch/ppc/kernel/misc.S
arch/ppc/kernel/pci.c
arch/ppc/kernel/ppc_ksyms.c
arch/ppc/kernel/setup.c
arch/ppc/kernel/traps.c
arch/ppc/mm/init.c
arch/ppc/platforms/Makefile
arch/ppc/platforms/chrp_pci.c
arch/ppc/platforms/chrp_setup.c
arch/ppc/platforms/chrp_time.c
arch/ppc/platforms/pmac_backlight.c [deleted file]
arch/ppc/platforms/pmac_cache.S [deleted file]
arch/ppc/platforms/pmac_cpufreq.c [deleted file]
arch/ppc/platforms/pmac_feature.c [deleted file]
arch/ppc/platforms/pmac_low_i2c.c [deleted file]
arch/ppc/platforms/pmac_nvram.c [deleted file]
arch/ppc/platforms/pmac_pci.c [deleted file]
arch/ppc/platforms/pmac_pic.c [deleted file]
arch/ppc/platforms/pmac_pic.h [deleted file]
arch/ppc/platforms/pmac_setup.c [deleted file]
arch/ppc/platforms/pmac_sleep.S [deleted file]
arch/ppc/platforms/pmac_smp.c [deleted file]
arch/ppc/platforms/pmac_time.c [deleted file]
arch/ppc/syslib/Makefile
arch/ppc/syslib/prom.c
arch/ppc/xmon/start.c
arch/ppc/xmon/xmon.c
arch/s390/crypto/aes_s390.c
arch/s390/crypto/des_s390.c
arch/s390/crypto/sha256_s390.c
arch/s390/kernel/process.c
arch/s390/kernel/setup.c
arch/s390/kernel/time.c
arch/s390/kernel/vtime.c
arch/s390/lib/Makefile
arch/s390/lib/spinlock.c
arch/um/Makefile
block/genhd.c
drivers/acpi/ec.c
drivers/base/firmware_class.c
drivers/block/loop.c
drivers/block/pktcdvd.c
drivers/bluetooth/hci_bcsp.c
drivers/char/drm/r128_state.c
drivers/char/watchdog/Kconfig
drivers/char/watchdog/Makefile
drivers/char/watchdog/mpc83xx_wdt.c [new file with mode: 0644]
drivers/char/watchdog/sa1100_wdt.c
drivers/char/watchdog/sbc_epx_c3.c [new file with mode: 0644]
drivers/cpufreq/cpufreq.c
drivers/firmware/dell_rbu.c
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-taskfile.c
drivers/infiniband/core/cm.c
drivers/isdn/hisax/avm_pci.c
drivers/isdn/hisax/diva.c
drivers/isdn/hisax/hscx_irq.c
drivers/isdn/hisax/jade_irq.c
drivers/md/bitmap.c
drivers/md/dm-crypt.c
drivers/md/dm-ioctl.c
drivers/md/dm-snap.c
drivers/md/dm.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/md/raid6main.c
drivers/media/video/tvp5150.c
drivers/media/video/zoran_card.c
drivers/message/fusion/mptlan.c
drivers/mmc/mmc_block.c
drivers/mtd/devices/doc2000.c
drivers/mtd/devices/doc2001.c
drivers/mtd/devices/doc2001plus.c
drivers/mtd/nand/diskonchip.c
drivers/net/Kconfig
drivers/net/cs89x0.c
drivers/net/e100.c
drivers/net/sb1000.c
drivers/net/wireless/hostap/hostap_80211_rx.c
drivers/net/wireless/hostap/hostap_hw.c
drivers/net/wireless/ipw2100.c
drivers/net/wireless/ipw2200.c
drivers/net/wireless/wavelan.c
drivers/s390/block/dasd.c
drivers/s390/cio/airq.c
drivers/s390/cio/blacklist.c
drivers/s390/cio/ccwgroup.c
drivers/s390/cio/chsc.c
drivers/s390/cio/cio.c
drivers/s390/cio/css.c
drivers/s390/cio/css.h
drivers/s390/cio/device.c
drivers/s390/cio/device_fsm.c
drivers/s390/cio/device_id.c
drivers/s390/cio/device_ops.c
drivers/s390/cio/device_pgid.c
drivers/s390/cio/device_status.c
drivers/s390/cio/qdio.c
drivers/s390/net/ctcmain.c
drivers/s390/net/cu3088.c
drivers/s390/net/netiucv.c
drivers/s390/s390_rdev.c
drivers/scsi/aic7xxx_old.c
drivers/scsi/iscsi_tcp.c
drivers/scsi/libata-core.c
drivers/scsi/megaraid/megaraid_mbox.c
drivers/scsi/megaraid/megaraid_sas.c
drivers/scsi/sr.c
drivers/serial/8250.c
drivers/serial/Kconfig
drivers/serial/Makefile
drivers/serial/imx.c
drivers/serial/ioc3_serial.c [new file with mode: 0644]
drivers/serial/pmac_zilog.c
drivers/serial/serial_core.c
drivers/sn/Kconfig
drivers/sn/Makefile
drivers/sn/ioc3.c [new file with mode: 0644]
drivers/usb/atm/usbatm.c
drivers/video/68328fb.c
drivers/video/acornfb.c
drivers/video/amba-clcd.c
drivers/video/amifb.c
drivers/video/arcfb.c
drivers/video/atafb.c
drivers/video/aty/aty128fb.c
drivers/video/aty/atyfb_base.c
drivers/video/aty/radeon_base.c
drivers/video/aty/radeon_pm.c
drivers/video/au1100fb.c
drivers/video/bw2.c
drivers/video/cg14.c
drivers/video/cg3.c
drivers/video/cg6.c
drivers/video/controlfb.c
drivers/video/fbmem.c
drivers/video/ffb.c
drivers/video/gbefb.c
drivers/video/geode/gx1fb_core.c
drivers/video/igafb.c
drivers/video/imsttfb.c
drivers/video/intelfb/intelfbdrv.c
drivers/video/kyro/fbdev.c
drivers/video/leo.c
drivers/video/matrox/matroxfb_base.c
drivers/video/matrox/matroxfb_crtc2.c
drivers/video/matrox/matroxfb_maven.c
drivers/video/neofb.c
drivers/video/p9100.c
drivers/video/pm3fb.c
drivers/video/pmag-aa-fb.c
drivers/video/pxafb.c
drivers/video/radeonfb.c
drivers/video/sa1100fb.c
drivers/video/sgivwfb.c
drivers/video/sis/sis_main.c
drivers/video/sis/sis_main.h
drivers/video/sstfb.c
drivers/video/tcx.c
drivers/video/vfb.c
fs/9p/conv.c
fs/autofs4/root.c
fs/binfmt_elf.c
fs/binfmt_misc.c
fs/bio.c
fs/buffer.c
fs/char_dev.c
fs/compat.c
fs/dcache.c
fs/exec.c
fs/ext2/namei.c
fs/ext3/namei.c
fs/fcntl.c
fs/hugetlbfs/inode.c
fs/isofs/namei.c
fs/jffs2/build.c
fs/jffs2/nodelist.c
fs/lockd/xdr.c
fs/mbcache.c
fs/namei.c
fs/ncpfs/inode.c
fs/ncpfs/ioctl.c
fs/nfsd/nfsxdr.c
fs/pipe.c
fs/proc/proc_misc.c
fs/quota_v2.c
fs/reiserfs/namei.c
fs/smbfs/Makefile
fs/smbfs/inode.c
fs/smbfs/request.c
include/asm-arm/arch-ixp2000/ixp2000-regs.h
include/asm-arm/arch-versatile/entry-macro.S
include/asm-arm/arch-versatile/platform.h
include/asm-arm/hardware/vic.h [new file with mode: 0644]
include/asm-arm/mach/arch.h
include/asm-arm/page.h
include/asm-arm/processor.h
include/asm-arm/ptrace.h
include/asm-arm/stat.h
include/asm-arm/statfs.h
include/asm-arm/unistd.h
include/asm-generic/atomic.h
include/asm-i386/bitops.h
include/asm-i386/current.h
include/asm-i386/string.h
include/asm-i386/uaccess.h
include/asm-ia64/sn/ioc3.h [new file with mode: 0644]
include/asm-powerpc/kexec.h
include/asm-ppc/prom.h
include/asm-s390/s390_rdev.h
include/asm-s390/sigcontext.h
include/asm-s390/system.h
include/asm-x86_64/fixmap.h
include/asm-x86_64/uaccess.h
include/linux/compiler-gcc3.h
include/linux/compiler-gcc4.h
include/linux/cpuset.h
include/linux/fb.h
include/linux/fs.h
include/linux/hardirq.h
include/linux/ioc3.h [new file with mode: 0644]
include/linux/mempolicy.h
include/linux/mm.h
include/linux/ncp_fs.h
include/linux/sched.h
include/linux/serial_core.h
include/linux/shmem_fs.h
include/linux/smb_fs.h
include/linux/swap.h
init/main.c
kernel/cpuset.c
kernel/exit.c
kernel/posix-timers.c
kernel/sched.c
kernel/signal.c
kernel/sysctl.c
kernel/workqueue.c
lib/Kconfig.debug
mm/mempolicy.c
mm/oom_kill.c
mm/shmem.c
net/ieee80211/ieee80211_module.c
net/ieee80211/ieee80211_rx.c
net/ieee80211/ieee80211_tx.c
net/ieee80211/ieee80211_wx.c
net/ipv4/fib_frontend.c
net/netfilter/nfnetlink.c
security/selinux/hooks.c
sound/oss/esssolo1.c
sound/pci/es1968.c

index 9474501..b4a1ea7 100644 (file)
@@ -123,6 +123,15 @@ Who:       Christoph Hellwig <hch@lst.de>
 
 ---------------------------
 
+What:  CONFIG_FORCED_INLINING
+When:  June 2006
+Why:   Config option is there to see if gcc is good enough. (in january
+        2006). If it is, the behavior should just be the default. If it's not,
+       the option should just go away entirely.
+Who:    Arjan van de Ven
+
+---------------------------
+
 What:  START_ARRAY ioctl for md
 When:  July 2006
 Files: drivers/md/md.c
index 0d783c5..dbe4d87 100644 (file)
@@ -78,6 +78,18 @@ use up all the memory on the machine; but enhances the scalability of
 that instance in a system with many cpus making intensive use of it.
 
 
+tmpfs has a mount option to set the NUMA memory allocation policy for
+all files in that instance:
+mpol=interleave                prefers to allocate memory from each node in turn
+mpol=default           prefers to allocate memory from the local node
+mpol=bind              prefers to allocate from mpol_nodelist
+mpol=preferred         prefers to allocate from first node in mpol_nodelist
+
+The following mount option is used in conjunction with mpol=interleave,
+mpol=bind or mpol=preferred:
+mpol_nodelist: nodelist suitable for parsing with nodelist_parse.
+
+
 To specify the initial root directory you can use the following mount
 options:
 
index fe11fcc..1cbcf65 100644 (file)
@@ -471,7 +471,7 @@ running once the system is up.
                        arch/i386/kernel/cpu/cpufreq/elanfreq.c.
 
        elevator=       [IOSCHED]
-                       Format: {"as" | "cfq" | "deadline" | "noop"}
+                       Format: {"anticipatory" | "cfq" | "deadline" | "noop"}
                        See Documentation/block/as-iosched.txt and
                        Documentation/block/deadline-iosched.txt for details.
 
@@ -712,9 +712,17 @@ running once the system is up.
        load_ramdisk=   [RAM] List of ramdisks to load from floppy
                        See Documentation/ramdisk.txt.
 
-       lockd.udpport=  [NFS]
+       lockd.nlm_grace_period=P  [NFS] Assign grace period.
+                       Format: <integer>
+
+       lockd.nlm_tcpport=N     [NFS] Assign TCP port.
+                       Format: <integer>
 
-       lockd.tcpport=  [NFS]
+       lockd.nlm_timeout=T     [NFS] Assign timeout value.
+                       Format: <integer>
+
+       lockd.nlm_udpport=M     [NFS] Assign UDP port.
+                       Format: <integer>
 
        logibm.irq=     [HW,MOUSE] Logitech Bus Mouse Driver
                        Format: <irq>
index 873c3f7..6d1b048 100644 (file)
@@ -1301,6 +1301,12 @@ M:       ttb@tentacle.dhs.org and rml@novell.com
 L:     linux-kernel@vger.kernel.org
 S:     Maintained
 
+INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
+P:      Sylvain Meyer
+M:      sylvain.meyer@worldonline.fr
+L:      linux-fbdev-devel@lists.sourceforge.net
+S:      Maintained
+
 INTEL 810/815 FRAMEBUFFER DRIVER
 P:      Antonino Daplas
 M:      adaplas@pol.net
@@ -1890,11 +1896,11 @@ W:      http://linux-ntfs.sf.net/
 T:     git kernel.org:/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git
 S:     Maintained
 
-NVIDIA (RIVA) FRAMEBUFFER DRIVER
-P:     Ani Joshi
-M:     ajoshi@shell.unixbox.com
-L:     linux-nvidia@lists.surfsouth.com
-S:     Maintained
+NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER
+P:      Antonino Daplas
+M:      adaplas@pol.net
+L:      linux-fbdev-devel@lists.sourceforge.net
+S:      Maintained
 
 ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
 P:     Mark Fasheh
@@ -2189,6 +2195,12 @@ L:       rtl@rtlinux.org
 W:     www.rtlinux.org
 S:     Maintained
 
+S3 SAVAGE FRAMEBUFFER DRIVER
+P:      Antonino Daplas
+M:      adaplas@pol.net
+L:      linux-fbdev-devel@lists.sourceforge.net
+S:      Maintained
+
 S390
 P:     Martin Schwidefsky
 M:     schwidefsky@de.ibm.com
@@ -2954,6 +2966,12 @@ M:       dm@sangoma.com
 W:     http://www.sangoma.com
 S:     Supported
 
+WATCHDOG DEVICE DRIVERS
+P:     Wim Van Sebroeck
+M:     wim@iguana.be
+T:     git kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git
+S:     Maintained
+
 WAVELAN NETWORK DRIVER & WIRELESS EXTENSIONS
 P:     Jean Tourrilhes
 M:     jt@hpl.hp.com
index deedaf7..673148e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -151,7 +151,7 @@ export srctree objtree VPATH TOPDIR
 SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
                                  -e s/arm.*/arm/ -e s/sa110/arm/ \
                                  -e s/s390x/s390/ -e s/parisc64/parisc/ \
-                                 -e s/ppc64/powerpc/ )
+                                 -e s/ppc.*/powerpc/ )
 
 # Cross compiling and selecting different set of gcc/bin-utils
 # ---------------------------------------------------------------------------
index 3cfd82a..5959e36 100644 (file)
@@ -180,6 +180,7 @@ config ARCH_OMAP
 config ARCH_VERSATILE
        bool "Versatile"
        select ARM_AMBA
+       select ARM_VIC
        select ICST307
        help
          This enables support for ARM Ltd Versatile board.
@@ -400,6 +401,38 @@ config NO_IDLE_HZ
          Currently at least OMAP, PXA2xx and SA11x0 platforms are known
          to have accurate timekeeping with dynamic tick.
 
+config AEABI
+       bool "Use the ARM EABI to compile the kernel"
+       help
+         This option allows for the kernel to be compiled using the latest
+         ARM ABI (aka EABI).  This is only useful if you are using a user
+         space environment that is also compiled with EABI.
+
+         Since there are major incompatibilities between the legacy ABI and
+         EABI, especially with regard to structure member alignment, this
+         option also changes the kernel syscall calling convention to
+         disambiguate both ABIs and allow for backward compatibility support
+         (selected with CONFIG_OABI_COMPAT).
+
+         To use this you need GCC version 4.0.0 or later.
+
+config OABI_COMPAT
+       bool "Allow old ABI binaries to run with this kernel"
+       depends on AEABI
+       default y
+       help
+         This option preserves the old syscall interface along with the
+         new (ARM EABI) one. It also provides a compatibility layer to
+         intercept syscalls that have structure arguments which layout
+         in memory differs between the legacy ABI and the new ARM EABI
+         (only for non "thumb" binaries). This option adds a tiny
+         overhead to all syscalls and produces a slightly larger kernel.
+         If you know you'll be using only pure EABI user space then you
+         can say N here. If this option is not selected and you attempt
+         to execute a legacy ABI binary then the result will be
+         UNPREDICTABLE (in fact it can be predicted that it won't work
+         at all). If in doubt say Y.
+
 config ARCH_DISCONTIGMEM_ENABLE
        bool
        default (ARCH_LH7A40X && !LH7A40X_CONTIGMEM)
@@ -586,6 +619,7 @@ comment "At least one emulation must be selected"
 
 config FPE_NWFPE
        bool "NWFPE math emulation"
+       depends on !AEABI || OABI_COMPAT
        ---help---
          Say Y to include the NWFPE floating point emulator in the kernel.
          This is necessary to run most binaries. Linux does not currently
@@ -609,7 +643,7 @@ config FPE_NWFPE_XP
 
 config FPE_FASTFPE
        bool "FastFPE math emulation (EXPERIMENTAL)"
-       depends on !CPU_32v3 && EXPERIMENTAL
+       depends on (!AEABI || OABI_COMPAT) && !CPU_32v3 && EXPERIMENTAL
        ---help---
          Say Y here to include the FAST floating point emulator in the kernel.
          This is an experimental much faster emulator which now also has full
@@ -641,6 +675,7 @@ source "fs/Kconfig.binfmt"
 
 config ARTHUR
        tristate "RISC OS personality"
+       depends on !AEABI
        help
          Say Y here to include the kernel code necessary if you want to run
          Acorn RISC OS/Arthur binaries under Linux. This code is still very
index 1fa2a10..fbfc14a 100644 (file)
@@ -56,8 +56,13 @@ tune-$(CONFIG_CPU_SA1100)    :=-mtune=strongarm1100
 tune-$(CONFIG_CPU_XSCALE)      :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
 tune-$(CONFIG_CPU_V6)          :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
 
-# Need -Uarm for gcc < 3.x
+ifeq ($(CONFIG_AEABI),y)
+CFLAGS_ABI     :=-mabi=aapcs -mno-thumb-interwork
+else
 CFLAGS_ABI     :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
+endif
+
+# Need -Uarm for gcc < 3.x
 CFLAGS         +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
 AFLAGS         +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float
 
index d7509c7..5e34ca6 100644 (file)
@@ -1,7 +1,10 @@
-config ICST525
+config ARM_GIC
        bool
 
-config ARM_GIC
+config ARM_VIC
+       bool
+
+config ICST525
        bool
 
 config ICST307
index ec8d17c..c81a2ff 100644 (file)
@@ -4,6 +4,7 @@
 
 obj-y                          += rtctime.o
 obj-$(CONFIG_ARM_GIC)          += gic.o
+obj-$(CONFIG_ARM_VIC)          += vic.o
 obj-$(CONFIG_ICST525)          += icst525.o
 obj-$(CONFIG_ICST307)          += icst307.o
 obj-$(CONFIG_SA1111)           += sa1111.o
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
new file mode 100644 (file)
index 0000000..a45ed16
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ *  linux/arch/arm/common/vic.c
+ *
+ *  Copyright (C) 1999 - 2003 ARM Limited
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#include <linux/init.h>
+#include <linux/list.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach/irq.h>
+#include <asm/hardware/vic.h>
+
+static void __iomem *vic_base;
+
+static void vic_mask_irq(unsigned int irq)
+{
+       irq -= IRQ_VIC_START;
+       writel(1 << irq, vic_base + VIC_INT_ENABLE_CLEAR);
+}
+
+static void vic_unmask_irq(unsigned int irq)
+{
+       irq -= IRQ_VIC_START;
+       writel(1 << irq, vic_base + VIC_INT_ENABLE);
+}
+
+static struct irqchip vic_chip = {
+       .ack    = vic_mask_irq,
+       .mask   = vic_mask_irq,
+       .unmask = vic_unmask_irq,
+};
+
+void __init vic_init(void __iomem *base, u32 vic_sources)
+{
+       unsigned int i;
+
+       vic_base = base;
+
+       /* Disable all interrupts initially. */
+
+       writel(0, vic_base + VIC_INT_SELECT);
+       writel(0, vic_base + VIC_INT_ENABLE);
+       writel(~0, vic_base + VIC_INT_ENABLE_CLEAR);
+       writel(0, vic_base + VIC_IRQ_STATUS);
+       writel(0, vic_base + VIC_ITCR);
+       writel(~0, vic_base + VIC_INT_SOFT_CLEAR);
+
+       /*
+        * Make sure we clear all existing interrupts
+        */
+       writel(0, vic_base + VIC_VECT_ADDR);
+       for (i = 0; i < 19; i++) {
+               unsigned int value;
+
+               value = readl(vic_base + VIC_VECT_ADDR);
+               writel(value, vic_base + VIC_VECT_ADDR);
+       }
+
+       for (i = 0; i < 16; i++) {
+               void __iomem *reg = vic_base + VIC_VECT_CNTL0 + (i * 4);
+               writel(VIC_VECT_CNTL_ENABLE | i, reg);
+       }
+
+       writel(32, vic_base + VIC_DEF_VECT_ADDR);
+
+       for (i = 0; i < 32; i++) {
+               unsigned int irq = IRQ_VIC_START + i;
+
+               set_irq_chip(irq, &vic_chip);
+
+               if (vic_sources & (1 << i)) {
+                       set_irq_handler(irq, do_level_IRQ);
+                       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+               }
+       }
+}
index de94b0f..2ce0e3a 100644 (file)
@@ -20,6 +20,7 @@ obj-$(CONFIG_ARTHUR)          += arthur.o
 obj-$(CONFIG_ISA_DMA)          += dma-isa.o
 obj-$(CONFIG_PCI)              += bios32.o
 obj-$(CONFIG_SMP)              += smp.o
+obj-$(CONFIG_OABI_COMPAT)      += sys_oabi-compat.o
 
 obj-$(CONFIG_IWMMXT)           += iwmmxt.o
 AFLAGS_iwmmxt.o                        := -Wa,-mcpu=iwmmxt
index 9997098..1574941 100644 (file)
@@ -35,6 +35,16 @@ extern void __udivsi3(void);
 extern void __umodsi3(void);
 extern void __do_div64(void);
 
+extern void __aeabi_idiv(void);
+extern void __aeabi_idivmod(void);
+extern void __aeabi_lasr(void);
+extern void __aeabi_llsl(void);
+extern void __aeabi_llsr(void);
+extern void __aeabi_lmul(void);
+extern void __aeabi_uidiv(void);
+extern void __aeabi_uidivmod(void);
+extern void __aeabi_ulcmp(void);
+
 extern void fpundefinstr(void);
 extern void fp_enter(void);
 
@@ -141,6 +151,18 @@ EXPORT_SYMBOL(__udivsi3);
 EXPORT_SYMBOL(__umodsi3);
 EXPORT_SYMBOL(__do_div64);
 
+#ifdef CONFIG_AEABI
+EXPORT_SYMBOL(__aeabi_idiv);
+EXPORT_SYMBOL(__aeabi_idivmod);
+EXPORT_SYMBOL(__aeabi_lasr);
+EXPORT_SYMBOL(__aeabi_llsl);
+EXPORT_SYMBOL(__aeabi_llsr);
+EXPORT_SYMBOL(__aeabi_lmul);
+EXPORT_SYMBOL(__aeabi_uidiv);
+EXPORT_SYMBOL(__aeabi_uidivmod);
+EXPORT_SYMBOL(__aeabi_ulcmp);
+#endif
+
        /* bitops */
 EXPORT_SYMBOL(_set_bit_le);
 EXPORT_SYMBOL(_test_and_set_bit_le);
index 55076a7..75e6f9a 100644 (file)
@@ -13,7 +13,7 @@
 #define NR_syscalls 328
 #else
 
-__syscall_start:
+100:
 /* 0 */                .long   sys_restart_syscall
                .long   sys_exit
                .long   sys_fork_wrapper
@@ -27,7 +27,7 @@ __syscall_start:
 /* 10 */       .long   sys_unlink
                .long   sys_execve_wrapper
                .long   sys_chdir
-               .long   sys_time                /* used by libc4 */
+               .long   OBSOLETE(sys_time)      /* used by libc4 */
                .long   sys_mknod
 /* 15 */       .long   sys_chmod
                .long   sys_lchown16
@@ -36,15 +36,15 @@ __syscall_start:
                .long   sys_lseek
 /* 20 */       .long   sys_getpid
                .long   sys_mount
-               .long   sys_oldumount           /* used by libc4 */
+               .long   OBSOLETE(sys_oldumount) /* used by libc4 */
                .long   sys_setuid16
                .long   sys_getuid16
-/* 25 */       .long   sys_stime
+/* 25 */       .long   OBSOLETE(sys_stime)
                .long   sys_ptrace
-               .long   sys_alarm               /* used by libc4 */
+               .long   OBSOLETE(sys_alarm)     /* used by libc4 */
                .long   sys_ni_syscall          /* was sys_fstat */
                .long   sys_pause
-/* 30 */       .long   sys_utime               /* used by libc4 */
+/* 30 */       .long   OBSOLETE(sys_utime)     /* used by libc4 */
                .long   sys_ni_syscall          /* was sys_stty */
                .long   sys_ni_syscall          /* was sys_getty */
                .long   sys_access
@@ -90,21 +90,21 @@ __syscall_start:
                .long   sys_sigpending
                .long   sys_sethostname
 /* 75 */       .long   sys_setrlimit
-               .long   sys_old_getrlimit       /* used by libc4 */
+               .long   OBSOLETE(sys_old_getrlimit) /* used by libc4 */
                .long   sys_getrusage
                .long   sys_gettimeofday
                .long   sys_settimeofday
 /* 80 */       .long   sys_getgroups16
                .long   sys_setgroups16
-               .long   old_select              /* used by libc4 */
+               .long   OBSOLETE(old_select)    /* used by libc4 */
                .long   sys_symlink
                .long   sys_ni_syscall          /* was sys_lstat */
 /* 85 */       .long   sys_readlink
                .long   sys_uselib
                .long   sys_swapon
                .long   sys_reboot
-               .long   old_readdir             /* used by libc4 */
-/* 90 */       .long   old_mmap                /* used by libc4 */
+               .long   OBSOLETE(old_readdir)   /* used by libc4 */
+/* 90 */       .long   OBSOLETE(old_mmap)      /* used by libc4 */
                .long   sys_munmap
                .long   sys_truncate
                .long   sys_ftruncate
@@ -116,7 +116,7 @@ __syscall_start:
                .long   sys_statfs
 /* 100 */      .long   sys_fstatfs
                .long   sys_ni_syscall
-               .long   sys_socketcall
+               .long   OBSOLETE(sys_socketcall)
                .long   sys_syslog
                .long   sys_setitimer
 /* 105 */      .long   sys_getitimer
@@ -127,11 +127,11 @@ __syscall_start:
 /* 110 */      .long   sys_ni_syscall          /* was sys_iopl */
                .long   sys_vhangup
                .long   sys_ni_syscall
-               .long   sys_syscall             /* call a syscall */
+               .long   OBSOLETE(sys_syscall)   /* call a syscall */
                .long   sys_wait4
 /* 115 */      .long   sys_swapoff
                .long   sys_sysinfo
-               .long   sys_ipc
+               .long   OBSOLETE(ABI(sys_ipc, sys_oabi_ipc))
                .long   sys_fsync
                .long   sys_sigreturn_wrapper
 /* 120 */      .long   sys_clone_wrapper
@@ -194,8 +194,8 @@ __syscall_start:
                .long   sys_rt_sigtimedwait
                .long   sys_rt_sigqueueinfo
                .long   sys_rt_sigsuspend_wrapper
-/* 180 */      .long   sys_pread64
-               .long   sys_pwrite64
+/* 180 */      .long   ABI(sys_pread64, sys_oabi_pread64)
+               .long   ABI(sys_pwrite64, sys_oabi_pwrite64)
                .long   sys_chown16
                .long   sys_getcwd
                .long   sys_capget
@@ -207,11 +207,11 @@ __syscall_start:
 /* 190 */      .long   sys_vfork_wrapper
                .long   sys_getrlimit
                .long   sys_mmap2
-               .long   sys_truncate64
-               .long   sys_ftruncate64
-/* 195 */      .long   sys_stat64
-               .long   sys_lstat64
-               .long   sys_fstat64
+               .long   ABI(sys_truncate64, sys_oabi_truncate64)
+               .long   ABI(sys_ftruncate64, sys_oabi_ftruncate64)
+/* 195 */      .long   ABI(sys_stat64, sys_oabi_stat64)
+               .long   ABI(sys_lstat64, sys_oabi_lstat64)
+               .long   ABI(sys_fstat64, sys_oabi_fstat64)
                .long   sys_lchown
                .long   sys_getuid
 /* 200 */      .long   sys_getgid
@@ -235,11 +235,11 @@ __syscall_start:
                .long   sys_pivot_root
                .long   sys_mincore
 /* 220 */      .long   sys_madvise
-               .long   sys_fcntl64
+               .long   ABI(sys_fcntl64, sys_oabi_fcntl64)
                .long   sys_ni_syscall /* TUX */
                .long   sys_ni_syscall
                .long   sys_gettid
-/* 225 */      .long   sys_readahead
+/* 225 */      .long   ABI(sys_readahead, sys_oabi_readahead)
                .long   sys_setxattr
                .long   sys_lsetxattr
                .long   sys_fsetxattr
@@ -265,8 +265,8 @@ __syscall_start:
                .long   sys_exit_group
                .long   sys_lookup_dcookie
 /* 250 */      .long   sys_epoll_create
-               .long   sys_epoll_ctl
-               .long   sys_epoll_wait
+               .long   ABI(sys_epoll_ctl, sys_oabi_epoll_ctl)
+               .long   ABI(sys_epoll_wait, sys_oabi_epoll_wait)
                .long   sys_remap_file_pages
                .long   sys_ni_syscall  /* sys_set_thread_area */
 /* 255 */      .long   sys_ni_syscall  /* sys_get_thread_area */
@@ -280,8 +280,8 @@ __syscall_start:
                .long   sys_clock_gettime
                .long   sys_clock_getres
 /* 265 */      .long   sys_clock_nanosleep
-               .long   sys_statfs64
-               .long   sys_fstatfs64
+               .long   sys_statfs64_wrapper
+               .long   sys_fstatfs64_wrapper
                .long   sys_tgkill
                .long   sys_utimes
 /* 270 */      .long   sys_arm_fadvise64_64
@@ -312,7 +312,7 @@ __syscall_start:
 /* 295 */      .long   sys_getsockopt
                .long   sys_sendmsg
                .long   sys_recvmsg
-               .long   sys_semop
+               .long   ABI(sys_semop, sys_oabi_semop)
                .long   sys_semget
 /* 300 */      .long   sys_semctl
                .long   sys_msgsnd
@@ -326,7 +326,7 @@ __syscall_start:
                .long   sys_add_key
 /* 310 */      .long   sys_request_key
                .long   sys_keyctl
-               .long   sys_semtimedop
+               .long   ABI(sys_semtimedop, sys_oabi_semtimedop)
 /* vserver */  .long   sys_ni_syscall
                .long   sys_ioprio_set
 /* 315 */      .long   sys_ioprio_get
@@ -336,9 +336,8 @@ __syscall_start:
                .long   sys_mbind
 /* 320 */      .long   sys_get_mempolicy
                .long   sys_set_mempolicy
-__syscall_end:
 
-               .rept   NR_syscalls - (__syscall_end - __syscall_start) / 4
+               .rept   NR_syscalls - (. - 100b) / 4
                        .long   sys_ni_syscall
                .endr
 #endif
index a52baed..874e6bb 100644 (file)
@@ -3,6 +3,7 @@
  *
  *  Copyright (C) 1996,1997,1998 Russell King.
  *  ARM700 fix by Matthew Godbolt (linux-user@willothewisp.demon.co.uk)
+ *  nommu support by Hyok S. Choi (hyok.choi@samsung.com)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -104,14 +105,24 @@ common_invalid:
 /*
  * SVC mode handlers
  */
+
+#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5)
+#define SPFIX(code...) code
+#else
+#define SPFIX(code...)
+#endif
+
        .macro  svc_entry
        sub     sp, sp, #S_FRAME_SIZE
+ SPFIX(        tst     sp, #4          )
+ SPFIX(        bicne   sp, sp, #4      )
        stmib   sp, {r1 - r12}
 
        ldmia   r0, {r1 - r3}
        add     r5, sp, #S_SP           @ here for interlock avoidance
        mov     r4, #-1                 @  ""  ""      ""       ""
        add     r0, sp, #S_FRAME_SIZE   @  ""  ""      ""       ""
+ SPFIX(        addne   r0, r0, #4      )
        str     r1, [sp]                @ save the "real" r0 copied
                                        @ from the exception stack
 
@@ -302,7 +313,14 @@ __pabt_svc:
 
 /*
  * User mode handlers
+ *
+ * EABI note: sp_svc is always 64-bit aligned here, so should S_FRAME_SIZE
  */
+
+#if defined(CONFIG_AEABI) && (__LINUX_ARM_ARCH__ >= 5) && (S_FRAME_SIZE & 7)
+#error "sizeof(struct pt_regs) must be a multiple of 8"
+#endif
+
        .macro  usr_entry
        sub     sp, sp, #S_FRAME_SIZE
        stmib   sp, {r1 - r12}
@@ -538,7 +556,11 @@ ENTRY(__switch_to)
        add     ip, r1, #TI_CPU_SAVE
        ldr     r3, [r2, #TI_TP_VALUE]
        stmia   ip!, {r4 - sl, fp, sp, lr}      @ Store most regs on stack
+#ifndef CONFIG_MMU
+       add     r2, r2, #TI_CPU_DOMAIN
+#else
        ldr     r6, [r2, #TI_CPU_DOMAIN]!
+#endif
 #if __LINUX_ARM_ARCH__ >= 6
 #ifdef CONFIG_CPU_MPCORE
        clrex
@@ -556,7 +578,9 @@ ENTRY(__switch_to)
        mov     r4, #0xffff0fff
        str     r3, [r4, #-15]                  @ TLS val at 0xffff0ff0
 #endif
+#ifdef CONFIG_MMU
        mcr     p15, 0, r6, c3, c0, 0           @ Set domain register
+#endif
 #ifdef CONFIG_VFP
        @ Always disable VFP so we can lazily save/restore the old
        @ state. This occurs in the context of the previous thread.
index e2b4299..2b92ce8 100644 (file)
@@ -98,20 +98,14 @@ ENTRY(ret_from_fork)
           run on an ARM7 and we can save a couple of instructions.  
                                                                --pb */
 #ifdef CONFIG_CPU_ARM710
-       .macro  arm710_bug_check, instr, temp
-       and     \temp, \instr, #0x0f000000      @ check for SWI
-       teq     \temp, #0x0f000000
-       bne     .Larm700bug
-       .endm
-
-.Larm700bug:
+#define A710(code...) code
+.Larm710bug:
        ldmia   sp, {r0 - lr}^                  @ Get calling r0 - lr
        mov     r0, r0
        add     sp, sp, #S_FRAME_SIZE
        subs    pc, lr, #4
 #else
-       .macro  arm710_bug_check, instr, temp
-       .endm
+#define A710(code...)
 #endif
 
        .align  5
@@ -129,14 +123,50 @@ ENTRY(vector_swi)
        /*
         * Get the system call number.
         */
+
+#if defined(CONFIG_OABI_COMPAT)
+
+       /*
+        * If we have CONFIG_OABI_COMPAT then we need to look at the swi
+        * value to determine if it is an EABI or an old ABI call.
+        */
 #ifdef CONFIG_ARM_THUMB
+       tst     r8, #PSR_T_BIT
+       movne   r10, #0                         @ no thumb OABI emulation
+       ldreq   r10, [lr, #-4]                  @ get SWI instruction
+#else
+       ldr     r10, [lr, #-4]                  @ get SWI instruction
+  A710(        and     ip, r10, #0x0f000000            @ check for SWI         )
+  A710(        teq     ip, #0x0f000000                                         )
+  A710(        bne     .Larm710bug                                             )
+#endif
+
+#elif defined(CONFIG_AEABI)
+
+       /*
+        * Pure EABI user space always put syscall number into scno (r7).
+        */
+  A710(        ldr     ip, [lr, #-4]                   @ get SWI instruction   )
+  A710(        and     ip, ip, #0x0f000000             @ check for SWI         )
+  A710(        teq     ip, #0x0f000000                                         )
+  A710(        bne     .Larm710bug                                             )
+
+#elif defined(CONFIG_ARM_THUMB)
+
+       /* Legacy ABI only, possibly thumb mode. */
        tst     r8, #PSR_T_BIT                  @ this is SPSR from save_user_regs
        addne   scno, r7, #__NR_SYSCALL_BASE    @ put OS number in
        ldreq   scno, [lr, #-4]
+
 #else
+
+       /* Legacy ABI only. */
        ldr     scno, [lr, #-4]                 @ get SWI instruction
+  A710(        and     ip, scno, #0x0f000000           @ check for SWI         )
+  A710(        teq     ip, #0x0f000000                                         )
+  A710(        bne     .Larm710bug                                             )
+
 #endif
-       arm710_bug_check scno, ip
 
 #ifdef CONFIG_ALIGNMENT_TRAP
        ldr     ip, __cr_alignment
@@ -145,18 +175,31 @@ ENTRY(vector_swi)
 #endif
        enable_irq
 
-       stmdb   sp!, {r4, r5}                   @ push fifth and sixth args
-
        get_thread_info tsk
+       adr     tbl, sys_call_table             @ load syscall table pointer
        ldr     ip, [tsk, #TI_FLAGS]            @ check for syscall tracing
+
+#if defined(CONFIG_OABI_COMPAT)
+       /*
+        * If the swi argument is zero, this is an EABI call and we do nothing.
+        *
+        * If this is an old ABI call, get the syscall number into scno and
+        * get the old ABI syscall table address.
+        */
+       bics    r10, r10, #0xff000000
+       eorne   scno, r10, #__NR_OABI_SYSCALL_BASE
+       ldrne   tbl, =sys_oabi_call_table
+#elif !defined(CONFIG_AEABI)
        bic     scno, scno, #0xff000000         @ mask off SWI op-code
        eor     scno, scno, #__NR_SYSCALL_BASE  @ check OS number
-       adr     tbl, sys_call_table             @ load syscall table pointer
+#endif
+
+       stmdb   sp!, {r4, r5}                   @ push fifth and sixth args
        tst     ip, #_TIF_SYSCALL_TRACE         @ are we tracing syscalls?
        bne     __sys_trace
 
-       adr     lr, ret_fast_syscall            @ return address
        cmp     scno, #NR_syscalls              @ check upper syscall limit
+       adr     lr, ret_fast_syscall            @ return address
        ldrcc   pc, [tbl, scno, lsl #2]         @ call sys_* routine
 
        add     r1, sp, #S_OFF
@@ -171,11 +214,13 @@ ENTRY(vector_swi)
         * context switches, and waiting for our parent to respond.
         */
 __sys_trace:
+       mov     r2, scno
        add     r1, sp, #S_OFF
        mov     r0, #0                          @ trace entry [IP = 0]
        bl      syscall_trace
 
        adr     lr, __sys_trace_return          @ return address
+       mov     scno, r0                        @ syscall number (possibly new)
        add     r1, sp, #S_R0 + S_OFF           @ pointer to regs
        cmp     scno, #NR_syscalls              @ check upper syscall limit
        ldmccia r1, {r0 - r3}                   @ have to reload r0 - r3
@@ -184,6 +229,7 @@ __sys_trace:
 
 __sys_trace_return:
        str     r0, [sp, #S_R0 + S_OFF]!        @ save returned r0
+       mov     r2, scno
        mov     r1, sp
        mov     r0, #1                          @ trace exit [IP = 1]
        bl      syscall_trace
@@ -195,10 +241,24 @@ __sys_trace_return:
 __cr_alignment:
        .word   cr_alignment
 #endif
+       .ltorg
+
+/*
+ * This is the syscall table declaration for native ABI syscalls.
+ * With EABI a couple syscalls are obsolete and defined as sys_ni_syscall.
+ */
+#define ABI(native, compat) native
+#ifdef CONFIG_AEABI
+#define OBSOLETE(syscall) sys_ni_syscall
+#else
+#define OBSOLETE(syscall) syscall
+#endif
 
        .type   sys_call_table, #object
 ENTRY(sys_call_table)
 #include "calls.S"
+#undef ABI
+#undef OBSOLETE
 
 /*============================================================================
  * Special system call wrappers
@@ -207,7 +267,7 @@ ENTRY(sys_call_table)
 @ r8 = syscall table
                .type   sys_syscall, #function
 sys_syscall:
-               eor     scno, r0, #__NR_SYSCALL_BASE
+               eor     scno, r0, #__NR_OABI_SYSCALL_BASE
                cmp     scno, #__NR_syscall - __NR_SYSCALL_BASE
                cmpne   scno, #NR_syscalls      @ check range
                stmloia sp, {r5, r6}            @ shuffle args
@@ -255,6 +315,16 @@ sys_sigaltstack_wrapper:
                ldr     r2, [sp, #S_OFF + S_SP]
                b       do_sigaltstack
 
+sys_statfs64_wrapper:
+               teq     r1, #88
+               moveq   r1, #84
+               b       sys_statfs64
+
+sys_fstatfs64_wrapper:
+               teq     r1, #88
+               moveq   r1, #84
+               b       sys_fstatfs64
+
 /*
  * Note: off_4k (r5) is always units of 4K.  If we can't do the requested
  * offset, we return EINVAL.
@@ -271,3 +341,49 @@ sys_mmap2:
                str     r5, [sp, #4]
                b       do_mmap2
 #endif
+
+#ifdef CONFIG_OABI_COMPAT
+
+/*
+ * These are syscalls with argument register differences
+ */
+
+sys_oabi_pread64:
+               stmia   sp, {r3, r4}
+               b       sys_pread64
+
+sys_oabi_pwrite64:
+               stmia   sp, {r3, r4}
+               b       sys_pwrite64
+
+sys_oabi_truncate64:
+               mov     r3, r2
+               mov     r2, r1
+               b       sys_truncate64
+
+sys_oabi_ftruncate64:
+               mov     r3, r2
+               mov     r2, r1
+               b       sys_ftruncate64
+
+sys_oabi_readahead:
+               str     r3, [sp]
+               mov     r3, r2
+               mov     r2, r1
+               b       sys_readahead
+
+/*
+ * Let's declare a second syscall table for old ABI binaries
+ * using the compatibility syscall entries.
+ */
+#define ABI(native, compat) compat
+#define OBSOLETE(syscall) syscall
+
+       .type   sys_oabi_call_table, #object
+ENTRY(sys_oabi_call_table)
+#include "calls.S"
+#undef ABI
+#undef OBSOLETE
+
+#endif
+
index 648cfff..55c99cd 100644 (file)
@@ -19,6 +19,7 @@
 @
 @ Most of the stack format comes from struct pt_regs, but with
 @ the addition of 8 bytes for storing syscall args 5 and 6.
+@ This _must_ remain a multiple of 8 for EABI.
 @
 #define S_OFF          8
 
index 1e985f2..1aca177 100644 (file)
@@ -251,12 +251,11 @@ __turn_mmu_on:
  * r10 = procinfo
  *
  * Returns:
- *  r0, r3, r5, r6, r7 corrupted
+ *  r0, r3, r6, r7 corrupted
  *  r4 = physical page table address
  */
        .type   __create_page_tables, %function
 __create_page_tables:
-       ldr     r5, [r8, #MACHINFO_PHYSRAM]     @ physram
        pgtbl   r4                              @ page table address
 
        /*
@@ -303,7 +302,7 @@ __create_page_tables:
         * Then map first 1MB of ram in case it contains our boot params.
         */
        add     r0, r4, #PAGE_OFFSET >> 18
-       orr     r6, r5, r7
+       orr     r6, r7, #PHYS_OFFSET
        str     r6, [r0]
 
 #ifdef CONFIG_XIP_KERNEL
@@ -311,7 +310,7 @@ __create_page_tables:
         * Map some ram to cover our .data and .bss areas.
         * Mapping 3MB should be plenty.
         */
-       sub     r3, r4, r5
+       sub     r3, r4, #PHYS_OFFSET
        mov     r3, r3, lsr #20
        add     r0, r0, r3, lsl #2
        add     r6, r6, r3, lsl #20
index e591f72..7b6256b 100644 (file)
@@ -766,6 +766,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                                       (unsigned long __user *) data);
                        break;
 
+               case PTRACE_SET_SYSCALL:
+                       ret = 0;
+                       child->ptrace_message = data;
+                       break;
+
                default:
                        ret = ptrace_request(child, request, addr, data);
                        break;
@@ -774,14 +779,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
        return ret;
 }
 
-asmlinkage void syscall_trace(int why, struct pt_regs *regs)
+asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
 {
        unsigned long ip;
 
        if (!test_thread_flag(TIF_SYSCALL_TRACE))
-               return;
+               return scno;
        if (!(current->ptrace & PT_PTRACED))
-               return;
+               return scno;
 
        /*
         * Save IP.  IP is used to denote syscall entry/exit:
@@ -790,6 +795,8 @@ asmlinkage void syscall_trace(int why, struct pt_regs *regs)
        ip = regs->ARM_ip;
        regs->ARM_ip = why;
 
+       current->ptrace_message = scno;
+
        /* the 0x80 provides a way for the tracing parent to distinguish
           between a syscall stop and SIGTRAP delivery */
        ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
@@ -804,4 +811,6 @@ asmlinkage void syscall_trace(int why, struct pt_regs *regs)
                current->exit_code = 0;
        }
        regs->ARM_ip = ip;
+
+       return current->ptrace_message;
 }
index 4c31f29..981fe5c 100644 (file)
@@ -177,41 +177,42 @@ int __down_trylock(struct semaphore * sem)
  * ip contains the semaphore pointer on entry. Save the C-clobbered
  * registers (r0 to r3 and lr), but not ip, as we use it as a return
  * value in some cases..
+ * To remain AAPCS compliant (64-bit stack align) we save r4 as well.
  */
 asm("  .section .sched.text,\"ax\",%progbits   \n\
        .align  5                               \n\
        .globl  __down_failed                   \n\
 __down_failed:                                 \n\
-       stmfd   sp!, {r0 - r3, lr}              \n\
+       stmfd   sp!, {r0 - r4, lr}              \n\
        mov     r0, ip                          \n\
        bl      __down                          \n\
-       ldmfd   sp!, {r0 - r3, pc}              \n\
+       ldmfd   sp!, {r0 - r4, pc}              \n\
                                                \n\
        .align  5                               \n\
        .globl  __down_interruptible_failed     \n\
 __down_interruptible_failed:                   \n\
-       stmfd   sp!, {r0 - r3, lr}              \n\
+       stmfd   sp!, {r0 - r4, lr}              \n\
        mov     r0, ip                          \n\
        bl      __down_interruptible            \n\
        mov     ip, r0                          \n\
-       ldmfd   sp!, {r0 - r3, pc}              \n\
+       ldmfd   sp!, {r0 - r4, pc}              \n\
                                                \n\
        .align  5                               \n\
        .globl  __down_trylock_failed           \n\
 __down_trylock_failed:                         \n\
-       stmfd   sp!, {r0 - r3, lr}              \n\
+       stmfd   sp!, {r0 - r4, lr}              \n\
        mov     r0, ip                          \n\
        bl      __down_trylock                  \n\
        mov     ip, r0                          \n\
-       ldmfd   sp!, {r0 - r3, pc}              \n\
+       ldmfd   sp!, {r0 - r4, pc}              \n\
                                                \n\
        .align  5                               \n\
        .globl  __up_wakeup                     \n\
 __up_wakeup:                                   \n\
-       stmfd   sp!, {r0 - r3, lr}              \n\
+       stmfd   sp!, {r0 - r4, lr}              \n\
        mov     r0, ip                          \n\
        bl      __up                            \n\
-       ldmfd   sp!, {r0 - r3, pc}              \n\
+       ldmfd   sp!, {r0 - r4, pc}              \n\
        ");
 
 EXPORT_SYMBOL(__down_failed);
index ea569ba..a491de2 100644 (file)
@@ -147,6 +147,7 @@ asmlinkage int old_select(struct sel_arg_struct __user *arg)
        return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
 }
 
+#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
 /*
  * sys_ipc() is the de-multiplexer for the SysV IPC calls..
  *
@@ -226,6 +227,7 @@ asmlinkage int sys_ipc(uint call, int first, int second, int third,
                return -ENOSYS;
        }
 }
+#endif
 
 /* Fork a new task - this creates a new program thread.
  * This is called indirectly via a small wrapper
diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c
new file mode 100644 (file)
index 0000000..eafa8e5
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ *  arch/arm/kernel/sys_oabi-compat.c
+ *
+ *  Compatibility wrappers for syscalls that are used from
+ *  old ABI user space binaries with an EABI kernel.
+ *
+ *  Author:    Nicolas Pitre
+ *  Created:   Oct 7, 2005
+ *  Copyright: MontaVista Software, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+/*
+ * The legacy ABI and the new ARM EABI have different rules making some
+ * syscalls incompatible especially with structure arguments.
+ * Most notably, Eabi says 64-bit members should be 64-bit aligned instead of
+ * simply word aligned.  EABI also pads structures to the size of the largest
+ * member it contains instead of the invariant 32-bit.
+ *
+ * The following syscalls are affected:
+ *
+ * sys_stat64:
+ * sys_lstat64:
+ * sys_fstat64:
+ *
+ *   struct stat64 has different sizes and some members are shifted
+ *   Compatibility wrappers are needed for them and provided below.
+ *
+ * sys_fcntl64:
+ *
+ *   struct flock64 has different sizes and some members are shifted
+ *   A compatibility wrapper is needed and provided below.
+ *
+ * sys_statfs64:
+ * sys_fstatfs64:
+ *
+ *   struct statfs64 has extra padding with EABI growing its size from
+ *   84 to 88.  This struct is now __attribute__((packed,aligned(4)))
+ *   with a small assembly wrapper to force the sz argument to 84 if it is 88
+ *   to avoid copying the extra padding over user space unexpecting it.
+ *
+ * sys_newuname:
+ *
+ *   struct new_utsname has no padding with EABI.  No problem there.
+ *
+ * sys_epoll_ctl:
+ * sys_epoll_wait:
+ *
+ *   struct epoll_event has its second member shifted also affecting the
+ *   structure size. Compatibility wrappers are needed and provided below.
+ *
+ * sys_ipc:
+ * sys_semop:
+ * sys_semtimedop:
+ *
+ *   struct sembuf loses its padding with EABI.  Since arrays of them are
+ *   used they have to be copyed to remove the padding. Compatibility wrappers
+ *   provided below.
+ */
+
+#include <linux/syscalls.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/fcntl.h>
+#include <linux/eventpoll.h>
+#include <linux/sem.h>
+#include <asm/ipc.h>
+#include <asm/uaccess.h>
+
+struct oldabi_stat64 {
+       unsigned long long st_dev;
+       unsigned int    __pad1;
+       unsigned long   __st_ino;
+       unsigned int    st_mode;
+       unsigned int    st_nlink;
+
+       unsigned long   st_uid;
+       unsigned long   st_gid;
+
+       unsigned long long st_rdev;
+       unsigned int    __pad2;
+
+       long long       st_size;
+       unsigned long   st_blksize;
+       unsigned long long st_blocks;
+
+       unsigned long   st_atime;
+       unsigned long   st_atime_nsec;
+
+       unsigned long   st_mtime;
+       unsigned long   st_mtime_nsec;
+
+       unsigned long   st_ctime;
+       unsigned long   st_ctime_nsec;
+
+       unsigned long long st_ino;
+} __attribute__ ((packed,aligned(4)));
+
+static long cp_oldabi_stat64(struct kstat *stat,
+                            struct oldabi_stat64 __user *statbuf)
+{
+       struct oldabi_stat64 tmp;
+
+       tmp.st_dev = huge_encode_dev(stat->dev);
+       tmp.__pad1 = 0;
+       tmp.__st_ino = stat->ino;
+       tmp.st_mode = stat->mode;
+       tmp.st_nlink = stat->nlink;
+       tmp.st_uid = stat->uid;
+       tmp.st_gid = stat->gid;
+       tmp.st_rdev = huge_encode_dev(stat->rdev);
+       tmp.st_size = stat->size;
+       tmp.st_blocks = stat->blocks;
+       tmp.__pad2 = 0;
+       tmp.st_blksize = stat->blksize;
+       tmp.st_atime = stat->atime.tv_sec;
+       tmp.st_atime_nsec = stat->atime.tv_nsec;
+       tmp.st_mtime = stat->mtime.tv_sec;
+       tmp.st_mtime_nsec = stat->mtime.tv_nsec;
+       tmp.st_ctime = stat->ctime.tv_sec;
+       tmp.st_ctime_nsec = stat->ctime.tv_nsec;
+       tmp.st_ino = stat->ino;
+       return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
+}
+
+asmlinkage long sys_oabi_stat64(char __user * filename,
+                               struct oldabi_stat64 __user * statbuf)
+{
+       struct kstat stat;
+       int error = vfs_stat(filename, &stat);
+       if (!error)
+               error = cp_oldabi_stat64(&stat, statbuf);
+       return error;
+}
+
+asmlinkage long sys_oabi_lstat64(char __user * filename,
+                                struct oldabi_stat64 __user * statbuf)
+{
+       struct kstat stat;
+       int error = vfs_lstat(filename, &stat);
+       if (!error)
+               error = cp_oldabi_stat64(&stat, statbuf);
+       return error;
+}
+
+asmlinkage long sys_oabi_fstat64(unsigned long fd,
+                                struct oldabi_stat64 __user * statbuf)
+{
+       struct kstat stat;
+       int error = vfs_fstat(fd, &stat);
+       if (!error)
+               error = cp_oldabi_stat64(&stat, statbuf);
+       return error;
+}
+
+struct oabi_flock64 {
+       short   l_type;
+       short   l_whence;
+       loff_t  l_start;
+       loff_t  l_len;
+       pid_t   l_pid;
+} __attribute__ ((packed,aligned(4)));
+
+asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd,
+                                unsigned long arg)
+{
+       struct oabi_flock64 user;
+       struct flock64 kernel;
+       mm_segment_t fs = USER_DS; /* initialized to kill a warning */
+       unsigned long local_arg = arg;
+       int ret;
+
+       switch (cmd) {
+       case F_GETLK64:
+       case F_SETLK64:
+       case F_SETLKW64:
+               if (copy_from_user(&user, (struct oabi_flock64 __user *)arg,
+                                  sizeof(user)))
+                       return -EFAULT;
+               kernel.l_type   = user.l_type;
+               kernel.l_whence = user.l_whence;
+               kernel.l_start  = user.l_start;
+               kernel.l_len    = user.l_len;
+               kernel.l_pid    = user.l_pid;
+               local_arg = (unsigned long)&kernel;
+               fs = get_fs();
+               set_fs(KERNEL_DS);
+       }
+
+       ret = sys_fcntl64(fd, cmd, local_arg);
+
+       switch (cmd) {
+       case F_GETLK64:
+               if (!ret) {
+                       user.l_type     = kernel.l_type;
+                       user.l_whence   = kernel.l_whence;
+                       user.l_start    = kernel.l_start;
+                       user.l_len      = kernel.l_len;
+                       user.l_pid      = kernel.l_pid;
+                       if (copy_to_user((struct oabi_flock64 __user *)arg,
+                                        &user, sizeof(user)))
+                               ret = -EFAULT;
+               }
+       case F_SETLK64:
+       case F_SETLKW64:
+               set_fs(fs);
+       }
+
+       return ret;
+}
+
+struct oabi_epoll_event {
+       __u32 events;
+       __u64 data;
+} __attribute__ ((packed,aligned(4)));
+
+asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
+                                  struct oabi_epoll_event __user *event)
+{
+       struct oabi_epoll_event user;
+       struct epoll_event kernel;
+       mm_segment_t fs;
+       long ret;
+
+       if (op == EPOLL_CTL_DEL)
+               return sys_epoll_ctl(epfd, op, fd, NULL);
+       if (copy_from_user(&user, event, sizeof(user)))
+               return -EFAULT;
+       kernel.events = user.events;
+       kernel.data   = user.data;
+       fs = get_fs();
+       set_fs(KERNEL_DS);
+       ret = sys_epoll_ctl(epfd, op, fd, &kernel);
+       set_fs(fs);
+       return ret;
+}
+
+asmlinkage long sys_oabi_epoll_wait(int epfd,
+                                   struct oabi_epoll_event __user *events,
+                                   int maxevents, int timeout)
+{
+       struct epoll_event *kbuf;
+       mm_segment_t fs;
+       long ret, err, i;
+
+       if (maxevents <= 0 || maxevents > (INT_MAX/sizeof(struct epoll_event)))
+               return -EINVAL;
+       kbuf = kmalloc(sizeof(*kbuf) * maxevents, GFP_KERNEL);
+       if (!kbuf)
+               return -ENOMEM;
+       fs = get_fs();
+       set_fs(KERNEL_DS);
+       ret = sys_epoll_wait(epfd, kbuf, maxevents, timeout);
+       set_fs(fs);
+       err = 0;
+       for (i = 0; i < ret; i++) {
+               __put_user_error(kbuf[i].events, &events->events, err);
+               __put_user_error(kbuf[i].data,   &events->data,   err);
+               events++;
+       }
+       kfree(kbuf);
+       return err ? -EFAULT : ret;
+}
+
+struct oabi_sembuf {
+       unsigned short  sem_num;
+       short           sem_op;
+       short           sem_flg;
+       unsigned short  __pad;
+};
+
+asmlinkage long sys_oabi_semtimedop(int semid,
+                                   struct oabi_sembuf __user *tsops,
+                                   unsigned nsops,
+                                   const struct timespec __user *timeout)
+{
+       struct sembuf *sops;
+       struct timespec local_timeout;
+       long err;
+       int i;
+
+       if (nsops < 1)
+               return -EINVAL;
+       sops = kmalloc(sizeof(*sops) * nsops, GFP_KERNEL);
+       if (!sops)
+               return -ENOMEM;
+       err = 0;
+       for (i = 0; i < nsops; i++) {
+               __get_user_error(sops[i].sem_num, &tsops->sem_num, err);
+               __get_user_error(sops[i].sem_op,  &tsops->sem_op,  err);
+               __get_user_error(sops[i].sem_flg, &tsops->sem_flg, err);
+               tsops++;
+       }
+       if (timeout) {
+               /* copy this as well before changing domain protection */
+               err |= copy_from_user(&local_timeout, timeout, sizeof(*timeout));
+               timeout = &local_timeout;
+       }
+       if (err) {
+               err = -EFAULT;
+       } else {
+               mm_segment_t fs = get_fs();
+               set_fs(KERNEL_DS);
+               err = sys_semtimedop(semid, sops, nsops, timeout);
+               set_fs(fs);
+       }
+       kfree(sops);
+       return err;
+}
+
+asmlinkage long sys_oabi_semop(int semid, struct oabi_sembuf __user *tsops,
+                              unsigned nsops)
+{
+       return sys_oabi_semtimedop(semid, tsops, nsops, NULL);
+}
+
+extern asmlinkage int sys_ipc(uint call, int first, int second, int third,
+                             void __user *ptr, long fifth);
+
+asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third,
+                           void __user *ptr, long fifth)
+{
+       switch (call & 0xffff) {
+       case SEMOP:
+               return  sys_oabi_semtimedop(first,
+                                           (struct oabi_sembuf __user *)ptr,
+                                           second, NULL);
+       case SEMTIMEDOP:
+               return  sys_oabi_semtimedop(first,
+                                           (struct oabi_sembuf __user *)ptr,
+                                           second,
+                                           (const struct timespec __user *)fifth);
+       default:
+               return sys_ipc(call, first, second, third, ptr, fifth);
+       }
+}
index 93cfd3f..10235b0 100644 (file)
@@ -404,7 +404,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
        struct thread_info *thread = current_thread_info();
        siginfo_t info;
 
-       if ((no >> 16) != 0x9f)
+       if ((no >> 16) != (__ARM_NR_BASE>> 16))
                return bad_syscall(no, regs);
 
        switch (no & 0xffff) {
index 561e207..55e57a1 100644 (file)
@@ -37,6 +37,7 @@ Boston, MA 02110-1301, USA.  */
 #endif
 
 ENTRY(__ashldi3)
+ENTRY(__aeabi_llsl)
 
        subs    r3, r2, #32
        rsb     ip, r2, #32
index 86fb2a9..0b31398 100644 (file)
@@ -37,6 +37,7 @@ Boston, MA 02110-1301, USA.  */
 #endif
 
 ENTRY(__ashrdi3)
+ENTRY(__aeabi_lasr)
 
        subs    r3, r2, #32
        rsb     ip, r2, #32
index 5902602..4e492f4 100644 (file)
@@ -206,6 +206,7 @@ Boston, MA 02111-1307, USA.  */
 
 
 ENTRY(__udivsi3)
+ENTRY(__aeabi_uidiv)
 
        subs    r2, r1, #1
        moveq   pc, lr
@@ -246,6 +247,7 @@ ENTRY(__umodsi3)
 
 
 ENTRY(__divsi3)
+ENTRY(__aeabi_idiv)
 
        cmp     r1, #0
        eor     ip, r0, r1                      @ save the sign of the result.
@@ -303,12 +305,33 @@ ENTRY(__modsi3)
        rsbmi   r0, r0, #0
        mov     pc, lr
 
+#ifdef CONFIG_AEABI
+
+ENTRY(__aeabi_uidivmod)
+
+       stmfd   sp!, {r0, r1, ip, lr}
+       bl      __aeabi_uidiv
+       ldmfd   sp!, {r1, r2, ip, lr}
+       mul     r3, r0, r2
+       sub     r1, r1, r3
+       mov     pc, lr
+
+ENTRY(__aeabi_idivmod)
+
+       stmfd   sp!, {r0, r1, ip, lr}
+       bl      __aeabi_idiv
+       ldmfd   sp!, {r1, r2, ip, lr}
+       mul     r3, r0, r2
+       sub     r1, r1, r3
+       mov     pc, lr
+
+#endif
 
 Ldiv0:
 
-       str     lr, [sp, #-4]!
+       str     lr, [sp, #-8]!
        bl      __div0
        mov     r0, #0                  @ About as wrong as it could be.
-       ldr     pc, [sp], #4
+       ldr     pc, [sp], #8
 
 
index 46c2ed1..a86dbdd 100644 (file)
@@ -37,6 +37,7 @@ Boston, MA 02110-1301, USA.  */
 #endif
 
 ENTRY(__lshrdi3)
+ENTRY(__aeabi_llsr)
 
        subs    r3, r2, #32
        rsb     ip, r2, #32
index c7fbdf0..72d5941 100644 (file)
@@ -25,6 +25,7 @@
 #endif
 
 ENTRY(__muldi3)
+ENTRY(__aeabi_lmul)
 
        mul     xh, yl, xh
        mla     xh, xl, yh, xh
index 112630f..d847a62 100644 (file)
@@ -10,6 +10,7 @@
  *  published by the Free Software Foundation.
  */
 
+#include <linux/config.h>
 #include <linux/linkage.h>
 
 #ifdef __ARMEB__
@@ -33,3 +34,16 @@ ENTRY(__ucmpdi2)
        movhi   r0, #2
        mov     pc, lr
 
+#ifdef CONFIG_AEABI
+
+ENTRY(__aeabi_ulcmp)
+
+       cmp     xh, yh
+       cmpeq   xl, yl
+       movlo   r0, #-1
+       moveq   r0, #0
+       movhi   r0, #1
+       mov     pc, lr
+
+#endif
+
index f5ef697..dc5fa8e 100644 (file)
@@ -90,7 +90,6 @@ static void __init aaed2000_map_io(void)
 
 MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform")
        /* Maintainer: Nicolas Bellido Y Ortega */
-       .phys_ram       = 0xf0000000,
        .phys_io        = PIO_BASE,
        .io_pg_offst    = ((VIO_BASE) >> 18) & 0xfffc,
        .map_io         = aaed2000_map_io,
index 4aec834..54022e5 100644 (file)
@@ -132,7 +132,6 @@ static void __init csb337_board_init(void)
 
 MACHINE_START(CSB337, "Cogent CSB337")
        /* Maintainer: Bill Gatliff */
-       .phys_ram       = AT91_SDRAM_BASE,
        .phys_io        = AT91_BASE_SYS,
        .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
        .boot_params    = AT91_SDRAM_BASE + 0x100,
index 23e4cc2..8195f9d 100644 (file)
@@ -105,7 +105,6 @@ static void __init csb637_board_init(void)
 
 MACHINE_START(CSB637, "Cogent CSB637")
        /* Maintainer: Bill Gatliff */
-       .phys_ram       = AT91_SDRAM_BASE,
        .phys_io        = AT91_BASE_SYS,
        .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
        .boot_params    = AT91_SDRAM_BASE + 0x100,
index 8c747a3..8a78336 100644 (file)
@@ -127,7 +127,6 @@ static void __init dk_board_init(void)
 
 MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
        /* Maintainer: SAN People/Atmel */
-       .phys_ram       = AT91_SDRAM_BASE,
        .phys_io        = AT91_BASE_SYS,
        .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
        .boot_params    = AT91_SDRAM_BASE + 0x100,
index d140645..fd0752e 100644 (file)
@@ -120,7 +120,6 @@ static void __init ek_board_init(void)
 
 MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
        /* Maintainer: SAN People/Atmel */
-       .phys_ram       = AT91_SDRAM_BASE,
        .phys_io        = AT91_BASE_SYS,
        .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
        .boot_params    = AT91_SDRAM_BASE + 0x100,
index 43b9423..c13ca6c 100644 (file)
@@ -64,7 +64,6 @@ void __init autcpu12_map_io(void)
 
 MACHINE_START(AUTCPU12, "autronix autcpu12")
        /* Maintainer: Thomas Gleixner */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xff000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0020000,
index cba7be5..831df00 100644 (file)
@@ -55,7 +55,6 @@ static void __init cdb89712_map_io(void)
 
 MACHINE_START(CDB89712, "Cirrus-CDB89712")
        /* Maintainer: Ray Lehtiniemi */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xff000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index 35d51a7..e2b2c5a 100644 (file)
@@ -56,7 +56,6 @@ static void __init ceiva_map_io(void)
 
 MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame")
        /* Maintainer: Rob Scott */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xff000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index c83f3fd..09fb57e 100644 (file)
@@ -38,7 +38,6 @@ fixup_clep7312(struct machine_desc *desc, struct tag *tags,
 
 MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
        /* Maintainer: Nobody */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xff000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index 255c98b..dc81cc6 100644 (file)
@@ -52,7 +52,6 @@ fixup_edb7211(struct machine_desc *desc, struct tag *tags,
 
 MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
        /* Maintainer: Jon McClintock */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xff000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0020100,   /* 0xc0000000 - 0xc001ffff can be video RAM */
index 3d88da0..ff26a85 100644 (file)
@@ -78,7 +78,6 @@ fortunet_fixup(struct machine_desc *desc, struct tag *tags,
 
 MACHINE_START(FORTUNET, "ARM-FortuNet")
        /* Maintainer: FortuNet Inc. */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf0000000) >> 18) & 0xfffc,
        .boot_params    = 0x00000000,
index a1acb94..9ba45f4 100644 (file)
@@ -90,7 +90,6 @@ static void __init p720t_map_io(void)
 
 MACHINE_START(P720T, "ARM-Prospector720T")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xff000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index d869af0..5b12cab 100644 (file)
@@ -384,7 +384,6 @@ static void __init clps7500_init(void)
 
 MACHINE_START(CLPS7500, "CL-PS7500")
        /* Maintainer: Philip Blundell */
-       .phys_ram       = 0x10000000,
        .phys_io        = 0x03000000,
        .io_pg_offst    = ((0xe0000000) >> 18) & 0xfffc,
        .map_io         = clps7500_map_io,
index ed46149..6d620d8 100644 (file)
@@ -284,7 +284,6 @@ arch_initcall(ebsa110_init);
 
 MACHINE_START(EBSA110, "EBSA110")
        /* Maintainer: Russell King */
-       .phys_ram       = 0x00000000,
        .phys_io        = 0xe0000000,
        .io_pg_offst    = ((0xe0000000) >> 18) & 0xfffc,
        .boot_params    = 0x00000400,
index 49b898a..5b64d5c 100644 (file)
@@ -85,7 +85,6 @@ fixup_cats(struct machine_desc *desc, struct tag *tags,
 
 MACHINE_START(CATS, "Chalice-CATS")
        /* Maintainer: Philip Blundell */
-       .phys_ram       = 0x00000000,
        .phys_io        = DC21285_ARMCSR_BASE,
        .io_pg_offst    = ((0xfe000000) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index 548a790..4545576 100644 (file)
@@ -29,7 +29,6 @@ fixup_coebsa285(struct machine_desc *desc, struct tag *tags,
 
 MACHINE_START(CO285, "co-EBSA285")
        /* Maintainer: Mark van Doesburg */
-       .phys_ram       = 0x00000000,
        .phys_io        = DC21285_ARMCSR_BASE,
        .io_pg_offst    = ((0x7cf00000) >> 18) & 0xfffc,
        .fixup          = fixup_coebsa285,
index 1c37605..b1d3bf2 100644 (file)
@@ -14,7 +14,6 @@
 
 MACHINE_START(EBSA285, "EBSA285")
        /* Maintainer: Russell King */
-       .phys_ram       = 0x00000000,
        .phys_io        = DC21285_ARMCSR_BASE,
        .io_pg_offst    = ((0xfe000000) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index 9e563de..229bf05 100644 (file)
@@ -649,7 +649,6 @@ fixup_netwinder(struct machine_desc *desc, struct tag *tags,
 
 MACHINE_START(NETWINDER, "Rebel-NetWinder")
        /* Maintainer: Russell King/Rebel.com */
-       .phys_ram       = 0x00000000,
        .phys_io        = DC21285_ARMCSR_BASE,
        .io_pg_offst    = ((0xfe000000) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index 0146b8b..c4f843f 100644 (file)
@@ -14,7 +14,6 @@
 
 MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer")
        /* Maintainer: Jamey Hicks / George France */
-       .phys_ram       = 0x00000000,
        .phys_io        = DC21285_ARMCSR_BASE,
        .io_pg_offst    = ((0xfe000000) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index fa59e9e..193f968 100644 (file)
@@ -31,7 +31,6 @@
 
 MACHINE_START(H7201, "Hynix GMS30C7201")
        /* Maintainer: Robert Schwebel, Pengutronix */
-       .phys_ram       = 0x40000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf0000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0001000,
index d75c822..3626689 100644 (file)
@@ -72,7 +72,6 @@ static void __init init_eval_h7202(void)
 
 MACHINE_START(H7202, "Hynix HMS30C7202")
        /* Maintainer: Robert Schwebel, Pengutronix */
-       .phys_ram       = 0x40000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf0000000) >> 18) & 0xfffc,
        .boot_params    = 0x40000100,
index c9e0cd8..dc31e3f 100644 (file)
@@ -69,7 +69,6 @@ mx1ads_map_io(void)
 
 MACHINE_START(MX1ADS, "Motorola MX1ADS")
        /* Maintainer: Sascha Hauer, Pengutronix */
-       .phys_ram       = 0x08000000,
        .phys_io        = 0x00200000,
        .io_pg_offst    = ((0xe0200000) >> 18) & 0xfffc,
        .boot_params    = 0x08000100,
index 3afedeb..d8d3c2a 100644 (file)
@@ -347,7 +347,6 @@ static struct sys_timer ap_timer = {
 
 MACHINE_START(INTEGRATOR, "ARM-Integrator")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .phys_ram       = 0x00000000,
        .phys_io        = 0x16000000,
        .io_pg_offst    = ((0xf1600000) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index 16cf248..3182017 100644 (file)
@@ -578,7 +578,6 @@ static struct sys_timer cp_timer = {
 
 MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .phys_ram       = 0x00000000,
        .phys_io        = 0x16000000,
        .io_pg_offst    = ((0xf1600000) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index 8077023..e4f4c52 100644 (file)
@@ -151,7 +151,6 @@ extern void iop321_init_time(void);
 #if defined(CONFIG_ARCH_IQ80321)
 MACHINE_START(IQ80321, "Intel IQ80321")
        /* Maintainer: Intel Corporation */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = IQ80321_UART,
        .io_pg_offst    = ((IQ80321_UART) >> 18) & 0xfffc,
        .map_io         = iq80321_map_io,
@@ -163,7 +162,6 @@ MACHINE_END
 #elif defined(CONFIG_ARCH_IQ31244)
 MACHINE_START(IQ31244, "Intel IQ31244")
        /* Maintainer: Intel Corp. */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = IQ31244_UART,
        .io_pg_offst    = ((IQ31244_UART) >> 18) & 0xfffc,
        .map_io         = iq31244_map_io,
index e6ea1cb..6358548 100644 (file)
@@ -195,7 +195,6 @@ extern void iq80332_map_io(void);
 #if defined(CONFIG_ARCH_IQ80331)
 MACHINE_START(IQ80331, "Intel IQ80331")
        /* Maintainer: Intel Corp. */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = 0xfefff000,
        .io_pg_offst    = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
        .map_io         = iq80331_map_io,
@@ -208,7 +207,6 @@ MACHINE_END
 #elif defined(CONFIG_MACH_IQ80332)
 MACHINE_START(IQ80332, "Intel IQ80332")
        /* Maintainer: Intel Corp. */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = 0xfefff000,
        .io_pg_offst    = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
        .map_io         = iq80332_map_io,
index 6851aba..cfd5bef 100644 (file)
@@ -106,6 +106,16 @@ static struct map_desc ixp2000_io_desc[] __initdata = {
                .length         = IXP2000_MSF_SIZE,
                .type           = MT_IXP2000_DEVICE,
        }, {
+               .virtual        = IXP2000_SCRATCH_RING_VIRT_BASE,
+               .pfn            = __phys_to_pfn(IXP2000_SCRATCH_RING_PHYS_BASE),
+               .length         = IXP2000_SCRATCH_RING_SIZE,
+               .type           = MT_IXP2000_DEVICE,
+       }, {
+               .virtual        = IXP2000_SRAM0_VIRT_BASE,
+               .pfn            = __phys_to_pfn(IXP2000_SRAM0_PHYS_BASE),
+               .length         = IXP2000_SRAM0_SIZE,
+               .type           = MT_IXP2000_DEVICE,
+       }, {
                .virtual        = IXP2000_PCI_IO_VIRT_BASE,
                .pfn            = __phys_to_pfn(IXP2000_PCI_IO_PHYS_BASE),
                .length         = IXP2000_PCI_IO_SIZE,
index 61f6006..9e5a13b 100644 (file)
@@ -254,7 +254,6 @@ static void __init enp2611_init_machine(void)
 
 MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
-       .phys_ram       = 0x00000000,
        .phys_io        = IXP2000_UART_PHYS_BASE,
        .io_pg_offst    = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index fd280a9..7c78240 100644 (file)
@@ -169,7 +169,6 @@ void ixdp2400_init_irq(void)
 
 MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform")
        /* Maintainer: MontaVista Software, Inc. */
-       .phys_ram       = 0x00000000,
        .phys_io        = IXP2000_UART_PHYS_BASE,
        .io_pg_offst    = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index f9073aa..076e3f8 100644 (file)
@@ -285,7 +285,6 @@ void ixdp2800_init_irq(void)
 
 MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform")
        /* Maintainer: MontaVista Software, Inc. */
-       .phys_ram       = 0x00000000,
        .phys_io        = IXP2000_UART_PHYS_BASE,
        .io_pg_offst    = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index e6a882f..10f0660 100644 (file)
@@ -376,7 +376,6 @@ static void __init ixdp2x01_init_machine(void)
 #ifdef CONFIG_ARCH_IXDP2401
 MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform")
        /* Maintainer: MontaVista Software, Inc. */
-       .phys_ram       = 0x00000000,
        .phys_io        = IXP2000_UART_PHYS_BASE,
        .io_pg_offst    = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
@@ -390,7 +389,6 @@ MACHINE_END
 #ifdef CONFIG_ARCH_IXDP2801
 MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform")
        /* Maintainer: MontaVista Software, Inc. */
-       .phys_ram       = 0x00000000,
        .phys_io        = IXP2000_UART_PHYS_BASE,
        .io_pg_offst    = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index 679594a..13f8a7a 100644 (file)
@@ -101,7 +101,6 @@ static void __init coyote_init(void)
 #ifdef CONFIG_ARCH_ADI_COYOTE
 MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
        /* Maintainer: MontaVista Software, Inc. */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
        .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
        .map_io         = ixp4xx_map_io,
@@ -119,7 +118,6 @@ MACHINE_END
 #ifdef CONFIG_MACH_IXDPG425
 MACHINE_START(IXDPG425, "Intel IXDPG425")
        /* Maintainer: MontaVista Software, Inc. */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
        .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
        .map_io         = ixp4xx_map_io,
index 0386704..654e2ee 100644 (file)
@@ -142,7 +142,6 @@ static void __init gtwx5715_init(void)
 
 MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
        /* Maintainer: George Joseph */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = IXP4XX_UART2_BASE_PHYS,
        .io_pg_offst    = ((IXP4XX_UART2_BASE_VIRT) >> 18) & 0xfffc,
        .map_io         = ixp4xx_map_io,
index c2e105c..da72383 100644 (file)
@@ -121,7 +121,6 @@ static void __init ixdp425_init(void)
 #ifdef CONFIG_ARCH_IXDP425
 MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
        /* Maintainer: MontaVista Software, Inc. */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
        .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
        .map_io         = ixp4xx_map_io,
@@ -135,7 +134,6 @@ MACHINE_END
 #ifdef CONFIG_MACH_IXDP465
 MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
        /* Maintainer: MontaVista Software, Inc. */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
        .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
        .map_io         = ixp4xx_map_io,
@@ -149,7 +147,6 @@ MACHINE_END
 #ifdef CONFIG_ARCH_PRPMC1100
 MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
        /* Maintainer: MontaVista Software, Inc. */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
        .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
        .map_io         = ixp4xx_map_io,
@@ -169,7 +166,6 @@ MACHINE_END
 #ifdef CONFIG_ARCH_AVILA
 MACHINE_START(AVILA, "Gateworks Avila Network Platform")
        /* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
        .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
        .map_io         = ixp4xx_map_io,
index 49998a8..856d56f 100644 (file)
@@ -124,7 +124,6 @@ static void __init nas100d_init(void)
 
 MACHINE_START(NAS100D, "Iomega NAS 100d")
        /* Maintainer: www.nslu2-linux.org */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
        .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
        .boot_params    = 0x00000100,
index 289e94c..da9340a 100644 (file)
@@ -123,7 +123,6 @@ static void __init nslu2_init(void)
 
 MACHINE_START(NSLU2, "Linksys NSLU2")
        /* Maintainer: www.nslu2-linux.org */
-       .phys_ram       = PHYS_OFFSET,
        .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
        .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
        .boot_params    = 0x00000100,
index 03ed742..ac62643 100644 (file)
@@ -91,7 +91,6 @@ static void __init l7200_map_io(void)
 
 MACHINE_START(L7200, "LinkUp Systems L7200")
        /* Maintainer: Steve Hill / Scott McConnell */
-       .phys_ram       = 0xf0000000,
        .phys_io        = 0x80040000,
        .io_pg_offst    = ((0xd0000000) >> 18) & 0xfffc,
        .map_io         = l7200_map_io,
index 19f2fa2..2cccc27 100644 (file)
@@ -112,7 +112,6 @@ void __init lh7a40x_init_board_irq (void)
 
 MACHINE_START (KEV7A400, "Sharp KEV7a400")
        /* Maintainer: Marc Singer */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((io_p2v (0x80000000))>>18) & 0xfffc,
        .boot_params    = 0xc0000100,
index 4eb962f..12e2327 100644 (file)
@@ -317,7 +317,6 @@ lpd7a400_map_io(void)
 
 MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10")
        /* Maintainer: Marc Singer */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((io_p2v (0x80000000))>>18) & 0xfffc,
        .boot_params    = 0xc0000100,
@@ -333,7 +332,6 @@ MACHINE_END
 
 MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10")
        /* Maintainer: Marc Singer */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((io_p2v (0x80000000))>>18) & 0xfffc,
        .boot_params    = 0xc0000100,
index 4b292e9..bdc20b5 100644 (file)
@@ -109,7 +109,6 @@ static void __init omap_generic_map_io(void)
 
 MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
        /* Maintainer: Tony Lindgren <tony@atomide.com> */
-       .phys_ram       = 0x10000000,
        .phys_io        = 0xfff00000,
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
index a07e2c9..9533c36 100644 (file)
@@ -199,7 +199,6 @@ static void __init h2_map_io(void)
 
 MACHINE_START(OMAP_H2, "TI-H2")
        /* Maintainer: Imre Deak <imre.deak@nokia.com> */
-       .phys_ram       = 0x10000000,
        .phys_io        = 0xfff00000,
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
index 668e278..d665efc 100644 (file)
@@ -215,7 +215,6 @@ static void __init h3_map_io(void)
 
 MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
        /* Maintainer: Texas Instruments, Inc. */
-       .phys_ram       = 0x10000000,
        .phys_io        = 0xfff00000,
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
index 95f1ff3..652f37c 100644 (file)
@@ -303,7 +303,6 @@ static void __init innovator_map_io(void)
 
 MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
        /* Maintainer: MontaVista Software, Inc. */
-       .phys_ram       = 0x10000000,
        .phys_io        = 0xfff00000,
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
index 0448fa7..58f7839 100644 (file)
@@ -149,7 +149,6 @@ postcore_initcall(netstar_late_init);
 
 MACHINE_START(NETSTAR, "NetStar OMAP5910")
        /* Maintainer: Ladislav Michl <michl@2n.cz> */
-       .phys_ram       = 0x10000000,
        .phys_io        = 0xfff00000,
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
index e990e1b..e5d126e 100644 (file)
@@ -274,7 +274,6 @@ static void __init osk_map_io(void)
 
 MACHINE_START(OMAP_OSK, "TI-OSK")
        /* Maintainer: Dirk Behme <dirk.behme@de.bosch.com> */
-       .phys_ram       = 0x10000000,
        .phys_io        = 0xfff00000,
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
index 5c975eb..67fada2 100644 (file)
@@ -76,7 +76,6 @@ static void __init omap_generic_map_io(void)
 }
 
 MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
-       .phys_ram       = 0x10000000,
        .phys_io        = 0xfff00000,
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
index 92ff5dc..88708a0 100644 (file)
@@ -199,7 +199,6 @@ static void __init omap_perseus2_map_io(void)
 
 MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
        /* Maintainer: Kevin Hilman <kjh@hilman.org> */
-       .phys_ram       = 0x10000000,
        .phys_io        = 0xfff00000,
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
index 6f9a622..959b4b8 100644 (file)
@@ -281,7 +281,6 @@ EXPORT_SYMBOL(voiceblue_wdt_ping);
 
 MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
        /* Maintainer: Ladislav Michl <michl@2n.cz> */
-       .phys_ram       = 0x10000000,
        .phys_io        = 0xfff00000,
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
index c602e7a..b937123 100644 (file)
@@ -69,7 +69,6 @@ static void __init omap_generic_map_io(void)
 
 MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
        /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
-       .phys_ram       = 0x80000000,
        .phys_io        = 0x48000000,
        .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
index f255446..c3c35d4 100644 (file)
@@ -186,7 +186,6 @@ static void __init omap_h4_map_io(void)
 
 MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
        /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
-       .phys_ram       = 0x80000000,
        .phys_io        = 0x48000000,
        .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
index 5a7b873..7ffd2de 100644 (file)
@@ -342,7 +342,6 @@ static void __init fixup_corgi(struct machine_desc *desc,
 
 #ifdef CONFIG_MACH_CORGI
 MACHINE_START(CORGI, "SHARP Corgi")
-       .phys_ram       = 0xa0000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .fixup          = fixup_corgi,
@@ -355,7 +354,6 @@ MACHINE_END
 
 #ifdef CONFIG_MACH_SHEPHERD
 MACHINE_START(SHEPHERD, "SHARP Shepherd")
-       .phys_ram       = 0xa0000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .fixup          = fixup_corgi,
@@ -368,7 +366,6 @@ MACHINE_END
 
 #ifdef CONFIG_MACH_HUSKY
 MACHINE_START(HUSKY, "SHARP Husky")
-       .phys_ram       = 0xa0000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .fixup          = fixup_corgi,
index 7de159e..347b9de 100644 (file)
@@ -183,7 +183,6 @@ static void __init idp_map_io(void)
 
 MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
        /* Maintainer: Vibren Technologies */
-       .phys_ram       = 0xa0000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .map_io         = idp_map_io,
index b464bc8..3e26d7c 100644 (file)
@@ -437,7 +437,6 @@ static void __init lubbock_map_io(void)
 
 MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
        /* Maintainer: MontaVista Software Inc. */
-       .phys_ram       = 0xa0000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .map_io         = lubbock_map_io,
index 8da9d3e..d5bda60 100644 (file)
@@ -489,7 +489,6 @@ static void __init mainstone_map_io(void)
 
 MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
        /* Maintainer: MontaVista Software Inc. */
-       .phys_ram       = 0xa0000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .map_io         = mainstone_map_io,
index 663c950..911e6ff 100644 (file)
@@ -311,7 +311,6 @@ static void __init fixup_poodle(struct machine_desc *desc,
 }
 
 MACHINE_START(POODLE, "SHARP Poodle")
-       .phys_ram       = 0xa0000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .fixup          = fixup_poodle,
index a9eacc0..c094d99 100644 (file)
@@ -497,7 +497,6 @@ static void __init fixup_spitz(struct machine_desc *desc,
 
 #ifdef CONFIG_MACH_SPITZ
 MACHINE_START(SPITZ, "SHARP Spitz")
-       .phys_ram       = 0xa0000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .fixup          = fixup_spitz,
@@ -510,7 +509,6 @@ MACHINE_END
 
 #ifdef CONFIG_MACH_BORZOI
 MACHINE_START(BORZOI, "SHARP Borzoi")
-       .phys_ram       = 0xa0000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .fixup          = fixup_spitz,
@@ -523,7 +521,6 @@ MACHINE_END
 
 #ifdef CONFIG_MACH_AKITA
 MACHINE_START(AKITA, "SHARP Akita")
-       .phys_ram       = 0xa0000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .fixup          = fixup_spitz,
index e4f92ef..d168286 100644 (file)
@@ -295,7 +295,6 @@ static void __init fixup_tosa(struct machine_desc *desc,
 }
 
 MACHINE_START(TOSA, "SHARP Tosa")
-       .phys_ram       = 0xa0000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .fixup          = fixup_tosa,
index 1299768..17f5f44 100644 (file)
@@ -3,7 +3,6 @@ menu "RealView platform type"
 
 config MACH_REALVIEW_EB
        bool "Support RealView/EB platform"
-       default n
        select ARM_GIC
        help
          Include support for the ARM(R) RealView Emulation Baseboard platform.
index 112f759..d4a586e 100644 (file)
@@ -166,7 +166,6 @@ static void __init realview_eb_init(void)
 
 MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .phys_ram       = 0x00000000,
        .phys_io        = REALVIEW_UART0_BASE,
        .io_pg_offst    = (IO_ADDRESS(REALVIEW_UART0_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index 5c4ac1c..208a2b5 100644 (file)
@@ -177,7 +177,6 @@ extern struct sys_timer ioc_timer;
 
 MACHINE_START(RISCPC, "Acorn-RiscPC")
        /* Maintainer: Russell King */
-       .phys_ram       = 0x10000000,
        .phys_io        = 0x03000000,
        .io_pg_offst    = ((0xe0000000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
index 0f81fc0..3e327b8 100644 (file)
@@ -294,7 +294,6 @@ static void __init anubis_map_io(void)
 
 MACHINE_START(ANUBIS, "Simtec-Anubis")
        /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
-       .phys_ram       = S3C2410_SDRAM_PA,
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index 4d96271..995bb8a 100644 (file)
@@ -527,7 +527,6 @@ static void __init bast_init(void)
 
 MACHINE_START(BAST, "Simtec-BAST")
        /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
-       .phys_ram       = S3C2410_SDRAM_PA,
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index 0aa8760..1c316f1 100644 (file)
@@ -171,7 +171,6 @@ static void __init h1940_init(void)
 
 MACHINE_START(H1940, "IPAQ-H1940")
        /* Maintainer: Ben Dooks <ben@fluff.org> */
-       .phys_ram       = S3C2410_SDRAM_PA,
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index 378d640..116ac31 100644 (file)
@@ -128,7 +128,6 @@ MACHINE_START(N30, "Acer-N30")
        /* Maintainer: Christer Weinigel <christer@weinigel.se>,
                                Ben Dooks <ben-linux@fluff.org>
        */
-       .phys_ram       = S3C2410_SDRAM_PA,
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index 42b0eef..07d0950 100644 (file)
@@ -148,7 +148,6 @@ static void __init nexcoder_map_io(void)
 
 MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
        /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
-       .phys_ram       = S3C2410_SDRAM_PA,
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index a2eb9ed..b39daed 100644 (file)
@@ -116,7 +116,6 @@ static void __init otom11_map_io(void)
 
 MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
        /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
-       .phys_ram       = S3C2410_SDRAM_PA,
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index f8d86d1..0260ed5 100644 (file)
@@ -205,7 +205,6 @@ static void __init rx3715_init_machine(void)
 
 MACHINE_START(RX3715, "IPAQ-RX3715")
        /* Maintainer: Ben Dooks <ben@fluff.org> */
-       .phys_ram       = S3C2410_SDRAM_PA,
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index 2c91965..1e76e1f 100644 (file)
@@ -115,7 +115,6 @@ static void __init smdk2410_init_irq(void)
 MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
                                    * to SMDK2410 */
        /* Maintainer: Jonas Dietsche */
-       .phys_ram       = S3C2410_SDRAM_PA,
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index 4e31118..f431572 100644 (file)
@@ -216,7 +216,6 @@ static void __init smdk2440_machine_init(void)
 
 MACHINE_START(S3C2440, "SMDK2440")
        /* Maintainer: Ben Dooks <ben@fluff.org> */
-       .phys_ram       = S3C2410_SDRAM_PA,
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index ae7e099..785fc9c 100644 (file)
@@ -395,7 +395,6 @@ static void __init vr1000_map_io(void)
 
 MACHINE_START(VR1000, "Thorcom-VR1000")
        /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
-       .phys_ram       = S3C2410_SDRAM_PA,
        .phys_io        = S3C2410_PA_UART,
        .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
        .boot_params    = S3C2410_SDRAM_PA + 0x100,
index a66ac61..a599bb0 100644 (file)
@@ -447,7 +447,6 @@ static void __init assabet_map_io(void)
 
 
 MACHINE_START(ASSABET, "Intel-Assabet")
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index edccd5e..f60b7a6 100644 (file)
@@ -297,7 +297,6 @@ static void __init badge4_map_io(void)
 }
 
 MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index 5085937..8269a9e 100644 (file)
@@ -135,7 +135,6 @@ static void __init cerf_init(void)
 
 MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
        /* Maintainer: support@intrinsyc.com */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .map_io         = cerf_map_io,
index 522abc0..6888816 100644 (file)
@@ -191,7 +191,6 @@ static void __init collie_map_io(void)
 }
 
 MACHINE_START(COLLIE, "Sharp-Collie")
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .map_io         = collie_map_io,
index e8352b7..b04d922 100644 (file)
@@ -392,7 +392,6 @@ static void __init h3100_map_io(void)
 }
 
 MACHINE_START(H3100, "Compaq iPAQ H3100")
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
@@ -510,7 +509,6 @@ static void __init h3600_map_io(void)
 }
 
 MACHINE_START(H3600, "Compaq iPAQ H3600")
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
@@ -897,7 +895,6 @@ static void __init h3800_map_io(void)
 }
 
 MACHINE_START(H3800, "Compaq iPAQ H3800")
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index c922e04..046b213 100644 (file)
@@ -195,7 +195,6 @@ static void __init hackkit_init(void)
  */
 
 MACHINE_START(HACKKIT, "HackKit Cpu Board")
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index 2f671cc..17f5a43 100644 (file)
@@ -173,7 +173,6 @@ static void __init jornada720_mach_init(void)
 
 MACHINE_START(JORNADA720, "HP Jornada 720")
        /* Maintainer: Michael Gernoth <michael@gernoth.net> */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index 8c9e3dd..07d3a69 100644 (file)
@@ -60,7 +60,6 @@ static void __init lart_map_io(void)
 }
 
 MACHINE_START(LART, "LART")
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index 58c18f9..0709eba 100644 (file)
@@ -146,7 +146,6 @@ static void __init pleb_map_io(void)
 }
 
 MACHINE_START(PLEB, "PLEB")
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .map_io         = pleb_map_io,
index 7482288..5aafe0b 100644 (file)
@@ -83,7 +83,6 @@ static void __init shannon_map_io(void)
 }
 
 MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index 439ddc9..d2c23b2 100644 (file)
@@ -229,7 +229,6 @@ arch_initcall(simpad_init);
 
 MACHINE_START(SIMPAD, "Simpad")
        /* Maintainer: Holger Freyther */
-       .phys_ram       = 0xc0000000,
        .phys_io        = 0x80000000,
        .io_pg_offst    = ((0xf8000000) >> 18) & 0xfffc,
        .boot_params    = 0xc0000100,
index 2d428b6..877600e 100644 (file)
@@ -111,7 +111,6 @@ static struct sys_timer shark_timer = {
 
 MACHINE_START(SHARK, "Shark")
        /* Maintainer: Alexander Schulz */
-       .phys_ram       = 0x08000000,
        .phys_io        = 0x40000000,
        .io_pg_offst    = ((0xe0000000) >> 18) & 0xfffc,
        .boot_params    = 0x08003000,
index 8d787f4..95096af 100644 (file)
@@ -9,7 +9,6 @@ config ARCH_VERSATILE_PB
 
 config MACH_VERSATILE_AB
        bool "Support Versatile/AB platform"
-       default n
        help
          Include support for the ARM(R) Versatile/AP platform.
 
index 9002374..9ebbe80 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/leds.h>
 #include <asm/hardware/arm_timer.h>
 #include <asm/hardware/icst307.h>
+#include <asm/hardware/vic.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/flash.h>
 #define VA_VIC_BASE            __io_address(VERSATILE_VIC_BASE)
 #define VA_SIC_BASE            __io_address(VERSATILE_SIC_BASE)
 
-static void vic_mask_irq(unsigned int irq)
-{
-       irq -= IRQ_VIC_START;
-       writel(1 << irq, VA_VIC_BASE + VIC_IRQ_ENABLE_CLEAR);
-}
-
-static void vic_unmask_irq(unsigned int irq)
-{
-       irq -= IRQ_VIC_START;
-       writel(1 << irq, VA_VIC_BASE + VIC_IRQ_ENABLE);
-}
-
-static struct irqchip vic_chip = {
-       .ack    = vic_mask_irq,
-       .mask   = vic_mask_irq,
-       .unmask = vic_unmask_irq,
-};
-
 static void sic_mask_irq(unsigned int irq)
 {
        irq -= IRQ_SIC_START;
@@ -127,43 +110,12 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
 
 void __init versatile_init_irq(void)
 {
-       unsigned int i, value;
-
-       /* Disable all interrupts initially. */
+       unsigned int i;
 
-       writel(0, VA_VIC_BASE + VIC_INT_SELECT);
-       writel(0, VA_VIC_BASE + VIC_IRQ_ENABLE);
-       writel(~0, VA_VIC_BASE + VIC_IRQ_ENABLE_CLEAR);
-       writel(0, VA_VIC_BASE + VIC_IRQ_STATUS);
-       writel(0, VA_VIC_BASE + VIC_ITCR);
-       writel(~0, VA_VIC_BASE + VIC_IRQ_SOFT_CLEAR);
-
-       /*
-        * Make sure we clear all existing interrupts
-        */
-       writel(0, VA_VIC_BASE + VIC_VECT_ADDR);
-       for (i = 0; i < 19; i++) {
-               value = readl(VA_VIC_BASE + VIC_VECT_ADDR);
-               writel(value, VA_VIC_BASE + VIC_VECT_ADDR);
-       }
-
-       for (i = 0; i < 16; i++) {
-               value = readl(VA_VIC_BASE + VIC_VECT_CNTL0 + (i * 4));
-               writel(value | VICVectCntl_Enable | i, VA_VIC_BASE + VIC_VECT_CNTL0 + (i * 4));
-       }
-
-       writel(32, VA_VIC_BASE + VIC_DEF_VECT_ADDR);
-
-       for (i = IRQ_VIC_START; i <= IRQ_VIC_END; i++) {
-               if (i != IRQ_VICSOURCE31) {
-                       set_irq_chip(i, &vic_chip);
-                       set_irq_handler(i, do_level_IRQ);
-                       set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
-               }
-       }
+       vic_init(VA_VIC_BASE, ~(1 << 31));
 
        set_irq_handler(IRQ_VICSOURCE31, sic_handle_irq);
-       vic_unmask_irq(IRQ_VICSOURCE31);
+       enable_irq(IRQ_VICSOURCE31);
 
        /* Do second interrupt controller */
        writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR);
@@ -877,7 +829,7 @@ static unsigned long versatile_gettimeoffset(void)
        ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff;
        do {
                ticks1 = ticks2;
-               status = __raw_readl(VA_IC_BASE + VIC_IRQ_RAW_STATUS);
+               status = __raw_readl(VA_IC_BASE + VIC_RAW_STATUS);
                ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff;
        } while (ticks2 > ticks1);
 
index e74c8a2..1eb5967 100644 (file)
@@ -36,7 +36,6 @@
 
 MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .phys_ram       = 0x00000000,
        .phys_io        = 0x101f1000,
        .io_pg_offst    = ((0xf11f1000) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index 22d5ca0..f17ab4f 100644 (file)
@@ -100,7 +100,6 @@ arch_initcall(versatile_pb_init);
 
 MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .phys_ram       = 0x00000000,
        .phys_io        = 0x101f1000,
        .io_pg_offst    = ((0xf11f1000) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
index da4c616..28cd79a 100644 (file)
@@ -62,7 +62,7 @@ typedef union tagFPREG {
 #else
        u32 padding[3];
 #endif
-} FPREG;
+} __attribute__ ((packed,aligned(4))) FPREG;
 
 /*
  * FPA11 device model.
@@ -89,7 +89,7 @@ typedef struct tagFPA11 {
                                   so we can use it to detect whether this
                                   instance of the emulator needs to be
                                   initialised. */
-} FPA11;
+} __attribute__ ((packed,aligned(4))) FPA11;
 
 extern int8 SetRoundingMode(const unsigned int);
 extern int8 SetRoundingPrecision(const unsigned int);
index 9693e9b..0887bb2 100644 (file)
@@ -22,7 +22,6 @@ comment "OMAP Feature Selections"
 config OMAP_RESET_CLOCKS
        bool "Reset unused clocks during boot"
        depends on ARCH_OMAP
-       default n
        help
          Say Y if you want to reset unused clocks during boot.
          This option saves power, but assumes all drivers are
@@ -44,7 +43,6 @@ config OMAP_MUX
 config OMAP_MUX_DEBUG
        bool "Multiplexing debug output"
         depends on OMAP_MUX
-        default n
         help
           Makes the multiplexing functions print out a lot of debug info.
           This is useful if you want to find out the correct values of the
@@ -93,7 +91,6 @@ config OMAP_32K_TIMER_HZ
 
 config OMAP_DM_TIMER
        bool "Use dual-mode timer"
-       default n
        depends on ARCH_OMAP16XX
        help
         Select this option if you want to use OMAP Dual-Mode timers.
index d5d0df7..cbde675 100644 (file)
@@ -702,6 +702,15 @@ config PHYSICAL_START
 
          Don't change this unless you know what you are doing.
 
+config HOTPLUG_CPU
+       bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
+       depends on SMP && HOTPLUG && EXPERIMENTAL
+       ---help---
+         Say Y here to experiment with turning CPUs off and on.  CPUs
+         can be controlled through /sys/devices/system/cpu.
+
+         Say N.
+
 endmenu
 
 
@@ -988,15 +997,6 @@ config SCx200
          This support is also available as a module.  If compiled as a
          module, it will be called scx200.
 
-config HOTPLUG_CPU
-       bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
-       depends on SMP && HOTPLUG && EXPERIMENTAL
-       ---help---
-         Say Y here to experiment with turning CPUs off and on.  CPUs
-         can be controlled through /sys/devices/system/cpu.
-
-         Say N.
-
 source "drivers/pcmcia/Kconfig"
 
 source "drivers/pci/hotplug/Kconfig"
index d3c0409..bd2d53a 100644 (file)
@@ -42,9 +42,9 @@ include $(srctree)/arch/i386/Makefile.cpu
 cflags-$(CONFIG_REGPARM) += $(shell if [ $(call cc-version) -ge 0300 ] ; then \
                             echo "-mregparm=3"; fi ;)
 
-# Disable unit-at-a-time mode, it makes gcc use a lot more stack
-# due to the lack of sharing of stacklots.
-CFLAGS += $(call cc-option,-fno-unit-at-a-time)
+# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
+# a lot more stack due to the lack of sharing of stacklots:
+CFLAGS                         += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;)
 
 CFLAGS += $(cflags-y)
 
index b9f0030..0aaebf3 100644 (file)
@@ -112,33 +112,38 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
                p < (void *)tinfo + THREAD_SIZE - 3;
 }
 
+static void print_addr_and_symbol(unsigned long addr, char *log_lvl)
+{
+       printk(log_lvl);
+       printk(" [<%08lx>] ", addr);
+       print_symbol("%s", addr);
+       printk("\n");
+}
+
 static inline unsigned long print_context_stack(struct thread_info *tinfo,
-                               unsigned long *stack, unsigned long ebp)
+                               unsigned long *stack, unsigned long ebp,
+                               char *log_lvl)
 {
        unsigned long addr;
 
 #ifdef CONFIG_FRAME_POINTER
        while (valid_stack_ptr(tinfo, (void *)ebp)) {
                addr = *(unsigned long *)(ebp + 4);
-               printk(KERN_EMERG " [<%08lx>] ", addr);
-               print_symbol("%s", addr);
-               printk("\n");
+               print_addr_and_symbol(addr, log_lvl);
                ebp = *(unsigned long *)ebp;
        }
 #else
        while (valid_stack_ptr(tinfo, stack)) {
                addr = *stack++;
-               if (__kernel_text_address(addr)) {
-                       printk(KERN_EMERG " [<%08lx>]", addr);
-                       print_symbol(" %s", addr);
-                       printk("\n");
-               }
+               if (__kernel_text_address(addr))
+                       print_addr_and_symbol(addr, log_lvl);
        }
 #endif
        return ebp;
 }
 
-void show_trace(struct task_struct *task, unsigned long * stack)
+static void show_trace_log_lvl(struct task_struct *task,
+                              unsigned long *stack, char *log_lvl)
 {
        unsigned long ebp;
 
@@ -157,7 +162,7 @@ void show_trace(struct task_struct *task, unsigned long * stack)
                struct thread_info *context;
                context = (struct thread_info *)
                        ((unsigned long)stack & (~(THREAD_SIZE - 1)));
-               ebp = print_context_stack(context, stack, ebp);
+               ebp = print_context_stack(context, stack, ebp, log_lvl);
                stack = (unsigned long*)context->previous_esp;
                if (!stack)
                        break;
@@ -165,7 +170,13 @@ void show_trace(struct task_struct *task, unsigned long * stack)
        }
 }
 
-void show_stack(struct task_struct *task, unsigned long *esp)
+void show_trace(struct task_struct *task, unsigned long * stack)
+{
+       show_trace_log_lvl(task, stack, "");
+}
+
+static void show_stack_log_lvl(struct task_struct *task, unsigned long *esp,
+                              char *log_lvl)
 {
        unsigned long *stack;
        int i;
@@ -178,16 +189,26 @@ void show_stack(struct task_struct *task, unsigned long *esp)
        }
 
        stack = esp;
-       printk(KERN_EMERG);
+       printk(log_lvl);
        for(i = 0; i < kstack_depth_to_print; i++) {
                if (kstack_end(stack))
                        break;
-               if (i && ((i % 8) == 0))
-                       printk("\n" KERN_EMERG "       ");
+               if (i && ((i % 8) == 0)) {
+                       printk("\n");
+                       printk(log_lvl);
+                       printk("       ");
+               }
                printk("%08lx ", *stack++);
        }
-       printk("\n" KERN_EMERG "Call Trace:\n");
-       show_trace(task, esp);
+       printk("\n");
+       printk(log_lvl);
+       printk("Call Trace:\n");
+       show_trace_log_lvl(task, esp, log_lvl);
+}
+
+void show_stack(struct task_struct *task, unsigned long *esp)
+{
+       show_stack_log_lvl(task, esp, "");
 }
 
 /*
@@ -238,7 +259,7 @@ void show_registers(struct pt_regs *regs)
                u8 __user *eip;
 
                printk("\n" KERN_EMERG "Stack: ");
-               show_stack(NULL, (unsigned long*)esp);
+               show_stack_log_lvl(NULL, (unsigned long *)esp, KERN_EMERG);
 
                printk(KERN_EMERG "Code: ");
 
index 65f6707..83c3645 100644 (file)
@@ -449,3 +449,19 @@ static void __devinit pci_post_fixup_toshiba_ohci1394(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_TI, 0x8032,
                         pci_post_fixup_toshiba_ohci1394);
+
+
+/*
+ * Prevent the BIOS trapping accesses to the Cyrix CS5530A video device
+ * configuration space.
+ */
+static void __devinit pci_early_fixup_cyrix_5530(struct pci_dev *dev)
+{
+       u8 r;
+       /* clear 'F4 Video Configuration Trap' bit */
+       pci_read_config_byte(dev, 0x42, &r);
+       r &= 0xfd;
+       pci_write_config_byte(dev, 0x42, r);
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY,
+                       pci_early_fixup_cyrix_5530);
index 80f8663..1d07d80 100644 (file)
@@ -701,6 +701,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_SERIAL_SGI_L1_CONSOLE=y
 # CONFIG_SERIAL_JSM is not set
 CONFIG_SERIAL_SGI_IOC4=y
+CONFIG_SERIAL_SGI_IOC3=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -1046,6 +1047,7 @@ CONFIG_INFINIBAND_IPOIB=m
 # SN Devices
 #
 CONFIG_SGI_IOC4=y
+CONFIG_SGI_IOC3=y
 
 #
 # File systems
index ff8bb37..3cb503b 100644 (file)
@@ -659,6 +659,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_SERIAL_SGI_L1_CONSOLE=y
 # CONFIG_SERIAL_JSM is not set
 CONFIG_SERIAL_SGI_IOC4=y
+CONFIG_SERIAL_SGI_IOC3=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -899,6 +900,7 @@ CONFIG_INFINIBAND_SRP=m
 # SN Devices
 #
 CONFIG_SGI_IOC4=y
+CONFIG_SGI_IOC3=y
 
 #
 # File systems
index 01feed0..df338c5 100644 (file)
@@ -78,17 +78,6 @@ config PPC_UDBG_16550
        bool
        default n
 
-config CRASH_DUMP
-       bool "kernel crash dumps (EXPERIMENTAL)"
-       depends on PPC_MULTIPLATFORM
-       depends on EXPERIMENTAL
-       help
-         Build a kernel suitable for use as a kdump capture kernel.
-         The kernel will be linked at a different address than normal, and
-         so can only be used for Kdump.
-
-         Don't change this unless you know what you are doing.
-
 config GENERIC_TBSYNC
        bool
        default y if PPC32 && SMP
@@ -584,6 +573,16 @@ config KEXEC
          support.  As of this writing the exact hardware interface is
          strongly in flux, so no good recommendation can be made.
 
+config CRASH_DUMP
+       bool "kernel crash dumps (EXPERIMENTAL)"
+       depends on PPC_MULTIPLATFORM && PPC64 && EXPERIMENTAL
+       help
+         Build a kernel suitable for use as a kdump capture kernel.
+         The kernel will be linked at a different address than normal, and
+         so can only be used for Kdump.
+
+         Don't change this unless you know what you are doing.
+
 config EMBEDDEDBOOT
        bool
        depends on 8xx || 8260
index 788dec4..840ae59 100644 (file)
@@ -27,6 +27,7 @@ BOOTCFLAGS    := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \
 BOOTAFLAGS     := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
 OBJCOPYFLAGS    := contents,alloc,load,readonly,data
 OBJCOPY_COFF_ARGS := -O aixcoff-rs6000 --set-start 0x500000
+OBJCOPY_MIB_ARGS  := -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
 
 zlib       := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c
 zlibheader := infblock.h infcodes.h inffast.h inftrees.h infutil.h
@@ -90,11 +91,11 @@ gz-sec  = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section)))
 hostprogs-y            := addnote addRamDisk hack-coff
 
 targets += zImage.vmode zImage.initrd.vmode zImage zImage.initrd \
-          zImage.coff zImage.initrd.coff \
+          zImage.coff zImage.initrd.coff miboot.image miboot.initrd.image \
           $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \
           $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \
           $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \
-          vmlinux.initrd
+          vmlinux.initrd dummy.o
 extra-y                        := initrd.o
 
 quiet_cmd_ramdisk = RAMDISK $@
@@ -116,6 +117,10 @@ quiet_cmd_addsection = ADDSEC  $@
 quiet_cmd_addnote = ADDNOTE $@
       cmd_addnote = $(obj)/addnote $@
 
+quiet_cmd_gen-miboot = GEN     $@
+      cmd_gen-miboot = $(OBJCOPY) $(OBJCOPY_MIB_ARGS) \
+                      --add-section=$1=$(word 2, $^) $< $@
+
 quiet_cmd_gencoff = COFF    $@
       cmd_gencoff = $(OBJCOPY) $(OBJCOPY_COFF_ARGS) $@ && \
                    $(obj)/hack-coff $@
@@ -141,19 +146,25 @@ $(obj)/zImage.initrd.vmode $(obj)/zImage.initrd.coff: obj-boot += $(call obj-sec
 $(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(srctree)/$(src)/zImage.lds
        $(call cmd,bootld,$(obj-boot),zImage.lds)
 
-# For 32-bit powermacs, build the COFF images as well as the ELF images.
+# For 32-bit powermacs, build the COFF and miboot images
+# as well as the ELF images.
 coffimage-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.coff
 coffrdimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/zImage.initrd.coff
+mibootimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32) := $(obj)/miboot.image
+mibrdimg-$(CONFIG_PPC_PMAC)-$(CONFIG_PPC32)  := $(obj)/miboot.initrd.image
 
-$(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote $(coffimage-y-y)
+$(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote $(coffimage-y-y) \
+                       $(mibootimg-y-y)
        @cp -f $< $@
        $(call if_changed,addnote)
 
-$(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote $(coffrdimg-y-y)
+$(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote \
+                       $(coffrdimg-y-y) $(mibrdimg-y-y)
        @cp -f $< $@
        $(call if_changed,addnote)
 
-$(obj)/zImage.coff: $(call obj-sec, $(required)) $(obj-boot) $(srctree)/$(src)/zImage.coff.lds $(obj)/hack-coff
+$(obj)/zImage.coff: $(call obj-sec, $(required)) $(obj-boot) \
+                       $(srctree)/$(src)/zImage.coff.lds $(obj)/hack-coff
        $(call cmd,bootld,$(obj-boot),zImage.coff.lds)
        $(call cmd,gencoff)
 
@@ -162,6 +173,12 @@ $(obj)/zImage.initrd.coff: $(call obj-sec, $(required) $(initrd)) $(obj-boot) \
        $(call cmd,bootld,$(obj-boot),zImage.coff.lds)
        $(call cmd,gencoff)
 
+$(obj)/miboot.image: $(obj)/dummy.o $(obj)/vmlinux.gz
+       $(call cmd,gen-miboot,image)
+
+$(obj)/miboot.initrd.image: $(obj)/miboot.image $(images)/ramdisk.image.gz
+       $(call cmd,gen-miboot,initrd)
+
 #-----------------------------------------------------------
 # build u-boot images
 #-----------------------------------------------------------
diff --git a/arch/powerpc/boot/dummy.c b/arch/powerpc/boot/dummy.c
new file mode 100644 (file)
index 0000000..31dbf45
--- /dev/null
@@ -0,0 +1,4 @@
+int main(void)
+{
+       return 0;
+}
index 398203b..2ace57d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.15-rc5
-# Tue Dec 13 17:24:05 2005
+# Linux kernel version: 2.6.15
+# Sat Jan 14 16:26:08 2006
 #
 # CONFIG_PPC64 is not set
 CONFIG_PPC32=y
@@ -15,11 +15,15 @@ CONFIG_EARLY_PRINTK=y
 CONFIG_GENERIC_NVRAM=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+# CONFIG_PPC_UDBG_16550 is not set
+# CONFIG_CRASH_DUMP is not set
+# CONFIG_GENERIC_TBSYNC is not set
 
 #
 # Processor support
 #
-CONFIG_6xx=y
+CONFIG_CLASSIC32=y
 # CONFIG_PPC_52xx is not set
 # CONFIG_PPC_82xx is not set
 # CONFIG_PPC_83xx is not set
@@ -28,6 +32,7 @@ CONFIG_6xx=y
 # CONFIG_8xx is not set
 # CONFIG_E200 is not set
 # CONFIG_E500 is not set
+CONFIG_6xx=y
 CONFIG_PPC_FPU=y
 CONFIG_ALTIVEC=y
 CONFIG_PPC_STD_MMU=y
@@ -53,17 +58,18 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
@@ -72,8 +78,10 @@ CONFIG_CC_ALIGN_FUNCTIONS=0
 CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LOOPS=0
 CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -113,13 +121,10 @@ CONFIG_PPC_MULTIPLATFORM=y
 # CONFIG_APUS is not set
 # CONFIG_PPC_CHRP is not set
 CONFIG_PPC_PMAC=y
-CONFIG_PPC_OF=y
 CONFIG_MPIC=y
 # CONFIG_PPC_RTAS is not set
 # CONFIG_MMIO_NVRAM is not set
-# CONFIG_CRASH_DUMP is not set
 CONFIG_PPC_MPC106=y
-# CONFIG_GENERIC_TBSYNC is not set
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_TABLE=y
 # CONFIG_CPU_FREQ_DEBUG is not set
@@ -195,6 +200,11 @@ CONFIG_CARDBUS=y
 # PC-card bridges
 #
 CONFIG_YENTA=m
+CONFIG_YENTA_O2=y
+CONFIG_YENTA_RICOH=y
+CONFIG_YENTA_TI=y
+CONFIG_YENTA_ENE_TUNE=y
+CONFIG_YENTA_TOSHIBA=y
 # CONFIG_PD6729 is not set
 # CONFIG_I82092 is not set
 CONFIG_PCCARD_NONSTATIC=m
@@ -464,7 +474,7 @@ CONFIG_IEEE80211_CRYPT_TKIP=m
 #
 # CONFIG_STANDALONE is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
-CONFIG_FW_LOADER=m
+CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
 
 #
@@ -491,7 +501,7 @@ CONFIG_PROC_EVENTS=y
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
-CONFIG_MAC_FLOPPY=y
+CONFIG_MAC_FLOPPY=m
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
@@ -603,7 +613,7 @@ CONFIG_SCSI_CONSTANTS=y
 # SCSI Transport Attributes
 #
 CONFIG_SCSI_SPI_ATTRS=y
-# CONFIG_SCSI_FC_ATTRS is not set
+CONFIG_SCSI_FC_ATTRS=y
 # CONFIG_SCSI_ISCSI_ATTRS is not set
 # CONFIG_SCSI_SAS_ATTRS is not set
 
@@ -645,12 +655,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
 CONFIG_SCSI_QLA2XXX=y
-# CONFIG_SCSI_QLA21XX is not set
-# CONFIG_SCSI_QLA22XX is not set
-# CONFIG_SCSI_QLA2300 is not set
-# CONFIG_SCSI_QLA2322 is not set
-# CONFIG_SCSI_QLA6312 is not set
-# CONFIG_SCSI_QLA24XX is not set
+# CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE is not set
 # CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -658,7 +663,7 @@ CONFIG_SCSI_QLA2XXX=y
 # CONFIG_SCSI_DEBUG is not set
 CONFIG_SCSI_MESH=y
 CONFIG_SCSI_MESH_SYNC_RATE=5
-CONFIG_SCSI_MESH_RESET_DELAY_MS=1000
+CONFIG_SCSI_MESH_RESET_DELAY_MS=4000
 CONFIG_SCSI_MAC53C94=y
 
 #
@@ -727,7 +732,6 @@ CONFIG_IEEE1394_SBP2=m
 CONFIG_IEEE1394_ETH1394=m
 CONFIG_IEEE1394_DV1394=m
 CONFIG_IEEE1394_RAWIO=m
-# CONFIG_IEEE1394_CMP is not set
 
 #
 # I2O device support
@@ -740,7 +744,7 @@ CONFIG_IEEE1394_RAWIO=m
 CONFIG_ADB=y
 CONFIG_ADB_CUDA=y
 CONFIG_ADB_PMU=y
-CONFIG_PMAC_APM_EMU=y
+CONFIG_PMAC_APM_EMU=m
 CONFIG_PMAC_MEDIABAY=y
 CONFIG_PMAC_BACKLIGHT=y
 CONFIG_INPUT_ADBHID=y
@@ -819,6 +823,7 @@ CONFIG_PCNET32=y
 # CONFIG_R8169 is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 # CONFIG_TIGON3 is not set
@@ -978,14 +983,14 @@ CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_8250=m
 # CONFIG_SERIAL_8250_CS is not set
 CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
 # Non-8250 serial port support
 #
 CONFIG_SERIAL_CORE=m
-# CONFIG_SERIAL_PMACZILOG is not set
-# CONFIG_SERIAL_JSM is not set
+CONFIG_SERIAL_PMACZILOG=m
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -1058,7 +1063,7 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_I801 is not set
 # CONFIG_I2C_I810 is not set
 # CONFIG_I2C_PIIX4 is not set
-CONFIG_I2C_KEYWEST=m
+CONFIG_I2C_POWERMAC=y
 # CONFIG_I2C_MPC is not set
 # CONFIG_I2C_NFORCE2 is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
@@ -1160,7 +1165,6 @@ CONFIG_FB_ATY128=y
 CONFIG_FB_ATY=y
 CONFIG_FB_ATY_CT=y
 # CONFIG_FB_ATY_GENERIC_LCD is not set
-# CONFIG_FB_ATY_XL_INIT is not set
 CONFIG_FB_ATY_GX=y
 # CONFIG_FB_SAVAGE is not set
 # CONFIG_FB_SIS is not set
@@ -1169,7 +1173,6 @@ CONFIG_FB_ATY_GX=y
 CONFIG_FB_3DFX=y
 # CONFIG_FB_3DFX_ACCEL is not set
 # CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_CYBLA is not set
 # CONFIG_FB_TRIDENT is not set
 # CONFIG_FB_VIRTUAL is not set
 
@@ -1214,9 +1217,10 @@ CONFIG_SND_OSSEMUL=y
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
 # CONFIG_SND_VERBOSE_PRINTK is not set
 # CONFIG_SND_DEBUG is not set
-CONFIG_SND_GENERIC_DRIVER=y
 
 #
 # Generic devices
@@ -1230,6 +1234,8 @@ CONFIG_SND_DUMMY=m
 #
 # PCI devices
 #
+# CONFIG_SND_AD1889 is not set
+# CONFIG_SND_ALS4000 is not set
 # CONFIG_SND_ALI5451 is not set
 # CONFIG_SND_ATIIXP is not set
 # CONFIG_SND_ATIIXP_MODEM is not set
@@ -1238,45 +1244,44 @@ CONFIG_SND_DUMMY=m
 # CONFIG_SND_AU8830 is not set
 # CONFIG_SND_AZT3328 is not set
 # CONFIG_SND_BT87X is not set
-# CONFIG_SND_CS46XX is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
 # CONFIG_SND_CS4281 is not set
+# CONFIG_SND_CS46XX is not set
 # CONFIG_SND_EMU10K1 is not set
 # CONFIG_SND_EMU10K1X is not set
-# CONFIG_SND_CA0106 is not set
-# CONFIG_SND_KORG1212 is not set
-# CONFIG_SND_MIXART is not set
-# CONFIG_SND_NM256 is not set
-# CONFIG_SND_RME32 is not set
-# CONFIG_SND_RME96 is not set
-# CONFIG_SND_RME9652 is not set
-# CONFIG_SND_HDSP is not set
-# CONFIG_SND_HDSPM is not set
-# CONFIG_SND_TRIDENT is not set
-# CONFIG_SND_YMFPCI is not set
-# CONFIG_SND_AD1889 is not set
-# CONFIG_SND_ALS4000 is not set
-# CONFIG_SND_CMIPCI is not set
 # CONFIG_SND_ENS1370 is not set
 # CONFIG_SND_ENS1371 is not set
 # CONFIG_SND_ES1938 is not set
 # CONFIG_SND_ES1968 is not set
-# CONFIG_SND_MAESTRO3 is not set
 # CONFIG_SND_FM801 is not set
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
 # CONFIG_SND_ICE1712 is not set
 # CONFIG_SND_ICE1724 is not set
 # CONFIG_SND_INTEL8X0 is not set
 # CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_PCXHR is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
 # CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
 # CONFIG_SND_VIA82XX is not set
 # CONFIG_SND_VIA82XX_MODEM is not set
 # CONFIG_SND_VX222 is not set
-# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_YMFPCI is not set
 
 #
 # ALSA PowerMac devices
 #
 CONFIG_SND_POWERMAC=m
-# CONFIG_SND_POWERMAC_AUTO_DRC is not set
+CONFIG_SND_POWERMAC_AUTO_DRC=y
 
 #
 # USB devices
@@ -1336,6 +1341,7 @@ CONFIG_USB_PRINTER=m
 # may also be needed; see USB_STORAGE Help for more information
 #
 # CONFIG_USB_STORAGE is not set
+# CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Input Devices
@@ -1355,6 +1361,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_YEALINK is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 CONFIG_USB_APPLETOUCH=y
 
@@ -1501,6 +1508,7 @@ CONFIG_FS_MBCACHE=y
 # CONFIG_JFS_FS is not set
 # CONFIG_FS_POSIX_ACL is not set
 # CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
@@ -1540,6 +1548,7 @@ CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
 CONFIG_RELAYFS_FS=m
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -1670,12 +1679,13 @@ CONFIG_OPROFILE=y
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
-CONFIG_DEBUG_KERNEL=y
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_MUTEXES is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_KOBJECT is not set
@@ -1688,6 +1698,11 @@ CONFIG_XMON=y
 CONFIG_XMON_DEFAULT=y
 # CONFIG_BDI_SWITCH is not set
 CONFIG_BOOTX_TEXT=y
+# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
+# CONFIG_PPC_EARLY_DEBUG_G5 is not set
+# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
+# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
+# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
 
 #
 # Security options
index a94699d..c287980 100644 (file)
@@ -60,7 +60,8 @@ obj-$(CONFIG_MODULES)         += $(module-y)
 
 pci64-$(CONFIG_PPC64)          += pci_64.o pci_dn.o pci_iommu.o \
                                   pci_direct_iommu.o iomap.o
-obj-$(CONFIG_PCI)              += $(pci64-y)
+pci32-$(CONFIG_PPC32)          := pci_32.o
+obj-$(CONFIG_PCI)              += $(pci64-y) $(pci32-y)
 kexec-$(CONFIG_PPC64)          := machine_kexec_64.o crash.o
 kexec-$(CONFIG_PPC32)          := machine_kexec_32.o
 obj-$(CONFIG_KEXEC)            += machine_kexec.o $(kexec-y)
index 5f248e3..8c21d37 100644 (file)
@@ -84,7 +84,10 @@ static void crash_save_this_cpu(struct pt_regs *regs, int cpu)
         * squirrelled away.  ELF notes happen to provide
         * all of that that no need to invent something new.
         */
-       buf = &crash_notes[cpu][0];
+       buf = (u32*)per_cpu_ptr(crash_notes, cpu);
+       if (!buf) 
+               return;
+
        memset(&prstatus, 0, sizeof(prstatus));
        prstatus.pr_pid = current->pid;
        elf_core_copy_regs(&prstatus.pr_reg, regs);
@@ -93,76 +96,6 @@ static void crash_save_this_cpu(struct pt_regs *regs, int cpu)
        final_note(buf);
 }
 
-/* FIXME Merge this with xmon_save_regs ?? */
-static inline void crash_get_current_regs(struct pt_regs *regs)
-{
-       unsigned long tmp1, tmp2;
-
-       __asm__ __volatile__ (
-               "std    0,0(%2)\n"
-               "std    1,8(%2)\n"
-               "std    2,16(%2)\n"
-               "std    3,24(%2)\n"
-               "std    4,32(%2)\n"
-               "std    5,40(%2)\n"
-               "std    6,48(%2)\n"
-               "std    7,56(%2)\n"
-               "std    8,64(%2)\n"
-               "std    9,72(%2)\n"
-               "std    10,80(%2)\n"
-               "std    11,88(%2)\n"
-               "std    12,96(%2)\n"
-               "std    13,104(%2)\n"
-               "std    14,112(%2)\n"
-               "std    15,120(%2)\n"
-               "std    16,128(%2)\n"
-               "std    17,136(%2)\n"
-               "std    18,144(%2)\n"
-               "std    19,152(%2)\n"
-               "std    20,160(%2)\n"
-               "std    21,168(%2)\n"
-               "std    22,176(%2)\n"
-               "std    23,184(%2)\n"
-               "std    24,192(%2)\n"
-               "std    25,200(%2)\n"
-               "std    26,208(%2)\n"
-               "std    27,216(%2)\n"
-               "std    28,224(%2)\n"
-               "std    29,232(%2)\n"
-               "std    30,240(%2)\n"
-               "std    31,248(%2)\n"
-               "mfmsr  %0\n"
-               "std    %0, 264(%2)\n"
-               "mfctr  %0\n"
-               "std    %0, 280(%2)\n"
-               "mflr   %0\n"
-               "std    %0, 288(%2)\n"
-               "bl     1f\n"
-       "1:      mflr   %1\n"
-               "std    %1, 256(%2)\n"
-               "mtlr   %0\n"
-               "mfxer  %0\n"
-               "std    %0, 296(%2)\n"
-               : "=&r" (tmp1), "=&r" (tmp2)
-               : "b" (regs));
-}
-
-/* We may have saved_regs from where the error came from
- * or it is NULL if via a direct panic().
- */
-static void crash_save_self(struct pt_regs *saved_regs)
-{
-       struct pt_regs regs;
-       int cpu;
-
-       cpu = smp_processor_id();
-       if (saved_regs)
-               memcpy(&regs, saved_regs, sizeof(regs));
-       else
-               crash_get_current_regs(&regs);
-       crash_save_this_cpu(&regs, cpu);
-}
-
 #ifdef CONFIG_SMP
 static atomic_t waiting_for_crash_ipi;
 
@@ -260,5 +193,5 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
         */
        crashing_cpu = smp_processor_id();
        crash_kexec_prepare_cpus();
-       crash_save_self(regs);
+       crash_save_this_cpu(regs, crashing_cpu);
 }
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
new file mode 100644 (file)
index 0000000..704c846
--- /dev/null
@@ -0,0 +1,1897 @@
+/*
+ * Common pmac/prep/chrp pci routines. -- Cort
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/delay.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/capability.h>
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/bootmem.h>
+
+#include <asm/processor.h>
+#include <asm/io.h>
+#include <asm/prom.h>
+#include <asm/sections.h>
+#include <asm/pci-bridge.h>
+#include <asm/byteorder.h>
+#include <asm/irq.h>
+#include <asm/uaccess.h>
+#include <asm/machdep.h>
+
+#undef DEBUG
+
+#ifdef DEBUG
+#define DBG(x...) printk(x)
+#else
+#define DBG(x...)
+#endif
+
+unsigned long isa_io_base     = 0;
+unsigned long isa_mem_base    = 0;
+unsigned long pci_dram_offset = 0;
+int pcibios_assign_bus_offset = 1;
+
+void pcibios_make_OF_bus_map(void);
+
+static int pci_relocate_bridge_resource(struct pci_bus *bus, int i);
+static int probe_resource(struct pci_bus *parent, struct resource *pr,
+                         struct resource *res, struct resource **conflict);
+static void update_bridge_base(struct pci_bus *bus, int i);
+static void pcibios_fixup_resources(struct pci_dev* dev);
+static void fixup_broken_pcnet32(struct pci_dev* dev);
+static int reparent_resources(struct resource *parent, struct resource *res);
+static void fixup_cpc710_pci64(struct pci_dev* dev);
+#ifdef CONFIG_PPC_OF
+static u8* pci_to_OF_bus_map;
+#endif
+
+/* By default, we don't re-assign bus numbers. We do this only on
+ * some pmacs
+ */
+int pci_assign_all_buses;
+
+struct pci_controller* hose_head;
+struct pci_controller** hose_tail = &hose_head;
+
+static int pci_bus_count;
+
+static void
+fixup_broken_pcnet32(struct pci_dev* dev)
+{
+       if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
+               dev->vendor = PCI_VENDOR_ID_AMD;
+               pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
+       }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT,        PCI_ANY_ID,                     fixup_broken_pcnet32);
+
+static void
+fixup_cpc710_pci64(struct pci_dev* dev)
+{
+       /* Hide the PCI64 BARs from the kernel as their content doesn't
+        * fit well in the resource management
+        */
+       dev->resource[0].start = dev->resource[0].end = 0;
+       dev->resource[0].flags = 0;
+       dev->resource[1].start = dev->resource[1].end = 0;
+       dev->resource[1].flags = 0;
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,    PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64);
+
+static void
+pcibios_fixup_resources(struct pci_dev *dev)
+{
+       struct pci_controller* hose = (struct pci_controller *)dev->sysdata;
+       int i;
+       unsigned long offset;
+
+       if (!hose) {
+               printk(KERN_ERR "No hose for PCI dev %s!\n", pci_name(dev));
+               return;
+       }
+       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+               struct resource *res = dev->resource + i;
+               if (!res->flags)
+                       continue;
+               if (res->end == 0xffffffff) {
+                       DBG("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n",
+                           pci_name(dev), i, res->start, res->end);
+                       res->end -= res->start;
+                       res->start = 0;
+                       res->flags |= IORESOURCE_UNSET;
+                       continue;
+               }
+               offset = 0;
+               if (res->flags & IORESOURCE_MEM) {
+                       offset = hose->pci_mem_offset;
+               } else if (res->flags & IORESOURCE_IO) {
+                       offset = (unsigned long) hose->io_base_virt
+                               - isa_io_base;
+               }
+               if (offset != 0) {
+                       res->start += offset;
+                       res->end += offset;
+#ifdef DEBUG
+                       printk("Fixup res %d (%lx) of dev %s: %lx -> %lx\n",
+                              i, res->flags, pci_name(dev),
+                              res->start - offset, res->start);
+#endif
+               }
+       }
+
+       /* Call machine specific resource fixup */
+       if (ppc_md.pcibios_fixup_resources)
+               ppc_md.pcibios_fixup_resources(dev);
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID,           PCI_ANY_ID,                     pcibios_fixup_resources);
+
+void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
+                       struct resource *res)
+{
+       unsigned long offset = 0;
+       struct pci_controller *hose = dev->sysdata;
+
+       if (hose && res->flags & IORESOURCE_IO)
+               offset = (unsigned long)hose->io_base_virt - isa_io_base;
+       else if (hose && res->flags & IORESOURCE_MEM)
+               offset = hose->pci_mem_offset;
+       region->start = res->start - offset;
+       region->end = res->end - offset;
+}
+EXPORT_SYMBOL(pcibios_resource_to_bus);
+
+void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
+                            struct pci_bus_region *region)
+{
+       unsigned long offset = 0;
+       struct pci_controller *hose = dev->sysdata;
+
+       if (hose && res->flags & IORESOURCE_IO)
+               offset = (unsigned long)hose->io_base_virt - isa_io_base;
+       else if (hose && res->flags & IORESOURCE_MEM)
+               offset = hose->pci_mem_offset;
+       res->start = region->start + offset;
+       res->end = region->end + offset;
+}
+EXPORT_SYMBOL(pcibios_bus_to_resource);
+
+/*
+ * We need to avoid collisions with `mirrored' VGA ports
+ * and other strange ISA hardware, so we always want the
+ * addresses to be allocated in the 0x000-0x0ff region
+ * modulo 0x400.
+ *
+ * Why? Because some silly external IO cards only decode
+ * the low 10 bits of the IO address. The 0x00-0xff region
+ * is reserved for motherboard devices that decode all 16
+ * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
+ * but we want to try to avoid allocating at 0x2900-0x2bff
+ * which might have be mirrored at 0x0100-0x03ff..
+ */
+void pcibios_align_resource(void *data, struct resource *res, unsigned long size,
+                      unsigned long align)
+{
+       struct pci_dev *dev = data;
+
+       if (res->flags & IORESOURCE_IO) {
+               unsigned long start = res->start;
+
+               if (size > 0x100) {
+                       printk(KERN_ERR "PCI: I/O Region %s/%d too large"
+                              " (%ld bytes)\n", pci_name(dev),
+                              dev->resource - res, size);
+               }
+
+               if (start & 0x300) {
+                       start = (start + 0x3ff) & ~0x3ff;
+                       res->start = start;
+               }
+       }
+}
+EXPORT_SYMBOL(pcibios_align_resource);
+
+/*
+ *  Handle resources of PCI devices.  If the world were perfect, we could
+ *  just allocate all the resource regions and do nothing more.  It isn't.
+ *  On the other hand, we cannot just re-allocate all devices, as it would
+ *  require us to know lots of host bridge internals.  So we attempt to
+ *  keep as much of the original configuration as possible, but tweak it
+ *  when it's found to be wrong.
+ *
+ *  Known BIOS problems we have to work around:
+ *     - I/O or memory regions not configured
+ *     - regions configured, but not enabled in the command register
+ *     - bogus I/O addresses above 64K used
+ *     - expansion ROMs left enabled (this may sound harmless, but given
+ *       the fact the PCI specs explicitly allow address decoders to be
+ *       shared between expansion ROMs and other resource regions, it's
+ *       at least dangerous)
+ *
+ *  Our solution:
+ *     (1) Allocate resources for all buses behind PCI-to-PCI bridges.
+ *         This gives us fixed barriers on where we can allocate.
+ *     (2) Allocate resources for all enabled devices.  If there is
+ *         a collision, just mark the resource as unallocated. Also
+ *         disable expansion ROMs during this step.
+ *     (3) Try to allocate resources for disabled devices.  If the
+ *         resources were assigned correctly, everything goes well,
+ *         if they weren't, they won't disturb allocation of other
+ *         resources.
+ *     (4) Assign new addresses to resources which were either
+ *         not configured at all or misconfigured.  If explicitly
+ *         requested by the user, configure expansion ROM address
+ *         as well.
+ */
+
+static void __init
+pcibios_allocate_bus_resources(struct list_head *bus_list)
+{
+       struct pci_bus *bus;
+       int i;
+       struct resource *res, *pr;
+
+       /* Depth-First Search on bus tree */
+       list_for_each_entry(bus, bus_list, node) {
+               for (i = 0; i < 4; ++i) {
+                       if ((res = bus->resource[i]) == NULL || !res->flags
+                           || res->start > res->end)
+                               continue;
+                       if (bus->parent == NULL)
+                               pr = (res->flags & IORESOURCE_IO)?
+                                       &ioport_resource: &iomem_resource;
+                       else {
+                               pr = pci_find_parent_resource(bus->self, res);
+                               if (pr == res) {
+                                       /* this happens when the generic PCI
+                                        * code (wrongly) decides that this
+                                        * bridge is transparent  -- paulus
+                                        */
+                                       continue;
+                               }
+                       }
+
+                       DBG("PCI: bridge rsrc %lx..%lx (%lx), parent %p\n",
+                           res->start, res->end, res->flags, pr);
+                       if (pr) {
+                               if (request_resource(pr, res) == 0)
+                                       continue;
+                               /*
+                                * Must be a conflict with an existing entry.
+                                * Move that entry (or entries) under the
+                                * bridge resource and try again.
+                                */
+                               if (reparent_resources(pr, res) == 0)
+                                       continue;
+                       }
+                       printk(KERN_ERR "PCI: Cannot allocate resource region "
+                              "%d of PCI bridge %d\n", i, bus->number);
+                       if (pci_relocate_bridge_resource(bus, i))
+                               bus->resource[i] = NULL;
+               }
+               pcibios_allocate_bus_resources(&bus->children);
+       }
+}
+
+/*
+ * Reparent resource children of pr that conflict with res
+ * under res, and make res replace those children.
+ */
+static int __init
+reparent_resources(struct resource *parent, struct resource *res)
+{
+       struct resource *p, **pp;
+       struct resource **firstpp = NULL;
+
+       for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) {
+               if (p->end < res->start)
+                       continue;
+               if (res->end < p->start)
+                       break;
+               if (p->start < res->start || p->end > res->end)
+                       return -1;      /* not completely contained */
+               if (firstpp == NULL)
+                       firstpp = pp;
+       }
+       if (firstpp == NULL)
+               return -1;      /* didn't find any conflicting entries? */
+       res->parent = parent;
+       res->child = *firstpp;
+       res->sibling = *pp;
+       *firstpp = res;
+       *pp = NULL;
+       for (p = res->child; p != NULL; p = p->sibling) {
+               p->parent = res;
+               DBG(KERN_INFO "PCI: reparented %s [%lx..%lx] under %s\n",
+                   p->name, p->start, p->end, res->name);
+       }
+       return 0;
+}
+
+/*
+ * A bridge has been allocated a range which is outside the range
+ * of its parent bridge, so it needs to be moved.
+ */
+static int __init
+pci_relocate_bridge_resource(struct pci_bus *bus, int i)
+{
+       struct resource *res, *pr, *conflict;
+       unsigned long try, size;
+       int j;
+       struct pci_bus *parent = bus->parent;
+
+       if (parent == NULL) {
+               /* shouldn't ever happen */
+               printk(KERN_ERR "PCI: can't move host bridge resource\n");
+               return -1;
+       }
+       res = bus->resource[i];
+       if (res == NULL)
+               return -1;
+       pr = NULL;
+       for (j = 0; j < 4; j++) {
+               struct resource *r = parent->resource[j];
+               if (!r)
+                       continue;
+               if ((res->flags ^ r->flags) & (IORESOURCE_IO | IORESOURCE_MEM))
+                       continue;
+               if (!((res->flags ^ r->flags) & IORESOURCE_PREFETCH)) {
+                       pr = r;
+                       break;
+               }
+               if (res->flags & IORESOURCE_PREFETCH)
+                       pr = r;
+       }
+       if (pr == NULL)
+               return -1;
+       size = res->end - res->start;
+       if (pr->start > pr->end || size > pr->end - pr->start)
+               return -1;
+       try = pr->end;
+       for (;;) {
+               res->start = try - size;
+               res->end = try;
+               if (probe_resource(bus->parent, pr, res, &conflict) == 0)
+                       break;
+               if (conflict->start <= pr->start + size)
+                       return -1;
+               try = conflict->start - 1;
+       }
+       if (request_resource(pr, res)) {
+               DBG(KERN_ERR "PCI: huh? couldn't move to %lx..%lx\n",
+                   res->start, res->end);
+               return -1;              /* "can't happen" */
+       }
+       update_bridge_base(bus, i);
+       printk(KERN_INFO "PCI: bridge %d resource %d moved to %lx..%lx\n",
+              bus->number, i, res->start, res->end);
+       return 0;
+}
+
+static int __init
+probe_resource(struct pci_bus *parent, struct resource *pr,
+              struct resource *res, struct resource **conflict)
+{
+       struct pci_bus *bus;
+       struct pci_dev *dev;
+       struct resource *r;
+       int i;
+
+       for (r = pr->child; r != NULL; r = r->sibling) {
+               if (r->end >= res->start && res->end >= r->start) {
+                       *conflict = r;
+                       return 1;
+               }
+       }
+       list_for_each_entry(bus, &parent->children, node) {
+               for (i = 0; i < 4; ++i) {
+                       if ((r = bus->resource[i]) == NULL)
+                               continue;
+                       if (!r->flags || r->start > r->end || r == res)
+                               continue;
+                       if (pci_find_parent_resource(bus->self, r) != pr)
+                               continue;
+                       if (r->end >= res->start && res->end >= r->start) {
+                               *conflict = r;
+                               return 1;
+                       }
+               }
+       }
+       list_for_each_entry(dev, &parent->devices, bus_list) {
+               for (i = 0; i < 6; ++i) {
+                       r = &dev->resource[i];
+                       if (!r->flags || (r->flags & IORESOURCE_UNSET))
+                               continue;
+                       if (pci_find_parent_resource(dev, r) != pr)
+                               continue;
+                       if (r->end >= res->start && res->end >= r->start) {
+                               *conflict = r;
+                               return 1;
+                       }
+               }
+       }
+       return 0;
+}
+
+static void __init
+update_bridge_base(struct pci_bus *bus, int i)
+{
+       struct resource *res = bus->resource[i];
+       u8 io_base_lo, io_limit_lo;
+       u16 mem_base, mem_limit;
+       u16 cmd;
+       unsigned long start, end, off;
+       struct pci_dev *dev = bus->self;
+       struct pci_controller *hose = dev->sysdata;
+
+       if (!hose) {
+               printk("update_bridge_base: no hose?\n");
+               return;
+       }
+       pci_read_config_word(dev, PCI_COMMAND, &cmd);
+       pci_write_config_word(dev, PCI_COMMAND,
+                             cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY));
+       if (res->flags & IORESOURCE_IO) {
+               off = (unsigned long) hose->io_base_virt - isa_io_base;
+               start = res->start - off;
+               end = res->end - off;
+               io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK;
+               io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK;
+               if (end > 0xffff) {
+                       pci_write_config_word(dev, PCI_IO_BASE_UPPER16,
+                                             start >> 16);
+                       pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16,
+                                             end >> 16);
+                       io_base_lo |= PCI_IO_RANGE_TYPE_32;
+               } else
+                       io_base_lo |= PCI_IO_RANGE_TYPE_16;
+               pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo);
+               pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo);
+
+       } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
+                  == IORESOURCE_MEM) {
+               off = hose->pci_mem_offset;
+               mem_base = ((res->start - off) >> 16) & PCI_MEMORY_RANGE_MASK;
+               mem_limit = ((res->end - off) >> 16) & PCI_MEMORY_RANGE_MASK;
+               pci_write_config_word(dev, PCI_MEMORY_BASE, mem_base);
+               pci_write_config_word(dev, PCI_MEMORY_LIMIT, mem_limit);
+
+       } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
+                  == (IORESOURCE_MEM | IORESOURCE_PREFETCH)) {
+               off = hose->pci_mem_offset;
+               mem_base = ((res->start - off) >> 16) & PCI_PREF_RANGE_MASK;
+               mem_limit = ((res->end - off) >> 16) & PCI_PREF_RANGE_MASK;
+               pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, mem_base);
+               pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit);
+
+       } else {
+               DBG(KERN_ERR "PCI: ugh, bridge %s res %d has flags=%lx\n",
+                   pci_name(dev), i, res->flags);
+       }
+       pci_write_config_word(dev, PCI_COMMAND, cmd);
+}
+
+static inline void alloc_resource(struct pci_dev *dev, int idx)
+{
+       struct resource *pr, *r = &dev->resource[idx];
+
+       DBG("PCI:%s: Resource %d: %08lx-%08lx (f=%lx)\n",
+           pci_name(dev), idx, r->start, r->end, r->flags);
+       pr = pci_find_parent_resource(dev, r);
+       if (!pr || request_resource(pr, r) < 0) {
+               printk(KERN_ERR "PCI: Cannot allocate resource region %d"
+                      " of device %s\n", idx, pci_name(dev));
+               if (pr)
+                       DBG("PCI:  parent is %p: %08lx-%08lx (f=%lx)\n",
+                           pr, pr->start, pr->end, pr->flags);
+               /* We'll assign a new address later */
+               r->flags |= IORESOURCE_UNSET;
+               r->end -= r->start;
+               r->start = 0;
+       }
+}
+
+static void __init
+pcibios_allocate_resources(int pass)
+{
+       struct pci_dev *dev = NULL;
+       int idx, disabled;
+       u16 command;
+       struct resource *r;
+
+       for_each_pci_dev(dev) {
+               pci_read_config_word(dev, PCI_COMMAND, &command);
+               for (idx = 0; idx < 6; idx++) {
+                       r = &dev->resource[idx];
+                       if (r->parent)          /* Already allocated */
+                               continue;
+                       if (!r->flags || (r->flags & IORESOURCE_UNSET))
+                               continue;       /* Not assigned at all */
+                       if (r->flags & IORESOURCE_IO)
+                               disabled = !(command & PCI_COMMAND_IO);
+                       else
+                               disabled = !(command & PCI_COMMAND_MEMORY);
+                       if (pass == disabled)
+                               alloc_resource(dev, idx);
+               }
+               if (pass)
+                       continue;
+               r = &dev->resource[PCI_ROM_RESOURCE];
+               if (r->flags & IORESOURCE_ROM_ENABLE) {
+                       /* Turn the ROM off, leave the resource region, but keep it unregistered. */
+                       u32 reg;
+                       DBG("PCI: Switching off ROM of %s\n", pci_name(dev));
+                       r->flags &= ~IORESOURCE_ROM_ENABLE;
+                       pci_read_config_dword(dev, dev->rom_base_reg, &reg);
+                       pci_write_config_dword(dev, dev->rom_base_reg,
+                                              reg & ~PCI_ROM_ADDRESS_ENABLE);
+               }
+       }
+}
+
+static void __init
+pcibios_assign_resources(void)
+{
+       struct pci_dev *dev = NULL;
+       int idx;
+       struct resource *r;
+
+       for_each_pci_dev(dev) {
+               int class = dev->class >> 8;
+
+               /* Don't touch classless devices and host bridges */
+               if (!class || class == PCI_CLASS_BRIDGE_HOST)
+                       continue;
+
+               for (idx = 0; idx < 6; idx++) {
+                       r = &dev->resource[idx];
+
+                       /*
+                        * We shall assign a new address to this resource,
+                        * either because the BIOS (sic) forgot to do so
+                        * or because we have decided the old address was
+                        * unusable for some reason.
+                        */
+                       if ((r->flags & IORESOURCE_UNSET) && r->end &&
+                           (!ppc_md.pcibios_enable_device_hook ||
+                            !ppc_md.pcibios_enable_device_hook(dev, 1))) {
+                               r->flags &= ~IORESOURCE_UNSET;
+                               pci_assign_resource(dev, idx);
+                       }
+               }
+
+#if 0 /* don't assign ROMs */
+               r = &dev->resource[PCI_ROM_RESOURCE];
+               r->end -= r->start;
+               r->start = 0;
+               if (r->end)
+                       pci_assign_resource(dev, PCI_ROM_RESOURCE);
+#endif
+       }
+}
+
+
+int
+pcibios_enable_resources(struct pci_dev *dev, int mask)
+{
+       u16 cmd, old_cmd;
+       int idx;
+       struct resource *r;
+
+       pci_read_config_word(dev, PCI_COMMAND, &cmd);
+       old_cmd = cmd;
+       for (idx=0; idx<6; idx++) {
+               /* Only set up the requested stuff */
+               if (!(mask & (1<<idx)))
+                       continue;
+       
+               r = &dev->resource[idx];
+               if (r->flags & IORESOURCE_UNSET) {
+                       printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
+                       return -EINVAL;
+               }
+               if (r->flags & IORESOURCE_IO)
+                       cmd |= PCI_COMMAND_IO;
+               if (r->flags & IORESOURCE_MEM)
+                       cmd |= PCI_COMMAND_MEMORY;
+       }
+       if (dev->resource[PCI_ROM_RESOURCE].start)
+               cmd |= PCI_COMMAND_MEMORY;
+       if (cmd != old_cmd) {
+               printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd);
+               pci_write_config_word(dev, PCI_COMMAND, cmd);
+       }
+       return 0;
+}
+
+static int next_controller_index;
+
+struct pci_controller * __init
+pcibios_alloc_controller(void)
+{
+       struct pci_controller *hose;
+
+       hose = (struct pci_controller *)alloc_bootmem(sizeof(*hose));
+       memset(hose, 0, sizeof(struct pci_controller));
+
+       *hose_tail = hose;
+       hose_tail = &hose->next;
+
+       hose->index = next_controller_index++;
+
+       return hose;
+}
+
+#ifdef CONFIG_PPC_OF
+/*
+ * Functions below are used on OpenFirmware machines.
+ */
+static void
+make_one_node_map(struct device_node* node, u8 pci_bus)
+{
+       int *bus_range;
+       int len;
+
+       if (pci_bus >= pci_bus_count)
+               return;
+       bus_range = (int *) get_property(node, "bus-range", &len);
+       if (bus_range == NULL || len < 2 * sizeof(int)) {
+               printk(KERN_WARNING "Can't get bus-range for %s, "
+                      "assuming it starts at 0\n", node->full_name);
+               pci_to_OF_bus_map[pci_bus] = 0;
+       } else
+               pci_to_OF_bus_map[pci_bus] = bus_range[0];
+
+       for (node=node->child; node != 0;node = node->sibling) {
+               struct pci_dev* dev;
+               unsigned int *class_code, *reg;
+       
+               class_code = (unsigned int *) get_property(node, "class-code", NULL);
+               if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
+                       (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
+                       continue;
+               reg = (unsigned int *)get_property(node, "reg", NULL);
+               if (!reg)
+                       continue;
+               dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff));
+               if (!dev || !dev->subordinate)
+                       continue;
+               make_one_node_map(node, dev->subordinate->number);
+       }
+}
+       
+void
+pcibios_make_OF_bus_map(void)
+{
+       int i;
+       struct pci_controller* hose;
+       u8* of_prop_map;
+
+       pci_to_OF_bus_map = (u8*)kmalloc(pci_bus_count, GFP_KERNEL);
+       if (!pci_to_OF_bus_map) {
+               printk(KERN_ERR "Can't allocate OF bus map !\n");
+               return;
+       }
+
+       /* We fill the bus map with invalid values, that helps
+        * debugging.
+        */
+       for (i=0; i<pci_bus_count; i++)
+               pci_to_OF_bus_map[i] = 0xff;
+
+       /* For each hose, we begin searching bridges */
+       for(hose=hose_head; hose; hose=hose->next) {
+               struct device_node* node;       
+               node = (struct device_node *)hose->arch_data;
+               if (!node)
+                       continue;
+               make_one_node_map(node, hose->first_busno);
+       }
+       of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", NULL);
+       if (of_prop_map)
+               memcpy(of_prop_map, pci_to_OF_bus_map, pci_bus_count);
+#ifdef DEBUG
+       printk("PCI->OF bus map:\n");
+       for (i=0; i<pci_bus_count; i++) {
+               if (pci_to_OF_bus_map[i] == 0xff)
+                       continue;
+               printk("%d -> %d\n", i, pci_to_OF_bus_map[i]);
+       }
+#endif
+}
+
+typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data);
+
+static struct device_node*
+scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data)
+{
+       struct device_node* sub_node;
+
+       for (; node != 0;node = node->sibling) {
+               unsigned int *class_code;
+       
+               if (filter(node, data))
+                       return node;
+
+               /* For PCI<->PCI bridges or CardBus bridges, we go down
+                * Note: some OFs create a parent node "multifunc-device" as
+                * a fake root for all functions of a multi-function device,
+                * we go down them as well.
+                */
+               class_code = (unsigned int *) get_property(node, "class-code", NULL);
+               if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
+                       (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
+                       strcmp(node->name, "multifunc-device"))
+                       continue;
+               sub_node = scan_OF_pci_childs(node->child, filter, data);
+               if (sub_node)
+                       return sub_node;
+       }
+       return NULL;
+}
+
+static int
+scan_OF_pci_childs_iterator(struct device_node* node, void* data)
+{
+       unsigned int *reg;
+       u8* fdata = (u8*)data;
+       
+       reg = (unsigned int *) get_property(node, "reg", NULL);
+       if (reg && ((reg[0] >> 8) & 0xff) == fdata[1]
+               && ((reg[0] >> 16) & 0xff) == fdata[0])
+               return 1;
+       return 0;
+}
+
+static struct device_node*
+scan_OF_childs_for_device(struct device_node* node, u8 bus, u8 dev_fn)
+{
+       u8 filter_data[2] = {bus, dev_fn};
+
+       return scan_OF_pci_childs(node, scan_OF_pci_childs_iterator, filter_data);
+}
+
+/*
+ * Scans the OF tree for a device node matching a PCI device
+ */
+struct device_node *
+pci_busdev_to_OF_node(struct pci_bus *bus, int devfn)
+{
+       struct pci_controller *hose;
+       struct device_node *node;
+       int busnr;
+
+       if (!have_of)
+               return NULL;
+       
+       /* Lookup the hose */
+       busnr = bus->number;
+       hose = pci_bus_to_hose(busnr);
+       if (!hose)
+               return NULL;
+
+       /* Check it has an OF node associated */
+       node = (struct device_node *) hose->arch_data;
+       if (!node)
+               return NULL;
+
+       /* Fixup bus number according to what OF think it is. */
+#ifdef CONFIG_PPC_PMAC
+       /* The G5 need a special case here. Basically, we don't remap all
+        * busses on it so we don't create the pci-OF-map. However, we do
+        * remap the AGP bus and so have to deal with it. A future better
+        * fix has to be done by making the remapping per-host and always
+        * filling the pci_to_OF map. --BenH
+        */
+       if (_machine == _MACH_Pmac && busnr >= 0xf0)
+               busnr -= 0xf0;
+       else
+#endif
+       if (pci_to_OF_bus_map)
+               busnr = pci_to_OF_bus_map[busnr];
+       if (busnr == 0xff)
+               return NULL;
+       
+       /* Now, lookup childs of the hose */
+       return scan_OF_childs_for_device(node->child, busnr, devfn);
+}
+EXPORT_SYMBOL(pci_busdev_to_OF_node);
+
+struct device_node*
+pci_device_to_OF_node(struct pci_dev *dev)
+{
+       return pci_busdev_to_OF_node(dev->bus, dev->devfn);
+}
+EXPORT_SYMBOL(pci_device_to_OF_node);
+
+/* This routine is meant to be used early during boot, when the
+ * PCI bus numbers have not yet been assigned, and you need to
+ * issue PCI config cycles to an OF device.
+ * It could also be used to "fix" RTAS config cycles if you want
+ * to set pci_assign_all_buses to 1 and still use RTAS for PCI
+ * config cycles.
+ */
+struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node)
+{
+       if (!have_of)
+               return NULL;
+       while(node) {
+               struct pci_controller* hose;
+               for (hose=hose_head;hose;hose=hose->next)
+                       if (hose->arch_data == node)
+                               return hose;
+               node=node->parent;
+       }
+       return NULL;
+}
+
+static int
+find_OF_pci_device_filter(struct device_node* node, void* data)
+{
+       return ((void *)node == data);
+}
+
+/*
+ * Returns the PCI device matching a given OF node
+ */
+int
+pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
+{
+       unsigned int *reg;
+       struct pci_controller* hose;
+       struct pci_dev* dev = NULL;
+       
+       if (!have_of)
+               return -ENODEV;
+       /* Make sure it's really a PCI device */
+       hose = pci_find_hose_for_OF_device(node);
+       if (!hose || !hose->arch_data)
+               return -ENODEV;
+       if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
+                       find_OF_pci_device_filter, (void *)node))
+               return -ENODEV;
+       reg = (unsigned int *) get_property(node, "reg", NULL);
+       if (!reg)
+               return -ENODEV;
+       *bus = (reg[0] >> 16) & 0xff;
+       *devfn = ((reg[0] >> 8) & 0xff);
+
+       /* Ok, here we need some tweak. If we have already renumbered
+        * all busses, we can't rely on the OF bus number any more.
+        * the pci_to_OF_bus_map is not enough as several PCI busses
+        * may match the same OF bus number.
+        */
+       if (!pci_to_OF_bus_map)
+               return 0;
+
+       for_each_pci_dev(dev)
+               if (pci_to_OF_bus_map[dev->bus->number] == *bus &&
+                               dev->devfn == *devfn) {
+                       *bus = dev->bus->number;
+                       pci_dev_put(dev);
+                       return 0;
+               }
+
+       return -ENODEV;
+}
+EXPORT_SYMBOL(pci_device_from_OF_node);
+
+void __init
+pci_process_bridge_OF_ranges(struct pci_controller *hose,
+                          struct device_node *dev, int primary)
+{
+       static unsigned int static_lc_ranges[256] __initdata;
+       unsigned int *dt_ranges, *lc_ranges, *ranges, *prev;
+       unsigned int size;
+       int rlen = 0, orig_rlen;
+       int memno = 0;
+       struct resource *res;
+       int np, na = prom_n_addr_cells(dev);
+       np = na + 5;
+
+       /* First we try to merge ranges to fix a problem with some pmacs
+        * that can have more than 3 ranges, fortunately using contiguous
+        * addresses -- BenH
+        */
+       dt_ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
+       if (!dt_ranges)
+               return;
+       /* Sanity check, though hopefully that never happens */
+       if (rlen > sizeof(static_lc_ranges)) {
+               printk(KERN_WARNING "OF ranges property too large !\n");
+               rlen = sizeof(static_lc_ranges);
+       }
+       lc_ranges = static_lc_ranges;
+       memcpy(lc_ranges, dt_ranges, rlen);
+       orig_rlen = rlen;
+
+       /* Let's work on a copy of the "ranges" property instead of damaging
+        * the device-tree image in memory
+        */
+       ranges = lc_ranges;
+       prev = NULL;
+       while ((rlen -= np * sizeof(unsigned int)) >= 0) {
+               if (prev) {
+                       if (prev[0] == ranges[0] && prev[1] == ranges[1] &&
+                               (prev[2] + prev[na+4]) == ranges[2] &&
+                               (prev[na+2] + prev[na+4]) == ranges[na+2]) {
+                               prev[na+4] += ranges[na+4];
+                               ranges[0] = 0;
+                               ranges += np;
+                               continue;
+                       }
+               }
+               prev = ranges;
+               ranges += np;
+       }
+
+       /*
+        * The ranges property is laid out as an array of elements,
+        * each of which comprises:
+        *   cells 0 - 2:       a PCI address
+        *   cells 3 or 3+4:    a CPU physical address
+        *                      (size depending on dev->n_addr_cells)
+        *   cells 4+5 or 5+6:  the size of the range
+        */
+       ranges = lc_ranges;
+       rlen = orig_rlen;
+       while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
+               res = NULL;
+               size = ranges[na+4];
+               switch ((ranges[0] >> 24) & 0x3) {
+               case 1:         /* I/O space */
+                       if (ranges[2] != 0)
+                               break;
+                       hose->io_base_phys = ranges[na+2];
+                       /* limit I/O space to 16MB */
+                       if (size > 0x01000000)
+                               size = 0x01000000;
+                       hose->io_base_virt = ioremap(ranges[na+2], size);
+                       if (primary)
+                               isa_io_base = (unsigned long) hose->io_base_virt;
+                       res = &hose->io_resource;
+                       res->flags = IORESOURCE_IO;
+                       res->start = ranges[2];
+                       DBG("PCI: IO 0x%lx -> 0x%lx\n",
+                                   res->start, res->start + size - 1);
+                       break;
+               case 2:         /* memory space */
+                       memno = 0;
+                       if (ranges[1] == 0 && ranges[2] == 0
+                           && ranges[na+4] <= (16 << 20)) {
+                               /* 1st 16MB, i.e. ISA memory area */
+                               if (primary)
+                                       isa_mem_base = ranges[na+2];
+                               memno = 1;
+                       }
+                       while (memno < 3 && hose->mem_resources[memno].flags)
+                               ++memno;
+                       if (memno == 0)
+                               hose->pci_mem_offset = ranges[na+2] - ranges[2];
+                       if (memno < 3) {
+                               res = &hose->mem_resources[memno];
+                               res->flags = IORESOURCE_MEM;
+                               if(ranges[0] & 0x40000000)
+                                       res->flags |= IORESOURCE_PREFETCH;
+                               res->start = ranges[na+2];
+                               DBG("PCI: MEM[%d] 0x%lx -> 0x%lx\n", memno,
+                                           res->start, res->start + size - 1);
+                       }
+                       break;
+               }
+               if (res != NULL) {
+                       res->name = dev->full_name;
+                       res->end = res->start + size - 1;
+                       res->parent = NULL;
+                       res->sibling = NULL;
+                       res->child = NULL;
+               }
+               ranges += np;
+       }
+}
+
+/* We create the "pci-OF-bus-map" property now so it appears in the
+ * /proc device tree
+ */
+void __init
+pci_create_OF_bus_map(void)
+{
+       struct property* of_prop;
+       
+       of_prop = (struct property*) alloc_bootmem(sizeof(struct property) + 256);
+       if (of_prop && find_path_device("/")) {
+               memset(of_prop, -1, sizeof(struct property) + 256);
+               of_prop->name = "pci-OF-bus-map";
+               of_prop->length = 256;
+               of_prop->value = (unsigned char *)&of_prop[1];
+               prom_add_property(find_path_device("/"), of_prop);
+       }
+}
+
+static ssize_t pci_show_devspec(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       struct pci_dev *pdev;
+       struct device_node *np;
+
+       pdev = to_pci_dev (dev);
+       np = pci_device_to_OF_node(pdev);
+       if (np == NULL || np->full_name == NULL)
+               return 0;
+       return sprintf(buf, "%s", np->full_name);
+}
+static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL);
+
+#else /* CONFIG_PPC_OF */
+void pcibios_make_OF_bus_map(void)
+{
+}
+#endif /* CONFIG_PPC_OF */
+
+/* Add sysfs properties */
+void pcibios_add_platform_entries(struct pci_dev *pdev)
+{
+#ifdef CONFIG_PPC_OF
+       device_create_file(&pdev->dev, &dev_attr_devspec);
+#endif /* CONFIG_PPC_OF */
+}
+
+
+#ifdef CONFIG_PPC_PMAC
+/*
+ * This set of routines checks for PCI<->PCI bridges that have closed
+ * IO resources and have child devices. It tries to re-open an IO
+ * window on them.
+ *
+ * This is a _temporary_ fix to workaround a problem with Apple's OF
+ * closing IO windows on P2P bridges when the OF drivers of cards
+ * below this bridge don't claim any IO range (typically ATI or
+ * Adaptec).
+ *
+ * A more complete fix would be to use drivers/pci/setup-bus.c, which
+ * involves a working pcibios_fixup_pbus_ranges(), some more care about
+ * ordering when creating the host bus resources, and maybe a few more
+ * minor tweaks
+ */
+
+/* Initialize bridges with base/limit values we have collected */
+static void __init
+do_update_p2p_io_resource(struct pci_bus *bus, int enable_vga)
+{
+       struct pci_dev *bridge = bus->self;
+       struct pci_controller* hose = (struct pci_controller *)bridge->sysdata;
+       u32 l;
+       u16 w;
+       struct resource res;
+
+       if (bus->resource[0] == NULL)
+               return;
+       res = *(bus->resource[0]);
+
+       DBG("Remapping Bus %d, bridge: %s\n", bus->number, pci_name(bridge));
+       res.start -= ((unsigned long) hose->io_base_virt - isa_io_base);
+       res.end -= ((unsigned long) hose->io_base_virt - isa_io_base);
+       DBG("  IO window: %08lx-%08lx\n", res.start, res.end);
+
+       /* Set up the top and bottom of the PCI I/O segment for this bus. */
+       pci_read_config_dword(bridge, PCI_IO_BASE, &l);
+       l &= 0xffff000f;
+       l |= (res.start >> 8) & 0x00f0;
+       l |= res.end & 0xf000;
+       pci_write_config_dword(bridge, PCI_IO_BASE, l);
+
+       if ((l & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32) {
+               l = (res.start >> 16) | (res.end & 0xffff0000);
+               pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, l);
+       }
+
+       pci_read_config_word(bridge, PCI_COMMAND, &w);
+       w |= PCI_COMMAND_IO;
+       pci_write_config_word(bridge, PCI_COMMAND, w);
+
+#if 0 /* Enabling this causes XFree 4.2.0 to hang during PCI probe */
+       if (enable_vga) {
+               pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, &w);
+               w |= PCI_BRIDGE_CTL_VGA;
+               pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, w);
+       }
+#endif
+}
+
+/* This function is pretty basic and actually quite broken for the
+ * general case, it's enough for us right now though. It's supposed
+ * to tell us if we need to open an IO range at all or not and what
+ * size.
+ */
+static int __init
+check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga)
+{
+       struct pci_dev *dev;
+       int     i;
+       int     rc = 0;
+
+#define push_end(res, size) do { unsigned long __sz = (size) ; \
+       res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \
+    } while (0)
+
+       list_for_each_entry(dev, &bus->devices, bus_list) {
+               u16 class = dev->class >> 8;
+
+               if (class == PCI_CLASS_DISPLAY_VGA ||
+                   class == PCI_CLASS_NOT_DEFINED_VGA)
+                       *found_vga = 1;
+               if (class >> 8 == PCI_BASE_CLASS_BRIDGE && dev->subordinate)
+                       rc |= check_for_io_childs(dev->subordinate, res, found_vga);
+               if (class == PCI_CLASS_BRIDGE_CARDBUS)
+                       push_end(res, 0xfff);
+
+               for (i=0; i<PCI_NUM_RESOURCES; i++) {
+                       struct resource *r;
+                       unsigned long r_size;
+
+                       if (dev->class >> 8 == PCI_CLASS_BRIDGE_PCI
+                           && i >= PCI_BRIDGE_RESOURCES)
+                               continue;
+                       r = &dev->resource[i];
+                       r_size = r->end - r->start;
+                       if (r_size < 0xfff)
+                               r_size = 0xfff;
+                       if (r->flags & IORESOURCE_IO && (r_size) != 0) {
+                               rc = 1;
+                               push_end(res, r_size);
+                       }
+               }
+       }
+
+       return rc;
+}
+
+/* Here we scan all P2P bridges of a given level that have a closed
+ * IO window. Note that the test for the presence of a VGA card should
+ * be improved to take into account already configured P2P bridges,
+ * currently, we don't see them and might end up configuring 2 bridges
+ * with VGA pass through enabled
+ */
+static void __init
+do_fixup_p2p_level(struct pci_bus *bus)
+{
+       struct pci_bus *b;
+       int i, parent_io;
+       int has_vga = 0;
+
+       for (parent_io=0; parent_io<4; parent_io++)
+               if (bus->resource[parent_io]
+                   && bus->resource[parent_io]->flags & IORESOURCE_IO)
+                       break;
+       if (parent_io >= 4)
+               return;
+
+       list_for_each_entry(b, &bus->children, node) {
+               struct pci_dev *d = b->self;
+               struct pci_controller* hose = (struct pci_controller *)d->sysdata;
+               struct resource *res = b->resource[0];
+               struct resource tmp_res;
+               unsigned long max;
+               int found_vga = 0;
+
+               memset(&tmp_res, 0, sizeof(tmp_res));
+               tmp_res.start = bus->resource[parent_io]->start;
+
+               /* We don't let low addresses go through that closed P2P bridge, well,
+                * that may not be necessary but I feel safer that way
+                */
+               if (tmp_res.start == 0)
+                       tmp_res.start = 0x1000;
+       
+               if (!list_empty(&b->devices) && res && res->flags == 0 &&
+                   res != bus->resource[parent_io] &&
+                   (d->class >> 8) == PCI_CLASS_BRIDGE_PCI &&
+                   check_for_io_childs(b, &tmp_res, &found_vga)) {
+                       u8 io_base_lo;
+
+                       printk(KERN_INFO "Fixing up IO bus %s\n", b->name);
+
+                       if (found_vga) {
+                               if (has_vga) {
+                                       printk(KERN_WARNING "Skipping VGA, already active"
+                                           " on bus segment\n");
+                                       found_vga = 0;
+                               } else
+                                       has_vga = 1;
+                       }
+                       pci_read_config_byte(d, PCI_IO_BASE, &io_base_lo);
+
+                       if ((io_base_lo & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32)
+                               max = ((unsigned long) hose->io_base_virt
+                                       - isa_io_base) + 0xffffffff;
+                       else
+                               max = ((unsigned long) hose->io_base_virt
+                                       - isa_io_base) + 0xffff;
+
+                       *res = tmp_res;
+                       res->flags = IORESOURCE_IO;
+                       res->name = b->name;
+               
+                       /* Find a resource in the parent where we can allocate */
+                       for (i = 0 ; i < 4; i++) {
+                               struct resource *r = bus->resource[i];
+                               if (!r)
+                                       continue;
+                               if ((r->flags & IORESOURCE_IO) == 0)
+                                       continue;
+                               DBG("Trying to allocate from %08lx, size %08lx from parent"
+                                   " res %d: %08lx -> %08lx\n",
+                                       res->start, res->end, i, r->start, r->end);
+                       
+                               if (allocate_resource(r, res, res->end + 1, res->start, max,
+                                   res->end + 1, NULL, NULL