diff -uNr linux-2.4.19/CREDITS linux-2.4.19bgl/CREDITS --- linux-2.4.19/CREDITS 2002-08-02 19:39:42.000000000 -0500 +++ linux-2.4.19bgl/CREDITS 2003-07-02 10:43:05.000000000 -0500 @@ -625,6 +625,13 @@ S: Bucharest S: Romania +N: Dan Cox: +E: danc@mvista.com +D: PowerPC SMP work +D: Synergy-Micro 'Gemini' port +S: Tucson, Arizona +S: USA + N: Laurence Culhane E: loz@holmes.demon.co.uk D: Wrote the initial alpha SLIP code @@ -1909,6 +1916,11 @@ E: Kai.Makisara@metla.fi D: SCSI Tape Driver +N: Dan Malek +E: dan@mvista.com +D: PowerPC 8xx, 4xx work. +S: USA + N: Asit Mallick E: asit.k.mallick@intel.com D: Linux/IA-64 @@ -2398,6 +2410,14 @@ E: fpotter@cirpack.com D: Some PCI kernel support +N: Matt Porter +E: mporter@mvista.com +D: Motorola PowerPC PReP support +D: cPCI PowerPC support +D: Embedded PowerPC 6xx/7xx/74xx support +S: Tempe, Arizona 85282 +S: USA + N: Rui Prior E: rprior@inescn.pt D: ATM device driver for NICStAR based cards @@ -2509,6 +2529,12 @@ S: 70110 Kuopio S: Finland +N: Tom Rini +E: trini@kernel.crashing.org +D: Lots of PowerPC cleanups, minor matroxfb work +S: Tucson, Arizona +S: USA + N: William E. Roadcap E: roadcapw@cfw.com W: http://www.cfw.com/~roadcapw @@ -2564,6 +2590,11 @@ S: 95170 Deuil La Barre S: France +N: Frank Rowand +E: frowand@mvista.com +D: PowerPC 4xx +S: USA + N: Sebastien Rougeaux E: Sebastien.Rougeaux@syseng.anu.edu.au D: IEEE 1394 OHCI module diff -uNr linux-2.4.19/Documentation/Configure.help linux-2.4.19bgl/Documentation/Configure.help --- linux-2.4.19/Documentation/Configure.help 2002-08-02 19:39:42.000000000 -0500 +++ linux-2.4.19bgl/Documentation/Configure.help 2005-06-08 14:30:43.000000000 -0500 @@ -112,6 +112,15 @@ like MGA monitors that you are very unlikely to see on today's systems. +Prompt for advanced kernel configuration options +CONFIG_ADVANCED_OPTIONS + This option will enable prompting for a variety of advanced kernel + configuration options. These options can cause the kernel to not + work if they are set incorrectly, but can be used to optimize certain + aspects of kernel memory management. + + Unless you know what you are doing you *should not* enable this option. + Symmetric Multi-Processing support CONFIG_SMP This enables support for systems with more than one CPU. If you have @@ -4200,6 +4209,26 @@ CONFIG_FB_S3TRIO If you have a S3 Trio say Y. Say N for S3 Virge. +RPX LCD display support +CONFIG_FB_RPX + This driver supports the PowerPC MPC823's on-chip LCD controller. If + you have an MPC823 (such as is present in the Embedded Planet RPX + Lite boards), say Y. + + The driver is also available as a module ( = code which can be + inserted and removed from the running kernel whenever you want). The + module will be called rpxfb.o. If you want to compile it as a + module, say M here and read . + + If unsure, say N. + +Debug RPX frame buffer +CONFIG_FB_RPX_DEBUG + If you want the RPX frame buffer driver to display debugging + information, say Y. + + If unsure, say N. + 3Dfx Banshee/Voodoo3 display support CONFIG_FB_3DFX This driver supports graphics boards with the 3Dfx Banshee/Voodoo3 @@ -4830,6 +4859,16 @@ If you plan to use the LCD display with your SA-1100 system, say Y here. +IBM Beech LCD Controller Support +CONFIG_FB_IBMLCDC + This is a framebuffer device for the IBM 405LP/Beech LCD Controller. + See for information on framebuffer + devices. + + If you plan to use the LCD display with your 405LP/Beech system, say + Y here. You must also enable generic framebuffer support under the + Console configuration tab. + Advanced low level driver options CONFIG_FBCON_ADVANCED The frame buffer console uses character drawing routines that are @@ -6552,28 +6591,7 @@ When this option is disabled (N), the SCSI portion of the driver is not compiled. -QuickNet Internet LineJack/PhoneJack support -CONFIG_PHONE_IXJ - Say M if you have a telephony card manufactured by Quicknet - Technologies, Inc. These include the Internet PhoneJACK and - Internet LineJACK Telephony Cards. You will get a module called - ixj.o. - - For the ISA versions of these products, you can configure the - cards using the isapnp tools (pnpdump/isapnp) or you can use the - isapnp support. Please read . - - For more information on these cards, see Quicknet's web site at: - . - If you do not have any Quicknet telephony cards, you can safely - say N here. - -QuickNet Internet LineJack/PhoneJack PCMCIA support -CONFIG_PHONE_IXJ_PCMCIA - Say Y here to configure in PCMCIA service support for the Quicknet - cards manufactured by Quicknet Technologies, Inc. This builds an - additional support module for the PCMCIA version of the card. FORE Systems 200E-series CONFIG_ATM_FORE200E_MAYBE @@ -10578,31 +10596,6 @@ The safe and default value for this is N. -SysKonnect SK-98xx support -CONFIG_SK98LIN - Say Y here if you have a SysKonnect SK-98xx Gigabit Ethernet Server - Adapter. The following adapters are supported by this driver: - - SK-9841 (single link 1000Base-LX) - - SK-9842 (dual link 1000Base-LX) - - SK-9843 (single link 1000Base-SX) - - SK-9844 (dual link 1000Base-SX) - - SK-9821 (single link 1000Base-T) - - SK-9822 (dual link 1000Base-T) - - SK-9861 (single link Volition connector) - - SK-9862 (dual link Volition connector) - The driver also supports the following adapters from Allied Telesyn: - - AT2970... - - The dual link adapters support a link-failover feature. Read - for information about - optional driver parameters. - Questions concerning this driver may be addressed to: - linux@syskonnect.de - - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called sk98lin.o. Sun GEM support CONFIG_SUNGEM @@ -16312,6 +16305,15 @@ If unsure, say N. +Use a non standard baud rate on serial console +CONFIG_SERIAL_CONSOLE_NONSTD + By default the serial console code assumes that all of the registers + for setting up the baud rate are set. In some cases, such as the IBM + Spruce boards, this is not the case. If you answer Y here, you can fill + in the desired baud rate to use at console (eg 9600). + + If unsure, say N. + Support for PowerMac serial ports CONFIG_MAC_SERIAL If you have Macintosh style serial ports (8 pin mini-DIN), say Y @@ -20527,6 +20529,11 @@ "Area6" will work for most boards. For ADX, select "Area5". +Disable data cache +CONFIG_DCACHE_DISABLE + This option allows you to run the kernel with data cache disabled. + Say Y if you experience CPM lock-ups. + # # m68k-specific kernel options # Documented by Chris Lawrence et al. @@ -21253,6 +21260,14 @@ CONFIG_WALNUT Select Walnut if you have an IBM 405GP "Walnut" Evaluation Board. +Beech +CONFIG_BEECH + Select Beech if you have an IBM 405LP "Beech" Evaluation Board. + +Xilinx-ML300 +CONFIG_XILINX_ML300 + Select Xilinx-ML300 if you have a Xilinx ML300 evaluation board. + Workarounds for PPC601 bugs CONFIG_PPC601_SYNC_FIX Some versions of the PPC601 (the first PowerPC chip) have bugs which @@ -21354,6 +21369,8 @@ Select APUS if configuring for a PowerUP Amiga. More information is available at: . + Note that Total Impact briQ is handled as a CHRP machine. + Synergy-Gemini CONFIG_GEMINI Select Gemini if configuring for a Synergy Microsystems' Gemini @@ -21366,6 +21383,12 @@ More information is available at: . +IBM Spruce Baud Clock Support +CONFIG_SPRUCE_BAUD_33M + IBM Spruce reference platforms are equipped with either a 30Mhz or + 33Mhz CPC700 input oscillator. Enable this option only if you + have the 33Mhz oscillator. + AltiVec kernel support CONFIG_ALTIVEC This option enables kernel support for the Altivec extensions to the @@ -21413,6 +21436,12 @@ a lot, or the TAU hardware is broken (likely on some G4's). If the range is small (around 4 degrees), the temperature is relatively stable. +MVME5100 configured with an IPMC761 +CONFIG_MVME5100_IPMC761_PRESENT + The MVME5100 supports a special IPMC761 PMC module in PMC site 1. + This option enables the use of the onboard i8259 PIC and ISA I/O + to support the legacy peripherals on the module. + Power management support for PowerBooks CONFIG_PMAC_PBOOK This provides support for putting a PowerBook to sleep; it also @@ -21746,6 +21775,38 @@ /proc/sys/dev/mac_hid/mouse_button2_keycode /proc/sys/dev/mac_hid/mouse_button3_keycode +Set high memory pool address +CONFIG_HIGHMEM_START_BOOL + Unless you know what you are doing you *should not* set this option. + + It can be used to override the default PKMAP_BASE address which + is the location of the high memory pool. This can be useful in + optimizing virtual memory usage in a system. + +Set maximum low memory +CONFIG_LOWMEM_SIZE_BOOL + Unless you know what you are doing you *should not* set this option. + + It can be used to override the standard calculated value of + MAX_LOW_MEM. This can be useful in optimizing virtual memory usage + in a system. + +Set custom kernel base address +CONFIG_KERNEL_START_BOOL + Unless you know what you are doing you *should not* set this option. + + It can be used to override the standard PAGE_OFFSET/KERNELBASE + value used by the kernel. This can be useful in controlling + amount of virtual address space available to the kernel. + +Set custom user task size +CONFIG_TASK_SIZE_BOOL + Unless you know what you are doing you *should not* set this option. + + It can be used to override the standard TASK_SIZE value used + by the kernel. This can be useful in controlling amount of + virtual address space available to user tasks. + Enhanced Real Time Clock Support (/dev/rtc) CONFIG_PPC_RTC If you say Y here and create a character special file /dev/rtc with @@ -24511,6 +24572,91 @@ To use this option, you have to check that the "/proc file system support" (CONFIG_PROC_FS) is enabled, too. +Use MDIO for PHY configuration +CONFIG_USE_MDIO + This option specifies whether to use MII autoconfiguration in the + FCC Ethernet driver or not. + +PPC4xx DMA controller support +CONFIG_PPC4xx_DMA + Select this to enable support for the PPC4xx general purpose DMA + controller. + +ttyS0 device +CONFIG_UART0_TTYS0 + This option reverses the mapping between the hardware UART and software + device. Selecting UART0 gives the normal mapping of UART0=ttyS0 and + UART1=ttyS1. Selecting UART1 gives the reverse mapping of UART0=ttyS1 + and UART1=ttyS0. Most people will use UART0. + +PowerPC 405 on-chip ethernet +CONFIG_IBM_OCP_ENET + If you want to use the 405 built-in ethernet select this. + +CONFIG_IBM_OCP_ENET_ERROR_MSG + Enable this option to print verbose debug messages for troubleshooting. + +PowerPC 405 on-chip ethernet -- Number of receive buffers +CONFIG_IBM_OCP_ENET_RX_BUFF + Number of ethernet receive (read) buffers. Unless you know what you + are doing the default should be fine. + +PowerPC 405 on-chip ethernet -- Number of transmit buffers +CONFIG_IBM_OCP_ENET_TX_BUFF + Number of ethernet transmit (write) buffers. Unless you know what + you are doing the default should be fine. + +PowerPC 405 on-chip ethernet -- Amount of bytes to Reserve on a skb +CONFIG_IBM_OCP_ENET_SKB_RES + Many standard ethernet drivers need to reserve 2 bytes of data + on the skb before giving the data ptr to the hardware. This is + so the IP data will be 16-byte aligned when it goes up the stack. + This is a requirement for some processors and it can cause major + slow downs on others. The 405GP dose not have problems with the + misaligned data so the default is 0. If you need to route the + incoming ethernet packets to another device that has alignment + requirements this can help remove a data copy. A value of 2 can + help at getting 16-byte aligned IP data for another device. A + larger value can be used when routing to a IP tunnel device. + Make sure XXX_DESC_SIZE - XXX_SKB_RES >= 1514, or larger if VLANS + are used. + +PPC 405 I2C Algorithm +CONFIG_PPC405_I2C_ALGO + Enable this option to use the built-in I2C on your 405. + +PPC 405 I2C Adapter +CONFIG_PPC405_I2C_ADAP + Enable this option to use the built-in I2C on your 405. + +BM PPC 405 Watchdog Timer +CONFIG_PPC405_WDT + Enable this option to use the built-in watch dog timer on your 405. + +Xilinx Virtex-II Pro on-chip ethernet +CONFIG_XILINX_ENET + If you want to use the Xilinx built-in ethernet select this. + +Xilinx Virtex-II Pro TFT display frame buffer +CONFIG_FB_XILINX + If you want to use the Xilinx built-in TFT display select this. + +Xilinx Virtex-II Pro I2C +CONFIG_I2C_XILINX + If you want to use the Xilinx built-in I2C select this. + +Xilinx Virtex-II Pro GPIO +CONFIG_XILINX_GPIO + If you want to use the Xilinx built-in GPIO select this. + +Xilinx MAC Address +CONFIG_XILINX_ML300_MACADDR + How the MAC address is going to be stored on the Xilinx ML300 + evaluation board has not yet been defined. This temporary + configuration variable will let you choose the MAC address to + use. Note that you will have to use different kernels if you + want to have multiple boards on the same network. + /proc/efi/vars support CONFIG_EFI_VARS If you say Y here, you are able to get EFI (Extensible Firmware @@ -24642,6 +24788,18 @@ Include in-kernel hooks for the xmon kernel monitor/debugger supported by the PPC port. +Include BDI2000 debugger support +CONFIG_BDI_SWITCH + Include in-kernel support for the Abatron BDI2000 debugger. To + learn more about the Abatron BDI2000, visit the web page at + . + +Add additional CFLAGS to the kernel build +CONFIG_MORE_COMPILE_OPTIONS + If you want to add additional CFLAGS to the kernel build, such as + -g for KGDB, XMON or the BDI2000, enable this option and then + enter what you would like to add in the next question. + Include kgdb kernel debugger CONFIG_KWDB Include in-kernel hooks for kdb, the source level debugger for the @@ -25549,8 +25707,6 @@ # LocalWords: hpl Tourrilhes DuraLAN starfire Davicom davicom dmfe auk tms tr # LocalWords: TokenExpress Belkin Peracom eTek DVDs infradead Cxxx Adlib AV ZX # LocalWords: NeoMagic CPi CPt Celeron decapsulation Undeletion BFS bfs nVidia -# LocalWords: OnStream Irongate Riva phonedev QuickNet LineJack PhoneJack IXJ -# LocalWords: Quicknet PhoneJACK LineJACK ixj pnpdump Quicknet's Joandi SSID # LocalWords: aironet quickconfig adhoc btw bap NONCS cardservices Xircom lin # LocalWords: Netwave AirSurfer netwave HomePNA failover MVP iMacs ALi aktual # LocalWords: Aladin HIDBP usbkbd KEYBDEV MOUSEDEV JOYDEV EVDEV UAB WhiteHEAT diff -uNr linux-2.4.19/Documentation/DocBook/Makefile linux-2.4.19bgl/Documentation/DocBook/Makefile --- linux-2.4.19/Documentation/DocBook/Makefile 2002-08-02 19:39:42.000000000 -0500 +++ linux-2.4.19bgl/Documentation/DocBook/Makefile 2003-07-02 10:44:33.000000000 -0500 @@ -1,7 +1,8 @@ BOOKS := wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml \ kernel-api.sgml parportbook.sgml kernel-hacking.sgml \ kernel-locking.sgml via-audio.sgml mousedrivers.sgml sis900.sgml \ - deviceiobook.sgml procfs-guide.sgml tulip-user.sgml + deviceiobook.sgml procfs-guide.sgml tulip-user.sgml ocp-guide.sgml + PS := $(patsubst %.sgml, %.ps, $(BOOKS)) PDF := $(patsubst %.sgml, %.pdf, $(BOOKS)) @@ -85,6 +86,10 @@ procfs-guide.sgml: procfs-guide.tmpl procfs_example.sgml $(TOPDIR)/scripts/docgen < procfs-guide.tmpl >$@ +ocp-guide.sgml: ocp-guide.tmpl $(TOPDIR)/arch/ppc/kernel/ocp.c + $(TOPDIR)/scripts/docgen $(TOPDIR)/arch/ppc/kernel/ocp.c \ + < ocp-guide.tmpl >$@ + APISOURCES := $(TOPDIR)/drivers/media/video/videodev.c \ $(TOPDIR)/arch/i386/kernel/irq.c \ $(TOPDIR)/arch/i386/kernel/mca.c \ diff -uNr linux-2.4.19/Documentation/powerpc/00-INDEX linux-2.4.19bgl/Documentation/powerpc/00-INDEX --- linux-2.4.19/Documentation/powerpc/00-INDEX 2000-06-20 09:24:52.000000000 -0500 +++ linux-2.4.19bgl/Documentation/powerpc/00-INDEX 2003-07-02 10:43:35.000000000 -0500 @@ -5,13 +5,24 @@ 00-INDEX - this file +cpu_features.txt + - info on how we support a variety of CPUs with minimal compile-time + options. ppc_htab.txt - info about the Linux/PPC /proc/ppc_htab entry +host_bridge.txt + - info on common support of some common embedded host bridges smp.txt - use and state info about Linux/PPC on MP machines SBC8260_memory_mapping.txt - EST SBC8260 board info sound.txt - info on sound support under Linux/PPC +todc.txt + - documentation for common support of mk48txx and mc146818 family of + realtime clocks +Xilinx.txt + - info about the Virtex-II Pro chips, and how their support is + implemented zImage_layout.txt - info on the kernel images for Linux/PPC diff -uNr linux-2.4.19/MAINTAINERS linux-2.4.19bgl/MAINTAINERS --- linux-2.4.19/MAINTAINERS 2002-08-02 19:39:42.000000000 -0500 +++ linux-2.4.19bgl/MAINTAINERS 2003-07-02 10:43:28.000000000 -0500 @@ -551,6 +551,12 @@ M: miku@iki.fi S: Maintained +ETHERNET, WATCHDOG TIMER AND GPIO DRIVERS ON IBM4XX +P: Armin Kuster +M: akuster@mvista.com +L: linuxppc-embedded@lists.linuxppc.org +S: Maintained + EXT2 FILE SYSTEM L: ext2-devel@lists.sourceforge.net S: Maintained @@ -703,6 +709,24 @@ W: http://www.uni-mainz.de/~langm000/linux.html S: Maintained +IBM iSeries Linux +P: Dave Boutcher +P: Jeff Haumont +M: ilinux@us.ibm.com +M: haumont@us.ibm.com +M: boutcher@us.ibm.com +S: Maintained + +IBM iSeries Virtual Console, CD-ROM, Disk, Ethernet, Tape +P: Ryan Arnold +P: Dave Boutcher +P: Kyle Lucke +M: ilinux@us.ibm.com +M: ryanarn@us.ibm.com +M: boutcher@us.ibm.com +M: klucke@raleigh.ibm.com +S: Maintained + IBM ServeRAID RAID DRIVER P: Keith Mitchell M: ipslinux@us.ibm.com @@ -907,12 +931,25 @@ L: linux-scsi@vger.kernel.org S: Maintained +LINUX FOR EMBEDDED/CPCI POWERPC 6XX/7XX/74XX +P: Matt Porter +M: mporter@mvista.com +S: Maintained + LINUX FOR IBM pSERIES (RS/6000) P: Paul Mackerras M: paulus@au.ibm.com W: http://www.ibm.com/linux/ltc/projects/ppc S: Supported +LINUX FOR MPC8XX AND IBM4XX +P: Dan Malek +P: Tom Rini +M: dmalek@mvista.com +M: trini@kernel.crashing.org +L: linuxppc-embedded@lists.linuxppc.org +S: Maintained + LINUX FOR POWERPC P: Paul Mackerras M: paulus@samba.org @@ -926,6 +963,12 @@ L: linuxppc-dev@lists.linuxppc.org S: Maintained +LINUX FOR SYNERGY (GEMINI) VME/CPCI POWERPC +P: Val Henson +M: val@synergymicro.com +W: http://www.synergymicro.com/Software/Linux.html +S: Supported + LINUX FOR 64BIT POWERPC P: David Engebretsen M: engebret@us.ibm.com diff -uNr linux-2.4.19/Makefile linux-2.4.19bgl/Makefile --- linux-2.4.19/Makefile 2002-08-02 19:39:46.000000000 -0500 +++ linux-2.4.19bgl/Makefile 2005-06-08 14:30:44.000000000 -0500 @@ -5,7 +5,8 @@ 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/) +# ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) +ARCH := ppc KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g") CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ @@ -188,6 +189,7 @@ 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-$(CONFIG_PPC_ISERIES) += drivers/iseries/iseries.o DRIVERS := $(DRIVERS-y) diff -uNr linux-2.4.19/arch/ppc/8260_io/Config.in linux-2.4.19bgl/arch/ppc/8260_io/Config.in --- linux-2.4.19/arch/ppc/8260_io/Config.in 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/8260_io/Config.in 2003-07-02 10:44:43.000000000 -0500 @@ -2,7 +2,7 @@ # MPC8260 Communication options # mainmenu_option next_comment -comment 'MPC8260 Communication Options' +comment 'MPC8260 CPM Options' bool 'Enable SCC Console' CONFIG_SCC_CONSOLE if [ "$CONFIG_NET_ETHERNET" = "y" ]; then bool 'CPM SCC Ethernet' CONFIG_SCC_ENET @@ -16,11 +16,22 @@ # CONFIG_FEC_ENET is only used to get netdevices to call our init # function. Any combination of FCC1,2,3 are supported. # - bool 'FCC Ethernet' CONFIG_FEC_ENET + bool 'CPM FCC Ethernet' CONFIG_FEC_ENET if [ "$CONFIG_FEC_ENET" = "y" ]; then bool 'Ethernet on FCC1' CONFIG_FCC1_ENET bool 'Ethernet on FCC2' CONFIG_FCC2_ENET bool 'Ethernet on FCC3' CONFIG_FCC3_ENET + bool 'Use MDIO for PHY configuration' CONFIG_USE_MDIO + if [ "$CONFIG_USE_MDIO" = "y" ]; then + choice 'Type of PHY' \ + "LXT970 CONFIG_FCC_LXT970 \ + LXT971 CONFIG_FCC_LXT971 \ + QS6612 CONFIG_FCC_QS6612 \ + DM9131 CONFIG_FCC_DM9131" LXT971 + fi fi fi + +comment 'Generic MPC8260 Options' +bool 'Disable data cache' CONFIG_DCACHE_DISABLE endmenu diff -uNr linux-2.4.19/arch/ppc/8260_io/Makefile linux-2.4.19bgl/arch/ppc/8260_io/Makefile --- linux-2.4.19/arch/ppc/8260_io/Makefile 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/8260_io/Makefile 2003-07-02 10:43:48.000000000 -0500 @@ -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.19/arch/ppc/8260_io/commproc.c linux-2.4.19bgl/arch/ppc/8260_io/commproc.c --- linux-2.4.19/arch/ppc/8260_io/commproc.c 2001-11-02 19:43:54.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/8260_io/commproc.c 2003-07-02 10:44:37.000000000 -0500 @@ -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.12 11/04/01 23:02:38 paulus */ /* diff -uNr linux-2.4.19/arch/ppc/8260_io/enet.c linux-2.4.19bgl/arch/ppc/8260_io/enet.c --- linux-2.4.19/arch/ppc/8260_io/enet.c 2001-10-08 13:40:13.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/8260_io/enet.c 2003-07-02 10:43:08.000000000 -0500 @@ -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.19/arch/ppc/8260_io/fcc_enet.c linux-2.4.19bgl/arch/ppc/8260_io/fcc_enet.c --- linux-2.4.19/arch/ppc/8260_io/fcc_enet.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/8260_io/fcc_enet.c 2003-07-02 10:44:42.000000000 -0500 @@ -1,21 +1,23 @@ /* - * BK Id: SCCS/s.fcc_enet.c 1.7 05/17/01 18:14:20 cort + * BK Id: SCCS/s.fcc_enet.c 1.15 05/28/02 11:49:26 trini */ /* * Fast Ethernet Controller (FCC) driver for Motorola MPC8260. * Copyright (c) 2000 MontaVista Software, Inc. Dan Malek (dmalek@jlc.net) * * This version of the driver is a combination of the 8xx fec and - * 8260 SCC Ethernet drivers. People seem to be choosing common I/O - * configurations, so this driver will work on the EST8260 boards and - * others yet to be announced. + * 8260 SCC Ethernet drivers. This version has some additional + * configuration options, which should probably be moved out of + * here. This driver currently works for the EST SBC8260, + * SBS Diablo/BCM, Embedded Planet RPX6, TQM8260, and others. * * Right now, I am very watseful with the buffers. I allocate memory * pages and then divide them into 2K frame buffers. This way I know I * have buffers large enough to hold one frame within one buffer descriptor. * Once I get this working, I will use 64 or 128 byte CPM buffers, which * will be much more memory efficient and will easily handle lots of - * small packets. + * small packets. Since this is a cache coherent processor and CPM, + * I could also preallocate SKB's and use them directly on the interface. * */ @@ -48,6 +50,56 @@ */ #define TX_TIMEOUT (2*HZ) +#ifdef CONFIG_USE_MDIO +/* Forward declarations of some structures to support different PHYs */ + +typedef struct { + uint mii_data; + void (*funct)(uint mii_reg, struct net_device *dev); +} phy_cmd_t; + +typedef struct { + uint id; + char *name; + + const phy_cmd_t *config; + const phy_cmd_t *startup; + const phy_cmd_t *ack_int; + const phy_cmd_t *shutdown; +} phy_info_t; + +/* Register definitions for the PHY. */ + +#define MII_REG_CR 0 /* Control Register */ +#define MII_REG_SR 1 /* Status Register */ +#define MII_REG_PHYIR1 2 /* PHY Identification Register 1 */ +#define MII_REG_PHYIR2 3 /* PHY Identification Register 2 */ +#define MII_REG_ANAR 4 /* A-N Advertisement Register */ +#define MII_REG_ANLPAR 5 /* A-N Link Partner Ability Register */ +#define MII_REG_ANER 6 /* A-N Expansion Register */ +#define MII_REG_ANNPTR 7 /* A-N Next Page Transmit Register */ +#define MII_REG_ANLPRNPR 8 /* A-N Link Partner Received Next Page Reg. */ + +/* values for phy_status */ + +#define PHY_CONF_ANE 0x0001 /* 1 auto-negotiation enabled */ +#define PHY_CONF_LOOP 0x0002 /* 1 loopback mode enabled */ +#define PHY_CONF_SPMASK 0x00f0 /* mask for speed */ +#define PHY_CONF_10HDX 0x0010 /* 10 Mbit half duplex supported */ +#define PHY_CONF_10FDX 0x0020 /* 10 Mbit full duplex supported */ +#define PHY_CONF_100HDX 0x0040 /* 100 Mbit half duplex supported */ +#define PHY_CONF_100FDX 0x0080 /* 100 Mbit full duplex supported */ + +#define PHY_STAT_LINK 0x0100 /* 1 up - 0 down */ +#define PHY_STAT_FAULT 0x0200 /* 1 remote fault */ +#define PHY_STAT_ANC 0x0400 /* 1 auto-negotiation complete */ +#define PHY_STAT_SPMASK 0xf000 /* mask for speed */ +#define PHY_STAT_10HDX 0x1000 /* 10 Mbit half duplex selected */ +#define PHY_STAT_10FDX 0x2000 /* 10 Mbit full duplex selected */ +#define PHY_STAT_100HDX 0x4000 /* 100 Mbit half duplex selected */ +#define PHY_STAT_100FDX 0x8000 /* 100 Mbit full duplex selected */ +#endif /* CONFIG_USE_MDIO */ + /* The number of Tx and Rx buffers. These are allocated from the page * pool. The code may assume these are power of two, so it is best * to keep them that size. @@ -77,12 +129,12 @@ static int fcc_enet_open(struct net_device *dev); static int fcc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); static int fcc_enet_rx(struct net_device *dev); -static void fcc_enet_mii(struct net_device *dev); static void fcc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs); static int fcc_enet_close(struct net_device *dev); static struct net_device_stats *fcc_enet_get_stats(struct net_device *dev); static void set_multicast_list(struct net_device *dev); -static void restart_fcc(struct net_device *dev); +static void fcc_restart(struct net_device *dev, int duplex); +static int fcc_enet_set_mac_address(struct net_device *dev, void *addr); /* These will be configurable for the FCC choice. * Multiple ports can be configured. There is little choice among the @@ -166,8 +218,14 @@ /* MII status/control serial interface. */ -#define PC_MDIO ((uint)0x00400000) -#define PC_MDCK ((uint)0x00200000) +#ifdef CONFIG_TQM8260 +/* TQM8260 has MDIO and MDCK on PC30 and PC31 respectively */ +#define PC_MDIO ((uint)0x00000002) +#define PC_MDCK ((uint)0x00000001) +#else +#define PC_MDIO ((uint)0x00000004) +#define PC_MDCK ((uint)0x00000020) +#endif /* A table of information for supporting FCCs. This does two things. * First, we know how many FCCs we have and they are always externally @@ -191,17 +249,31 @@ #ifdef CONFIG_FCC1_ENET { 0, CPM_CR_FCC1_SBLOCK, CPM_CR_FCC1_PAGE, PROFF_FCC1, SIU_INT_FCC1, (PC_F1RXCLK | PC_F1TXCLK), CMX1_CLK_ROUTE, CMX1_CLK_MASK, +# if defined(CONFIG_TQM8260) PC_MDIO, PC_MDCK }, +# else + 0x00000004, 0x00000100 }, +# endif #endif #ifdef CONFIG_FCC2_ENET { 1, CPM_CR_FCC2_SBLOCK, CPM_CR_FCC2_PAGE, PROFF_FCC2, SIU_INT_FCC2, (PC_F2RXCLK | PC_F2TXCLK), CMX2_CLK_ROUTE, CMX2_CLK_MASK, +# if defined(CONFIG_TQM8260) PC_MDIO, PC_MDCK }, +# elif defined(CONFIG_EST8260) || defined(CONFIG_ADS8260) + 0x00400000, 0x00200000 }, +# else + 0x00000002, 0x00000080 }, +# endif #endif #ifdef CONFIG_FCC3_ENET { 2, CPM_CR_FCC3_SBLOCK, CPM_CR_FCC3_PAGE, PROFF_FCC3, SIU_INT_FCC3, (PC_F3RXCLK | PC_F3TXCLK), CMX3_CLK_ROUTE, CMX3_CLK_MASK, +# if defined(CONFIG_TQM8260) PC_MDIO, PC_MDCK }, +# else + 0x00000001, 0x00000040 }, +# endif #endif }; @@ -230,9 +302,23 @@ struct net_device_stats stats; uint tx_full; spinlock_t lock; - uint phy_address; - uint phy_type; - uint phy_duplex; + +#ifdef CONFIG_USE_MDIO + uint phy_id; + uint phy_id_done; + uint phy_status; + phy_info_t *phy; + struct tq_struct phy_task; + + uint sequence_done; + + uint phy_addr; +#endif /* CONFIG_USE_MDIO */ + + int link; + int old_link; + int full_duplex; + fcc_info_t *fip; }; @@ -244,55 +330,31 @@ static void init_fcc_param(fcc_info_t *fip, struct net_device *dev, volatile immap_t *immap); -/* MII processing. We keep this as simple as possible. Requests are - * placed on the list (if there is room). When the request is finished - * by the MII, an optional function may be called. - */ -typedef struct mii_list { - uint mii_regval; - void (*mii_func)(uint val, struct net_device *dev); - struct mii_list *mii_next; -} mii_list_t; - -#define NMII 20 -mii_list_t mii_cmds[NMII]; -mii_list_t *mii_free; -mii_list_t *mii_head; -mii_list_t *mii_tail; - -static int phyaddr; -static uint phytype; - -static int mii_queue(int request, void (*func)(uint, struct net_device *)); -static void mii_startup_cmds(void); +#ifdef CONFIG_USE_MDIO +static int mii_queue(struct net_device *dev, int request, void (*func)(uint, struct net_device *)); static uint mii_send_receive(fcc_info_t *fip, uint cmd); +static void fcc_stop(struct net_device *dev); + /* Make MII read/write commands for the FCC. */ - -#define mk_mii_phyaddr(ADDR) (0x60020000 | ((ADDR) << 23) | (2 << 18)) - -#define mk_mii_read(REG) (0x60020000 | ((phyaddr << 23) | \ - (REG & 0x1f) << 18)) - -#define mk_mii_write(REG, VAL) (0x50020000 | ((phyaddr << 23) | \ - (REG & 0x1f) << 18) | \ +#define mk_mii_read(REG) (0x60020000 | ((REG & 0x1f) << 18)) +#define mk_mii_write(REG, VAL) (0x50020000 | ((REG & 0x1f) << 18) | \ (VAL & 0xffff)) +#define mk_mii_end 0 +#endif /* CONFIG_USE_MDIO */ static int -fcc_enet_open(struct net_device *dev) -{ - netif_start_queue(dev); - return 0; /* Always succeed */ -} - -static int fcc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct fcc_enet_private *cep = (struct fcc_enet_private *)dev->priv; volatile cbd_t *bdp; + if (!cep->link) { + /* Link is down or autonegotiation is in progress. */ + return 1; + } /* Fill in a Tx ring entry */ bdp = cep->cur_tx; @@ -307,24 +369,20 @@ } #endif - /* Clear all of the status flags. - */ + /* Clear all of the status flags. */ bdp->cbd_sc &= ~BD_ENET_TX_STATS; - /* If the frame is short, tell CPM to pad it. - */ + /* If the frame is short, tell CPM to pad it. */ if (skb->len <= ETH_ZLEN) bdp->cbd_sc |= BD_ENET_TX_PAD; else bdp->cbd_sc &= ~BD_ENET_TX_PAD; - /* Set buffer length and buffer pointer. - */ + /* Set buffer length and buffer pointer. */ bdp->cbd_datlen = skb->len; bdp->cbd_bufaddr = __pa(skb->data); - /* Save skb pointer. - */ + /* Save skb pointer. */ cep->tx_skbuff[cep->skb_cur] = skb; cep->stats.tx_bytes += skb->len; @@ -338,14 +396,12 @@ bdp->cbd_sc |= (BD_ENET_TX_READY | BD_ENET_TX_INTR | BD_ENET_TX_LAST | BD_ENET_TX_TC); #if 0 - /* Errata says don't do this. - */ + /* Errata says don't do this. */ cep->fccp->fcc_ftodr = 0x8000; #endif dev->trans_start = jiffies; - /* If this was the last BD in the ring, start at the beginning again. - */ + /* If this was the last BD in the ring, start at the beginning again. */ if (bdp->cbd_sc & BD_ENET_TX_WRAP) bdp = cep->tx_bd_base; else @@ -398,8 +454,7 @@ netif_wake_queue(dev); } -/* The interrupt handler. - */ +/* The interrupt handler. */ static void fcc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) { @@ -469,13 +524,11 @@ if (bdp->cbd_sc & BD_ENET_TX_DEF) cep->stats.collisions++; - /* Free the sk buffer associated with this last transmit. - */ + /* Free the sk buffer associated with this last transmit. */ dev_kfree_skb_irq(cep->tx_skbuff[cep->skb_dirty]); cep->skb_dirty = (cep->skb_dirty + 1) & TX_RING_MOD_MASK; - /* Update pointer to next buffer descriptor to be transmitted. - */ + /* Update pointer to next buffer descriptor to be transmitted. */ if (bdp->cbd_sc & BD_ENET_TX_WRAP) bdp = cep->tx_bd_base; else @@ -510,8 +563,13 @@ * down. We now issue a restart transmit. Since the * errors close the BD and update the pointers, the restart * _should_ pick up without having to reset any of our - * pointers either. + * pointers either. Also, To workaround 8260 device erratum + * CPM37, we must disable and then re-enable the transmitter + * following a Late Collision, Underrun, or Retry Limit error. */ + cep->fccp->fcc_gfmr &= ~FCC_GFMR_ENT; + udelay(10); /* wait a few microseconds just on principle */ + cep->fccp->fcc_gfmr |= FCC_GFMR_ENT; cp = cpmp; cp->cp_cpcr = @@ -564,8 +622,7 @@ printk("CPM ENET: rcv is not first+last\n"); #endif - /* Frame too long or too short. - */ + /* Frame too long or too short. */ if (bdp->cbd_sc & (BD_ENET_RX_LG | BD_ENET_RX_SH)) cep->stats.rx_length_errors++; if (bdp->cbd_sc & BD_ENET_RX_NO) /* Frame alignment */ @@ -574,28 +631,22 @@ cep->stats.rx_crc_errors++; if (bdp->cbd_sc & BD_ENET_RX_OV) /* FIFO overrun */ cep->stats.rx_crc_errors++; - - /* Report late collisions as a frame error. - * On this error, the BD is closed, but we don't know what we - * have in the buffer. So, just drop this frame on the floor. - */ - if (bdp->cbd_sc & BD_ENET_RX_CL) { + if (bdp->cbd_sc & BD_ENET_RX_CL) /* Late Collision */ cep->stats.rx_frame_errors++; - } - else { - /* Process the incoming frame. - */ + if (!(bdp->cbd_sc & + (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO | BD_ENET_RX_CR + | BD_ENET_RX_OV | BD_ENET_RX_CL))) + { + /* Process the incoming frame. */ cep->stats.rx_packets++; - pkt_len = bdp->cbd_datlen; + + /* Remove the FCS from the packet length. */ + pkt_len = bdp->cbd_datlen - 4; cep->stats.rx_bytes += pkt_len; - /* This does 16 byte alignment, much more than we need. - * The packet length includes FCS, but we don't want to - * include that when passing upstream as it messes up - * bridging applications. - */ - skb = dev_alloc_skb(pkt_len-4); + /* This does 16 byte alignment, much more than we need. */ + skb = dev_alloc_skb(pkt_len); if (skb == NULL) { printk("%s: Memory squeeze, dropping packet.\n", dev->name); @@ -603,25 +654,22 @@ } else { skb->dev = dev; - skb_put(skb,pkt_len-4); /* Make room */ + skb_put(skb,pkt_len); /* Make room */ eth_copy_and_sum(skb, (unsigned char *)__va(bdp->cbd_bufaddr), - pkt_len-4, 0); + pkt_len, 0); skb->protocol=eth_type_trans(skb,dev); netif_rx(skb); } } - /* Clear the status flags for this buffer. - */ + /* Clear the status flags for this buffer. */ bdp->cbd_sc &= ~BD_ENET_RX_STATS; - /* Mark the buffer empty. - */ + /* Mark the buffer empty. */ bdp->cbd_sc |= BD_ENET_RX_EMPTY; - /* Update BD pointer to next entry. - */ + /* Update BD pointer to next entry. */ if (bdp->cbd_sc & BD_ENET_RX_WRAP) bdp = cep->rx_bd_base; else @@ -636,8 +684,7 @@ static int fcc_enet_close(struct net_device *dev) { - /* Don't know what to do yet. - */ + /* Don't know what to do yet. */ netif_stop_queue(dev); return 0; @@ -650,340 +697,600 @@ return &cep->stats; } -/* The MII is simulated from the 8xx FEC implementation. The FCC - * is not responsible for the MII control/status interface. +#ifdef CONFIG_USE_MDIO + +/* NOTE: Most of the following comes from the FEC driver for 860. The + * overall structure of MII code has been retained (as it's proved stable + * and well-tested), but actual transfer requests are processed "at once" + * instead of being queued (there's no interrupt-driven MII transfer + * mechanism, one has to toggle the data/clock bits manually). */ -static void -fcc_enet_mii(struct net_device *dev) +static int +mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *)) { - struct fcc_enet_private *fep; - mii_list_t *mip; - uint mii_reg; + struct fcc_enet_private *fep; + int retval, tmp; - fep = (struct fcc_enet_private *)dev->priv; -#if 0 - ep = &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec); - mii_reg = ep->fec_mii_data; -#endif - - if ((mip = mii_head) == NULL) { - printk("MII and no head!\n"); + /* Add PHY address to register command. */ + fep = dev->priv; + regval |= fep->phy_addr << 23; + + retval = 0; + + tmp = mii_send_receive(fep->fip, regval); + if (func) + func(tmp, dev); + + return retval; +} + +static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c) +{ + int k; + + if(!c) return; - } - if (mip->mii_func != NULL) - (*(mip->mii_func))(mii_reg, dev); + for(k = 0; (c+k)->mii_data != mk_mii_end; k++) + mii_queue(dev, (c+k)->mii_data, (c+k)->funct); +} - mii_head = mip->mii_next; - mip->mii_next = mii_free; - mii_free = mip; +static void mii_parse_sr(uint mii_reg, struct net_device *dev) +{ + volatile struct fcc_enet_private *fep = dev->priv; + uint s = fep->phy_status; -#if 0 - if ((mip = mii_head) != NULL) - ep->fec_mii_data = mip->mii_regval; -#endif + s &= ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); + + if (mii_reg & 0x0004) + s |= PHY_STAT_LINK; + if (mii_reg & 0x0010) + s |= PHY_STAT_FAULT; + if (mii_reg & 0x0020) + s |= PHY_STAT_ANC; + + fep->phy_status = s; + fep->link = (s & PHY_STAT_LINK) ? 1 : 0; } -static int -mii_queue(int regval, void (*func)(uint, struct net_device *)) +static void mii_parse_cr(uint mii_reg, struct net_device *dev) { - unsigned long flags; - mii_list_t *mip; - int retval; + volatile struct fcc_enet_private *fep = dev->priv; + uint s = fep->phy_status; - retval = 0; + s &= ~(PHY_CONF_ANE | PHY_CONF_LOOP); - save_flags(flags); - cli(); + if (mii_reg & 0x1000) + s |= PHY_CONF_ANE; + if (mii_reg & 0x4000) + s |= PHY_CONF_LOOP; - if ((mip = mii_free) != NULL) { - mii_free = mip->mii_next; - mip->mii_regval = regval; - mip->mii_func = func; - mip->mii_next = NULL; - if (mii_head) { - mii_tail->mii_next = mip; - mii_tail = mip; - } - else { - mii_head = mii_tail = mip; -#if 0 - (&(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec))->fec_mii_data = regval; -#endif - } - } - else { - retval = 1; - } + fep->phy_status = s; +} - restore_flags(flags); +static void mii_parse_anar(uint mii_reg, struct net_device *dev) +{ + volatile struct fcc_enet_private *fep = dev->priv; + uint s = fep->phy_status; + + s &= ~(PHY_CONF_SPMASK); - return(retval); + if (mii_reg & 0x0020) + s |= PHY_CONF_10HDX; + if (mii_reg & 0x0040) + s |= PHY_CONF_10FDX; + if (mii_reg & 0x0080) + s |= PHY_CONF_100HDX; + if (mii_reg & 0x00100) + s |= PHY_CONF_100FDX; + + fep->phy_status = s; } +/* ------------------------------------------------------------------------- */ +/* The Level one LXT970 is used by many boards */ -static volatile uint full_duplex; +#ifdef CONFIG_FCC_LXT970 -static void -mii_status(uint mii_reg, struct net_device *dev) +#define MII_LXT970_MIRROR 16 /* Mirror register */ +#define MII_LXT970_IER 17 /* Interrupt Enable Register */ +#define MII_LXT970_ISR 18 /* Interrupt Status Register */ +#define MII_LXT970_CONFIG 19 /* Configuration Register */ +#define MII_LXT970_CSR 20 /* Chip Status Register */ + +static void mii_parse_lxt970_csr(uint mii_reg, struct net_device *dev) { - volatile uint prev_duplex; + volatile struct fcc_enet_private *fep = dev->priv; + uint s = fep->phy_status; - if (((mii_reg >> 18) & 0x1f) == 1) { - /* status register. - */ - printk("fec: "); - if (mii_reg & 0x0004) - printk("link up"); - else - printk("link down"); + s &= ~(PHY_STAT_SPMASK); - if (mii_reg & 0x0010) - printk(",remote fault"); - if (mii_reg & 0x0020) - printk(",auto complete"); - printk("\n"); - } - if (((mii_reg >> 18) & 0x1f) == 0x14) { - /* Extended chip status register. - */ - prev_duplex = full_duplex; - printk("fec: "); - if (mii_reg & 0x0800) - printk("100 Mbps"); + if (mii_reg & 0x0800) { + if (mii_reg & 0x1000) + s |= PHY_STAT_100FDX; else - printk("10 Mbps"); + s |= PHY_STAT_100HDX; + } else { + if (mii_reg & 0x1000) + s |= PHY_STAT_10FDX; + else + s |= PHY_STAT_10HDX; + } - if (mii_reg & 0x1000) { - printk(", Full-Duplex\n"); - full_duplex = 1; - } - else { - printk(", Half-Duplex\n"); - full_duplex = 0; - } + fep->phy_status = s; +} + +static phy_info_t phy_info_lxt970 = { + 0x07810000, + "LXT970", + + (const phy_cmd_t []) { /* config */ #if 0 - if (prev_duplex != full_duplex) - restart_fec(dev); -#endif - } - if (((mii_reg >> 18) & 0x1f) == 31) { - /* QS6612 PHY Control/Status. - * OK, now we have it all, so figure out what is going on. +// { mk_mii_write(MII_REG_ANAR, 0x0021), NULL }, + + /* Set default operation of 100-TX....for some reason + * some of these bits are set on power up, which is wrong. */ - prev_duplex = full_duplex; - printk("fec: "); + { mk_mii_write(MII_LXT970_CONFIG, 0), NULL }, +#endif + { mk_mii_read(MII_REG_CR), mii_parse_cr }, + { mk_mii_read(MII_REG_ANAR), mii_parse_anar }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* startup - enable interrupts */ + { mk_mii_write(MII_LXT970_IER, 0x0002), NULL }, + { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */ + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* ack_int */ + /* read SR and ISR to acknowledge */ + + { mk_mii_read(MII_REG_SR), mii_parse_sr }, + { mk_mii_read(MII_LXT970_ISR), NULL }, + + /* find out the current status */ + + { mk_mii_read(MII_LXT970_CSR), mii_parse_lxt970_csr }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* shutdown - disable interrupts */ + { mk_mii_write(MII_LXT970_IER, 0x0000), NULL }, + { mk_mii_end, } + }, +}; - mii_reg = (mii_reg >> 2) & 7; +#endif /* CONFIG_FEC_LXT970 */ - if (mii_reg & 1) - printk("10 Mbps"); - else - printk("100 Mbps"); +/* ------------------------------------------------------------------------- */ +/* The Level one LXT971 is used on some of my custom boards */ - if (mii_reg > 4) { - printk(", Full-Duplex\n"); - full_duplex = 1; - } - else { - printk(", Half-Duplex\n"); - full_duplex = 0; - } +#ifdef CONFIG_FCC_LXT971 -#if 0 - if (prev_duplex != full_duplex) - restart_fec(dev); -#endif +/* register definitions for the 971 */ + +#define MII_LXT971_PCR 16 /* Port Control Register */ +#define MII_LXT971_SR2 17 /* Status Register 2 */ +#define MII_LXT971_IER 18 /* Interrupt Enable Register */ +#define MII_LXT971_ISR 19 /* Interrupt Status Register */ +#define MII_LXT971_LCR 20 /* LED Control Register */ +#define MII_LXT971_TCR 30 /* Transmit Control Register */ + +/* + * I had some nice ideas of running the MDIO faster... + * The 971 should support 8MHz and I tried it, but things acted really + * weird, so 2.5 MHz ought to be enough for anyone... + */ + +static void mii_parse_lxt971_sr2(uint mii_reg, struct net_device *dev) +{ + volatile struct fcc_enet_private *fep = dev->priv; + uint s = fep->phy_status; + + s &= ~(PHY_STAT_SPMASK); + + if (mii_reg & 0x4000) { + if (mii_reg & 0x0200) + s |= PHY_STAT_100FDX; + else + s |= PHY_STAT_100HDX; + } else { + if (mii_reg & 0x0200) + s |= PHY_STAT_10FDX; + else + s |= PHY_STAT_10HDX; } + if (mii_reg & 0x0008) + s |= PHY_STAT_FAULT; + + fep->phy_status = s; } -static uint phyno; +static phy_info_t phy_info_lxt971 = { + 0x0001378e, + "LXT971", + + (const phy_cmd_t []) { /* config */ +// { mk_mii_write(MII_REG_ANAR, 0x021), NULL }, /* 10 Mbps, HD */ + { mk_mii_read(MII_REG_CR), mii_parse_cr }, + { mk_mii_read(MII_REG_ANAR), mii_parse_anar }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* startup - enable interrupts */ + { mk_mii_write(MII_LXT971_IER, 0x00f2), NULL }, + { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */ + + /* Somehow does the 971 tell me that the link is down + * the first read after power-up. + * read here to get a valid value in ack_int */ + + { mk_mii_read(MII_REG_SR), mii_parse_sr }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* ack_int */ + /* find out the current status */ + + { mk_mii_read(MII_REG_SR), mii_parse_sr }, + { mk_mii_read(MII_LXT971_SR2), mii_parse_lxt971_sr2 }, + + /* we only need to read ISR to acknowledge */ + + { mk_mii_read(MII_LXT971_ISR), NULL }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* shutdown - disable interrupts */ + { mk_mii_write(MII_LXT971_IER, 0x0000), NULL }, + { mk_mii_end, } + }, +}; -static void -mii_discover_phy3(uint mii_reg, struct net_device *dev) +#endif /* CONFIG_FEC_LXT970 */ + + +/* ------------------------------------------------------------------------- */ +/* The Quality Semiconductor QS6612 is used on the RPX CLLF */ + +#ifdef CONFIG_FCC_QS6612 + +/* register definitions */ + +#define MII_QS6612_MCR 17 /* Mode Control Register */ +#define MII_QS6612_FTR 27 /* Factory Test Register */ +#define MII_QS6612_MCO 28 /* Misc. Control Register */ +#define MII_QS6612_ISR 29 /* Interrupt Source Register */ +#define MII_QS6612_IMR 30 /* Interrupt Mask Register */ +#define MII_QS6612_PCR 31 /* 100BaseTx PHY Control Reg. */ + +static void mii_parse_qs6612_pcr(uint mii_reg, struct net_device *dev) { - phytype <<= 16; - phytype |= (mii_reg & 0xffff); - printk("fec: Phy @ 0x%x, type 0x%08x\n", phyno, phytype); - mii_startup_cmds(); + volatile struct fcc_enet_private *fep = dev->priv; + uint s = fep->phy_status; + + s &= ~(PHY_STAT_SPMASK); + + switch((mii_reg >> 2) & 7) { + case 1: s |= PHY_STAT_10HDX; break; + case 2: s |= PHY_STAT_100HDX; break; + case 5: s |= PHY_STAT_10FDX; break; + case 6: s |= PHY_STAT_100FDX; break; + } + + fep->phy_status = s; } -static void -mii_discover_phy(uint mii_reg, struct net_device *dev) +static phy_info_t phy_info_qs6612 = { + 0x00181440, + "QS6612", + + (const phy_cmd_t []) { /* config */ +// { mk_mii_write(MII_REG_ANAR, 0x061), NULL }, /* 10 Mbps */ + + /* The PHY powers up isolated on the RPX, + * so send a command to allow operation. + */ + + { mk_mii_write(MII_QS6612_PCR, 0x0dc0), NULL }, + + /* parse cr and anar to get some info */ + + { mk_mii_read(MII_REG_CR), mii_parse_cr }, + { mk_mii_read(MII_REG_ANAR), mii_parse_anar }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* startup - enable interrupts */ + { mk_mii_write(MII_QS6612_IMR, 0x003a), NULL }, + { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */ + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* ack_int */ + + /* we need to read ISR, SR and ANER to acknowledge */ + + { mk_mii_read(MII_QS6612_ISR), NULL }, + { mk_mii_read(MII_REG_SR), mii_parse_sr }, + { mk_mii_read(MII_REG_ANER), NULL }, + + /* read pcr to get info */ + + { mk_mii_read(MII_QS6612_PCR), mii_parse_qs6612_pcr }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* shutdown - disable interrupts */ + { mk_mii_write(MII_QS6612_IMR, 0x0000), NULL }, + { mk_mii_end, } + }, +}; + + +#endif /* CONFIG_FEC_QS6612 */ + + +/* ------------------------------------------------------------------------- */ +/* The Davicom DM9131 is used on the HYMOD board */ + +#ifdef CONFIG_FCC_DM9131 + +/* register definitions */ + +#define MII_DM9131_ACR 16 /* Aux. Config Register */ +#define MII_DM9131_ACSR 17 /* Aux. Config/Status Register */ +#define MII_DM9131_10TCSR 18 /* 10BaseT Config/Status Reg. */ +#define MII_DM9131_INTR 21 /* Interrupt Register */ +#define MII_DM9131_RECR 22 /* Receive Error Counter Reg. */ +#define MII_DM9131_DISCR 23 /* Disconnect Counter Register */ + +static void mii_parse_dm9131_acsr(uint mii_reg, struct net_device *dev) { - if (phyno < 32) { - if ((phytype = (mii_reg & 0xffff)) != 0xffff) { - phyaddr = phyno; - mii_queue(mk_mii_read(3), mii_discover_phy3); - } - else { - phyno++; - mii_queue(mk_mii_phyaddr(phyno), mii_discover_phy); - } - } - else { - printk("FEC: No PHY device found.\n"); + volatile struct fcc_enet_private *fep = dev->priv; + uint s = fep->phy_status; + + s &= ~(PHY_STAT_SPMASK); + + switch ((mii_reg >> 12) & 0xf) { + case 1: s |= PHY_STAT_10HDX; break; + case 2: s |= PHY_STAT_10FDX; break; + case 4: s |= PHY_STAT_100HDX; break; + case 8: s |= PHY_STAT_100FDX; break; } + + fep->phy_status = s; } -static void -mii_discover_phy_poll(fcc_info_t *fip) +static phy_info_t phy_info_dm9131 = { + 0x00181b80, + "DM9131", + + (const phy_cmd_t []) { /* config */ + /* parse cr and anar to get some info */ + { mk_mii_read(MII_REG_CR), mii_parse_cr }, + { mk_mii_read(MII_REG_ANAR), mii_parse_anar }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* startup - enable interrupts */ + { mk_mii_write(MII_DM9131_INTR, 0x0002), NULL }, + { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */ + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* ack_int */ + + /* we need to read INTR, SR and ANER to acknowledge */ + + { mk_mii_read(MII_DM9131_INTR), NULL }, + { mk_mii_read(MII_REG_SR), mii_parse_sr }, + { mk_mii_read(MII_REG_ANER), NULL }, + + /* read acsr to get info */ + + { mk_mii_read(MII_DM9131_ACSR), mii_parse_dm9131_acsr }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* shutdown - disable interrupts */ + { mk_mii_write(MII_DM9131_INTR, 0x0f00), NULL }, + { mk_mii_end, } + }, +}; + + +#endif /* CONFIG_FEC_DM9131 */ + + +static phy_info_t *phy_info[] = { + +#ifdef CONFIG_FCC_LXT970 + &phy_info_lxt970, +#endif /* CONFIG_FEC_LXT970 */ + +#ifdef CONFIG_FCC_LXT971 + &phy_info_lxt971, +#endif /* CONFIG_FEC_LXT971 */ + +#ifdef CONFIG_FCC_QS6612 + &phy_info_qs6612, +#endif /* CONFIG_FEC_QS6612 */ + +#ifdef CONFIG_FCC_DM9131 + &phy_info_dm9131, +#endif /* CONFIG_FEC_DM9131 */ + + NULL +}; + +static void mii_display_status(struct net_device *dev) { - uint rv; - int i; + volatile struct fcc_enet_private *fep = dev->priv; + uint s = fep->phy_status; - for (i=0; i<32; i++) { - rv = mii_send_receive(fip, mk_mii_phyaddr(i)); - if ((phytype = (rv & 0xffff)) != 0xffff) { - phyaddr = i; - rv = mii_send_receive(fip, mk_mii_read(3)); - phytype <<= 16; - phytype |= (rv & 0xffff); - printk("fec: Phy @ 0x%x, type 0x%08x\n", phyaddr, phytype); + if (!fep->link && !fep->old_link) { + /* Link is still down - don't print anything */ + return; + } + + printk("%s: status: ", dev->name); + + if (!fep->link) { + printk("link down"); + } else { + printk("link up"); + + switch(s & PHY_STAT_SPMASK) { + case PHY_STAT_100FDX: printk(", 100 Mbps Full Duplex"); break; + case PHY_STAT_100HDX: printk(", 100 Mbps Half Duplex"); break; + case PHY_STAT_10FDX: printk(", 10 Mbps Full Duplex"); break; + case PHY_STAT_10HDX: printk(", 10 Mbps Half Duplex"); break; + default: + printk(", Unknown speed/duplex"); } + + if (s & PHY_STAT_ANC) + printk(", auto-negotiation complete"); } + + if (s & PHY_STAT_FAULT) + printk(", remote fault"); + + printk(".\n"); } -static void -mii_startup_cmds(void) +static void mii_display_config(struct net_device *dev) { + volatile struct fcc_enet_private *fep = dev->priv; + uint s = fep->phy_status; -#if 1 - /* Level One PHY. - */ + printk("%s: config: auto-negotiation ", dev->name); - /* Read status registers to clear any pending interrupt. - */ - mii_queue(mk_mii_read(1), mii_status); - mii_queue(mk_mii_read(18), mii_status); + if (s & PHY_CONF_ANE) + printk("on"); + else + printk("off"); - /* Read extended chip status register. - */ - mii_queue(mk_mii_read(0x14), mii_status); + if (s & PHY_CONF_100FDX) + printk(", 100FDX"); + if (s & PHY_CONF_100HDX) + printk(", 100HDX"); + if (s & PHY_CONF_10FDX) + printk(", 10FDX"); + if (s & PHY_CONF_10HDX) + printk(", 10HDX"); + if (!(s & PHY_CONF_SPMASK)) + printk(", No speed/duplex selected?"); + + if (s & PHY_CONF_LOOP) + printk(", loopback enabled"); + + printk(".\n"); + + fep->sequence_done = 1; +} + +static void mii_relink(struct net_device *dev) +{ + struct fcc_enet_private *fep = dev->priv; + int duplex; + + fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; + mii_display_status(dev); + fep->old_link = fep->link; + + if (fep->link) { + duplex = 0; + if (fep->phy_status + & (PHY_STAT_100FDX | PHY_STAT_10FDX)) + duplex = 1; + fcc_restart(dev, duplex); + } else { + fcc_stop(dev); + } +} - /* Set default operation of 100-TX....for some reason - * some of these bits are set on power up, which is wrong. - */ - mii_queue(mk_mii_write(0x13, 0), NULL); +static void mii_queue_relink(uint mii_reg, struct net_device *dev) +{ + struct fcc_enet_private *fep = dev->priv; - /* Enable Link status change interrupts. - */ - mii_queue(mk_mii_write(0x11, 0x0002), NULL); + fep->phy_task.routine = (void *)mii_relink; + fep->phy_task.data = dev; + schedule_task(&fep->phy_task); +} - /* Don't advertize Full duplex. - mii_queue(mk_mii_write(0x04, 0x0021), NULL); - */ -#endif +static void mii_queue_config(uint mii_reg, struct net_device *dev) +{ + struct fcc_enet_private *fep = dev->priv; + fep->phy_task.routine = (void *)mii_display_config; + fep->phy_task.data = dev; + schedule_task(&fep->phy_task); } -/* This supports the mii_link interrupt below. - * We should get called three times. Once for register 1, once for - * register 18, and once for register 20. - */ -static uint mii_saved_reg1; + +phy_cmd_t phy_cmd_relink[] = { { mk_mii_read(MII_REG_CR), mii_queue_relink }, + { mk_mii_end, } }; +phy_cmd_t phy_cmd_config[] = { { mk_mii_read(MII_REG_CR), mii_queue_config }, + { mk_mii_end, } }; + + +/* Read remainder of PHY ID. +*/ static void -mii_relink(uint mii_reg, struct net_device *dev) +mii_discover_phy3(uint mii_reg, struct net_device *dev) { - volatile uint prev_duplex; - unsigned long flags; + struct fcc_enet_private *fep; + int i; - if (((mii_reg >> 18) & 0x1f) == 1) { - /* Just save the status register and get out. - */ - mii_saved_reg1 = mii_reg; - return; - } - if (((mii_reg >> 18) & 0x1f) == 18) { - /* Not much here, but has to be read to clear the - * interrupt condition. - */ - if ((mii_reg & 0x8000) == 0) - printk("fec: re-link and no IRQ?\n"); - if ((mii_reg & 0x4000) == 0) - printk("fec: no PHY power?\n"); - } - if (((mii_reg >> 18) & 0x1f) == 20) { - /* Extended chip status register. - * OK, now we have it all, so figure out what is going on. - */ - prev_duplex = full_duplex; - printk("fec: "); - if (mii_saved_reg1 & 0x0004) - printk("link up"); - else - printk("link down"); + fep = dev->priv; + fep->phy_id |= (mii_reg & 0xffff); - if (mii_saved_reg1 & 0x0010) - printk(", remote fault"); - if (mii_saved_reg1 & 0x0020) - printk(", auto complete"); + for(i = 0; phy_info[i]; i++) + if(phy_info[i]->id == (fep->phy_id >> 4)) + break; - if (mii_reg & 0x0800) - printk(", 100 Mbps"); - else - printk(", 10 Mbps"); + if(!phy_info[i]) + panic("%s: PHY id 0x%08x is not supported!\n", + dev->name, fep->phy_id); - if (mii_reg & 0x1000) { - printk(", Full-Duplex\n"); - full_duplex = 1; - } - else { - printk(", Half-Duplex\n"); - full_duplex = 0; - } - if (prev_duplex != full_duplex) { - save_flags(flags); - cli(); -#if 0 - restart_fec(dev); -#endif - restore_flags(flags); - } - } - if (((mii_reg >> 18) & 0x1f) == 31) { - /* QS6612 PHY Control/Status. - * OK, now we have it all, so figure out what is going on. - */ - prev_duplex = full_duplex; - printk("fec: "); - if (mii_saved_reg1 & 0x0004) - printk("link up"); - else - printk("link down"); + fep->phy = phy_info[i]; - if (mii_saved_reg1 & 0x0010) - printk(", remote fault"); - if (mii_saved_reg1 & 0x0020) - printk(", auto complete"); + printk("%s: Phy @ 0x%x, type %s (0x%08x)\n", + dev->name, fep->phy_addr, fep->phy->name, fep->phy_id); +} - mii_reg = (mii_reg >> 2) & 7; +/* Scan all of the MII PHY addresses looking for someone to respond + * with a valid ID. This usually happens quickly. + */ +static void +mii_discover_phy(uint mii_reg, struct net_device *dev) +{ + struct fcc_enet_private *fep; + uint phytype; - if (mii_reg & 1) - printk(", 10 Mbps"); - else - printk(", 100 Mbps"); + fep = dev->priv; - if (mii_reg > 4) { - printk(", Full-Duplex\n"); - full_duplex = 1; - } - else { - printk(", Half-Duplex\n"); - full_duplex = 0; - } + if ((phytype = (mii_reg & 0xfff)) != 0xfff) { -#if 0 - if (prev_duplex != full_duplex) { - save_flags(flags); - cli(); - restart_fec(dev); - restore_flags(flags); + /* Got first part of ID, now get remainder. */ + fep->phy_id = phytype << 16; + mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), mii_discover_phy3); + } else { + fep->phy_addr++; + if (fep->phy_addr < 32) { + mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), + mii_discover_phy); + } else { + printk("fec: No PHY device found.\n"); } -#endif } } +/* This interrupt occurs when the PHY detects a link change. */ +static void +mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) +{ + struct net_device *dev = dev_id; + struct fcc_enet_private *fep = dev->priv; + + mii_do_cmd(dev, fep->phy->ack_int); + mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ +} + +#endif /* CONFIG_USE_MDIO */ + /* Set or clear the multicast filter for this adaptor. * Skeleton taken from sunlance driver. * The CPM Ethernet implementation allows Multicast as well as individual @@ -1062,6 +1369,33 @@ } } + +/* Set the individual MAC address. + */ +int fcc_enet_set_mac_address(struct net_device *dev, void *p) +{ + struct sockaddr *addr= (struct sockaddr *) p; + struct fcc_enet_private *cep; + volatile fcc_enet_t *ep; + unsigned char *eap; + int i; + + cep = (struct fcc_enet_private *)(dev->priv); + ep = cep->ep; + + if (netif_running(dev)) + return -EBUSY; + + memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); + + eap = (unsigned char *) &(ep->fen_paddrh); + for (i=5; i>=0; i--) + *eap++ = addr->sa_data[i]; + + return 0; +} + + /* Initialize the CPM Ethernet on FCC. */ int __init fec_enet_init(void) @@ -1113,19 +1447,22 @@ dev->stop = fcc_enet_close; dev->get_stats = fcc_enet_get_stats; dev->set_multicast_list = set_multicast_list; + dev->set_mac_address = fcc_enet_set_mac_address; init_fcc_startup(fip, dev); - printk("%s: FCC ENET Version 0.2, ", dev->name); + printk("%s: FCC ENET Version 0.3, ", dev->name); for (i=0; i<5; i++) printk("%02x:", dev->dev_addr[i]); printk("%02x\n", dev->dev_addr[5]); - /* This is just a hack for now that works only on the EST - * board, or anything else that has MDIO/CK configured. - * It is mainly to test the MII software clocking. - */ - mii_discover_phy_poll(fip); +#ifdef CONFIG_USE_MDIO + /* Queue up command to detect the PHY and initialize the + * remainder of the interface. + */ + cep->phy_addr = 0; + mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); +#endif /* CONFIG_USE_MDIO */ fip++; } @@ -1200,12 +1537,14 @@ io->iop_pdirc &= ~(fip->fc_trxclocks); io->iop_pparc |= fip->fc_trxclocks; +#ifdef CONFIG_USE_MDIO /* ....and the MII serial clock/data. */ io->iop_pdatc |= (fip->fc_mdio | fip->fc_mdck); - io->iop_podrc |= fip->fc_mdio; + io->iop_podrc &= ~(fip->fc_mdio | fip->fc_mdck); io->iop_pdirc |= (fip->fc_mdio | fip->fc_mdck); io->iop_pparc &= ~(fip->fc_mdio | fip->fc_mdck); +#endif /* CONFIG_USE_MDIO */ /* Configure Serial Interface clock routing. * First, clear all FCC bits to zero, @@ -1325,14 +1664,15 @@ * This is supplied in the board information structure, so we * copy that into the controller. * So, far we have only been given one Ethernet address. We make - * it unique by setting a few bits in the upper byte of the - * non-static part of the address. + * it unique by toggling selected bits in the upper byte of the + * non-static part of the address (for the second and third ports, + * the first port uses the address supplied as is). */ eap = (unsigned char *)&(ep->fen_paddrh); for (i=5; i>=0; i--) { - if (i == 3) { + if (i == 3 && fip->fc_fccnum != 0) { dev->dev_addr[i] = bd->bi_enetaddr[i]; - dev->dev_addr[i] |= (1 << (7 - fip->fc_fccnum)); + dev->dev_addr[i] ^= (1 << (7 - fip->fc_fccnum)); *eap++ = dev->dev_addr[i]; } else { @@ -1446,6 +1786,12 @@ "fenet", dev) < 0) printk("Can't get FCC IRQ %d\n", fip->fc_interrupt); +#ifdef CONFIG_USE_MDIO + if (request_8xxirq(PHY_INTERRUPT, mii_link_interrupt, 0, + "mii", dev) < 0) + printk("Can't get MII IRQ %d\n", fip->fc_interrupt); +#endif /* CONFIG_USE_MDIO */ + /* Set GFMR to enable Ethernet operating mode. */ fccp->fcc_gfmr = (FCC_GFMR_TCI | FCC_GFMR_MODE_ENET); @@ -1460,11 +1806,25 @@ */ fccp->fcc_fpsmr = FCC_PSMR_ENCRC; - /* And last, enable the transmit and receive processing. +#ifdef CONFIG_ADS8260 + /* Enable the PHY. */ - fccp->fcc_gfmr |= (FCC_GFMR_ENR | FCC_GFMR_ENT); + ads_csr_addr[1] |= BCSR1_FETH_RST; /* Remove reset */ + ads_csr_addr[1] &= ~BCSR1_FETHIEN; /* Enable */ +#endif + +#if defined(CONFIG_USE_MDIO) || defined(CONFIG_TQM8260) + /* start in full duplex mode, and negotiate speed + */ + fcc_restart (dev, 1); +#else + /* start in half duplex mode + */ + fcc_restart (dev, 0); +#endif } +#ifdef CONFIG_USE_MDIO /* MII command/status interface. * I'm not going to describe all of the details. You can find the * protocol definition in many other places, including the data sheet @@ -1472,136 +1832,153 @@ * I wonder what "they" were thinking (maybe weren't) when they leave * the I2C in the CPM but I have to toggle these bits...... */ + +#define FCC_PDATC_MDIO(bit) \ + if (bit) \ + io->iop_pdatc |= fip->fc_mdio; \ + else \ + io->iop_pdatc &= ~fip->fc_mdio; + +#define FCC_PDATC_MDC(bit) \ + if (bit) \ + io->iop_pdatc |= fip->fc_mdck; \ + else \ + io->iop_pdatc &= ~fip->fc_mdck; + static uint mii_send_receive(fcc_info_t *fip, uint cmd) { - unsigned long flags; uint retval; - int read_op, i; + int read_op, i, off; volatile immap_t *immap; volatile iop8260_t *io; immap = (immap_t *)IMAP_ADDR; io = &immap->im_ioport; - /* When we get here, both clock and data are high, outputs. - * Output is open drain. - * Data transitions on high->low clock, is valid on low->high clock. - * Spec says edge transitions no closer than 160 nSec, minimum clock - * cycle 400 nSec. I could only manage about 500 nSec edges with - * an XOR loop, so I won't worry about delays yet. - * I disable interrupts during bit flipping to ensure atomic - * updates of the registers. I do lots of interrupt disable/enable - * to ensure we don't hang out too long with interrupts disabled. - */ - - /* First, crank out 32 1-bits as preamble. - * This is 64 transitions to clock the bits, with clock/data - * left high. - */ - save_flags(flags); - cli(); - for (i=0; i<64; i++) { - io->iop_pdatc ^= fip->fc_mdck; - udelay(0); - } - restore_flags(flags); + io->iop_pdirc |= (fip->fc_mdio | fip->fc_mdck); read_op = ((cmd & 0xf0000000) == 0x60000000); - /* We return the command word on a write op, or the command portion - * plus the new data on a read op. This is what the 8xx FEC does, - * and it allows the functions to simply look at the returned value - * and know the PHY/register as well. + /* Write preamble */ - if (read_op) - retval = cmd; - else - retval = (cmd >> 16); - - /* Clock out the first 16 MS bits of the command. - */ - save_flags(flags); - cli(); - for (i=0; i<16; i++) { - io->iop_pdatc &= ~(fip->fc_mdck); - if (cmd & 0x80000000) - io->iop_pdatc |= fip->fc_mdio; - else - io->iop_pdatc &= ~(fip->fc_mdio); - cmd <<= 1; - io->iop_pdatc |= fip->fc_mdck; - udelay(0); + for (i = 0; i < 32; i++) + { + FCC_PDATC_MDC(0); + FCC_PDATC_MDIO(1); + udelay(1); + FCC_PDATC_MDC(1); + udelay(1); } - /* Do the turn-around. If read op, we make the IO and input. - * If write op, do the 1/0 thing. + /* Write data */ - io->iop_pdatc &= ~(fip->fc_mdck); + for (i = 0, off = 31; i < (read_op ? 14 : 32); i++, --off) + { + FCC_PDATC_MDC(0); + FCC_PDATC_MDIO((cmd >> off) & 0x00000001); + udelay(1); + FCC_PDATC_MDC(1); + udelay(1); + } + + retval = cmd; + if (read_op) - io->iop_pdirc &= ~(fip->fc_mdio); - else - io->iop_pdatc |= fip->fc_mdio; - io->iop_pdatc |= fip->fc_mdck; + { + retval >>= 16; - /* I do this mainly to get just a little delay. - */ - restore_flags(flags); - save_flags(flags); - cli(); - io->iop_pdatc &= ~(fip->fc_mdck); - io->iop_pdirc &= ~(fip->fc_mdio); - io->iop_pdatc |= fip->fc_mdck; - - restore_flags(flags); - save_flags(flags); - cli(); - - /* For read, clock in 16 bits. For write, clock out - * rest of command. - */ - if (read_op) { - io->iop_pdatc &= ~(fip->fc_mdck); - udelay(0); - for (i=0; i<16; i++) { - io->iop_pdatc |= fip->fc_mdck; - udelay(0); + FCC_PDATC_MDC(0); + io->iop_pdirc &= ~fip->fc_mdio; + udelay(1); + FCC_PDATC_MDC(1); + udelay(1); + FCC_PDATC_MDC(0); + udelay(1); + + for (i = 0, off = 15; i < 16; i++, off--) + { + FCC_PDATC_MDC(1); retval <<= 1; if (io->iop_pdatc & fip->fc_mdio) - retval |= 1; - io->iop_pdatc &= ~(fip->fc_mdck); - udelay(0); + retval++; + udelay(1); + FCC_PDATC_MDC(0); + udelay(1); } } - else { - for (i=0; i<16; i++) { - io->iop_pdatc &= ~(fip->fc_mdck); - if (cmd & 0x80000000) - io->iop_pdatc |= fip->fc_mdio; - else - io->iop_pdatc &= ~(fip->fc_mdio); - cmd <<= 1; - io->iop_pdatc |= fip->fc_mdck; - udelay(0); - } - io->iop_pdatc &= ~(fip->fc_mdck); + + io->iop_pdirc |= (fip->fc_mdio | fip->fc_mdck); + + for (i = 0; i < 32; i++) + { + FCC_PDATC_MDC(0); + FCC_PDATC_MDIO(1); + udelay(1); + FCC_PDATC_MDC(1); + udelay(1); } - restore_flags(flags); - /* Some diagrams show two 1 bits for "idle". I don't know if - * this is really necessary or if it was just to indicate nothing - * is going to happen for a while. - * Make the data pin an output, set the data high, and clock it. - */ - save_flags(flags); - cli(); - io->iop_pdatc |= fip->fc_mdio; - io->iop_pdirc |= fip->fc_mdio; - for (i=0; i<3; i++) - io->iop_pdatc ^= fip->fc_mdck; - restore_flags(flags); + return retval; +} - /* We exit with the same conditions as entry. - */ - return(retval); +static void +fcc_stop(struct net_device *dev) +{ + volatile fcc_t *fccp; + struct fcc_enet_private *fcp; + + fcp = (struct fcc_enet_private *)(dev->priv); + fccp = fcp->fccp; + + /* Disable transmit/receive */ + fccp->fcc_gfmr &= ~(FCC_GFMR_ENR | FCC_GFMR_ENT); +} +#endif /* CONFIG_USE_MDIO */ + +static void +fcc_restart(struct net_device *dev, int duplex) +{ + volatile fcc_t *fccp; + struct fcc_enet_private *fcp; + + fcp = (struct fcc_enet_private *)(dev->priv); + fccp = fcp->fccp; + + if (duplex) + fccp->fcc_fpsmr |= FCC_PSMR_FDE; + else + fccp->fcc_fpsmr &= ~FCC_PSMR_FDE; + + /* Enable transmit/receive */ + fccp->fcc_gfmr |= FCC_GFMR_ENR | FCC_GFMR_ENT; } + +static int +fcc_enet_open(struct net_device *dev) +{ + struct fcc_enet_private *fep = dev->priv; + +#ifdef CONFIG_USE_MDIO + fep->sequence_done = 0; + fep->link = 0; + + if (fep->phy) { + mii_do_cmd(dev, fep->phy->ack_int); + mii_do_cmd(dev, fep->phy->config); + mii_do_cmd(dev, phy_cmd_config); /* display configuration */ + while(!fep->sequence_done) + schedule(); + + mii_do_cmd(dev, fep->phy->startup); + netif_start_queue(dev); + return 0; /* Success */ + } + return -ENODEV; /* No PHY we understand */ +#else + fep->link = 1; + netif_start_queue(dev); + return 0; /* Always succeed */ +#endif /* CONFIG_USE_MDIO */ +} + diff -uNr linux-2.4.19/arch/ppc/8260_io/uart.c linux-2.4.19bgl/arch/ppc/8260_io/uart.c --- linux-2.4.19/arch/ppc/8260_io/uart.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/8260_io/uart.c 2003-07-02 10:43:58.000000000 -0500 @@ -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.19 04/05/02 11:46:45 trini */ /* * UART driver for MPC8260 CPM SCC or SMC @@ -53,12 +53,21 @@ #ifdef CONFIG_SERIAL_CONSOLE #include +/* SCC Console configuration. Not quite finished. The SCC_CONSOLE + * should be the number of the SCC to use, but only SCC1 will + * work at this time. + */ +#ifdef CONFIG_SCC_CONSOLE +#define SCC_CONSOLE 1 +#endif + /* this defines the index into rs_table for the port to use */ #ifndef CONFIG_SERIAL_CONSOLE_PORT #define CONFIG_SERIAL_CONSOLE_PORT 0 #endif #endif +#define CONFIG_SERIAL_CONSOLE_PORT 0 #define TX_WAKEUP ASYNC_SHARE_IRQ @@ -105,6 +114,18 @@ */ #define smc_scc_num hub6 +/* The choice of serial port to use for KGDB. If the system has + * two ports, you can use one for console and one for KGDB (which + * doesn't make sense to me, but people asked for it). + */ +#ifdef CONFIG_KGDB_TTYS1 +#define KGDB_SER_IDX 1 /* SCC2/SMC2 */ +#else +#define KGDB_SER_IDX 0 /* SCC1/SMC1 */ +#endif + +#ifndef SCC_CONSOLE + /* SMC2 is sometimes used for low performance TDM interfaces. Define * this as 1 if you want SMC2 as a serial port UART managed by this driver. * Define this as 0 if you wish to use SMC2 for something else. @@ -129,10 +150,26 @@ #if USE_SMC2 { 0, 0, PROFF_SMC2, SIU_INT_SMC2, 0, 1 }, /* SMC2 ttyS1 */ #endif - { 0, 0, PROFF_SCC2, SIU_INT_SCC2, 0, SCC_NUM_BASE}, /* SCC2 ttyS2 */ - { 0, 0, PROFF_SCC3, SIU_INT_SCC3, 0, SCC_NUM_BASE + 1}, /* SCC3 ttyS3 */ +#ifndef CONFIG_SCC1_ENET + { 0, 0, PROFF_SCC1, SIU_INT_SCC1, 0, SCC_NUM_BASE}, /* SCC1 ttyS2 */ +#endif +#ifndef CONFIG_SCC2_ENET + { 0, 0, PROFF_SCC2, SIU_INT_SCC2, 0, SCC_NUM_BASE + 1}, /* SCC2 ttyS3 */ +#endif }; +#else /* SCC_CONSOLE */ +#define SCC_NUM_BASE 0 /* SCC base tty "number" */ +#define SCC_IDX_BASE 0 /* table index */ +static struct serial_state rs_table[] = { + /* UART CLK PORT IRQ FLAGS NUM */ + { 0, 0, PROFF_SCC1, SIU_INT_SCC1, 0, SCC_NUM_BASE}, /* SCC1 ttyS2 */ + { 0, 0, PROFF_SCC2, SIU_INT_SCC2, 0, SCC_NUM_BASE + 1}, /* SCC2 ttyS3 */ +}; +#endif /* SCC_CONSOLE */ + +#define PORT_NUM(P) (((P) < (SCC_NUM_BASE)) ? (P) : (P)-(SCC_NUM_BASE)) + #define NR_PORTS (sizeof(rs_table)/sizeof(struct serial_state)) static struct tty_struct *serial_table[NR_PORTS]; @@ -349,6 +386,13 @@ i = bdp->cbd_datlen; cp = (unsigned char *)__va(bdp->cbd_bufaddr); status = bdp->cbd_sc; +#ifdef CONFIG_KGDB + if (info->state->smc_scc_num == KGDB_SER_IDX) { + if (*cp == 0x03 || *cp == '$') + breakpoint(); + return; + } +#endif /* Check to see if there is room in the tty buffer for * the characters in our BD buffer. If not, we exit @@ -775,7 +819,10 @@ else { sccp = &immr->im_scc[idx - SCC_IDX_BASE]; sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX); - sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT); +#ifdef CONFIG_SERIAL_CONSOLE + if (idx != CONFIG_SERIAL_CONSOLE_PORT) + sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT); +#endif } if (info->tty) @@ -2006,7 +2053,7 @@ ret = sprintf(buf, "%d: uart:%s port:%X irq:%d", state->line, (state->smc_scc_num < SCC_NUM_BASE) ? "SMC" : "SCC", - state->port, state->irq); + (unsigned int)(state->port), state->irq); if (!state->port || (state->type == PORT_UNKNOWN)) { ret += sprintf(buf+ret, "\n"); @@ -2129,8 +2176,11 @@ /* * Print a string to the serial port trying not to disturb any possible * real use of the port... + * These funcitons work equally well for SCC, even though they are + * designed for SMC. Our only interests are the transmit/receive + * buffers, which are identically mapped for either the SCC or SMC. */ -static void serial_console_write(struct console *c, const char *s, +static void my_console_write(int idx, const char *s, unsigned count) { struct serial_state *ser; @@ -2140,7 +2190,7 @@ volatile smc_uart_t *up; volatile u_char *cp; - ser = rs_table + c->index; + ser = rs_table + idx; /* If the port has been initialized for general use, we have * to use the buffer descriptors allocated there. Otherwise, @@ -2177,8 +2227,15 @@ * that, not that it is ready for us to send. */ while (bdp->cbd_sc & BD_SC_READY); - /* Send the character out. */ - cp = __va(bdp->cbd_bufaddr); + + /* Send the character out. + * If the buffer address is in the CPM DPRAM, don't + * convert it. + */ + if ((uint)(bdp->cbd_bufaddr) > (uint)IMAP_ADDR) + cp = (u_char *)(bdp->cbd_bufaddr); + else + cp = __va(bdp->cbd_bufaddr); *cp = *s; bdp->cbd_datlen = 1; @@ -2216,9 +2273,196 @@ info->tx_cur = (cbd_t *)bdp; } +static void serial_console_write(struct console *c, const char *s, + unsigned count) +{ +#if defined(CONFIG_KGDB) && !defined(CONFIG_USE_SERIAL2_KGDB) + /* Try to let stub handle output. Returns true if it did. */ + if (kgdb_output_string(s, count)) + return; +#endif + my_console_write(c->index, s, count); +} + +#ifdef CONFIG_XMON +int +xmon_8xx_write(const char *s, unsigned count) +{ + my_console_write(KGDB_SER_IDX, s, count); + return(count); +} +#endif + +#ifdef CONFIG_KGDB +void +putDebugChar(char ch) +{ + my_console_write(KGDB_SER_IDX, &ch, 1); +} +#endif + +#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) +/* + * Receive character from the serial port. This only works well + * before the port is initialize for real use. + */ +static int my_console_wait_key(int idx, int xmon, char *obuf) +{ + struct serial_state *ser; + u_char c, *cp; + ser_info_t *info; + volatile cbd_t *bdp; + volatile smc_uart_t *up; + int i; + + ser = rs_table + idx; + + /* Pointer to UART in parameter ram. + */ + up = (smc_uart_t *)&immr->im_dprambase[ser->port]; + + /* Get the address of the host memory buffer. + * If the port has been initialized for general use, we must + * use information from the port structure. + */ + if ((info = (ser_info_t *)ser->info)) + bdp = info->rx_cur; + else + bdp = (cbd_t *)&immr->im_dprambase[up->smc_rbase]; + + /* + * We need to gracefully shut down the receiver, disable + * interrupts, then read the input. + * XMON just wants a poll. If no character, return -1, else + * return the character. + */ + if (!xmon) { + while (bdp->cbd_sc & BD_SC_EMPTY); + } + else { + if (bdp->cbd_sc & BD_SC_EMPTY) + return -1; + } + + /* If the buffer address is in the CPM DPRAM, don't + * convert it. + */ + if ((uint)(bdp->cbd_bufaddr) > (uint)IMAP_ADDR) + cp = (u_char *)(bdp->cbd_bufaddr); + else + cp = __va(bdp->cbd_bufaddr); + + if (obuf) { + i = c = bdp->cbd_datlen; + while (i-- > 0) + *obuf++ = *cp++; + } + else { + c = *cp; + } + bdp->cbd_sc |= BD_SC_EMPTY; + + if (info) { + if (bdp->cbd_sc & BD_SC_WRAP) { + bdp = info->rx_bd_base; + } + else { + bdp++; + } + info->rx_cur = (cbd_t *)bdp; + } + + return((int)c); +} +#endif + +#ifdef CONFIG_XMON +int +xmon_8xx_read_poll(void) +{ + return(my_console_wait_key(KGDB_SER_IDX, 1, NULL)); +} + +int +xmon_8xx_read_char(void) +{ + return(my_console_wait_key(KGDB_SER_IDX, 0, NULL)); +} +#endif + +#ifdef CONFIG_KGDB +static char kgdb_buf[RX_BUF_SIZE], *kgdp; +static int kgdb_chars; + +char +getDebugChar(void) +{ + if (kgdb_chars <= 0) { + kgdb_chars = my_console_wait_key(KGDB_SER_IDX, 0, kgdb_buf); + kgdp = kgdb_buf; + } + kgdb_chars--; + + return(*kgdp++); +} + +void kgdb_interruptible(int yes) +{ + volatile smc_t *smcp; + + smcp = &immr->im_smc[KGDB_SER_IDX]; + + if (yes == 1) + smcp->smc_smcm |= SMCM_RX; + else + smcp->smc_smcm &= ~SMCM_RX; +} + +void kgdb_map_scc(void) +{ + ushort serbase; + uint mem_addr; + volatile cbd_t *bdp; + volatile smc_uart_t *up; + + /* The serial port has already been initialized before + * we get here. We have to assign some pointers needed by + * the kernel, and grab a memory location in the CPM that will + * work until the driver is really initialized. + */ + immr = (immap_t *)IMAP_ADDR; + + /* Right now, assume we are using SMCs. + */ +#ifdef USE_KGDB_SMC2 + *(ushort *)(&immr->im_dprambase[PROFF_SMC2_BASE]) = serbase = PROFF_SMC2; +#else + *(ushort *)(&immr->im_dprambase[PROFF_SMC1_BASE]) = serbase = PROFF_SMC1; +#endif + up = (smc_uart_t *)&immr->im_dprambase[serbase]; + + /* Allocate space for an input FIFO, plus a few bytes for output. + * Allocate bytes to maintain word alignment. + */ + mem_addr = (uint)(&immr->im_dprambase[0x1000]); + + /* Set the physical address of the host memory buffers in + * the buffer descriptors. + */ + bdp = (cbd_t *)&immr->im_dprambase[up->smc_rbase]; + bdp->cbd_bufaddr = mem_addr; + + bdp = (cbd_t *)&immr->im_dprambase[up->smc_tbase]; + bdp->cbd_bufaddr = mem_addr+RX_BUF_SIZE; + + up->smc_mrblr = RX_BUF_SIZE; /* receive buffer length */ + up->smc_maxidl = RX_BUF_SIZE; +} +#endif + static kdev_t serial_console_device(struct console *c) { - return MKDEV(TTYAUX_MAJOR, 64 + c->index); + return MKDEV(TTY_MAJOR, 64 + c->index); } @@ -2348,6 +2592,7 @@ * Configure SMCs Tx/Rx. SMC1 is only on Port D, SMC2 is * only on Port A. You either pick 'em, or not. */ +#ifndef SCC_CONSOLE io->iop_ppard |= 0x00c00000; io->iop_pdird |= 0x00400000; io->iop_pdird &= ~0x00800000; @@ -2383,6 +2628,27 @@ */ immap->im_cpmux.cmx_scr &= ~0x00ffff00; immap->im_cpmux.cmx_scr |= 0x00121b00; +#else + io->iop_pparb |= 0x008b0000; + io->iop_pdirb |= 0x00880000; + io->iop_psorb |= 0x00880000; + io->iop_pdirb &= ~0x00030000; + io->iop_psorb &= ~0x00030000; + + /* Use Port D for SCC1 instead of other functions. + */ + io->iop_ppard |= 0x00000003; + io->iop_psord &= ~0x00000001; /* Rx */ + io->iop_psord |= 0x00000002; /* Tx */ + io->iop_pdird &= ~0x00000001; /* Rx */ + io->iop_pdird |= 0x00000002; /* Tx */ + + /* Connect SCC1, SCC2, SCC3 to NMSI. Connect BRG1 to SCC1, + * BRG2 to SCC2, BRG3 to SCC3. + */ + immap->im_cpmux.cmx_scr &= ~0xffffff00; + immap->im_cpmux.cmx_scr |= 0x00091200; +#endif for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { state->magic = SSTATE_MAGIC; @@ -2398,9 +2664,12 @@ state->icount.rx = state->icount.tx = 0; state->icount.frame = state->icount.parity = 0; state->icount.overrun = state->icount.brk = 0; - printk(KERN_INFO "ttyS%02d at 0x%04x is a %s\n", - i, state->port, - (state->smc_scc_num < SCC_NUM_BASE) ? "SMC" : "SCC"); + printk (KERN_INFO "ttyS%d on %s%d at 0x%04x, BRG%d\n", + i, + (state->smc_scc_num < SCC_NUM_BASE) ? "SMC" : "SCC", + PORT_NUM(state->smc_scc_num) + 1, + (unsigned int)(state->port), + state->smc_scc_num + 1); #ifdef CONFIG_SERIAL_CONSOLE /* If we just printed the message on the console port, and * we are about to initialize it for general use, we have @@ -2408,7 +2677,7 @@ * make it out of the transmit buffer. */ if (i == CONFIG_SERIAL_CONSOLE_PORT) - mdelay(2); + mdelay(300); #endif info = kmalloc(sizeof(ser_info_t), GFP_KERNEL); if (info) { @@ -2460,6 +2729,7 @@ else { scp = &immap->im_scc[idx - SCC_IDX_BASE]; sup = (scc_uart_t *)&immap->im_dprambase[state->port]; + scp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT); sup->scc_genscc.scc_rbase = dp_addr; } @@ -2563,6 +2833,22 @@ /* Send the CPM an initialize command. */ +#ifdef SCC_CONSOLE + switch (state->smc_scc_num) { + case 0: + page = CPM_CR_SCC1_PAGE; + sblock = CPM_CR_SCC1_SBLOCK; + break; + case 1: + page = CPM_CR_SCC2_PAGE; + sblock = CPM_CR_SCC2_SBLOCK; + break; + case 2: + page = CPM_CR_SCC3_PAGE; + sblock = CPM_CR_SCC3_SBLOCK; + break; + } +#else if (state->smc_scc_num == 2) { page = CPM_CR_SCC2_PAGE; sblock = CPM_CR_SCC2_SBLOCK; @@ -2571,6 +2857,7 @@ page = CPM_CR_SCC3_PAGE; sblock = CPM_CR_SCC3_SBLOCK; } +#endif cp->cp_cpcr = mk_cr_cmd(page, sblock, 0, CPM_CR_INIT_TRX) | CPM_CR_FLG; @@ -2604,8 +2891,12 @@ /* If the port is the console, enable Rx and Tx. */ #ifdef CONFIG_SERIAL_CONSOLE - if (i == CONFIG_SERIAL_CONSOLE_PORT) - sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN; + if (i == CONFIG_SERIAL_CONSOLE_PORT) { + if (idx < SCC_NUM_BASE) + sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN; + else + scp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT); + } #endif } } @@ -2622,8 +2913,12 @@ volatile cbd_t *bdp; volatile cpm8260_t *cp; volatile immap_t *immap; +#ifndef SCC_CONSOLE volatile smc_t *sp; volatile smc_uart_t *up; +#endif + volatile scc_t *scp; + volatile scc_uart_t *sup; volatile iop8260_t *io; bd_t *bd; @@ -2638,11 +2933,25 @@ ser = rs_table + co->index; - immap = immr; cp = &immap->im_cpm; io = &immap->im_ioport; +#ifdef SCC_CONSOLE + scp = (scc_t *)&(immap->im_scc[SCC_CONSOLE-1]); + sup = (scc_uart_t *)&immap->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)]; + scp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX); + scp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT); + + /* Use Port D for SCC1 instead of other functions. + */ + io->iop_ppard |= 0x00000003; + io->iop_psord &= ~0x00000001; /* Rx */ + io->iop_psord |= 0x00000002; /* Tx */ + io->iop_pdird &= ~0x00000001; /* Rx */ + io->iop_pdird |= 0x00000002; /* Tx */ + +#else /* This should have been done long ago by the early boot code, * but do it again to make sure. */ @@ -2670,6 +2979,7 @@ io->iop_pdird |= 0x00400000; io->iop_pdird &= ~0x00800000; io->iop_psord &= ~0x00c00000; +#endif /* Allocate space for two buffer descriptors in the DP ram. */ @@ -2694,6 +3004,68 @@ /* Set up the uart parameters in the parameter ram. */ +#ifdef SCC_CONSOLE + sup->scc_genscc.scc_rbase = dp_addr; + sup->scc_genscc.scc_tbase = dp_addr + sizeof(cbd_t); + + /* Set up the uart parameters in the + * parameter ram. + */ + sup->scc_genscc.scc_rfcr = CPMFCR_GBL | CPMFCR_EB; + sup->scc_genscc.scc_tfcr = CPMFCR_GBL | CPMFCR_EB; + + sup->scc_genscc.scc_mrblr = 1; + sup->scc_maxidl = 0; + sup->scc_brkcr = 1; + sup->scc_parec = 0; + sup->scc_frmec = 0; + sup->scc_nosec = 0; + sup->scc_brkec = 0; + sup->scc_uaddr1 = 0; + sup->scc_uaddr2 = 0; + sup->scc_toseq = 0; + sup->scc_char1 = 0x8000; + sup->scc_char2 = 0x8000; + sup->scc_char3 = 0x8000; + sup->scc_char4 = 0x8000; + sup->scc_char5 = 0x8000; + sup->scc_char6 = 0x8000; + sup->scc_char7 = 0x8000; + sup->scc_char8 = 0x8000; + sup->scc_rccm = 0xc0ff; + + /* Send the CPM an initialize command. + */ + cp->cp_cpcr = mk_cr_cmd(CPM_CR_SCC1_PAGE, CPM_CR_SCC1_SBLOCK, 0, + CPM_CR_INIT_TRX) | CPM_CR_FLG; + while (cp->cp_cpcr & CPM_CR_FLG); + + /* Set UART mode, 8 bit, no parity, one stop. + * Enable receive and transmit. + */ + scp->scc_gsmrh = 0; + scp->scc_gsmrl = + (SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16); + + /* Disable all interrupts and clear all pending + * events. + */ + scp->scc_sccm = 0; + scp->scc_scce = 0xffff; + scp->scc_dsr = 0x7e7e; + scp->scc_pmsr = 0x3000; + + /* Wire BRG1 to SCC1. The serial init will take care of + * others. + */ + immap->im_cpmux.cmx_scr = 0; + + /* Set up the baud rate generator. + */ + m8260_cpm_setbrg(ser->smc_scc_num, bd->bi_baudrate); + + scp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT); +#else up->smc_rbase = dp_addr; /* Base of receive buffer desc. */ up->smc_tbase = dp_addr+sizeof(cbd_t); /* Base of xmt buffer desc. */ up->smc_rfcr = CPMFCR_GBL | CPMFCR_EB; @@ -2722,6 +3094,7 @@ /* And finally, enable Rx and Tx. */ sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN; +#endif return 0; } diff -uNr linux-2.4.19/arch/ppc/8xx_io/Config.in linux-2.4.19bgl/arch/ppc/8xx_io/Config.in --- linux-2.4.19/arch/ppc/8xx_io/Config.in 2001-10-15 15:35:26.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/8xx_io/Config.in 2003-07-02 10:44:11.000000000 -0500 @@ -25,6 +25,10 @@ fi bool 'Enable SCC2 and SCC3 for UART' CONFIG_USE_SCC_IO +if [ "$CONFIG_SOUND" = "y" ]; then + bool 'Embedded Planet HIOX Audio' CONFIG_HTDMSOUND +fi + # This doesn't really belong here, but it is convenient to ask # 8xx specific questions. diff -uNr linux-2.4.19/arch/ppc/8xx_io/Makefile linux-2.4.19bgl/arch/ppc/8xx_io/Makefile --- linux-2.4.19/arch/ppc/8xx_io/Makefile 2001-09-08 14:39:33.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/8xx_io/Makefile 2003-07-02 10:43:28.000000000 -0500 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.6 08/30/01 09:33:48 trini +# BK Id: SCCS/s.Makefile 1.8 01/20/02 04:14:35 dan # # # Makefile for the linux MPC8xx ppc-specific parts of comm processor @@ -16,5 +16,6 @@ obj-$(CONFIG_FEC_ENET) += fec.o obj-$(CONFIG_SCC_ENET) += enet.o obj-$(CONFIG_UCODE_PATCH) += micropatch.o +obj-$(CONFIG_HTDMSOUND) += cs4218_tdm.o include $(TOPDIR)/Rules.make diff -uNr linux-2.4.19/arch/ppc/8xx_io/commproc.c linux-2.4.19bgl/arch/ppc/8xx_io/commproc.c --- linux-2.4.19/arch/ppc/8xx_io/commproc.c 2001-11-02 19:43:54.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/8xx_io/commproc.c 2003-07-02 10:43:32.000000000 -0500 @@ -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.19 01/19/02 03:07:14 dan */ /* @@ -55,7 +55,63 @@ static struct cpm_action cpm_vecs[CPMVEC_NR]; static void cpm_interrupt(int irq, void * dev, struct pt_regs * regs); static void cpm_error_interrupt(void *, struct pt_regs * regs); +static void alloc_host_memory(void); +#if 1 +void +m8xx_cpm_reset() +{ + volatile immap_t *imp; + volatile cpm8xx_t *commproc; + pte_t *pte; + + imp = (immap_t *)IMAP_ADDR; + commproc = (cpm8xx_t *)&imp->im_cpm; + +#ifdef CONFIG_UCODE_PATCH + /* Perform a reset. + */ + commproc->cp_cpcr = (CPM_CR_RST | CPM_CR_FLG); + + /* Wait for it. + */ + while (commproc->cp_cpcr & CPM_CR_FLG); + + cpm_load_patch(imp); +#endif + + /* Set SDMA Bus Request priority 5. + * On 860T, this also enables FEC priority 6. I am not sure + * this is what we realy want for some applications, but the + * manual recommends it. + * Bit 25, FAM can also be set to use FEC aggressive mode (860T). + */ + imp->im_siu_conf.sc_sdcr = 1; + + /* Reclaim the DP memory for our use. + */ + dp_alloc_base = CPM_DATAONLY_BASE; + dp_alloc_top = dp_alloc_base + CPM_DATAONLY_SIZE; + + /* Tell everyone where the comm processor resides. + */ + cpmp = (cpm8xx_t *)commproc; +} + +/* We used to do this earlier, but have to postpone as long as possible + * to ensure the kernel VM is now running. + */ +static void +alloc_host_memory() +{ + uint physaddr; + + /* Set the host page for allocation. + */ + host_buffer = (uint)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &physaddr); + host_end = host_buffer + PAGE_SIZE; +} +#else void m8xx_cpm_reset(uint host_page_addr) { @@ -111,6 +167,7 @@ */ cpmp = (cpm8xx_t *)commproc; } +#endif /* This is called during init_IRQ. We used to do it above, but this * was too early since init_IRQ was not yet called. @@ -222,6 +279,12 @@ return(retloc); } +uint +m8xx_cpm_dpalloc_index(void) +{ + return dp_alloc_base; +} + /* We also own one page of host buffer space for the allocation of * UART "fifos" and the like. */ @@ -230,6 +293,11 @@ { uint retloc; +#if 1 + if (host_buffer == 0) + alloc_host_memory(); +#endif + if ((host_buffer + size) >= host_end) return(0); diff -uNr linux-2.4.19/arch/ppc/8xx_io/enet.c linux-2.4.19bgl/arch/ppc/8xx_io/enet.c --- linux-2.4.19/arch/ppc/8xx_io/enet.c 2001-10-17 16:37:01.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/8xx_io/enet.c 2003-07-02 10:43:47.000000000 -0500 @@ -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.24 01/19/02 03:07:14 dan */ /* * Ethernet driver for Motorola MPC8xx. @@ -139,6 +139,11 @@ cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ cbd_t *dirty_tx; /* The ring entries to be free()ed. */ scc_t *sccp; + + /* Virtual addresses for the receive buffers because we can't + * do a __va() on them anymore. + */ + unsigned char *rx_vaddr[RX_RING_SIZE]; struct net_device_stats stats; uint tx_full; spinlock_t lock; @@ -507,7 +512,7 @@ skb->dev = dev; skb_put(skb,pkt_len-4); /* Make room */ eth_copy_and_sum(skb, - (unsigned char *)__va(bdp->cbd_bufaddr), + cep->rx_vaddr[bdp - cep->rx_bd_base], pkt_len-4, 0); skb->protocol=eth_type_trans(skb,dev); netif_rx(skb); @@ -641,10 +646,9 @@ { struct net_device *dev; struct scc_enet_private *cep; - int i, j; - unsigned char *eap; - unsigned long mem_addr; - pte_t *pte; + int i, j, k; + unsigned char *eap, *ba; + dma_addr_t mem_addr; bd_t *bd; volatile cbd_t *bdp; volatile cpm8xx_t *cp; @@ -834,24 +838,21 @@ bdp->cbd_sc |= BD_SC_WRAP; bdp = cep->rx_bd_base; + k = 0; for (i=0; icbd_sc = BD_ENET_RX_EMPTY | BD_ENET_RX_INTR; - bdp->cbd_bufaddr = __pa(mem_addr); + bdp->cbd_bufaddr = mem_addr; + cep->rx_vaddr[k++] = ba; mem_addr += CPM_ENET_RX_FRSIZE; + ba += CPM_ENET_RX_FRSIZE; bdp++; } } diff -uNr linux-2.4.19/arch/ppc/8xx_io/fec.c linux-2.4.19bgl/arch/ppc/8xx_io/fec.c --- linux-2.4.19/arch/ppc/8xx_io/fec.c 2001-10-17 16:37:01.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/8xx_io/fec.c 2003-07-02 10:43:16.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.fec.c 1.20 10/11/01 11:55:47 trini + * BK Id: SCCS/s.fec.c 1.28 07/23/02 10:18:01 dan */ /* * Fast Ethernet Controller (FEC) driver for Motorola MPC8xx. @@ -33,6 +33,8 @@ #undef CONFIG_FEC_LXT970 #define CONFIG_FEC_LXT971 #undef CONFIG_FEC_QS6612 +#undef CONFIG_FEC_DP83843 +#undef CONFIG_FEC_DP83846A #include #include @@ -50,9 +52,8 @@ #include #include #include -#ifdef CONFIG_FEC_PACKETHOOK -#include -#endif +#include +#include #include #include @@ -68,7 +69,7 @@ typedef struct { uint mii_data; - void (*funct)(uint mii_reg, struct net_device *dev); + void (*funct)(uint mii_reg, struct net_device *dev, uint data); } phy_cmd_t; typedef struct { @@ -163,7 +164,12 @@ cbd_t *tx_bd_base; cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ cbd_t *dirty_tx; /* The ring entries to be free()ed. */ - scc_t *sccp; + + /* Virtual addresses for the receive buffers because we can't + * do a __va() on them anymore. + */ + unsigned char *rx_vaddr[RX_RING_SIZE]; + struct net_device_stats stats; uint tx_full; spinlock_t lock; @@ -179,20 +185,14 @@ uint sequence_done; uint phy_addr; + + struct timer_list phy_timer_list; + u16 old_status; #endif /* CONFIG_USE_MDIO */ int link; int old_link; int full_duplex; - -#ifdef CONFIG_FEC_PACKETHOOK - unsigned long ph_lock; - fec_ph_func *ph_rxhandler; - fec_ph_func *ph_txhandler; - __u16 ph_proto; - volatile __u32 *ph_regaddr; - void *ph_priv; -#endif }; static int fec_enet_open(struct net_device *dev); @@ -201,13 +201,8 @@ static void fec_enet_mii(struct net_device *dev); #endif /* CONFIG_USE_MDIO */ static void fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs); -#ifdef CONFIG_FEC_PACKETHOOK -static void fec_enet_tx(struct net_device *dev, __u32 regval); -static void fec_enet_rx(struct net_device *dev, __u32 regval); -#else static void fec_enet_tx(struct net_device *dev); static void fec_enet_rx(struct net_device *dev); -#endif static int fec_enet_close(struct net_device *dev); static struct net_device_stats *fec_enet_get_stats(struct net_device *dev); static void set_multicast_list(struct net_device *dev); @@ -216,14 +211,25 @@ static ushort my_enet_addr[3]; #ifdef CONFIG_USE_MDIO +static int fec_enet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); +static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr); + +static void mdio_callback(uint regval, struct net_device *dev, uint data); +static int mdio_read(struct net_device *dev, int phy_id, int location); + +#if defined(CONFIG_FEC_DP83846A) +static void mdio_timer_callback(unsigned long data); +#endif /* CONFIG_FEC_DP83846A */ + /* MII processing. We keep this as simple as possible. Requests are * placed on the list (if there is room). When the request is finished * by the MII, an optional function may be called. */ typedef struct mii_list { uint mii_regval; - void (*mii_func)(uint val, struct net_device *dev); + void (*mii_func)(uint val, struct net_device *dev, uint data); struct mii_list *mii_next; + uint mii_data; } mii_list_t; #define NMII 20 @@ -232,8 +238,14 @@ mii_list_t *mii_head; mii_list_t *mii_tail; +typedef struct mdio_read_data { + u16 regval; + struct task_struct *sleeping_task; +} mdio_read_data_t; + static int mii_queue(struct net_device *dev, int request, - void (*func)(uint, struct net_device *)); + void (*func)(uint, struct net_device *, uint), uint data); +static void mii_queue_relink(uint mii_reg, struct net_device *dev, uint data); /* Make MII read/write commands for the FEC. */ @@ -281,65 +293,6 @@ #define PHY_STAT_100FDX 0x8000 /* 100 Mbit full duplex selected */ #endif /* CONFIG_USE_MDIO */ -#ifdef CONFIG_FEC_PACKETHOOK -int -fec_register_ph(struct net_device *dev, fec_ph_func *rxfun, fec_ph_func *txfun, - __u16 proto, volatile __u32 *regaddr, void *priv) -{ - struct fec_enet_private *fep; - int retval = 0; - - fep = dev->priv; - - if (test_and_set_bit(0, (void*)&fep->ph_lock) != 0) { - /* Someone is messing with the packet hook */ - return -EAGAIN; - } - if (fep->ph_rxhandler != NULL || fep->ph_txhandler != NULL) { - retval = -EBUSY; - goto out; - } - fep->ph_rxhandler = rxfun; - fep->ph_txhandler = txfun; - fep->ph_proto = proto; - fep->ph_regaddr = regaddr; - fep->ph_priv = priv; - - out: - fep->ph_lock = 0; - - return retval; -} - - -int -fec_unregister_ph(struct net_device *dev) -{ - struct fec_enet_private *fep; - int retval = 0; - - fep = dev->priv; - - if (test_and_set_bit(0, (void*)&fep->ph_lock) != 0) { - /* Someone is messing with the packet hook */ - return -EAGAIN; - } - - fep->ph_rxhandler = fep->ph_txhandler = NULL; - fep->ph_proto = 0; - fep->ph_regaddr = NULL; - fep->ph_priv = NULL; - - fep->ph_lock = 0; - - return retval; -} - -EXPORT_SYMBOL(fec_register_ph); -EXPORT_SYMBOL(fec_unregister_ph); - -#endif /* CONFIG_FEC_PACKETHOOK */ - static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) { @@ -477,12 +430,6 @@ struct net_device *dev = dev_id; volatile fec_t *fecp; uint int_events; -#ifdef CONFIG_FEC_PACKETHOOK - struct fec_enet_private *fep = dev->priv; - __u32 regval; - - if (fep->ph_regaddr) regval = *fep->ph_regaddr; -#endif fecp = (volatile fec_t*)dev->base_addr; /* Get the interrupt events that caused us to be here. @@ -496,25 +443,15 @@ /* Handle receive event in its own function. */ - if (int_events & FEC_ENET_RXF) { -#ifdef CONFIG_FEC_PACKETHOOK - fec_enet_rx(dev, regval); -#else + if (int_events & FEC_ENET_RXF) fec_enet_rx(dev); -#endif - } /* Transmit OK, or non-fatal error. Update the buffer descriptors. FEC handles all errors, we just discover them as part of the transmit process. */ - if (int_events & FEC_ENET_TXF) { -#ifdef CONFIG_FEC_PACKETHOOK - fec_enet_tx(dev, regval); -#else + if (int_events & FEC_ENET_TXF) fec_enet_tx(dev); -#endif - } if (int_events & FEC_ENET_MII) { #ifdef CONFIG_USE_MDIO @@ -529,11 +466,7 @@ static void -#ifdef CONFIG_FEC_PACKETHOOK -fec_enet_tx(struct net_device *dev, __u32 regval) -#else fec_enet_tx(struct net_device *dev) -#endif { struct fec_enet_private *fep; volatile cbd_t *bdp; @@ -562,18 +495,8 @@ fep->stats.tx_fifo_errors++; if (bdp->cbd_sc & BD_ENET_TX_CSL) /* Carrier lost */ fep->stats.tx_carrier_errors++; - } else { -#ifdef CONFIG_FEC_PACKETHOOK - /* Packet hook ... */ - if (fep->ph_txhandler && - ((struct ethhdr *)skb->data)->h_proto - == fep->ph_proto) { - fep->ph_txhandler((__u8*)skb->data, skb->len, - regval, fep->ph_priv); - } -#endif + } else fep->stats.tx_packets++; - } #ifndef final_version if (bdp->cbd_sc & BD_ENET_TX_READY) @@ -609,11 +532,6 @@ if (netif_queue_stopped(dev)) netif_wake_queue(dev); } -#ifdef CONFIG_FEC_PACKETHOOK - /* Re-read register. Not exactly guaranteed to be correct, - but... */ - if (fep->ph_regaddr) regval = *fep->ph_regaddr; -#endif } fep->dirty_tx = (cbd_t *)bdp; spin_unlock(&fep->lock); @@ -626,11 +544,7 @@ * effectively tossing the packet. */ static void -#ifdef CONFIG_FEC_PACKETHOOK -fec_enet_rx(struct net_device *dev, __u32 regval) -#else fec_enet_rx(struct net_device *dev) -#endif { struct fec_enet_private *fep; volatile fec_t *fecp; @@ -688,28 +602,7 @@ fep->stats.rx_packets++; pkt_len = bdp->cbd_datlen; fep->stats.rx_bytes += pkt_len; - data = (__u8*)__va(bdp->cbd_bufaddr); - -#ifdef CONFIG_FEC_PACKETHOOK - /* Packet hook ... */ - if (fep->ph_rxhandler) { - if (((struct ethhdr *)data)->h_proto == fep->ph_proto) { - switch (fep->ph_rxhandler(data, pkt_len, regval, - fep->ph_priv)) { - case 1: - goto rx_processing_done; - break; - case 0: - break; - default: - fep->stats.rx_errors++; - goto rx_processing_done; - } - } - } - - /* If it wasn't filtered - copy it to an sk buffer. */ -#endif + data = fep->rx_vaddr[bdp - fep->rx_bd_base]; /* This does 16 byte alignment, exactly what we need. * The packet length includes FCS, but we don't want to @@ -724,9 +617,7 @@ } else { skb->dev = dev; skb_put(skb,pkt_len-4); /* Make room */ - eth_copy_and_sum(skb, - (unsigned char *)__va(bdp->cbd_bufaddr), - pkt_len-4, 0); + eth_copy_and_sum(skb, data, pkt_len-4, 0); skb->protocol=eth_type_trans(skb,dev); netif_rx(skb); } @@ -754,11 +645,6 @@ */ fecp->fec_r_des_active = 0x01000000; #endif -#ifdef CONFIG_FEC_PACKETHOOK - /* Re-read register. Not exactly guaranteed to be correct, - but... */ - if (fep->ph_regaddr) regval = *fep->ph_regaddr; -#endif } /* while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) */ fep->cur_rx = (cbd_t *)bdp; @@ -794,7 +680,7 @@ } if (mip->mii_func != NULL) - (*(mip->mii_func))(mii_reg, dev); + (*(mip->mii_func))(mii_reg, dev, mip->mii_data); mii_head = mip->mii_next; mip->mii_next = mii_free; @@ -806,7 +692,7 @@ } static int -mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *)) +mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *, uint), uint data) { struct fec_enet_private *fep; unsigned long flags; @@ -828,6 +714,7 @@ mip->mii_regval = regval; mip->mii_func = func; mip->mii_next = NULL; + mip->mii_data = data; if (mii_head) { mii_tail->mii_next = mip; mii_tail = mip; @@ -852,10 +739,10 @@ return; for(k = 0; (c+k)->mii_data != mk_mii_end; k++) - mii_queue(dev, (c+k)->mii_data, (c+k)->funct); + mii_queue(dev, (c+k)->mii_data, (c+k)->funct, 0); } -static void mii_parse_sr(uint mii_reg, struct net_device *dev) +static void mii_parse_sr(uint mii_reg, struct net_device *dev, uint data) { struct fec_enet_private *fep = dev->priv; volatile uint *s = &(fep->phy_status); @@ -872,7 +759,7 @@ fep->link = (*s & PHY_STAT_LINK) ? 1 : 0; } -static void mii_parse_cr(uint mii_reg, struct net_device *dev) +static void mii_parse_cr(uint mii_reg, struct net_device *dev, uint data) { struct fec_enet_private *fep = dev->priv; volatile uint *s = &(fep->phy_status); @@ -885,7 +772,7 @@ *s |= PHY_CONF_LOOP; } -static void mii_parse_anar(uint mii_reg, struct net_device *dev) +static void mii_parse_anar(uint mii_reg, struct net_device *dev, uint data) { struct fec_enet_private *fep = dev->priv; volatile uint *s = &(fep->phy_status); @@ -919,7 +806,7 @@ #define MII_LXT970_CONFIG 19 /* Configuration Register */ #define MII_LXT970_CSR 20 /* Chip Status Register */ -static void mii_parse_lxt970_csr(uint mii_reg, struct net_device *dev) +static void mii_parse_lxt970_csr(uint mii_reg, struct net_device *dev, uint data) { struct fec_enet_private *fep = dev->priv; volatile uint *s = &(fep->phy_status); @@ -1001,7 +888,7 @@ * weird, so 2.5 MHz ought to be enough for anyone... */ -static void mii_parse_lxt971_sr2(uint mii_reg, struct net_device *dev) +static void mii_parse_lxt971_sr2(uint mii_reg, struct net_device *dev, uint data) { struct fec_enet_private *fep = dev->priv; volatile uint *s = &(fep->phy_status); @@ -1079,7 +966,7 @@ #define MII_QS6612_IMR 30 /* Interrupt Mask Register */ #define MII_QS6612_PCR 31 /* 100BaseTx PHY Control Reg. */ -static void mii_parse_qs6612_pcr(uint mii_reg, struct net_device *dev) +static void mii_parse_qs6612_pcr(uint mii_reg, struct net_device *dev, uint data) { struct fec_enet_private *fep = dev->priv; volatile uint *s = &(fep->phy_status); @@ -1141,6 +1028,144 @@ #endif /* CONFIG_FEC_QS6612 */ +/* -------------------------------------------------------------------- */ +/* The National Semiconductor DP83843BVJE is used on a Mediatrix board */ +/* -------------------------------------------------------------------- */ + +#ifdef CONFIG_FEC_DP83843 + +/* Register definitions */ +#define MII_DP83843_PHYSTS 0x10 /* PHY Status Register */ +#define MII_DP83843_MIPSCR 0x11 /* Specific Status Register */ +#define MII_DP83843_MIPGSR 0x12 /* Generic Status Register */ + +static void mii_parse_dp83843_physts(uint mii_reg, struct net_device *dev, uint data) +{ + struct fec_enet_private *fep = dev->priv; + volatile uint *s = &(fep->phy_status); + + *s &= ~(PHY_STAT_SPMASK); + + if (mii_reg & 0x0002) + { + if (mii_reg & 0x0004) + *s |= PHY_STAT_10FDX; + else + *s |= PHY_STAT_10HDX; + } + else + { + if (mii_reg & 0x0004) + *s |= PHY_STAT_100FDX; + else + *s |= PHY_STAT_100HDX; + } +} + +static phy_info_t phy_info_dp83843 = { + 0x020005c1, + "DP83843BVJE", + + (const phy_cmd_t []) { /* config */ + { mk_mii_write(MII_REG_ANAR, 0x01E1), NULL }, /* Auto-Negociation Register Control set to */ + /* auto-negociate 10/100MBps, Half/Full duplex */ + { mk_mii_read(MII_REG_CR), mii_parse_cr }, + { mk_mii_read(MII_REG_ANAR), mii_parse_anar }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* startup */ + { mk_mii_write(MII_DP83843_MIPSCR, 0x0002), NULL }, /* Enable interrupts */ + { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* Enable and Restart Auto-Negotiation */ + { mk_mii_read(MII_REG_SR), mii_parse_sr }, + { mk_mii_read(MII_REG_CR), mii_parse_cr }, + { mk_mii_read(MII_DP83843_PHYSTS), mii_parse_dp83843_physts }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* ack_int */ + { mk_mii_read(MII_DP83843_MIPGSR), NULL }, /* Acknowledge interrupts */ + { mk_mii_read(MII_REG_SR), mii_parse_sr }, /* Find out the current status */ + { mk_mii_read(MII_REG_CR), mii_parse_cr }, + { mk_mii_read(MII_DP83843_PHYSTS), mii_parse_dp83843_physts }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* shutdown - disable interrupts */ + { mk_mii_end, } + } +}; + +#endif /* CONFIG_FEC_DP83843 */ + + +/* ----------------------------------------------------------------- */ +/* The National Semiconductor DP83846A is used on a Mediatrix board */ +/* ----------------------------------------------------------------- */ + +#ifdef CONFIG_FEC_DP83846A + +/* Register definitions */ +#define MII_DP83846A_PHYSTS 0x10 /* PHY Status Register */ + +static void mii_parse_dp83846a_physts(uint mii_reg, struct net_device *dev, uint data) +{ + struct fec_enet_private *fep = (struct fec_enet_private *)dev->priv; + volatile uint *s = &(fep->phy_status); + int link_change_mask; + + *s &= ~(PHY_STAT_SPMASK); + + if (mii_reg & 0x0002) { + if (mii_reg & 0x0004) + *s |= PHY_STAT_10FDX; + else + *s |= PHY_STAT_10HDX; + } + else { + if (mii_reg & 0x0004) + *s |= PHY_STAT_100FDX; + else + *s |= PHY_STAT_100HDX; + } + + link_change_mask = PHY_STAT_LINK | PHY_STAT_10FDX | PHY_STAT_10HDX | PHY_STAT_100FDX | PHY_STAT_100HDX; + if(fep->old_status != (link_change_mask & *s)) + { + fep->old_status = (link_change_mask & *s); + mii_queue_relink(mii_reg, dev, 0); + } +} + +static phy_info_t phy_info_dp83846a = { + 0x020005c2, + "DP83846A", + + (const phy_cmd_t []) { /* config */ + { mk_mii_write(MII_REG_ANAR, 0x01E1), NULL }, /* Auto-Negociation Register Control set to */ + /* auto-negociate 10/100MBps, Half/Full duplex */ + { mk_mii_read(MII_REG_CR), mii_parse_cr }, + { mk_mii_read(MII_REG_ANAR), mii_parse_anar }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* startup */ + { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* Enable and Restart Auto-Negotiation */ + { mk_mii_read(MII_REG_SR), mii_parse_sr }, + { mk_mii_read(MII_REG_CR), mii_parse_cr }, + { mk_mii_read(MII_DP83846A_PHYSTS), mii_parse_dp83846a_physts }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* ack_int */ + { mk_mii_read(MII_REG_SR), mii_parse_sr }, + { mk_mii_read(MII_REG_CR), mii_parse_cr }, + { mk_mii_read(MII_DP83846A_PHYSTS), mii_parse_dp83846a_physts }, + { mk_mii_end, } + }, + (const phy_cmd_t []) { /* shutdown - disable interrupts */ + { mk_mii_end, } + } +}; + +#endif /* CONFIG_FEC_DP83846A */ + + static phy_info_t *phy_info[] = { #ifdef CONFIG_FEC_LXT970 @@ -1155,6 +1180,14 @@ &phy_info_qs6612, #endif /* CONFIG_FEC_LXT971 */ +#ifdef CONFIG_FEC_DP83843 + &phy_info_dp83843, +#endif /* CONFIG_FEC_DP83843 */ + +#ifdef CONFIG_FEC_DP83846A + &phy_info_dp83846a, +#endif /* CONFIG_FEC_DP83846A */ + NULL }; @@ -1250,7 +1283,7 @@ } -static void mii_queue_relink(uint mii_reg, struct net_device *dev) +static void mii_queue_relink(uint mii_reg, struct net_device *dev, uint data) { struct fec_enet_private *fep = dev->priv; @@ -1259,7 +1292,7 @@ schedule_task(&fep->phy_task); } -static void mii_queue_config(uint mii_reg, struct net_device *dev) +static void mii_queue_config(uint mii_reg, struct net_device *dev, uint data) { struct fec_enet_private *fep = dev->priv; @@ -1280,7 +1313,7 @@ /* Read remainder of PHY ID. */ static void -mii_discover_phy3(uint mii_reg, struct net_device *dev) +mii_discover_phy3(uint mii_reg, struct net_device *dev, uint data) { struct fec_enet_private *fep; int i; @@ -1307,7 +1340,7 @@ * with a valid ID. This usually happens quickly. */ static void -mii_discover_phy(uint mii_reg, struct net_device *dev) +mii_discover_phy(uint mii_reg, struct net_device *dev, uint data) { struct fec_enet_private *fep; uint phytype; @@ -1319,12 +1352,12 @@ /* Got first part of ID, now get remainder. */ fep->phy_id = phytype << 16; - mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), mii_discover_phy3); + mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), mii_discover_phy3, 0); } else { fep->phy_addr++; if (fep->phy_addr < 32) { mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), - mii_discover_phy); + mii_discover_phy, 0); } else { printk("fec: No PHY device found.\n"); } @@ -1387,13 +1420,40 @@ fep->link = 0; if (fep->phy) { - mii_do_cmd(dev, fep->phy->ack_int); mii_do_cmd(dev, fep->phy->config); mii_do_cmd(dev, phy_cmd_config); /* display configuration */ while(!fep->sequence_done) schedule(); mii_do_cmd(dev, fep->phy->startup); + +#if defined(CONFIG_USE_MDIO) && defined(CONFIG_FEC_DP83846A) + if(fep->phy == &phy_info_dp83846a) + { + /* Initializing timers + */ + init_timer( &fep->phy_timer_list ); + + /* Starting timer for periodic link status check + * After 100 milli-seconds, mdio_timer_callback function is called. + */ + fep->phy_timer_list.expires = jiffies + (100 * HZ / 1000); + fep->phy_timer_list.data = (unsigned long)dev; + fep->phy_timer_list.function = mdio_timer_callback; + add_timer( &fep->phy_timer_list ); + } + +#if defined(CONFIG_IP_PNP) + printk("%s: Waiting for the link to be up...\n", dev->name); + + while(fep->link == 0 || ((((volatile fec_t*)dev->base_addr)->fec_ecntrl & FEC_ECNTRL_ETHER_EN) == 0)) + { + schedule(); + } +#endif /* CONFIG_IP_PNP */ + +#endif /* CONFIG_USE_MDIO && CONFIG_FEC_DP83846A */ + netif_start_queue(dev); return 0; /* Success */ } @@ -1424,6 +1484,139 @@ return &fep->stats; } +#ifdef CONFIG_USE_MDIO + +#if defined(CONFIG_FEC_DP83846A) +/* Execute the ack_int command set and schedules next timer call back. */ +static void mdio_timer_callback(unsigned long data) +{ + struct net_device *dev = (struct net_device *)data; + struct fec_enet_private *fep = (struct fec_enet_private *)(dev->priv); + mii_do_cmd(dev, fep->phy->ack_int); + + if(fep->link == 0) + { + fep->phy_timer_list.expires = jiffies + (100 * HZ / 1000); /* Sleep for 100ms */ + } + else + { + fep->phy_timer_list.expires = jiffies + (1 * HZ); /* Sleep for 1 sec. */ + } + add_timer( &fep->phy_timer_list ); +} +#endif /* CONFIG_FEC_DP83846A */ + +static void mdio_callback(uint regval, struct net_device *dev, uint data) +{ + mdio_read_data_t* mrd = (mdio_read_data_t *)data; + mrd->regval = 0xFFFF & regval; + wake_up_process(mrd->sleeping_task); +} + +static int mdio_read(struct net_device *dev, int phy_id, int location) +{ + uint retval; + mdio_read_data_t* mrd = (mdio_read_data_t *)kmalloc(sizeof(*mrd), GFP_KERNEL); + + mrd->sleeping_task = current; + set_current_state(TASK_INTERRUPTIBLE); + mii_queue(dev, mk_mii_read(location), mdio_callback, (unsigned int) mrd); + schedule(); + + retval = mrd->regval; + + kfree(mrd); + + return retval; +} + +void mdio_write(struct net_device *dev, int phy_id, int location, int value) +{ + mii_queue(dev, mk_mii_write(location, value), NULL, 0); +} + +static int fec_enet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) +{ + struct fec_enet_private *cep = (struct fec_enet_private *)dev->priv; + struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data; + + int phy = cep->phy_addr & 0x1f; + int retval; + + if (data == NULL) + { + retval = -EINVAL; + } + else + { + switch(cmd) + { + case SIOCETHTOOL: + return netdev_ethtool_ioctl(dev, (void*)rq->ifr_data); + break; + + case SIOCGMIIPHY: /* Get address of MII PHY in use. */ + case SIOCDEVPRIVATE: /* for binary compat, remove in 2.5 */ + data->phy_id = phy; + + case SIOCGMIIREG: /* Read MII PHY register. */ + case SIOCDEVPRIVATE+1: /* for binary compat, remove in 2.5 */ + data->val_out = mdio_read(dev, data->phy_id & 0x1f, data->reg_num & 0x1f); + retval = 0; + break; + + case SIOCSMIIREG: /* Write MII PHY register. */ + case SIOCDEVPRIVATE+2: /* for binary compat, remove in 2.5 */ + if (!capable(CAP_NET_ADMIN)) + { + retval = -EPERM; + } + else + { + mdio_write(dev, data->phy_id & 0x1f, data->reg_num & 0x1f, data->val_in); + retval = 0; + } + break; + + default: + retval = -EOPNOTSUPP; + break; + } + } + return retval; +} + + +static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) +{ + u32 ethcmd; + + /* dev_ioctl() in ../../net/core/dev.c has already checked + capable(CAP_NET_ADMIN), so don't bother with that here. */ + + if (copy_from_user (ðcmd, useraddr, sizeof (ethcmd))) + return -EFAULT; + + switch (ethcmd) { + case ETHTOOL_GDRVINFO: + { + struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; + strcpy (info.driver, dev->name); + strcpy (info.version, "0.2"); + strcpy (info.bus_info, ""); + if (copy_to_user (useraddr, &info, sizeof (info))) + return -EFAULT; + return 0; + } + default: + break; + } + + return -EOPNOTSUPP; +} + +#endif /* CONFIG_USE_MDIO */ + /* Set or clear the multicast filter for this adaptor. * Skeleton taken from sunlance driver. * The CPM Ethernet implementation allows Multicast as well as individual @@ -1504,10 +1697,9 @@ { struct net_device *dev; struct fec_enet_private *fep; - int i, j; - unsigned char *eap, *iap; + int i, j, k; + unsigned char *eap, *iap, *ba; unsigned long mem_addr; - pte_t *pte; volatile cbd_t *bdp; cbd_t *cbd_base; volatile immap_t *immap; @@ -1578,14 +1770,7 @@ printk("FEC initialization failed.\n"); return 1; } - mem_addr = __get_free_page(GFP_KERNEL); - cbd_base = (cbd_t *)mem_addr; - - /* Make it uncached. - */ - pte = va_to_pte(mem_addr); - pte_val(*pte) |= _PAGE_NO_CACHE; - flush_tlb_page(init_mm.mmap, mem_addr); + cbd_base = (cbd_t *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); /* Set receive and transmit descriptor base. */ @@ -1597,24 +1782,21 @@ /* Initialize the receive buffer descriptors. */ bdp = fep->rx_bd_base; + k = 0; for (i=0; icbd_sc = BD_ENET_RX_EMPTY; - bdp->cbd_bufaddr = __pa(mem_addr); + bdp->cbd_bufaddr = mem_addr; + fep->rx_vaddr[k++] = ba; mem_addr += FEC_ENET_RX_FRSIZE; + ba += FEC_ENET_RX_FRSIZE; bdp++; } } @@ -1624,16 +1806,7 @@ bdp--; bdp->cbd_sc |= BD_SC_WRAP; -#ifdef CONFIG_FEC_PACKETHOOK - fep->ph_lock = 0; - fep->ph_rxhandler = fep->ph_txhandler = NULL; - fep->ph_proto = 0; - fep->ph_regaddr = NULL; - fep->ph_priv = NULL; -#endif - - /* Install our interrupt handler. - */ + /* Install our interrupt handler. */ if (request_8xxirq(FEC_INTERRUPT, fec_enet_interrupt, 0, "fec", dev) != 0) panic("Could not allocate FEC IRQ!"); @@ -1672,6 +1845,8 @@ dev->set_multicast_list = set_multicast_list; #ifdef CONFIG_USE_MDIO + dev->do_ioctl = fec_enet_ioctl; + for (i=0; ifec_mii_speed = fep->phy_speed = - (( (bd->bi_intfreq + 500000) / 2500000 / 2 ) & 0x3F ) << 1; + (((((bd->bi_intfreq + 500000) / 2500000) + 1) / 2 ) & 0x3F ) << 1; #else fecp->fec_mii_speed = 0; /* turn off MDIO */ #endif /* CONFIG_USE_MDIO */ @@ -1722,7 +1897,9 @@ */ fep->phy_id_done = 0; fep->phy_addr = 0; - mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); + mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy, 0); + + fep->old_status = 0; #endif /* CONFIG_USE_MDIO */ return 0; @@ -1776,8 +1953,8 @@ /* Set receive and transmit descriptor base. */ - fecp->fec_r_des_start = __pa((uint)(fep->rx_bd_base)); - fecp->fec_x_des_start = __pa((uint)(fep->tx_bd_base)); + fecp->fec_r_des_start = iopa((uint)(fep->rx_bd_base)); + fecp->fec_x_des_start = iopa((uint)(fep->tx_bd_base)); fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; fep->cur_rx = fep->rx_bd_base; @@ -1862,6 +2039,13 @@ */ fecp->fec_ecntrl = FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN; fecp->fec_r_des_active = 0x01000000; + + /* The tx ring is no longer full. */ + if(fep->tx_full) + { + fep->tx_full = 0; + netif_wake_queue(dev); + } } static void diff -uNr linux-2.4.19/arch/ppc/8xx_io/uart.c linux-2.4.19bgl/arch/ppc/8xx_io/uart.c --- linux-2.4.19/arch/ppc/8xx_io/uart.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/8xx_io/uart.c 2003-07-02 10:44:30.000000000 -0500 @@ -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.29 04/05/02 11:39:35 trini */ /* * UART driver for MPC860 CPM SCC or SMC @@ -49,9 +49,7 @@ #endif #ifdef CONFIG_KGDB -extern void breakpoint(void); -extern void set_debug_traps(void); -extern int kgdb_output_string (const char* s, unsigned int count); +#include #endif #ifdef CONFIG_SERIAL_CONSOLE @@ -135,6 +133,16 @@ #define NUM_IS_SCC ((int)0x00010000) #define PORT_NUM(P) ((P) & 0x0000ffff) +/* The choice of serial port to use for KGDB. If the system has + * two ports, you can use one for console and one for KGDB (which + * doesn't make sense to me, but people asked for it). + */ +#ifdef CONFIG_KGDB_TTYS1 +#define KGDB_SER_IDX 1 /* SCC2/SMC2 */ +#else +#define KGDB_SER_IDX 0 /* SCC1/SMC1 */ +#endif + /* Processors other than the 860 only get SMCs configured by default. * Either they don't have SCCs or they are allocated somewhere else. * Of course, there are now 860s without some SCCs, so we will need to @@ -211,6 +219,12 @@ cbd_t *rx_cur; cbd_t *tx_bd_base; cbd_t *tx_cur; + + /* Virtual addresses for the FIFOs because we can't __va() a + * physical address anymore. + */ + unsigned char *rx_va_base; + unsigned char *tx_va_base; } ser_info_t; static struct console sercons = { @@ -387,8 +401,15 @@ /* Get the number of characters and the buffer pointer. */ i = bdp->cbd_datlen; - cp = (unsigned char *)__va(bdp->cbd_bufaddr); + cp = info->rx_va_base + ((bdp - info->rx_bd_base) * RX_BUF_SIZE); status = bdp->cbd_sc; +#ifdef CONFIG_KGDB + if (info->state->smc_scc_num == KGDB_SER_IDX) { + if (*cp == 0x03 || *cp == '$') + breakpoint(); + return; + } +#endif /* Check to see if there is room in the tty buffer for * the characters in our BD buffer. If not, we exit @@ -1027,6 +1048,7 @@ { ser_info_t *info = (ser_info_t *)tty->driver_data; volatile cbd_t *bdp; + unsigned char *cp; if (serial_paranoia_check(info, tty->device, "rs_put_char")) return; @@ -1037,7 +1059,8 @@ bdp = info->tx_cur; while (bdp->cbd_sc & BD_SC_READY); - *((char *)__va(bdp->cbd_bufaddr)) = ch; + cp = info->tx_va_base + ((bdp - info->tx_bd_base) * TX_BUF_SIZE); + *cp = ch; bdp->cbd_datlen = 1; bdp->cbd_sc |= BD_SC_READY; @@ -1058,6 +1081,7 @@ int c, ret = 0; ser_info_t *info = (ser_info_t *)tty->driver_data; volatile cbd_t *bdp; + unsigned char *cp; #ifdef CONFIG_KGDB /* Try to let stub handle output. Returns true if it did. */ @@ -1084,14 +1108,15 @@ break; } + cp = info->tx_va_base + ((bdp - info->tx_bd_base) * TX_BUF_SIZE); if (from_user) { - if (copy_from_user(__va(bdp->cbd_bufaddr), buf, c)) { + if (copy_from_user((void *)cp, buf, c)) { if (!ret) ret = -EFAULT; break; } } else { - memcpy(__va(bdp->cbd_bufaddr), buf, c); + memcpy((void *)cp, buf, c); } bdp->cbd_datlen = c; @@ -1166,6 +1191,7 @@ static void rs_8xx_send_xchar(struct tty_struct *tty, char ch) { volatile cbd_t *bdp; + unsigned char *cp; ser_info_t *info = (ser_info_t *)tty->driver_data; @@ -1175,7 +1201,8 @@ bdp = info->tx_cur; while (bdp->cbd_sc & BD_SC_READY); - *((char *)__va(bdp->cbd_bufaddr)) = ch; + cp = info->tx_va_base + ((bdp - info->tx_bd_base) * TX_BUF_SIZE); + *cp = ch; bdp->cbd_datlen = 1; bdp->cbd_sc |= BD_SC_READY; @@ -2202,6 +2229,11 @@ #ifdef CONFIG_SERIAL_CONSOLE +/* I need this just so I can store the virtual addresses and have + * common functions for the early console printing. + */ +static ser_info_t consinfo; + /* * Print a string to the serial port trying not to disturb any possible * real use of the port... @@ -2234,6 +2266,8 @@ /* Get the address of the host memory buffer. */ bdp = bdbase = (cbd_t *)&cpmp->cp_dpmem[up->smc_tbase]; + + info = &consinfo; } /* @@ -2261,7 +2295,7 @@ if ((uint)(bdp->cbd_bufaddr) > (uint)IMAP_ADDR) cp = (u_char *)(bdp->cbd_bufaddr); else - cp = __va(bdp->cbd_bufaddr); + cp = info->tx_va_base + ((bdp - info->tx_bd_base) * TX_BUF_SIZE); *cp = *s; bdp->cbd_datlen = 1; @@ -2275,7 +2309,7 @@ /* if a LF, also do CR... */ if (*s == 10) { while (bdp->cbd_sc & BD_SC_READY); - cp = __va(bdp->cbd_bufaddr); + cp = info->tx_va_base + ((bdp - info->tx_bd_base) * TX_BUF_SIZE); *cp = 13; bdp->cbd_datlen = 1; bdp->cbd_sc |= BD_SC_READY; @@ -2350,10 +2384,13 @@ * If the port has been initialized for general use, we must * use information from the port structure. */ - if ((info = (ser_info_t *)ser->info)) + if ((info = (ser_info_t *)ser->info)) { bdp = info->rx_cur; - else + } + else { bdp = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase]; + info = &consinfo; + } /* * We need to gracefully shut down the receiver, disable @@ -2375,7 +2412,7 @@ if ((uint)(bdp->cbd_bufaddr) > (uint)IMAP_ADDR) cp = (u_char *)(bdp->cbd_bufaddr); else - cp = __va(bdp->cbd_bufaddr); + cp = info->rx_va_base + ((bdp - info->rx_bd_base) * RX_BUF_SIZE); if (obuf) { i = c = bdp->cbd_datlen; @@ -2418,7 +2455,7 @@ static char kgdb_buf[RX_BUF_SIZE], *kgdp; static int kgdb_chars; -unsigned char +char getDebugChar(void) { if (kgdb_chars <= 0) { @@ -2430,9 +2467,18 @@ return(*kgdp++); } -void kgdb_interruptible(int state) +void kgdb_interruptible(int yes) { + volatile smc_t *smcp; + + smcp = &cpmp->cp_smc[KGDB_SER_IDX]; + + if (yes == 1) + smcp->smc_smcm |= SMCM_RX; + else + smcp->smc_smcm &= ~SMCM_RX; } + void kgdb_map_scc(void) { struct serial_state *ser; @@ -2459,7 +2505,7 @@ /* Allocate space for an input FIFO, plus a few bytes for output. * Allocate bytes to maintain word alignment. */ - mem_addr = (uint)(&cpmp->cp_dpmem[0x1000]); + mem_addr = (uint)(&cpmp->cp_dpmem[0xa00]); /* Set the physical address of the host memory buffers in * the buffer descriptors. @@ -2680,6 +2726,7 @@ /* Allocate space for FIFOs in the host memory. */ mem_addr = m8xx_cpm_hostalloc(RX_NUM_FIFO * RX_BUF_SIZE); + info->rx_va_base = (unsigned char *)mem_addr; /* Set the physical address of the host memory * buffers in the buffer descriptors, and the @@ -2689,12 +2736,12 @@ info->rx_cur = info->rx_bd_base = (cbd_t *)bdp; for (j=0; j<(RX_NUM_FIFO-1); j++) { - bdp->cbd_bufaddr = __pa(mem_addr); + bdp->cbd_bufaddr = iopa(mem_addr); bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT; mem_addr += RX_BUF_SIZE; bdp++; } - bdp->cbd_bufaddr = __pa(mem_addr); + bdp->cbd_bufaddr = iopa(mem_addr); bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT; idx = PORT_NUM(info->state->smc_scc_num); @@ -2714,6 +2761,7 @@ /* Allocate space for FIFOs in the host memory. */ mem_addr = m8xx_cpm_hostalloc(TX_NUM_FIFO * TX_BUF_SIZE); + info->tx_va_base = (unsigned char *)mem_addr; /* Set the physical address of the host memory * buffers in the buffer descriptors, and the @@ -2723,12 +2771,12 @@ info->tx_cur = info->tx_bd_base = (cbd_t *)bdp; for (j=0; j<(TX_NUM_FIFO-1); j++) { - bdp->cbd_bufaddr = __pa(mem_addr); + bdp->cbd_bufaddr = iopa(mem_addr); bdp->cbd_sc = BD_SC_INTRPT; mem_addr += TX_BUF_SIZE; bdp++; } - bdp->cbd_bufaddr = __pa(mem_addr); + bdp->cbd_bufaddr = iopa(mem_addr); bdp->cbd_sc = (BD_SC_WRAP | BD_SC_INTRPT); if (info->state->smc_scc_num & NUM_IS_SCC) { @@ -2934,20 +2982,28 @@ * from dual port ram, and a character buffer area from host mem. */ + /* Allocate space for two FIFOs. We can't allocate from host + * memory yet because vm allocator isn't initialized + * during this early console init. + */ + dp_addr = m8xx_cpm_dpalloc(8); + mem_addr = (uint)(&cpmp->cp_dpmem[dp_addr]); + /* Allocate space for two buffer descriptors in the DP ram. */ dp_addr = m8xx_cpm_dpalloc(sizeof(cbd_t) * 2); - /* Allocate space for two 2 byte FIFOs in the host memory. - */ - mem_addr = m8xx_cpm_hostalloc(8); - /* Set the physical address of the host memory buffers in * the buffer descriptors. */ bdp = (cbd_t *)&cp->cp_dpmem[dp_addr]; - bdp->cbd_bufaddr = __pa(mem_addr); - (bdp+1)->cbd_bufaddr = __pa(mem_addr+4); + bdp->cbd_bufaddr = iopa(mem_addr); + (bdp+1)->cbd_bufaddr = iopa(mem_addr+4); + + consinfo.rx_va_base = mem_addr; + consinfo.rx_bd_base = bdp; + consinfo.tx_va_base = mem_addr + 4; + consinfo.tx_bd_base = bdp+1; /* For the receive, set empty and wrap. * For transmit, set wrap. @@ -3052,3 +3108,18 @@ return 0; } +#ifdef CONFIG_INPUT_KEYBDEV + +void handle_scancode(unsigned char scancode, int down) +{ + printk("handle_scancode(scancode=0x%x, down=%d)\n", scancode, down); +} + +static void kbd_bh(unsigned long dummy) +{ +} + +DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0); +void (*kbd_ledfunc)(unsigned int led); + +#endif diff -uNr linux-2.4.19/arch/ppc/Makefile linux-2.4.19bgl/arch/ppc/Makefile --- linux-2.4.19/arch/ppc/Makefile 2001-10-11 11:04:57.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/Makefile 2003-07-02 10:44:12.000000000 -0500 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.23 09/18/01 11:19:05 paulus +# BK Id: SCCS/s.Makefile 1.38 11/13/01 08:50:13 trini # # 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 @@ -15,45 +15,59 @@ # # Be sure to change PAGE_OFFSET in include/asm-ppc/page.h to match +ifdef CONFIG_KERNEL_START_BOOL +KERNELLOAD =$(CONFIG_KERNEL_START) +else KERNELLOAD =0xc0000000 +endif ifeq ($(shell uname -m),ppc) CHECKS = checks endif -ASFLAGS = LINKFLAGS = -T arch/ppc/vmlinux.lds -Ttext $(KERNELLOAD) -Bstatic -CPPFLAGS := $(CPPFLAGS) -D__powerpc__ -CFLAGS := $(CFLAGS) -D__powerpc__ -fsigned-char \ +CPPFLAGS := $(CPPFLAGS) -I$(TOPDIR)/arch/$(ARCH) +AFLAGS := $(AFLAGS) -I$(TOPDIR)/arch/$(ARCH) +CFLAGS := $(CFLAGS) -I$(TOPDIR)/arch/$(ARCH) -fsigned-char \ -msoft-float -pipe -ffixed-r2 -Wno-uninitialized \ -mmultiple -mstring +HOSTCFLAGS += -I$(TOPDIR)/arch/$(ARCH) CPP = $(CC) -E $(CFLAGS) ifdef CONFIG_4xx -CFLAGS := $(CFLAGS) -mcpu=403 -endif - -ifdef CONFIG_8xx -CFLAGS := $(CFLAGS) -mcpu=860 +CFLAGS := $(CFLAGS) -Wa,-m405 endif ifdef CONFIG_PPC64BRIDGE CFLAGS := $(CFLAGS) -Wa,-mppc64bridge endif -ifdef CONFIG_4xx +ifdef CONFIG_MORE_COMPILE_OPTIONS +# Use sed to remove the quotes. + CFLAGS += $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') +endif + +ifdef CONFIG_40x HEAD := arch/ppc/kernel/head_4xx.o else - ifdef CONFIG_8xx - HEAD := arch/ppc/kernel/head_8xx.o + ifdef CONFIG_440 + HEAD := arch/ppc/kernel/head_440.o else - HEAD := arch/ppc/kernel/head.o + ifdef CONFIG_8xx + HEAD := arch/ppc/kernel/head_8xx.o + else + ifdef CONFIG_PPC_ISERIES + HEAD := arch/ppc/kernel/iSeries_head.o + else + HEAD := arch/ppc/kernel/head.o + endif + endif endif endif - -ARCH_SUBDIRS = arch/ppc/kernel arch/ppc/mm arch/ppc/lib +ARCH_SUBDIRS = arch/ppc/kernel arch/ppc/platforms arch/ppc/mm arch/ppc/lib SUBDIRS := $(SUBDIRS) $(ARCH_SUBDIRS) -CORE_FILES := arch/ppc/kernel/kernel.o arch/ppc/mm/mm.o arch/ppc/lib/lib.o $(CORE_FILES) +CORE_FILES := arch/ppc/kernel/kernel.o arch/ppc/platforms/platform.o \ + arch/ppc/mm/mm.o arch/ppc/lib/lib.o $(CORE_FILES) ifdef CONFIG_MATH_EMULATION SUBDIRS += arch/ppc/math-emu @@ -77,15 +91,25 @@ DRIVERS += arch/ppc/8260_io/8260_io.o endif +ifdef CONFIG_40x +SUBDIRS += arch/ppc/4xx_io +DRIVERS += arch/ppc/4xx_io/4xx_io.o +endif + ifdef CONFIG_APUS SUBDIRS += arch/ppc/amiga CORE_FILES += arch/ppc/amiga/amiga.o endif +ifdef CONFIG_PPC_ISERIES +SUBDIRS += arch/ppc/iSeries +CORE_FILES += arch/ppc/iSeries/iSeries.o +endif + checks: @$(MAKE) -C arch/$(ARCH)/kernel checks -BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd +BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd pImage vmlinux.sm # All the instructions talk about "make bzImage". bzImage: zImage @@ -99,6 +123,7 @@ archclean: rm -f arch/ppc/kernel/{mk_defs,ppc_defs.h,find_name,checks} + rm -f arch/ppc/iSeries/ReleaseData.h @$(MAKEBOOT) clean archmrproper: diff -uNr linux-2.4.19/arch/ppc/amiga/Makefile linux-2.4.19bgl/arch/ppc/amiga/Makefile --- linux-2.4.19/arch/ppc/amiga/Makefile 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/amiga/Makefile 2003-07-02 10:43:13.000000000 -0500 @@ -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.19/arch/ppc/amiga/amiga_ksyms.c linux-2.4.19bgl/arch/ppc/amiga/amiga_ksyms.c --- linux-2.4.19/arch/ppc/amiga/amiga_ksyms.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/amiga/amiga_ksyms.c 2003-07-02 10:44:30.000000000 -0500 @@ -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.19/arch/ppc/amiga/amiints.c linux-2.4.19bgl/arch/ppc/amiga/amiints.c --- linux-2.4.19/arch/ppc/amiga/amiints.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/amiga/amiints.c 2003-07-02 10:44:34.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.amiints.c 1.8 05/21/01 00:48:24 cort + * BK Id: SCCS/s.amiints.c 1.13 11/10/01 20:12:38 trini */ /* * linux/arch/m68k/amiga/amiints.c -- Amiga Linux interrupt handling code @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include @@ -63,9 +65,6 @@ extern void cia_init_IRQ(struct ciabase *base); extern int cia_get_irq_list(struct ciabase *base, char *buf); -/* irq node variables for amiga interrupt sources */ -static irq_node_t *ami_irq_list[AMI_STD_IRQS]; - unsigned short ami_intena_vals[AMI_STD_IRQS] = { IF_VERTB, IF_COPER, IF_AUD0, IF_AUD1, IF_AUD2, IF_AUD3, IF_BLIT, IF_DSKSYN, IF_DSKBLK, IF_RBF, IF_TBE, IF_SOFT, IF_PORTS, IF_EXTER @@ -78,7 +77,7 @@ static void ami_badint(int irq, void *dev_id, struct pt_regs *fp) { - num_spurious += 1; +/* num_spurious += 1;*/ } /* @@ -97,25 +96,12 @@ { int i; - /* initialize handlers */ - for (i = 0; i < AMI_STD_IRQS; i++) { - if (ami_servers[i]) { - ami_irq_list[i] = NULL; - } else { - ami_irq_list[i] = new_irq_node(); - ami_irq_list[i]->handler = ami_badint; - ami_irq_list[i]->flags = 0; - ami_irq_list[i]->dev_id = NULL; - ami_irq_list[i]->devname = NULL; - ami_irq_list[i]->next = NULL; - } - } for (i = 0; i < AMI_IRQS; i++) ami_ablecount[i] = 0; /* turn off PCMCIA interrupts */ if (AMIGAHW_PRESENT(PCMCIA)) - pcmcia_disable_irq(); + gayle.inten = GAYLE_IRQ_IDE; /* turn off all interrupts... */ custom.intena = 0x7fff; @@ -138,152 +124,6 @@ cia_init_IRQ(&ciab_base); } -static inline int amiga_insert_irq(irq_node_t **list, irq_node_t *node) -{ - unsigned long flags; - irq_node_t *cur; - - if (!node->dev_id) - printk("%s: Warning: dev_id of %s is zero\n", - __FUNCTION__, node->devname); - - save_flags(flags); - cli(); - - cur = *list; - - if (node->flags & SA_INTERRUPT) { - if (node->flags & SA_SHIRQ) - return -EBUSY; - /* - * There should never be more than one - */ - while (cur && cur->flags & SA_INTERRUPT) { - list = &cur->next; - cur = cur->next; - } - } else { - while (cur) { - list = &cur->next; - cur = cur->next; - } - } - - node->next = cur; - *list = node; - - restore_flags(flags); - return 0; -} - -static inline void amiga_delete_irq(irq_node_t **list, void *dev_id) -{ - unsigned long flags; - irq_node_t *node; - - save_flags(flags); - cli(); - - for (node = *list; node; list = &node->next, node = *list) { - if (node->dev_id == dev_id) { - *list = node->next; - /* Mark it as free. */ - node->handler = NULL; - restore_flags(flags); - return; - } - } - restore_flags(flags); - printk ("%s: tried to remove invalid irq\n", __FUNCTION__); -} - -/* - * amiga_request_irq : add an interrupt service routine for a particular - * machine specific interrupt source. - * If the addition was successful, it returns 0. - */ - -int amiga_request_irq(unsigned int irq, - void (*handler)(int, void *, struct pt_regs *), - unsigned long flags, const char *devname, void *dev_id) -{ - irq_node_t *node; - int error = 0; - - if (irq >= AMI_IRQS) { - printk ("%s: Unknown IRQ %d from %s\n", __FUNCTION__, - irq, devname); - return -ENXIO; - } - - if (irq >= IRQ_AMIGA_AUTO) - return sys_request_irq(irq - IRQ_AMIGA_AUTO, handler, - flags, devname, dev_id); - - if (irq >= IRQ_AMIGA_CIAA) - return cia_request_irq(irq, handler, flags, devname, dev_id); - - /* - * IRQ_AMIGA_PORTS & IRQ_AMIGA_EXTER defaults to shared, - * we could add a check here for the SA_SHIRQ flag but all drivers - * should be aware of sharing anyway. - */ - if (ami_servers[irq]) { - if (!(node = new_irq_node())) - return -ENOMEM; - node->handler = handler; - node->flags = flags; - node->dev_id = dev_id; - node->devname = devname; - node->next = NULL; - error = amiga_insert_irq(&ami_irq_list[irq], node); - } else { - ami_irq_list[irq]->handler = handler; - ami_irq_list[irq]->flags = flags; - ami_irq_list[irq]->dev_id = dev_id; - ami_irq_list[irq]->devname = devname; - } - - /* enable the interrupt */ - if (irq < IRQ_AMIGA_PORTS && !ami_ablecount[irq]) - custom.intena = IF_SETCLR | ami_intena_vals[irq]; - - return error; -} - -void amiga_free_irq(unsigned int irq, void *dev_id) -{ - if (irq >= AMI_IRQS) { - printk ("%s: Unknown IRQ %d\n", __FUNCTION__, irq); - return; - } - - if (irq >= IRQ_AMIGA_AUTO) { - sys_free_irq(irq - IRQ_AMIGA_AUTO, dev_id); - return; - } - if (irq >= IRQ_AMIGA_CIAA) { - cia_free_irq(irq, dev_id); - return; - } - - if (ami_servers[irq]) { - amiga_delete_irq(&ami_irq_list[irq], dev_id); - /* if server list empty, disable the interrupt */ - if (!ami_irq_list[irq] && irq < IRQ_AMIGA_PORTS) - custom.intena = ami_intena_vals[irq]; - } else { - if (ami_irq_list[irq]->dev_id != dev_id) - printk("%s: removing probably wrong IRQ %d from %s\n", - __FUNCTION__, irq, ami_irq_list[irq]->devname); - ami_irq_list[irq]->handler = ami_badint; - ami_irq_list[irq]->flags = 0; - ami_irq_list[irq]->dev_id = NULL; - ami_irq_list[irq]->devname = NULL; - custom.intena = ami_intena_vals[irq]; - } -} - /* * Enable/disable a particular machine specific interrupt source. * Note that this may affect other interrupts in case of a shared interrupt. @@ -350,20 +190,24 @@ inline void amiga_do_irq(int irq, struct pt_regs *fp) { - kstat.irqs[0][SYS_IRQS + irq]++; - ami_irq_list[irq]->handler(irq, ami_irq_list[irq]->dev_id, fp); + irq_desc_t *desc = irq_desc + irq; + struct irqaction *action = desc->action; + + kstat.irqs[0][irq]++; + action->handler(irq, action->dev_id, fp); } void amiga_do_irq_list(int irq, struct pt_regs *fp) { - irq_node_t *node; + irq_desc_t *desc = irq_desc + irq; + struct irqaction *action; - kstat.irqs[0][SYS_IRQS + irq]++; + kstat.irqs[0][irq]++; custom.intreq = ami_intena_vals[irq]; - for (node = ami_irq_list[irq]; node; node = node->next) - node->handler(irq, node->dev_id, fp); + for (action = desc->action; action; action = action->next) + action->handler(irq, action->dev_id, fp); } /* @@ -469,9 +313,15 @@ /* The PPC irq handling links all handlers requested on the same vector and executes them in a loop. Having ami_badint at the end of the chain is a bad idea. */ -void (*amiga_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = { - NULL, ami_int1, NULL, ami_int3, - ami_int4, ami_int5, NULL, ami_int7 +struct irqaction amiga_sys_irqaction[AUTO_IRQS] = { + { handler: ami_badint, name: "spurious int" }, + { handler: ami_int1, name: "int1 handler" }, + { 0, /* CIAA */ }, + { handler: ami_int3, name: "int3 handler" }, + { handler: ami_int4, name: "int4 handler" }, + { handler: ami_int5, name: "int5 handler" }, + { 0, /* CIAB */ }, + { handler: ami_int7, name: "int7 handler" }, }; #else void (*amiga_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = { @@ -479,29 +329,3 @@ ami_int4, ami_int5, ami_badint, ami_int7 }; #endif - -int amiga_get_irq_list(char *buf) -{ - int i, len = 0; - irq_node_t *node; - - for (i = 0; i < AMI_STD_IRQS; i++) { - if (!(node = ami_irq_list[i])) - continue; - len += sprintf(buf+len, "ami %2d: %10u ", i, - kstat.irqs[0][SYS_IRQS + i]); - do { - if (node->flags & SA_INTERRUPT) - len += sprintf(buf+len, "F "); - else - len += sprintf(buf+len, " "); - len += sprintf(buf+len, "%s\n", node->devname); - if ((node = node->next)) - len += sprintf(buf+len, " "); - } while (node); - } - - len += cia_get_irq_list(&ciaa_base, buf+len); - len += cia_get_irq_list(&ciab_base, buf+len); - return len; -} diff -uNr linux-2.4.19/arch/ppc/amiga/amisound.c linux-2.4.19bgl/arch/ppc/amiga/amisound.c --- linux-2.4.19/arch/ppc/amiga/amisound.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/amiga/amisound.c 2003-07-02 10:44:03.000000000 -0500 @@ -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.19/arch/ppc/amiga/bootinfo.c linux-2.4.19bgl/arch/ppc/amiga/bootinfo.c --- linux-2.4.19/arch/ppc/amiga/bootinfo.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/amiga/bootinfo.c 2003-07-02 10:43:15.000000000 -0500 @@ -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.19/arch/ppc/amiga/chipram.c linux-2.4.19bgl/arch/ppc/amiga/chipram.c --- linux-2.4.19/arch/ppc/amiga/chipram.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/amiga/chipram.c 2003-07-02 10:43:23.000000000 -0500 @@ -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.19/arch/ppc/amiga/cia.c linux-2.4.19bgl/arch/ppc/amiga/cia.c --- linux-2.4.19/arch/ppc/amiga/cia.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/amiga/cia.c 2003-07-02 10:43:44.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.cia.c 1.7 05/21/01 00:48:24 cort + * BK Id: SCCS/s.cia.c 1.12 11/10/01 20:12:38 trini */ /* * linux/arch/m68k/amiga/cia.c - CIA support @@ -16,7 +16,8 @@ #include #include #include -#include +#include +#include #include #include @@ -30,7 +31,6 @@ u_short int_mask; int handler_irq, cia_irq, server_irq; char *name; - irq_handler_t irq_list[CIA_IRQS]; } ciaa_base = { &ciaa, 0, 0, IF_PORTS, IRQ_AMIGA_AUTO_2, IRQ_AMIGA_CIAA, @@ -99,15 +99,13 @@ } /* - * Enable or disable CIA interrupts, return old interrupt mask, - * interrupts will only be enabled if a handler exists + * Enable or disable CIA interrupts, return old interrupt mask. */ static unsigned char cia_able_irq_private(struct ciabase *base, unsigned char mask) { - u_char old, tmp; - int i; + u_char old; old = base->icr_mask; base->icr_data |= base->cia->icr; @@ -117,12 +115,7 @@ else base->icr_mask &= ~mask; base->icr_mask &= CIA_ICR_ALL; - for (i = 0, tmp = 1; i < CIA_IRQS; i++, tmp <<= 1) { - if ((tmp & base->icr_mask) && !base->irq_list[i].handler) { - base->icr_mask &= ~tmp; - base->cia->icr = tmp; - } - } + if (base->icr_data & base->icr_mask) custom.intreq = IF_SETCLR | base->int_mask; return old; @@ -144,94 +137,45 @@ return cia_able_irq_private(base, mask); } -int cia_request_irq(unsigned int irq, - void (*handler)(int, void *, struct pt_regs *), - unsigned long flags, const char *devname, void *dev_id) -{ - u_char mask; - struct ciabase *base; - - CIA_SET_BASE_ADJUST_IRQ(base, irq); - - base->irq_list[irq].handler = handler; - base->irq_list[irq].flags = flags; - base->irq_list[irq].dev_id = dev_id; - base->irq_list[irq].devname = devname; - - /* enable the interrupt */ - mask = 1 << irq; - cia_set_irq_private(base, mask); - cia_able_irq_private(base, CIA_ICR_SETCLR | mask); - return 0; -} - -void cia_free_irq(unsigned int irq, void *dev_id) -{ - struct ciabase *base; - - CIA_SET_BASE_ADJUST_IRQ(base, irq); - - if (base->irq_list[irq].dev_id != dev_id) - printk("%s: removing probably wrong IRQ %i from %s\n", - __FUNCTION__, base->cia_irq + irq, - base->irq_list[irq].devname); - - base->irq_list[irq].handler = NULL; - base->irq_list[irq].flags = 0; - - cia_able_irq_private(base, 1 << irq); -} - static void cia_handler(int irq, void *dev_id, struct pt_regs *fp) { struct ciabase *base = (struct ciabase *)dev_id; - int mach_irq, i; + irq_desc_t *desc; + struct irqaction *action; + int i; unsigned char ints; - mach_irq = base->cia_irq; - irq = SYS_IRQS + mach_irq; + irq = base->cia_irq; + desc = irq_desc + irq; ints = cia_set_irq_private(base, CIA_ICR_ALL); custom.intreq = base->int_mask; - for (i = 0; i < CIA_IRQS; i++, irq++, mach_irq++) { + for (i = 0; i < CIA_IRQS; i++, irq++) { if (ints & 1) { kstat.irqs[0][irq]++; - base->irq_list[i].handler(mach_irq, base->irq_list[i].dev_id, fp); + action = desc->action; + action->handler(irq, action->dev_id, fp); } ints >>= 1; + desc++; } amiga_do_irq_list(base->server_irq, fp); } void __init cia_init_IRQ(struct ciabase *base) { - int i; - - /* init isr handlers */ - for (i = 0; i < CIA_IRQS; i++) { - base->irq_list[i].handler = NULL; - base->irq_list[i].flags = 0; - } + extern struct irqaction amiga_sys_irqaction[AUTO_IRQS]; + struct irqaction *action; /* clear any pending interrupt and turn off all interrupts */ cia_set_irq_private(base, CIA_ICR_ALL); cia_able_irq_private(base, CIA_ICR_ALL); /* install CIA handler */ - request_irq(base->handler_irq, cia_handler, 0, base->name, base); + action = &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO]; + action->handler = cia_handler; + action->dev_id = base; + action->name = base->name; + setup_irq(base->handler_irq, &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO]); custom.intena = IF_SETCLR | base->int_mask; } - -int cia_get_irq_list(struct ciabase *base, char *buf) -{ - int i, j, len = 0; - - j = base->cia_irq; - for (i = 0; i < CIA_IRQS; i++) { - len += sprintf(buf+len, "cia %2d: %10d ", j + i, - kstat.irqs[0][SYS_IRQS + j + i]); - len += sprintf(buf+len, " "); - len += sprintf(buf+len, "%s\n", base->irq_list[i].devname); - } - return len; -} diff -uNr linux-2.4.19/arch/ppc/amiga/config.c linux-2.4.19bgl/arch/ppc/amiga/config.c --- linux-2.4.19/arch/ppc/amiga/config.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/amiga/config.c 2003-07-02 10:43:06.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.config.c 1.12 09/18/01 11:19:06 paulus + * BK Id: SCCS/s.config.c 1.16 04/05/02 11:39:36 trini */ #define m68k_debug_device debug_device @@ -411,16 +411,16 @@ mach_keyb_init = amiga_keyb_init; mach_kbdrate = amiga_kbdrate; mach_init_IRQ = amiga_init_IRQ; - mach_default_handler = &amiga_default_handler; #ifndef CONFIG_APUS + mach_default_handler = &amiga_default_handler; mach_request_irq = amiga_request_irq; mach_free_irq = amiga_free_irq; enable_irq = amiga_enable_irq; disable_irq = amiga_disable_irq; + mach_get_irq_list = amiga_get_irq_list; #endif mach_get_model = amiga_get_model; mach_get_hardware_list = amiga_get_hardware_list; - mach_get_irq_list = amiga_get_irq_list; mach_gettimeoffset = amiga_gettimeoffset; if (AMIGAHW_PRESENT(A3000_CLK)){ mach_gettod = a3000_gettod; diff -uNr linux-2.4.19/arch/ppc/amiga/ints.c linux-2.4.19bgl/arch/ppc/amiga/ints.c --- linux-2.4.19/arch/ppc/amiga/ints.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/amiga/ints.c 2003-07-02 10:44:11.000000000 -0500 @@ -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.19/arch/ppc/amiga/pcmcia.c linux-2.4.19bgl/arch/ppc/amiga/pcmcia.c --- linux-2.4.19/arch/ppc/amiga/pcmcia.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/amiga/pcmcia.c 2003-07-02 10:43:47.000000000 -0500 @@ -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.19/arch/ppc/amiga/time.c linux-2.4.19bgl/arch/ppc/amiga/time.c --- linux-2.4.19/arch/ppc/amiga/time.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/amiga/time.c 2003-07-02 10:44:32.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.time.c 1.5 05/17/01 18:14:20 cort + * BK Id: SCCS/s.time.c 1.7 06/05/01 21:22:02 paulus */ #include /* CONFIG_HEARTBEAT */ #include diff -uNr linux-2.4.19/arch/ppc/boot/Makefile linux-2.4.19bgl/arch/ppc/boot/Makefile --- linux-2.4.19/arch/ppc/boot/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/Makefile 2005-06-08 14:30:44.000000000 -0500 @@ -30,7 +30,17 @@ subdir-y := lib common simple subdir-$(CONFIG_ALL_PPC) := chrp pmac prep tools-$(CONFIG_ALL_PPC) := addnote mknote hack-coff mkprep -tools-$(CONFIG_4xx) := mktree +tools-$(CONFIG_PPLUS) := mkbugboot mkprep +tools-$(CONFIG_40x) := mktree +tools-$(CONFIG_BGL) := mktree +tools-$(CONFIG_EBONY) := mktree +tools-$(CONFIG_LOPEC) := mkbugboot mkprep +tools-$(CONFIG_MCPN765) := mkbugboot mkprep +tools-$(CONFIG_MENF1) := mkprep +tools-$(CONFIG_MVME5100) := mkbugboot mkprep +tools-$(CONFIG_PRPMC750) := mkbugboot mkprep +tools-$(CONFIG_PRPMC800) := mkbugboot mkprep +tools-$(CONFIG_SPRUCE) := mktree # These are dirs we don't want to go into on BOOT_TARGETS. We have them for # the 'depend' stage. @@ -65,6 +75,9 @@ -d $< images/vmlinux.PPCBoot ln -sf vmlinux.PPCBoot images/pImage +vmlinux.sm: $(TOPDIR)/vmlinux utils/addSystemMap + ./utils/addSystemMap $(TOPDIR)/System.map $(TOPDIR)/vmlinux images/vmlinux.sm + # These are subdirs with files not normally rm'ed. -- Tom clean: $(MAKE) -C images clean diff -uNr linux-2.4.19/arch/ppc/boot/chrp/Makefile linux-2.4.19bgl/arch/ppc/boot/chrp/Makefile --- linux-2.4.19/arch/ppc/boot/chrp/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/chrp/Makefile 2003-07-02 10:44:02.000000000 -0500 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.15 01/11/02 10:46:06 trini +# BK Id: SCCS/s.Makefile 1.24 03/12/02 16:14:59 paulus # # Makefile for making ELF bootable images for booting on CHRP # using Open Firmware. diff -uNr linux-2.4.19/arch/ppc/boot/chrp/main.c linux-2.4.19bgl/arch/ppc/boot/chrp/main.c --- linux-2.4.19/arch/ppc/boot/chrp/main.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/chrp/main.c 2003-07-02 10:43:05.000000000 -0500 @@ -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.23 03/12/02 16:07:28 paulus */ /* * Copyright (C) Paul Mackerras 1997. diff -uNr linux-2.4.19/arch/ppc/boot/chrp/misc.S linux-2.4.19bgl/arch/ppc/boot/chrp/misc.S --- linux-2.4.19/arch/ppc/boot/chrp/misc.S 2001-05-24 17:02:06.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/chrp/misc.S 2003-07-02 10:44:13.000000000 -0500 @@ -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 22:20:45 paulus */ /* * Copyright (C) Paul Mackerras 1997. diff -uNr linux-2.4.19/arch/ppc/boot/chrp/start.c linux-2.4.19bgl/arch/ppc/boot/chrp/start.c --- linux-2.4.19/arch/ppc/boot/chrp/start.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/chrp/start.c 2003-07-02 10:43:16.000000000 -0500 @@ -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.12 07/10/02 13:44:03 trini */ /* * Copyright (C) Paul Mackerras 1997. diff -uNr linux-2.4.19/arch/ppc/boot/common/Makefile linux-2.4.19bgl/arch/ppc/boot/common/Makefile --- linux-2.4.19/arch/ppc/boot/common/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/common/Makefile 2003-07-02 10:44:03.000000000 -0500 @@ -11,7 +11,6 @@ USE_STANDARD_AS_RULE := true coffcrt0.o: - $(CC) -I$(TOPDIR)/arch/$(ARCH)/kernel $(AFLAGS) -DXCOFF \ - -traditional -c -o coffcrt0.o crt0.S + $(CC) $(AFLAGS) -DXCOFF -traditional -c -o coffcrt0.o crt0.S include $(TOPDIR)/Rules.make diff -uNr linux-2.4.19/arch/ppc/boot/common/crt0.S linux-2.4.19bgl/arch/ppc/boot/common/crt0.S --- linux-2.4.19/arch/ppc/boot/common/crt0.S 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/common/crt0.S 2003-07-02 10:44:30.000000000 -0500 @@ -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.19 03/28/02 16:26:50 trini */ /* Copyright (c) 1997 Paul Mackerras * Initial Power Macintosh COFF version. @@ -22,7 +22,7 @@ */ #include -#include "ppc_asm.h" +#include .text @@ -69,7 +69,7 @@ bdnz 1b # If we are not done yet, keep clearing 2: -#ifdef CONFIG_4xx +#ifdef CONFIG_40x ## Set up the stack lis r9,_start@h # r9 = &_start (text section entry) diff -uNr linux-2.4.19/arch/ppc/boot/common/misc-common.c linux-2.4.19bgl/arch/ppc/boot/common/misc-common.c --- linux-2.4.19/arch/ppc/boot/common/misc-common.c 2001-08-28 08:58:33.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/common/misc-common.c 2005-06-08 14:30:44.000000000 -0500 @@ -35,6 +35,10 @@ #include #include "zlib.h" #include "nonstdio.h" +#ifdef CONFIG_BGL +#include "bglmailbox.h" +#include "platforms/ibmbgl.h" +#endif /* If we're on a ALL_PPC, assume we have a keyboard controller * Also note, if we're not ALL_PPC, we assume you are a serial @@ -83,6 +87,61 @@ extern void serial_putc(unsigned long com_port, unsigned char c); #endif +#ifdef CONFIG_BGL +/* Note that an I/O TLB must exist for the mbox */ +static volatile BGLSramCommunicationsArea *bgl_mbox = (volatile BGLSramCommunicationsArea *)0xffffc000; + +/* drop a message in the mailbox. don't worry if a msg already exists */ +void bgl_puts(char *msg) +{ + bglboard_t *pers = (bglboard_t *)BGL_SRAM_PERSONALITY_BASE; + if (BGLPersonality_verbose(pers)) { + int len = strlen(msg); + + memcpy((void *)bgl_mbox->mailboxFromCpu0._payload._fromCore._data, msg, len); + bgl_mbox->mailboxFromCpu0._payload._fromCore._len = len; + bgl_mbox->mailboxFromCpu0._header._cmd = BGL_MAILBOX_WRITE_CONSOLE; + BGLMailbox_raiseAttention(); + while (bgl_mbox->mailboxFromCpu0._header._cmd != BGL_MAILBOX_EMPTY) + /* wait for mmcs; should probably watch timebase to timeout */; + } +} + +static void bgl_putc(unsigned char c) +{ + static enum {bgl_mode_unknown, bgl_mode_sim, bgl_mode_mbox} bgl_putc_mode; + static int bgl_next; + static char bgl_buf[200]; + + switch (bgl_putc_mode) { + case bgl_mode_unknown: { + /* first time. Go to SRAM for personality */ + bglboard_t *pers = (bglboard_t *)BGL_SRAM_PERSONALITY_BASE; + if (BGLPersonality_simulator(pers)) + bgl_putc_mode = bgl_mode_sim; + else + bgl_putc_mode = bgl_mode_mbox; + bgl_putc(c); /* Now do it for real */ + } + break; + case bgl_mode_sim: { + volatile char *simout = (volatile char *)0xef600300UL; + *simout = c; + } + break; + case bgl_mode_mbox: + if (c == '\r' || bgl_next >= sizeof(bgl_buf)-1) { + bgl_buf[bgl_next] = 0; + bgl_puts(bgl_buf); + bgl_next = 0; + } else { + bgl_buf[bgl_next++] = c; + } + break; + } +} +#endif + void pause(void) { puts("pause\n"); @@ -129,6 +188,11 @@ if ( c == '\n' ) serial_putc(com_port, '\r'); #endif /* CONFIG_SERIAL_CONSOLE */ +#ifdef CONFIG_BGL + bgl_putc(c); + if ( c == '\n' ) + bgl_putc('\r'); +#endif x = orig_x; y = orig_y; @@ -175,6 +239,11 @@ serial_putc(com_port, c); if ( c == '\n' ) serial_putc(com_port, '\r'); #endif /* CONFIG_SERIAL_CONSOLE */ +#ifdef CONFIG_BGL + bgl_putc(c); + if ( c == '\n' ) + bgl_putc('\r'); +#endif if ( c == '\n' ) { x = 0; diff -uNr linux-2.4.19/arch/ppc/boot/common/misc-simple.c linux-2.4.19bgl/arch/ppc/boot/common/misc-simple.c --- linux-2.4.19/arch/ppc/boot/common/misc-simple.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/common/misc-simple.c 2005-06-08 14:30:44.000000000 -0500 @@ -26,7 +26,15 @@ #include #include #include +#ifdef CONFIG_BGL +#include +#include +#include +#elif CONFIG_EBONY +#include +#endif /* CONFIG_EBONY */ +#include "mpc10x.h" #include "nonstdio.h" #include "zlib.h" @@ -64,6 +72,7 @@ extern unsigned long start; extern int CRT_tstc(void); +extern unsigned long mpc10x_get_mem_size(int map); extern unsigned long serial_init(int chan, void *ignored); extern void serial_close(unsigned long com_port); extern void gunzip(void *, int, unsigned char *, int *); @@ -75,9 +84,28 @@ int timer = 0; char *cp, ch; struct bi_record *rec, *birecs; + unsigned long TotalMemory = 0; + unsigned char *im; serial_fixups(); +#if defined(CONFIG_SERIAL_CONSOLE) com_port = serial_init(0, NULL); +#endif + +#ifdef CONFIG_EBONY + mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR); /* reset MAL */ + while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; /* wait for reset */ + *(volatile unsigned long *)EBONY_EMAC0_MR0 = 0x20000000; /* reset EMAC */ + __asm__ __volatile__("eieio"); /* enforce ordering */ +#endif + +#ifdef CONFIG_LOPEC + /* + * This should work on any board with an MPC10X which is properly + * initalized. + */ + TotalMemory = mpc10x_get_mem_size(MPC10X_MEM_MAP_B); +#endif /* assume the chunk below 8M is free */ end_avail = (char *)0x00800000; @@ -148,9 +176,12 @@ memcpy (cmd_line, cmd_preset, sizeof(cmd_preset)); while ( *cp ) putc(*cp++); -#ifndef CONFIG_GEMINI - /* Val Henson has requested that Gemini doesn't wait for the - * user to edit the cmdline or not. */ +#if (defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_VGA_CONSOLE)) \ + && !defined(CONFIG_GEMINI) && !defined(CONFIG_BGL) + /* + * If they have a console, allow them to edit the command line. + * Otherwise, don't bother wasting the five seconds. + */ while (timer++ < 5*1000) { if (tstc()) { while ((ch = getc()) != '\n' && ch != '\r') { @@ -194,6 +225,20 @@ rec->size = sizeof(struct bi_record); rec = (struct bi_record *)((unsigned long)rec + rec->size); +#if ( defined(CONFIG_BGL ) && !defined(CONFIG_VHDL_BGL) ) + rec->tag = BI_BGL_PERSONALITY; + puts("Copying personality\n"); + memcpy( rec->data, (bglboard_t *)BGL_SRAM_PERSONALITY_BASE, sizeof(bglboard_t)); + rec->size = sizeof(struct bi_record)+sizeof(bglboard_t); + rec = (struct bi_record *)((unsigned long)rec + rec->size); +#endif + if ( TotalMemory ) { + rec->tag = BI_MEMSIZE; + rec->data[0] = TotalMemory; + rec->size = sizeof(struct bi_record) + sizeof(unsigned long); + rec = (struct bi_record *)((unsigned long)rec + rec->size); + } + rec->tag = BI_CMD_LINE; memcpy( (char *)rec->data, cmd_line, strlen(cmd_line)+1); rec->size = sizeof(struct bi_record) + strlen(cmd_line) + 1; @@ -208,12 +253,32 @@ rec = (struct bi_record *)((unsigned long)rec + rec->size); } +#ifdef CONFIG_BGL + else { + /* On BG/L we may have a gzipped ramdisk loaded at a fixed + * address. It is preceeded by a 4-byte magic value and a + * 4-byte big endian length. + */ + unsigned int *rd = (unsigned int *)0x1000000; /* 16M */ + + if (rd[0] == 0xf0e1d2c3 && rd[1] != 0) { + rec->tag = BI_INITRD; + rec->data[0] = rd + 2; + rec->data[1] = rd[1]; + rec->size = sizeof(struct bi_record) + 2 * + sizeof(unsigned long); + rec = (struct bi_record *)((unsigned long)rec + + rec->size); + } + } +#endif rec->tag = BI_LAST; rec->size = sizeof(struct bi_record); rec = (struct bi_record *)((unsigned long)rec + rec->size); puts("Now booting the kernel\n"); +#if defined(CONFIG_SERIAL_CONSOLE) serial_close(com_port); - +#endif return birecs; } diff -uNr linux-2.4.19/arch/ppc/boot/common/ns16550.c linux-2.4.19bgl/arch/ppc/boot/common/ns16550.c --- linux-2.4.19/arch/ppc/boot/common/ns16550.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/common/ns16550.c 2003-07-02 10:43:19.000000000 -0500 @@ -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.28 04/16/02 21:42:07 paulus */ /* * COM1 NS16550 support diff -uNr linux-2.4.19/arch/ppc/boot/common/ofcommon.c linux-2.4.19bgl/arch/ppc/boot/common/ofcommon.c --- linux-2.4.19/arch/ppc/boot/common/ofcommon.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/common/ofcommon.c 2003-07-02 10:44:11.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ofcommon.c 1.2 01/11/02 10:46:07 trini + * BK Id: SCCS/s.ofcommon.c 1.5 07/10/02 13:44:03 trini * * Copyright (C) Paul Mackerras 1997. * diff -uNr linux-2.4.19/arch/ppc/boot/common/relocate.S linux-2.4.19bgl/arch/ppc/boot/common/relocate.S --- linux-2.4.19/arch/ppc/boot/common/relocate.S 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/common/relocate.S 2005-06-08 14:30:44.000000000 -0500 @@ -20,7 +20,7 @@ #include #include #include -#include "ppc_asm.h" +#include #define GETSYM(reg, sym) \ lis reg, sym@h; ori reg, reg, sym@l @@ -33,6 +33,36 @@ */ .globl relocate relocate: +#if defined(CONFIG_BGL) + /* are we second CPU? */ + li r0, 0 + mfspr r4, 0x11E + cmpw r4, r0 + bgt bgl_secondary_waitloop + b relocate_continue + + .data + .align 5 + .globl bgl_secondary_go +bgl_secondary_go: + .long 0 /* this goes to 1 when the 2nd cpu can continue */ + .previous + +bgl_secondary_waitloop: + GETSYM(r9, bgl_secondary_go) +2: dcbi 0,r9 + lwz r6,0(r9) + cmpwi r6,0 + beq 2b + /* time to enter the kernel */ + li r4,0 + li r6,0 + li r9,0x0000 + mtlr r9 + blr + +relocate_continue: +#endif /* Save r3, r4 for later. * The r8/r11 are legacy registers so I don't have to * rewrite the code below :-). @@ -193,6 +223,12 @@ mr r6,r11 /* Residual data */ bl decompress_kernel +#if defined(CONFIG_BGL) + GETSYM(r4, bgl_secondary_go) + li r6,1 + stw r6,0(r4) + dcbst 0,r6 +#endif /* * Make sure the kernel knows we don't have things set in * registers. -- Tom diff -uNr linux-2.4.19/arch/ppc/boot/common/string.S linux-2.4.19bgl/arch/ppc/boot/common/string.S --- linux-2.4.19/arch/ppc/boot/common/string.S 2001-05-24 17:02:06.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/common/string.S 2003-07-02 10:44:10.000000000 -0500 @@ -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 22:20:45 paulus */ /* * String handling functions for PowerPC. diff -uNr linux-2.4.19/arch/ppc/boot/common/util.S linux-2.4.19bgl/arch/ppc/boot/common/util.S --- linux-2.4.19/arch/ppc/boot/common/util.S 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/common/util.S 2003-07-02 10:43:28.000000000 -0500 @@ -24,7 +24,7 @@ #include #include -#include "ppc_asm.h" +#include .text @@ -160,12 +160,7 @@ blt 2b 3: blr -.globl _put_MSR -_put_MSR: - mtmsr r3 - blr - - .section ".relocate_code","xa" + .section ".relocate_code","xa" /* * Flush and enable instruction cache * First, flush the data cache in case it was enabled and may be diff -uNr linux-2.4.19/arch/ppc/boot/images/Makefile linux-2.4.19bgl/arch/ppc/boot/images/Makefile --- linux-2.4.19/arch/ppc/boot/images/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/images/Makefile 2005-06-08 14:30:44.000000000 -0500 @@ -7,6 +7,7 @@ vmlinux.gz: $(TOPDIR)/vmlinux $(OBJCOPY) --strip-all -S -O binary $(TOPDIR)/vmlinux vmlinux gzip -vf9 vmlinux + $(OBJCOPY) --strip-all -S -O binary $(TOPDIR)/vmlinux vmlinux clean: rm -f sImage vmapus vmlinux* miboot* zImage* zvmlinux* diff -uNr linux-2.4.19/arch/ppc/boot/include/nonstdio.h linux-2.4.19bgl/arch/ppc/boot/include/nonstdio.h --- linux-2.4.19/arch/ppc/boot/include/nonstdio.h 2001-08-28 08:58:33.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/include/nonstdio.h 2003-07-02 10:43:14.000000000 -0500 @@ -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:57:33 paulus */ /* * Copyright (C) Paul Mackerras 1997. diff -uNr linux-2.4.19/arch/ppc/boot/include/rs6000.h linux-2.4.19bgl/arch/ppc/boot/include/rs6000.h --- linux-2.4.19/arch/ppc/boot/include/rs6000.h 2001-05-24 17:02:06.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/include/rs6000.h 2003-07-02 10:43:53.000000000 -0500 @@ -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 22:20:46 paulus */ /* IBM RS/6000 "XCOFF" file definitions for BFD. Copyright (C) 1990, 1991 Free Software Foundation, Inc. diff -uNr linux-2.4.19/arch/ppc/boot/include/zlib.h linux-2.4.19bgl/arch/ppc/boot/include/zlib.h --- linux-2.4.19/arch/ppc/boot/include/zlib.h 2001-05-24 17:02:06.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/include/zlib.h 2003-07-02 10:44:29.000000000 -0500 @@ -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.8 06/05/01 22:20:46 paulus */ /* * This file is derived from zlib.h and zconf.h from the zlib-0.95 diff -uNr linux-2.4.19/arch/ppc/boot/lib/zlib.c linux-2.4.19bgl/arch/ppc/boot/lib/zlib.c --- linux-2.4.19/arch/ppc/boot/lib/zlib.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/lib/zlib.c 2003-07-02 10:44:18.000000000 -0500 @@ -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.13 03/21/02 14:35:03 trini */ /* * This file is derived from various .h and .c files from the zlib-0.95 diff -uNr linux-2.4.19/arch/ppc/boot/pmac/Makefile linux-2.4.19bgl/arch/ppc/boot/pmac/Makefile --- linux-2.4.19/arch/ppc/boot/pmac/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/pmac/Makefile 2003-07-02 10:44:41.000000000 -0500 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.19 01/16/02 11:08:07 trini +# BK Id: SCCS/s.Makefile 1.27 03/12/02 16:14:59 paulus # # Makefile for making XCOFF bootable images for booting on PowerMacs # using Open Firmware. @@ -31,8 +31,6 @@ TFTPIMAGE=/tftpboot/zImage.pmac$(END) -AFLAGS_../common/crt0.o += -I$(TOPDIR)/arch/$(ARCH)/kernel - ../common/coffcrt0.o: $(MAKE) -C ../common coffcrt0.o diff -uNr linux-2.4.19/arch/ppc/boot/pmac/chrpmain.c linux-2.4.19bgl/arch/ppc/boot/pmac/chrpmain.c --- linux-2.4.19/arch/ppc/boot/pmac/chrpmain.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/pmac/chrpmain.c 2003-07-02 10:44:38.000000000 -0500 @@ -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.22 03/12/02 16:07:28 paulus */ /* * Copyright (C) Paul Mackerras 1997. diff -uNr linux-2.4.19/arch/ppc/boot/pmac/coffmain.c linux-2.4.19bgl/arch/ppc/boot/pmac/coffmain.c --- linux-2.4.19/arch/ppc/boot/pmac/coffmain.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/pmac/coffmain.c 2003-07-02 10:43:28.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.coffmain.c 1.15 01/11/02 10:46:07 trini + * BK Id: SCCS/s.coffmain.c 1.17 01/11/02 10:56:05 trini */ /* * Copyright (C) Paul Mackerras 1997. diff -uNr linux-2.4.19/arch/ppc/boot/pmac/misc.S linux-2.4.19bgl/arch/ppc/boot/pmac/misc.S --- linux-2.4.19/arch/ppc/boot/pmac/misc.S 2001-05-24 17:02:07.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/pmac/misc.S 2003-07-02 10:43:27.000000000 -0500 @@ -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 22:20:46 paulus */ /* * Copyright (C) Paul Mackerras 1997. diff -uNr linux-2.4.19/arch/ppc/boot/pmac/start.c linux-2.4.19bgl/arch/ppc/boot/pmac/start.c --- linux-2.4.19/arch/ppc/boot/pmac/start.c 2001-08-28 08:58:33.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/pmac/start.c 2003-07-02 10:44:17.000000000 -0500 @@ -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.13 07/10/02 13:44:03 trini */ /* * Copyright (C) Paul Mackerras 1997. diff -uNr linux-2.4.19/arch/ppc/boot/prep/Makefile linux-2.4.19bgl/arch/ppc/boot/prep/Makefile --- linux-2.4.19/arch/ppc/boot/prep/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/prep/Makefile 2003-07-02 10:44:46.000000000 -0500 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.30 01/26/02 12:27:41 trini +# BK Id: SCCS/s.Makefile 1.30 11/19/01 09:04:20 trini # # arch/ppc/boot/Makefile # @@ -23,9 +23,10 @@ endif LD_ARGS = -T ../ld.script -Ttext 0x00800000 -Bstatic -obj-y := head.o ../simple/legacy.o misc.o of1275.o \ +obj-y := head.o ../simple/legacy.o misc.o \ ../common/util.o ../common/string.o \ - ../common/misc-common.o + ../common/misc-common.o \ + ../common/mpc10x_memory.o OBJCOPY_ARGS = -O elf32-powerpc LIBS = ../lib/zlib.a @@ -39,10 +40,6 @@ # 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 diff -uNr linux-2.4.19/arch/ppc/boot/prep/head.S linux-2.4.19bgl/arch/ppc/boot/prep/head.S --- linux-2.4.19/arch/ppc/boot/prep/head.S 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/prep/head.S 2003-07-02 10:43:13.000000000 -0500 @@ -1,8 +1,8 @@ /* - * BK Id: SCCS/s.head.S 1.13 01/11/02 10:46:07 trini + * BK Id: SCCS/s.head.S 1.13 08/07/01 17:57:15 trini */ -#include "ppc_asm.h" +#include #include #include @@ -38,10 +38,6 @@ isync mr r11,r3 /* Save pointer to residual/board data */ - mr r25,r5 /* Save OFW pointer */ - - /* Save the original MSR value */ - mfmsr r26 /* Establish default MSR value */ li r3,MSR_IP|MSR_FP @@ -114,17 +110,11 @@ li r2,0x000F /* Mask pointer to 16-byte boundary */ andc r1,r1,r2 - /* Store the original MSR into 'orig_MSR' */ - lis r3,orig_MSR@h - ori r3,r3,orig_MSR@l - stw r26,0(r3) - /* Run loader */ mr r3,r8 /* Load point */ mr r4,r7 /* Program length */ mr r5,r6 /* Checksum */ mr r6,r11 /* Residual data */ - mr r7,r25 /* OFW interfaces */ bl decompress_kernel /* diff -uNr linux-2.4.19/arch/ppc/boot/prep/iso_font.h linux-2.4.19bgl/arch/ppc/boot/prep/iso_font.h --- linux-2.4.19/arch/ppc/boot/prep/iso_font.h 2001-05-24 17:02:07.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/prep/iso_font.h 2003-07-02 10:44:12.000000000 -0500 @@ -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 22:20:09 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.19/arch/ppc/boot/prep/kbd.c linux-2.4.19bgl/arch/ppc/boot/prep/kbd.c --- linux-2.4.19/arch/ppc/boot/prep/kbd.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/prep/kbd.c 2003-07-02 10:43:53.000000000 -0500 @@ -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.14 03/12/02 16:07:29 paulus */ #include diff -uNr linux-2.4.19/arch/ppc/boot/prep/misc.c linux-2.4.19bgl/arch/ppc/boot/prep/misc.c --- linux-2.4.19/arch/ppc/boot/prep/misc.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/prep/misc.c 2003-07-02 10:43:10.000000000 -0500 @@ -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.42 07/11/02 13:36:53 trini * * arch/ppc/boot/prep/misc.c * @@ -20,6 +20,8 @@ #include #include #include + +#include "mpc10x.h" #include "nonstdio.h" #include "zlib.h" @@ -51,7 +53,6 @@ RESIDUAL hold_resid_buf; RESIDUAL *hold_residual = &hold_resid_buf; unsigned long initrd_size = 0; -unsigned long orig_MSR; char *zimage_start; int zimage_size; @@ -66,16 +67,11 @@ #endif /* CONFIG_VGA_CONSOLE */ extern int CRT_tstc(void); -extern void of_init(void *handler); -extern int of_finddevice(const char *device_specifier, int *phandle); -extern int of_getprop(int phandle, const char *name, void *buf, int buflen, - int *size); extern int vga_init(unsigned char *ISA_mem); extern void gunzip(void *, int, unsigned char *, int *); - -extern void _put_MSR(unsigned int val); extern unsigned long serial_init(int chan, void *ignored); extern void serial_fixups(void); +extern unsigned long mpc10x_get_mem_size(int mem_map); void writel(unsigned int val, unsigned int address) @@ -120,15 +116,12 @@ unsigned long decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, - RESIDUAL *residual, void *OFW_interface) + RESIDUAL *residual) { int timer = 0; extern unsigned long start; char *cp, ch; unsigned long TotalMemory; - int dev_handle; - int mem_info[2]; - int res, size; unsigned char board_type; unsigned char base_mod; int start_multi = 0; @@ -218,49 +211,14 @@ } else { /* Tell the user we didn't find anything. */ puts("No residual data found.\n"); - - /* Assume 32M in the absence of more info... */ - TotalMemory = 0x02000000; - - /* - * This is a 'best guess' check. We want to make sure - * we don't try this on a PReP box without OF - * -- Cort - */ - while (OFW_interface && ((unsigned long)OFW_interface < 0x10000000) ) - { - /* We need to restore the slightly inaccurate - * MSR so that OpenFirmware will behave. -- Tom - */ - _put_MSR(orig_MSR); - of_init(OFW_interface); - - /* get handle to memory description */ - res = of_finddevice("/memory@0", - &dev_handle); - if (res) - break; - - /* get the info */ - res = of_getprop(dev_handle, - "reg", - mem_info, - sizeof(mem_info), - &size); - if (res) - break; - - TotalMemory = mem_info[1]; - break; - } - - hold_residual->TotalMemory = TotalMemory; - residual = hold_residual; - - /* Enforce a sane MSR for booting. */ - _put_MSR(MSR_IP); } + /* Get our memory size either from residual data or the bridge. */ + if (residual && residual->TotalMemory) + TotalMemory = residual->TotalMemory; + else + TotalMemory = mpc10x_get_mem_size(MPC10X_MEM_MAP_A); + /* assume the chunk below 8M is free */ end_avail = (char *)0x00800000; @@ -363,6 +321,11 @@ sizeof(unsigned long); rec = (struct bi_record *)((unsigned long)rec + rec->size); + rec->tag = BI_MEMSIZE; + rec->data[0] = TotalMemory; + rec->size = sizeof(struct bi_record) + sizeof(unsigned long); + rec = (struct bi_record *)((unsigned long)rec + rec->size); + rec->tag = BI_CMD_LINE; memcpy( (char *)rec->data, cmd_line, strlen(cmd_line)+1); rec->size = sizeof(struct bi_record) + strlen(cmd_line) + 1; diff -uNr linux-2.4.19/arch/ppc/boot/prep/vreset.c linux-2.4.19bgl/arch/ppc/boot/prep/vreset.c --- linux-2.4.19/arch/ppc/boot/prep/vreset.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/prep/vreset.c 2003-07-02 10:43:52.000000000 -0500 @@ -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.16 03/12/02 16:07:29 paulus */ /* * vreset.c diff -uNr linux-2.4.19/arch/ppc/boot/simple/Makefile linux-2.4.19bgl/arch/ppc/boot/simple/Makefile --- linux-2.4.19/arch/ppc/boot/simple/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/simple/Makefile 2005-06-08 14:30:44.000000000 -0500 @@ -19,37 +19,134 @@ # 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_IBM_OPENBIOS),y) +ZIMAGE := zImage-TREE +ZIMAGEINITRD := zImage.initrd-TREE +TFTPIMAGE := /tftpboot/zImage.embedded +MISC := misc-embedded.o +endif ifeq ($(CONFIG_EMBEDDEDBOOT),y) ZIMAGE := zImage-EMBEDDED ZIMAGEINITRD := zImage.initrd-EMBEDDED TFTPIMAGE := /tftpboot/zImage.embedded MISC := misc-embedded.o endif +ifeq ($(CONFIG_EV64260),y) +ZIMAGE := zImage-EV64260 +ZIMAGEINITRD := zImage.initrd-EV64260 +EXTRA := direct.o misc-ev64260.o +TFTPIMAGE := /tftpboot/zImage.ev64260 +endif ifeq ($(CONFIG_GEMINI),y) ZIMAGE := zImage-SMON ZIMAGEINITRD := zImage.initrd-SMON -HEADHELP := direct.o +EXTRA := direct.o TFTPIMAGE := /tftpboot/zImage.gemini endif +ifeq ($(CONFIG_MENF1),y) +ZIMAGE := zImage-MENF1 +ZIMAGEINITRD := zImage.initrd-MENF1 +EXTRA := chrpmap.o +TFTPIMAGE := /tftpboot/zImage.menf1 +endif +ifeq ($(CONFIG_K2),y) +ZIMAGE := zImage-K2 +ZIMAGEINITRD := zImage.initrd-K2 +EXTRA := legacy.o +TFTPIMAGE := /tftpboot/zImage.k2 +endif +# kbuild-2.4 'feature', only one of these will ever by 'y' at a time. +# The rest will be unset. +ifeq ($(CONFIG_BGL),y) +ZIMAGE := zImage-BGL +ZIMAGEINITRD := zImage.initrd-BGL +EXTRA := direct.o +TFTPIMAGE := /tftpboot/zImage.bgl +CFLAGS += -I../../platforms +endif +ifeq ($(CONFIG_EBONY),y) +ZIMAGE := zImage-EBONY +ZIMAGEINITRD := zImage.initrd-EBONY +EXTRA := direct.o +TFTPIMAGE := /tftpboot/zImage.ebony +endif +ifeq ($(CONFIG_MCPN765)$(CONFIG_MVME5100)$(CONFIG_PRPMC750)$(CONFIG_PRPMC800)$(CONFIG_LOPEC)$(CONFIG_PPLUS),y) +ZIMAGE := zImage-PPLUS +ZIMAGEINITRD := zImage.initrd-PPLUS +EXTRA := direct.o ../common/mpc10x_memory.o +TFTPIMAGE := /tftpboot/zImage.pplus +ZNETBOOT := zImage.pplus +ZNETBOOTRD := zImage.initrd.pplus +endif +ifeq ($(CONFIG_PPLUS),y) +EXTRA := legacy.o +endif +ifeq ($(CONFIG_PAL4),y) +ZIMAGE := zImage-PAL4 +ZIMAGEINITRD := zImage.initrd-PAL4 +EXTRA := direct.o +TFTPIMAGE := /tftpboot/zImage.pal4 +endif +ifeq ($(CONFIG_PCORE),y) +ZIMAGE := zImage-PCORE +ZIMAGEINITRD := zImage.initrd-PCORE +EXTRA := chrpmap.o +TFTPIMAGE := /tftpboot/zImage.pcore +endif +#Ugh, should come up with a better nameing convention.. +ifeq ($(CONFIG_POWERPMC250),y) +ZIMAGE := zImage-PCORE +ZIMAGEINITRD := zImage.initrd-PCORE +EXTRA := direct.o +TFTPIMAGE := /tftpboot/zImage.pcore +endif +ifeq ($(CONFIG_SANDPOINT),y) +ZIMAGE := zImage-SP +ZIMAGEINITRD := zImage.initrd-SP +EXTRA := direct.o +TFTPIMAGE := /tftpboot/zImage.sandpoint +endif +ifeq ($(CONFIG_SPRUCE),y) +ZIMAGE := zImage-SPRUCE +ZIMAGEINITRD := zImage.initrd-SPRUCE +EXTRA := direct.o +MISC := misc-spruce.o +TFTPIMAGE := /tftpboot/zImage.spruce +endif +ifeq ($(CONFIG_ZX4500),y) +ZIMAGE := zImage-ZX4500 +ZIMAGEINITRD := zImage.initrd-ZX4500 +EXTRA := direct.o +TFTPIMAGE := /tftpboot/zImage.zx4500 +endif ifeq ($(CONFIG_SMP),y) TFTPIMAGE += .smp endif +ifeq ($(CONFIG_REDWOOD_4),y) +# This is a treeboot that needs init functions until the +# boot rom is sorted out (i.e. this is short lived) +EXTRA_AFLAGS := -Wa,-m405 +EXTRA := rw4/rw4_init.o rw4/rw4_init_brd.o +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) +ifeq ($(CONFIG_8260)$(CONFIG_40x),y) LD_ARGS := -T ../ld.script -Ttext 0x00400000 -Bstatic endif +ifdef CONFIG_440 +LD_ARGS := -T ../ld.script -Ttext 0x00800000 -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 $(HEADHELP) \ +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_40x) += embed_config.o obj-$(CONFIG_8xx) += embed_config.o obj-$(CONFIG_8260) += embed_config.o obj-$(CONFIG_BSEIP) += iic.o @@ -60,18 +157,22 @@ ifeq ($(CONFIG_SERIAL_CONSOLE),y) obj-$(CONFIG_8xx) += m8xx_tty.o obj-$(CONFIG_8260) += m8260_tty.o +obj-$(CONFIG_GT64XXX_CONSOLE) += gt64xxx_tty.o obj-$(CONFIG_SERIAL) += ../common/ns16550.o endif LIBS := ../lib/zlib.a # Tools +MKBUGBOOT := ../utils/mkbugboot MKPREP := ../utils/mkprep MKTREE := ../utils/mktree -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 + +# TODO: we need to use the variables in Make.rules (JGC) +VMLINUX_UNCOMPRESSED = ../images/vmlinux +RAMDISK_UNCOMPRESSED = ../../../../../../ramdisk/ramdisk.img + zvmlinux: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz ../common/dummy.o $(OBJCOPY) $(OBJCOPY_ARGS) \ @@ -94,11 +195,36 @@ $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr \ -R .sysmap +zvmlinux.initrdu: $(obj-y) $(LIBS) ../ld.script $(VMLINUX_UNCOMPRESSED) \ + ../common/dummy.o $(RAMDISK_UNCOMPRESSED) + $(OBJCOPY) $(OBJCOPY_ARGS) \ + --add-section=.ramdisk=$(RAMDISK_UNCOMPRESSED) \ + --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \ + --add-section=.image=$(VMLINUX_UNCOMPRESSED) \ + --set-section-flags=.image=contents,alloc,load,readonly,data \ + ../common/dummy.o image.o + $(LD) $(LD_ARGS) -o zvmlinux.initrd $(obj-y) image.o $(LIBS) + $(OBJCOPY) $(OBJCOPY_ARGS) zvmlinux.initrd zvmlinux.initrd -R .comment -R .stab -R .stabstr \ + -R .sysmap + +zvmlinux.initrdc: $(obj-y) $(LIBS) ../ld.script $(VMLINUX_UNCOMPRESSED) \ + ../common/dummy.o $(RAMDISK_UNCOMPRESSED).gz + $(OBJCOPY) $(OBJCOPY_ARGS) \ + --add-section=.ramdisk=$(RAMDISK_UNCOMPRESSED).gz \ + --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \ + --add-section=.image=$(VMLINUX_UNCOMPRESSED) \ + --set-section-flags=.image=contents,alloc,load,readonly,data \ + ../common/dummy.o image.o + $(LD) $(LD_ARGS) -o zvmlinux.initrd $(obj-y) image.o $(LIBS) + $(OBJCOPY) $(OBJCOPY_ARGS) zvmlinux.initrd zvmlinux.initrd -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 + mv zvmlinux ../images/zImage.elf + zImage.initrd: $(ZIMAGEINITRD) - rm -f zvmlinux.initrd + mv zvmlinux.initrd ../images/zImage.initrd.elf-sim znetboot: zImage ifneq ($(ZNETBOOT),) @@ -114,11 +240,63 @@ cp ../images/zImage.* $(TFTPIMAGE) endif +zImage-BGL: zvmlinux + ln -sf zImage.elf ../images/zvmlinux.bgl + $(MKTREE) zvmlinux ../images/zImage.bgl 0x800000 + +zImage.initrd-BGL: zvmlinux.initrdu + $(MKTREE) zvmlinux.initrd ../images/zImage.initrd.bgl 0x800000 + +zImage-EBONY: zvmlinux + ln -sf zImage.elf ../images/zvmlinux.ebony + $(MKTREE) zvmlinux ../images/zImage.ebony 0x800000 + +zImage.initrd-EBONY: zvmlinux.initrd + $(MKTREE) zvmlinux.initrd ../images/zImage.initrd.ebony 0x800000 + zImage-EMBEDDED: zvmlinux - mv zvmlinux ../images/zImage.embedded + ln -sf zImage.elf ../images/zImage.embedded zImage.initrd-EMBEDDED: zvmlinux.initrd - mv zvmlinux.initrd ../images/zImage.initrd.embedded + ln -sf zImage.initrd.elf ../images/zImage.initrd.embedded + +zImage-K2: zvmlinux + ln -sf zImage.elf ../images/zImage.k2 + +zImage.initrd-K2: zvmlinux.initrd + ln -sf zImage.initrd.elf ../images/zImage.initrd.k2 + +zImage-EV64260: zvmlinux + ln -sf zImage.elf ../images/zImage.ev64260 + +zImage.initrd-EV64260: zvmlinux.initrd + ln -sf zImage.initrd.elf ../images/zImage.initrd.ev64260 + +zImage-MENF1: zvmlinux + $(MKPREP) -pbp zvmlinux ../images/zImage.menf1 + +zImage.initrd-MENF1: zvmlinux.initrd + $(MKPREP) -pbp zvmlinux.initrd ../images/zImage.initrd.menf1 + +zImage-PAL4: zvmlinux + cp zvmlinux ../images/zImage.pal4 + +zImage.initrd-PAL4: zvmlinux.initrd + cp zvmlinux.initrd ../images/zImage.initrd.pal4 + +zImage-PCORE: zvmlinux + dd if=zvmlinux of=../images/zImage.pcore skip=64 bs=1k + +zImage.initrd-PCORE: zvmlinux.initrd + dd if=zvmlinux.initrd of=../images/zImage.initrd.pcore skip=64 bs=1k + +zImage-PPLUS: zvmlinux $(MKPREP) $(MKBUGBOOT) + $(MKPREP) -pbp zvmlinux ../images/zImage.pplus + $(MKBUGBOOT) zvmlinux ../images/zImage.bugboot + +zImage.initrd-PPLUS: zvmlinux.initrd $(MKPREP) $(MKBUGBOOT) + $(MKPREP) -pbp zvmlinux.initrd ../images/zImage.initrd.pplus + $(MKBUGBOOT) zvmlinux.initrd ../images/zImage.initrd.bugboot zImage-SMON: zvmlinux dd if=zvmlinux of=../images/zImage.gemini skip=64 bs=1k @@ -126,10 +304,28 @@ zImage.initrd-SMON: zvmlinux.initrd dd if=zvmlinux.initrd of=../images/zImage.initrd.gemini skip=64 bs=1k +zImage-SP: zvmlinux + ln -sf zImage.elf ../images/zImage.sandpoint + +zImage.initrd-SP: zvmlinux.initrd + ln -sf zImage.initrd.elf ../images/zImage.initrd.sandpoint + +zImage-SPRUCE: zvmlinux + $(MKTREE) zvmlinux ../images/zImage.spruce 0x800000 + +zImage.initrd-SPRUCE: zvmlinux.initrd + $(MKTREE) zvmlinux.initrd ../images/zImage.initrd.spruce 0x800000 + zImage-TREE: zvmlinux $(MKTREE) zvmlinux ../images/zImage.treeboot zImage.initrd-TREE: zvmlinux.initrd $(MKTREE) zvmlinux.initrd ../images/zImage.initrd.treeboot +zImage-ZX4500: zvmlinux + dd if=zvmlinux of=../images/zImage.zx4500 skip=64 bs=1k + +zImage.initrd-ZX4500: zvmlinux.initrd + dd if=zvmlinux.initrd of=../images/zImage.initrd.zx4500 skip=64 bs=1k + include $(TOPDIR)/Rules.make diff -uNr linux-2.4.19/arch/ppc/boot/simple/embed_config.c linux-2.4.19bgl/arch/ppc/boot/simple/embed_config.c --- linux-2.4.19/arch/ppc/boot/simple/embed_config.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/simple/embed_config.c 2003-07-02 10:43:26.000000000 -0500 @@ -13,6 +13,7 @@ #include #include +#include #ifdef CONFIG_8xx #include #endif @@ -20,12 +21,9 @@ #include #include #endif -#ifdef CONFIG_4xx +#ifdef CONFIG_40x #include #endif -#if defined(CONFIG_405GP) || defined(CONFIG_NP405H) || defined(CONFIG_NP405L) -#include -#endif /* For those boards that don't provide one. */ @@ -228,6 +226,23 @@ bd->bi_memsize = size * 1024 * 1024; } #endif /* LITE || CLASSIC || EP405 */ +#if defined(CONFIG_EP405) +static void +rpx_nvramsize(bd_t *bd, u_char *cp) +{ + uint size; + + size = 0; + + while (*cp != '\n') { + size *= 10; + size += (*cp) - '0'; + cp++; + } + + bd->bi_nvramsize = size * 1024; +} +#endif /* CONFIG_EP405 */ #endif /* Embedded Planet boards */ @@ -644,11 +659,111 @@ } #endif /* WILLOW */ -#ifdef CONFIG_TREEBOOT +#ifdef CONFIG_XILINX_ML300 +/* SAATODO: Remove this when CONFIG_XILINX_ML300_MACADDR is removed. */ +static int +char2dec(char c) +{ + if ('0' <= c && c <= '9') + return c - '0'; + else if ('a' <= c && c <= 'f') + return c - 'a' + 10; + else if ('A' <= c && c <= 'F') + return c - 'A' + 10; + else + return -1; +} + +void +embed_config(bd_t ** bdp) +{ + static const unsigned long line_size = 32; + static const unsigned long congruence_classes = 256; + unsigned long addr; + u_char *cp; + int i; + bd_t *bd; + + /* + * At one point, we were getting machine checks. Linux was not + * invalidating the data cache before it was enabled. The + * following code was added to do that. Soon after we had done + * that, we found the real reasons for the machine checks. I've + * run the kernel a few times with the following code + * temporarily removed without any apparent problems. However, + * I objdump'ed the kernel and boot code and found out that + * there were no other dccci's anywhere, so I put the code back + * in and have been reluctant to remove it. It seems safer to + * just leave it here. + */ + for (addr = 0; + addr < (congruence_classes * line_size); addr += line_size) { + __asm__("dccci 0,%0": :"b"(addr)); + } + + bd = &bdinfo; + *bdp = bd; + bd->bi_memsize = XPAR_DDR_0_SIZE; + bd->bi_intfreq = XPAR_CORE_CLOCK_FREQ_HZ; + bd->bi_busfreq = XPAR_PLB_CLOCK_FREQ_HZ; + + /* SAATODO: Use board's MAC address once that is defined. */ + if (1) { + char MAC_string[] = CONFIG_XILINX_ML300_MACADDR; + int good_addr = 1; + + if (sizeof (MAC_string) != 13) + good_addr = 0; + else { + char *s = MAC_string; + cp = bd->bi_enetaddr; + + while (s < MAC_string + 12) { + int msn, lsn; + msn = char2dec(*s++); + lsn = char2dec(*s++); + if (msn < 0 || lsn < 0) { + good_addr = 0; + break; + } + *cp++ = msn << 4 | lsn; + } + } + if (!good_addr) { + cp = (u_char *) def_enet_addr; + for (i = 0; i < 6; i++) { + bd->bi_enetaddr[i] = *cp++; + } + } + } +} +#endif /* CONFIG_XILINX_ML300 */ + +#ifdef CONFIG_IBM_OPENBIOS /* This could possibly work for all treeboot roms. */ -#define BOARD_INFO_VECTOR 0xFFFE0B50 +#if defined(CONFIG_ASH) || defined(CONFIG_BEECH) +#define BOARD_INFO_VECTOR 0xFFF80B50 /* openbios 1.19 moved this vector down - armin */ +#else +#define BOARD_INFO_VECTOR 0xFFFE0B50 +#endif +#ifdef CONFIG_BEECH +static void +get_board_info(bd_t **bdp) +{ + typedef void (*PFV)(bd_t *bd); + ((PFV)(*(unsigned long *)BOARD_INFO_VECTOR))(*bdp); + return; +} + +void +embed_config(bd_t **bdp) +{ + *bdp = &bdinfo; + get_board_info(bdp); +} +#else /* !CONFIG_BEECH */ void embed_config(bd_t **bdp) { @@ -664,8 +779,8 @@ /* shut down the Ethernet controller that the boot rom * sometimes leaves running. */ - mtdcr(DCRN_MALCR, MALCR_MMSR); /* 1st reset MAL */ - while (mfdcr(DCRN_MALCR) & MALCR_MMSR) {}; /* wait for the reset */ + mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR); /* 1st reset MAL */ + while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; /* wait for the reset */ emacp->em0mr0 = 0x20000000; /* then reset EMAC */ eieio(); #endif @@ -690,33 +805,59 @@ bd->bi_pci_enetaddr[i] = *cp++; #endif } + bd->bi_tbfreq = 200 * 1000 * 1000; bd->bi_intfreq = 200000000; bd->bi_busfreq = 100000000; #ifdef CONFIG_PCI bd->bi_pci_busfreq = 66666666; #endif - /* Yeah, this look weird, but on Redwood 4 they are - * different object in the structure. When RW5 uses - * OpenBIOS, it requires a special value. - */ -#ifdef CONFIG_REDWOOD_5 - bd->bi_intfreq = 200 * 1000 * 1000; - bd->bi_busfreq = 0; - - bd->bi_tbfreq = 27 * 1000 * 1000; -#elif CONFIG_REDWOOD_4 - bd->bi_tbfreq = bd->bi_intfreq; -#endif } -} + /* Yeah, this look weird, but on Redwood 4 they are + * different object in the structure. Sincr Redwwood 5 + * and Redwood 6 use OpenBIOS, it requires a special value. + */ +#if defined(CONFIG_REDWOOD_5) || defined (CONFIG_REDWOOD_6) + bd->bi_tbfreq = 27 * 1000 * 1000; #endif +} +#endif /* CONFIG_BEECH */ +#endif /* CONFIG_IBM_OPENBIOS */ #ifdef CONFIG_EP405 +#include + void embed_config(bd_t **bdp) { + u32 chcr0; u_char *cp; bd_t *bd; + volatile emac_t *emacp; + + /* Different versions of the PlanetCore firmware vary in how + they set up the serial port - in particular whether they + use the internal or external serial clock for UART0. Make + sure the UART is in a known state. */ + /* FIXME: We should use the board's 11.0592MHz external serial + clock - it will be more accurate for serial rates. For + now, however the baud rates in ep405.h are for the internal + clock. */ + chcr0 = mfdcr(DCRN_CHCR0); + if ( (chcr0 & 0x1fff) != 0x103e ) { + mtdcr(DCRN_CHCR0, (chcr0 & 0xffffe000) | 0x103e); + /* The following tricks serial_init() into resetting the baud rate */ + writeb(0, UART0_IO_BASE + UART_LCR); + } + + /* We haven't seen actual problems with the EP405 leaving the + * EMAC running (as we have on Walnut). But the registers + * suggest it may not be left completely quiescent. Reset it + * just to be sure. */ + emacp = (emac_t *)EMAC0_BASE; + mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR); /* 1st reset MAL */ + while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; /* wait for the reset */ + emacp->em0mr0 = 0x20000000; /* then reset EMAC */ + eieio(); bd = &bdinfo; *bdp = bd; @@ -739,6 +880,13 @@ } } + if (*cp == 'N') { + cp++; + if (*cp == 'V') { + cp += 2; + rpx_nvramsize(bd, cp); + } + } while ((*cp != '\n') && (*cp != 0xff)) cp++; @@ -759,3 +907,38 @@ } #endif +#ifdef CONFIG_RAINIER +/* Rainier uses vxworks bootrom */ +void +embed_config(bd_t **bdp) +{ + u_char *cp; + int i; + bd_t *bd; + + bd = &bdinfo; + *bdp = bd; + + for(i=0;i<8192;i+=32) { + __asm__("dccci 0,%0" :: "r" (i)); + } + __asm__("iccci 0,0"); + __asm__("sync;isync"); + + /* init ram for parity */ + memset(0, 0,0x400000); /* Lo memory */ + + + bd->bi_memsize = (32 * 1024 * 1024) ; + bd->bi_intfreq = 133000000; //the internal clock is 133 MHz + bd->bi_busfreq = 100000000; + bd->bi_pci_busfreq= 33000000; + + cp = (u_char *)def_enet_addr; + for (i=0; i<6; i++) { + bd->bi_enetaddr[i] = *cp++; + } + +} +#endif + diff -uNr linux-2.4.19/arch/ppc/boot/simple/head.S linux-2.4.19bgl/arch/ppc/boot/simple/head.S --- linux-2.4.19/arch/ppc/boot/simple/head.S 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/simple/head.S 2003-07-02 10:43:22.000000000 -0500 @@ -18,7 +18,7 @@ #include #include #include -#include "ppc_asm.h" +#include .text @@ -37,8 +37,8 @@ .globl start start: bl start_ -#ifdef CONFIG_TREEBOOT - /* The IBM "Tree" bootrom knows that the address of the bootrom +#ifdef CONFIG_IBM_OPENBIOS + /* The IBM OpenBIOS bootroms know that the address of the bootrom * read only structure is 4 bytes after _start. */ .long 0x62726f6d # structure ID - "brom" @@ -73,7 +73,8 @@ #ifdef CONFIG_6xx bl disable_6xx_mmu bl disable_6xx_l1cache -#if defined(CONFIG_FORCE) || defined(CONFIG_K2) || defined(CONFIG_EV64260) +#if defined(CONFIG_FORCE) || defined(CONFIG_K2) \ + || defined(CONFIG_EV64260) || defined(CONFIG_PAL4) bl _setup_L2CR #endif #endif diff -uNr linux-2.4.19/arch/ppc/boot/simple/legacy.S linux-2.4.19bgl/arch/ppc/boot/simple/legacy.S --- linux-2.4.19/arch/ppc/boot/simple/legacy.S 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/simple/legacy.S 2003-07-02 10:44:29.000000000 -0500 @@ -6,7 +6,7 @@ * This will go and setup ISA_io to 0x8000000 and return. */ -#include "ppc_asm.h" +#include .text diff -uNr linux-2.4.19/arch/ppc/boot/simple/misc-embedded.c linux-2.4.19bgl/arch/ppc/boot/simple/misc-embedded.c --- linux-2.4.19/arch/ppc/boot/simple/misc-embedded.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/simple/misc-embedded.c 2003-07-02 10:44:37.000000000 -0500 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,7 @@ char compiled_string[] = CONFIG_CMDLINE; #endif char ramroot_string[] = "root=/dev/ram"; -char netroot_string[] = "root=/dev/nfs rw ip=auto"; +char netroot_string[] = "root=/dev/nfs rw ip=on"; /* Serial port to use. */ unsigned long com_port; @@ -172,6 +173,11 @@ #endif while ( *cp ) putc(*cp++); +#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_VGA_CONSOLE) + /* + * If they have a console, allow them to edit the command line. + * Otherwise, don't bother wasting the five seconds. + */ while (timer++ < 5*1000) { if (tstc()) { while ((ch = getc()) != '\n' && ch != '\r') { @@ -195,6 +201,7 @@ } udelay(1000); /* 1 msec */ } +#endif *cp = 0; puts("\nUncompressing Linux..."); @@ -231,7 +238,9 @@ rec = (struct bi_record *)((unsigned long)rec + rec->size); } puts("Now booting the kernel\n"); +#ifdef CONFIG_SERIAL_CONSOLE serial_close(com_port); +#endif return (unsigned long)hold_residual; } diff -uNr linux-2.4.19/arch/ppc/boot/utils/Makefile linux-2.4.19bgl/arch/ppc/boot/utils/Makefile --- linux-2.4.19/arch/ppc/boot/utils/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/utils/Makefile 2003-07-02 10:44:30.000000000 -0500 @@ -10,7 +10,8 @@ all: dummy # Simple programs with 1 file and no extra CFLAGS -UTILS = addnote hack-coff mkprep mknote mktree +UTILS = addnote hack-coff mkprep mknote mkbugboot mktree \ + addSystemMap addRamdDisk $(UTILS): $(HOSTCC) $(HOSTCFLAGS) -o $@ $@.c diff -uNr linux-2.4.19/arch/ppc/boot/utils/addnote.c linux-2.4.19bgl/arch/ppc/boot/utils/addnote.c --- linux-2.4.19/arch/ppc/boot/utils/addnote.c 2001-05-24 17:02:07.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/utils/addnote.c 2003-07-02 10:43:06.000000000 -0500 @@ -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 22:20:10 paulus */ /* * Program to hack in a PT_NOTE program header entry in an ELF file. diff -uNr linux-2.4.19/arch/ppc/boot/utils/hack-coff.c linux-2.4.19bgl/arch/ppc/boot/utils/hack-coff.c --- linux-2.4.19/arch/ppc/boot/utils/hack-coff.c 2001-05-24 17:02:07.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/utils/hack-coff.c 2003-07-02 10:44:38.000000000 -0500 @@ -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 22:20:10 paulus */ /* * hack-coff.c - hack the header of an xcoff file to fill in diff -uNr linux-2.4.19/arch/ppc/boot/utils/mknote.c linux-2.4.19bgl/arch/ppc/boot/utils/mknote.c --- linux-2.4.19/arch/ppc/boot/utils/mknote.c 2001-05-24 17:02:07.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/utils/mknote.c 2003-07-02 10:44:01.000000000 -0500 @@ -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 22:20:10 paulus */ /* * Copyright (C) Cort Dougan 1999. diff -uNr linux-2.4.19/arch/ppc/boot/utils/mkprep.c linux-2.4.19bgl/arch/ppc/boot/utils/mkprep.c --- linux-2.4.19/arch/ppc/boot/utils/mkprep.c 2001-05-24 17:02:07.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/boot/utils/mkprep.c 2003-07-02 10:43:17.000000000 -0500 @@ -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 22:20:09 paulus */ /* * Makes a prep bootable image which can be dd'd onto diff -uNr linux-2.4.19/arch/ppc/config.in linux-2.4.19bgl/arch/ppc/config.in --- linux-2.4.19/arch/ppc/config.in 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/config.in 2005-06-08 14:30:44.000000000 -0500 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.config.in 1.51 03/07/02 13:36:31 trini +# BK Id: SCCS/s.config.in 1.96 11/27/01 16:34:08 paulus # # For a description of the syntax of this configuration file, # see Documentation/kbuild/config-language.txt. @@ -13,6 +13,7 @@ mainmenu_option next_comment comment 'Code maturity level options' bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL +bool 'Prompt for advanced kernel configuration options' CONFIG_ADVANCED_OPTIONS endmenu mainmenu_option next_comment @@ -30,22 +31,30 @@ define_bool CONFIG_PPC32 y choice 'Processor Type' \ "6xx/7xx/74xx/8260 CONFIG_6xx \ - 4xx CONFIG_4xx \ + 40x CONFIG_40x \ + 440 CONFIG_440 \ POWER3 CONFIG_POWER3 \ - POWER4 CONFIG_POWER4 \ - 8xx CONFIG_8xx" 6xx + 8xx CONFIG_8xx \ + iSeries CONFIG_PPC_ISERIES" 6xx + +if [ "$CONFIG_40x" = "y" -o "$CONFIG_440" = "y" ]; then + define_bool CONFIG_4xx y +fi if [ "$CONFIG_6xx" = "y" ]; then bool 'MPC8260 CPM Support' CONFIG_8260 fi -if [ "$CONFIG_POWER3" = "y" -o "$CONFIG_POWER4" = "y" ]; then +if [ "$CONFIG_POWER3" = "y" ]; then define_bool CONFIG_PPC64BRIDGE y define_bool CONFIG_ALL_PPC y fi -if [ "$CONFIG_6xx" = "y" -o "$CONFIG_POWER3" = "y" -o \ - "$CONFIG_POWER4" = "y" ]; then +if [ "$CONFIG_PPC_ISERIES" = "y" ]; then + define_bool CONFIG_PPC64BRIDGE y +fi + +if [ "$CONFIG_6xx" = "y" -o "$CONFIG_POWER3" = "y" ]; then define_bool CONFIG_PPC_STD_MMU y else define_bool CONFIG_PPC_STD_MMU n @@ -53,17 +62,59 @@ if [ "$CONFIG_8260" = "y" ]; then define_bool CONFIG_SERIAL_CONSOLE y - bool 'Support for EST8260' CONFIG_EST8260 + choice 'Machine Type' \ + "EST8260 CONFIG_EST8260 \ + SBS8260 CONFIG_SBS8260 \ + RPXSUPER CONFIG_RPX6 \ + TQM8260 CONFIG_TQM8260 \ + Willow CONFIG_WILLOW" Willow fi -if [ "$CONFIG_4xx" = "y" ]; then +if [ "$CONFIG_40x" = "y" ]; then choice 'Machine Type' \ - "Oak CONFIG_OAK \ - Walnut CONFIG_WALNUT" Oak + "Ash CONFIG_ASH \ + Ceder CONFIG_CEDER \ + Beech CONFIG_BEECH \ + CPCI405 CONFIG_CPCI405 \ + EP405/EP405PC CONFIG_EP405 \ + Oak CONFIG_OAK \ + Rainier CONFIG_RAINIER \ + Redwood-4 CONFIG_REDWOOD_4 \ + Redwood-5 CONFIG_REDWOOD_5 \ + Redwood-6 CONFIG_REDWOOD_6 \ + Sycamore CONFIG_SYCAMORE \ + Tivo CONFIG_TIVO \ + Walnut CONFIG_WALNUT \ + Xilinx-ML300 CONFIG_XILINX_ML300" Walnut + + if [ "$CONFIG_EP405" = "y" ]; then + bool 'EP405PC Support' CONFIG_EP405PC + fi +fi + +if [ "$CONFIG_440" = "y" ]; then + define_bool CONFIG_BOOKE y + define_bool CONFIG_NOT_COHERENT_CACHE y + define_bool CONFIG_IBM_OCP y + define_bool CONFIG_GEN550_KGDB y + define_bool CONFIG_PIN_TLB y + define_int CONFIG_IBM_OCP_MAL_CNT 1 + + choice 'Machine Type' \ + "Bgl CONFIG_BGL \ + Ebony CONFIG_EBONY" Ebony + + if [ "$CONFIG_BGL" = "y" ]; then + define_bool CONFIG_440X5 y + define_bool CONFIG_DHUMMER_BGL y + define_bool LINUX_BGL_STDINT y + define_bool CONFIG_HEATER_MODE_BGL y + fi fi if [ "$CONFIG_8xx" = "y" ]; then define_bool CONFIG_SERIAL_CONSOLE y + define_bool CONFIG_NOT_COHERENT_CACHE y choice 'Machine Type' \ "RPX-Lite CONFIG_RPXLITE \ @@ -75,11 +126,16 @@ TQM855L CONFIG_TQM855L \ TQM860L CONFIG_TQM860L \ FPS850L CONFIG_FPS850L \ - TQM860 CONFIG_TQM860 \ SPD823TS CONFIG_SPD823TS \ IVMS8 CONFIG_IVMS8 \ IVML24 CONFIG_IVML24 \ SM850 CONFIG_SM850 \ + HERMES CONFIG_HERMES_PRO \ + IP860 CONFIG_IP860 \ + LWMON CONFIG_LWMON \ + PCU_E CONFIG_PCU_E \ + CCM CONFIG_CCM \ + LANTEC CONFIG_LANTEC \ MBX CONFIG_MBX \ WinCept CONFIG_WINCEPT" RPX-Lite @@ -96,8 +152,82 @@ if [ "$CONFIG_6xx" = "y" -a "$CONFIG_8260" = "n" ]; then choice 'Machine Type' \ "CHRP/PowerMac/PReP CONFIG_ALL_PPC \ - Amiga-APUS CONFIG_APUS \ - Synergy-Gemini CONFIG_GEMINI" CHRP/PowerMac/PReP + Amiga-APUS CONFIG_APUS \ + Cogent-Willow CONFIG_WILLOW \ + Force-PowerCore CONFIG_PCORE \ + Force-PowerPMC250 CONFIG_POWERPMC250 \ + Galileo-EV-64260-BP CONFIG_EV64260 \ + IBM-Spruce CONFIG_SPRUCE \ + MEN-F1 CONFIG_MENF1 \ + Motorola-LoPEC CONFIG_LOPEC \ + Motorola-MCPN765 CONFIG_MCPN765 \ + Motorola-MVME5100 CONFIG_MVME5100 \ + Motorola-PowerPlus CONFIG_PPLUS \ + Motorola-PrPMC750 CONFIG_PRPMC750 \ + Motorola-PrPMC800 CONFIG_PRPMC800 \ + Motorola-Sandpoint CONFIG_SANDPOINT \ + SBS-Adirondack CONFIG_ADIR \ + SBS-K2 CONFIG_K2 \ + SBS-Palomar4 CONFIG_PAL4 \ + Synergy-Gemini CONFIG_GEMINI \ + Zynx-ZX4500 CONFIG_ZX4500" CHRP/PowerMac/PReP +fi + +if [ "$CONFIG_PCORE" = "y" \ + -o "$CONFIG_POWERPMC250" = "y" ]; then + define_bool CONFIG_FORCE y +fi + +if [ "$CONFIG_FORCE" = "y" \ + -o "$CONFIG_MENF1" = "y" \ + -o "$CONFIG_SANDPOINT" = "y" \ + -o "$CONFIG_ZX4500" = "y" ]; then + bool 'Enable MPC10x store gathering' CONFIG_MPC10X_STORE_GATHERING +fi + +if [ "$CONFIG_EV64260" = "y" ]; then + define_bool CONFIG_GT64260 y + define_int CONFIG_SERIAL_CONSOLE_BAUD 115200 +fi + +if [ "$CONFIG_GT64260" = "y" ]; then + mainmenu_option next_comment + comment 'Galileo GT64260 Options' + bool 'GT64260 Ethernet Ports' CONFIG_GT64260_ETH + if [ "$CONFIG_GT64260_ETH" = "y" ]; then + bool ' EVB64260 - Ethernet Port 0' CONFIG_GT64260_ETH_0 + string ' MAC Address' CONFIG_GT64260_ETH_0_MACADDR "feffff000000" + bool ' EVB64260 - Ethernet Port 1' CONFIG_GT64260_ETH_1 + string ' MAC Address' CONFIG_GT64260_ETH_1_MACADDR "feffff000001" + bool ' EVB64260 - Ethernet Port 2' CONFIG_GT64260_ETH_2 + string ' MAC Address' CONFIG_GT64260_ETH_2_MACADDR "feffff000002" + fi + bool 'GT64260 MPSC Serial Ports' CONFIG_GT64260_MPSC + if [ "$CONFIG_GT64260_MPSC" = "y" ]; then + bool ' MPSC Port 0' CONFIG_GT64260_MPSC_0 + bool ' MPSC Port 1' CONFIG_GT64260_MPSC_1 + bool ' MPSC Port 0 as system console' CONFIG_GT64260_CONSOLE + fi + if [ "$CONFIG_GT64260_CONSOLE" = "y" ]; then + define_bool CONFIG_SERIAL_CONSOLE y + fi + endmenu +fi + +if [ "$CONFIG_K2" = "y" ]; then + bool 'Enable CPC710 data gathering' CONFIG_CPC710_DATA_GATHERING +fi + +if [ "$CONFIG_MVME5100" = "y" ]; then + bool 'MVME5100 configured with an IPMC761' CONFIG_MVME5100_IPMC761_PRESENT +fi + +if [ "$CONFIG_SANDPOINT" = "y" ]; then + bool 'Sandpoint X3' CONFIG_SANDPOINT_X3 +fi + +if [ "$CONFIG_SANDPOINT_X3" = "y" -o "$CONFIG_LOPEC" = "y" ]; then + define_bool CONFIG_EPIC_SERIAL_MODE y fi if [ "$CONFIG_PPC_STD_MMU" != "y" ]; then @@ -122,6 +252,107 @@ bool 'Math emulation' CONFIG_MATH_EMULATION fi +if [ "$CONFIG_40x" = "y" ]; then +# It's often necessary to know the specific 4xx processor type. +# Fortunately, it is impled (so far) from the board type, so we +# don't need to ask more redundant questions. + if [ "$CONFIG_ASH" = "y" ]; then + define_bool CONFIG_NP405H y + define_bool CONFIG_IBM_OPENBIOS y + define_bool CONFIG_BIOS_FIXUP y + define_bool CONFIG_IBM405_ERR77 y + define_bool CONFIG_IBM_OCP y + fi + if [ "$CONFIG_CEDER" = "y" ]; then + define_bool CONFIG_NP405L y + define_bool CONFIG_IBM_OPENBIOS y + define_bool CONFIG_IBM405_ERR77 y + define_bool CONFIG_IBM_OCP y + fi + if [ "$CONFIG_CPCI405" = "y" ]; then + define_bool CONFIG_405GP y + define_bool CONFIG_IBM405_ERR77 y + define_bool CONFIG_IBM_OCP y + fi + if [ "$CONFIG_EP405" = "y" ]; then + define_bool CONFIG_405GP y + define_bool CONFIG_BIOS_FIXUP y + define_bool CONFIG_EMBEDDEDBOOT y + define_bool CONFIG_IBM405_ERR77 y + define_bool CONFIG_IBM_OCP y + fi + if [ "$CONFIG_RAINIER" = "y" ]; then + define_bool CONFIG_NP405GS y + define_bool CONFIG_EMBEDDEDBOOT y + define_bool CONFIG_IBM405_ERR77 y + define_bool CONFIG_IBM_OCP y + fi + if [ "$CONFIG_XILINX_ML300" = "y" ]; then + define_bool CONFIG_VIRTEX_II_PRO y + define_bool CONFIG_EMBEDDEDBOOT y + define_bool CONFIG_IBM405_ERR77 y + define_bool CONFIG_XILINX_OCP y + string 'Temporary: Hardcoded MAC Address' CONFIG_XILINX_ML300_MACADDR 000A35002200 + fi + if [ "$CONFIG_OAK" = "y" -o "$CONFIG_TIVO" = "y" ]; then + define_bool CONFIG_403GCX y + define_bool CONFIG_IBM_OPENBIOS y + fi + if [ "$CONFIG_REDWOOD_4" = "y" -o "$CONFIG_REDWOOD_5" = "y" \ + -o "$CONFIG_REDWOOD_6" = "y" ]; then + define_bool CONFIG_STB03xxx y + define_bool CONFIG_IBM_OPENBIOS y + define_bool CONFIG_IBM405_ERR77 y + define_bool CONFIG_IBM_OCP y + fi + if [ "$CONFIG_WALNUT" = "y" ]; then + define_bool CONFIG_405GP y + define_bool CONFIG_BIOS_FIXUP y + define_bool CONFIG_IBM_OPENBIOS y + define_bool CONFIG_IBM405_ERR77 y + define_bool CONFIG_IBM_OCP y + fi + if [ "$CONFIG_BEECH" = "y" ]; then + define_bool CONFIG_405LP y + define_bool CONFIG_IBM_OPENBIOS y + define_bool CONFIG_IBM405_ERR77 y + define_bool CONFIG_IBM_OCP y + fi + if [ "$CONFIG_SYCAMORE" = "y" ]; then + define_bool CONFIG_405GPR y + define_bool CONFIG_BIOS_FIXUP y + define_bool CONFIG_IBM_OPENBIOS y + define_bool CONFIG_IBM405_ERR77 y + define_bool CONFIG_IBM_OCP y + fi + + dep_bool 'Power Management support (experimental)' CONFIG_PM $CONFIG_EXPERIMENTAL + + if [ "$CONFIG_40x" = "y" ]; then + choice 'TTYS0 device and default console' \ + "UART0 CONFIG_UART0_TTYS0 \ + UART1 CONFIG_UART0_TTYS1" UART0 + fi + + define_bool CONFIG_IBM405_ERR51 y + define_bool CONFIG_NOT_COHERENT_CACHE y +fi + +if [ "$CONFIG_4xx" = "y" ]; then + bool 'PPC4xx DMA controller support' CONFIG_PPC4xx_DMA + if [ "$CONFIG_PPC4xx_DMA" = "y" ]; then + if [ "$CONFIG_405GP" = "y" -o "$CONFIG_NP405L" = "y" \ + -o "$CONFIG_NP405H" = "y" -o "$CONFIG_NP405GS" = "y" \ + -o "$CONFIG_440" = "y" ]; then + define_bool CONFIG_PPC4xx_EDMA y + fi + if [ "$CONFIG_STB03xxx" = "y" ]; then + define_bool CONFIG_STBXXX_DMA y + fi + fi + dep_bool 'OCP Device proc fs support (experimental)' CONFIG_OCP_PROC $CONFIG_IBM_OCP +fi + if [ "$CONFIG_8xx" = "y" -o "$CONFIG_8260" = "y" ]; then define_bool CONFIG_EMBEDDEDBOOT y fi @@ -131,8 +362,39 @@ comment 'General setup' bool 'High memory support (experimental)' CONFIG_HIGHMEM +if [ "$CONFIG_ADVANCED_OPTIONS" = "y" ]; then + if [ "$CONFIG_HIGHMEM" = "y" ]; then + bool " Set high memory pool address" CONFIG_HIGHMEM_START_BOOL + if [ "$CONFIG_HIGHMEM_START_BOOL" = "y" ]; then + hex " Virtual start address of high memory pool" CONFIG_HIGHMEM_START 0xfe000000 + fi + bool " Set maximum low memory" CONFIG_LOWMEM_SIZE_BOOL + if [ "$CONFIG_LOWMEM_SIZE_BOOL" = "y" ]; then + hex " Maximum low memory size (in bytes)" CONFIG_LOWMEM_SIZE 0x20000000 + fi + fi -define_bool CONFIG_ISA n + bool "Set custom kernel base address" CONFIG_KERNEL_START_BOOL + if [ "$CONFIG_KERNEL_START_BOOL" = "y" ]; then + hex " Virtual address of kernel base" CONFIG_KERNEL_START 0xc0000000 + fi + bool "Set custom user task size" CONFIG_TASK_SIZE_BOOL + if [ "$CONFIG_TASK_SIZE_BOOL" = "y" ]; then + hex " Size of user task space" CONFIG_TASK_SIZE 0x80000000 + fi + if [ "$CONFIG_8xx" = "y" ]; then + bool "Pinned Kernel TLBs (860 ONLY)" CONFIG_PIN_TLB + fi + if [ "$CONFIG_40x" = "y" ]; then + bool "Pinned Kernel TLBs" CONFIG_PIN_TLB + fi +fi + +if [ "$CONFIG_ALL_PPC" = "y" ]; then + bool 'Support for ISA-bus hardware' CONFIG_ISA +else + define_bool CONFIG_ISA n +fi define_bool CONFIG_EISA n define_bool CONFIG_SBUS n @@ -140,7 +402,8 @@ define_bool CONFIG_MCA n if [ "$CONFIG_4xx" = "y" -o "$CONFIG_8260" = "y" ]; then - define_bool CONFIG_PCI n + bool "Enable PCI" CONFIG_PCI + bool 'PC PS/2 style Keyboard' CONFIG_PC_KEYBOARD else if [ "$CONFIG_8xx" = "y" ]; then bool 'QSpan PCI' CONFIG_PCI_QSPAN @@ -150,7 +413,12 @@ bool 'PCI for Permedia2' CONFIG_PCI_PERMEDIA define_bool CONFIG_PCI $CONFIG_PCI_PERMEDIA else - define_bool CONFIG_PCI y + if [ "$CONFIG_PPC_ISERIES" = "y" ]; then + bool "IBM iSeries Native I/O Support" CONFIG_PCI_ISERIES + define_bool CONFIG_PCI $CONFIG_PCI_ISERIES + else + define_bool CONFIG_PCI y + fi fi fi fi @@ -180,7 +448,7 @@ source drivers/parport/Config.in -if [ "$CONFIG_4xx" != "y" ]; then +if [ "$CONFIG_PPC_ISERIES" != "y" ]; then if [ "$CONFIG_APUS" != "y" ]; then tristate 'Support for /dev/rtc' CONFIG_PPC_RTC else @@ -195,9 +463,12 @@ if [ "$CONFIG_ALL_PPC" = "y" ]; then bool 'Support for Open Firmware device tree in /proc' CONFIG_PROC_DEVICETREE bool 'Support for RTAS (RunTime Abstraction Services) in /proc' CONFIG_PPC_RTAS - bool 'Support for early boot text console (BootX or OpenFirmware only)' CONFIG_BOOTX_TEXT bool 'Support for PReP Residual Data' CONFIG_PREP_RESIDUAL dep_bool ' Support for reading of PReP Residual Data in /proc' CONFIG_PROC_PREPRESIDUAL $CONFIG_PREP_RESIDUAL + define_bool CONFIG_PPCBUG_NVRAM y +fi +if [ "$CONFIG_PPLUS" = "y" -o "$CONFIG_LOPEC" = "y" ]; then + bool 'Enable reading PPCBUG NVRAM during boot' CONFIG_PPCBUG_NVRAM fi bool 'Default bootloader kernel arguments' CONFIG_CMDLINE_BOOL @@ -272,8 +543,12 @@ fi endmenu +source drivers/message/fusion/Config.in + source drivers/ieee1394/Config.in +source drivers/message/i2o/Config.in + if [ "$CONFIG_NET" = "y" ]; then mainmenu_option next_comment comment 'Network device support' @@ -312,7 +587,7 @@ mainmenu_option next_comment comment 'Console drivers' -if [ "$CONFIG_4xx" != "y" -a "$CONFIG_8xx" != "y" ]; then +if [ "$CONFIG_40x" != "y" -a "$CONFIG_8xx" != "y" ]; then bool 'Support for VGA Console' CONFIG_VGA_CONSOLE fi source drivers/video/Config.in @@ -321,6 +596,33 @@ fi endmenu + +if [ "$CONFIG_PPC_ISERIES" = "y" ]; then + mainmenu_option next_comment + comment 'iSeries device drivers' + tristate 'iSeries Virtual Console Support' CONFIG_VIOCONS + tristate 'iSeries Virtual I/O disk support' CONFIG_VIODASD + if [ "$CONFIG_VIODASD" = "y" -o "$CONFIG_VIODASD" = "m" ]; then + bool 'iSeries Virtual disk IDE emulation' CONFIG_VIODASD_IDE + fi + tristate 'iSeries Virtual I/O CD support' CONFIG_VIOCD + if [ "$CONFIG_VIOCD" = "y" -o "$CONFIG_VIOCD" = "m" ]; then + bool 'iSeries Virtual CD Aztech emulation' CONFIG_VIOCD_AZTECH + fi + tristate 'iSeries Virtual Tape Support' CONFIG_VIOTAPE + tristate 'iSeries Virtual Ethernet driver support' CONFIG_VETH + if [ "$CONFIG_VIOCONS" != "n" -o "$CONFIG_VIODASD" != "n" \ + -o "$CONFIG_VIOTAPE" != "n" -o "$CONFIG_VIOCD" != "n" ]; then + define_bool CONFIG_VIOPATH y + fi + endmenu +fi + +if [ "$CONFIG_VIOCD" = "y" ]; then + define_bool CONFIG_CD_NO_IDESCSI y + define_bool CONFIG_BLK_DEV_IDECD y +fi + source drivers/input/Config.in mainmenu_option next_comment @@ -391,6 +693,20 @@ source arch/ppc/8260_io/Config.in fi +if [ "$CONFIG_40x" = "y" ]; then + mainmenu_option next_comment + comment 'IBM 4xx options' + if [ "$CONFIG_STB03xxx" = "y" ]; then + bool 'STB IR Keyboard' CONFIG_STB_KB + bool 'SICC Serial port' CONFIG_SERIAL_SICC + if [ "$CONFIG_SERIAL_SICC" = "y" -a "$CONFIG_UART0_TTYS1" = "y" ]; then + define_bool CONFIG_UART1_DFLT_CONSOLE y + define_bool CONFIG_SERIAL_SICC_CONSOLE y + fi + fi + endmenu +fi + source drivers/usb/Config.in source net/bluetooth/Config.in @@ -400,5 +716,30 @@ bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ bool 'Include kgdb kernel debugger' CONFIG_KGDB +if [ "$CONFIG_KGDB" = "y" ]; then + choice 'Serial Port' \ + "ttyS0 CONFIG_KGDB_TTYS0 \ + ttyS1 CONFIG_KGDB_TTYS1 \ + ttyS2 CONFIG_KGDB_TTYS2 \ + ttyS3 CONFIG_KGDB_TTYS3" ttyS1 +fi bool 'Include xmon kernel debugger' CONFIG_XMON +bool 'Include BDI-2000 user context switcher' CONFIG_BDI_SWITCH +if [ "$CONFIG_KGDB" = "y" -o "$CONFIG_XMON" = "y" \ + -o "$CONFIG_BDI_SWITCH" = "y" ]; then + bool 'Add any additional compile options' CONFIG_MORE_COMPILE_OPTIONS + if [ "$CONFIG_MORE_COMPILE_OPTIONS" = "y" ]; then + string 'Additional compile arguments' CONFIG_COMPILE_OPTIONS "-g -ggdb" + fi +fi + +if [ "$CONFIG_ALL_PPC" = "y" ]; then + bool 'Support for early boot text console (BootX or OpenFirmware only)' CONFIG_BOOTX_TEXT +fi +if [ "$CONFIG_MCPN765" = "y" -o "$CONFIG_SANDPOINT" = "y" \ + -o "$CONFIG_ZX4500" = "y" -o "$CONFIG_PRPMC800" = "y" \ + -o "$CONFIG_4xx" = "y" -o "$CONFIG_GT64260" = "y" \ + -o "$CONFIG_LOPEC" = "y" -o "$CONFIG_PPLUS" = "y" ]; then + bool 'Support for early boot texts over serial port' CONFIG_SERIAL_TEXT_DEBUG +fi endmenu diff -uNr linux-2.4.19/arch/ppc/configs/IVMS8_defconfig linux-2.4.19bgl/arch/ppc/configs/IVMS8_defconfig --- linux-2.4.19/arch/ppc/configs/IVMS8_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/IVMS8_defconfig 2003-07-02 10:44:38.000000000 -0500 @@ -24,9 +24,8 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set CONFIG_8xx=y # CONFIG_PPC_STD_MMU is not set CONFIG_SERIAL_CONSOLE=y diff -uNr linux-2.4.19/arch/ppc/configs/SM850_defconfig linux-2.4.19bgl/arch/ppc/configs/SM850_defconfig --- linux-2.4.19/arch/ppc/configs/SM850_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/SM850_defconfig 2003-07-02 10:43:48.000000000 -0500 @@ -24,9 +24,8 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set CONFIG_8xx=y # CONFIG_PPC_STD_MMU is not set CONFIG_SERIAL_CONSOLE=y diff -uNr linux-2.4.19/arch/ppc/configs/SPD823TS_defconfig linux-2.4.19bgl/arch/ppc/configs/SPD823TS_defconfig --- linux-2.4.19/arch/ppc/configs/SPD823TS_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/SPD823TS_defconfig 2003-07-02 10:43:21.000000000 -0500 @@ -24,9 +24,8 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set CONFIG_8xx=y # CONFIG_PPC_STD_MMU is not set CONFIG_SERIAL_CONSOLE=y diff -uNr linux-2.4.19/arch/ppc/configs/TQM823L_defconfig linux-2.4.19bgl/arch/ppc/configs/TQM823L_defconfig --- linux-2.4.19/arch/ppc/configs/TQM823L_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/TQM823L_defconfig 2003-07-02 10:43:55.000000000 -0500 @@ -24,9 +24,8 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set CONFIG_8xx=y # CONFIG_PPC_STD_MMU is not set CONFIG_SERIAL_CONSOLE=y diff -uNr linux-2.4.19/arch/ppc/configs/TQM850L_defconfig linux-2.4.19bgl/arch/ppc/configs/TQM850L_defconfig --- linux-2.4.19/arch/ppc/configs/TQM850L_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/TQM850L_defconfig 2003-07-02 10:44:45.000000000 -0500 @@ -24,9 +24,8 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set CONFIG_8xx=y # CONFIG_PPC_STD_MMU is not set CONFIG_SERIAL_CONSOLE=y diff -uNr linux-2.4.19/arch/ppc/configs/TQM860L_defconfig linux-2.4.19bgl/arch/ppc/configs/TQM860L_defconfig --- linux-2.4.19/arch/ppc/configs/TQM860L_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/TQM860L_defconfig 2003-07-02 10:43:33.000000000 -0500 @@ -24,12 +24,13 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set CONFIG_8xx=y +# CONFIG_PPC_ISERIES is not set # CONFIG_PPC_STD_MMU is not set CONFIG_SERIAL_CONSOLE=y +CONFIG_NOT_COHERENT_CACHE=y # CONFIG_RPXLITE is not set # CONFIG_RPXCLASSIC is not set # CONFIG_BSEIP is not set @@ -39,12 +40,18 @@ # CONFIG_TQM855L is not set CONFIG_TQM860L=y # CONFIG_FPS850L is not set -# CONFIG_TQM860 is not set # CONFIG_SPD823TS is not set # CONFIG_IVMS8 is not set # CONFIG_IVML24 is not set # CONFIG_SM850 is not set +# CONFIG_HERMES_PRO is not set +# CONFIG_IP860 is not set +# CONFIG_LWMON is not set +# CONFIG_PCU_E is not set +# CONFIG_CCM is not set +# CONFIG_LANTEC is not set # CONFIG_MBX is not set +# CONFIG_IDIF860 is not set # CONFIG_WINCEPT is not set CONFIG_TQM8xxL=y # CONFIG_ALL_PPC is not set @@ -95,6 +102,7 @@ # Block devices # # CONFIG_BLK_DEV_FD is not set +# CONFIG_VIODASD is not set # CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set @@ -276,6 +284,7 @@ # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_SK98LIN is not set +# CONFIG_VETH is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PLIP is not set @@ -351,6 +360,7 @@ # CONFIG_SERIAL_NONSTANDARD is not set CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=32 +# CONFIG_VIOCONS is not set # # I2C support @@ -376,6 +386,7 @@ # Input core support is needed for joysticks # # CONFIG_QIC02_TAPE is not set +# CONFIG_VIOTAPE is not set # # Watchdog Cards @@ -510,10 +521,20 @@ # CONFIG_SCC3_ENET is not set # CONFIG_FEC_ENET is not set CONFIG_ENET_BIG_BUFFERS=y +CONFIG_SMC1_UART_RX_BDNUM=4 +CONFIG_SMC1_UART_RX_BDSIZE=32 +CONFIG_SMC1_UART_TX_BDNUM=4 +CONFIG_SMC1_UART_TX_BDSIZE=32 CONFIG_SMC2_UART=y # CONFIG_ALTSMC2 is not set # CONFIG_CONS_SMC2 is not set +CONFIG_UART_MAXIDL_SMC2=1 +CONFIG_SMC2_UART_RX_BDNUM=4 +CONFIG_SMC2_UART_RX_BDSIZE=32 +CONFIG_SMC2_UART_TX_BDNUM=4 +CONFIG_SMC2_UART_TX_BDSIZE=32 # CONFIG_USE_SCC_IO is not set +CONFIG_STATUS_LED=y # # Generic MPC8xx Options @@ -641,3 +662,4 @@ # CONFIG_MAGIC_SYSRQ is not set # CONFIG_KGDB is not set # CONFIG_XMON is not set +# CONFIG_BDI_SWITCH is not set diff -uNr linux-2.4.19/arch/ppc/configs/apus_defconfig linux-2.4.19bgl/arch/ppc/configs/apus_defconfig --- linux-2.4.19/arch/ppc/configs/apus_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/apus_defconfig 2003-07-02 10:44:19.000000000 -0500 @@ -24,9 +24,8 @@ CONFIG_PPC=y CONFIG_PPC32=y CONFIG_6xx=y -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set # CONFIG_8xx is not set # CONFIG_8260 is not set CONFIG_PPC_STD_MMU=y diff -uNr linux-2.4.19/arch/ppc/configs/bseip_defconfig linux-2.4.19bgl/arch/ppc/configs/bseip_defconfig --- linux-2.4.19/arch/ppc/configs/bseip_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/bseip_defconfig 2003-07-02 10:43:08.000000000 -0500 @@ -22,9 +22,8 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set CONFIG_8xx=y # CONFIG_PPC_STD_MMU is not set CONFIG_SERIAL_CONSOLE=y diff -uNr linux-2.4.19/arch/ppc/configs/common_defconfig linux-2.4.19bgl/arch/ppc/configs/common_defconfig --- linux-2.4.19/arch/ppc/configs/common_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/common_defconfig 2003-07-02 10:43:27.000000000 -0500 @@ -24,15 +24,29 @@ CONFIG_PPC=y CONFIG_PPC32=y CONFIG_6xx=y -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set # CONFIG_8xx is not set +# CONFIG_PPC_ISERIES is not set # CONFIG_8260 is not set CONFIG_PPC_STD_MMU=y CONFIG_ALL_PPC=y # CONFIG_APUS is not set +# CONFIG_SPRUCE is not set +# CONFIG_PCORE is not set +# CONFIG_POWERPMC250 is not set +# CONFIG_MENF1 is not set +# CONFIG_LOPEC is not set +# CONFIG_MCPN765 is not set +# CONFIG_MVME5100 is not set +# CONFIG_PRPMC750 is not set +# CONFIG_PRPMC800 is not set +# CONFIG_SANDPOINT is not set +# CONFIG_ADIR is not set +# CONFIG_K2 is not set # CONFIG_GEMINI is not set +# CONFIG_WILLOW is not set +# CONFIG_ZX4500 is not set # CONFIG_SMP is not set CONFIG_ALTIVEC=y CONFIG_TAU=y @@ -72,7 +86,6 @@ CONFIG_PPC601_SYNC_FIX=y CONFIG_PROC_DEVICETREE=y CONFIG_PPC_RTAS=y -CONFIG_BOOTX_TEXT=y CONFIG_PREP_RESIDUAL=y CONFIG_PROC_PREPRESIDUAL=y CONFIG_CMDLINE_BOOL=y @@ -99,6 +112,7 @@ # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_CISS_SCSI_TAPE is not set # CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_NBD is not set CONFIG_BLK_DEV_RAM=y @@ -165,6 +179,7 @@ CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m +# CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m @@ -172,6 +187,8 @@ # CONFIG_IP_NF_TARGET_LOG is not set CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_COMPAT_IPCHAINS=m CONFIG_IP_NF_NAT_NEEDED=y # CONFIG_IP_NF_COMPAT_IPFWADM is not set @@ -190,13 +207,6 @@ # Appletalk devices # # CONFIG_DEV_APPLETALK is not set -# CONFIG_LTPC is not set -# CONFIG_COPS is not set -# CONFIG_COPS_DAYNA is not set -# CONFIG_COPS_TANGENT is not set -# CONFIG_IPDDP is not set -# CONFIG_IPDDP_ENCAP is not set -# CONFIG_IPDDP_DECAP is not set # CONFIG_DECNET is not set # CONFIG_BRIDGE is not set # CONFIG_X25 is not set @@ -214,6 +224,11 @@ # CONFIG_NET_SCHED is not set # +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# # ATA/IDE/MFM/RLL support # CONFIG_IDE=y @@ -230,6 +245,7 @@ # CONFIG_BLK_DEV_HD is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEDISK_STROKE is not set # CONFIG_BLK_DEV_IDEDISK_VENDOR is not set # CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set # CONFIG_BLK_DEV_IDEDISK_IBM is not set @@ -244,6 +260,7 @@ # CONFIG_BLK_DEV_IDETAPE is not set CONFIG_BLK_DEV_IDEFLOPPY=y CONFIG_BLK_DEV_IDESCSI=y +# CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes @@ -255,12 +272,15 @@ CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y CONFIG_BLK_DEV_IDEDMA_PCI=y -CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y +# CONFIG_IDEDMA_ONLYDISK is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_PCI_WIP is not set +# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set +CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_AEC62XX_TUNING is not set # CONFIG_BLK_DEV_ALI15X3 is not set @@ -268,6 +288,7 @@ # CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_AMD74XX_OVERRIDE is not set CONFIG_BLK_DEV_CMD64X=y +# CONFIG_BLK_DEV_CMD680 is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set @@ -336,6 +357,7 @@ CONFIG_SCSI_AIC7XXX=m 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 @@ -381,6 +403,7 @@ # CONFIG_SCSI_DEBUG is not set CONFIG_SCSI_MESH=y CONFIG_SCSI_MESH_SYNC_RATE=5 +CONFIG_SCSI_MESH_RESET_DELAY_MS=4000 CONFIG_SCSI_MAC53C94=y # @@ -428,6 +451,7 @@ # CONFIG_APRICOT is not set # CONFIG_CS89x0 is not set CONFIG_TULIP=y +# CONFIG_TC35815 is not set # CONFIG_TULIP_MWI is not set CONFIG_TULIP_MMIO=y CONFIG_DE4X5=m @@ -465,6 +489,7 @@ # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PLIP is not set @@ -492,6 +517,7 @@ CONFIG_HERMES=m CONFIG_APPLE_AIRPORT=m # CONFIG_PLX_HERMES is not set +# CONFIG_PCI_HERMES is not set CONFIG_NET_WIRELESS=y # @@ -563,6 +589,7 @@ CONFIG_FB_RADEON=y CONFIG_FB_ATY128=y # CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set CONFIG_FB_3DFX=y # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_TRIDENT is not set @@ -599,8 +626,10 @@ # CONFIG_ADB_CUDA=y CONFIG_ADB_PMU=y -# CONFIG_PMAC_PBOOK is not set -# CONFIG_PMAC_BACKLIGHT is not set +CONFIG_PMAC_PBOOK=y +CONFIG_PM=y +CONFIG_PMAC_APM_EMU=y +CONFIG_PMAC_BACKLIGHT=y # CONFIG_MAC_FLOPPY is not set CONFIG_MAC_SERIAL=m CONFIG_ADB=y @@ -621,6 +650,7 @@ # CONFIG_SERIAL_NONSTANDARD is not set CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=256 +# CONFIG_BRIQ_PANEL is not set # # I2C support @@ -643,6 +673,7 @@ CONFIG_PSMOUSE=y # CONFIG_82C710_MOUSE is not set # CONFIG_PC110_PAD is not set +# CONFIG_MK712_MOUSE is not set # # Joysticks @@ -684,7 +715,6 @@ # Watchdog Cards # # CONFIG_WATCHDOG is not set -# CONFIG_INTEL_RNG is not set CONFIG_NVRAM=y # CONFIG_RTC is not set # CONFIG_DTLK is not set @@ -729,7 +759,7 @@ # CONFIG_JFFS2_FS is not set # CONFIG_CRAMFS is not set CONFIG_TMPFS=y -# CONFIG_RAMFS is not set +CONFIG_RAMFS=y CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set # CONFIG_ZISOFS is not set @@ -759,12 +789,13 @@ # CONFIG_CODA_FS is not set # CONFIG_INTERMEZZO_FS is not set CONFIG_NFS_FS=y -# CONFIG_NFS_V3 is not set +CONFIG_NFS_V3=y # CONFIG_ROOT_NFS is not set CONFIG_NFSD=y -# CONFIG_NFSD_V3 is not set +CONFIG_NFSD_V3=y CONFIG_SUNRPC=y CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set # CONFIG_NCPFS_PACKET_SIGNING is not set @@ -824,7 +855,7 @@ # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set -CONFIG_NLS_CODEPAGE_1250=m +# CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set CONFIG_NLS_ISO8859_1=m # CONFIG_NLS_ISO8859_2 is not set @@ -885,8 +916,9 @@ # CONFIG_USB_LONG_TIMEOUT is not set # -# USB Controllers +# USB Host Controller Drivers # +# CONFIG_USB_EHCI_HCD is not set # CONFIG_USB_UHCI is not set # CONFIG_USB_UHCI_ALT is not set CONFIG_USB_OHCI=y @@ -895,13 +927,14 @@ # USB Device Class drivers # # CONFIG_USB_AUDIO is not set +# CONFIG_USB_EMI26 is not set # CONFIG_USB_BLUETOOTH is not set -# CONFIG_USB_STORAGE is not set +CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set +CONFIG_USB_STORAGE_FREECOM=y # CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_DPCM is not set +CONFIG_USB_STORAGE_DPCM=y # CONFIG_USB_STORAGE_HP8200e is not set # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set @@ -912,6 +945,7 @@ # USB Human Interface Devices (HID) # CONFIG_USB_HID=y +CONFIG_USB_HIDINPUT=y # CONFIG_USB_HIDDEV is not set # CONFIG_USB_WACOM is not set @@ -936,6 +970,7 @@ # USB Network adaptors # # CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set # CONFIG_USB_KAWETH is not set # CONFIG_USB_CATC is not set # CONFIG_USB_CDCETHER is not set @@ -961,15 +996,15 @@ # CONFIG_USB_SERIAL_IR is not set # CONFIG_USB_SERIAL_EDGEPORT is not set # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y # CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set # CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=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 @@ -981,6 +1016,7 @@ # USB Miscellaneous drivers # # CONFIG_USB_RIO500 is not set +# CONFIG_USB_AUERSWALD is not set # # Bluetooth support @@ -993,3 +1029,6 @@ CONFIG_MAGIC_SYSRQ=y # CONFIG_KGDB is not set CONFIG_XMON=y +# CONFIG_BDI_SWITCH is not set +CONFIG_BOOTX_TEXT=y +# CONFIG_MORE_COMPILE_OPTIONS is not set diff -uNr linux-2.4.19/arch/ppc/configs/est8260_defconfig linux-2.4.19bgl/arch/ppc/configs/est8260_defconfig --- linux-2.4.19/arch/ppc/configs/est8260_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/est8260_defconfig 2003-07-02 10:44:43.000000000 -0500 @@ -22,9 +22,8 @@ CONFIG_PPC=y CONFIG_PPC32=y CONFIG_6xx=y -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set # CONFIG_8xx is not set CONFIG_8260=y CONFIG_PPC_STD_MMU=y @@ -444,6 +443,7 @@ CONFIG_SCC_ENET=y CONFIG_SCC1_ENET=y # CONFIG_FEC_ENET is not set +# CONFIG_DCACHE_DISABLE is not set # # USB support diff -uNr linux-2.4.19/arch/ppc/configs/gemini_defconfig linux-2.4.19bgl/arch/ppc/configs/gemini_defconfig --- linux-2.4.19/arch/ppc/configs/gemini_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/gemini_defconfig 2003-07-02 10:43:08.000000000 -0500 @@ -24,9 +24,8 @@ CONFIG_PPC=y CONFIG_PPC32=y CONFIG_6xx=y -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set # CONFIG_8xx is not set # CONFIG_8260 is not set CONFIG_PPC_STD_MMU=y diff -uNr linux-2.4.19/arch/ppc/configs/ibmchrp_defconfig linux-2.4.19bgl/arch/ppc/configs/ibmchrp_defconfig --- linux-2.4.19/arch/ppc/configs/ibmchrp_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/ibmchrp_defconfig 2003-07-02 10:43:18.000000000 -0500 @@ -24,9 +24,8 @@ CONFIG_PPC=y CONFIG_PPC32=y CONFIG_6xx=y -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set # CONFIG_8xx is not set # CONFIG_8260 is not set CONFIG_PPC_STD_MMU=y diff -uNr linux-2.4.19/arch/ppc/configs/mbx_defconfig linux-2.4.19bgl/arch/ppc/configs/mbx_defconfig --- linux-2.4.19/arch/ppc/configs/mbx_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/mbx_defconfig 2003-07-02 10:43:06.000000000 -0500 @@ -22,9 +22,8 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set CONFIG_8xx=y # CONFIG_PPC_STD_MMU is not set CONFIG_SERIAL_CONSOLE=y diff -uNr linux-2.4.19/arch/ppc/configs/oak_defconfig linux-2.4.19bgl/arch/ppc/configs/oak_defconfig --- linux-2.4.19/arch/ppc/configs/oak_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/oak_defconfig 2003-07-02 10:43:57.000000000 -0500 @@ -24,16 +24,29 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -CONFIG_4xx=y +CONFIG_40x=y # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set # CONFIG_8xx is not set +# CONFIG_PPC_ISERIES is not set # CONFIG_PPC_STD_MMU is not set +# CONFIG_CEDER is not set +# CONFIG_CPCI405 is not set +# CONFIG_EP405 is not set CONFIG_OAK=y +# CONFIG_REDWOOD_4 is not set +# CONFIG_REDWOOD_5 is not set +# CONFIG_TIVO is not set # CONFIG_WALNUT is not set # CONFIG_ALL_PPC is not set # CONFIG_SMP is not set # CONFIG_MATH_EMULATION is not set +CONFIG_403GCX=y +CONFIG_IBM_OPENBIOS=y +# CONFIG_405_DMA is not set +CONFIG_UART0_TTYS0=y +# CONFIG_UART0_TTYS1 is not set +CONFIG_IBM405_ERR51=y +CONFIG_NOT_COHERENT_CACHE=y # # General setup @@ -44,6 +57,7 @@ # CONFIG_SBUS is not set # CONFIG_MCA is not set # CONFIG_PCI is not set +# CONFIG_PC_KEYBOARD is not set CONFIG_NET=y CONFIG_SYSCTL=y CONFIG_SYSVIPC=y @@ -59,6 +73,7 @@ # Parallel port support # # CONFIG_PARPORT is not set +CONFIG_PPC_RTC=y # CONFIG_CMDLINE_BOOL is not set # @@ -80,7 +95,6 @@ # CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_CISS_SCSI_TAPE is not set # CONFIG_BLK_DEV_DAC960 is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_NBD is not set @@ -172,6 +186,24 @@ # CONFIG_SCSI is not set # +# Fusion MPT device support +# +# CONFIG_FUSION is not set +# CONFIG_FUSION_BOOT is not set +# CONFIG_FUSION_ISENSE is not set +# CONFIG_FUSION_CTL is not set +# CONFIG_FUSION_LAN is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# # Network device support # CONFIG_NETDEVICES=y @@ -193,9 +225,11 @@ # CONFIG_MACE is not set # CONFIG_BMAC is not set # CONFIG_GMAC is not set +CONFIG_OAKNET=y # CONFIG_SUNLANCE is not set # CONFIG_SUNBMAC is not set # CONFIG_SUNQE is not set +# CONFIG_SUNLANCE is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set # CONFIG_LANCE is not set @@ -428,6 +462,10 @@ # CONFIG_SOUND is not set # +# MPC4xx Driver Options +# + +# # USB support # # CONFIG_USB is not set @@ -444,10 +482,6 @@ # # CONFIG_USB_AUDIO is not set # CONFIG_USB_BLUETOOTH is not set - -# -# SCSI support is needed for USB Storage -# # CONFIG_USB_STORAGE is not set # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_DATAFAB is not set @@ -546,3 +580,5 @@ # CONFIG_MAGIC_SYSRQ is not set # CONFIG_KGDB is not set # CONFIG_XMON is not set +# CONFIG_BDI_SWITCH is not set +# CONFIG_SERIAL_TEXT_DEBUG is not set diff -uNr linux-2.4.19/arch/ppc/configs/pmac_defconfig linux-2.4.19bgl/arch/ppc/configs/pmac_defconfig --- linux-2.4.19/arch/ppc/configs/pmac_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/pmac_defconfig 2003-07-02 10:43:16.000000000 -0500 @@ -24,7 +24,7 @@ CONFIG_PPC=y CONFIG_PPC32=y CONFIG_6xx=y -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set # CONFIG_POWER4 is not set # CONFIG_8xx is not set diff -uNr linux-2.4.19/arch/ppc/configs/power3_defconfig linux-2.4.19bgl/arch/ppc/configs/power3_defconfig --- linux-2.4.19/arch/ppc/configs/power3_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/power3_defconfig 2003-07-02 10:43:16.000000000 -0500 @@ -24,9 +24,8 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -# CONFIG_4xx is not set +# CONFIG_40x is not set CONFIG_POWER3=y -# CONFIG_POWER4 is not set # CONFIG_8xx is not set CONFIG_PPC64BRIDGE=y CONFIG_ALL_PPC=y diff -uNr linux-2.4.19/arch/ppc/configs/rpxcllf_defconfig linux-2.4.19bgl/arch/ppc/configs/rpxcllf_defconfig --- linux-2.4.19/arch/ppc/configs/rpxcllf_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/rpxcllf_defconfig 2003-07-02 10:43:27.000000000 -0500 @@ -22,9 +22,8 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set CONFIG_8xx=y # CONFIG_PPC_STD_MMU is not set CONFIG_SERIAL_CONSOLE=y diff -uNr linux-2.4.19/arch/ppc/configs/rpxlite_defconfig linux-2.4.19bgl/arch/ppc/configs/rpxlite_defconfig --- linux-2.4.19/arch/ppc/configs/rpxlite_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/rpxlite_defconfig 2003-07-02 10:43:30.000000000 -0500 @@ -22,9 +22,8 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -# CONFIG_4xx is not set +# CONFIG_40x is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set CONFIG_8xx=y # CONFIG_PPC_STD_MMU is not set CONFIG_SERIAL_CONSOLE=y diff -uNr linux-2.4.19/arch/ppc/configs/walnut_defconfig linux-2.4.19bgl/arch/ppc/configs/walnut_defconfig --- linux-2.4.19/arch/ppc/configs/walnut_defconfig 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/configs/walnut_defconfig 2003-07-02 10:44:06.000000000 -0500 @@ -10,6 +10,7 @@ # Code maturity level options # CONFIG_EXPERIMENTAL=y +# CONFIG_ADVANCED_OPTIONS is not set # # Loadable module support @@ -24,16 +25,39 @@ CONFIG_PPC=y CONFIG_PPC32=y # CONFIG_6xx is not set -CONFIG_4xx=y +CONFIG_40x=y +# CONFIG_440 is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set # CONFIG_8xx is not set +# CONFIG_PPC_ISERIES is not set +CONFIG_4xx=y # CONFIG_PPC_STD_MMU is not set +# CONFIG_ASH is not set +# CONFIG_CEDER is not set +# CONFIG_CPCI405 is not set +# CONFIG_EP405 is not set # CONFIG_OAK is not set +# CONFIG_RAINIER is not set +# CONFIG_REDWOOD_4 is not set +# CONFIG_REDWOOD_5 is not set +# CONFIG_TIVO is not set CONFIG_WALNUT=y # CONFIG_ALL_PPC is not set # CONFIG_SMP is not set # CONFIG_MATH_EMULATION is not set +CONFIG_405GP=y +CONFIG_BIOS_FIXUP=y +CONFIG_IBM_OPENBIOS=y +CONFIG_IBM405_ERR77=y +CONFIG_IBM_OCP=y +# CONFIG_405_DMA is not set +CONFIG_405XX_DMA=y +# CONFIG_PM is not set +CONFIG_UART0_TTYS0=y +# CONFIG_UART0_TTYS1 is not set +CONFIG_IBM405_ERR51=y +CONFIG_NOT_COHERENT_CACHE=y +CONFIG_OCP_PROC=y # # General setup @@ -43,7 +67,8 @@ # CONFIG_EISA is not set # CONFIG_SBUS is not set # CONFIG_MCA is not set -# CONFIG_PCI is not set +CONFIG_PCI=y +# CONFIG_PC_KEYBOARD is not set CONFIG_NET=y CONFIG_SYSCTL=y CONFIG_SYSVIPC=y @@ -52,6 +77,7 @@ CONFIG_BINFMT_ELF=y CONFIG_KERNEL_ELF=y # CONFIG_BINFMT_MISC is not set +# CONFIG_PCI_NAMES is not set # CONFIG_HOTPLUG is not set # CONFIG_PCMCIA is not set @@ -59,6 +85,7 @@ # Parallel port support # # CONFIG_PARPORT is not set +CONFIG_PPC_RTC=y # CONFIG_CMDLINE_BOOL is not set # @@ -82,6 +109,7 @@ # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_CISS_SCSI_TAPE is not set # CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_NBD is not set CONFIG_BLK_DEV_RAM=y @@ -136,13 +164,6 @@ # Appletalk devices # # CONFIG_DEV_APPLETALK is not set -# CONFIG_LTPC is not set -# CONFIG_COPS is not set -# CONFIG_COPS_DAYNA is not set -# CONFIG_COPS_TANGENT is not set -# CONFIG_IPDDP is not set -# CONFIG_IPDDP_ENCAP is not set -# CONFIG_IPDDP_DECAP is not set # CONFIG_DECNET is not set # CONFIG_BRIDGE is not set # CONFIG_X25 is not set @@ -160,6 +181,11 @@ # CONFIG_NET_SCHED is not set # +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# # ATA/IDE/MFM/RLL support # # CONFIG_IDE is not set @@ -172,6 +198,30 @@ # CONFIG_SCSI is not set # +# Fusion MPT device support +# +# CONFIG_FUSION is not set +# CONFIG_FUSION_BOOT is not set +# CONFIG_FUSION_ISENSE is not set +# CONFIG_FUSION_CTL is not set +# CONFIG_FUSION_LAN is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# # Network device support # CONFIG_NETDEVICES=y @@ -194,6 +244,7 @@ # CONFIG_BMAC is not set # CONFIG_GMAC is not set # CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set # CONFIG_SUNBMAC is not set # CONFIG_SUNQE is not set # CONFIG_SUNGEM is not set @@ -201,6 +252,7 @@ # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set # CONFIG_NET_ISA is not set # CONFIG_NET_PCI is not set # CONFIG_NET_POCKET is not set @@ -215,6 +267,23 @@ # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set + +# +# Backplane Networking +# +# CONFIG_NPNET is not set + +# +# On-chip net devices +# +CONFIG_IBM_OCP_ENET=y +# CONFIG_IBM_OCP_ENET_ERROR_MSG is not set +CONFIG_IBM_OCP_ENET_RX_BUFF=64 +CONFIG_IBM_OCP_ENET_TX_BUFF=8 +CONFIG_IBM_OCP_ENET_GAP=8 +CONFIG_IBM_OCP_ENET_SKB_RES=0 +CONFIG_OCP_NET=y # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PLIP is not set @@ -289,7 +358,8 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_UNIX98_PTYS is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 # # I2C support @@ -297,6 +367,8 @@ CONFIG_I2C=y # CONFIG_I2C_ALGOBIT is not set # CONFIG_I2C_ALGOPCF is not set +CONFIG_I2C_IBM_OCP_ALGO=y +CONFIG_I2C_IBM_OCP_ADAP=y # CONFIG_I2C_CHARDEV is not set # CONFIG_I2C_PROC is not set @@ -324,12 +396,12 @@ # Watchdog Cards # # CONFIG_WATCHDOG is not set -# CONFIG_INTEL_RNG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set +CONFIG_IBM_OCP_GPIO=y # # Ftape, the floppy tape device driver @@ -369,7 +441,7 @@ # CONFIG_JFFS2_FS is not set # CONFIG_CRAMFS is not set CONFIG_TMPFS=y -# CONFIG_RAMFS is not set +CONFIG_RAMFS=y # CONFIG_ISO9660_FS is not set # CONFIG_JOLIET is not set # CONFIG_ZISOFS is not set @@ -382,7 +454,7 @@ # CONFIG_DEVFS_FS is not set # CONFIG_DEVFS_MOUNT is not set # CONFIG_DEVFS_DEBUG is not set -# CONFIG_DEVPTS_FS is not set +CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set # CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set @@ -421,8 +493,17 @@ # # Partition Types # -# CONFIG_PARTITION_ADVANCED is not set -CONFIG_MSDOS_PARTITION=y +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +# CONFIG_MSDOS_PARTITION is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set # CONFIG_SMB_NLS is not set # CONFIG_NLS is not set @@ -432,112 +513,13 @@ # CONFIG_SOUND is not set # -# USB support -# -# CONFIG_USB is not set - -# -# USB Controllers +# IBM 4xx options # -# CONFIG_USB_UHCI is not set -# CONFIG_USB_UHCI_ALT is not set -# CONFIG_USB_OHCI is not set # -# USB Device Class drivers -# -# CONFIG_USB_AUDIO is not set -# CONFIG_USB_BLUETOOTH is not set - -# -# SCSI support is needed for USB Storage -# -# 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_JUMPSHOT is not set -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set - -# -# USB Human Interface Devices (HID) -# - -# -# Input core support is needed for USB HID -# - -# -# USB Imaging devices -# -# CONFIG_USB_DC2XX is not set -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_SCANNER is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USB_HPUSBSCSI is not set - -# -# USB Multimedia devices -# - -# -# Video4Linux support is needed for USB Multimedia device support -# - -# -# USB Network adaptors -# -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_CATC is not set -# CONFIG_USB_CDCETHER is not set -# CONFIG_USB_USBNET is not set - -# -# USB port drivers -# -# CONFIG_USB_USS720 is not set - -# -# USB Serial Converter support -# -# CONFIG_USB_SERIAL is not set -# CONFIG_USB_SERIAL_GENERIC is not set -# CONFIG_USB_SERIAL_BELKIN is not set -# CONFIG_USB_SERIAL_WHITEHEAT is not set -# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set -# CONFIG_USB_SERIAL_EMPEG is not set -# CONFIG_USB_SERIAL_FTDI_SIO is not set -# CONFIG_USB_SERIAL_VISOR is not set -# CONFIG_USB_SERIAL_IPAQ is not set -# CONFIG_USB_SERIAL_IR is not set -# CONFIG_USB_SERIAL_EDGEPORT is not set -# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set -# CONFIG_USB_SERIAL_MCT_U232 is not set -# CONFIG_USB_SERIAL_KLSI is not set -# CONFIG_USB_SERIAL_PL2303 is not set -# CONFIG_USB_SERIAL_CYBERJACK is not set -# CONFIG_USB_SERIAL_XIRCOM is not set -# CONFIG_USB_SERIAL_OMNINET is not set - -# -# USB Miscellaneous drivers +# USB support # -# CONFIG_USB_RIO500 is not set +# CONFIG_USB is not set # # Bluetooth support @@ -550,3 +532,5 @@ # CONFIG_MAGIC_SYSRQ is not set # CONFIG_KGDB is not set # CONFIG_XMON is not set +# CONFIG_BDI_SWITCH is not set +# CONFIG_SERIAL_TEXT_DEBUG is not set diff -uNr linux-2.4.19/arch/ppc/defconfig linux-2.4.19bgl/arch/ppc/defconfig --- linux-2.4.19/arch/ppc/defconfig 2002-02-25 13:37:55.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/defconfig 2005-06-08 14:30:43.000000000 -0500 @@ -1,5 +1,5 @@ # -# Automatically generated make config: don't edit +# Automatically generated by make menuconfig: don't edit # # CONFIG_UID16 is not set # CONFIG_RWSEM_GENERIC_SPINLOCK is not set @@ -10,6 +10,7 @@ # Code maturity level options # CONFIG_EXPERIMENTAL=y +# CONFIG_ADVANCED_OPTIONS is not set # # Loadable module support @@ -24,15 +25,33 @@ CONFIG_PPC=y CONFIG_PPC32=y CONFIG_6xx=y -# CONFIG_4xx is not set +# CONFIG_40x is not set +# CONFIG_440 is not set # CONFIG_POWER3 is not set -# CONFIG_POWER4 is not set # CONFIG_8xx is not set +# CONFIG_PPC_ISERIES is not set # CONFIG_8260 is not set CONFIG_PPC_STD_MMU=y CONFIG_ALL_PPC=y # CONFIG_APUS is not set +# CONFIG_WILLOW is not set +# CONFIG_PCORE is not set +# CONFIG_POWERPMC250 is not set +# CONFIG_EV64260 is not set +# CONFIG_SPRUCE is not set +# CONFIG_MENF1 is not set +# CONFIG_LOPEC is not set +# CONFIG_MCPN765 is not set +# CONFIG_MVME5100 is not set +# CONFIG_PPLUS is not set +# CONFIG_PRPMC750 is not set +# CONFIG_PRPMC800 is not set +# CONFIG_SANDPOINT is not set +# CONFIG_ADIR is not set +# CONFIG_K2 is not set +# CONFIG_PAL4 is not set # CONFIG_GEMINI is not set +# CONFIG_ZX4500 is not set # CONFIG_SMP is not set CONFIG_ALTIVEC=y CONFIG_TAU=y @@ -72,8 +91,9 @@ CONFIG_PPC601_SYNC_FIX=y CONFIG_PROC_DEVICETREE=y CONFIG_PPC_RTAS=y -CONFIG_BOOTX_TEXT=y CONFIG_PREP_RESIDUAL=y +CONFIG_PROC_PREPRESIDUAL=y +CONFIG_PPCBUG_NVRAM=y CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="console=ttyS0,9600 console=tty0 root=/dev/sda2" @@ -96,8 +116,11 @@ # CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_CISS_SCSI_TAPE is not set # CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set CONFIG_BLK_DEV_LOOP=y +CONFIG_CIPHER_TWOFISH=m # CONFIG_BLK_DEV_NBD is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 @@ -149,6 +172,7 @@ CONFIG_IP_NF_MATCH_MARK=m CONFIG_IP_NF_MATCH_MULTIPORT=m CONFIG_IP_NF_MATCH_TOS=m +CONFIG_IP_NF_MATCH_AH_ESP=m CONFIG_IP_NF_MATCH_LENGTH=m CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_MATCH_TCPMSS=m @@ -162,12 +186,16 @@ CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m +# CONFIG_IP_NF_NAT_LOCAL is not set 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_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m +CONFIG_IP_NF_ARPTABLES=m +CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_COMPAT_IPCHAINS=m CONFIG_IP_NF_NAT_NEEDED=y # CONFIG_IP_NF_COMPAT_IPFWADM is not set @@ -175,12 +203,13 @@ # CONFIG_KHTTPD is not set # CONFIG_ATM is not set # CONFIG_VLAN_8021Q is not set +# CONFIG_IPX is not set +CONFIG_ATALK=m # -# +# Appletalk devices # -# CONFIG_IPX is not set -CONFIG_ATALK=m +# CONFIG_DEV_APPLETALK is not set # CONFIG_DECNET is not set # CONFIG_BRIDGE is not set # CONFIG_X25 is not set @@ -198,6 +227,11 @@ # CONFIG_NET_SCHED is not set # +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# # ATA/IDE/MFM/RLL support # CONFIG_IDE=y @@ -206,14 +240,11 @@ # IDE, ATA and ATAPI Block devices # CONFIG_BLK_DEV_IDE=y - -# -# Please see Documentation/ide.txt for help/info on IDE drives -# # CONFIG_BLK_DEV_HD_IDE is not set # CONFIG_BLK_DEV_HD is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEDISK_STROKE is not set # CONFIG_BLK_DEV_IDEDISK_VENDOR is not set # CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set # CONFIG_BLK_DEV_IDEDISK_IBM is not set @@ -228,10 +259,7 @@ # CONFIG_BLK_DEV_IDETAPE is not set CONFIG_BLK_DEV_IDEFLOPPY=y CONFIG_BLK_DEV_IDESCSI=y - -# -# IDE chipset support/bugfixes -# +# CONFIG_IDE_TASK_IOCTL is not set # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_CMD640_ENHANCED is not set # CONFIG_BLK_DEV_ISAPNP is not set @@ -239,12 +267,15 @@ CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y CONFIG_BLK_DEV_IDEDMA_PCI=y -CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y +# CONFIG_IDEDMA_ONLYDISK is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_PCI_WIP is not set +# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set +CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_AEC62XX_TUNING is not set # CONFIG_BLK_DEV_ALI15X3 is not set @@ -252,6 +283,7 @@ # CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_AMD74XX_OVERRIDE is not set CONFIG_BLK_DEV_CMD64X=y +# CONFIG_BLK_DEV_CMD680 is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set @@ -286,10 +318,6 @@ # SCSI support # CONFIG_SCSI=y - -# -# SCSI support type (disk, tape, CD-ROM) -# CONFIG_BLK_DEV_SD=y CONFIG_SD_EXTRA_DEVS=40 CONFIG_CHR_DEV_ST=y @@ -298,10 +326,6 @@ CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_SR_EXTRA_DEVS=2 CONFIG_CHR_DEV_SG=y - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# # CONFIG_SCSI_DEBUG_QUEUES is not set # CONFIG_SCSI_MULTI_LUN is not set CONFIG_SCSI_CONSTANTS=y @@ -316,9 +340,11 @@ # CONFIG_SCSI_AHA152X is not set # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AACRAID is not set CONFIG_SCSI_AIC7XXX=m 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 @@ -364,14 +390,34 @@ # CONFIG_SCSI_DEBUG is not set CONFIG_SCSI_MESH=y CONFIG_SCSI_MESH_SYNC_RATE=5 +CONFIG_SCSI_MESH_RESET_DELAY_MS=4000 CONFIG_SCSI_MAC53C94=y # +# Fusion MPT device support +# +# CONFIG_FUSION is not set +# CONFIG_FUSION_BOOT is not set +# CONFIG_FUSION_ISENSE is not set +# CONFIG_FUSION_CTL is not set +# CONFIG_FUSION_LAN is not set + +# # IEEE 1394 (FireWire) support (EXPERIMENTAL) # # CONFIG_IEEE1394 is not set # +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# # Network device support # CONFIG_NETDEVICES=y @@ -380,13 +426,6 @@ # ARCnet devices # # CONFIG_ARCNET is not set - -# -# Appletalk devices -# -# CONFIG_LTPC is not set -# CONFIG_COPS is not set -# CONFIG_IPDDP is not set # CONFIG_DUMMY is not set # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set @@ -405,7 +444,6 @@ # CONFIG_HAPPYMEAL is not set # CONFIG_SUNBMAC is not set # CONFIG_SUNQE is not set -# CONFIG_SUNLANCE is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set # CONFIG_LANCE is not set @@ -419,6 +457,7 @@ # CONFIG_APRICOT is not set # CONFIG_CS89x0 is not set CONFIG_TULIP=y +# CONFIG_TC35815 is not set # CONFIG_TULIP_MWI is not set CONFIG_TULIP_MMIO=y CONFIG_DE4X5=m @@ -436,6 +475,7 @@ # CONFIG_8139TOO_PIO is not set # CONFIG_8139TOO_TUNE_TWISTER is not set # CONFIG_8139TOO_8129 is not set +# CONFIG_8139_NEW_RX_RESET is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set @@ -454,7 +494,7 @@ # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set -# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PLIP is not set @@ -482,6 +522,7 @@ CONFIG_HERMES=m CONFIG_APPLE_AIRPORT=m # CONFIG_PLX_HERMES is not set +# CONFIG_PCI_HERMES is not set CONFIG_NET_WIRELESS=y # @@ -530,6 +571,7 @@ # CONFIG_FB_RIVA is not set # CONFIG_FB_CLGEN is not set # CONFIG_FB_PM2 is not set +# CONFIG_FB_PM3 is not set # CONFIG_FB_CYBER2000 is not set CONFIG_FB_OF=y CONFIG_FB_CONTROL=y @@ -538,7 +580,9 @@ CONFIG_FB_CT65550=y CONFIG_FB_IMSTT=y # CONFIG_FB_S3TRIO is not set +# CONFIG_FB_VESA is not set # CONFIG_FB_VGA16 is not set +# CONFIG_FB_LYNX is not set CONFIG_FB_MATROX=y CONFIG_FB_MATROX_MILLENIUM=y CONFIG_FB_MATROX_MYSTIQUE=y @@ -552,8 +596,10 @@ CONFIG_FB_RADEON=y CONFIG_FB_ATY128=y # CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set CONFIG_FB_3DFX=y # CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_TRIDENT is not set # CONFIG_FB_VIRTUAL is not set # CONFIG_FBCON_ADVANCED is not set CONFIG_FBCON_CFB8=y @@ -587,8 +633,10 @@ # CONFIG_ADB_CUDA=y CONFIG_ADB_PMU=y -# CONFIG_PMAC_PBOOK is not set -# CONFIG_PMAC_BACKLIGHT is not set +CONFIG_PMAC_PBOOK=y +CONFIG_PM=y +CONFIG_PMAC_APM_EMU=y +CONFIG_PMAC_BACKLIGHT=y # CONFIG_MAC_FLOPPY is not set CONFIG_MAC_SERIAL=m CONFIG_ADB=y @@ -609,6 +657,7 @@ # CONFIG_SERIAL_NONSTANDARD is not set CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=256 +# CONFIG_BRIQ_PANEL is not set # # I2C support @@ -631,6 +680,7 @@ CONFIG_PSMOUSE=y # CONFIG_82C710_MOUSE is not set # CONFIG_PC110_PAD is not set +# CONFIG_MK712_MOUSE is not set # # Joysticks @@ -643,10 +693,6 @@ # CONFIG_INPUT_EMU10K1 is not set # CONFIG_INPUT_SERIO is not set # CONFIG_INPUT_SERPORT is not set - -# -# Joysticks -# # CONFIG_INPUT_ANALOG is not set # CONFIG_INPUT_A3D is not set # CONFIG_INPUT_ADI is not set @@ -672,7 +718,6 @@ # Watchdog Cards # # CONFIG_WATCHDOG is not set -# CONFIG_INTEL_RNG is not set CONFIG_NVRAM=y # CONFIG_RTC is not set # CONFIG_DTLK is not set @@ -717,7 +762,7 @@ # CONFIG_JFFS2_FS is not set # CONFIG_CRAMFS is not set CONFIG_TMPFS=y -# CONFIG_RAMFS is not set +CONFIG_RAMFS=y CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set # CONFIG_ZISOFS is not set @@ -747,12 +792,13 @@ # CONFIG_CODA_FS is not set # CONFIG_INTERMEZZO_FS is not set CONFIG_NFS_FS=y -# CONFIG_NFS_V3 is not set +CONFIG_NFS_V3=y # CONFIG_ROOT_NFS is not set CONFIG_NFSD=y -# CONFIG_NFSD_V3 is not set +CONFIG_NFSD_V3=y CONFIG_SUNRPC=y CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set # CONFIG_NCPFS_PACKET_SIGNING is not set @@ -812,6 +858,7 @@ # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set CONFIG_NLS_ISO8859_1=m # CONFIG_NLS_ISO8859_2 is not set @@ -863,74 +910,42 @@ # CONFIG_USB=y # CONFIG_USB_DEBUG is not set - -# -# Miscellaneous USB options -# CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_LONG_TIMEOUT is not set - -# -# USB Controllers -# +# CONFIG_USB_EHCI_HCD is not set # CONFIG_USB_UHCI is not set # CONFIG_USB_UHCI_ALT is not set CONFIG_USB_OHCI=y - -# -# USB Device Class drivers -# # CONFIG_USB_AUDIO is not set +# CONFIG_USB_EMI26 is not set # CONFIG_USB_BLUETOOTH is not set -# CONFIG_USB_STORAGE is not set +CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set +CONFIG_USB_STORAGE_FREECOM=y # CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_DPCM is not set +CONFIG_USB_STORAGE_DPCM=y # CONFIG_USB_STORAGE_HP8200e is not set # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set CONFIG_USB_ACM=m CONFIG_USB_PRINTER=m - -# -# USB Human Interface Devices (HID) -# CONFIG_USB_HID=y +CONFIG_USB_HIDINPUT=y # CONFIG_USB_HIDDEV is not set # CONFIG_USB_WACOM is not set - -# -# USB Imaging devices -# # CONFIG_USB_DC2XX is not set # CONFIG_USB_MDC800 is not set CONFIG_USB_SCANNER=m # CONFIG_USB_MICROTEK is not set # CONFIG_USB_HPUSBSCSI is not set - -# -# USB Multimedia devices -# - -# -# Video4Linux support is needed for USB Multimedia device support -# - -# -# USB Network adaptors -# # CONFIG_USB_PEGASUS is not set +# 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_USBNET is not set - -# -# USB port drivers -# # CONFIG_USB_USS720 is not set # @@ -944,28 +959,28 @@ # CONFIG_USB_SERIAL_EMPEG is not set # CONFIG_USB_SERIAL_FTDI_SIO is not set CONFIG_USB_SERIAL_VISOR=m +# CONFIG_USB_SERIAL_IPAQ is not set # CONFIG_USB_SERIAL_IR is not set # CONFIG_USB_SERIAL_EDGEPORT is not set # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y # CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set # CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=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 # CONFIG_USB_SERIAL_CYBERJACK is not set # CONFIG_USB_SERIAL_XIRCOM is not set # CONFIG_USB_SERIAL_OMNINET is not set - -# -# USB Miscellaneous drivers -# # CONFIG_USB_RIO500 is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_BRLVGER is not set # # Bluetooth support @@ -978,3 +993,6 @@ CONFIG_MAGIC_SYSRQ=y # CONFIG_KGDB is not set CONFIG_XMON=y +# CONFIG_BDI_SWITCH is not set +# CONFIG_MORE_COMPILE_OPTIONS is not set +CONFIG_BOOTX_TEXT=y diff -uNr linux-2.4.19/arch/ppc/kernel/Makefile linux-2.4.19bgl/arch/ppc/kernel/Makefile --- linux-2.4.19/arch/ppc/kernel/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/Makefile 2005-06-08 14:30:44.000000000 -0500 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.41 04/16/02 20:08:22 paulus +# BK Id: SCCS/s.Makefile 1.108 08/02/02 09:25:31 akuster # # # Makefile for the linux kernel. @@ -14,9 +14,9 @@ ifdef CONFIG_PPC64BRIDGE EXTRA_AFLAGS := -Wa,-mppc64bridge endif - -# Extra CFLAGS so we don't have to do relative includes -CFLAGS_pmac_setup.o += -I$(TOPDIR)/arch/$(ARCH)/mm -I$(TOPDIR)/drivers/scsi +ifdef CONFIG_4xx +EXTRA_AFLAGS := -Wa,-m405 +endif # Code in these files is used before the kernel is moved to its final position CFLAGS_prom_init.o += -mrelocatable-lib @@ -24,14 +24,18 @@ # Start off with 'head.o', change as needed. HEAD-y := head.o -HEAD-$(CONFIG_4xx) := head_4xx.o +HEAD-$(CONFIG_40x) := head_4xx.o +HEAD-$(CONFIG_440) := head_440.o HEAD-$(CONFIG_8xx) := head_8xx.o +HEAD-$(CONFIG_PPC_ISERIES) := iSeries_head.o all: $(HEAD-y) kernel.o O_TARGET := kernel.o -export-objs := ppc_ksyms.o prep_setup.o time.o +export-objs := ppc_ksyms.o time.o ppc4xx_dma.o ocp.o \ + ppc4xx_pm.o ocp_uart.o ppc4xx_sgdma.o \ + ppc4xx_stbdma.o obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ process.o signal.o ptrace.o align.o \ @@ -39,16 +43,46 @@ cputable.o ppc_htab.o obj-$(CONFIG_6xx) += l2cr.o obj-$(CONFIG_MODULES) += ppc_ksyms.o -obj-$(CONFIG_POWER4) += xics.o -obj-$(CONFIG_PCI) += pci.o pci-dma.o +obj-$(CONFIG_PCI) += pci.o +ifneq ($(CONFIG_PPC_ISERIES),y) +obj-$(CONFIG_PCI) += pci-dma.o +endif +obj-$(CONFIG_PPCBUG_NVRAM) += prep_nvram.o obj-$(CONFIG_KGDB) += ppc-stub.o obj-$(CONFIG_SMP) += smp.o -obj-$(CONFIG_4xx) += ppc4xx_pic.o -obj-$(CONFIG_OAK) += oak_setup.o -obj-$(CONFIG_WALNUT) += walnut_setup.o obj-$(CONFIG_TAU) += temp.o -ifeq ($(CONFIG_WALNUT),y) -obj-$(CONFIG_PCI) += galaxy_pci.o +ifeq ($(CONFIG_KGDB),y) +obj-$(CONFIG_GEN550_KGDB) += gen550_kgdb.o gen550_dbg.o +endif +ifeq ($(CONFIG_4xx),y) +obj-$(CONFIG_40x) += ppc4xx_setup.o ocp.o +ifeq ($(CONFIG_XILINX_OCP),y) +obj-$(CONFIG_40x) += xilinx_pic.o +else +obj-$(CONFIG_40x) += ppc4xx_pic.o +endif +obj-$(CONFIG_PM) += ppc4xx_pm.o +ifneq ($(CONFIG_RAINIER),y) +ifeq ($(CONFIG_SERIAL),y) +obj-$(CONFIG_40x) += ocp_uart.o +endif +endif +obj-$(CONFIG_440) += ocp.o +ifneq ($(CONFIG_BGL),y) +obj-$(CONFIG_440) += ppc4xx_pic.o +endif +obj-$(CONFIG_PPC_RTC) += todc_time.o +ifeq ($(CONFIG_40x),y) +obj-$(CONFIG_KGDB) += ppc4xx_kgdb.o +endif +obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o +obj-$(CONFIG_STBXXX_DMA) += ppc4xx_stbdma.o +obj-$(CONFIG_PPC4xx_DMA) += ppc4xx_dma.o +ifeq ($(CONFIG_PCI),y) +obj-$(CONFIG_40x) += ppc405_pci.o indirect_pci.o pci_auto.o +obj-$(CONFIG_440) += indirect_pci.o pci_auto.o +endif +obj-$(CONFIG_OCP_PROC) += ocp_proc.o endif obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o ifeq ($(CONFIG_8xx),y) @@ -58,29 +92,42 @@ endif endif obj-$(CONFIG_MBX) += i8259.o -obj-$(CONFIG_APUS) += apus_setup.o -ifeq ($(CONFIG_APUS),y) -obj-$(CONFIG_PCI) += apus_pci.o -endif -obj-$(CONFIG_ALL_PPC) += pmac_pic.o pmac_setup.o pmac_time.o prom.o \ - prom_init.o pmac_feature.o pmac_pci.o \ - chrp_setup.o chrp_time.o chrp_pci.o \ - open_pic.o indirect_pci.o i8259.o \ - prep_pci.o prep_time.o prep_nvram.o \ - prep_setup.o -obj-$(CONFIG_NVRAM) += pmac_nvram.o -obj-$(CONFIG_PMAC_BACKLIGHT) += pmac_backlight.o -obj-$(CONFIG_PMAC_PBOOK) += sleep.o -obj-$(CONFIG_PREP_RESIDUAL) += residual.o -obj-$(CONFIG_PPC_RTAS) += error_log.o proc_rtas.o -obj-$(CONFIG_GEMINI) += gemini_prom.o gemini_pci.o gemini_setup.o \ - open_pic.o +obj-$(CONFIG_ALL_PPC) += prom_init.o prom.o open_pic.o \ + indirect_pci.o i8259.o +obj-$(CONFIG_ADIR) += i8259.o indirect_pci.o pci_auto.o \ + todc_time.o +obj-$(CONFIG_EV64260) += gt64260_common.o gt64260_pic.o \ + indirect_pci.o todc_time.o pci_auto.o +obj-$(CONFIG_GEMINI) += open_pic.o i8259.o +obj-$(CONFIG_K2) += i8259.o indirect_pci.o todc_time.o \ + pci_auto.o +obj-$(CONFIG_LOPEC) += mpc10x_common.o indirect_pci.o pci_auto.o \ + open_pic.o i8259.o todc_time.o +obj-$(CONFIG_MCPN765) += todc_time.o indirect_pci.o pci_auto.o \ + open_pic.o i8259.o pplus_common.o +obj-$(CONFIG_MENF1) += todc_time.o i8259.o mpc10x_common.o \ + pci_auto.o indirect_pci.o +obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o indirect_pci.o \ + i8259.o pci_auto.o pplus_common.o +obj-$(CONFIG_PAL4) += todc_time.o indirect_pci.o pci_auto.o +obj-$(CONFIG_PCORE) += mpc10x_common.o todc_time.o i8259.o \ + indirect_pci.o pci_auto.o +obj-$(CONFIG_POWERPMC250) += open_pic.o mpc10x_common.o \ + indirect_pci.o pci_auto.o +obj-$(CONFIG_PPLUS) += pplus_common.o open_pic.o i8259.o \ + indirect_pci.o todc_time.o pci_auto.o +obj-$(CONFIG_PRPMC750) += open_pic.o indirect_pci.o pci_auto.o \ + pplus_common.o +obj-$(CONFIG_PRPMC800) += open_pic.o indirect_pci.o pci_auto.o \ + pplus_common.o harrier.o +obj-$(CONFIG_SANDPOINT) += i8259.o open_pic.o mpc10x_common.o \ + pci_auto.o indirect_pci.o todc_time.o +obj-$(CONFIG_SPRUCE) += indirect_pci.o pci_auto.o todc_time.o +obj-$(CONFIG_ZX4500) += indirect_pci.o pci_auto.o mpc10x_common.o \ + i8259.o open_pic.o obj-$(CONFIG_8260) += m8260_setup.o ppc8260_pic.o obj-$(CONFIG_BOOTX_TEXT) += btext.o - -ifeq ($(CONFIG_SMP),y) -obj-$(CONFIG_ALL_PPC) += pmac_smp.o chrp_smp.o -endif +obj-$(CONFIG_PPC_ISERIES) += iSeries_misc.o include $(TOPDIR)/Rules.make @@ -89,8 +136,10 @@ l2cr.o: l2cr.S ppc_defs.h head.o: head.S ppc_defs.h head_4xx.o: head_4xx.S ppc_defs.h +head_440.o: head_440.S ppc_defs.h head_8xx.o: head_8xx.S ppc_defs.h -gemini_prom.o: gemini_prom.S ppc_defs.h +iSeries_head.o: iSeries_head.S ppc_defs.h +iSeries_misc.o: iSeries_misc.S ppc_defs.h ppc_defs.h: mk_defs.c ppc_defs.head \ $(TOPDIR)/include/asm/mmu.h \ @@ -110,4 +159,3 @@ checks: checks.c $(HOSTCC) -I$(HPATH) $(HOSTCFLAGS) -D__KERNEL__ -fno-builtin -o checks checks.c ./checks - diff -uNr linux-2.4.19/arch/ppc/kernel/align.c linux-2.4.19bgl/arch/ppc/kernel/align.c --- linux-2.4.19/arch/ppc/kernel/align.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/align.c 2005-06-08 14:30:44.000000000 -0500 @@ -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.10 06/25/02 18:32:43 mporter */ /* * align.c - handle alignment exceptions for the Power PC. @@ -24,11 +24,11 @@ unsigned char flags; }; -#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) +#if defined(CONFIG_4xx) #define OPCD(inst) (((inst) & 0xFC000000) >> 26) #define RS(inst) (((inst) & 0x03E00000) >> 21) #define RA(inst) (((inst) & 0x001F0000) >> 16) -#define IS_DFORM(code) ((code) >= 32 && (code) <= 47) +#define IS_XFORM(code) ((code) == 31) #endif #define INVALID { 0, 0 } @@ -187,7 +187,7 @@ fix_alignment(struct pt_regs *regs) { int instr, nb, flags; -#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) +#if defined(CONFIG_4xx) int opcode, f1, f2, f3; #endif int i, t; @@ -196,15 +196,17 @@ union { long l; float f; +#ifdef CONFIG_DHUMMER_BGL + bl_quad_t d; +#else double d; +#endif unsigned char v[8]; } data; -#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) +#if defined(CONFIG_4xx) /* The 4xx-family processors have no DSISR register, * so we emulate it. - * The POWER4 has a DSISR register but doesn't set it on - * an alignment fault. -- paulus */ instr = *((unsigned int *)regs->nip); @@ -212,7 +214,7 @@ reg = RS(instr); areg = RA(instr); - if (IS_DFORM(opcode)) { + if (!IS_XFORM(opcode)) { f1 = 0; f2 = (instr & 0x04000000) >> 26; f3 = (instr & 0x78000000) >> 27; diff -uNr linux-2.4.19/arch/ppc/kernel/bitops.c linux-2.4.19bgl/arch/ppc/kernel/bitops.c --- linux-2.4.19/arch/ppc/kernel/bitops.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/bitops.c 2003-07-02 10:43:23.000000000 -0500 @@ -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.10 09/21/01 03:00:33 dan */ /* * Copyright (C) 1996 Paul Mackerras. @@ -21,8 +21,9 @@ __asm__ __volatile__(SMP_WMB "\n\ 1: lwarx %0,0,%3 \n\ - or %0,%0,%2 \n\ - stwcx. %0,0,%3 \n\ + or %0,%0,%2 \n" + PPC405_ERR77(0,%3) +" stwcx. %0,0,%3 \n\ bne 1b" SMP_MB : "=&r" (old), "=m" (*p) @@ -38,8 +39,9 @@ __asm__ __volatile__(SMP_WMB "\n\ 1: lwarx %0,0,%3 \n\ - andc %0,%0,%2 \n\ - stwcx. %0,0,%3 \n\ + andc %0,%0,%2 \n" + PPC405_ERR77(0,%3) +" stwcx. %0,0,%3 \n\ bne 1b" SMP_MB : "=&r" (old), "=m" (*p) @@ -55,8 +57,9 @@ __asm__ __volatile__(SMP_WMB "\n\ 1: lwarx %0,0,%3 \n\ - xor %0,%0,%2 \n\ - stwcx. %0,0,%3 \n\ + xor %0,%0,%2 \n" + PPC405_ERR77(0,%3) +" stwcx. %0,0,%3 \n\ bne 1b" SMP_MB : "=&r" (old), "=m" (*p) @@ -72,8 +75,9 @@ __asm__ __volatile__(SMP_WMB "\n\ 1: lwarx %0,0,%4 \n\ - or %1,%0,%3 \n\ - stwcx. %1,0,%4 \n\ + or %1,%0,%3 \n" + PPC405_ERR77(0,%4) +" stwcx. %1,0,%4 \n\ bne 1b" SMP_MB : "=&r" (old), "=&r" (t), "=m" (*p) @@ -91,8 +95,9 @@ __asm__ __volatile__(SMP_WMB "\n\ 1: lwarx %0,0,%4 \n\ - andc %1,%0,%3 \n\ - stwcx. %1,0,%4 \n\ + andc %1,%0,%3 \n" + PPC405_ERR77(0,%4) +" stwcx. %1,0,%4 \n\ bne 1b" SMP_MB : "=&r" (old), "=&r" (t), "=m" (*p) @@ -110,8 +115,9 @@ __asm__ __volatile__(SMP_WMB "\n\ 1: lwarx %0,0,%4 \n\ - xor %1,%0,%3 \n\ - stwcx. %1,0,%4 \n\ + xor %1,%0,%3 \n" + PPC405_ERR77(0,%4) +" stwcx. %1,0,%4 \n\ bne 1b" SMP_MB : "=&r" (old), "=&r" (t), "=m" (*p) diff -uNr linux-2.4.19/arch/ppc/kernel/btext.c linux-2.4.19bgl/arch/ppc/kernel/btext.c --- linux-2.4.19/arch/ppc/kernel/btext.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/btext.c 2003-07-02 10:44:31.000000000 -0500 @@ -45,6 +45,7 @@ static unsigned char vga_font[cmapsz]; int boot_text_mapped; +int force_printk_to_btext = 0; boot_infos_t disp_bi; diff -uNr linux-2.4.19/arch/ppc/kernel/checks.c linux-2.4.19bgl/arch/ppc/kernel/checks.c --- linux-2.4.19/arch/ppc/kernel/checks.c 2001-05-21 19:04:46.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/checks.c 2003-07-02 10:44:03.000000000 -0500 @@ -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.9 11/16/01 12:28:23 dgibson */ #include #include @@ -19,6 +19,8 @@ #include #include +int printf(const char *, ...); + /* * Do various before compile checks of data structures * -- Cort diff -uNr linux-2.4.19/arch/ppc/kernel/cputable.c linux-2.4.19bgl/arch/ppc/kernel/cputable.c --- linux-2.4.19/arch/ppc/kernel/cputable.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/cputable.c 2003-07-02 10:43:26.000000000 -0500 @@ -31,13 +31,11 @@ extern void __setup_cpu_7450_23(int cpu_nr); extern void __setup_cpu_7455(int cpu_nr); extern void __setup_cpu_power3(int cpu_nr); -extern void __setup_cpu_power4(int cpu_nr); extern void __setup_cpu_8xx(int cpu_nr); extern void __setup_cpu_generic(int cpu_nr); -#define CLASSIC_PPC (!defined(CONFIG_8xx) && \ - !defined(CONFIG_4xx) && !defined(CONFIG_POWER3) && \ - !defined(CONFIG_POWER4) && !defined(CONFIG_PPC_ISERIES)) +#define CLASSIC_PPC (!defined(CONFIG_8xx) && !defined(CONFIG_4xx) && \ + !defined(CONFIG_POWER3) && !defined(CONFIG_PPC_ISERIES)) /* This table only contains "desktop" CPUs, it need to be filled with embedded * ones as well... @@ -127,6 +125,14 @@ 32, 32, __setup_cpu_750 }, + { /* 750CXe rev 3.x (83311) */ + 0xfffffff0, 0x00083310, "750CXe (3.x)", + 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, + COMMON_PPC, + 32, 32, + __setup_cpu_750 + }, { /* 745/755 */ 0xfffff000, 0x00083000, "745/755", CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | @@ -135,8 +141,24 @@ 32, 32, __setup_cpu_750 }, - { /* 750CX */ - 0xffffff00, 0x00082200, "750CX", + { /* 750CX (80100 and 8010x?) */ + 0xfffffff0, 0x00080100, "750CX", + 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, + COMMON_PPC, + 32, 32, + __setup_cpu_750 + }, + { /* 750CX (82201 and 82202) */ + 0xfffffff0, 0x00082200, "750CX", + 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, + COMMON_PPC, + 32, 32, + __setup_cpu_750 + }, + { /* 750CXe (82214) */ + 0xfffffff0, 0x00082210, "750CXe", 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, COMMON_PPC, @@ -189,7 +211,7 @@ { /* 7450 2.0 - no doze/nap */ 0xffffffff, 0x80000200, "7450", CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450, COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC, 32, 32, @@ -198,7 +220,7 @@ { /* 7450 2.1 */ 0xffffffff, 0x80000201, "7450", CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450, COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC, 32, 32, @@ -207,7 +229,7 @@ { /* 7450 2.3 and newer */ 0xffff0000, 0x80000000, "7450", CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450, COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC, 32, 32, @@ -216,7 +238,7 @@ { /* 7455 */ 0xffff0000, 0x80010000, "7455", CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | + CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450, COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC, 32, 32, @@ -267,15 +289,6 @@ __setup_cpu_power3 }, #endif /* CONFIG_PPC64BRIDGE */ -#ifdef CONFIG_POWER4 - { /* Power4 */ - 0xffff0000, 0x00350000, "Power4", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, - COMMON_PPC | PPC_FEATURE_64, - 128, 128, - __setup_cpu_power4 - }, -#endif /* CONFIG_POWER4 */ #ifdef CONFIG_8xx { /* 8xx */ 0xffff0000, 0x00500000, "8xx", @@ -286,7 +299,7 @@ __setup_cpu_8xx /* Empty */ }, #endif /* CONFIG_8xx */ -#ifdef CONFIG_4xx +#ifdef CONFIG_40x { /* 403GC */ 0xffffff00, 0x00200200, "403GC", CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, @@ -315,6 +328,13 @@ 32, 32, 0, /*__setup_cpu_405 */ }, + { /* 405GPr */ + 0xffff0000, 0x50910000, "405GPr", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + 32, 32, + 0, /*__setup_cpu_405 */ + }, { /* STB 03xxx */ 0xffff0000, 0x40130000, "STB03xxx", CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, @@ -322,7 +342,73 @@ 32, 32, 0, /*__setup_cpu_405 */ }, -#endif /* CONFIG_4xx */ + { /* STB 04xxx */ + 0xffff0000, 0x41810000, "STB04xxx", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + 32, 32, + 0, /*__setup_cpu_405 */ + }, + { /* NP405L */ + 0xffff0000, 0x41610000, "NP405L", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + 16, 8, + 0, /*__setup_cpu_405 */ + }, + { /* NP4GS3 */ + 0xffff0000, 0x40B10000, "NP4GS3", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + 16, 8, + 0, /*__setup_cpu_405 */ + }, + { /* NP405H */ + 0xffff0000, 0x41410000, "NP405H", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + 16, 8, + 0, /*__setup_cpu_405 */ + }, + { /* STBx25xx */ + 0xffff0000, 0x51510000, "STBx25xx", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + 32, 32, + 0, /*__setup_cpu_405 */ + }, + { /* 405LP */ + 0xffff0000, 0x41F10000, "405LP", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + 32, 32, + 0, /*__setup_cpu_405 */ + }, + { /* Xilinx Virtex-II Pro */ + 0xffff0000, 0x20010000, "Virtex-II Pro", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + 32, 32, + 0, /*__setup_cpu_405 */ + }, + +#endif /* CONFIG_40x */ +#ifdef CONFIG_440 + { /* 440GP Rev. B */ + 0xf0000fff, 0x40000440, "440GP Rev. B", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + 32, 32, + 0, /*__setup_cpu_440 */ + }, + { /* 440GP Rev. C */ + 0xf0000fff, 0x40000481, "440GP Rev. C", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + 32, 32, + 0, /*__setup_cpu_440 */ + }, +#endif /* CONFIG_440 */ #if !CLASSIC_PPC { /* default match */ 0x00000000, 0x00000000, "(generic PPC)", diff -uNr linux-2.4.19/arch/ppc/kernel/entry.S linux-2.4.19bgl/arch/ppc/kernel/entry.S --- linux-2.4.19/arch/ppc/kernel/entry.S 2002-02-25 13:37:55.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/kernel/entry.S 2003-07-02 10:43:48.000000000 -0500 @@ -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.44 06/03/02 10:21:06 mporter */ /* * PowerPC version @@ -11,6 +11,7 @@ * rewritten by Paul Mackerras. * Copyright (C) 1996 Paul Mackerras. * MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net). + * Adaptations for iSeries Lpar by Mike Corrigan & Dave Boutcher * * This file contains the system call entry code, context switch * code, and exception/interrupt return code for PowerPC. @@ -22,7 +23,6 @@ * */ -#include "ppc_asm.h" #include #include #include @@ -31,6 +31,11 @@ #include #include #include +#include +#include "ppc_defs.h" +#ifdef CONFIG_PPC_ISERIES +#include "iSeries_asm.h" +#endif /* CONFIG_PPC_ISERIES */ #undef SHOW_SYSCALLS #undef SHOW_SYSCALLS_TASK @@ -45,6 +50,10 @@ * Handle a system call. */ .text + .stabs "arch/ppc/kernel/",N_SO,0,0,0f + .stabs "entry.S",N_SO,0,0,0f +0: + _GLOBAL(DoSyscall) stw r0,THREAD+LAST_SYSCALL(r2) lwz r11,_CCR(r1) /* Clear SO bit in CR */ @@ -197,6 +206,9 @@ * On entry, r3 points to the THREAD for the current task, r4 * points to the THREAD for the new task. * + * This routine is always called with interrupts disabled + * (soft disabled for iSeries). + * * Note: there are two ways to get to the "going out" portion * of this code; either by coming in via the entry (_switch) * or via "fork" which must set up an environment equivalent @@ -279,6 +291,9 @@ beq restore .globl ret_from_except ret_from_except: +#ifdef CONFIG_PPC_ISERIES + bl iSeries_check_intr +#endif /* CONFIG_PPC_ISERIES */ lwz r3,_MSR(r1) /* Returning to user mode? */ andi. r3,r3,MSR_PR beq+ do_signal_ret /* if so, check need_resched and signals */ @@ -297,6 +312,28 @@ .globl ret_to_user_hook ret_to_user_hook: nop +#ifdef CONFIG_PPC_ISERIES + mfmsr r0 /* Hard disable */ + rlwinm r0,r0,0,17,15 + mtmsr r0 + + mfspr r5,SPRG1 + lbz r5,PACAPROCENABLED(r5) + cmpi 0,r5,0 + bne restore /* skip checks if already soft enabled */ + + lwz r5,_SOFTE(r1) + cmpi 0,r5,0 + beq restore + +irq_recheck: + CHECKANYINT(r4,r5,r6) + beq+ restore + + ori r0,r0,MSR_EE + mtmsr r0 /* Hard enable */ + b ret_from_except /* An interrupt came in after we checked above */ +#endif /* CONFIG_PPC_ISERIES */ restore: lwz r3,_XER(r1) mtspr XER,r3 @@ -310,9 +347,22 @@ */ mfmsr r0 /* Get current interrupt state */ rlwinm r0,r0,0,17,15 /* clear MSR_EE in r0 */ +#ifdef CONFIG_4xx + rlwinm r0,r0,0,23,21 /* clear MSR_DE in r0 */ +#endif SYNC /* Some chip revs have problems here... */ mtmsr r0 /* Update machine state */ +#if defined(CONFIG_4xx) && !defined(CONFIG_BDI_SWITCH) + /* Restore the processor debugging state of the thread. Only do + * this if we aren't using an Abatron BDI JTAG debugger. It doesn't + * tolerate others mucking with the debug registers. + */ + lwz r0, _DBCR0(r1) + mtspr SPRN_DBCR0, r0 +#endif + + PPC405_ERR77(0,r1) stwcx. r0,0,r1 /* to clear the reservation */ /* if returning to user mode, set new sprg2 and save kernel SP */ @@ -327,14 +377,24 @@ #endif /* CONFIG_ALTIVEC */ addi r0,r1,INT_FRAME_SIZE /* size of frame */ stw r0,THREAD+KSP(r2) /* save kernel stack pointer */ +#ifndef CONFIG_PPC_ISERIES tophys(r8,r1) CLR_TOP32(r8) mtspr SPRG2,r8 /* phys exception stack pointer */ +#else /* CONFIG_PPC_ISERIES */ + mfspr r2,SPRG1 /* Get Paca address */ + stw r1,PACAKSAVE(r2) /* save exception stack pointer */ +#endif /* CONFIG_PPC_ISERIES */ 1: lwz r3,_CTR(r1) lwz r0,_LINK(r1) mtctr r3 mtlr r0 +#ifdef CONFIG_PPC_ISERIES + mfspr r2,SPRG1 /* Get Paca address */ + lwz r0,_SOFTE(r1) + stb r0,PACAPROCENABLED(r2) /* Restore soft enabled/disabled */ +#endif /* CONFIG_PPC_ISERIES */ REST_4GPRS(3, r1) REST_2GPRS(7, r1) @@ -376,6 +436,7 @@ lwz r4,GPR4(r1) lwz r1,GPR1(r1) SYNC + PPC405_ERR77_SYNC RFI @@ -389,8 +450,7 @@ * On CHRP, the Run-Time Abstraction Services (RTAS) have to be * called with the MMU off. */ - .globl enter_rtas -enter_rtas: +_GLOBAL(enter_rtas) mflr r0 stw r0,20(r1) lis r4,rtas_data@ha diff -uNr linux-2.4.19/arch/ppc/kernel/find_name.c linux-2.4.19bgl/arch/ppc/kernel/find_name.c --- linux-2.4.19/arch/ppc/kernel/find_name.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/find_name.c 2003-07-02 10:43:56.000000000 -0500 @@ -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.19/arch/ppc/kernel/galaxy_pci.c linux-2.4.19bgl/arch/ppc/kernel/galaxy_pci.c --- linux-2.4.19/arch/ppc/kernel/galaxy_pci.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/galaxy_pci.c 2003-07-02 10:44:43.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.galaxy_pci.c 1.7 05/17/01 18:14:21 cort + * BK Id: SCCS/s.galaxy_pci.c 1.10 11/04/01 21:07:37 paulus */ /* * @@ -27,8 +27,7 @@ #include #include #include - -#include "pci.h" +#include /* Preprocessor Defines */ diff -uNr linux-2.4.19/arch/ppc/kernel/head.S linux-2.4.19bgl/arch/ppc/kernel/head.S --- linux-2.4.19/arch/ppc/kernel/head.S 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/head.S 2003-07-02 10:43:57.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.head.S 1.43 06/25/02 17:24:29 benh + * BK Id: SCCS/s.head.S 1.70 07/16/02 21:19:50 trini */ /* * PowerPC version @@ -22,17 +22,18 @@ * 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 "ppc_asm.h" #include #include #include #include #include #include +#include +#include "ppc_defs.h" #ifdef CONFIG_APUS #include @@ -48,9 +49,9 @@ ld RB,(n*32)+24(reg); \ mtspr DBAT##n##U,RA; \ mtspr DBAT##n##L,RB; \ - + #else /* CONFIG_PPC64BRIDGE */ - + /* 601 only have IBAT; cr0.eq is set on 601 when using this macro */ #define LOAD_BAT(n, reg, RA, RB) \ /* see the comment for clear_bats() -- Cort */ \ @@ -66,10 +67,13 @@ lwz RB,(n*16)+12(reg); \ mtspr DBAT##n##U,RA; \ mtspr DBAT##n##L,RB; \ -1: +1: #endif /* CONFIG_PPC64BRIDGE */ .text + .stabs "arch/ppc/kernel/",N_SO,0,0,0f + .stabs "head.S",N_SO,0,0,0f +0: .globl _stext _stext: @@ -86,8 +90,8 @@ * but we're always started by some kind of bootloader now. * -- Cort */ - nop - nop + nop /* used by __secondary_hold on prep (mtx) and chrp smp */ + nop /* used by __secondary_hold on prep (mtx) and chrp smp */ nop /* PMAC @@ -113,7 +117,7 @@ * PREP * This is jumped to on prep systems right after the kernel is relocated * to its proper place in memory by the boot loader. The expected layout - * of the regs is: + * of the regs is: * r3: ptr to residual data * r4: initrd_start or if no initrd then 0 * r5: initrd_end - unused if r4 is 0 @@ -124,7 +128,7 @@ * start_here() to do the real work. * -- Cort */ - + .globl __start __start: /* @@ -153,7 +157,6 @@ bl fix_mem_constants #endif /* CONFIG_APUS */ -#ifndef CONFIG_GEMINI /* Switch MMU off, clear BATs and flush TLB. At this point, r3 contains * the physical address we are running at, returned by early_init() */ @@ -161,28 +164,11 @@ __after_mmu_off: bl clear_bats bl flush_tlbs -#endif -#ifndef CONFIG_POWER4 - /* POWER4 doesn't have BATs */ bl initial_bats #if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) bl setup_disp_bat #endif -#else /* CONFIG_POWER4 */ -/* - * Load up the SDR1 and segment register values now - * since we don't have the BATs. - */ - bl reloc_offset - addis r4,r3,_SDR1@ha /* get the value from _SDR1 */ - lwz r4,_SDR1@l(r4) /* assume hash table below 4GB */ - mtspr SDR1,r4 - slbia - lis r5,0x2000 /* set pseudo-segment reg 12 */ - ori r5,r5,0x0ccc - mtsr 12,r5 -#endif /* CONFIG_POWER4 */ #ifndef CONFIG_APUS /* @@ -297,13 +283,11 @@ .long ret_from_except /* System reset */ -#ifdef CONFIG_SMP /* MVME/MTX and gemini start the secondary here */ -#ifdef CONFIG_GEMINI +/* core99 pmac starts the seconary here by changing the vector, and + putting it back to what it was (UnknownException) when done. */ +#if defined(CONFIG_GEMINI) && defined(CONFIG_SMP) . = 0x100 b __secondary_start_gemini -#else /* CONFIG_GEMINI */ - STD_EXCEPTION(0x100, Reset, __secondary_start_psurge) -#endif /* CONFIG_GEMINI */ #else STD_EXCEPTION(0x100, Reset, UnknownException) #endif @@ -404,16 +388,12 @@ EXCEPTION_PROLOG; addi r3,r1,STACK_FRAME_OVERHEAD li r20,MSR_KERNEL -#ifndef CONFIG_APUS li r4,0 bl transfer_to_handler .globl do_IRQ_intercept do_IRQ_intercept: .long do_IRQ; .long ret_from_intercept -#else - bl apus_interrupt_entry -#endif /* CONFIG_APUS */ /* Alignment exception */ . = 0x600 @@ -503,7 +483,7 @@ Trap_0f: EXCEPTION_PROLOG b trap_0f_cont - + /* * Handle TLB miss for instruction on 603/603e. * Note: we get an alternate set of r0 - r3 to use automatically. @@ -652,7 +632,7 @@ mtcrf 0x80,r3 /* Restore CR0 */ mtmsr r0 b DataAccess - + /* * Handle TLB miss for DATA Store on 603/603e */ @@ -825,11 +805,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 @@ -846,14 +826,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) @@ -866,8 +845,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) @@ -891,7 +872,7 @@ lwz r21,GPR21(r21) SYNC RFI - + /* * FP unavailable trap from kernel - print a message, but let * the task use FP in the kernel until it returns to user mode. @@ -1036,7 +1017,7 @@ #endif /* CONFIG_SMP */ blr #endif /* CONFIG_ALTIVEC */ - + /* * giveup_fpu(tsk) * Disable FP for the task given as the argument, @@ -1047,9 +1028,10 @@ giveup_fpu: mfmsr r5 ori r5,r5,MSR_FP - SYNC + SYNC_601 + ISYNC_601 mtmsr r5 /* enable use of fpu now */ - SYNC + SYNC_601 isync cmpi 0,r3,0 beqlr- /* if no previous owner, done */ @@ -1188,62 +1170,6 @@ sync /* additional sync needed on g4 */ isync /* No speculative loading until now */ blr - -apus_interrupt_entry: - /* This is horrible, but there's no way around it. Enable the - * data cache so the IRQ hardware register can be accessed - * without cache intervention. Then disable interrupts and get - * the current emulated m68k IPL value. - */ - - mfmsr 20 - xori r20,r20,MSR_DR - SYNC - mtmsr r20 - isync - - lis r4,APUS_IPL_EMU@h - - li r20,(IPLEMU_SETRESET|IPLEMU_DISABLEINT) - stb r20,APUS_IPL_EMU@l(r4) - eieio - - lbz r3,APUS_IPL_EMU@l(r4) - - li r2,IPLEMU_IPLMASK - rlwinm. r20,r3,32-3,29,31 - bne 2f - mr r20,r2 /* lvl7! Need to reset state machine. */ - b 3f -2: cmp 0,r20,r2 - beq 1f -3: eieio - stb r2,APUS_IPL_EMU@l(r4) - ori r20,r20,IPLEMU_SETRESET - eieio - stb r20,APUS_IPL_EMU@l(r4) -1: eieio - li r20,IPLEMU_DISABLEINT - stb r20,APUS_IPL_EMU@l(r4) - - /* At this point we could do some magic to avoid the overhead - * of calling the C interrupt handler in case of a spurious - * interrupt. Could not get a simple hack to work though. - */ - - mfmsr r20 - xori r20,r20,MSR_DR - SYNC - mtmsr r20 - isync - - stw r3,(_CCR+4)(r21); - - addi r3,r1,STACK_FRAME_OVERHEAD; - li r20,MSR_KERNEL; - bl transfer_to_handler; - .long do_IRQ; - .long ret_from_except /*********************************************************************** * Please note that on APUS the exception handlers are located at the @@ -1263,10 +1189,9 @@ andc r4,r4,r3 mtspr HID0,r4 sync - bl prom_init + bl gemini_prom_init b __secondary_start #endif /* CONFIG_GEMINI */ - .globl __secondary_start_psurge __secondary_start_psurge: li r24,1 /* cpu # */ @@ -1326,7 +1251,6 @@ mtspr SPRG3,r4 li r3,0 mtspr SPRG2,r3 /* 0 => r1 has kernel sp */ - stw r3,PT_REGS(r4) /* set thread.regs to 0 for kernel thread */ /* enable MMU and jump to start_secondary */ li r4,MSR_KERNEL @@ -1391,8 +1315,6 @@ blr _GLOBAL(__setup_cpu_power3) blr -_GLOBAL(__setup_cpu_power4) - blr _GLOBAL(__setup_cpu_generic) blr @@ -1400,7 +1322,11 @@ 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 */ @@ -1530,7 +1456,7 @@ tophys(r6,r6) lwz r6,_SDR1@l(r6) mtspr SDR1,r6 -#ifdef CONFIG_PPC64BRIDGE +#ifdef CONFIG_PPC64BRIDGE /* clear the ASR so we only use the pseudo-segment registers. */ li r6,0 mtasr r6 @@ -1543,7 +1469,6 @@ addi r3,r3,0x111 /* increment VSID */ addis r4,r4,0x1000 /* address of next segment */ bdnz 3b -#ifndef CONFIG_POWER4 /* Load the BAT registers with the values set up by MMU_init. MMU_init takes care of whether we're on a 601 or not. */ mfpvr r3 @@ -1556,7 +1481,6 @@ LOAD_BAT(1,r3,r4,r5) LOAD_BAT(2,r3,r4,r5) LOAD_BAT(3,r3,r4,r5) -#endif /* CONFIG_POWER4 */ blr /* @@ -1626,12 +1550,27 @@ /* Load up the kernel context */ 2: sync /* Force all PTE updates to finish */ - ISYNC_601 + isync tlbia /* Clear all TLB entries */ sync /* wait for tlbia/tlbie to finish */ TLBSYNC /* ... on all CPUs */ bl load_up_mmu + +#ifdef CONFIG_BDI_SWITCH + /* Add helper information for the Abatron bdiGDB debugger. + * We do this here because we know the mmu is disabled, and + * will be enabled for real in just a few instructions. + */ + lis r5, abatron_pteptrs@h + ori r5, r5, abatron_pteptrs@l + stw r5, 0xf0(r0) /* This much match your Abatron config */ + lis r6, swapper_pg_dir@h + ori r6, r6, swapper_pg_dir@l + tophys(r5, r5) + stw r6, 0(r5) +#endif + /* Now turn on the MMU for real! */ li r4,MSR_KERNEL FIX_SRR1(r4,r5) @@ -1651,6 +1590,16 @@ addis r3,r3,0x6000 /* Set Ks, Ku bits */ li r0,NUM_USER_SEGMENTS mtctr r0 + +#ifdef CONFIG_BDI_SWITCH + /* Context switch the PTE pointer for the Abatron BDI2000. + * The PGDIR is passed as second argument. + */ + lis r5, KERNELBASE@h + lwz r5, 0xf0(r5) + stw r4, 0x4(r5) +#endif + li r4,0 BEGIN_FTR_SECTION DSSALL @@ -1678,22 +1627,21 @@ * -- Cort */ clear_bats: -#if !defined(CONFIG_GEMINI) li r20,0 mfspr r9,PVR rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */ cmpwi r9, 1 beq 1f - + mtspr DBAT0U,r20 - mtspr DBAT0L,r20 + mtspr DBAT0L,r20 mtspr DBAT1U,r20 mtspr DBAT1L,r20 mtspr DBAT2U,r20 - mtspr DBAT2L,r20 + mtspr DBAT2L,r20 mtspr DBAT3U,r20 mtspr DBAT3L,r20 -1: +1: mtspr IBAT0U,r20 mtspr IBAT0L,r20 mtspr IBAT1U,r20 @@ -1702,10 +1650,8 @@ mtspr IBAT2L,r20 mtspr IBAT3U,r20 mtspr IBAT3L,r20 -#endif /* !defined(CONFIG_GEMINI) */ blr -#ifndef CONFIG_GEMINI flush_tlbs: lis r20, 0x40 1: addic. r20, r20, -0x1000 @@ -1724,9 +1670,7 @@ mtspr SRR1,r3 sync RFI -#endif -#ifndef CONFIG_POWER4 /* * Use the first pair of BAT registers to map the 1st 16MB * of RAM to KERNELBASE. From this point on we can't safely @@ -1762,7 +1706,7 @@ #else ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */ #endif /* CONFIG_APUS */ - + #ifdef CONFIG_PPC64BRIDGE /* clear out the high 32 bits in the BAT */ clrldi r11,r11,32 @@ -1799,7 +1743,6 @@ blr #endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */ -#endif /* CONFIG_POWER4 */ #ifdef CONFIG_8260 /* Jump into the system reset for the rom. @@ -1851,12 +1794,12 @@ .globl swapper_pg_dir swapper_pg_dir: - .space 4096 + .space 4096 /* * This space gets a copy of optional info passed to us by the bootstrap * Used to pass parameters into the kernel like root=/dev/sda1, etc. - */ + */ .globl cmd_line cmd_line: .space 512 @@ -1869,3 +1812,11 @@ .long 0, 0, 0, 0, 0, 0, 0, 0 .long 0, 0, 0, 0, 0, 0, 0, 0 .long 0, 0, 0, 0, 0, 0, 0, 0 + +#ifdef CONFIG_BDI_SWITCH +/* Room for two PTE pointers, usually the kernel and current user pointers + * to their respective root page table. + */ +abatron_pteptrs: + .space 8 +#endif diff -uNr linux-2.4.19/arch/ppc/kernel/head_4xx.S linux-2.4.19bgl/arch/ppc/kernel/head_4xx.S --- linux-2.4.19/arch/ppc/kernel/head_4xx.S 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/head_4xx.S 2003-07-02 10:44:13.000000000 -0500 @@ -1,7 +1,4 @@ /* - * BK Id: SCCS/s.head_4xx.S 1.6 05/21/01 11:50:00 paulus - */ -/* * Copyright (c) 1995-1996 Gary Thomas * Initial PowerPC version. * Copyright (c) 1996 Cort Dougan @@ -14,6 +11,13 @@ * PowerPC 403GCX modifications. * Copyright (c) 1999 Grant Erickson * PowerPC 403GCX/405GP modifications. + * Copyright 2000 MontaVista Software Inc. + * PPC405 modifications + * PowerPC 403GCX/405GP modifications. + * Author: MontaVista Software, Inc. + * frank_rowand@mvista.com or source@mvista.com + * debbie_chu@mvista.com + * * * Module name: head_4xx.S * @@ -28,139 +32,92 @@ */ #include - #include #include -#include #include - -#include "ppc_asm.h" - +#include +#include +#include +#include +#include "ppc_defs.h" /* Preprocessor Defines */ #define STND_EXC 0 #define CRIT_EXC 1 -### -### Check to make sure the right processor has been defined. -### - -#if !defined(CONFIG_4xx) -#error "This file is only appropriate for kernels supporting the PPC4xx." -#endif - -### -### Execution entry point. -### - -### -### As with the other PowerPC ports, it is expected that when code -### execution begins here, the following registers contain valid, yet -### optional, information: -### -### r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.) -### r4 - Starting address of the init RAM disk -### r5 - Ending address of the init RAM disk -### r6 - Start of kernel command line string (e.g. "mem=96m") -### r7 - End of kernel command line string -### - +/* As with the other PowerPC ports, it is expected that when code + * execution begins here, the following registers contain valid, yet + * optional, information: + * + * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.) + * r4 - Starting address of the init RAM disk + * r5 - Ending address of the init RAM disk + * r6 - Start of kernel command line string (e.g. "mem=96m") + * r7 - End of kernel command line string + * + * This is all going to change RSN when we add bi_recs....... -- Dan + */ .text _GLOBAL(_stext) _GLOBAL(_start) - ## Save residual data, init RAM disk, and command line parameters - + + /* Save parameters we are passed. + */ mr r31,r3 mr r30,r4 mr r29,r5 mr r28,r6 mr r27,r7 + li r24,0 /* CPU number */ - ## Set the ID for this CPU - - li r24,0 - - ## Invalidate all TLB entries + /* We have to turn on the MMU right away so we get cache modes + * set correctly. + */ + bl initial_mmu - tlbia - - ## We should still be executing code at physical address 0x0000xxxx - ## at this point. However, start_here is at virtual address - ## 0xC000xxxx. So, set up a TLB mapping to cover this once - ## translation is enabled. - - lis r3,KERNELBASE@h # Load the kernel virtual address - ori r3,r3,KERNELBASE@l - tophys(r4,r3) # Load the kernel physical address - - ## Save the existing PID and load the kernel PID. - - mfspr r7,SPRN_PID # Save the old PID - li r0,0 - mtspr SPRN_PID,r0 # Load the kernel PID - - ## Configure and load entry into TLB slot 0. - - clrrwi r4,r4,10 # Mask off the real page number - ori r4,r4,(TLB_WR | TLB_EX) # Set the write and execute bits - - clrrwi r3,r3,10 # Mask off the effective page number - ori r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_16M)) - - tlbwe r4,r0,TLB_DATA # Load the data portion of the entry - tlbwe r3,r0,TLB_TAG # Load the tag portion of the entry - isync - - mtspr SPRN_PID,r7 # Restore the existing PID - - ## Establish the exception vector base - - lis r4,KERNELBASE@h # EVPR only uses the high 16-bits - tophys(r0,r4) # Use the physical address - mtspr SPRN_EVPR,r0 - - ## Enable the MMU and jump to the main PowerPC kernel start-up code - - mfmsr r0 # Get the machine state register - ori r0,r0,(MSR_DR | MSR_IR) # Enable data and instr. translation - mtspr SPRN_SRR1,r0 # Set up the new machine state register - lis r0,start_here@h - ori r0,r0,start_here@l - mtspr SPRN_SRR0,r0 # Set up the new instruction pointer - rfi # Jump to start_here w/ translation on - - -### -### Exception vector entry code. This code runs with address translation -### turned off (i.e. using physical addresses). We assume SPRG3 has the -### physical address of the current task thread_struct. -### +/* We now have the lower 16 Meg mapped into TLB entries, and the caches + * ready to work. + */ +turn_on_mmu: + li r0,MSR_KERNEL + mtspr SRR1,r0 + lis r0,start_here@h + ori r0,r0,start_here@l + mtspr SRR0,r0 + SYNC + rfi /* enables MMU */ + b . /* prevent prefetch past rfi */ - ## Common exception code for all exception types. +/* Exception vector entry code. This code runs with address translation + * turned off (i.e. using physical addresses). We assume SPRG3 has the + * physical address of the current task thread_struct. + */ #define COMMON_PROLOG \ -0: mtspr SPRN_SPRG0,r20; /* We need r20, move it to SPRG0 */\ - mtspr SPRN_SPRG1,r21; /* We need r21, move it to SPRG1 */\ - mfcr r20; /* We need the CR, move it to r20 */\ - mfspr r21,SPRN_SPRG2; /* Exception stack to use */\ - cmpwi cr0,r21,0; /* From user mode or RTAS? */\ - bne 1f; /* Not RTAS, branch */\ - tophys(r21, r1); /* Convert vka in r1 to pka in r21 */\ - subi r21,r21,INT_FRAME_SIZE; /* Allocate an exception frame */\ -1: stw r20,_CCR(r21); /* Save CR on the stack */\ - stw r22,GPR22(r21); /* Save r22 on the stack */\ - stw r23,GPR23(r21); /* r23 Save on the stack */\ - mfspr r20,SPRN_SPRG0; /* Get r20 back out of SPRG0 */\ - stw r20,GPR20(r21); /* Save r20 on the stack */\ - mfspr r22,SPRN_SPRG1; /* Get r21 back out of SPRG0 */\ - stw r22,GPR21(r21); /* Save r21 on the stack */\ - mflr r20; \ - stw r20,_LINK(r21); /* Save LR on the stack */\ - mfctr r22; \ - stw r22,_CTR(r21); /* Save CTR on the stack */\ - mfspr r20,XER; \ - stw r20,_XER(r21); /* Save XER on the stack */ +0: mtspr SPRN_SPRG0,r20; /* We need r20, move it to SPRG0 */\ + mtspr SPRN_SPRG1,r21; /* We need r21, move it to SPRG1 */\ + mfcr r20; /* We need the CR, move it to r20 */\ + mfspr r21,SPRN_SPRG2; /* Exception stack to use */\ + cmpwi cr0,r21,0; /* From user mode or RTAS? */\ + bne 1f; /* Not RTAS, branch */\ + tophys(r21, r1); /* Convert vka in r1 to pka in r21 */\ + subi r21,r21,INT_FRAME_SIZE; /* Allocate an exception frame */\ +1: stw r20,_CCR(r21); /* Save CR on the stack */\ + stw r22,GPR22(r21); /* Save r22 on the stack */\ + stw r23,GPR23(r21); /* r23 Save on the stack */\ + mfspr r20,SPRN_SPRG0; /* Get r20 back out of SPRG0 */\ + stw r20,GPR20(r21); /* Save r20 on the stack */\ + mfspr r22,SPRN_SPRG1; /* Get r21 back out of SPRG0 */\ + stw r22,GPR21(r21); /* Save r21 on the stack */\ + mflr r20; \ + stw r20,_LINK(r21); /* Save LR on the stack */\ + mfctr r22; \ + stw r22,_CTR(r21); /* Save CTR on the stack */\ + mfspr r20,XER; \ + stw r20,_XER(r21); /* Save XER on the stack */\ + mfspr r20,SPRN_DBCR0; \ + stw r20,_DBCR0(r21); /* Save Debug Control on the stack */ #define COMMON_EPILOG \ stw r0,GPR0(r21); /* Save r0 on the stack */\ @@ -171,25 +128,22 @@ SAVE_4GPRS(3, r21); /* Save r3 through r6 on the stack */\ SAVE_GPR(7, r21); /* Save r7 on the stack */ - ## Common exception code for standard (non-critical) exceptions. - #define STND_EXCEPTION_PROLOG \ COMMON_PROLOG; \ mfspr r22,SPRN_SRR0; /* Faulting instruction address */\ + lis r20,MSR_WE@h; \ mfspr r23,SPRN_SRR1; /* MSR at the time of fault */\ + andc r23,r23,r20; /* disable processor wait state */\ COMMON_EPILOG; - ## Common exception code for critical exceptions. - #define CRIT_EXCEPTION_PROLOG \ COMMON_PROLOG; \ mfspr r22,SPRN_SRR2; /* Faulting instruction address */\ + lis r20,MSR_WE@h; \ mfspr r23,SPRN_SRR3; /* MSR at the time of fault */\ + andc r23,r23,r20; /* disable processor wait state */\ COMMON_EPILOG; -### -### Macros for specific exception types -### #define START_EXCEPTION(n, label) \ . = n; \ @@ -200,8 +154,8 @@ bl transfer_to_handler; \ .long func; \ .long ret_from_except - - + + #define STND_EXCEPTION(n, label, func) \ START_EXCEPTION(n, label); \ STND_EXCEPTION_PROLOG; \ @@ -210,7 +164,7 @@ li r20,MSR_KERNEL; \ FINISH_EXCEPTION(func) - + #define CRIT_EXCEPTION(n, label, func) \ START_EXCEPTION(n, label); \ CRIT_EXCEPTION_PROLOG; \ @@ -219,47 +173,189 @@ li r20,MSR_KERNEL; \ FINISH_EXCEPTION(func) - -### -### Exception vectors. -### - -### 0x0100 - Critical Interrupt Exception +/* Exception vectors. +*/ + +/* 0x0100 - Critical Interrupt Exception +*/ CRIT_EXCEPTION(0x0100, CriticalInterrupt, UnknownException) -### 0x0200 - Machine Check Exception - - CRIT_EXCEPTION(0x0200, MachineCheck, MachineCheckException) +/* 0x0200 - Machine Check Exception +*/ + START_EXCEPTION(0x0200, MachineCheck) + CRIT_EXCEPTION_PROLOG + + /* + lis r4,0x0400 + mtdcr DCRN_POB0_BESR0,r4 + */ +#ifdef DCRN_POB0_BEAR + mfdcr r4,DCRN_POB0_BEAR + mfdcr r4,DCRN_POB0_BESR0 + mfdcr r4,DCRN_POB0_BESR1 +#endif -### 0x0300 - Data Storage Exception +#ifdef DCRN_PLB0_BEAR + mfdcr r4,DCRN_PLB0_ACR + mfdcr r4,DCRN_PLB0_BEAR + mfdcr r4,DCRN_PLB0_BESR +#endif - START_EXCEPTION(0x0300, DataAccess) - STND_EXCEPTION_PROLOG - mfspr r5,SPRN_ESR # Grab the ESR, save it, pass as arg3 - stw r5,_ESR(r21) - mfspr r4,SPRN_DEAR # Grab the DEAR, save it, pass as arg2 - stw r4,_DEAR(r21) addi r3,r1,STACK_FRAME_OVERHEAD - li r7,STND_EXC # This is a standard exception + li r7,CRIT_EXC li r20,MSR_KERNEL - rlwimi r20,r23,0,16,16 # Copy EE bit from the saved MSR - FINISH_EXCEPTION(do_page_fault) # do_page_fault(regs, ESR, DEAR) - -### 0x0400 - Instruction Storage Exception + FINISH_EXCEPTION(MachineCheckException) +/* 0x0300 - Data Storage Exception + * This happens for just a few reasons. U0 set (but we don't do that), + * or zone protection fault (user violation, write to protected page). + * If this is just an update of modified status, we do that quickly + * and exit. Otherwise, we call heavywight functions to do the work. + */ + START_EXCEPTION(0x0300, DataStore) + mtspr SPRG0, r20 /* Save some working registers */ + mtspr SPRG1, r21 +#ifdef CONFIG_403GCX + stw r22, 0(r0) + stw r23, 4(r0) + mfcr r21 + mfspr r22, SPRN_PID + stw r21, 8(r0) + stw r22, 12(r0) +#else + mtspr SPRG4, r22 + mtspr SPRG5, r23 + mfcr r21 + mfspr r22, SPRN_PID + mtspr SPRG7, r21 + mtspr SPRG6, r22 +#endif + + /* First, check if it was a zone fault (which means a user + * tried to access a kernel or read-protected page - always + * a SEGV). All other faults here must be stores, so no + * need to check ESR_DST as well. */ + mfspr r20, SPRN_ESR + andis. r20, r20, ESR_DIZ@h + bne 2f + + mfspr r20, SPRN_DEAR /* Get faulting address */ + + /* If we are faulting a kernel address, we have to use the + * kernel page tables. + */ + andis. r21, r20, 0x8000 + beq 3f + lis r21, swapper_pg_dir@h + ori r21, r21, swapper_pg_dir@l + li r23, 0 + mtspr SPRN_PID, r23 /* TLB will have 0 TID */ + b 4f + + /* Get the PGD for the current thread. + */ +3: + mfspr r21,SPRG3 + lwz r21,PGDIR(r21) +4: + tophys(r21, r21) + rlwimi r21, r20, 12, 20, 29 /* Create L1 (pgdir/pmd) address */ + lwz r21, 0(r21) /* Get L1 entry */ + rlwinm. r22, r21, 0, 0, 19 /* Extract L2 (pte) base address */ + beq 2f /* Bail if no table */ + + tophys(r22, r22) + rlwimi r22, r20, 22, 20, 29 /* Compute PTE address */ + lwz r21, 0(r22) /* Get Linux PTE */ + + andi. r23, r21, _PAGE_RW /* Is it writeable? */ + beq 2f /* Bail if not */ + + /* Update 'changed'. + */ + ori r21, r21, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE + stw r21, 0(r22) /* Update Linux page table */ + + /* Most of the Linux PTE is ready to load into the TLB LO. + * We set ZSEL, where only the LS-bit determines user access. + * We set execute, because we don't have the granularity to + * properly set this at the page level (Linux problem). + * If shared is set, we cause a zero PID->TID load. + * Many of these bits are software only. Bits we don't set + * here we (properly should) assume have the appropriate value. + */ + li r22, 0x0ce2 + andc r21, r21, r22 /* Make sure 20, 21 are zero */ + + /* find the TLB index that caused the fault. It has to be here. + */ + tlbsx r23, 0, r20 + + tlbwe r21, r23, TLB_DATA /* Load TLB LO */ + + /* Done...restore registers and get out of here. + */ +#ifdef CONFIG_403GCX + lwz r22, 12(r0) + lwz r21, 8(r0) + mtspr SPRN_PID, r22 + mtcr r21 + lwz r23, 4(r0) + lwz r22, 0(r0) +#else + mfspr r22, SPRG6 + mfspr r21, SPRG7 + mtspr SPRN_PID, r22 + mtcr r21 + mfspr r23, SPRG5 + mfspr r22, SPRG4 +#endif + mfspr r21, SPRG1 + mfspr r20, SPRG0 + PPC405_ERR77_SYNC + rfi /* Should sync shadow TLBs */ + b . /* prevent prefetch past rfi */ + +2: + /* The bailout. Restore registers to pre-exception conditions + * and call the heavyweights to help us out. + */ +#ifdef CONFIG_403GCX + lwz r22, 12(r0) + lwz r21, 8(r0) + mtspr SPRN_PID, r22 + mtcr r21 + lwz r23, 4(r0) + lwz r22, 0(r0) +#else + mfspr r22, SPRG6 + mfspr r21, SPRG7 + mtspr SPRN_PID, r22 + mtcr r21 + mfspr r23, SPRG5 + mfspr r22, SPRG4 +#endif + mfspr r21, SPRG1 + mfspr r20, SPRG0 + b DataAccess + +/* 0x0400 - Instruction Storage Exception + * I don't know why it is called "Storage"....This is caused by a fetch + * from non-execute or guarded pages. + */ START_EXCEPTION(0x0400, InstructionAccess) STND_EXCEPTION_PROLOG - mr r4,r22 # Pass SRR0 as arg2 - mr r5,r23 # Pass SRR1 as arg3 + mr r4,r22 /* Pass SRR0 as arg2 */ + li r5,0 /* Pass zero as arg3 */ addi r3,r1,STACK_FRAME_OVERHEAD - li r7,STND_EXC # This is a standard exception + li r7,STND_EXC li r20,MSR_KERNEL - rlwimi r20,r23,0,16,16 # Copy EE bit from the saved MSR - FINISH_EXCEPTION(do_page_fault) # do_page_fault(regs, SRR0, SRR1) - -### 0x0500 - External Interrupt Exception + rlwimi r20,r23,0,16,16 /* Copy EE bit from the saved MSR */ + FINISH_EXCEPTION(do_page_fault) /* do_page_fault(regs, SRR0, SRR1) */ +/* 0x0500 - External Interrupt Exception +*/ START_EXCEPTION(0x0500, HardwareInterrupt) STND_EXCEPTION_PROLOG addi r3,r1,STACK_FRAME_OVERHEAD @@ -271,54 +367,70 @@ .long do_IRQ .long ret_from_intercept -### 0x0600 - Alignment Exception - +/* 0x0600 - Alignment Exception +*/ START_EXCEPTION(0x0600, Alignment) STND_EXCEPTION_PROLOG - mfspr r4,SPRN_DEAR # Grab the DEAR and save it + mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */ stw r4,_DEAR(r21) addi r3,r1,STACK_FRAME_OVERHEAD - li r7,STND_EXC # This is a standard exception + li r7,STND_EXC li r20,MSR_KERNEL - rlwimi r20,r23,0,16,16 # Copy EE bit from the saved MSR + rlwimi r20,r23,0,16,16 /* Copy EE bit from the saved MSR */ FINISH_EXCEPTION(AlignmentException) -### 0x0700 - Program Exception - +/* 0x0700 - Program Exception +*/ START_EXCEPTION(0x0700, ProgramCheck) STND_EXCEPTION_PROLOG addi r3,r1,STACK_FRAME_OVERHEAD - li r7,STND_EXC # This is a standard exception + li r7,STND_EXC li r20,MSR_KERNEL - rlwimi r20,r23,0,16,16 # Copy EE bit from the saved MSR + rlwimi r20,r23,0,16,16 /* Copy EE bit from the saved MSR */ FINISH_EXCEPTION(ProgramCheckException) - - STND_EXCEPTION(0x0800, Trap_08, UnknownException) + + +/* I'm stealing this unused vector location to build a standard exception + * frame for Data TLB Access errors. The other Data TLB exceptions will bail + * out to this point if they can't resolve the lightweight TLB fault. + */ + START_EXCEPTION(0x0800, DataAccess) + STND_EXCEPTION_PROLOG + mfspr r5,SPRN_ESR /* Grab the ESR, save it, pass arg3 */ + stw r5,_ESR(r21) + mfspr r4,SPRN_DEAR /* Grab the DEAR, save it, pass arg2 */ + stw r4,_DEAR(r21) + addi r3,r1,STACK_FRAME_OVERHEAD + li r7,STND_EXC + li r20,MSR_KERNEL + rlwimi r20,r23,0,16,16 /* Copy EE bit from the saved MSR */ + FINISH_EXCEPTION(do_page_fault) /* do_page_fault(regs, ESR, DEAR) */ + STND_EXCEPTION(0x0900, Trap_09, UnknownException) STND_EXCEPTION(0x0A00, Trap_0A, UnknownException) - STND_EXCEPTION(0x0B00, Trap_0B, UnknownException) -### 0x0C00 - System Call Exception - + STND_EXCEPTION(0x0B00, Trap_0B, UnknownException) +/* 0x0C00 - System Call Exception +*/ START_EXCEPTION(0x0C00, SystemCall) STND_EXCEPTION_PROLOG stw r3,ORIG_GPR3(r21) - li r7,STND_EXC # This is a standard exception + li r7,STND_EXC li r20,MSR_KERNEL - rlwimi r20,r23,0,16,16 # Copy EE bit from the saved MSR + rlwimi r20,r23,0,16,16 /* Copy EE bit from the saved MSR */ FINISH_EXCEPTION(DoSyscall) STND_EXCEPTION(0x0D00, Trap_0D, UnknownException) STND_EXCEPTION(0x0E00, Trap_0E, UnknownException) STND_EXCEPTION(0x0F00, Trap_0F, UnknownException) -### 0x1000 - Programmable Interval Timer (PIT) Exception - +/* 0x1000 - Programmable Interval Timer (PIT) Exception +*/ START_EXCEPTION(0x1000, Decrementer) STND_EXCEPTION_PROLOG - lis r0,TSR_PIS@h # Set-up the PIT exception mask - mtspr SPRN_TSR,r0 # Clear the PIT exception + lis r0,TSR_PIS@h /* Set-up the PIT exception mask */ + mtspr SPRN_TSR,r0 /* Clear the PIT exception */ addi r3,r1,STACK_FRAME_OVERHEAD - li r7,STND_EXC # This is a standard exception + li r7,STND_EXC li r20,MSR_KERNEL bl transfer_to_handler _GLOBAL(timer_interrupt_intercept) @@ -326,28 +438,217 @@ .long ret_from_intercept #if 0 -### 0x1010 - Fixed Interval Timer (FIT) Exception - +/* NOTE: + * FIT and WDT handlers are not implemented yet. + */ + +/* 0x1010 - Fixed Interval Timer (FIT) Exception +*/ STND_EXCEPTION(0x1010, FITException, UnknownException) -### 0x1020 - Watchdog Timer (WDT) Exception +/* 0x1020 - Watchdog Timer (WDT) Exception +*/ CRIT_EXCEPTION(0x1020, WDTException, UnknownException) #endif -### 0x1100 - Data TLB Miss Exception +/* 0x1100 - Data TLB Miss Exception + * As the name implies, translation is not in the MMU, so search the + * page tables and fix it. The only purpose of this function is to + * load TLB entries from the page table if they exist. + */ + START_EXCEPTION(0x1100, DTLBMiss) + mtspr SPRG0, r20 /* Save some working registers */ + mtspr SPRG1, r21 +#ifdef CONFIG_403GCX + stw r22, 0(r0) + stw r23, 4(r0) + mfcr r21 + mfspr r22, SPRN_PID + stw r21, 8(r0) + stw r22, 12(r0) +#else + mtspr SPRG4, r22 + mtspr SPRG5, r23 + mfcr r21 + mfspr r22, SPRN_PID + mtspr SPRG7, r21 + mtspr SPRG6, r22 +#endif + mfspr r20, SPRN_DEAR /* Get faulting address */ - STND_EXCEPTION(0x1100, DTLBMiss, PPC4xx_dtlb_miss) + /* If we are faulting a kernel address, we have to use the + * kernel page tables. + */ + andis. r21, r20, 0x8000 + beq 3f + lis r21, swapper_pg_dir@h + ori r21, r21, swapper_pg_dir@l + li r23, 0 + mtspr SPRN_PID, r23 /* TLB will have 0 TID */ + b 4f + + /* Get the PGD for the current thread. + */ +3: + mfspr r21,SPRG3 + lwz r21,PGDIR(r21) +4: + tophys(r21, r21) + rlwimi r21, r20, 12, 20, 29 /* Create L1 (pgdir/pmd) address */ + lwz r21, 0(r21) /* Get L1 entry */ + rlwinm. r22, r21, 0, 0, 19 /* Extract L2 (pte) base address */ + beq 2f /* Bail if no table */ + + tophys(r22, r22) + rlwimi r22, r20, 22, 20, 29 /* Compute PTE address */ + lwz r21, 0(r22) /* Get Linux PTE */ + andi. r23, r21, _PAGE_PRESENT + beq 2f -### 0x1200 - Instruction TLB Miss Exception + ori r21, r21, _PAGE_ACCESSED + stw r21, 0(r22) - STND_EXCEPTION(0x1200, ITLBMiss, PPC4xx_itlb_miss) + /* Most of the Linux PTE is ready to load into the TLB LO. + * We set ZSEL, where only the LS-bit determines user access. + * We set execute, because we don't have the granularity to + * properly set this at the page level (Linux problem). + * If shared is set, we cause a zero PID->TID load. + * Many of these bits are software only. Bits we don't set + * here we (properly should) assume have the appropriate value. + */ + li r22, 0x0ce2 + andc r21, r21, r22 /* Make sure 20, 21 are zero */ + + b finish_tlb_load + + +2: + /* The bailout. Restore registers to pre-exception conditions + * and call the heavyweights to help us out. + */ +#ifdef CONFIG_403GCX + lwz r22, 12(r0) + lwz r21, 8(r0) + mtspr SPRN_PID, r22 + mtcr r21 + lwz r23, 4(r0) + lwz r22, 0(r0) +#else + mfspr r22, SPRG6 + mfspr r21, SPRG7 + mtspr SPRN_PID, r22 + mtcr r21 + mfspr r23, SPRG5 + mfspr r22, SPRG4 +#endif + mfspr r21, SPRG1 + mfspr r20, SPRG0 + b DataAccess + +/* 0x1200 - Instruction TLB Miss Exception + * Nearly the same as above, except we get our information from different + * registers and bailout to a different point. + */ + START_EXCEPTION(0x1200, ITLBMiss) + mtspr SPRG0, r20 /* Save some working registers */ + mtspr SPRG1, r21 +#ifdef CONFIG_403GCX + stw r22, 0(r0) + stw r23, 4(r0) + mfcr r21 + mfspr r22, SPRN_PID + stw r21, 8(r0) + stw r22, 12(r0) +#else + mtspr SPRG4, r22 + mtspr SPRG5, r23 + mfcr r21 + mfspr r22, SPRN_PID + mtspr SPRG7, r21 + mtspr SPRG6, r22 +#endif + mfspr r20, SRR0 /* Get faulting address */ + + /* If we are faulting a kernel address, we have to use the + * kernel page tables. + */ + andis. r21, r20, 0x8000 + beq 3f + lis r21, swapper_pg_dir@h + ori r21, r21, swapper_pg_dir@l + li r23, 0 + mtspr SPRN_PID, r23 /* TLB will have 0 TID */ + b 4f + + /* Get the PGD for the current thread. + */ +3: + mfspr r21,SPRG3 + lwz r21,PGDIR(r21) +4: + tophys(r21, r21) + rlwimi r21, r20, 12, 20, 29 /* Create L1 (pgdir/pmd) address */ + lwz r21, 0(r21) /* Get L1 entry */ + rlwinm. r22, r21, 0, 0, 19 /* Extract L2 (pte) base address */ + beq 2f /* Bail if no table */ + + tophys(r22, r22) + rlwimi r22, r20, 22, 20, 29 /* Compute PTE address */ + lwz r21, 0(r22) /* Get Linux PTE */ + andi. r23, r21, _PAGE_PRESENT + beq 2f + + ori r21, r21, _PAGE_ACCESSED + stw r21, 0(r22) + + /* Most of the Linux PTE is ready to load into the TLB LO. + * We set ZSEL, where only the LS-bit determines user access. + * We set execute, because we don't have the granularity to + * properly set this at the page level (Linux problem). + * If shared is set, we cause a zero PID->TID load. + * Many of these bits are software only. Bits we don't set + * here we (properly should) assume have the appropriate value. + */ + li r22, 0x0ce2 + andc r21, r21, r22 /* Make sure 20, 21 are zero */ + + b finish_tlb_load + +2: + /* The bailout. Restore registers to pre-exception conditions + * and call the heavyweights to help us out. + */ +#ifdef CONFIG_403GCX + lwz r22, 12(r0) + lwz r21, 8(r0) + mtspr SPRN_PID, r22 + mtcr r21 + lwz r23, 4(r0) + lwz r22, 0(r0) +#else + mfspr r22, SPRG6 + mfspr r21, SPRG7 + mtspr SPRN_PID, r22 + mtcr r21 + mfspr r23, SPRG5 + mfspr r22, SPRG4 +#endif + mfspr r21, SPRG1 + mfspr r20, SPRG0 + b InstructionAccess STND_EXCEPTION(0x1300, Trap_13, UnknownException) STND_EXCEPTION(0x1400, Trap_14, UnknownException) STND_EXCEPTION(0x1500, Trap_15, UnknownException) STND_EXCEPTION(0x1600, Trap_16, UnknownException) +#ifdef CONFIG_IBM405_ERR51 + /* 405GP errata 51 */ + START_EXCEPTION(0x1700, Trap_17) + b DTLBMiss +#else STND_EXCEPTION(0x1700, Trap_17, UnknownException) +#endif STND_EXCEPTION(0x1800, Trap_18, UnknownException) STND_EXCEPTION(0x1900, Trap_19, UnknownException) STND_EXCEPTION(0x1A00, Trap_1A, UnknownException) @@ -356,73 +657,212 @@ STND_EXCEPTION(0x1D00, Trap_1D, UnknownException) STND_EXCEPTION(0x1E00, Trap_1E, UnknownException) STND_EXCEPTION(0x1F00, Trap_1F, UnknownException) - -### 0x2000 - Debug Exception - CRIT_EXCEPTION(0x2000, DebugTrap, UnknownException) +/* 0x2000 - Debug Exception +*/ + START_EXCEPTION(0x2000, DebugTrap) + b check_single_step_in_exception +ret_to_debug_exception: + CRIT_EXCEPTION_PROLOG + addi r3,r1,STACK_FRAME_OVERHEAD + li r7,CRIT_EXC; + li r20,MSR_KERNEL + FINISH_EXCEPTION(DebugException) + +/* Make sure the final interrupt handler has not spilled past the + * end of its allotted space. + */ + .=0x2100 + +/* Check for a single step debug exception while in an exception + * handler before state has been saved. This is to catch the case + * where an instruction that we are trying to single step causes + * an exception (eg ITLB miss) and thus the first instruction of + * the exception handler generates a single step debug exception. + * + * If we get a debug trap on the first instruction of an exception handler, + * we reset the MSR_DE in the _exception handlers_ MSR (the debug trap is + * a critical exception, so we are using SPRN_SRR3 to manipulate the MSR). + * The exception handler was handling a non-critical interrupt, so it will + * save (and later restore) the MSR via SPRN_SRR1, which will still have + * the MSR_DE bit set. + */ +check_single_step_in_exception: + + /* This first instruction was already executed by the exception + * handler and must be the first instruction of every exception + * handler. + */ + mtspr SPRN_SPRG0,r20 /* Save some working registers... */ + mtspr SPRN_SPRG1,r21 + mfcr r20 /* ..and the cr because we change it */ + + mfspr r21,SPRN_SRR3 /* MSR at the time of fault */ + andi. r21,r21,MSR_PR + bne+ 2f /* trapped from problem state */ + + mfspr r21,SPRN_SRR2 /* Faulting instruction address */ + cmplwi r21,0x2100 + bgt+ 2f /* address above exception vectors */ + + lis r21,DBSR_IC@h /* Remove the trap status */ + mtspr SPRN_DBSR,r21 + + mfspr r21,SPRN_SRR3 + rlwinm r21,r21,0,23,21 /* clear MSR_DE */ + mtspr SPRN_SRR3, r21 /* restore MSR at rcfi without DE */ + + mtcrf 0xff,r20 /* restore registers */ + mfspr r21,SPRN_SPRG1 + mfspr r20,SPRN_SPRG0 + + sync + rfci /* return to the exception handler */ + b . /* prevent prefetch past rfci */ + +2: + mtcrf 0xff,r20 /* restore registers */ + mfspr r21,SPRN_SPRG1 + mfspr r20,SPRN_SPRG0 + b ret_to_debug_exception + +/* Other PowerPC processors, namely those derived from the 6xx-series + * have vectors from 0x2100 through 0x2F00 defined, but marked as reserved. + * However, for the 4xx-series processors these are neither defined nor + * reserved. + */ + + /* Damn, I came up one instruction too many to fit into the + * exception space :-). Both the instruction and data TLB + * miss get to this point to load the TLB. + * r20 - EA of fault + * r21 - TLB LO (info from Linux PTE) + * r22, r23 - avilable to use + * PID - loaded with proper value when we get here + * Upon exit, we reload everything and RFI. + * Actually, it will fit now, but oh well.....a common place + * to load the TLB. + */ +tlb_4xx_index: + .long 0 +finish_tlb_load: + /* load the next available TLB index. + */ + lwz r23, tlb_4xx_index@l(0) + addi r23, r23, 1 +#ifdef CONFIG_PIN_TLB + cmpwi 0, r23, 61 /* reserve entries 62, 63 for kernel */ + ble 7f + li r23, 0 +7: +#else + andi. r23, r23, (PPC4XX_TLB_SIZE-1) +#endif + stw r23, tlb_4xx_index@l(0) -### -### Other PowerPC processors, namely those derived from the 6xx-series -### have vectors from 0x2100 through 0x2F00 defined, but marked as reserved. -### However, for the 4xx-series processors these are neither defined nor -### reserved. -### - -### -### This code finishes saving the registers to the exception frame -### and jumps to the appropriate handler for the exception, turning -### on address translation. -### +6: + tlbwe r21, r23, TLB_DATA /* Load TLB LO */ + /* Create EPN. This is the faulting address plus a static + * set of bits. These are size, valid, E, U0, and ensure + * bits 20 and 21 are zero. + */ + li r22, 0x00c0 + rlwimi r20, r22, 0, 20, 31 + tlbwe r20, r23, TLB_TAG /* Load TLB HI */ + + /* Done...restore registers and get out of here. + */ +#ifdef CONFIG_403GCX + lwz r22, 12(r0) + lwz r21, 8(r0) + mtspr SPRN_PID, r22 + mtcr r21 + lwz r23, 4(r0) + lwz r22, 0(r0) +#else + mfspr r22, SPRG6 + mfspr r21, SPRG7 + mtspr SPRN_PID, r22 + mtcr r21 + mfspr r23, SPRG5 + mfspr r22, SPRG4 +#endif + mfspr r21, SPRG1 + mfspr r20, SPRG0 + PPC405_ERR77_SYNC + rfi /* Should sync shadow TLBs */ + b . /* prevent prefetch past rfi */ + +/* This code finishes saving the registers to the exception frame + * and jumps to the appropriate handler for the exception, turning + * on address translation. + */ _GLOBAL(transfer_to_handler) - stw r22,_NIP(r21) # Save the faulting IP on the stack - stw r23,_MSR(r21) # Save the exception MSR on the stack - SAVE_4GPRS(8, r21) # Save r8 through r11 on the stack - SAVE_8GPRS(12, r21) # Save r12 through r19 on the stack - SAVE_8GPRS(24, r21) # Save r24 through r31 on the stack - andi. r23,r23,MSR_PR # Is this from user space? - mfspr r23,SPRN_SPRG3 # If from user, fix up THREAD.regs - beq 2f # No, it is from the kernel; branch. + stw r22,_NIP(r21) /* Save the faulting IP on the stack */ + stw r23,_MSR(r21) /* Save the exception MSR on stack */ + SAVE_4GPRS(8, r21) /* Save r8 through r11 on the stack */ + SAVE_8GPRS(12, r21) /* Save r12 through r19 on the stack */ + SAVE_8GPRS(24, r21) /* Save r24 through r31 on the stack */ + andi. r23,r23,MSR_PR /* Is this from user space? */ + mfspr r23,SPRN_SPRG3 /* If from user, fix up THREAD.regs */ + beq 2f /* No, it is from the kernel; branch. */ addi r24,r1,STACK_FRAME_OVERHEAD - stw r24,PT_REGS(r23) # -2: addi r2,r23,-THREAD # Set r2 to current thread + stw r24,PT_REGS(r23) +2: addi r2,r23,-THREAD /* Set r2 to current thread */ tovirt(r2,r2) mflr r23 - andi. r24,r23,0x3f00 # Get vector offset + andi. r24,r23,0x3f00 /* Get vector offset */ stw r24,TRAP(r21) + li r22,RESULT + /* No need to put an erratum #77 workaround here + because interrupts are currently disabled */ + stwcx. r22,r22,r21 /* Clear the reservation */ li r22,0 stw r22,RESULT(r21) - mtspr SPRN_SPRG2,r22 # r1 is now the kernel stack pointer - addi r24,r2,TASK_STRUCT_SIZE # Check for kernel stack overflow + mtspr SPRN_SPRG2,r22 /* r1 is now the kernel stack pointer */ + addi r24,r2,TASK_STRUCT_SIZE /* Check for kernel stack overflow */ cmplw cr0,r1,r2 cmplw cr1,r1,r24 crand cr1,cr1,cr4 - bgt- stack_ovf # If r2 < r1 < r2 + TASK_STRUCT_SIZE - lwz r24,0(r23) # Virtual address of the handler - lwz r23,4(r23) # Handler return pointer - cmpwi cr0,r7,STND_EXC # What type of exception is this? - bne 3f # It is a critical exception... - - ## Standard exception jump path - - mtspr SPRN_SRR0,r24 # Set up the instruction pointer - mtspr SPRN_SRR1,r20 # Set up the machine state register - mtlr r23 # Set up the return pointer + bgt- stack_ovf /* If r2 < r1 < r2 + TASK_STRUCT_SIZE */ + lwz r24,0(r23) /* Virtual address of the handler */ + lwz r23,4(r23) /* Handler return pointer */ + cmpwi cr0,r7,STND_EXC /* What type of exception is this? */ + bne 3f /* It is a critical exception... */ + + /* Standard exception jump path + */ + + /* We have to recover r7 from the register save stack. + * It was used to indicate standard/critical exception. In + * the case of a standard exception that is the system call + * trap, it may have originally contained one of the syscall + * parameters and we have to get it back now. + */ + lwz r7,GPR7(r21) + mtspr SPRN_SRR0,r24 /* Set up the instruction pointer */ + mtspr SPRN_SRR1,r20 /* Set up the machine state register */ + mtlr r23 /* Set up the return pointer */ SYNC - rfi # Enable the MMU, jump to the handler + /* We shouldn't need a 405 erratum #77 workaround here, because we're not + * actually returning to the interrupted instruction yet. */ + rfi + b . /* prevent prefetch past rfi */ - ## Critical exception jump path + /* Critical exception jump path + */ -3: mtspr SPRN_SRR2,r24 # Set up the instruction pointer - mtspr SPRN_SRR3,r20 # Set up the machine state register - mtlr r23 # Set up the return pointer +3: mtspr SPRN_SRR2,r24 /* Set up the instruction pointer */ + mtspr SPRN_SRR3,r20 /* Set up the machine state register */ + mtlr r23 /* Set up the return pointer */ SYNC - rfci # Enable the MMU, jump to the handler + rfci + b . /* prevent prefetch past rfci */ -### -### On kernel stack overlow, load up an initial stack pointer and call -### StackOverflow(regs), which should NOT return. -### +/* On kernel stack overlow, load up an initial stack pointer and call + * StackOverflow(regs), which should NOT return. + */ stack_ovf: addi r3,r1,STACK_FRAME_OVERHEAD @@ -432,143 +872,224 @@ lis r24,StackOverflow@ha addi r24,r24,StackOverflow@l li r20,MSR_KERNEL - mtspr SPRN_SRR0,r24 # Set up the instruction pointer - mtspr SPRN_SRR1,r20 # Set up the machine state register + mtspr SPRN_SRR0,r24 + mtspr SPRN_SRR1,r20 SYNC - rfi # Enable the MMU, jump to StackOverflow - -### -### extern void giveup_altivec(struct task_struct *prev) -### -### The PowerPC 4xx family of processors do not have AltiVec capabilities, so -### this just returns. -### + rfi + b . /* prevent prefetch past rfi */ +/* extern void giveup_altivec(struct task_struct *prev) + * + * The PowerPC 4xx family of processors do not have AltiVec capabilities, so + * this just returns. + */ _GLOBAL(giveup_altivec) blr - -### -### extern void giveup_fpu(struct task_struct *prev) -### -### The PowerPC 4xx family of processors do not have an FPU, so this just -### returns. -### +/* extern void giveup_fpu(struct task_struct *prev) + * + * The PowerPC 4xx family of processors do not have an FPU, so this just + * returns. + */ _GLOBAL(giveup_fpu) blr -### -### extern void abort(void) -### -### At present, this routine just applies a system reset. -### - +/* extern void abort(void) + * + * At present, this routine just applies a system reset. + */ _GLOBAL(abort) - mfspr r13,SPRN_DBCR - oris r13,r13,DBCR_RST(DBCR_RST_SYSTEM)@h - mtspr SPRN_DBCR,r13 - + mfspr r13,SPRN_DBCR0 + oris r13,r13,DBCR_RST(DBCR_RST_SYSTEM)@h + mtspr SPRN_DBCR0,r13 -### -### This is where the main kernel code starts. -### +/* This is where the main kernel code starts. + */ start_here: - ## Establish a pointer to the current task - + + /* ptr to current */ lis r2,init_task_union@h ori r2,r2,init_task_union@l - - ## Clear out the BSS as per ANSI C requirements - lis r7,_end@ha - addi r7,r7,_end@l - lis r8,__bss_start@ha - addi r8,r8,__bss_start@l - subf r7,r8,r7 - addi r7,r7,3 - srwi. r7,r7,2 - beq 2f - addi r8,r8,-4 - mtctr r7 - li r0,0 -3: stwu r0,4(r8) - bdnz 3b + /* ptr to phys current thread */ + tophys(r4,r2) + addi r4,r4,THREAD /* init task's THREAD */ + mtspr SPRG3,r4 + li r3,0 + mtspr SPRG2,r3 /* 0 => r1 has kernel sp */ - ## Stack - -2: addi r1,r2,TASK_UNION_SIZE + /* stack */ + addi r1,r2,TASK_UNION_SIZE li r0,0 stwu r0,-STACK_FRAME_OVERHEAD(r1) - ## Determine what type of platform this is. + bl early_init /* We have to do this with MMU on */ +/* + * Decide what sort of machine this is and initialize the MMU. + */ mr r3,r31 mr r4,r30 mr r5,r29 mr r6,r28 mr r7,r27 - bl identify_machine - - ## Initialize the memory management unit. - + bl machine_init bl MMU_init - ## Go back to running unmapped so that we can change to our - ## exception vectors. - +/* Go back to running unmapped so we can load up new values + * and change to using our exception vectors. + * On the 4xx, all we have to do is invalidate the TLB to clear + * the old 16M byte TLB mappings. + */ lis r4,2f@h ori r4,r4,2f@l tophys(r4,r4) li r3,MSR_KERNEL & ~(MSR_IR|MSR_DR) - mtspr SPRN_SRR0,r4 # Set up the instruction pointer - mtspr SPRN_SRR1,r3 # Set up the machine state register + mtspr SRR0,r4 + mtspr SRR1,r3 rfi + b . /* prevent prefetch past rfi */ - ## Load up the kernel context +/* Load up the kernel context */ +2: + SYNC /* Force all PTE updates to finish */ +#ifndef CONFIG_PIN_TLB + tlbia /* Clear all TLB entries */ + sync /* wait for tlbia/tlbie to finish */ +#endif -2: SYNC # Force all PTE updates to finish -# tlbia # Clear all TLB entries -# sync # Wait for tlbia to finish... + /* set up the PTE pointers for the Abatron bdiGDB. + */ + lis r6, swapper_pg_dir@h + ori r6, r6, swapper_pg_dir@l + lis r5, abatron_pteptrs@h + ori r5, r5, abatron_pteptrs@l + stw r5, 0xf0(r0) /* Must match your Abatron config file */ + tophys(r5,r5) + stw r6, 0(r5) + +/* Now turn on the MMU for real! */ + li r4,MSR_KERNEL + lis r3,start_kernel@h + ori r3,r3,start_kernel@l + mtspr SRR0,r3 + mtspr SRR1,r4 + rfi /* enable MMU and jump to start_kernel */ + b . /* prevent prefetch past rfi */ + +/* Set up the initial MMU state so we can do the first level of + * kernel initialization. This maps the first 16 MBytes of memory 1:1 + * virtual to physical and more importantly sets the cache mode. + */ +initial_mmu: + tlbia /* Invalidate all TLB entries */ + sync + + /* We should still be executing code at physical address 0x0000xxxx + * at this point. However, start_here is at virtual address + * 0xC000xxxx. So, set up a TLB mapping to cover this once + * translation is enabled. + */ - ## Set up for using our exception vectors - - tophys(r4,r2) # Pointer to physical current thread - addi r4,r4,THREAD # The init task thread - mtspr SPRN_SPRG3,r4 # Save it for exceptions later - li r3,0 # - mtspr SPRN_SPRG2,r3 # 0 implies r1 has kernel stack pointer + lis r3,KERNELBASE@h /* Load the kernel virtual address */ + ori r3,r3,KERNELBASE@l + tophys(r4,r3) /* Load the kernel physical address */ + + /* Load the kernel PID. + */ + li r0,0 + mtspr SPRN_PID,r0 + sync + + /* Configure and load two entries into TLB slots 62 and 63. + * In case we are pinning TLBs, these are reserved in by the + * other TLB functions. If not reserving, then it doesn't + * matter where they are loaded. + */ + clrrwi r4,r4,10 /* Mask off the real page number */ + ori r4,r4,(TLB_WR | TLB_EX) /* Set the write and execute bits */ + + clrrwi r3,r3,10 /* Mask off the effective page number */ + ori r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_16M)) + + li r0,62 /* TLB slot 62 */ + + tlbwe r4,r0,TLB_DATA /* Load the data portion of the entry */ + tlbwe r3,r0,TLB_TAG /* Load the tag portion of the entry */ + + addis r4, r4, 0x0100 /* Map next 16 M entries */ + addis r3, r3, 0x0100 + + li r0,63 /* TLB slot 63 */ + + tlbwe r4,r0,TLB_DATA + tlbwe r3,r0,TLB_TAG + +#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(SERIAL_DEBUG_IO_BASE) - ## Really turn on the MMU and jump into the kernel + /* Load a TLB entry for the UART, so that ppc4xx_progress() can use + * the UARTs nice and early. We use a 4k real==virtual mapping. */ + + lis r3,SERIAL_DEBUG_IO_BASE@h + ori r3,r3,SERIAL_DEBUG_IO_BASE@l + mr r4,r3 + clrrwi r4,r4,12 + ori r4,r4,(TLB_WR|TLB_I|TLB_M|TLB_G) + + clrrwi r3,r3,12 + ori r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_4K)) + + li r0,0 /* TLB slot 0 */ + tlbwe r4,r0,TLB_DATA + tlbwe r3,r0,TLB_TAG +#endif /* CONFIG_SERIAL_DEBUG_TEXT && SERIAL_DEBUG_IO_BASE */ + + isync + + /* Establish the exception vector base + */ + lis r4,KERNELBASE@h /* EVPR only uses the high 16-bits */ + tophys(r0,r4) /* Use the physical address */ + mtspr SPRN_EVPR,r0 + + blr - lis r4,MSR_KERNEL@h - ori r4,r4,MSR_KERNEL@l - lis r3,start_kernel@h - ori r3,r3,start_kernel@l - mtspr SPRN_SRR0,r3 # Set up the instruction pointer - mtspr SPRN_SRR1,r4 # Set up the machine state register - rfi # Enable the MMU, jump to the kernel _GLOBAL(set_context) + +#ifdef CONFIG_BDI_SWITCH + /* Context switch the PTE pointer for the Abatron BDI2000. + * The PGDIR is the second parameter. + */ + lis r5, KERNELBASE@h + lwz r5, 0xf0(r5) + stw r4, 0x4(r5) +#endif + sync mtspr SPRN_PID,r3 + isync /* Need an isync to flush shadow */ + /* TLBs after changing PID */ blr -### -### We put a few things here that have to be page-aligned. This stuff -### goes at the beginning of the data segment, which is page-aligned. -### - +/* We put a few things here that have to be page-aligned. This stuff + * goes at the beginning of the data segment, which is page-aligned. + */ .data _GLOBAL(sdata) _GLOBAL(empty_zero_page) .space 4096 _GLOBAL(swapper_pg_dir) - .space 4096 - -### -### This space gets a copy of optional info passed to us by the bootstrap -### which is used to pass parameters into the kernel like root=/dev/sda1, etc. -### + .space 4096 +/* This space gets a copy of optional info passed to us by the bootstrap + * which is used to pass parameters into the kernel like root=/dev/sda1, etc. + */ _GLOBAL(cmd_line) .space 512 + +/* Room for two PTE pointers, usually the kernel and current user pointers + * to their respective root page table. + */ +abatron_pteptrs: + .space 8 diff -uNr linux-2.4.19/arch/ppc/kernel/head_8xx.S linux-2.4.19bgl/arch/ppc/kernel/head_8xx.S --- linux-2.4.19/arch/ppc/kernel/head_8xx.S 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/head_8xx.S 2003-07-02 10:43:05.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.head_8xx.S 1.25 01/08/02 16:41:27 trini + * BK Id: SCCS/s.head_8xx.S 1.37 05/27/02 10:16:47 trini */ /* * arch/ppc/kernel/except_8xx.S @@ -21,17 +21,18 @@ * 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 "ppc_asm.h" +#include #include #include -#include #include #include #include #include +#include +#include "ppc_defs.h" .text .globl _stext @@ -78,7 +79,7 @@ * and the CCR at memory location 0.....Someday I'll fix this..... * -- Dan */ - + .globl __start __start: mr r31,r3 /* save parameters */ @@ -152,22 +153,22 @@ /* * Exception vectors. */ + +#define FINISH_EXCEPTION(func) \ + bl transfer_to_handler; \ + .long func; \ + .long ret_from_except + #define STD_EXCEPTION(n, label, hdlr) \ . = n; \ label: \ EXCEPTION_PROLOG; \ addi r3,r1,STACK_FRAME_OVERHEAD; \ li r20,MSR_KERNEL; \ - bl transfer_to_handler; \ - .long hdlr; \ - .long ret_from_except + FINISH_EXCEPTION(hdlr) /* System reset */ -#ifdef CONFIG_SMP /* MVME/MTX start the secondary here */ - STD_EXCEPTION(0x100, Reset, __secondary_start_psurge) -#else STD_EXCEPTION(0x100, Reset, UnknownException) -#endif /* Machine check */ STD_EXCEPTION(0x200, MachineCheck, MachineCheckException) @@ -187,9 +188,7 @@ addi r3,r1,STACK_FRAME_OVERHEAD li r20,MSR_KERNEL rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */ - bl transfer_to_handler - .long do_page_fault - .long ret_from_except + FINISH_EXCEPTION(do_page_fault) /* Instruction access exception. * This is "never generated" by the MPC8xx. We jump to it for other @@ -203,9 +202,7 @@ mr r5,r23 li r20,MSR_KERNEL rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */ - bl transfer_to_handler - .long do_page_fault - .long ret_from_except + FINISH_EXCEPTION(do_page_fault) /* External interrupt */ . = 0x500; @@ -215,11 +212,10 @@ li r20,MSR_KERNEL li r4,0 bl transfer_to_handler - .globl do_IRQ_intercept + .globl do_IRQ_intercept do_IRQ_intercept: .long do_IRQ; .long ret_from_intercept - /* Alignment exception */ . = 0x600 @@ -232,9 +228,7 @@ addi r3,r1,STACK_FRAME_OVERHEAD li r20,MSR_KERNEL rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */ - bl transfer_to_handler - .long AlignmentException - .long ret_from_except + FINISH_EXCEPTION(AlignmentException) /* Program check exception */ . = 0x700 @@ -243,9 +237,7 @@ addi r3,r1,STACK_FRAME_OVERHEAD li r20,MSR_KERNEL rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */ - bl transfer_to_handler - .long ProgramCheckException - .long ret_from_except + FINISH_EXCEPTION(ProgramCheckException) /* No FPU on MPC8xx. This exception is not supposed to happen. */ @@ -257,7 +249,7 @@ addi r3,r1,STACK_FRAME_OVERHEAD li r20,MSR_KERNEL bl transfer_to_handler - .globl timer_interrupt_intercept + .globl timer_interrupt_intercept timer_interrupt_intercept: .long timer_interrupt .long ret_from_intercept @@ -272,9 +264,7 @@ stw r3,ORIG_GPR3(r21) li r20,MSR_KERNEL rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */ - bl transfer_to_handler - .long DoSyscall - .long ret_from_except + FINISH_EXCEPTION(DoSyscall) /* Single step - not used on 601 */ STD_EXCEPTION(0xd00, SingleStep, SingleStepException) @@ -334,7 +324,7 @@ beq 2f /* If zero, don't try to find a pte */ /* We have a pte table, so load the MI_TWC with the attributes - * for this page, which has only bit 31 set. + * for this "segment." */ tophys(r21,r21) ori r21,r21,1 /* Set valid bit */ @@ -343,7 +333,7 @@ stw r3, 12(r0) lwz r3, 12(r0) #endif - mtspr MI_TWC, r21 /* Set page attributes */ + mtspr MI_TWC, r21 /* Set segment attributes */ #ifdef CONFIG_8xx_CPU6 li r3, 0x3b80 stw r3, 12(r0) @@ -362,8 +352,6 @@ * set. All other Linux PTE bits control the behavior * of the MMU. */ - li r21, 0x0600 - andc r20, r20, r21 /* Clear 21, 22 */ li r21, 0x00f0 rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */ @@ -456,8 +444,6 @@ * set. All other Linux PTE bits control the behavior * of the MMU. */ - li r21, 0x0600 - andc r20, r20, r21 /* Clear 21, 22 */ li r21, 0x00f0 rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */ @@ -592,8 +578,6 @@ * set. All other Linux PTE bits control the behavior * of the MMU. */ - li r21, 0x0600 - andc r20, r20, r21 /* Clear 21, 22 */ li r21, 0x00f0 rlwimi r20, r21, 0, 24, 28 /* Set 24-27, clear 28 */ @@ -776,14 +760,18 @@ sync /* wait for tlbia/tlbie to finish */ TLBSYNC /* ... on all CPUs */ - /* set up the PTE pointers for the Abatron bdiGDB. - */ +#ifdef CONFIG_BDI_SWITCH + /* Add helper information for the Abatron bdiGDB debugger. + * We do this here because we know the mmu is disabled, and + * will be enabled for real in just a few instructions. + */ tovirt(r6,r6) lis r5, abatron_pteptrs@h ori r5, r5, abatron_pteptrs@l stw r5, 0xf0(r0) /* Must match your Abatron config file */ tophys(r5,r5) stw r6, 0(r5) +#endif /* Now turn on the MMU for real! */ li r4,MSR_KERNEL @@ -797,16 +785,31 @@ * kernel initialization. This maps the first 8 MBytes of memory 1:1 * virtual to physical. Also, set the cache mode since that is defined * by TLB entries and perform any additional mapping (like of the IMMR). + * If configured to pin some TLBs, we pin the first 8 Mbytes of kernel, + * 24 Mbytes of data, and the 8M IMMR space. Anything not covered by + * these mappings is mapped by page tables. */ initial_mmu: tlbia /* Invalidate all TLB entries */ +#ifdef CONFIG_PIN_TLB + lis r8, MI_RSV4I@h + ori r8, r8, 0x1c00 +#else li r8, 0 - mtspr MI_CTR, r8 /* Set instruction control to zero */ - lis r8, MD_RESETVAL@h +#endif + mtspr MI_CTR, r8 /* Set instruction MMU control */ + +#ifdef CONFIG_PIN_TLB + lis r10, (MD_RSV4I | MD_RESETVAL)@h + ori r10, r10, 0x1c00 + mr r8, r10 +#else + lis r10, MD_RESETVAL@h +#endif #ifndef CONFIG_8xx_COPYBACK - oris r8, r8, MD_WTDEF@h + oris r10, r10, MD_WTDEF@h #endif - mtspr MD_CTR, r8 /* Set data TLB control */ + mtspr MD_CTR, r10 /* Set data TLB control */ /* Now map the lower 8 Meg into the TLBs. For this quick hack, * we can load the instruction and data TLB registers with the @@ -830,6 +833,10 @@ /* Map another 8 MByte at the IMMR to get the processor * internal registers (among other things). */ +#ifdef CONFIG_PIN_TLB + addi r10, r10, 0x0100 + mtspr MD_CTR, r10 +#endif mfspr r9, 638 /* Get current IMMR */ andis. r9, r9, 0xff80 /* Get 8Mbyte boundary */ @@ -843,6 +850,30 @@ ori r8, r8, MI_BOOTINIT|0x2 /* Inhibit cache -- Cort */ mtspr MD_RPN, r8 +#ifdef CONFIG_PIN_TLB + /* Map two more 8M kernel data pages. + */ + addi r10, r10, 0x0100 + mtspr MD_CTR, r10 + + lis r8, KERNELBASE@h /* Create vaddr for TLB */ + addis r8, r8, 0x0080 /* Add 8M */ + ori r8, r8, MI_EVALID /* Mark it valid */ + mtspr MD_EPN, r8 + li r9, MI_PS8MEG /* Set 8M byte page */ + ori r9, r9, MI_SVALID /* Make it valid */ + mtspr MD_TWC, r9 + li r11, MI_BOOTINIT /* Create RPN for address 0 */ + addis r11, r11, 0x0080 /* Add 8M */ + mtspr MD_RPN, r8 + + addis r8, r8, 0x0080 /* Add 8M */ + mtspr MD_EPN, r8 + mtspr MD_TWC, r9 + addis r11, r11, 0x0080 /* Add 8M */ + mtspr MD_RPN, r8 +#endif + /* Since the cache is enabled according to the information we * just loaded into the TLB, invalidate and enable the caches here. * We should probably check/set other modes....later. @@ -922,7 +953,7 @@ SYNC blr #endif - + /* * We put a few things here that have to be page-aligned. * This stuff goes at the beginning of the data segment, @@ -937,25 +968,26 @@ .globl swapper_pg_dir swapper_pg_dir: - .space 4096 + .space 4096 /* * This space gets a copy of optional info passed to us by the bootstrap * Used to pass parameters into the kernel like root=/dev/sda1, etc. - */ + */ .globl cmd_line cmd_line: .space 512 +#ifdef CONFIG_BDI_SWITCH /* Room for two PTE table poiners, usually the kernel and current user * pointer to their respective root page table (pgdir). */ abatron_pteptrs: .space 8 +#endif #ifdef CONFIG_8xx_CPU6 .globl cpu6_errata_word cpu6_errata_word: .space 16 #endif - diff -uNr linux-2.4.19/arch/ppc/kernel/i8259.c linux-2.4.19bgl/arch/ppc/kernel/i8259.c --- linux-2.4.19/arch/ppc/kernel/i8259.c 2002-02-25 13:37:55.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/kernel/i8259.c 2003-07-02 10:44:30.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.i8259.c 1.11 12/19/01 09:45:54 trini + * BK Id: SCCS/s.i8259.c 1.18 05/08/02 15:05:14 benh */ #include @@ -9,9 +9,9 @@ #include #include #include -#include "i8259.h" +#include -static volatile char *pci_intack; /* RO, gives us the irq vector */ +static volatile unsigned char *pci_intack; /* RO, gives us the irq vector */ unsigned char cached_8259[2] = { 0xff, 0xff }; #define cached_A1 (cached_8259[0]) @@ -24,13 +24,13 @@ /* Acknowledge the irq using the PCI host bridge's interrupt acknowledge * feature. (Polling is somehow broken on some IBM and Motorola PReP boxes.) */ -int i8259_irq(void) +int i8259_irq(struct pt_regs *regs) { int irq; spin_lock/*_irqsave*/(&i8259_lock/*, flags*/); - irq = *pci_intack & 0xff; + irq = *pci_intack; if (irq==7) { /* * This may be a spurious interrupt. @@ -48,7 +48,7 @@ } /* Poke the 8259's directly using poll commands. */ -int i8259_poll(void) +int i8259_poll(struct pt_regs *regs) { int irq; @@ -171,7 +171,7 @@ "8259 edge control", 0x4d0, 0x4d1, IORESOURCE_BUSY }; -void __init i8259_init(long intack_addr) +void __init i8259_init(unsigned long intack_addr) { unsigned long flags; @@ -201,10 +201,11 @@ /* reserve our resources */ request_irq( i8259_pic_irq_offset + 2, no_action, SA_INTERRUPT, "82c59 secondary cascade", NULL ); +#if 0 /* Do not request these before the host bridge resource have been setup */ request_resource(&ioport_resource, &pic1_iores); request_resource(&ioport_resource, &pic2_iores); request_resource(&ioport_resource, &pic_edgectrl_iores); - +#endif if (intack_addr) pci_intack = ioremap(intack_addr, 1); } diff -uNr linux-2.4.19/arch/ppc/kernel/idle.c linux-2.4.19bgl/arch/ppc/kernel/idle.c --- linux-2.4.19/arch/ppc/kernel/idle.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/idle.c 2003-07-02 10:43:30.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.idle.c 1.20 03/19/02 15:04:39 benh + * BK Id: SCCS/s.idle.c 1.32 07/28/02 22:00:01 mporter */ /* * Idle daemon for PowerPC. Idle daemon will handle any action @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -32,6 +33,20 @@ #include #include #include +#ifdef CONFIG_PPC_ISERIES +#include +#include +#include +#include + +static void yield_shared_processor(void); +static void run_light_on(int on); + +extern unsigned long yield_count; + +#else /* CONFIG_PPC_ISERIES */ +#define run_light_on(x) do { } while (0) +#endif /* CONFIG_PPC_ISERIES */ void zero_paged(void); void power_save(void); @@ -59,6 +74,14 @@ current->counter = -100; init_idle(); for (;;) { +#ifdef CONFIG_PPC_ISERIES + if (!current->need_resched) { + /* Turn off the run light */ + run_light_on(0); + yield_shared_processor(); + } + HMT_low(); +#endif #ifdef CONFIG_SMP if (!do_power_save) { /* @@ -77,9 +100,17 @@ power_save(); if (current->need_resched) { + run_light_on(1); schedule(); check_pgt_cache(); } +#ifdef CONFIG_PPC_ISERIES + else { + run_light_on(0); + yield_shared_processor(); + HMT_low(); + } +#endif /* CONFIG_PPC_ISERIES */ } return 0; } @@ -110,6 +141,7 @@ register unsigned long tmp; asm ( "101:lwarx %1,0,%3\n" /* reserve zero_cache */ " lwz %0,0(%1)\n" /* get next -- new zero_cache */ + PPC405_ERR77(0,%3) " stwcx. %0,0,%3\n" /* update zero_cache */ " bne- 101b\n" /* if lost reservation try again */ : "=&r" (tmp), "=&r" (page), "+m" (zero_cache) @@ -209,6 +241,7 @@ #ifdef CONFIG_SMP " sync\n" /* let store settle */ #endif + PPC405_ERR77(0,%2) " stwcx. %3,0,%2\n" /* update zero_cache in mem */ " bne- 101b\n" /* if lost reservation try again */ : "=&r" (tmp), "+m" (zero_quicklist) @@ -256,6 +289,7 @@ _nmask_and_or_msr(MSR_EE, 0); if (!current->need_resched) { +#ifndef CONFIG_4xx __asm__ __volatile__("mfspr %0,1008" : "=r" (hid0) :); hid0 &= ~(HID0_NAP | HID0_SLEEP | HID0_DOZE); hid0 |= (powersave_nap? HID0_NAP: HID0_DOZE) | HID0_DPM; @@ -264,7 +298,7 @@ * exist on all altivec capable CPUs */ __asm__ __volatile__( - "98: " stringify(DSSALL) "\n" + "98: " __stringify(DSSALL) "\n" " sync\n" "99:\n" ".section __ftr_fixup,\"a\"\n" @@ -273,6 +307,7 @@ " .long 98b\n" " .long 99b\n" ".previous" : : "i" (CPU_FTR_ALTIVEC), "i" (CPU_FTR_ALTIVEC)); +#endif /* !CONFIG_4xx */ /* set the POW bit in the MSR, and enable interrupts * so we wake up sometime! */ @@ -281,3 +316,64 @@ _nmask_and_or_msr(0, MSR_EE); } +#ifdef CONFIG_PPC_ISERIES + +extern void fake_interrupt(void); +extern u64 get_tb64(void); + +void run_light_on(int on) +{ + unsigned long CTRL; + + CTRL = mfspr(CTRLF); + CTRL = on? (CTRL | RUNLATCH): (CTRL & ~RUNLATCH); + mtspr(CTRLT, CTRL); +} + +void yield_shared_processor(void) +{ + struct Paca *paca; + u64 tb; + + /* Poll for I/O events */ + __cli(); + __sti(); + + paca = (struct Paca *)mfspr(SPRG1); + if ( paca->xLpPaca.xSharedProc ) { + HvCall_setEnabledInterrupts( HvCall_MaskIPI | + HvCall_MaskLpEvent | + HvCall_MaskLpProd | + HvCall_MaskTimeout ); + + /* + * Check here for any of the above pending... + * IPI and Decrementers are indicated in ItLpPaca + * LpEvents are indicated on the LpQueue + * + * Disabling/enabling will check for LpEvents, IPIs + * and decrementers + */ + __cli(); + __sti(); + + ++yield_count; + + /* Get current tb value */ + tb = get_tb64(); + /* Compute future tb value when yield will expire */ + tb += tb_ticks_per_jiffy; + HvCall_yieldProcessor( HvCall_YieldTimed, tb ); + + /* Check here for any of the above pending or timeout expired*/ + __cli(); + /* + * The decrementer stops during the yield. Just force + * a fake decrementer now and the timer_interrupt + * code will straighten it all out + */ + paca->xLpPaca.xDecrInt = 1; + __sti(); + } +} +#endif /* CONFIG_PPC_ISERIES */ diff -uNr linux-2.4.19/arch/ppc/kernel/indirect_pci.c linux-2.4.19bgl/arch/ppc/kernel/indirect_pci.c --- linux-2.4.19/arch/ppc/kernel/indirect_pci.c 2001-09-08 14:38:41.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/indirect_pci.c 2003-07-02 10:43:12.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.indirect_pci.c 1.10 09/08/01 15:47:42 paulus + * BK Id: SCCS/s.indirect_pci.c 1.15 05/30/02 15:50:31 mporter */ /* * Support for indirect PCI bridges. @@ -24,8 +24,6 @@ #include #include -#include "pci.h" - #define cfg_read(val, addr, type, op) *val = op((type)(addr)) #define cfg_write(val, addr, type, op) op((type *)(addr), (val)) @@ -34,10 +32,19 @@ indirect_##rw##_config_##size(struct pci_dev *dev, int offset, type val) \ { \ struct pci_controller *hose = dev->sysdata; \ + u8 cfg_type = 0; \ + \ + if (ppc_md.pci_exclude_device) \ + if (ppc_md.pci_exclude_device(dev->bus->number, dev->devfn)) \ + return PCIBIOS_DEVICE_NOT_FOUND; \ + \ + if (ppc_md.set_cfg_type) \ + if (dev->bus->number != hose->first_busno) \ + cfg_type = 1; \ \ out_be32(hose->cfg_addr, \ - ((offset & 0xfc) << 24) | (dev->devfn << 16) \ - | (dev->bus->number << 8) | 0x80); \ + (((offset & 0xfc) | cfg_type) << 24) | (dev->devfn << 16) \ + | ((dev->bus->number - hose->bus_offset) << 8) | 0x80); \ cfg_##rw(val, hose->cfg_data + (offset & mask), type, op); \ return PCIBIOS_SUCCESSFUL; \ } diff -uNr linux-2.4.19/arch/ppc/kernel/irq.c linux-2.4.19bgl/arch/ppc/kernel/irq.c --- linux-2.4.19/arch/ppc/kernel/irq.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/irq.c 2003-07-02 10:43:47.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: %F% %I% %G% %U% %#% + * BK Id: SCCS/s.irq.c 1.53 06/04/02 20:53:12 paulus */ /* * arch/ppc/kernel/irq.c @@ -50,20 +50,15 @@ #include #include -#include #include #include #include #include -#include #include #include -#include -#include -#include #include -#include "local_irq.h" +#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) extern atomic_t ipi_recv; extern atomic_t ipi_sent; @@ -189,9 +184,6 @@ * now, this is what I need. -- Dan */ #define request_irq request_8xxirq -#elif defined(CONFIG_APUS) -#define request_irq request_sysirq -#define free_irq sys_free_irq #endif void free_irq(unsigned int irq, void* dev_id) @@ -373,9 +365,6 @@ int get_irq_list(char *buf) { -#ifdef CONFIG_APUS - return apus_get_irq_list (buf); -#else int i, len = 0, j; struct irqaction * action; @@ -423,7 +412,6 @@ #endif len += sprintf(buf+len, "BAD: %10u\n", ppc_spurious_interrupts); return len; -#endif /* CONFIG_APUS */ } static inline void @@ -534,39 +522,35 @@ spin_unlock(&desc->lock); } +#ifndef CONFIG_PPC_ISERIES /* iSeries version is in iSeries_pic.c */ int do_IRQ(struct pt_regs *regs) { int cpu = smp_processor_id(); 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 and 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)) do_softirq(); return 1; /* lets ret_from_int know we can do checks */ } +#endif /* CONFIG_PPC_ISERIES */ unsigned long probe_irq_on (void) { @@ -598,7 +582,6 @@ #ifdef CONFIG_SMP unsigned char global_irq_holder = NO_PROC_ID; unsigned volatile long global_irq_lock; /* pendantic :long for set_bit--RR*/ -atomic_t global_irq_count; atomic_t global_bh_count; @@ -609,8 +592,7 @@ int cpu = smp_processor_id(); printk("\n%s, CPU %d:\n", str, cpu); - printk("irq: %d [%d %d]\n", - atomic_read(&global_irq_count), + printk("irq: [%d %d]\n", local_irq_count(0), local_irq_count(1)); printk("bh: %d [%d %d]\n", @@ -650,11 +632,9 @@ * for bottom half handlers unless we're * already executing in one.. */ - if (!atomic_read(&global_irq_count)) { - if (local_bh_count(cpu) - || !atomic_read(&global_bh_count)) - break; - } + if (!irqs_running()) + if (local_bh_count(cpu) || !spin_is_locked(&global_bh_lock)) + break; /* Duh, we have to loop. Release the lock to avoid deadlocks */ clear_bit(0,&global_irq_lock); @@ -665,16 +645,19 @@ count = ~0; } __sti(); - /* don't worry about the lock race Linus found - * on intel here. -- Cort + /* + * We have to allow irqs to arrive between __sti and __cli + * Some cpus apparently won't cause the interrupt + * for several instructions. We hope that isync will + * catch this --Troy */ + __asm__ __volatile__ ("isync"); __cli(); - if (atomic_read(&global_irq_count)) + if (irqs_running()) continue; if (global_irq_lock) continue; - if (!local_bh_count(cpu) - && atomic_read(&global_bh_count)) + if (!local_bh_count(cpu) && spin_is_locked(&global_bh_lock)) continue; if (!test_and_set_bit(0,&global_irq_lock)) break; @@ -705,7 +688,7 @@ */ void synchronize_irq(void) { - if (atomic_read(&global_irq_count)) { + if (irqs_running()) { /* Stupid approach */ cli(); sti(); diff -uNr linux-2.4.19/arch/ppc/kernel/l2cr.S linux-2.4.19bgl/arch/ppc/kernel/l2cr.S --- linux-2.4.19/arch/ppc/kernel/l2cr.S 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/l2cr.S 2003-07-02 10:44:12.000000000 -0500 @@ -42,7 +42,7 @@ */ #include #include -#include "ppc_asm.h" +#include /* Usage: diff -uNr linux-2.4.19/arch/ppc/kernel/m8260_setup.c linux-2.4.19bgl/arch/ppc/kernel/m8260_setup.c --- linux-2.4.19/arch/ppc/kernel/m8260_setup.c 2001-11-16 12:10:08.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/kernel/m8260_setup.c 2003-07-02 10:44:04.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.m8260_setup.c 1.30 11/13/01 21:26:07 paulus + * BK Id: SCCS/s.m8260_setup.c 1.37 11/18/01 16:44:44 paulus */ /* * linux/arch/ppc/kernel/setup.c @@ -45,8 +45,9 @@ #include #include #include - +#include #include + #include "ppc8260_pic.h" static int m8260_set_rtc_time(unsigned long time); @@ -98,17 +99,25 @@ static static int m8260_set_rtc_time(unsigned long time) { +#ifdef CONFIG_TQM8260 + ((immap_t *)IMAP_ADDR)->im_sit.sit_tmcnt = time; + ((immap_t *)IMAP_ADDR)->im_sit.sit_tmcntsc = 0x3; +#else rtc_time = time; +#endif return(0); } static unsigned long m8260_get_rtc_time(void) { - +#ifdef CONFIG_TQM8260 + return ((immap_t *)IMAP_ADDR)->im_sit.sit_tmcnt; +#else /* Get time from the RTC. */ return((unsigned long)rtc_time); +#endif } static void @@ -121,8 +130,11 @@ * of the reset vector. If that doesn't work for you, change this * or the reboot program to send a proper address. */ +#ifdef CONFIG_TQM8260 + startaddr = 0x40000104; +#else startaddr = 0xff000104; - +#endif if (cmd != NULL) { if (!strncmp(cmd, "startaddr=", 10)) startaddr = simple_strtoul(&cmd[10], NULL, 0); @@ -150,14 +162,13 @@ bd_t *bp; bp = (bd_t *)__res; - + seq_printf(m, "core clock\t: %d MHz\n" "CPM clock\t: %d MHz\n" "bus clock\t: %d MHz\n", bp->bi_intfreq / 1000000, bp->bi_cpmfreq / 1000000, bp->bi_busfreq / 1000000); - return 0; } @@ -178,7 +189,7 @@ #endif for ( i = 0 ; i < NR_SIU_INTS ; i++ ) irq_desc[i].handler = &ppc8260_pic; - + /* Initialize the default interrupt mapping priorities, * in case the boot rom changed something on us. */ @@ -197,7 +208,7 @@ { bd_t *binfo; extern unsigned char __res[]; - + binfo = (bd_t *)__res; return binfo->bi_memsize; @@ -219,22 +230,20 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { + parse_bootinfo(find_bootinfo()); if ( r3 ) memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) ); - + #ifdef CONFIG_BLK_DEV_INITRD /* take care of initrd if we have one */ - if ( r4 ) - { + if ( r4 ) { initrd_start = r4 + KERNELBASE; initrd_end = r5 + KERNELBASE; } #endif /* CONFIG_BLK_DEV_INITRD */ /* take care of cmd line */ - if ( r6 ) - { - + if ( r6 ) { *(char *)(r7+KERNELBASE) = 0; strcpy(cmd_line, (char *)(r6+KERNELBASE)); } diff -uNr linux-2.4.19/arch/ppc/kernel/m8xx_setup.c linux-2.4.19bgl/arch/ppc/kernel/m8xx_setup.c --- linux-2.4.19/arch/ppc/kernel/m8xx_setup.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/m8xx_setup.c 2003-07-02 10:44:16.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.m8xx_setup.c 1.40 11/13/01 21:26:07 paulus + * BK Id: SCCS/s.m8xx_setup.c 1.49 04/05/02 11:39:36 trini * * linux/arch/ppc/kernel/setup.c * @@ -43,8 +43,9 @@ #include #include #include - +#include #include + #include "ppc8xx_pic.h" static int m8xx_set_rtc_time(unsigned long time); @@ -57,25 +58,30 @@ extern unsigned long find_available_memory(void); extern void m8xx_cpm_reset(uint); +extern void rpxfb_alloc_pages(void); void __init 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); +#ifdef CONFIG_FB_RPX + rpxfb_alloc_pages(); +#endif + #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; @@ -105,6 +111,9 @@ xmon(0); #endif machine_restart(NULL); + + /* not reached */ + for (;;); } /* A place holder for time base interrupts, if they are ever enabled. */ @@ -217,7 +226,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); } @@ -240,9 +249,9 @@ bd_t *bp; bp = (bd_t *)__res; - - seq_printf(m, "clock\t\t: %ldMHz\n" - "bus clock\t: %ldMHz\n", + + seq_printf(m, "clock\t\t: %dMHz\n" + "bus clock\t: %dMHz\n", bp->bi_intfreq / 1000000, bp->bi_busfreq / 1000000); @@ -263,7 +272,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. */ @@ -296,7 +305,7 @@ { bd_t *binfo; extern unsigned char __res[]; - + binfo = (bd_t *)__res; return binfo->bi_memsize; @@ -343,9 +352,11 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { + parse_bootinfo(find_bootinfo()); + if ( r3 ) memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) ); - + #ifdef CONFIG_PCI m8xx_setup_pci_ptrs(); #endif @@ -360,7 +371,7 @@ #endif /* CONFIG_BLK_DEV_INITRD */ /* take care of cmd line */ if ( r6 ) - { + { *(char *)(r7+KERNELBASE) = 0; strcpy(cmd_line, (char *)(r6+KERNELBASE)); } @@ -394,5 +405,5 @@ #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) m8xx_ide_init(); -#endif +#endif } diff -uNr linux-2.4.19/arch/ppc/kernel/misc.S linux-2.4.19bgl/arch/ppc/kernel/misc.S --- linux-2.4.19/arch/ppc/kernel/misc.S 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/misc.S 2003-07-02 10:43:47.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.misc.S 1.44 06/25/02 17:24:30 benh + * BK Id: SCCS/s.misc.S 1.73 07/16/02 21:19:50 trini */ /* * This file contains miscellaneous low-level functions. @@ -23,7 +23,9 @@ #include #include #include -#include "ppc_asm.h" +#include +#include +#include "ppc_defs.h" .text @@ -136,6 +138,7 @@ * r3 = data offset (not changed) */ _GLOBAL(do_cpu_ftr_fixups) +#ifndef CONFIG_PPC_ISERIES /* Get CPU 0 features */ addis r6,r3,cur_cpu_spec@ha addi r6,r6,cur_cpu_spec@l @@ -179,6 +182,9 @@ sync /* additional sync needed on g4 */ isync b 1b +#else /* CONFIG_PPC_ISERIES */ + blr +#endif /* CONFIG_PPC_ISERIES */ /* * call_setup_cpu - call the setup_cpu function for this cpu @@ -199,6 +205,7 @@ mr r3,r24 bctr +#ifndef CONFIG_PPC_ISERIES /* iSeries version is in iSeries_misc.S */ /* void __save_flags_ptr(unsigned long *flags) */ _GLOBAL(__save_flags_ptr) mfmsr r4 @@ -326,7 +333,7 @@ nop nop _GLOBAL(__sti_end) - +#endif /* CONFIG_PPC_ISERIES */ /* * complement mask on the msr then "or" some values on. @@ -347,6 +354,29 @@ * Flush MMU TLB */ _GLOBAL(_tlbia) +#if defined(CONFIG_40x) && defined(CONFIG_PIN_TLB) + /* This needs to be coordinated with other pinning functions since + * we don't keep a memory location of number of entries to reduce + * cache pollution during these operations. + */ + lis r3, 0 + sync +1: + tlbwe r3, r3, TLB_TAG /* just ensure V is clear */ + addi r3, r3, 1 /* so r3 works fine for that */ + cmpwi 0, r3, 61 /* reserve last two entries */ + ble 1b + isync +#elif defined(CONFIG_440) + lis r3,0 + sync +1: + tlbwe r3,r3,PPC440_TLB_PAGEID + addi r3,r3,1 + cmpwi 0,r3,61 + ble 1b + isync +#else #if defined(CONFIG_SMP) mfmsr r10 SYNC @@ -360,6 +390,7 @@ 10: lwarx r7,0,r9 cmpi 0,r7,0 bne- 10b + /* No 405 Erratum 77 fix needed here, because 4xx can't do SMP */ stwcx. r8,0,r9 bne- 10b #endif /* CONFIG_SMP */ @@ -373,12 +404,48 @@ mtmsr r10 SYNC #endif /* CONFIG_SMP */ +#endif /* defined(CONFIG_40x) && defined(CONFIG_PIN_TLB) */ blr /* * Flush MMU TLB for a particular address */ _GLOBAL(_tlbie) +#ifdef CONFIG_40x + tlbsx. r3, 0, r3 + bne 10f + sync + /* There are only 64 TLB entries, so r3 < 64, which means bit 25, is clear. + * Since 25 is the V bit in the TLB_TAG, loading this value will invalidate + * the TLB entry. */ + tlbwe r3, r3, TLB_TAG + isync +10: +#elif defined(CONFIG_440) + mfspr r4,SPRN_MMUCR /* Get MMUCR */ + lis r5,PPC440_MMUCR_STS@h + ori r5,r5,PPC440_MMUCR_TID@l /* Create mask */ + andc r4,r4,r5 /* Clear out TID/STS bits */ + mfspr r5,SPRN_PID /* Get PID */ + or r4,r4,r5 /* Set TID bits */ + mfmsr r6 /* Get MSR */ + andi. r6,r6,MSR_IS@l /* TS=1? */ + beq 11f /* If not, leave STS=0 */ + oris r4,r4,PPC440_MMUCR_STS@h /* Set STS=1 */ +11: mtspr SPRN_MMUCR, r4 /* Put MMUCR */ + + tlbsx. r3, 0, r3 + bne 10f + sync + /* There are only 64 TLB entries, so r3 < 64, + * which means bit 22, is clear. Since 22 is + * the V bit in the TLB_PAGEID, loading this + * value will invalidate the TLB entry. + */ + tlbwe r3, r3, PPC440_TLB_PAGEID + isync +10: +#else #if defined(CONFIG_SMP) mfmsr r10 SYNC @@ -392,6 +459,7 @@ 10: lwarx r7,0,r9 cmpi 0,r7,0 bne- 10b + PPC405_ERR77(0,r9) stwcx. r8,0,r9 bne- 10b #endif /* CONFIG_SMP */ @@ -405,6 +473,7 @@ mtmsr r10 SYNC #endif +#endif /* CONFIG_40x */ blr /* @@ -416,9 +485,18 @@ isync lis r5, IDC_INVALL@h mtspr IC_CST, r5 -#elif defined(CONFIG_4xx) +#elif CONFIG_4xx +#ifdef CONFIG_403GCX + li r3, 512 + mtctr r3 + lis r4, KERNELBASE@h +1: iccci 0, r4 + addi r4, r4, 16 + bdnz 1b +#else lis r3, KERNELBASE@h iccci 0,r3 +#endif #else mfspr r3,PVR rlwinm r3,r3,16,16,31 @@ -428,10 +506,11 @@ mfspr r3,HID0 ori r3,r3,HID0_ICFI mtspr HID0,r3 -#endif /* CONFIG_8xx */ +#endif /* CONFIG_8xx/4xx */ isync blr +#ifndef CONFIG_PPC_ISERIES /* iSeries version is in iSeries_misc.S */ /* * Write any modified data cache blocks out to memory * and invalidate the corresponding instruction cache blocks. @@ -528,6 +607,34 @@ sync /* wait for dcbi's to get to ram */ blr +#ifdef CONFIG_NOT_COHERENT_CACHE +/* This is a bad one....It is used by 'consistent_sync' functions when + * there isn't any handle on the virtual address needed by the usual + * cache flush instructions. On the MPC8xx, we can use the cache line + * flush command, on others all we can do is read enough data to completely + * reload the cache, flushing old data out. + */ + +/* + * 40x cores have 8K or 16K dcache and 32 byte line size. + * 440 has a 32K dcache and 32 byte line size. + * 8xx has 1, 2, 4, 8K variants. + * For now, cover the worst case of the 440. + * When we get a cputable cache size entry we can do the right thing. + */ +#define CACHE_NWAYS 64 +#define CACHE_NLINES 16 + +_GLOBAL(flush_dcache_all) + li r4, (CACHE_NWAYS * CACHE_NLINES) + mtctr r4 + lis r5, KERNELBASE@h +1: lwz r3, 0(r5) /* Load one word from every line */ + addi r5, r5, L1_CACHE_LINE_SIZE + bdnz 1b + blr +#endif /* CONFIG_NOT_COHERENT_CACHE */ + /* * Flush a particular page from the data cache to RAM. * Note: this is necessary because the instruction cache does *not* @@ -600,8 +707,8 @@ li r5,4 #ifndef CONFIG_8xx -#if MAX_L1_COPY_PREFETCH > 1 - li r0,MAX_L1_COPY_PREFETCH +#if MAX_COPY_PREFETCH > 1 + li r0,MAX_COPY_PREFETCH li r11,4 mtctr r0 11: dcbt r11,r4 @@ -636,6 +743,7 @@ #endif bdnz 1b blr +#endif /* CONFIG_PPC_ISERIES */ /* * Atomic [test&set] exchange @@ -647,6 +755,7 @@ _GLOBAL(xchg_u32) mr r5,r3 /* Save pointer */ 10: lwarx r3,0,r5 /* Fetch old value & reserve */ + PPC405_ERR77(0,r5) stwcx. r4,0,r5 /* Update with new value */ bne- 10b /* Retry if "reservation" (i.e. lock) lost */ blr @@ -658,12 +767,14 @@ _GLOBAL(atomic_clear_mask) 10: lwarx r5,0,r4 andc r5,r5,r3 + PPC405_ERR77(0,r4) stwcx. r5,0,r4 bne- 10b blr _GLOBAL(atomic_set_mask) 10: lwarx r5,0,r4 or r5,r5,r3 + PPC405_ERR77(0,r4) stwcx. r5,0,r4 bne- 10b blr @@ -862,7 +973,7 @@ * and exceptions as if the cpu had performed the load or store. */ -#if defined(CONFIG_4xx) +#ifdef CONFIG_4xx _GLOBAL(cvt_fd) lfs 0,0(r3) stfd 0,0(r4) diff -uNr linux-2.4.19/arch/ppc/kernel/mk_defs.c linux-2.4.19bgl/arch/ppc/kernel/mk_defs.c --- linux-2.4.19/arch/ppc/kernel/mk_defs.c 2001-08-28 08:58:33.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/mk_defs.c 2003-07-02 10:43:11.000000000 -0500 @@ -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.23 04/05/02 11:21:28 mporter */ /* * This program is used to generate definitions needed by @@ -28,6 +28,13 @@ #include #include +#ifdef CONFIG_PPC_ISERIES +#include +#include +#include +#include +#endif /* CONFIG_PPC_ISERIES */ + #define DEFINE(sym, val) \ asm volatile("\n#define\t" #sym "\t%0" : : "i" (val)) @@ -52,6 +59,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 @@ -114,6 +122,10 @@ */ DEFINE(_DEAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar)); DEFINE(_ESR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr)); +#ifdef CONFIG_4xx + DEFINE(_DBCR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dbcr0)); + DEFINE(_DBCR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dbcr1)); +#endif DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3)); DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result)); DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); @@ -127,6 +139,35 @@ DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); +#ifdef CONFIG_PPC_ISERIES + DEFINE(PACAPROCENABLED, offsetof(struct Paca, xProcEnabled)); + DEFINE(PACAPACAINDEX, offsetof(struct Paca, xPacaIndex)); + DEFINE(PACAPROCSTART, offsetof(struct Paca, xProcStart)); + DEFINE(PACAKSAVE, offsetof(struct Paca, xKsave)); + DEFINE(PACASAVEDMSR, offsetof(struct Paca, xSavedMsr)); + DEFINE(PACASAVEDLR, offsetof(struct Paca, xSavedLr)); + DEFINE(PACACONTEXTOVERFLOW, offsetof(struct Paca, xContextOverflow)); + DEFINE(PACAR21, offsetof(struct Paca, xR21)); + DEFINE(PACAR22, offsetof(struct Paca, xR22)); + DEFINE(PACALPQUEUE, offsetof(struct Paca, lpQueuePtr)); + DEFINE(PACALPPACA, offsetof(struct Paca, xLpPaca)); + DEFINE(PACA_STRUCT_SIZE, sizeof(struct Paca)); + DEFINE(LPREGSAV, offsetof(struct Paca, xRegSav)); + DEFINE(PACADEFAULTDECR, offsetof(struct Paca, default_decr)); + DEFINE(LPPACAANYINT, offsetof(struct ItLpPaca, xRsvd)); + DEFINE(LPPACASRR0, offsetof(struct ItLpPaca, xSavedSrr0)); + DEFINE(LPPACASRR1, offsetof(struct ItLpPaca, xSavedSrr1)); + DEFINE(LPPACADECRINT, offsetof(struct ItLpPaca, xDecrInt)); + DEFINE(LPPACAIPIINT, offsetof(struct ItLpPaca, xIpiCnt)); + DEFINE(LPQCUREVENTPTR, offsetof(struct ItLpQueue, xSlicCurEventPtr)); + DEFINE(LPQOVERFLOW, offsetof(struct ItLpQueue, xPlicOverflowIntPending)); + DEFINE(LPQINUSEWORD, offsetof(struct ItLpQueue, xInUseWord)); + DEFINE(LPEVENTFLAGS, offsetof(struct HvLpEvent, xFlags)); + DEFINE(CONTEXT, offsetof(struct mm_struct, context)); + DEFINE(_SOFTE, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, mq)); + DEFINE(PACA_EXT_INTS, offsetof(struct Paca, ext_ints)); +#endif /* CONFIG_PPC_ISERIES */ + DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); return 0; } diff -uNr linux-2.4.19/arch/ppc/kernel/open_pic.c linux-2.4.19bgl/arch/ppc/kernel/open_pic.c --- linux-2.4.19/arch/ppc/kernel/open_pic.c 2002-02-25 13:37:55.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/kernel/open_pic.c 2003-07-02 10:44:38.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.open_pic.c 1.33 12/19/01 09:45:54 trini + * BK Id: SCCS/s.open_pic.c 1.57 06/01/02 16:36:14 paulus */ /* * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling @@ -17,36 +17,37 @@ #include #include #include -#include #include #include #include #include #include #include +#include +#include -#include "local_irq.h" -#include "open_pic.h" #include "open_pic_defs.h" -#include "i8259.h" + +#ifdef CONFIG_PRPMC800 +#define OPENPIC_BIG_ENDIAN +#endif void* OpenPIC_Addr; static volatile struct OpenPIC *OpenPIC = NULL; +/* + * We define OpenPIC_InitSenses table thusly: + * bit 0x1: sense, 0 for edge and 1 for level. + * bit 0x2: polarity, 0 for negative, 1 for positive. + */ u_int OpenPIC_NumInitSenses __initdata = 0; u_char *OpenPIC_InitSenses __initdata = NULL; extern int use_of_interrupt_tree; -void find_ISUs(void); - static u_int NumProcessors; static u_int NumSources; -#ifdef CONFIG_POWER3 -static int NumISUs; -#endif static int open_pic_irq_offset; -static volatile unsigned char* chrp_int_ack_special; - -OpenPIC_SourcePtr ISU[OPENPIC_MAX_ISU]; +static volatile unsigned char *chrp_int_ack_special; +static volatile OpenPIC_Source *ISR[NR_IRQS]; /* Global Operations */ static void openpic_disable_8259_pass_through(void); @@ -68,13 +69,12 @@ static void openpic_disable_irq(u_int irq); static void openpic_initirq(u_int irq, u_int pri, u_int vector, int polarity, int is_level); -static void openpic_mapirq(u_int irq, u_int cpumask); +static void openpic_mapirq(u_int irq, u_int cpumask, u_int keepmask); /* * These functions are not used but the code is kept here * for completeness and future reference. */ -static void openpic_reset(void); #ifdef notused static void openpic_enable_8259_pass_through(void); static u_int openpic_get_priority(void); @@ -151,7 +151,8 @@ */ extern unsigned long* _get_SP(void); #define check_arg_irq(irq) \ - if (irq < open_pic_irq_offset || irq >= (NumSources+open_pic_irq_offset)){ \ + if (irq < open_pic_irq_offset || irq >= NumSources+open_pic_irq_offset \ + || ISR[irq - open_pic_irq_offset] == 0) { \ printk("open_pic.c:%d: illegal irq %d\n", __LINE__, irq); \ print_backtrace(_get_SP()); } #define check_arg_cpu(cpu) \ @@ -167,23 +168,25 @@ #define check_arg_cpu(cpu) do {} while (0) #endif -#ifdef CONFIG_POWER3 - #define GET_ISU(source) ISU[(source) >> 4][(source) & 0xf] -#else - #define GET_ISU(source) ISU[0][(source)] -#endif - u_int openpic_read(volatile u_int *addr) { u_int val; +#ifdef OPENPIC_BIG_ENDIAN + val = in_be32(addr); +#else val = in_le32(addr); +#endif return val; } static inline void openpic_write(volatile u_int *addr, u_int val) { +#ifdef OPENPIC_BIG_ENDIAN + out_be32(addr, val); +#else out_le32(addr, val); +#endif } static inline u_int openpic_readfield(volatile u_int *addr, u_int mask) @@ -222,7 +225,7 @@ u_int openpic_read_IPI(volatile u_int* addr) { u_int val = 0; -#ifdef CONFIG_POWER3 +#if defined(OPENPIC_BIG_ENDIAN) || defined(CONFIG_POWER3) val = in_be32(addr); #else val = in_le32(addr); @@ -261,7 +264,46 @@ } #endif /* CONFIG_SMP */ -void __init openpic_init(int main_pic, int offset, unsigned char* chrp_ack, +#ifdef CONFIG_EPIC_SERIAL_MODE +static void __init openpic_eicr_set_clk(u_int clkval) +{ + openpic_writefield(&OpenPIC->Global.Global_Configuration1, + OPENPIC_EICR_S_CLK_MASK, (clkval << 28)); +} + +static void __init openpic_enable_sie(void) +{ + openpic_setfield(&OpenPIC->Global.Global_Configuration1, + OPENPIC_EICR_SIE); +} +#endif + +#if defined(CONFIG_EPIC_SERIAL_MODE) || defined(CONFIG_PMAC_PBOOK) +static void openpic_reset(void) +{ + openpic_setfield(&OpenPIC->Global.Global_Configuration0, + OPENPIC_CONFIG_RESET); + while (openpic_readfield(&OpenPIC->Global.Global_Configuration0, + OPENPIC_CONFIG_RESET)) + mb(); +} +#endif + +void __init openpic_set_sources(int first_irq, int num_irqs, void *first_ISR) +{ + volatile OpenPIC_Source *src = first_ISR; + int i, last_irq; + + last_irq = first_irq + num_irqs; + if (last_irq > NumSources) + NumSources = last_irq; + if (src == 0) + src = &((struct OpenPIC *)OpenPIC_Addr)->Source[first_irq]; + for (i = first_irq; i < last_irq; ++i, ++src) + ISR[i] = src; +} + +void __init openpic_init(int main_pic, int offset, unsigned char *chrp_ack, int programmer_switch_irq) { u_int t, i; @@ -274,7 +316,13 @@ } OpenPIC = (volatile struct OpenPIC *)OpenPIC_Addr; - if ( ppc_md.progress ) ppc_md.progress("openpic enter",0x122); +#ifdef CONFIG_EPIC_SERIAL_MODE + /* Have to start from ground zero. + */ + openpic_reset(); +#endif + + if (ppc_md.progress) ppc_md.progress("openpic: enter", 0x122); t = openpic_read(&OpenPIC->Global.Feature_Reporting0); switch (t & OPENPIC_FEATURE_VERSION_MASK) { @@ -293,8 +341,11 @@ } NumProcessors = ((t & OPENPIC_FEATURE_LAST_PROCESSOR_MASK) >> OPENPIC_FEATURE_LAST_PROCESSOR_SHIFT) + 1; - NumSources = ((t & OPENPIC_FEATURE_LAST_SOURCE_MASK) >> - OPENPIC_FEATURE_LAST_SOURCE_SHIFT) + 1; + if (NumSources == 0) + openpic_set_sources(0, + ((t & OPENPIC_FEATURE_LAST_SOURCE_MASK) >> + OPENPIC_FEATURE_LAST_SOURCE_SHIFT) + 1, + NULL); printk("OpenPIC Version %s (%d CPUs and %d IRQ sources) at %p\n", version, NumProcessors, NumSources, OpenPIC); timerfreq = openpic_read(&OpenPIC->Global.Timer_Frequency); @@ -306,10 +357,10 @@ return; open_pic_irq_offset = offset; - chrp_int_ack_special = (volatile unsigned char*)chrp_ack; + chrp_int_ack_special = chrp_ack; /* Initialize timer interrupts */ - if ( ppc_md.progress ) ppc_md.progress("openpic timer",0x3ba); + if ( ppc_md.progress ) ppc_md.progress("openpic: timer",0x3ba); for (i = 0; i < OPENPIC_NUM_TIMERS; i++) { /* Disabled, Priority 0 */ openpic_inittimer(i, 0, OPENPIC_VEC_TIMER+i+offset); @@ -319,7 +370,7 @@ #ifdef CONFIG_SMP /* Initialize IPI interrupts */ - if ( ppc_md.progress ) ppc_md.progress("openpic ipi",0x3bb); + if ( ppc_md.progress ) ppc_md.progress("openpic: ipi",0x3bb); for (i = 0; i < OPENPIC_NUM_IPI; i++) { /* Disabled, Priority 10..13 */ openpic_initipi(i, 10+i, OPENPIC_VEC_IPI+i+offset); @@ -329,35 +380,36 @@ } #endif - find_ISUs(); - /* Initialize external interrupts */ - if (ppc_md.progress) ppc_md.progress("openpic ext",0x3bc); + if (ppc_md.progress) ppc_md.progress("openpic: external",0x3bc); openpic_set_priority(0xf); - /* SIOint (8259 cascade) is special */ - if (offset) { - openpic_initirq(0, 8, offset, 1, 1); - openpic_mapirq(0, 1<<0); - } - - /* Init all external sources */ - for (i = 1; i < NumSources; i++) { + /* Init all external sources, including possibly the cascade. */ + for (i = 0; i < NumSources; i++) { int pri, sense; + if (ISR[i] == 0) + continue; + /* the bootloader may have left it enabled (bad !) */ openpic_disable_irq(i+offset); pri = (i == programmer_switch_irq)? 9: 8; + /* + * We find the vale from either the InitSenses table + * or assume a negative polarity level interrupt. + */ sense = (i < OpenPIC_NumInitSenses)? OpenPIC_InitSenses[i]: 1; - if (sense) + + if ((sense & IRQ_SENSE_MASK) == 1) irq_desc[i+offset].status = IRQ_LEVEL; /* Enabled, Priority 8 or 9 */ - openpic_initirq(i, pri, i+offset, !sense, sense); + openpic_initirq(i, pri, i+offset, (sense & IRQ_POLARITY_MASK), + (sense & IRQ_SENSE_MASK)); /* Processor 0 */ - openpic_mapirq(i, 1<<0); + openpic_mapirq(i, 1<<0, 0); } /* Init descriptors */ @@ -365,61 +417,17 @@ irq_desc[i].handler = &open_pic; /* Initialize the spurious interrupt */ - if (ppc_md.progress) ppc_md.progress("openpic spurious",0x3bd); + if (ppc_md.progress) ppc_md.progress("openpic: spurious",0x3bd); openpic_set_spurious(OPENPIC_VEC_SPURIOUS+offset); - /* Initialize the cascade */ - if (offset) { - if (request_irq(offset, no_action, SA_INTERRUPT, - "82c59 cascade", NULL)) - printk("Unable to get OpenPIC IRQ 0 for cascade\n"); - } - openpic_set_priority(0); - openpic_disable_8259_pass_through(); - - if (ppc_md.progress) ppc_md.progress("openpic exit",0x222); -} - -#ifdef CONFIG_POWER3 -void openpic_setup_ISU(int isu_num, unsigned long addr) -{ - if (isu_num >= OPENPIC_MAX_ISU) - return; - ISU[isu_num] = (OpenPIC_SourcePtr) ioremap(addr, 0x400); - if (isu_num >= NumISUs) - NumISUs = isu_num + 1; -} + openpic_disable_8259_pass_through(); +#ifdef CONFIG_EPIC_SERIAL_MODE + openpic_eicr_set_clk(7); /* Slowest value until we know better */ + openpic_enable_sie(); #endif + openpic_set_priority(0); -void find_ISUs(void) -{ -#ifdef CONFIG_POWER3 - /* Use /interrupt-controller/reg and - * /interrupt-controller/interrupt-ranges from OF device tree - * the ISU array is setup in chrp_pci.c in ibm_add_bridges - * as a result - * -- tgall - */ - - /* basically each ISU is a bus, and this assumes that - * open_pic_isu_count interrupts per bus are possible - * ISU == Interrupt Source - */ - NumSources = NumISUs * 0x10; - -#else - /* for non-distributed OpenPIC implementations it's in the IDU -- Cort */ - ISU[0] = (OpenPIC_Source *)OpenPIC->Source; -#endif -} - -static void openpic_reset(void) -{ - openpic_setfield(&OpenPIC->Global.Global_Configuration0, - OPENPIC_CONFIG_RESET); - while (openpic_readfield(&OpenPIC->Global.Global_Configuration0, - OPENPIC_CONFIG_RESET)) - mb(); + if (ppc_md.progress) ppc_md.progress("openpic: exit",0x222); } #ifdef notused @@ -430,6 +438,7 @@ } #endif /* notused */ +/* This can't be __init, it is used in openpic_sleep_restore_intrs */ static void openpic_disable_8259_pass_through(void) { openpic_setfield(&OpenPIC->Global.Global_Configuration0, @@ -471,7 +480,7 @@ } #endif /* notused */ -static void openpic_set_priority(u_int pri) +static void __init openpic_set_priority(u_int pri) { DECL_THIS_CPU; @@ -492,6 +501,7 @@ } #endif /* notused */ +/* This can't be __init, it is used in openpic_sleep_restore_intrs */ static void openpic_set_spurious(u_int vec) { check_arg_vec(vec); @@ -521,7 +531,9 @@ 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 /* @@ -603,8 +615,8 @@ * we should make sure we also change the default values of irq_affinity * in irq.c. */ - for (i = 0; i < NumSources ; i++) - openpic_mapirq(i, openpic_read(&GET_ISU(i).Destination) | msk); + for (i = 0; i < NumSources; i++) + openpic_mapirq(i, msk, ~0U); #endif /* CONFIG_IRQ_ALL_CPUS */ openpic_set_priority(0); @@ -646,6 +658,16 @@ * */ +/* + * Hookup a cascade to the OpenPIC. + */ +void __init +openpic_hookup_cascade(u_int irq, char *name) +{ + if (request_irq(irq, no_action, SA_INTERRUPT, name, NULL)) + printk("Unable to get OpenPIC IRQ %d for cascade\n", + irq - open_pic_irq_offset); +} /* * Enable/disable an external interrupt source @@ -654,26 +676,29 @@ */ static void openpic_enable_irq(u_int irq) { + volatile u_int *vpp; + check_arg_irq(irq); - openpic_clearfield(&GET_ISU(irq - open_pic_irq_offset).Vector_Priority, OPENPIC_MASK); + vpp = &ISR[irq - open_pic_irq_offset]->Vector_Priority; + openpic_clearfield(vpp, OPENPIC_MASK); /* make sure mask gets to controller before we return to user */ do { mb(); /* sync is probably useless here */ - } while(openpic_readfield(&GET_ISU(irq - open_pic_irq_offset).Vector_Priority, - OPENPIC_MASK)); + } while (openpic_readfield(vpp, OPENPIC_MASK)); } static void openpic_disable_irq(u_int irq) { + volatile u_int *vpp; u32 vp; check_arg_irq(irq); - openpic_setfield(&GET_ISU(irq - open_pic_irq_offset).Vector_Priority, OPENPIC_MASK); + vpp = &ISR[irq - open_pic_irq_offset]->Vector_Priority; + openpic_setfield(vpp, OPENPIC_MASK); /* make sure mask gets to controller before we return to user */ do { mb(); /* sync is probably useless here */ - vp = openpic_readfield(&GET_ISU(irq - open_pic_irq_offset).Vector_Priority, - OPENPIC_MASK | OPENPIC_ACTIVITY); + vp = openpic_readfield(vpp, OPENPIC_MASK | OPENPIC_ACTIVITY); } while((vp & OPENPIC_ACTIVITY) && !(vp & OPENPIC_MASK)); } @@ -708,9 +733,10 @@ * pol: polarity (1 for positive, 0 for negative) * sense: 1 for level, 0 for edge */ -static void openpic_initirq(u_int irq, u_int pri, u_int vec, int pol, int sense) +static void __init +openpic_initirq(u_int irq, u_int pri, u_int vec, int pol, int sense) { - openpic_safe_writefield(&GET_ISU(irq).Vector_Priority, + openpic_safe_writefield(&ISR[irq]->Vector_Priority, OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK | OPENPIC_SENSE_MASK | OPENPIC_POLARITY_MASK, (pri << OPENPIC_PRIORITY_SHIFT) | vec | @@ -722,9 +748,13 @@ /* * Map an interrupt source to one or more CPUs */ -static void openpic_mapirq(u_int irq, u_int physmask) +static void openpic_mapirq(u_int irq, u_int physmask, u_int keepmask) { - openpic_write(&GET_ISU(irq).Destination, physmask); + if (ISR[irq] == 0) + return; + if (keepmask != 0) + physmask |= openpic_read(&ISR[irq]->Destination) & keepmask; + openpic_write(&ISR[irq]->Destination, physmask); } #ifdef notused @@ -735,9 +765,10 @@ */ static void openpic_set_sense(u_int irq, int sense) { - openpic_safe_writefield(&GET_ISU(irq).Vector_Priority, - OPENPIC_SENSE_LEVEL, - (sense ? OPENPIC_SENSE_LEVEL : 0)); + if (ISR[irq] != 0) + openpic_safe_writefield(&ISR[irq]->Vector_Priority, + OPENPIC_SENSE_LEVEL, + (sense ? OPENPIC_SENSE_LEVEL : 0)); } #endif /* notused */ @@ -758,7 +789,7 @@ static void openpic_set_affinity(unsigned int irq_nr, unsigned long cpumask) { - openpic_mapirq(irq_nr - open_pic_irq_offset, physmask(cpumask)); + openpic_mapirq(irq_nr - open_pic_irq_offset, physmask(cpumask), 0); } #ifdef CONFIG_SMP @@ -778,29 +809,25 @@ #endif /* CONFIG_SMP */ -/* This one may be merged with PReP and CHRP */ int openpic_get_irq(struct pt_regs *regs) { -/* - * Clean up needed. -VAL - */ int irq = openpic_irq(); - /* Management of the cascade should be moved out of here */ - - /* Yep - because openpic !=> i8259, for one thing. -VAL */ + /* + * This needs to be cleaned up. We don't necessarily have + * an i8259 cascaded or even a cascade. + */ if (open_pic_irq_offset && irq == open_pic_irq_offset) { - /* - * This magic address generates a PCI IACK cycle. - */ + /* + * On CHRP, we do the equivalent of i8259_irq(). + */ if ( chrp_int_ack_special ) irq = *chrp_int_ack_special; -#ifndef CONFIG_GEMINI else - irq = i8259_poll(); -#endif + irq = i8259_poll(regs); + openpic_eoi(); } if (irq == OPENPIC_VEC_SPURIOUS + open_pic_irq_offset) @@ -856,9 +883,11 @@ for (i=0; iGlobal.IPI_Vector_Priority(i)); for (i=0; iSource[i].Vector_Priority) + if (ISR[i] == 0) + continue; + save_irq_src_vp[i] = openpic_read(&ISR[i]->Vector_Priority) & ~OPENPIC_ACTIVITY; - save_irq_src_dest[i] = openpic_read(&OpenPIC->Source[i].Destination); + save_irq_src_dest[i] = openpic_read(&ISR[i]->Destination); } spin_unlock_irqrestore(&openpic_setup_lock, flags); } @@ -874,15 +903,19 @@ openpic_reset(); for (i=0; iGlobal.IPI_Vector_Priority(i), save_ipi_vp[i]); + openpic_write(&OpenPIC->Global.IPI_Vector_Priority(i), + save_ipi_vp[i]); for (i=0; iSource[i].Vector_Priority, save_irq_src_vp[i]); - openpic_write(&OpenPIC->Source[i].Destination, save_irq_src_dest[i]); + if (ISR[i] == 0) + continue; + openpic_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]); + openpic_write(&ISR[i]->Destination, save_irq_src_dest[i]); } openpic_set_spurious(OPENPIC_VEC_SPURIOUS+open_pic_irq_offset); openpic_disable_8259_pass_through(); for (i=0; iProcessor[i].Current_Task_Priority, save_cpu_task_pri[i]); + openpic_write(&OpenPIC->Processor[i].Current_Task_Priority, + save_cpu_task_pri[i]); spin_unlock_irqrestore(&openpic_setup_lock, flags); } diff -uNr linux-2.4.19/arch/ppc/kernel/open_pic_defs.h linux-2.4.19bgl/arch/ppc/kernel/open_pic_defs.h --- linux-2.4.19/arch/ppc/kernel/open_pic_defs.h 2001-08-28 08:58:33.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/open_pic_defs.h 2003-07-02 10:44:43.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.open_pic_defs.h 1.8 08/20/01 22:33:28 paulus + * BK Id: SCCS/s.open_pic_defs.h 1.10 08/27/01 17:54:26 dan */ /* * linux/openpic.h -- OpenPIC definitions @@ -209,6 +209,14 @@ #define OPENPIC_CONFIG_BASE_MASK 0x000fffff /* + * Global Configuration Register 1 + * This is the EICR on EPICs. + */ + +#define OPENPIC_EICR_S_CLK_MASK 0x70000000 +#define OPENPIC_EICR_SIE 0x08000000 + + /* * Vendor Identification Register */ diff -uNr linux-2.4.19/arch/ppc/kernel/pci-dma.c linux-2.4.19bgl/arch/ppc/kernel/pci-dma.c --- linux-2.4.19/arch/ppc/kernel/pci-dma.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/pci-dma.c 2003-07-02 10:43:32.000000000 -0500 @@ -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.10 06/13/02 14:57:36 trini */ /* * Copyright (C) 2000 Ani Joshi @@ -25,11 +25,18 @@ if (hwdev == NULL || hwdev->dma_mask != 0xffffffff) gfp |= GFP_DMA; + +#ifdef CONFIG_NOT_COHERENT_CACHE + ret = consistent_alloc(gfp, size, dma_handle); +#else ret = (void *)__get_free_pages(gfp, get_order(size)); +#endif if (ret != NULL) { memset(ret, 0, size); +#ifndef CONFIG_NOT_COHERENT_CACHE *dma_handle = virt_to_bus(ret); +#endif } return ret; } @@ -37,5 +44,9 @@ void pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) { +#ifdef CONFIG_NOT_COHERENT_CACHE + consistent_free(vaddr); +#else free_pages((unsigned long)vaddr, get_order(size)); +#endif } diff -uNr linux-2.4.19/arch/ppc/kernel/pci.c linux-2.4.19bgl/arch/ppc/kernel/pci.c --- linux-2.4.19/arch/ppc/kernel/pci.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/pci.c 2003-07-02 10:44:43.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pci.c 1.43 05/08/02 15:01:15 benh + * BK Id: SCCS/s.pci.c 1.56 05/28/02 16:39:02 trini */ /* * Common pmac/prep/chrp pci routines. -- Cort @@ -21,15 +21,11 @@ #include #include #include -#include #include #include -#include #include -#include "pci.h" - -#define DEBUG +#undef DEBUG #ifdef DEBUG #define DBG(x...) printk(x) @@ -43,8 +39,13 @@ void pcibios_make_OF_bus_map(void); +static int pci_relocate_bridge_resource(struct pci_bus *bus, int i); +static int probe_resource(struct pci_bus *parent, struct resource *pr, + struct resource *res, struct resource **conflict); +static void update_bridge_base(struct pci_bus *bus, int i); static void pcibios_fixup_resources(struct pci_dev* dev); static void fixup_broken_pcnet32(struct pci_dev* dev); +static int reparent_resources(struct resource *parent, struct resource *res); static void fixup_rev1_53c810(struct pci_dev* dev); static void fixup_cpc710_pci64(struct pci_dev* dev); #ifdef CONFIG_ALL_PPC @@ -100,18 +101,20 @@ static void fixup_cpc710_pci64(struct pci_dev* dev) { + int i; + /* 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; + for (i=0; iresource[i].start = dev->resource[i].end = 0; + dev->resource[i].flags = 0; + } } void pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) + struct resource *res, int resource) { u32 new, check; int reg; @@ -119,6 +122,7 @@ unsigned long io_offset; new = res->start; + res->flags &= ~IORESOURCE_UNSET; if (hose && res->flags & IORESOURCE_IO) { io_offset = (unsigned long)hose->io_base_virt - isa_io_base; new -= io_offset; @@ -143,6 +147,9 @@ "%s/%d (%08x != %08x)\n", dev->slot_name, resource, new, check); } + printk(KERN_INFO "PCI: moved device %s resource %d (%lx) to %x\n", + dev->slot_name, resource, res->flags, + new & ~PCI_REGION_FLAG_MASK); } static void @@ -158,13 +165,14 @@ } for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { struct resource *res = dev->resource + i; - if (!res->start || !res->flags) + if (!res->flags) continue; - if (res->end == 0xffffffff) { + if (!res->start || 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; + res->flags |= IORESOURCE_UNSET; continue; } offset = 0; @@ -184,6 +192,10 @@ #endif } } + + /* Call machine specific resource fixup */ + if (ppc_md.pcibios_fixup_resources) + ppc_md.pcibios_fixup_resources(dev); } #ifdef CONFIG_ALL_PPC @@ -303,7 +315,8 @@ 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) + if ((res = bus->resource[i]) == NULL || !res->flags + || res->start > res->end) continue; if (bus->parent == NULL) pr = (res->flags & IORESOURCE_IO)? @@ -318,18 +331,238 @@ continue; } } - - if (pr && request_resource(pr, res) == 0) - continue; + + DBG("PCI: bridge rsrc %lx..%lx (%lx), parent %p\n", + res->start, res->end, res->flags, pr); + if (pr) { + if (request_resource(pr, res) == 0) + continue; + /* + * Must be a conflict with an existing entry. + * Move that entry (or entries) under the + * bridge resource and try again. + */ + if (reparent_resources(pr, res) == 0) + continue; + } printk(KERN_ERR "PCI: Cannot allocate resource region " "%d of PCI bridge %d\n", i, bus->number); - DBG("PCI: resource is %lx..%lx (%lx), parent %p\n", - res->start, res->end, res->flags, pr); + if (pci_relocate_bridge_resource(bus, i)) + bus->resource[i] = NULL; } pcibios_allocate_bus_resources(&bus->children); } } +/* + * Reparent resource children of pr that conflict with res + * under res, and make res replace those children. + */ +static int __init +reparent_resources(struct resource *parent, struct resource *res) +{ + struct resource *p, **pp; + struct resource **firstpp = NULL; + + for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) { + if (p->end < res->start) + continue; + if (res->end < p->start) + break; + if (p->start < res->start || p->end > res->end) + return -1; /* not completely contained */ + if (firstpp == NULL) + firstpp = pp; + } + if (firstpp == NULL) + return -1; /* didn't find any conflicting entries? */ + res->parent = parent; + res->child = *firstpp; + res->sibling = *pp; + *firstpp = res; + *pp = NULL; + for (p = res->child; p != NULL; p = p->sibling) { + p->parent = res; + DBG(KERN_INFO "PCI: reparented %s [%lx..%lx] under %s\n", + p->name, p->start, p->end, res->name); + } + return 0; +} + +/* + * A bridge has been allocated a range which is outside the range + * of its parent bridge, so it needs to be moved. + */ +static int __init +pci_relocate_bridge_resource(struct pci_bus *bus, int i) +{ + struct resource *res, *pr, *conflict; + unsigned long try, size; + int j; + struct pci_bus *parent = bus->parent; + + if (parent == NULL) { + /* shouldn't ever happen */ + printk(KERN_ERR "PCI: can't move host bridge resource\n"); + return -1; + } + res = bus->resource[i]; + pr = NULL; + for (j = 0; j < 4; j++) { + struct resource *r = parent->resource[j]; + if (!r) + continue; + if ((res->flags ^ r->flags) & (IORESOURCE_IO | IORESOURCE_MEM)) + continue; + if (!((res->flags ^ r->flags) & IORESOURCE_PREFETCH)) { + pr = r; + break; + } + if (res->flags & IORESOURCE_PREFETCH) + pr = r; + } + if (pr == NULL) + return -1; + size = res->end - res->start; + if (pr->start > pr->end || size > pr->end - pr->start) + return -1; + try = pr->end + 1; + for (;;) { + try &= ~0xfffUL; + if (res->flags & IORESOURCE_MEM) + try &= ~0xfffffUL; + res->start = try - size - 1; + res->end = try - 1; + if (try <= size || res->start < pr->start) + return -1; + if (probe_resource(bus->parent, pr, res, &conflict) == 0) + break; + if (conflict->start <= pr->start + size) + return -1; + try = conflict->start; + } + if (request_resource(pr, res)) { + DBG(KERN_ERR "PCI: huh? couldn't move to %lx..%lx\n", + res->start, res->end); + return -1; /* "can't happen" */ + } + update_bridge_base(bus, i); + printk(KERN_INFO "PCI: bridge %d resource %d moved to %lx..%lx\n", + bus->number, i, res->start, res->end); + return 0; +} + +static int __init +probe_resource(struct pci_bus *parent, struct resource *pr, + struct resource *res, struct resource **conflict) +{ + struct pci_bus *bus; + struct pci_dev *dev; + struct resource *r; + struct list_head *ln; + int i; + + for (r = pr->child; r != NULL; r = r->sibling) { + if (r->end >= res->start && res->end >= r->start) { + *conflict = r; + return 1; + } + } + for (ln = parent->children.next; ln != &parent->children; + ln = ln->next) { + bus = pci_bus_b(ln); + for (i = 0; i < 4; ++i) { + if ((r = bus->resource[i]) == NULL) + continue; + if (!r->flags || r->start > r->end || r == res) + continue; + if (pci_find_parent_resource(bus->self, r) != pr) + continue; + if (r->end >= res->start && res->end >= r->start) { + *conflict = r; + return 1; + } + } + } + for (ln = parent->devices.next; ln != &parent->devices; ln=ln->next) { + dev = pci_dev_b(ln); + for (i = 0; i < 6; ++i) { + r = &dev->resource[i]; + if (!r->flags || (r->flags & IORESOURCE_UNSET)) + continue; + if (pci_find_parent_resource(bus->self, r) != pr) + continue; + if (r->end >= res->start && res->end >= r->start) { + *conflict = r; + return 1; + } + } + } + return 0; +} + +static void __init +update_bridge_base(struct pci_bus *bus, int i) +{ + struct resource *res = bus->resource[i]; + u8 io_base_lo, io_limit_lo; + u16 mem_base, mem_limit; + u16 cmd; + unsigned long start, end, off; + struct pci_dev *dev = bus->self; + struct pci_controller *hose = dev->sysdata; + + if (!hose) { + printk("update_bridge_base: no hose?\n"); + return; + } + pci_read_config_word(dev, PCI_COMMAND, &cmd); + pci_write_config_word(dev, PCI_COMMAND, + cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY)); + if (res->flags & IORESOURCE_IO) { + u16 bu; + off = (unsigned long) hose->io_base_virt - isa_io_base; + start = res->start - off; + end = res->end - off; + pci_read_config_byte(dev, PCI_IO_BASE, &io_base_lo); + pci_read_config_byte(dev, PCI_IO_LIMIT, &io_limit_lo); + pci_read_config_word(dev, PCI_IO_BASE_UPPER16, &bu); + io_limit_lo &= PCI_IO_RANGE_TYPE_MASK; + if (io_base_lo == PCI_IO_RANGE_TYPE_16 && end > 0xffff) { + printk(KERN_ERR "bridge only supports 16-bit I/O!\n"); + goto out; + } + io_base_lo |= (start >> 8) & PCI_IO_RANGE_MASK; + io_limit_lo |= (end >> 8) & PCI_IO_RANGE_MASK; + pci_write_config_word(dev, PCI_IO_BASE_UPPER16, start >> 16); + pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16, end >> 16); + pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo); + pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo); + + } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH)) + == IORESOURCE_MEM) { + off = hose->pci_mem_offset; + mem_base = ((res->start - off) >> 16) & PCI_MEMORY_RANGE_MASK; + mem_limit = ((res->end - off) >> 16) & PCI_MEMORY_RANGE_MASK; + pci_write_config_word(dev, PCI_MEMORY_BASE, mem_base); + pci_write_config_word(dev, PCI_MEMORY_LIMIT, mem_limit); + + } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH)) + == (IORESOURCE_MEM | IORESOURCE_PREFETCH)) { + off = hose->pci_mem_offset; + mem_base = ((res->start - off) >> 16) & PCI_PREF_RANGE_MASK; + mem_limit = ((res->end - off) >> 16) & PCI_PREF_RANGE_MASK; + pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, mem_base); + pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit); + + } else { + DBG(KERN_ERR "PCI: ugh, bridge %s res %d has flags=%lx\n", + dev->slot_name, i, res->flags); + } + out: + pci_write_config_word(dev, PCI_COMMAND, cmd); +} + static inline void alloc_resource(struct pci_dev *dev, int idx) { struct resource *pr, *r = &dev->resource[idx]; @@ -344,6 +577,7 @@ DBG("PCI: parent is %p: %08lx-%08lx (f=%lx)\n", pr, pr->start, pr->end, pr->flags); /* We'll assign a new address later */ + r->flags |= IORESOURCE_UNSET; r->end -= r->start; r->start = 0; } @@ -363,8 +597,8 @@ r = &dev->resource[idx]; if (r->parent) /* Already allocated */ continue; - if (!r->start) /* Not assigned at all */ - continue; + if (!r->flags || (r->flags & IORESOURCE_UNSET)) + continue; /* Not assigned at all */ if (r->flags & IORESOURCE_IO) disabled = !(command & PCI_COMMAND_IO); else @@ -410,7 +644,7 @@ * or because we have decided the old address was * unusable for some reason. */ - if (!r->start && r->end && + if ((r->flags & IORESOURCE_UNSET) && r->end && (!ppc_md.pcibios_enable_device_hook || !ppc_md.pcibios_enable_device_hook(dev, 1))) pci_assign_resource(dev, idx); @@ -436,9 +670,9 @@ pci_read_config_word(dev, PCI_COMMAND, &cmd); old_cmd = cmd; - for(idx=0; idx<6; idx++) { + for (idx=0; idx<6; idx++) { r = &dev->resource[idx]; - if (!r->start && r->end) { + if (r->flags & IORESOURCE_UNSET) { printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name); return -EINVAL; } @@ -489,7 +723,7 @@ 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); + node->full_name); return; } pci_to_OF_bus_map[pci_bus] = bus_range[0]; @@ -795,6 +1029,24 @@ ranges += np; } } + +/* We create the "pci-OF-bus-map" property now so it appears in the + * /proc device tree + */ +void __init +pci_create_OF_bus_map(void) +{ + struct property* of_prop; + + of_prop = (struct property*) alloc_bootmem(sizeof(struct property) + 256); + if (of_prop && find_path_device("/")) { + memset(of_prop, -1, sizeof(struct property) + 256); + of_prop->name = "pci-OF-bus-map"; + of_prop->length = 256; + of_prop->value = (unsigned char *)&of_prop[1]; + prom_add_property(find_path_device("/"), of_prop); + } +} #endif /* CONFIG_ALL_PPC */ void __init @@ -825,6 +1077,10 @@ 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(); @@ -840,10 +1096,23 @@ ppc_md.pcibios_after_init(); } -int __init -pcibios_assign_all_busses(void) +unsigned char __init +common_swizzle(struct pci_dev *dev, unsigned char *pinp) { - return pci_assign_all_busses; + 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); } void __init @@ -949,7 +1218,7 @@ old_cmd = cmd; for (idx=0; idx<6; idx++) { r = &dev->resource[idx]; - if (!r->start && r->end) { + if (r->flags & IORESOURCE_UNSET) { printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name); return -EINVAL; } @@ -1238,6 +1507,19 @@ 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. diff -uNr linux-2.4.19/arch/ppc/kernel/ppc-stub.c linux-2.4.19bgl/arch/ppc/kernel/ppc-stub.c --- linux-2.4.19/arch/ppc/kernel/ppc-stub.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/ppc-stub.c 2003-07-02 10:44:06.000000000 -0500 @@ -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.18 06/25/02 18:36:52 mporter */ /* * ppc-stub.c: KGDB support for the Linux kernel. @@ -61,7 +61,7 @@ * * The following gdb commands are supported: * - * command function Return value + * command function Return value * * g return the value of the CPU registers hex data or ENN * G set the value of the CPU registers OK or ENN @@ -131,12 +131,16 @@ static u_int fault_jmp_buf[100]; static int kdebug; + static const char hexchars[]="0123456789abcdef"; /* Place where we save old trap entries for restoration - sparc*/ /* struct tt_entry kgdb_savettable[256]; */ /* typedef void (*trapfunc_t)(void); */ +static void kgdb_fault_handler(struct pt_regs *regs); +static void handle_exception (struct pt_regs *regs); + #if 0 /* Install an exception handler for kgdb */ static void exceptionHandler(int tnum, unsigned int *tfunc) @@ -188,14 +192,45 @@ mem2hex(char *mem, char *buf, int count) { unsigned char ch; + unsigned short tmp_s; + unsigned long tmp_l; if (kgdb_setjmp((long*)fault_jmp_buf) == 0) { debugger_fault_handler = kgdb_fault_handler; - while (count-- > 0) { - ch = *mem++; - *buf++ = hexchars[ch >> 4]; - *buf++ = hexchars[ch & 0xf]; + + /* Accessing 16 bit and 32 bit objects in a single + ** load instruction is required to avoid bad side + ** effects for some IO registers. + */ + + if ((count == 2) && (((long)mem & 1) == 0)) { + tmp_s = *(unsigned short *)mem; + mem += 2; + *buf++ = hexchars[(tmp_s >> 12) & 0xf]; + *buf++ = hexchars[(tmp_s >> 8) & 0xf]; + *buf++ = hexchars[(tmp_s >> 4) & 0xf]; + *buf++ = hexchars[tmp_s & 0xf]; + + } else if ((count == 4) && (((long)mem & 3) == 0)) { + tmp_l = *(unsigned int *)mem; + mem += 4; + *buf++ = hexchars[(tmp_l >> 28) & 0xf]; + *buf++ = hexchars[(tmp_l >> 24) & 0xf]; + *buf++ = hexchars[(tmp_l >> 20) & 0xf]; + *buf++ = hexchars[(tmp_l >> 16) & 0xf]; + *buf++ = hexchars[(tmp_l >> 12) & 0xf]; + *buf++ = hexchars[(tmp_l >> 8) & 0xf]; + *buf++ = hexchars[(tmp_l >> 4) & 0xf]; + *buf++ = hexchars[tmp_l & 0xf]; + + } else { + while (count-- > 0) { + ch = *mem++; + *buf++ = hexchars[ch >> 4]; + *buf++ = hexchars[ch & 0xf]; + } } + } else { /* error condition */ } @@ -210,17 +245,58 @@ static char * hex2mem(char *buf, char *mem, int count) { - int i; unsigned char ch; + int i; + char *orig_mem; + unsigned short tmp_s; + unsigned long tmp_l; + + orig_mem = mem; if (kgdb_setjmp((long*)fault_jmp_buf) == 0) { debugger_fault_handler = kgdb_fault_handler; - for (i=0; i# */ +/* scan for the sequence $# */ static void getpacket(char *buffer) { @@ -316,14 +392,14 @@ } while (checksum != xmitcsum); } -/* send the packet in buffer. */ +/* send the packet in buffer. */ static void putpacket(unsigned char *buffer) { unsigned char checksum; int count; unsigned char ch, recv; - /* $#. */ + /* $#. */ do { putDebugChar('$'); checksum = 0; @@ -428,7 +504,7 @@ return 1; } -/* Convert the SPARC hardware trap type code to a unix signal number. */ +/* Convert the hardware trap type code to a unix signal number. */ /* * This table contains the mapping between PowerPC hardware trap types, and * signals, which are primarily what GDB understands. @@ -438,20 +514,47 @@ unsigned int tt; /* Trap type code for powerpc */ unsigned char signo; /* Signal that we map this trap into */ } hard_trap_info[] = { - { 0x200, SIGSEGV }, /* machine check */ - { 0x300, SIGSEGV }, /* address error (store) */ - { 0x400, SIGBUS }, /* instruction bus error */ - { 0x500, SIGINT }, /* interrupt */ - { 0x600, SIGBUS }, /* alingment */ - { 0x700, SIGTRAP }, /* breakpoint trap */ - { 0x800, SIGFPE }, /* fpu unavail */ - { 0x900, SIGALRM }, /* decrementer */ - { 0xa00, SIGILL }, /* reserved */ - { 0xb00, SIGILL }, /* reserved */ - { 0xc00, SIGCHLD }, /* syscall */ - { 0xd00, SIGTRAP }, /* single-step/watch */ - { 0xe00, SIGFPE }, /* fp assist */ +#if defined(CONFIG_4xx) + { 0x100, SIGINT }, /* critical input interrupt */ + { 0x200, SIGSEGV }, /* machine check */ + { 0x300, SIGSEGV }, /* data storage */ + { 0x400, SIGBUS }, /* instruction storage */ + { 0x500, SIGINT }, /* interrupt */ + { 0x600, SIGBUS }, /* alignment */ + { 0x700, SIGILL }, /* program */ + { 0x800, SIGILL }, /* reserved */ + { 0x900, SIGILL }, /* reserved */ + { 0xa00, SIGILL }, /* reserved */ + { 0xb00, SIGILL }, /* reserved */ + { 0xc00, SIGCHLD }, /* syscall */ + { 0xd00, SIGILL }, /* reserved */ + { 0xe00, SIGILL }, /* reserved */ + { 0xf00, SIGILL }, /* reserved */ + /* + ** 0x1000 PIT + ** 0x1010 FIT + ** 0x1020 watchdog + ** 0x1100 data TLB miss + ** 0x1200 instruction TLB miss + */ + { 0x2000, SIGTRAP}, /* debug */ +#else + { 0x200, SIGSEGV }, /* machine check */ + { 0x300, SIGSEGV }, /* address error (store) */ + { 0x400, SIGBUS }, /* instruction bus error */ + { 0x500, SIGINT }, /* interrupt */ + { 0x600, SIGBUS }, /* alingment */ + { 0x700, SIGTRAP }, /* breakpoint trap */ + { 0x800, SIGFPE }, /* fpu unavail */ + { 0x900, SIGALRM }, /* decrementer */ + { 0xa00, SIGILL }, /* reserved */ + { 0xb00, SIGILL }, /* reserved */ + { 0xc00, SIGCHLD }, /* syscall */ + { 0xd00, SIGTRAP }, /* single-step/watch */ + { 0xe00, SIGFPE }, /* fp assist */ +#endif { 0, 0} /* Must be last */ + }; static int computeSignal(unsigned int tt) @@ -462,7 +565,7 @@ if (ht->tt == tt) return ht->signo; - return SIGHUP; /* default for things we don't know about */ + return SIGHUP; /* default for things we don't know about */ } #define PC_REGNUM 64 @@ -493,7 +596,7 @@ #ifdef KGDB_DEBUG printk("kgdb: entering handle_exception; trap [0x%x]\n", - (unsigned int)regs->trap); + (unsigned int)regs->trap); #endif kgdb_interruptible(0); @@ -510,7 +613,7 @@ sigval = computeSignal(regs->trap); ptr = remcomOutBuffer; -#if 0 +#if defined(CONFIG_4xx) *ptr++ = 'S'; *ptr++ = hexchars[sigval >> 4]; *ptr++ = hexchars[sigval & 0xf]; @@ -533,6 +636,8 @@ *ptr++ = 0; putpacket(remcomOutBuffer); + if (kdebug) + printk("remcomOutBuffer: %s\n", remcomOutBuffer); /* XXX We may want to add some features dealing with poking the * XXX page tables, ... (look at sparc-stub.c for more info) @@ -544,7 +649,7 @@ getpacket(remcomInBuffer); switch (remcomInBuffer[0]) { - case '?': /* report most recent signal */ + case '?': /* report most recent signal */ remcomOutBuffer[0] = 'S'; remcomOutBuffer[1] = hexchars[sigval >> 4]; remcomOutBuffer[2] = hexchars[sigval & 0xf]; @@ -601,7 +706,7 @@ } break; - case 'G': /* set the value of the CPU registers */ + case 'G': /* set the value of the CPU registers */ { ptr = &remcomInBuffer[1]; @@ -639,15 +744,14 @@ ptr = &remcomInBuffer[1]; - if (hexToInt(&ptr, &addr) - && *ptr++ == ',' - && hexToInt(&ptr, &length)) { - if (mem2hex((char *)addr, remcomOutBuffer,length)) + if (hexToInt(&ptr, &addr) && *ptr++ == ',' + && hexToInt(&ptr, &length)) { + if (mem2hex((char *)addr, remcomOutBuffer, + length)) break; - strcpy (remcomOutBuffer, "E03"); - } else { - strcpy(remcomOutBuffer,"E01"); - } + strcpy(remcomOutBuffer, "E03"); + } else + strcpy(remcomOutBuffer, "E01"); break; case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */ @@ -655,50 +759,63 @@ ptr = &remcomInBuffer[1]; - if (hexToInt(&ptr, &addr) - && *ptr++ == ',' - && hexToInt(&ptr, &length) - && *ptr++ == ':') { - if (hex2mem(ptr, (char *)addr, length)) { + if (hexToInt(&ptr, &addr) && *ptr++ == ',' + && hexToInt(&ptr, &length) + && *ptr++ == ':') { + if (hex2mem(ptr, (char *)addr, length)) strcpy(remcomOutBuffer, "OK"); - } else { + else strcpy(remcomOutBuffer, "E03"); - } flush_icache_range(addr, addr+length); - } else { + } else strcpy(remcomOutBuffer, "E02"); - } break; - case 'k': /* kill the program, actually just continue */ - case 'c': /* cAA..AA Continue; address AA..AA optional */ + case 'k': /* kill the program, actually just continue */ + case 'c': /* cAA..AA Continue; address AA..AA optional */ /* try to read optional parameter, pc unchanged if no parm */ ptr = &remcomInBuffer[1]; - if (hexToInt(&ptr, &addr)) { + if (hexToInt(&ptr, &addr)) regs->nip = addr; - } /* Need to flush the instruction cache here, as we may have deposited a * breakpoint, and the icache probably has no way of knowing that a data ref to * some location may have changed something that is in the instruction cache. */ kgdb_flush_cache_all(); +#if defined(CONFIG_4xx) + strcpy(remcomOutBuffer, "OK"); + putpacket(remcomOutBuffer); +#endif set_msr(msr); + kgdb_interruptible(1); unlock_kernel(); kgdb_active = 0; + if (kdebug) { + printk("remcomInBuffer: %s\n", remcomInBuffer); + printk("remcomOutBuffer: %s\n", remcomOutBuffer); + } return; case 's': kgdb_flush_cache_all(); +#if defined(CONFIG_4xx) + regs->msr |= MSR_DE; + regs->dbcr0 |= (DBCR0_IDM | DBCR0_IC); + set_msr(msr); +#else regs->msr |= MSR_SE; -#if 0 set_msr(msr | MSR_SE); #endif unlock_kernel(); kgdb_active = 0; + if (kdebug) { + printk("remcomInBuffer: %s\n", remcomInBuffer); + printk("remcomOutBuffer: %s\n", remcomOutBuffer); + } return; case 'r': /* Reset (if user process..exit ???)*/ @@ -729,7 +846,7 @@ asm(" .globl breakinst breakinst: .long 0x7d821008 - "); + "); } /* Output string in GDB O-packet format if GDB has connected. If nothing @@ -739,24 +856,23 @@ { char buffer[512]; - if (!kgdb_started) - return 0; + if (!kgdb_started) + return 0; - count = (count <= (sizeof(buffer) / 2 - 2)) + count = (count <= (sizeof(buffer) / 2 - 2)) ? count : (sizeof(buffer) / 2 - 2); buffer[0] = 'O'; mem2hex (s, &buffer[1], count); putpacket(buffer); - return 1; + return 1; } -#ifndef CONFIG_8xx +#if defined(CONFIG_6xx) || defined(CONFIG_POWER3) || defined(CONFIG_ISERIES) -/* I don't know why other platforms don't need this. The function for - * the 8xx is found in arch/ppc/8xx_io/uart.c. -- Dan - */ +/* This is used on arches which don't have a serial driver that maps + * the ports for us */ void kgdb_map_scc(void) { diff -uNr linux-2.4.19/arch/ppc/kernel/ppc4xx_pic.c linux-2.4.19bgl/arch/ppc/kernel/ppc4xx_pic.c --- linux-2.4.19/arch/ppc/kernel/ppc4xx_pic.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/ppc4xx_pic.c 2003-07-02 10:43:58.000000000 -0500 @@ -1,7 +1,4 @@ /* - * BK Id: SCCS/s.ppc4xx_pic.c 1.5 05/17/01 18:14:21 cort - */ -/* * * Copyright (c) 1999 Grant Erickson * @@ -9,6 +6,12 @@ * * Description: * Interrupt controller driver for PowerPC 4xx-based processors. + * + * July 17, 2002 - Armin + * added sense & polarity to non 403 cpus + * + * Juky 24, 2002 - Armin + * fixed level setting for cascaded UIC, thanks Eugene */ /* @@ -18,10 +21,14 @@ * there are eight internal interrupts for the on-chip serial port * (SPU), DMA controller, and JTAG controller. * - * The PowerPC 405 cores' Universal Interrupt Controller (UIC) has 32 - * possible interrupts as well. There are seven, configurable external - * interrupt pins and there are 17 internal interrupts for the on-chip - * serial port, DMA controller, on-chip Ethernet controller, PCI, etc. + * The PowerPC 405/440 cores' Universal Interrupt Controller (UIC) has + * 32 possible interrupts as well. Depending on the core and SoC + * implementation, a portion of the interrrupts are used for on-chip + * peripherals and a portion of the interrupts are available to be + * configured for external devices generating interrupts. + * + * The PowerNP and 440GP (and most likely future implementations) have + * cascaded UICs. * */ @@ -33,25 +40,34 @@ #include #include #include - -#include "local_irq.h" -#include "ppc4xx_pic.h" - +#include /* Global Variables */ - struct hw_interrupt_type *ppc4xx_pic; +/* + * We define 4xxIRQ_InitSenses table thusly: + * bit 0x1: sense, 1 for edge and 0 for level. + * bit 0x2: polarity, 0 for negative, 1 for positive. + */ +unsigned int ibm4xxPIC_NumInitSenses __initdata = 0; +unsigned char *ibm4xxPIC_InitSenses __initdata = NULL; +/* Six of one, half dozen of the other....#ifdefs, separate files, + * other tricks..... + * + * There are basically two types of interrupt controllers, the 403 AIC + * and the "others" with UIC. I just kept them both here separated + * with #ifdefs, but it seems to change depending upon how supporting + * files (like ppc4xx.h) change. -- Dan. + */ + +#ifdef CONFIG_403 /* Function Prototypes */ -static void ppc403_aic_enable(unsigned int irq); -static void ppc403_aic_disable(unsigned int irq); -static void ppc403_aic_disable_and_ack(unsigned int irq); - -static void ppc405_uic_enable(unsigned int irq); -static void ppc405_uic_disable(unsigned int irq); -static void ppc405_uic_disable_and_ack(unsigned int irq); +static void ppc403_aic_enable(unsigned int irq); +static void ppc403_aic_disable(unsigned int irq); +static void ppc403_aic_disable_and_ack(unsigned int irq); static struct hw_interrupt_type ppc403_aic = { "403GC AIC", @@ -63,55 +79,11 @@ 0 }; -static struct hw_interrupt_type ppc405_uic = { - "405GP UIC", - NULL, - NULL, - ppc405_uic_enable, - ppc405_uic_disable, - ppc405_uic_disable_and_ack, - 0 -}; - -/* - * Document me. - */ -void __init -ppc4xx_pic_init(void) -{ - unsigned long ver = PVR_VER(mfspr(SPRN_PVR)); - - switch (ver) { - - case PVR_VER(PVR_403GC): - /* - * Disable all external interrupts until they are - * explicity requested. - */ - ppc_cached_irq_mask[0] = 0; - mtdcr(DCRN_EXIER, 0); - - ppc4xx_pic = &ppc403_aic; - break; - - case PVR_VER(PVR_405GP): - ppc4xx_pic = &ppc405_uic; - break; - } - - return; -} - -/* - * XXX - Currently 403-specific! - * - * Document me. - */ int -ppc4xx_pic_get_irq(struct pt_regs *regs) +ppc403_pic_get_irq(struct pt_regs *regs) { int irq; - unsigned long bits, mask = (1 << 31); + unsigned long bits; /* * Only report the status of those interrupts that are actually @@ -123,19 +95,17 @@ /* * Walk through the interrupts from highest priority to lowest, and * report the first pending interrupt found. + * We want PPC, not C bit numbering, so just subtract the ffs() + * result from 32. */ + irq = 32 - ffs(bits); - for (irq = 0; irq < NR_IRQS; irq++, mask >>= 1) { - if (bits & mask) - break; - } + if (irq == NR_AIC_IRQS) + irq = -1; return (irq); } -/* - * Document me. - */ static void ppc403_aic_enable(unsigned int irq) { @@ -148,9 +118,6 @@ mtdcr(DCRN_EXIER, ppc_cached_irq_mask[word]); } -/* - * Document me. - */ static void ppc403_aic_disable(unsigned int irq) { @@ -163,9 +130,6 @@ mtdcr(DCRN_EXIER, ppc_cached_irq_mask[word]); } -/* - * Document me. - */ static void ppc403_aic_disable_and_ack(unsigned int irq) { @@ -179,29 +143,308 @@ mtdcr(DCRN_EXISR, (1 << (31 - bit))); } -/* - * Document me. - */ +#else + +#ifndef UIC1 +#define UIC1 UIC0 +#endif + static void ppc405_uic_enable(unsigned int irq) { - /* XXX - Implement me. */ + int bit, word; + irq_desc_t *desc = irq_desc + irq; + + bit = irq & 0x1f; + word = irq >> 5; + +#ifdef UIC_DEBUG + printk("ppc405_uic_enable - irq %d word %d bit 0x%x\n", irq, word, bit); +#endif + ppc_cached_irq_mask[word] |= 1 << (31 - bit); + switch (word) { + case 0: + mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[word]); + if ((mfdcr(DCRN_UIC_TR(UIC0)) & (1 << (31 - bit))) == 0) + desc->status |= IRQ_LEVEL; + else + /* lets hope this works since in linux/irq.h + * there is no define for EDGE and it's assumed + * once you set status to LEVEL you would not + * want to change it - Armin + */ + desc->status = desc->status & ~IRQ_LEVEL; + break; + case 1: + mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]); + if ((mfdcr(DCRN_UIC_TR(UIC1)) & (1 << (31 - bit))) == 0) + desc->status |= IRQ_LEVEL; + else + /* lets hope this works since in linux/irq.h + * there is no define for EDGE and it's assumed + * once you set status to LEVEL you would not + * want to change it - Armin + */ + desc->status = desc->status & ~IRQ_LEVEL; + break; + } + } -/* - * Document me. - */ static void ppc405_uic_disable(unsigned int irq) { - /* XXX - Implement me. */ + int bit, word; + + bit = irq & 0x1f; + word = irq >> 5; +#ifdef UIC_DEBUG + printk("ppc405_uic_disable - irq %d word %d bit 0x%x\n", irq, word, + bit); +#endif + ppc_cached_irq_mask[word] &= ~(1 << (31 - bit)); + switch (word) { + case 0: + mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[word]); + break; + case 1: + mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]); + break; + } } -/* - * Document me. - */ static void ppc405_uic_disable_and_ack(unsigned int irq) { - /* XXX - Implement me. */ + int bit, word; + + bit = irq & 0x1f; + word = irq >> 5; + +#ifdef UIC_DEBUG + printk("ppc405_uic_disable_and_ack - irq %d word %d bit 0x%x\n", irq, + word, bit); +#endif + ppc_cached_irq_mask[word] &= ~(1 << (31 - bit)); + switch (word) { + case 0: + mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[word]); + mtdcr(DCRN_UIC_SR(UIC0), (1 << (31 - bit))); + break; + case 1: + mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]); + mtdcr(DCRN_UIC_SR(UIC1), (1 << (31 - bit))); + break; + } +} + +static void +ppc405_uic_end(unsigned int irq) +{ + int bit, word; + unsigned int tr_bits; + + bit = irq & 0x1f; + word = irq >> 5; + +#ifdef UIC_DEBUG + printk("ppc405_uic_end - irq %d word %d bit 0x%x\n", irq, word, bit); +#endif + + switch (word) { + case 0: + tr_bits = mfdcr(DCRN_UIC_TR(UIC0)); + break; + case 1: + tr_bits = mfdcr(DCRN_UIC_TR(UIC1)); + break; + } + + if ((tr_bits & (1 << (31 - bit))) == 0) { + /* level trigger */ + switch (word) { + case 0: + mtdcr(DCRN_UIC_SR(UIC0), 1 << (31 - bit)); + break; + case 1: + mtdcr(DCRN_UIC_SR(UIC1), 1 << (31 - bit)); + break; + } + } + + if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { + ppc_cached_irq_mask[word] |= 1 << (31 - bit); + switch (word) { + case 0: + mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[word]); + break; + case 1: + mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]); + break; + } + } +} + +static struct hw_interrupt_type ppc405_uic = { +#if (NR_UICS == 1) + "IBM UIC", +#else + "IBM UIC Cascade", +#endif + NULL, + NULL, + ppc405_uic_enable, + ppc405_uic_disable, + ppc405_uic_disable_and_ack, + ppc405_uic_end, + 0 +}; + +int +ppc405_pic_get_irq(struct pt_regs *regs) +{ + int irq, cas_irq; + unsigned long bits; + cas_irq = 0; + /* + * Only report the status of those interrupts that are actually + * enabled. + */ + + bits = mfdcr(DCRN_UIC_MSR(UIC0)); + +#if (NR_UICS > 1) + if (bits & UIC_CASCADE_MASK) { + bits = mfdcr(DCRN_UIC_MSR(UIC1)); + cas_irq = 32 - ffs(bits); + irq = 32 + cas_irq; + } else { + irq = 32 - ffs(bits); + if (irq == 32) + irq = -1; + } +#else + /* + * Walk through the interrupts from highest priority to lowest, and + * report the first pending interrupt found. + * We want PPC, not C bit numbering, so just subtract the ffs() + * result from 32. + */ + irq = 32 - ffs(bits); +#endif + if (irq == (NR_UIC_IRQS * NR_UICS)) + irq = -1; + +#ifdef UIC_DEBUG + printk("ppc405_pic_get_irq - irq %d bit 0x%x\n", irq, bits); +#endif + + return (irq); +} +#endif + +void __init +ppc4xx_extpic_init(void) +{ + /* set polarity + * 1 = default/pos/rising , 0= neg/falling internal + * 1 = neg/falling , 0= pos/rising external + * Sense + * 0 = default level internal + * 0 = level, 1 = edge external + */ + + unsigned int sense, irq; + int bit, word; + unsigned long ppc_cached_sense_mask[NR_MASK_WORDS]; + unsigned long ppc_cached_pol_mask[NR_MASK_WORDS]; + ppc_cached_sense_mask[0] = 0; + ppc_cached_sense_mask[1] = 0; + ppc_cached_pol_mask[0] = 0; + ppc_cached_pol_mask[1] = 0; + + for (irq = 0; irq < NR_IRQS; irq++) { + + bit = irq & 0x1f; + word = irq >> 5; + + sense = + (irq < + ibm4xxPIC_NumInitSenses) ? ibm4xxPIC_InitSenses[irq] : 3; +#ifdef PPC4xx_PIC_DEBUG + printk("PPC4xx_picext %d word:%x bit:%x sense:%x", irq, word, + bit, sense); +#endif + ppc_cached_sense_mask[word] |= + (sense & IBM4xx_IRQ_SNS_MASK) << (31 - bit); + ppc_cached_pol_mask[word] |= + ((sense & IBM4xx_IRQ_POL_MASK) >> 1) << (31 - bit); + switch (word) { + case 0: +#ifdef PPC4xx_PIC_DEBUG + printk("Pol %x ", mfdcr(DCRN_UIC_PR(UIC0))); + printk("Level %x\n", mfdcr(DCRN_UIC_TR(UIC0))); +#endif + /* polarity setting */ + mtdcr(DCRN_UIC_PR(UIC0), ppc_cached_pol_mask[word]); + + /* Level setting */ + mtdcr(DCRN_UIC_TR(UIC0), ppc_cached_sense_mask[word]); + + break; + case 1: +#ifdef PPC4xx_PIC_DEBUG + printk("Pol %x ", mfdcr(DCRN_UIC_PR(UIC1))); + printk("Level %x\n", mfdcr(DCRN_UIC_TR(UIC1))); +#endif + /* polarity setting */ + mtdcr(DCRN_UIC_PR(UIC1), ppc_cached_pol_mask[word]); + + /* Level setting */ + mtdcr(DCRN_UIC_TR(UIC1), ppc_cached_sense_mask[word]); + + break; + } + } + +} +void __init +ppc4xx_pic_init(void) +{ + + /* + * Disable all external interrupts until they are + * explicity requested. + */ + ppc_cached_irq_mask[0] = 0; + ppc_cached_irq_mask[1] = 0; + +#if defined CONFIG_403 + mtdcr(DCRN_EXIER, ppc_cached_irq_mask[0]); + + ppc4xx_pic = &ppc403_aic; + ppc_md.get_irq = ppc403_pic_get_irq; +#else +#if (NR_UICS > 1) + ppc_cached_irq_mask[0] |= 1 << (31 - UIC0_UIC1NC); /* enable cascading interrupt */ + mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[1]); + mtdcr(DCRN_UIC_CR(UIC1), 0); + +#endif + mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[0]); + mtdcr(DCRN_UIC_CR(UIC0), 0); + + if (ibm4xxPIC_InitSenses != NULL) + ppc4xx_extpic_init(); + + /* Clear any pending interrupts */ +#if (NR_UICS > 1) + mtdcr(DCRN_UIC_SR(UIC1), 0xffffffff); +#endif + mtdcr(DCRN_UIC_SR(UIC0), 0xffffffff); + + ppc4xx_pic = &ppc405_uic; + ppc_md.get_irq = ppc405_pic_get_irq; +#endif + } diff -uNr linux-2.4.19/arch/ppc/kernel/ppc8260_pic.c linux-2.4.19bgl/arch/ppc/kernel/ppc8260_pic.c --- linux-2.4.19/arch/ppc/kernel/ppc8260_pic.c 2002-02-25 13:37:55.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/kernel/ppc8260_pic.c 2003-07-02 10:44:07.000000000 -0500 @@ -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.10 02/14/02 13:18:38 trini */ #include diff -uNr linux-2.4.19/arch/ppc/kernel/ppc8260_pic.h linux-2.4.19bgl/arch/ppc/kernel/ppc8260_pic.h --- linux-2.4.19/arch/ppc/kernel/ppc8260_pic.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/ppc8260_pic.h 2003-07-02 10:44:46.000000000 -0500 @@ -1,11 +1,11 @@ /* - * BK Id: SCCS/s.ppc8260_pic.h 1.7 05/17/01 18:14:21 cort + * BK Id: SCCS/s.ppc8260_pic.h 1.10 11/04/01 21:07:38 paulus */ #ifndef _PPC_KERNEL_PPC8260_H #define _PPC_KERNEL_PPC8260_H -#include "local_irq.h" +#include extern struct hw_interrupt_type ppc8260_pic; diff -uNr linux-2.4.19/arch/ppc/kernel/ppc8xx_pic.c linux-2.4.19bgl/arch/ppc/kernel/ppc8xx_pic.c --- linux-2.4.19/arch/ppc/kernel/ppc8xx_pic.c 2002-02-25 13:37:55.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/kernel/ppc8xx_pic.c 2003-07-02 10:43:22.000000000 -0500 @@ -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.16 12/27/01 10:38:49 trini */ #include #include diff -uNr linux-2.4.19/arch/ppc/kernel/ppc8xx_pic.h linux-2.4.19bgl/arch/ppc/kernel/ppc8xx_pic.h --- linux-2.4.19/arch/ppc/kernel/ppc8xx_pic.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/ppc8xx_pic.h 2003-07-02 10:43:57.000000000 -0500 @@ -1,11 +1,11 @@ /* - * BK Id: SCCS/s.ppc8xx_pic.h 1.7 05/17/01 18:14:21 cort + * BK Id: SCCS/s.ppc8xx_pic.h 1.10 11/04/01 21:07:38 paulus */ #ifndef _PPC_KERNEL_PPC8xx_H #define _PPC_KERNEL_PPC8xx_H #include -#include "local_irq.h" +#include extern struct hw_interrupt_type ppc8xx_pic; @@ -15,7 +15,7 @@ int m8xx_get_irq(struct pt_regs *regs); #ifdef CONFIG_MBX -#include "i8259.h" +#include #include void mbx_i8259_action(int cpl, void *dev_id, struct pt_regs *regs); #endif diff -uNr linux-2.4.19/arch/ppc/kernel/ppc_htab.c linux-2.4.19bgl/arch/ppc/kernel/ppc_htab.c --- linux-2.4.19/arch/ppc/kernel/ppc_htab.c 2001-11-02 19:43:54.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/kernel/ppc_htab.c 2003-07-02 10:44:43.000000000 -0500 @@ -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.30 11/04/01 23:02:40 paulus */ /* * PowerPC hash table management proc entry. Will show information diff -uNr linux-2.4.19/arch/ppc/kernel/ppc_ksyms.c linux-2.4.19bgl/arch/ppc/kernel/ppc_ksyms.c --- linux-2.4.19/arch/ppc/kernel/ppc_ksyms.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/ppc_ksyms.c 2005-06-08 14:30:44.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc_ksyms.c 1.63 01/20/02 23:53:11 benh + * BK Id: SCCS/s.ppc_ksyms.c 1.97 05/08/02 15:05:15 benh */ #include #include @@ -12,18 +12,17 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -161,14 +160,22 @@ EXPORT_SYMBOL(_outsw_ns); EXPORT_SYMBOL(_insl_ns); EXPORT_SYMBOL(_outsl_ns); +EXPORT_SYMBOL(iopa); +EXPORT_SYMBOL(mm_ptov); +#ifndef CONFIG_PPC_ISERIES +#ifndef CONFIG_BGL EXPORT_SYMBOL(ioremap); +#else +EXPORT_SYMBOL(ioremap_bot); +#endif EXPORT_SYMBOL(__ioremap); EXPORT_SYMBOL(iounmap); -EXPORT_SYMBOL(iopa); -EXPORT_SYMBOL(mm_ptov); +#endif +#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) EXPORT_SYMBOL(ppc_ide_md); EXPORT_SYMBOL(ppc_generic_ide_fix_driveid); +#endif #ifdef CONFIG_PCI EXPORT_SYMBOL_NOVERS(isa_io_base); @@ -176,14 +183,26 @@ EXPORT_SYMBOL_NOVERS(pci_dram_offset); EXPORT_SYMBOL(pci_alloc_consistent); EXPORT_SYMBOL(pci_free_consistent); +EXPORT_SYMBOL(pci_bus_io_base); +EXPORT_SYMBOL(pci_bus_io_base_phys); +EXPORT_SYMBOL(pci_bus_mem_base_phys); +EXPORT_SYMBOL(pci_bus_to_hose); +EXPORT_SYMBOL(pci_resource_to_bus); +EXPORT_SYMBOL(pci_phys_to_bus); +EXPORT_SYMBOL(pci_bus_to_phys); #endif /* CONFIG_PCI */ +#ifdef CONFIG_NOT_COHERENT_CACHE +EXPORT_SYMBOL(consistent_alloc); +EXPORT_SYMBOL(consistent_free); +EXPORT_SYMBOL(consistent_sync); +EXPORT_SYMBOL(consistent_sync_page); +EXPORT_SYMBOL(flush_dcache_all); +#endif + 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); @@ -199,7 +218,6 @@ #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); @@ -246,21 +264,15 @@ 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); #endif /* defined(CONFIG_ALL_PPC) */ #if defined(CONFIG_BOOTX_TEXT) @@ -292,7 +304,7 @@ EXPORT_SYMBOL(abs); -#ifdef CONFIG_VGA_CONSOLE +#if defined(CONFIG_FB_VGA16_MODULE) EXPORT_SYMBOL(screen_info); #endif @@ -341,10 +353,12 @@ #ifdef CONFIG_8xx EXPORT_SYMBOL(__res); -EXPORT_SYMBOL(request_8xxirq); EXPORT_SYMBOL(cpm_install_handler); EXPORT_SYMBOL(cpm_free_handler); #endif /* CONFIG_8xx */ +#if defined(CONFIG_8xx) || defined(CONFIG_8260) +EXPORT_SYMBOL(request_8xxirq); +#endif EXPORT_SYMBOL(ret_to_user_hook); EXPORT_SYMBOL(next_mmu_context); @@ -363,4 +377,7 @@ extern unsigned long agp_special_page; EXPORT_SYMBOL_NOVERS(agp_special_page); #endif /* defined(CONFIG_ALL_PPC) */ - +#if defined(CONFIG_GT64260) +extern unsigned long gt64260_base; +EXPORT_SYMBOL(gt64260_base); +#endif /* CONFIG_GT64260 */ diff -uNr linux-2.4.19/arch/ppc/kernel/prep_nvram.c linux-2.4.19bgl/arch/ppc/kernel/prep_nvram.c --- linux-2.4.19/arch/ppc/kernel/prep_nvram.c 2001-09-08 14:38:42.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/prep_nvram.c 2003-07-02 10:43:16.000000000 -0500 @@ -1,8 +1,8 @@ /* - * BK Id: SCCS/s.prep_nvram.c 1.12 09/08/01 15:47:42 paulus + * BK Id: SCCS/s.prep_nvram.c 1.16 07/17/02 12:08:59 trini */ /* - * linux/arch/ppc/kernel/prep_nvram.c + * arch/ppc/platforms/prep_nvram.c * * Copyright (C) 1998 Corey Minyard * diff -uNr linux-2.4.19/arch/ppc/kernel/process.c linux-2.4.19bgl/arch/ppc/kernel/process.c --- linux-2.4.19/arch/ppc/kernel/process.c 2001-11-26 07:29:17.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/kernel/process.c 2005-06-08 14:30:44.000000000 -0500 @@ -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.46 07/12/02 12:16:06 tpoynor */ /* * linux/arch/ppc/kernel/process.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -42,6 +43,9 @@ #include #include #include +#ifdef CONFIG_PPC_ISERIES +#include +#endif int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs); extern unsigned long _get_SP(void); @@ -233,8 +237,10 @@ /* Avoid the trap. On smp this this never happens since * we don't set last_task_used_altivec -- Cort */ +#ifdef CONFIG_ALTIVEC if (new->thread.regs && last_task_used_altivec == new) new->thread.regs->msr |= MSR_VEC; +#endif new_thread = &new->thread; old_thread = ¤t->thread; *last = _switch(old_thread, new_thread); @@ -260,12 +266,14 @@ printk("\nlast math %p last altivec %p", last_task_used_math, last_task_used_altivec); -#ifdef CONFIG_4xx +#if defined(CONFIG_4xx) && defined(DCRN_PLB0_BEAR) printk("\nPLB0: bear= 0x%8.8x acr= 0x%8.8x besr= 0x%8.8x\n", - mfdcr(DCRN_POB0_BEAR), mfdcr(DCRN_PLB0_ACR), + mfdcr(DCRN_PLB0_BEAR), mfdcr(DCRN_PLB0_ACR), mfdcr(DCRN_PLB0_BESR)); +#endif +#if defined(CONFIG_4xx) && defined(DCRN_POB0_BEAR) printk("PLB0 to OPB: bear= 0x%8.8x besr0= 0x%8.8x besr1= 0x%8.8x\n", - mfdcr(DCRN_PLB0_BEAR), mfdcr(DCRN_POB0_BESR0), + mfdcr(DCRN_POB0_BEAR), mfdcr(DCRN_POB0_BESR0), mfdcr(DCRN_POB0_BESR1)); #endif @@ -356,6 +364,9 @@ sp -= STACK_FRAME_OVERHEAD; p->thread.ksp = sp; kregs->nip = (unsigned long)ret_from_fork; +#ifdef CONFIG_PPC_ISERIES + kregs->softEnable = ((struct Paca *)mfspr(SPRG1))->xProcEnabled; +#endif /* * copy fpu info - assume lazy fpu switch now always @@ -392,7 +403,10 @@ { set_fs(USER_DS); memset(regs->gpr, 0, sizeof(regs->gpr)); - memset(®s->ctr, 0, 5 * sizeof(regs->ctr)); + regs->ctr = 0; + regs->link = 0; + regs->xer = 0; + regs->ccr = 0; regs->nip = nip; regs->gpr[1] = sp; regs->msr = MSR_USER; @@ -400,7 +414,26 @@ 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 */ +} + +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 sys_clone(int p1, int p2, int p3, int p4, int p5, int p6, diff -uNr linux-2.4.19/arch/ppc/kernel/prom.c linux-2.4.19bgl/arch/ppc/kernel/prom.c --- linux-2.4.19/arch/ppc/kernel/prom.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/prom.c 2003-07-02 10:44:40.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.prom.c 1.52 04/09/02 21:01:58 paulus + * BK Id: SCCS/s.prom.c 1.69 05/08/02 15:05:15 benh */ /* * Procedures for interfacing to the Open Firmware PROM on @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -72,7 +73,6 @@ static unsigned long finish_node(struct device_node *, unsigned long, interpret_func *, int, int); static unsigned long finish_node_interrupts(struct device_node *, unsigned long); -static struct device_node *find_phandle(phandle); extern void enter_rtas(void *); void phys_call_rtas(int, int, int, ...); @@ -758,8 +758,15 @@ for (np = allnodes; np != 0; np = np->allnext) { for (j = 0; j < np->n_intrs; j++) { i = np->intrs[j].line; - if (i >= off && i < max) - senses[i-off] = np->intrs[j].sense; + if (i >= off && i < max) { + if (np->intrs[j].sense == 1) { + senses[i-off] = (IRQ_SENSE_LEVEL | + IRQ_POLARITY_NEGATIVE); + } else { + senses[i-off] = (IRQ_SENSE_EDGE | + IRQ_POLARITY_POSITIVE); + } + } } } } @@ -898,7 +905,7 @@ /* * Find the device_node with a given phandle. */ -static struct device_node * __init +struct device_node * __init find_phandle(phandle ph) { struct device_node *np; diff -uNr linux-2.4.19/arch/ppc/kernel/ptrace.c linux-2.4.19bgl/arch/ppc/kernel/ptrace.c --- linux-2.4.19/arch/ppc/kernel/ptrace.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/ptrace.c 2005-06-08 14:30:44.000000000 -0500 @@ -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.20 06/03/02 10:21:06 mporter */ /* * linux/arch/ppc/kernel/ptrace.c @@ -37,7 +37,11 @@ /* * Set of msr bits that gdb can change on behalf of a process. */ +#if defined(CONFIG_4xx) +#define MSR_DEBUGCHANGE (0) +#else #define MSR_DEBUGCHANGE (MSR_FE0 | MSR_SE | MSR_BE | MSR_FE1) +#endif /* * does not yet catch signals sent when the child dies. @@ -133,18 +137,27 @@ set_single_step(struct task_struct *task) { struct pt_regs *regs = task->thread.regs; - +#if defined(CONFIG_4xx) + regs->msr |= MSR_DE; + regs->dbcr0 |= (DBCR0_IDM | DBCR0_IC); +#else if (regs != NULL) regs->msr |= MSR_SE; +#endif + } static inline void clear_single_step(struct task_struct *task) { struct pt_regs *regs = task->thread.regs; - +#if defined(CONFIG_4xx) + regs->msr &= ~MSR_DE; + regs->dbcr0 &= ~DBCR0_IC; +#else if (regs != NULL) regs->msr &= ~MSR_SE; +#endif } /* @@ -218,7 +231,11 @@ ret = -EIO; /* convert to index and check */ index = (unsigned long) addr >> 2; +#ifdef CONFIG_DHUMMER_BGL + if ((addr & 3) || index > PT_FPR31S + 1) +#else if ((addr & 3) || index > PT_FPSCR) +#endif break; if (index < PT_FPR0) { @@ -227,6 +244,12 @@ if (child->thread.regs != NULL && child->thread.regs->msr & MSR_FP) giveup_fpu(child); +#ifdef CONFIG_DHUMMER_BGL + if (index < PT_FPR0S) + index = PT_FPR0 + ((index&~0x1) - PT_FPR0)*2 + (index&0x1); + else + index = PT_FPR0 + ((index&~0x1) - PT_FPR0S)*2 + (index&0x1) + 2; +#endif tmp = ((unsigned long *)child->thread.fpr)[index - PT_FPR0]; } ret = put_user(tmp,(unsigned long *) data); @@ -250,7 +273,11 @@ ret = -EIO; /* convert to index and check */ index = (unsigned long) addr >> 2; +#ifdef CONFIG_DHUMMER_BGL + if ((addr & 3) || index > PT_FPR31S + 1) +#else if ((addr & 3) || index > PT_FPSCR) +#endif break; if (index == PT_ORIG_R3) @@ -261,6 +288,12 @@ if (child->thread.regs != NULL && child->thread.regs->msr & MSR_FP) giveup_fpu(child); +#ifdef CONFIG_DHUMMER_BGL + if (index < PT_FPR0S) + index = PT_FPR0 + ((index&~0x1) - PT_FPR0)*2 + (index&0x1); + else + index = PT_FPR0 + ((index&~0x1) - PT_FPR0S)*2 + (index&0x1) + 2; +#endif ((unsigned long *)child->thread.fpr)[index - PT_FPR0] = data; ret = 0; } @@ -279,6 +312,12 @@ child->exit_code = data; /* make sure the single step bit is not set. */ clear_single_step(child); +#ifdef CONFIG_4xx + /* ...but traps may be set, so catch those.... + */ + child->thread.regs->msr |= MSR_DE; + child->thread.regs->dbcr0 |= (DBCR0_IDM | DBCR0_TDE); +#endif wake_up_process(child); ret = 0; break; diff -uNr linux-2.4.19/arch/ppc/kernel/qspan_pci.c linux-2.4.19bgl/arch/ppc/kernel/qspan_pci.c --- linux-2.4.19/arch/ppc/kernel/qspan_pci.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/qspan_pci.c 2003-07-02 10:44:06.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.qspan_pci.c 1.5 05/17/01 18:14:22 cort + * BK Id: SCCS/s.qspan_pci.c 1.10 03/12/02 16:07:31 paulus */ /* * QSpan pci routines. @@ -29,8 +29,7 @@ #include #include #include - -#include "pci.h" +#include /* diff -uNr linux-2.4.19/arch/ppc/kernel/semaphore.c linux-2.4.19bgl/arch/ppc/kernel/semaphore.c --- linux-2.4.19/arch/ppc/kernel/semaphore.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/semaphore.c 2003-07-02 10:44:33.000000000 -0500 @@ -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 09/21/01 03:00:34 dan */ /* * PowerPC-specific semaphore code. @@ -39,6 +39,7 @@ " srawi %1,%0,31\n" " andc %1,%0,%1\n" " add %1,%1,%4\n" + PPC405_ERR77(0,%3) " stwcx. %1,0,%3\n" " bne 1b" : "=&r" (old_count), "=&r" (tmp), "=m" (sem->count) diff -uNr linux-2.4.19/arch/ppc/kernel/setup.c linux-2.4.19bgl/arch/ppc/kernel/setup.c --- linux-2.4.19/arch/ppc/kernel/setup.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/setup.c 2003-07-02 10:43:27.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.setup.c 1.75 04/16/02 20:08:22 paulus + * BK Id: SCCS/s.setup.c 1.104 07/03/02 09:23:02 trini */ /* * Common prep/pmac/chrp boot and setup code. @@ -29,17 +29,6 @@ #include #include #include -#ifdef CONFIG_8xx -#include -#include -#endif -#ifdef CONFIG_8260 -#include -#include -#endif -#ifdef CONFIG_4xx -#include -#endif #include #include #include @@ -47,6 +36,10 @@ #include #include +#if defined CONFIG_KGDB +#include +#endif + extern void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7); extern void bootx_init(unsigned long r4, unsigned long phys); @@ -58,6 +51,10 @@ extern void xmon_map_scc(void); #endif +#ifdef CONFIG_KGDB +extern void kgdb_map_scc(void); +#endif + extern boot_infos_t *boot_infos; char saved_command_line[512]; extern char cmd_line[512]; @@ -68,9 +65,7 @@ /* Used with the BI_MEMSIZE bootinfo parameter to store the memory size value reported by the boot loader. */ -unsigned int boot_mem_size; - -int parse_bootinfo(void); +unsigned long boot_mem_size; unsigned long ISA_DMA_THRESHOLD; unsigned long DMA_MODE_READ, DMA_MODE_WRITE; @@ -104,7 +99,8 @@ int icache_bsize; int ucache_bsize; -#ifdef CONFIG_VGA_CONSOLE +#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_FB_VGA16) || \ + defined(CONFIG_FB_VGA16_MODULE) || defined(CONFIG_FB_VESA) struct screen_info screen_info = { 0, 25, /* orig-x, orig-y */ 0, /* unused */ @@ -116,7 +112,7 @@ 1, /* orig-video-isVGA */ 16 /* orig-video-points */ }; -#endif /* CONFIG_VGA_CONSOLE */ +#endif /* CONFIG_VGA_CONSOLE || CONFIG_FB_VGA16 || CONFIG_FB_VESA */ void machine_restart(char *cmd) { @@ -350,6 +346,8 @@ } #endif + parse_bootinfo(find_bootinfo()); + /* if we didn't get any bootinfo telling us what we are... */ if (_machine == 0) { /* prep boot loader tells us if we're prep or not */ @@ -427,6 +425,12 @@ } } cmd_line[sizeof(cmd_line) - 1] = 0; +#ifdef CONFIG_ADB + if (strstr(cmd_line, "adb_sync")) { + extern int __adb_probe_sync; + __adb_probe_sync = 1; + } +#endif /* CONFIG_ADB */ switch (_machine) { case _MACH_Pmac: @@ -439,7 +443,7 @@ } #endif /* CONFIG_ALL_PPC */ -int parse_bootinfo(void) +struct bi_record *find_bootinfo(void) { struct bi_record *rec; extern char __bss_start[]; @@ -453,11 +457,16 @@ */ rec = (struct bi_record *)_ALIGN((ulong)__bss_start+0x10000+(1<<20)-1,(1<<20)); if ( rec->tag != BI_FIRST ) - return -1; + return NULL; } - for ( ; rec->tag != BI_LAST ; - rec = (struct bi_record *)((ulong)rec + rec->size) ) - { + return rec; +} + +void parse_bootinfo(struct bi_record *rec) +{ + if (rec == NULL || rec->tag != BI_FIRST) + return; + while (rec->tag != BI_LAST) { ulong *data = rec->data; switch (rec->tag) { case BI_CMD_LINE: @@ -483,9 +492,8 @@ boot_mem_size = data[0]; break; } + rec = (struct bi_record *)((ulong)rec + rec->size); } - - return 0; } /* @@ -502,8 +510,6 @@ strcpy(cmd_line, CONFIG_CMDLINE); #endif /* CONFIG_CMDLINE */ - parse_bootinfo(); - platform_init(r3, r4, r5, r6, r7); if (ppc_md.progress) @@ -568,7 +574,12 @@ #if defined(CONFIG_KGDB) kgdb_map_scc(); set_debug_traps(); - breakpoint(); + if (strstr(cmd_line, "nokgdb")) + printk("kgdb default breakpoint deactivated on command line\n"); + else { + printk("kgdb default breakpoint activated\n"); + breakpoint(); + } #endif /* @@ -603,24 +614,6 @@ ppc_md.setup_arch(); if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab); -#if defined(CONFIG_PCI) && defined(CONFIG_ALL_PPC) - /* We create the "pci-OF-bus-map" property now so it appear in the - * /proc device tree - */ - if (have_of) { - 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_PCI && CONFIG_ALL_PPC */ - paging_init(); sort_exception_table(); @@ -628,6 +621,7 @@ ppc_md.ppc_machine = _machine; } +#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) /* Convert the shorts/longs in hd_driveid from little to big endian; * chars are endian independant, of course, but strings need to be flipped. * (Despite what it says in drivers/block/ide.h, they come up as little @@ -722,3 +716,4 @@ id->words206_254[i] = __le16_to_cpu(id->words206_254[i]); id->integrity_word = __le16_to_cpu(id->integrity_word); } +#endif diff -uNr linux-2.4.19/arch/ppc/kernel/signal.c linux-2.4.19bgl/arch/ppc/kernel/signal.c --- linux-2.4.19/arch/ppc/kernel/signal.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/signal.c 2005-06-08 14:30:44.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.signal.c 1.10 11/23/01 16:38:30 paulus + * BK Id: SCCS/s.signal.c 1.14 03/12/02 16:07:32 paulus */ /* * linux/arch/ppc/kernel/signal.c @@ -108,7 +108,9 @@ recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); - regs->gpr[3] = -EINTR; + regs->result = -EINTR; + regs->gpr[3] = EINTR; + regs->ccr |= 0x10000000; while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); @@ -145,7 +147,9 @@ recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); - regs->gpr[3] = -EINTR; + regs->result = -EINTR; + regs->gpr[3] = EINTR; + regs->ccr |= 0x10000000; while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); @@ -494,7 +498,7 @@ || __put_user(&rt_sf->info, &rt_sf->pinfo) || __put_user(&rt_sf->uc, &rt_sf->puc) /* Put the siginfo */ - || __copy_to_user(&rt_sf->info, info, sizeof(*info)) + || copy_siginfo_to_user(&rt_sf->info, info) /* Create the ucontext */ || __put_user(0, &rt_sf->uc.uc_flags) || __put_user(0, &rt_sf->uc.uc_link) @@ -621,7 +625,7 @@ continue; switch (signr) { - case SIGCONT: case SIGCHLD: case SIGWINCH: + case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG: continue; case SIGTSTP: case SIGTTIN: case SIGTTOU: diff -uNr linux-2.4.19/arch/ppc/kernel/smp.c linux-2.4.19bgl/arch/ppc/kernel/smp.c --- linux-2.4.19/arch/ppc/kernel/smp.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/smp.c 2003-07-02 10:44:30.000000000 -0500 @@ -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.50 04/16/02 12:02:07 hozer */ /* * Smp support for ppc. @@ -66,6 +66,10 @@ extern int cpu_idle(void *unused); void smp_call_function_interrupt(void); +#ifdef CONFIG_PPC_ISERIES +extern void smp_iSeries_space_timers( unsigned nr ); +#endif + /* 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 @@ -336,6 +340,9 @@ */ if (cpu_nr > max_cpus) cpu_nr = max_cpus; +#ifdef CONFIG_PPC_ISERIES + smp_iSeries_space_timers( cpu_nr ); +#endif for (i = 1; i < cpu_nr; i++) { int c; struct pt_regs regs; diff -uNr linux-2.4.19/arch/ppc/kernel/softemu8xx.c linux-2.4.19bgl/arch/ppc/kernel/softemu8xx.c --- linux-2.4.19/arch/ppc/kernel/softemu8xx.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/softemu8xx.c 2003-07-02 10:44:17.000000000 -0500 @@ -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.11 11/10/01 15:35:07 trini */ /* * Software emulation of some PPC instructions for the 8xx core. @@ -35,6 +35,11 @@ #include #include +extern void +print_8xx_pte(struct mm_struct *mm, unsigned long addr); +extern int +get_8xx_pte(struct mm_struct *mm, unsigned long addr); + /* Eventually we may need a look-up table, but this works for now. */ #define LFS 48 @@ -117,7 +122,7 @@ default: retval = 1; printk("Bad emulation %s/%d\n" - " NIP: %08x instruction: %08x opcode: %x " + " NIP: %08lx instruction: %08x opcode: %x " "A: %x B: %x C: %x code: %x rc: %x\n", current->comm,current->pid, regs->nip, diff -uNr linux-2.4.19/arch/ppc/kernel/syscalls.c linux-2.4.19bgl/arch/ppc/kernel/syscalls.c --- linux-2.4.19/arch/ppc/kernel/syscalls.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/syscalls.c 2003-07-02 10:44:17.000000000 -0500 @@ -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.16 06/13/02 15:36:56 dgibson */ /* * linux/arch/ppc/kernel/sys_ppc.c @@ -188,6 +188,16 @@ return error; } +#ifndef CONFIG_40x +#define allow_mmap_address(addr) 1 +#else +/* Blech. On 40x allowing mmap() (MAP_FIXED) at the first few pages + * of (any process's) virtual memory is a security hole due to chip + * erratum #67 (and possibly also due to the (documented) bizarre + * prefetch behaviour around 'sc' see S3.8.2.1 of the user manual). */ +#define allow_mmap_address(addr) ((((addr) & PAGE_MASK) >= 0x2100) || suser()) +#endif + static inline unsigned long do_mmap2(unsigned long addr, size_t len, unsigned long prot, unsigned long flags, @@ -201,6 +211,10 @@ if (!(file = fget(fd))) goto out; } + + ret = -EINVAL; + if ((! allow_mmap_address(addr)) && (flags & MAP_FIXED)) + goto out; down_write(¤t->mm->mmap_sem); ret = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); diff -uNr linux-2.4.19/arch/ppc/kernel/time.c linux-2.4.19bgl/arch/ppc/kernel/time.c --- linux-2.4.19/arch/ppc/kernel/time.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/kernel/time.c 2003-07-02 10:43:07.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.time.c 1.29 12/11/01 11:40:45 trini + * BK Id: SCCS/s.time.c 1.42 04/05/02 11:39:36 trini */ /* * Common time routines among all ppc machines. @@ -87,6 +87,11 @@ extern unsigned long wall_jiffies; +#ifdef CONFIG_PPC_ISERIES +extern u64 get_tb64(void); +extern u64 next_jiffy_update_tb[]; +#endif + static long time_offset; spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; @@ -106,6 +111,8 @@ return delta; } +#ifndef CONFIG_PPC_ISERIES /* iSeries version is in iSeries_time.c */ + extern unsigned long prof_cpu_mask; extern unsigned int * prof_buffer; extern unsigned long prof_len; @@ -181,7 +188,7 @@ * We should have an rtc call that only sets the minutes and * seconds like on Intel to avoid problems with non UTC clocks. */ - if ( (time_status & STA_UNSYNC) == 0 && + if ( ppc_md.set_rtc_time && (time_status & STA_UNSYNC) == 0 && xtime.tv_sec - last_rtc_update >= 659 && abs(xtime.tv_usec - (1000000-1000000/HZ)) < 500000/HZ && jiffies - wall_jiffies == 1) { @@ -211,6 +218,7 @@ return 1; /* lets ret_from_int know we can do checks */ } +#endif /* CONFIG_PPC_ISERIES */ /* * This version of gettimeofday has microsecond resolution. @@ -223,7 +231,11 @@ read_lock_irqsave(&xtime_lock, flags); sec = xtime.tv_sec; usec = xtime.tv_usec; +#ifdef CONFIG_PPC_ISERIES + delta = tb_ticks_per_jiffy - ( next_jiffy_update_tb[0] - get_tb64() ); +#else delta = tb_ticks_since(tb_last_stamp); +#endif #ifdef CONFIG_SMP /* As long as timebases are not in sync, gettimeofday can only * have jiffy resolution on SMP. diff -uNr linux-2.4.19/arch/ppc/kernel/traps.c linux-2.4.19bgl/arch/ppc/kernel/traps.c --- linux-2.4.19/arch/ppc/kernel/traps.c 2001-11-02 19:43:54.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/kernel/traps.c 2005-06-08 14:30:44.000000000 -0500 @@ -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.38 06/03/02 10:21:06 mporter */ /* * 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); @@ -66,6 +69,13 @@ int (*debugger_iabr_match)(struct pt_regs *regs); int (*debugger_dabr_match)(struct pt_regs *regs); void (*debugger_fault_handler)(struct pt_regs *regs); +#else +#define debugger(regs) do { } while (0) +#define debugger_bpt(regs) 0 +#define debugger_sstep(regs) 0 +#define debugger_iabr_match(regs) 0 +#define debugger_dabr_match(regs) 0 +#define debugger_fault_handler ((void (*)(struct pt_regs *))0) #endif #endif @@ -74,15 +84,28 @@ */ -spinlock_t oops_lock = SPIN_LOCK_UNLOCKED; +spinlock_t die_lock = SPIN_LOCK_UNLOCKED; 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); + spin_lock_irq(&die_lock); +#ifdef CONFIG_BOOTX_TEXT + force_printk_to_btext = 1; +#endif +#ifdef CONFIG_PMAC_BACKLIGHT + set_backlight_enable(1); + set_backlight_level(BACKLIGHT_MAX); +#endif printk("Oops: %s, sig: %ld\n", str, err); show_regs(fp); - spin_unlock_irq(&oops_lock); +#ifdef CONFIG_BOOTX_TEXT + force_printk_to_btext = 0; +#endif + spin_unlock_irq(&die_lock); /* do_exit() should take care of panic'ing from an interrupt * context so we don't handle it here */ @@ -94,9 +117,7 @@ { if (!user_mode(regs)) { -#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) debugger(regs); -#endif die("Exception in kernel mode", regs, signr); } force_sig(signr, current); @@ -108,10 +129,13 @@ #ifdef CONFIG_ALL_PPC unsigned long fixup; #endif /* CONFIG_ALL_PPC */ - unsigned long msr = regs->msr; + unsigned long reason; +#if defined(CONFIG_BGL) + BGL_machine_check(regs); +#endif if (user_mode(regs)) { - _exception(SIGSEGV, regs); + _exception(SIGSEGV, regs); return; } @@ -120,13 +144,24 @@ bad_page_fault(regs, regs->dar, SIGBUS); return; #endif -#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) if (debugger_fault_handler) { debugger_fault_handler(regs); return; } -#endif +#if defined(CONFIG_4xx) + /* On 4xx, the reason for the machine check is in the ESR. */ + reason = mfspr(SPRN_ESR); + if (reason & ESR_IMCP) { + printk("Instruction"); + mtspr(SPRN_ESR, reason & ~ESR_IMCP); + } else + printk("Data"); + printk(" machine check in kernel mode.\n"); + +#else /* CONFIG_4xx */ + /* On non-4xx, the reason for the machine check is in the MSR. */ + reason = regs->msr; #ifdef CONFIG_ALL_PPC /* * I/O accesses can cause machine checks on powermacs. @@ -135,10 +170,10 @@ * table. * Note that the 601 only takes a machine check on TEA * (transfer error ack) signal assertion, and does not - * set of the top 16 bits of SRR1. + * set any of the top 16 bits of SRR1. * -- paulus. */ - if (((msr & 0xffff0000) == 0 || (msr & (0x80000 | 0x40000))) + if (((reason & 0xffff0000) == 0 || (reason & (0x80000 | 0x40000))) && (fixup = search_exception_table(regs->nip)) != 0) { /* * Check that it's a sync instruction, or somewhere @@ -168,13 +203,14 @@ } #endif /* CONFIG_ALL_PPC */ printk("Machine check in kernel mode.\n"); - printk("Caused by (from SRR1=%lx): ", msr); - switch (msr & 0xF0000) { + printk("Caused by (from SRR1=%lx): ", reason); + switch (reason & 0x601F0000) { case 0x80000: printk("Machine check signal\n"); break; case 0: /* for 601 */ case 0x40000: + case 0x140000: /* 7450 MSS error and TEA */ printk("Transfer error ack signal\n"); break; case 0x20000: @@ -183,26 +219,31 @@ case 0x10000: printk("Address parity error signal\n"); break; + case 0x20000000: + printk("L1 Data Cache error\n"); + break; + case 0x40000000: + printk("L1 Instruction Cache error\n"); + break; + case 0x00100000: + printk("L2 data cache parity error\n"); + break; default: printk("Unknown values in msr\n"); } -#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) +#endif /* !CONFIG_4xx */ debugger(regs); -#endif die("machine check", regs, SIGBUS); } void SMIException(struct pt_regs *regs) { -#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) - { - debugger(regs); - return; - } -#endif + debugger(regs); +#if !(defined(CONFIG_XMON) || defined(CONFIG_KGDB)) show_regs(regs); panic("System Management Interrupt"); +#endif } void @@ -210,23 +251,21 @@ { printk("Bad trap at PC: %lx, SR: %lx, vector=%lx %s\n", regs->nip, regs->msr, regs->trap, print_tainted()); - _exception(SIGTRAP, regs); + _exception(SIGTRAP, regs); } void InstructionBreakpoint(struct pt_regs *regs) { -#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) if (debugger_iabr_match(regs)) return; -#endif _exception(SIGTRAP, regs); } void RunModeException(struct pt_regs *regs) { - _exception(SIGTRAP, regs); + _exception(SIGTRAP, regs); } /* Illegal instruction emulation support. Originally written to @@ -272,51 +311,54 @@ void ProgramCheckException(struct pt_regs *regs) { + int errcode; + #if defined(CONFIG_4xx) unsigned int esr = mfspr(SPRN_ESR); + int isbpt = esr & ESR_PTR; + extern int do_mathemu(struct pt_regs *regs); + + if (isbpt) + mtspr(SPRN_DBSR, DBSR_TIE); +#ifdef CONFIG_MATH_EMULATION + if (!isbpt && do_mathemu(regs) == 0) + return; +#endif /* CONFIG_MATH_EMULATION */ + +#else /* ! CONFIG_4xx */ + int isbpt = regs->msr & 0x20000; - if (esr & ESR_PTR) { -#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) - if (debugger_bpt(regs)) - return; -#endif - _exception(SIGTRAP, regs); - } else { - _exception(SIGILL, regs); - } -#else if (regs->msr & 0x100000) { /* IEEE FP exception */ _exception(SIGFPE, regs); - } else if (regs->msr & 0x20000) { + return; + } +#endif /* ! CONFIG_4xx */ + + if (isbpt) { /* trap exception */ -#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) if (debugger_bpt(regs)) return; -#endif _exception(SIGTRAP, regs); - } else { - /* Try to emulate it if we should. */ - int errcode; - if ((errcode = emulate_instruction(regs))) { - if (errcode == -EFAULT) - _exception(SIGBUS, regs); - else - _exception(SIGILL, regs); - } + return; + } + + /* Try to emulate it if we should. */ + if ((errcode = emulate_instruction(regs))) { + if (errcode == -EFAULT) + _exception(SIGBUS, regs); + else + _exception(SIGILL, regs); } -#endif } void SingleStepException(struct pt_regs *regs) { regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */ -#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) if (debugger_sstep(regs)) return; -#endif - _exception(SIGTRAP, regs); + _exception(SIGTRAP, regs); } void @@ -337,7 +379,7 @@ bad_page_fault(regs, regs->dar, SIGSEGV); return; } - _exception(SIGBUS, regs); + _exception(SIGBUS, regs); } void @@ -345,9 +387,7 @@ { printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n", current, regs->gpr[1]); -#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) debugger(regs); -#endif show_regs(regs); panic("kernel stack overflow"); } @@ -365,20 +405,20 @@ SoftwareEmulation(struct pt_regs *regs) { extern int do_mathemu(struct pt_regs *); + extern int Soft_emulate_8xx(struct pt_regs *); int errcode; if (!user_mode(regs)) { -#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) debugger(regs); -#endif die("Kernel Mode Software FPU Emulation", regs, SIGFPE); } #ifdef CONFIG_MATH_EMULATION - if ((errcode = do_mathemu(regs))) { + errcode = do_mathemu(regs); #else - if ((errcode = Soft_emulate_8xx(regs))) { + errcode = Soft_emulate_8xx(regs); #endif + if (errcode) { if (errcode > 0) _exception(SIGFPE, regs); else if (errcode == -EFAULT) @@ -387,7 +427,36 @@ _exception(SIGILL, regs); } } -#endif +#endif /* CONFIG_8xx */ + +#if defined(CONFIG_4xx) + +void DebugException(struct pt_regs *regs) +{ + unsigned long debug_status; + + debug_status = mfspr(SPRN_DBSR); + + regs->msr &= ~MSR_DE; /* Turn off 'debug' bit */ + if (debug_status & DBSR_TIE) { /* trap instruction*/ + + mtspr(SPRN_DBSR, DBSR_TIE); + + if (!user_mode(regs) && debugger_bpt(regs)) + return; + _exception(SIGTRAP, regs); + + } else if (debug_status & DBSR_IC) { /* instruction completion */ + + mtspr(SPRN_DBSR, DBSR_IC); + regs->dbcr0 &= ~DBCR0_IC; + + if (!user_mode(regs) && debugger_sstep(regs)) + return; + _exception(SIGTRAP, regs); + } +} +#endif /* CONFIG_4xx */ #if !defined(CONFIG_TAU_INT) void diff -uNr linux-2.4.19/arch/ppc/lib/Makefile linux-2.4.19bgl/arch/ppc/lib/Makefile --- linux-2.4.19/arch/ppc/lib/Makefile 2001-11-16 12:10:08.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/lib/Makefile 2003-07-02 10:43:44.000000000 -0500 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.10 11/08/01 07:57:40 paulus +# BK Id: SCCS/s.Makefile 1.11 11/18/01 16:35:08 paulus # # # Makefile for ppc-specific library files.. diff -uNr linux-2.4.19/arch/ppc/lib/checksum.S linux-2.4.19bgl/arch/ppc/lib/checksum.S --- linux-2.4.19/arch/ppc/lib/checksum.S 2001-08-28 08:58:33.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/lib/checksum.S 2003-07-02 10:43:57.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.checksum.S 1.8 08/20/01 22:09:34 paulus + * BK Id: SCCS/s.checksum.S 1.10 11/08/01 09:41:38 paulus */ /* * This file contains assembly-language implementations @@ -18,7 +18,7 @@ #include #include #include -#include "../kernel/ppc_asm.tmpl" +#include .text diff -uNr linux-2.4.19/arch/ppc/lib/locks.c linux-2.4.19bgl/arch/ppc/lib/locks.c --- linux-2.4.19/arch/ppc/lib/locks.c 2001-08-28 08:58:33.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/lib/locks.c 2003-07-02 10:43:05.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.locks.c 1.11 08/19/01 22:27:32 paulus + * BK Id: SCCS/s.locks.c 1.15 09/21/01 03:00:34 dan */ /* * Locks for smp ppc @@ -35,8 +35,9 @@ __asm__ __volatile__ ("\n\ 1: lwarx %0,0,%1\n\ cmpwi 0,%0,0\n\ - bne 2f\n\ - stwcx. %2,0,%1\n\ + bne 2f\n" + PPC405_ERR77(0,%1) +" stwcx. %2,0,%1\n\ bne- 1b\n\ isync\n\ 2:" diff -uNr linux-2.4.19/arch/ppc/lib/strcase.c linux-2.4.19bgl/arch/ppc/lib/strcase.c --- linux-2.4.19/arch/ppc/lib/strcase.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/lib/strcase.c 2003-07-02 10:43:56.000000000 -0500 @@ -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.19/arch/ppc/lib/string.S linux-2.4.19bgl/arch/ppc/lib/string.S --- linux-2.4.19/arch/ppc/lib/string.S 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/lib/string.S 2003-07-02 10:43:56.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.string.S 1.11 05/21/02 21:44:32 paulus + * BK Id: SCCS/s.string.S 1.18 06/04/02 20:53:12 paulus */ /* * String handling functions for PowerPC. @@ -11,11 +11,11 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ -#include "../kernel/ppc_asm.tmpl" #include #include #include #include +#include #define COPY_16_BYTES \ lwz r7,4(r4); \ @@ -65,13 +65,14 @@ .text .text + .stabs "arch/ppc/lib/",N_SO,0,0,0f + .stabs "string.S",N_SO,0,0,0f CACHELINE_BYTES = L1_CACHE_LINE_SIZE LG_CACHELINE_BYTES = LG_L1_CACHE_LINE_SIZE CACHELINE_MASK = (L1_CACHE_LINE_SIZE-1) - .globl strcpy -strcpy: +_GLOBAL(strcpy) addi r5,r3,-1 addi r4,r4,-1 1: lbzu r0,1(r4) @@ -80,8 +81,7 @@ bne 1b blr - .globl strncpy -strncpy: +_GLOBAL(strncpy) cmpwi 0,r5,0 beqlr mtctr r5 @@ -93,8 +93,7 @@ bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */ blr - .globl strcat -strcat: +_GLOBAL(strcat) addi r5,r3,-1 addi r4,r4,-1 1: lbzu r0,1(r5) @@ -107,8 +106,7 @@ bne 1b blr - .globl strcmp -strcmp: +_GLOBAL(strcmp) addi r5,r3,-1 addi r4,r4,-1 1: lbzu r3,1(r5) @@ -119,8 +117,7 @@ beq 1b blr - .globl strlen -strlen: +_GLOBAL(strlen) addi r4,r3,-1 1: lbzu r0,1(r4) cmpwi 0,r0,0 @@ -133,8 +130,7 @@ * to set them to zero. This requires that the destination * area is cacheable. -- paulus */ - .globl cacheable_memzero -cacheable_memzero: +_GLOBAL(cacheable_memzero) mr r5,r4 li r4,0 addi r6,r3,-4 @@ -184,8 +180,7 @@ bdnz 8b blr - .globl memset -memset: +_GLOBAL(memset) rlwimi r4,r4,8,16,23 rlwimi r4,r4,16,0,15 addi r6,r3,-4 @@ -210,8 +205,7 @@ bdnz 8b blr - .globl bcopy -bcopy: +_GLOBAL(bcopy) mr r6,r3 mr r3,r4 mr r4,r6 @@ -224,8 +218,7 @@ * We only use this version if the source and dest don't overlap. * -- paulus. */ - .global cacheable_memcpy -cacheable_memcpy: +_GLOBAL(cacheable_memcpy) add r7,r3,r5 /* test if the src & dst overlap */ add r8,r4,r5 cmplw 0,r4,r7 @@ -299,14 +292,12 @@ bdnz 40b 65: blr - .globl memmove -memmove: +_GLOBAL(memmove) cmplw 0,r3,r4 bgt backwards_memcpy /* fall through */ - .globl memcpy -memcpy: +_GLOBAL(memcpy) srwi. r7,r5,3 addi r6,r3,-4 addi r4,r4,-4 @@ -347,8 +338,7 @@ mtctr r7 b 1b - .globl backwards_memcpy -backwards_memcpy: +_GLOBAL(backwards_memcpy) rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */ add r6,r3,r5 add r4,r4,r5 @@ -383,9 +373,8 @@ beq 2b mtctr r7 b 1b - - .globl memcmp -memcmp: + +_GLOBAL(memcmp) cmpwi 0,r5,0 ble- 2f mtctr r5 @@ -399,8 +388,7 @@ 2: li r3,0 blr - .global memchr -memchr: +_GLOBAL(memchr) cmpwi 0,r5,0 ble- 2f mtctr r5 @@ -412,8 +400,7 @@ 2: li r3,0 blr - .globl __copy_tofrom_user -__copy_tofrom_user: +_GLOBAL(__copy_tofrom_user) addi r4,r4,-4 addi r6,r3,-4 neg r0,r3 @@ -445,23 +432,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 @@ -608,8 +595,7 @@ .long 114b,120b .text - .globl __clear_user -__clear_user: +_GLOBAL(__clear_user) addi r6,r3,-4 li r3,0 li r5,0 @@ -652,8 +638,7 @@ .long 8b,92b .text - .globl __strncpy_from_user -__strncpy_from_user: +_GLOBAL(__strncpy_from_user) addi r6,r3,-1 addi r4,r4,-1 cmpwi 0,r5,0 @@ -676,8 +661,7 @@ .text /* r3 = str, r4 = len (> 0), r5 = top (highest addr) */ - .globl __strnlen_user -__strnlen_user: +_GLOBAL(__strnlen_user) addi r7,r3,-1 subf r6,r7,r5 /* top+1 - str */ cmplw 0,r4,r6 diff -uNr linux-2.4.19/arch/ppc/math-emu/Makefile linux-2.4.19bgl/arch/ppc/math-emu/Makefile --- linux-2.4.19/arch/ppc/math-emu/Makefile 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/Makefile 2003-07-02 10:44:30.000000000 -0500 @@ -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.19/arch/ppc/math-emu/double.h linux-2.4.19bgl/arch/ppc/math-emu/double.h --- linux-2.4.19/arch/ppc/math-emu/double.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/double.h 2003-07-02 10:44:08.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fabs.c linux-2.4.19bgl/arch/ppc/math-emu/fabs.c --- linux-2.4.19/arch/ppc/math-emu/fabs.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fabs.c 2003-07-02 10:44:16.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fadd.c linux-2.4.19bgl/arch/ppc/math-emu/fadd.c --- linux-2.4.19/arch/ppc/math-emu/fadd.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fadd.c 2003-07-02 10:44:16.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fadds.c linux-2.4.19bgl/arch/ppc/math-emu/fadds.c --- linux-2.4.19/arch/ppc/math-emu/fadds.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fadds.c 2003-07-02 10:44:31.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fcmpo.c linux-2.4.19bgl/arch/ppc/math-emu/fcmpo.c --- linux-2.4.19/arch/ppc/math-emu/fcmpo.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fcmpo.c 2003-07-02 10:43:18.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fcmpu.c linux-2.4.19bgl/arch/ppc/math-emu/fcmpu.c --- linux-2.4.19/arch/ppc/math-emu/fcmpu.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fcmpu.c 2003-07-02 10:43:28.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fctiw.c linux-2.4.19bgl/arch/ppc/math-emu/fctiw.c --- linux-2.4.19/arch/ppc/math-emu/fctiw.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fctiw.c 2003-07-02 10:43:55.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fctiwz.c linux-2.4.19bgl/arch/ppc/math-emu/fctiwz.c --- linux-2.4.19/arch/ppc/math-emu/fctiwz.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fctiwz.c 2003-07-02 10:44:16.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fdiv.c linux-2.4.19bgl/arch/ppc/math-emu/fdiv.c --- linux-2.4.19/arch/ppc/math-emu/fdiv.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fdiv.c 2003-07-02 10:43:49.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fdivs.c linux-2.4.19bgl/arch/ppc/math-emu/fdivs.c --- linux-2.4.19/arch/ppc/math-emu/fdivs.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fdivs.c 2003-07-02 10:43:52.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fmadd.c linux-2.4.19bgl/arch/ppc/math-emu/fmadd.c --- linux-2.4.19/arch/ppc/math-emu/fmadd.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fmadd.c 2003-07-02 10:43:52.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fmadds.c linux-2.4.19bgl/arch/ppc/math-emu/fmadds.c --- linux-2.4.19/arch/ppc/math-emu/fmadds.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fmadds.c 2003-07-02 10:44:40.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fmr.c linux-2.4.19bgl/arch/ppc/math-emu/fmr.c --- linux-2.4.19/arch/ppc/math-emu/fmr.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fmr.c 2003-07-02 10:44:02.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fmsub.c linux-2.4.19bgl/arch/ppc/math-emu/fmsub.c --- linux-2.4.19/arch/ppc/math-emu/fmsub.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fmsub.c 2003-07-02 10:43:13.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fmsubs.c linux-2.4.19bgl/arch/ppc/math-emu/fmsubs.c --- linux-2.4.19/arch/ppc/math-emu/fmsubs.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fmsubs.c 2003-07-02 10:44:38.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fmul.c linux-2.4.19bgl/arch/ppc/math-emu/fmul.c --- linux-2.4.19/arch/ppc/math-emu/fmul.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fmul.c 2003-07-02 10:44:32.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fmuls.c linux-2.4.19bgl/arch/ppc/math-emu/fmuls.c --- linux-2.4.19/arch/ppc/math-emu/fmuls.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fmuls.c 2003-07-02 10:43:32.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fnabs.c linux-2.4.19bgl/arch/ppc/math-emu/fnabs.c --- linux-2.4.19/arch/ppc/math-emu/fnabs.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fnabs.c 2003-07-02 10:43:58.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fneg.c linux-2.4.19bgl/arch/ppc/math-emu/fneg.c --- linux-2.4.19/arch/ppc/math-emu/fneg.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fneg.c 2003-07-02 10:43:06.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fnmadd.c linux-2.4.19bgl/arch/ppc/math-emu/fnmadd.c --- linux-2.4.19/arch/ppc/math-emu/fnmadd.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fnmadd.c 2003-07-02 10:44:29.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fnmadds.c linux-2.4.19bgl/arch/ppc/math-emu/fnmadds.c --- linux-2.4.19/arch/ppc/math-emu/fnmadds.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fnmadds.c 2003-07-02 10:43:48.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fnmsub.c linux-2.4.19bgl/arch/ppc/math-emu/fnmsub.c --- linux-2.4.19/arch/ppc/math-emu/fnmsub.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fnmsub.c 2003-07-02 10:44:18.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fnmsubs.c linux-2.4.19bgl/arch/ppc/math-emu/fnmsubs.c --- linux-2.4.19/arch/ppc/math-emu/fnmsubs.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fnmsubs.c 2003-07-02 10:44:08.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fres.c linux-2.4.19bgl/arch/ppc/math-emu/fres.c --- linux-2.4.19/arch/ppc/math-emu/fres.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fres.c 2003-07-02 10:44:37.000000000 -0500 @@ -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.19/arch/ppc/math-emu/frsp.c linux-2.4.19bgl/arch/ppc/math-emu/frsp.c --- linux-2.4.19/arch/ppc/math-emu/frsp.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/frsp.c 2003-07-02 10:43:33.000000000 -0500 @@ -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.19/arch/ppc/math-emu/frsqrte.c linux-2.4.19bgl/arch/ppc/math-emu/frsqrte.c --- linux-2.4.19/arch/ppc/math-emu/frsqrte.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/frsqrte.c 2003-07-02 10:44:06.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fsel.c linux-2.4.19bgl/arch/ppc/math-emu/fsel.c --- linux-2.4.19/arch/ppc/math-emu/fsel.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fsel.c 2003-07-02 10:44:07.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fsqrt.c linux-2.4.19bgl/arch/ppc/math-emu/fsqrt.c --- linux-2.4.19/arch/ppc/math-emu/fsqrt.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fsqrt.c 2003-07-02 10:43:05.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fsqrts.c linux-2.4.19bgl/arch/ppc/math-emu/fsqrts.c --- linux-2.4.19/arch/ppc/math-emu/fsqrts.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fsqrts.c 2003-07-02 10:43:57.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fsub.c linux-2.4.19bgl/arch/ppc/math-emu/fsub.c --- linux-2.4.19/arch/ppc/math-emu/fsub.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fsub.c 2003-07-02 10:44:01.000000000 -0500 @@ -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.19/arch/ppc/math-emu/fsubs.c linux-2.4.19bgl/arch/ppc/math-emu/fsubs.c --- linux-2.4.19/arch/ppc/math-emu/fsubs.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/fsubs.c 2003-07-02 10:43:28.000000000 -0500 @@ -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.19/arch/ppc/math-emu/lfd.c linux-2.4.19bgl/arch/ppc/math-emu/lfd.c --- linux-2.4.19/arch/ppc/math-emu/lfd.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/lfd.c 2003-07-02 10:44:32.000000000 -0500 @@ -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.19/arch/ppc/math-emu/lfs.c linux-2.4.19bgl/arch/ppc/math-emu/lfs.c --- linux-2.4.19/arch/ppc/math-emu/lfs.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/lfs.c 2003-07-02 10:44:42.000000000 -0500 @@ -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.19/arch/ppc/math-emu/math.c linux-2.4.19bgl/arch/ppc/math-emu/math.c --- linux-2.4.19/arch/ppc/math-emu/math.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/math.c 2003-07-02 10:43:48.000000000 -0500 @@ -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.19/arch/ppc/math-emu/mcrfs.c linux-2.4.19bgl/arch/ppc/math-emu/mcrfs.c --- linux-2.4.19/arch/ppc/math-emu/mcrfs.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/mcrfs.c 2003-07-02 10:43:14.000000000 -0500 @@ -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.19/arch/ppc/math-emu/mffs.c linux-2.4.19bgl/arch/ppc/math-emu/mffs.c --- linux-2.4.19/arch/ppc/math-emu/mffs.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/mffs.c 2003-07-02 10:43:47.000000000 -0500 @@ -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.19/arch/ppc/math-emu/mtfsb0.c linux-2.4.19bgl/arch/ppc/math-emu/mtfsb0.c --- linux-2.4.19/arch/ppc/math-emu/mtfsb0.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/mtfsb0.c 2003-07-02 10:43:56.000000000 -0500 @@ -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.19/arch/ppc/math-emu/mtfsb1.c linux-2.4.19bgl/arch/ppc/math-emu/mtfsb1.c --- linux-2.4.19/arch/ppc/math-emu/mtfsb1.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/mtfsb1.c 2003-07-02 10:43:15.000000000 -0500 @@ -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.19/arch/ppc/math-emu/mtfsf.c linux-2.4.19bgl/arch/ppc/math-emu/mtfsf.c --- linux-2.4.19/arch/ppc/math-emu/mtfsf.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/mtfsf.c 2003-07-02 10:44:18.000000000 -0500 @@ -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.19/arch/ppc/math-emu/mtfsfi.c linux-2.4.19bgl/arch/ppc/math-emu/mtfsfi.c --- linux-2.4.19/arch/ppc/math-emu/mtfsfi.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/mtfsfi.c 2003-07-02 10:43:45.000000000 -0500 @@ -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.19/arch/ppc/math-emu/op-1.h linux-2.4.19bgl/arch/ppc/math-emu/op-1.h --- linux-2.4.19/arch/ppc/math-emu/op-1.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/op-1.h 2003-07-02 10:43:52.000000000 -0500 @@ -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.19/arch/ppc/math-emu/op-2.h linux-2.4.19bgl/arch/ppc/math-emu/op-2.h --- linux-2.4.19/arch/ppc/math-emu/op-2.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/op-2.h 2003-07-02 10:44:43.000000000 -0500 @@ -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.19/arch/ppc/math-emu/op-4.h linux-2.4.19bgl/arch/ppc/math-emu/op-4.h --- linux-2.4.19/arch/ppc/math-emu/op-4.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/op-4.h 2003-07-02 10:44:13.000000000 -0500 @@ -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.19/arch/ppc/math-emu/op-common.h linux-2.4.19bgl/arch/ppc/math-emu/op-common.h --- linux-2.4.19/arch/ppc/math-emu/op-common.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/op-common.h 2003-07-02 10:43:44.000000000 -0500 @@ -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.19/arch/ppc/math-emu/sfp-machine.h linux-2.4.19bgl/arch/ppc/math-emu/sfp-machine.h --- linux-2.4.19/arch/ppc/math-emu/sfp-machine.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/sfp-machine.h 2003-07-02 10:44:38.000000000 -0500 @@ -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.19/arch/ppc/math-emu/single.h linux-2.4.19bgl/arch/ppc/math-emu/single.h --- linux-2.4.19/arch/ppc/math-emu/single.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/single.h 2003-07-02 10:44:01.000000000 -0500 @@ -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.19/arch/ppc/math-emu/soft-fp.h linux-2.4.19bgl/arch/ppc/math-emu/soft-fp.h --- linux-2.4.19/arch/ppc/math-emu/soft-fp.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/soft-fp.h 2003-07-02 10:43:54.000000000 -0500 @@ -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.19/arch/ppc/math-emu/stfd.c linux-2.4.19bgl/arch/ppc/math-emu/stfd.c --- linux-2.4.19/arch/ppc/math-emu/stfd.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/stfd.c 2003-07-02 10:44:43.000000000 -0500 @@ -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.19/arch/ppc/math-emu/stfiwx.c linux-2.4.19bgl/arch/ppc/math-emu/stfiwx.c --- linux-2.4.19/arch/ppc/math-emu/stfiwx.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/stfiwx.c 2003-07-02 10:43:21.000000000 -0500 @@ -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.19/arch/ppc/math-emu/stfs.c linux-2.4.19bgl/arch/ppc/math-emu/stfs.c --- linux-2.4.19/arch/ppc/math-emu/stfs.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/stfs.c 2003-07-02 10:44:41.000000000 -0500 @@ -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.19/arch/ppc/math-emu/types.c linux-2.4.19bgl/arch/ppc/math-emu/types.c --- linux-2.4.19/arch/ppc/math-emu/types.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/types.c 2003-07-02 10:44:31.000000000 -0500 @@ -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.19/arch/ppc/math-emu/udivmodti4.c linux-2.4.19bgl/arch/ppc/math-emu/udivmodti4.c --- linux-2.4.19/arch/ppc/math-emu/udivmodti4.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/math-emu/udivmodti4.c 2003-07-02 10:44:16.000000000 -0500 @@ -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.19/arch/ppc/mm/4xx_mmu.c linux-2.4.19bgl/arch/ppc/mm/4xx_mmu.c --- linux-2.4.19/arch/ppc/mm/4xx_mmu.c 2001-11-02 19:43:54.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/mm/4xx_mmu.c 2003-07-02 10:43:17.000000000 -0500 @@ -54,11 +54,6 @@ #include #include -/* Used by the 4xx TLB replacement exception handler. - * Just needed it declared someplace (and initialized to zero). - */ -unsigned int tlb_4xx_index; - /* * MMU_init_hw does the chip-specific initialization of the MMU hardware. */ @@ -93,6 +88,6 @@ * vectors and the kernel live in real-mode. */ - mtspr(SPRN_DCCR, 0x80000000); /* 128 MB of data space at 0x0. */ - mtspr(SPRN_ICCR, 0x80000000); /* 128 MB of instr. space at 0x0. */ + mtspr(SPRN_DCCR, 0xF0000000); /* 512 MB of data space at 0x0. */ + mtspr(SPRN_ICCR, 0xF0000000); /* 512 MB of instr. space at 0x0. */ } diff -uNr linux-2.4.19/arch/ppc/mm/Makefile linux-2.4.19bgl/arch/ppc/mm/Makefile --- linux-2.4.19/arch/ppc/mm/Makefile 2001-08-28 08:58:33.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/mm/Makefile 2003-07-02 10:44:16.000000000 -0500 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.8 08/16/01 17:25:47 paulus +# BK Id: SCCS/s.Makefile 1.19 04/05/02 11:16:15 mporter # # # Makefile for the linux ppc-specific parts of the memory manager. @@ -21,7 +21,8 @@ obj-$(CONFIG_PPC_STD_MMU) += hashtable.o ppc_mmu.o tlb.o obj-$(CONFIG_PPC_ISERIES) += iSeries_hashtable.o iSeries_mmu.o tlb.o -obj-$(CONFIG_4xx) += cachemap.o 4xx_mmu.o -obj-$(CONFIG_8xx) += cachemap.o +obj-$(CONFIG_40x) += 4xx_mmu.o +obj-$(CONFIG_440) += 440_mmu.o +obj-$(CONFIG_NOT_COHERENT_CACHE) += cachemap.o include $(TOPDIR)/Rules.make diff -uNr linux-2.4.19/arch/ppc/mm/cachemap.c linux-2.4.19bgl/arch/ppc/mm/cachemap.c --- linux-2.4.19/arch/ppc/mm/cachemap.c 2001-11-02 19:43:54.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/mm/cachemap.c 2003-07-02 10:43:44.000000000 -0500 @@ -13,6 +13,7 @@ * is the virtual address and 'dma_handle' is the physical address. * Mostly stolen from the ARM port, with some changes for PowerPC. * -- Dan + * Modified for 36-bit support. -Matt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -50,14 +51,24 @@ #include #include -extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep); +#include "mmu_decl.h" +extern int map_page(unsigned long va, phys_addr_t pa, int flags); + +/* This function will allocate the requested contiguous pages and + * map them into the kernel's vmalloc() space. This is done so we + * get unique mapping for these pages, outside of the kernel's 1:1 + * virtual:physical mapping. This is necessary so we can cover large + * portions of the kernel with single large page TLB entries, and + * still get unique uncached pages for consistent DMA. + */ void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle) { - int order, rsize; - unsigned long page; - void *ret; - pte_t *pte; + int order, err, i; + unsigned long page, va, flags; + phys_addr_t pa; + struct vm_struct *area; + void *ret; if (in_interrupt()) BUG(); @@ -79,23 +90,29 @@ */ invalidate_dcache_range(page, page + size); - ret = (void *)page; - *dma_handle = virt_to_bus(ret); + /* Allocate some common virtual space to map the new pages. + */ + area = get_vm_area(size, VM_ALLOC); + if (area == 0) { + free_pages(page, order); + return NULL; + } + va = VMALLOC_VMADDR(area->addr); + ret = (void *)va; - /* Chase down all of the PTEs and mark them uncached. + /* This gives us the real physical address of the first page. */ - rsize = (int)size; - while (rsize > 0) { - if (get_pteptr(&init_mm, page, &pte)) { - pte_val(*pte) |= _PAGE_NO_CACHE | _PAGE_GUARDED; - flush_tlb_page(find_vma(&init_mm,page),page); - } - else { - BUG(); - return NULL; - } - page += PAGE_SIZE; - rsize -= PAGE_SIZE; + *dma_handle = pa = virt_to_bus((void *)page); + + flags = _PAGE_KERNEL | _PAGE_NO_CACHE; + + err = 0; + for (i = 0; i < size && err == 0; i += PAGE_SIZE) + err = map_page(va+i, pa+i, flags); + + if (err) { + vfree((void *)va); + return NULL; } return ret; @@ -103,42 +120,12 @@ /* * free page(s) as defined by the above mapping. - * The caller has to tell us the size so we can free the proper number - * of pages. We can't vmalloc() a new space for these pages and simply - * call vfree() like some other architectures because we could end up - * with aliased cache lines (or at least a cache line with the wrong - * attributes). This can happen when the PowerPC speculative loads - * across page boundaries. */ -void consistent_free(void *vaddr, size_t size) +void consistent_free(void *vaddr) { - int order, rsize; - unsigned long addr; - pte_t *pte; - if (in_interrupt()) BUG(); - - size = PAGE_ALIGN(size); - order = get_order(size); - - /* Chase down all of the PTEs and mark them cached again. - */ - addr = (unsigned long)vaddr; - rsize = (int)size; - while (rsize > 0) { - if (get_pteptr(&init_mm, addr, &pte)) { - pte_val(*pte) &= ~(_PAGE_NO_CACHE | _PAGE_GUARDED); - flush_tlb_page(find_vma(&init_mm,addr),addr); - } - else { - BUG(); - return; - } - addr += PAGE_SIZE; - rsize -= PAGE_SIZE; - } - free_pages((unsigned long)vaddr, order); + vfree(vaddr); } /* @@ -163,3 +150,17 @@ break; } } + +/* + * consistent_sync_page make a page are consistent. identical + * to consistent_sync, but takes a struct page instead of a virtual address + */ + +void consistent_sync_page(struct page *page, unsigned long offset, +size_t size, int direction) +{ + void *start; + + start = page_address(page) + offset; + consistent_sync(start, size, direction); +} diff -uNr linux-2.4.19/arch/ppc/mm/extable.c linux-2.4.19bgl/arch/ppc/mm/extable.c --- linux-2.4.19/arch/ppc/mm/extable.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/mm/extable.c 2003-07-02 10:44:44.000000000 -0500 @@ -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.19/arch/ppc/mm/fault.c linux-2.4.19bgl/arch/ppc/mm/fault.c --- linux-2.4.19/arch/ppc/mm/fault.c 2001-10-02 11:12:44.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/mm/fault.c 2003-07-02 10:44:36.000000000 -0500 @@ -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.25 06/25/02 18:33:19 mporter */ /* * arch/ppc/mm/fault.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -54,6 +55,7 @@ extern void die_if_kernel(char *, struct pt_regs *, long); void bad_page_fault(struct pt_regs *, unsigned long, int sig); void do_page_fault(struct pt_regs *, unsigned long, unsigned long); +extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep); /* * For 600- and 800-family processors, the error_code parameter is DSISR @@ -68,7 +70,7 @@ struct mm_struct *mm = current->mm; siginfo_t info; int code = SEGV_MAPERR; -#if defined(CONFIG_4xx) +#ifdef CONFIG_4xx int is_write = error_code & ESR_DST; #else int is_write = 0; @@ -90,7 +92,7 @@ debugger_fault_handler(regs); return; } -#if !defined(CONFIG_4xx) +#ifndef CONFIG_4xx if (error_code & 0x00400000) { /* DABR match */ if (debugger_dabr_match(regs)) @@ -136,6 +138,36 @@ if (is_write) { if (!(vma->vm_flags & VM_WRITE)) goto bad_area; +#if defined(CONFIG_4xx) + /* an exec - 4xx allows for per-page execute permission */ + } else if (regs->trap == 0x400) { + pte_t *ptep; + +#if 0 + /* It would be nice to actually enforce the VM execute + permission on CPUs which can do so, but far too + much stuff in userspace doesn't get the permissions + right, so we let any page be executed for now. */ + if (! (vma->vm_flags & VM_EXEC)) + goto bad_area; +#endif + + /* Since 4xx supports per-page execute permission, + * we lazily flush dcache to icache. */ + if (get_pteptr(mm, address, &ptep) && pte_present(*ptep)) { + struct page *page = pte_page(*ptep); + + if (! test_bit(PG_arch_1, &page->flags)) { + __flush_dcache_icache(kmap(page)); + kunmap(page); + set_bit(PG_arch_1, &page->flags); + } + pte_update(ptep, 0, _PAGE_HWEXEC); + _tlbie(address); + up_read(&mm->mmap_sem); + return; + } +#endif /* a read */ } else { /* protection fault */ @@ -245,7 +277,7 @@ die("kernel access of bad area", regs, sig); } -#ifdef CONFIG_8xx +#if defined(CONFIG_8xx) || defined(CONFIG_GT64260_ETH) /* The pgtable.h claims some functions generically exist, but I * can't find them...... diff -uNr linux-2.4.19/arch/ppc/mm/hashtable.S linux-2.4.19bgl/arch/ppc/mm/hashtable.S --- linux-2.4.19/arch/ppc/mm/hashtable.S 2001-08-28 08:58:33.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/mm/hashtable.S 2003-07-02 10:43:59.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.hashtable.S 1.18 08/15/01 22:43:07 paulus + * BK Id: SCCS/s.hashtable.S 1.8 12/21/01 19:51:01 paulus */ /* * arch/ppc/kernel/hashtable.S @@ -27,11 +27,12 @@ */ #include -#include "../kernel/ppc_asm.h" #include #include #include #include +#include +#include #ifdef CONFIG_SMP .comm hash_table_lock,4 @@ -333,25 +334,6 @@ ori r8,r8,_PAGE_COHERENT /* set M (coherence required) */ #endif -#ifdef CONFIG_POWER4 - /* - * XXX hack hack hack - translate 32-bit "physical" addresses - * in the linux page tables to 42-bit real addresses in such - * a fashion that we can get at the I/O we need to access. - * -- paulus - */ - cmpwi r8,0 - rlwinm r0,r8,16,16,30 - bge 57f - cmplwi r0,0xfe00 - li r0,0x3fd - bne 56f - li r0,0x3ff -56: sldi r0,r0,32 - or r8,r8,r0 -57: -#endif - /* Construct the high word of the PPC-style PTE (r5) */ #ifndef CONFIG_PPC64BRIDGE rlwinm r5,r3,7,1,24 /* put VSID in 0x7fffff80 bits */ @@ -448,21 +430,6 @@ lwz r6,next_slot@l(r4) addi r6,r6,PTE_SIZE andi. r6,r6,7*PTE_SIZE -#ifdef CONFIG_POWER4 - /* - * Since we don't have BATs on POWER4, we rely on always having - * PTEs in the hash table to map the hash table and the code - * that manipulates it in virtual mode, namely flush_hash_page and - * flush_hash_segments. Otherwise we can get a DSI inside those - * routines which leads to a deadlock on the hash_table_lock on - * SMP machines. We avoid this by never overwriting the first - * PTE of each PTEG if it is already valid. - * -- paulus. - */ - bne 102f - li r6,PTE_SIZE -102: -#endif /* CONFIG_POWER4 */ stw r6,next_slot@l(r4) add r4,r3,r6 diff -uNr linux-2.4.19/arch/ppc/mm/init.c linux-2.4.19bgl/arch/ppc/mm/init.c --- linux-2.4.19/arch/ppc/mm/init.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/mm/init.c 2003-07-02 10:43:13.000000000 -0500 @@ -1,14 +1,15 @@ /* - * BK Id: SCCS/s.init.c 1.43 03/12/02 12:13:51 paulus + * BK Id: SCCS/s.init.c 1.77 07/20/02 12:47:52 mporter */ /* - * PowerPC version + * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) * * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au) * and Cort Dougan (PReP) (cort@cs.nmt.edu) * Copyright (C) 1996 Paul Mackerras * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk). + * PPC440/36-bit changes by Matt Porter (mporter@mvista.com) * * Derived from "arch/i386/mm/init.c" * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds @@ -49,12 +50,18 @@ #include "mem_pieces.h" #include "mmu_decl.h" +#ifdef CONFIG_PPC_ISERIES +extern void create_virtual_bus_tce_table(void); +#endif + mmu_gather_t mmu_gathers[NR_CPUS]; -void *end_of_DRAM; unsigned long total_memory; unsigned long total_lowmem; +unsigned long ppc_memstart; +unsigned long ppc_memoffset = PAGE_OFFSET; + int mem_init_done; int init_bootmem_done; int boot_mapsize; @@ -181,13 +188,13 @@ iscur = 1; printk("current"); } - + if ( p == last_task_used_math ) { if ( iscur ) printk(","); printk("last math"); - } + } #endif /* CONFIG_SMP */ printk("\n"); } @@ -313,7 +320,6 @@ total_memory = __max_memory; total_lowmem = total_memory; adjust_total_lowmem(); - end_of_DRAM = __va(total_lowmem); set_phys_avail(total_lowmem); /* Initialize the MMU hardware */ @@ -396,8 +402,11 @@ } start = PAGE_ALIGN(start); - boot_mapsize = init_bootmem(start >> PAGE_SHIFT, - total_lowmem >> PAGE_SHIFT); + min_low_pfn = start >> PAGE_SHIFT; + max_low_pfn = (PPC_MEMSTART + total_lowmem) >> PAGE_SHIFT; + boot_mapsize = init_bootmem_node(&contig_page_data, min_low_pfn, + PPC_MEMSTART >> PAGE_SHIFT, + max_low_pfn); /* remove the bootmem bitmap from the available memory */ mem_pieces_remove(&phys_avail, start, boot_mapsize, 1); @@ -407,6 +416,12 @@ free_bootmem(phys_avail.regions[i].address, phys_avail.regions[i].size); +#ifdef CONFIG_440 + /* Reserve space in the pinned TLB area (ZONE_DMA) */ + if (total_lowmem > PPC440_PIN_SIZE) + reserve_bootmem(0x00800000, 0x00800000); +#endif + init_bootmem_done = 1; } @@ -428,9 +443,23 @@ /* * All pages are DMA-able so we put them all in the DMA zone. */ +#ifndef CONFIG_440 zones_size[ZONE_DMA] = total_lowmem >> PAGE_SHIFT; + for (i = 1; i < MAX_NR_ZONES; i++) zones_size[i] = 0; +#else + /* + * On 440, we highjack the DMA zone to provide a zone + * which limits allocations to our pinned TLB region. + */ + zones_size[ZONE_DMA] = PPC440_PIN_SIZE >> PAGE_SHIFT; + zones_size[ZONE_NORMAL] = (total_lowmem - PPC440_PIN_SIZE) >> PAGE_SHIFT; + + for (i = 2; i < MAX_NR_ZONES; i++) + zones_size[i] = 0; +#endif + #ifdef CONFIG_HIGHMEM zones_size[ZONE_HIGHMEM] = (total_memory - total_lowmem) >> PAGE_SHIFT; @@ -450,14 +479,18 @@ highmem_mapnr = total_lowmem >> PAGE_SHIFT; highmem_start_page = mem_map + highmem_mapnr; - max_mapnr = total_memory >> PAGE_SHIFT; -#else - max_mapnr = max_low_pfn; #endif /* CONFIG_HIGHMEM */ + max_mapnr = total_memory >> PAGE_SHIFT; - high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); + high_memory = (void *) __va(PPC_MEMSTART + total_lowmem); num_physpages = max_mapnr; /* RAM is assumed contiguous */ +#ifdef CONFIG_440 + /* Free reserved space in the pinned TLB area (ZONE_DMA) */ + if (total_lowmem > PPC440_PIN_SIZE) + free_bootmem(0x00800000, 0x00800000); +#endif + totalram_pages += free_all_bootmem(); #ifdef CONFIG_BLK_DEV_INITRD @@ -485,7 +518,7 @@ addr += PAGE_SIZE) SetPageReserved(virt_to_page(addr)); - for (addr = PAGE_OFFSET; addr < (unsigned long)end_of_DRAM; + for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory; addr += PAGE_SIZE) { if (!PageReserved(virt_to_page(addr))) continue; @@ -527,6 +560,11 @@ if (agp_special_page) printk(KERN_INFO "AGP special page: 0x%08lx\n", agp_special_page); #endif /* defined(CONFIG_ALL_PPC) */ +#ifdef CONFIG_PPC_ISERIES + + create_virtual_bus_tce_table(); + +#endif /* CONFIG_PPC_ISERIES */ mem_init_done = 1; } @@ -544,7 +582,7 @@ * physical memory. */ - phys_avail.regions[0].address = 0; + phys_avail.regions[0].address = PPC_MEMSTART; phys_avail.regions[0].size = total_memory; phys_avail.n_regions = 1; diff -uNr linux-2.4.19/arch/ppc/mm/mem_pieces.c linux-2.4.19bgl/arch/ppc/mm/mem_pieces.c --- linux-2.4.19/arch/ppc/mm/mem_pieces.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/mm/mem_pieces.c 2003-07-02 10:43:13.000000000 -0500 @@ -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.8 11/06/01 16:21:09 trini */ /* * Copyright (c) 1996 Paul Mackerras @@ -45,7 +45,7 @@ a = (a + align - 1) & -align; if (a + size <= e) { mem_pieces_remove(mp, a, size, 1); - return __va(a); + return (void *) __va(a); } } panic("Couldn't find %u bytes at %u alignment\n", size, align); diff -uNr linux-2.4.19/arch/ppc/mm/mem_pieces.h linux-2.4.19bgl/arch/ppc/mm/mem_pieces.h --- linux-2.4.19/arch/ppc/mm/mem_pieces.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/mm/mem_pieces.h 2003-07-02 10:44:10.000000000 -0500 @@ -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.19/arch/ppc/mm/mmu_decl.h linux-2.4.19bgl/arch/ppc/mm/mmu_decl.h --- linux-2.4.19/arch/ppc/mm/mmu_decl.h 2002-02-25 13:37:55.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/mm/mmu_decl.h 2003-07-02 10:44:17.000000000 -0500 @@ -12,6 +12,7 @@ * and Cort Dougan (PReP) (cort@cs.nmt.edu) * Copyright (C) 1996 Paul Mackerras * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk). + * PPC440-36-bit changes by Matt Porter (mporter@mvista.com) * * Derived from "arch/i386/mm/init.c" * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds @@ -23,23 +24,23 @@ * */ +#include + extern void mapin_ram(void); extern void bat_mapin_ram(unsigned long bat2, unsigned long bat3); extern void adjust_total_lowmem(void); -extern int map_page(unsigned long va, unsigned long pa, int flags); +extern int map_page(unsigned long va, phys_addr_t pa, int flags); extern void setbat(int index, unsigned long virt, unsigned long phys, unsigned int size, int flags); extern void reserve_phys_mem(unsigned long start, unsigned long size); extern int __map_without_bats; -extern void *end_of_DRAM; extern unsigned long ioremap_base; extern unsigned long ioremap_bot; extern unsigned int rtas_data, rtas_size; extern unsigned long total_memory; extern unsigned long total_lowmem; -extern unsigned long ram_phys_base; extern int mem_init_done; extern PTE *Hash, *Hash_end; diff -uNr linux-2.4.19/arch/ppc/mm/pgtable.c linux-2.4.19bgl/arch/ppc/mm/pgtable.c --- linux-2.4.19/arch/ppc/mm/pgtable.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/mm/pgtable.c 2005-06-08 14:30:44.000000000 -0500 @@ -12,6 +12,7 @@ * and Cort Dougan (PReP) (cort@cs.nmt.edu) * Copyright (C) 1996 Paul Mackerras * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk). + * PPC440/36-bit changes by Matt Porter (mporter@mvista.com) * * Derived from "arch/i386/mm/init.c" * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds @@ -32,11 +33,10 @@ #include #include #include +#include #include "mmu_decl.h" -unsigned long ram_phys_base; - unsigned long ioremap_base; unsigned long ioremap_bot; int io_bat_index; @@ -44,7 +44,11 @@ /* Maximum 768Mb of lowmem. On SMP, this value will be * trimmed down to whatever can be covered by BATs though. */ +#ifdef CONFIG_LOWMEM_SIZE_BOOL +#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE +#else #define MAX_LOW_MEM 0x30000000 +#endif /* CONFIG_LOWMEM_SIZE_BOOL */ #ifndef CONFIG_SMP struct pgtable_cache_struct quicklists; @@ -72,16 +76,51 @@ #endif /* HAVE_BATS */ #ifndef CONFIG_PPC_ISERIES +#ifndef CONFIG_440 +void * +ioremap(phys_addr_t addr, unsigned long size) +{ + return __ioremap(addr, size, _PAGE_NO_CACHE); +} +#else /* CONFIG_440 */ void * -ioremap(unsigned long addr, unsigned long size) +ioremap64(unsigned long long addr, unsigned long size) { return __ioremap(addr, size, _PAGE_NO_CACHE); } +#ifndef CONFIG_BGL +void * +ioremap(phys_addr_t addr, unsigned long size) +{ + unsigned long long addr64; + unsigned long long page_4gb = 0; + + /* + * Trap the least significant 32-bit portions of an + * address in the 440's 36-bit address space. Fix + * them up with the appropriate ERPN + */ + if ((addr >= PPC440_IO_LO) && (addr < PPC440_IO_HI)) + page_4gb = PPC440_IO_PAGE; + else if ((addr >= PPC440_PCICFG_LO) && (addr < PPC440_PCICFG_HI)) + page_4gb = PPC440_PCICFG_PAGE; + else if ((addr >= PPC440_PCIMEM_LO) && (addr < PPC440_PCIMEM_HI)) + page_4gb = PPC440_PCIMEM_PAGE; + + addr64 = page_4gb | (unsigned long long)addr; + + return ioremap64(addr64, size); +} +#endif +#endif /* CONFIG_440 */ + void * -__ioremap(unsigned long addr, unsigned long size, unsigned long flags) +__ioremap(phys_addr_t addr, unsigned long size, unsigned long flags) { - unsigned long p, v, i; + unsigned long v, i; + phys_addr_t p; + int err; /* @@ -106,8 +145,13 @@ */ if ( mem_init_done && (p < virt_to_phys(high_memory)) ) { +#ifndef CONFIG_440 printk("__ioremap(): phys addr %0lx is RAM lr %p\n", p, __builtin_return_address(0)); +#else + printk("__ioremap(): phys addr %0Lx is RAM lr %p\n", p, + __builtin_return_address(0)); +#endif /* CONFIG_440 */ return NULL; } @@ -157,7 +201,7 @@ } out: - return (void *) (v + (addr & ~PAGE_MASK)); + return (void *) (v + ((unsigned long)addr & ~PAGE_MASK)); } void iounmap(void *addr) @@ -174,7 +218,7 @@ #endif /* CONFIG_PPC_ISERIES */ int -map_page(unsigned long va, unsigned long pa, int flags) +map_page(unsigned long va, phys_addr_t pa, int flags) { pmd_t *pd; pte_t *pg; @@ -203,7 +247,7 @@ #ifdef HAVE_BATS unsigned long bat_max = 0x10000000; unsigned long align; - unsigned long ram = total_lowmem; + unsigned long ram; int is601 = 0; /* 601s have smaller BATs */ @@ -212,10 +256,20 @@ is601 = 1; } + /* adjust BAT block size to max_low_mem */ + if (max_low_mem < bat_max) + bat_max = max_low_mem; + + /* adjust lowmem size to max_low_mem */ + if (max_low_mem < total_lowmem) + ram = max_low_mem; + else + ram = total_lowmem; + /* Make sure we don't map a block larger than the smallest alignment of the physical address. */ - /* alignment of ram_phys_base */ - align = ~(ram_phys_base-1) & ram_phys_base; + /* alignment of PPC_MEMSTART */ + align = ~(PPC_MEMSTART-1) & PPC_MEMSTART; /* set BAT block size to MIN(max_size, align) */ if (align && align < bat_max) bat_max = align; @@ -232,8 +286,9 @@ ram -= __bat3; } - printk(KERN_INFO "Memory BAT mapping: BAT2=%ldMb, BAT3=%ldMb, residual: %ldMb\n", - __bat2 >> 20, __bat3 >> 20, ram >> 20); + printk(KERN_INFO "Memory BAT mapping: BAT2=%ldMb, BAT3=%ldMb," + " residual: %ldMb\n", __bat2 >> 20, __bat3 >> 20, + (total_lowmem - (__bat2 - __bat3)) >> 20); /* On SMP, we limit the lowmem to the area mapped with BATs. * We also assume nobody will do SMP with 601s @@ -247,8 +302,9 @@ if (total_lowmem > max_low_mem) { 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); + printk(KERN_INFO "Warning, memory limited to %ld Mb, use " + " CONFIG_HIGHMEM to reach %ld Mb\n", + max_low_mem >> 20, total_memory >> 20); total_memory = total_lowmem; #endif /* CONFIG_HIGHMEM */ } @@ -259,7 +315,8 @@ */ void __init mapin_ram(void) { - unsigned long v, p, s, f; + unsigned long v, s, f; + phys_addr_t p; #ifdef HAVE_BATS if (!__map_without_bats) @@ -267,18 +324,22 @@ #endif /* HAVE_BATS */ v = KERNELBASE; - p = ram_phys_base; + p = PPC_MEMSTART; for (s = 0; s < total_lowmem; s += PAGE_SIZE) { /* On the MPC8xx, we want the page shared so we * don't get ASID compares on kernel space. */ - f = _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_SHARED; + f = _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_SHARED | _PAGE_HWEXEC; #if defined(CONFIG_KGDB) || defined(CONFIG_XMON) /* Allows stub to set breakpoints everywhere */ f |= _PAGE_WRENABLE; #else /* !CONFIG_KGDB && !CONFIG_XMON */ if ((char *) v < _stext || (char *) v >= etext) f |= _PAGE_WRENABLE; +#ifdef CONFIG_440 + /* Prevent bogus speculative cycles */ + f |= _PAGE_GUARDED; +#endif #ifdef CONFIG_PPC_STD_MMU else /* On the powerpc (not all), no user access @@ -290,6 +351,8 @@ v += PAGE_SIZE; p += PAGE_SIZE; } + if (ppc_md.progress) + ppc_md.progress("MMU:mapin_ram done", 0x401); } /* is x a power of 2? */ @@ -300,7 +363,7 @@ * virt, phys, size must all be page-aligned. * This should only be called before ioremap is called. */ -void __init io_block_mapping(unsigned long virt, unsigned long phys, +void __init io_block_mapping(unsigned long virt, phys_addr_t phys, unsigned int size, int flags) { int i; diff -uNr linux-2.4.19/arch/ppc/mm/ppc_mmu.c linux-2.4.19bgl/arch/ppc/mm/ppc_mmu.c --- linux-2.4.19/arch/ppc/mm/ppc_mmu.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/mm/ppc_mmu.c 2003-07-02 10:43:53.000000000 -0500 @@ -91,11 +91,11 @@ unsigned long tot, done; tot = total_lowmem; - setbat(2, KERNELBASE, ram_phys_base, bat2, _PAGE_KERNEL); + setbat(2, KERNELBASE, PPC_MEMSTART, bat2, _PAGE_KERNEL); done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1; if ((done < tot) && !bat_addrs[3].limit && bat3) { tot -= done; - setbat(3, KERNELBASE+done, ram_phys_base+done, bat3, + setbat(3, KERNELBASE+done, PPC_MEMSTART+done, bat3, _PAGE_KERNEL); } } @@ -158,31 +158,13 @@ */ void __init MMU_init_hw(void) { - int Hash_bits, mb, mb2; - unsigned int hmask; + unsigned int hmask, mb, mb2; + unsigned int n_hpteg, lg_n_hpteg; extern unsigned int hash_page_patch_A[]; extern unsigned int hash_page_patch_B[], hash_page_patch_C[]; extern unsigned int flush_hash_patch_A[], flush_hash_patch_B[]; -#ifdef CONFIG_PPC64BRIDGE - /* The hash table has already been allocated and initialized - in prom.c */ - Hash_mask = (Hash_size >> 7) - 1; - hmask = Hash_mask >> 9; - Hash_bits = __ilog2(Hash_size) - 7; - mb = 25 - Hash_bits; - if (Hash_bits > 16) - Hash_bits = 16; - mb2 = 25 - Hash_bits; - - /* Remove the hash table from the available memory */ - if (Hash) - reserve_phys_mem(__pa(Hash), Hash_size); - -#else /* CONFIG_PPC64BRIDGE */ - unsigned int h; - if ((cur_cpu_spec[0]->cpu_features & CPU_FTR_HPTE_TABLE) == 0) { Hash_size = 0; Hash_end = 0; @@ -192,72 +174,80 @@ if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105); +#ifdef CONFIG_PPC64BRIDGE +#define LG_HPTEG_SIZE 7 /* 128 bytes per HPTEG */ +#define SDR1_LOW_BITS (lg_n_hpteg - 11) +#define MIN_N_HPTEG 2048 /* min 256kB hash table */ +#else +#define LG_HPTEG_SIZE 6 /* 64 bytes per HPTEG */ +#define SDR1_LOW_BITS ((n_hpteg - 1) >> 10) +#define MIN_N_HPTEG 1024 /* min 64kB hash table */ +#endif + /* - * Allow 64k of hash table for every 16MB of memory, - * up to a maximum of 2MB. + * Allow 1 HPTE (1/8 HPTEG) for each page of memory. + * This is less than the recommended amount, but then + * Linux ain't AIX. */ - for (h = 64<<10; h < total_memory / 256 && h < (2<<20); h *= 2) - ; - Hash_size = h; - Hash_mask = (h >> 6) - 1; - hmask = Hash_mask >> 10; - Hash_bits = __ilog2(h) - 6; - mb = 26 - Hash_bits; - if (Hash_bits > 16) - Hash_bits = 16; - mb2 = 26 - Hash_bits; + n_hpteg = total_memory / (PAGE_SIZE * 8); + if (n_hpteg < MIN_N_HPTEG) + n_hpteg = MIN_N_HPTEG; + lg_n_hpteg = __ilog2(n_hpteg); + if (n_hpteg & (n_hpteg - 1)) { + ++lg_n_hpteg; /* round up if not power of 2 */ + n_hpteg = 1 << lg_n_hpteg; + } + + Hash_size = n_hpteg << LG_HPTEG_SIZE; + Hash_mask = n_hpteg - 1; + hmask = Hash_mask >> (16 - LG_HPTEG_SIZE); + mb2 = mb = 32 - LG_HPTEG_SIZE - lg_n_hpteg; + if (lg_n_hpteg > 16) + mb2 = 16 - LG_HPTEG_SIZE; + /* + * Find some memory for the hash table. + */ if ( ppc_md.progress ) ppc_md.progress("hash:find piece", 0x322); - /* Find some memory for the hash table. */ - if ( Hash_size ) { - Hash = mem_pieces_find(Hash_size, Hash_size); - cacheable_memzero(Hash, Hash_size); - _SDR1 = __pa(Hash) | (Hash_mask >> 10); - } else - Hash = 0; -#endif /* CONFIG_PPC64BRIDGE */ + Hash = mem_pieces_find(Hash_size, Hash_size); + cacheable_memzero(Hash, Hash_size); + _SDR1 = __pa(Hash) | SDR1_LOW_BITS; + Hash_end = (PTE *) ((unsigned long)Hash + Hash_size); printk("Total memory = %ldMB; using %ldkB for hash table (at %p)\n", total_memory >> 20, Hash_size >> 10, Hash); - if (Hash_size) { - if ( ppc_md.progress ) ppc_md.progress("hash:patch", 0x345); - Hash_end = (PTE *) ((unsigned long)Hash + Hash_size); - - /* - * Patch up the instructions in hashtable.S:create_hpte - */ - hash_page_patch_A[0] = (hash_page_patch_A[0] & ~0xffff) - | ((unsigned int)(Hash) >> 16); - hash_page_patch_A[1] = (hash_page_patch_A[1] & ~0x7c0) - | (mb << 6); - hash_page_patch_A[2] = (hash_page_patch_A[2] & ~0x7c0) - | (mb2 << 6); - hash_page_patch_B[0] = (hash_page_patch_B[0] & ~0xffff) - | hmask; - hash_page_patch_C[0] = (hash_page_patch_C[0] & ~0xffff) - | hmask; - /* - * Ensure that the locations we've patched have been written - * out from the data cache and invalidated in the instruction - * cache, on those machines with split caches. - */ - flush_icache_range((unsigned long) &hash_page_patch_A[0], - (unsigned long) &hash_page_patch_C[1]); - /* - * Patch up the instructions in hashtable.S:flush_hash_page - */ - flush_hash_patch_A[0] = (flush_hash_patch_A[0] & ~0xffff) - | ((unsigned int)(Hash) >> 16); - flush_hash_patch_A[1] = (flush_hash_patch_A[1] & ~0x7c0) - | (mb << 6); - flush_hash_patch_A[2] = (flush_hash_patch_A[2] & ~0x7c0) - | (mb2 << 6); - flush_hash_patch_B[0] = (flush_hash_patch_B[0] & ~0xffff) - | hmask; - flush_icache_range((unsigned long) &flush_hash_patch_A[0], - (unsigned long) &flush_hash_patch_B[1]); - } - + + + /* + * Patch up the instructions in hashtable.S:create_hpte + */ + if ( ppc_md.progress ) ppc_md.progress("hash:patch", 0x345); + hash_page_patch_A[0] = (hash_page_patch_A[0] & ~0xffff) + | ((unsigned int)(Hash) >> 16); + hash_page_patch_A[1] = (hash_page_patch_A[1] & ~0x7c0) | (mb << 6); + hash_page_patch_A[2] = (hash_page_patch_A[2] & ~0x7c0) | (mb2 << 6); + hash_page_patch_B[0] = (hash_page_patch_B[0] & ~0xffff) | hmask; + hash_page_patch_C[0] = (hash_page_patch_C[0] & ~0xffff) | hmask; + + /* + * Ensure that the locations we've patched have been written + * out from the data cache and invalidated in the instruction + * cache, on those machines with split caches. + */ + flush_icache_range((unsigned long) &hash_page_patch_A[0], + (unsigned long) &hash_page_patch_C[1]); + + /* + * Patch up the instructions in hashtable.S:flush_hash_page + */ + flush_hash_patch_A[0] = (flush_hash_patch_A[0] & ~0xffff) + | ((unsigned int)(Hash) >> 16); + flush_hash_patch_A[1] = (flush_hash_patch_A[1] & ~0x7c0) | (mb << 6); + flush_hash_patch_A[2] = (flush_hash_patch_A[2] & ~0x7c0) | (mb2 << 6); + flush_hash_patch_B[0] = (flush_hash_patch_B[0] & ~0xffff) | hmask; + flush_icache_range((unsigned long) &flush_hash_patch_A[0], + (unsigned long) &flush_hash_patch_B[1]); + if ( ppc_md.progress ) ppc_md.progress("hash:done", 0x205); } diff -uNr linux-2.4.19/arch/ppc/xmon/Makefile linux-2.4.19bgl/arch/ppc/xmon/Makefile --- linux-2.4.19/arch/ppc/xmon/Makefile 2001-07-02 16:34:57.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/xmon/Makefile 2003-07-02 10:44:06.000000000 -0500 @@ -1,9 +1,11 @@ -# BK Id: SCCS/s.Makefile 1.6 06/27/01 14:49:58 trini +# BK Id: SCCS/s.Makefile 1.8 06/25/02 16:33:15 trini # # Makefile for xmon O_TARGET := x.o +CFLAGS_xmon.o += -I$(TOPDIR)/arch/$(ARCH)/mm + ifdef CONFIG_8xx obj-y := start_8xx.o else diff -uNr linux-2.4.19/arch/ppc/xmon/adb.c linux-2.4.19bgl/arch/ppc/xmon/adb.c --- linux-2.4.19/arch/ppc/xmon/adb.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/xmon/adb.c 2003-07-02 10:44:46.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.adb.c 1.5 05/17/01 18:14:23 cort + * BK Id: SCCS/s.adb.c 1.7 06/05/01 21:22:06 paulus */ /* * Copyright (C) 1996 Paul Mackerras. diff -uNr linux-2.4.19/arch/ppc/xmon/ansidecl.h linux-2.4.19bgl/arch/ppc/xmon/ansidecl.h --- linux-2.4.19/arch/ppc/xmon/ansidecl.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/xmon/ansidecl.h 2003-07-02 10:43:52.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ansidecl.h 1.5 05/17/01 18:14:23 cort + * BK Id: SCCS/s.ansidecl.h 1.7 06/05/01 21:22:06 paulus */ /* ANSI and traditional C compatability macros Copyright 1991, 1992 Free Software Foundation, Inc. diff -uNr linux-2.4.19/arch/ppc/xmon/nonstdio.h linux-2.4.19bgl/arch/ppc/xmon/nonstdio.h --- linux-2.4.19/arch/ppc/xmon/nonstdio.h 2002-02-25 13:37:55.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/xmon/nonstdio.h 2005-06-08 14:30:44.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.nonstdio.h 1.8 12/01/01 20:09:07 benh + * BK Id: SCCS/s.nonstdio.h 1.10 12/27/01 10:38:51 trini */ typedef int FILE; extern FILE *xmon_stdin, *xmon_stdout; @@ -14,13 +14,14 @@ #define getchar xmon_getchar #define putc xmon_putc #define getc xmon_getc +#define fflush xmon_flush #define fopen(n, m) NULL -#define fflush(f) do {} while (0) #define fclose(f) do {} while (0) extern char *fgets(char *, int, void *); extern void xmon_printf(const char *, ...); extern void xmon_fprintf(void *, const char *, ...); extern void xmon_sprintf(char *, const char *, ...); extern void xmon_puts(char*); +extern void xmon_flush(void *); #define perror(s) printf("%s: no files!\n", (s)) diff -uNr linux-2.4.19/arch/ppc/xmon/ppc-dis.c linux-2.4.19bgl/arch/ppc/xmon/ppc-dis.c --- linux-2.4.19/arch/ppc/xmon/ppc-dis.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/xmon/ppc-dis.c 2003-07-02 10:44:30.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc-dis.c 1.5 05/17/01 18:14:23 cort + * BK Id: SCCS/s.ppc-dis.c 1.7 06/05/01 21:22:06 paulus */ /* ppc-dis.c -- Disassemble PowerPC instructions Copyright 1994 Free Software Foundation, Inc. diff -uNr linux-2.4.19/arch/ppc/xmon/ppc-opc.c linux-2.4.19bgl/arch/ppc/xmon/ppc-opc.c --- linux-2.4.19/arch/ppc/xmon/ppc-opc.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/xmon/ppc-opc.c 2003-07-02 10:44:32.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc-opc.c 1.5 05/17/01 18:14:23 cort + * BK Id: SCCS/s.ppc-opc.c 1.7 06/05/01 21:22:06 paulus */ /* ppc-opc.c -- PowerPC opcode list Copyright 1994 Free Software Foundation, Inc. diff -uNr linux-2.4.19/arch/ppc/xmon/ppc.h linux-2.4.19bgl/arch/ppc/xmon/ppc.h --- linux-2.4.19/arch/ppc/xmon/ppc.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/xmon/ppc.h 2003-07-02 10:44:08.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc.h 1.5 05/17/01 18:14:23 cort + * BK Id: SCCS/s.ppc.h 1.7 06/05/01 21:22:06 paulus */ /* ppc.h -- Header file for PowerPC opcode table Copyright 1994 Free Software Foundation, Inc. diff -uNr linux-2.4.19/arch/ppc/xmon/privinst.h linux-2.4.19bgl/arch/ppc/xmon/privinst.h --- linux-2.4.19/arch/ppc/xmon/privinst.h 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/xmon/privinst.h 2003-07-02 10:44:11.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.privinst.h 1.5 05/17/01 18:14:23 cort + * BK Id: SCCS/s.privinst.h 1.7 06/05/01 21:22:06 paulus */ /* * Copyright (C) 1996 Paul Mackerras. diff -uNr linux-2.4.19/arch/ppc/xmon/setjmp.c linux-2.4.19bgl/arch/ppc/xmon/setjmp.c --- linux-2.4.19/arch/ppc/xmon/setjmp.c 2001-05-21 19:04:47.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/xmon/setjmp.c 2003-07-02 10:43:53.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.setjmp.c 1.5 05/17/01 18:14:23 cort + * BK Id: SCCS/s.setjmp.c 1.7 06/05/01 21:22:06 paulus */ /* * Copyright (C) 1996 Paul Mackerras. diff -uNr linux-2.4.19/arch/ppc/xmon/start.c linux-2.4.19bgl/arch/ppc/xmon/start.c --- linux-2.4.19/arch/ppc/xmon/start.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/xmon/start.c 2005-06-08 14:30:44.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.start.c 1.20 04/09/02 21:01:58 paulus + * BK Id: SCCS/s.start.c 1.32 04/16/02 21:42:09 paulus */ /* * Copyright (C) 1996 Paul Mackerras. @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -24,13 +25,15 @@ #ifdef CONFIG_SMP #include #endif +#ifdef CONFIG_BGL +#include +#endif static volatile unsigned char *sccc, *sccd; -unsigned long TXRDY, RXRDY; +unsigned int TXRDY, RXRDY, DLAB; extern void xmon_printf(const char *fmt, ...); static int xmon_expect(const char *str, unsigned int timeout); -static int console; static int use_screen; static int via_modem; static int xmon_use_sccb; @@ -48,12 +51,52 @@ void buf_access(void) { - if ( _machine == _MACH_chrp ) - sccd[3] &= ~0x80; /* reset DLAB */ + if (DLAB) + sccd[3] &= ~DLAB; /* reset DLAB */ } extern int adb_init(void); +#ifdef CONFIG_ALL_PPC +/* + * This looks in the "ranges" property for the primary PCI host bridge + * to find the physical address of the start of PCI/ISA I/O space. + * It is basically a cut-down version of pci_process_bridge_OF_ranges. + */ +static unsigned long chrp_find_phys_io_base(void) +{ + struct device_node *node; + unsigned int *ranges; + unsigned long base = CHRP_ISA_IO_BASE; + int rlen = 0; + int np; + + node = find_devices("isa"); + if (node != NULL) { + node = node->parent; + if (node == NULL || node->type == NULL + || strcmp(node->type, "pci") != 0) + node = NULL; + } + if (node == NULL) + node = find_devices("pci"); + if (node == NULL) + return base; + + ranges = (unsigned int *) get_property(node, "ranges", &rlen); + np = prom_n_addr_cells(node) + 5; + while ((rlen -= np * sizeof(unsigned int)) >= 0) { + if ((ranges[0] >> 24) == 1 && ranges[2] == 0) { + /* I/O space starting at 0, grab the phys base */ + base = ranges[np - 3]; + break; + } + ranges += np; + } + return base; +} +#endif /* CONFIG_ALL_PPC */ + void xmon_map_scc(void) { @@ -132,18 +175,22 @@ base = (volatile unsigned char *) ioremap(addr & PAGE_MASK, PAGE_SIZE); sccc = base + (addr & ~PAGE_MASK); sccd = sccc + 0x10; - } - else - { - /* should already be mapped by the kernel boot */ - sccc = (volatile unsigned char *) (isa_io_base + 0x3fd); - sccd = (volatile unsigned char *) (isa_io_base + 0x3f8); + + } else { + base = (volatile unsigned char *) isa_io_base; + if (_machine == _MACH_chrp) + base = (volatile unsigned char *) + ioremap(chrp_find_phys_io_base(), 0x1000); + + sccc = base + 0x3fd; + sccd = base + 0x3f8; if (xmon_use_sccb) { sccc -= 0x100; sccd -= 0x100; } TXRDY = 0x20; RXRDY = 1; + DLAB = 0x80; } #elif defined(CONFIG_GEMINI) /* should already be mapped by the kernel boot */ @@ -151,11 +198,21 @@ sccd = (volatile unsigned char *) 0xffeffb08; TXRDY = 0x20; RXRDY = 1; - console = 1; + DLAB = 0x80; +#elif defined(CONFIG_405GP) + sccc = (volatile unsigned char *)0xef600305; + sccd = (volatile unsigned char *)0xef600300; + TXRDY = 0x20; + RXRDY = 1; + DLAB = 0x80; #endif /* platform */ } +#ifdef CONFIG_BGL +#define scc_initialized (1) +#else static int scc_initialized = 0; +#endif void xmon_init_scc(void); extern void pmu_poll(void); @@ -173,6 +230,69 @@ #endif /* CONFIG_ADB_CUDA */ } +#ifdef CONFIG_BGL +static int xmon_outpos; +static char xmon_outbuf[1024]; +int +xmon_write(void *handle, void *ptr, int nb) +{ + char *p = (char *)ptr; + int i = nb; + while (i > 0) { + if (xmon_outpos == sizeof(xmon_outbuf)-1) { + /* full buffer...need to flush */ + xmon_outbuf[xmon_outpos] = '\0'; + bgl_dprintf("%s\n", xmon_outbuf); + xmon_outpos = 0; + } + if (*p == '\n') { + xmon_outbuf[xmon_outpos] = '\0'; + bgl_dprintf("%s\n", xmon_outbuf); + xmon_outpos = 0; + p++; + } else { + xmon_outbuf[xmon_outpos++] = *p++; + } + i--; + } + return nb; +} +void +xmon_flush(void *handle) +{ + if (xmon_outpos > 0) { + xmon_outbuf[xmon_outpos] = '\0'; + bgl_dprintf("%s\n", xmon_outbuf); + xmon_outpos = 0; + } +} + +static char xmon_readlen; +static char *xmon_readbufp; +static char xmon_readbuffer[256]; + +int +xmon_read(void *handle, void *ptr, int nb) +{ + if (xmon_readlen == 0) + xmon_readbufp = xmon_readbuffer; + while (xmon_readlen == 0) { + xmon_readlen = bgl_dread(xmon_readbuffer, sizeof(xmon_readbuffer)); + } + if (nb > xmon_readlen) + nb = xmon_readlen; + memcpy(ptr, xmon_readbufp, nb); + xmon_readbufp += nb; + xmon_readlen -= nb; + + return nb; +} +int +xmon_read_poll(void) +{ + return -1; +} +#else int xmon_write(void *handle, void *ptr, int nb) { @@ -209,8 +329,6 @@ ct = 1; --i; } else { - if (console) - printk("%c", c); ct = 0; } buf_access(); @@ -226,6 +344,11 @@ return nb; } +void +xmon_flush(void *handle) +{ +} + int xmon_wants_key; int xmon_adb_keycode; @@ -322,6 +445,7 @@ return *sccd; } + static unsigned char scc_inittab[] = { 13, 0, /* set baud rate divisor */ 12, 1, @@ -395,6 +519,7 @@ } } } +#endif #if 0 extern int (*prom_entry)(void *); diff -uNr linux-2.4.19/arch/ppc/xmon/start_8xx.c linux-2.4.19bgl/arch/ppc/xmon/start_8xx.c --- linux-2.4.19/arch/ppc/xmon/start_8xx.c 2001-10-08 13:40:13.000000000 -0500 +++ linux-2.4.19bgl/arch/ppc/xmon/start_8xx.c 2003-07-02 10:44:33.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.start_8xx.c 1.10 09/14/01 18:01:17 trini + * BK Id: SCCS/s.start_8xx.c 1.11 10/08/01 16:49:27 trini */ /* * Copyright (C) 1996 Paul Mackerras. diff -uNr linux-2.4.19/arch/ppc/xmon/subr_prf.c linux-2.4.19bgl/arch/ppc/xmon/subr_prf.c --- linux-2.4.19/arch/ppc/xmon/subr_prf.c 2002-02-25 13:37:55.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/xmon/subr_prf.c 2003-07-02 10:43:06.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.subr_prf.c 1.8 12/01/01 20:09:07 benh + * BK Id: SCCS/s.subr_prf.c 1.10 12/27/01 10:38:52 trini */ /* * Written by Cort Dougan to replace the version originally used diff -uNr linux-2.4.19/arch/ppc/xmon/xmon.c linux-2.4.19bgl/arch/ppc/xmon/xmon.c --- linux-2.4.19/arch/ppc/xmon/xmon.c 2002-02-25 13:37:55.000000000 -0600 +++ linux-2.4.19bgl/arch/ppc/xmon/xmon.c 2003-07-02 10:43:07.000000000 -0500 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.xmon.c 1.18 12/01/01 20:09:07 benh + * BK Id: SCCS/s.xmon.c 1.28 06/27/02 14:05:06 trini */ /* * Routines providing a simple monitor for use on the PowerMac. @@ -14,6 +14,9 @@ #include #include #include +#include + +#include "mmu_decl.h" #include "nonstdio.h" #include "privinst.h" @@ -203,6 +206,16 @@ */ #endif /* CONFIG_SMP */ remove_bpts(); +#ifdef CONFIG_PMAC_BACKLIGHT + if( setjmp(bus_error_jmp) == 0 ) { + debugger_fault_handler = handle_fault; + sync(); + set_backlight_enable(1); + set_backlight_level(BACKLIGHT_MAX); + sync(); + } + debugger_fault_handler = 0; +#endif /* CONFIG_PMAC_BACKLIGHT */ cmd = cmds(excp); if (cmd == 's') { xmon_trace[smp_processor_id()] = SSTEP; @@ -334,7 +347,7 @@ } store_inst((void *) bp->address); } -#if !defined(CONFIG_8xx) && !defined(CONFIG_POWER4) +#if !defined(CONFIG_8xx) if (dabr.enabled) set_dabr(dabr.address); if (iabr.enabled) @@ -349,7 +362,7 @@ struct bpt *bp; unsigned instr; -#if !defined(CONFIG_8xx) && !defined(CONFIG_POWER4) +#if !defined(CONFIG_8xx) set_dabr(0); set_iabr(0); #endif @@ -591,7 +604,7 @@ cmd = inchar(); switch (cmd) { -#if !defined(CONFIG_8xx) && !defined(CONFIG_POWER4) +#if !defined(CONFIG_8xx) case 'd': mode = 7; cmd = inchar(); @@ -921,15 +934,22 @@ } #endif +#ifndef CONFIG_PPC_STD_MMU +static void +dump_hash_table() +{ + printf("This CPU doesn't have a hash table.\n"); +} +#else + #ifndef CONFIG_PPC64BRIDGE static void dump_hash_table_seg(unsigned seg, unsigned start, unsigned end) { - extern void *Hash; - extern unsigned long Hash_size; - unsigned *htab = Hash; - unsigned hsize = Hash_size; - unsigned v, hmask, va, last_va; + void *htab = Hash; + unsigned long hsize = Hash_size; + unsigned long hmask; + unsigned v, va, last_va; int found, last_found, i; unsigned *hg, w1, last_w2, last_va0; @@ -984,11 +1004,10 @@ static void dump_hash_table_seg(unsigned seg, unsigned start, unsigned end) { - extern void *Hash; - extern unsigned long Hash_size; - unsigned *htab = Hash; - unsigned hsize = Hash_size; - unsigned v, hmask, va, last_va; + void *htab = Hash; + unsigned long hsize = Hash_size; + unsigned long hmask; + unsigned v, va, last_va; int found, last_found, i; unsigned *hg, w1, last_w2, last_va0; @@ -1050,6 +1069,8 @@ int seg; unsigned seg_start, seg_end; + if (Hash == NULL) + return; hash_ctx = 0; hash_start = 0; hash_end = 0xfffff000; @@ -1067,6 +1088,7 @@ seg_start = seg_end + 0x1000; } } +#endif /* CONFIG_PPC_STD_MMU */ /* * Stuff for reading and writing memory safely diff -uNr linux-2.4.19/drivers/Makefile linux-2.4.19bgl/drivers/Makefile --- linux-2.4.19/drivers/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/Makefile 2003-07-02 10:44:42.000000000 -0500 @@ -8,7 +8,7 @@ mod-subdirs := dio mtd sbus video macintosh usb input telephony sgi ide \ message/i2o message/fusion scsi md ieee1394 pnp isdn atm \ - fc4 net/hamradio i2c acpi bluetooth + fc4 net/hamradio i2c acpi bluetooth iseries subdir-y := parport char block net sound misc media cdrom hotplug subdir-m := $(subdir-y) @@ -25,6 +25,7 @@ subdir-$(CONFIG_VT) += video subdir-$(CONFIG_MAC) += macintosh subdir-$(CONFIG_PPC) += macintosh +subdir-$(CONFIG_PPC_ISERIES) += iseries subdir-$(CONFIG_USB) += usb subdir-$(CONFIG_INPUT) += input subdir-$(CONFIG_PHONE) += telephony diff -uNr linux-2.4.19/drivers/block/Config.in linux-2.4.19bgl/drivers/block/Config.in --- linux-2.4.19/drivers/block/Config.in 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/block/Config.in 2005-06-08 14:30:43.000000000 -0500 @@ -40,6 +40,7 @@ dep_tristate 'Micro Memory MM5415 Battery Backed RAM support' CONFIG_BLK_DEV_UMEM $CONFIG_PCI $CONFIG_EXPERIMENTAL tristate 'Loopback device support' CONFIG_BLK_DEV_LOOP +dep_tristate 'Twofish encryption for loop device' CONFIG_CIPHER_TWOFISH $CONFIG_BLK_DEV_LOOP dep_tristate 'Network block device support' CONFIG_BLK_DEV_NBD $CONFIG_NET tristate 'RAM disk support' CONFIG_BLK_DEV_RAM diff -uNr linux-2.4.19/drivers/block/Makefile linux-2.4.19bgl/drivers/block/Makefile --- linux-2.4.19/drivers/block/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/block/Makefile 2005-06-08 14:30:43.000000000 -0500 @@ -24,6 +24,7 @@ obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o obj-$(CONFIG_BLK_DEV_RAM) += rd.o obj-$(CONFIG_BLK_DEV_LOOP) += loop.o +obj-$(CONFIG_CIPHER_TWOFISH) += loop_fish2.o obj-$(CONFIG_BLK_DEV_PS2) += ps2esdi.o obj-$(CONFIG_BLK_DEV_XD) += xd.o obj-$(CONFIG_BLK_CPQ_DA) += cpqarray.o diff -uNr linux-2.4.19/drivers/block/genhd.c linux-2.4.19bgl/drivers/block/genhd.c --- linux-2.4.19/drivers/block/genhd.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/block/genhd.c 2003-07-02 10:43:22.000000000 -0500 @@ -213,6 +213,9 @@ #ifdef CONFIG_VT console_map_init(); #endif +#ifdef CONFIG_VIODASD + viodasd_init(); +#endif return 0; } diff -uNr linux-2.4.19/drivers/block/ll_rw_blk.c linux-2.4.19bgl/drivers/block/ll_rw_blk.c --- linux-2.4.19/drivers/block/ll_rw_blk.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/block/ll_rw_blk.c 2003-07-02 10:44:06.000000000 -0500 @@ -1345,6 +1345,9 @@ #ifdef CONFIG_BLK_DEV_XD xd_init(); #endif +#ifdef CONFIG_VIOCD + viocd_init(); +#endif #ifdef CONFIG_BLK_DEV_MFM mfm_init(); #endif diff -uNr linux-2.4.19/drivers/char/Config.in linux-2.4.19bgl/drivers/char/Config.in --- linux-2.4.19/drivers/char/Config.in 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/char/Config.in 2003-07-02 10:43:06.000000000 -0500 @@ -123,6 +123,21 @@ fi bool 'Enable Smart Card Reader 0 Support ' CONFIG_IT8172_SCR0 fi +if [ "$CONFIG_GT64260" = "y" ]; then + bool 'GT64xxx mpsc serial port support' CONFIG_GT64XXX_MPSC + if [ "$CONFIG_GT64XXX_MPSC" = "y" ]; then + bool ' MPSC Console support' CONFIG_GT64XXX_CONSOLE + if [ "$CONFIG_GT64XXX_CONSOLE" = "y" ]; then + define_bool CONFIG_SERIAL_CONSOLE y + choice 'Default console port' \ + "MPSC0 CONFIG_GT64XXX_CONSOLE_0 \ + MPSC1 CONFIG_GT64XXX_CONSOLE_1" MPSC0 + if [ "$CONFIG_USE_PPCBOOT" != "y" ]; then + int 'Serial Console Baudrate' CONFIG_SERIAL_CONSOLE_BAUD 115200 + fi + fi + fi +fi bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256 @@ -134,6 +149,13 @@ fi dep_tristate 'Support for user-space parallel port device drivers' CONFIG_PPDEV $CONFIG_PARPORT fi +if [ "$CONFIG_PPC64" = "y" ]; then + bool 'pSeries Hypervisor Virtual Console support' CONFIG_HVC_CONSOLE +fi + +if [ "$CONFIG_ALL_PPC" = "y" ]; then + tristate 'Total Impact briQ front panel driver' CONFIG_BRIQ_PANEL +fi source drivers/i2c/Config.in @@ -190,6 +212,9 @@ fi tristate ' Eurotech CPU-1220/1410 Watchdog Timer' CONFIG_EUROTECH_WDT tristate ' IB700 SBC Watchdog Timer' CONFIG_IB700_WDT + if [ "$CONFIG_40x" = "y" ]; then + tristate ' IBM PPC 405 Watchdog Timer' CONFIG_PPC405_WDT + fi tristate ' ICP ELectronics Wafer 5823 Watchdog' CONFIG_WAFER_WDT if [ "$CONFIG_SGI_IP22" = "y" ]; then dep_tristate ' Indy/I2 Hardware Watchdog' CONFIG_INDYDOG $CONFIG_SGI_IP22 @@ -228,7 +253,9 @@ dep_tristate 'Intel i8x0 Random Number Generator support' CONFIG_INTEL_RNG $CONFIG_PCI fi tristate '/dev/nvram support' CONFIG_NVRAM -tristate 'Enhanced Real Time Clock Support' CONFIG_RTC +if [ "$CONFIG_PPC_ISERIES" != "y" -a "$CONFIG_PPC_PSERIES" != "y" ]; then + tristate 'Enhanced Real Time Clock Support' CONFIG_RTC +fi if [ "$CONFIG_IA64" = "y" ]; then bool 'EFI Real Time Clock Services' CONFIG_EFI_RTC fi @@ -242,6 +269,9 @@ if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_X86" = "y" ]; then dep_tristate 'Sony Vaio Programmable I/O Control Device support' CONFIG_SONYPI $CONFIG_PCI fi +if [ "$CONFIG_IBM_OCP" = "y" ]; then + tristate 'IBM GPIO' CONFIG_IBM_OCP_GPIO +fi mainmenu_option next_comment comment 'Ftape, the floppy tape device driver' @@ -293,4 +323,8 @@ tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE fi +if [ "$CONFIG_XILINX_OCP" = "y" ]; then + tristate 'Xilinx on-chip GPIO' CONFIG_XILINX_GPIO +fi + endmenu diff -uNr linux-2.4.19/drivers/char/Makefile linux-2.4.19bgl/drivers/char/Makefile --- linux-2.4.19/drivers/char/Makefile 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/char/Makefile 2005-06-08 14:30:44.000000000 -0500 @@ -24,7 +24,7 @@ export-objs := busmouse.o console.o keyboard.o sysrq.o \ misc.o pty.o random.o selection.o serial.o \ sonypi.o tty_io.o tty_ioctl.o generic_serial.o \ - au1000_gpio.o + au1000_gpio.o ibm_ocp_gpio.o mod-subdirs := joystick ftape drm drm-4.0 pcmcia @@ -179,6 +179,8 @@ obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.o obj-$(CONFIG_SERIAL_TX3912) += generic_serial.o serial_tx3912.o obj-$(CONFIG_TXX927_SERIAL) += serial_txx927.o +obj-$(CONFIG_HVC_CONSOLE) += hvc_console.o +obj-$(CONFIG_GT64XXX_MPSC) += gt64xxx_mpsc.o subdir-$(CONFIG_RIO) += rio subdir-$(CONFIG_INPUT) += joystick @@ -205,7 +207,7 @@ obj-$(CONFIG_MK712_MOUSE) += mk712.o obj-$(CONFIG_RTC) += rtc.o obj-$(CONFIG_EFI_RTC) += efirtc.o -ifeq ($(CONFIG_PPC),) +ifeq ($(CONFIG_ALL_PPC),) obj-$(CONFIG_NVRAM) += nvram.o endif obj-$(CONFIG_TOSHIBA) += toshiba.o @@ -213,6 +215,7 @@ obj-$(CONFIG_DS1620) += ds1620.o obj-$(CONFIG_INTEL_RNG) += i810_rng.o obj-$(CONFIG_AMD_RNG) += amd768_rng.o +obj-$(CONFIG_BRIQ_PANEL) += briq_panel.o obj-$(CONFIG_ITE_GPIO) += ite_gpio.o obj-$(CONFIG_AU1000_GPIO) += au1000_gpio.o @@ -262,12 +265,28 @@ obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o +obj-$(CONFIG_PPC405_WDT) += ppc405_wdt.o +obj-$(CONFIG_IBM_OCP_GPIO) += ibm_ocp_gpio.o + +mod-subdirs += xilinx_gpio +subdir-$(CONFIG_XILINX_GPIO) += xilinx_gpio +obj-$(CONFIG_XILINX_GPIO) += xilinx_gpio/xilinx_gpio.o +ifeq ($(CONFIG_VIRTEX_II_PRO),y) + ifeq ($(CONFIG_VT),y) + ifeq ($(CONFIG_PC_KEYBOARD),y) + subdir-$(CONFIG_VT) += xilinx_keyb + obj-$(CONFIG_VT) += xilinx_keyb/xilinx_keyb.o + endif + endif +endif subdir-$(CONFIG_MWAVE) += mwave ifeq ($(CONFIG_MWAVE),y) obj-y += mwave/mwave.o endif +obj-$(CONFIG_BGL) += bglcons.o + include $(TOPDIR)/Rules.make fastdep: diff -uNr linux-2.4.19/drivers/char/console.c linux-2.4.19bgl/drivers/char/console.c --- linux-2.4.19/drivers/char/console.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/char/console.c 2003-07-02 10:44:31.000000000 -0500 @@ -2992,13 +2992,21 @@ static int pm_con_request(struct pm_dev *dev, pm_request_t rqst, void *data) { + int save_vesa_interval; + switch (rqst) { case PM_RESUME: unblank_screen(); break; case PM_SUSPEND: + /* We temporarily set vesa_off_interval to prevent + * firing up the console timer during suspend + */ + save_vesa_interval = vesa_off_interval; + vesa_off_interval = 0; do_blank_screen(0); + vesa_off_interval = save_vesa_interval; break; } return 0; diff -uNr linux-2.4.19/drivers/char/drm/r128_state.c linux-2.4.19bgl/drivers/char/drm/r128_state.c --- linux-2.4.19/drivers/char/drm/r128_state.c 2001-08-08 11:42:15.000000000 -0500 +++ linux-2.4.19bgl/drivers/char/drm/r128_state.c 2005-06-08 14:30:43.000000000 -0500 @@ -23,8 +23,20 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * RED HAT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * THIS SOFTWARE IS NOT INTENDED FOR USE IN SAFETY CRITICAL SYSTEMS + * * Authors: * Gareth Hughes + * + * Memory allocation size checks added 14/01/2003, Alan Cox */ #define __NO_VERSION__ @@ -903,6 +915,9 @@ DRM_DEBUG( "%s\n", __FUNCTION__ ); count = depth->n; + + if( count > 4096 ) + return -EMSGSIZE; if ( copy_from_user( &x, depth->x, sizeof(x) ) ) { return -EFAULT; } @@ -996,6 +1011,9 @@ DRM_DEBUG( "%s\n", __FUNCTION__ ); count = depth->n; + + if( count > 4096 ) + return -EMSGSIZE; x = kmalloc( count * sizeof(*x), GFP_KERNEL ); if ( x == NULL ) { @@ -1111,6 +1129,9 @@ DRM_DEBUG( "%s\n", __FUNCTION__ ); count = depth->n; + + if ( count > 4096 ) + return -EMSGSIZE; if ( copy_from_user( &x, depth->x, sizeof(x) ) ) { return -EFAULT; } diff -uNr linux-2.4.19/drivers/char/drm-4.0/r128_state.c linux-2.4.19bgl/drivers/char/drm-4.0/r128_state.c --- linux-2.4.19/drivers/char/drm-4.0/r128_state.c 2002-02-25 13:37:57.000000000 -0600 +++ linux-2.4.19bgl/drivers/char/drm-4.0/r128_state.c 2005-06-08 14:30:47.000000000 -0500 @@ -1235,6 +1235,8 @@ } count = depth->n; + if ( count > 4096 || count <= 0) + return -EMSGSIZE; if ( count > dev_priv->depth_pitch ) { count = dev_priv->depth_pitch; } diff -uNr linux-2.4.19/drivers/char/serial.c linux-2.4.19bgl/drivers/char/serial.c --- linux-2.4.19/drivers/char/serial.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/char/serial.c 2003-07-02 10:43:21.000000000 -0500 @@ -236,9 +236,7 @@ #include #include -#if defined(CONFIG_MAC_SERIAL) -#define SERIAL_DEV_OFFSET ((_machine == _MACH_prep || _machine == _MACH_chrp) ? 0 : 2) -#else +#ifndef SERIAL_DEV_OFFSET #define SERIAL_DEV_OFFSET 0 #endif @@ -1335,8 +1333,8 @@ /* * Allocate the IRQ if necessary */ - if (state->irq && (!IRQ_ports[state->irq] || - !IRQ_ports[state->irq]->next_port)) { + if (!IRQ_ports[state->irq] || + !IRQ_ports[state->irq]->next_port) { if (IRQ_ports[state->irq]) { #ifdef CONFIG_SERIAL_SHARE_IRQ free_irq(state->irq, &IRQ_ports[state->irq]); @@ -1501,7 +1499,7 @@ /* * Free the IRQ, if necessary */ - if (state->irq && (!IRQ_ports[state->irq] || + if ((!IRQ_ports[state->irq] || !IRQ_ports[state->irq]->next_port)) { if (IRQ_ports[state->irq]) { free_irq(state->irq, &IRQ_ports[state->irq]); diff -uNr linux-2.4.19/drivers/char/tty_io.c linux-2.4.19bgl/drivers/char/tty_io.c --- linux-2.4.19/drivers/char/tty_io.c 2002-08-02 19:39:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/char/tty_io.c 2005-06-08 14:30:43.000000000 -0500 @@ -162,6 +162,10 @@ extern void tx3912_rs_init(void); extern void txx927_console_init(void); extern void sb1250_serial_console_init(void); +extern void viocons_init(void); +extern void viocons_init2(void); +extern void gt64xxx_mpsc_console_init(void); +extern void sicc_console_init(void); #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) @@ -1692,8 +1696,18 @@ /* the driver doesn't support them. */ case TCSBRK: case TCSBRKP: - if (!tty->driver.ioctl) + if (!tty->driver.ioctl){ + if (cmd == TCSBRK && arg) { + /* tcdrain case */ + retval = tty_check_change(tty); + if (retval) + return retval; + tty_wait_until_sent(tty,0); + if (signal_pending(current)) + return -EINTR; + } return 0; + } retval = tty->driver.ioctl(tty, file, cmd, arg); if (retval == -ENOIOCTLCMD) retval = 0; @@ -2184,12 +2198,20 @@ * set up the console device so that later boot sequences can * inform about problems etc.. */ + +#ifdef CONFIG_VIOCONS + viocons_init(); +#endif + #ifdef CONFIG_VT con_init(); #endif #ifdef CONFIG_AU1000_SERIAL_CONSOLE au1000_serial_console_init(); #endif +#ifdef CONFIG_SERIAL_SICC_CONSOLE + sicc_console_init(); +#endif #ifdef CONFIG_SERIAL_CONSOLE #if (defined(CONFIG_8xx) || defined(CONFIG_8260)) console_8xx_init(); @@ -2251,6 +2273,12 @@ #ifdef CONFIG_SIBYTE_SB1250_DUART_CONSOLE sb1250_serial_console_init(); #endif +#ifdef CONFIG_HVC_CONSOLE + hvc_console_init(); +#endif +#ifdef CONFIG_GT64XXX_CONSOLE + gt64xxx_mpsc_console_init(); +#endif } static struct tty_driver dev_tty_driver, dev_syscons_driver; @@ -2301,6 +2329,10 @@ /* console calls tty_register_driver() before kmalloc() works. * Thus, we can't devfs_register() then. Do so now, instead. */ +#ifdef CONFIG_VIOCONS + viocons_init2(); +#endif + #ifdef CONFIG_VT con_init_devfs(); #endif diff -uNr linux-2.4.19/drivers/char/tty_ioctl.c linux-2.4.19bgl/drivers/char/tty_ioctl.c --- linux-2.4.19/drivers/char/tty_ioctl.c 2001-09-18 00:52:35.000000000 -0500 +++ linux-2.4.19bgl/drivers/char/tty_ioctl.c 2005-06-08 14:30:44.000000000 -0500 @@ -394,7 +394,7 @@ return -EFAULT; return 0; case TCSETSF: - return set_termios(real_tty, arg, TERMIOS_FLUSH); + return set_termios(real_tty, arg, TERMIOS_FLUSH | TERMIOS_WAIT); case TCSETSW: return set_termios(real_tty, arg, TERMIOS_WAIT); case TCSETS: @@ -402,7 +402,7 @@ case TCGETA: return get_termio(real_tty,(struct termio *) arg); case TCSETAF: - return set_termios(real_tty, arg, TERMIOS_FLUSH | TERMIOS_TERMIO); + return set_termios(real_tty, arg, TERMIOS_FLUSH | TERMIOS_WAIT | TERMIOS_TERMIO); case TCSETAW: return set_termios(real_tty, arg, TERMIOS_WAIT | TERMIOS_TERMIO); case TCSETA: diff -uNr linux-2.4.19/drivers/char/vt.c linux-2.4.19bgl/drivers/char/vt.c --- linux-2.4.19/drivers/char/vt.c 2001-11-16 12:08:28.000000000 -0600 +++ linux-2.4.19bgl/drivers/char/vt.c 2003-07-02 10:43:53.000000000 -0500 @@ -90,7 +90,8 @@ * comments - KDMKTONE doesn't put the process to sleep. */ -#if defined(__i386__) || defined(__alpha__) || defined(__powerpc__) \ +#if defined(__i386__) || defined(__alpha__) \ + || (defined(__powerpc__) && !defined(CONFIG_REDWOOD_4)) \ || (defined(__mips__) && defined(CONFIG_ISA)) \ || (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE)) \ || defined(__x86_64__) diff -uNr linux-2.4.19/drivers/i2c/Config.in linux-2.4.19bgl/drivers/i2c/Config.in --- linux-2.4.19/drivers/i2c/Config.in 2002-02-25 13:37:57.000000000 -0600 +++ linux-2.4.19bgl/drivers/i2c/Config.in 2003-07-02 10:43:23.000000000 -0500 @@ -32,13 +32,17 @@ dep_tristate ' Embedded Planet RPX Lite/Classic suppoort' CONFIG_I2C_RPXLITE $CONFIG_I2C_ALGO8XX fi fi - if [ "$CONFIG_405" = "y" ]; then - dep_tristate 'PPC 405 I2C Algorithm' CONFIG_I2C_PPC405_ALGO $CONFIG_I2C - if [ "$CONFIG_I2C_PPC405_ALGO" != "n" ]; then - dep_tristate ' PPC 405 I2C Adapter' CONFIG_I2C_PPC405_ADAP $CONFIG_I2C_PPC405_ALGO + if [ "$CONFIG_IBM_OCP" = "y" ]; then + dep_tristate 'IBM on-chip I2C Algorithm' CONFIG_I2C_IBM_OCP_ALGO $CONFIG_I2C + if [ "$CONFIG_I2C_IBM_OCP_ALGO" != "n" ]; then + dep_tristate ' IBM on-chip I2C Adapter' CONFIG_I2C_IBM_OCP_ADAP $CONFIG_I2C_IBM_OCP_ALGO fi fi + if [ "$CONFIG_XILINX_OCP" = "y" ]; then + dep_tristate 'Xilinx on-chip I2C' CONFIG_I2C_XILINX $CONFIG_I2C + fi + if [ "$CONFIG_ALL_PPC" = "y" ] ; then dep_tristate 'Keywest I2C interface in Apple Core99 machines' CONFIG_I2C_KEYWEST $CONFIG_I2C fi diff -uNr linux-2.4.19/drivers/i2c/Makefile linux-2.4.19bgl/drivers/i2c/Makefile --- linux-2.4.19/drivers/i2c/Makefile 2002-02-25 13:37:57.000000000 -0600 +++ linux-2.4.19bgl/drivers/i2c/Makefile 2003-07-02 10:44:08.000000000 -0500 @@ -5,7 +5,8 @@ O_TARGET := i2c.o export-objs := i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o \ - i2c-algo-ite.o i2c-proc.o + i2c-algo-ite.o i2c-algo-ibm_ocp.o i2c-proc.o +mod-subdirs := xilinx_iic obj-$(CONFIG_I2C) += i2c-core.o obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o @@ -18,7 +19,14 @@ obj-$(CONFIG_ITE_I2C_ALGO) += i2c-algo-ite.o obj-$(CONFIG_ITE_I2C_ADAP) += i2c-adap-ite.o obj-$(CONFIG_I2C_PROC) += i2c-proc.o +obj-$(CONFIG_I2C_ALGO8XX) += i2c-algo-8xx.o +obj-$(CONFIG_I2C_IBM_OCP_ALGO) += i2c-algo-ibm_ocp.o +obj-$(CONFIG_I2C_IBM_OCP_ADAP) += i2c-adap-ibm_ocp.o +obj-$(CONFIG_I2C_RPXLITE) += i2c-rpx.o obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest.o +subdir-$(CONFIG_I2C_XILINX) += xilinx_iic +obj-$(CONFIG_I2C_XILINX) += xilinx_iic/xilinx_iic.o + # This is needed for automatic patch generation: sensors code starts here # This is needed for automatic patch generation: sensors code ends here diff -uNr linux-2.4.19/drivers/ide/Config.in linux-2.4.19bgl/drivers/ide/Config.in --- linux-2.4.19/drivers/ide/Config.in 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/ide/Config.in 2003-07-02 10:43:23.000000000 -0500 @@ -110,6 +110,17 @@ if [ "$CONFIG_SIBYTE_SWARM" = "y" ]; then bool ' SWARM onboard IDE support' CONFIG_BLK_DEV_IDE_SWARM fi + + if [ "$CONFIG_REDWOOD_4" = "y" ] ; then + bool ' STB3xxx IDE support ' CONFIG_BLK_DEV_REDWOOD_IDE + fi + if [ "$CONFIG_IBM_OCP" = "y" ]; then + bool ' IBM on-chip IDE' CONFIG_IBM_OCP_IDE + fi + if [ "$CONFIG_REDWOOD_6" = "y" ] ; then + bool ' STBx25xx IDE support ' CONFIG_BLK_DEV_REDWOOD6_IDE + fi + if [ "$CONFIG_ARCH_ACORN" = "y" ]; then dep_bool ' ICS IDE interface support' CONFIG_BLK_DEV_IDE_ICSIDE $CONFIG_ARCH_ACORN dep_bool ' ICS DMA support' CONFIG_BLK_DEV_IDEDMA_ICS $CONFIG_BLK_DEV_IDE_ICSIDE @@ -130,6 +141,9 @@ if [ "$CONFIG_MAC" = "y" ]; then dep_bool ' Macintosh Quadra/Powerbook IDE interface support' CONFIG_BLK_DEV_MAC_IDE $CONFIG_MAC fi + if [ "$CONFIG_CPCI405" = "y" ]; then + dep_bool ' CPCI-405 IDE interface support' CONFIG_BLK_DEV_CPCI405_IDE $CONFIG_CPCI405 + fi if [ "$CONFIG_Q40" = "y" ]; then dep_bool ' Q40/Q60 IDE interface support' CONFIG_BLK_DEV_Q40IDE $CONFIG_Q40 fi @@ -177,7 +191,10 @@ bool ' IGNORE word93 Validation BITS' CONFIG_IDEDMA_IVB fi -if [ "$CONFIG_BLK_DEV_TIVO" = "y" ]; then +if [ "$CONFIG_BLK_DEV_TIVO" = "y" -o \ + "$CONFIG_BLK_DEV_REDWOOD_IDE" = "y" -o \ + "$CONFIG_BLK_DEV_REDWOOD6_IDE" = "y" -o \ + "$CONFIG_IBM_OCP_IDE" = "y" ]; then define_bool CONFIG_DMA_NONPCI y else define_bool CONFIG_DMA_NONPCI n @@ -203,6 +220,7 @@ "$CONFIG_BLK_DEV_SLC90E66" = "y" -o \ "$CONFIG_BLK_DEV_SL82C105" = "y" -o \ "$CONFIG_BLK_DEV_VIA82CXXX" = "y" -o \ + "$CONFIG_STB03xxx" = "y" -o \ "$CONFIG_BLK_DEV_MPC8xx_IDE" = "y" ]; then define_bool CONFIG_BLK_DEV_IDE_MODES y else diff -uNr linux-2.4.19/drivers/ide/Makefile linux-2.4.19bgl/drivers/ide/Makefile --- linux-2.4.19/drivers/ide/Makefile 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/ide/Makefile 2003-07-02 10:44:08.000000000 -0500 @@ -34,6 +34,7 @@ ide-obj-$(CONFIG_BLK_DEV_BUDDHA) += buddha.o ide-obj-$(CONFIG_BLK_DEV_CMD640) += cmd640.o ide-obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o +ide-obj-$(CONFIG_BLK_DEV_CPCI405_IDE) += cpci405ide.o ide-obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o ide-obj-$(CONFIG_BLK_DEV_CY82C693) += cy82c693.o ide-obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o @@ -68,6 +69,10 @@ ide-obj-$(CONFIG_BLK_DEV_UMC8672) += umc8672.o ide-obj-$(CONFIG_BLK_DEV_VIA82CXXX) += via82cxxx.o ide-obj-$(CONFIG_BLK_DEV_MPC8xx_IDE) += ide-m8xx.o +ide-obj-$(CONFIG_BLK_DEV_REDWOOD_IDE) += stb03xxx.o +ide-obj-$(CONFIG_IBM_OCP_IDE) += ibm_ocp_ide.o +ide-obj-$(CONFIG_BLK_DEV_REDWOOD6_IDE) += ocp_stbxxxxx.o + # The virtualised raid layers MUST come after the ide itself or bad stuff # will happen. diff -uNr linux-2.4.19/drivers/ide/aec62xx.c linux-2.4.19bgl/drivers/ide/aec62xx.c --- linux-2.4.19/drivers/ide/aec62xx.c 2000-06-20 09:52:36.000000000 -0500 +++ linux-2.4.19bgl/drivers/ide/aec62xx.c 2003-07-02 10:44:09.000000000 -0500 @@ -51,6 +51,21 @@ extern char *ide_media_verbose(ide_drive_t *); static struct pci_dev *bmide_dev; +static const char *aec6280_get_speed(u8 speed) +{ + switch(speed) { + case 7: return "6"; + case 6: return "5"; + case 5: return "4"; + case 4: return "3"; + case 3: return "2"; + case 2: return "1"; + case 1: return "0"; + case 0: return "?"; + } + return "?"; +} + static int aec62xx_get_info (char *buffer, char **addr, off_t offset, int count) { char *p = buffer; @@ -69,6 +84,12 @@ case PCI_DEVICE_ID_ARTOP_ATP860R: p += sprintf(p, "\n AEC6260 Chipset.\n"); break; + case PCI_DEVICE_ID_ARTOP_ATP865: + p += sprintf(p, "\n AEC6280 Chipset without ROM.\n"); + break; + case PCI_DEVICE_ID_ARTOP_ATP865R: + p += sprintf(p, "\n AEC6280 Chipset with ROM.\n"); + break; default: p += sprintf(p, "\n AEC62?? Chipset.\n"); break; @@ -153,6 +174,41 @@ (void) pci_read_config_byte(bmide_dev, 0x4a, &uart); p += sprintf(p, "reg4ah = 0x%02x\n", uart); break; + case PCI_DEVICE_ID_ARTOP_ATP865: + case PCI_DEVICE_ID_ARTOP_ATP865R: + (void) pci_read_config_byte(bmide_dev, 0x44, &art); + p += sprintf(p, "DMA Mode: %s(%s) %s(%s)", + (c0&0x20)?((art&0x0f)?"UDMA":" DMA"):" PIO", + aec6280_get_speed(art&0x0f), + (c0&0x40)?((art&0xf0)?"UDMA":" DMA"):" PIO", + aec6280_get_speed(art>>4)); + (void) pci_read_config_byte(bmide_dev, 0x45, &art); + p += sprintf(p, " %s(%s) %s(%s)\n", + (c0&0x20)?((art&0x0f)?"UDMA":" DMA"):" PIO", + aec6280_get_speed(art&0x0f), + (c0&0x40)?((art&0xf0)?"UDMA":" DMA"):" PIO", + aec6280_get_speed(art>>4)); + (void) pci_read_config_byte(bmide_dev, 0x40, &art); + p += sprintf(p, "Active: 0x%02x", HIGH_4(art)); + (void) pci_read_config_byte(bmide_dev, 0x41, &art); + p += sprintf(p, " 0x%02x", HIGH_4(art)); + (void) pci_read_config_byte(bmide_dev, 0x42, &art); + p += sprintf(p, " 0x%02x", HIGH_4(art)); + (void) pci_read_config_byte(bmide_dev, 0x43, &art); + p += sprintf(p, " 0x%02x\n", HIGH_4(art)); + (void) pci_read_config_byte(bmide_dev, 0x40, &art); + p += sprintf(p, "Recovery: 0x%02x", LOW_4(art)); + (void) pci_read_config_byte(bmide_dev, 0x41, &art); + p += sprintf(p, " 0x%02x", LOW_4(art)); + (void) pci_read_config_byte(bmide_dev, 0x42, &art); + p += sprintf(p, " 0x%02x", LOW_4(art)); + (void) pci_read_config_byte(bmide_dev, 0x43, &art); + p += sprintf(p, " 0x%02x\n", LOW_4(art)); + (void) pci_read_config_byte(bmide_dev, 0x49, &uart); + p += sprintf(p, "reg49h = 0x%02x ", uart); + (void) pci_read_config_byte(bmide_dev, 0x4a, &uart); + p += sprintf(p, "reg4ah = 0x%02x\n", uart); + break; default: break; } @@ -177,6 +233,8 @@ struct chipset_bus_clock_list_entry aec62xx_base [] = { #ifdef CONFIG_BLK_DEV_IDEDMA + { XFER_UDMA_6, 0x41, 0x06, 0x31, 0x07 }, + { XFER_UDMA_5, 0x41, 0x05, 0x31, 0x06 }, { XFER_UDMA_4, 0x41, 0x04, 0x31, 0x05 }, { XFER_UDMA_3, 0x41, 0x03, 0x31, 0x04 }, { XFER_UDMA_2, 0x41, 0x02, 0x31, 0x03 }, @@ -399,6 +457,58 @@ ide_dma_off_quietly); } +static int config_aec6280_chipset_for_dma (ide_drive_t *drive, byte ultra) +{ + struct hd_driveid *id = drive->id; + ide_hwif_t *hwif = HWIF(drive); + byte unit = (drive->select.b.unit & 0x01); + unsigned long dma_base = hwif->dma_base; + byte speed = -1; + byte ultra66 = eighty_ninty_three(drive); + + if (drive->media != ide_disk) + return ((int) ide_dma_off_quietly); + + if ((id->dma_ultra & 0x0040) && (ultra) && (ultra66)) { + speed = XFER_UDMA_6; + } else if ((id->dma_ultra & 0x0020) && (ultra) && (ultra66)) { + speed = XFER_UDMA_5; + } else if ((id->dma_ultra & 0x0010) && (ultra) && (ultra66)) { + speed = XFER_UDMA_4; + } else if ((id->dma_ultra & 0x0008) && (ultra) && (ultra66)) { + speed = XFER_UDMA_3; + } else if ((id->dma_ultra & 0x0004) && (ultra)) { + speed = XFER_UDMA_2; + } else if ((id->dma_ultra & 0x0002) && (ultra)) { + speed = XFER_UDMA_1; + } else if ((id->dma_ultra & 0x0001) && (ultra)) { + speed = XFER_UDMA_0; + } else if (id->dma_mword & 0x0004) { + speed = XFER_MW_DMA_2; + } else if (id->dma_mword & 0x0002) { + speed = XFER_MW_DMA_1; + } else if (id->dma_mword & 0x0001) { + speed = XFER_MW_DMA_0; + } else if (id->dma_1word & 0x0004) { + speed = XFER_SW_DMA_2; + } else if (id->dma_1word & 0x0002) { + speed = XFER_SW_DMA_1; + } else if (id->dma_1word & 0x0001) { + speed = XFER_SW_DMA_0; + } else { + return ((int) ide_dma_off_quietly); + } + + outb(inb(dma_base+2) & ~(1<<(5+unit)), dma_base+2); + (void) aec6260_tune_chipset(drive, speed); + + return ((int) ((id->dma_ultra >> 11) & 3) ? ide_dma_on : + ((id->dma_ultra >> 8) & 7) ? ide_dma_on : + ((id->dma_mword >> 8) & 7) ? ide_dma_on : + ((id->dma_1word >> 8) & 7) ? ide_dma_on : + ide_dma_off_quietly); +} + static int config_chipset_for_dma (ide_drive_t *drive, byte ultra) { switch(HWIF(drive)->pci_dev->device) { @@ -407,6 +517,9 @@ case PCI_DEVICE_ID_ARTOP_ATP860: case PCI_DEVICE_ID_ARTOP_ATP860R: return config_aec6260_chipset_for_dma(drive, ultra); + case PCI_DEVICE_ID_ARTOP_ATP865: + case PCI_DEVICE_ID_ARTOP_ATP865R: + return config_aec6260_chipset_for_dma(drive, ultra); default: return ((int) ide_dma_off_quietly); } @@ -433,6 +546,8 @@ (void) aec6210_tune_chipset(drive, speed); case PCI_DEVICE_ID_ARTOP_ATP860: case PCI_DEVICE_ID_ARTOP_ATP860R: + case PCI_DEVICE_ID_ARTOP_ATP865: + case PCI_DEVICE_ID_ARTOP_ATP865R: (void) aec6260_tune_chipset(drive, speed); default: break; @@ -551,6 +666,31 @@ void __init ide_init_aec62xx (ide_hwif_t *hwif) { + byte reg49h = 0; + byte reg4ah = 0; + + switch(hwif->pci_dev->device) { + case PCI_DEVICE_ID_ARTOP_ATP865: + case PCI_DEVICE_ID_ARTOP_ATP865R: + /* Clear reset and test bits. */ + pci_read_config_byte(hwif->pci_dev, 0x49, ®49h); + pci_write_config_byte(hwif->pci_dev, 0x49, reg49h & ~0x30); + /* Enable chip interrupt output. */ + pci_read_config_byte(hwif->pci_dev, 0x4a, ®4ah); + pci_write_config_byte(hwif->pci_dev, 0x4a, reg4ah & ~0x01); +#define CONFIG_AEC6280_BURST +#ifdef CONFIG_AEC6280_BURST + /* Must be greater than 0x80 for burst mode. */ + pci_write_config_byte(hwif->pci_dev, PCI_LATENCY_TIMER, 0x90); + /* Enable burst mode. */ + pci_read_config_byte(hwif->pci_dev, 0x4a, ®4ah); + pci_write_config_byte(hwif->pci_dev, 0x4a, reg4ah | 0x80); +#endif + break; + default: + break; + } + #ifdef CONFIG_AEC62XX_TUNING hwif->tuneproc = &aec62xx_tune_drive; hwif->speedproc = &aec62xx_tune_chipset; @@ -570,13 +710,20 @@ unsigned long flags; byte reg54h = 0; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ + switch(hwif->pci_dev->device) { + case PCI_DEVICE_ID_ARTOP_ATP865: + case PCI_DEVICE_ID_ARTOP_ATP865R: + break; + default: + __save_flags(flags); /* local CPU only */ + __cli(); /* local CPU only */ - pci_read_config_byte(hwif->pci_dev, 0x54, ®54h); - pci_write_config_byte(hwif->pci_dev, 0x54, reg54h & ~(hwif->channel ? 0xF0 : 0x0F)); + pci_read_config_byte(hwif->pci_dev, 0x54, ®54h); + pci_write_config_byte(hwif->pci_dev, 0x54, reg54h & ~(hwif->channel ? 0xF0 : 0x0F)); - __restore_flags(flags); /* local CPU only */ + __restore_flags(flags); /* local CPU only */ + break; + } #endif /* CONFIG_AEC62XX_TUNING */ ide_setup_dma(hwif, dmabase, 8); } diff -uNr linux-2.4.19/drivers/ide/ide-cs.c linux-2.4.19bgl/drivers/ide/ide-cs.c --- linux-2.4.19/drivers/ide/ide-cs.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/ide/ide-cs.c 2003-07-02 10:43:48.000000000 -0500 @@ -92,10 +92,11 @@ int ndev; dev_node_t node; int hd; + struct tq_struct rel_task; } ide_info_t; static void ide_config(dev_link_t *link); -static void ide_release(u_long arg); +static void ide_release(void *arg); static int ide_event(event_t event, int priority, event_callback_args_t *args); @@ -136,9 +137,8 @@ if (!info) return NULL; memset(info, 0, sizeof(*info)); link = &info->link; link->priv = info; + INIT_TQUEUE(&info->rel_task, ide_release, link); - link->release.function = &ide_release; - link->release.data = (u_long)link; link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; link->io.IOAddrLines = 3; @@ -187,6 +187,7 @@ static void ide_detach(dev_link_t *link) { dev_link_t **linkp; + ide_info_t *info = link->priv; int ret; DEBUG(0, "ide_detach(0x%p)\n", link); @@ -197,9 +198,10 @@ if (*linkp == NULL) return; - del_timer(&link->release); - if (link->state & DEV_CONFIG) - ide_release((u_long)link); + if (link->state & DEV_CONFIG) { + schedule_task(&info->rel_task); + flush_scheduled_tasks(); + } if (link->handle) { ret = CardServices(DeregisterClient, link->handle); @@ -209,7 +211,7 @@ /* Unlink, free device structure */ *linkp = link->next; - kfree(link->priv); + kfree(info); } /* ide_detach */ @@ -337,6 +339,8 @@ if (link->io.NumPorts2) release_region(link->io.BasePort2, link->io.NumPorts2); + outb(0x02, ctl_base); // Set nIEN = disable device interrupts + /* retry registration in case device is still spinning up */ for (i = 0; i < 10; i++) { if (ctl_base) @@ -381,7 +385,7 @@ cs_failed: cs_error(link->handle, last_fn, last_ret); failed: - ide_release((u_long)link); + ide_release(link); } /* ide_config */ @@ -393,12 +397,15 @@ ======================================================================*/ -void ide_release(u_long arg) +static void ide_release(void *arg) { - dev_link_t *link = (dev_link_t *)arg; + dev_link_t *link = arg; ide_info_t *info = link->priv; - DEBUG(0, "ide_release(0x%p)\n", link); + if (!(link->state & DEV_CONFIG)) + return; + + DEBUG(0, "ide_do_release(0x%p)\n", link); if (info->ndev) { ide_unregister(info->hd); @@ -433,6 +440,7 @@ event_callback_args_t *args) { dev_link_t *link = args->client_data; + ide_info_t *info = link->priv; DEBUG(1, "ide_event(0x%06x)\n", event); @@ -440,7 +448,7 @@ case CS_EVENT_CARD_REMOVAL: link->state &= ~DEV_PRESENT; if (link->state & DEV_CONFIG) - mod_timer(&link->release, jiffies + HZ/20); + schedule_task(&info->rel_task); break; case CS_EVENT_CARD_INSERTION: link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; diff -uNr linux-2.4.19/drivers/ide/ide-features.c linux-2.4.19bgl/drivers/ide/ide-features.c --- linux-2.4.19/drivers/ide/ide-features.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/ide/ide-features.c 2003-07-02 10:43:06.000000000 -0500 @@ -278,7 +278,11 @@ #if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI) byte unit = (drive->select.b.unit & 0x01); - outb(inb(hwif->dma_base+2) & ~(1<<(5+unit)), hwif->dma_base+2); + /* Some interfaces would like to use this routine, but don"t have this + * kind of DMA engine. --BenH. + */ + if (hwif->dma_base) + outb(inb(hwif->dma_base+2) & ~(1<<(5+unit)), hwif->dma_base+2); #endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */ /* @@ -347,10 +351,15 @@ drive->id->dma_1word &= ~0x0F00; #if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI) - if (speed > XFER_PIO_4) { - outb(inb(hwif->dma_base+2)|(1<<(5+unit)), hwif->dma_base+2); - } else { - outb(inb(hwif->dma_base+2) & ~(1<<(5+unit)), hwif->dma_base+2); + /* Some interfaces would like to use this routine, but don"t have this + * kind of DMA engine. --BenH. + */ + if (hwif->dma_base) { + if (speed > XFER_PIO_4) { + outb(inb(hwif->dma_base+2)|(1<<(5+unit)), hwif->dma_base+2); + } else { + outb(inb(hwif->dma_base+2) & ~(1<<(5+unit)), hwif->dma_base+2); + } } #endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */ diff -uNr linux-2.4.19/drivers/ide/ide-pci.c linux-2.4.19bgl/drivers/ide/ide-pci.c --- linux-2.4.19/drivers/ide/ide-pci.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/ide/ide-pci.c 2003-07-02 10:43:31.000000000 -0500 @@ -73,6 +73,8 @@ #define DEVID_AEC6210 ((ide_pci_devid_t){PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP850UF}) #define DEVID_AEC6260 ((ide_pci_devid_t){PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860}) #define DEVID_AEC6260R ((ide_pci_devid_t){PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860R}) +#define DEVID_AEC6280 ((ide_pci_devid_t){PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865}) +#define DEVID_AEC6280R ((ide_pci_devid_t){PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865R}) #define DEVID_W82C105 ((ide_pci_devid_t){PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105}) #define DEVID_UM8673F ((ide_pci_devid_t){PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8673F}) #define DEVID_UM8886A ((ide_pci_devid_t){PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886A}) @@ -444,6 +446,8 @@ {DEVID_AEC6210, "AEC6210", PCI_AEC62XX, NULL, INIT_AEC62XX, DMA_AEC62XX, {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, OFF_BOARD, 0 }, {DEVID_AEC6260, "AEC6260", PCI_AEC62XX, ATA66_AEC62XX, INIT_AEC62XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, NEVER_BOARD, 0 }, {DEVID_AEC6260R,"AEC6260R", PCI_AEC62XX, ATA66_AEC62XX, INIT_AEC62XX, NULL, {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, OFF_BOARD, 0 }, + {DEVID_AEC6280, "AEC6280", PCI_AEC62XX, ATA66_AEC62XX, INIT_AEC62XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0 }, + {DEVID_AEC6280R,"AEC6280R", PCI_AEC62XX, ATA66_AEC62XX, INIT_AEC62XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0 }, {DEVID_W82C105, "W82C105", PCI_W82C105, NULL, INIT_W82C105, DMA_W82C105, {{0x40,0x01,0x01}, {0x40,0x10,0x10}}, ON_BOARD, 0 }, {DEVID_UM8673F, "UM8673F", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, {DEVID_UM8886A, "UM8886A", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, @@ -486,6 +490,8 @@ case PCI_DEVICE_ID_ARTOP_ATP850UF: case PCI_DEVICE_ID_ARTOP_ATP860: case PCI_DEVICE_ID_ARTOP_ATP860R: + case PCI_DEVICE_ID_ARTOP_ATP865: + case PCI_DEVICE_ID_ARTOP_ATP865R: return dev->irq; default: break; @@ -809,6 +815,8 @@ IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6210) || IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6260) || IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6260R) || + IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6280) || + IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6280R) || IDE_PCI_DEVID_EQ(d->devid, DEVID_HPT34X) || IDE_PCI_DEVID_EQ(d->devid, DEVID_HPT366) || IDE_PCI_DEVID_EQ(d->devid, DEVID_CS5530) || diff -uNr linux-2.4.19/drivers/ide/ide-probe.c linux-2.4.19bgl/drivers/ide/ide-probe.c --- linux-2.4.19/drivers/ide/ide-probe.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/ide/ide-probe.c 2003-07-02 10:43:07.000000000 -0500 @@ -260,12 +260,22 @@ int retval; int autoprobe = 0; unsigned long cookie = 0; + ide_hwif_t *hwif = HWIF(drive); + int irqdefense = 0; - if (IDE_CONTROL_REG && !HWIF(drive)->irq) { + if (IDE_CONTROL_REG && !hwif->irq) { autoprobe = 1; cookie = probe_irq_on(); OUT_BYTE(drive->ctl,IDE_CONTROL_REG); /* enable device irq */ } +#ifdef CONFIG_IDEPCI_SHARE_IRQ + if (hwif->irq && IDE_CHIPSET_IS_PCI(hwif->chipset)) { + OUT_BYTE(drive->ctl|2, IDE_CONTROL_REG); /* mask device irq */ + printk(KERN_WARNING "disabling irq %d defensively\n", hwif->irq); + disable_irq(hwif->irq); + irqdefense = 1; + } +#endif CONFIG_IDEPCI_SHARE_IRQ retval = actual_try_to_identify(drive, cmd); @@ -291,6 +301,12 @@ } } } + +#ifdef CONFIG_IDEPCI_SHARE_IRQ + if (irqdefense) + enable_irq(hwif->irq); +#endif CONFIG_IDEPCI_SHARE_IRQ + return retval; } diff -uNr linux-2.4.19/drivers/ide/ide.c linux-2.4.19bgl/drivers/ide/ide.c --- linux-2.4.19/drivers/ide/ide.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/ide/ide.c 2003-07-02 10:43:07.000000000 -0500 @@ -2420,6 +2420,7 @@ hw->irq = irq; hw->dma = NO_DMA; hw->ack_intr = ack_intr; + hw->chipset = ide_generic; } /* @@ -2481,6 +2482,7 @@ hw_regs_t hw; ide_init_hwif_ports(&hw, (ide_ioreg_t) arg1, (ide_ioreg_t) arg2, NULL); hw.irq = irq; + hw.chipset = ide_unknown; return ide_register_hw(&hw, NULL); } @@ -3652,6 +3654,12 @@ macide_init(); } #endif /* CONFIG_BLK_DEV_MAC_IDE */ +#ifdef CONFIG_BLK_DEV_CPCI405_IDE + { + extern void cpci405ide_init(void); + cpci405ide_init(); + } +#endif /* CONFIG_BLK_DEV_CPCI405_IDE */ #ifdef CONFIG_BLK_DEV_Q40IDE { extern void q40ide_init(void); diff -uNr linux-2.4.19/drivers/ide/rapide.c linux-2.4.19bgl/drivers/ide/rapide.c --- linux-2.4.19/drivers/ide/rapide.c 2001-10-11 11:14:32.000000000 -0500 +++ linux-2.4.19bgl/drivers/ide/rapide.c 2003-07-02 10:43:21.000000000 -0500 @@ -40,6 +40,7 @@ } hw.io_ports[IDE_CONTROL_OFFSET] = port + 0x206; hw.irq = ec->irq; + hw.chipset = ide_generic; return ide_register_hw(&hw, NULL); } diff -uNr linux-2.4.19/drivers/media/video/Config.in linux-2.4.19bgl/drivers/media/video/Config.in --- linux-2.4.19/drivers/media/video/Config.in 2001-12-21 11:41:54.000000000 -0600 +++ linux-2.4.19bgl/drivers/media/video/Config.in 2005-06-08 14:30:43.000000000 -0500 @@ -4,52 +4,4 @@ mainmenu_option next_comment comment 'Video For Linux' -bool ' V4L information in proc filesystem' CONFIG_VIDEO_PROC_FS -dep_tristate ' I2C on parallel port' CONFIG_I2C_PARPORT $CONFIG_PARPORT $CONFIG_I2C - -comment 'Video Adapters' -if [ "$CONFIG_I2C_ALGOBIT" = "y" -o "$CONFIG_I2C_ALGOBIT" = "m" ]; then - dep_tristate ' BT848 Video For Linux' CONFIG_VIDEO_BT848 $CONFIG_VIDEO_DEV $CONFIG_PCI $CONFIG_I2C_ALGOBIT -fi -dep_tristate ' Mediavision Pro Movie Studio Video For Linux' CONFIG_VIDEO_PMS $CONFIG_VIDEO_DEV -if [ "$CONFIG_ALL_PPC" = "y" ]; then - dep_tristate ' PlanB Video-In on PowerMac' CONFIG_VIDEO_PLANB $CONFIG_VIDEO_DEV -fi -if [ "$CONFIG_PARPORT" != "n" ]; then - dep_tristate ' Quickcam BW Video For Linux' CONFIG_VIDEO_BWQCAM $CONFIG_VIDEO_DEV $CONFIG_PARPORT - if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - dep_tristate ' QuickCam Colour Video For Linux (EXPERIMENTAL)' CONFIG_VIDEO_CQCAM $CONFIG_VIDEO_DEV $CONFIG_PARPORT - fi -fi -if [ "$CONFIG_PARPORT" != "n" ]; then - if [ "$CONFIG_PARPORT_1284" != "n" ]; then - dep_tristate ' W9966CF Webcam (FlyCam Supra and others) Video For Linux' CONFIG_VIDEO_W9966 $CONFIG_VIDEO_DEV $CONFIG_PARPORT - fi -fi -dep_tristate ' CPiA Video For Linux' CONFIG_VIDEO_CPIA $CONFIG_VIDEO_DEV -if [ "$CONFIG_VIDEO_CPIA" != "n" ]; then - if [ "$CONFIG_PARPORT_1284" != "n" ]; then - dep_tristate ' CPiA Parallel Port Lowlevel Support' CONFIG_VIDEO_CPIA_PP $CONFIG_VIDEO_CPIA $CONFIG_PARPORT - fi - if [ "$CONFIG_USB" != "n" ]; then - dep_tristate ' CPiA USB Lowlevel Support' CONFIG_VIDEO_CPIA_USB $CONFIG_VIDEO_CPIA $CONFIG_USB - fi -fi -dep_tristate ' SAA5249 Teletext processor' CONFIG_VIDEO_SAA5249 $CONFIG_VIDEO_DEV $CONFIG_I2C -dep_tristate ' SAB3036 tuner' CONFIG_TUNER_3036 $CONFIG_VIDEO_DEV $CONFIG_I2C -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - if [ "$CONFIG_SGI" = "y" ]; then - dep_tristate ' SGI Vino Video For Linux (EXPERIMENTAL)' CONFIG_VIDEO_VINO $CONFIG_VIDEO_DEV $CONFIG_SGI - fi - dep_tristate ' Stradis 4:2:2 MPEG-2 video driver (EXPERIMENTAL)' CONFIG_VIDEO_STRADIS $CONFIG_VIDEO_DEV $CONFIG_PCI -fi -dep_tristate ' Zoran ZR36057/36060 Video For Linux' CONFIG_VIDEO_ZORAN $CONFIG_VIDEO_DEV $CONFIG_PCI $CONFIG_I2C -dep_tristate ' Iomega Buz support' CONFIG_VIDEO_ZORAN_BUZ $CONFIG_VIDEO_ZORAN $CONFIG_VIDEO_DEV $CONFIG_PCI $CONFIG_I2C -dep_tristate ' Miro DC10(+) support' CONFIG_VIDEO_ZORAN_DC10 $CONFIG_VIDEO_ZORAN $CONFIG_VIDEO_DEV $CONFIG_PCI $CONFIG_I2C -dep_tristate ' Linux Media Labs LML33 support' CONFIG_VIDEO_ZORAN_LML33 $CONFIG_VIDEO_ZORAN $CONFIG_VIDEO_DEV $CONFIG_PCI $CONFIG_I2C -dep_tristate ' Zoran ZR36120/36125 Video For Linux' CONFIG_VIDEO_ZR36120 $CONFIG_VIDEO_DEV $CONFIG_PCI $CONFIG_I2C -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - dep_tristate ' Sony Vaio Picturebook Motion Eye Video For Linux' CONFIG_VIDEO_MEYE $CONFIG_VIDEO_DEV $CONFIG_PCI $CONFIG_SONYPI -fi - endmenu diff -uNr linux-2.4.19/drivers/media/video/Makefile linux-2.4.19bgl/drivers/media/video/Makefile --- linux-2.4.19/drivers/media/video/Makefile 2001-11-09 16:01:22.000000000 -0600 +++ linux-2.4.19bgl/drivers/media/video/Makefile 2005-06-08 14:30:43.000000000 -0500 @@ -22,66 +22,5 @@ O_TARGET := video.o -# All of the (potential) objects that export symbols. -# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. - -export-objs := i2c-old.o videodev.o bttv-if.o cpia.o - -list-multi := bttv.o zoran.o -bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o -zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o - -obj-$(CONFIG_VIDEO_DEV) += videodev.o - -obj-$(CONFIG_BUS_I2C) += i2c-old.o -obj-$(CONFIG_VIDEO_BT848) += bttv.o msp3400.o tvaudio.o \ - tda7432.o tda9875.o tuner.o -obj-$(CONFIG_SOUND_TVMIXER) += tvmixer.o - -obj-$(CONFIG_VIDEO_ZR36120) += zoran.o -obj-$(CONFIG_I2C_PARPORT) += i2c-parport.o i2c-old.o -obj-$(CONFIG_VIDEO_SAA5249) += saa5249.o i2c-old.o -obj-$(CONFIG_VIDEO_CQCAM) += c-qcam.o -obj-$(CONFIG_VIDEO_BWQCAM) += bw-qcam.o -obj-$(CONFIG_VIDEO_W9966) += w9966.o -obj-$(CONFIG_VIDEO_ZORAN) += zr36067.o i2c-old.o -obj-$(CONFIG_VIDEO_ZORAN_BUZ) += saa7111.o saa7185.o -obj-$(CONFIG_VIDEO_ZORAN_DC10) += saa7110.o adv7175.o -obj-$(CONFIG_VIDEO_ZORAN_LML33) += bt819.o bt856.o -obj-$(CONFIG_VIDEO_LML33) += bt856.o bt819.o -obj-$(CONFIG_VIDEO_PMS) += pms.o -obj-$(CONFIG_VIDEO_PLANB) += planb.o -obj-$(CONFIG_VIDEO_VINO) += vino.o -obj-$(CONFIG_VIDEO_STRADIS) += stradis.o -obj-$(CONFIG_VIDEO_CPIA) += cpia.o -obj-$(CONFIG_VIDEO_CPIA_PP) += cpia_pp.o -obj-$(CONFIG_VIDEO_CPIA_USB) += cpia_usb.o -obj-$(CONFIG_VIDEO_MEYE) += meye.o -obj-$(CONFIG_TUNER_3036) += tuner-3036.o - -# Extract lists of the multi-part drivers. -# The 'int-*' lists are the intermediate files used to build the multi's. - -multi-y := $(filter $(list-multi), $(obj-y)) -multi-m := $(filter $(list-multi), $(obj-m)) -int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) -int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) - -# Files that are both resident and modular: remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) -int-m := $(filter-out $(int-y), $(int-m)) - -# Take multi-part drivers out of obj-y and put components in. - -obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) - include $(TOPDIR)/Rules.make -fastdep: - -zoran.o: zr36120.o zr36120_i2c.o zr36120_mem.o - $(LD) $(LD_RFLAG) -r -o $@ zr36120.o zr36120_i2c.o zr36120_mem.o - -bttv.o: $(bttv-objs) - $(LD) $(LD_RFLAG) -r -o $@ $(bttv-objs) diff -uNr linux-2.4.19/drivers/misc/Makefile linux-2.4.19bgl/drivers/misc/Makefile --- linux-2.4.19/drivers/misc/Makefile 2000-12-29 16:07:22.000000000 -0600 +++ linux-2.4.19bgl/drivers/misc/Makefile 2005-06-08 14:30:44.000000000 -0500 @@ -11,6 +11,8 @@ O_TARGET := misc.o +obj-y += distro_id.o include $(TOPDIR)/Rules.make +CFLAGS_distro_id.o := -DJLBD_DISTRO_ID="\"$(JLBD_DISTRO_ID)\\n\"" fastdep: diff -uNr linux-2.4.19/drivers/mtd/Config.in linux-2.4.19bgl/drivers/mtd/Config.in --- linux-2.4.19/drivers/mtd/Config.in 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/mtd/Config.in 2005-06-08 14:30:44.000000000 -0500 @@ -25,11 +25,8 @@ if [ "$CONFIG_MTD_BLOCK" = "n" -o "$CONFIG_MTD_BLOCK" = "m" ]; then dep_tristate ' Readonly block device access to MTD devices' CONFIG_MTD_BLOCK_RO $CONFIG_MTD fi - dep_tristate ' FTL (Flash Translation Layer) support' CONFIG_FTL $CONFIG_MTD - dep_tristate ' NFTL (NAND Flash Translation Layer) support' CONFIG_NFTL $CONFIG_MTD - if [ "$CONFIG_NFTL" = "y" -o "$CONFIG_NFTL" = "m" ]; then - bool ' Write support for NFTL (BETA)' CONFIG_NFTL_RW - fi + dep_tristate ' FTL (Flash Translation Layer) support' $CONFIG_MTD + dep_tristate ' NFTL (NAND Flash Translation Layer) support' $CONFIG_MTD source drivers/mtd/chips/Config.in diff -uNr linux-2.4.19/drivers/mtd/Makefile linux-2.4.19bgl/drivers/mtd/Makefile --- linux-2.4.19/drivers/mtd/Makefile 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/mtd/Makefile 2005-06-08 14:30:44.000000000 -0500 @@ -54,13 +54,7 @@ obj-$(CONFIG_MTD_CHAR) += mtdchar.o obj-$(CONFIG_MTD_BLOCK) += mtdblock.o obj-$(CONFIG_MTD_BLOCK_RO) += mtdblock_ro.o -obj-$(CONFIG_FTL) += ftl.o -obj-$(CONFIG_NFTL) += nftl.o - -nftl-objs := nftlcore.o nftlmount.o include $(TOPDIR)/Rules.make -nftl.o: $(nftl-objs) - $(LD) -r -o $@ $(nftl-objs) diff -uNr linux-2.4.19/drivers/mtd/chips/jedec.c linux-2.4.19bgl/drivers/mtd/chips/jedec.c --- linux-2.4.19/drivers/mtd/chips/jedec.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/mtd/chips/jedec.c 2003-07-02 10:43:18.000000000 -0500 @@ -38,6 +38,7 @@ {0x01AD,"AMD Am29F016",2*1024*1024,64*1024,MTD_CAP_NORFLASH}, {0x01D5,"AMD Am29F080",1*1024*1024,64*1024,MTD_CAP_NORFLASH}, {0x01A4,"AMD Am29F040",512*1024,64*1024,MTD_CAP_NORFLASH}, + {0x014F,"AMD Am29LV040B",512*1024,64*1024,MTD_CAP_NORFLASH}, {0x20E3,"AMD Am29W040B",512*1024,64*1024,MTD_CAP_NORFLASH}, {0xC2AD,"Macronix MX29F016",2*1024*1024,64*1024,MTD_CAP_NORFLASH}, {}}; diff -uNr linux-2.4.19/drivers/mtd/maps/Config.in linux-2.4.19bgl/drivers/mtd/maps/Config.in --- linux-2.4.19/drivers/mtd/maps/Config.in 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/mtd/maps/Config.in 2003-07-02 10:44:16.000000000 -0500 @@ -36,9 +36,27 @@ fi if [ "$CONFIG_PPC" = "y" ]; then - dep_tristate ' CFI Flash device mapped on TQM8XXL' CONFIG_MTD_TQM8XXL $CONFIG_MTD_CFI $CONFIG_TQM8xxL - dep_tristate ' CFI Flash device mapped on RPX Lite or CLLF' CONFIG_MTD_RPXLITE $CONFIG_MTD_CFI - dep_tristate ' System flash on MBX860 board' CONFIG_MTD_MBX860 $CONFIG_MTD_CFI + if [ "$CONFIG_MOT_MVP" = "y" ]; then + dep_tristate ' CFI Flash device mapped on Motorola MVP' CONFIG_MTD_MOT_MVP $CONFIG_MTD_CFI + fi + if [ "$CONFIG_EBONY" = "y" ]; then + dep_tristate ' Flash devices mapped on IBM Ebony' CONFIG_MTD_EBONY $CONFIG_MTD_CFI + fi + if [ "$CONFIG_TQM8xxL" = "y" ]; then + dep_tristate ' CFI Flash device mapped on TQM8XXL' CONFIG_MTD_TQM8XXL $CONFIG_MTD_CFI + fi + if [ "$CONFIG_RPXLITE" = "y" -o "$CONFIG_RPXCLASSIC" = "y" ]; then + dep_tristate ' CFI Flash device mapped on RPX Lite or CLLF' CONFIG_MTD_RPXLITE $CONFIG_MTD_CFI + fi + if [ "$CONFIG_MBX" = "y" ]; then + dep_tristate ' System flash on MBX860 board' CONFIG_MTD_MBX860 $CONFIG_MTD_CFI + fi + if [ "$CONFIG_REDWOOD_4" = "y" -o "$CONFIG_REDWOOD_5" = "y" -o "$CONFIG_REDWOOD_6" = "y" ]; then + dep_tristate ' CFI Flash device mapped on IBM Redwood' CONFIG_MTD_REDWOOD $CONFIG_MTD_CFI + fi + if [ "$CONFIG_BEECH" = "y" ]; then + dep_tristate ' CFI Flash device mapped on IBM Beech' CONFIG_MTD_BEECH $CONFIG_MTD_CFI + fi dep_tristate ' CFI Flash device mapped on D-Box2' CONFIG_MTD_DBOX2 $CONFIG_MTD_CFI dep_tristate ' CFI Flash device mapping on FlagaDM' CONFIG_MTD_CFI_FLAGADM $CONFIG_MTD_CFI fi diff -uNr linux-2.4.19/drivers/mtd/maps/Makefile linux-2.4.19bgl/drivers/mtd/maps/Makefile --- linux-2.4.19/drivers/mtd/maps/Makefile 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/mtd/maps/Makefile 2003-07-02 10:44:29.000000000 -0500 @@ -39,5 +39,9 @@ obj-$(CONFIG_MTD_PB1000) += pb1xxx-flash.o obj-$(CONFIG_MTD_PB1500) += pb1xxx-flash.o obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o +obj-$(CONFIG_MTD_REDWOOD) += redwood.o +obj-$(CONFIG_MTD_MOT_MVP) += mot-mvp.o +obj-$(CONFIG_MTD_EBONY) += ebony.o +obj-$(CONFIG_MTD_BEECH) += beech-mtd.o include $(TOPDIR)/Rules.make diff -uNr linux-2.4.19/drivers/net/8390.c linux-2.4.19bgl/drivers/net/8390.c --- linux-2.4.19/drivers/net/8390.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/net/8390.c 2003-07-02 10:43:26.000000000 -0500 @@ -101,6 +101,10 @@ #define ei_block_input (ei_local->block_input) #define ei_get_8390_hdr (ei_local->get_8390_hdr) +#ifdef CONFIG_REDWOOD_4 +#include "8390_redwood.h" +#endif + /* use 0 for production, 1 for verification, >2 for debug */ #ifndef ei_debug int ei_debug = 1; @@ -726,7 +730,11 @@ ei_local->stat.rx_errors++; ei_local->stat.rx_length_errors++; } +#ifdef CONFIG_REDWOOD_4 + else if ((pkt_stat & 0x1F) == ENRSR_RXOK) +#else else if ((pkt_stat & 0x0F) == ENRSR_RXOK) +#endif { struct sk_buff *skb; @@ -1036,9 +1044,15 @@ long e8390_base = dev->base_addr; struct ei_device *ei_local = (struct ei_device *) dev->priv; int i; +#ifdef CONFIG_REDWOOD_4 + int endcfg = ei_local->word16 + ? (0x28 | ENDCFG_WTS ) + : 0x28; +#else int endcfg = ei_local->word16 ? (0x48 | ENDCFG_WTS | (ei_local->bigendian ? ENDCFG_BOS : 0)) : 0x48; +#endif if(sizeof(struct e8390_pkt_hdr)!=4) panic("8390.c: header struct mispacked\n"); diff -uNr linux-2.4.19/drivers/net/8390.h linux-2.4.19bgl/drivers/net/8390.h --- linux-2.4.19/drivers/net/8390.h 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/net/8390.h 2003-07-02 10:43:58.000000000 -0500 @@ -33,11 +33,16 @@ unsigned short count; /* header + packet length in bytes */ }; + #ifdef notdef extern int ei_debug; #else +#ifdef CONFIG_REDWOOD_4 +#define ei_debug 0 +#else #define ei_debug 1 #endif +#endif #ifndef HAVE_AUTOIRQ /* From auto_irq.c */ @@ -130,6 +135,8 @@ #define inb_p(port) in_8(port) #define outb_p(val,port) out_8(port,val) +#elif CONFIG_STB03xxx +#define EI_SHIFT(x) (2 * (x)) #else #define EI_SHIFT(x) (x) #endif diff -uNr linux-2.4.19/drivers/net/Config.in linux-2.4.19bgl/drivers/net/Config.in --- linux-2.4.19/drivers/net/Config.in 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/net/Config.in 2005-06-08 14:30:43.000000000 -0500 @@ -37,11 +37,12 @@ fi dep_tristate ' BMAC (G3 ethernet) support' CONFIG_BMAC $CONFIG_ALL_PPC dep_tristate ' GMAC (G4/iBook ethernet) support' CONFIG_GMAC $CONFIG_ALL_PPC - if [ "$CONFIG_4xx" = "y" ]; then - if [ "$CONFIG_STB03xxx" = "y" -o "$CONFIG_403GCX" = "y" ]; then - tristate ' National DP83902AV (Oak ethernet) support' CONFIG_OAKNET - fi + if [ "$CONFIG_REDWOOD_4" = "y" -o "$CONFIG_403GCX" = "y" ]; then + tristate ' National DP83902AV (Oak ethernet) support' CONFIG_OAKNET fi + if [ "$CONFIG_BEECH" = "y" ]; then + tristate ' Beech onboard CS8900A Ethernet support' CONFIG_CS89x0 + fi fi if [ "$CONFIG_ZORRO" = "y" ]; then tristate ' Ariadne support' CONFIG_ARIADNE @@ -106,6 +107,19 @@ dep_tristate ' SMC Ultra support' CONFIG_ULTRA $CONFIG_ISA dep_tristate ' SMC Ultra32 EISA support' CONFIG_ULTRA32 $CONFIG_EISA dep_tristate ' SMC 9194 support' CONFIG_SMC9194 $CONFIG_ISA + tristate ' SMC 91111 support' CONFIG_SMC91111 + if [ "$CONFIG_SMC91111" != "n" ]; then + bool ' Advanced configuration options for SMC91111' CONFIG_SMC91111_ADVANCED + if [ "$CONFIG_SMC91111_ADVANCED" = "n" ]; then + define_bool CONFIG_SMC91111_BYTE_SWAP n + define_bool CONFIG_SMC91111_USE_8_BIT y + define_bool CONFIG_SMC91111_USE_32_BIT y + else + bool ' Byte swap device accesses' CONFIG_SMC91111_BYTE_SWAP + bool ' Allow 8 bit device accesses' CONFIG_SMC91111_USE_8_BIT + bool ' Allow 32 bit device accesses' CONFIG_SMC91111_USE_32_BIT + fi + fi fi bool ' Racal-Interlan (Micom) NI cards' CONFIG_NET_VENDOR_RACAL if [ "$CONFIG_NET_VENDOR_RACAL" = "y" ]; then @@ -245,13 +259,20 @@ dep_tristate 'National Semiconduct DP83820 support' CONFIG_NS83820 $CONFIG_PCI dep_tristate 'Packet Engines Hamachi GNIC-II support' CONFIG_HAMACHI $CONFIG_PCI dep_tristate 'Packet Engines Yellowfin Gigabit-NIC support (EXPERIMENTAL)' CONFIG_YELLOWFIN $CONFIG_PCI $CONFIG_EXPERIMENTAL -dep_tristate 'SysKonnect SK-98xx support' CONFIG_SK98LIN $CONFIG_PCI dep_tristate 'Broadcom Tigon3 support' CONFIG_TIGON3 $CONFIG_PCI endmenu -if [ "$CONFIG_PPC_ISERIES" = "y" ]; then - dep_tristate 'iSeries Virtual Ethernet driver support' CONFIG_VETH $CONFIG_PPC_ISERIES +if [ "$CONFIG_4xx" = "y" ]; then + mainmenu_option next_comment + comment 'Backplane Networking' + dep_tristate 'IBM NPNet NP4GS3 Backplane Networking' CONFIG_NPNET $CONFIG_PCI + endmenu + + source drivers/net/ibm_ocp/Config.in + if [ "$CONFIG_XILINX_OCP" = "y" ]; then + tristate ' Xilinx on-chip ethernet' CONFIG_XILINX_ENET + fi fi bool 'FDDI driver support' CONFIG_FDDI diff -uNr linux-2.4.19/drivers/net/Makefile linux-2.4.19bgl/drivers/net/Makefile --- linux-2.4.19/drivers/net/Makefile 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/net/Makefile 2005-06-08 14:30:43.000000000 -0500 @@ -25,6 +25,10 @@ obj-y += tulip/tulip.o endif +ifeq ($(CONFIG_OCP_NET),y) + obj-y += ibm_ocp/ocp.o +endif + ifeq ($(CONFIG_ISDN_PPP),y) obj-$(CONFIG_ISDN) += slhc.o endif @@ -32,13 +36,13 @@ subdir-$(CONFIG_NET_PCMCIA) += pcmcia subdir-$(CONFIG_NET_WIRELESS) += wireless subdir-$(CONFIG_TULIP) += tulip +subdir-$(CONFIG_OCP_NET) += ibm_ocp subdir-$(CONFIG_IRDA) += irda subdir-$(CONFIG_TR) += tokenring subdir-$(CONFIG_WAN) += wan subdir-$(CONFIG_NET_FC) += fc subdir-$(CONFIG_ARCNET) += arcnet subdir-$(CONFIG_DEV_APPLETALK) += appletalk -subdir-$(CONFIG_SK98LIN) += sk98lin subdir-$(CONFIG_SKFP) += skfp # @@ -73,7 +77,6 @@ obj-$(CONFIG_DM9102) += dmfe.o obj-$(CONFIG_YELLOWFIN) += yellowfin.o obj-$(CONFIG_ACENIC) += acenic.o -obj-$(CONFIG_VETH) += veth.o obj-$(CONFIG_NATSEMI) += natsemi.o obj-$(CONFIG_NS83820) += ns83820.o obj-$(CONFIG_STNIC) += stnic.o 8390.o @@ -81,9 +84,6 @@ obj-$(CONFIG_TC35815) += tc35815.o obj-$(CONFIG_TIGON3) += tg3.o -ifeq ($(CONFIG_SK98LIN),y) -obj-y += sk98lin/sk98lin.o -endif ifeq ($(CONFIG_SKFP),y) obj-y += skfp/skfp.o @@ -116,6 +116,7 @@ obj-$(CONFIG_SK_G16) += sk_g16.o obj-$(CONFIG_HP100) += hp100.o obj-$(CONFIG_SMC9194) += smc9194.o +obj-$(CONFIG_SMC91111) += smc91111.o obj-$(CONFIG_ARM_AM79C961A) += am79c961a.o obj-$(CONFIG_ARM_ETHERH) += 8390.o obj-$(CONFIG_WD80x3) += wd.o 8390.o @@ -132,6 +133,8 @@ obj-$(CONFIG_LNE390) += lne390.o 8390.o obj-$(CONFIG_NE3210) += ne3210.o 8390.o obj-$(CONFIG_NET_SB1250_MAC) += sb1250-mac.o +obj-$(CONFIG_GT64260_ETH) += gt64260_eth.o +obj-$(CONFIG_NPNET) += npnet.o obj-$(CONFIG_PPP) += ppp_generic.o slhc.o obj-$(CONFIG_PPP_ASYNC) += ppp_async.o @@ -215,6 +218,10 @@ obj-$(CONFIG_TUN) += tun.o obj-$(CONFIG_DL2K) += dl2k.o +mod-subdirs += xilinx_enet +subdir-$(CONFIG_XILINX_ENET) += xilinx_enet +obj-$(CONFIG_XILINX_ENET) += xilinx_enet/xilinx_enet.o + ifeq ($(CONFIG_ARCH_ACORN),y) mod-subdirs += ../acorn/net subdir-y += ../acorn/net diff -uNr linux-2.4.19/drivers/net/cs89x0.c linux-2.4.19bgl/drivers/net/cs89x0.c --- linux-2.4.19/drivers/net/cs89x0.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/net/cs89x0.c 2003-07-02 10:43:52.000000000 -0500 @@ -98,7 +98,11 @@ * Note that even if DMA is turned off we still support the 'dma' and 'use_dma' * module options so we don't break any startup scripts. */ +#ifdef CONFIG_BEECH /* IBM 405LP/Beech does not have external DMA */ +#define ALLOW_DMA 0 +#else #define ALLOW_DMA 1 +#endif /* * Set this to zero to remove all the debug statements via @@ -142,7 +146,7 @@ #include "cs89x0.h" static char version[] __initdata = -"cs89x0.c: v2.4.3-pre1 Russell Nelson , Andrew Morton \n"; +"cs89x0.c: v2.4.3-pre1 Russell Nelson , Andrew Morton , Modified by Ralph Blach for the Earl\n"; /* First, a few definitions that the brave might change. A zero-terminated list of I/O addresses to be probed. Some special flags.. @@ -163,6 +167,10 @@ static unsigned int netcard_portlist[] __initdata = { 0x0300, 0}; static unsigned int cs8900_irq_map[] = {1,0,0,0}; +#elif defined (CONFIG_BEECH) +static unsigned int netcard_portlist[] __initdata = +{ 0 /* filled in with mapped virtual addr later */, 0}; +static unsigned int cs8900_irq_map[] = {UIC_IRQ_EIR4,0,0,0}; #else static unsigned int netcard_portlist[] __initdata = { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0}; @@ -292,11 +300,22 @@ else if (base_addr != 0) /* Don't probe at all. */ return -ENXIO; +#ifdef CONFIG_BEECH + netcard_portlist[0] = + (int) ioremap(BEECH_ETHERNET_PADDR, BEECH_ETHERNET_SIZE) + + 0x301; +#endif + for (i = 0; netcard_portlist[i]; i++) { if (cs89x0_probe1(dev, netcard_portlist[i]) == 0) return 0; } printk(KERN_WARNING "cs89x0: no cs8900 or cs8920 detected. Be sure to disable PnP with SETUP\n"); + +#ifdef CONFIG_BEECH + iounmap(netcard_portlist[0]); +#endif + return -ENODEV; } @@ -476,7 +495,14 @@ lp->chip_revision, dev->base_addr); +#ifdef CONFIG_BEECH + /* + * Leave firmware settings alone, Beech does not currently provide + * a means of retrieving MAC address, etc. known only to f/w. + */ +#else reset_chip(dev); +#endif /* Here we read the current configuration of the chip. If there is no Extended EEPROM then the idea is to not disturb the chip @@ -519,6 +545,15 @@ if ((readreg(dev, PP_SelfST) & (EEPROM_OK | EEPROM_PRESENT)) == (EEPROM_OK|EEPROM_PRESENT)) { + printk( "[Cirrus EEPROM] "); +#ifdef CONFIG_BEECH + } + /* HACK: Beech needs to do this configuration even though it + * doesn't have a Cirrus EEPROM */ + { + printk( "[Beech] "); +#endif + /* Load the MAC. */ for (i=0; i < ETH_ALEN/2; i++) { unsigned int Addr; @@ -563,8 +598,6 @@ /* IRQ. Other chips already probe, see below. */ if (lp->chip_type == CS8900) lp->isa_config = readreg(dev, PP_CS8900_ISAINT) & INT_NO_MASK; - - printk( "[Cirrus EEPROM] "); } printk("\n"); diff -uNr linux-2.4.19/drivers/net/cs89x0.h linux-2.4.19bgl/drivers/net/cs89x0.h --- linux-2.4.19/drivers/net/cs89x0.h 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/net/cs89x0.h 2003-07-02 10:44:07.000000000 -0500 @@ -439,6 +439,8 @@ #define PNP_IRQ_FRMT 0x0022 /* PNP small item IRQ format */ #ifdef CONFIG_SH_HICOSH4 #define CS8900_IRQ_MAP 0x0002 /* HiCO-SH4 board has its IRQ on #1 */ +#elif defined(CONFIG_BEECH) +#define CS8900_IRQ_MAP 1 << UIC_IRQ_EIR4 #else #define CS8900_IRQ_MAP 0x1c20 /* This IRQ map is fixed */ #endif diff -uNr linux-2.4.19/drivers/net/eql.c linux-2.4.19bgl/drivers/net/eql.c --- linux-2.4.19/drivers/net/eql.c 2001-09-30 14:26:06.000000000 -0500 +++ linux-2.4.19bgl/drivers/net/eql.c 2005-06-08 14:30:47.000000000 -0500 @@ -491,6 +491,8 @@ #endif eql = (equalizer_t *) dev->priv; slave_dev = __dev_get_by_name (sc.slave_name); + if (!slave_dev) + return -EINVAL; if ( eql_is_slave (slave_dev) ) { @@ -522,9 +524,10 @@ printk ("%s: set config for slave `%s'\n", dev->name, sc.slave_name); #endif - eql = (equalizer_t *) dev->priv; slave_dev = __dev_get_by_name (sc.slave_name); + if (!slave_dev) + return -EINVAL; if ( eql_is_slave (slave_dev) ) { diff -uNr linux-2.4.19/drivers/net/ne2k-pci.c linux-2.4.19bgl/drivers/net/ne2k-pci.c --- linux-2.4.19/drivers/net/ne2k-pci.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/net/ne2k-pci.c 2003-07-02 10:43:27.000000000 -0500 @@ -69,8 +69,6 @@ #if defined(__powerpc__) #define inl_le(addr) le32_to_cpu(inl(addr)) #define inw_le(addr) le16_to_cpu(inw(addr)) -#define insl insl_ns -#define outsl outsl_ns #endif #define PFX DRV_NAME ": " diff -uNr linux-2.4.19/drivers/net/oaknet.c linux-2.4.19bgl/drivers/net/oaknet.c --- linux-2.4.19/drivers/net/oaknet.c 2001-10-16 23:56:29.000000000 -0500 +++ linux-2.4.19bgl/drivers/net/oaknet.c 2003-07-02 10:44:07.000000000 -0500 @@ -12,6 +12,9 @@ * Additional inspiration from the "tcd8390.c" driver from TiVo, Inc. * and "enetLib.c" from IBM. * + * Modified to work on "Redwood 4" board also by someone at + * Montavista software (brad@heeltoe.com) + * */ #include @@ -21,11 +24,70 @@ #include #include -#include #include #include "8390.h" +#ifdef CONFIG_REDWOOD_4 +#define OAKNET_CMD 0x00 +#define OAKNET_DATA 0x20 /* NS-defined port window offset. */ +#define OAKNET_BASE (dev->base_addr) +#define E8390_BASE (dev->base_addr) + + +#undef outb_p +#undef insb +#undef insw + +#define FTR_DELAY_HACK +#ifdef FTR_DELAY_HACK + +static inline void outb_p(unsigned char value, long address) +{ + readb((void *)(address & 0xffffff00) + 0x40); + writeb(value, address); +} + +static inline void ei_obp(unsigned char value, long address) +{ + readb((void *)(address & 0xffffff00) + 0x40); + writeb(value, address); +} + +static inline unsigned char ei_ibp(long address) +{ + readb((void *)(address & 0xffffff00) + 0x40); + return readb(address); +} + +static inline unsigned char ei_ib(long address) +{ + readb((void *)(address & 0xffffff00) + 0x40); + return readb(address); +} + +#else + +#define outb_p writeb + +#define ei_obp writeb +#define ei_ibp readb +#define ei_ib readb + +#endif + + +/* don't add _IO_BASE to port */ + +#define ei_osw _outsw_ns +#define ei_isw _insw_ns +#define ei_osb _outsb +#define ei_isb _insb + +#define insb _insb +#define insw _insw_ns + +#endif /* Preprocessor Defines */ @@ -37,17 +99,23 @@ #define FALSE 0 #endif +#ifdef CONFIG_REDWOOD_4 +#define OAKNET_START_PG 0x40 /* First page of TX buffer */ +#define OAKNET_STOP_PG 0x80 /* Last page +1 of RX ring */ +#else #define OAKNET_START_PG 0x20 /* First page of TX buffer */ -#define OAKNET_STOP_PG 0x40 /* Last pagge +1 of RX ring */ +#define OAKNET_STOP_PG 0x40 /* Last page +1 of RX ring */ +#endif + #define OAKNET_WAIT (2 * HZ / 100) /* 20 ms */ /* Experimenting with some fixes for a broken driver... */ - +#ifndef CONFIG_REDWOOD_4 #define OAKNET_DISINT #define OAKNET_HEADCHECK #define OAKNET_RWFIX - +#endif /* Global Variables */ @@ -58,6 +126,8 @@ /* Function Prototypes */ +int oaknet_probe(struct net_device *dev); +static int oaknet_init(struct net_device *dev); static int oaknet_open(struct net_device *dev); static int oaknet_close(struct net_device *dev); @@ -71,6 +141,23 @@ static void oaknet_dma_error(struct net_device *dev, const char *name); +/* + * Maintain the initial probe as a sub function just in case it is wished + * to have this driver as a module later. + */ +int oaknet_probe_done = 0; + +int +oaknet_probe(struct net_device *dev) +{ + if (oaknet_probe_done) + return -ENODEV; + + oaknet_init(dev); + + oaknet_probe_done = 1; + return 0; +} /* * int oaknet_init() @@ -90,32 +177,25 @@ * 0 if OK, otherwise system error number on error. * */ -static int __init oaknet_init(void) +static int __init oaknet_init(struct net_device *dev) { register int i; int reg0, regd; int ret; - struct net_device tmp, *dev = NULL; -#if 0 unsigned long ioaddr = OAKNET_IO_BASE; -#else - unsigned long ioaddr = ioremap(OAKNET_IO_BASE, OAKNET_IO_SIZE); -#endif bd_t *bip = (bd_t *)__res; if (!ioaddr) return -ENOMEM; - /* - * This MUST happen here because of the nic_* macros - * which have an implicit dependency on dev->base_addr. - */ - tmp.base_addr = ioaddr; - dev = &tmp; + dev->base_addr = ioaddr; - ret = -EBUSY; - if (!request_region(OAKNET_IO_BASE, OAKNET_IO_SIZE, name)) - goto out_unmap; +#if !defined(CONFIG_REDWOOD_4) + if (!request_region(OAKNET_IO_BASE, OAKNET_IO_SIZE, name)) { + dev->base_addr = 0; + return -EBUSY; + } +#endif /* Quick register check to see if the device is really there. */ @@ -130,30 +210,27 @@ */ ei_obp(E8390_NODMA + E8390_PAGE1 + E8390_STOP, ioaddr + E8390_CMD); +#ifdef CONFIG_REDWOOD_4 + regd = ei_ibp(ioaddr + EI_SHIFT(0x0D)); + ei_obp(0xFF, ioaddr + EI_SHIFT(0x0D)); +#else regd = ei_ibp(ioaddr + 0x0D); ei_obp(0xFF, ioaddr + 0x0D); +#endif ei_obp(E8390_NODMA + E8390_PAGE0, ioaddr + E8390_CMD); ei_ibp(ioaddr + EN0_COUNTER0); /* It's no good. Fix things back up and leave. */ - ret = -ENODEV; if (ei_ibp(ioaddr + EN0_COUNTER0) != 0) { ei_obp(reg0, ioaddr); ei_obp(regd, ioaddr + 0x0D); - goto out_region; +#if !defined(CONFIG_REDWOOD_4) + release_region(dev->base_addr, OAKNET_IO_SIZE); +#endif + return (-ENODEV); } - /* - * We're not using the old-style probing API, so we have to allocate - * our own device structure. - */ - - dev = init_etherdev(NULL, 0); - ret = -ENOMEM; - if (!dev) - goto out_region; - SET_MODULE_OWNER(dev); oaknet_devs = dev; /* @@ -166,10 +243,12 @@ /* Allocate 8390-specific device-private area and fields. */ - ret = -ENOMEM; if (ethdev_init(dev)) { printk(" unable to get memory for dev->priv.\n"); - goto out_dev; +#if !defined(CONFIG_REDWOOD_4) + release_region(dev->base_addr, OAKNET_IO_SIZE); +#endif + return (-ENOMEM); } /* @@ -182,11 +261,14 @@ /* Attempt to get the interrupt line */ - ret = -EAGAIN; if (request_irq(dev->irq, ei_interrupt, 0, name, dev)) { printk("%s: unable to request interrupt %d.\n", dev->name, dev->irq); - goto out_priv; + dev->priv = NULL; +#if !defined(CONFIG_REDWOOD_4) + release_region(dev->base_addr, OAKNET_IO_SIZE); +#endif + return (EAGAIN); } /* Tell the world about what and where we've found. */ @@ -196,7 +278,7 @@ dev->dev_addr[i] = bip->bi_enetaddr[i]; printk("%c%.2x", (i ? ':' : ' '), dev->dev_addr[i]); } - printk(", found at %#lx, using IRQ %d.\n", dev->base_addr, dev->irq); + printk(", found at %#lx, irq=%d.\n", dev->base_addr, dev->irq); /* Set up some required driver fields and then we're done. */ @@ -251,7 +333,9 @@ static int oaknet_open(struct net_device *dev) { - int status = ei_open(dev); + int status; + + status = ei_open(dev); return (status); } @@ -300,7 +384,7 @@ static void oaknet_reset_8390(struct net_device *dev) { - int base = E8390_BASE; + int base = E8390_BASE; /* * We have no provision of reseting the controller as is done @@ -360,10 +444,10 @@ outb_p(E8390_RREAD + E8390_START, base + OAKNET_CMD); if (ei_status.word16) - insw(base + OAKNET_DATA, hdr, + insw((u16 *)base + OAKNET_DATA, hdr, sizeof(struct e8390_pkt_hdr) >> 1); else - insb(base + OAKNET_DATA, hdr, + insb((unsigned char *)(base + OAKNET_DATA), hdr, sizeof(struct e8390_pkt_hdr)); /* Byte-swap the packet byte count */ @@ -381,6 +465,12 @@ oaknet_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset) { +#ifdef OAKNET_DISINT + unsigned long flags; +#endif +#ifdef OAKNET_HEADCHECK + int bytes = count; +#endif int base = OAKNET_BASE; char *buf = skb->data; @@ -394,6 +484,10 @@ return; } +#ifdef CONFIG_REDWOOD_4 + dma_cache_wback_inv((long)skb->data, (long)count); +#endif + #ifdef OAKNET_DISINT save_flags(flags); cli(); @@ -407,15 +501,16 @@ ei_obp(ring_offset >> 8, base + EN0_RSARHI); ei_obp(E8390_RREAD + E8390_START, base + E8390_CMD); if (ei_status.word16) { - ei_isw(base + E8390_DATA, buf, count >> 1); + ei_isw((unsigned short *)(base + OAKNET_DATA), buf, count >> 1); + if (count & 0x01) { - buf[count - 1] = ei_ib(base + E8390_DATA); + buf[count - 1] = ei_ib(base + OAKNET_DATA); #ifdef OAKNET_HEADCHECK bytes++; #endif } } else { - ei_isb(base + E8390_DATA, buf, count); + ei_isb((unsigned char *)(base + OAKNET_DATA), buf, count); } #ifdef OAKNET_HEADCHECK /* @@ -437,10 +532,11 @@ if (((ring_offset + bytes) & 0xff) == low) break; } while (--tries > 0); - if (tries <= 0) + if (tries <= 0) { printk("%s: RX transfer address mismatch," "%#4.4x (expected) vs. %#4.4x (actual).\n", dev->name, ring_offset + bytes, addr); + } } #endif ei_obp(ENISR_RDC, base + EN0_ISR); /* ACK Remote DMA interrupt */ @@ -512,6 +608,10 @@ ei_obp(E8390_PAGE0 + E8390_START + E8390_NODMA, base + E8390_CMD); +#ifdef CONFIG_REDWOOD_4 + dma_cache_wback_inv((long)buf, (long)count); +#endif + #ifdef OAKNET_HEADCHECK retry: #endif @@ -581,9 +681,9 @@ ei_obp(E8390_RWRITE + E8390_START, base + E8390_CMD); if (ei_status.word16) { - ei_osw(E8390_BASE + E8390_DATA, buf, count >> 1); + ei_osw((unsigned short *)(base + OAKNET_DATA), buf, count >> 1); } else { - ei_osb(E8390_BASE + E8390_DATA, buf, count); + ei_osb((unsigned char *)(base + OAKNET_DATA), buf, count); } #ifdef OAKNET_DISINT @@ -658,7 +758,7 @@ printk(KERN_EMERG "%s: DMAing conflict in %s." "[DMAstat:%d][irqlock:%d][intr:%ld]\n", dev->name, name, ei_status.dmaing, ei_status.irqlock, - dev->interrupt); + dev->irq); } /* @@ -666,10 +766,18 @@ */ static int __init oaknet_init_module (void) { + struct net_device *dev; + if (oaknet_devs != NULL) return (-EBUSY); - return (oaknet_init()); + dev = init_etherdev(NULL, 0); + if (!dev) + return (-ENOMEM); + + SET_MODULE_OWNER(dev); + + return (oaknet_init(dev)); } /* @@ -681,12 +789,14 @@ return; if (oaknet_devs->priv != NULL) { - int ioaddr = oaknet_devs->base_addr; + unsigned long ioaddr = oaknet_devs->base_addr; void *priv = oaknet_devs->priv; free_irq(oaknet_devs->irq, oaknet_devs); +#if !defined(CONFIG_REDWOOD_4) release_region(ioaddr, OAKNET_IO_SIZE); +#endif iounmap(ioaddr); - unregister_netdev(oaknet_dev); + unregister_netdev(oaknet_devs); kfree(priv); } diff -uNr linux-2.4.19/drivers/net/pcnet32.c linux-2.4.19bgl/drivers/net/pcnet32.c --- linux-2.4.19/drivers/net/pcnet32.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/net/pcnet32.c 2003-07-02 10:44:12.000000000 -0500 @@ -461,11 +461,29 @@ static void __devinit pcnet32_probe_vlbus(void) { - unsigned int *port, ioaddr; + unsigned long ioaddr = 0; // FIXME dev ? dev->base_addr: 0; +#ifndef __powerpc__ + unsigned int irq_line = 0; // FIXME dev ? dev->irq : 0; +#endif + int *port; + + printk(KERN_INFO "pcnet32_probe_vlbus: cards_found=%d\n", cards_found); +#ifndef __powerpc__ + if (ioaddr > 0x1ff) { + if (check_region(ioaddr, PCNET32_TOTAL_SIZE) == 0) + return pcnet32_probe1(ioaddr, irq_line, 0, NULL); + else + return -ENODEV; + } else +#endif + if (ioaddr != 0) + return -ENXIO; - /* search for PCnet32 VLB cards at known addresses */ - for (port = pcnet32_portlist; (ioaddr = *port); port++) { - if (!check_region(ioaddr, PCNET32_TOTAL_SIZE)) { + /* now look for PCnet32 VLB cards */ + for (port = pcnet32_portlist; *port; port++) { + unsigned long ioaddr = *port; + + if ( check_region(ioaddr, PCNET32_TOTAL_SIZE) == 0) { /* check if there is really a pcnet chip on that ioaddr */ if ((inb(ioaddr + 14) == 0x57) && (inb(ioaddr + 15) == 0x57)) pcnet32_probe1(ioaddr, 0, 0, NULL); @@ -530,8 +548,10 @@ pcnet32_dwio_reset(ioaddr); if (pcnet32_dwio_read_csr(ioaddr, 0) == 4 && pcnet32_dwio_check(ioaddr)) { a = &pcnet32_dwio; - } else + } else { + printk(KERN_INFO "pcnet32: probe at %lx failed\n", ioaddr); return -ENODEV; + } } chip_version = a->read_csr(ioaddr, 88) | (a->read_csr(ioaddr,89) << 16); @@ -1307,6 +1327,7 @@ struct sk_buff *newskb; if ((newskb = dev_alloc_skb (PKT_BUF_SZ))) { + pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[entry], lp->rx_skbuff[entry]->len, PCI_DMA_FROMDEVICE); skb_reserve (newskb, 2); skb = lp->rx_skbuff[entry]; pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[entry], skb->len, PCI_DMA_FROMDEVICE); diff -uNr linux-2.4.19/drivers/net/sungem.c linux-2.4.19bgl/drivers/net/sungem.c --- linux-2.4.19/drivers/net/sungem.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/net/sungem.c 2003-07-02 10:44:02.000000000 -0500 @@ -2973,6 +2973,7 @@ * not have properly shut down the PHY. */ #ifdef CONFIG_ALL_PPC + gp->of_node = pci_device_to_OF_node(pdev); if (pdev->vendor == PCI_VENDOR_ID_APPLE) gem_apple_powerup(gp); #endif @@ -3001,9 +3002,6 @@ goto err_out_iounmap; } -#ifdef CONFIG_ALL_PPC - gp->of_node = pci_device_to_OF_node(pdev); -#endif if (gem_get_device_address(gp)) goto err_out_free_consistent; diff -uNr linux-2.4.19/drivers/net/wireless/airo.c linux-2.4.19bgl/drivers/net/wireless/airo.c --- linux-2.4.19/drivers/net/wireless/airo.c 2002-02-25 13:38:03.000000000 -0600 +++ linux-2.4.19bgl/drivers/net/wireless/airo.c 2005-06-08 14:30:47.000000000 -0500 @@ -2235,19 +2235,22 @@ size_t len, loff_t *offset ) { - int i; - int pos; + loff_t pos = *offset; struct proc_data *priv = (struct proc_data*)file->private_data; - if( !priv->rbuffer ) return -EINVAL; + if (!priv->rbuffer) + return -EINVAL; - pos = *offset; - for( i = 0; i+pos < priv->readlen && i < len; i++ ) { - if (put_user( priv->rbuffer[i+pos], buffer+i )) - return -EFAULT; - } - *offset += i; - return i; + if (pos < 0) + return -EINVAL; + if (pos >= priv->readlen) + return 0; + if (len > priv->readlen - pos) + len = priv->readlen - pos; + if (copy_to_user(buffer, priv->rbuffer + pos, len)) + return -EFAULT; + *offset = pos + len; + return len; } /* @@ -2259,24 +2262,24 @@ size_t len, loff_t *offset ) { - int i; - int pos; + loff_t pos = *offset; struct proc_data *priv = (struct proc_data*)file->private_data; - if ( !priv->wbuffer ) { + if (!priv->wbuffer) return -EINVAL; - } - - pos = *offset; - for( i = 0; i + pos < priv->maxwritelen && - i < len; i++ ) { - if (get_user( priv->wbuffer[i+pos], buffer + i )) - return -EFAULT; - } - if ( i+pos > priv->writelen ) priv->writelen = i+file->f_pos; - *offset += i; - return i; + if (pos < 0) + return -EINVAL; + if (pos >= priv->maxwritelen) + return 0; + if (len > priv->maxwritelen - pos) + len = priv->maxwritelen - pos; + if (copy_from_user(priv->wbuffer + pos, buffer, len)) + return -EFAULT; + if (pos + len > priv->writelen) + priv->writelen = pos + len; + *offset = pos + len; + return len; } static int proc_status_open( struct inode *inode, struct file *file ) { diff -uNr linux-2.4.19/drivers/pci/Makefile linux-2.4.19bgl/drivers/pci/Makefile --- linux-2.4.19/drivers/pci/Makefile 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/pci/Makefile 2003-07-02 10:44:42.000000000 -0500 @@ -27,7 +27,7 @@ obj-$(CONFIG_ARM) += setup-bus.o setup-irq.o obj-$(CONFIG_PARISC) += setup-bus.o obj-$(CONFIG_SUPERH) += setup-bus.o setup-irq.o -obj-$(CONFIG_ALL_PPC) += setup-bus.o +obj-$(CONFIG_PPC32) += setup-irq.o obj-$(CONFIG_SGI_IP27) += setup-irq.o obj-$(CONFIG_SGI_IP32) += setup-irq.o diff -uNr linux-2.4.19/drivers/pci/pci.c linux-2.4.19bgl/drivers/pci/pci.c --- linux-2.4.19/drivers/pci/pci.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/pci/pci.c 2003-07-02 10:43:58.000000000 -0500 @@ -1086,15 +1086,21 @@ u16 io_base_hi, io_limit_hi; pci_read_config_word(dev, PCI_IO_BASE_UPPER16, &io_base_hi); pci_read_config_word(dev, PCI_IO_LIMIT_UPPER16, &io_limit_hi); - base |= (io_base_hi << 16); - limit |= (io_limit_hi << 16); + base |= (unsigned long)(io_base_hi << 16); + limit |= (unsigned long)(io_limit_hi << 16); } - if (base && base <= limit) { + if ((base || limit) && base <= limit) { res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO; res->start = base; res->end = limit + 0xfff; res->name = child->name; + } else if (base == limit + 0x1000) { + /* Firmware/BIOS has deactivated this window */ + res->start = res->end = 0; + res->flags = 0; + printk(KERN_ERR "Bridge %s resource %d was deactivated by" + " firmware\n", dev->slot_name, 0); } else { /* * Ugh. We don't know enough about this bridge. Just assume @@ -1114,6 +1120,12 @@ res->start = base; res->end = limit + 0xfffff; res->name = child->name; + } else if (base == limit + 0x100000) { + /* Firmware/BIOS has deactivated this window */ + res->start = res->end = 0; + res->flags = 0; + printk(KERN_ERR "Bridge %s resource %d was deactivated by" + " firmware\n", dev->slot_name, 1); } else { /* See comment above. Same thing */ printk(KERN_ERR "Unknown bridge resource %d: assuming transparent\n", 1); @@ -1145,6 +1157,12 @@ res->start = base; res->end = limit + 0xfffff; res->name = child->name; + } else if (base == limit + 0x100000) { + /* Firmware/BIOS has deactivated this window */ + res->start = res->end = 0; + res->flags = 0; + printk(KERN_ERR "Bridge %s resource %d was deactivated by" + " firmware\n", dev->slot_name, 2); } else { /* See comments above */ printk(KERN_ERR "Unknown bridge resource %d: assuming transparent\n", 2); diff -uNr linux-2.4.19/drivers/sound/Makefile linux-2.4.19bgl/drivers/sound/Makefile --- linux-2.4.19/drivers/sound/Makefile 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/sound/Makefile 2005-06-08 14:30:47.000000000 -0500 @@ -10,7 +10,7 @@ export-objs := ad1848.o audio_syms.o midi_syms.o mpu401.o \ msnd.o opl3.o sb_common.o sequencer_syms.o \ sound_core.o sound_syms.o uart401.o \ - nm256_audio.o ac97.o ac97_codec.o aci.o + ac97.o ac97_codec.o aci.o # Each configuration option enables a list of files. @@ -58,7 +58,6 @@ obj-$(CONFIG_SOUND_MSNDCLAS) += msnd.o msnd_classic.o obj-$(CONFIG_SOUND_MSNDPIN) += msnd.o msnd_pinnacle.o obj-$(CONFIG_SOUND_VWSND) += vwsnd.o -obj-$(CONFIG_SOUND_NM256) += nm256_audio.o ac97.o obj-$(CONFIG_SOUND_ICH) += i810_audio.o ac97_codec.o obj-$(CONFIG_SOUND_SONICVIBES) += sonicvibes.o obj-$(CONFIG_SOUND_CMPCI) += cmpci.o diff -uNr linux-2.4.19/drivers/sound/mpu401.c linux-2.4.19bgl/drivers/sound/mpu401.c --- linux-2.4.19/drivers/sound/mpu401.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/sound/mpu401.c 2005-06-08 14:30:47.000000000 -0500 @@ -1512,14 +1512,16 @@ static int mpu_timer_ioctl(int dev, unsigned int command, caddr_t arg) { int midi_dev = sound_timer_devs[dev]->devlink; + int *p = (int *)arg; switch (command) { case SNDCTL_TMR_SOURCE: { int parm; - - parm = *(int *) arg; + + if (get_user(parm, p)) + return -EFAULT; parm &= timer_caps; if (parm != 0) @@ -1531,7 +1533,9 @@ else if (timer_mode & TMR_MODE_SMPTE) mpu_cmd(midi_dev, 0x3d, 0); /* Use SMPTE sync */ } - return (*(int *) arg = timer_mode); + if (put_user(timer_mode, p)) + return -EFAULT; + return timer_mode; } break; @@ -1556,10 +1560,13 @@ { int val; - val = *(int *) arg; + if (get_user(val, p)) + return -EFAULT; if (val) set_timebase(midi_dev, val); - return (*(int *) arg = curr_timebase); + if (put_user(curr_timebase, p)) + return -EFAULT; + return curr_timebase; } break; @@ -1568,7 +1575,8 @@ int val; int ret; - val = *(int *) arg; + if (get_user(val, p)) + return -EFAULT; if (val) { @@ -1583,7 +1591,9 @@ } curr_tempo = val; } - return (*(int *) arg = curr_tempo); + if (put_user(curr_tempo, p)) + return -EFAULT; + return curr_tempo; } break; @@ -1591,18 +1601,25 @@ { int val; - val = *(int *) arg; + if (get_user(val, p)) + return -EFAULT; if (val != 0) /* Can't change */ return -EINVAL; - return (*(int *) arg = ((curr_tempo * curr_timebase) + 30) / 60); + val = (curr_tempo * curr_timebase + 30) / 60; + if (put_user(val, p)) + return -EFAULT; + return val; } break; case SNDCTL_SEQ_GETTIME: - return (*(int *) arg = curr_ticks); + if (put_user(curr_ticks, p)) + return -EFAULT; + return curr_ticks; case SNDCTL_TMR_METRONOME: - metronome_mode = *(int *) arg; + if (get_user(metronome_mode, p)) + return -EFAULT; setup_metronome(midi_dev); return 0; diff -uNr linux-2.4.19/drivers/sound/msnd.c linux-2.4.19bgl/drivers/sound/msnd.c --- linux-2.4.19/drivers/sound/msnd.c 2001-09-30 14:26:08.000000000 -0500 +++ linux-2.4.19bgl/drivers/sound/msnd.c 2005-06-08 14:30:47.000000000 -0500 @@ -155,13 +155,10 @@ f->len = f->tail = f->head = 0; } -int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len, int user) +int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len) { int count = 0; - if (f->len == f->n) - return 0; - while ((count < len) && (f->len != f->n)) { int nwritten; @@ -177,11 +174,7 @@ nwritten = len - count; } - if (user) { - if (copy_from_user(f->data + f->tail, buf, nwritten)) - return -EFAULT; - } else - isa_memcpy_fromio(f->data + f->tail, (unsigned long) buf, nwritten); + isa_memcpy_fromio(f->data + f->tail, (unsigned long) buf, nwritten); count += nwritten; buf += nwritten; @@ -193,13 +186,10 @@ return count; } -int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len, int user) +int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len) { int count = 0; - if (f->len == 0) - return f->len; - while ((count < len) && (f->len > 0)) { int nread; @@ -215,11 +205,7 @@ nread = len - count; } - if (user) { - if (copy_to_user(buf, f->data + f->head, nread)) - return -EFAULT; - } else - isa_memcpy_toio((unsigned long) buf, f->data + f->head, nread); + isa_memcpy_toio((unsigned long) buf, f->data + f->head, nread); count += nread; buf += nread; diff -uNr linux-2.4.19/drivers/sound/msnd.h linux-2.4.19bgl/drivers/sound/msnd.h --- linux-2.4.19/drivers/sound/msnd.h 2000-07-12 23:58:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/sound/msnd.h 2005-06-08 14:30:47.000000000 -0500 @@ -266,8 +266,8 @@ void msnd_fifo_free(msnd_fifo *f); int msnd_fifo_alloc(msnd_fifo *f, size_t n); void msnd_fifo_make_empty(msnd_fifo *f); -int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len, int user); -int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len, int user); +int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len); +int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len); int msnd_wait_TXDE(multisound_dev_t *dev); int msnd_wait_HC0(multisound_dev_t *dev); diff -uNr linux-2.4.19/drivers/sound/msnd_pinnacle.c linux-2.4.19bgl/drivers/sound/msnd_pinnacle.c --- linux-2.4.19/drivers/sound/msnd_pinnacle.c 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/sound/msnd_pinnacle.c 2005-06-08 14:30:47.000000000 -0500 @@ -804,7 +804,7 @@ static __inline__ int pack_DARQ_to_DARF(register int bank) { - register int size, n, timeout = 3; + register int size, timeout = 3; register WORD wTmp; LPDAQD DAQD; @@ -825,13 +825,10 @@ /* Read data from the head (unprotected bank 1 access okay since this is only called inside an interrupt) */ outb(HPBLKSEL_1, dev.io + HP_BLKS); - if ((n = msnd_fifo_write( + msnd_fifo_write( &dev.DARF, (char *)(dev.base + bank * DAR_BUFF_SIZE), - size, 0)) <= 0) { - outb(HPBLKSEL_0, dev.io + HP_BLKS); - return n; - } + size); outb(HPBLKSEL_0, dev.io + HP_BLKS); return 1; @@ -853,21 +850,16 @@ if (protect) { /* Critical section: protect fifo in non-interrupt */ spin_lock_irqsave(&dev.lock, flags); - if ((n = msnd_fifo_read( + n = msnd_fifo_read( &dev.DAPF, (char *)(dev.base + bank_num * DAP_BUFF_SIZE), - DAP_BUFF_SIZE, 0)) < 0) { - spin_unlock_irqrestore(&dev.lock, flags); - return n; - } + DAP_BUFF_SIZE); spin_unlock_irqrestore(&dev.lock, flags); } else { - if ((n = msnd_fifo_read( + n = msnd_fifo_read( &dev.DAPF, (char *)(dev.base + bank_num * DAP_BUFF_SIZE), - DAP_BUFF_SIZE, 0)) < 0) { - return n; - } + DAP_BUFF_SIZE); } if (!n) break; @@ -894,30 +886,43 @@ static int dsp_read(char *buf, size_t len) { int count = len; + char *page = (char *)__get_free_page(PAGE_SIZE); + + if (!page) + return -ENOMEM; while (count > 0) { - int n; + int n, k; unsigned long flags; + k = PAGE_SIZE; + if (k > count) + k = count; + /* Critical section: protect fifo in non-interrupt */ spin_lock_irqsave(&dev.lock, flags); - if ((n = msnd_fifo_read(&dev.DARF, buf, count, 1)) < 0) { - printk(KERN_WARNING LOGNAME ": FIFO read error\n"); - spin_unlock_irqrestore(&dev.lock, flags); - return n; - } + n = msnd_fifo_read(&dev.DARF, page, k); spin_unlock_irqrestore(&dev.lock, flags); + if (copy_to_user(buf, page, n)) { + free_page((unsigned long)page); + return -EFAULT; + } buf += n; count -= n; + if (n == k && count) + continue; + if (!test_bit(F_READING, &dev.flags) && dev.mode & FMODE_READ) { dev.last_recbank = -1; if (chk_send_dsp_cmd(&dev, HDEX_RECORD_START) == 0) set_bit(F_READING, &dev.flags); } - if (dev.rec_ndelay) + if (dev.rec_ndelay) { + free_page((unsigned long)page); return count == len ? -EAGAIN : len - count; + } if (count > 0) { set_bit(F_READBLOCK, &dev.flags); @@ -926,41 +931,57 @@ get_rec_delay_jiffies(DAR_BUFF_SIZE))) clear_bit(F_READING, &dev.flags); clear_bit(F_READBLOCK, &dev.flags); - if (signal_pending(current)) + if (signal_pending(current)) { + free_page((unsigned long)page); return -EINTR; + } } } - + free_page((unsigned long)page); return len - count; } static int dsp_write(const char *buf, size_t len) { int count = len; + char *page = (char *)__get_free_page(GFP_KERNEL); + + if (!page) + return -ENOMEM; while (count > 0) { - int n; + int n, k; unsigned long flags; + k = PAGE_SIZE; + if (k > count) + k = count; + + if (copy_from_user(page, buf, k)) { + free_page((unsigned long)page); + return -EFAULT; + } + /* Critical section: protect fifo in non-interrupt */ spin_lock_irqsave(&dev.lock, flags); - if ((n = msnd_fifo_write(&dev.DAPF, buf, count, 1)) < 0) { - printk(KERN_WARNING LOGNAME ": FIFO write error\n"); - spin_unlock_irqrestore(&dev.lock, flags); - return n; - } + n = msnd_fifo_write(&dev.DAPF, page, k); spin_unlock_irqrestore(&dev.lock, flags); buf += n; count -= n; + if (count && n == k) + continue; + if (!test_bit(F_WRITING, &dev.flags) && (dev.mode & FMODE_WRITE)) { dev.last_playbank = -1; if (pack_DAPF_to_DAPQ(1) > 0) set_bit(F_WRITING, &dev.flags); } - if (dev.play_ndelay) + if (dev.play_ndelay) { + free_page((unsigned long)page); return count == len ? -EAGAIN : len - count; + } if (count > 0) { set_bit(F_WRITEBLOCK, &dev.flags); @@ -968,11 +989,14 @@ &dev.writeblock, get_play_delay_jiffies(DAP_BUFF_SIZE)); clear_bit(F_WRITEBLOCK, &dev.flags); - if (signal_pending(current)) + if (signal_pending(current)) { + free_page((unsigned long)page); return -EINTR; + } } } + free_page((unsigned long)page); return len - count; } diff -uNr linux-2.4.19/drivers/sound/pss.c linux-2.4.19bgl/drivers/sound/pss.c --- linux-2.4.19/drivers/sound/pss.c 2002-02-25 13:38:06.000000000 -0600 +++ linux-2.4.19bgl/drivers/sound/pss.c 2005-06-08 14:30:47.000000000 -0500 @@ -450,20 +450,36 @@ } } -static void arg_to_volume_mono(unsigned int volume, int *aleft) +static int set_volume_mono(caddr_t p, int *aleft) { int left; + unsigned volume; + if (get_user(volume, (unsigned *)p)) + return -EFAULT; - left = volume & 0x00ff; + left = volume & 0xff; if (left > 100) left = 100; *aleft = left; + return 0; } -static void arg_to_volume_stereo(unsigned int volume, int *aleft, int *aright) +static int set_volume_stereo(caddr_t p, int *aleft, int *aright) { - arg_to_volume_mono(volume, aleft); - arg_to_volume_mono(volume >> 8, aright); + int left, right; + unsigned volume; + if (get_user(volume, (unsigned *)p)) + return -EFAULT; + + left = volume & 0xff; + if (left > 100) + left = 100; + right = (volume >> 8) & 0xff; + if (right > 100) + right = 100; + *aleft = left; + *aright = right; + return 0; } static int ret_vol_mono(int left) @@ -510,33 +526,38 @@ return call_ad_mixer(devc, cmd, arg); else { - if (*(int *)arg != 0) + int v; + if (get_user(v, (int *)arg)) + return -EFAULT; + if (v != 0) return -EINVAL; return 0; } case SOUND_MIXER_VOLUME: - arg_to_volume_stereo(*(unsigned int *)arg, &devc->mixer.volume_l, - &devc->mixer.volume_r); + if (set_volume_stereo(arg, + &devc->mixer.volume_l, + &devc->mixer.volume_r)) + return -EFAULT; set_master_volume(devc, devc->mixer.volume_l, devc->mixer.volume_r); return ret_vol_stereo(devc->mixer.volume_l, devc->mixer.volume_r); case SOUND_MIXER_BASS: - arg_to_volume_mono(*(unsigned int *)arg, - &devc->mixer.bass); + if (set_volume_mono(arg, &devc->mixer.bass)) + return -EFAULT; set_bass(devc, devc->mixer.bass); return ret_vol_mono(devc->mixer.bass); case SOUND_MIXER_TREBLE: - arg_to_volume_mono(*(unsigned int *)arg, - &devc->mixer.treble); + if (set_volume_mono(arg, &devc->mixer.treble)) + return -EFAULT; set_treble(devc, devc->mixer.treble); return ret_vol_mono(devc->mixer.treble); case SOUND_MIXER_SYNTH: - arg_to_volume_mono(*(unsigned int *)arg, - &devc->mixer.synth); + if (set_volume_mono(arg, &devc->mixer.synth)) + return -EFAULT; set_synth_volume(devc, devc->mixer.synth); return ret_vol_mono(devc->mixer.synth); @@ -546,54 +567,67 @@ } else { + int val, and_mask = 0, or_mask = 0; /* * Return parameters */ switch (cmdf) { - case SOUND_MIXER_DEVMASK: if (call_ad_mixer(devc, cmd, arg) == -EINVAL) - *(int *)arg = 0; /* no mixer devices */ - return (*(int *)arg |= SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE | SOUND_MASK_SYNTH); + break; + and_mask = ~0; + or_mask = SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE | SOUND_MASK_SYNTH; + break; case SOUND_MIXER_STEREODEVS: if (call_ad_mixer(devc, cmd, arg) == -EINVAL) - *(int *)arg = 0; /* no stereo devices */ - return (*(int *)arg |= SOUND_MASK_VOLUME); + break; + and_mask = ~0; + or_mask = SOUND_MASK_VOLUME; + break; case SOUND_MIXER_RECMASK: if (devc->ad_mixer_dev != NO_WSS_MIXER) return call_ad_mixer(devc, cmd, arg); - else - return (*(int *)arg = 0); /* no record devices */ + break; case SOUND_MIXER_CAPS: if (devc->ad_mixer_dev != NO_WSS_MIXER) return call_ad_mixer(devc, cmd, arg); - else - return (*(int *)arg = SOUND_CAP_EXCL_INPUT); + or_mask = SOUND_CAP_EXCL_INPUT; + break; case SOUND_MIXER_RECSRC: if (devc->ad_mixer_dev != NO_WSS_MIXER) return call_ad_mixer(devc, cmd, arg); - else - return (*(int *)arg = 0); /* no record source */ + break; case SOUND_MIXER_VOLUME: - return (*(int *)arg = ret_vol_stereo(devc->mixer.volume_l, devc->mixer.volume_r)); + or_mask = ret_vol_stereo(devc->mixer.volume_l, devc->mixer.volume_r); + break; case SOUND_MIXER_BASS: - return (*(int *)arg = ret_vol_mono(devc->mixer.bass)); + or_mask = ret_vol_mono(devc->mixer.bass); + break; case SOUND_MIXER_TREBLE: - return (*(int *)arg = ret_vol_mono(devc->mixer.treble)); + or_mask = ret_vol_mono(devc->mixer.treble); + break; case SOUND_MIXER_SYNTH: - return (*(int *)arg = ret_vol_mono(devc->mixer.synth)); + or_mask = ret_vol_mono(devc->mixer.synth); + break; default: return -EINVAL; } + if (get_user(val, (int *)arg)) + return -EFAULT; + val &= and_mask; + val |= or_mask; + if (put_user(val, (int *)arg)) + return -EFAULT; + return val; } } diff -uNr linux-2.4.19/drivers/sound/sb_audio.c linux-2.4.19bgl/drivers/sound/sb_audio.c --- linux-2.4.19/drivers/sound/sb_audio.c 2002-02-25 13:38:06.000000000 -0600 +++ linux-2.4.19bgl/drivers/sound/sb_audio.c 2005-06-08 14:30:47.000000000 -0500 @@ -879,7 +879,7 @@ c -= locallen; p += locallen; } /* used = ( samples * 16 bits size ) */ - *used = len << 1; + *used = max_in > ( max_out << 1) ? (max_out << 1) : max_in; /* returned = ( samples * 8 bits size ) */ *returned = len; } diff -uNr linux-2.4.19/drivers/telephony/Config.in linux-2.4.19bgl/drivers/telephony/Config.in --- linux-2.4.19/drivers/telephony/Config.in 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/telephony/Config.in 2005-06-08 14:30:43.000000000 -0500 @@ -5,6 +5,4 @@ comment 'Telephony Support' tristate 'Linux telephony support' CONFIG_PHONE -dep_tristate 'QuickNet Internet LineJack/PhoneJack support' CONFIG_PHONE_IXJ $CONFIG_PHONE -dep_tristate 'QuickNet Internet LineJack/PhoneJack PCMCIA support' CONFIG_PHONE_IXJ_PCMCIA $CONFIG_PHONE_IXJ $CONFIG_PCMCIA endmenu diff -uNr linux-2.4.19/drivers/telephony/Makefile linux-2.4.19bgl/drivers/telephony/Makefile --- linux-2.4.19/drivers/telephony/Makefile 2001-09-07 11:28:37.000000000 -0500 +++ linux-2.4.19bgl/drivers/telephony/Makefile 2005-06-08 14:30:43.000000000 -0500 @@ -10,11 +10,9 @@ obj-n := obj-m := obj- := -export-objs := phonedev.o ixj.o +export-objs := phonedev.o obj-$(CONFIG_PHONE) += phonedev.o -obj-$(CONFIG_PHONE_IXJ) += ixj.o -obj-$(CONFIG_PHONE_IXJ_PCMCIA) += ixj_pcmcia.o O_TARGET := telephony.o diff -uNr linux-2.4.19/drivers/usb/Config.in linux-2.4.19bgl/drivers/usb/Config.in --- linux-2.4.19/drivers/usb/Config.in 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/usb/Config.in 2005-06-08 14:30:43.000000000 -0500 @@ -72,14 +72,6 @@ if [ "$CONFIG_VIDEO_DEV" = "n" ]; then comment ' Video4Linux support is needed for USB Multimedia device support' else - dep_tristate ' USB IBM (Xirlink) C-it Camera support' CONFIG_USB_IBMCAM $CONFIG_USB $CONFIG_VIDEO_DEV - dep_tristate ' USB OV511 Camera support' CONFIG_USB_OV511 $CONFIG_USB $CONFIG_VIDEO_DEV - dep_tristate ' USB Philips Cameras' CONFIG_USB_PWC $CONFIG_USB $CONFIG_VIDEO_DEV - dep_tristate ' USB SE401 Camera support' CONFIG_USB_SE401 $CONFIG_USB $CONFIG_VIDEO_DEV - dep_tristate ' USB STV680 (Pencam) Camera support' CONFIG_USB_STV680 $CONFIG_USB $CONFIG_VIDEO_DEV - dep_tristate ' USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)' CONFIG_USB_VICAM $CONFIG_USB $CONFIG_VIDEO_DEV $CONFIG_EXPERIMENTAL - dep_tristate ' D-Link USB FM radio support (EXPERIMENTAL)' CONFIG_USB_DSBR $CONFIG_USB $CONFIG_VIDEO_DEV $CONFIG_EXPERIMENTAL - dep_tristate ' DABUSB driver' CONFIG_USB_DABUSB $CONFIG_USB fi comment 'USB Network adaptors' diff -uNr linux-2.4.19/drivers/usb/Makefile linux-2.4.19bgl/drivers/usb/Makefile --- linux-2.4.19/drivers/usb/Makefile 2002-08-02 19:39:44.000000000 -0500 +++ linux-2.4.19bgl/drivers/usb/Makefile 2005-06-08 14:30:43.000000000 -0500 @@ -10,14 +10,13 @@ # Objects that export symbols. -export-objs := hcd.o usb.o ov511.o pwc-uncompress.o +export-objs := hcd.o usb.o # Multipart objects. -list-multi := usbcore.o hid.o pwc.o +list-multi := usbcore.o hid.o usbcore-objs := usb.o usb-debug.o hub.o hid-objs := hid-core.o -pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o # Optional parts of multipart objects. @@ -69,23 +68,15 @@ obj-$(CONFIG_USB_PRINTER) += printer.o obj-$(CONFIG_USB_AUDIO) += audio.o obj-$(CONFIG_USB_EMI26) += emi26.o -obj-$(CONFIG_USB_IBMCAM) += ibmcam.o usbvideo.o ultracam.o -obj-$(CONFIG_USB_PWC) += pwc.o obj-$(CONFIG_USB_DC2XX) += dc2xx.o obj-$(CONFIG_USB_MDC800) += mdc800.o obj-$(CONFIG_USB_USS720) += uss720.o -obj-$(CONFIG_USB_DABUSB) += dabusb.o -obj-$(CONFIG_USB_VICAM) += vicam.o -obj-$(CONFIG_USB_OV511) += ov511.o -obj-$(CONFIG_USB_SE401) += se401.o -obj-$(CONFIG_USB_STV680) += stv680.o obj-$(CONFIG_USB_PEGASUS) += pegasus.o obj-$(CONFIG_USB_RTL8150) += rtl8150.o obj-$(CONFIG_USB_CATC) += catc.o obj-$(CONFIG_USB_KAWETH) += kaweth.o obj-$(CONFIG_USB_CDCETHER) += CDCEther.o obj-$(CONFIG_USB_RIO500) += rio500.o -obj-$(CONFIG_USB_DSBR) += dsbr100.o obj-$(CONFIG_USB_MICROTEK) += microtek.o obj-$(CONFIG_USB_HPUSBSCSI) += hpusbscsi.o obj-$(CONFIG_USB_BLUETOOTH) += bluetooth.o @@ -117,5 +108,3 @@ hid.o: $(hid-objs) $(LD) -r -o $@ $(hid-objs) -pwc.o: $(pwc-objs) - $(LD) -r -o $@ $(pwc-objs) diff -uNr linux-2.4.19/drivers/usb/usb-ohci.h linux-2.4.19bgl/drivers/usb/usb-ohci.h --- linux-2.4.19/drivers/usb/usb-ohci.h 2002-08-02 19:39:45.000000000 -0500 +++ linux-2.4.19bgl/drivers/usb/usb-ohci.h 2003-07-02 10:44:01.000000000 -0500 @@ -58,7 +58,7 @@ dma_addr_t dma; __u32 unused[3]; -} __attribute((aligned(16))); +} __attribute((aligned(32))); typedef struct ed ed_t; @@ -567,7 +567,7 @@ return -ENOMEM; ohci->dev_cache = pci_pool_create ("ohci_dev", ohci->ohci_dev, sizeof (struct ohci_device), - 16 /* byte alignment */, + 32 /* byte alignment */, 0 /* no page-crossing issues */, GFP_KERNEL | OHCI_MEM_FLAGS); if (!ohci->dev_cache) diff -uNr linux-2.4.19/drivers/video/Config.in linux-2.4.19bgl/drivers/video/Config.in --- linux-2.4.19/drivers/video/Config.in 2002-08-02 19:39:45.000000000 -0500 +++ linux-2.4.19bgl/drivers/video/Config.in 2003-07-02 10:43:16.000000000 -0500 @@ -66,15 +66,35 @@ define_bool CONFIG_FB_ATY_GX y fi fi - if [ "$CONFIG_PPC" = "y" ]; then - dep_bool ' Open Firmware frame buffer device support' CONFIG_FB_OF $CONFIG_ALL_PPC - dep_bool ' Apple "control" display support' CONFIG_FB_CONTROL $CONFIG_ALL_PPC - dep_bool ' Apple "platinum" display support' CONFIG_FB_PLATINUM $CONFIG_ALL_PPC - dep_bool ' Apple "valkyrie" display support' CONFIG_FB_VALKYRIE $CONFIG_ALL_PPC + if [ "$CONFIG_PPC_PSERIES" = "y" -o "$CONFIG_ALL_PPC" = "y" ]; then + bool ' Open Firmware frame buffer device support' CONFIG_FB_OF + fi + if [ "$CONFIG_PPC32" = "y" ]; then + if [ "$CONFIG_ALL_PPC" = "y" ]; then + bool ' Apple "control" display support' CONFIG_FB_CONTROL + bool ' Apple "platinum" display support' CONFIG_FB_PLATINUM + bool ' Apple "valkyrie" display support' CONFIG_FB_VALKYRIE + fi bool ' Chips 65550 display support' CONFIG_FB_CT65550 bool ' IMS Twin Turbo display support' CONFIG_FB_IMSTT - bool ' S3 Trio display support' CONFIG_FB_S3TRIO + tristate ' S3 Trio display support' CONFIG_FB_S3TRIO + bool ' VESA VGA graphics console' CONFIG_FB_VESA tristate ' VGA 16-color graphics console' CONFIG_FB_VGA16 + if [ "$CONFIG_8xx" = "y" ]; then + dep_tristate ' RPX LCD display support' CONFIG_FB_RPX $CONFIG_RPXLITE + if [ "$CONFIG_FB_RPX" != "n" ]; then + bool ' Debug RPX frame buffer' CONFIG_FB_RPX_DEBUG + choice ' RPX LCD Display Options' \ + "NEC CONFIG_FB_RPX_LCD_NEC \ + Sharp CONFIG_FB_RPX_LCD_SHARP" NEC + fi + fi + if [ "$CONFIG_XILINX_OCP" = "y" ]; then + tristate ' Xilinx LCD display support' CONFIG_FB_XILINX + if [ "$CONFIG_FB_XILINX" != "n" ]; then + bool ' Rotate display' CONFIG_FB_XILINX_ROTATE + fi + fi fi if [ "$CONFIG_PARISC" = "y" ]; then bool ' Generic STI frame buffer device support' CONFIG_FB_STI @@ -90,6 +110,7 @@ if [ "$ARCH" = "alpha" ]; then tristate ' TGA framebuffer support' CONFIG_FB_TGA fi + dep_tristate ' Silicon Motion Lynx3DM frame buffer support' CONFIG_FB_LYNX $CONFIG_PCI if [ "$ARCH" = "i386" ]; then bool ' VESA VGA graphics console' CONFIG_FB_VESA tristate ' VGA 16-color graphics console' CONFIG_FB_VGA16 @@ -118,6 +139,9 @@ hex ' Framebuffer Base Address' CONFIG_E1355_FB_BASE a8200000 fi fi + if [ "$CONFIG_BEECH" = "y" ]; then + bool 'IBM Beech LCD Controller Support' CONFIG_FB_IBMLCDC + fi if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then if [ "$CONFIG_PCI" != "n" ]; then tristate ' Matrox acceleration (EXPERIMENTAL)' CONFIG_FB_MATROX @@ -339,7 +363,8 @@ "$CONFIG_FB_MATROX" = "y" -o "$CONFIG_FB_PM2" = "y" -o \ "$CONFIG_FB_ATY128" = "y" -o "$CONFIG_FB_RADEON" = "y" -o \ "$CONFIG_FB_CYBER2000" = "y" -o "$CONFIG_FB_PVR2" = "y" -o \ - "$CONFIG_FB_VOODOO1" = "y" -o "$CONFIG_FB_NEOMAGIC" = "y" ]; then + "$CONFIG_FB_VOODOO1" = "y" -o "$CONFIG_FB_NEOMAGIC" = "y" -o \ + "$CONFIG_FB_LYNX" = "y" ]; then define_tristate CONFIG_FBCON_CFB24 y else if [ "$CONFIG_FB_ATY" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" -o \ @@ -361,7 +386,8 @@ "$CONFIG_FB_FM2" = "y" -o "$CONFIG_FB_SGIVW" = "y" -o \ "$CONFIG_FB_RADEON" = "y" -o "$CONFIG_FB_PVR2" = "y" -o \ "$CONFIG_FB_3DFX" = "y" -o "$CONFIG_FB_SIS" = "y" -o \ - "$CONFIG_FB_VOODOO1" = "y" -o "$CONFIG_FB_CYBER2000" = "y" ]; then + "$CONFIG_FB_VOODOO1" = "y" -o "$CONFIG_FB_CYBER2000" = "y" -o \ + "$CONFIG_FB_XILINX" = "y" ]; then define_tristate CONFIG_FBCON_CFB32 y else if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \ @@ -374,7 +400,7 @@ "$CONFIG_FB_3DFX" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \ "$CONFIG_FB_SGIVW" = "m" -o "$CONFIG_FB_SIS" = "m" -o \ "$CONFIG_FB_PVR2" = "m" -o "$CONFIG_FB_VOODOO1" = "m" -o \ - "$CONFIG_FB_CYBER2000" = "m" ]; then + "$CONFIG_FB_CYBER2000" = "m" -o "$CONFIG_FB_XILINX" = "m" ]; then define_tristate CONFIG_FBCON_CFB32 m fi fi diff -uNr linux-2.4.19/drivers/video/Makefile linux-2.4.19bgl/drivers/video/Makefile --- linux-2.4.19/drivers/video/Makefile 2002-08-02 19:39:45.000000000 -0500 +++ linux-2.4.19bgl/drivers/video/Makefile 2003-07-02 10:43:19.000000000 -0500 @@ -69,6 +69,7 @@ obj-$(CONFIG_FB_TRIDENT) += tridentfb.o fbgen.o obj-$(CONFIG_FB_S3TRIO) += S3triofb.o obj-$(CONFIG_FB_TGA) += tgafb.o fbgen.o +obj-$(CONFIG_FB_LYNX) += lynxfb.o obj-$(CONFIG_FB_VESA) += vesafb.o obj-$(CONFIG_FB_VGA16) += vga16fb.o fbcon-vga-planes.o obj-$(CONFIG_FB_VIRGE) += virgefb.o @@ -87,7 +88,9 @@ obj-$(CONFIG_FB_PMAGB_B) += pmagb-b-fb.o obj-$(CONFIG_FB_MAXINE) += maxinefb.o obj-$(CONFIG_FB_TX3912) += tx3912fb.o - +obj-$(CONFIG_FB_RPX) += rpxfb.o +obj-$(CONFIG_FB_XILINX) += xilinxfb.o fbgen.o +obj-$(CONFIG_FB_IBMLCDC) += ibmlcdfb.o fbgen.o subdir-$(CONFIG_FB_MATROX) += matrox ifeq ($(CONFIG_FB_MATROX),y) diff -uNr linux-2.4.19/drivers/video/S3triofb.c linux-2.4.19bgl/drivers/video/S3triofb.c --- linux-2.4.19/drivers/video/S3triofb.c 2001-09-13 18:04:43.000000000 -0500 +++ linux-2.4.19bgl/drivers/video/S3triofb.c 2003-07-02 10:44:29.000000000 -0500 @@ -17,8 +17,7 @@ */ /* - Bugs : + OF dependencies should be removed. - + This driver should be merged with the CyberVision driver. The + Bugs : + This driver should be merged with the CyberVision driver. The CyberVision is a Zorro III implementation of the S3Trio64 chip. */ @@ -37,9 +36,6 @@ #include #include #include -#include -#include -#include #include #ifdef CONFIG_FB_COMPAT_XPMAC #include @@ -60,7 +56,9 @@ #define IO_OUT16VAL(v, r) (((v) << 8) | (r)) + static int currcon = 0; +static int disabled; static struct display disp; static struct fb_info fb_info; static struct { u_char red, green, blue, pad; } palette[256]; @@ -68,14 +66,20 @@ static char *s3trio_base; static struct fb_fix_screeninfo fb_fix; -static struct fb_var_screeninfo fb_var = { 0, }; - +static struct fb_var_screeninfo S3triofb_default_var = { + 640, 480, 640, 480, 0, 0, 8, 0, + {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0}, + 0, 0, -1, FB_ACCELF_TEXT, 39722, 40, 24, 32, 11, 96, 2, + FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, + FB_VMODE_NONINTERLACED +}; +static struct fb_var_screeninfo fb_var = { 0,}; /* * Interface used by the world */ -static void __init s3triofb_of_init(struct device_node *dp); +static void __init s3triofb_pci_init(struct pci_dev *dp); static int s3trio_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info); static int s3trio_get_var(struct fb_var_screeninfo *var, int con, @@ -259,15 +263,42 @@ return 0; } +int __init s3triofb_setup(char *options) { + char *this_opt; + + if (!options || !*options) + return 0; + + while ((this_opt = strsep(&options, ",")) != NULL) { + if (!*this_opt) + continue; + + if (!strcmp(this_opt, "disabled")) + disabled = 1; + } + return 0; +} int __init s3triofb_init(void) { - struct device_node *dp; + struct pci_dev *dp = NULL; - dp = find_devices("S3Trio"); - if (dp != 0) - s3triofb_of_init(dp); - return 0; + if (disabled) + return -ENXIO; + + dp = pci_find_device(PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_TRIO, dp); + if ((dp != 0) && ((dp->class >> 16) == PCI_BASE_CLASS_DISPLAY)) { + s3triofb_pci_init(dp); + return 0; + } else + return -ENODEV; +} + +static void __exit s3triofb_exit(void) +{ + unregister_framebuffer(&fb_info); + iounmap(s3trio_base); + /* XXX unshare VGA regions */ } void __init s3trio_resetaccel(void){ @@ -313,111 +344,69 @@ outw( MF_PIX_CONTROL | MFA_SRC_FOREGR_MIX, 0xbee8); } -int __init s3trio_init(struct device_node *dp){ - - u_char bus, dev; - unsigned int t32; - unsigned short cmd; - - pci_device_loc(dp,&bus,&dev); - pcibios_read_config_dword(bus, dev, PCI_VENDOR_ID, &t32); - if(t32 == (PCI_DEVICE_ID_S3_TRIO << 16) + PCI_VENDOR_ID_S3) { - pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_0, &t32); - pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_1, &t32); - pcibios_read_config_word(bus, dev, PCI_COMMAND,&cmd); - - pcibios_write_config_word(bus, dev, PCI_COMMAND, PCI_COMMAND_IO | PCI_COMMAND_MEMORY); - - pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_0,0xffffffff); - pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_0, &t32); - -/* This is a gross hack as OF only maps enough memory for the framebuffer and - we want to use MMIO too. We should find out which chunk of address space - we can use here */ - pcibios_write_config_dword(bus,dev,PCI_BASE_ADDRESS_0,0xc6000000); - - /* unlock s3 */ - - outb(0x01, 0x3C3); - - outb(inb(0x03CC) | 1, 0x3c2); - - outw(IO_OUT16VAL(0x48, 0x38),0x03D4); - outw(IO_OUT16VAL(0xA0, 0x39),0x03D4); - outb(0x33,0x3d4); - outw(IO_OUT16VAL((inb(0x3d5) & ~(0x2 | 0x10 | 0x40)) | - 0x20, 0x33), 0x3d4); - - outw(IO_OUT16VAL(0x6, 0x8), 0x3c4); - - /* switch to MMIO only mode */ - - outb(0x58, 0x3d4); - outw(IO_OUT16VAL(inb(0x3d5) | 3 | 0x10, 0x58), 0x3d4); - outw(IO_OUT16VAL(8, 0x53), 0x3d4); - - /* switch off I/O accesses */ - -#if 0 - pcibios_write_config_word(bus, dev, PCI_COMMAND, - PCI_COMMAND_IO | PCI_COMMAND_MEMORY); -#endif - return 1; - } +int __init s3trio_init(struct pci_dev *dp) +{ + /* unlock s3 */ + outb(0x01, 0x3C3); + outb(inb(0x03CC) | 1, 0x3c2); + outw(IO_OUT16VAL(0x48, 0x38),0x03D4); + outw(IO_OUT16VAL(0xA0, 0x39),0x03D4); + outb(0x33,0x3d4); + outw(IO_OUT16VAL((inb(0x3d5) & ~(0x2 | 0x10 | 0x40)) | + 0x20, 0x33), 0x3d4); + + outw(IO_OUT16VAL(0x6, 0x8), 0x3c4); + printk("S3trio: unlocked s3\n"); + + /* switch to MMIO only mode */ + outb(0x58, 0x3d4); + outw(IO_OUT16VAL(inb(0x3d5) | 3 | 0x10, 0x58), 0x3d4); + outw(IO_OUT16VAL(8, 0x53), 0x3d4); + printk("S3trio: switched to mmio only mode\n"); - return 0; + return 1; } /* * Initialisation - * We heavily rely on OF for the moment. This needs fixing. */ -static void __init s3triofb_of_init(struct device_node *dp) +static void __init s3triofb_pci_init(struct pci_dev *dp) { - int i, *pp, len; + int i; unsigned long address, size; u_long *CursorBase; + u16 cmd; - strncat(s3trio_name, dp->name, sizeof(s3trio_name)); - s3trio_name[sizeof(s3trio_name)-1] = '\0'; strcpy(fb_fix.id, s3trio_name); - if((pp = (int *)get_property(dp, "vendor-id", &len)) != NULL - && *pp!=PCI_VENDOR_ID_S3) { - printk("%s: can't find S3 Trio board\n", dp->full_name); - return; - } + fb_var = S3triofb_default_var; + fb_fix.line_length = fb_var.xres_virtual; + fb_fix.smem_len = fb_fix.line_length*fb_var.yres; - if((pp = (int *)get_property(dp, "device-id", &len)) != NULL - && *pp!=PCI_DEVICE_ID_S3_TRIO) { - printk("%s: can't find S3 Trio board\n", dp->full_name); - return; + /* This driver cannot cope if the firmware has not initialised the + * device. So, if the device isn't enabled we simply return + */ + pci_read_config_word(dp, PCI_COMMAND, &cmd); + if (!(cmd & PCI_COMMAND_MEMORY)) { + printk(KERN_NOTICE "S3trio: card was not initialised by firmware\n"); + return; } - if ((pp = (int *)get_property(dp, "depth", &len)) != NULL - && len == sizeof(int) && *pp != 8) { - printk("%s: can't use depth = %d\n", dp->full_name, *pp); - return; + /* Enable it anyway */ + if (pci_enable_device(dp)) { + printk(KERN_ERR "S3trio: failed to enable PCI device\n"); + return; } - if ((pp = (int *)get_property(dp, "width", &len)) != NULL - && len == sizeof(int)) - fb_var.xres = fb_var.xres_virtual = *pp; - if ((pp = (int *)get_property(dp, "height", &len)) != NULL - && len == sizeof(int)) - fb_var.yres = fb_var.yres_virtual = *pp; - if ((pp = (int *)get_property(dp, "linebytes", &len)) != NULL - && len == sizeof(int)) - fb_fix.line_length = *pp; - else - fb_fix.line_length = fb_var.xres_virtual; - fb_fix.smem_len = fb_fix.line_length*fb_var.yres; - address = 0xc6000000; - size = 64*1024*1024; - if (!request_mem_region(address, size, "S3triofb")) + /* There is only one memory region and it covers the mmio and fb areas */ + address = pci_resource_start(dp, 0); + size = pci_resource_len(dp, 0); /* size = 64*1024*1024; */ + if (!request_mem_region(address, size, "S3triofb")) { + printk("S3trio: failed to allocate memory region\n"); return; + } s3trio_init(dp); s3trio_base = ioremap(address, size); @@ -552,8 +541,7 @@ #endif disp.scrollmode = fb_var.accel_flags & FB_ACCELF_TEXT ? 0 : SCROLL_YREDRAW; - strcpy(fb_info.modename, "Trio64 "); - strncat(fb_info.modename, dp->full_name, sizeof(fb_info.modename)); + strcpy(fb_info.modename, "Trio64"); fb_info.node = -1; fb_info.fbops = &s3trio_ops; #if 0 @@ -591,7 +579,7 @@ return; printk("fb%d: S3 Trio frame buffer device on %s\n", - GET_FB_IDX(fb_info.node), dp->full_name); + GET_FB_IDX(fb_info.node), dp->name); } @@ -859,4 +847,8 @@ }; #endif +#ifdef MODULE +module_init(s3triofb_init); MODULE_LICENSE("GPL"); +#endif +module_exit(s3triofb_exit); diff -uNr linux-2.4.19/drivers/video/controlfb.c linux-2.4.19bgl/drivers/video/controlfb.c --- linux-2.4.19/drivers/video/controlfb.c 2002-02-25 13:38:07.000000000 -0600 +++ linux-2.4.19bgl/drivers/video/controlfb.c 2003-07-02 10:43:06.000000000 -0500 @@ -132,7 +132,7 @@ }; /* control register access macro */ -#define CNTRL_REG(INFO,REG) (&(((INFO)->control_regs-> ## REG).r)) +#define CNTRL_REG(INFO,REG) (&(((INFO)->control_regs->REG).r)) /******************** Prototypes for exported functions ********************/ diff -uNr linux-2.4.19/drivers/video/fbmem.c linux-2.4.19bgl/drivers/video/fbmem.c --- linux-2.4.19/drivers/video/fbmem.c 2002-08-02 19:39:45.000000000 -0500 +++ linux-2.4.19bgl/drivers/video/fbmem.c 2003-07-02 10:43:58.000000000 -0500 @@ -136,6 +136,8 @@ extern int pvr2fb_setup(char*); extern int sstfb_init(void); extern int sstfb_setup(char*); +extern int ibmlcdfb_init(void); +extern int ibmlcdfb_setup(char*); static struct { const char *name; @@ -310,6 +312,9 @@ #ifdef CONFIG_FB_MAXINE { "maxinefb", maxinefb_init, NULL }, #endif +#ifdef CONFIG_FB_IBMLCDC + { "ibmlcdfb", ibmlcdfb_init, ibmlcdfb_setup }, +#endif /* diff -uNr linux-2.4.19/drivers/video/offb.c linux-2.4.19bgl/drivers/video/offb.c --- linux-2.4.19/drivers/video/offb.c 2002-02-25 13:38:07.000000000 -0600 +++ linux-2.4.19bgl/drivers/video/offb.c 2003-07-02 10:43:52.000000000 -0500 @@ -357,7 +357,7 @@ } else pitch = width; if ((up = (unsigned *)get_property(dp, "address", &len)) != NULL - && len == sizeof(unsigned)) + && len >= sizeof(unsigned)) address = (u_long)*up; else { for (i = 0; i < dp->n_addrs; ++i) @@ -430,7 +430,7 @@ info->cmap_type = cmap_unknown; if (depth == 8) { - /* XXX kludge for ati's */ + /* XXX kludge for ati */ if (dp && !strncmp(name, "ATY,Rage128", 11)) { unsigned long regbase = dp->addrs[2].address; info->cmap_adr = ioremap(regbase, 0x1FFF); diff -uNr linux-2.4.19/drivers/video/radeon.h linux-2.4.19bgl/drivers/video/radeon.h --- linux-2.4.19/drivers/video/radeon.h 2002-02-25 13:38:07.000000000 -0600 +++ linux-2.4.19bgl/drivers/video/radeon.h 2003-07-02 10:43:17.000000000 -0500 @@ -395,7 +395,7 @@ #define RADEON_BIOS_6_SCRATCH 0x0028 #define RADEON_BIOS_7_SCRATCH 0x002c - +/* PLL Registers */ #define CLK_PIN_CNTL 0x0001 #define PPLL_CNTL 0x0002 #define PPLL_REF_DIV 0x0003 @@ -412,8 +412,9 @@ #define MPLL_CNTL 0x000e #define MDLL_CKO 0x000f #define MCLK_CNTL 0x0012 -#define AGP_PLL_CNTL 0x000b #define PLL_TEST_CNTL 0x0013 +#define CLK_PWRMGT_CNTL 0x0014 +#define PLL_PWRMGT_CNTL 0x0015 /* MCLK_CNTL bit constants */ #define FORCEON_MCLKA (1 << 16) @@ -770,7 +771,9 @@ #define MPLL_RESET 0x00000001 /* MDLL_CKO bit constants */ -#define MDLL_CKO__MCKOA_RESET 0x00000002 +#define MCKOA_RESET 0x00000002 +#define MCKOA_REF_SKEW_MASK 0x00000700 +#define MCKOA_FB_SKEW_MASK 0x00007000 /* VCLK_ECP_CNTL constants */ #define PIXCLK_ALWAYS_ONb 0x00000040 diff -uNr linux-2.4.19/drivers/video/radeonfb.c linux-2.4.19bgl/drivers/video/radeonfb.c --- linux-2.4.19/drivers/video/radeonfb.c 2002-08-02 19:39:45.000000000 -0500 +++ linux-2.4.19bgl/drivers/video/radeonfb.c 2003-07-02 10:44:32.000000000 -0500 @@ -225,7 +225,8 @@ /* PLL regs */ u32 ppll_div_3; u32 ppll_ref_div; - + u32 vclk_ecp_cntl; + /* Flat panel regs */ u32 fp_crtc_h_total_disp; u32 fp_crtc_v_total_disp; @@ -317,10 +318,11 @@ #endif #ifdef CONFIG_PMAC_PBOOK - unsigned char *save_framebuffer; int pm_reg; + u32 save_regs[16]; /* Add more later */ #endif - + int asleep; + struct radeonfb_info *next; }; @@ -966,6 +968,32 @@ /* currcon not yet configured, will be set by first switch */ rinfo->currcon = -1; + /* One PPC, OF based cards setup the internal memory + * mapping in strange ways. We change it so that the + * framebuffer is mapped at 0 and given half of the card's + * address space (2Gb). AGP is mapped high (0xe0000000) and + * can use up to 512Mb. Once DRI is fully implemented, we + * will have to setup the PCI remapper to remap the agp_special_page + * memory page somewhere between those regions so that the card + * use a normal PCI bus master cycle to access the ring read ptr. + * --BenH. + */ +#ifdef CONFIG_ALL_PPC + if (rinfo->hasCRTC2) + OUTREG(CRTC2_GEN_CNTL, + (INREG(CRTC2_GEN_CNTL) & ~CRTC2_EN) | CRTC2_DISP_REQ_EN_B); + OUTREG(CRTC_EXT_CNTL, INREG(CRTC_EXT_CNTL) | CRTC_DISPLAY_DIS); + OUTREG(MC_FB_LOCATION, 0x7fff0000); + OUTREG(MC_AGP_LOCATION, 0xffffe000); + OUTREG(DISPLAY_BASE_ADDR, 0x00000000); + if (rinfo->hasCRTC2) + OUTREG(CRTC2_DISPLAY_BASE_ADDR, 0x00000000); + OUTREG(SRC_OFFSET, 0x00000000); + OUTREG(DST_OFFSET, 0x00000000); + mdelay(10); + OUTREG(CRTC_EXT_CNTL, INREG(CRTC_EXT_CNTL) & ~CRTC_DISPLAY_DIS); +#endif /* CONFIG_ALL_PPC */ + /* set all the vital stuff */ radeon_set_fbinfo (rinfo); @@ -998,6 +1026,7 @@ return -ENODEV; } + if (!noaccel) { /* initialize the engine */ radeon_engine_init (rinfo); @@ -1012,7 +1041,15 @@ #ifdef CONFIG_PMAC_PBOOK if (rinfo->dviDisp_type == MT_LCD) { rinfo->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM); - pmu_register_sleep_notifier(&radeon_sleep_notifier); + if (rinfo->pm_reg) { + printk("radeonfb: pm reg @%x, clk_pwrmgt: %x, pll_pwrmgt: %x" + ", mdll_cko: %x\n", rinfo->pm_reg, INPLL(CLK_PWRMGT_CNTL), + INPLL(PLL_PWRMGT_CNTL), INPLL(MDLL_CKO)); + /* Fixup some PLL reg values for proper power management */ + OUTPLL(PLL_PWRMGT_CNTL, 0xc01f); + OUTPLL(MDLL_CKO, 0x043c); + pmu_register_sleep_notifier(&radeon_sleep_notifier); + } } #endif @@ -2102,8 +2139,10 @@ var->yres_virtual)) return -EINVAL; + if (rinfo->asleep) + return 0; offset = ((yoffset * var->xres + xoffset) * var->bits_per_pixel) >> 6; - + OUTREG(CRTC_OFFSET, offset); return 0; @@ -2172,6 +2211,9 @@ u32 val = INREG(CRTC_EXT_CNTL); u32 val2 = INREG(LVDS_GEN_CNTL); + if (rinfo->asleep) + return; + #ifdef CONFIG_PMAC_BACKLIGHT if (rinfo->dviDisp_type == MT_LCD && _machine == _MACH_Pmac) { set_backlight_enable(!blank); @@ -2253,7 +2295,7 @@ unsigned blue, unsigned transp, struct fb_info *info) { struct radeonfb_info *rinfo = (struct radeonfb_info *) info; - u32 pindex; + u32 pindex, vclk_cntl; if (regno > 255) return 1; @@ -2267,29 +2309,35 @@ /* default */ pindex = regno; - - if (rinfo->bpp == 16) { - pindex = regno * 8; - if (rinfo->depth == 16 && regno > 63) - return 1; - if (rinfo->depth == 15 && regno > 31) - return 1; + if (!rinfo->asleep) { + vclk_cntl = INPLL(VCLK_ECP_CNTL); + OUTPLL(VCLK_ECP_CNTL, vclk_cntl & ~PIXCLK_DAC_ALWAYS_ONb); + + if (rinfo->bpp == 16) { + pindex = regno * 8; + + if (rinfo->depth == 16 && regno > 63) + return 1; + if (rinfo->depth == 15 && regno > 31) + return 1; + + /* For 565, the green component is mixed one order below */ + if (rinfo->depth == 16) { + OUTREG(PALETTE_INDEX, pindex>>1); + OUTREG(PALETTE_DATA, (rinfo->palette[regno>>1].red << 16) | + (green << 8) | (rinfo->palette[regno>>1].blue)); + green = rinfo->palette[regno<<1].green; + } + } - /* For 565, the green component is mixed one order below */ - if (rinfo->depth == 16) { - OUTREG(PALETTE_INDEX, pindex>>1); - OUTREG(PALETTE_DATA, (rinfo->palette[regno>>1].red << 16) | - (green << 8) | (rinfo->palette[regno>>1].blue)); - green = rinfo->palette[regno<<1].green; - } - } + if (rinfo->depth != 16 || regno < 32) { + OUTREG(PALETTE_INDEX, pindex); + OUTREG(PALETTE_DATA, (red << 16) | (green << 8) | blue); + } - if (rinfo->depth != 16 || regno < 32) { - OUTREG(PALETTE_INDEX, pindex); - OUTREG(PALETTE_DATA, (red << 16) | (green << 8) | blue); + OUTPLL(VCLK_ECP_CNTL, vclk_cntl); } - if (regno < 16) { switch (rinfo->depth) { #ifdef FBCON_HAS_CFB16 @@ -2351,6 +2399,7 @@ save->lvds_pll_cntl = INREG(LVDS_PLL_CNTL); save->tmds_crc = INREG(TMDS_CRC); save->tmds_transmitter_cntl = INREG(TMDS_TRANSMITTER_CNTL); + save->vclk_ecp_cntl = INPLL(VCLK_ECP_CNTL); } @@ -2531,6 +2580,8 @@ newmode.ppll_ref_div = rinfo->pll.ref_div; newmode.ppll_div_3 = rinfo->fb_div | (post_div->bitvalue << 16); } + newmode.vclk_ecp_cntl = rinfo->init_state.vclk_ecp_cntl; + RTRACE("post div = 0x%x\n", rinfo->post_div); RTRACE("fb_div = 0x%x\n", rinfo->fb_div); @@ -2570,6 +2621,13 @@ if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD)) { unsigned int hRatio, vRatio; + /* We force the pixel clock to be always enabled. Allowing it + * to be power managed during blanking would save power, but has + * nasty interactions with the 2D engine & sleep code that haven't + * been solved yet. --BenH + */ + newmode.vclk_ecp_cntl &= ~PIXCLK_DAC_ALWAYS_ONb; + if (mode->xres > rinfo->panel_xres) mode->xres = rinfo->panel_xres; if (mode->yres > rinfo->panel_yres) @@ -2639,7 +2697,8 @@ } /* do it! */ - radeon_write_mode (rinfo, &newmode); + if (!rinfo->asleep) + radeon_write_mode (rinfo, &newmode); #if defined(CONFIG_BOOTX_TEXT) btext_update_display(rinfo->fb_base_phys, mode->xres, mode->yres, @@ -2745,6 +2804,8 @@ /* unblank screen */ OUTREG8(CRTC_EXT_CNTL + 1, 0); + OUTPLL(VCLK_ECP_CNTL, mode->vclk_ecp_cntl); + return; } @@ -2822,28 +2883,44 @@ * including PCI config registers, clocks, AGP conf, ...) */ if (suspend) { - /* Make sure CRTC2 is reset. Remove that the day - * we decide to actually use CRTC2 and replace it with - * real code for disabling the CRTC2 output during sleep. - */ - - pci_read_config_word(rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL, - &pwr_cmd); - - /* Switch PCI power managment to D2 */ - pci_write_config_word(rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL, - (pwr_cmd & ~PCI_PM_CTRL_STATE_MASK) - | 2); - pci_read_config_word(rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL, - &pwr_cmd); + /* Save some registers */ + rinfo->save_regs[0] = INREG(CRTC_GEN_CNTL); + rinfo->save_regs[1] = INREG(CRTC2_GEN_CNTL); + + /* Disable CRTCs */ + OUTREG(CRTC_GEN_CNTL, (INREG(CRTC_GEN_CNTL) & ~CRTC_EN) | CRTC_DISP_REQ_EN_B); + OUTREG(CRTC2_GEN_CNTL, (INREG(CRTC2_GEN_CNTL) & ~CRTC2_EN) | CRTC2_DISP_REQ_EN_B); + (void)INREG(CRTC2_GEN_CNTL); + mdelay(10); + + /* Reset the MDLL */ + OUTPLL(MDLL_CKO, INPLL(MDLL_CKO) | MCKOA_RESET); + OUTPLL(MDLL_CKO, INPLL(MDLL_CKO) & ~MCKOA_RESET); + + /* Switch PCI power managment to D2. */ + for (;;) { + pci_read_config_word( + rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL, + &pwr_cmd); + if (pwr_cmd & 2) + break; + pci_write_config_word( + rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL, + (pwr_cmd & ~PCI_PM_CTRL_STATE_MASK) | 2); + mdelay(500); + } } else { /* Switch back PCI powermanagment to D0 */ - mdelay(100); + mdelay(200); pci_write_config_word(rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL, 0); - mdelay(100); - pci_read_config_word(rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL, - &pwr_cmd); - mdelay(100); + mdelay(500); + + /* Restore the MDLL */ + OUTPLL(MDLL_CKO, INPLL(MDLL_CKO) & ~MCKOA_RESET); + + /* Restore some registers */ + OUTREG(CRTC2_GEN_CNTL, rinfo->save_regs[1]); + OUTREG(CRTC_GEN_CNTL, rinfo->save_regs[0]); } } @@ -2859,6 +2936,9 @@ for (rinfo = board_list; rinfo != NULL; rinfo = rinfo->next) { struct fb_fix_screeninfo fix; int nb; + struct display *disp; + + disp = (rinfo->currcon < 0) ? rinfo->info.disp : &fb_display[rinfo->currcon]; switch (rinfo->chipset) { case PCI_DEVICE_ID_RADEON_LW: @@ -2873,72 +2953,41 @@ nb = fb_display[fg_console].var.yres * fix.line_length; switch (when) { - case PBOOK_SLEEP_REQUEST: -#if 0 - rinfo->save_framebuffer = vmalloc(nb); - if (rinfo->save_framebuffer == NULL) - return PBOOK_SLEEP_REFUSE; -#endif - break; - case PBOOK_SLEEP_REJECT: -#if 0 - if (rinfo->save_framebuffer) { - vfree(rinfo->save_framebuffer); - rinfo->save_framebuffer = 0; - } -#endif - break; case PBOOK_SLEEP_NOW: - radeon_engine_idle(); - radeon_engine_reset(); - radeon_engine_idle(); - -#if 0 - /* Backup framebuffer content */ - if (rinfo->save_framebuffer) - memcpy_fromio(rinfo->save_framebuffer, - (void *)rinfo->fb_base, - nb); -#endif + acquire_console_sem(); + disp->dispsw = &fbcon_dummy; + + if (!noaccel) { + /* Make sure engine is reset */ + radeon_engine_reset(); + radeon_engine_idle(); + } /* Blank display and LCD */ radeonfb_blank(VESA_POWERDOWN+1, (struct fb_info *)rinfo); /* Sleep */ + rinfo->asleep = 1; radeon_set_suspend(rinfo, 1); - + release_console_sem(); + break; case PBOOK_WAKE: + acquire_console_sem(); /* Wakeup */ radeon_set_suspend(rinfo, 0); - radeon_engine_reset(); - if (!noaccel) { + if (!noaccel) radeon_engine_init(rinfo); - radeon_engine_reset(); - } - -#if 0 - /* Restore framebuffer content */ - if (rinfo->save_framebuffer) { - memcpy_toio((void *)rinfo->fb_base, - rinfo->save_framebuffer, - nb); - vfree(rinfo->save_framebuffer); - rinfo->save_framebuffer = 0; - } -#endif - - if (rinfo->currcon_display) { - radeonfb_set_var(&rinfo->currcon_display->var, rinfo->currcon, - (struct fb_info *) rinfo); - radeon_set_dispsw(rinfo, rinfo->currcon_display); - do_install_cmap(rinfo->currcon, - (struct fb_info *)rinfo); - } + rinfo->asleep = 0; + radeon_set_dispsw(rinfo, disp); + radeon_load_video_mode(rinfo, &disp->var); + do_install_cmap(rinfo->currcon, + (struct fb_info *)rinfo); radeonfb_blank(0, (struct fb_info *)rinfo); + release_console_sem(); break; } } diff -uNr linux-2.4.19/drivers/video/vesafb.c linux-2.4.19bgl/drivers/video/vesafb.c --- linux-2.4.19/drivers/video/vesafb.c 2001-11-14 16:52:20.000000000 -0600 +++ linux-2.4.19bgl/drivers/video/vesafb.c 2003-07-02 10:44:29.000000000 -0500 @@ -23,7 +23,9 @@ #include #include +#ifdef CONFIG_MTRR #include +#endif /* CONFIG_MTRR */ #include