diff -uNr linux-2.4.20/CREDITS linux-2.4.20-ben10/CREDITS
--- linux-2.4.20/CREDITS 2002-11-29 00:53:08.000000000 +0100
+++ linux-2.4.20-ben10/CREDITS 2003-03-23 11:56:20.000000000 +0100
@@ -1488,7 +1488,7 @@
S: United Kingdom
N: Ani Joshi
-E: ajoshi@shell.unixbox.com
+E: ajoshi@kernel.crashing.org
D: fbdev hacking
N: Bernhard Kaindl
diff -uNr linux-2.4.20/Documentation/Configure.help linux-2.4.20-ben10/Documentation/Configure.help
--- linux-2.4.20/Documentation/Configure.help 2002-11-29 00:53:08.000000000 +0100
+++ linux-2.4.20-ben10/Documentation/Configure.help 2003-03-23 12:00:25.000000000 +0100
@@ -26242,6 +26242,29 @@
If unsure, say N.
+CONFIG_CPU_FREQ
+ Clock scaling allows you to change the clock speed of CPUs on the
+ fly. This is a nice method to save battery power on notebooks,
+ because the lower the clock speed, the less power the CPU consumes.
+
+ For more information, take a look at linux/Documentation/cpufreq or
+ at
+
+ If in doubt, say N.
+
+CONFIG_CPU_FREQ_24_API
+ This enables the /proc/sys/cpu/ sysctl interface for controlling
+ CPUFreq, as known from the 2.4.-kernel patches for CPUFreq. Note
+ that some drivers do not support this interface or offer less
+ functionality.
+
+ If you say N here, you'll be able to control CPUFreq using the
+ new /proc/cpufreq interface.
+
+ For details, take a look at linux/Documentation/cpufreq.
+
+ If in doubt, say N.
+
#
# A couple of things I keep forgetting:
# capitalize: AppleTalk, Ethernet, DOS, DMA, FAT, FTP, Internet,
diff -uNr linux-2.4.20/Documentation/cpufreq linux-2.4.20-ben10/Documentation/cpufreq
--- linux-2.4.20/Documentation/cpufreq 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/Documentation/cpufreq 2003-03-23 11:59:33.000000000 +0100
@@ -0,0 +1,361 @@
+ CPU frequency and voltage scaling code in the Linux(TM) kernel
+
+
+ L i n u x C P U F r e q
+
+
+
+
+ Dominik Brodowski
+ David Kimdon
+
+
+
+ Clock scaling allows you to change the clock speed of the CPUs on the
+ fly. This is a nice method to save battery power, because the lower
+ the clock speed, the less power the CPU consumes.
+
+
+
+Contents:
+---------
+1. Supported architectures
+2. User interface
+2.1 /proc/cpufreq interface [2.6]
+2.2. /proc/sys/cpu/ interface [2.4]
+3. CPUFreq core and interfaces
+3.1 General information
+3.2 CPUFreq notifiers
+3.3 CPUFreq architecture drivers
+4. Mailing list and Links
+
+
+
+1. Supported architectures
+==========================
+
+ARM:
+ ARM Integrator, SA 1100, SA1110
+--------------------------------
+ This driver will be ported to new CPUFreq core soon, so
+ far it will not work.
+
+
+AMD Elan:
+ SC400, SC410
+--------------------------------
+ You need to specify the highest allowed CPU frequency as
+ a module parameter ("max_freq") or as boot parameter
+ ("elanfreq="). Else the available speed range will be
+ limited to the speed at which the CPU runs while this
+ module is loaded.
+
+
+VIA Cyrix Longhaul:
+ VIA Samuel/CyrixIII, VIA Cyrix Samuel/C3,
+ VIA Cyrix Ezra, VIA Cyrix Ezra-T
+--------------------------------
+ If you do not want to scale the Front Side Bus or voltage,
+ pass the module parameter "dont_scale_fsb 1" or
+ "dont_scale_voltage 1". Additionally, it is advised that
+ you pass the current Front Side Bus speed (in MHz) to
+ this module as module parameter "current_fsb", e.g.
+ "current_fsb 133" for a Front Side Bus speed of 133 MHz.
+
+
+Intel SpeedStep:
+ certain mobile Intel Pentium III (Coppermine), and all mobile
+ Intel Pentium III-M (Tualatin) and mobile Intel Pentium 4 P4-Ms.
+--------------------------------
+ Unfortunately only modern Intel ICH2-M and ICH3-M chipsets are
+ supported.
+
+
+P4 CPU Clock Modulation:
+ Intel Pentium 4 Xeon processors
+---------------------------------
+ Note that you can only switch the speed of two logical CPUs at
+ once - but each phyiscal CPU may have different throttling levels.
+
+
+PowerNow! K6:
+ mobile AMD K6-2+ / mobile K6-3+:
+--------------------------------
+ No known issues.
+
+
+Transmeta Crusoe Longrun:
+ Transmeta Crusoe processors:
+--------------------------------
+ Does not work with the 2.4. /proc/sys/cpu/ interface.
+
+
+
+2. User Interface
+=================
+
+2.1 /proc/cpufreq interface [2.6]
+***********************************
+
+Starting in the patches for kernel 2.5.33, CPUFreq uses a "policy"
+interface /proc/cpufreq.
+
+When you "cat" this file, you'll find something like:
+
+--
+ minimum CPU frequency - maximum CPU frequency - policy
+CPU 0 1200000 ( 75%) - 1600000 (100%) - performance
+--
+
+This means the current policy allows this CPU to be run anywhere
+between 1.2 GHz (the value is in kHz) and 1.6 GHz with an eye towards
+performance.
+
+To change the policy, "echo" the desired new policy into
+/proc/cpufreq. Use one of the following formats:
+
+cpu_nr:min_freq:max_freq:policy
+cpu_nr%min_freq%max_freq%policy
+min_freq:max_freq:policy
+min_freq%max_freq%policy
+
+with cpu_nr being the CPU which shall be affected, min_freq and
+max_freq the lower and upper limit of the CPU core frequency in kHz,
+and policy either "performance" or "powersave".
+A few examples:
+
+root@notebook:#echo -n "0:0:0:powersave" > /proc/cpufreq
+ sets the CPU #0 to the lowest supported frequency.
+
+root@notebook:#echo -n "1%100%100%performance" > /proc/cpufreq
+ sets the CPU #1 to the highest supported frequency.
+
+root@notebook:#echo -n "1000000:2000000:performance" > /proc/cpufreq
+ to set the frequency of all CPUs between 1 GHz and 2 GHz and to
+ the policy "performance".
+
+Please note that the values you "echo" into /proc/cpufreq are
+validated first, and may be limited by hardware or thermal
+considerations. Because of this, a read from /proc/cpufreq might
+differ from what was written into it.
+
+
+When you read /proc/cpufreq for the first time after a CPUFreq driver
+has been initialized, you'll see the "default policy" for this
+driver. If this does not suit your needs, you can pass a boot
+parameter to the cpufreq core. Use the following syntax for this:
+ "cpufreq=min_freq:max_freq:policy", i.e. you may not chose a
+specific CPU and you need to specify the limits in kHz and not in
+per cent.
+
+
+2.2 /proc/cpufreq interface [2.4]
+***********************************
+
+Previsiously (and still available as a config option), CPUFreq used
+a "sysctl" interface which is located in
+ /proc/sys/cpu/0/
+ /proc/sys/cpu/1/ ... (SMP only)
+
+In these directories, you will find three files of importance for
+CPUFreq: speed-max, speed-min and speed:
+
+speed shows the current CPU frequency in kHz,
+speed-min the minimum supported CPU frequency, and
+speed-max the maximum supported CPU frequency.
+
+
+To change the CPU frequency, "echo" the desired CPU frequency (in kHz)
+to speed. For example, to set the CPU speed to the lowest/highest
+allowed frequency do:
+
+root@notebook:# cat /proc/sys/cpu/0/speed-min > /proc/sys/cpu/0/speed
+root@notebook:# cat /proc/sys/cpu/0/speed-max > /proc/sys/cpu/0/speed
+
+
+
+3. CPUFreq core and interfaces
+===============================
+
+3.1 General information
+*************************
+
+The CPUFreq core code is located in linux/kernel/cpufreq.c. This
+cpufreq code offers a standardized interface for the CPUFreq
+architecture drivers (those pieces of code that do actual
+frequency transitions), as well as to "notifiers". These are device
+drivers or other part of the kernel that need to be informed of
+policy changes (like thermal modules like ACPI) or of all
+frequency changes (like timing code) or even need to force certain
+speed limits (like LCD drivers on ARM architecture). Additionally, the
+kernel "constant" loops_per_jiffy is updated on frequency changes
+here.
+
+
+3.2 CPUFreq notifiers
+***********************
+
+CPUFreq notifiers conform to the standard kernel notifier interface.
+See linux/include/linux/notifier.h for details on notifiers.
+
+There are two different CPUFreq notifiers - policy notifiers and
+transition notifiers.
+
+
+3.2.1 CPUFreq policy notifiers
+******************************
+
+These are notified when a new policy is intended to be set. Each
+CPUFreq policy notifier is called three times for a policy transition:
+
+1.) During CPUFREQ_ADJUST all CPUFreq notifiers may change the limit if
+ they see a need for this - may it be thermal considerations or
+ hardware limitations.
+
+2.) During CPUFREQ_INCOMPATIBLE only changes may be done in order to avoid
+ hardware failure.
+
+3.) And during CPUFREQ_NOTIFY all notifiers are informed of the new policy
+ - if two hardware drivers failed to agree on a new policy before this
+ stage, the incompatible hardware shall be shut down, and the user
+ informed of this.
+
+The phase is specified in the second argument to the notifier.
+
+The third argument, a void *pointer, points to a struct cpufreq_policy
+consisting of five values: cpu, min, max, policy and max_cpu_freq. Min
+and max are the lower and upper frequencies (in kHz) of the new
+policy, policy the new policy, cpu the number of the affected CPU or
+CPUFREQ_ALL_CPUS for all CPUs; and max_cpu_freq the maximum supported
+CPU frequency. This value is given for informational purposes only.
+
+
+3.2.2 CPUFreq transition notifiers
+**********************************
+
+These are notified twice when the CPUfreq driver switches the CPU core
+frequency and this change has any external implications.
+
+The second argument specifies the phase - CPUFREQ_PRECHANGE or
+CPUFREQ_POSTCHANGE.
+
+The third argument is a struct cpufreq_freqs with the following
+values:
+cpu - number of the affected CPU or CPUFREQ_ALL_CPUS
+old - old frequency
+new - new frequency
+
+
+3.3 CPUFreq architecture drivers
+**********************************
+
+CPUFreq architecture drivers are the pieces of kernel code that
+actually perform CPU frequency transitions. These need to be
+initialized separately (separate initcalls), and may be
+modularized. They interact with the CPUFreq core in the following way:
+
+cpufreq_register()
+------------------
+cpufreq_register registers an arch driver to the CPUFreq core. Please
+note that only one arch driver may be registered at any time. -EBUSY
+is returned when an arch driver is already registered. The argument to
+cpufreq_register, struct cpufreq_driver *driver, is described later.
+
+cpufreq_unregister()
+--------------------
+cpufreq_unregister unregisters an arch driver, e.g. on module
+unloading. Please note that there is no check done that this is called
+from the driver which actually registered itself to the core, so
+please only call this function when you are sure the arch driver got
+registered correctly before.
+
+cpufreq_notify_transition()
+---------------------------
+On "dumb" hardware where only fixed frequency can be set, the driver
+must call cpufreq_notify_transition() once before, and once after the
+actual transition.
+
+struct cpufreq_driver
+---------------------
+On initialization, the arch driver is supposed to pass a pointer
+to a struct cpufreq_driver *cpufreq_driver consisting of the following
+entries:
+
+cpufreq_verify_t verify: This is a pointer to a function with the
+ following definition:
+ void verify_function (struct cpufreq_policy *policy).
+ This function must verify the new policy is within the limits
+ supported by the CPU, and at least one supported CPU is within
+ this range. It may be useful to use cpufreq.h /
+ cpufreq_verify_within_limits for this.
+
+cpufreq_setpolicy_t setpolicy: This is a pointer to a function with
+ the following definition:
+ void setpolicy_function (struct cpufreq_policy *policy).
+ This function must set the CPU to the new policy. If it is a
+ "dumb" CPU which only allows fixed frequencies to be set, it
+ shall set it to the lowest within the limit for
+ CPUFREQ_POLICY_POWERSAVE, and to the highest for
+ CPUFREQ_POLICY_PERFORMANCE. Once CONFIG_CPU_FREQ_DYNAMIC is
+ implemented, it can use a dynamic method to adjust the speed
+ between the lower and upper limit.
+
+struct cpufreq_policy *policy: This is an array of NR_CPUS struct
+ cpufreq_policies, containing the current policies set for these
+ CPUs. Note that policy[0].max_cpu_freq must contain the
+ absolute maximum CPU frequency supported by _all_ CPUs.
+
+In case the driver is expected to run with the 2.4.-style API
+(/proc/sys/cpu/.../), two more values must be passed
+#ifdef CONFIG_CPU_FREQ_24_API
+ unsigned int cpu_min_freq;
+ unsigned int cpu_cur_freq[NR_CPUS];
+#endif
+ with cpu_min_freq being the minimum CPU frequency supported by
+ the CPUs; and the entries in cpu_cur_freq reflecting the
+ current speed of the appropriate CPU.
+
+Some Requirements to CPUFreq architecture drivers
+-------------------------------------------------
+* Only call cpufreq_register() when the ability to switch CPU
+ frequencies is _verified_ or can't be missing
+* cpufreq_unregister() may only be called if cpufreq_register() has
+ been successfully(!) called before.
+* kfree() the struct cpufreq_driver only after the call to
+ cpufreq_unregister(), unless cpufreq_register() failed.
+* Be aware that there is currently no error management in the
+ setpolicy() code in the CPUFreq core. So only call yourself a
+ cpufreq_driver if you are really a working cpufreq_driver!
+
+
+
+4. Mailing list and Links
+*************************
+
+
+Mailing List
+------------
+There is a CPU frequency changing CVS commit and general list where
+you can report bugs, problems or submit patches. To post a message,
+send an email to cpufreq@www.linux.org.uk, to subscribe go to
+http://www.linux.org.uk/mailman/listinfo/cpufreq. Previous post to the
+mailing list are available to subscribers at
+http://www.linux.org.uk/mailman/private/cpufreq/.
+
+
+Links
+-----
+the FTP archives:
+* ftp://ftp.linux.org.uk/pub/linux/cpufreq/
+
+how to access the CVS repository:
+* http://cvs.arm.linux.org.uk/
+
+the CPUFreq Mailing list:
+* http://www.linux.org.uk/mailman/listinfo/cpufreq
+
+Clock and voltage scaling for the SA-1100:
+* http://www.lart.tudelft.nl/projects/scaling
+
+CPUFreq project homepage
+* http://www.brodo.de/cpufreq/
diff -uNr linux-2.4.20/MAINTAINERS linux-2.4.20-ben10/MAINTAINERS
--- linux-2.4.20/MAINTAINERS 2002-11-29 00:53:08.000000000 +0100
+++ linux-2.4.20-ben10/MAINTAINERS 2003-03-23 11:56:55.000000000 +0100
@@ -1160,8 +1160,8 @@
NVIDIA (RIVA) FRAMEBUFFER DRIVER
P: Ani Joshi
-M: ajoshi@shell.unixbox.com
-L: linux-nvidia@lists.surfsouth.com
+M: ajoshi@kernel.crashing.org
+L: linux-fbdev-devel@lists.sourceforge.net
S: Maintained
OLYMPIC NETWORK DRIVER
@@ -1336,13 +1336,13 @@
RADEON FRAMEBUFFER DISPLAY DRIVER
P: Ani Joshi
-M: ajoshi@shell.unixbox.com
+M: ajoshi@kernel.crashing.org
L: linux-fbdev-devel@lists.sourceforge.net
S: Maintained
RAGE128 FRAMEBUFFER DISPLAY DRIVER
P: Ani Joshi
-M: ajoshi@shell.unixbox.com
+M: ajoshi@kernel.crashing.org
L: linux-fbdev-devel@lists.sourceforge.net
S: Maintained
diff -uNr linux-2.4.20/Makefile linux-2.4.20-ben10/Makefile
--- linux-2.4.20/Makefile 2002-11-29 00:53:16.000000000 +0100
+++ linux-2.4.20-ben10/Makefile 2003-04-02 23:59:36.000000000 +0200
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 20
-EXTRAVERSION =
+EXTRAVERSION = -ben10
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
diff -uNr linux-2.4.20/Makefile.orig linux-2.4.20-ben10/Makefile.orig
--- linux-2.4.20/Makefile.orig 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/Makefile.orig 2003-03-23 12:00:30.000000000 +0100
@@ -0,0 +1,573 @@
+VERSION = 2
+PATCHLEVEL = 4
+SUBLEVEL = 20
+EXTRAVERSION = -ben9
+
+KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+
+ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")
+
+CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+ else if [ -x /bin/bash ]; then echo /bin/bash; \
+ else echo sh; fi ; fi)
+TOPDIR := $(shell /bin/pwd)
+
+HPATH = $(TOPDIR)/include
+FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
+
+HOSTCC = gcc
+HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+
+CROSS_COMPILE =
+
+#
+# Include the make variables (CC, etc...)
+#
+
+AS = $(CROSS_COMPILE)as
+LD = $(CROSS_COMPILE)ld
+CC = $(CROSS_COMPILE)gcc
+CPP = $(CC) -E
+AR = $(CROSS_COMPILE)ar
+NM = $(CROSS_COMPILE)nm
+STRIP = $(CROSS_COMPILE)strip
+OBJCOPY = $(CROSS_COMPILE)objcopy
+OBJDUMP = $(CROSS_COMPILE)objdump
+MAKEFILES = $(TOPDIR)/.config
+GENKSYMS = /sbin/genksyms
+DEPMOD = /sbin/depmod
+MODFLAGS = -DMODULE
+CFLAGS_KERNEL =
+PERL = perl
+
+export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
+ CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
+ CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS MODFLAGS PERL
+
+all: do-it-all
+
+#
+# Make "config" the default target if there is no configuration file or
+# "depend" the target if there is no top-level dependency information.
+#
+
+ifeq (.config,$(wildcard .config))
+include .config
+ifeq (.depend,$(wildcard .depend))
+include .depend
+do-it-all: Version vmlinux
+else
+CONFIGURATION = depend
+do-it-all: depend
+endif
+else
+CONFIGURATION = config
+do-it-all: config
+endif
+
+#
+# INSTALL_PATH specifies where to place the updated kernel and system map
+# images. Uncomment if you want to place them anywhere other than root.
+#
+
+#export INSTALL_PATH=/boot
+
+#
+# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
+# relocations required by build roots. This is not defined in the
+# makefile but the arguement can be passed to make if needed.
+#
+
+MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
+export MODLIB
+
+#
+# standard CFLAGS
+#
+
+CPPFLAGS := -D__KERNEL__ -I$(HPATH)
+
+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
+ -fno-strict-aliasing -fno-common
+ifndef CONFIG_FRAME_POINTER
+CFLAGS += -fomit-frame-pointer
+endif
+AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
+
+#
+# ROOT_DEV specifies the default root-device when making the image.
+# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
+# the default of FLOPPY is used by 'build'.
+# This is i386 specific.
+#
+
+export ROOT_DEV = CURRENT
+
+#
+# If you want to preset the SVGA mode, uncomment the next line and
+# set SVGA_MODE to whatever number you want.
+# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
+# The number is the same as you would ordinarily press at bootup.
+# This is i386 specific.
+#
+
+export SVGA_MODE = -DSVGA_MODE=NORMAL_VGA
+
+#
+# If you want the RAM disk device, define this to be the size in blocks.
+# This is i386 specific.
+#
+
+#export RAMDISK = -DRAMDISK=512
+
+CORE_FILES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
+NETWORKS =net/network.o
+
+LIBS =$(TOPDIR)/lib/lib.a
+SUBDIRS =kernel drivers mm fs net ipc lib
+
+DRIVERS-n :=
+DRIVERS-y :=
+DRIVERS-m :=
+DRIVERS- :=
+
+DRIVERS-$(CONFIG_ACPI) += drivers/acpi/acpi.o
+DRIVERS-$(CONFIG_PARPORT) += drivers/parport/driver.o
+DRIVERS-y += drivers/char/char.o \
+ drivers/block/block.o \
+ drivers/misc/misc.o \
+ drivers/net/net.o \
+ drivers/media/media.o
+DRIVERS-$(CONFIG_AGP) += drivers/char/agp/agp.o
+DRIVERS-$(CONFIG_DRM_NEW) += drivers/char/drm/drm.o
+DRIVERS-$(CONFIG_DRM_OLD) += drivers/char/drm-4.0/drm.o
+DRIVERS-$(CONFIG_NUBUS) += drivers/nubus/nubus.a
+DRIVERS-$(CONFIG_NET_FC) += drivers/net/fc/fc.o
+DRIVERS-$(CONFIG_DEV_APPLETALK) += drivers/net/appletalk/appletalk.o
+DRIVERS-$(CONFIG_TR) += drivers/net/tokenring/tr.o
+DRIVERS-$(CONFIG_WAN) += drivers/net/wan/wan.o
+DRIVERS-$(CONFIG_ARCNET) += drivers/net/arcnet/arcnetdrv.o
+DRIVERS-$(CONFIG_ATM) += drivers/atm/atm.o
+DRIVERS-$(CONFIG_IDE) += drivers/ide/idedriver.o
+DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a
+DRIVERS-$(CONFIG_SCSI) += drivers/scsi/scsidrv.o
+DRIVERS-$(CONFIG_FUSION_BOOT) += drivers/message/fusion/fusion.o
+DRIVERS-$(CONFIG_IEEE1394) += drivers/ieee1394/ieee1394drv.o
+
+ifneq ($(CONFIG_CD_NO_IDESCSI)$(CONFIG_BLK_DEV_IDECD)$(CONFIG_BLK_DEV_SR)$(CONFIG_PARIDE_PCD),)
+DRIVERS-y += drivers/cdrom/driver.o
+endif
+
+DRIVERS-$(CONFIG_SOUND) += drivers/sound/sounddrivers.o
+DRIVERS-$(CONFIG_PCI) += drivers/pci/driver.o
+DRIVERS-$(CONFIG_MTD) += drivers/mtd/mtdlink.o
+DRIVERS-$(CONFIG_PCMCIA) += drivers/pcmcia/pcmcia.o
+DRIVERS-$(CONFIG_NET_PCMCIA) += drivers/net/pcmcia/pcmcia_net.o
+DRIVERS-$(CONFIG_NET_WIRELESS) += drivers/net/wireless/wireless_net.o
+DRIVERS-$(CONFIG_PCMCIA_CHRDEV) += drivers/char/pcmcia/pcmcia_char.o
+DRIVERS-$(CONFIG_DIO) += drivers/dio/dio.a
+DRIVERS-$(CONFIG_SBUS) += drivers/sbus/sbus_all.o
+DRIVERS-$(CONFIG_ZORRO) += drivers/zorro/driver.o
+DRIVERS-$(CONFIG_FC4) += drivers/fc4/fc4.a
+DRIVERS-$(CONFIG_PPC32) += drivers/macintosh/macintosh.o
+DRIVERS-$(CONFIG_MAC) += drivers/macintosh/macintosh.o
+DRIVERS-$(CONFIG_ISAPNP) += drivers/pnp/pnp.o
+DRIVERS-$(CONFIG_SGI_IP22) += drivers/sgi/sgi.a
+DRIVERS-$(CONFIG_VT) += drivers/video/video.o
+DRIVERS-$(CONFIG_PARIDE) += drivers/block/paride/paride.a
+DRIVERS-$(CONFIG_HAMRADIO) += drivers/net/hamradio/hamradio.o
+DRIVERS-$(CONFIG_TC) += drivers/tc/tc.a
+DRIVERS-$(CONFIG_USB) += drivers/usb/usbdrv.o
+DRIVERS-$(CONFIG_INPUT) += drivers/input/inputdrv.o
+DRIVERS-$(CONFIG_HIL) += drivers/hil/hil.o
+DRIVERS-$(CONFIG_I2O) += drivers/message/i2o/i2o.o
+DRIVERS-$(CONFIG_IRDA) += drivers/net/irda/irda.o
+DRIVERS-$(CONFIG_I2C) += drivers/i2c/i2c.o
+DRIVERS-$(CONFIG_PHONE) += drivers/telephony/telephony.o
+DRIVERS-$(CONFIG_MD) += drivers/md/mddev.o
+DRIVERS-$(CONFIG_GSC) += drivers/gsc/gscbus.o
+DRIVERS-$(CONFIG_BLUEZ) += drivers/bluetooth/bluetooth.o
+DRIVERS-$(CONFIG_HOTPLUG_PCI) += drivers/hotplug/vmlinux-obj.o
+DRIVERS-$(CONFIG_ISDN_BOOL) += drivers/isdn/vmlinux-obj.o
+
+DRIVERS := $(DRIVERS-y)
+
+
+# files removed with 'make clean'
+CLEAN_FILES = \
+ kernel/ksyms.lst include/linux/compile.h \
+ vmlinux System.map \
+ .tmp* \
+ drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \
+ drivers/char/conmakehash \
+ drivers/char/drm/*-mod.c \
+ drivers/pci/devlist.h drivers/pci/classlist.h drivers/pci/gen-devlist \
+ drivers/zorro/devlist.h drivers/zorro/gen-devlist \
+ drivers/sound/bin2hex drivers/sound/hex2hex \
+ drivers/atm/fore200e_mkfirm drivers/atm/{pca,sba}*{.bin,.bin1,.bin2} \
+ drivers/scsi/aic7xxx/aicasm/aicasm \
+ drivers/scsi/aic7xxx/aicasm/aicasm_gram.c \
+ drivers/scsi/aic7xxx/aicasm/aicasm_gram.h \
+ drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.c \
+ drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.h \
+ drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.c \
+ drivers/scsi/aic7xxx/aicasm/aicasm_scan.c \
+ drivers/scsi/aic7xxx/aicasm/aicdb.h \
+ drivers/scsi/aic7xxx/aicasm/y.tab.h \
+ drivers/scsi/53c700_d.h \
+ net/khttpd/make_times_h \
+ net/khttpd/times.h \
+ submenu*
+# directories removed with 'make clean'
+CLEAN_DIRS = \
+ modules
+
+# files removed with 'make mrproper'
+MRPROPER_FILES = \
+ include/linux/autoconf.h include/linux/version.h \
+ drivers/net/hamradio/soundmodem/sm_tbl_{afsk1200,afsk2666,fsk9600}.h \
+ drivers/net/hamradio/soundmodem/sm_tbl_{hapn4800,psk4800}.h \
+ drivers/net/hamradio/soundmodem/sm_tbl_{afsk2400_7,afsk2400_8}.h \
+ drivers/net/hamradio/soundmodem/gentbl \
+ drivers/sound/*_boot.h drivers/sound/.*.boot \
+ drivers/sound/msndinit.c \
+ drivers/sound/msndperm.c \
+ drivers/sound/pndsperm.c \
+ drivers/sound/pndspini.c \
+ drivers/atm/fore200e_*_fw.c drivers/atm/.fore200e_*.fw \
+ .version .config* config.in config.old \
+ scripts/tkparse scripts/kconfig.tk scripts/kconfig.tmp \
+ scripts/lxdialog/*.o scripts/lxdialog/lxdialog \
+ .menuconfig.log \
+ include/asm \
+ .hdepend scripts/mkdep scripts/split-include scripts/docproc \
+ $(TOPDIR)/include/linux/modversions.h \
+ kernel.spec
+
+# directories removed with 'make mrproper'
+MRPROPER_DIRS = \
+ include/config \
+ $(TOPDIR)/include/linux/modules
+
+
+include arch/$(ARCH)/Makefile
+
+# Extra cflags for kbuild 2.4. The default is to forbid includes by kernel code
+# from user space headers. Some UML code requires user space headers, in the
+# UML Makefiles add 'kbuild_2_4_nostdinc :=' before include Rules.make. No
+# other kernel code should include user space headers, if you need
+# 'kbuild_2_4_nostdinc :=' or -I/usr/include for kernel code and you are not UML
+# then your code is broken! KAO.
+
+kbuild_2_4_nostdinc := -nostdinc -iwithprefix include
+export kbuild_2_4_nostdinc
+
+export CPPFLAGS CFLAGS CFLAGS_KERNEL AFLAGS AFLAGS_KERNEL
+
+export NETWORKS DRIVERS LIBS HEAD LDFLAGS LINKFLAGS MAKEBOOT ASFLAGS
+
+.S.s:
+ $(CPP) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -o $*.s $<
+.S.o:
+ $(CC) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -c -o $*.o $<
+
+Version: dummy
+ @rm -f include/linux/compile.h
+
+boot: vmlinux
+ @$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C arch/$(ARCH)/boot
+
+vmlinux: include/linux/version.h $(CONFIGURATION) init/main.o init/version.o init/do_mounts.o linuxsubdirs
+ $(LD) $(LINKFLAGS) $(HEAD) init/main.o init/version.o init/do_mounts.o \
+ --start-group \
+ $(CORE_FILES) \
+ $(DRIVERS) \
+ $(NETWORKS) \
+ $(LIBS) \
+ --end-group \
+ -o vmlinux
+ $(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
+
+symlinks:
+ rm -f include/asm
+ ( cd include ; ln -sf asm-$(ARCH) asm)
+ @if [ ! -d include/linux/modules ]; then \
+ mkdir include/linux/modules; \
+ fi
+
+oldconfig: symlinks
+ $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
+
+xconfig: symlinks
+ $(MAKE) -C scripts kconfig.tk
+ wish -f scripts/kconfig.tk
+
+menuconfig: include/linux/version.h symlinks
+ $(MAKE) -C scripts/lxdialog all
+ $(CONFIG_SHELL) scripts/Menuconfig arch/$(ARCH)/config.in
+
+config: symlinks
+ $(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in
+
+include/config/MARKER: scripts/split-include include/linux/autoconf.h
+ scripts/split-include include/linux/autoconf.h include/config
+ @ touch include/config/MARKER
+
+linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
+
+$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/linux/version.h include/config/MARKER
+ $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C $(patsubst _dir_%, %, $@)
+
+$(TOPDIR)/include/linux/version.h: include/linux/version.h
+$(TOPDIR)/include/linux/compile.h: include/linux/compile.h
+
+newversion:
+ . scripts/mkversion > .tmpversion
+ @mv -f .tmpversion .version
+
+uts_len := 64
+uts_truncate := sed -e 's/\(.\{1,$(uts_len)\}\).*/\1/'
+
+include/linux/compile.h: $(CONFIGURATION) include/linux/version.h newversion
+ @echo -n \#`cat .version` > .ver1
+ @if [ -n "$(CONFIG_SMP)" ] ; then echo -n " SMP" >> .ver1; fi
+ @if [ -f .name ]; then echo -n \-`cat .name` >> .ver1; fi
+ @LANG=C echo ' '`date` >> .ver1
+ @echo \#define UTS_VERSION \"`cat .ver1 | $(uts_truncate)`\" > .ver
+ @LANG=C echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> .ver
+ @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> .ver
+ @echo \#define LINUX_COMPILE_HOST \"`hostname | $(uts_truncate)`\" >> .ver
+ @([ -x /bin/dnsdomainname ] && /bin/dnsdomainname > .ver1) || \
+ ([ -x /bin/domainname ] && /bin/domainname > .ver1) || \
+ echo > .ver1
+ @echo \#define LINUX_COMPILE_DOMAIN \"`cat .ver1 | $(uts_truncate)`\" >> .ver
+ @echo \#define LINUX_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -1`\" >> .ver
+ @mv -f .ver $@
+ @rm -f .ver1
+
+include/linux/version.h: ./Makefile
+ @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
+ (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false)
+ @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
+ @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
+ @echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver
+ @mv -f .ver $@
+
+comma := ,
+
+init/version.o: init/version.c include/linux/compile.h include/config/MARKER
+ $(CC) $(CFLAGS) $(CFLAGS_KERNEL) -DUTS_MACHINE='"$(ARCH)"' -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o init/version.o init/version.c
+
+init/main.o: init/main.c include/config/MARKER
+ $(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $<
+
+init/do_mounts.o: init/do_mounts.c include/config/MARKER
+ $(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $<
+
+fs lib mm ipc kernel drivers net: dummy
+ $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
+
+TAGS: dummy
+ { find include/asm-${ARCH} -name '*.h' -print ; \
+ find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print ; \
+ find $(SUBDIRS) init arch/${ARCH} -name '*.[chS]' ; } | grep -v SCCS | grep -v '\.svn' | etags -
+
+# Exuberant ctags works better with -I
+tags: dummy
+ CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
+ ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \
+ find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
+ find $(SUBDIRS) init -name '*.[ch]' | xargs ctags $$CTAGSF -a
+
+ifdef CONFIG_MODULES
+ifdef CONFIG_MODVERSIONS
+MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h
+endif
+
+.PHONY: modules
+modules: $(patsubst %, _mod_%, $(SUBDIRS))
+
+.PHONY: $(patsubst %, _mod_%, $(SUBDIRS))
+$(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER
+ $(MAKE) -C $(patsubst _mod_%, %, $@) CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules
+
+.PHONY: modules_install
+modules_install: _modinst_ $(patsubst %, _modinst_%, $(SUBDIRS)) _modinst_post
+
+.PHONY: _modinst_
+_modinst_:
+ @rm -rf $(MODLIB)/kernel
+ @rm -f $(MODLIB)/build
+ @mkdir -p $(MODLIB)/kernel
+ @ln -s $(TOPDIR) $(MODLIB)/build
+
+# If System.map exists, run depmod. This deliberately does not have a
+# dependency on System.map since that would run the dependency tree on
+# vmlinux. This depmod is only for convenience to give the initial
+# boot a modules.dep even before / is mounted read-write. However the
+# boot script depmod is the master version.
+ifeq "$(strip $(INSTALL_MOD_PATH))" ""
+depmod_opts :=
+else
+depmod_opts := -b $(INSTALL_MOD_PATH) -r
+endif
+.PHONY: _modinst_post
+_modinst_post: _modinst_post_pcmcia
+ if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
+
+# Backwards compatibilty symlinks for people still using old versions
+# of pcmcia-cs with hard coded pathnames on insmod. Remove
+# _modinst_post_pcmcia for kernel 2.4.1.
+.PHONY: _modinst_post_pcmcia
+_modinst_post_pcmcia:
+ cd $(MODLIB); \
+ mkdir -p pcmcia; \
+ find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
+
+.PHONY: $(patsubst %, _modinst_%, $(SUBDIRS))
+$(patsubst %, _modinst_%, $(SUBDIRS)) :
+ $(MAKE) -C $(patsubst _modinst_%, %, $@) modules_install
+
+# modules disabled....
+
+else
+modules modules_install: dummy
+ @echo
+ @echo "The present kernel configuration has modules disabled."
+ @echo "Type 'make config' and enable loadable module support."
+ @echo "Then build a kernel with module support enabled."
+ @echo
+ @exit 1
+endif
+
+clean: archclean
+ find . \( -name '*.[oas]' -o -name core -o -name '.*.flags' \) -type f -print \
+ | grep -v lxdialog/ | xargs rm -f
+ rm -f $(CLEAN_FILES)
+ rm -rf $(CLEAN_DIRS)
+ $(MAKE) -C Documentation/DocBook clean
+
+mrproper: clean archmrproper
+ find . \( -size 0 -o -name .depend \) -type f -print | xargs rm -f
+ rm -f $(MRPROPER_FILES)
+ rm -rf $(MRPROPER_DIRS)
+ $(MAKE) -C Documentation/DocBook mrproper
+
+distclean: mrproper
+ rm -f core `find . \( -not -type d \) -and \
+ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
+ -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
+
+backup: mrproper
+ cd .. && tar cf - linux/ | gzip -9 > backup.gz
+ sync
+
+sgmldocs:
+ chmod 755 $(TOPDIR)/scripts/docgen
+ chmod 755 $(TOPDIR)/scripts/gen-all-syms
+ chmod 755 $(TOPDIR)/scripts/kernel-doc
+ $(MAKE) -C $(TOPDIR)/Documentation/DocBook books
+
+psdocs: sgmldocs
+ $(MAKE) -C Documentation/DocBook ps
+
+pdfdocs: sgmldocs
+ $(MAKE) -C Documentation/DocBook pdf
+
+htmldocs: sgmldocs
+ $(MAKE) -C Documentation/DocBook html
+
+mandocs:
+ chmod 755 $(TOPDIR)/scripts/kernel-doc
+ chmod 755 $(TOPDIR)/scripts/split-man
+ $(MAKE) -C Documentation/DocBook man
+
+sums:
+ find . -type f -print | sort | xargs sum > .SUMS
+
+dep-files: scripts/mkdep archdep include/linux/version.h
+ scripts/mkdep -- init/*.c > .depend
+ scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
+ $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
+ifdef CONFIG_MODVERSIONS
+ $(MAKE) update-modverfile
+endif
+
+ifdef CONFIG_MODVERSIONS
+MODVERFILE := $(TOPDIR)/include/linux/modversions.h
+else
+MODVERFILE :=
+endif
+export MODVERFILE
+
+depend dep: dep-files
+
+checkconfig:
+ find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkconfig.pl
+
+checkhelp:
+ find * -name [cC]onfig.in -print | sort | xargs $(PERL) -w scripts/checkhelp.pl
+
+checkincludes:
+ find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkincludes.pl
+
+ifdef CONFIGURATION
+..$(CONFIGURATION):
+ @echo
+ @echo "You have a bad or nonexistent" .$(CONFIGURATION) ": running 'make" $(CONFIGURATION)"'"
+ @echo
+ $(MAKE) $(CONFIGURATION)
+ @echo
+ @echo "Successful. Try re-making (ignore the error that follows)"
+ @echo
+ exit 1
+
+#dummy: ..$(CONFIGURATION)
+dummy:
+
+else
+
+dummy:
+
+endif
+
+include Rules.make
+
+#
+# This generates dependencies for the .h files.
+#
+
+scripts/mkdep: scripts/mkdep.c
+ $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
+
+scripts/split-include: scripts/split-include.c
+ $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
+
+#
+# RPM target
+#
+# If you do a make spec before packing the tarball you can rpm -ta it
+#
+spec:
+ . scripts/mkspec >kernel.spec
+
+#
+# Build a tar ball, generate an rpm from it and pack the result
+# There arw two bits of magic here
+# 1) The use of /. to avoid tar packing just the symlink
+# 2) Removing the .dep files as they have source paths in them that
+# will become invalid
+#
+rpm: clean spec
+ find . \( -size 0 -o -name .depend -o -name .hdepend \) -type f -print | xargs rm -f
+ set -e; \
+ cd $(TOPDIR)/.. ; \
+ ln -sf $(TOPDIR) $(KERNELPATH) ; \
+ tar -cvz --exclude CVS -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
+ rm $(KERNELPATH) ; \
+ cd $(TOPDIR) ; \
+ . scripts/mkversion > .version ; \
+ rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
+ rm $(TOPDIR)/../$(KERNELPATH).tar.gz
diff -uNr linux-2.4.20/arch/alpha/mm/fault.c linux-2.4.20-ben10/arch/alpha/mm/fault.c
--- linux-2.4.20/arch/alpha/mm/fault.c 2002-11-29 00:53:08.000000000 +0100
+++ linux-2.4.20-ben10/arch/alpha/mm/fault.c 2003-03-23 11:56:35.000000000 +0100
@@ -124,7 +124,7 @@
goto good_area;
if (!(vma->vm_flags & VM_GROWSDOWN))
goto bad_area;
- if (expand_stack(vma, address))
+ if (expand_stack(vma, address, NULL))
goto bad_area;
/*
* Ok, we have a good vm_area for this memory access, so
diff -uNr linux-2.4.20/arch/arm/mm/fault-common.c linux-2.4.20-ben10/arch/arm/mm/fault-common.c
--- linux-2.4.20/arch/arm/mm/fault-common.c 2002-11-29 00:53:09.000000000 +0100
+++ linux-2.4.20-ben10/arch/arm/mm/fault-common.c 2003-03-23 12:01:02.000000000 +0100
@@ -229,7 +229,7 @@
goto survive;
check_stack:
- if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr))
+ if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr, NULL))
goto good_area;
out:
return fault;
diff -uNr linux-2.4.20/arch/cris/mm/fault.c linux-2.4.20-ben10/arch/cris/mm/fault.c
--- linux-2.4.20/arch/cris/mm/fault.c 2002-11-29 00:53:09.000000000 +0100
+++ linux-2.4.20-ben10/arch/cris/mm/fault.c 2003-03-23 11:56:56.000000000 +0100
@@ -315,7 +315,7 @@
if (address + PAGE_SIZE < rdusp())
goto bad_area;
}
- if (expand_stack(vma, address))
+ if (expand_stack(vma, address, NULL))
goto bad_area;
/*
diff -uNr linux-2.4.20/arch/i386/mm/fault.c linux-2.4.20-ben10/arch/i386/mm/fault.c
--- linux-2.4.20/arch/i386/mm/fault.c 2002-11-29 00:53:09.000000000 +0100
+++ linux-2.4.20-ben10/arch/i386/mm/fault.c 2003-03-23 11:56:23.000000000 +0100
@@ -32,7 +32,7 @@
*/
int __verify_write(const void * addr, unsigned long size)
{
- struct vm_area_struct * vma;
+ struct vm_area_struct * vma, * prev_vma;
unsigned long start = (unsigned long) addr;
if (!size)
@@ -78,7 +78,8 @@
check_stack:
if (!(vma->vm_flags & VM_GROWSDOWN))
goto bad_area;
- if (expand_stack(vma, start) == 0)
+ find_vma_prev(current->mm, start, &prev_vma);
+ if (expand_stack(vma, start, prev_vma) == 0)
goto good_area;
bad_area:
@@ -141,7 +142,7 @@
{
struct task_struct *tsk;
struct mm_struct *mm;
- struct vm_area_struct * vma;
+ struct vm_area_struct * vma, * prev_vma;
unsigned long address;
unsigned long page;
unsigned long fixup;
@@ -202,7 +203,8 @@
if (address + 32 < regs->esp)
goto bad_area;
}
- if (expand_stack(vma, address))
+ find_vma_prev(mm, address, &prev_vma);
+ if (expand_stack(vma, address, prev_vma))
goto bad_area;
/*
* Ok, we have a good vm_area for this memory access, so
diff -uNr linux-2.4.20/arch/ia64/mm/fault.c linux-2.4.20-ben10/arch/ia64/mm/fault.c
--- linux-2.4.20/arch/ia64/mm/fault.c 2002-11-29 00:53:09.000000000 +0100
+++ linux-2.4.20-ben10/arch/ia64/mm/fault.c 2003-03-23 11:56:35.000000000 +0100
@@ -134,7 +134,7 @@
if (rgn_index(address) != rgn_index(vma->vm_start)
|| rgn_offset(address) >= RGN_MAP_LIMIT)
goto bad_area;
- if (expand_stack(vma, address))
+ if (expand_stack(vma, address, NULL))
goto bad_area;
} else {
vma = prev_vma;
diff -uNr linux-2.4.20/arch/m68k/mm/fault.c linux-2.4.20-ben10/arch/m68k/mm/fault.c
--- linux-2.4.20/arch/m68k/mm/fault.c 2002-11-29 00:53:09.000000000 +0100
+++ linux-2.4.20-ben10/arch/m68k/mm/fault.c 2003-03-23 11:59:52.000000000 +0100
@@ -120,7 +120,7 @@
if (address + 256 < rdusp())
goto map_err;
}
- if (expand_stack(vma, address))
+ if (expand_stack(vma, address, NULL))
goto map_err;
/*
diff -uNr linux-2.4.20/arch/mips/mm/fault.c linux-2.4.20-ben10/arch/mips/mm/fault.c
--- linux-2.4.20/arch/mips/mm/fault.c 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.20-ben10/arch/mips/mm/fault.c 2003-03-23 11:56:22.000000000 +0100
@@ -113,7 +113,7 @@
goto good_area;
if (!(vma->vm_flags & VM_GROWSDOWN))
goto bad_area;
- if (expand_stack(vma, address))
+ if (expand_stack(vma, address, NULL))
goto bad_area;
/*
* Ok, we have a good vm_area for this memory access, so
diff -uNr linux-2.4.20/arch/mips64/mm/fault.c linux-2.4.20-ben10/arch/mips64/mm/fault.c
--- linux-2.4.20/arch/mips64/mm/fault.c 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.20-ben10/arch/mips64/mm/fault.c 2003-03-23 11:58:44.000000000 +0100
@@ -137,7 +137,7 @@
goto good_area;
if (!(vma->vm_flags & VM_GROWSDOWN))
goto bad_area;
- if (expand_stack(vma, address))
+ if (expand_stack(vma, address, NULL))
goto bad_area;
/*
* Ok, we have a good vm_area for this memory access, so
diff -uNr linux-2.4.20/arch/ppc/8260_io/Makefile linux-2.4.20-ben10/arch/ppc/8260_io/Makefile
--- linux-2.4.20/arch/ppc/8260_io/Makefile 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/8260_io/Makefile 2003-03-23 11:57:58.000000000 +0100
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.3 05/17/01 18:14:19 cort
+# BK Id: SCCS/s.Makefile 1.5 06/05/01 21:22:01 paulus
#
#
# Makefile for the linux MPC8xx ppc-specific parts of comm processor
diff -uNr linux-2.4.20/arch/ppc/8260_io/commproc.c linux-2.4.20-ben10/arch/ppc/8260_io/commproc.c
--- linux-2.4.20/arch/ppc/8260_io/commproc.c 2001-11-03 02:43:54.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/8260_io/commproc.c 2003-03-23 12:00:33.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.commproc.c 1.10 10/16/01 16:21:52 trini
+ * BK Id: SCCS/s.commproc.c 1.11 11/04/01 22:58:20 paulus
*/
/*
diff -uNr linux-2.4.20/arch/ppc/8260_io/enet.c linux-2.4.20-ben10/arch/ppc/8260_io/enet.c
--- linux-2.4.20/arch/ppc/8260_io/enet.c 2001-10-08 20:40:13.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/8260_io/enet.c 2003-03-23 11:56:23.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.enet.c 1.9 09/14/01 18:01:16 trini
+ * BK Id: SCCS/s.enet.c 1.10 10/08/01 16:49:24 trini
*/
/*
* Ethernet driver for Motorola MPC8260.
diff -uNr linux-2.4.20/arch/ppc/8260_io/fcc_enet.c linux-2.4.20-ben10/arch/ppc/8260_io/fcc_enet.c
--- linux-2.4.20/arch/ppc/8260_io/fcc_enet.c 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/8260_io/fcc_enet.c 2003-03-23 11:59:02.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fcc_enet.c 1.7 05/17/01 18:14:20 cort
+ * BK Id: SCCS/s.fcc_enet.c 1.11 06/05/01 21:22:01 paulus
*/
/*
* Fast Ethernet Controller (FCC) driver for Motorola MPC8260.
diff -uNr linux-2.4.20/arch/ppc/8260_io/uart.c linux-2.4.20-ben10/arch/ppc/8260_io/uart.c
--- linux-2.4.20/arch/ppc/8260_io/uart.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/8260_io/uart.c 2003-03-23 11:58:35.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.uart.c 1.13 12/29/01 14:50:03 trini
+ * BK Id: SCCS/s.uart.c 1.16 11/19/02 08:55:00 trini
*/
/*
* UART driver for MPC8260 CPM SCC or SMC
@@ -910,9 +910,9 @@
* enables, because we want to put them back if they were
* present.
*/
- prev_mode = smcp->smc_smcmr;
- smcp->smc_smcmr = smcr_mk_clen(bits) | cval | SMCMR_SM_UART;
- smcp->smc_smcmr |= (prev_mode & (SMCMR_REN | SMCMR_TEN));
+ prev_mode = smcp->smc_smcmr & (SMCMR_REN | SMCMR_TEN);
+ smcp->smc_smcmr = smcr_mk_clen(bits) | cval | SMCMR_SM_UART
+ | prev_mode;
}
else {
sccp = &immr->im_scc[idx - SCC_IDX_BASE];
diff -uNr linux-2.4.20/arch/ppc/8xx_io/Makefile linux-2.4.20-ben10/arch/ppc/8xx_io/Makefile
--- linux-2.4.20/arch/ppc/8xx_io/Makefile 2001-09-08 21:39:33.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/8xx_io/Makefile 2003-03-23 11:56:56.000000000 +0100
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.6 08/30/01 09:33:48 trini
+# BK Id: SCCS/s.Makefile 1.7 09/09/01 12:20:42 trini
#
#
# Makefile for the linux MPC8xx ppc-specific parts of comm processor
diff -uNr linux-2.4.20/arch/ppc/8xx_io/commproc.c linux-2.4.20-ben10/arch/ppc/8xx_io/commproc.c
--- linux-2.4.20/arch/ppc/8xx_io/commproc.c 2001-11-03 02:43:54.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/8xx_io/commproc.c 2003-03-23 11:57:12.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.commproc.c 1.15 10/16/01 16:21:52 trini
+ * BK Id: SCCS/s.commproc.c 1.16 11/04/01 22:58:20 paulus
*/
/*
diff -uNr linux-2.4.20/arch/ppc/8xx_io/enet.c linux-2.4.20-ben10/arch/ppc/8xx_io/enet.c
--- linux-2.4.20/arch/ppc/8xx_io/enet.c 2001-10-17 23:37:01.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/8xx_io/enet.c 2003-03-23 11:57:53.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.enet.c 1.17 10/11/01 11:55:47 trini
+ * BK Id: SCCS/s.enet.c 1.18 10/17/01 18:40:00 trini
*/
/*
* Ethernet driver for Motorola MPC8xx.
diff -uNr linux-2.4.20/arch/ppc/8xx_io/fec.c linux-2.4.20-ben10/arch/ppc/8xx_io/fec.c
--- linux-2.4.20/arch/ppc/8xx_io/fec.c 2002-11-29 00:53:10.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/8xx_io/fec.c 2003-03-23 11:56:33.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.fec.c 1.24 09/11/02 14:41:30 paulus
*/
/*
* Fast Ethernet Controller (FEC) driver for Motorola MPC8xx.
diff -uNr linux-2.4.20/arch/ppc/8xx_io/uart.c linux-2.4.20-ben10/arch/ppc/8xx_io/uart.c
--- linux-2.4.20/arch/ppc/8xx_io/uart.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/8xx_io/uart.c 2003-03-23 11:56:37.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.uart.c 1.23 12/29/01 14:50:03 trini
+ * BK Id: SCCS/s.uart.c 1.26 11/19/02 08:55:00 trini
*/
/*
* UART driver for MPC860 CPM SCC or SMC
@@ -1008,9 +1008,9 @@
* enables, because we want to put them back if they were
* present.
*/
- prev_mode = smcp->smc_smcmr;
- new_mode = smcr_mk_clen(bits) | cval | SMCMR_SM_UART;
- new_mode |= (prev_mode & (SMCMR_REN | SMCMR_TEN));
+ prev_mode = smcp->smc_smcmr & (SMCMR_REN | SMCMR_TEN);
+ new_mode = smcr_mk_clen(bits) | cval | SMCMR_SM_UART
+ | prev_mode;
if (!(prev_mode & SMCMR_PEN))
/* If parity is disabled, mask out even/odd */
prev_mode &= ~SMCMR_PM_EVEN;
diff -uNr linux-2.4.20/arch/ppc/Makefile linux-2.4.20-ben10/arch/ppc/Makefile
--- linux-2.4.20/arch/ppc/Makefile 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/Makefile 2003-03-23 11:59:39.000000000 +0100
@@ -1,4 +1,4 @@
-# BK Id: %F% %I% %G% %U% %#%
+# BK Id: SCCS/s.Makefile 1.31 11/27/02 12:15:43 benh
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
diff -uNr linux-2.4.20/arch/ppc/amiga/Makefile linux-2.4.20-ben10/arch/ppc/amiga/Makefile
--- linux-2.4.20/arch/ppc/amiga/Makefile 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/amiga/Makefile 2003-03-23 11:56:25.000000000 +0100
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.5 05/21/01 00:48:24 cort
+# BK Id: SCCS/s.Makefile 1.7 06/05/01 21:22:02 paulus
#
#
# Makefile for Linux arch/m68k/amiga source directory
diff -uNr linux-2.4.20/arch/ppc/amiga/amiga_ksyms.c linux-2.4.20-ben10/arch/ppc/amiga/amiga_ksyms.c
--- linux-2.4.20/arch/ppc/amiga/amiga_ksyms.c 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/amiga/amiga_ksyms.c 2003-03-23 12:00:14.000000000 +0100
@@ -1,4 +1,4 @@
/*
- * BK Id: SCCS/s.amiga_ksyms.c 1.5 05/17/01 18:14:20 cort
+ * BK Id: SCCS/s.amiga_ksyms.c 1.7 06/05/01 21:22:02 paulus
*/
#include "../../m68k/amiga/amiga_ksyms.c"
diff -uNr linux-2.4.20/arch/ppc/amiga/amiints.c linux-2.4.20-ben10/arch/ppc/amiga/amiints.c
--- linux-2.4.20/arch/ppc/amiga/amiints.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/amiga/amiints.c 2003-03-23 12:00:28.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.amiints.c 1.11 08/29/02 13:07:54 paulus
*/
/*
* linux/arch/m68k/amiga/amiints.c -- Amiga Linux interrupt handling code
diff -uNr linux-2.4.20/arch/ppc/amiga/amisound.c linux-2.4.20-ben10/arch/ppc/amiga/amisound.c
--- linux-2.4.20/arch/ppc/amiga/amisound.c 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/amiga/amisound.c 2003-03-23 11:58:51.000000000 +0100
@@ -1,4 +1,4 @@
/*
- * BK Id: SCCS/s.amisound.c 1.5 05/17/01 18:14:20 cort
+ * BK Id: SCCS/s.amisound.c 1.7 06/05/01 21:22:02 paulus
*/
#include "../../m68k/amiga/amisound.c"
diff -uNr linux-2.4.20/arch/ppc/amiga/bootinfo.c linux-2.4.20-ben10/arch/ppc/amiga/bootinfo.c
--- linux-2.4.20/arch/ppc/amiga/bootinfo.c 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/amiga/bootinfo.c 2003-03-23 11:56:33.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.bootinfo.c 1.5 05/17/01 18:14:20 cort
+ * BK Id: SCCS/s.bootinfo.c 1.7 06/05/01 21:22:02 paulus
*/
/*
* linux/arch/ppc/amiga/bootinfo.c
diff -uNr linux-2.4.20/arch/ppc/amiga/chipram.c linux-2.4.20-ben10/arch/ppc/amiga/chipram.c
--- linux-2.4.20/arch/ppc/amiga/chipram.c 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/amiga/chipram.c 2003-03-23 11:56:43.000000000 +0100
@@ -1,4 +1,4 @@
/*
- * BK Id: SCCS/s.chipram.c 1.7 05/21/01 00:49:49 cort
+ * BK Id: SCCS/s.chipram.c 1.9 06/05/01 21:22:02 paulus
*/
#include "../../m68k/amiga/chipram.c"
diff -uNr linux-2.4.20/arch/ppc/amiga/cia.c linux-2.4.20-ben10/arch/ppc/amiga/cia.c
--- linux-2.4.20/arch/ppc/amiga/cia.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/amiga/cia.c 2003-03-23 11:57:23.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.cia.c 1.10 08/29/02 13:07:54 paulus
*/
/*
* linux/arch/m68k/amiga/cia.c - CIA support
diff -uNr linux-2.4.20/arch/ppc/amiga/config.c linux-2.4.20-ben10/arch/ppc/amiga/config.c
--- linux-2.4.20/arch/ppc/amiga/config.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/amiga/config.c 2003-03-23 11:56:22.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.config.c 1.16 08/29/02 13:07:54 paulus
*/
#define m68k_debug_device debug_device
diff -uNr linux-2.4.20/arch/ppc/amiga/ints.c linux-2.4.20-ben10/arch/ppc/amiga/ints.c
--- linux-2.4.20/arch/ppc/amiga/ints.c 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/amiga/ints.c 2003-03-23 11:59:34.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.ints.c 1.5 05/17/01 18:14:20 cort
+ * BK Id: SCCS/s.ints.c 1.7 06/05/01 21:22:02 paulus
*/
/*
* linux/arch/ppc/amiga/ints.c
diff -uNr linux-2.4.20/arch/ppc/amiga/pcmcia.c linux-2.4.20-ben10/arch/ppc/amiga/pcmcia.c
--- linux-2.4.20/arch/ppc/amiga/pcmcia.c 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/amiga/pcmcia.c 2003-03-23 11:57:52.000000000 +0100
@@ -1,4 +1,4 @@
/*
- * BK Id: SCCS/s.pcmcia.c 1.5 05/17/01 18:14:20 cort
+ * BK Id: SCCS/s.pcmcia.c 1.7 06/05/01 21:22:02 paulus
*/
#include "../../m68k/amiga/pcmcia.c"
diff -uNr linux-2.4.20/arch/ppc/amiga/time.c linux-2.4.20-ben10/arch/ppc/amiga/time.c
--- linux-2.4.20/arch/ppc/amiga/time.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/amiga/time.c 2003-03-23 12:00:20.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.time.c 1.9 10/09/02 10:28:17 paulus
*/
#include /* CONFIG_HEARTBEAT */
#include
diff -uNr linux-2.4.20/arch/ppc/boot/chrp/Makefile linux-2.4.20-ben10/arch/ppc/boot/chrp/Makefile
--- linux-2.4.20/arch/ppc/boot/chrp/Makefile 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/chrp/Makefile 2003-04-02 22:20:01.000000000 +0200
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.15 01/11/02 10:46:06 trini
+# BK Id: SCCS/s.Makefile 1.16 03/07/02 13:42:36 trini
#
# Makefile for making ELF bootable images for booting on CHRP
# using Open Firmware.
@@ -12,7 +12,7 @@
LD_ARGS = -T ../ld.script -Ttext 0x00400000
OBJS = ../common/crt0.o start.o main.o misc.o ../common/string.o image.o \
- ../common/ofcommon.o
+ ../common/ofcommon.o ../common/div64.o
LIBS = $(TOPDIR)/lib/lib.a ../lib/zlib.a
ADDNOTE = ../utils/addnote
PIGGYBACK = ../utils/piggyback
diff -uNr linux-2.4.20/arch/ppc/boot/chrp/Makefile~ linux-2.4.20-ben10/arch/ppc/boot/chrp/Makefile~
--- linux-2.4.20/arch/ppc/boot/chrp/Makefile~ 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/boot/chrp/Makefile~ 2003-03-23 11:58:47.000000000 +0100
@@ -0,0 +1,69 @@
+# BK Id: SCCS/s.Makefile 1.16 03/07/02 13:42:36 trini
+#
+# Makefile for making ELF bootable images for booting on CHRP
+# using Open Firmware.
+#
+# Geert Uytterhoeven September 1997
+#
+# Based on coffboot by Paul Mackerras
+
+USE_STANDARD_AS_RULE := true
+
+LD_ARGS = -T ../ld.script -Ttext 0x00400000
+
+OBJS = ../common/crt0.o start.o main.o misc.o ../common/string.o image.o \
+ ../common/ofcommon.o
+LIBS = $(TOPDIR)/lib/lib.a ../lib/zlib.a
+ADDNOTE = ../utils/addnote
+PIGGYBACK = ../utils/piggyback
+
+ifeq ($(CONFIG_PPC64BRIDGE),y)
+END += .64
+AFLAGS += -Wa,-mppc64bridge
+endif
+ifeq ($(CONFIG_SMP),y)
+END += .smp
+endif
+
+TFTPIMAGE=/tftpboot/zImage.chrp$(END)
+
+AFLAGS_../common/crt0.o += -I$(TOPDIR)/arch/$(ARCH)/kernel
+
+all: zImage
+
+znetboot: zImage
+ cp -f $(TOPDIR)/vmlinux /tftpboot/vmlinux$(END)
+ cp ../images/zImage.chrp $(TFTPIMAGE)
+
+znetboot.initrd: zImage.initrd
+ cp ../images/zImage.initrd.chrp $(TFTPIMAGE)
+
+floppy: zImage
+ mcopy zImage a:zImage
+
+image.o: ../images/vmlinux.gz ../common/dummy.o
+ $(OBJCOPY) ../common/dummy.o $@ \
+ --add-section=.image=../images/vmlinux.gz \
+ --set-section-flags=.image=contents,alloc,load,readonly,data
+ifdef CONFIG_XMON
+ $(OBJCOPY) $@ $@ \
+ --add-section=.sysmap=$(TOPDIR)/System.map \
+ --set-section-flags=.sysmap=contents,alloc,load,readonly,data
+endif
+
+zImage: $(OBJS) $(LIBS) $(ADDNOTE)
+ $(LD) $(LD_ARGS) -o ../images/$@.chrp $(OBJS) $(LIBS)
+ $(OBJCOPY) ../images/$@.chrp ../images/$@.chrp -R .comment -R .ramdisk
+ cp ../images/$@.chrp ../images/$@.chrp-rs6k
+ $(ADDNOTE) ../images/$@.chrp-rs6k
+
+zImage.initrd: $(OBJS) $(LIBS) $(ADDNOTE) ../images/ramdisk.image.gz
+ $(OBJCOPY) image.o image.o \
+ --add-section=.ramdisk=../images/ramdisk.image.gz \
+ --set-section-flags=.ramdisk=contents,alloc,load,readonly,data
+ $(LD) $(LD_ARGS) -o ../images/$@.chrp $(OBJS) $(LIBS)
+ $(OBJCOPY) ../images/$@.chrp ../images/$@.chrp -R .comment
+ cp ../images/$@.chrp ../images/$@.chrp-rs6k
+ $(ADDNOTE) ../images/$@.chrp-rs6k
+
+include $(TOPDIR)/Rules.make
diff -uNr linux-2.4.20/arch/ppc/boot/chrp/main.c linux-2.4.20-ben10/arch/ppc/boot/chrp/main.c
--- linux-2.4.20/arch/ppc/boot/chrp/main.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/chrp/main.c 2003-03-23 11:56:19.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.main.c 1.16 01/12/02 10:36:33 trini
+ * BK Id: SCCS/s.main.c 1.17 03/07/02 13:42:36 trini
*/
/*
* Copyright (C) Paul Mackerras 1997.
diff -uNr linux-2.4.20/arch/ppc/boot/chrp/misc.S linux-2.4.20-ben10/arch/ppc/boot/chrp/misc.S
--- linux-2.4.20/arch/ppc/boot/chrp/misc.S 2001-05-25 00:02:06.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/chrp/misc.S 2003-03-23 11:59:42.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.misc.S 1.6 05/18/01 15:16:59 cort
+ * BK Id: SCCS/s.misc.S 1.7 06/05/01 20:20:04 paulus
*/
/*
* Copyright (C) Paul Mackerras 1997.
diff -uNr linux-2.4.20/arch/ppc/boot/chrp/start.c linux-2.4.20-ben10/arch/ppc/boot/chrp/start.c
--- linux-2.4.20/arch/ppc/boot/chrp/start.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/chrp/start.c 2003-03-23 11:56:33.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.start.c 1.8 07/25/01 18:13:07 trini
+ * BK Id: SCCS/s.start.c 1.10 06/25/02 10:29:26 paulus
*/
/*
* Copyright (C) Paul Mackerras 1997.
diff -uNr linux-2.4.20/arch/ppc/boot/common/crt0.S linux-2.4.20-ben10/arch/ppc/boot/common/crt0.S
--- linux-2.4.20/arch/ppc/boot/common/crt0.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/boot/common/crt0.S 2003-03-23 12:00:14.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.crt0.S 1.14 01/11/02 10:46:07 trini
+ * BK Id: SCCS/s.crt0.S 1.16 08/13/02 20:27:36 paulus
*/
/* Copyright (c) 1997 Paul Mackerras
* Initial Power Macintosh COFF version.
diff -uNr linux-2.4.20/arch/ppc/boot/common/div64.S linux-2.4.20-ben10/arch/ppc/boot/common/div64.S
--- linux-2.4.20/arch/ppc/boot/common/div64.S 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/boot/common/div64.S 2003-04-02 22:19:23.000000000 +0200
@@ -0,0 +1,58 @@
+/*
+ * Divide a 64-bit unsigned number by a 32-bit unsigned number.
+ * This routine assumes that the top 32 bits of the dividend are
+ * non-zero to start with.
+ * On entry, r3 points to the dividend, which get overwritten with
+ * the 64-bit quotient, and r4 contains the divisor.
+ * On exit, r3 contains the remainder.
+ *
+ * Copyright (C) 2002 Paul Mackerras, IBM Corp.
+ *
+ * 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.
+ */
+#include
+#include
+
+_GLOBAL(__div64_32)
+ lwz r5,0(r3) # get the dividend into r5/r6
+ lwz r6,4(r3)
+ cmplw r5,r4
+ li r7,0
+ li r8,0
+ blt 1f
+ divwu r7,r5,r4 # if dividend.hi >= divisor,
+ mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor
+ subf. r5,r0,r5 # dividend.hi %= divisor
+ beq 3f
+1: mr r11,r5 # here dividend.hi != 0
+ andis. r0,r5,0xc000
+ bne 2f
+ cntlzw r0,r5 # we are shifting the dividend right
+ li r10,-1 # to make it < 2^32, and shifting
+ srw r10,r10,r0 # the divisor right the same amount,
+ add r9,r4,r10 # rounding up (so the estimate cannot
+ andc r11,r6,r10 # ever be too large, only too small)
+ andc r9,r9,r10
+ or r11,r5,r11
+ rotlw r9,r9,r0
+ rotlw r11,r11,r0
+ divwu r11,r11,r9 # then we divide the shifted quantities
+2: mullw r10,r11,r4 # to get an estimate of the quotient,
+ mulhwu r9,r11,r4 # multiply the estimate by the divisor,
+ subfc r6,r10,r6 # take the product from the divisor,
+ add r8,r8,r11 # and add the estimate to the accumulated
+ subfe. r5,r9,r5 # quotient
+ bne 1b
+3: cmplw r6,r4
+ blt 4f
+ divwu r0,r6,r4 # perform the remaining 32-bit division
+ mullw r10,r0,r4 # and get the remainder
+ add r8,r8,r0
+ subf r6,r10,r6
+4: stw r7,0(r3) # return the quotient in *r3
+ stw r8,4(r3)
+ mr r3,r6 # return the remainder in r3
+ blr
diff -uNr linux-2.4.20/arch/ppc/boot/common/ns16550.c linux-2.4.20-ben10/arch/ppc/boot/common/ns16550.c
--- linux-2.4.20/arch/ppc/boot/common/ns16550.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/common/ns16550.c 2003-03-23 11:56:42.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.ns16550.c 1.16 03/13/02 09:17:06 trini
+ * BK Id: SCCS/s.ns16550.c 1.17 04/16/02 20:08:22 paulus
*/
/*
* COM1 NS16550 support
diff -uNr linux-2.4.20/arch/ppc/boot/common/string.S linux-2.4.20-ben10/arch/ppc/boot/common/string.S
--- linux-2.4.20/arch/ppc/boot/common/string.S 2001-05-25 00:02:06.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/common/string.S 2003-03-23 11:59:32.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.string.S 1.8 05/18/01 06:20:29 patch
+ * BK Id: SCCS/s.string.S 1.9 06/05/01 20:01:06 paulus
*/
/*
* String handling functions for PowerPC.
diff -uNr linux-2.4.20/arch/ppc/boot/include/nonstdio.h linux-2.4.20-ben10/arch/ppc/boot/include/nonstdio.h
--- linux-2.4.20/arch/ppc/boot/include/nonstdio.h 2001-08-28 15:58:33.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/include/nonstdio.h 2003-03-23 11:56:32.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.nonstdio.h 1.9 07/25/01 18:13:07 trini
+ * BK Id: SCCS/s.nonstdio.h 1.10 08/29/01 08:49:23 paulus
*/
/*
* Copyright (C) Paul Mackerras 1997.
diff -uNr linux-2.4.20/arch/ppc/boot/include/rs6000.h linux-2.4.20-ben10/arch/ppc/boot/include/rs6000.h
--- linux-2.4.20/arch/ppc/boot/include/rs6000.h 2001-05-25 00:02:06.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/include/rs6000.h 2003-03-23 11:58:13.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.rs6000.h 1.7 05/18/01 15:17:23 cort
+ * BK Id: SCCS/s.rs6000.h 1.8 06/05/01 20:20:05 paulus
*/
/* IBM RS/6000 "XCOFF" file definitions for BFD.
Copyright (C) 1990, 1991 Free Software Foundation, Inc.
diff -uNr linux-2.4.20/arch/ppc/boot/include/zlib.h linux-2.4.20-ben10/arch/ppc/boot/include/zlib.h
--- linux-2.4.20/arch/ppc/boot/include/zlib.h 2001-05-25 00:02:06.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/include/zlib.h 2003-03-23 11:56:25.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.zlib.h 1.8 05/18/01 15:17:23 cort
+ * BK Id: SCCS/s.zlib.h 1.9 06/05/01 20:20:05 paulus
*/
/*
* This file is derived from zlib.h and zconf.h from the zlib-0.95
diff -uNr linux-2.4.20/arch/ppc/boot/lib/zlib.c linux-2.4.20-ben10/arch/ppc/boot/lib/zlib.c
--- linux-2.4.20/arch/ppc/boot/lib/zlib.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/lib/zlib.c 2003-03-23 12:00:02.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.zlib.c 1.9 12/05/01 16:19:42 mporter
+ * BK Id: SCCS/s.zlib.c 1.12 03/21/02 14:10:28 trini
*/
/*
* This file is derived from various .h and .c files from the zlib-0.95
diff -uNr linux-2.4.20/arch/ppc/boot/pmac/Makefile linux-2.4.20-ben10/arch/ppc/boot/pmac/Makefile
--- linux-2.4.20/arch/ppc/boot/pmac/Makefile 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/pmac/Makefile 2003-04-02 22:20:10.000000000 +0200
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.19 01/16/02 11:08:07 trini
+# BK Id: SCCS/s.Makefile 1.20 03/07/02 13:42:36 trini
#
# Makefile for making XCOFF bootable images for booting on PowerMacs
# using Open Firmware.
@@ -12,7 +12,7 @@
COFF_LD_ARGS = -T ../ld.script -e _start -Ttext 0x00500000 -Bstatic
CHRP_LD_ARGS = -T ../ld.script -Ttext 0x01000000
-COMMONOBJS = start.o misc.o ../common/string.o ../common/ofcommon.o
+COMMONOBJS = start.o misc.o ../common/string.o ../common/ofcommon.o ../common/div64.o
COFFOBJS = ../common/coffcrt0.o $(COMMONOBJS) coffmain.o
CHRPOBJS = ../common/crt0.o $(COMMONOBJS) chrpmain.o
LIBS = $(TOPDIR)/lib/lib.a ../lib/zlib.a
diff -uNr linux-2.4.20/arch/ppc/boot/pmac/Makefile~ linux-2.4.20-ben10/arch/ppc/boot/pmac/Makefile~
--- linux-2.4.20/arch/ppc/boot/pmac/Makefile~ 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/boot/pmac/Makefile~ 2003-03-23 12:00:57.000000000 +0100
@@ -0,0 +1,112 @@
+# BK Id: SCCS/s.Makefile 1.20 03/07/02 13:42:36 trini
+#
+# Makefile for making XCOFF bootable images for booting on PowerMacs
+# using Open Firmware.
+#
+# Paul Mackerras January 1997
+#
+# Cleaned up, moved into arch/ppc/boot/pmac
+# Tom Rini January 2001
+
+OBJCOPY_ARGS = -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
+COFF_LD_ARGS = -T ../ld.script -e _start -Ttext 0x00500000 -Bstatic
+CHRP_LD_ARGS = -T ../ld.script -Ttext 0x01000000
+
+COMMONOBJS = start.o misc.o ../common/string.o ../common/ofcommon.o
+COFFOBJS = ../common/coffcrt0.o $(COMMONOBJS) coffmain.o
+CHRPOBJS = ../common/crt0.o $(COMMONOBJS) chrpmain.o
+LIBS = $(TOPDIR)/lib/lib.a ../lib/zlib.a
+
+MKNOTE := ../utils/mknote
+SIZE := ../utils/size
+OFFSET := ../utils/offset
+HACKCOFF := ../utils/hack-coff
+
+ifdef CONFIG_SMP
+END := .smp
+endif
+ifdef CONFIG_PPC64BRIDGE
+END += .64
+endif
+
+TFTPIMAGE=/tftpboot/zImage.pmac$(END)
+
+AFLAGS_../common/crt0.o += -I$(TOPDIR)/arch/$(ARCH)/kernel
+
+../common/coffcrt0.o:
+ $(MAKE) -C ../common coffcrt0.o
+
+image.o: ../images/vmlinux.gz ../common/dummy.o
+ $(OBJCOPY) ../common/dummy.o $@ -R .comment \
+ --add-section=.image=../images/vmlinux.gz \
+ --set-section-flags=.image=contents,alloc,load,readonly,data
+ifdef CONFIG_XMON
+ $(OBJCOPY) $@ $@ \
+ --add-section=.sysmap=$(TOPDIR)/System.map \
+ --set-section-flags=.sysmap=contents,alloc,load,readonly,data
+endif
+
+znetboot: vmlinux.coff vmlinux.elf-pmac zImage
+ cp ../images/vmlinux.coff $(TFTPIMAGE)
+ cp ../images/vmlinux.elf-pmac $(TFTPIMAGE).elf
+
+znetboot.initrd: vmlinux.initrd.coff vmlinux.initrd.elf-pmac
+ cp ../images/vmlinux.initrd.coff $(TFTPIMAGE)
+ cp ../images/vmlinux.initrd.elf-pmac $(TFTPIMAGE).elf
+
+miboot.image: ../common/dummy.o ../images/vmlinux.gz
+ $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=image=../images/vmlinux.gz \
+ ../common/dummy.o ../images/$@
+
+miboot.initrd.image: miboot.image ../images/ramdisk.image.gz
+ $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=initrd=../images/ramdisk.image.gz \
+ ../images/miboot.image ../images/$@
+
+coffboot: $(COFFOBJS) image.o $(LIBS) ../ld.script
+ $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) image.o $(LIBS)
+ $(OBJCOPY) $@ $@ -R .comment
+
+coffboot.initrd: $(COFFOBJS) image.o $(LIBS) ../ld.script \
+ ../images/ramdisk.image.gz
+ $(OBJCOPY) image.o image-coff.o \
+ --add-section=.ramdisk=../images/ramdisk.image.gz \
+ --set-section-flags=.ramdisk=contents,alloc,load,readonly,data
+ $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) image-coff.o $(LIBS)
+ $(OBJCOPY) $@ $@ -R .comment
+ rm -f image-coff.o
+
+vmlinux.coff: coffboot $(HACKCOFF)
+ $(OBJCOPY) $(OBJCOPY_ARGS) coffboot ../images/$@
+ $(HACKCOFF) ../images/$@
+ rm -f coffboot
+ ln -sf vmlinux.coff ../images/zImage.pmac
+
+vmlinux.initrd.coff: coffboot.initrd $(HACKCOFF)
+ $(OBJCOPY) $(OBJCOPY_ARGS) coffboot.initrd ../images/$@
+ $(HACKCOFF) ../images/$@
+ rm -f coffboot.initrd
+ ln -sf vmlinux.initrd.coff ../images/zImage.initrd.pmac
+
+vmlinux.elf-pmac: $(CHRPOBJS) $(LIBS) $(MKNOTE) image.o
+ $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) $(LIBS) image.o
+ $(MKNOTE) > note
+ $(OBJCOPY) ../images/$@ ../images/$@ --add-section=.note=note \
+ -R .comment -R .ramdisk
+ rm -f note
+
+vmlinux.initrd.elf-pmac: $(CHRPOBJS) $(LIBS) $(MKNOTE) image.o \
+ ../images/ramdisk.image.gz
+ $(OBJCOPY) image.o image-elf.o \
+ --add-section=.ramdisk=../images/ramdisk.image.gz \
+ --set-section-flags=.ramdisk=contents,alloc,load,readonly,data
+ $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) $(LIBS) image-elf.o
+ $(MKNOTE) > note
+ $(OBJCOPY) ../images/$@ ../images/$@ --add-section=.note=note \
+ -R .comment
+ rm -f note image-elf.o
+
+zImage: vmlinux.coff vmlinux.elf-pmac miboot.image
+
+zImage.initrd: vmlinux.initrd.coff vmlinux.initrd.elf-pmac miboot.initrd.image
+
+include $(TOPDIR)/Rules.make
diff -uNr linux-2.4.20/arch/ppc/boot/pmac/chrpmain.c linux-2.4.20-ben10/arch/ppc/boot/pmac/chrpmain.c
--- linux-2.4.20/arch/ppc/boot/pmac/chrpmain.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/pmac/chrpmain.c 2003-03-23 12:00:39.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.chrpmain.c 1.18 01/11/02 10:46:07 trini
+ * BK Id: SCCS/s.chrpmain.c 1.19 03/07/02 13:42:37 trini
*/
/*
* Copyright (C) Paul Mackerras 1997.
diff -uNr linux-2.4.20/arch/ppc/boot/pmac/misc.S linux-2.4.20-ben10/arch/ppc/boot/pmac/misc.S
--- linux-2.4.20/arch/ppc/boot/pmac/misc.S 2001-05-25 00:02:07.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/pmac/misc.S 2003-03-23 11:56:45.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.misc.S 1.6 05/18/01 15:17:15 cort
+ * BK Id: SCCS/s.misc.S 1.7 06/05/01 20:20:05 paulus
*/
/*
* Copyright (C) Paul Mackerras 1997.
diff -uNr linux-2.4.20/arch/ppc/boot/pmac/start.c linux-2.4.20-ben10/arch/ppc/boot/pmac/start.c
--- linux-2.4.20/arch/ppc/boot/pmac/start.c 2001-08-28 15:58:33.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/pmac/start.c 2003-03-23 11:59:59.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.start.c 1.10 07/25/01 18:13:07 trini
+ * BK Id: SCCS/s.start.c 1.11 08/29/01 08:49:23 paulus
*/
/*
* Copyright (C) Paul Mackerras 1997.
diff -uNr linux-2.4.20/arch/ppc/boot/prep/Makefile linux-2.4.20-ben10/arch/ppc/boot/prep/Makefile
--- linux-2.4.20/arch/ppc/boot/prep/Makefile 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/prep/Makefile 2003-04-02 22:19:10.000000000 +0200
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.30 01/26/02 12:27:41 trini
+# BK Id: SCCS/s.Makefile 1.32 08/29/02 13:11:12 paulus
#
# arch/ppc/boot/Makefile
#
@@ -25,7 +25,7 @@
LD_ARGS = -T ../ld.script -Ttext 0x00800000 -Bstatic
obj-y := head.o ../simple/legacy.o misc.o of1275.o \
../common/util.o ../common/string.o \
- ../common/misc-common.o
+ ../common/misc-common.o ../common/div64.o
OBJCOPY_ARGS = -O elf32-powerpc
LIBS = ../lib/zlib.a
diff -uNr linux-2.4.20/arch/ppc/boot/prep/Makefile~ linux-2.4.20-ben10/arch/ppc/boot/prep/Makefile~
--- linux-2.4.20/arch/ppc/boot/prep/Makefile~ 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/boot/prep/Makefile~ 2003-03-23 12:01:08.000000000 +0100
@@ -0,0 +1,82 @@
+# BK Id: SCCS/s.Makefile 1.32 08/29/02 13:11:12 paulus
+#
+# arch/ppc/boot/Makefile
+#
+# This file is subject to the terms and conditions of the GNU General Public
+# License. See the file "COPYING" in the main directory of this archive
+# for more details.
+#
+# Tom Rini January 2001
+#
+# Originally:
+# arch/ppc/boot/Makefile
+# Copyright (C) 1994 by Linus Torvalds
+# Adapted for PowerPC by Gary Thomas
+# modified by Cort (cort@cs.nmt.edu)
+#
+
+USE_STANDARD_AS_RULE := true
+
+TFTPIMAGE = /tftpboot/zImage.prep
+ifeq ($(CONFIG_SMP),y)
+TFTPIMAGE = $(TFTPBOOT).smp
+endif
+
+LD_ARGS = -T ../ld.script -Ttext 0x00800000 -Bstatic
+obj-y := head.o ../simple/legacy.o misc.o of1275.o \
+ ../common/util.o ../common/string.o \
+ ../common/misc-common.o
+OBJCOPY_ARGS = -O elf32-powerpc
+LIBS = ../lib/zlib.a
+
+obj-$(CONFIG_SERIAL_CONSOLE) += ../common/ns16550.o
+obj-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
+
+# Tools
+MKPREP := ../utils/mkprep
+SIZE := ../utils/size
+OFFSET := ../utils/offset
+
+# Extra include search dirs
+CFLAGS_kbd.o += -I$(TOPDIR)/drivers/char
+AFLAGS_head.o += -I$(TOPDIR)/arch/$(ARCH)/kernel
+AFLAGS_../common/util.o += -I$(TOPDIR)/arch/$(ARCH)/kernel
+AFLAGS_../common/relocate.o += -I$(TOPDIR)/arch/$(ARCH)/kernel
+AFLAGS_../simple/legacy.o += -I$(TOPDIR)/arch/$(ARCH)/kernel
+
+all: zImage
+
+zImage: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz ../common/dummy.o \
+ $(MKPREP)
+ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
+ --add-section=.image=../images/vmlinux.gz \
+ --set-section-flags=.image=contents,alloc,load,readonly,data \
+ ../common/dummy.o image.o
+ $(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS)
+ $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr
+ $(MKPREP) -pbp $@ ../images/$@.prep
+ rm -f $@
+
+zImage.initrd: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz $(MKPREP) \
+ ../common/dummy.o
+ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
+ --add-section=.ramdisk=../images/ramdisk.image.gz \
+ --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \
+ --add-section=.image=../images/vmlinux.gz \
+ --set-section-flags=.image=contents,alloc,load,readonly,data \
+ ../common/dummy.o image.o
+ $(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS)
+ $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr
+ $(MKPREP) -pbp $@ ../images/$@.prep
+ rm -f $@
+
+floppy: zImage
+ dd if=../images/zImage.prep of=/dev/fd0H1440 bs=64b
+
+znetboot : zImage
+ cp ../images/zImage.prep $(TFTPIMAGE)
+
+znetboot.initrd : zImage.initrd
+ cp ../images/zImage.initrd.prep $(TFTPIMAGE)
+
+include $(TOPDIR)/Rules.make
diff -uNr linux-2.4.20/arch/ppc/boot/prep/head.S linux-2.4.20-ben10/arch/ppc/boot/prep/head.S
--- linux-2.4.20/arch/ppc/boot/prep/head.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/boot/prep/head.S 2003-03-23 11:56:25.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.head.S 1.13 01/11/02 10:46:07 trini
+ * BK Id: SCCS/s.head.S 1.15 08/13/02 21:25:13 paulus
*/
#include
diff -uNr linux-2.4.20/arch/ppc/boot/prep/iso_font.h linux-2.4.20-ben10/arch/ppc/boot/prep/iso_font.h
--- linux-2.4.20/arch/ppc/boot/prep/iso_font.h 2001-05-25 00:02:07.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/prep/iso_font.h 2003-03-23 11:59:38.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.iso_font.h 1.6 05/18/01 15:16:42 cort
+ * BK Id: SCCS/s.iso_font.h 1.7 06/05/01 20:20:05 paulus
*/
static const unsigned char font[] = {
/* 0x00 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff -uNr linux-2.4.20/arch/ppc/boot/prep/kbd.c linux-2.4.20-ben10/arch/ppc/boot/prep/kbd.c
--- linux-2.4.20/arch/ppc/boot/prep/kbd.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/prep/kbd.c 2003-03-23 11:58:10.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.kbd.c 1.9 01/11/02 10:46:07 trini
+ * BK Id: SCCS/s.kbd.c 1.10 03/07/02 13:42:37 trini
*/
#include
diff -uNr linux-2.4.20/arch/ppc/boot/prep/misc.c linux-2.4.20-ben10/arch/ppc/boot/prep/misc.c
--- linux-2.4.20/arch/ppc/boot/prep/misc.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/prep/misc.c 2003-03-23 11:56:24.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.misc.c 1.25 01/26/02 12:27:41 trini
+ * BK Id: SCCS/s.misc.c 1.27 03/07/02 13:42:37 trini
*
* arch/ppc/boot/prep/misc.c
*
diff -uNr linux-2.4.20/arch/ppc/boot/prep/of1275.c linux-2.4.20-ben10/arch/ppc/boot/prep/of1275.c
--- linux-2.4.20/arch/ppc/boot/prep/of1275.c 2001-05-25 00:02:07.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/prep/of1275.c 2003-03-23 11:57:59.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.of1275.c 1.6 05/18/01 15:16:42 cort
+ * BK Id: SCCS/s.of1275.c 1.7 06/05/01 20:20:05 paulus
*/
/* Open Firmware Client Interface */
diff -uNr linux-2.4.20/arch/ppc/boot/prep/of1275.h linux-2.4.20-ben10/arch/ppc/boot/prep/of1275.h
--- linux-2.4.20/arch/ppc/boot/prep/of1275.h 2001-05-25 00:02:07.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/prep/of1275.h 2003-03-23 11:57:27.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.of1275.h 1.6 05/18/01 15:16:42 cort
+ * BK Id: SCCS/s.of1275.h 1.7 06/05/01 20:20:05 paulus
*/
/* 6.3.2.1 Client interface */
diff -uNr linux-2.4.20/arch/ppc/boot/prep/vreset.c linux-2.4.20-ben10/arch/ppc/boot/prep/vreset.c
--- linux-2.4.20/arch/ppc/boot/prep/vreset.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/prep/vreset.c 2003-03-23 11:58:09.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.vreset.c 1.13 01/11/02 10:46:08 trini
+ * BK Id: SCCS/s.vreset.c 1.14 03/07/02 13:42:37 trini
*/
/*
* vreset.c
diff -uNr linux-2.4.20/arch/ppc/boot/simple/Makefile linux-2.4.20-ben10/arch/ppc/boot/simple/Makefile
--- linux-2.4.20/arch/ppc/boot/simple/Makefile 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/boot/simple/Makefile 2003-04-02 22:20:29.000000000 +0200
@@ -67,7 +67,7 @@
# head.o and ../common/relocate.o must be at the start.
obj-y := head.o ../common/relocate.o $(EXTRA) \
- $(MISC) ../common/misc-common.o \
+ $(MISC) ../common/misc-common.o ../common/div64.o \
../common/string.o ../common/util.o
obj-$(CONFIG_4xx) += embed_config.o
obj-$(CONFIG_8xx) += embed_config.o
diff -uNr linux-2.4.20/arch/ppc/boot/simple/Makefile~ linux-2.4.20-ben10/arch/ppc/boot/simple/Makefile~
--- linux-2.4.20/arch/ppc/boot/simple/Makefile~ 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/boot/simple/Makefile~ 2003-03-23 11:56:33.000000000 +0100
@@ -0,0 +1,157 @@
+# This is far from simple, but I couldn't think of a good name. This is
+# for making the 'zImage' or 'zImage.initrd' on a number of targets.
+#
+# Author: Tom Rini
+#
+# Copyright 2001-2002 MontaVista Software Inc.
+#
+# Notes:
+# (1) For machine targets which produce more than one image, define
+# ZNETBOOT and ZNETBOOTRD to the image which should be available for
+# 'znetboot' and 'znetboot.initrd`
+# (2) For machine targets which use the mktree program, define END to be
+# the machine name you want in the image, and you can optionally set
+# ENTRYPOINT which the image should be loaded at. The optimal setting
+# for ENTRYPOINT is the link address.
+#
+# 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.
+
+USE_STANDARD_AS_RULE := true
+
+# Normally, we use the 'misc-simple.c' file for decompress_kernel and
+# whatnot. Sometimes we need to override this however.
+MISC := ../common/misc-simple.o
+ifeq ($(CONFIG_EMBEDDEDBOOT),y)
+ZIMAGE := zImage-EMBEDDED
+ZIMAGEINITRD := zImage.initrd-EMBEDDED
+TFTPIMAGE := /tftpboot/zImage.embedded
+MISC := misc-embedded.o
+endif
+ifeq ($(CONFIG_GEMINI),y)
+ZIMAGE := zImage-SMON
+ZIMAGEINITRD := zImage.initrd-SMON
+EXTRA := direct.o
+TFTPIMAGE := /tftpboot/zImage.gemini
+endif
+ifeq ($(CONFIG_PAL4),y)
+ZIMAGE := zImage-PAL4
+ZIMAGEINITRD := zImage.initrd-PAL4
+EXTRA := direct.o
+TFTPIMAGE := /tftpboot/zImage.pal4
+endif
+ifeq ($(CONFIG_SPRUCE),y)
+ZIMAGE := zImage-TREE
+ZIMAGEINITRD := zImage.initrd-TREE
+EXTRA := direct.o
+ENTRYPOINT := 0x00800000
+MISC := misc-spruce.o
+END := spruce
+TFTPIMAGE := /tftpboot/zImage.$(END)
+endif
+ifeq ($(CONFIG_SMP),y)
+TFTPIMAGE += .smp
+endif
+
+# Setup a default address to put ourselves, change it as needed.
+LD_ARGS = -T ../ld.script -Ttext 0x00800000 -Bstatic
+ifdef CONFIG_8xx
+LD_ARGS := -T ../ld.script -Ttext 0x00180000 -Bstatic
+endif
+ifeq ($(CONFIG_8260)$(CONFIG_4xx),y)
+LD_ARGS := -T ../ld.script -Ttext 0x00400000 -Bstatic
+endif
+OBJCOPY_ARGS := -O elf32-powerpc
+
+# head.o and ../common/relocate.o must be at the start.
+obj-y := head.o ../common/relocate.o $(EXTRA) \
+ $(MISC) ../common/misc-common.o \
+ ../common/string.o ../common/util.o
+obj-$(CONFIG_4xx) += embed_config.o
+obj-$(CONFIG_8xx) += embed_config.o
+obj-$(CONFIG_8260) += embed_config.o
+obj-$(CONFIG_BSEIP) += iic.o
+obj-$(CONFIG_MBX) += iic.o
+obj-$(CONFIG_RPXCLASSIC) += iic.o
+obj-$(CONFIG_RPXLITE) += iic.o
+# Different boards need different serial implementations.
+ifeq ($(CONFIG_SERIAL_CONSOLE),y)
+obj-$(CONFIG_8xx) += m8xx_tty.o
+obj-$(CONFIG_8260) += m8260_tty.o
+obj-$(CONFIG_SERIAL) += ../common/ns16550.o
+endif
+
+LIBS := ../lib/zlib.a
+
+# Tools
+MKPREP := ../utils/mkprep
+MKTREE := ../utils/mktree
+
+zvmlinux: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz ../common/dummy.o
+ $(OBJCOPY) $(OBJCOPY_ARGS) \
+ --add-section=.image=../images/vmlinux.gz \
+ --set-section-flags=.image=contents,alloc,load,readonly,data \
+ ../common/dummy.o image.o
+ $(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS)
+ $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr \
+ -R .ramdisk -R .sysmap
+
+zvmlinux.initrd: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz \
+ ../common/dummy.o
+ $(OBJCOPY) $(OBJCOPY_ARGS) \
+ --add-section=.ramdisk=../images/ramdisk.image.gz \
+ --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \
+ --add-section=.image=../images/vmlinux.gz \
+ --set-section-flags=.image=contents,alloc,load,readonly,data \
+ ../common/dummy.o image.o
+ $(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS)
+ $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr \
+ -R .sysmap
+
+# Sort-of dummy rules, that let us format the image we want.
+zImage: $(ZIMAGE)
+ rm -f zvmlinux
+zImage.initrd: $(ZIMAGEINITRD)
+ rm -f zvmlinux.initrd
+
+znetboot: zImage
+ifneq ($(ZNETBOOT),)
+ cp ../images/$(ZNETBOOT) $(TFTPIMAGE)
+else
+ cp ../images/zImage.* $(TFTPIMAGE)
+endif
+
+znetboot.initrd: zImage.initrd
+ifneq ($(ZNETBOOTRD),)
+ cp ../images/$(ZNETBOOTRD) $(TFTPIMAGE)
+else
+ cp ../images/zImage.* $(TFTPIMAGE)
+endif
+
+zImage-EMBEDDED: zvmlinux
+ mv zvmlinux ../images/zImage.embedded
+
+zImage.initrd-EMBEDDED: zvmlinux.initrd
+ mv zvmlinux.initrd ../images/zImage.initrd.embedded
+
+zImage-PAL4: zvmlinux
+ cp zvmlinux ../images/zImage.pal4
+
+zImage.initrd-PAL4: zvmlinux.initrd
+ cp zvmlinux.initrd ../images/zImage.initrd.pal4
+
+zImage-SMON: zvmlinux
+ dd if=zvmlinux of=../images/zImage.gemini skip=64 bs=1k
+
+zImage.initrd-SMON: zvmlinux.initrd
+ dd if=zvmlinux.initrd of=../images/zImage.initrd.gemini skip=64 bs=1k
+
+zImage-TREE: zvmlinux
+ $(MKTREE) zvmlinux ../images/zImage.$(END) $(ENTRYPOINT)
+
+zImage.initrd-TREE: zvmlinux.initrd
+ $(MKTREE) zvmlinux.initrd ../images/zImage.initrd.$(END) $(ENTRYPOINT)
+
+include $(TOPDIR)/Rules.make
diff -uNr linux-2.4.20/arch/ppc/boot/utils/addnote.c linux-2.4.20-ben10/arch/ppc/boot/utils/addnote.c
--- linux-2.4.20/arch/ppc/boot/utils/addnote.c 2001-05-25 00:02:07.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/utils/addnote.c 2003-03-23 11:56:21.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.addnote.c 1.7 05/18/01 15:17:23 cort
+ * BK Id: SCCS/s.addnote.c 1.8 06/05/01 20:20:06 paulus
*/
/*
* Program to hack in a PT_NOTE program header entry in an ELF file.
diff -uNr linux-2.4.20/arch/ppc/boot/utils/hack-coff.c linux-2.4.20-ben10/arch/ppc/boot/utils/hack-coff.c
--- linux-2.4.20/arch/ppc/boot/utils/hack-coff.c 2001-05-25 00:02:07.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/utils/hack-coff.c 2003-03-23 12:00:39.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.hack-coff.c 1.8 05/18/01 06:20:29 patch
+ * BK Id: SCCS/s.hack-coff.c 1.9 06/05/01 20:20:06 paulus
*/
/*
* hack-coff.c - hack the header of an xcoff file to fill in
diff -uNr linux-2.4.20/arch/ppc/boot/utils/mknote.c linux-2.4.20-ben10/arch/ppc/boot/utils/mknote.c
--- linux-2.4.20/arch/ppc/boot/utils/mknote.c 2001-05-25 00:02:07.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/utils/mknote.c 2003-03-23 11:58:42.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mknote.c 1.7 05/18/01 15:17:23 cort
+ * BK Id: SCCS/s.mknote.c 1.8 06/05/01 20:20:06 paulus
*/
/*
* Copyright (C) Cort Dougan 1999.
diff -uNr linux-2.4.20/arch/ppc/boot/utils/mkprep.c linux-2.4.20-ben10/arch/ppc/boot/utils/mkprep.c
--- linux-2.4.20/arch/ppc/boot/utils/mkprep.c 2001-05-25 00:02:07.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/boot/utils/mkprep.c 2003-03-23 11:56:35.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mkprep.c 1.7 05/18/01 06:20:29 patch
+ * BK Id: SCCS/s.mkprep.c 1.8 06/05/01 20:20:06 paulus
*/
/*
* Makes a prep bootable image which can be dd'd onto
diff -uNr linux-2.4.20/arch/ppc/config.in linux-2.4.20-ben10/arch/ppc/config.in
--- linux-2.4.20/arch/ppc/config.in 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/config.in 2003-03-23 11:56:33.000000000 +0100
@@ -1,4 +1,4 @@
-# BK Id: %F% %I% %G% %U% %#%
+# BK Id: SCCS/s.config.in 1.54 05/21/02 16:43:05 benh
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
@@ -52,6 +52,17 @@
define_bool CONFIG_PPC_STD_MMU n
fi
+bool 'CPU Frequency scaling' CONFIG_CPU_FREQ
+if [ "$CONFIG_CPU_FREQ" = "y" ]; then
+ bool ' /proc/sys/cpu/ interface (2.4.)' CONFIG_CPU_FREQ_24_API
+ if [ "$CONFIG_CPU_FREQ_24_API" = "n" ]; then
+ define_bool CONFIG_CPU_FREQ_26_API y
+ fi
+ if [ "$CONFIG_ADB_PMU" = "y" ]; then
+ bool " Support for Apple PowerBooks" CONFIG_CPU_FREQ_PMAC
+ fi
+fi
+
if [ "$CONFIG_8260" = "y" ]; then
define_bool CONFIG_SERIAL_CONSOLE y
bool 'Support for EST8260' CONFIG_EST8260
diff -uNr linux-2.4.20/arch/ppc/configs/pmac_defconfig linux-2.4.20-ben10/arch/ppc/configs/pmac_defconfig
--- linux-2.4.20/arch/ppc/configs/pmac_defconfig 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/configs/pmac_defconfig 2003-04-03 00:10:11.000000000 +0200
@@ -30,6 +30,10 @@
# CONFIG_8xx is not set
# CONFIG_8260 is not set
CONFIG_PPC_STD_MMU=y
+CONFIG_CPU_FREQ=y
+# CONFIG_CPU_FREQ_24_API is not set
+CONFIG_CPU_FREQ_26_API=y
+CONFIG_CPU_FREQ_PMAC=y
CONFIG_ALL_PPC=y
# CONFIG_APUS is not set
# CONFIG_SPRUCE is not set
@@ -37,9 +41,7 @@
# CONFIG_GEMINI is not set
# CONFIG_SMP is not set
CONFIG_ALTIVEC=y
-CONFIG_TAU=y
-# CONFIG_TAU_INT is not set
-# CONFIG_TAU_AVERAGE is not set
+# CONFIG_TAU is not set
CONFIG_PPC_ISATIMER=y
#
@@ -78,7 +80,7 @@
CONFIG_PPC_RTC=y
CONFIG_PPC601_SYNC_FIX=y
CONFIG_PROC_DEVICETREE=y
-CONFIG_PPC_RTAS=y
+# CONFIG_PPC_RTAS is not set
CONFIG_BOOTX_TEXT=y
# CONFIG_PREP_RESIDUAL is not set
# CONFIG_PROC_PREPRESIDUAL is not set
@@ -98,7 +100,7 @@
#
# Block devices
#
-CONFIG_BLK_DEV_FD=m
+# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_CPQ_DA is not set
@@ -152,7 +154,7 @@
CONFIG_IP_NF_CONNTRACK=m
CONFIG_IP_NF_FTP=m
CONFIG_IP_NF_IRC=m
-# CONFIG_IP_NF_QUEUE is not set
+CONFIG_IP_NF_QUEUE=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_MATCH_LIMIT=m
CONFIG_IP_NF_MATCH_MAC=m
@@ -182,8 +184,12 @@
CONFIG_IP_NF_NAT_SNMP_BASIC=m
CONFIG_IP_NF_NAT_IRC=m
CONFIG_IP_NF_NAT_FTP=m
-# CONFIG_IP_NF_MANGLE is not set
-# CONFIG_IP_NF_TARGET_LOG is not set
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_MARK=m
+CONFIG_IP_NF_TARGET_LOG=m
CONFIG_IP_NF_TARGET_ULOG=m
CONFIG_IP_NF_TARGET_TCPMSS=m
CONFIG_IP_NF_ARPTABLES=m
@@ -193,7 +199,13 @@
# CONFIG_IP_NF_COMPAT_IPFWADM is not set
# CONFIG_IPV6 is not set
# CONFIG_KHTTPD is not set
-# CONFIG_ATM is not set
+CONFIG_ATM=y
+CONFIG_ATM_CLIP=y
+CONFIG_ATM_CLIP_NO_ICMP=y
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
# CONFIG_VLAN_8021Q is not set
#
@@ -258,7 +270,7 @@
CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDETAPE is not set
CONFIG_BLK_DEV_IDEFLOPPY=y
-CONFIG_BLK_DEV_IDESCSI=y
+CONFIG_BLK_DEV_IDESCSI=m
# CONFIG_IDE_TASK_IOCTL is not set
#
@@ -273,7 +285,7 @@
CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
-CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_PCI_AUTO is not set
# CONFIG_IDEDMA_ONLYDISK is not set
CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
@@ -286,7 +298,7 @@
# CONFIG_WDC_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD74XX is not set
# CONFIG_AMD74XX_OVERRIDE is not set
-CONFIG_BLK_DEV_CMD64X=y
+# CONFIG_BLK_DEV_CMD64X is not set
# CONFIG_BLK_DEV_CMD680 is not set
# CONFIG_BLK_DEV_CY82C693 is not set
# CONFIG_BLK_DEV_CS5530 is not set
@@ -295,9 +307,9 @@
# CONFIG_BLK_DEV_HPT366 is not set
# CONFIG_BLK_DEV_NS87415 is not set
# CONFIG_BLK_DEV_OPTI621 is not set
-# CONFIG_BLK_DEV_PDC202XX is not set
-# CONFIG_PDC202XX_BURST is not set
-# CONFIG_PDC202XX_FORCE is not set
+CONFIG_BLK_DEV_PDC202XX=y
+CONFIG_PDC202XX_BURST=y
+CONFIG_PDC202XX_FORCE=y
# CONFIG_BLK_DEV_SVWKS is not set
# CONFIG_BLK_DEV_SIS5513 is not set
# CONFIG_BLK_DEV_SLC90E66 is not set
@@ -353,15 +365,11 @@
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
# CONFIG_SCSI_AACRAID is not set
-CONFIG_SCSI_AIC7XXX=m
+CONFIG_SCSI_AIC7XXX=y
CONFIG_AIC7XXX_CMDS_PER_DEVICE=253
CONFIG_AIC7XXX_RESET_DELAY_MS=15000
# CONFIG_AIC7XXX_PROBE_EISA_VL is not set
# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
-CONFIG_SCSI_AIC7XXX_OLD=m
-# CONFIG_AIC7XXX_OLD_TCQ_ON_BY_DEFAULT is not set
-CONFIG_AIC7XXX_OLD_CMDS_PER_DEVICE=8
-CONFIG_AIC7XXX_OLD_PROC_STATS=y
# CONFIG_SCSI_DPT_I2O is not set
CONFIG_SCSI_ADVANSYS=m
# CONFIG_SCSI_IN2000 is not set
@@ -402,7 +410,7 @@
# CONFIG_SCSI_DEBUG is not set
CONFIG_SCSI_MESH=y
CONFIG_SCSI_MESH_SYNC_RATE=5
-CONFIG_SCSI_MESH_RESET_DELAY_MS=500
+CONFIG_SCSI_MESH_RESET_DELAY_MS=4000
CONFIG_SCSI_MAC53C94=y
#
@@ -413,25 +421,22 @@
#
# IEEE 1394 (FireWire) support (EXPERIMENTAL)
#
-CONFIG_IEEE1394=m
+CONFIG_IEEE1394=y
#
# Device Drivers
#
-
-#
-# Texas Instruments PCILynx requires I2C bit-banging
-#
-CONFIG_IEEE1394_OHCI1394=m
+CONFIG_IEEE1394_PCILYNX=m
+CONFIG_IEEE1394_OHCI1394=y
#
# Protocol Drivers
#
CONFIG_IEEE1394_VIDEO1394=m
-CONFIG_IEEE1394_SBP2=m
+CONFIG_IEEE1394_SBP2=y
# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
CONFIG_IEEE1394_ETH1394=m
-# CONFIG_IEEE1394_DV1394 is not set
+CONFIG_IEEE1394_DV1394=m
CONFIG_IEEE1394_RAWIO=m
# CONFIG_IEEE1394_CMP is not set
# CONFIG_IEEE1394_VERBOSEDEBUG is not set
@@ -448,7 +453,7 @@
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
+CONFIG_TUN=m
# CONFIG_ETHERTAP is not set
#
@@ -529,6 +534,7 @@
CONFIG_PPP_DEFLATE=y
CONFIG_PPP_BSDCOMP=m
# CONFIG_PPPOE is not set
+# CONFIG_PPPOATM is not set
# CONFIG_SLIP is not set
#
@@ -590,6 +596,21 @@
# CONFIG_AIRONET4500_CS is not set
#
+# ATM drivers
+#
+# CONFIG_ATM_TCP is not set
+# CONFIG_ATM_LANAI is not set
+# CONFIG_ATM_ENI is not set
+# CONFIG_ATM_FIRESTREAM is not set
+# CONFIG_ATM_ZATM is not set
+# CONFIG_ATM_NICSTAR is not set
+# CONFIG_ATM_IDT77252 is not set
+# CONFIG_ATM_AMBASSADOR is not set
+# CONFIG_ATM_HORIZON is not set
+# CONFIG_ATM_IA is not set
+# CONFIG_ATM_FORE200E_MAYBE is not set
+
+#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set
@@ -605,7 +626,7 @@
CONFIG_IRLAN=m
CONFIG_IRNET=m
CONFIG_IRCOMM=m
-# CONFIG_IRDA_ULTRA is not set
+CONFIG_IRDA_ULTRA=y
#
# IrDA options
@@ -622,7 +643,7 @@
# SIR device drivers
#
CONFIG_IRTTY_SIR=m
-# CONFIG_IRPORT_SIR is not set
+CONFIG_IRPORT_SIR=m
#
# Dongle support
@@ -643,7 +664,77 @@
#
# ISDN subsystem
#
-# CONFIG_ISDN is not set
+CONFIG_ISDN=m
+CONFIG_ISDN_BOOL=y
+CONFIG_ISDN_PPP=y
+CONFIG_ISDN_PPP_VJ=y
+CONFIG_ISDN_MPP=y
+CONFIG_ISDN_PPP_BSDCOMP=m
+# CONFIG_ISDN_AUDIO is not set
+
+#
+# ISDN feature submodules
+#
+# CONFIG_ISDN_DRV_LOOP is not set
+# CONFIG_ISDN_DIVERSION is not set
+
+#
+# low-level hardware drivers
+#
+
+#
+# Passive ISDN cards
+#
+CONFIG_ISDN_DRV_HISAX=m
+CONFIG_ISDN_HISAX=y
+
+#
+# D-channel protocol features
+#
+# CONFIG_HISAX_EURO is not set
+# CONFIG_HISAX_1TR6 is not set
+# CONFIG_HISAX_NI1 is not set
+CONFIG_HISAX_MAX_CARDS=8
+
+#
+# HiSax supported cards
+#
+# CONFIG_HISAX_TELESPCI is not set
+# CONFIG_HISAX_S0BOX is not set
+# CONFIG_HISAX_FRITZPCI is not set
+# CONFIG_HISAX_AVM_A1_PCMCIA is not set
+# CONFIG_HISAX_ELSA is not set
+# CONFIG_HISAX_DIEHLDIVA is not set
+# CONFIG_HISAX_SEDLBAUER is not set
+# CONFIG_HISAX_NETJET is not set
+# CONFIG_HISAX_NETJET_U is not set
+# CONFIG_HISAX_NICCY is not set
+# CONFIG_HISAX_BKM_A4T is not set
+# CONFIG_HISAX_SCT_QUADRO is not set
+CONFIG_HISAX_GAZEL=y
+# CONFIG_HISAX_HFC_PCI is not set
+# CONFIG_HISAX_W6692 is not set
+# CONFIG_HISAX_HFC_SX is not set
+# CONFIG_HISAX_ENTERNOW_PCI is not set
+# CONFIG_HISAX_DEBUG is not set
+# CONFIG_HISAX_SEDLBAUER_CS is not set
+# CONFIG_HISAX_ELSA_CS is not set
+# CONFIG_HISAX_AVM_A1_CS is not set
+CONFIG_HISAX_ST5481=m
+# CONFIG_HISAX_FRITZ_PCIPNP is not set
+
+#
+# Active ISDN cards
+#
+# CONFIG_ISDN_DRV_ICN is not set
+# CONFIG_ISDN_DRV_PCBIT is not set
+# CONFIG_ISDN_DRV_SC is not set
+# CONFIG_ISDN_DRV_ACT2000 is not set
+# CONFIG_ISDN_DRV_EICON is not set
+# CONFIG_ISDN_DRV_TPAM is not set
+# CONFIG_ISDN_CAPI is not set
+# CONFIG_HYSDN is not set
+# CONFIG_HYSDN_CAPI is not set
#
# Old CD-ROM drivers (not SCSI, not IDE)
@@ -660,7 +751,7 @@
#
CONFIG_FB=y
CONFIG_DUMMY_CONSOLE=y
-# CONFIG_FB_RIVA is not set
+CONFIG_FB_RIVA=y
# CONFIG_FB_CLGEN is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_PM3 is not set
@@ -676,8 +767,9 @@
CONFIG_FB_MATROX=y
CONFIG_FB_MATROX_MILLENIUM=y
CONFIG_FB_MATROX_MYSTIQUE=y
-# CONFIG_FB_MATROX_G100 is not set
+CONFIG_FB_MATROX_G100=y
# CONFIG_FB_MATROX_I2C is not set
+# CONFIG_FB_MATROX_MAVEN is not set
# CONFIG_FB_MATROX_G450 is not set
# CONFIG_FB_MATROX_MULTIHEAD is not set
CONFIG_FB_ATY=y
@@ -733,7 +825,7 @@
CONFIG_ADB=y
CONFIG_ADB_MACIO=y
CONFIG_INPUT_ADBHID=y
-CONFIG_MAC_ADBKEYCODES=y
+# CONFIG_MAC_ADBKEYCODES is not set
CONFIG_MAC_EMUMOUSEBTN=y
CONFIG_MAC_HID=y
# CONFIG_ANSLCD is not set
@@ -754,7 +846,10 @@
# I2C support
#
CONFIG_I2C=m
-# CONFIG_I2C_ALGOBIT is not set
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_I2C_PHILIPSPAR is not set
+# CONFIG_I2C_ELV is not set
+# CONFIG_I2C_VELLEMAN is not set
# CONFIG_I2C_ALGOPCF is not set
CONFIG_I2C_KEYWEST=m
CONFIG_I2C_CHARDEV=m
@@ -813,6 +908,7 @@
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
+# CONFIG_AMD_PM768 is not set
CONFIG_NVRAM=y
# CONFIG_RTC is not set
# CONFIG_DTLK is not set
@@ -823,19 +919,59 @@
# Ftape, the floppy tape device driver
#
# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
+CONFIG_AGP=m
+# CONFIG_AGP_INTEL is not set
+# CONFIG_AGP_I810 is not set
+# CONFIG_AGP_VIA is not set
+# CONFIG_AGP_AMD is not set
+# CONFIG_AGP_AMD_8151 is not set
+# CONFIG_AGP_SIS is not set
+# CONFIG_AGP_ALI is not set
+# CONFIG_AGP_SWORKS is not set
+CONFIG_AGP_UNINORTH=y
# CONFIG_DRM is not set
#
# PCMCIA character devices
#
-# CONFIG_PCMCIA_SERIAL_CS is not set
+CONFIG_PCMCIA_SERIAL_CS=m
# CONFIG_SYNCLINK_CS is not set
#
# Multimedia devices
#
-# CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+# CONFIG_VIDEO_PROC_FS is not set
+# CONFIG_I2C_PARPORT is not set
+
+#
+# Video Adapters
+#
+# CONFIG_VIDEO_BT848 is not set
+# CONFIG_VIDEO_PMS is not set
+CONFIG_VIDEO_PLANB=m
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_TUNER_3036 is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_ZORAN is not set
+# CONFIG_VIDEO_ZORAN_BUZ is not set
+# CONFIG_VIDEO_ZORAN_DC10 is not set
+# CONFIG_VIDEO_ZORAN_LML33 is not set
+# CONFIG_VIDEO_ZR36120 is not set
+# CONFIG_VIDEO_MEYE is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+# CONFIG_RADIO_MIROPCM20 is not set
#
# File systems
@@ -878,7 +1014,7 @@
# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
-CONFIG_DEVFS_FS=y
+# CONFIG_DEVFS_FS is not set
# CONFIG_DEVFS_MOUNT is not set
# CONFIG_DEVFS_DEBUG is not set
CONFIG_DEVPTS_FS=y
@@ -1036,20 +1172,20 @@
#
# USB Device Class drivers
#
-# CONFIG_USB_AUDIO is not set
+CONFIG_USB_AUDIO=m
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_BLUETOOTH is not set
# CONFIG_USB_MIDI is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
+CONFIG_USB_STORAGE=m
+CONFIG_USB_STORAGE_DEBUG=y
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_HP8200e=y
+CONFIG_USB_STORAGE_SDDR09=y
# CONFIG_USB_STORAGE_SDDR55 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
+CONFIG_USB_STORAGE_JUMPSHOT=y
CONFIG_USB_ACM=m
CONFIG_USB_PRINTER=m
@@ -1058,7 +1194,7 @@
#
CONFIG_USB_HID=y
CONFIG_USB_HIDINPUT=y
-# CONFIG_USB_HIDDEV is not set
+CONFIG_USB_HIDDEV=y
# CONFIG_USB_AIPTEK is not set
# CONFIG_USB_WACOM is not set
@@ -1074,10 +1210,14 @@
#
# USB Multimedia devices
#
-
-#
-# Video4Linux support is needed for USB Multimedia device support
-#
+# CONFIG_USB_IBMCAM is not set
+CONFIG_USB_OV511=m
+CONFIG_USB_PWC=m
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_VICAM is not set
+# CONFIG_USB_DSBR is not set
+# CONFIG_USB_DABUSB is not set
#
# USB Network adaptors
@@ -1086,7 +1226,7 @@
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
+CONFIG_USB_CDCETHER=m
# CONFIG_USB_USBNET is not set
#
@@ -1110,8 +1250,18 @@
# CONFIG_USB_SERIAL_IR is not set
# CONFIG_USB_SERIAL_EDGEPORT is not set
# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
# CONFIG_USB_SERIAL_MCT_U232 is not set
# CONFIG_USB_SERIAL_KLSI is not set
# CONFIG_USB_SERIAL_PL2303 is not set
diff -uNr linux-2.4.20/arch/ppc/kernel/Makefile linux-2.4.20-ben10/arch/ppc/kernel/Makefile
--- linux-2.4.20/arch/ppc/kernel/Makefile 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/Makefile 2003-03-23 12:00:31.000000000 +0100
@@ -1,4 +1,4 @@
-# BK Id: %F% %I% %G% %U% %#%
+# BK Id: SCCS/s.Makefile 1.50 02/25/03 16:19:51 benh
#
#
# Makefile for the linux kernel.
@@ -38,7 +38,7 @@
process.o signal.o ptrace.o align.o \
semaphore.o syscalls.o setup.o \
cputable.o ppc_htab.o
-obj-$(CONFIG_6xx) += l2cr.o
+obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
obj-$(CONFIG_MODULES) += ppc_ksyms.o
obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_PCI) += pci-dma.o
diff -uNr linux-2.4.20/arch/ppc/kernel/align.c linux-2.4.20-ben10/arch/ppc/kernel/align.c
--- linux-2.4.20/arch/ppc/kernel/align.c 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/align.c 2003-03-23 11:56:33.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.align.c 1.5 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.align.c 1.7 06/05/01 21:22:02 paulus
*/
/*
* align.c - handle alignment exceptions for the Power PC.
diff -uNr linux-2.4.20/arch/ppc/kernel/bitops.c linux-2.4.20-ben10/arch/ppc/kernel/bitops.c
--- linux-2.4.20/arch/ppc/kernel/bitops.c 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/bitops.c 2003-03-23 11:56:43.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.bitops.c 1.7 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.bitops.c 1.9 06/05/01 21:22:02 paulus
*/
/*
* Copyright (C) 1996 Paul Mackerras.
diff -uNr linux-2.4.20/arch/ppc/kernel/btext.c linux-2.4.20-ben10/arch/ppc/kernel/btext.c
--- linux-2.4.20/arch/ppc/kernel/btext.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/btext.c 2003-03-23 12:00:17.000000000 +0100
@@ -45,22 +45,14 @@
static unsigned char vga_font[cmapsz];
int boot_text_mapped;
+int force_printk_to_btext;
boot_infos_t disp_bi;
extern char *klimit;
-/*
- * Powermac can use btext_* after boot for xmon,
- * chrp only uses it during early boot.
- */
-#ifdef CONFIG_XMON
-#define BTEXT __pmac
-#define BTDATA __pmacdata
-#else
-#define BTEXT __init
-#define BTDATA __initdata
-#endif /* CONFIG_XMON */
+#define BTEXT
+#define BTDATA
/*
* This is called only when we are booted via BootX.
diff -uNr linux-2.4.20/arch/ppc/kernel/checks.c linux-2.4.20-ben10/arch/ppc/kernel/checks.c
--- linux-2.4.20/arch/ppc/kernel/checks.c 2001-05-22 02:04:46.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/checks.c 2003-03-23 11:58:50.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.checks.c 1.6 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.checks.c 1.8 06/05/01 21:22:02 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/kernel/cpu_setup_6xx.S linux-2.4.20-ben10/arch/ppc/kernel/cpu_setup_6xx.S
--- linux-2.4.20/arch/ppc/kernel/cpu_setup_6xx.S 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/cpu_setup_6xx.S 2003-03-23 11:56:23.000000000 +0100
@@ -0,0 +1,419 @@
+/*
+ * This file contains low level CPU setup functions.
+ * Copyright (C) 2003 Benjamin Herrenschmidt (benh@kernel.crashing.org)
+ *
+ * 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.
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "ppc_defs.h"
+
+_GLOBAL(__setup_cpu_601)
+ blr
+_GLOBAL(__setup_cpu_603)
+ b setup_common_caches
+_GLOBAL(__setup_cpu_604)
+ mflr r4
+ bl setup_common_caches
+ bl setup_604_hid0
+ mtlr r4
+ blr
+_GLOBAL(__setup_cpu_750)
+ mflr r4
+ bl setup_common_caches
+ bl setup_750_7400_hid0
+ mtlr r4
+ blr
+_GLOBAL(__setup_cpu_750cx)
+ mflr r4
+ bl setup_common_caches
+ bl setup_750_7400_hid0
+ bl setup_750cx
+ mtlr r4
+ blr
+_GLOBAL(__setup_cpu_750fx)
+ mflr r4
+ bl setup_common_caches
+ bl setup_750_7400_hid0
+ bl setup_750fx
+ mtlr r4
+ blr
+_GLOBAL(__setup_cpu_7400)
+ mflr r4
+ bl setup_7400_workarounds
+ bl setup_common_caches
+ bl setup_750_7400_hid0
+ mtlr r4
+ blr
+_GLOBAL(__setup_cpu_7410)
+ mflr r4
+ bl setup_7410_workarounds
+ bl setup_common_caches
+ bl setup_750_7400_hid0
+ li r3,0
+ mtspr SPRN_L2CR2,r3
+ mtlr r4
+ blr
+_GLOBAL(__setup_cpu_745x)
+ mflr r4
+ bl setup_common_caches
+ bl setup_745x_specifics
+ mtlr r4
+ blr
+
+/* Enable caches for 603's, 604, 750 & 7400 */
+setup_common_caches:
+ mfspr r11,HID0
+ andi. r0,r11,HID0_DCE
+#ifdef CONFIG_DCACHE_DISABLE
+ ori r11,r11,HID0_ICE
+#else
+ ori r11,r11,HID0_ICE|HID0_DCE
+#endif
+ ori r8,r11,HID0_ICFI
+ bne 1f /* don't invalidate the D-cache */
+ ori r8,r8,HID0_DCI /* unless it wasn't enabled */
+1: sync
+ mtspr HID0,r8 /* enable and invalidate caches */
+ sync
+ mtspr HID0,r11 /* enable caches */
+ sync
+ isync
+ blr
+
+/* 604, 604e, 604ev, ...
+ * Enable superscalar execution & branch history table
+ */
+setup_604_hid0:
+ mfspr r11,HID0
+ ori r11,r11,HID0_SIED|HID0_BHTE
+ ori r8,r11,HID0_BTCD
+ sync
+ mtspr HID0,r8 /* flush branch target address cache */
+ sync /* on 604e/604r */
+ mtspr HID0,r11
+ sync
+ isync
+ blr
+
+/* 7400 <= rev 2.7 and 7410 rev = 1.0 suffer from some
+ * erratas we work around here.
+ * Moto MPC710CE.pdf describes them, those are errata
+ * #3, #4 and #5
+ * Note that we assume the firmware didn't choose to
+ * apply other workarounds (there are other ones documented
+ * in the .pdf). It appear that Apple firmware only works
+ * around #3 and with the same fix we use. We may want to
+ * check if the CPU is using 60x bus mode in which case
+ * the workaround for errata #4 is useless. Also, we may
+ * want to explicitely clear HID0_NOPDST as this is not
+ * needed once we have applied workaround #5 (though it's
+ * not set by Apple's firmware at least).
+ */
+setup_7400_workarounds:
+ mfpvr r3
+ rlwinm r3,r3,0,20,31
+ cmpwi 0,r3,0x0207
+ ble 1f
+ blr
+setup_7410_workarounds:
+ mfpvr r3
+ rlwinm r3,r3,0,20,31
+ cmpwi 0,r3,0x0100
+ bnelr
+1:
+ mfspr r11,SPRN_MSSSR0
+ /* Errata #3: Set L1OPQ_SIZE to 0x10 */
+ rlwinm r11,r11,0,9,6
+ oris r11,r11,0x0100
+ /* Errata #4: Set L2MQ_SIZE to 1 (check for MPX mode first ?) */
+ oris r11,r11,0x0002
+ /* Errata #5: Set DRLT_SIZE to 0x01 */
+ rlwinm r11,r11,0,5,2
+ oris r11,r11,0x0800
+ sync
+ mtspr SPRN_MSSSR0,r11
+ sync
+ isync
+ blr
+
+/* 740/750/7400/7410
+ * Enable Store Gathering (SGE), Address Brodcast (ABE),
+ * Branch History Table (BHTE), Branch Target ICache (BTIC)
+ * Dynamic Power Management (DPM), Speculative (SPD)
+ * Clear Instruction cache throttling (ICTC)
+ */
+setup_750_7400_hid0:
+ mfspr r11,HID0
+ ori r11,r11,HID0_SGE | HID0_ABE | HID0_BHTE | HID0_BTIC
+BEGIN_FTR_SECTION
+ oris r11,r11,HID0_DPM@h /* enable dynamic power mgmt */
+END_FTR_SECTION_IFCLR(CPU_FTR_NO_DPM)
+ li r3,HID0_SPD
+ andc r11,r11,r3 /* clear SPD: enable speculative */
+ li r3,0
+ mtspr ICTC,r3 /* Instruction Cache Throttling off */
+ isync
+ mtspr HID0,r11
+ sync
+ isync
+ blr
+
+/* 750cx specific
+ * Looks like we have to disable NAP feature for some PLL settings...
+ * (waiting for confirmation)
+ */
+setup_750cx:
+ mfspr r10, SPRN_HID1
+ rlwinm r10,r10,4,28,31
+ cmpi cr0,r10,7
+ cmpi cr1,r10,9
+ cmpi cr2,r10,11
+ cror 4*cr0+eq,4*cr0+eq,4*cr1+eq
+ cror 4*cr0+eq,4*cr0+eq,4*cr2+eq
+ bnelr
+ lwz r6,CPU_SPEC_FEATURES(r5)
+ li r7,CPU_FTR_CAN_NAP
+ andc r6,r6,r7
+ stw r6,CPU_SPEC_FEATURES(r5)
+ blr
+
+/* 750fx specific
+ */
+setup_750fx:
+ blr
+
+/* MPC 745x
+ * Enable Store Gathering (SGE), Branch Folding (FOLD)
+ * Branch History Table (BHTE), Branch Target ICache (BTIC)
+ * Dynamic Power Management (DPM), Speculative (SPD)
+ * Ensure our data cache instructions really operate.
+ * Timebase has to be running or we wouldn't have made it here,
+ * just ensure we don't disable it.
+ * Clear Instruction cache throttling (ICTC)
+ * Enable L2 HW prefetch
+ */
+setup_745x_specifics:
+ /* We check for the presence of an L3 cache setup by
+ * the firmware. If any, we disable NAP capability as
+ * it's known to be bogus on rev 2.1 and earlier
+ */
+ mfspr r11,SPRN_L3CR
+ andis. r11,r11,L3CR_L3E@h
+ beq 1f
+ lwz r6,CPU_SPEC_FEATURES(r5)
+ andi. r0,r6,CPU_FTR_L3_DISABLE_NAP
+ beq 1f
+ li r7,CPU_FTR_CAN_NAP
+ andc r6,r6,r7
+ stw r6,CPU_SPEC_FEATURES(r5)
+1:
+ mfspr r11,HID0
+
+ /* All of the bits we have to set.....
+ */
+ ori r11,r11,HID0_SGE | HID0_FOLD | HID0_BHTE | HID0_BTIC | HID0_LRSTK
+BEGIN_FTR_SECTION
+ oris r11,r11,HID0_DPM@h /* enable dynamic power mgmt */
+END_FTR_SECTION_IFCLR(CPU_FTR_NO_DPM)
+
+ /* All of the bits we have to clear....
+ */
+ li r3,HID0_SPD | HID0_NOPDST | HID0_NOPTI
+ andc r11,r11,r3 /* clear SPD: enable speculative */
+ li r3,0
+
+ mtspr ICTC,r3 /* Instruction Cache Throttling off */
+ isync
+ mtspr HID0,r11
+ sync
+ isync
+
+ /* Enable L2 HW prefetch
+ */
+ mfspr r3,SPRN_MSSCR0
+ ori r3,r3,3
+ sync
+ mtspr SPRN_MSSCR0,r3
+ sync
+ isync
+ blr
+
+/* Definitions for the table use to save CPU states */
+#define CS_HID0 0
+#define CS_HID1 4
+#define CS_MSSCR0 8
+#define CS_MSSSR0 12
+#define CS_ICTRL 16
+#define CS_LDSTCR 20
+#define CS_LDSTDB 24
+#define CS_SIZE 28
+
+ .data
+ .balign L1_CACHE_LINE_SIZE
+cpu_state_storage:
+ .space CS_SIZE
+ .balign L1_CACHE_LINE_SIZE,0
+ .text
+
+/* Called in normal context to backup CPU 0 state. This
+ * does not include cache settings. This function is also
+ * called for machine sleep. This does not include the MMU
+ * setup, BATs, etc... but rather the "special" registers
+ * like HID0, HID1, MSSCR0, etc...
+ */
+_GLOBAL(__save_cpu_setup)
+ /* Some CR fields are volatile, we back it up all */
+ mfcr r7
+
+ /* Get storage ptr */
+ lis r5,cpu_state_storage@h
+ ori r5,r5,cpu_state_storage@l
+
+ /* Save HID0 (common to all CONFIG_6xx cpus) */
+ mfspr r3,SPRN_HID0
+ stw r3,CS_HID0(r5)
+
+ /* Now deal with CPU type dependent registers */
+ mfspr r3,PVR
+ srwi r3,r3,16
+ cmpli cr0,r3,0x8000 /* 7450 */
+ cmpli cr1,r3,0x000c /* 7400 */
+ cmpli cr2,r3,0x800c /* 7410 */
+ cmpli cr3,r3,0x8001 /* 7455 */
+ cmpli cr4,r3,0x8002 /* 7457 */
+ cmpli cr5,r3,0x7000 /* 750FX */
+ /* cr1 is 7400 || 7410 */
+ cror 4*cr1+eq,4*cr1+eq,4*cr2+eq
+ /* cr0 is 74xx */
+ cror 4*cr0+eq,4*cr0+eq,4*cr3+eq
+ cror 4*cr0+eq,4*cr0+eq,4*cr4+eq
+ cror 4*cr0+eq,4*cr0+eq,4*cr1+eq
+ bne 1f
+ /* Backup 74xx specific regs */
+ mfspr r4,SPRN_MSSCR0
+ stw r4,CS_MSSCR0(r5)
+ mfspr r4,SPRN_MSSSR0
+ stw r4,CS_MSSSR0(r5)
+ beq cr1,1f
+ /* Backup 745x specific registers */
+ mfspr r4,SPRN_HID1
+ stw r4,CS_HID1(r5)
+ mfspr r4,SPRN_ICTRL
+ stw r4,CS_ICTRL(r5)
+ mfspr r4,SPRN_LDSTCR
+ stw r4,CS_LDSTCR(r5)
+ mfspr r4,SPRN_LDSTDB
+ stw r4,CS_LDSTDB(r5)
+1:
+ bne cr5,1f
+ /* Backup 750FX specific registers */
+ mfspr r4,SPRN_HID1
+ stw r4,CS_HID1(r5)
+1:
+ mtcr r7
+ blr
+
+/* Called with no MMU context (typically MSR:IR/DR off) to
+ * restore CPU state as backed up by the previous
+ * function. This does not include cache setting
+ */
+_GLOBAL(__restore_cpu_setup)
+ /* Some CR fields are volatile, we back it up all */
+ mfcr r7
+
+ /* Get storage ptr */
+ lis r5,(cpu_state_storage-KERNELBASE)@h
+ ori r5,r5,cpu_state_storage@l
+
+ /* Restore HID0 */
+ lwz r3,CS_HID0(r5)
+ sync
+ isync
+ mtspr SPRN_HID0,r3
+ sync
+ isync
+
+ /* Now deal with CPU type dependent registers */
+ mfspr r3,PVR
+ srwi r3,r3,16
+ cmpli cr0,r3,0x8000 /* 7450 */
+ cmpli cr1,r3,0x000c /* 7400 */
+ cmpli cr2,r3,0x800c /* 7410 */
+ cmpli cr3,r3,0x8001 /* 7455 */
+ cmpli cr4,r3,0x8002 /* 7457 */
+ cmpli cr5,r3,0x7000 /* 750FX */
+ /* cr1 is 7400 || 7410 */
+ cror 4*cr1+eq,4*cr1+eq,4*cr2+eq
+ /* cr0 is 74xx */
+ cror 4*cr0+eq,4*cr0+eq,4*cr3+eq
+ cror 4*cr0+eq,4*cr0+eq,4*cr4+eq
+ cror 4*cr0+eq,4*cr0+eq,4*cr1+eq
+ bne 2f
+ /* Restore 74xx specific regs */
+ lwz r4,CS_MSSCR0(r5)
+ sync
+ mtspr SPRN_MSSCR0,r4
+ sync
+ isync
+ lwz r4,CS_MSSSR0(r5)
+ sync
+ mtspr SPRN_MSSSR0,r4
+ sync
+ isync
+ bne cr2,1f
+ /* Clear 7410 L2CR2 */
+ li r4,0
+ mtspr SPRN_L2CR2,r4
+1: beq cr1,2f
+ /* Restore 745x specific registers */
+ lwz r4,CS_HID1(r5)
+ sync
+ mtspr SPRN_HID1,r4
+ isync
+ sync
+ lwz r4,CS_ICTRL(r5)
+ sync
+ mtspr SPRN_ICTRL,r4
+ isync
+ sync
+ lwz r4,CS_LDSTCR(r5)
+ sync
+ mtspr SPRN_LDSTCR,r4
+ isync
+ sync
+ lwz r4,CS_LDSTDB(r5)
+ sync
+ mtspr SPRN_LDSTDB,r4
+ isync
+ sync
+2: bne cr5,1f
+ /* Restore 750FX specific registers
+ * that is restore PLL config & switch
+ * to PLL 0
+ */
+ lwz r4,CS_HID1(r5)
+ rlwinm r5,r4,0,16,14
+ mtspr SPRN_HID1,r5
+ /* Wait for PLL to stabilize */
+ mftbl r5
+3: mftbl r6
+ sub r6,r6,r5
+ cmpli cr0,r6,10000
+ ble 3b
+ /* Setup final PLL */
+ mtspr SPRN_HID1,r4
+1:
+ mtcr r7
+ blr
+
diff -uNr linux-2.4.20/arch/ppc/kernel/cputable.c linux-2.4.20-ben10/arch/ppc/kernel/cputable.c
--- linux-2.4.20/arch/ppc/kernel/cputable.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/cputable.c 2003-03-23 11:56:44.000000000 +0100
@@ -29,8 +29,7 @@
extern void __setup_cpu_750fx(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_7400(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_7410(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
-extern void __setup_cpu_7450(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
-extern void __setup_cpu_7455(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
+extern void __setup_cpu_745x(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_power3(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_power4(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_8xx(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
@@ -144,11 +143,20 @@
32, 32,
__setup_cpu_750cx
},
- { /* 750FX (All revs for now) */
+ { /* 750FX rev 2.0 must disable HID0[DPM] */
+ 0xffffffff, 0x70000200, "750FX",
+ CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
+ CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP |
+ CPU_FTR_NO_DPM,
+ COMMON_PPC,
+ 32, 32,
+ __setup_cpu_750
+ },
+ { /* 750FX (All revs except 2.0) */
0xffff0000, 0x70000000, "750FX",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP |
- CPU_FTR_DUAL_PLL_750FX,
+ CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC,
32, 32,
__setup_cpu_750fx
@@ -195,7 +203,7 @@
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7450
+ __setup_cpu_745x
},
{ /* 7450 2.1 */
0xffffffff, 0x80000201, "7450",
@@ -205,7 +213,7 @@
CPU_FTR_L3_DISABLE_NAP,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7450
+ __setup_cpu_745x
},
{ /* 7450 2.3 and newer */
0xffff0000, 0x80000000, "7450",
@@ -214,35 +222,46 @@
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7450
+ __setup_cpu_745x
},
{ /* 7455 rev 1.x */
0xffffff00, 0x80010100, "7455",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450,
+ CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7455
+ __setup_cpu_745x
},
{ /* 7455 rev 2.0 */
0xffffffff, 0x80010200, "7455",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
- CPU_FTR_L3_DISABLE_NAP,
+ CPU_FTR_L3_DISABLE_NAP | CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7455
+ __setup_cpu_745x
},
{ /* 7455 others */
0xffff0000, 0x80010000, "7455",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR,
+ CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
+ CPU_FTR_HAS_HIGH_BATS,
+ COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
+ 32, 32,
+ __setup_cpu_745x
+ },
+ { /* 7457 */
+ 0xffff0000, 0x80020000, "7457",
+ CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
+ CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
+ CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
+ CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7455
+ __setup_cpu_745x
},
{ /* 82xx (8240, 8245, 8260 are all 603e cores) */
0x7fff0000, 0x00810000, "82xx",
diff -uNr linux-2.4.20/arch/ppc/kernel/entry.S linux-2.4.20-ben10/arch/ppc/kernel/entry.S
--- linux-2.4.20/arch/ppc/kernel/entry.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/entry.S 2003-03-23 11:57:58.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.entry.S 1.26 01/25/02 15:15:24 benh
+ * BK Id: SCCS/s.entry.S 1.29 01/20/03 22:26:36 benh
*/
/*
* PowerPC version
@@ -166,7 +166,6 @@
.globl ret_from_syscall_2
ret_from_syscall_2:
stw r3,RESULT(r1) /* Save result */
- stw r3,GPR0(r1) /* temporary gross hack to make strace work */
li r10,-_LAST_ERRNO
cmpl 0,r3,r10
blt 60f
diff -uNr linux-2.4.20/arch/ppc/kernel/find_name.c linux-2.4.20-ben10/arch/ppc/kernel/find_name.c
--- linux-2.4.20/arch/ppc/kernel/find_name.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/find_name.c 2003-03-23 11:58:22.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.find_name.c 1.5 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.find_name.c 1.7 06/05/01 21:22:02 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/kernel/galaxy_pci.c linux-2.4.20-ben10/arch/ppc/kernel/galaxy_pci.c
--- linux-2.4.20/arch/ppc/kernel/galaxy_pci.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/galaxy_pci.c 2003-03-23 12:01:04.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.galaxy_pci.c 1.10 08/13/02 20:27:37 paulus
*/
/*
*
diff -uNr linux-2.4.20/arch/ppc/kernel/head.S linux-2.4.20-ben10/arch/ppc/kernel/head.S
--- linux-2.4.20/arch/ppc/kernel/head.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/head.S 2003-03-23 11:58:29.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.head.S 1.58 01/25/03 21:28:49 benh
*/
/*
* PowerPC version
@@ -40,6 +40,8 @@
#include
#endif
+#undef DEBUG_RESET
+
#ifdef CONFIG_PPC64BRIDGE
#define LOAD_BAT(n, reg, RA, RB) \
ld RA,(n*32)+0(reg); \
@@ -310,15 +312,31 @@
.long ret_from_except
/* System reset */
-#ifdef CONFIG_SMP /* MVME/MTX and gemini start the secondary here */
-#ifdef CONFIG_GEMINI
+/* MVME/MTX and gemini start the secondary here
+ * Changed so that location is dynamically changed to a
+ * branch for CPU startup, then restored, so we still have
+ * the exception vector around for debugging
+ */
+#if defined(CONFIG_SMP) && defined(CONFIG_GEMINI)
. = 0x100
b __secondary_start_gemini
-#else /* CONFIG_GEMINI */
- STD_EXCEPTION(0x100, Reset, __secondary_start_psurge)
-#endif /* CONFIG_GEMINI */
+#else
+#ifdef DEBUG_RESET
+ . = 0x100
+ li r3,0
+ mfspr r0,SRR0
+ stw r0,0(r3)
+ mfspr r0,SRR1
+ stw r0,4(r3)
+ mflr r0
+ stw r0,8(r3)
+ stw r1,12(r3)
+ stw r2,16(r3)
+1: nop
+ b 1b
#else
STD_EXCEPTION(0x100, Reset, UnknownException)
+#endif
#endif
/* Machine check */
@@ -853,11 +871,11 @@
RFI
/*
- * Disable FP for the task which had the FPU previously,
+ * This task wants to use the FPU now.
+ * On UP, disable FP for the task which had the FPU previously,
* and save its floating-point registers in its thread_struct.
- * Enables the FPU for use in the kernel on return.
- * On SMP we know the fpu is free, since we give it up every
- * switch. -- Cort
+ * Load up this task's FP registers from its thread_struct,
+ * enable the FPU for the current task and return to the task.
*/
load_up_fpu:
mfmsr r5
@@ -874,14 +892,13 @@
* to another. Instead we call giveup_fpu in switch_to.
*/
#ifndef CONFIG_SMP
- lis r6,0 /* get __pa constant */
- tophys(r6,r6)
+ tophys(r6,0) /* get __pa constant */
addis r3,r6,last_task_used_math@ha
lwz r4,last_task_used_math@l(r3)
cmpi 0,r4,0
beq 1f
add r4,r4,r6
- addi r4,r4,THREAD /* want THREAD of last_task_used_math */
+ addi r4,r4,THREAD /* want last_task_used_math->thread */
SAVE_32FPRS(0, r4)
mffs fr0
stfd fr0,THREAD_FPSCR-4(r4)
@@ -894,8 +911,10 @@
1:
#endif /* CONFIG_SMP */
/* enable use of FP after return */
- ori r23,r23,MSR_FP|MSR_FE0|MSR_FE1
mfspr r5,SPRG3 /* current task's THREAD (phys) */
+ lwz r4,THREAD_FPEXC_MODE(r5)
+ ori r23,r23,MSR_FP /* enable FP for current */
+ or r23,r23,r4
lfd fr0,THREAD_FPSCR-4(r5)
mtfsf 0xff,fr0
REST_32FPRS(0, r5)
@@ -1077,7 +1096,7 @@
ori r5,r5,MSR_FP
SYNC
mtmsr r5 /* enable use of fpu now */
- SYNC
+ SYNC_601
isync
cmpi 0,r3,0
beqlr- /* if no previous owner, done */
@@ -1268,7 +1287,9 @@
MTMSRD(r0)
isync
#endif
-
+ /* Copy some CPU settings from CPU 0 */
+ bl __restore_cpu_setup
+
lis r3,-KERNELBASE@h
mr r4,r24
bl identify_cpu
@@ -1314,64 +1335,9 @@
#endif /* CONFIG_SMP */
/*
- * Enable caches and 604-specific features if necessary.
+ * Those generic dummy functions are kept for CPUs not
+ * included in CONFIG_6xx
*/
-_GLOBAL(__setup_cpu_601)
- blr
-_GLOBAL(__setup_cpu_603)
- b setup_common_caches
-_GLOBAL(__setup_cpu_604)
- mflr r4
- bl setup_common_caches
- bl setup_604_hid0
- mtlr r4
- blr
-_GLOBAL(__setup_cpu_750)
- mflr r4
- bl setup_common_caches
- bl setup_750_7400_hid0
- mtlr r4
- blr
-_GLOBAL(__setup_cpu_750cx)
- mflr r4
- bl setup_common_caches
- bl setup_750_7400_hid0
- bl setup_750cx
- mtlr r4
- blr
-_GLOBAL(__setup_cpu_750fx)
- mflr r4
- bl setup_common_caches
- bl setup_750_7400_hid0
- bl setup_750fx
- mtlr r4
- blr
-_GLOBAL(__setup_cpu_7400)
- mflr r4
- bl setup_common_caches
- bl setup_750_7400_hid0
- mtlr r4
- blr
-_GLOBAL(__setup_cpu_7410)
- mflr r4
- bl setup_common_caches
- bl setup_750_7400_hid0
- li r3,0
- mtspr SPRN_L2CR2,r3
- mtlr r4
- blr
-_GLOBAL(__setup_cpu_7450)
- mflr r4
- bl setup_common_caches
- bl setup_745x_specifics
- mtlr r4
- blr
-_GLOBAL(__setup_cpu_7455)
- mflr r4
- bl setup_common_caches
- bl setup_745x_specifics
- mtlr r4
- blr
_GLOBAL(__setup_cpu_power3)
blr
_GLOBAL(__setup_cpu_power4)
@@ -1379,126 +1345,12 @@
_GLOBAL(__setup_cpu_generic)
blr
-/* Enable caches for 603's, 604, 750 & 7400 */
-setup_common_caches:
- mfspr r11,HID0
- andi. r0,r11,HID0_DCE
-#ifdef CONFIG_DCACHE_DISABLE
- ori r11,r11,HID0_ICE
-#else
- ori r11,r11,HID0_ICE|HID0_DCE
-#endif
- ori r8,r11,HID0_ICFI
- bne 1f /* don't invalidate the D-cache */
- ori r8,r8,HID0_DCI /* unless it wasn't enabled */
-1: sync
- mtspr HID0,r8 /* enable and invalidate caches */
- sync
- mtspr HID0,r11 /* enable caches */
- sync
- isync
+#ifndef CONFIG_6xx
+_GLOBAL(__save_cpu_setup)
blr
-
-/* 604, 604e, 604ev, ...
- * Enable superscalar execution & branch history table
- */
-setup_604_hid0:
- mfspr r11,HID0
- ori r11,r11,HID0_SIED|HID0_BHTE
- ori r8,r11,HID0_BTCD
- sync
- mtspr HID0,r8 /* flush branch target address cache */
- sync /* on 604e/604r */
- mtspr HID0,r11
- sync
- isync
- blr
-
-/* 740/750/7400/7410
- * Enable Store Gathering (SGE), Address Brodcast (ABE),
- * Branch History Table (BHTE), Branch Target ICache (BTIC)
- * Dynamic Power Management (DPM), Speculative (SPD)
- * Clear Instruction cache throttling (ICTC)
- */
-setup_750_7400_hid0:
- mfspr r11,HID0
- ori r11,r11,HID0_SGE | HID0_ABE | HID0_BHTE | HID0_BTIC
- oris r11,r11,HID0_DPM@h /* enable dynamic power mgmt */
- li r3,HID0_SPD
- andc r11,r11,r3 /* clear SPD: enable speculative */
- li r3,0
- mtspr ICTC,r3 /* Instruction Cache Throttling off */
- isync
- mtspr HID0,r11
- sync
- isync
- blr
-
-/* 750cx specific
- * Looks like we have to disable NAP feature for some PLL settings...
- * (waiting for confirmation)
- */
-setup_750cx:
- blr
-
-/* 750fx specific
- */
-setup_750fx:
- blr
-
-/* MPC 745x
- * Enable Store Gathering (SGE), Branch Folding (FOLD)
- * Branch History Table (BHTE), Branch Target ICache (BTIC)
- * Dynamic Power Management (DPM), Speculative (SPD)
- * Ensure our data cache instructions really operate.
- * Timebase has to be running or we wouldn't have made it here,
- * just ensure we don't disable it.
- * Clear Instruction cache throttling (ICTC)
- * Enable L2 HW prefetch
- */
-setup_745x_specifics:
- /* We check for the presence of an L3 cache setup by
- * the firmware. If any, we disable NAP capability as
- * it's known to be bogus on rev 2.1 and earlier
- */
- mfspr r11,SPRN_L3CR
- andis. r11,r11,L3CR_L3E@h
- beq 1f
- lwz r6,CPU_SPEC_FEATURES(r5)
- andi. r0,r6,CPU_FTR_L3_DISABLE_NAP
- beq 1f
- li r7,CPU_FTR_CAN_NAP
- andc r6,r6,r7
- stw r6,CPU_SPEC_FEATURES(r5)
-1:
- mfspr r11,HID0
-
- /* All of the bits we have to set.....
- */
- ori r11,r11,HID0_SGE | HID0_FOLD | HID0_BHTE | HID0_BTIC | HID0_LRSTK
- oris r11,r11,HID0_DPM@h /* enable dynamic power mgmt */
-
- /* All of the bits we have to clear....
- */
- li r3,HID0_SPD | HID0_NOPDST | HID0_NOPTI
- andc r11,r11,r3 /* clear SPD: enable speculative */
- li r3,0
-
- mtspr ICTC,r3 /* Instruction Cache Throttling off */
- isync
- mtspr HID0,r11
- sync
- isync
-
- /* Enable L2 HW prefetch
- */
- mfspr r3,SPRN_MSSCR0
- ori r3,r3,3
- sync
- mtspr SPRN_MSSCR0,r3
- sync
- isync
+_GLOBAL(__restore_cpu_setup)
blr
+#endif /* CONFIG_6xx */
/*
* Load stuff into the MMU. Intended to be called with
@@ -1702,6 +1554,30 @@
mtspr IBAT2L,r20
mtspr IBAT3U,r20
mtspr IBAT3L,r20
+BEGIN_FTR_SECTION
+ /* Here's a tweak: at this point, CPU setup have
+ * not been called yet, so HIGH_BAT_EN may not be
+ * set in HID0 for the 745x processors. However, it
+ * seems that doesn't affect our ability to actually
+ * write to these SPRs.
+ */
+ mtspr SPRN_DBAT4U,r20
+ mtspr SPRN_DBAT4L,r20
+ mtspr SPRN_DBAT5U,r20
+ mtspr SPRN_DBAT5L,r20
+ mtspr SPRN_DBAT6U,r20
+ mtspr SPRN_DBAT6L,r20
+ mtspr SPRN_DBAT7U,r20
+ mtspr SPRN_DBAT7L,r20
+ mtspr SPRN_IBAT4U,r20
+ mtspr SPRN_IBAT4L,r20
+ mtspr SPRN_IBAT5U,r20
+ mtspr SPRN_IBAT5L,r20
+ mtspr SPRN_IBAT6U,r20
+ mtspr SPRN_IBAT6L,r20
+ mtspr SPRN_IBAT7U,r20
+ mtspr SPRN_IBAT7L,r20
+END_FTR_SECTION_IFSET(CPU_FTR_HAS_HIGH_BATS)
#endif /* !defined(CONFIG_GEMINI) */
blr
diff -uNr linux-2.4.20/arch/ppc/kernel/head_4xx.S linux-2.4.20-ben10/arch/ppc/kernel/head_4xx.S
--- linux-2.4.20/arch/ppc/kernel/head_4xx.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/head_4xx.S 2003-03-23 11:59:46.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.head_4xx.S 1.6 05/21/01 11:50:00 paulus
+ * BK Id: SCCS/s.head_4xx.S 1.9 08/13/02 20:27:37 paulus
*/
/*
* Copyright (c) 1995-1996 Gary Thomas
diff -uNr linux-2.4.20/arch/ppc/kernel/head_8xx.S linux-2.4.20-ben10/arch/ppc/kernel/head_8xx.S
--- linux-2.4.20/arch/ppc/kernel/head_8xx.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/head_8xx.S 2003-03-23 11:56:19.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.head_8xx.S 1.31 09/11/02 14:41:30 paulus
*/
/*
* arch/ppc/kernel/except_8xx.S
diff -uNr linux-2.4.20/arch/ppc/kernel/i8259.c linux-2.4.20-ben10/arch/ppc/kernel/i8259.c
--- linux-2.4.20/arch/ppc/kernel/i8259.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/i8259.c 2003-03-23 12:00:14.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.i8259.c 1.18 10/12/02 14:14:20 paulus
*/
#include
@@ -21,17 +21,37 @@
int i8259_pic_irq_offset;
-/* Acknowledge the irq using the PCI host bridge's interrupt acknowledge
- * feature. (Polling is somehow broken on some IBM and Motorola PReP boxes.)
+/*
+ * Acknowledge the IRQ using either the PCI host bridge's interrupt
+ * acknowledge feature or poll. How i8259_init() is called determines
+ * which is called. It should be noted that polling is broken on some
+ * IBM and Motorola PReP boxes so we must use the int-ack feature on them.
*/
-int i8259_irq(struct pt_regs *regs)
+int
+i8259_irq(struct pt_regs *regs)
{
int irq;
- spin_lock/*_irqsave*/(&i8259_lock/*, flags*/);
+ spin_lock(&i8259_lock);
- irq = *pci_intack;
- if (irq==7) {
+ /* Either int-ack or poll for the IRQ */
+ if (pci_intack)
+ irq = *pci_intack;
+ else {
+ /* Perform an interrupt acknowledge cycle on controller 1. */
+ outb(0x0C, 0x20); /* prepare for poll */
+ irq = inb(0x20) & 7;
+ if (irq == 2 ) {
+ /*
+ * Interrupt is cascaded so perform interrupt
+ * acknowledge on controller 2.
+ */
+ outb(0x0C, 0xA0); /* prepare for poll */
+ irq = (inb(0xA0) & 7) + 8;
+ }
+ }
+
+ if (irq == 7) {
/*
* This may be a spurious interrupt.
*
@@ -39,47 +59,13 @@
* significant bit is not set then there is no valid
* interrupt.
*/
- if(~inb(0x20)&0x80) {
+ if (!pci_intack)
+ outb(0x0B, 0x20); /* ISR register */
+ if(~inb(0x20) & 0x80)
irq = -1;
- }
}
- spin_unlock/*_irqrestore*/(&i8259_lock/*, flags*/);
- return irq;
-}
-
-/* Poke the 8259's directly using poll commands. */
-int i8259_poll(struct pt_regs *regs)
-{
- int irq;
- spin_lock/*_irqsave*/(&i8259_lock/*, flags*/);
- /*
- * Perform an interrupt acknowledge cycle on controller 1
- */
- outb(0x0C, 0x20); /* prepare for poll */
- irq = inb(0x20) & 7;
- if (irq == 2) {
- /*
- * Interrupt is cascaded so perform interrupt
- * acknowledge on controller 2
- */
- outb(0x0C, 0xA0); /* prepare for poll */
- irq = (inb(0xA0) & 7) + 8;
- } else if (irq==7) {
- /*
- * This may be a spurious interrupt
- *
- * Read the interrupt status register. If the most
- * significant bit is not set then there is no valid
- * interrupt
- */
- outb(0x0b, 0x20);
- if(~inb(0x20)&0x80) {
- spin_unlock/*_irqrestore*/(&i8259_lock/*, flags*/);
- return -1;
- }
- }
- spin_unlock/*_irqrestore*/(&i8259_lock/*, flags*/);
+ spin_unlock(&i8259_lock);
return irq;
}
diff -uNr linux-2.4.20/arch/ppc/kernel/idle.c linux-2.4.20-ben10/arch/ppc/kernel/idle.c
--- linux-2.4.20/arch/ppc/kernel/idle.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/idle.c 2003-03-23 11:57:00.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.idle.c 1.26 10/29/02 20:27:52 benh
*/
/*
* Idle daemon for PowerPC. Idle daemon will handle any action
diff -uNr linux-2.4.20/arch/ppc/kernel/idle_6xx.S linux-2.4.20-ben10/arch/ppc/kernel/idle_6xx.S
--- linux-2.4.20/arch/ppc/kernel/idle_6xx.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/idle_6xx.S 2003-03-23 11:59:02.000000000 +0100
@@ -107,13 +107,23 @@
andis. r0,r3,HID0_NAP@h
beq 2f
BEGIN_FTR_SECTION
- /* Disable L2 prefetch on some 745x */
+ /* Disable L2 prefetch on some 745x and try to ensure
+ * L2 prefetch engines are idle. As explained by errata
+ * text, we can't be sure they are, we just hope very hard
+ * that well be enough (sic !). At least I noticed Apple
+ * doesn't even bother doing the dcbf's here...
+ */
mfspr r4,SPRN_MSSCR0
rlwinm r4,r4,0,0,29
sync
mtspr SPRN_MSSCR0,r4
sync
isync
+ lis r4,KERNELBASE@h
+ dcbf 0,r4
+ dcbf 0,r4
+ dcbf 0,r4
+ dcbf 0,r4
END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)
#ifdef DEBUG
lis r6,nap_enter_count@ha
@@ -142,7 +152,9 @@
END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
andc r4,r4,r5
or r4,r4,r3
- oris r4,r4,HID0_DPM@h /* that should be done once for all ... */
+BEGIN_FTR_SECTION
+ oris r4,r4,HID0_DPM@h /* that should be done once for all */
+END_FTR_SECTION_IFCLR(CPU_FTR_NO_DPM)
mtspr SPRN_HID0,r4
BEGIN_FTR_SECTION
DSSALL
diff -uNr linux-2.4.20/arch/ppc/kernel/indirect_pci.c linux-2.4.20-ben10/arch/ppc/kernel/indirect_pci.c
--- linux-2.4.20/arch/ppc/kernel/indirect_pci.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/indirect_pci.c 2003-03-23 11:56:24.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.indirect_pci.c 1.12 08/13/02 20:27:37 paulus
*/
/*
* Support for indirect PCI bridges.
diff -uNr linux-2.4.20/arch/ppc/kernel/irq.c linux-2.4.20-ben10/arch/ppc/kernel/irq.c
--- linux-2.4.20/arch/ppc/kernel/irq.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/irq.c 2003-03-23 11:57:52.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.irq.c 1.39 06/04/02 16:06:19 benh
*/
/*
* arch/ppc/kernel/irq.c
@@ -78,6 +78,10 @@
unsigned long ppc_lost_interrupts[NR_MASK_WORDS];
atomic_t ppc_n_lost_interrupts;
+#ifdef CONFIG_DEBUG_SPINLOCK
+int debug_long_irqlock;
+#endif /* CONFIG_DEBUG_SPINLOCK */
+
/* nasty hack for shared irq's since we need to do kmalloc calls but
* can't very early in the boot when we need to do a request irq.
* this needs to be removed.
@@ -528,27 +532,21 @@
int irq, first = 1;
hardirq_enter( cpu );
- for (;;) {
- /*
- * Every arch is required to implement ppc_md.get_irq.
- * This function will either return an irq number or -1 to
- * indicate there are no more pending. But the first time
- * through the loop this means there wasn't and IRQ pending.
- * The value -2 is for buggy hardware and means that this IRQ
- * has already been handled. -- Tom
- */
- irq = ppc_md.get_irq( regs );
-
- if (irq >= 0)
- ppc_irq_dispatch_handler( regs, irq );
- else {
- if (irq != -2 && first)
- /* That's not SMP safe ... but who cares ? */
- ppc_spurious_interrupts++;
- break;
- }
+ /*
+ * Every platform is required to implement ppc_md.get_irq.
+ * This function will either return an irq number or -1 to
+ * indicate there are no more pending. But the first time
+ * through the loop this means there wasn't an IRQ pending.
+ * The value -2 is for buggy hardware and means that this IRQ
+ * has already been handled. -- Tom
+ */
+ while ((irq = ppc_md.get_irq(regs)) >= 0) {
+ ppc_irq_dispatch_handler(regs, irq);
first = 0;
}
+ if (irq != -2 && first)
+ /* That's not SMP safe ... but who cares ? */
+ ppc_spurious_interrupts++;
hardirq_exit( cpu );
if (softirq_pending(cpu))
@@ -596,6 +594,24 @@
unsigned long *stack;
int cpu = smp_processor_id();
+#ifdef CONFIG_XMON
+ xmon_printf("\n%s, CPU %d:\n", str, cpu);
+ xmon_printf("irq: %d [%d %d]\n",
+ atomic_read(&global_irq_count),
+ local_irq_count(0),
+ local_irq_count(1));
+ xmon_printf("bh: %d [%d %d]\n",
+ atomic_read(&global_bh_count),
+ local_bh_count(0),
+ local_bh_count(1));
+ stack = (unsigned long *) &str;
+ for (i = 40; i ; i--) {
+ unsigned long x = *++stack;
+ if (x > (unsigned long) &init_task_union && x < (unsigned long) &vsprintf) {
+ xmon_printf("<[%08lx]> ", x);
+ }
+ }
+#endif /* CONFIG_XMON */
printk("\n%s, CPU %d:\n", str, cpu);
printk("irq: %d [%d %d]\n",
atomic_read(&global_irq_count),
@@ -712,6 +728,9 @@
do {
do {
if (loops-- == 0) {
+#ifdef CONFIG_XMON
+ xmon_printf("get_irqlock(%d) waiting, global_irq_holder=%d\n", cpu, global_irq_holder);
+#endif
printk("get_irqlock(%d) waiting, global_irq_holder=%d\n", cpu, global_irq_holder);
#ifdef CONFIG_XMON
xmon(0);
diff -uNr linux-2.4.20/arch/ppc/kernel/l2cr.S linux-2.4.20-ben10/arch/ppc/kernel/l2cr.S
--- linux-2.4.20/arch/ppc/kernel/l2cr.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/l2cr.S 2003-03-23 11:59:37.000000000 +0100
@@ -40,9 +40,11 @@
Author: Terry Greeniaus (tgree@phys.ualberta.ca)
Please e-mail updates to this file to me, thanks!
*/
+#include
#include
#include
#include
+#include
/* Usage:
@@ -101,6 +103,8 @@
blr
END_FTR_SECTION_IFCLR(CPU_FTR_L2CR)
+ mflr r9
+
/* Stop DST streams */
BEGIN_FTR_SECTION
DSSALL
@@ -115,6 +119,22 @@
mtmsr r4
isync
+ /* Before we perform the global invalidation, we must disable dynamic
+ * power management via HID0[DPM] to work around a processor bug where
+ * DPM can possibly interfere with the state machine in the processor
+ * that invalidates the L2 cache tags.
+ */
+ mfspr r8,HID0 /* Save HID0 in r8 */
+ rlwinm r4,r8,0,12,10 /* Turn off HID0[DPM] */
+ sync
+ mtspr HID0,r4 /* Disable DPM */
+ sync
+
+ /* Flush & disable L1 */
+ mr r5,r3
+ bl __flush_disable_L1
+ mr r3,r5
+
/* Get the current enable bit of the L2CR into r4 */
mfspr r4,L2CR
@@ -142,21 +162,22 @@
/* TODO: use HW flush assist when available */
- lis r4,0x0004
+ lis r4,0x0002
mtctr r4
li r4,0
1:
lwzx r0,r0,r4
addi r4,r4,32 /* Go to start of next cache line */
bdnz 1b
+ isync
/* Now, flush the first 4MB of memory */
- lis r4,0x0004
+ lis r4,0x0002
mtctr r4
li r4,0
sync
1:
- dcbf r0,r4
+ dcbf 0,r4
addi r4,r4,32 /* Go to start of next cache line */
bdnz 1b
@@ -166,25 +187,19 @@
* L1 icache
*/
b 20f
-21:
+ .balign L1_CACHE_LINE_SIZE
+22:
sync
mtspr L2CR,r3
sync
- b 22f
+ b 23f
20:
- b 21b
-22:
- /* Before we perform the global invalidation, we must disable dynamic
- * power management via HID0[DPM] to work around a processor bug where
- * DPM can possibly interfere with the state machine in the processor
- * that invalidates the L2 cache tags.
- */
- mfspr r8,HID0 /* Save HID0 in r8 */
- rlwinm r4,r8,0,12,10 /* Turn off HID0[DPM] */
- sync
- mtspr HID0,r4 /* Disable DPM */
- sync
-
+ b 21f
+21: sync
+ isync
+ b 22b
+
+23:
/* Perform a global invalidation */
oris r3,r3,0x0020
sync
@@ -211,11 +226,6 @@
mtspr L2CR,r3
sync
- /* Restore HID0[DPM] to whatever it was before */
- sync
- mtspr 1008,r8
- sync
-
/* See if we need to enable the cache */
cmplwi r5,0
beq 4f
@@ -225,10 +235,20 @@
mtspr L2CR,r3
sync
+4:
+ bl __inval_enable_L1
+
+ /* Restore HID0[DPM] to whatever it was before */
+ sync
+ mtspr 1008,r8
+ sync
+
/* Restore MSR (restores EE and DR bits to original state) */
-4: SYNC
+ SYNC
mtmsr r7
isync
+
+ mtlr r9
blr
_GLOBAL(_get_L2CR)
@@ -286,7 +306,7 @@
li r4,0
1:
lwzx r0,r0,r4
- dcbf r0,r4
+ dcbf 0,r4
addi r4,r4,32 /* Go to start of next cache line */
bdnz 1b
@@ -360,3 +380,73 @@
/* --- End of PowerLogix code ---
*/
+
+
+/* flush_disable_L1() - Flush and disable L1 cache
+ *
+ * clobbers r0, r3, ctr, cr0
+ *
+ */
+ .globl __flush_disable_L1
+ __flush_disable_L1:
+
+ /* Stop pending alitvec streams and memory accesses */
+BEGIN_FTR_SECTION
+ DSSALL
+END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
+ sync
+
+ /* Load counter to 0x1000 cache lines (128k) and
+ * load cache with datas
+ */
+ lis r3,0x0002
+// li r3,0x1000 /* 128kB / 32B */
+ mtctr r3
+ li r3, 0
+1:
+ lwz r0,0(r3)
+ addi r3,r3,0x0020 /* Go to start of next cache line */
+ bdnz 1b
+ isync
+ sync
+
+ /* Now flush those cache lines */
+ lis r3,0x0002
+// li r3,0x1000 /* 128kB / 32B */
+ mtctr r3
+ li r3, 0
+1:
+ dcbf 0,r3
+ addi r3,r3,0x0020 /* Go to start of next cache line */
+ bdnz 1b
+ sync
+
+ /* We can now disable the L1 cache (HID0:DCE, HID0:ICE) */
+ mfspr r3,SPRN_HID0
+ rlwinm r3,r3,0,18,15
+ mtspr SPRN_HID0,r3
+ sync
+ isync
+ blr
+
+/* inval_enable_L1 - Invalidate and enable L1 cache
+ *
+ * Assumes L1 is already disabled and MSR:EE is off
+ *
+ * clobbers r3
+ */
+ .globl __inval_enable_L1
+ __inval_enable_L1:
+ /* Enable and then Flash inval the instruction & data cache */
+ mfspr r3,SPRN_HID0
+ ori r3,r3, HID0_ICE|HID0_ICFI|HID0_DCE|HID0_DCI
+ sync
+ isync
+ mtspr SPRN_HID0,r3
+ xori r3,r3, HID0_ICFI|HID0_DCI
+ mtspr SPRN_HID0,r3
+ sync
+
+ blr
+
+
diff -uNr linux-2.4.20/arch/ppc/kernel/m8260_setup.c linux-2.4.20-ben10/arch/ppc/kernel/m8260_setup.c
--- linux-2.4.20/arch/ppc/kernel/m8260_setup.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/m8260_setup.c 2003-03-23 11:58:55.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.m8260_setup.c 1.33 09/26/02 22:13:19 paulus
*/
/*
* linux/arch/ppc/kernel/setup.c
diff -uNr linux-2.4.20/arch/ppc/kernel/m8xx_setup.c linux-2.4.20-ben10/arch/ppc/kernel/m8xx_setup.c
--- linux-2.4.20/arch/ppc/kernel/m8xx_setup.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/m8xx_setup.c 2003-03-23 11:59:52.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.m8xx_setup.c 1.45 10/12/02 14:14:20 paulus
*
* linux/arch/ppc/kernel/setup.c
*
@@ -45,6 +45,7 @@
#include
#include
#include
+#include
#include "ppc8xx_pic.h"
@@ -63,9 +64,9 @@
m8xx_setup_arch(void)
{
int cpm_page;
-
+
cpm_page = (int) alloc_bootmem_pages(PAGE_SIZE);
-
+
/* Reset the Communication Processor Module.
*/
m8xx_cpm_reset(cpm_page);
@@ -73,10 +74,10 @@
#ifdef notdef
ROOT_DEV = to_kdev_t(0x0301); /* hda1 */
#endif
-
+
#ifdef CONFIG_BLK_DEV_INITRD
#if 0
- ROOT_DEV = to_kdev_t(0x0200); /* floppy */
+ ROOT_DEV = to_kdev_t(0x0200); /* floppy */
rd_prompt = 1;
rd_doload = 1;
rd_image_start = 0;
@@ -218,7 +219,7 @@
__asm__("mtmsr %0" : : "r" (msr) );
dummy = ((immap_t *)IMAP_ADDR)->im_clkrst.res[0];
- printk("Restart failed\n");
+ printk("Restart failed\n");
while(1);
}
@@ -241,7 +242,7 @@
bd_t *bp;
bp = (bd_t *)__res;
-
+
seq_printf(m, "clock\t\t: %ldMHz\n"
"bus clock\t: %ldMHz\n",
bp->bi_intfreq / 1000000,
@@ -264,7 +265,7 @@
for ( i = 0 ; i < NR_SIU_INTS ; i++ )
irq_desc[i].handler = &ppc8xx_pic;
-
+
/* We could probably incorporate the CPM into the multilevel
* interrupt structure.
*/
@@ -275,7 +276,7 @@
for ( i = NR_SIU_INTS ; i < (NR_SIU_INTS + NR_8259_INTS) ; i++ )
irq_desc[i].handler = &i8259_pic;
i8259_pic.irq_offset = NR_SIU_INTS;
- i8259_init();
+ i8259_init(0);
request_8xxirq(ISA_BRIDGE_INT, mbx_i8259_action, 0, "8259 cascade", NULL);
enable_irq(ISA_BRIDGE_INT);
#endif
@@ -297,7 +298,7 @@
{
bd_t *binfo;
extern unsigned char __res[];
-
+
binfo = (bd_t *)__res;
return binfo->bi_memsize;
@@ -348,7 +349,7 @@
if ( r3 )
memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) );
-
+
#ifdef CONFIG_PCI
m8xx_setup_pci_ptrs();
#endif
@@ -363,7 +364,7 @@
#endif /* CONFIG_BLK_DEV_INITRD */
/* take care of cmd line */
if ( r6 )
- {
+ {
*(char *)(r7+KERNELBASE) = 0;
strcpy(cmd_line, (char *)(r6+KERNELBASE));
}
@@ -397,5 +398,5 @@
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
m8xx_ide_init();
-#endif
+#endif
}
diff -uNr linux-2.4.20/arch/ppc/kernel/misc.S linux-2.4.20-ben10/arch/ppc/kernel/misc.S
--- linux-2.4.20/arch/ppc/kernel/misc.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/misc.S 2003-03-23 11:57:56.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.misc.S 1.51 02/25/03 16:19:51 benh
*/
/*
* This file contains miscellaneous low-level functions.
@@ -203,6 +203,59 @@
mr r4,r24
bctr
+#ifdef CONFIG_CPU_FREQ_PMAC
+
+/* This gets called by via-pmu.c to switch the PLL selection
+ * on 750fx CPU.
+ */
+_GLOBAL(low_choose_750fx_pll)
+ /* Clear MSR:EE */
+ mfmsr r7
+ rlwinm r0,r7,0,17,15
+ mtmsr r0
+
+ /* If switching to PLL1, disable HID0:BTIC */
+ cmpli cr0,r3,0
+ beq 1f
+ mfspr r5,HID0
+ rlwinm r5,r5,0,27,25
+ sync
+ mtspr HID0,r5
+ isync
+ sync
+
+1:
+ /* Calc new HID1 value */
+ mfspr r4,SPRN_HID1 /* Build a HID1:PS bit from parameter */
+ rlwinm r5,r3,16,15,15 /* Clear out HID1:PS from value read */
+ rlwinm r4,r4,0,16,14 /* Could have I used rlwimi here ? */
+ or r4,r4,r5
+ mtspr SPRN_HID1,r4
+
+ /* Store new HID1 image */
+ lwz r6,PROCESSOR(r2)
+ slwi r6,r6,2
+ addis r6,r6,nap_save_hid1@ha
+ stw r4,nap_save_hid1@l(r6)
+
+ /* If switching to PLL0, enable HID0:BTIC */
+ cmpli cr0,r3,0
+ bne 1f
+ mfspr r5,HID0
+ ori r5,r5,HID0_BTIC
+ sync
+ mtspr HID0,r5
+ isync
+ sync
+
+1:
+ /* Return */
+ mtmsr r7
+ blr
+
+#endif /* CONFIG_CPU_FREQ_PMAC */
+
+
/* void __save_flags_ptr(unsigned long *flags) */
_GLOBAL(__save_flags_ptr)
mfmsr r4
diff -uNr linux-2.4.20/arch/ppc/kernel/mk_defs.c linux-2.4.20-ben10/arch/ppc/kernel/mk_defs.c
--- linux-2.4.20/arch/ppc/kernel/mk_defs.c 2001-08-28 15:58:33.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/mk_defs.c 2003-03-23 11:56:23.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mk_defs.c 1.11 08/19/01 22:43:23 paulus
+ * BK Id: SCCS/s.mk_defs.c 1.13 03/05/03 20:16:41 benh
*/
/*
* This program is used to generate definitions needed by
@@ -52,6 +52,7 @@
DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
DEFINE(NEED_RESCHED, offsetof(struct task_struct, need_resched));
+ DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode));
DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0]));
DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr));
#ifdef CONFIG_ALTIVEC
diff -uNr linux-2.4.20/arch/ppc/kernel/open_pic.c linux-2.4.20-ben10/arch/ppc/kernel/open_pic.c
--- linux-2.4.20/arch/ppc/kernel/open_pic.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/open_pic.c 2003-03-23 12:00:36.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.open_pic.c 1.43 03/14/03 19:03:09 benh
*/
/*
* arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling
@@ -38,7 +38,6 @@
static u_int NumSources;
static int open_pic_irq_offset;
static volatile OpenPIC_Source *ISR[NR_IRQS];
-static volatile unsigned char* chrp_int_ack_special;
/* Global Operations */
static void openpic_disable_8259_pass_through(void);
@@ -309,7 +308,6 @@
return;
open_pic_irq_offset = offset;
- chrp_int_ack_special = (volatile unsigned char*)chrp_ack;
/* Initialize timer interrupts */
if ( ppc_md.progress ) ppc_md.progress("openpic: timer",0x3ba);
@@ -494,9 +492,7 @@
openpic_write(&OpenPIC->Global.Processor_Initialization, mask);
}
-#if defined(CONFIG_SMP) || defined(CONFIG_PMAC_PBOOK)
static spinlock_t openpic_setup_lock = SPIN_LOCK_UNLOCKED;
-#endif
#ifdef CONFIG_SMP
/*
@@ -544,14 +540,19 @@
if (OpenPIC == NULL)
return;
+ /* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset,
- openpic_ipi_action, 0, "IPI0 (call function)", 0);
+ openpic_ipi_action, SA_INTERRUPT,
+ "IPI0 (call function)", 0);
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+1,
- openpic_ipi_action, 0, "IPI1 (reschedule)", 0);
+ openpic_ipi_action, SA_INTERRUPT,
+ "IPI1 (reschedule)", 0);
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+2,
- openpic_ipi_action, 0, "IPI2 (invalidate tlb)", 0);
+ openpic_ipi_action, SA_INTERRUPT,
+ "IPI2 (invalidate tlb)", 0);
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+3,
- openpic_ipi_action, 0, "IPI3 (xmon break)", 0);
+ openpic_ipi_action, SA_INTERRUPT,
+ "IPI3 (xmon break)", 0);
for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
openpic_enable_ipi(OPENPIC_VEC_IPI+open_pic_irq_offset+i);
@@ -776,14 +777,8 @@
/* Yep - because openpic !=> i8259, for one thing. -VAL */
if (open_pic_irq_offset && irq == open_pic_irq_offset)
{
- /*
- * This magic address generates a PCI IACK cycle.
- */
- if ( chrp_int_ack_special )
- irq = *chrp_int_ack_special;
#ifndef CONFIG_GEMINI
- else
- irq = i8259_poll(regs);
+ irq = i8259_irq(regs);
#endif
openpic_eoi();
}
@@ -817,11 +812,11 @@
}
#endif /* CONFIG_SMP */
-#ifdef CONFIG_PMAC_PBOOK
-static u32 save_ipi_vp[OPENPIC_NUM_IPI];
-static u32 save_irq_src_vp[OPENPIC_MAX_SOURCES];
-static u32 save_irq_src_dest[OPENPIC_MAX_SOURCES];
-static u32 save_cpu_task_pri[OPENPIC_MAX_PROCESSORS];
+#ifdef CONFIG_ALL_PPC
+static u32 save_ipi_vp[OPENPIC_NUM_IPI] __pmacdata;
+static u32 save_irq_src_vp[OPENPIC_MAX_SOURCES] __pmacdata;
+static u32 save_irq_src_dest[OPENPIC_MAX_SOURCES] __pmacdata;
+static u32 save_cpu_task_pri[OPENPIC_MAX_PROCESSORS] __pmacdata;
void __pmac
openpic_sleep_save_intrs(void)
@@ -876,4 +871,4 @@
spin_unlock_irqrestore(&openpic_setup_lock, flags);
}
-#endif /* CONFIG_PMAC_PBOOK */
+#endif /* CONFIG_ALL_PPC */
diff -uNr linux-2.4.20/arch/ppc/kernel/pci-dma.c linux-2.4.20-ben10/arch/ppc/kernel/pci-dma.c
--- linux-2.4.20/arch/ppc/kernel/pci-dma.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/pci-dma.c 2003-03-23 11:57:10.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.pci-dma.c 1.5 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.pci-dma.c 1.7 06/05/01 21:22:03 paulus
*/
/*
* Copyright (C) 2000 Ani Joshi
diff -uNr linux-2.4.20/arch/ppc/kernel/pci.c linux-2.4.20-ben10/arch/ppc/kernel/pci.c
--- linux-2.4.20/arch/ppc/kernel/pci.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/pci.c 2003-04-02 22:09:00.000000000 +0200
@@ -1,8 +1,8 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.pci.c 1.60 01/20/03 21:55:26 benh
*/
/*
- * Common pmac/prep/chrp pci routines. -- Cort
+ * Common PCI code for PPC architecture
*/
#include
@@ -25,7 +25,7 @@
#include
#include
-#undef DEBUG
+#define DEBUG
#ifdef DEBUG
#define DBG(x...) printk(x)
@@ -113,7 +113,11 @@
int reg;
struct pci_controller* hose = dev->sysdata;
unsigned long io_offset;
-
+
+ if (dev->vendor == PCI_VENDOR_ID_APPLE && dev->device == PCI_DEVICE_ID_APPLE_KEYLARGO) {
+ printk("trying to reloc keylargo !! skipping\n");
+ return;
+ }
new = res->start;
if (hose && res->flags & IORESOURCE_IO) {
io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
@@ -210,7 +214,8 @@
}
if (dev->device == PCI_DEVICE_ID_TI_1210 ||
dev->device == PCI_DEVICE_ID_TI_1211 ||
- dev->device == PCI_DEVICE_ID_TI_1410) {
+ dev->device == PCI_DEVICE_ID_TI_1410 ||
+ dev->device == PCI_DEVICE_ID_TI_1510) {
u8 val;
/* 0x8c == TI122X_IRQMUX, 2 says to route the INTA
signal out the MFUNC0 pin */
@@ -335,8 +340,9 @@
{
struct resource *pr, *r = &dev->resource[idx];
- DBG("PCI:%s: Resource %d: %08lx-%08lx (f=%lx)\n",
- dev->slot_name, idx, r->start, r->end, r->flags);
+ DBG("PCI:%s: Resource %d: %08lx-%08lx (f=%lx), vd: %04x, dev: %04x\n",
+ dev->slot_name, idx, r->start, r->end, r->flags,
+ dev->vendor, dev->device);
pr = pci_find_parent_resource(dev, r);
if (!pr || request_resource(pr, r) < 0) {
printk(KERN_ERR "PCI: Cannot allocate resource region %d"
@@ -795,6 +801,10 @@
}
ranges += np;
}
+ DBG("hose %s, pci_mem_offset: %08lx, start0: %08lx\n",
+ dev->name, hose->pci_mem_offset, hose->mem_resources[0].start);
+ DBG(" io_base_virt: %p, io_base_phys: %08lx, isa_mem_base: %08lx\n",
+ hose->io_base_virt, hose->io_base_phys, isa_mem_base);
}
/* We create the "pci-OF-bus-map" property now so it appears in the
@@ -894,7 +904,8 @@
struct pci_dev *dev = pci_dev_b(ln);
u16 class = dev->class >> 8;
- if (class == PCI_CLASS_DISPLAY_VGA || class == PCI_CLASS_NOT_DEFINED_VGA)
+ 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);
@@ -905,7 +916,8 @@
struct resource *r;
unsigned long r_size;
- if (dev->class >> 8 == PCI_CLASS_BRIDGE_PCI && i >= PCI_BRIDGE_RESOURCES)
+ if (dev->class >> 8 == PCI_CLASS_BRIDGE_PCI
+ && i >= PCI_BRIDGE_RESOURCES)
continue;
r = &dev->resource[i];
r_size = r->end - r->start;
@@ -931,30 +943,45 @@
do_fixup_p2p_level(struct pci_bus *bus)
{
struct list_head *ln;
- int i;
+ int i, parent_io;
int has_vga = 0;
+
+ for (parent_io=0; parent_io<4; parent_io++)
+ if (bus->resource[parent_io]->flags & IORESOURCE_IO)
+ break;
+ if (parent_io >= 4)
+ return;
for (ln=bus->children.next; ln != &bus->children; ln=ln->next) {
struct pci_bus *b = pci_bus_b(ln);
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;
- res->end = 0;
- res->start = 0x1000;
+ 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[0] &&
+ 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, res, &found_vga)) {
+ 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");
+ printk(KERN_WARNING "Skipping VGA, already active"
+ " on bus segment\n");
found_vga = 0;
} else
has_vga = 1;
@@ -962,10 +989,13 @@
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;
+ max = ((unsigned long) hose->io_base_virt
+ - isa_io_base) + 0xffffffff;
else
- max = ((unsigned long) hose->io_base_virt - isa_io_base) + 0xffff;
-
+ max = ((unsigned long) hose->io_base_virt
+ - isa_io_base) + 0xffff;
+
+ *res = tmp_res;
res->flags = IORESOURCE_IO;
res->name = b->name;
@@ -976,10 +1006,12 @@
continue;
if ((r->flags & IORESOURCE_IO) == 0)
continue;
- DBG("Trying to allocate from %08lx, size %08lx from parent res %d: %08lx -> %08lx\n",
+ 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) < 0) {
+ if (allocate_resource(r, res, res->end + 1, res->start, max,
+ res->end + 1, NULL, NULL) < 0) {
DBG("Failed !\n");
continue;
}
@@ -1085,6 +1117,9 @@
return PCI_SLOT(dev->devfn);
}
+/* Where does that come from ? Doesn't seem to be correct for us, but we
+ * don't use it anyway so ... -BenH.
+ */
void __init
pcibios_fixup_pbus_ranges(struct pci_bus * bus, struct pbus_set_ranges_data * ranges)
{
diff -uNr linux-2.4.20/arch/ppc/kernel/pci.c~ linux-2.4.20-ben10/arch/ppc/kernel/pci.c~
--- linux-2.4.20/arch/ppc/kernel/pci.c~ 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/pci.c~ 2003-03-23 12:01:02.000000000 +0100
@@ -0,0 +1,1594 @@
+/*
+ * BK Id: SCCS/s.pci.c 1.60 01/20/03 21:55:26 benh
+ */
+/*
+ * Common PCI code for PPC architecture
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define 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;
+
+void pcibios_make_OF_bus_map(void);
+
+static void pcibios_fixup_resources(struct pci_dev* dev);
+static void fixup_broken_pcnet32(struct pci_dev* dev);
+static void fixup_rev1_53c810(struct pci_dev* dev);
+static void fixup_cpc710_pci64(struct pci_dev* dev);
+#ifdef CONFIG_ALL_PPC
+static void pcibios_fixup_cardbus(struct pci_dev* dev);
+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_busses;
+
+struct pci_controller* hose_head;
+struct pci_controller** hose_tail = &hose_head;
+
+static int pci_bus_count;
+
+struct pci_fixup pcibios_fixups[] = {
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32 },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810 },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64},
+ { PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources },
+#ifdef CONFIG_ALL_PPC
+ /* We should add per-machine fixup support in xxx_setup.c or xxx_pci.c */
+ { PCI_FIXUP_FINAL, PCI_VENDOR_ID_TI, PCI_ANY_ID, pcibios_fixup_cardbus },
+#endif /* CONFIG_ALL_PPC */
+ { 0 }
+};
+
+static void
+fixup_rev1_53c810(struct pci_dev* dev)
+{
+ /* rev 1 ncr53c810 chips don't set the class at all which means
+ * they don't get their resources remapped. Fix that here.
+ */
+
+ if ((dev->class == PCI_CLASS_NOT_DEFINED)) {
+ printk("NCR 53c810 rev 1 detected, setting PCI class.\n");
+ dev->class = PCI_CLASS_STORAGE_SCSI;
+ }
+}
+
+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);
+ pci_name_device(dev);
+ }
+}
+
+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;
+}
+
+void
+pcibios_update_resource(struct pci_dev *dev, struct resource *root,
+ struct resource *res, int resource)
+{
+ u32 new, check;
+ int reg;
+ struct pci_controller* hose = dev->sysdata;
+ unsigned long io_offset;
+
+ if (dev->vendor == PCI_VENDOR_ID_APPLE && dev->device == PCI_DEVICE_ID_APPLE_KEYLARGO) {
+ printk("trying to reloc keylargo !! skipping\n");
+ return;
+ }
+ new = res->start;
+ if (hose && res->flags & IORESOURCE_IO) {
+ io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
+ new -= io_offset;
+ }
+ if (hose && res->flags & IORESOURCE_MEM)
+ new -= hose->pci_mem_offset;
+ new |= (res->flags & PCI_REGION_FLAG_MASK);
+ if (resource < 6) {
+ reg = PCI_BASE_ADDRESS_0 + 4*resource;
+ } else if (resource == PCI_ROM_RESOURCE) {
+ res->flags |= PCI_ROM_ADDRESS_ENABLE;
+ reg = dev->rom_base_reg;
+ } else {
+ /* Somebody might have asked allocation of a non-standard resource */
+ return;
+ }
+
+ pci_write_config_dword(dev, reg, new);
+ pci_read_config_dword(dev, reg, &check);
+ if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) {
+ printk(KERN_ERR "PCI: Error while updating region "
+ "%s/%d (%08x != %08x)\n", dev->slot_name, resource,
+ new, check);
+ }
+}
+
+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", dev->slot_name);
+ return;
+ }
+ for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+ struct resource *res = dev->resource + i;
+ if (!res->start || !res->flags)
+ continue;
+ if (res->end == 0xffffffff) {
+ DBG("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n",
+ dev->slot_name, i, res->start, res->end);
+ res->end -= res->start;
+ res->start = 0;
+ 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, dev->slot_name,
+ res->start - offset, res->start);
+#endif
+ }
+ }
+
+ /* Call machine specific resource fixup */
+ if (ppc_md.pcibios_fixup_resources)
+ ppc_md.pcibios_fixup_resources(dev);
+}
+
+#ifdef CONFIG_ALL_PPC
+static void
+pcibios_fixup_cardbus(struct pci_dev* dev)
+{
+ if (_machine != _MACH_Pmac)
+ return;
+ /*
+ * Fix the interrupt routing on the various cardbus bridges
+ * used on powerbooks
+ */
+ if (dev->vendor != PCI_VENDOR_ID_TI)
+ return;
+ if (dev->device == PCI_DEVICE_ID_TI_1130 ||
+ dev->device == PCI_DEVICE_ID_TI_1131) {
+ u8 val;
+ /* Enable PCI interrupt */
+ if (pci_read_config_byte(dev, 0x91, &val) == 0)
+ pci_write_config_byte(dev, 0x91, val | 0x30);
+ /* Disable ISA interrupt mode */
+ if (pci_read_config_byte(dev, 0x92, &val) == 0)
+ pci_write_config_byte(dev, 0x92, val & ~0x06);
+ }
+ if (dev->device == PCI_DEVICE_ID_TI_1210 ||
+ dev->device == PCI_DEVICE_ID_TI_1211 ||
+ dev->device == PCI_DEVICE_ID_TI_1410) {
+ u8 val;
+ /* 0x8c == TI122X_IRQMUX, 2 says to route the INTA
+ signal out the MFUNC0 pin */
+ if (pci_read_config_byte(dev, 0x8c, &val) == 0)
+ pci_write_config_byte(dev, 0x8c, (val & ~0x0f) | 2);
+ /* Disable ISA interrupt mode */
+ if (pci_read_config_byte(dev, 0x92, &val) == 0)
+ pci_write_config_byte(dev, 0x92, val & ~0x06);
+ }
+}
+#endif /* CONFIG_ALL_PPC */
+
+/*
+ * 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", dev->slot_name,
+ dev->resource - res, size);
+ }
+
+ if (start & 0x300) {
+ start = (start + 0x3ff) & ~0x3ff;
+ res->start = start;
+ }
+ }
+}
+
+
+/*
+ * 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 list_head *ln;
+ struct pci_bus *bus;
+ int i;
+ struct resource *res, *pr;
+
+ /* Depth-First Search on bus tree */
+ for (ln = bus_list->next; ln != bus_list; ln=ln->next) {
+ bus = pci_bus_b(ln);
+ for (i = 0; i < 4; ++i) {
+ if ((res = bus->resource[i]) == NULL || !res->flags)
+ 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;
+ }
+ }
+
+ if (pr && request_resource(pr, res) == 0)
+ continue;
+ printk(KERN_ERR "PCI: Cannot allocate resource region "
+ "%d of PCI bridge %d\n", i, bus->number);
+ DBG("PCI: resource is %lx..%lx (%lx), parent %p\n",
+ res->start, res->end, res->flags, pr);
+ }
+ pcibios_allocate_bus_resources(&bus->children);
+ }
+}
+
+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), vd: %04x, dev: %04x\n",
+ dev->slot_name, idx, r->start, r->end, r->flags,
+ dev->vendor, dev->device);
+ 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, dev->slot_name);
+ 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->end -= r->start;
+ r->start = 0;
+ }
+}
+
+static void __init
+pcibios_allocate_resources(int pass)
+{
+ struct pci_dev *dev;
+ int idx, disabled;
+ u16 command;
+ struct resource *r;
+
+ pci_for_each_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->start) /* Not assigned at all */
+ continue;
+ 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 & PCI_ROM_ADDRESS_ENABLE) {
+ /* Turn the ROM off, leave the resource region, but keep it unregistered. */
+ u32 reg;
+ DBG("PCI: Switching off ROM of %s\n", dev->slot_name);
+ r->flags &= ~PCI_ROM_ADDRESS_ENABLE;
+ pci_read_config_dword(dev, dev->rom_base_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;
+ int idx;
+ struct resource *r;
+
+ pci_for_each_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->start && r->end &&
+ (!ppc_md.pcibios_enable_device_hook ||
+ !ppc_md.pcibios_enable_device_hook(dev, 1)))
+ 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)
+{
+ 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++) {
+ r = &dev->resource[idx];
+ if (!r->start && r->end) {
+ printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name);
+ 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", dev->slot_name, 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_ALL_PPC
+/*
+ * Functions below are used on OpenFirmware machines.
+ */
+static void __openfirmware
+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\n",
+ node->full_name);
+ return;
+ }
+ 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", 0);
+ 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", 0);
+ 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 __openfirmware
+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; inext) {
+ 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", 0);
+ 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 %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* __openfirmware
+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", 0);
+ 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", 0);
+ if (reg && ((reg[0] >> 8) & 0xff) == fdata[1]
+ && ((reg[0] >> 16) & 0xff) == fdata[0])
+ return 1;
+ return 0;
+}
+
+static struct device_node* __openfirmware
+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_device_to_OF_node(struct pci_dev *dev)
+{
+ struct pci_controller *hose;
+ struct device_node *node;
+ int bus;
+
+ if (!have_of)
+ return NULL;
+
+ /* Lookup the hose */
+ bus = dev->bus->number;
+ hose = pci_bus_to_hose(bus);
+ 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. */
+ if (pci_to_OF_bus_map)
+ bus = pci_to_OF_bus_map[bus];
+ if (bus == 0xff)
+ return NULL;
+
+ /* Now, lookup childs of the hose */
+ return scan_OF_childs_for_device(node->child, bus, dev->devfn);
+}
+
+/* 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_busses 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 __openfirmware
+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;
+
+ 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", 0);
+ 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;
+ pci_for_each_dev(dev) {
+ if (pci_to_OF_bus_map[dev->bus->number] != *bus)
+ continue;
+ if (dev->devfn != *devfn)
+ continue;
+ *bus = dev->bus->number;
+ return 0;
+ }
+ return -ENODEV;
+}
+
+void __init
+pci_process_bridge_OF_ranges(struct pci_controller *hose,
+ struct device_node *dev, int primary)
+{
+ unsigned int *ranges, *prev;
+ int rlen = 0;
+ 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
+ */
+ ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
+ 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
+ */
+ rlen = 0;
+ hose->io_base_phys = 0;
+ ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
+ while ((rlen -= np * sizeof(unsigned int)) >= 0) {
+ res = NULL;
+ switch (ranges[0] >> 24) {
+ case 1: /* I/O space */
+ if (ranges[2] != 0)
+ break;
+ hose->io_base_phys = ranges[na+2];
+ hose->io_base_virt = ioremap(ranges[na+2], ranges[na+4]);
+ if (primary)
+ isa_io_base = (unsigned long) hose->io_base_virt;
+ res = &hose->io_resource;
+ res->flags = IORESOURCE_IO;
+ res->start = ranges[2];
+ 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;
+ res->start = ranges[na+2];
+ }
+ break;
+ }
+ if (res != NULL) {
+ res->name = dev->full_name;
+ res->end = res->start + ranges[na+4] - 1;
+ res->parent = NULL;
+ res->sibling = NULL;
+ res->child = NULL;
+ }
+ ranges += np;
+ }
+ DBG("hose %s, pci_mem_offset: %08lx, start0: %08lx\n",
+ dev->name, hose->pci_mem_offset, hose->mem_resources[0].start);
+ DBG(" io_base_virt: %p, io_base_phys: %08lx, isa_mem_base: %08lx\n",
+ hose->io_base_virt, hose->io_base_phys, isa_mem_base);
+}
+
+/* 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);
+ }
+}
+#endif /* CONFIG_ALL_PPC */
+
+/*
+ * 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;
+
+ res = *(bus->resource[0]);
+
+ DBG("Remapping Bus %d, bridge: %s\n", bus->number, bridge->name);
+ 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 list_head *ln;
+ 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)
+
+ for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) {
+ struct pci_dev *dev = pci_dev_b(ln);
+ 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; iclass >> 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 list_head *ln;
+ int i, parent_io;
+ int has_vga = 0;
+
+ for (parent_io=0; parent_io<4; parent_io++)
+ if (bus->resource[parent_io]->flags & IORESOURCE_IO)
+ break;
+ if (parent_io >= 4)
+ return;
+
+ for (ln=bus->children.next; ln != &bus->children; ln=ln->next) {
+ struct pci_bus *b = pci_bus_b(ln);
+ 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) < 0) {
+ DBG("Failed !\n");
+ continue;
+ }
+ do_update_p2p_io_resource(b, found_vga);
+ break;
+ }
+ }
+ do_fixup_p2p_level(b);
+ }
+}
+
+static void
+pcibios_fixup_p2p_bridges(void)
+{
+ struct list_head *ln;
+
+ for(ln=pci_root_buses.next; ln != &pci_root_buses; ln=ln->next) {
+ struct pci_bus *b = pci_bus_b(ln);
+ do_fixup_p2p_level(b);
+ }
+}
+
+void __init
+pcibios_init(void)
+{
+ struct pci_controller *hose;
+ struct pci_bus *bus;
+ int next_busno, bus_offset;
+
+ printk(KERN_INFO "PCI: Probing PCI hardware\n");
+
+ /* There is a problem with bus renumbering currently. If
+ * you have 2 sibling pci<->pci bridges, and during PCI
+ * probe, the first one gets assigned a new number equal
+ * to the old number of the second one, you'll end up
+ * probing that branch with 2 bridges racing on the bus
+ * numbers.
+ * I work around this on pmac by adding a large offset
+ * between host bridges, though a better long term solution
+ * will have to be found in the generic code. --BenH
+ */
+#ifdef CONFIG_ALL_PPC
+ if (machine_is_compatible("MacRISC"))
+ bus_offset = 0x10;
+ else
+#endif
+ bus_offset = 1;
+ /* Scan all of the recorded PCI controllers. */
+ for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
+ if (pci_assign_all_busses)
+ hose->first_busno = next_busno;
+ hose->last_busno = 0xff;
+ bus = pci_scan_bus(hose->first_busno, hose->ops, hose);
+ hose->last_busno = bus->subordinate;
+ if (pci_assign_all_busses || next_busno <= hose->last_busno)
+ next_busno = hose->last_busno + bus_offset;
+ }
+ pci_bus_count = next_busno;
+
+ /* OpenFirmware based machines need a map of OF bus
+ * numbers vs. kernel bus numbers since we may have to
+ * remap them.
+ */
+ if (pci_assign_all_busses && have_of)
+ pcibios_make_OF_bus_map();
+
+ /* Do machine dependent PCI interrupt routing */
+ if (ppc_md.pci_swizzle && ppc_md.pci_map_irq)
+ pci_fixup_irqs(ppc_md.pci_swizzle, ppc_md.pci_map_irq);
+
+ /* Call machine dependant fixup */
+ if (ppc_md.pcibios_fixup)
+ ppc_md.pcibios_fixup();
+
+ /* Allocate and assign resources */
+ pcibios_allocate_bus_resources(&pci_root_buses);
+ pcibios_allocate_resources(0);
+ pcibios_allocate_resources(1);
+ pcibios_fixup_p2p_bridges();
+ pcibios_assign_resources();
+
+ /* Call machine dependent post-init code */
+ if (ppc_md.pcibios_after_init)
+ ppc_md.pcibios_after_init();
+}
+
+unsigned char __init
+common_swizzle(struct pci_dev *dev, unsigned char *pinp)
+{
+ struct pci_controller *hose = dev->sysdata;
+
+ if (dev->bus->number != hose->first_busno) {
+ u8 pin = *pinp;
+ do {
+ pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
+ /* Move up the chain of bridges. */
+ dev = dev->bus->self;
+ } while (dev->bus->self);
+ *pinp = pin;
+
+ /* The slot is the idsel of the last bridge. */
+ }
+ return PCI_SLOT(dev->devfn);
+}
+
+/* Where does that come from ? Doesn't seem to be correct for us, but we
+ * don't use it anyway so ... -BenH.
+ */
+void __init
+pcibios_fixup_pbus_ranges(struct pci_bus * bus, struct pbus_set_ranges_data * ranges)
+{
+ ranges->io_start -= bus->resource[0]->start;
+ ranges->io_end -= bus->resource[0]->start;
+ ranges->mem_start -= bus->resource[1]->start;
+ ranges->mem_end -= bus->resource[1]->start;
+}
+
+unsigned long resource_fixup(struct pci_dev * dev, struct resource * res,
+ unsigned long start, unsigned long size)
+{
+ return start;
+}
+
+void __init pcibios_fixup_bus(struct pci_bus *bus)
+{
+ struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
+ unsigned long io_offset;
+ struct resource *res;
+ int i;
+
+ io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
+ if (bus->parent == NULL) {
+ /* This is a host bridge - fill in its resources */
+ hose->bus = bus;
+
+ bus->resource[0] = res = &hose->io_resource;
+ if (!res->flags) {
+ if (io_offset)
+ printk(KERN_ERR "I/O resource not set for host"
+ " bridge %d\n", hose->index);
+ res->start = 0;
+ res->end = IO_SPACE_LIMIT;
+ res->flags = IORESOURCE_IO;
+ }
+ res->start += io_offset;
+ res->end += io_offset;
+
+ for (i = 0; i < 3; ++i) {
+ res = &hose->mem_resources[i];
+ if (!res->flags) {
+ if (i > 0)
+ continue;
+ printk(KERN_ERR "Memory resource not set for "
+ "host bridge %d\n", hose->index);
+ res->start = hose->pci_mem_offset;
+ res->end = ~0U;
+ res->flags = IORESOURCE_MEM;
+ }
+ bus->resource[i+1] = res;
+ }
+ } else {
+ /* This is a subordinate bridge */
+ pci_read_bridge_bases(bus);
+
+ for (i = 0; i < 4; ++i) {
+ if ((res = bus->resource[i]) == NULL)
+ continue;
+ if (!res->flags)
+ continue;
+ if (io_offset && (res->flags & IORESOURCE_IO)) {
+ res->start += io_offset;
+ res->end += io_offset;
+ } else if (hose->pci_mem_offset
+ && (res->flags & IORESOURCE_MEM)) {
+ res->start += hose->pci_mem_offset;
+ res->end += hose->pci_mem_offset;
+ }
+ }
+ }
+
+ if (ppc_md.pcibios_fixup_bus)
+ ppc_md.pcibios_fixup_bus(bus);
+}
+
+char __init *pcibios_setup(char *str)
+{
+ return str;
+}
+
+/* the next one is stolen from the alpha port... */
+void __init
+pcibios_update_irq(struct pci_dev *dev, int irq)
+{
+ pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
+ /* XXX FIXME - update OF device tree node interrupt property */
+}
+
+int pcibios_enable_device(struct pci_dev *dev, int mask)
+{
+ u16 cmd, old_cmd;
+ int idx;
+ struct resource *r;
+
+ if (ppc_md.pcibios_enable_device_hook)
+ if (ppc_md.pcibios_enable_device_hook(dev, 0))
+ return -EINVAL;
+
+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
+ old_cmd = cmd;
+ for (idx=0; idx<6; idx++) {
+ if(!(mask & (1<resource[idx];
+ if (!r->start && r->end) {
+ printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name);
+ return -EINVAL;
+ }
+ if (r->flags & IORESOURCE_IO)
+ cmd |= PCI_COMMAND_IO;
+ if (r->flags & IORESOURCE_MEM)
+ cmd |= PCI_COMMAND_MEMORY;
+ }
+ if (cmd != old_cmd) {
+ printk("PCI: Enabling device %s (%04x -> %04x)\n",
+ dev->slot_name, old_cmd, cmd);
+ pci_write_config_word(dev, PCI_COMMAND, cmd);
+ }
+ return 0;
+}
+
+struct pci_controller*
+pci_bus_to_hose(int bus)
+{
+ struct pci_controller* hose = hose_head;
+
+ for (; hose; hose = hose->next)
+ if (bus >= hose->first_busno && bus <= hose->last_busno)
+ return hose;
+ return NULL;
+}
+
+void*
+pci_bus_io_base(unsigned int bus)
+{
+ struct pci_controller *hose;
+
+ hose = pci_bus_to_hose(bus);
+ if (!hose)
+ return NULL;
+ return hose->io_base_virt;
+}
+
+unsigned long
+pci_bus_io_base_phys(unsigned int bus)
+{
+ struct pci_controller *hose;
+
+ hose = pci_bus_to_hose(bus);
+ if (!hose)
+ return 0;
+ return hose->io_base_phys;
+}
+
+unsigned long
+pci_bus_mem_base_phys(unsigned int bus)
+{
+ struct pci_controller *hose;
+
+ hose = pci_bus_to_hose(bus);
+ if (!hose)
+ return 0;
+ return hose->pci_mem_offset;
+}
+
+unsigned long
+pci_resource_to_bus(struct pci_dev *pdev, struct resource *res)
+{
+ /* Hack alert again ! See comments in chrp_pci.c
+ */
+ struct pci_controller* hose =
+ (struct pci_controller *)pdev->sysdata;
+ if (hose && res->flags & IORESOURCE_MEM)
+ return res->start - hose->pci_mem_offset;
+ /* We may want to do something with IOs here... */
+ return res->start;
+}
+
+/*
+ * Return the index of the PCI controller for device pdev.
+ */
+int pci_controller_num(struct pci_dev *dev)
+{
+ struct pci_controller *hose = (struct pci_controller *) dev->sysdata;
+
+ return hose->index;
+}
+
+/*
+ * Platform support for /proc/bus/pci/X/Y mmap()s,
+ * modelled on the sparc64 implementation by Dave Miller.
+ * -- paulus.
+ */
+
+/*
+ * Adjust vm_pgoff of VMA such that it is the physical page offset
+ * corresponding to the 32-bit pci bus offset for DEV requested by the user.
+ *
+ * Basically, the user finds the base address for his device which he wishes
+ * to mmap. They read the 32-bit value from the config space base register,
+ * add whatever PAGE_SIZE multiple offset they wish, and feed this into the
+ * offset parameter of mmap on /proc/bus/pci/XXX for that device.
+ *
+ * Returns negative error code on failure, zero on success.
+ */
+static __inline__ int
+__pci_mmap_make_offset(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state)
+{
+ struct pci_controller *hose = (struct pci_controller *) dev->sysdata;
+ unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
+ unsigned long io_offset = 0;
+ int i, res_bit;
+
+ if (hose == 0)
+ return -EINVAL; /* should never happen */
+
+ /* If memory, add on the PCI bridge address offset */
+ if (mmap_state == pci_mmap_mem) {
+ offset += hose->pci_mem_offset;
+ res_bit = IORESOURCE_MEM;
+ } else {
+ io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
+ offset += io_offset;
+ res_bit = IORESOURCE_IO;
+ }
+
+ /*
+ * Check that the offset requested corresponds to one of the
+ * resources of the device.
+ */
+ for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
+ struct resource *rp = &dev->resource[i];
+ int flags = rp->flags;
+
+ /* treat ROM as memory (should be already) */
+ if (i == PCI_ROM_RESOURCE)
+ flags |= IORESOURCE_MEM;
+
+ /* Active and same type? */
+ if ((flags & res_bit) == 0)
+ continue;
+
+ /* In the range of this resource? */
+ if (offset < (rp->start & PAGE_MASK) || offset > rp->end)
+ continue;
+
+ /* found it! construct the final physical address */
+ if (mmap_state == pci_mmap_io)
+ offset += hose->io_base_phys - io_offset;
+
+ vma->vm_pgoff = offset >> PAGE_SHIFT;
+ return 0;
+ }
+
+ return -EINVAL;
+}
+
+/*
+ * Set vm_flags of VMA, as appropriate for this architecture, for a pci device
+ * mapping.
+ */
+static __inline__ void
+__pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state)
+{
+ vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO;
+}
+
+/*
+ * Set vm_page_prot of VMA, as appropriate for this architecture, for a pci
+ * device mapping.
+ */
+static __inline__ void
+__pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state, int write_combine)
+{
+ int prot = pgprot_val(vma->vm_page_prot);
+
+ /* XXX would be nice to have a way to ask for write-through */
+ prot |= _PAGE_NO_CACHE;
+ if (!write_combine)
+ prot |= _PAGE_GUARDED;
+ vma->vm_page_prot = __pgprot(prot);
+}
+
+/*
+ * Perform the actual remap of the pages for a PCI device mapping, as
+ * appropriate for this architecture. The region in the process to map
+ * is described by vm_start and vm_end members of VMA, the base physical
+ * address is found in vm_pgoff.
+ * The pci device structure is provided so that architectures may make mapping
+ * decisions on a per-device or per-bus basis.
+ *
+ * Returns a negative error code on failure, zero on success.
+ */
+int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state,
+ int write_combine)
+{
+ int ret;
+
+ ret = __pci_mmap_make_offset(dev, vma, mmap_state);
+ if (ret < 0)
+ return ret;
+
+ __pci_mmap_set_flags(dev, vma, mmap_state);
+ __pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine);
+
+ ret = remap_page_range(vma->vm_start, vma->vm_pgoff << PAGE_SHIFT,
+ vma->vm_end - vma->vm_start, vma->vm_page_prot);
+
+ return ret;
+}
+
+/* Obsolete functions. Should be removed once the symbios driver
+ * is fixed
+ */
+unsigned long
+phys_to_bus(unsigned long pa)
+{
+ struct pci_controller *hose;
+ int i;
+
+ for (hose = hose_head; hose; hose = hose->next) {
+ for (i = 0; i < 3; ++i) {
+ if (pa >= hose->mem_resources[i].start
+ && pa <= hose->mem_resources[i].end) {
+ /*
+ * XXX the hose->pci_mem_offset really
+ * only applies to mem_resources[0].
+ * We need a way to store an offset for
+ * the others. -- paulus
+ */
+ if (i == 0)
+ pa -= hose->pci_mem_offset;
+ return pa;
+ }
+ }
+ }
+ /* hmmm, didn't find it */
+ return 0;
+}
+
+unsigned long
+pci_phys_to_bus(unsigned long pa, int busnr)
+{
+ struct pci_controller* hose = pci_bus_to_hose(busnr);
+ if (!hose)
+ return pa;
+ return pa - hose->pci_mem_offset;
+}
+
+unsigned long
+pci_bus_to_phys(unsigned int ba, int busnr)
+{
+ struct pci_controller* hose = pci_bus_to_hose(busnr);
+ if (!hose)
+ return ba;
+ return ba + hose->pci_mem_offset;
+}
+
+/* Provide information on locations of various I/O regions in physical
+ * memory. Do this on a per-card basis so that we choose the right
+ * root bridge.
+ * Note that the returned IO or memory base is a physical address
+ */
+
+long
+sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
+{
+ struct pci_controller* hose = pci_bus_to_hose(bus);
+ long result = -EOPNOTSUPP;
+
+ if (!hose)
+ return -ENODEV;
+
+ switch (which) {
+ case IOBASE_BRIDGE_NUMBER:
+ return (long)hose->first_busno;
+ case IOBASE_MEMORY:
+ return (long)hose->pci_mem_offset;
+ case IOBASE_IO:
+ return (long)hose->io_base_phys;
+ case IOBASE_ISA_IO:
+ return (long)isa_io_base;
+ case IOBASE_ISA_MEM:
+ return (long)isa_mem_base;
+ }
+
+ return result;
+}
+
+void __init
+pci_init_resource(struct resource *res, unsigned long start, unsigned long end,
+ int flags, char *name)
+{
+ res->start = start;
+ res->end = end;
+ res->flags = flags;
+ res->name = name;
+ res->parent = NULL;
+ res->sibling = NULL;
+ res->child = NULL;
+}
+
+/*
+ * Null PCI config access functions, for the case when we can't
+ * find a hose.
+ */
+#define NULL_PCI_OP(rw, size, type) \
+static int \
+null_##rw##_config_##size(struct pci_dev *dev, int offset, type val) \
+{ \
+ return PCIBIOS_DEVICE_NOT_FOUND; \
+}
+
+NULL_PCI_OP(read, byte, u8 *)
+NULL_PCI_OP(read, word, u16 *)
+NULL_PCI_OP(read, dword, u32 *)
+NULL_PCI_OP(write, byte, u8)
+NULL_PCI_OP(write, word, u16)
+NULL_PCI_OP(write, dword, u32)
+
+static struct pci_ops null_pci_ops =
+{
+ null_read_config_byte,
+ null_read_config_word,
+ null_read_config_dword,
+ null_write_config_byte,
+ null_write_config_word,
+ null_write_config_dword
+};
+
+/*
+ * These functions are used early on before PCI scanning is done
+ * and all of the pci_dev and pci_bus structures have been created.
+ */
+static struct pci_dev *
+fake_pci_dev(struct pci_controller *hose, int busnr, int devfn)
+{
+ static struct pci_dev dev;
+ static struct pci_bus bus;
+
+ if (hose == 0) {
+ hose = pci_bus_to_hose(busnr);
+ if (hose == 0)
+ printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr);
+ }
+ dev.bus = &bus;
+ dev.sysdata = hose;
+ dev.devfn = devfn;
+ bus.number = busnr;
+ bus.ops = hose? hose->ops: &null_pci_ops;
+ return &dev;
+}
+
+#define EARLY_PCI_OP(rw, size, type) \
+int early_##rw##_config_##size(struct pci_controller *hose, int bus, \
+ int devfn, int offset, type value) \
+{ \
+ return pci_##rw##_config_##size(fake_pci_dev(hose, bus, devfn), \
+ offset, value); \
+}
+
+EARLY_PCI_OP(read, byte, u8 *)
+EARLY_PCI_OP(read, word, u16 *)
+EARLY_PCI_OP(read, dword, u32 *)
+EARLY_PCI_OP(write, byte, u8)
+EARLY_PCI_OP(write, word, u16)
+EARLY_PCI_OP(write, dword, u32)
diff -uNr linux-2.4.20/arch/ppc/kernel/pci.h linux-2.4.20-ben10/arch/ppc/kernel/pci.h
--- linux-2.4.20/arch/ppc/kernel/pci.h 2001-08-12 21:43:26.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/pci.h 2003-03-23 12:00:02.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.pci.h 1.10 08/08/01 16:35:43 paulus
+ * BK Id: SCCS/s.pci.h 1.11 08/13/01 10:44:12 paulus
*/
#ifndef __PPC_KERNEL_PCI_H__
diff -uNr linux-2.4.20/arch/ppc/kernel/ppc-stub.c linux-2.4.20-ben10/arch/ppc/kernel/ppc-stub.c
--- linux-2.4.20/arch/ppc/kernel/ppc-stub.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/ppc-stub.c 2003-03-23 11:59:00.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.ppc-stub.c 1.6 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.ppc-stub.c 1.8 06/05/01 21:22:03 paulus
*/
/*
* ppc-stub.c: KGDB support for the Linux kernel.
diff -uNr linux-2.4.20/arch/ppc/kernel/ppc4xx_pic.c linux-2.4.20-ben10/arch/ppc/kernel/ppc4xx_pic.c
--- linux-2.4.20/arch/ppc/kernel/ppc4xx_pic.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/ppc4xx_pic.c 2003-03-23 11:58:36.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.ppc4xx_pic.c 1.5 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.ppc4xx_pic.c 1.8 08/13/02 20:27:37 paulus
*/
/*
*
diff -uNr linux-2.4.20/arch/ppc/kernel/ppc8260_pic.c linux-2.4.20-ben10/arch/ppc/kernel/ppc8260_pic.c
--- linux-2.4.20/arch/ppc/kernel/ppc8260_pic.c 2002-02-25 20:37:55.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/ppc8260_pic.c 2003-03-23 11:59:23.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.ppc8260_pic.c 1.5 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.ppc8260_pic.c 1.9 02/14/02 12:33:42 trini
*/
#include
diff -uNr linux-2.4.20/arch/ppc/kernel/ppc8260_pic.h linux-2.4.20-ben10/arch/ppc/kernel/ppc8260_pic.h
--- linux-2.4.20/arch/ppc/kernel/ppc8260_pic.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/ppc8260_pic.h 2003-03-23 12:01:07.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.ppc8260_pic.h 1.10 08/13/02 20:27:37 paulus
*/
#ifndef _PPC_KERNEL_PPC8260_H
diff -uNr linux-2.4.20/arch/ppc/kernel/ppc8xx_pic.c linux-2.4.20-ben10/arch/ppc/kernel/ppc8xx_pic.c
--- linux-2.4.20/arch/ppc/kernel/ppc8xx_pic.c 2002-02-25 20:37:55.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/ppc8xx_pic.c 2003-03-23 11:56:43.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.ppc8xx_pic.c 1.13 12/01/01 17:19:48 trini
+ * BK Id: SCCS/s.ppc8xx_pic.c 1.14 12/27/01 10:08:50 trini
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/kernel/ppc8xx_pic.h linux-2.4.20-ben10/arch/ppc/kernel/ppc8xx_pic.h
--- linux-2.4.20/arch/ppc/kernel/ppc8xx_pic.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/ppc8xx_pic.h 2003-03-23 11:58:26.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.ppc8xx_pic.h 1.10 08/13/02 20:27:38 paulus
*/
#ifndef _PPC_KERNEL_PPC8xx_H
#define _PPC_KERNEL_PPC8xx_H
diff -uNr linux-2.4.20/arch/ppc/kernel/ppc_htab.c linux-2.4.20-ben10/arch/ppc/kernel/ppc_htab.c
--- linux-2.4.20/arch/ppc/kernel/ppc_htab.c 2001-11-03 02:43:54.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/ppc_htab.c 2003-03-23 12:01:06.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.ppc_htab.c 1.19 10/16/01 15:58:42 trini
+ * BK Id: SCCS/s.ppc_htab.c 1.20 11/04/01 22:58:20 paulus
*/
/*
* PowerPC hash table management proc entry. Will show information
diff -uNr linux-2.4.20/arch/ppc/kernel/ppc_ksyms.c linux-2.4.20-ben10/arch/ppc/kernel/ppc_ksyms.c
--- linux-2.4.20/arch/ppc/kernel/ppc_ksyms.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/ppc_ksyms.c 2003-04-02 22:09:41.000000000 +0200
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.ppc_ksyms.c 1.75 03/14/03 19:02:15 benh
*/
#include
#include
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
#include
#include
@@ -70,9 +71,11 @@
extern int pmac_newworld;
extern int sys_sigreturn(struct pt_regs *regs);
-long long __ashrdi3(long long, int);
-long long __ashldi3(long long, int);
-long long __lshrdi3(long long, int);
+extern long long __ashrdi3(long long, int);
+extern long long __ashldi3(long long, int);
+extern long long __lshrdi3(long long, int);
+extern u32 __div64_32(u64 *dividend, u32 div);
+
int abs(int);
extern unsigned char __res[];
@@ -285,6 +288,7 @@
EXPORT_SYMBOL_NOVERS(__ashrdi3);
EXPORT_SYMBOL_NOVERS(__ashldi3);
EXPORT_SYMBOL_NOVERS(__lshrdi3);
+EXPORT_SYMBOL_NOVERS(__div64_32);
EXPORT_SYMBOL_NOVERS(memcpy);
EXPORT_SYMBOL_NOVERS(memset);
EXPORT_SYMBOL_NOVERS(memmove);
@@ -317,7 +321,7 @@
EXPORT_SYMBOL(get_wchan);
EXPORT_SYMBOL(console_drivers);
#ifdef CONFIG_XMON
-extern void xmon_printf(char *fmt, ...);
+extern void xmon_printf(const char *fmt, ...);
EXPORT_SYMBOL(xmon);
EXPORT_SYMBOL(xmon_printf);
#endif
@@ -348,10 +352,18 @@
EXPORT_SYMBOL(cpm_free_handler);
#endif /* CONFIG_8xx */
+/* Those should really be inline */
+EXPORT_SYMBOL(atomic_clear_mask);
+EXPORT_SYMBOL(atomic_set_mask);
+
EXPORT_SYMBOL(ret_to_user_hook);
EXPORT_SYMBOL(next_mmu_context);
EXPORT_SYMBOL(set_context);
EXPORT_SYMBOL(handle_mm_fault); /* For MOL */
+#ifdef CONFIG_SMP
+extern int *hash_table_lock;
+EXPORT_SYMBOL_NOVERS(hash_table_lock); /* For MOL */
+#endif
EXPORT_SYMBOL_NOVERS(disarm_decr);
#ifdef CONFIG_PPC_STD_MMU
EXPORT_SYMBOL(flush_hash_page); /* For MOL */
@@ -362,6 +374,10 @@
EXPORT_SYMBOL(ret_from_intercept);
EXPORT_SYMBOL(cur_cpu_spec);
#if defined(CONFIG_ALL_PPC)
+extern int map_page(unsigned long va, unsigned long pa, int flags);
+
+EXPORT_SYMBOL(map_page);
+EXPORT_SYMBOL(get_vm_area);
extern unsigned long agp_special_page;
EXPORT_SYMBOL_NOVERS(agp_special_page);
#endif /* defined(CONFIG_ALL_PPC) */
diff -uNr linux-2.4.20/arch/ppc/kernel/ppc_ksyms.c~ linux-2.4.20-ben10/arch/ppc/kernel/ppc_ksyms.c~
--- linux-2.4.20/arch/ppc/kernel/ppc_ksyms.c~ 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/ppc_ksyms.c~ 2003-03-23 11:58:10.000000000 +0100
@@ -0,0 +1,380 @@
+/*
+ * BK Id: SCCS/s.ppc_ksyms.c 1.75 03/14/03 19:02:15 benh
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#ifdef CONFIG_SMP
+#include
+#include
+#endif /* CONFIG_SMP */
+#include
+#include
+#include
+
+#ifdef CONFIG_8xx
+#include
+#endif
+
+/* Tell string.h we don't want memcpy etc. as cpp defines */
+#define EXPORT_SYMTAB_STROPS
+
+extern void ppc_generic_ide_fix_driveid(struct hd_driveid *id);
+extern void transfer_to_handler(void);
+extern void syscall_trace(void);
+extern void do_IRQ(struct pt_regs *regs);
+extern void MachineCheckException(struct pt_regs *regs);
+extern void AlignmentException(struct pt_regs *regs);
+extern void ProgramCheckException(struct pt_regs *regs);
+extern void SingleStepException(struct pt_regs *regs);
+extern int do_signal(sigset_t *, struct pt_regs *);
+extern int pmac_newworld;
+extern int sys_sigreturn(struct pt_regs *regs);
+
+extern long long __ashrdi3(long long, int);
+extern long long __ashldi3(long long, int);
+extern long long __lshrdi3(long long, int);
+extern u32 __div64_32(u64 *dividend, u32 div);
+
+int abs(int);
+
+extern unsigned char __res[];
+
+extern unsigned long ret_to_user_hook;
+extern unsigned long mm_ptov (unsigned long paddr);
+
+EXPORT_SYMBOL(clear_page);
+EXPORT_SYMBOL(do_signal);
+EXPORT_SYMBOL(syscall_trace);
+EXPORT_SYMBOL(transfer_to_handler);
+EXPORT_SYMBOL(do_IRQ);
+EXPORT_SYMBOL(MachineCheckException);
+EXPORT_SYMBOL(AlignmentException);
+EXPORT_SYMBOL(ProgramCheckException);
+EXPORT_SYMBOL(SingleStepException);
+EXPORT_SYMBOL(sys_sigreturn);
+EXPORT_SYMBOL(ppc_n_lost_interrupts);
+EXPORT_SYMBOL(ppc_lost_interrupts);
+EXPORT_SYMBOL(enable_irq);
+EXPORT_SYMBOL(disable_irq);
+EXPORT_SYMBOL(disable_irq_nosync);
+EXPORT_SYMBOL(probe_irq_mask);
+#ifdef CONFIG_SMP
+EXPORT_SYMBOL(kernel_flag);
+#endif /* CONFIG_SMP */
+
+EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
+EXPORT_SYMBOL_NOVERS(DMA_MODE_READ);
+EXPORT_SYMBOL(DMA_MODE_WRITE);
+#if defined(CONFIG_ALL_PPC)
+EXPORT_SYMBOL(_prep_type);
+EXPORT_SYMBOL(ucSystemType);
+#endif
+
+#if !__INLINE_BITOPS
+EXPORT_SYMBOL(set_bit);
+EXPORT_SYMBOL(clear_bit);
+EXPORT_SYMBOL(change_bit);
+EXPORT_SYMBOL(test_and_set_bit);
+EXPORT_SYMBOL(test_and_clear_bit);
+EXPORT_SYMBOL(test_and_change_bit);
+#endif /* __INLINE_BITOPS */
+
+EXPORT_SYMBOL(strcpy);
+EXPORT_SYMBOL(strncpy);
+EXPORT_SYMBOL(strcat);
+EXPORT_SYMBOL(strncat);
+EXPORT_SYMBOL(strchr);
+EXPORT_SYMBOL(strrchr);
+EXPORT_SYMBOL(strpbrk);
+EXPORT_SYMBOL(strtok);
+EXPORT_SYMBOL(strstr);
+EXPORT_SYMBOL(strlen);
+EXPORT_SYMBOL(strnlen);
+EXPORT_SYMBOL(strcmp);
+EXPORT_SYMBOL(strncmp);
+EXPORT_SYMBOL(strcasecmp);
+
+/* EXPORT_SYMBOL(csum_partial); already in net/netsyms.c */
+EXPORT_SYMBOL(csum_partial_copy_generic);
+EXPORT_SYMBOL(ip_fast_csum);
+EXPORT_SYMBOL(csum_tcpudp_magic);
+
+EXPORT_SYMBOL(__copy_tofrom_user);
+EXPORT_SYMBOL(__clear_user);
+EXPORT_SYMBOL(__strncpy_from_user);
+EXPORT_SYMBOL(__strnlen_user);
+
+/*
+EXPORT_SYMBOL(inb);
+EXPORT_SYMBOL(inw);
+EXPORT_SYMBOL(inl);
+EXPORT_SYMBOL(outb);
+EXPORT_SYMBOL(outw);
+EXPORT_SYMBOL(outl);
+EXPORT_SYMBOL(outsl);*/
+
+EXPORT_SYMBOL(_insb);
+EXPORT_SYMBOL(_outsb);
+EXPORT_SYMBOL(_insw);
+EXPORT_SYMBOL(_outsw);
+EXPORT_SYMBOL(_insl);
+EXPORT_SYMBOL(_outsl);
+EXPORT_SYMBOL(_insw_ns);
+EXPORT_SYMBOL(_outsw_ns);
+EXPORT_SYMBOL(_insl_ns);
+EXPORT_SYMBOL(_outsl_ns);
+EXPORT_SYMBOL(ioremap);
+EXPORT_SYMBOL(__ioremap);
+EXPORT_SYMBOL(iounmap);
+EXPORT_SYMBOL(iopa);
+EXPORT_SYMBOL(mm_ptov);
+
+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) \
+ || defined(CONFIG_USB_STORAGE) || defined(CONFIG_USB_STORAGE_MODULE)
+EXPORT_SYMBOL(ppc_ide_md);
+EXPORT_SYMBOL(ppc_generic_ide_fix_driveid);
+#endif
+
+#ifdef CONFIG_PCI
+EXPORT_SYMBOL_NOVERS(isa_io_base);
+EXPORT_SYMBOL_NOVERS(isa_mem_base);
+EXPORT_SYMBOL_NOVERS(pci_dram_offset);
+EXPORT_SYMBOL(pci_alloc_consistent);
+EXPORT_SYMBOL(pci_free_consistent);
+#endif /* CONFIG_PCI */
+
+EXPORT_SYMBOL(start_thread);
+EXPORT_SYMBOL(kernel_thread);
+
+/*EXPORT_SYMBOL(__restore_flags);*/
+/*EXPORT_SYMBOL(_disable_interrupts);
+ EXPORT_SYMBOL(_enable_interrupts);*/
+EXPORT_SYMBOL(flush_instruction_cache);
+EXPORT_SYMBOL(giveup_fpu);
+EXPORT_SYMBOL(enable_kernel_fp);
+EXPORT_SYMBOL(flush_icache_range);
+EXPORT_SYMBOL(flush_dcache_range);
+EXPORT_SYMBOL(flush_icache_user_range);
+EXPORT_SYMBOL(flush_icache_page);
+EXPORT_SYMBOL(flush_dcache_page);
+EXPORT_SYMBOL(xchg_u32);
+#ifdef CONFIG_ALTIVEC
+EXPORT_SYMBOL(last_task_used_altivec);
+EXPORT_SYMBOL(giveup_altivec);
+#endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SMP
+EXPORT_SYMBOL(global_irq_lock);
+EXPORT_SYMBOL(global_irq_count);
+EXPORT_SYMBOL(global_irq_holder);
+EXPORT_SYMBOL(__global_cli);
+EXPORT_SYMBOL(__global_sti);
+EXPORT_SYMBOL(__global_save_flags);
+EXPORT_SYMBOL(__global_restore_flags);
+#if SPINLOCK_DEBUG
+EXPORT_SYMBOL(_spin_lock);
+EXPORT_SYMBOL(_spin_unlock);
+EXPORT_SYMBOL(spin_trylock);
+EXPORT_SYMBOL(_read_lock);
+EXPORT_SYMBOL(_read_unlock);
+EXPORT_SYMBOL(_write_lock);
+EXPORT_SYMBOL(_write_unlock);
+#endif
+EXPORT_SYMBOL(smp_call_function);
+EXPORT_SYMBOL(smp_hw_index);
+EXPORT_SYMBOL(smp_num_cpus);
+EXPORT_SYMBOL(synchronize_irq);
+#endif
+
+EXPORT_SYMBOL(ppc_md);
+
+#ifdef CONFIG_ADB
+EXPORT_SYMBOL(adb_request);
+EXPORT_SYMBOL(adb_register);
+EXPORT_SYMBOL(adb_unregister);
+EXPORT_SYMBOL(adb_poll);
+EXPORT_SYMBOL(adb_try_handler_change);
+#endif /* CONFIG_ADB */
+#ifdef CONFIG_ADB_CUDA
+EXPORT_SYMBOL(cuda_request);
+EXPORT_SYMBOL(cuda_poll);
+#endif /* CONFIG_ADB_CUDA */
+#ifdef CONFIG_PMAC_BACKLIGHT
+EXPORT_SYMBOL(get_backlight_level);
+EXPORT_SYMBOL(set_backlight_level);
+EXPORT_SYMBOL(set_backlight_enable);
+EXPORT_SYMBOL(register_backlight_controller);
+#endif /* CONFIG_PMAC_BACKLIGHT */
+#if defined(CONFIG_ALL_PPC)
+EXPORT_SYMBOL(_machine);
+EXPORT_SYMBOL_NOVERS(sys_ctrler);
+EXPORT_SYMBOL(find_devices);
+EXPORT_SYMBOL(find_type_devices);
+EXPORT_SYMBOL(find_compatible_devices);
+EXPORT_SYMBOL(find_path_device);
+EXPORT_SYMBOL(find_phandle);
+EXPORT_SYMBOL(device_is_compatible);
+EXPORT_SYMBOL(machine_is_compatible);
+EXPORT_SYMBOL(find_all_nodes);
+EXPORT_SYMBOL(get_property);
+EXPORT_SYMBOL(request_OF_resource);
+EXPORT_SYMBOL(release_OF_resource);
+EXPORT_SYMBOL(pci_bus_io_base);
+EXPORT_SYMBOL(pci_bus_io_base_phys);
+EXPORT_SYMBOL(pci_bus_mem_base_phys);
+EXPORT_SYMBOL(pci_device_to_OF_node);
+EXPORT_SYMBOL(pci_device_from_OF_node);
+EXPORT_SYMBOL(pci_bus_to_hose);
+EXPORT_SYMBOL(pci_resource_to_bus);
+EXPORT_SYMBOL(pci_phys_to_bus);
+EXPORT_SYMBOL(pci_bus_to_phys);
+EXPORT_SYMBOL(pmac_newworld);
+EXPORT_SYMBOL(nvram_read_byte);
+EXPORT_SYMBOL(nvram_write_byte);
+EXPORT_SYMBOL(pmac_xpram_read);
+EXPORT_SYMBOL(pmac_xpram_write);
+#endif /* defined(CONFIG_ALL_PPC) */
+#if defined(CONFIG_BOOTX_TEXT)
+EXPORT_SYMBOL(btext_update_display);
+#endif
+#if defined(CONFIG_SCSI) && defined(CONFIG_ALL_PPC)
+EXPORT_SYMBOL(note_scsi_host);
+#endif
+#ifdef CONFIG_VT
+EXPORT_SYMBOL(kd_mksound);
+#endif
+EXPORT_SYMBOL(to_tm);
+
+EXPORT_SYMBOL_NOVERS(__ashrdi3);
+EXPORT_SYMBOL_NOVERS(__ashldi3);
+EXPORT_SYMBOL_NOVERS(__lshrdi3);
+EXPORT_SYMBOL_NOVERS(__div64_32);
+EXPORT_SYMBOL_NOVERS(memcpy);
+EXPORT_SYMBOL_NOVERS(memset);
+EXPORT_SYMBOL_NOVERS(memmove);
+EXPORT_SYMBOL_NOVERS(memscan);
+EXPORT_SYMBOL_NOVERS(memcmp);
+EXPORT_SYMBOL_NOVERS(memchr);
+
+EXPORT_SYMBOL(abs);
+
+#ifdef CONFIG_VGA_CONSOLE
+EXPORT_SYMBOL(screen_info);
+#endif
+
+EXPORT_SYMBOL(__delay);
+EXPORT_SYMBOL(__sti);
+EXPORT_SYMBOL(__sti_end);
+EXPORT_SYMBOL(__cli);
+EXPORT_SYMBOL(__cli_end);
+EXPORT_SYMBOL(__save_flags_ptr);
+EXPORT_SYMBOL(__save_flags_ptr_end);
+EXPORT_SYMBOL(__restore_flags);
+EXPORT_SYMBOL(__restore_flags_end);
+EXPORT_SYMBOL(timer_interrupt_intercept);
+EXPORT_SYMBOL(timer_interrupt);
+EXPORT_SYMBOL(do_IRQ_intercept);
+EXPORT_SYMBOL(irq_desc);
+void ppc_irq_dispatch_handler(struct pt_regs *, int);
+EXPORT_SYMBOL(ppc_irq_dispatch_handler);
+EXPORT_SYMBOL(tb_ticks_per_jiffy);
+EXPORT_SYMBOL(get_wchan);
+EXPORT_SYMBOL(console_drivers);
+#ifdef CONFIG_XMON
+extern void xmon_printf(const char *fmt, ...);
+EXPORT_SYMBOL(xmon);
+EXPORT_SYMBOL(xmon_printf);
+#endif
+EXPORT_SYMBOL(__up);
+EXPORT_SYMBOL(__down);
+EXPORT_SYMBOL(__down_interruptible);
+
+#if defined(CONFIG_KGDB) || defined(CONFIG_XMON)
+extern void (*debugger)(struct pt_regs *regs);
+extern int (*debugger_bpt)(struct pt_regs *regs);
+extern int (*debugger_sstep)(struct pt_regs *regs);
+extern int (*debugger_iabr_match)(struct pt_regs *regs);
+extern int (*debugger_dabr_match)(struct pt_regs *regs);
+extern void (*debugger_fault_handler)(struct pt_regs *regs);
+
+EXPORT_SYMBOL(debugger);
+EXPORT_SYMBOL(debugger_bpt);
+EXPORT_SYMBOL(debugger_sstep);
+EXPORT_SYMBOL(debugger_iabr_match);
+EXPORT_SYMBOL(debugger_dabr_match);
+EXPORT_SYMBOL(debugger_fault_handler);
+#endif
+
+#ifdef CONFIG_8xx
+EXPORT_SYMBOL(__res);
+EXPORT_SYMBOL(request_8xxirq);
+EXPORT_SYMBOL(cpm_install_handler);
+EXPORT_SYMBOL(cpm_free_handler);
+#endif /* CONFIG_8xx */
+
+/* Those should really be inline */
+EXPORT_SYMBOL(atomic_clear_mask);
+EXPORT_SYMBOL(atomic_set_mask);
+
+EXPORT_SYMBOL(ret_to_user_hook);
+EXPORT_SYMBOL(next_mmu_context);
+EXPORT_SYMBOL(set_context);
+EXPORT_SYMBOL(handle_mm_fault); /* For MOL */
+EXPORT_SYMBOL_NOVERS(disarm_decr);
+#ifdef CONFIG_PPC_STD_MMU
+EXPORT_SYMBOL(flush_hash_page); /* For MOL */
+extern long *intercept_table;
+EXPORT_SYMBOL(intercept_table);
+#endif
+extern long *ret_from_intercept;
+EXPORT_SYMBOL(ret_from_intercept);
+EXPORT_SYMBOL(cur_cpu_spec);
+#if defined(CONFIG_ALL_PPC)
+extern int map_page(unsigned long va, unsigned long pa, int flags);
+
+EXPORT_SYMBOL(map_page);
+EXPORT_SYMBOL(get_vm_area);
+extern unsigned long agp_special_page;
+EXPORT_SYMBOL_NOVERS(agp_special_page);
+#endif /* defined(CONFIG_ALL_PPC) */
+
diff -uNr linux-2.4.20/arch/ppc/kernel/prep_nvram.c linux-2.4.20-ben10/arch/ppc/kernel/prep_nvram.c
--- linux-2.4.20/arch/ppc/kernel/prep_nvram.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/prep_nvram.c 2003-03-23 11:56:33.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.prep_nvram.c 1.14 08/13/02 20:27:38 paulus
*/
/*
* arch/ppc/platforms/prep_nvram.c
diff -uNr linux-2.4.20/arch/ppc/kernel/process.c linux-2.4.20-ben10/arch/ppc/kernel/process.c
--- linux-2.4.20/arch/ppc/kernel/process.c 2001-11-26 14:29:17.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/process.c 2003-03-23 11:57:21.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.process.c 1.34 11/23/01 16:38:29 paulus
+ * BK Id: SCCS/s.process.c 1.36 08/20/02 15:26:44 benh
*/
/*
* linux/arch/ppc/kernel/process.c
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
#include
#include
@@ -400,13 +401,53 @@
last_task_used_math = 0;
if (last_task_used_altivec == current)
last_task_used_altivec = 0;
+ memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
current->thread.fpscr = 0;
+#ifdef CONFIG_ALTIVEC
+ memset(current->thread.vr, 0, sizeof(current->thread.vr));
+ memset(¤t->thread.vscr, 0, sizeof(current->thread.vscr));
+ current->thread.vrsave = 0;
+#endif /* CONFIG_ALTIVEC */
+}
+
+/*
+ * Support for the PR_GET/SET_FPEXC prctl() calls.
+ */
+static inline unsigned int __unpack_fe01(unsigned int msr_bits)
+{
+ return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8);
+}
+
+static inline unsigned int __pack_fe01(unsigned int fpmode)
+{
+ return ((fpmode << 10) & MSR_FE0) | ((fpmode << 8) & MSR_FE1);
+}
+
+int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
+{
+ struct pt_regs *regs = tsk->thread.regs;
+
+ if (val > PR_FP_EXC_PRECISE)
+ return -EINVAL;
+ tsk->thread.fpexc_mode = __pack_fe01(val);
+ if (regs != NULL && (regs->msr & MSR_FP) != 0)
+ regs->msr = (regs->msr & ~(MSR_FE0|MSR_FE1))
+ | tsk->thread.fpexc_mode;
+ return 0;
+}
+
+int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
+{
+ unsigned int val;
+
+ val = __unpack_fe01(tsk->thread.fpexc_mode);
+ return put_user(val, (unsigned int *) adr);
}
int sys_clone(int p1, int p2, int p3, int p4, int p5, int p6,
struct pt_regs *regs)
{
- return do_fork(p1, regs->gpr[1], regs, 0);
+ return do_fork(p1, p2, regs, 0);
}
int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6,
@@ -452,6 +493,8 @@
int cnt = 0;
unsigned long i;
+ if (sp == NULL)
+ asm("mr %0,1" : "=r" (sp));
printk("Call backtrace: ");
while (sp) {
if (__get_user( i, &sp[1] ))
diff -uNr linux-2.4.20/arch/ppc/kernel/prom.c linux-2.4.20-ben10/arch/ppc/kernel/prom.c
--- linux-2.4.20/arch/ppc/kernel/prom.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/prom.c 2003-03-23 11:58:33.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.prom.c 1.59 10/20/02 20:14:45 benh
*/
/*
* Procedures for interfacing to the Open Firmware PROM on
diff -uNr linux-2.4.20/arch/ppc/kernel/prom_init.c linux-2.4.20-ben10/arch/ppc/kernel/prom_init.c
--- linux-2.4.20/arch/ppc/kernel/prom_init.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/prom_init.c 2003-03-23 11:56:43.000000000 +0100
@@ -266,7 +266,7 @@
{
phandle node;
ihandle ih;
- int i;
+ int i, j;
char type[16], *path;
static unsigned char default_colors[] = {
0x00, 0x00, 0x00,
@@ -325,26 +325,26 @@
break;
}
-try_again:
/*
* Open the first display and set its colormap.
*/
- if (prom_num_displays > 0) {
- path = prom_display_paths[0];
+ for (j=0; j 0)
- prom_disp_node = prom_display_nodes[0];
- else
+ if (--prom_num_displays > 0) {
+ prom_disp_node = prom_display_nodes[j];
+ j--;
+ } else
prom_disp_node = NULL;
- goto try_again;
+ continue;
} else {
prom_print("... ok\n");
/*
diff -uNr linux-2.4.20/arch/ppc/kernel/ptrace.c linux-2.4.20-ben10/arch/ppc/kernel/ptrace.c
--- linux-2.4.20/arch/ppc/kernel/ptrace.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/ptrace.c 2003-03-23 11:58:28.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.ptrace.c 1.14 01/17/02 23:05:50 paulus
+ * BK Id: SCCS/s.ptrace.c 1.16 08/13/02 20:27:38 paulus
*/
/*
* linux/arch/ppc/kernel/ptrace.c
diff -uNr linux-2.4.20/arch/ppc/kernel/qspan_pci.c linux-2.4.20-ben10/arch/ppc/kernel/qspan_pci.c
--- linux-2.4.20/arch/ppc/kernel/qspan_pci.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/qspan_pci.c 2003-03-23 11:59:00.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.qspan_pci.c 1.9 08/13/02 20:27:38 paulus
*/
/*
* QSpan pci routines.
diff -uNr linux-2.4.20/arch/ppc/kernel/semaphore.c linux-2.4.20-ben10/arch/ppc/kernel/semaphore.c
--- linux-2.4.20/arch/ppc/kernel/semaphore.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/semaphore.c 2003-03-23 12:00:27.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.semaphore.c 1.12 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.semaphore.c 1.14 06/05/01 21:22:03 paulus
*/
/*
* PowerPC-specific semaphore code.
diff -uNr linux-2.4.20/arch/ppc/kernel/setup.c linux-2.4.20-ben10/arch/ppc/kernel/setup.c
--- linux-2.4.20/arch/ppc/kernel/setup.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/setup.c 2003-03-23 11:56:46.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.setup.c 1.84 03/14/03 19:05:33 benh
*/
/*
* Common prep/pmac/chrp boot and setup code.
@@ -154,7 +154,7 @@
return 0;
pvr = cpu_data[i].pvr;
lpj = cpu_data[i].loops_per_jiffy;
- seq_printf(m, "processor\t: %lu\n", i);
+ seq_printf(m, "processor\t: %u\n", i);
#else
pvr = mfspr(PVR);
lpj = loops_per_jiffy;
@@ -331,6 +331,7 @@
unsigned long r6, unsigned long r7)
{
#ifdef CONFIG_BOOTX_TEXT
+ extern int force_printk_to_btext;
if (boot_text_mapped) {
btext_clearscreen();
btext_welcome();
@@ -417,6 +418,31 @@
}
cmd_line[sizeof(cmd_line) - 1] = 0;
+
+
+
+ /* Debug stuff, do not merge ! */
+#ifdef CONFIG_ADB_PMU
+ if (strstr(cmd_line, "fake_sleep")) {
+ extern int __fake_sleep;
+ __fake_sleep = 1;
+ }
+#endif /* CONFIG_ADB_PMU */
+#ifdef CONFIG_ADB
+ if (strstr(cmd_line, "adb_sync")) {
+ extern int __adb_probe_sync;
+ __adb_probe_sync = 1;
+ }
+#endif /* CONFIG_ADB */
+ if (strstr(cmd_line, "nol3") && cur_cpu_spec[0]->cpu_features & CPU_FTR_L3CR)
+ _set_L3CR(0);
+#ifdef CONFIG_BOOTX_TEXT
+ if (strstr(cmd_line, "printkbtext"))
+ force_printk_to_btext = 1;
+#endif
+
+
+
switch (_machine) {
case _MACH_Pmac:
pmac_init(r3, r4, r5, r6, r7);
diff -uNr linux-2.4.20/arch/ppc/kernel/signal.c linux-2.4.20-ben10/arch/ppc/kernel/signal.c
--- linux-2.4.20/arch/ppc/kernel/signal.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/signal.c 2003-03-23 11:57:06.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.signal.c 1.15 11/27/02 09:12:55 paulus
*/
/*
* linux/arch/ppc/kernel/signal.c
diff -uNr linux-2.4.20/arch/ppc/kernel/smp.c linux-2.4.20-ben10/arch/ppc/kernel/smp.c
--- linux-2.4.20/arch/ppc/kernel/smp.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/smp.c 2003-03-23 11:56:37.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.smp.c 1.40 03/28/02 16:54:23 hozer
+ * BK Id: SCCS/s.smp.c 1.45 03/05/03 20:14:46 benh
*/
/*
* Smp support for ppc.
@@ -66,6 +66,10 @@
extern int cpu_idle(void *unused);
void smp_call_function_interrupt(void);
+/* Low level assembly function used to backup CPU 0 state */
+extern void __save_cpu_setup(void);
+
+
/* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
*
* Make sure this matches openpic_request_IPIs in open_pic.c, or what shows up
@@ -230,6 +234,10 @@
timeout = 1000000;
while (atomic_read(&data.started) != cpus) {
if (--timeout == 0) {
+#ifdef CONFIG_XMON
+ xmon_printf("smp_call_function on cpu %d: other cpus not responding (%d)\n",
+ smp_processor_id(), atomic_read(&data.started));
+#endif
printk("smp_call_function on cpu %d: other cpus not responding (%d)\n",
smp_processor_id(), atomic_read(&data.started));
goto out;
@@ -242,6 +250,10 @@
timeout = 1000000;
while (atomic_read(&data.finished) != cpus) {
if (--timeout == 0) {
+#ifdef CONFIG_XMON
+ xmon_printf("smp_call_function on cpu %d: other cpus not finishing (%d/%d)\n",
+ smp_processor_id(), atomic_read(&data.finished), atomic_read(&data.started));
+#endif
printk("smp_call_function on cpu %d: other cpus not finishing (%d/%d)\n",
smp_processor_id(), atomic_read(&data.finished), atomic_read(&data.started));
goto out;
@@ -330,6 +342,9 @@
/* Probe arch for CPUs */
cpu_nr = smp_ops->probe();
+ /* Backup CPU 0 state */
+ __save_cpu_setup();
+
/*
* only check for cpus we know exist. We keep the callin map
* with cpus at the bottom -- Cort
@@ -371,7 +386,7 @@
* use this value that I found through experimentation.
* -- Cort
*/
- for ( c = 1000; c && !cpu_callin_map[i] ; c-- )
+ for ( c = 10000; c && !cpu_callin_map[i] ; c-- )
udelay(100);
if ( cpu_callin_map[i] )
@@ -505,19 +520,11 @@
int cpu = current->processor;
smp_store_cpu_info(cpu);
+ smp_ops->setup_cpu(cpu);
set_dec(tb_ticks_per_jiffy);
+ cpu_online_map |= 1UL << cpu;
+ mb();
cpu_callin_map[cpu] = 1;
-
- smp_ops->setup_cpu(cpu);
-
- /*
- * This cpu is now "online". Only set them online
- * before they enter the loop below since write access
- * to the below variable is _not_ guaranteed to be
- * atomic.
- * -- Cort
- */
- cpu_online_map |= 1UL << smp_processor_id();
while(!smp_commenced)
barrier();
diff -uNr linux-2.4.20/arch/ppc/kernel/softemu8xx.c linux-2.4.20-ben10/arch/ppc/kernel/softemu8xx.c
--- linux-2.4.20/arch/ppc/kernel/softemu8xx.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/softemu8xx.c 2003-03-23 11:59:57.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.softemu8xx.c 1.8 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.softemu8xx.c 1.10 06/05/01 21:22:04 paulus
*/
/*
* Software emulation of some PPC instructions for the 8xx core.
diff -uNr linux-2.4.20/arch/ppc/kernel/syscalls.c linux-2.4.20-ben10/arch/ppc/kernel/syscalls.c
--- linux-2.4.20/arch/ppc/kernel/syscalls.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/kernel/syscalls.c 2003-03-23 11:59:57.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.syscalls.c 1.13 03/13/02 09:12:22 trini
+ * BK Id: SCCS/s.syscalls.c 1.14 04/16/02 20:08:22 paulus
*/
/*
* linux/arch/ppc/kernel/sys_ppc.c
diff -uNr linux-2.4.20/arch/ppc/kernel/time.c linux-2.4.20-ben10/arch/ppc/kernel/time.c
--- linux-2.4.20/arch/ppc/kernel/time.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/time.c 2003-03-23 11:56:22.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.time.c 1.36 11/11/02 11:10:25 trini
*/
/*
* Common time routines among all ppc machines.
@@ -295,13 +295,11 @@
write_unlock_irqrestore(&xtime_lock, flags);
}
-
+/* This function is only called on the boot processor */
void __init time_init(void)
{
time_t sec, old_sec;
unsigned old_stamp, stamp, elapsed;
- /* This function is only called on the boot processor */
- unsigned long flags;
if (ppc_md.time_init != NULL)
time_offset = ppc_md.time_init();
@@ -318,32 +316,33 @@
/* Now that the decrementer is calibrated, it can be used in case the
* clock is stuck, but the fact that we have to handle the 601
* makes things more complex. Repeatedly read the RTC until the
- * next second boundary to try to achieve some precision...
+ * next second boundary to try to achieve some precision. If there
+ * is no RTC, we still need to set tb_last_stamp and
+ * last_jiffy_stamp(cpu 0) to the current stamp.
*/
+ stamp = get_native_tbl();
if (ppc_md.get_rtc_time) {
- stamp = get_native_tbl();
sec = ppc_md.get_rtc_time();
elapsed = 0;
do {
old_stamp = stamp;
old_sec = sec;
stamp = get_native_tbl();
- if (__USE_RTC() && stamp < old_stamp) old_stamp -= 1000000000;
+ if (__USE_RTC() && stamp < old_stamp)
+ old_stamp -= 1000000000;
elapsed += stamp - old_stamp;
sec = ppc_md.get_rtc_time();
} while ( sec == old_sec && elapsed < 2*HZ*tb_ticks_per_jiffy);
- if (sec==old_sec) {
+ if (sec == old_sec)
printk("Warning: real time clock seems stuck!\n");
- }
- write_lock_irqsave(&xtime_lock, flags);
xtime.tv_sec = sec;
- last_jiffy_stamp(0) = tb_last_stamp = stamp;
xtime.tv_usec = 0;
/* No update now, we just read the time from the RTC ! */
last_rtc_update = xtime.tv_sec;
- write_unlock_irqrestore(&xtime_lock, flags);
}
+ last_jiffy_stamp(0) = tb_last_stamp = stamp;
+
/* Not exact, but the timer interrupt takes care of this */
set_dec(tb_ticks_per_jiffy);
diff -uNr linux-2.4.20/arch/ppc/kernel/traps.c linux-2.4.20-ben10/arch/ppc/kernel/traps.c
--- linux-2.4.20/arch/ppc/kernel/traps.c 2001-11-03 02:43:54.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/kernel/traps.c 2003-03-23 11:58:56.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.traps.c 1.22 10/11/01 10:33:09 paulus
+ * BK Id: SCCS/s.traps.c 1.25 11/07/02 18:38:50 benh
*/
/*
* linux/arch/ppc/kernel/traps.c
@@ -38,6 +38,9 @@
#include
#include
#include
+#ifdef CONFIG_PMAC_BACKLIGHT
+#include
+#endif
extern int fix_alignment(struct pt_regs *);
extern void bad_page_fault(struct pt_regs *, unsigned long, int sig);
@@ -78,10 +81,25 @@
void die(const char * str, struct pt_regs * fp, long err)
{
+#ifdef CONFIG_BOOTX_TEXT
+ extern int force_printk_to_btext;
+#endif
console_verbose();
spin_lock_irq(&oops_lock);
+#ifdef CONFIG_BOOTX_TEXT
+ force_printk_to_btext = 1;
+#endif
+#ifdef CONFIG_PMAC_BACKLIGHT
+ if (_machine == _MACH_Pmac) {
+ set_backlight_enable(1);
+ set_backlight_level(BACKLIGHT_MAX);
+ }
+#endif
printk("Oops: %s, sig: %ld\n", str, err);
show_regs(fp);
+#ifdef CONFIG_BOOTX_TEXT
+ force_printk_to_btext = 0;
+#endif
spin_unlock_irq(&oops_lock);
/* do_exit() should take care of panic'ing from an interrupt
* context so we don't handle it here
@@ -345,6 +363,7 @@
{
printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n",
current, regs->gpr[1]);
+ print_backtrace((unsigned long *)regs->gpr[1]);
#if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
debugger(regs);
#endif
diff -uNr linux-2.4.20/arch/ppc/lib/Makefile linux-2.4.20-ben10/arch/ppc/lib/Makefile
--- linux-2.4.20/arch/ppc/lib/Makefile 2001-11-16 19:10:08.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/lib/Makefile 2003-03-23 11:57:23.000000000 +0100
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.10 11/08/01 07:57:40 paulus
+# BK Id: SCCS/s.Makefile 1.12 03/14/03 19:02:15 benh
#
#
# Makefile for ppc-specific library files..
@@ -10,7 +10,7 @@
export-objs := dec_and_lock.o
-obj-y := checksum.o string.o strcase.o dec_and_lock.o
+obj-y := checksum.o string.o strcase.o dec_and_lock.o div64.o
obj-$(CONFIG_SMP) += locks.o
diff -uNr linux-2.4.20/arch/ppc/lib/checksum.S linux-2.4.20-ben10/arch/ppc/lib/checksum.S
--- linux-2.4.20/arch/ppc/lib/checksum.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/lib/checksum.S 2003-03-23 11:58:26.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.checksum.S 1.10 08/13/02 20:27:38 paulus
*/
/*
* This file contains assembly-language implementations
diff -uNr linux-2.4.20/arch/ppc/lib/div64.S linux-2.4.20-ben10/arch/ppc/lib/div64.S
--- linux-2.4.20/arch/ppc/lib/div64.S 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/lib/div64.S 2003-03-23 11:56:55.000000000 +0100
@@ -0,0 +1,58 @@
+/*
+ * Divide a 64-bit unsigned number by a 32-bit unsigned number.
+ * This routine assumes that the top 32 bits of the dividend are
+ * non-zero to start with.
+ * On entry, r3 points to the dividend, which get overwritten with
+ * the 64-bit quotient, and r4 contains the divisor.
+ * On exit, r3 contains the remainder.
+ *
+ * Copyright (C) 2002 Paul Mackerras, IBM Corp.
+ *
+ * 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.
+ */
+#include
+#include
+
+_GLOBAL(__div64_32)
+ lwz r5,0(r3) # get the dividend into r5/r6
+ lwz r6,4(r3)
+ cmplw r5,r4
+ li r7,0
+ li r8,0
+ blt 1f
+ divwu r7,r5,r4 # if dividend.hi >= divisor,
+ mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor
+ subf. r5,r0,r5 # dividend.hi %= divisor
+ beq 3f
+1: mr r11,r5 # here dividend.hi != 0
+ andis. r0,r5,0xc000
+ bne 2f
+ cntlzw r0,r5 # we are shifting the dividend right
+ li r10,-1 # to make it < 2^32, and shifting
+ srw r10,r10,r0 # the divisor right the same amount,
+ add r9,r4,r10 # rounding up (so the estimate cannot
+ andc r11,r6,r10 # ever be too large, only too small)
+ andc r9,r9,r10
+ or r11,r5,r11
+ rotlw r9,r9,r0
+ rotlw r11,r11,r0
+ divwu r11,r11,r9 # then we divide the shifted quantities
+2: mullw r10,r11,r4 # to get an estimate of the quotient,
+ mulhwu r9,r11,r4 # multiply the estimate by the divisor,
+ subfc r6,r10,r6 # take the product from the divisor,
+ add r8,r8,r11 # and add the estimate to the accumulated
+ subfe. r5,r9,r5 # quotient
+ bne 1b
+3: cmplw r6,r4
+ blt 4f
+ divwu r0,r6,r4 # perform the remaining 32-bit division
+ mullw r10,r0,r4 # and get the remainder
+ add r8,r8,r0
+ subf r6,r10,r6
+4: stw r7,0(r3) # return the quotient in *r3
+ stw r8,4(r3)
+ mr r3,r6 # return the remainder in r3
+ blr
diff -uNr linux-2.4.20/arch/ppc/lib/locks.c linux-2.4.20-ben10/arch/ppc/lib/locks.c
--- linux-2.4.20/arch/ppc/lib/locks.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/lib/locks.c 2003-03-23 11:56:19.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.locks.c 1.15 05/04/02 16:12:57 benh
*/
/*
* Locks for smp ppc
@@ -18,8 +18,16 @@
#if SPINLOCK_DEBUG
+/* Route debug output to xmon when possible, there are more chances
+ * for it to work than the console
+ */
+#ifdef CONFIG_XMON
+extern void xmon_printf(const char* fmt,...);
+#define printk xmon_printf
+#endif
+
#undef INIT_STUCK
-#define INIT_STUCK 200000000 /*0xffffffff*/
+#define INIT_STUCK 0xffffffff
/*
* Try to acquire a spinlock.
@@ -59,6 +67,9 @@
lock, cpu, __builtin_return_address(0),
lock->owner_cpu,lock->owner_pc);
stuck = INIT_STUCK;
+#ifdef CONFIG_XMON
+// xmon(NULL);
+#endif /* CONFIG_XMON */
/* steal the lock */
/*xchg_u32((void *)&lock->lock,0);*/
}
@@ -88,7 +99,7 @@
lp, smp_processor_id(), (int)lp->owner_cpu,
lp->owner_pc,lp->lock);
lp->owner_pc = lp->owner_cpu = 0;
- wmb();
+ mb();
lp->lock = 0;
}
@@ -122,7 +133,7 @@
/* try to get the read lock again */
goto again;
}
- wmb();
+ __asm__ __volatile__ ("isync" : : : "memory");
}
void _read_unlock(rwlock_t *rw)
@@ -131,7 +142,7 @@
printk("_read_unlock(): %s/%d (nip %08lX) lock %lx\n",
current->comm,current->pid,current->thread.regs->nip,
rw->lock);
- wmb();
+ mb();
atomic_dec((atomic_t *) &(rw)->lock);
}
@@ -172,7 +183,7 @@
}
goto again;
}
- wmb();
+ __asm__ __volatile__ ("isync" : : : "memory");
}
void _write_unlock(rwlock_t *rw)
@@ -181,7 +192,7 @@
printk("_write_lock(): %s/%d (nip %08lX) lock %lx\n",
current->comm,current->pid,current->thread.regs->nip,
rw->lock);
- wmb();
+ mb();
clear_bit(31,&(rw)->lock);
}
diff -uNr linux-2.4.20/arch/ppc/lib/strcase.c linux-2.4.20-ben10/arch/ppc/lib/strcase.c
--- linux-2.4.20/arch/ppc/lib/strcase.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/lib/strcase.c 2003-03-23 11:58:25.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.strcase.c 1.5 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.strcase.c 1.7 06/05/01 21:22:04 paulus
*/
#include
diff -uNr linux-2.4.20/arch/ppc/lib/string.S linux-2.4.20-ben10/arch/ppc/lib/string.S
--- linux-2.4.20/arch/ppc/lib/string.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/lib/string.S 2003-03-23 11:58:22.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.string.S 1.14 02/25/03 16:22:21 benh
*/
/*
* String handling functions for PowerPC.
@@ -445,23 +445,23 @@
#if !defined(CONFIG_8xx)
/* Here we decide how far ahead to prefetch the source */
-#if MAX_L1_COPY_PREFETCH > 1
+#if MAX_COPY_PREFETCH > 1
/* Heuristically, for large transfers we prefetch
- MAX_L1_COPY_PREFETCH cachelines ahead. For small transfers
+ MAX_COPY_PREFETCH cachelines ahead. For small transfers
we prefetch 1 cacheline ahead. */
- cmpwi r0,MAX_L1_COPY_PREFETCH
+ cmpwi r0,MAX_COPY_PREFETCH
li r7,1
li r3,4
ble 111f
- li r7,MAX_L1_COPY_PREFETCH
+ li r7,MAX_COPY_PREFETCH
111: mtctr r7
112: dcbt r3,r4
addi r3,r3,CACHELINE_BYTES
bdnz 112b
-#else /* MAX_L1_COPY_PREFETCH == 1 */
+#else /* MAX_COPY_PREFETCH == 1 */
li r3,CACHELINE_BYTES + 4
dcbt r11,r4
-#endif /* MAX_L1_COPY_PREFETCH */
+#endif /* MAX_COPY_PREFETCH */
#endif /* CONFIG_8xx */
mtctr r0
@@ -517,18 +517,18 @@
blr
/* read fault, initial single-byte copy */
-100: li r4,0
+100: li r9,0
b 90f
/* write fault, initial single-byte copy */
-101: li r4,1
+101: li r9,1
90: subf r5,r8,r5
li r3,0
b 99f
/* read fault, initial word copy */
-102: li r4,0
+102: li r9,0
b 91f
/* write fault, initial word copy */
-103: li r4,1
+103: li r9,1
91: li r3,2
b 99f
@@ -552,38 +552,47 @@
#endif
/* read fault in cacheline loop */
-104: li r4,0
+104: li r9,0
b 92f
/* fault on dcbz (effectively a write fault) */
/* or write fault in cacheline loop */
-105: li r4,1
+105: li r9,1
92: li r3,LG_CACHELINE_BYTES
b 99f
/* read fault in final word loop */
-108: li r4,0
+108: li r9,0
b 93f
/* write fault in final word loop */
-109: li r4,1
+109: li r9,1
93: andi. r5,r5,3
li r3,2
b 99f
/* read fault in final byte loop */
-110: li r4,0
+110: li r9,0
b 94f
/* write fault in final byte loop */
-111: li r4,1
+111: li r9,1
94: li r5,0
li r3,0
/*
* At this stage the number of bytes not copied is
- * r5 + (ctr << r3), and r4 is 0 for read or 1 for write.
+ * r5 + (ctr << r3), and r9 is 0 for read or 1 for write.
*/
99: mfctr r0
slw r3,r0,r3
- add r3,r3,r5
- cmpwi 0,r4,0
+ add. r3,r3,r5
+ beq 120f /* shouldn't happen */
+ cmpwi 0,r9,0
bne 120f
-/* for read fault, clear out the destination: r3 bytes starting at 4(r6) */
+/* for a read fault, first try to continue the copy one byte at a time */
+ mtctr r3
+130: lbz r0,4(r4)
+131: stb r0,4(r6)
+ addi r4,r4,1
+ addi r6,r6,1
+ bdnz 130b
+/* then clear out the destination: r3 bytes starting at 4(r6) */
+132: mfctr r3
srwi. r0,r3,2
li r9,0
mtctr r0
@@ -604,6 +613,8 @@
.long 31b,109b
.long 40b,110b
.long 41b,111b
+ .long 130b,132b
+ .long 131b,120b
.long 112b,120b
.long 114b,120b
.text
diff -uNr linux-2.4.20/arch/ppc/math-emu/Makefile linux-2.4.20-ben10/arch/ppc/math-emu/Makefile
--- linux-2.4.20/arch/ppc/math-emu/Makefile 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/Makefile 2003-03-23 11:56:41.000000000 +0100
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.3 05/17/01 18:14:22 cort
+# BK Id: SCCS/s.Makefile 1.5 06/05/01 21:22:04 paulus
#
#
#
diff -uNr linux-2.4.20/arch/ppc/math-emu/double.h linux-2.4.20-ben10/arch/ppc/math-emu/double.h
--- linux-2.4.20/arch/ppc/math-emu/double.h 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/double.h 2003-03-23 11:59:27.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.double.h 1.5 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.double.h 1.7 06/05/01 21:22:04 paulus
*/
/*
* Definitions for IEEE Double Precision
diff -uNr linux-2.4.20/arch/ppc/math-emu/fabs.c linux-2.4.20-ben10/arch/ppc/math-emu/fabs.c
--- linux-2.4.20/arch/ppc/math-emu/fabs.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fabs.c 2003-03-23 11:59:49.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fabs.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fabs.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fadd.c linux-2.4.20-ben10/arch/ppc/math-emu/fadd.c
--- linux-2.4.20/arch/ppc/math-emu/fadd.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fadd.c 2003-03-23 11:59:53.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fadd.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fadd.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fadds.c linux-2.4.20-ben10/arch/ppc/math-emu/fadds.c
--- linux-2.4.20/arch/ppc/math-emu/fadds.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fadds.c 2003-03-23 12:00:18.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fadds.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fadds.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fcmpo.c linux-2.4.20-ben10/arch/ppc/math-emu/fcmpo.c
--- linux-2.4.20/arch/ppc/math-emu/fcmpo.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fcmpo.c 2003-03-23 11:56:35.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fcmpo.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fcmpo.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fcmpu.c linux-2.4.20-ben10/arch/ppc/math-emu/fcmpu.c
--- linux-2.4.20/arch/ppc/math-emu/fcmpu.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fcmpu.c 2003-03-23 11:56:56.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fcmpu.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fcmpu.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fctiw.c linux-2.4.20-ben10/arch/ppc/math-emu/fctiw.c
--- linux-2.4.20/arch/ppc/math-emu/fctiw.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fctiw.c 2003-03-23 11:58:19.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fctiw.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fctiw.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fctiwz.c linux-2.4.20-ben10/arch/ppc/math-emu/fctiwz.c
--- linux-2.4.20/arch/ppc/math-emu/fctiwz.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fctiwz.c 2003-03-23 11:59:53.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fctiwz.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fctiwz.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fdiv.c linux-2.4.20-ben10/arch/ppc/math-emu/fdiv.c
--- linux-2.4.20/arch/ppc/math-emu/fdiv.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fdiv.c 2003-03-23 11:58:02.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fdiv.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fdiv.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fdivs.c linux-2.4.20-ben10/arch/ppc/math-emu/fdivs.c
--- linux-2.4.20/arch/ppc/math-emu/fdivs.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fdivs.c 2003-03-23 11:58:07.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fdivs.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fdivs.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fmadd.c linux-2.4.20-ben10/arch/ppc/math-emu/fmadd.c
--- linux-2.4.20/arch/ppc/math-emu/fmadd.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fmadd.c 2003-03-23 11:58:08.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fmadd.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fmadd.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fmadds.c linux-2.4.20-ben10/arch/ppc/math-emu/fmadds.c
--- linux-2.4.20/arch/ppc/math-emu/fmadds.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fmadds.c 2003-03-23 12:00:40.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fmadds.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fmadds.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fmr.c linux-2.4.20-ben10/arch/ppc/math-emu/fmr.c
--- linux-2.4.20/arch/ppc/math-emu/fmr.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fmr.c 2003-03-23 11:58:45.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fmr.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fmr.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fmsub.c linux-2.4.20-ben10/arch/ppc/math-emu/fmsub.c
--- linux-2.4.20/arch/ppc/math-emu/fmsub.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fmsub.c 2003-03-23 11:56:24.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fmsub.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fmsub.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fmsubs.c linux-2.4.20-ben10/arch/ppc/math-emu/fmsubs.c
--- linux-2.4.20/arch/ppc/math-emu/fmsubs.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fmsubs.c 2003-03-23 12:00:38.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fmsubs.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fmsubs.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fmul.c linux-2.4.20-ben10/arch/ppc/math-emu/fmul.c
--- linux-2.4.20/arch/ppc/math-emu/fmul.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fmul.c 2003-03-23 11:57:18.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fmul.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fmul.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fmuls.c linux-2.4.20-ben10/arch/ppc/math-emu/fmuls.c
--- linux-2.4.20/arch/ppc/math-emu/fmuls.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fmuls.c 2003-03-23 11:57:10.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fmuls.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fmuls.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fnabs.c linux-2.4.20-ben10/arch/ppc/math-emu/fnabs.c
--- linux-2.4.20/arch/ppc/math-emu/fnabs.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fnabs.c 2003-03-23 11:58:34.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fnabs.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fnabs.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fneg.c linux-2.4.20-ben10/arch/ppc/math-emu/fneg.c
--- linux-2.4.20/arch/ppc/math-emu/fneg.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fneg.c 2003-03-23 11:56:21.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fneg.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fneg.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fnmadd.c linux-2.4.20-ben10/arch/ppc/math-emu/fnmadd.c
--- linux-2.4.20/arch/ppc/math-emu/fnmadd.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fnmadd.c 2003-03-23 12:00:08.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fnmadd.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fnmadd.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fnmadds.c linux-2.4.20-ben10/arch/ppc/math-emu/fnmadds.c
--- linux-2.4.20/arch/ppc/math-emu/fnmadds.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fnmadds.c 2003-03-23 11:57:58.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fnmadds.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fnmadds.c 1.8 06/05/01 21:22:04 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fnmsub.c linux-2.4.20-ben10/arch/ppc/math-emu/fnmsub.c
--- linux-2.4.20/arch/ppc/math-emu/fnmsub.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fnmsub.c 2003-03-23 12:00:04.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fnmsub.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fnmsub.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fnmsubs.c linux-2.4.20-ben10/arch/ppc/math-emu/fnmsubs.c
--- linux-2.4.20/arch/ppc/math-emu/fnmsubs.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fnmsubs.c 2003-03-23 11:59:28.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fnmsubs.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fnmsubs.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fres.c linux-2.4.20-ben10/arch/ppc/math-emu/fres.c
--- linux-2.4.20/arch/ppc/math-emu/fres.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fres.c 2003-03-23 12:00:34.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fres.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fres.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/frsp.c linux-2.4.20-ben10/arch/ppc/math-emu/frsp.c
--- linux-2.4.20/arch/ppc/math-emu/frsp.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/frsp.c 2003-03-23 11:57:15.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.frsp.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.frsp.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/frsqrte.c linux-2.4.20-ben10/arch/ppc/math-emu/frsqrte.c
--- linux-2.4.20/arch/ppc/math-emu/frsqrte.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/frsqrte.c 2003-03-23 11:59:02.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.frsqrte.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.frsqrte.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fsel.c linux-2.4.20-ben10/arch/ppc/math-emu/fsel.c
--- linux-2.4.20/arch/ppc/math-emu/fsel.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fsel.c 2003-03-23 11:59:24.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fsel.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fsel.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fsqrt.c linux-2.4.20-ben10/arch/ppc/math-emu/fsqrt.c
--- linux-2.4.20/arch/ppc/math-emu/fsqrt.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fsqrt.c 2003-03-23 11:56:20.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fsqrt.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fsqrt.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fsqrts.c linux-2.4.20-ben10/arch/ppc/math-emu/fsqrts.c
--- linux-2.4.20/arch/ppc/math-emu/fsqrts.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fsqrts.c 2003-03-23 11:58:29.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fsqrts.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fsqrts.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fsub.c linux-2.4.20-ben10/arch/ppc/math-emu/fsub.c
--- linux-2.4.20/arch/ppc/math-emu/fsub.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fsub.c 2003-03-23 11:58:42.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fsub.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fsub.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/fsubs.c linux-2.4.20-ben10/arch/ppc/math-emu/fsubs.c
--- linux-2.4.20/arch/ppc/math-emu/fsubs.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/fsubs.c 2003-03-23 11:56:56.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fsubs.c 1.6 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.fsubs.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/lfd.c linux-2.4.20-ben10/arch/ppc/math-emu/lfd.c
--- linux-2.4.20/arch/ppc/math-emu/lfd.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/lfd.c 2003-03-23 11:57:18.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.lfd.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.lfd.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/lfs.c linux-2.4.20-ben10/arch/ppc/math-emu/lfs.c
--- linux-2.4.20/arch/ppc/math-emu/lfs.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/lfs.c 2003-03-23 12:01:01.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.lfs.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.lfs.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/math.c linux-2.4.20-ben10/arch/ppc/math-emu/math.c
--- linux-2.4.20/arch/ppc/math-emu/math.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/math.c 2003-03-23 11:57:59.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.math.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.math.c 1.8 06/05/01 21:22:05 paulus
*/
/*
* arch/ppc/math-emu/math.c
diff -uNr linux-2.4.20/arch/ppc/math-emu/mcrfs.c linux-2.4.20-ben10/arch/ppc/math-emu/mcrfs.c
--- linux-2.4.20/arch/ppc/math-emu/mcrfs.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/mcrfs.c 2003-03-23 11:56:32.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mcrfs.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.mcrfs.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/mffs.c linux-2.4.20-ben10/arch/ppc/math-emu/mffs.c
--- linux-2.4.20/arch/ppc/math-emu/mffs.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/mffs.c 2003-03-23 11:57:55.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mffs.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.mffs.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/mtfsb0.c linux-2.4.20-ben10/arch/ppc/math-emu/mtfsb0.c
--- linux-2.4.20/arch/ppc/math-emu/mtfsb0.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/mtfsb0.c 2003-03-23 11:58:22.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mtfsb0.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.mtfsb0.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/mtfsb1.c linux-2.4.20-ben10/arch/ppc/math-emu/mtfsb1.c
--- linux-2.4.20/arch/ppc/math-emu/mtfsb1.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/mtfsb1.c 2003-03-23 11:56:33.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mtfsb1.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.mtfsb1.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/mtfsf.c linux-2.4.20-ben10/arch/ppc/math-emu/mtfsf.c
--- linux-2.4.20/arch/ppc/math-emu/mtfsf.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/mtfsf.c 2003-03-23 12:00:01.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mtfsf.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.mtfsf.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/mtfsfi.c linux-2.4.20-ben10/arch/ppc/math-emu/mtfsfi.c
--- linux-2.4.20/arch/ppc/math-emu/mtfsfi.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/mtfsfi.c 2003-03-23 12:00:25.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mtfsfi.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.mtfsfi.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/op-1.h linux-2.4.20-ben10/arch/ppc/math-emu/op-1.h
--- linux-2.4.20/arch/ppc/math-emu/op-1.h 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/op-1.h 2003-03-23 11:58:05.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.op-1.h 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.op-1.h 1.7 06/05/01 21:22:05 paulus
*/
/*
* Basic one-word fraction declaration and manipulation.
diff -uNr linux-2.4.20/arch/ppc/math-emu/op-2.h linux-2.4.20-ben10/arch/ppc/math-emu/op-2.h
--- linux-2.4.20/arch/ppc/math-emu/op-2.h 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/op-2.h 2003-03-23 12:01:06.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.op-2.h 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.op-2.h 1.7 06/05/01 21:22:05 paulus
*/
/*
* Basic two-word fraction declaration and manipulation.
diff -uNr linux-2.4.20/arch/ppc/math-emu/op-4.h linux-2.4.20-ben10/arch/ppc/math-emu/op-4.h
--- linux-2.4.20/arch/ppc/math-emu/op-4.h 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/op-4.h 2003-03-23 11:59:44.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.op-4.h 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.op-4.h 1.7 06/05/01 21:22:05 paulus
*/
/*
* Basic four-word fraction declaration and manipulation.
diff -uNr linux-2.4.20/arch/ppc/math-emu/op-common.h linux-2.4.20-ben10/arch/ppc/math-emu/op-common.h
--- linux-2.4.20/arch/ppc/math-emu/op-common.h 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/op-common.h 2003-03-23 11:57:23.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.op-common.h 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.op-common.h 1.7 06/05/01 21:22:05 paulus
*/
#define _FP_DECL(wc, X) \
diff -uNr linux-2.4.20/arch/ppc/math-emu/sfp-machine.h linux-2.4.20-ben10/arch/ppc/math-emu/sfp-machine.h
--- linux-2.4.20/arch/ppc/math-emu/sfp-machine.h 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/sfp-machine.h 2003-03-23 12:00:39.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.sfp-machine.h 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.sfp-machine.h 1.7 06/05/01 21:22:05 paulus
*/
/* Machine-dependent software floating-point definitions. PPC version.
Copyright (C) 1997 Free Software Foundation, Inc.
diff -uNr linux-2.4.20/arch/ppc/math-emu/single.h linux-2.4.20-ben10/arch/ppc/math-emu/single.h
--- linux-2.4.20/arch/ppc/math-emu/single.h 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/single.h 2003-03-23 11:58:44.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.single.h 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.single.h 1.7 06/05/01 21:22:05 paulus
*/
/*
* Definitions for IEEE Single Precision
diff -uNr linux-2.4.20/arch/ppc/math-emu/soft-fp.h linux-2.4.20-ben10/arch/ppc/math-emu/soft-fp.h
--- linux-2.4.20/arch/ppc/math-emu/soft-fp.h 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/soft-fp.h 2003-03-23 11:58:18.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.soft-fp.h 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.soft-fp.h 1.7 06/05/01 21:22:05 paulus
*/
#ifndef SOFT_FP_H
#define SOFT_FP_H
diff -uNr linux-2.4.20/arch/ppc/math-emu/stfd.c linux-2.4.20-ben10/arch/ppc/math-emu/stfd.c
--- linux-2.4.20/arch/ppc/math-emu/stfd.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/stfd.c 2003-03-23 12:01:04.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.stfd.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.stfd.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/stfiwx.c linux-2.4.20-ben10/arch/ppc/math-emu/stfiwx.c
--- linux-2.4.20/arch/ppc/math-emu/stfiwx.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/stfiwx.c 2003-03-23 11:56:42.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.stfiwx.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.stfiwx.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/stfs.c linux-2.4.20-ben10/arch/ppc/math-emu/stfs.c
--- linux-2.4.20/arch/ppc/math-emu/stfs.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/stfs.c 2003-03-23 12:00:58.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.stfs.c 1.6 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.stfs.c 1.8 06/05/01 21:22:05 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/math-emu/types.c linux-2.4.20-ben10/arch/ppc/math-emu/types.c
--- linux-2.4.20/arch/ppc/math-emu/types.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/types.c 2003-03-23 12:00:17.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.types.c 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.types.c 1.7 06/05/01 21:22:05 paulus
*/
#include "soft-fp.h"
diff -uNr linux-2.4.20/arch/ppc/math-emu/udivmodti4.c linux-2.4.20-ben10/arch/ppc/math-emu/udivmodti4.c
--- linux-2.4.20/arch/ppc/math-emu/udivmodti4.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/math-emu/udivmodti4.c 2003-03-23 11:59:52.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.udivmodti4.c 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.udivmodti4.c 1.7 06/05/01 21:22:05 paulus
*/
/* This has so very few changes over libgcc2's __udivmoddi4 it isn't funny. */
diff -uNr linux-2.4.20/arch/ppc/mm/4xx_tlb.c linux-2.4.20-ben10/arch/ppc/mm/4xx_tlb.c
--- linux-2.4.20/arch/ppc/mm/4xx_tlb.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/mm/4xx_tlb.c 2003-03-23 11:59:38.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.4xx_tlb.c 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.4xx_tlb.c 1.7 06/05/01 21:22:05 paulus
*/
/*
*
diff -uNr linux-2.4.20/arch/ppc/mm/4xx_tlb.h linux-2.4.20-ben10/arch/ppc/mm/4xx_tlb.h
--- linux-2.4.20/arch/ppc/mm/4xx_tlb.h 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/mm/4xx_tlb.h 2003-03-23 12:00:15.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.4xx_tlb.h 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.4xx_tlb.h 1.7 06/05/01 21:22:05 paulus
*/
/*
*
diff -uNr linux-2.4.20/arch/ppc/mm/Makefile linux-2.4.20-ben10/arch/ppc/mm/Makefile
--- linux-2.4.20/arch/ppc/mm/Makefile 2001-08-28 15:58:33.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/mm/Makefile 2003-03-23 11:59:53.000000000 +0100
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.8 08/16/01 17:25:47 paulus
+# BK Id: SCCS/s.Makefile 1.9 08/29/01 08:49:24 paulus
#
#
# Makefile for the linux ppc-specific parts of the memory manager.
diff -uNr linux-2.4.20/arch/ppc/mm/extable.c linux-2.4.20-ben10/arch/ppc/mm/extable.c
--- linux-2.4.20/arch/ppc/mm/extable.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/mm/extable.c 2003-03-23 11:59:47.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.extable.c 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.extable.c 1.7 06/05/01 21:22:06 paulus
*/
/*
* linux/arch/ppc/mm/extable.c
diff -uNr linux-2.4.20/arch/ppc/mm/fault.c linux-2.4.20-ben10/arch/ppc/mm/fault.c
--- linux-2.4.20/arch/ppc/mm/fault.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/mm/fault.c 2003-03-23 12:00:31.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fault.c 1.15 09/24/01 16:35:10 paulus
+ * BK Id: SCCS/s.fault.c 1.20 01/23/03 17:54:25 benh
*/
/*
* arch/ppc/mm/fault.c
@@ -64,7 +64,7 @@
void do_page_fault(struct pt_regs *regs, unsigned long address,
unsigned long error_code)
{
- struct vm_area_struct * vma;
+ struct vm_area_struct * vma, * prev_vma;
struct mm_struct *mm = current->mm;
siginfo_t info;
int code = SEGV_MAPERR;
@@ -111,7 +111,16 @@
goto good_area;
if (!(vma->vm_flags & VM_GROWSDOWN))
goto bad_area;
- if (expand_stack(vma, address))
+ /* Only allow stack grow on writes */
+ if (!is_write) {
+ printk(KERN_DEBUG "Process %s tried to read below stack\n",
+ current->comm);
+ printk(KERN_DEBUG " addr: %08lx, gpr1: %08lx, pc: %08lx, lr: %08lx\n",
+ address, regs->gpr[1], regs->nip, regs->link);
+ goto bad_area;
+ }
+ vma = find_vma_prev(mm, address, &prev_vma);
+ if (expand_stack(vma, address, prev_vma))
goto bad_area;
good_area:
diff -uNr linux-2.4.20/arch/ppc/mm/hashtable.S linux-2.4.20-ben10/arch/ppc/mm/hashtable.S
--- linux-2.4.20/arch/ppc/mm/hashtable.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/mm/hashtable.S 2003-03-23 11:58:34.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.hashtable.S 1.20 08/13/02 20:27:38 paulus
*/
/*
* arch/ppc/kernel/hashtable.S
diff -uNr linux-2.4.20/arch/ppc/mm/init.c linux-2.4.20-ben10/arch/ppc/mm/init.c
--- linux-2.4.20/arch/ppc/mm/init.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/mm/init.c 2003-03-23 11:56:25.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.init.c 1.43 03/12/02 12:13:51 paulus
+ * BK Id: SCCS/s.init.c 1.47 06/25/02 17:31:35 benh
*/
/*
* PowerPC version
@@ -329,7 +329,7 @@
#ifdef CONFIG_HIGHMEM
ioremap_base = PKMAP_BASE;
#else
- ioremap_base = 0xfe000000UL; /* for now, could be 0xfffff000 */
+ ioremap_base = 0xfe000000UL; /* for now, could be 0xfffff000 (or 0 ?)*/
#endif /* CONFIG_HIGHMEM */
ioremap_bot = ioremap_base;
@@ -458,6 +458,17 @@
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
num_physpages = max_mapnr; /* RAM is assumed contiguous */
+ /* Sanity check: did ioremap_bot stomp over vmalloc space ? We keep
+ * a minimal 16Mb guard though if you only have 16Mb left, you'll
+ * probably run into trouble, so we also printk something if you
+ * have less than 64Mb. This is meant to help diagnosing such problems
+ * as debugging it can be really painful. --BenH.
+ */
+ if (VMALLOC_END < (VMALLOC_START + 0x01000000UL))
+ panic("Argh ! Virtual space exhausted !");
+ if (VMALLOC_END < (VMALLOC_START + 0x04000000UL))
+ printk(KERN_WARNING "Warning ! Virtual space small !");
+
totalram_pages += free_all_bootmem();
#ifdef CONFIG_BLK_DEV_INITRD
@@ -619,6 +630,10 @@
void clear_user_page(void *page, unsigned long vaddr)
{
clear_page(page);
+ /* That should not be necessary, but a glibc "feature" makes
+ * in important as glibc fails to invalidate blank pages
+ * properly
+ */
__flush_dcache_icache(page);
}
diff -uNr linux-2.4.20/arch/ppc/mm/mem_pieces.c linux-2.4.20-ben10/arch/ppc/mm/mem_pieces.c
--- linux-2.4.20/arch/ppc/mm/mem_pieces.c 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/mm/mem_pieces.c 2003-03-23 11:56:24.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mem_pieces.c 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.mem_pieces.c 1.7 06/05/01 21:22:06 paulus
*/
/*
* Copyright (c) 1996 Paul Mackerras
diff -uNr linux-2.4.20/arch/ppc/mm/mem_pieces.h linux-2.4.20-ben10/arch/ppc/mm/mem_pieces.h
--- linux-2.4.20/arch/ppc/mm/mem_pieces.h 2001-05-22 02:04:47.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/mm/mem_pieces.h 2003-03-23 11:59:32.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mem_pieces.h 1.5 05/17/01 18:14:23 cort
+ * BK Id: SCCS/s.mem_pieces.h 1.7 06/05/01 21:22:06 paulus
*/
/*
* Copyright (c) 1996 Paul Mackerras
diff -uNr linux-2.4.20/arch/ppc/mm/pgtable.c linux-2.4.20-ben10/arch/ppc/mm/pgtable.c
--- linux-2.4.20/arch/ppc/mm/pgtable.c 2002-08-03 02:39:43.000000000 +0200
+++ linux-2.4.20-ben10/arch/ppc/mm/pgtable.c 2003-03-23 11:59:46.000000000 +0100
@@ -248,7 +248,7 @@
total_lowmem = max_low_mem;
#ifndef CONFIG_HIGHMEM
printk(KERN_INFO "Warning, memory limited to %ld Mb, use CONFIG_HIGHMEM"
- " to reach %ld Mb\n", max_low_mem >> 20, total_lowmem >> 20);
+ " to reach %ld Mb\n", max_low_mem >> 20, (total_lowmem+ram) >> 20);
total_memory = total_lowmem;
#endif /* CONFIG_HIGHMEM */
}
@@ -305,7 +305,7 @@
{
int i;
- if (virt > KERNELBASE && virt < ioremap_bot)
+ if (virt > KERNELBASE && (virt < ioremap_bot || !ioremap_bot))
ioremap_bot = ioremap_base = virt;
#ifdef HAVE_BATS
diff -uNr linux-2.4.20/arch/ppc/platforms/Makefile linux-2.4.20-ben10/arch/ppc/platforms/Makefile
--- linux-2.4.20/arch/ppc/platforms/Makefile 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/Makefile 2003-03-23 11:58:49.000000000 +0100
@@ -43,6 +43,9 @@
prep_time.o prep_setup.o pmac_sleep.o \
pmac_nvram.o
obj-$(CONFIG_PMAC_BACKLIGHT) += pmac_backlight.o
+ifeq ($(CONFIG_ALL_PPC),y)
+obj-$(CONFIG_CPU_FREQ_PMAC) += pmac_cpufreq.o
+endif
obj-$(CONFIG_PPC_RTAS) += error_log.o proc_rtas.o
obj-$(CONFIG_PREP_RESIDUAL) += residual.o
obj-$(CONFIG_GEMINI) += gemini_pci.o gemini_setup.o gemini_prom.o
diff -uNr linux-2.4.20/arch/ppc/platforms/apus_pci.c linux-2.4.20-ben10/arch/ppc/platforms/apus_pci.c
--- linux-2.4.20/arch/ppc/platforms/apus_pci.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/apus_pci.c 2003-03-23 12:00:16.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.apus_pci.c 1.7 08/31/02 12:27:55 paulus
*/
/*
* Copyright (C) Michel Dänzer
diff -uNr linux-2.4.20/arch/ppc/platforms/apus_pci.h linux-2.4.20-ben10/arch/ppc/platforms/apus_pci.h
--- linux-2.4.20/arch/ppc/platforms/apus_pci.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/apus_pci.h 2003-03-23 11:59:52.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.apus_pci.h 1.6 08/13/02 21:40:09 paulus
*/
/*
* Phase5 CybervisionPPC (TVP4020) definitions for the Permedia2 framebuffer
diff -uNr linux-2.4.20/arch/ppc/platforms/apus_setup.c linux-2.4.20-ben10/arch/ppc/platforms/apus_setup.c
--- linux-2.4.20/arch/ppc/platforms/apus_setup.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/apus_setup.c 2003-03-23 11:56:43.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.apus_setup.c 1.34 10/09/02 10:28:18 paulus
*/
/*
* arch/ppc/platforms/apus_setup.c
diff -uNr linux-2.4.20/arch/ppc/platforms/bseip.h linux-2.4.20-ben10/arch/ppc/platforms/bseip.h
--- linux-2.4.20/arch/ppc/platforms/bseip.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/bseip.h 2003-03-23 11:59:23.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.bseip.h 1.10 08/17/01 15:23:17 paulus
+ * BK Id: SCCS/s.bseip.h 1.13 08/13/02 20:27:38 paulus
*/
/*
diff -uNr linux-2.4.20/arch/ppc/platforms/chrp_pci.c linux-2.4.20-ben10/arch/ppc/platforms/chrp_pci.c
--- linux-2.4.20/arch/ppc/platforms/chrp_pci.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/chrp_pci.c 2003-03-23 12:00:03.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.chrp_pci.c 1.29 09/11/02 14:41:31 paulus
*/
/*
* CHRP pci routines.
diff -uNr linux-2.4.20/arch/ppc/platforms/chrp_setup.c linux-2.4.20-ben10/arch/ppc/platforms/chrp_setup.c
--- linux-2.4.20/arch/ppc/platforms/chrp_setup.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/chrp_setup.c 2003-03-23 11:57:56.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.chrp_setup.c 1.59 01/20/03 21:59:06 benh
*/
/*
* arch/ppc/platforms/setup.c
@@ -56,6 +56,11 @@
#include
#include
+#ifdef CONFIG_SERIAL
+#include
+#include
+#endif
+
unsigned long chrp_get_rtc_time(void);
int chrp_set_rtc_time(unsigned long nowtime);
void chrp_calibrate_decr(void);
@@ -411,7 +416,6 @@
chrp_init_irq_openpic(unsigned long intack)
{
int i;
- unsigned char* chrp_int_ack_special = 0;
int nmi_irq = -1;
unsigned char init_senses[NR_IRQS - NUM_8259_INTERRUPTS];
@@ -421,12 +425,10 @@
OpenPIC_InitSenses = init_senses;
OpenPIC_NumInitSenses = NR_IRQS - NUM_8259_INTERRUPTS;
- if (intack)
- chrp_int_ack_special = (unsigned char *) ioremap(intack, 1);
- openpic_init(1, NUM_8259_INTERRUPTS, chrp_int_ack_special, nmi_irq);
+ openpic_init(1, NUM_8259_INTERRUPTS, 0, nmi_irq);
for (i = 0; i < NUM_8259_INTERRUPTS; i++)
irq_desc[i].handler = &i8259_pic;
- i8259_init(0);
+ i8259_init(intack);
}
static void __init
@@ -572,6 +574,18 @@
}
#endif
+#ifdef CONFIG_VT
+static void __chrp
+dummy_pckbd_leds(unsigned char leds)
+{
+}
+
+static void __init
+dummy_pckbd_init_hw(void)
+{
+}
+#endif /* CONFIG_VT */
+
void __init
chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7)
@@ -596,6 +610,14 @@
/* Check if it's a briq */
machine = get_property(root, "model", NULL);
is_briq = machine && strncmp(machine, "TotalImpact,BRIQ-1", 18) == 0;
+#ifdef CONFIG_SERIAL
+ if (is_briq) {
+ /* briQ has a different serial clock */
+ extern struct serial_state rs_table[];
+ rs_table[0].baud_base = (7372800 / 16);
+ rs_table[1].baud_base = (7372800 / 16);
+ }
+#endif /* CONFIG_SERIAL */
ppc_md.setup_arch = chrp_setup_arch;
ppc_md.show_percpuinfo = of_show_percpuinfo;
@@ -623,8 +645,8 @@
ppc_md.kbd_getkeycode = pckbd_getkeycode;
ppc_md.kbd_translate = pckbd_translate;
ppc_md.kbd_unexpected_up = pckbd_unexpected_up;
- ppc_md.kbd_leds = pckbd_leds;
- ppc_md.kbd_init_hw = pckbd_init_hw;
+ ppc_md.kbd_leds = is_briq ? dummy_pckbd_leds : pckbd_leds;
+ ppc_md.kbd_init_hw = is_briq ? dummy_pckbd_init_hw : pckbd_init_hw;
#ifdef CONFIG_MAGIC_SYSRQ
ppc_md.ppc_kbd_sysrq_xlate = pckbd_sysrq_xlate;
SYSRQ_KEY = 0x54;
diff -uNr linux-2.4.20/arch/ppc/platforms/chrp_time.c linux-2.4.20-ben10/arch/ppc/platforms/chrp_time.c
--- linux-2.4.20/arch/ppc/platforms/chrp_time.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/chrp_time.c 2003-03-23 11:56:35.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.chrp_time.c 1.13 08/13/02 20:27:38 paulus
*/
/*
* arch/ppc/platforms/chrp_time.c
diff -uNr linux-2.4.20/arch/ppc/platforms/error_log.c linux-2.4.20-ben10/arch/ppc/platforms/error_log.c
--- linux-2.4.20/arch/ppc/platforms/error_log.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/error_log.c 2003-03-23 12:00:57.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.error_log.c 1.6 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.error_log.c 1.7 08/13/02 21:31:33 paulus
*/
/*
* arch/ppc/kernel/error_log.c
diff -uNr linux-2.4.20/arch/ppc/platforms/error_log.h linux-2.4.20-ben10/arch/ppc/platforms/error_log.h
--- linux-2.4.20/arch/ppc/platforms/error_log.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/error_log.h 2003-03-23 11:58:08.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.error_log.h 1.5 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.error_log.h 1.6 08/13/02 21:31:33 paulus
*/
#ifndef __ERROR_LOG_H__
#define __ERROR_LOG_H__
diff -uNr linux-2.4.20/arch/ppc/platforms/est8260.h linux-2.4.20-ben10/arch/ppc/platforms/est8260.h
--- linux-2.4.20/arch/ppc/platforms/est8260.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/est8260.h 2003-03-23 11:56:22.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.est8260.h 1.5 05/17/01 18:14:24 cort
+ * BK Id: SCCS/s.est8260.h 1.9 08/13/02 20:27:38 paulus
*/
/* Board information for the EST8260, which should be generic for
diff -uNr linux-2.4.20/arch/ppc/platforms/fads.h linux-2.4.20-ben10/arch/ppc/platforms/fads.h
--- linux-2.4.20/arch/ppc/platforms/fads.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/fads.h 2003-03-23 11:57:52.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.fads.h 1.14 10/26/01 10:14:09 trini
+ * BK Id: SCCS/s.fads.h 1.17 08/13/02 20:27:38 paulus
*/
/*
diff -uNr linux-2.4.20/arch/ppc/platforms/gemini.h linux-2.4.20-ben10/arch/ppc/platforms/gemini.h
--- linux-2.4.20/arch/ppc/platforms/gemini.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/gemini.h 2003-03-23 11:58:07.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.gemini.h 1.7 08/31/02 12:27:55 paulus
*/
/*
* arch/ppc/platforms/gemini.h
diff -uNr linux-2.4.20/arch/ppc/platforms/gemini_pci.c linux-2.4.20-ben10/arch/ppc/platforms/gemini_pci.c
--- linux-2.4.20/arch/ppc/platforms/gemini_pci.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/gemini_pci.c 2003-03-23 11:59:23.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.gemini_pci.c 1.8 08/13/02 21:40:09 paulus
*/
#include
#include
diff -uNr linux-2.4.20/arch/ppc/platforms/gemini_prom.S linux-2.4.20-ben10/arch/ppc/platforms/gemini_prom.S
--- linux-2.4.20/arch/ppc/platforms/gemini_prom.S 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/gemini_prom.S 2003-03-23 11:56:53.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.gemini_prom.S 1.7 08/13/02 21:40:09 paulus
*/
/*
* arch/ppc/kernel/gemini_prom.S
diff -uNr linux-2.4.20/arch/ppc/platforms/gemini_serial.h linux-2.4.20-ben10/arch/ppc/platforms/gemini_serial.h
--- linux-2.4.20/arch/ppc/platforms/gemini_serial.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/gemini_serial.h 2003-03-23 11:58:00.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.gemini_serial.h 1.7 08/13/02 21:40:09 paulus
*/
#ifdef __KERNEL__
#ifndef __ASMPPC_GEMINI_SERIAL_H
diff -uNr linux-2.4.20/arch/ppc/platforms/gemini_setup.c linux-2.4.20-ben10/arch/ppc/platforms/gemini_setup.c
--- linux-2.4.20/arch/ppc/platforms/gemini_setup.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/gemini_setup.c 2003-03-23 11:59:44.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.gemini_setup.c 1.22 09/30/02 15:08:18 paulus
*/
/*
* arch/ppc/platforms/setup.c
diff -uNr linux-2.4.20/arch/ppc/platforms/ivms8.h linux-2.4.20-ben10/arch/ppc/platforms/ivms8.h
--- linux-2.4.20/arch/ppc/platforms/ivms8.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/ivms8.h 2003-03-23 11:58:51.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.ivms8.h 1.8 10/26/01 10:14:09 trini
+ * BK Id: SCCS/s.ivms8.h 1.9 08/13/02 21:33:06 paulus
*/
/*
* Speech Design Integrated Voicemail board specific definitions
diff -uNr linux-2.4.20/arch/ppc/platforms/mbx.h linux-2.4.20-ben10/arch/ppc/platforms/mbx.h
--- linux-2.4.20/arch/ppc/platforms/mbx.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/mbx.h 2003-03-23 11:56:34.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.mbx.h 1.11 08/17/01 15:23:17 paulus
+ * BK Id: SCCS/s.mbx.h 1.14 08/13/02 20:27:38 paulus
*/
/*
* A collection of structures, addresses, and values associated with
diff -uNr linux-2.4.20/arch/ppc/platforms/oak.h linux-2.4.20-ben10/arch/ppc/platforms/oak.h
--- linux-2.4.20/arch/ppc/platforms/oak.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/oak.h 2003-03-23 11:59:57.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.oak.h 1.12 10/11/01 13:05:07 trini
+ * BK Id: SCCS/s.oak.h 1.15 08/13/02 20:27:39 paulus
*/
/*
*
diff -uNr linux-2.4.20/arch/ppc/platforms/oak_setup.c linux-2.4.20-ben10/arch/ppc/platforms/oak_setup.c
--- linux-2.4.20/arch/ppc/platforms/oak_setup.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/oak_setup.c 2003-03-23 12:00:07.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: %F% %I% %G% %U% %#%
+ * BK Id: SCCS/s.oak_setup.c 1.16 08/29/02 13:07:58 paulus
*/
/*
*
diff -uNr linux-2.4.20/arch/ppc/platforms/oak_setup.h linux-2.4.20-ben10/arch/ppc/platforms/oak_setup.h
--- linux-2.4.20/arch/ppc/platforms/oak_setup.h 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/oak_setup.h 2003-03-23 11:56:57.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.oak_setup.h 1.5 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.oak_setup.h 1.9 08/13/02 20:27:39 paulus
*/
/*
*
diff -uNr linux-2.4.20/arch/ppc/platforms/pmac_backlight.c linux-2.4.20-ben10/arch/ppc/platforms/pmac_backlight.c
--- linux-2.4.20/arch/ppc/platforms/pmac_backlight.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/pmac_backlight.c 2003-03-23 11:56:45.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.pmac_backlight.c 1.10 12/01/01 20:09:06 benh
+ * BK Id: SCCS/s.pmac_backlight.c 1.13 08/13/02 20:27:39 paulus
*/
/*
* Miscellaneous procedures for dealing with the PowerMac hardware.
diff -uNr linux-2.4.20/arch/ppc/platforms/pmac_cpufreq.c linux-2.4.20-ben10/arch/ppc/platforms/pmac_cpufreq.c
--- linux-2.4.20/arch/ppc/platforms/pmac_cpufreq.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/pmac_cpufreq.c 2003-03-23 12:00:23.000000000 +0100
@@ -0,0 +1,353 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#undef DEBUG_FREQ
+
+extern void low_choose_750fx_pll(int pll);
+extern void low_sleep_handler(void);
+extern void openpic_sleep_save_intrs(void);
+extern void openpic_sleep_restore_intrs(void);
+extern void enable_kernel_altivec(void);
+extern void enable_kernel_fp(void);
+
+static unsigned int low_freq;
+static unsigned int hi_freq;
+static unsigned int cur_freq;
+static int cpufreq_uses_pmu;
+
+#define PMAC_CPU_LOW_SPEED 1
+#define PMAC_CPU_HIGH_SPEED 0
+
+static inline void
+wakeup_decrementer(void)
+{
+ set_dec(tb_ticks_per_jiffy);
+ /* No currently-supported powerbook has a 601,
+ * so use get_tbl, not native
+ */
+ last_jiffy_stamp(0) = tb_last_stamp = get_tbl();
+}
+
+#ifdef DEBUG_FREQ
+static inline void
+debug_calc_bogomips(void)
+{
+ /* This will cause a recalc of bogomips and display the
+ * result. We backup/restore the value to avoid affecting the
+ * core cpufreq framework's own calculation.
+ */
+ extern void calibrate_delay(void);
+
+ unsigned long save_lpj = loops_per_jiffy;
+ calibrate_delay();
+ loops_per_jiffy = save_lpj;
+}
+#endif
+
+/* Switch CPU speed under 750FX CPU control
+ */
+static int __pmac
+cpu_750fx_cpu_speed(int low_speed)
+{
+#ifdef DEBUG_FREQ
+ printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1));
+#endif
+ low_choose_750fx_pll(low_speed);
+#ifdef DEBUG_FREQ
+ printk(KERN_DEBUG "HID1, after: %x\n", mfspr(SPRN_HID1));
+ debug_calc_bogomips();
+#endif
+
+ return 0;
+}
+
+/* Switch CPU speed under PMU control
+ */
+static int __pmac
+pmu_set_cpu_speed(unsigned int low_speed)
+{
+ struct adb_request req;
+ unsigned long save_l2cr;
+ unsigned long save_l3cr;
+
+#ifdef DEBUG_FREQ
+ printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1));
+#endif
+ /* Disable all interrupt sources on openpic */
+ openpic_sleep_save_intrs();
+
+ /* Make sure the PMU is idle */
+ pmu_suspend();
+
+ /* Make sure the decrementer won't interrupt us */
+ asm volatile("mtdec %0" : : "r" (0x7fffffff));
+ /* Make sure any pending DEC interrupt occuring while we did
+ * the above didn't re-enable the DEC */
+ mb();
+ asm volatile("mtdec %0" : : "r" (0x7fffffff));
+
+ /* We can now disable MSR_EE */
+ local_irq_disable();
+
+ /* Giveup the FPU & vec */
+ enable_kernel_fp();
+
+#ifdef CONFIG_ALTIVEC
+ if (cur_cpu_spec[0]->cpu_features & CPU_FTR_ALTIVEC)
+ enable_kernel_altivec();
+#endif /* CONFIG_ALTIVEC */
+
+ /* Save & disable L2 and L3 caches */
+ save_l3cr = _get_L3CR(); /* (returns -1 if not available) */
+ save_l2cr = _get_L2CR(); /* (returns -1 if not available) */
+ if (save_l3cr != 0xffffffff && (save_l3cr & L3CR_L3E) != 0)
+ _set_L3CR(save_l3cr & 0x7fffffff);
+ if (save_l2cr != 0xffffffff && (save_l2cr & L2CR_L2E) != 0)
+ _set_L2CR(save_l2cr & 0x7fffffff);
+
+ /* Send the new speed command. My assumption is that this command
+ * will cause PLL_CFG[0..3] to be changed next time CPU goes to sleep
+ */
+ pmu_request(&req, NULL, 6, PMU_CPU_SPEED, 'W', 'O', 'O', 'F', low_speed);
+ while (!req.complete)
+ pmu_poll();
+
+ pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,1,1);
+
+ low_sleep_handler();
+
+ pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,1,0);
+
+ /* Restore L2 cache */
+ if (save_l2cr != 0xffffffff && (save_l2cr & L2CR_L2E) != 0)
+ _set_L2CR(save_l2cr);
+ /* Restore L3 cache */
+ if (save_l3cr != 0xffffffff && (save_l3cr & L3CR_L3E) != 0)
+ _set_L3CR(save_l3cr);
+
+ /* Restore userland MMU context */
+ set_context(current->active_mm->context, current->active_mm->pgd);
+
+#ifdef DEBUG_FREQ
+ printk(KERN_DEBUG "HID1, after: %x\n", mfspr(SPRN_HID1));
+#endif
+
+ /* Restore decrementer */
+ wakeup_decrementer();
+
+ /* Restore interrupts */
+ openpic_sleep_restore_intrs();
+
+ pmu_resume();
+
+ /* Let interrupts flow again ... */
+ local_irq_enable();
+
+#ifdef DEBUG_FREQ
+ debug_calc_bogomips();
+#endif
+
+ return 0;
+}
+
+static int __pmac
+do_set_cpu_speed(int speed_mode)
+{
+ struct cpufreq_freqs freqs;
+ int rc;
+
+ freqs.old = cur_freq;
+ freqs.new = (speed_mode == PMAC_CPU_HIGH_SPEED) ? hi_freq : low_freq;
+ freqs.cpu = CPUFREQ_ALL_CPUS;
+
+ if (freqs.old == freqs.new)
+ return 0;
+
+ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+ if (cpufreq_uses_pmu)
+ rc = pmu_set_cpu_speed(speed_mode);
+ else
+ rc = cpu_750fx_cpu_speed(speed_mode);
+ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+ cur_freq = (speed_mode == PMAC_CPU_HIGH_SPEED) ? hi_freq : low_freq;
+
+ return rc;
+}
+
+static int __pmac
+pmac_cpufreq_verify(struct cpufreq_policy *policy)
+{
+ if (!policy)
+ return -EINVAL;
+
+ policy->cpu = 0; /* UP only */
+
+ cpufreq_verify_within_limits(policy, low_freq, hi_freq);
+
+ if ((policy->min > low_freq) &&
+ (policy->max < hi_freq))
+ policy->max = hi_freq;
+
+ return 0;
+}
+
+static int __pmac
+pmac_cpufreq_setpolicy(struct cpufreq_policy *policy)
+{
+ int rc;
+
+ if (!policy)
+ return -EINVAL;
+ if (policy->min > low_freq)
+ rc = do_set_cpu_speed(PMAC_CPU_HIGH_SPEED);
+ else if (policy->max < hi_freq)
+ rc = do_set_cpu_speed(PMAC_CPU_LOW_SPEED);
+ else if (policy->policy == CPUFREQ_POLICY_POWERSAVE)
+ rc = do_set_cpu_speed(PMAC_CPU_LOW_SPEED);
+ else
+ rc = do_set_cpu_speed(PMAC_CPU_HIGH_SPEED);
+
+ return rc;
+}
+
+unsigned int __pmac
+pmac_get_cur_cpufreq(void)
+{
+ return cur_freq;
+}
+
+
+/* Currently, we support the following machines:
+ *
+ * - Titanium PowerBook 800 (PMU based, 667Mhz & 800Mhz)
+ * - Titanium PowerBook 500 (PMU based, 300Mhz & 500Mhz)
+ * - iBook2 500 (PMU based, 400Mhz & 500Mhz)
+ * - iBook2 700 (CPU based, 400Mhz & 700Mhz, support low voltage)
+ */
+static int __init
+pmac_cpufreq_setup(void)
+{
+ struct device_node *cpunode;
+ struct cpufreq_driver *driver;
+ u32 *value;
+ int has_freq_ctl = 0;
+ int rc;
+
+ memset(&driver, 0, sizeof(driver));
+
+ /* Assume only one CPU */
+ cpunode = find_type_devices("cpu");
+ if (!cpunode)
+ goto out;
+
+ /* Get current cpu clock freq */
+ value = (u32 *)get_property(cpunode, "clock-frequency", NULL);
+ if (!value)
+ goto out;
+ cur_freq = (*value) / 1000;
+
+ /* Check for newer machines */
+ if (machine_is_compatible("PowerBook3,4") ||
+ machine_is_compatible("PowerBook3,5") ||
+ machine_is_compatible("MacRISC3")) {
+ value = (u32 *)get_property(cpunode, "min-clock-frequency", NULL);
+ if (!value)
+ goto out;
+ low_freq = (*value) / 1000;
+ /* The PowerBook G4 12" (PowerBook6,1) has an error in the device-tree
+ * here */
+ if (low_freq < 100000)
+ low_freq *= 10;
+
+ value = (u32 *)get_property(cpunode, "max-clock-frequency", NULL);
+ if (!value)
+ goto out;
+ hi_freq = (*value) / 1000;
+ has_freq_ctl = 1;
+ cpufreq_uses_pmu = 1;
+ }
+ /* Else check for iBook2 500 */
+ else if (machine_is_compatible("PowerBook4,1")) {
+ /* We only know about 500Mhz model */
+ if (cur_freq < 450000 || cur_freq > 550000)
+ goto out;
+ hi_freq = cur_freq;
+ low_freq = 400000;
+ has_freq_ctl = 1;
+ cpufreq_uses_pmu = 1;
+ }
+ /* Else check for TiPb 500 */
+ else if (machine_is_compatible("PowerBook3,2")) {
+ /* We only know about 500Mhz model */
+ if (cur_freq < 450000 || cur_freq > 550000)
+ goto out;
+ hi_freq = cur_freq;
+ low_freq = 300000;
+ has_freq_ctl = 1;
+ cpufreq_uses_pmu = 1;
+ }
+ /* Else check for 750FX */
+ else if (PVR_VER(mfspr(PVR)) == 0x7000) {
+ if (get_property(cpunode, "dynamic-power-step", NULL) == NULL)
+ goto out;
+ hi_freq = cur_freq;
+ value = (u32 *)get_property(cpunode, "reduced-clock-frequency", NULL);
+ if (!value)
+ goto out;
+ low_freq = (*value) / 1000;
+ cpufreq_uses_pmu = 0;
+ has_freq_ctl = 1;
+ }
+out:
+ if (!has_freq_ctl)
+ return -ENODEV;
+
+ /* initialization of main "cpufreq" code*/
+ driver = kmalloc(sizeof(struct cpufreq_driver) +
+ NR_CPUS * sizeof(struct cpufreq_policy), GFP_KERNEL);
+ if (!driver)
+ return -ENOMEM;
+
+ driver->policy = (struct cpufreq_policy *) (driver + 1);
+
+#ifdef CONFIG_CPU_FREQ_24_API
+ driver->cpu_min_freq[0] = low_freq;
+ driver->cpu_cur_freq[0] = cur_freq;
+#endif
+
+ driver->verify = &pmac_cpufreq_verify;
+ driver->setpolicy = &pmac_cpufreq_setpolicy;
+
+ driver->policy[0].cpu = 0;
+ driver->policy[0].min = low_freq;
+ driver->policy[0].max = cur_freq;
+ driver->policy[0].max_cpu_freq = hi_freq;
+ driver->policy[0].policy = (cur_freq == low_freq) ?
+ CPUFREQ_POLICY_POWERSAVE : CPUFREQ_POLICY_PERFORMANCE;
+
+ rc = cpufreq_register(driver);
+ if (rc)
+ kfree(driver);
+ return rc;
+}
+
+__initcall(pmac_cpufreq_setup);
+
diff -uNr linux-2.4.20/arch/ppc/platforms/pmac_feature.c linux-2.4.20-ben10/arch/ppc/platforms/pmac_feature.c
--- linux-2.4.20/arch/ppc/platforms/pmac_feature.c 2002-11-29 00:53:11.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/pmac_feature.c 2003-04-02 22:08:11.000000000 +0200
@@ -17,6 +17,8 @@
* - Replace mdelay with some schedule loop if possible
* - Shorten some obfuscated delays on some routines (like modem
* power)
+ * - Refcount some clocks (see darwin)
+ * - Split split split...
*
*/
#include
@@ -79,7 +81,8 @@
macio_gatwick,
macio_paddington,
macio_keylargo,
- macio_pangea
+ macio_pangea,
+ macio_intrepid,
};
static const char* macio_names[] __pmacdata =
@@ -92,7 +95,8 @@
"Gatwick",
"Paddington",
"Keylargo",
- "Pangea"
+ "Pangea",
+ "Intrepid"
};
static struct macio_chip
@@ -538,7 +542,7 @@
return 0;
}
-static u32 save_fcr[5] __pmacdata;
+static u32 save_fcr[6] __pmacdata;
static u32 save_mbcr __pmacdata;
static u32 save_gpio_levels[2] __pmacdata;
static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT] __pmacdata;
@@ -814,8 +818,96 @@
}
static int __pmac
+pangea_modem_enable(struct device_node* node, int param, int value)
+{
+ struct macio_chip* macio;
+ u8 gpio;
+ unsigned long flags;
+
+ /* Hack for internal USB modem */
+ if (node == NULL) {
+ if (macio_chips[0].type != macio_pangea &&
+ macio_chips[0].type != macio_intrepid)
+ return -ENODEV;
+ node = macio_chips[0].of_node;
+ }
+ macio = macio_find(node, 0);
+ if (!macio)
+ return -ENODEV;
+ gpio = MACIO_IN8(KL_GPIO_MODEM_RESET);
+ gpio |= KEYLARGO_GPIO_OUTPUT_ENABLE;
+ gpio &= ~KEYLARGO_GPIO_OUTOUT_DATA;
+
+ if (!value) {
+ LOCK(flags);
+ MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
+ UNLOCK(flags);
+ (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
+ mdelay(250);
+ }
+ LOCK(flags);
+ if (value) {
+ MACIO_OUT8(KL_GPIO_MODEM_POWER,
+ KEYLARGO_GPIO_OUTPUT_ENABLE);
+ UNLOCK(flags);
+ (void)MACIO_IN32(KEYLARGO_FCR2);
+ mdelay(250);
+ } else {
+ MACIO_OUT8(KL_GPIO_MODEM_POWER,
+ KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
+ UNLOCK(flags);
+ }
+ if (value) {
+ LOCK(flags);
+ MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
+ (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
+ UNLOCK(flags); mdelay(250); LOCK(flags);
+ MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
+ (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
+ UNLOCK(flags); mdelay(250); LOCK(flags);
+ MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
+ (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
+ UNLOCK(flags); mdelay(250);
+ }
+ return 0;
+}
+
+static int __pmac
+core99_ata100_enable(struct device_node* node, int value)
+{
+ unsigned long flags;
+ struct pci_dev *pdev = NULL;
+ u8 pbus, pid;
+
+ if (uninorth_rev < 0x24)
+ return -ENODEV;
+
+ LOCK(flags);
+ if (value)
+ UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA100);
+ else
+ UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA100);
+ (void)UN_IN(UNI_N_CLOCK_CNTL);
+ UNLOCK(flags);
+ udelay(20);
+
+ if (value) {
+ if (pci_device_from_OF_node(node, &pbus, &pid) == 0)
+ pdev = pci_find_slot(pbus, pid);
+ if (pdev == NULL)
+ return 0;
+ pci_enable_device(pdev);
+ pci_set_master(pdev);
+ }
+ return 0;
+}
+
+static int __pmac
core99_ide_enable(struct device_node* node, int param, int value)
{
+ /* Bus ID 0 to 2 are KeyLargo based IDE, busID 3 is U2
+ * based ata-100
+ */
switch(param) {
case 0:
return simple_feature_tweak(node, macio_unknown,
@@ -826,6 +918,8 @@
case 2:
return simple_feature_tweak(node, macio_unknown,
KEYLARGO_FCR1, KL1_UIDE_ENABLE, value);
+ case 3:
+ return core99_ata100_enable(node, value);
default:
return -ENODEV;
}
@@ -873,7 +967,8 @@
struct macio_chip* macio;
macio = &macio_chips[0];
- if (macio->type != macio_keylargo && macio->type != macio_pangea)
+ if (macio->type != macio_keylargo && macio->type != macio_pangea &&
+ macio->type != macio_intrepid)
return -ENODEV;
LOCK(flags);
@@ -1010,40 +1105,14 @@
static int __pmac
core99_reset_cpu(struct device_node* node, int param, int value)
{
- const int reset_lines[] = { KL_GPIO_RESET_CPU0,
- KL_GPIO_RESET_CPU1,
- KL_GPIO_RESET_CPU2,
- KL_GPIO_RESET_CPU3 };
- int reset_io;
- unsigned long flags;
- struct macio_chip* macio;
-
- macio = &macio_chips[0];
- if (macio->type != macio_keylargo && macio->type != macio_pangea)
- return -ENODEV;
- if (param > 3 || param < 0)
- return -ENODEV;
-
- reset_io = reset_lines[param];
-
- LOCK(flags);
- MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE);
- (void)MACIO_IN8(reset_io);
- udelay(1);
- MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
- (void)MACIO_IN8(reset_io);
- UNLOCK(flags);
-
- return 0;
-}
-
-static int __pmac
-rackmac_reset_cpu(struct device_node* node, int param, int value)
-{
- int reset_io;
+ unsigned int reset_io = 0;
unsigned long flags;
struct macio_chip* macio;
struct device_node* np;
+ const int dflt_reset_lines[] = { KL_GPIO_RESET_CPU0,
+ KL_GPIO_RESET_CPU1,
+ KL_GPIO_RESET_CPU2,
+ KL_GPIO_RESET_CPU3 };
macio = &macio_chips[0];
if (macio->type != macio_keylargo)
@@ -1062,14 +1131,14 @@
break;
}
}
- if (np == NULL)
- return -ENODEV;
+ if (np == NULL || reset_io == 0)
+ reset_io = dflt_reset_lines[param];
LOCK(flags);
MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE);
(void)MACIO_IN8(reset_io);
udelay(1);
- MACIO_OUT8(reset_io, 0);
+ MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTOUT_DATA | KEYLARGO_GPIO_OUTPUT_ENABLE);
(void)MACIO_IN8(reset_io);
UNLOCK(flags);
@@ -1087,15 +1156,19 @@
u32 reg;
macio = &macio_chips[0];
- if (macio->type != macio_keylargo && macio->type != macio_pangea)
+ if (macio->type != macio_keylargo && macio->type != macio_pangea &&
+ macio->type != macio_intrepid)
return -ENODEV;
-
+
+ /* XXX Fix handling of 3rd USB controller in Intrepid, move the
+ * port connect stuff (KL4_*) to the sleep code eventually
+ */
prop = (char *)get_property(node, "AAPL,clock-id", NULL);
if (!prop)
return -ENODEV;
- if (strncmp(prop, "usb0u048", strlen("usb0u048")) == 0)
+ if (strncmp(prop, "usb0u048", 8) == 0)
number = 0;
- else if (strncmp(prop, "usb1u148", strlen("usb1u148")) == 0)
+ else if (strncmp(prop, "usb1u148", 8) == 0)
number = 2;
else
return -ENODEV;
@@ -1166,7 +1239,8 @@
struct macio_chip* macio;
macio = &macio_chips[0];
- if (macio->type != macio_keylargo && macio->type != macio_pangea)
+ if (macio->type != macio_keylargo && macio->type != macio_pangea &&
+ macio->type != macio_intrepid)
return -ENODEV;
if (!(macio->flags & MACIO_FLAG_FW_SUPPORTED))
return -ENODEV;
@@ -1195,7 +1269,8 @@
if ((pmac_mb.board_flags & PMAC_MB_HAS_FW_POWER) == 0)
return -ENODEV;
macio = &macio_chips[0];
- if (macio->type != macio_keylargo && macio->type != macio_pangea)
+ if (macio->type != macio_keylargo && macio->type != macio_pangea &&
+ macio->type != macio_intrepid)
return -ENODEV;
if (!(macio->flags & MACIO_FLAG_FW_SUPPORTED))
return -ENODEV;
@@ -1234,23 +1309,24 @@
}
static void __pmac
-keylargo_shutdown(struct macio_chip* macio, int restart)
+keylargo_shutdown(struct macio_chip* macio, int sleep_mode)
{
u32 temp;
- mdelay(1);
- MACIO_BIS(KEYLARGO_FCR0, KL0_USB_REF_SUSPEND);
- (void)MACIO_IN32(KEYLARGO_FCR0);
- mdelay(100);
+ if (sleep_mode) {
+ mdelay(1);
+ MACIO_BIS(KEYLARGO_FCR0, KL0_USB_REF_SUSPEND);
+ (void)MACIO_IN32(KEYLARGO_FCR0);
+ mdelay(1);
+ }
MACIO_BIC(KEYLARGO_FCR0,KL0_SCCA_ENABLE | KL0_SCCB_ENABLE |
KL0_SCC_CELL_ENABLE |
KL0_IRDA_ENABLE | KL0_IRDA_CLK32_ENABLE |
KL0_IRDA_CLK19_ENABLE);
-
- (void)MACIO_IN32(KEYLARGO_FCR0); udelay(10);
+
MACIO_BIC(KEYLARGO_MBCR, KL_MBCR_MB0_DEV_MASK);
- (void)MACIO_IN32(KEYLARGO_MBCR); udelay(10);
+ MACIO_BIS(KEYLARGO_MBCR, KL_MBCR_MB0_IDE_ENABLE);
MACIO_BIC(KEYLARGO_FCR1,
KL1_AUDIO_SEL_22MCLK | KL1_AUDIO_CLK_ENABLE_BIT |
@@ -1261,27 +1337,33 @@
KL1_EIDE0_ENABLE | KL1_EIDE0_RESET_N |
KL1_EIDE1_ENABLE | KL1_EIDE1_RESET_N |
KL1_UIDE_ENABLE);
- (void)MACIO_IN32(KEYLARGO_FCR1); udelay(10);
MACIO_BIS(KEYLARGO_FCR2, KL2_ALT_DATA_OUT);
- udelay(10);
MACIO_BIC(KEYLARGO_FCR2, KL2_IOBUS_ENABLE);
- udelay(10);
+
temp = MACIO_IN32(KEYLARGO_FCR3);
- if (macio->rev >= 2)
- temp |= (KL3_SHUTDOWN_PLL2X | KL3_SHUTDOWN_PLL_TOTAL);
-
+ if (macio->rev >= 2) {
+ temp |= KL3_SHUTDOWN_PLL2X;
+ if (sleep_mode)
+ temp |= KL3_SHUTDOWN_PLL_TOTAL;
+ }
+
temp |= KL3_SHUTDOWN_PLLKW6 | KL3_SHUTDOWN_PLLKW4 |
- KL3_SHUTDOWN_PLLKW35 | KL3_SHUTDOWN_PLLKW12;
+ KL3_SHUTDOWN_PLLKW35;
+ if (sleep_mode)
+ temp |= KL3_SHUTDOWN_PLLKW12;
temp &= ~(KL3_CLK66_ENABLE | KL3_CLK49_ENABLE | KL3_CLK45_ENABLE
- | KL3_CLK31_ENABLE | KL3_TIMER_CLK18_ENABLE | KL3_I2S1_CLK18_ENABLE
- | KL3_I2S0_CLK18_ENABLE | KL3_VIA_CLK16_ENABLE);
+ | KL3_CLK31_ENABLE | KL3_I2S1_CLK18_ENABLE | KL3_I2S0_CLK18_ENABLE);
+ if (sleep_mode)
+ temp &= ~(KL3_TIMER_CLK18_ENABLE | KL3_VIA_CLK16_ENABLE);
MACIO_OUT32(KEYLARGO_FCR3, temp);
- (void)MACIO_IN32(KEYLARGO_FCR3); udelay(10);
+
+ /* Flush posted writes & wait a bit */
+ (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
}
static void __pmac
-pangea_shutdown(struct macio_chip* macio, int restart)
+pangea_shutdown(struct macio_chip* macio, int sleep_mode)
{
u32 temp;
@@ -1289,10 +1371,6 @@
KL0_SCC_CELL_ENABLE |
KL0_USB0_CELL_ENABLE | KL0_USB1_CELL_ENABLE);
- (void)MACIO_IN32(KEYLARGO_FCR0); udelay(10);
- MACIO_BIC(KEYLARGO_MBCR, KL_MBCR_MB0_DEV_MASK);
- (void)MACIO_IN32(KEYLARGO_MBCR); udelay(10);
-
MACIO_BIC(KEYLARGO_FCR1,
KL1_AUDIO_SEL_22MCLK | KL1_AUDIO_CLK_ENABLE_BIT |
KL1_AUDIO_CLK_OUT_ENABLE | KL1_AUDIO_CELL_ENABLE |
@@ -1300,18 +1378,54 @@
KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE |
KL1_I2S1_CLK_ENABLE_BIT | KL1_I2S1_ENABLE |
KL1_UIDE_ENABLE);
- (void)MACIO_IN32(KEYLARGO_FCR1); udelay(10);
+ if (pmac_mb.board_flags & PMAC_MB_MOBILE)
+ MACIO_BIC(KEYLARGO_FCR1, KL1_UIDE_RESET_N);
MACIO_BIS(KEYLARGO_FCR2, KL2_ALT_DATA_OUT);
- udelay(10);
+
temp = MACIO_IN32(KEYLARGO_FCR3);
temp |= KL3_SHUTDOWN_PLLKW6 | KL3_SHUTDOWN_PLLKW4 |
KL3_SHUTDOWN_PLLKW35;
- temp &= ~(KL3_CLK49_ENABLE | KL3_CLK45_ENABLE
- | KL3_CLK31_ENABLE | KL3_TIMER_CLK18_ENABLE | KL3_I2S1_CLK18_ENABLE
- | KL3_I2S0_CLK18_ENABLE | KL3_VIA_CLK16_ENABLE);
+ temp &= ~(KL3_CLK49_ENABLE | KL3_CLK45_ENABLE | KL3_CLK31_ENABLE
+ | KL3_I2S0_CLK18_ENABLE | KL3_I2S1_CLK18_ENABLE);
+ if (sleep_mode)
+ temp &= ~(KL3_VIA_CLK16_ENABLE | KL3_TIMER_CLK18_ENABLE);
MACIO_OUT32(KEYLARGO_FCR3, temp);
- (void)MACIO_IN32(KEYLARGO_FCR3); udelay(10);
+
+ /* Flush posted writes & wait a bit */
+ (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
+}
+
+static void __pmac
+intrepid_shutdown(struct macio_chip* macio, int sleep_mode)
+{
+ u32 temp;
+
+ MACIO_BIC(KEYLARGO_FCR0,KL0_SCCA_ENABLE | KL0_SCCB_ENABLE |
+ KL0_SCC_CELL_ENABLE |
+ KL0_USB0_CELL_ENABLE | KL0_USB1_CELL_ENABLE);
+
+ MACIO_BIC(KEYLARGO_FCR1,
+ KL1_USB2_CELL_ENABLE |
+ KL1_I2S0_CELL_ENABLE | KL1_I2S0_CLK_ENABLE_BIT |
+ KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE |
+ KL1_I2S1_CLK_ENABLE_BIT | KL1_I2S1_ENABLE);
+ if (pmac_mb.board_flags & PMAC_MB_MOBILE)
+ MACIO_BIC(KEYLARGO_FCR1, KL1_UIDE_RESET_N);
+
+ MACIO_BIS(KEYLARGO_FCR2, KL2_ALT_DATA_OUT);
+
+ temp = MACIO_IN32(KEYLARGO_FCR3);
+ temp |= KL3_IT_SHUTDOWN_PLL1 | KL3_IT_SHUTDOWN_PLL2 |
+ KL3_IT_SHUTDOWN_PLL3;
+ temp &= ~(KL3_CLK49_ENABLE | KL3_CLK45_ENABLE |
+ KL3_I2S1_CLK18_ENABLE | KL3_I2S0_CLK18_ENABLE);
+ if (sleep_mode)
+ temp &= ~(KL3_TIMER_CLK18_ENABLE | KL3_IT_VIA_CLK32_ENABLE);
+ MACIO_OUT32(KEYLARGO_FCR3, temp);
+
+ /* Flush posted writes & wait a bit */
+ (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
}
static int __pmac
@@ -1321,7 +1435,8 @@
int i;
macio = &macio_chips[0];
- if (macio->type != macio_keylargo && macio->type != macio_pangea)
+ if (macio->type != macio_keylargo && macio->type != macio_pangea &&
+ macio->type != macio_intrepid)
return -ENODEV;
/* We power off the wireless slot in case it was not done
@@ -1337,7 +1452,11 @@
}
/* We make sure int. modem is off (in case driver lost it) */
- core99_modem_enable(macio->of_node, 0, 0);
+ if (macio->type == macio_keylargo)
+ core99_modem_enable(macio->of_node, 0, 0);
+ else
+ pangea_modem_enable(macio->of_node, 0, 0);
+
/* We make sure the sound is off as well */
core99_sound_chip_enable(macio->of_node, 0, 0);
@@ -1354,12 +1473,15 @@
save_gpio_normal[i] = MACIO_IN8(KEYLARGO_GPIO_0+i);
/* Save the FCRs */
- save_mbcr = MACIO_IN32(KEYLARGO_MBCR);
+ if (macio->type == macio_keylargo)
+ save_mbcr = MACIO_IN32(KEYLARGO_MBCR);
save_fcr[0] = MACIO_IN32(KEYLARGO_FCR0);
save_fcr[1] = MACIO_IN32(KEYLARGO_FCR1);
save_fcr[2] = MACIO_IN32(KEYLARGO_FCR2);
save_fcr[3] = MACIO_IN32(KEYLARGO_FCR3);
save_fcr[4] = MACIO_IN32(KEYLARGO_FCR4);
+ if (macio->type == macio_pangea || macio->type == macio_intrepid)
+ save_fcr[5] = MACIO_IN32(KEYLARGO_FCR5);
/* Save state & config of DBDMA channels */
dbdma_save(macio, save_dbdma);
@@ -1368,9 +1490,11 @@
* Turn off as much as we can
*/
if (macio->type == macio_pangea)
- pangea_shutdown(macio, 0);
+ pangea_shutdown(macio, 1);
+ else if (macio->type == macio_intrepid)
+ intrepid_shutdown(macio, 1);
else if (macio->type == macio_keylargo)
- keylargo_shutdown(macio, 0);
+ keylargo_shutdown(macio, 1);
/*
* Put the host bridge to sleep
@@ -1400,7 +1524,8 @@
int i;
macio = &macio_chips[0];
- if (macio->type != macio_keylargo && macio->type != macio_pangea)
+ if (macio->type != macio_keylargo && macio->type != macio_pangea &&
+ macio->type != macio_intrepid)
return -ENODEV;
/*
@@ -1414,9 +1539,11 @@
/*
* Restore KeyLargo
*/
-
- MACIO_OUT32(KEYLARGO_MBCR, save_mbcr);
- (void)MACIO_IN32(KEYLARGO_MBCR); udelay(10);
+
+ if (macio->type == macio_keylargo) {
+ MACIO_OUT32(KEYLARGO_MBCR, save_mbcr);
+ (void)MACIO_IN32(KEYLARGO_MBCR); udelay(10);
+ }
MACIO_OUT32(KEYLARGO_FCR0, save_fcr[0]);
(void)MACIO_IN32(KEYLARGO_FCR0); udelay(10);
MACIO_OUT32(KEYLARGO_FCR1, save_fcr[1]);
@@ -1427,6 +1554,10 @@
(void)MACIO_IN32(KEYLARGO_FCR3); udelay(10);
MACIO_OUT32(KEYLARGO_FCR4, save_fcr[4]);
(void)MACIO_IN32(KEYLARGO_FCR4); udelay(10);
+ if (macio->type == macio_pangea || macio->type == macio_intrepid) {
+ MACIO_OUT32(KEYLARGO_FCR5, save_fcr[5]);
+ (void)MACIO_IN32(KEYLARGO_FCR5); udelay(10);
+ }
dbdma_restore(macio, save_dbdma);
@@ -1477,61 +1608,6 @@
}
static int __pmac
-pangea_modem_enable(struct device_node* node, int param, int value)
-{
- struct macio_chip* macio;
- u8 gpio;
- unsigned long flags;
-
- /* Hack for internal USB modem */
- if (node == NULL) {
- if (macio_chips[0].type != macio_pangea)
- return -ENODEV;
- node = macio_chips[0].of_node;
- }
- macio = macio_find(node, 0);
- if (!macio)
- return -ENODEV;
- gpio = MACIO_IN8(KL_GPIO_MODEM_RESET);
- gpio |= KEYLARGO_GPIO_OUTPUT_ENABLE;
- gpio &= ~KEYLARGO_GPIO_OUTOUT_DATA;
-
- if (!value) {
- LOCK(flags);
- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
- UNLOCK(flags);
- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
- mdelay(250);
- }
- LOCK(flags);
- if (value) {
- MACIO_OUT8(KL_GPIO_MODEM_POWER,
- KEYLARGO_GPIO_OUTPUT_ENABLE);
- UNLOCK(flags);
- (void)MACIO_IN32(KEYLARGO_FCR2);
- mdelay(250);
- } else {
- MACIO_OUT8(KL_GPIO_MODEM_POWER,
- KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
- UNLOCK(flags);
- }
- if (value) {
- LOCK(flags);
- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
- UNLOCK(flags); mdelay(250); LOCK(flags);
- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
- UNLOCK(flags); mdelay(250); LOCK(flags);
- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
- UNLOCK(flags); mdelay(250);
- }
- return 0;
-}
-
-
-static int __pmac
generic_get_mb_info(struct device_node* node, int param, int value)
{
switch(param) {
@@ -1547,7 +1623,6 @@
return 0;
}
-
/*
* Table definitions
*/
@@ -1657,7 +1732,7 @@
{ PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power },
{ PMAC_FTR_SLEEP_STATE, core99_sleep_state },
#ifdef CONFIG_SMP
- { PMAC_FTR_RESET_CPU, rackmac_reset_cpu },
+ { PMAC_FTR_RESET_CPU, core99_reset_cpu },
#endif /* CONFIG_SMP */
{ PMAC_FTR_READ_GPIO, core99_read_gpio },
{ PMAC_FTR_WRITE_GPIO, core99_write_gpio },
@@ -1683,6 +1758,26 @@
{ PMAC_FTR_WRITE_GPIO, core99_write_gpio },
{ 0, NULL }
};
+
+/* Intrepid features
+ */
+static struct feature_table_entry intrepid_features[] __pmacdata = {
+ { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
+ { PMAC_FTR_MODEM_ENABLE, pangea_modem_enable },
+ { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
+ { PMAC_FTR_IDE_RESET, core99_ide_reset },
+ { PMAC_FTR_GMAC_ENABLE, core99_gmac_enable },
+ { PMAC_FTR_GMAC_PHY_RESET, core99_gmac_phy_reset },
+ { PMAC_FTR_SOUND_CHIP_ENABLE, core99_sound_chip_enable },
+ { PMAC_FTR_AIRPORT_ENABLE, core99_airport_enable },
+ { PMAC_FTR_USB_ENABLE, core99_usb_enable },
+ { PMAC_FTR_1394_ENABLE, core99_firewire_enable },
+ { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power },
+ { PMAC_FTR_SLEEP_STATE, core99_sleep_state },
+ { PMAC_FTR_READ_GPIO, core99_read_gpio },
+ { PMAC_FTR_WRITE_GPIO, core99_write_gpio },
+ { 0, NULL }
+};
static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
/* Warning: ordering is important as some models may claim
@@ -1714,11 +1809,11 @@
},
{ "AAPL,3400/2400", "PowerBook 3400",
PMAC_TYPE_HOOPER, ohare_features,
- PMAC_MB_CAN_SLEEP
+ PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
},
{ "AAPL,3500", "PowerBook 3500",
PMAC_TYPE_KANGA, ohare_features,
- PMAC_MB_CAN_SLEEP
+ PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
},
{ "AAPL,Gossamer", "PowerMac G3 (Gossamer)",
PMAC_TYPE_GOSSAMER, heathrow_desktop_features,
@@ -1730,11 +1825,11 @@
},
{ "AAPL,PowerBook1998", "PowerBook Wallstreet",
PMAC_TYPE_WALLSTREET, heathrow_laptop_features,
- PMAC_MB_CAN_SLEEP
+ PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
},
{ "PowerBook1,1", "PowerBook 101 (Lombard)",
PMAC_TYPE_101_PBOOK, paddington_features,
- PMAC_MB_CAN_SLEEP
+ PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
},
{ "iMac,1", "iMac (first generation)",
PMAC_TYPE_ORIG_IMAC, paddington_features,
@@ -1746,15 +1841,15 @@
},
{ "PowerBook4,3", "iBook 2 rev. 2",
PMAC_TYPE_IBOOK2, pangea_features,
- PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER
+ PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
},
{ "PowerBook4,2", "iBook 2",
PMAC_TYPE_IBOOK2, pangea_features,
- PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER
+ PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
},
{ "PowerBook4,1", "iBook 2",
PMAC_TYPE_IBOOK2, pangea_features,
- PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER
+ PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
},
{ "PowerMac4,4", "eMac",
PMAC_TYPE_EMAC, core99_features,
@@ -1774,7 +1869,7 @@
},
{ "PowerBook2,1", "iBook (first generation)",
PMAC_TYPE_ORIG_IBOOK, core99_features,
- PMAC_MB_CAN_SLEEP | PMAC_MB_OLD_CORE99
+ PMAC_MB_CAN_SLEEP | PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE
},
{ "PowerMac3,1", "PowerMac G4 AGP Graphics",
PMAC_TYPE_SAWTOOTH, core99_features,
@@ -1798,7 +1893,7 @@
},
{ "PowerBook2,2", "iBook FireWire",
PMAC_TYPE_FW_IBOOK, core99_features,
- PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_OLD_CORE99
+ PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE
},
{ "PowerMac5,1", "PowerMac G4 Cube",
PMAC_TYPE_CUBE, core99_features,
@@ -1814,28 +1909,44 @@
},
{ "PowerBook3,1", "PowerBook Pismo",
PMAC_TYPE_PISMO, core99_features,
- PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_OLD_CORE99
+ PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE
},
{ "PowerBook3,2", "PowerBook Titanium",
PMAC_TYPE_TITANIUM, core99_features,
- PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER
+ PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
},
{ "PowerBook3,3", "PowerBook Titanium II",
PMAC_TYPE_TITANIUM2, core99_features,
- PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER
+ PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
},
{ "PowerBook3,4", "PowerBook Titanium III",
PMAC_TYPE_TITANIUM3, core99_features,
- PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER
+ PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
+ },
+ { "PowerBook3,5", "PowerBook Titanium IV",
+ PMAC_TYPE_TITANIUM4, core99_features,
+ PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
},
{ "RackMac1,1", "XServe",
PMAC_TYPE_RACKMAC, rackmac_features,
0,
},
+ { "RackMac1,2", "XServe rev. 2",
+ PMAC_TYPE_RACKMAC, rackmac_features,
+ 0,
+ },
{ "PowerMac3,6", "PowerMac G4 Windtunnel",
PMAC_TYPE_WINDTUNNEL, rackmac_features,
0,
},
+ { "PowerBook5,1", "PowerBook G4 17\"",
+ PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
+ PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+ },
+ { "PowerBook6,1", "PowerBook G4 12\"",
+ PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
+ PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+ },
};
/*
@@ -1931,6 +2042,11 @@
pmac_mb.model_name = "Unknown Pangea-based";
pmac_mb.features = pangea_features;
break;
+ case macio_intrepid:
+ pmac_mb.model_id = PMAC_TYPE_UNKNOWN_INTREPID;
+ pmac_mb.model_name = "Unknown Intrepid-based";
+ pmac_mb.features = intrepid_features;
+ break;
default:
return -ENODEV;
}
@@ -1977,6 +2093,12 @@
* NAP mode
*/
powersave_lowspeed = 1;
+
+ /* Check for "mobile" machine */
+ if (model && (strncmp(model, "PowerBook", 9) == 0
+ || strncmp(model, "iBook", 5) == 0))
+ pmac_mb.board_flags |= PMAC_MB_MOBILE;
+
printk(KERN_INFO "PowerMac motherboard: %s\n", pmac_mb.model_name);
return 0;
@@ -2060,6 +2182,8 @@
u32* did = (u32 *)get_property(node, "device-id", NULL);
if (*did == 0x00000025)
type = macio_pangea;
+ if (*did == 0x0000003e)
+ type = macio_intrepid;
}
macio_chips[i].of_node = node;
macio_chips[i].type = type;
@@ -2154,7 +2278,8 @@
}
if (macio_chips[0].type == macio_keylargo ||
- macio_chips[0].type == macio_pangea) {
+ macio_chips[0].type == macio_pangea ||
+ macio_chips[0].type == macio_intrepid) {
/* Enable GMAC for now for PCI probing. It will be disabled
* later on after PCI probe
*/
@@ -2185,6 +2310,17 @@
np = np->next;
}
+ /* Enable ATA-100 before PCI probe. */
+ np = find_devices("ata-6");
+ while(np) {
+ if (np->parent
+ && device_is_compatible(np->parent, "uni-north")
+ && device_is_compatible(np, "kauai-ata")) {
+ core99_ata100_enable(np, 1);
+ }
+ np = np->next;
+ }
+
/* Switch airport off */
np = find_devices("radio");
while(np) {
diff -uNr linux-2.4.20/arch/ppc/platforms/pmac_feature.c~ linux-2.4.20-ben10/arch/ppc/platforms/pmac_feature.c~
--- linux-2.4.20/arch/ppc/platforms/pmac_feature.c~ 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.4.20-ben10/arch/ppc/platforms/pmac_feature.c~ 2003-03-23 12:00:25.000000000 +0100
@@ -0,0 +1,2391 @@
+/*
+ * BK Id: %F% %I% %G% %U% %#%
+ */
+/*
+ * arch/ppc/platform/pmac_feature.c
+ *
+ * Copyright (C) 1996-2002 Paul Mackerras (paulus@cs.anu.edu.au)
+ * Ben. Herrenschmidt (benh@kernel.crashing.org)
+ *
+ * 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.
+ *
+ * TODO:
+ *
+ * - Replace mdelay with some schedule loop if possible
+ * - Shorten some obfuscated delays on some routines (like modem
+ * power)
+ * - Refcount some clocks (see darwin)
+ * - Split split split...
+ *
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include