diff -urN linux-2.4.18/Documentation/Configure.help linuxppc-2.4.18/Documentation/Configure.help --- linux-2.4.18/Documentation/Configure.help Mon Mar 4 20:52:32 2002 +++ linuxppc-2.4.18/Documentation/Configure.help Thu Mar 7 10:51:52 2002 @@ -5434,18 +5434,19 @@ (see ipchains(8), "-m" argument). AppleTalk interfaces support -CONFIG_APPLETALK - AppleTalk is the way Apple computers speak to each other on a - network. If your Linux box is connected to such a network and you - want to join the conversation, say Y. +CONFIG_DEV_APPLETALK + AppleTalk is the protocol that Apple computers can use to communicate + on a network. If your Linux box is connected to such a network, and wish + to do IP over it, or you have a LocalTalk card and wish to use it to + connect to the AppleTalk network, say Y. AppleTalk protocol support CONFIG_ATALK - AppleTalk is the way Apple computers speak to each other on a - network. If your Linux box is connected to such a network and you - want to join the conversation, say Y. You will need to use the - netatalk package so that your Linux box can act as a print and file - server for Macs as well as access AppleTalk printers. Check out + AppleTalk is the protocol that Apple computers can use to communicate + on a network. If your Linux box is connected to such a network and you + wish to connect to it, say Y. You will need to use the netatalk package + so that your Linux box can act as a print and file server for Macs as + well as access AppleTalk printers. Check out on the WWW for details. EtherTalk is the name used for AppleTalk over Ethernet and the cheaper and slower LocalTalk is AppleTalk over a proprietary Apple @@ -14402,8 +14403,15 @@ other useful pieces of information. Sometimes this information is not present or incorrect. - Unless you expect to boot on a PReP system, there is not need to + Unless you expect to boot on a PReP system, there is no need to select Y. + +PReP residual data available in /proc/residual +CONFIG_PROC_PREPRESIDUAL + Enabling this option will create a /proc/residual file which allows + you to get at the residual data on PReP systems. You will need a tool + (lsresidual) to parse it. If you aren't on a PReP system, you don't + want this. /dev file system support CONFIG_DEVFS_FS diff -urN linux-2.4.18/Makefile linuxppc-2.4.18/Makefile --- linux-2.4.18/Makefile Mon Mar 4 20:52:32 2002 +++ linuxppc-2.4.18/Makefile Thu Mar 7 10:52:23 2002 @@ -142,7 +142,7 @@ DRIVERS-$(CONFIG_NUBUS) += drivers/nubus/nubus.a DRIVERS-$(CONFIG_ISDN) += drivers/isdn/isdn.a DRIVERS-$(CONFIG_NET_FC) += drivers/net/fc/fc.o -DRIVERS-$(CONFIG_APPLETALK) += drivers/net/appletalk/appletalk.o +DRIVERS-$(CONFIG_DEV_APPLETALK) += drivers/net/appletalk/appletalk.o DRIVERS-$(CONFIG_TR) += drivers/net/tokenring/tr.o DRIVERS-$(CONFIG_WAN) += drivers/net/wan/wan.o DRIVERS-$(CONFIG_ARCNET) += drivers/net/arcnet/arcnetdrv.o diff -urN linux-2.4.18/arch/ppc/8260_io/Config.in linuxppc-2.4.18/arch/ppc/8260_io/Config.in --- linux-2.4.18/arch/ppc/8260_io/Config.in Mon Sep 18 03:48:05 2000 +++ linuxppc-2.4.18/arch/ppc/8260_io/Config.in Thu Mar 7 10:52:19 2002 @@ -1,9 +1,10 @@ # # MPC8260 Communication options # +mainmenu_option next_comment +comment 'MPC8260 Communication Options' +bool 'Enable SCC Console' CONFIG_SCC_CONSOLE if [ "$CONFIG_NET_ETHERNET" = "y" ]; then - mainmenu_option next_comment - comment 'MPC8260 Communication Options' bool 'CPM SCC Ethernet' CONFIG_SCC_ENET if [ "$CONFIG_SCC_ENET" = "y" ]; then bool 'Ethernet on SCC1' CONFIG_SCC1_ENET @@ -21,5 +22,5 @@ bool 'Ethernet on FCC2' CONFIG_FCC2_ENET bool 'Ethernet on FCC3' CONFIG_FCC3_ENET fi - endmenu fi +endmenu diff -urN linux-2.4.18/arch/ppc/8260_io/Makefile linuxppc-2.4.18/arch/ppc/8260_io/Makefile --- linux-2.4.18/arch/ppc/8260_io/Makefile Sat May 26 12:39:39 2001 +++ linuxppc-2.4.18/arch/ppc/8260_io/Makefile Thu Mar 7 10:51:54 2002 @@ -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 -urN linux-2.4.18/arch/ppc/8260_io/commproc.c linuxppc-2.4.18/arch/ppc/8260_io/commproc.c --- linux-2.4.18/arch/ppc/8260_io/commproc.c Tue Nov 6 18:21:28 2001 +++ linuxppc-2.4.18/arch/ppc/8260_io/commproc.c Thu Mar 7 10:51:53 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.commproc.c 1.10 10/16/01 16:21:52 trini + * BK Id: SCCS/s.commproc.c 1.11 11/04/01 22:58:20 paulus */ /* diff -urN linux-2.4.18/arch/ppc/8260_io/enet.c linuxppc-2.4.18/arch/ppc/8260_io/enet.c --- linux-2.4.18/arch/ppc/8260_io/enet.c Wed Oct 10 12:38:52 2001 +++ linuxppc-2.4.18/arch/ppc/8260_io/enet.c Thu Mar 7 10:51:41 2002 @@ -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 -urN linux-2.4.18/arch/ppc/8260_io/fcc_enet.c linuxppc-2.4.18/arch/ppc/8260_io/fcc_enet.c --- linux-2.4.18/arch/ppc/8260_io/fcc_enet.c Sat May 26 12:39:39 2001 +++ linuxppc-2.4.18/arch/ppc/8260_io/fcc_enet.c Thu Mar 7 10:52:14 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.fcc_enet.c 1.7 05/17/01 18:14:20 cort + * BK Id: SCCS/s.fcc_enet.c 1.11 06/05/01 21:22:01 paulus */ /* * Fast Ethernet Controller (FCC) driver for Motorola MPC8260. diff -urN linux-2.4.18/arch/ppc/8260_io/uart.c linuxppc-2.4.18/arch/ppc/8260_io/uart.c --- linux-2.4.18/arch/ppc/8260_io/uart.c Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/8260_io/uart.c Thu Mar 7 10:52:12 2002 @@ -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.14 01/10/02 15:04:02 trini */ /* * UART driver for MPC8260 CPM SCC or SMC diff -urN linux-2.4.18/arch/ppc/8xx_io/Makefile linuxppc-2.4.18/arch/ppc/8xx_io/Makefile --- linux-2.4.18/arch/ppc/8xx_io/Makefile Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/8xx_io/Makefile Thu Mar 7 10:51:50 2002 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.6 08/30/01 09:33:48 trini +# BK Id: SCCS/s.Makefile 1.7 09/09/01 12:20:42 trini # # # Makefile for the linux MPC8xx ppc-specific parts of comm processor diff -urN linux-2.4.18/arch/ppc/8xx_io/commproc.c linuxppc-2.4.18/arch/ppc/8xx_io/commproc.c --- linux-2.4.18/arch/ppc/8xx_io/commproc.c Tue Nov 6 18:21:29 2001 +++ linuxppc-2.4.18/arch/ppc/8xx_io/commproc.c Thu Mar 7 10:51:51 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.commproc.c 1.15 10/16/01 16:21:52 trini + * BK Id: SCCS/s.commproc.c 1.16 11/04/01 22:58:20 paulus */ /* diff -urN linux-2.4.18/arch/ppc/8xx_io/enet.c linuxppc-2.4.18/arch/ppc/8xx_io/enet.c --- linux-2.4.18/arch/ppc/8xx_io/enet.c Wed Oct 24 23:04:55 2001 +++ linuxppc-2.4.18/arch/ppc/8xx_io/enet.c Thu Mar 7 10:51:53 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.enet.c 1.17 10/11/01 11:55:47 trini + * BK Id: SCCS/s.enet.c 1.18 10/17/01 18:40:00 trini */ /* * Ethernet driver for Motorola MPC8xx. diff -urN linux-2.4.18/arch/ppc/8xx_io/fec.c linuxppc-2.4.18/arch/ppc/8xx_io/fec.c --- linux-2.4.18/arch/ppc/8xx_io/fec.c Wed Oct 24 23:04:55 2001 +++ linuxppc-2.4.18/arch/ppc/8xx_io/fec.c Thu Mar 7 10:51:42 2002 @@ -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.21 10/17/01 18:40:00 trini */ /* * Fast Ethernet Controller (FEC) driver for Motorola MPC8xx. diff -urN linux-2.4.18/arch/ppc/8xx_io/uart.c linuxppc-2.4.18/arch/ppc/8xx_io/uart.c --- linux-2.4.18/arch/ppc/8xx_io/uart.c Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/8xx_io/uart.c Thu Mar 7 10:51:43 2002 @@ -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.24 01/10/02 15:04:02 trini */ /* * UART driver for MPC860 CPM SCC or SMC diff -urN linux-2.4.18/arch/ppc/Makefile linuxppc-2.4.18/arch/ppc/Makefile --- linux-2.4.18/arch/ppc/Makefile Wed Oct 24 23:04:55 2001 +++ linuxppc-2.4.18/arch/ppc/Makefile Thu Mar 7 10:52:18 2002 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.23 09/18/01 11:19:05 paulus +# BK Id: SCCS/s.Makefile 1.24 10/11/01 17:51:25 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 diff -urN linux-2.4.18/arch/ppc/amiga/Makefile linuxppc-2.4.18/arch/ppc/amiga/Makefile --- linux-2.4.18/arch/ppc/amiga/Makefile Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/amiga/Makefile Thu Mar 7 10:51:41 2002 @@ -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 -urN linux-2.4.18/arch/ppc/amiga/amiga_ksyms.c linuxppc-2.4.18/arch/ppc/amiga/amiga_ksyms.c --- linux-2.4.18/arch/ppc/amiga/amiga_ksyms.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/amiga/amiga_ksyms.c Thu Mar 7 10:51:45 2002 @@ -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 -urN linux-2.4.18/arch/ppc/amiga/amiints.c linuxppc-2.4.18/arch/ppc/amiga/amiints.c --- linux-2.4.18/arch/ppc/amiga/amiints.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/amiga/amiints.c Thu Mar 7 10:52:23 2002 @@ -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.10 06/05/01 21:22:02 paulus */ /* * linux/arch/m68k/amiga/amiints.c -- Amiga Linux interrupt handling code diff -urN linux-2.4.18/arch/ppc/amiga/amisound.c linuxppc-2.4.18/arch/ppc/amiga/amisound.c --- linux-2.4.18/arch/ppc/amiga/amisound.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/amiga/amisound.c Thu Mar 7 10:52:13 2002 @@ -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 -urN linux-2.4.18/arch/ppc/amiga/bootinfo.c linuxppc-2.4.18/arch/ppc/amiga/bootinfo.c --- linux-2.4.18/arch/ppc/amiga/bootinfo.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/amiga/bootinfo.c Thu Mar 7 10:51:42 2002 @@ -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 -urN linux-2.4.18/arch/ppc/amiga/chipram.c linuxppc-2.4.18/arch/ppc/amiga/chipram.c --- linux-2.4.18/arch/ppc/amiga/chipram.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/amiga/chipram.c Thu Mar 7 10:51:46 2002 @@ -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 -urN linux-2.4.18/arch/ppc/amiga/cia.c linuxppc-2.4.18/arch/ppc/amiga/cia.c --- linux-2.4.18/arch/ppc/amiga/cia.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/amiga/cia.c Thu Mar 7 10:51:52 2002 @@ -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.9 06/05/01 21:22:02 paulus */ /* * linux/arch/m68k/amiga/cia.c - CIA support diff -urN linux-2.4.18/arch/ppc/amiga/config.c linuxppc-2.4.18/arch/ppc/amiga/config.c --- linux-2.4.18/arch/ppc/amiga/config.c Wed Oct 24 23:04:55 2001 +++ linuxppc-2.4.18/arch/ppc/amiga/config.c Thu Mar 7 10:51:40 2002 @@ -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.13 10/11/01 17:51:25 trini */ #define m68k_debug_device debug_device diff -urN linux-2.4.18/arch/ppc/amiga/ints.c linuxppc-2.4.18/arch/ppc/amiga/ints.c --- linux-2.4.18/arch/ppc/amiga/ints.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/amiga/ints.c Thu Mar 7 10:52:18 2002 @@ -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 -urN linux-2.4.18/arch/ppc/amiga/pcmcia.c linuxppc-2.4.18/arch/ppc/amiga/pcmcia.c --- linux-2.4.18/arch/ppc/amiga/pcmcia.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/amiga/pcmcia.c Thu Mar 7 10:51:53 2002 @@ -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 -urN linux-2.4.18/arch/ppc/amiga/time.c linuxppc-2.4.18/arch/ppc/amiga/time.c --- linux-2.4.18/arch/ppc/amiga/time.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/amiga/time.c Thu Mar 7 10:51:50 2002 @@ -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 -urN linux-2.4.18/arch/ppc/boot/Makefile linuxppc-2.4.18/arch/ppc/boot/Makefile --- linux-2.4.18/arch/ppc/boot/Makefile Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/Makefile Thu Mar 7 10:51:50 2002 @@ -17,29 +17,24 @@ AFLAGS += -D__BOOTER__ OBJCOPY_ARGS = -O elf32-powerpc -ifeq ($(CONFIG_SMP),y) -TFTPSIMAGE=/tftpboot/sImage.smp -else -TFTPSIMAGE=/tftpboot/sImage -endif +MKIMAGE := ./utils/mkimage.wrapper -lib/zlib.a: +lib/zlib.a: lib/zlib.c $(MAKE) -C lib images/vmlinux.gz: $(TOPDIR)/vmlinux $(MAKE) -C images vmlinux.gz -# Subdirs and tools needed for each. -subdir-y := lib images common -subdir-$(CONFIG_ALL_PPC) += chrp pmac prep -tools-$(CONFIG_ALL_PPC) := addnote piggyback mknote hack-coff mkprep -subdir-$(CONFIG_4xx) += tree -subdir-$(CONFIG_8xx) += mbx -subdir-$(CONFIG_8260) += mbx -tools-$(CONFIG_GEMINI) := mksimage - -# These are dirs we don't want to go into on BOOT_TARGETS -NONBOOT := lib images common +# Subdirs and tools needed for each. Assume we always need to go into +# 'simple' unless told otherwise. +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 + +# These are dirs we don't want to go into on BOOT_TARGETS. We have them for +# the 'depend' stage. +NONBOOT := lib common # These are the subdirs we want to use BOOTDIRS = $(filter-out $(NONBOOT), $(subdir-y)) @@ -50,37 +45,29 @@ $(MAKE) -C utils $(tools-y) # The targets all boards support for boot images. -BOOT_TARGETS = zImage -ifndef CONFIG_GEMINI -BOOT_TARGETS += zImage.initrd znetboot znetboot.initrd -endif +BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd -$(BOOT_TARGETS): sImage vmapus lib/zlib.a images/vmlinux.gz maketools +$(BOOT_TARGETS): vmapus lib/zlib.a images/vmlinux.gz maketools ifneq ($(BOOTDIRS),) for d in $(BOOTDIRS); do $(MAKE) -C $$d $@; done endif -sImage: $(TOPDIR)/vmlinux -ifdef CONFIG_GEMINI - $(OBJCOPY) -I elf32-powerpc -O binary $(TOPDIR)/vmlinux images/sImage -endif - vmapus: $(TOPDIR)/vmlinux ifdef CONFIG_APUS $(STRIP) $(TOPDIR)/vmlinux -o images/vmapus gzip $(GZIP_FLAGS) images/vmapus endif -ifdef CONFIG_GEMINI -znetboot : zImage - cp images/sImage $(TFTPSIMAGE) -endif +# Make an image for PPCBoot +pImage: images/vmlinux.gz + $(MKIMAGE) -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \ + -n 'Linux-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)' \ + -d $< images/vmlinux.PPCBoot + ln -sf vmlinux.PPCBoot images/pImage -# Clean up after ourselves. We have to do it like this since only some dirs -# need to be gone into. -- Tom +# These are subdirs with files not normally rm'ed. -- Tom clean: $(MAKE) -C images clean - $(MAKE) -C tree clean $(MAKE) -C utils clean include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ppc/boot/chrp/Makefile linuxppc-2.4.18/arch/ppc/boot/chrp/Makefile --- linux-2.4.18/arch/ppc/boot/chrp/Makefile Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/chrp/Makefile Thu Mar 7 10:52:13 2002 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.13 07/27/01 20:24:17 trini +# BK Id: SCCS/s.Makefile 1.15 01/11/02 10:46:06 trini # # Makefile for making ELF bootable images for booting on CHRP # using Open Firmware. @@ -7,19 +7,9 @@ # # Based on coffboot by Paul Mackerras -ifeq ($(CONFIG_PPC64BRIDGE),y) -MSIZE=.64 -AFLAGS += -Wa,-mppc64bridge -else -MSIZE= -endif - -.c.o: - $(CC) $(CFLAGS) -DKERNELBASE=$(KERNELBASE) -c -o $*.o $< -.S.o: - $(CC) $(AFLAGS) -traditional -c -o $*.o $< +USE_STANDARD_AS_RULE := true -LD_ARGS = -Ttext 0x00400000 +LD_ARGS = -T ../ld.script -Ttext 0x00400000 OBJS = ../common/crt0.o start.o main.o misc.o ../common/string.o image.o \ ../common/ofcommon.o @@ -27,23 +17,22 @@ ADDNOTE = ../utils/addnote PIGGYBACK = ../utils/piggyback +ifeq ($(CONFIG_PPC64BRIDGE),y) +END += .64 +AFLAGS += -Wa,-mppc64bridge +endif ifeq ($(CONFIG_SMP),y) -TFTPIMAGE=/tftpboot/zImage.chrp.smp$(MSIZE) -else -TFTPIMAGE=/tftpboot/zImage.chrp$(MSIZE) +END += .smp endif +TFTPIMAGE=/tftpboot/zImage.chrp$(END) + +AFLAGS_../common/crt0.o += -I$(TOPDIR)/arch/$(ARCH)/kernel + all: zImage znetboot: zImage -ifdef CONFIG_SMP - cp -f $(TOPDIR)/vmlinux /tftpboot/vmlinux.smp -else - cp -f $(TOPDIR)/vmlinux /tftpboot/vmlinux -endif -ifdef CONFIG_PPC64BRIDGE - cp -f $(TOPDIR)/vmlinux /tftpboot/vmlinux.64 -endif + cp -f $(TOPDIR)/vmlinux /tftpboot/vmlinux$(END) cp ../images/zImage.chrp $(TFTPIMAGE) znetboot.initrd: zImage.initrd @@ -52,22 +41,28 @@ floppy: zImage mcopy zImage a:zImage -image.o: $(PIGGYBACK) ../images/vmlinux.gz - $(PIGGYBACK) image < ../images/vmlinux.gz | $(AS) -o $@ - -sysmap.o: $(PIGGYBACK) $(TOPDIR)/System.map - $(PIGGYBACK) sysmap < $(TOPDIR)/System.map | $(AS) -o $@ - -initrd.o: ../images/ramdisk.image.gz $(PIGGYBACK) - $(PIGGYBACK) initrd < ../images/ramdisk.image.gz | $(AS) -o $@ +image.o: ../images/vmlinux.gz ../common/dummy.o + $(OBJCOPY) ../common/dummy.o $@ \ + --add-section=.image=../images/vmlinux.gz \ + --set-section-flags=.image=contents,alloc,load,readonly,data +ifdef CONFIG_XMON + $(OBJCOPY) $@ $@ \ + --add-section=.sysmap=$(TOPDIR)/System.map \ + --set-section-flags=.sysmap=contents,alloc,load,readonly,data +endif -zImage: $(OBJS) $(LIBS) ../common/no_initrd.o $(ADDNOTE) ../images/vmlinux.gz - $(LD) $(LD_ARGS) -o ../images/$@.chrp $(OBJS) ../common/no_initrd.o $(LIBS) +zImage: $(OBJS) $(LIBS) $(ADDNOTE) + $(LD) $(LD_ARGS) -o ../images/$@.chrp $(OBJS) $(LIBS) + $(OBJCOPY) ../images/$@.chrp ../images/$@.chrp -R .comment -R .ramdisk cp ../images/$@.chrp ../images/$@.chrp-rs6k $(ADDNOTE) ../images/$@.chrp-rs6k -zImage.initrd: $(OBJS) $(LIBS) initrd.o $(ADDNOTE) ../images/vmlinux.gz - $(LD) $(LD_ARGS) -o ../images/$@.chrp $(OBJS) initrd.o $(LIBS) +zImage.initrd: $(OBJS) $(LIBS) $(ADDNOTE) ../images/ramdisk.image.gz + $(OBJCOPY) image.o image.o \ + --add-section=.ramdisk=../images/ramdisk.image.gz \ + --set-section-flags=.ramdisk=contents,alloc,load,readonly,data + $(LD) $(LD_ARGS) -o ../images/$@.chrp $(OBJS) $(LIBS) + $(OBJCOPY) ../images/$@.chrp ../images/$@.chrp -R .comment cp ../images/$@.chrp ../images/$@.chrp-rs6k $(ADDNOTE) ../images/$@.chrp-rs6k diff -urN linux-2.4.18/arch/ppc/boot/chrp/main.c linuxppc-2.4.18/arch/ppc/boot/chrp/main.c --- linux-2.4.18/arch/ppc/boot/chrp/main.c Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/chrp/main.c Thu Mar 7 10:51:39 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.main.c 1.13 07/27/01 20:24:17 trini + * BK Id: SCCS/s.main.c 1.16 01/12/02 10:36:33 trini */ /* * Copyright (C) Paul Mackerras 1997. @@ -11,15 +11,14 @@ */ #include "nonstdio.h" #include +#include + +/* Passed from the linker */ +extern char __image_begin, __image_end; +extern char __ramdisk_begin[], __ramdisk_end; +extern char _start, _end; -extern char _end[]; -extern char initrd_data[]; -extern char image_data[]; -extern char sysmap_data[]; extern int getprop(void *, const char *, void *, int); -extern int initrd_len; -extern int image_len; -extern int sysmap_len; extern unsigned int heap_max; extern void claim(unsigned int virt, unsigned int size, unsigned int align); extern void *finddevice(const char *); @@ -53,22 +52,27 @@ unsigned sa, len; void *dst; unsigned char *im; - unsigned initrd_start=0, initrd_size=0; - extern char _start; + unsigned int initrd_size, initrd_start; printf("chrpboot starting: loaded at 0x%p\n\r", &_start); - if (initrd_len) { - initrd_size = initrd_len; + initrd_size = (char *)(&__ramdisk_end) - (char *)(&__ramdisk_begin); + if (initrd_size) { initrd_start = (RAM_END - initrd_size) & ~0xFFF; + a1 = initrd_start; + a2 = initrd_size; claim(initrd_start, RAM_END - initrd_start, 0); printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n\r", - initrd_start, initrd_data, initrd_size); - memcpy((char *)initrd_start, initrd_data, initrd_size); + initrd_start, (char *)(&__ramdisk_begin), initrd_size); + memcpy((char *)initrd_start, (char *)(&__ramdisk_begin), initrd_size); + } else { + initrd_start = 0; + initrd_size = 0; + a2 = 0xdeadbeef; } - im = image_data; - len = image_len; + im = (char *)(&__image_begin); + len = (char *)(&__image_end) - (char *)(&__image_begin); /* claim 4MB starting at PROG_START */ claim(PROG_START, PROG_SIZE - PROG_START, 0); dst = (void *) PROG_START; diff -urN linux-2.4.18/arch/ppc/boot/chrp/misc.S linuxppc-2.4.18/arch/ppc/boot/chrp/misc.S --- linux-2.4.18/arch/ppc/boot/chrp/misc.S Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/chrp/misc.S Thu Mar 7 10:52:18 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.misc.S 1.6 05/18/01 15:16:59 cort + * BK Id: SCCS/s.misc.S 1.7 06/05/01 20:20:04 paulus */ /* * Copyright (C) Paul Mackerras 1997. diff -urN linux-2.4.18/arch/ppc/boot/chrp/start.c linuxppc-2.4.18/arch/ppc/boot/chrp/start.c --- linux-2.4.18/arch/ppc/boot/chrp/start.c Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/chrp/start.c Thu Mar 7 10:51:42 2002 @@ -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.9 08/29/01 08:49:23 paulus */ /* * Copyright (C) Paul Mackerras 1997. diff -urN linux-2.4.18/arch/ppc/boot/common/Makefile linuxppc-2.4.18/arch/ppc/boot/common/Makefile --- linux-2.4.18/arch/ppc/boot/common/Makefile Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/common/Makefile Thu Mar 7 10:52:13 2002 @@ -8,20 +8,10 @@ # Tom Rini January 2001 # -.c.s: - $(CC) $(CFLAGS) -S -o $*.s $< -.s.o: - $(AS) -o $*.o $< -.c.o: - $(CC) $(CFLAGS) -c -o $*.o $< -.S.s: - $(CPP) $(AFLAGS) -traditional -o $*.o $< -.S.o: - $(CC) $(AFLAGS) -traditional -c -o $*.o $< - -OBJCOPY_ARGS = -O elf32-powerpc +USE_STANDARD_AS_RULE := true coffcrt0.o: - $(CC) $(AFLAGS) -DXCOFF -traditional -c -o coffcrt0.o crt0.S + $(CC) -I$(TOPDIR)/arch/$(ARCH)/kernel $(AFLAGS) -DXCOFF \ + -traditional -c -o coffcrt0.o crt0.S include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ppc/boot/common/crt0.S linuxppc-2.4.18/arch/ppc/boot/common/crt0.S --- linux-2.4.18/arch/ppc/boot/common/crt0.S Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/common/crt0.S Thu Mar 7 10:51:47 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.crt0.S 1.12 08/09/01 17:09:10 paulus + * BK Id: SCCS/s.crt0.S 1.14 01/11/02 10:46:07 trini */ /* Copyright (c) 1997 Paul Mackerras * Initial Power Macintosh COFF version. @@ -22,7 +22,7 @@ */ #include -#include "../../kernel/ppc_asm.tmpl" +#include "ppc_asm.h" .text diff -urN linux-2.4.18/arch/ppc/boot/common/dummy.c linuxppc-2.4.18/arch/ppc/boot/common/dummy.c --- linux-2.4.18/arch/ppc/boot/common/dummy.c Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/common/dummy.c Thu Mar 7 10:51:43 2002 @@ -0,0 +1,7 @@ +/* + * BK Id: %F% %I% %G% %U% %#% + */ +int main(void) +{ + return 0; +} diff -urN linux-2.4.18/arch/ppc/boot/common/misc-simple.c linuxppc-2.4.18/arch/ppc/boot/common/misc-simple.c --- linux-2.4.18/arch/ppc/boot/common/misc-simple.c Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/common/misc-simple.c Thu Mar 7 10:51:52 2002 @@ -3,10 +3,10 @@ * * Misc. bootloader code for many machines. This assumes you have are using * a 6xx/7xx/74xx CPU in your machine. This assumes the chunk of memory - * below 8MB is free. Finally, it assumes you have a NS16550-style uart for + * below 8MB is free. Finally, it assumes you have a NS16550-style uart for * your serial console. If a machine meets these requirements, it can quite * likely use this code during boot. - * + * * Author: Matt Porter * Derived from arch/ppc/boot/prep/misc.c * @@ -25,50 +25,59 @@ #include #include #include +#include #include "nonstdio.h" #include "zlib.h" -unsigned long com_port; - -char *avail_ram; -char *end_avail; -extern char _end[]; - +/* Default cmdline */ #ifdef CONFIG_CMDLINE #define CMDLINE CONFIG_CMDLINE #else #define CMDLINE "" #endif + +/* Keyboard (and VGA console)? */ +#ifdef CONFIG_VGA_CONSOLE +#define HAS_KEYB 1 +#else +#define HAS_KEYB 0 +#endif + +char *avail_ram; +char *end_avail; +char *zimage_start; char cmd_preset[] = CMDLINE; char cmd_buf[256]; char *cmd_line = cmd_buf; +int keyb_present = HAS_KEYB; +int zimage_size; -unsigned long initrd_start = 0, initrd_end = 0; +unsigned long com_port; +unsigned long initrd_size = 0; -/* These values must be variables. If not, the compiler optimizer - * will remove some code, causing the size of the code to vary - * when these values are zero. This is bad because we first - * compile with these zero to determine the size and offsets - * in an image, than compile again with these set to the proper - * discovered value. - */ -unsigned int initrd_offset, initrd_size; -char *zimage_start; -int zimage_size; +/* The linker tells us various locations in the image */ +extern char __image_begin, __image_end; +extern char __ramdisk_begin, __ramdisk_end; +extern char _end[]; +/* Original location */ +extern unsigned long start; +extern int CRT_tstc(void); +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 *); -extern unsigned long serial_init(int chan); +extern void setup_legacy(void); -void +struct bi_record * decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum) { - int timer = 0; - extern unsigned long start; char *cp, ch; + struct bi_record *rec, *birecs; - com_port = serial_init(0); + setup_legacy(); + com_port = serial_init(0, NULL); /* assume the chunk below 8M is free */ end_avail = (char *)0x00800000; @@ -88,42 +97,31 @@ puts("\n"); } - /* we have to subtract 0x10000 here to correct for objdump including - the size of the elf header which we strip -- Cort */ - zimage_start = (char *)(load_addr - 0x10000 + ZIMAGE_OFFSET); - zimage_size = ZIMAGE_SIZE; - initrd_offset = INITRD_OFFSET; - initrd_size = INITRD_SIZE; - - if ( initrd_offset ) - initrd_start = load_addr - 0x10000 + initrd_offset; - else - initrd_start = 0; - initrd_end = initrd_size + initrd_start; + /* + * We link ourself to 0x00800000. When we run, we relocate + * ourselves there. So we just need __image_begin for the + * start. -- Tom + */ + zimage_start = (char *)(unsigned long)(&__image_begin); + zimage_size = (unsigned long)(&__image_end) - + (unsigned long)(&__image_begin); + + initrd_size = (unsigned long)(&__ramdisk_end) - + (unsigned long)(&__ramdisk_begin); - /* Relocate the zImage */ + /* + * The zImage and initrd will be between start and _end, so they've + * already been moved once. We're good to go now. -- Tom + */ avail_ram = (char *)PAGE_ALIGN((unsigned long)_end); puts("zimage at: "); puthex((unsigned long)zimage_start); puts(" "); puthex((unsigned long)(zimage_size+zimage_start)); puts("\n"); - memcpy( (void *)avail_ram, (void *)zimage_start, zimage_size ); - zimage_start = (char *)avail_ram; - puts("relocated to: "); puthex((unsigned long)zimage_start); - puts(" "); - puthex((unsigned long)zimage_size+(unsigned long)zimage_start); - puts("\n"); - if ( initrd_start ) { - puts("initrd at: "); puthex(initrd_start); - puts(" "); puthex(initrd_end); puts("\n"); - /* relocate initrd */ - avail_ram = (char *)PAGE_ALIGN((unsigned long)zimage_size + - (unsigned long)zimage_start); - memcpy( (void *)avail_ram, (void *)initrd_start, initrd_size ); - initrd_start = (unsigned long)avail_ram; - initrd_end = initrd_start + initrd_size; - puts("relocated to: "); puthex(initrd_start); - puts(" "); puthex(initrd_end); puts("\n"); + if ( initrd_size ) { + puts("initrd at: "); + puthex((unsigned long)(&__ramdisk_begin)); + puts(" "); puthex((unsigned long)(&__ramdisk_end));puts("\n"); } avail_ram = (char *)0x00400000; @@ -131,11 +129,28 @@ puts("avail ram: "); puthex((unsigned long)avail_ram); puts(" "); puthex((unsigned long)end_avail); puts("\n"); + if (keyb_present) + CRT_tstc(); /* Forces keyboard to be initialized */ +#ifdef CONFIG_GEMINI + /* + * If cmd_line is empty and cmd_preset is not, copy cmd_preset + * to cmd_line. This way we can override cmd_preset with the + * command line from Smon. + */ + + if ( (cmd_line[0] == '\0') && (cmd_preset[0] != '\0')) + memcpy (cmd_line, cmd_preset, sizeof(cmd_preset)); +#endif + /* Display standard Linux/PPC boot prompt for kernel args */ puts("\nLinux/PPC load: "); cp = cmd_line; 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. */ while (timer++ < 5*1000) { if (tstc()) { while ((ch = getc()) != '\n' && ch != '\r') { @@ -161,16 +176,44 @@ udelay(1000); /* 1 msec */ } *cp = 0; +#endif puts("\n"); - /* mappings on early boot can only handle 16M */ - if ( (u32)(cmd_line) > (16<<20)) - puts("cmd_line located > 16M\n"); - puts("Uncompressing Linux..."); - gunzip(0, 0x400000, zimage_start, &zimage_size); puts("done.\n"); + /* + * Create bi_recs for cmd_line and initrds + */ + rec = (struct bi_record *)_ALIGN((unsigned long)(zimage_size) + + (1 << 20) - 1, (1 << 20)); + birecs = rec; + + rec->tag = BI_FIRST; + rec->size = sizeof(struct bi_record); + 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; + rec = (struct bi_record *)((unsigned long)rec + rec->size); + + if ( initrd_size ) { + rec->tag = BI_INITRD; + rec->data[0] = (unsigned long)(&__ramdisk_begin); + rec->data[1] = initrd_size; + rec->size = sizeof(struct bi_record) + 2 * + sizeof(unsigned long); + rec = (struct bi_record *)((unsigned long)rec + + rec->size); + } + + 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"); + serial_close(com_port); + + return birecs; } diff -urN linux-2.4.18/arch/ppc/boot/common/no_initrd.c linuxppc-2.4.18/arch/ppc/boot/common/no_initrd.c --- linux-2.4.18/arch/ppc/boot/common/no_initrd.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/common/no_initrd.c Thu Jan 1 10:00:00 1970 @@ -1,5 +0,0 @@ -/* - * BK Id: SCCS/s.no_initrd.c 1.7 05/18/01 15:17:23 cort - */ -char initrd_data[1]; -int initrd_len = 0; diff -urN linux-2.4.18/arch/ppc/boot/common/ns16550.c linuxppc-2.4.18/arch/ppc/boot/common/ns16550.c --- linux-2.4.18/arch/ppc/boot/common/ns16550.c Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/common/ns16550.c Thu Mar 7 10:51:43 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ns16550.c 1.12 10/08/01 17:16:50 paulus + * BK Id: SCCS/s.ns16550.c 1.14 01/11/02 10:46:07 trini */ /* * COM1 NS16550 support @@ -10,7 +10,6 @@ #include #include -/* Default serial baud rate */ #define SERIAL_BAUD 9600 extern void outb(int port, unsigned char val); @@ -23,8 +22,10 @@ static int shift; -unsigned long serial_init(int chan) { +unsigned long serial_init(int chan, void *ignored) +{ unsigned long com_port; + unsigned char lcr, dlm; /* We need to find out which type io we're expecting. If it's * 'SERIAL_IO_PORT', we get an offset from the isa_io_base. @@ -43,30 +44,33 @@ /* How far apart the registers are. */ shift = rs_table[chan].iomem_reg_shift; - - /* See if port is present */ - outb(com_port + (UART_LCR << shift), 0x00); - outb(com_port + (UART_IER << shift), 0x00); + + /* save the LCR */ + lcr = inb(com_port + (UART_LCR << shift)); /* Access baud rate */ outb(com_port + (UART_LCR << shift), 0x80); + dlm = inb(com_port + (UART_DLM << shift)); /* * Test if serial port is unconfigured. * We assume that no-one uses less than 110 baud or * less than 7 bits per character these days. * -- paulus. */ - if (inb(com_port + (UART_DLM << shift)) > 4 - || (inb(com_port + (UART_LCR << shift)) & 2) == 0) { + + if ((dlm <= 4) && (lcr & 2)) + /* port is configured, put the old LCR back */ + outb(com_port + (UART_LCR << shift), lcr); + else { /* Input clock. */ outb(com_port + (UART_DLL << shift), (BASE_BAUD / SERIAL_BAUD)); outb(com_port + (UART_DLM << shift), (BASE_BAUD / SERIAL_BAUD) >> 8); + /* 8 data, 1 stop, no parity */ + outb(com_port + (UART_LCR << shift), 0x03); + /* RTS/DTR */ + outb(com_port + (UART_MCR << shift), 0x03); } - /* 8 data, 1 stop, no parity */ - outb(com_port + (UART_LCR << shift), 0x03); - /* RTS/DTR */ - outb(com_port + (UART_MCR << shift), 0x03); /* Clear & enable FIFOs */ outb(com_port + (UART_FCR << shift), 0x07); @@ -93,4 +97,9 @@ serial_tstc(unsigned long com_port) { return ((inb(com_port + (UART_LSR << shift)) & UART_LSR_DR) != 0); +} + +void +serial_close(unsigned long com_port) +{ } diff -urN linux-2.4.18/arch/ppc/boot/common/ofcommon.c linuxppc-2.4.18/arch/ppc/boot/common/ofcommon.c --- linux-2.4.18/arch/ppc/boot/common/ofcommon.c Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/common/ofcommon.c Thu Mar 7 10:52:17 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ofcommon.c 1.1 07/27/01 20:24:18 trini + * BK Id: SCCS/s.ofcommon.c 1.2 01/11/02 10:46:07 trini * * Copyright (C) Paul Mackerras 1997. * @@ -14,6 +14,9 @@ #include #include +/* Information from the linker */ +extern char __sysmap_begin, __sysmap_end; + extern int strcmp(const char *s1, const char *s2); extern char *avail_ram, *avail_high; extern char *end_avail; @@ -126,15 +129,22 @@ inflateEnd(&s); } -/* Make a bi_rec in OF. We need to be passed a name for BI_BOOTLOADER_ID, +/* Make a bi_rec in OF. We need to be passed a name for BI_BOOTLOADER_ID, * a machine type for BI_MACHTYPE, and the location where the end of the * bootloader is (PROG_START + PROG_SIZE) */ void make_bi_recs(unsigned long addr, char *name, unsigned int mach, unsigned long progend) { + unsigned long sysmap_size; struct bi_record *rec; + /* FIgure out the size of a possible System.map we're going to + * pass along. + * */ + sysmap_size = (unsigned long)(&__sysmap_end) - + (unsigned long)(&__sysmap_begin); + /* leave a 1MB gap then align to the next 1MB boundary */ addr = _ALIGN(addr+ (1<<20) - 1, (1<<20)); /* oldworld machine seem very unhappy about this. -- Tom */ @@ -150,21 +160,22 @@ sprintf( (char *)rec->data, name); rec->size = sizeof(struct bi_record) + strlen(name) + 1; rec = (struct bi_record *)((unsigned long)rec + rec->size); - + rec->tag = BI_MACHTYPE; rec->data[0] = mach; rec->data[1] = 1; rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long); rec = (struct bi_record *)((unsigned long)rec + rec->size); -#ifdef SYSMAP_OFFSET - rec->tag = BI_SYSMAP; - rec->data[0] = SYSMAP_OFFSET; - rec->data[1] = SYSMAP_SIZE; - rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long); - rec = (struct bi_record *)((unsigned long)rec + rec->size); -#endif /* SYSMAP_OFFSET */ - + if (sysmap_size) { + rec->tag = BI_SYSMAP; + rec->data[0] = (unsigned long)(&__sysmap_begin); + rec->data[1] = sysmap_size; + rec->size = sizeof(struct bi_record) + 2 * + sizeof(unsigned long); + rec = (struct bi_record *)((unsigned long)rec + rec->size); + } + rec->tag = BI_LAST; rec->size = sizeof(struct bi_record); rec = (struct bi_record *)((unsigned long)rec + rec->size); diff -urN linux-2.4.18/arch/ppc/boot/common/relocate.S linuxppc-2.4.18/arch/ppc/boot/common/relocate.S --- linux-2.4.18/arch/ppc/boot/common/relocate.S Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/common/relocate.S Thu Mar 7 10:52:13 2002 @@ -0,0 +1,210 @@ +/* + * arch/ppc/boot/simple/relocate.S + * + * This is the common part of the loader relocation and initialization + * process. All of the board/processor specific initialization is + * done before we get here. + * + * Author: Tom Rini + * trini@mvista.com + * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others). + * + * Copyright 2001 MontaVista Software Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include "ppc_asm.h" + +#define GETSYM(reg, sym) \ + lis reg, sym@h; ori reg, reg, sym@l + + .text + /* We get called from the early initialization code. + * Register 3 has the address where we were loaded, + * Register 4 contains any residual data passed from the + * boot rom. + */ + .globl relocate +relocate: + /* Save r3, r4 for later. + * The r8/r11 are legacy registers so I don't have to + * rewrite the code below :-). + */ + mr r8, r3 + mr r11, r4 + + /* compute the size of the whole image in words. */ + GETSYM(r4,start) + GETSYM(r5,end) + + addi r5,r5,3 /* round up */ + sub r5,r5,r4 /* end - start */ + srwi r5,r5,2 + mr r7,r5 /* Save for later use. */ + + /* + * Check if we need to relocate ourselves to the link addr or were + * we loaded there to begin with. + */ + cmp cr0,r3,r4 + beq start_ldr /* If 0, we don't need to relocate */ + + /* Move this code somewhere safe. This is max(load + size, end) + * BIG ASSUMPTION: Addresses below 0x80000000 are assumed to be + * in RAM, and addresses above 0x80000000 are assumed to be in + * Flash. The cmpw instruction below does a signed integer + * comparison, so when comparing a RAM address to a Flash address + * the RAM address will always be greater. This allows the + * relocation to work when the load address is in Flash. + * r8 == load address + */ + GETSYM(r4, start) + GETSYM(r5, end) + + sub r6,r5,r4 + add r6,r8,r6 /* r6 == phys(load + size) */ + + cmpw r5,r6 + bgt 1f + b 2f +1: + mr r6, r5 +2: + /* dest is in r6 */ + /* Ensure alignment --- this code is precautionary */ + addi r6,r6,4 + li r5,0x0003 + andc r6,r6,r5 + + /* Find physical address and size of do_relocate */ + GETSYM(r5, __relocate_start) + GETSYM(r4, __relocate_end) + GETSYM(r3, start) + + /* Size to copy */ + sub r4,r4,r5 + srwi r4,r4,2 + + /* Src addr to copy (= __relocate_start - start + where_loaded) */ + sub r3,r5,r3 + add r5,r8,r3 + + /* Save dest */ + mr r3, r6 + + /* Do the copy */ + mtctr r4 +3: lwz r4,0(r5) + stw r4,0(r3) + addi r3,r3,4 + addi r5,r5,4 + bdnz 3b + + GETSYM(r4, __relocate_start) + GETSYM(r5, do_relocate) + + sub r4,r5,r4 /* Get entry point for do_relocate in + add r6,r6,r4 * relocated section */ + + /* This will return to the relocated do_relocate */ + mtlr r6 + b flush_instruction_cache + + .section ".relocate_code","xa" + +do_relocate: + /* We have 2 cases --- start < load, or start > load + * This determines whether we copy from the end, or the start. + * Its easier to have 2 loops than to have paramaterised + * loops. Sigh. + */ + li r6,0 /* Clear checksum */ + mtctr r7 /* Setup for a loop */ + + GETSYM(r4, start) + mr r3,r8 /* Get the load addr */ + + cmp cr0,r4,r3 /* If we need to copy from the end, do so */ + bgt do_relocate_from_end + +do_relocate_from_start: +1: lwz r5,0(r3) /* Load and decrement */ + stw r5,0(r4) /* Store and decrement */ + addi r3,r3,4 + addi r4,r4,4 + xor r6,r6,r5 /* Update checksum */ + bdnz 1b /* Are we done? */ + b do_relocate_out /* Finished */ + +do_relocate_from_end: + GETSYM(r3, end) + slwi r4,r7,2 + add r4,r8,r4 /* Get the physical end */ +1: lwzu r5,-4(r4) + stwu r5, -4(r3) + xor r6,r6,r5 + bdnz 1b + +do_relocate_out: + GETSYM(r3,start_ldr) + mtlr r3 /* Easiest way to do an absolute jump */ +/* Some boards don't boot up with the I-cache enabled. Do that + * now because the decompress runs much faster that way. + * As a side effect, we have to ensure the data cache is not enabled + * so we can access the serial I/O without trouble. + */ + b flush_instruction_cache + + .previous + +start_ldr: +/* Clear all of BSS and set up stack for C calls */ + lis r3,edata@h + ori r3,r3,edata@l + lis r4,end@h + ori r4,r4,end@l + subi r3,r3,4 + subi r4,r4,4 + li r0,0 +50: stwu r0,4(r3) + cmp cr0,r3,r4 + bne 50b +90: mr r9,r1 /* Save old stack pointer (in case it matters) */ + lis r1,.stack@h + ori r1,r1,.stack@l + addi r1,r1,4096*2 + subi r1,r1,256 + li r2,0x000F /* Mask pointer to 16-byte boundary */ + andc r1,r1,r2 + + /* + * Exec kernel loader + */ + mr r3,r8 /* Load point */ + mr r4,r7 /* Program length */ + mr r5,r6 /* Checksum */ + mr r6,r11 /* Residual data */ + bl decompress_kernel + + /* + * Make sure the kernel knows we don't have things set in + * registers. -- Tom + */ + li r4,0 + li r6,0 + + /* + * Start at the begining. + */ + li r9,0x0000 + mtlr r9 + blr + + .comm .stack,4096*2,4 diff -urN linux-2.4.18/arch/ppc/boot/common/string.S linuxppc-2.4.18/arch/ppc/boot/common/string.S --- linux-2.4.18/arch/ppc/boot/common/string.S Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/common/string.S Thu Mar 7 10:52:17 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.string.S 1.8 05/18/01 06:20:29 patch + * BK Id: SCCS/s.string.S 1.9 06/05/01 20:01:06 paulus */ /* * String handling functions for PowerPC. diff -urN linux-2.4.18/arch/ppc/boot/common/util.S linuxppc-2.4.18/arch/ppc/boot/common/util.S --- linux-2.4.18/arch/ppc/boot/common/util.S Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/common/util.S Thu Mar 7 10:51:43 2002 @@ -0,0 +1,230 @@ +/* + * arch/ppc/boot/common/util.S + * + * Useful bootup functions, which are more easily done in asm than C. + * + * NOTE: Be very very careful about the registers you use here. + * We don't follow any ABI calling convention among the + * assembler functions that call each other, especially early + * in the initialization. Please preserve at least r3 and r4 + * for these early functions, as they often contain information + * passed from boot roms into the C decompress function. + * + * Author: Tom Rini + * trini@mvista.com + * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others). + * + * Copyright 2001 MontaVista Software Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include "ppc_asm.h" + + + .text + + .globl disable_6xx_mmu +disable_6xx_mmu: + /* Establish default MSR value, exception prefix 0xFFF. + * If necessary, this function must fix up the LR if we + * return to a different address space once the MMU is + * disabled. + */ + li r8,MSR_IP|MSR_FP + mtmsr r8 + + /* Clear BATs */ + li r8,0 + mtspr DBAT0U,r8 + mtspr DBAT0L,r8 + mtspr DBAT1U,r8 + mtspr DBAT1L,r8 + mtspr DBAT2U,r8 + mtspr DBAT2L,r8 + mtspr DBAT3U,r8 + mtspr DBAT3L,r8 + mtspr IBAT0U,r8 + mtspr IBAT0L,r8 + mtspr IBAT1U,r8 + mtspr IBAT1L,r8 + mtspr IBAT2U,r8 + mtspr IBAT2L,r8 + mtspr IBAT3U,r8 + mtspr IBAT3L,r8 + isync + sync + sync + + /* Set segment registers */ + li r8,16 /* load up segment register values */ + mtctr r8 /* for context 0 */ + lis r8,0x2000 /* Ku = 1, VSID = 0 */ + li r10,0 +3: mtsrin r8,r10 + addi r8,r8,0x111 /* increment VSID */ + addis r10,r10,0x1000 /* address of next segment */ + bdnz 3b + + .globl disable_6xx_l1cache +disable_6xx_l1cache: + /* Enable, invalidate and then disable the L1 icache/dcache. */ + li r8,0 + ori r8,r8,(HID0_ICE|HID0_DCE|HID0_ICFI|HID0_DCI) + mfspr r11,HID0 + or r11,r11,r8 + andc r10,r11,r8 + isync + mtspr HID0,r8 + sync + isync + mtspr HID0,r10 + sync + isync + blr + + .globl _setup_L2CR +_setup_L2CR: +/* + * We should be skipping this section on CPUs where this results in an + * illegal instruction. If not, please send trini@kernel.crashing.org + * the PVR of your CPU. + */ + /* Invalidate/disable L2 cache */ + sync + isync + mfspr r8,L2CR + rlwinm r8,r8,0,1,31 + oris r8,r8,0x0020 + sync + isync + mtspr L2CR,r8 + sync + isync + + /* Wait for the invalidation to complete */ +1: mfspr r8,L2CR + rlwinm. r9,r8,0,31,31 + bne 1b + + rlwinm r8,r8,0,11,9 /* Turn off L2I bit */ + sync + isync + mtspr L2CR,r8 + sync + isync + blr + + +/* + * Delay for a number of microseconds + * -- Use the BUS timer (assumes 66MHz) + */ + .globl udelay +udelay: + mfspr r4,PVR + srwi r4,r4,16 + cmpi 0,r4,1 /* 601 ? */ + bne .udelay_not_601 +00: li r0,86 /* Instructions / microsecond? */ + mtctr r0 +10: addi r0,r0,0 /* NOP */ + bdnz 10b + subic. r3,r3,1 + bne 00b + blr + +.udelay_not_601: + mulli r4,r3,1000 /* nanoseconds */ + addi r4,r4,59 + li r5,60 + divw r4,r4,r5 /* BUS ticks */ +1: mftbu r5 + mftb r6 + mftbu r7 + cmp 0,r5,r7 + bne 1b /* Get [synced] base time */ + addc r9,r6,r4 /* Compute end time */ + addze r8,r5 +2: mftbu r5 + cmp 0,r5,r8 + blt 2b + bgt 3f + mftb r6 + cmp 0,r6,r9 + blt 2b +3: blr + +.globl _put_MSR +_put_MSR: + mtmsr r3 + blr + + .section ".relocate_code","xa" +/* + * Flush and enable instruction cache + * First, flush the data cache in case it was enabled and may be + * holding instructions for copy back. + */ +_GLOBAL(flush_instruction_cache) + mflr r6 + bl flush_data_cache + +#ifdef CONFIG_8xx + lis r3, IDC_INVALL@h + mtspr IC_CST, r3 + lis r3, IDC_ENABLE@h + mtspr IC_CST, r3 + lis r3, IDC_DISABLE@h + mtspr DC_CST, r3 +#elif CONFIG_4xx + lis r3,start@h # r9 = &_start + lis r4,_etext@ha + addi r4,r4,_etext@l # r8 = &_etext +1: dcbf r0,r3 # Flush the data cache + icbi r0,r3 # Invalidate the instruction cache + addi r3,r3,0x10 # Increment by one cache line + cmplwi cr0,r3,r4 # Are we at the end yet? + blt 1b # No, keep flushing and invalidating +#else + /* Enable, invalidate and then disable the L1 icache/dcache. */ + li r3,0 + ori r3,r3,(HID0_ICE|HID0_DCE|HID0_ICFI|HID0_DCI) + mfspr r4,HID0 + or r5,r4,r3 + isync + mtspr HID0,r5 + sync + isync + ori r5,r4,HID0_ICE /* Enable cache */ + mtspr HID0,r5 + sync + isync +#endif + mtlr r6 + blr + +#define NUM_CACHE_LINES 128*8 +#define cache_flush_buffer 0x1000 + +/* + * Flush data cache + * Do this by just reading lots of stuff into the cache. + */ +_GLOBAL(flush_data_cache) + lis r3,cache_flush_buffer@h + ori r3,r3,cache_flush_buffer@l + li r4,NUM_CACHE_LINES + mtctr r4 +00: lwz r4,0(r3) + addi r3,r3,L1_CACHE_BYTES /* Next line, please */ + bdnz 00b +10: blr + + .previous + diff -urN linux-2.4.18/arch/ppc/boot/images/Makefile linuxppc-2.4.18/arch/ppc/boot/images/Makefile --- linux-2.4.18/arch/ppc/boot/images/Makefile Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/images/Makefile Thu Mar 7 10:52:22 2002 @@ -5,7 +5,7 @@ include $(TOPDIR)/Rules.make vmlinux.gz: $(TOPDIR)/vmlinux - $(OBJCOPY) -S -O binary $(TOPDIR)/vmlinux vmlinux + $(OBJCOPY) --strip-all -S -O binary $(TOPDIR)/vmlinux vmlinux gzip -vf9 vmlinux clean: diff -urN linux-2.4.18/arch/ppc/boot/include/nonstdio.h linuxppc-2.4.18/arch/ppc/boot/include/nonstdio.h --- linux-2.4.18/arch/ppc/boot/include/nonstdio.h Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/include/nonstdio.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.nonstdio.h 1.9 07/25/01 18:13:07 trini + * BK Id: SCCS/s.nonstdio.h 1.10 08/29/01 08:49:23 paulus */ /* * Copyright (C) Paul Mackerras 1997. diff -urN linux-2.4.18/arch/ppc/boot/include/rs6000.h linuxppc-2.4.18/arch/ppc/boot/include/rs6000.h --- linux-2.4.18/arch/ppc/boot/include/rs6000.h Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/include/rs6000.h Thu Mar 7 10:52:08 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.rs6000.h 1.7 05/18/01 15:17:23 cort + * BK Id: SCCS/s.rs6000.h 1.8 06/05/01 20:20:05 paulus */ /* IBM RS/6000 "XCOFF" file definitions for BFD. Copyright (C) 1990, 1991 Free Software Foundation, Inc. diff -urN linux-2.4.18/arch/ppc/boot/include/zlib.h linuxppc-2.4.18/arch/ppc/boot/include/zlib.h --- linux-2.4.18/arch/ppc/boot/include/zlib.h Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/include/zlib.h Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.zlib.h 1.8 05/18/01 15:17:23 cort + * BK Id: SCCS/s.zlib.h 1.9 06/05/01 20:20:05 paulus */ /* * This file is derived from zlib.h and zconf.h from the zlib-0.95 diff -urN linux-2.4.18/arch/ppc/boot/ld.script linuxppc-2.4.18/arch/ppc/boot/ld.script --- linux-2.4.18/arch/ppc/boot/ld.script Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/ld.script Thu Mar 7 10:52:14 2002 @@ -0,0 +1,82 @@ +OUTPUT_ARCH(powerpc) +SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib); +/* Do we need any of these for elf? + __DYNAMIC = 0; */ +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = + SIZEOF_HEADERS; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .rel.text : { *(.rel.text) } + .rela.text : { *(.rela.text) } + .rel.data : { *(.rel.data) } + .rela.data : { *(.rela.data) } + .rel.rodata : { *(.rel.rodata) } + .rela.rodata : { *(.rela.rodata) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .plt : { *(.plt) } + .text : + { + *(.text) + *(.fixup) + __relocate_start = .; + *(.relocate_code) + __relocate_end = .; + } + _etext = .; + PROVIDE (etext = .); + + /* Read-write section, merged into data segment: */ + . = (. + 0x0FFF) & 0xFFFFF000; + .data : + { + *(.data) + *(.data1) + *(.sdata) + *(.sdata2) + *(.got.plt) *(.got) + *(.dynamic) + *(.rodata) + *(.rodata.*) + *(.rodata1) + *(.got1) + __image_begin = .; + *(.image) + __image_end = .; + . = ALIGN(4096); + __ramdisk_begin = .; + *(.ramdisk) + __ramdisk_end = .; + . = ALIGN(4096); + __sysmap_begin = .; + *(.sysmap) + __sysmap_end = .; + . = ALIGN(4096); + CONSTRUCTORS + } + _edata = .; + PROVIDE (edata = .); + + __bss_start = .; + .bss : + { + *(.sbss) *(.scommon) + *(.dynbss) + *(.bss) + *(COMMON) + } + _end = . ; + PROVIDE (end = .); +} diff -urN linux-2.4.18/arch/ppc/boot/lib/zlib.c linuxppc-2.4.18/arch/ppc/boot/lib/zlib.c --- linux-2.4.18/arch/ppc/boot/lib/zlib.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/lib/zlib.c Thu Mar 7 10:51:39 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.zlib.c 1.8 05/18/01 15:17:24 cort + * BK Id: SCCS/s.zlib.c 1.10 01/11/02 10:46:07 trini */ /* * This file is derived from various .h and .c files from the zlib-0.95 @@ -651,11 +651,6 @@ /* load local pointers */ #define LOAD {LOADIN LOADOUT} -/* - * The IBM 150 firmware munges the data right after _etext[]. This - * protects it. -- Cort - */ -local uInt protect_mask[] = {0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0 ,0}; /* And'ing with mask[n] masks the lower n bits */ local uInt inflate_mask[] = { 0x0000, diff -urN linux-2.4.18/arch/ppc/boot/mbx/Makefile linuxppc-2.4.18/arch/ppc/boot/mbx/Makefile --- linux-2.4.18/arch/ppc/boot/mbx/Makefile Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/Makefile Thu Jan 1 10:00:00 1970 @@ -1,149 +0,0 @@ -# BK Id: SCCS/s.Makefile 1.9 10/15/01 10:53:29 trini -# -# -# arch/ppc/mbxboot/Makefile -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1994 by Linus Torvalds -# Adapted for PowerPC by Gary Thomas -# modified by Cort (cort@cs.nmt.edu) -# -.c.s: - $(CC) $(CFLAGS) -S -o $*.s $< -.s.o: - $(AS) -o $*.o $< -.c.o: - $(CC) $(CFLAGS) -c -o $*.o $< -.S.s: - $(CPP) $(AFLAGS) -traditional -o $*.o $< -.S.o: - $(CC) $(AFLAGS) -traditional -c -o $*.o $< - -TFTPIMAGE := /tftpboot/zImage.embedded - -OFFSET := ../utils/offset -SIZE := ../utils/size - -LIBS := ../lib/zlib.a -OBJCOPY_ARGS := -O elf32-powerpc - -ifdef CONFIG_8xx -ZLINKFLAGS := -T $(TOPDIR)/arch/$(ARCH)/vmlinux.lds -Ttext 0x00180000 -OBJECTS := head.o m8xx_tty.o -CFLAGS += -DCONFIG_8xx -endif - -ifdef CONFIG_8260 -ZLINKFLAGS := -T $(TOPDIR)/arch/$(ARCH)/vmlinux.lds -Ttext 0x00400000 -OBJECTS := head_8260.o m8260_tty.o embed_config.o -CFLAGS += -DCONFIG_8260 -endif - -OBJECTS += ../common/misc-common.o misc.o ../common/string.o -OBJCOPY_ARGS = -O elf32-powerpc - -ifeq ($(CONFIG_MBX),y) -OBJECTS += iic.o embed_config.o pci.o qspan_pci.o -CFLAGS += -DCONFIG_MBX -endif -ifeq ($(CONFIG_RPXLITE),y) -CFLAGS += -DCONFIG_RPXLITE -OBJECTS += iic.o embed_config.o -endif -ifeq ($(CONFIG_RPXCLASSIC),y) -CFLAGS += -DCONFIG_RPXCLASSIC -OBJECTS += iic.o embed_config.o pci.o qspan_pci.o -endif -ifeq ($(CONFIG_BSEIP),y) -CFLAGS += -DCONFIG_BSEIP -OBJECTS += iic.o embed_config.o -endif -ifeq ($(CONFIG_FADS),y) -CFLAGS += -DCONFIG_FADS -OBJECTS += embed_config.o -endif - -all: zImage - -misc.o: misc.c - $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 -DZIMAGE_OFFSET=0 \ - -DZIMAGE_SIZE=0 -c -o $@ $*.c - -zvmlinux.initrd: $(OBJECTS) $(LIBS) ../images/vmlinux.gz -# -# Recompile misc.o again with more 'correct' bogus offsets -# - $(CC) $(CFLAGS) -DINITRD_OFFSET=0x0008c8e3 -DINITRD_SIZE=0x0000111a \ - -DZIMAGE_OFFSET=0x00018000 -DZIMAGE_SIZE=0x000748e2 \ - -c -o misc.o misc.c - $(LD) $(ZLINKFLAGS) -o $@.tmp $(OBJECTS) $(LIBS) - $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ - --add-section=initrd=../images/ramdisk.image.gz \ - --add-section=image=../images/vmlinux.gz \ - $@.tmp $@ - $(CC) $(CFLAGS) -DINITRD_OFFSET=`sh $(OFFSET) $(OBJDUMP) $@ initrd` \ - -DINITRD_SIZE=`sh $(SIZE) $(OBJDUMP) $@ initrd` \ - -DZIMAGE_OFFSET=`sh $(OFFSET) $(OBJDUMP) $@ image` \ - -DZIMAGE_SIZE=`sh $(SIZE) $(OBJDUMP) $@ image` \ - -c -o misc.o misc.c - $(LD) $(ZLINKFLAGS) -o $@.tmp $(OBJECTS) $(LIBS) - $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ - --add-section=initrd=../images/ramdisk.image.gz \ - --add-section=image=../images/vmlinux.gz \ - $@.tmp ../images/$@.embedded -# Remove zvmlinux and zvmlinux.temp, we have ../images/zvmlinux.embedded - rm -f $@.tmp $@ - -zImage: zvmlinux -ifeq ($(CONFIG_RPXCLASSIC),y) - dd if=../images/zvmlinux.embedded of=../images/zImage.embedded bs=65536 skip=1 -else - ln -sf ../images/zvmlinux.embedded ../images/zImage.embedded -endif - -zImage.initrd: zvmlinux.initrd -ifeq ($(CONFIG_RPXCLASSIC),y) - dd if=../images/zvmlinux.initrd.embedded of=../images/zImage.initrd.embedded bs=65536 skip=1 -else - ln -sf ../images/zvmlinux.initrd.embedded ../images/zImage.initrd.embedded -endif - -zvmlinux: $(OBJECTS) $(LIBS) ../images/vmlinux.gz -# -# Recompile misc.o again with more 'correct' bogus offsets -# - $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 \ - -DZIMAGE_OFFSET=0x00018000 -DZIMAGE_SIZE=0x000748e2 \ - -c -o misc.o misc.c -# -# build the boot loader image and then compute the offset into it -# for the kernel image -# - $(LD) $(ZLINKFLAGS) -o $@.tmp $(OBJECTS) $(LIBS) - $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ - --add-section=image=../images/vmlinux.gz \ - $@.tmp $@ -# -# then with the offset rebuild the bootloader so we know where the kernel is -# - $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 \ - -DZIMAGE_OFFSET=`sh $(OFFSET) $(OBJDUMP) $@ image` \ - -DZIMAGE_SIZE=`sh $(SIZE) $(OBJDUMP) $@ image` \ - -c -o misc.o misc.c - $(LD) $(ZLINKFLAGS) -o $@.tmp $(OBJECTS) $(LIBS) - $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ - --add-section=image=../images/vmlinux.gz \ - $@.tmp ../images/$@.embedded -# Remove zvmlinux and zvmlinux.temp, we have ../images/zvmlinux.embedded - rm -f $@.tmp $@ - -znetboot : zImage - cp ../images/zImage.embedded $(TFTPIMAGE) - -znetboot.initrd : zImage.initrd - cp ../images/zImage.initrd.embedded $(TFTPIMAGE) - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ppc/boot/mbx/embed_config.c linuxppc-2.4.18/arch/ppc/boot/mbx/embed_config.c --- linux-2.4.18/arch/ppc/boot/mbx/embed_config.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/embed_config.c Thu Jan 1 10:00:00 1970 @@ -1,593 +0,0 @@ -/* - * BK Id: SCCS/s.embed_config.c 1.7 05/18/01 07:54:04 patch - */ - -/* Board specific functions for those embedded 8xx boards that do - * not have boot monitor support for board information. - */ -#include -#include -#ifdef CONFIG_8xx -#include -#endif -#ifdef CONFIG_8260 -#include -#include -#endif - - -/* IIC functions. - * These are just the basic master read/write operations so we can - * examine serial EEPROM. - */ -extern void iic_read(uint devaddr, u_char *buf, uint offset, uint count); -static u_char aschex_to_byte(u_char *cp); - -/* Supply a default Ethernet address for those eval boards that don't - * ship with one. This is an address from the MBX board I have, so - * it is unlikely you will find it on your network. - */ -static ushort def_enet_addr[] = { 0x0800, 0x3e26, 0x1559 }; - -#if defined(CONFIG_MBX) - -/* The MBX hands us a pretty much ready to go board descriptor. This - * is where the idea started in the first place. - */ -void -embed_config(bd_t *bd) -{ - u_char *mp; - u_char eebuf[128]; - int i; - - /* Read the first 128 bytes of the EEPROM. There is more, - * but this is all we need. - */ - iic_read(0xa4, eebuf, 0, 128); - - /* All we are looking for is the Ethernet MAC address. The - * first 8 bytes are 'MOTOROLA', so check for part of that. - * If it's there, assume we have a valid MAC address. If not, - * grab our default one. - */ - if ((*(uint *)eebuf) == 0x4d4f544f) - mp = &eebuf[0x4c]; - else - mp = (u_char *)def_enet_addr; - - for (i=0; i<6; i++) { - bd->bi_enetaddr[i] = *mp++; - } - - /* The boot rom passes these to us in MHz. Linux now expects - * them to be in Hz. - */ - bd->bi_intfreq *= 1000000; - bd->bi_busfreq *= 1000000; - - /* Stuff a baud rate here as well. - */ - bd->bi_baudrate = 9600; -} -#endif /* CONFIG_MBX */ - -#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) || defined(CONFIG_RPX6) - -/* Helper functions for Embedded Planet boards. -*/ -static void -rpx_eth(bd_t *bd, u_char *cp) -{ - int i; - - for (i=0; i<6; i++) { - bd->bi_enetaddr[i] = aschex_to_byte(cp); - cp += 2; - } -} - -static uint -rpx_baseten(u_char *cp) -{ - uint retval; - - retval = 0; - - while (*cp != '\n') { - retval *= 10; - retval += (*cp) - '0'; - cp++; - } - return(retval); -} - -static void -rpx_brate(bd_t *bd, u_char *cp) -{ - uint rate; - - rate = 0; - - while (*cp != '\n') { - rate *= 10; - rate += (*cp) - '0'; - cp++; - } - - bd->bi_baudrate = rate * 100; -} - -static void -rpx_memsize(bd_t *bd, u_char *cp) -{ - uint size; - - size = 0; - - while (*cp != '\n') { - size *= 10; - size += (*cp) - '0'; - cp++; - } - - bd->bi_memsize = size * 1024 * 1024; -} - -static void -rpx_cpuspeed(bd_t *bd, u_char *cp) -{ - uint num, den; - - num = den = 0; - - while (*cp != '\n') { - num *= 10; - num += (*cp) - '0'; - cp++; - if (*cp == '/') { - cp++; - den = (*cp) - '0'; - break; - } - } - - /* I don't know why the RPX just can't state the actual - * CPU speed..... - */ - if (den) { - num /= den; - num *= den; - } - bd->bi_intfreq = bd->bi_busfreq = num * 1000000; - - /* The 8xx can only run a maximum 50 MHz bus speed (until - * Motorola changes this :-). Greater than 50 MHz parts - * run internal/2 for bus speed. - */ - if (num > 50) - bd->bi_busfreq /= 2; -} - -/* Because I didn't find anything that would do this....... -*/ -u_char -aschex_to_byte(u_char *cp) -{ - u_char byte, c; - - c = *cp++; - - if ((c >= 'A') && (c <= 'F')) { - c -= 'A'; - c += 10; - } - else if ((c >= 'a') && (c <= 'f')) { - c -= 'a'; - c += 10; - } - else { - c -= '0'; - } - - byte = c * 16; - - c = *cp; - - if ((c >= 'A') && (c <= 'F')) { - c -= 'A'; - c += 10; - } - else if ((c >= 'a') && (c <= 'f')) { - c -= 'a'; - c += 10; - } - else { - c -= '0'; - } - - byte += c; - - return(byte); -} -#endif - -#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) - -/* Read the EEPROM on the RPX-Lite board. -*/ -void -embed_config(bd_t *bd) -{ - u_char eebuf[256], *cp; - - /* Read the first 256 bytes of the EEPROM. I think this - * is really all there is, and I hope if it gets bigger the - * info we want is still up front. - */ -#if 1 - iic_read(0xa8, eebuf, 0, 128); - iic_read(0xa8, &eebuf[128], 128, 128); - - /* We look for two things, the Ethernet address and the - * serial baud rate. The records are separated by - * newlines. - */ - cp = eebuf; - for (;;) { - if (*cp == 'E') { - cp++; - if (*cp == 'A') { - cp += 2; - rpx_eth(bd, cp); - } - } - if (*cp == 'S') { - cp++; - if (*cp == 'B') { - cp += 2; - rpx_brate(bd, cp); - } - } - if (*cp == 'D') { - cp++; - if (*cp == '1') { - cp += 2; - rpx_memsize(bd, cp); - } - } - if (*cp == 'H') { - cp++; - if (*cp == 'Z') { - cp += 2; - rpx_cpuspeed(bd, cp); - } - } - - /* Scan to the end of the record. - */ - while ((*cp != '\n') && (*cp != 0xff)) - cp++; - - /* If the next character is a 0 or ff, we are done. - */ - cp++; - if ((*cp == 0) || (*cp == 0xff)) - break; - } - bd->bi_memstart = 0; -#else - /* For boards without initialized EEPROM. - */ - bd->bi_memstart = 0; - bd->bi_memsize = (8 * 1024 * 1024); - bd->bi_intfreq = 48000000; - bd->bi_busfreq = 48000000; - bd->bi_baudrate = 9600; -#endif -} -#endif /* RPXLITE || RPXCLASSIC */ - -#ifdef CONFIG_BSEIP -/* Build a board information structure for the BSE ip-Engine. - * There is more to come since we will add some environment - * variables and a function to read them. - */ -void -embed_config(bd_t *bd) -{ - u_char *cp; - int i; - - /* Baud rate and processor speed will eventually come - * from the environment variables. - */ - bd->bi_baudrate = 9600; - - /* Get the Ethernet station address from the Flash ROM. - */ - cp = (u_char *)0xfe003ffa; - for (i=0; i<6; i++) { - bd->bi_enetaddr[i] = *cp++; - } - - /* The rest of this should come from the environment as well. - */ - bd->bi_memstart = 0; - bd->bi_memsize = (16 * 1024 * 1024); - bd->bi_intfreq = 48000000; - bd->bi_busfreq = 48000000; -} -#endif /* BSEIP */ - -#ifdef CONFIG_FADS -/* Build a board information structure for the FADS. - */ -void -embed_config(bd_t *bd) -{ - u_char *cp; - int i; - - /* Just fill in some known values. - */ - bd->bi_baudrate = 9600; - - /* Use default enet. - */ - cp = (u_char *)def_enet_addr; - for (i=0; i<6; i++) { - bd->bi_enetaddr[i] = *cp++; - } - - bd->bi_memstart = 0; - bd->bi_memsize = (8 * 1024 * 1024); - bd->bi_intfreq = 40000000; - bd->bi_busfreq = 40000000; -} -#endif /* FADS */ - -#ifdef CONFIG_8260 -/* Compute 8260 clock values if the rom doesn't provide them. - * We can't compute the internal core frequency (I don't know how to - * do that). - */ -static void -clk_8260(bd_t *bd) -{ - uint scmr, vco_out, clkin; - uint plldf, pllmf, busdf, brgdf, cpmdf; - volatile immap_t *ip; - - ip = (immap_t *)IMAP_ADDR; - scmr = ip->im_clkrst.car_scmr; - - /* The clkin is always bus frequency. - */ - clkin = bd->bi_busfreq; - - /* Collect the bits from the scmr. - */ - plldf = (scmr >> 12) & 1; - pllmf = scmr & 0xfff; - cpmdf = (scmr >> 16) & 0x0f; - busdf = (scmr >> 20) & 0x0f; - - /* This is arithmetic from the 8260 manual. - */ - vco_out = clkin / (plldf + 1); - vco_out *= 2 * (pllmf + 1); - bd->bi_vco = vco_out; /* Save for later */ - - bd->bi_cpmfreq = vco_out / 2; /* CPM Freq, in MHz */ - - /* Set Baud rate divisor. The power up default is divide by 16, - * but we set it again here in case it was changed. - */ - ip->im_clkrst.car_sccr = 1; /* DIV 16 BRG */ - bd->bi_brgfreq = vco_out / 16; -} -#endif - -#ifdef CONFIG_EST8260 -void -embed_config(bd_t **bdp) -{ - u_char *cp; - int i; - bd_t *bd; - - bd = *bdp; -#if 0 - /* This is actually provided by my boot rom. I have it - * here for those people that may load the kernel with - * a JTAG/COP tool and not the rom monitor. - */ - bd->bi_baudrate = 115200; - bd->bi_intfreq = 200000000; - bd->bi_busfreq = 66666666; - bd->bi_cpmfreq = 66666666; - bd->bi_brgfreq = 33333333; - bd->bi_memsize = 16 * 1024 * 1024; -#else - /* The boot rom passes these to us in MHz. Linux now expects - * them to be in Hz. - */ - bd->bi_intfreq *= 1000000; - bd->bi_busfreq *= 1000000; - bd->bi_cpmfreq *= 1000000; - bd->bi_brgfreq *= 1000000; -#endif - - cp = (u_char *)def_enet_addr; - for (i=0; i<6; i++) { - bd->bi_enetaddr[i] = *cp++; - } -} -#endif /* EST8260 */ - -#ifdef CONFIG_SBS8260 -/* We have to fill in everything. -*/ -static bd_t bdinfo; - -void -embed_config(bd_t **bdp) -{ - u_char *cp; - int i; - bd_t *bd; - - /* This should provided by the boot rom. - */ - bd = &bdinfo; - *bdp = bd; - bd->bi_baudrate = 9600; - bd->bi_memsize = 64 * 1024 * 1024; - - /* Set all of the clocks. We have to know the speed of the - * external clock. The development board had 66 MHz. - */ - bd->bi_busfreq = 66666666; - clk_8260(bd); - - /* I don't know how to compute this yet. - */ - bd->bi_intfreq = 133000000; - - - cp = (u_char *)def_enet_addr; - for (i=0; i<6; i++) { - bd->bi_enetaddr[i] = *cp++; - } -} -#endif /* SBS8260 */ - -#ifdef CONFIG_RPX6 -/* The pointer we are given is for the string of key values. - */ -static bd_t bdinfo; - -void -embed_config(bd_t **bdp) -{ - u_char *cp, *keyvals; - int i; - bd_t *bd; - - keyvals = (u_char *)*bdp; - - bd = &bdinfo; - *bdp = bd; - - /* This is almost identical to the RPX-Lite/Classic functions - * on the 8xx boards. It would be nice to have a key lookup - * function in a string, but the format of all of the fields - * is slightly different. - */ - cp = keyvals; - for (;;) { - if (*cp == 'E') { - cp++; - if (*cp == 'A') { - cp += 2; - rpx_eth(bd, cp); - } - } - if (*cp == 'S') { - cp++; - if (*cp == 'B') { - cp += 2; - bd->bi_baudrate = rpx_baseten(cp); - } - } - if (*cp == 'D') { - cp++; - if (*cp == '1') { - cp += 2; - bd->bi_memsize = rpx_baseten(cp) * 1024 * 1024; - } - } - if (*cp == 'X') { - cp++; - if (*cp == 'T') { - cp += 2; - bd->bi_busfreq = rpx_baseten(cp); - } - } - if (*cp == 'N') { - cp++; - if (*cp == 'V') { - cp += 2; - bd->bi_nvsize = rpx_baseten(cp) * 1024 * 1024; - } - } - - /* Scan to the end of the record. - */ - while ((*cp != '\n') && (*cp != 0xff)) - cp++; - - /* If the next character is a 0 or ff, we are done. - */ - cp++; - if ((*cp == 0) || (*cp == 0xff)) - break; - } - bd->bi_memstart = 0; - - /* The memory size includes both the 60x and local bus DRAM. - * I don't want to use the local bus DRAM for real memory, - * so subtract it out. It would be nice if they were separate - * keys. - */ - bd->bi_memsize -= 32 * 1024 * 1024; - - /* Set all of the clocks. We have to know the speed of the - * external clock. - */ - clk_8260(bd); - - /* I don't know how to compute this yet. - */ - bd->bi_intfreq = 200000000; -} -#endif /* RPX6 for testing */ - -#ifdef CONFIG_ADS8260 -/* We have to fill in everything. -*/ -static bd_t bdinfo; - -void -embed_config(bd_t **bdp) -{ - u_char *cp; - int i; - bd_t *bd; - - /* This should provided by the boot rom. - */ - bd = &bdinfo; - *bdp = bd; - bd->bi_baudrate = 9600; - bd->bi_memsize = 16 * 1024 * 1024; - - /* Set all of the clocks. We have to know the speed of the - * external clock. The development board had 66 MHz. - */ - bd->bi_busfreq = 66666666; - clk_8260(bd); - - /* I don't know how to compute this yet. - */ - bd->bi_intfreq = 200000000; - - - cp = (u_char *)def_enet_addr; - for (i=0; i<6; i++) { - bd->bi_enetaddr[i] = *cp++; - } -} -#endif /* ADS8260 */ - diff -urN linux-2.4.18/arch/ppc/boot/mbx/gzimage.c linuxppc-2.4.18/arch/ppc/boot/mbx/gzimage.c --- linux-2.4.18/arch/ppc/boot/mbx/gzimage.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/gzimage.c Thu Jan 1 10:00:00 1970 @@ -1,11 +0,0 @@ -/* - * BK Id: SCCS/s.gzimage.c 1.6 05/18/01 15:17:06 cort - */ -/* - * gzimage.c - * - * Dummy file to allow a compressed zImage to be added - * into a linker section, accessed by the boot coode - */ - -char dummy_for_gzimage; diff -urN linux-2.4.18/arch/ppc/boot/mbx/head.S linuxppc-2.4.18/arch/ppc/boot/mbx/head.S --- linux-2.4.18/arch/ppc/boot/mbx/head.S Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/head.S Thu Jan 1 10:00:00 1970 @@ -1,243 +0,0 @@ -/* - * BK Id: SCCS/s.head.S 1.9 05/18/01 07:54:04 patch - */ -#include -#include "../../kernel/ppc_defs.h" -#include "../../kernel/ppc_asm.tmpl" -#include -#include - - .text - -/* - * This code is loaded by the ROM loader at some arbitrary location. - * Move it to high memory so that it can load the kernel at 0x0000. - * - * This is a three step process that will also work when booting from - * a Flash PROM normally located in high memory. - * - * First, the entire image is loaded into some high memory address. - * This is usually at or above 0x02000000. This is done by a network - * boot function supported by the board or a debugger over BDM port. - * - * Second, the start up function here will relocate the decompress - * function to run at the link address of 0x01000000. - * - * Last, the decompression function will reloate the initrd, zImage, and - * the residual data to locations under 8 Meg. This is necessary because - * the embedded kernel start up uses 8 Meg translations to access physical - * space before the MMU is enabled. Finally, the zImage is uncompressed - * to location 0 and we jump to it. - * - * On the MBX, - * R1 - Stack pointer at a high memory address. - * R3 - Pointer to Board Information Block. - * R4 - Pointer to argument string. - * Interrupts masked, cache and MMU disabled. - * - * ...and the first and second functions listed above are - * done for us (it knows ELF images). - * - * For other embedded boards we build the Board Information Block. - */ - - .globl start -start: - bl start_ -start_: -#ifndef CONFIG_MBX - lis r11, local_bd_info@h - ori r11, r11, local_bd_info@l -#else - mr r11, r3 -#endif - - mfmsr r3 /* Turn off interrupts */ - li r4,0 - ori r4,r4,MSR_EE - andc r3,r3,r4 - mtmsr r3 - - li r4,0 /* Zero DER to prevent FRZ */ - mtspr SPRN_DER,r4 - -/* check if we need to relocate ourselves to the link addr or were we - loaded there to begin with -- Cort */ - lis r4,start@h - ori r4,r4,start@l - mflr r3 - subi r3,r3,4 /* we get the nip, not the ip of the branch */ - mr r8,r3 -#if 0 - cmp 0,r3,r4 - beq start_ldr /* Branch if loaded OK */ -#endif - -/* - * no matter where we're loaded, move ourselves to -Ttext address - * This computes the sizes we need to determine other things. - */ - lis r5,end@h - ori r5,r5,end@l - addi r5,r5,3 /* Round up - just in case */ - sub r5,r5,r4 /* Compute # longwords to move */ - srwi r5,r5,2 - mtctr r5 - mr r7,r5 - li r6,0 - subi r3,r3,4 /* Set up for loop */ - subi r4,r4,4 -00: lwzu r5,4(r3) - stwu r5,4(r4) - xor r6,r6,r5 - bdnz 00b - - lis r3,start_ldr@h - ori r3,r3,start_ldr@l - mtlr r3 /* Easiest way to do an absolute jump */ - blr - -start_ldr: -/* Most 8xx boards don't boot up with the I-cache enabled. Do that - * now because the decompress runs much faster that way. - */ - lis r3, IDC_INVALL@h - mtspr IC_CST, r3 - lis r3, IDC_ENABLE@h - mtspr IC_CST, r3 - -/* Clear all of BSS */ - lis r3,edata@h - ori r3,r3,edata@l - lis r4,end@h - ori r4,r4,end@l - subi r3,r3,4 - subi r4,r4,4 - li r0,0 -50: stwu r0,4(r3) - cmp 0,r3,r4 - bne 50b - - lis r1,.stack@h - ori r1,r1,.stack@l - addi r1,r1,4096*2 - subi r1,r1,256 - li r2,0x000F /* Mask pointer to 16-byte boundary */ - andc r1,r1,r2 - - /* Perform configuration of the various boards. This is done - * by reading some configuration data from EEPROM and building - * the board information structure. - */ - mr r3, r11 - mr r21, r11 - mr r22, r8 - mr r23, r7 - mr r24, r6 - - bl embed_config - mr r3, r21 - bl serial_init /* Init MBX serial port */ - - mr r11, r21 - mr r8, r22 - mr r7, r23 - mr r6, r24 - -#ifdef CONFIG_MBX - /* On the MBX (or anything that will TFTP load an ELF image), - * we have to find the intermediate address. The ELF loader - * only moves the Linux boostrap/decompress, not the zImage. - */ -#define ILAP_ADDRESS 0xfa000020 - lis r8, ILAP_ADDRESS@h - lwz r8, ILAP_ADDRESS@l(r8) - addis r8, r8, 1 /* Add 64K */ -#endif - - mr r3,r8 /* Load point */ - mr r4,r7 /* Program length */ - mr r5,r6 /* Checksum */ - mr r6,r11 /* Residual data */ - bl decompress_kernel - - /* changed to use r3 (as firmware does) for kernel - as ptr to residual -- Cort*/ - lis r6,cmd_line@h - ori r6,r6,cmd_line@l - lwz r6, 0(r6) - subi r7,r6,1 -00: lbzu r2,1(r7) - cmpi 0,r2,0 - bne 00b - - /* r4,r5 have initrd_start, size */ - lis r2,initrd_start@h - ori r2,r2,initrd_start@l - lwz r4,0(r2) - lis r2,initrd_end@h - ori r2,r2,initrd_end@l - lwz r5,0(r2) - - /* The world starts from the beginning. - */ - li r9,0x0 - mtlr r9 - - /* Invalidate the instruction cache because we just copied a - * bunch of kernel instructions. - */ - lis r9, IDC_INVALL@h - mtspr IC_CST, r9 - - blr -hang: - b hang - -/* - * Delay for a number of microseconds - * -- Use the BUS timer (assumes 66MHz) - */ - .globl udelay -udelay: - mulli r4,r3,1000 /* nanoseconds */ - addi r4,r4,59 - li r5,60 - divw r4,r4,r5 /* BUS ticks */ -1: mftbu r5 - mftb r6 - mftbu r7 - cmp 0,r5,r7 - bne 1b /* Get [synced] base time */ - addc r9,r6,r4 /* Compute end time */ - addze r8,r5 -2: mftbu r5 - cmp 0,r5,r8 - blt 2b - bgt 3f - mftb r6 - cmp 0,r6,r9 - blt 2b -3: blr - -.globl _get_MSR -_get_MSR: - mfmsr r3 - blr - -.globl _put_MSR -_put_MSR: - mtmsr r3 - blr - - .comm .stack,4096*2,4 -#ifndef CONFIG_MBX -local_bd_info: - .long 0 - .long 0x01000000 - .long 64 - .long 64 - .long 0 - .long 0 - .long 0 -#endif diff -urN linux-2.4.18/arch/ppc/boot/mbx/head_8260.S linuxppc-2.4.18/arch/ppc/boot/mbx/head_8260.S --- linux-2.4.18/arch/ppc/boot/mbx/head_8260.S Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/head_8260.S Thu Jan 1 10:00:00 1970 @@ -1,259 +0,0 @@ -/* - * BK Id: SCCS/s.head_8260.S 1.8 05/18/01 07:54:04 patch - */ -#include "../../kernel/ppc_defs.h" -#include "../../kernel/ppc_asm.tmpl" -#include -#include - - .text - -/* - * Boot loader philosophy: - * - * ROM loads us to some arbitrary location - * ROM loads these registers: - * - * R3 = Pointer to the board configuration data - * R5 = Pointer to Open Firmware data - * - * ROM jumps to start/start_ - * Move the boot code to the link address (4 MB) - * Call decompress_kernel() - * Relocate the initrd, zimage and residual data to 4 MB - * Decompress the kernel to 0 - * Jump to the kernel entry - * -- Cort - */ - .globl start -start: - bl start_ -start_: - mr r11,r3 /* Save pointer to residual/board data */ - mr r25,r5 /* Save OFW pointer */ - li r3,MSR_IP /* Establish default MSR value */ - mtmsr r3 - -/* check if we need to relocate ourselves to the link addr or were we - loaded there to begin with -- Cort */ - lis r4,start@h - ori r4,r4,start@l - mflr r3 - subi r3,r3,4 /* we get the nip, not the ip of the branch */ - mr r8,r3 - cmp 0,r3,r4 - bne 1010f -/* compute size of whole image in words. this should be moved to - * start_ldr() -- Cort - */ - lis r4,start@h - ori r4,r4,start@l - lis r5,end@h - ori r5,r5,end@l - addi r5,r5,3 /* round up */ - sub r5,r5,r4 - srwi r5,r5,2 - mr r7,r5 - b start_ldr -1010: -/* - * no matter where we're loaded, move ourselves to -Ttext address - */ -relocate: - mflr r3 /* Compute code bias */ - subi r3,r3,4 - mr r8,r3 - lis r4,start@h - ori r4,r4,start@l - lis r5,end@h - ori r5,r5,end@l - addi r5,r5,3 /* Round up - just in case */ - sub r5,r5,r4 /* Compute # longwords to move */ - srwi r5,r5,2 - mtctr r5 - mr r7,r5 - li r6,0 - subi r3,r3,4 /* Set up for loop */ - subi r4,r4,4 -00: lwzu r5,4(r3) - stwu r5,4(r4) - xor r6,r6,r5 - bdnz 00b - lis r3,start_ldr@h - ori r3,r3,start_ldr@l - mtlr r3 /* Easiest way to do an absolute jump */ - blr -start_ldr: -/* Clear all of BSS */ - lis r3,edata@h - ori r3,r3,edata@l - lis r4,end@h - ori r4,r4,end@l - subi r3,r3,4 - subi r4,r4,4 - li r0,0 -50: stwu r0,4(r3) - cmp 0,r3,r4 - bne 50b -90: mr r9,r1 /* Save old stack pointer (in case it matters) */ - lis r1,.stack@h - ori r1,r1,.stack@l - addi r1,r1,4096*2 - subi r1,r1,256 - li r2,0x000F /* Mask pointer to 16-byte boundary */ - andc r1,r1,r2 - - /* Speed us up a little. - */ - bl flush_instruction_cache - -/* 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 - - /* changed to use r3 (as firmware does) for kernel - as ptr to residual -- Cort*/ - lis r6,cmd_line@h - ori r6,r6,cmd_line@l - lwz r6, 0(r6) - subi r7,r6,1 -00: lbzu r2,1(r7) - cmpi 0,r2,0 - bne 00b - - /* r4,r5 have initrd_start, size */ - lis r2,initrd_start@h - ori r2,r2,initrd_start@l - lwz r4,0(r2) - lis r2,initrd_end@h - ori r2,r2,initrd_end@l - lwz r5,0(r2) - - /* tell kernel we're prep */ - /* - * get start address of kernel code which is stored as a coff - * entry. see boot/head.S -- Cort - */ - li r9,0x4 - mtlr r9 - lis r10,0xdeadc0de@h - ori r10,r10,0xdeadc0de@l - li r9,0 - stw r10,0(r9) -/* - * The Radstone firmware maps PCI memory at 0xc0000000 using BAT2 - * so disable BATs before setting this to avoid a clash - */ - li r8,0 - mtspr DBAT0U,r8 - mtspr DBAT1U,r8 - mtspr DBAT2U,r8 - mtspr DBAT3U,r8 - mtspr IBAT0U,r8 - mtspr IBAT1U,r8 - mtspr IBAT2U,r8 - mtspr IBAT3U,r8 - - blr -hang: - b hang - -/* - * Delay for a number of microseconds - * -- Use the BUS timer (assumes 66MHz) - */ - .globl udelay -udelay: - mfspr r4,PVR - srwi r4,r4,16 - cmpi 0,r4,1 /* 601 ? */ - bne .udelay_not_601 -00: li r0,86 /* Instructions / microsecond? */ - mtctr r0 -10: addi r0,r0,0 /* NOP */ - bdnz 10b - subic. r3,r3,1 - bne 00b - blr - -.udelay_not_601: - mulli r4,r3,1000 /* nanoseconds */ - addi r4,r4,59 - li r5,60 - divw r4,r4,r5 /* BUS ticks */ -1: mftbu r5 - mftb r6 - mftbu r7 - cmp 0,r5,r7 - bne 1b /* Get [synced] base time */ - addc r9,r6,r4 /* Compute end time */ - addze r8,r5 -2: mftbu r5 - cmp 0,r5,r8 - blt 2b - bgt 3f - mftb r6 - cmp 0,r6,r9 - blt 2b -3: blr - -.globl _get_HID0 -_get_HID0: - mfspr r3,HID0 - blr - -.globl _put_HID0 -_put_HID0: - mtspr HID0,r3 - blr - -.globl _get_MSR -_get_MSR: - mfmsr r3 - blr - -.globl _put_MSR -_put_MSR: - mtmsr r3 - blr - -/* - * Flush instruction cache - * *** I'm really paranoid here! - */ -_GLOBAL(flush_instruction_cache) - mflr r5 - bl flush_data_cache - mfspr r3,HID0 /* Caches are controlled by this register */ - li r4,0 - ori r4,r4,(HID0_ICE|HID0_ICFI) - or r3,r3,r4 /* Need to enable+invalidate to clear */ - mtspr HID0,r3 - andc r3,r3,r4 - ori r3,r3,HID0_ICE /* Enable cache */ - mtspr HID0,r3 - mtlr r5 - blr - -#define NUM_CACHE_LINES 128*8 -#define CACHE_LINE_SIZE 32 -#define cache_flush_buffer 0x1000 - -/* - * Flush data cache - * *** I'm really paranoid here! - */ -_GLOBAL(flush_data_cache) - lis r3,cache_flush_buffer@h - ori r3,r3,cache_flush_buffer@l - li r4,NUM_CACHE_LINES - mtctr r4 -00: lwz r4,0(r3) - addi r3,r3,CACHE_LINE_SIZE /* Next line, please */ - bdnz 00b -10: blr - .comm .stack,4096*2,4 diff -urN linux-2.4.18/arch/ppc/boot/mbx/iic.c linuxppc-2.4.18/arch/ppc/boot/mbx/iic.c --- linux-2.4.18/arch/ppc/boot/mbx/iic.c Wed Oct 10 12:38:52 2001 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/iic.c Thu Jan 1 10:00:00 1970 @@ -1,218 +0,0 @@ -/* - * BK Id: SCCS/s.iic.c 1.10 09/14/01 19:30:13 trini - */ - -/* Minimal support functions to read configuration from IIC EEPROMS - * on MPC8xx boards. Originally written for RPGC RPX-Lite. - * Dan Malek (dmalek@jlc.net). - */ -#include -#include -#include -#include - - -/* IIC functions. - * These are just the basic master read/write operations so we can - * examine serial EEPROM. - */ -void iic_read(uint devaddr, u_char *buf, uint offset, uint count); - -static int iic_init_done; - -static void -iic_init() -{ - volatile iic_t *iip; - volatile i2c8xx_t *i2c; - volatile cpm8xx_t *cp; - volatile immap_t *immap; - uint dpaddr; - - immap = (immap_t *)IMAP_ADDR; - cp = (cpm8xx_t *)&(immap->im_cpm); - - /* Reset the CPM. This is necessary on the 860 processors - * that may have started the SCC1 ethernet without relocating - * the IIC. - * This also stops the Ethernet in case we were loaded by a - * BOOTP rom monitor. - */ - cp->cp_cpcr = (CPM_CR_RST | CPM_CR_FLG); - - /* Wait for it. - */ - while (cp->cp_cpcr & (CPM_CR_RST | CPM_CR_FLG)); - - /* Remove any microcode patches. We will install our own - * later. - */ - cp->cp_cpmcr1 = 0; - cp->cp_cpmcr2 = 0; - cp->cp_cpmcr3 = 0; - cp->cp_cpmcr4 = 0; - cp->cp_rccr = 0; - - iip = (iic_t *)&cp->cp_dparam[PROFF_IIC]; - i2c = (i2c8xx_t *)&(immap->im_i2c); - - /* Initialize Port B IIC pins. - */ - cp->cp_pbpar |= 0x00000030; - cp->cp_pbdir |= 0x00000030; - cp->cp_pbodr |= 0x00000030; - - /* Initialize the parameter ram. - */ - - /* Allocate space for a two transmit and one receive buffer - * descriptor in the DP ram. - * For now, this address seems OK, but it may have to - * change with newer versions of the firmware. - */ - dpaddr = 0x0840; - - /* Set up the IIC parameters in the parameter ram. - */ - iip->iic_tbase = dpaddr; - iip->iic_rbase = dpaddr + (2 * sizeof(cbd_t)); - - iip->iic_tfcr = SMC_EB; - iip->iic_rfcr = SMC_EB; - - /* This should really be done by the reader/writer. - */ - iip->iic_mrblr = 128; - - /* Initialize Tx/Rx parameters. - */ - cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_I2C, CPM_CR_INIT_TRX) | CPM_CR_FLG; - while (cp->cp_cpcr & CPM_CR_FLG); - - /* Select an arbitrary address. Just make sure it is unique. - */ - i2c->i2c_i2add = 0x34; - - /* Make clock run maximum slow. - */ - i2c->i2c_i2brg = 7; - - /* Disable interrupts. - */ - i2c->i2c_i2cmr = 0; - i2c->i2c_i2cer = 0xff; - - /* Enable SDMA. - */ - immap->im_siu_conf.sc_sdcr = 1; - - iic_init_done = 1; -} - -/* Read from IIC. - * Caller provides device address, memory buffer, and byte count. - */ -static u_char iitemp[32]; - -void -iic_read(uint devaddr, u_char *buf, uint offset, uint count) -{ - volatile iic_t *iip; - volatile i2c8xx_t *i2c; - volatile cbd_t *tbdf, *rbdf; - volatile cpm8xx_t *cp; - volatile immap_t *immap; - u_char *tb; - uint temp; - - /* If the interface has not been initialized, do that now. - */ - if (!iic_init_done) - iic_init(); - - immap = (immap_t *)IMAP_ADDR; - cp = (cpm8xx_t *)&(immap->im_cpm); - - iip = (iic_t *)&cp->cp_dparam[PROFF_IIC]; - i2c = (i2c8xx_t *)&(immap->im_i2c); - - tbdf = (cbd_t *)&cp->cp_dpmem[iip->iic_tbase]; - rbdf = (cbd_t *)&cp->cp_dpmem[iip->iic_rbase]; - - /* Send a "dummy write" operation. This is a write request with - * only the offset sent, followed by another start condition. - * This will ensure we start reading from the first location - * of the EEPROM. - */ - tb = iitemp; - tb = (u_char *)(((uint)tb + 15) & ~15); - tbdf->cbd_bufaddr = (int)tb; - *tb = devaddr & 0xfe; /* Device address */ - *(tb+1) = offset; /* Offset */ - tbdf->cbd_datlen = 2; /* Length */ - tbdf->cbd_sc = - BD_SC_READY | BD_SC_LAST | BD_SC_WRAP | BD_IIC_START; - - i2c->i2c_i2mod = 1; /* Enable */ - i2c->i2c_i2cer = 0xff; - i2c->i2c_i2com = 0x81; /* Start master */ - - /* Wait for IIC transfer. - */ -#if 0 - while ((i2c->i2c_i2cer & 3) == 0); - - if (tbdf->cbd_sc & BD_SC_READY) - printf("IIC ra complete but tbuf ready\n"); -#else - temp = 10000000; - while ((tbdf->cbd_sc & BD_SC_READY) && (temp != 0)) - temp--; -#if 0 - /* We can't do this...there is no serial port yet! - */ - if (temp == 0) { - printf("Timeout reading EEPROM\n"); - return; - } -#endif -#endif - - /* Chip errata, clear enable. - */ - i2c->i2c_i2mod = 0; - - /* To read, we need an empty buffer of the proper length. - * All that is used is the first byte for address, the remainder - * is just used for timing (and doesn't really have to exist). - */ - tbdf->cbd_bufaddr = (int)tb; - *tb = devaddr | 1; /* Device address */ - rbdf->cbd_bufaddr = (uint)buf; /* Desination buffer */ - tbdf->cbd_datlen = rbdf->cbd_datlen = count + 1; /* Length */ - tbdf->cbd_sc = BD_SC_READY | BD_SC_LAST | BD_SC_WRAP | BD_IIC_START; - rbdf->cbd_sc = BD_SC_EMPTY | BD_SC_WRAP; - - /* Chip bug, set enable here. - */ - i2c->i2c_i2mod = 1; /* Enable */ - i2c->i2c_i2cer = 0xff; - i2c->i2c_i2com = 0x81; /* Start master */ - - /* Wait for IIC transfer. - */ -#if 0 - while ((i2c->i2c_i2cer & 1) == 0); - - if (rbdf->cbd_sc & BD_SC_EMPTY) - printf("IIC read complete but rbuf empty\n"); -#else - temp = 10000000; - while ((tbdf->cbd_sc & BD_SC_READY) && (temp != 0)) - temp--; -#endif - - /* Chip errata, clear enable. - */ - i2c->i2c_i2mod = 0; -} diff -urN linux-2.4.18/arch/ppc/boot/mbx/m8260_tty.c linuxppc-2.4.18/arch/ppc/boot/mbx/m8260_tty.c --- linux-2.4.18/arch/ppc/boot/mbx/m8260_tty.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/m8260_tty.c Thu Jan 1 10:00:00 1970 @@ -1,312 +0,0 @@ -/* - * BK Id: SCCS/s.m8260_tty.c 1.7 05/18/01 07:54:04 patch - */ - - -/* Minimal serial functions needed to send messages out the serial - * port on SMC1. - */ -#include -#include -#include - -uint no_print; -extern char *params[]; -extern int nparams; -static u_char cons_hold[128], *sgptr; -static int cons_hold_cnt; - -/* If defined, enables serial console. The value (1 through 4) - * should designate which SCC is used, but this isn't complete. Only - * SCC1 is known to work at this time. - */ -#ifdef CONFIG_SCC_CONSOLE -#define SCC_CONSOLE 1 -#endif - -void -serial_init(bd_t *bd) -{ - volatile smc_t *sp; - volatile smc_uart_t *up; - volatile scc_t *sccp; - volatile scc_uart_t *sup; - volatile cbd_t *tbdf, *rbdf; - volatile immap_t *ip; - volatile iop8260_t *io; - volatile cpm8260_t *cp; - uint dpaddr, memaddr; - - ip = (immap_t *)IMAP_ADDR; - cp = &ip->im_cpm; - io = &ip->im_ioport; - - /* Perform a reset. - */ - cp->cp_cpcr = (CPM_CR_RST | CPM_CR_FLG); - - /* Wait for it. - */ - while (cp->cp_cpcr & CPM_CR_FLG); - -#ifdef CONFIG_ADS8260 - /* Enable the RS-232 transceivers. - */ - *(volatile uint *)(BCSR_ADDR + 4) &= - ~(BCSR1_RS232_EN1 | BCSR1_RS232_EN2); -#endif - -#ifdef SCC_CONSOLE - sccp = (scc_t *)&(ip->im_scc[SCC_CONSOLE-1]); - sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)]; - sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX); - sccp->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 - sp = (smc_t*)&(ip->im_smc[0]); - *(ushort *)(&ip->im_dprambase[PROFF_SMC1_BASE]) = PROFF_SMC1; - up = (smc_uart_t *)&ip->im_dprambase[PROFF_SMC1]; - - /* Disable transmitter/receiver. - */ - sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); - - /* Use Port D for SMC1 instead of other functions. - */ - io->iop_ppard |= 0x00c00000; - io->iop_pdird |= 0x00400000; - io->iop_pdird &= ~0x00800000; - io->iop_psord &= ~0x00c00000; -#endif - - /* Allocate space for two buffer descriptors in the DP ram. - * For now, this address seems OK, but it may have to - * change with newer versions of the firmware. - */ - dpaddr = 0x0800; - - /* Grab a few bytes from the top of memory. - */ - memaddr = (bd->bi_memsize - 256) & ~15; - - /* Set the physical address of the host memory buffers in - * the buffer descriptors. - */ - rbdf = (cbd_t *)&ip->im_dprambase[dpaddr]; - rbdf->cbd_bufaddr = memaddr; - rbdf->cbd_sc = 0; - tbdf = rbdf + 1; - tbdf->cbd_bufaddr = memaddr+128; - tbdf->cbd_sc = 0; - - /* Set up the uart parameters in the parameter ram. - */ -#ifdef SCC_CONSOLE - sup->scc_genscc.scc_rbase = dpaddr; - sup->scc_genscc.scc_tbase = dpaddr + 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 = 128; - sup->scc_maxidl = 8; - 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. - */ - sccp->scc_gsmrh = 0; - sccp->scc_gsmrl = - (SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16); - - /* Disable all interrupts and clear all pending - * events. - */ - sccp->scc_sccm = 0; - sccp->scc_scce = 0xffff; - sccp->scc_dsr = 0x7e7e; - sccp->scc_pmsr = 0x3000; - - /* Wire BRG1 to SCC1. The console driver will take care of - * others. - */ - ip->im_cpmux.cmx_scr = 0; -#else - up->smc_rbase = dpaddr; - up->smc_tbase = dpaddr+sizeof(cbd_t); - up->smc_rfcr = CPMFCR_EB; - up->smc_tfcr = CPMFCR_EB; - up->smc_brklen = 0; - up->smc_brkec = 0; - up->smc_brkcr = 0; - up->smc_mrblr = 128; - up->smc_maxidl = 8; - - /* Set UART mode, 8 bit, no parity, one stop. - * Enable receive and transmit. - */ - sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART; - - /* Mask all interrupts and remove anything pending. - */ - sp->smc_smcm = 0; - sp->smc_smce = 0xff; - - /* Set up the baud rate generator. - */ - ip->im_cpmux.cmx_smr = 0; -#endif - - /* The baud rate divisor needs to be coordinated with clk_8260(). - */ - ip->im_brgc1 = - (((bd->bi_brgfreq/16) / bd->bi_baudrate) << 1) | - CPM_BRG_EN; - - /* Make the first buffer the only buffer. - */ - tbdf->cbd_sc |= BD_SC_WRAP; - rbdf->cbd_sc |= BD_SC_EMPTY | BD_SC_WRAP; - - /* Initialize Tx/Rx parameters. - */ -#ifdef SCC_CONSOLE - sccp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT); -#else - cp->cp_cpcr = mk_cr_cmd(CPM_CR_SMC1_PAGE, CPM_CR_SMC1_SBLOCK, 0, CPM_CR_INIT_TRX) | CPM_CR_FLG; - while (cp->cp_cpcr & CPM_CR_FLG); - - /* Enable transmitter/receiver. - */ - sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN; -#endif -} - -void -serial_putc(void *ignored, const char c) -{ - volatile cbd_t *tbdf; - volatile char *buf; - volatile smc_uart_t *up; - volatile scc_uart_t *sup; - volatile immap_t *ip; - extern bd_t *board_info; - - ip = (immap_t *)IMAP_ADDR; -#ifdef SCC_CONSOLE - sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)]; - tbdf = (cbd_t *)&ip->im_dprambase[sup->scc_genscc.scc_tbase]; -#else - up = (smc_uart_t *)&(ip->im_dprambase[PROFF_SMC1]); - tbdf = (cbd_t *)&ip->im_dprambase[up->smc_tbase]; -#endif - - /* Wait for last character to go. - */ - buf = (char *)tbdf->cbd_bufaddr; - while (tbdf->cbd_sc & BD_SC_READY); - - *buf = c; - tbdf->cbd_datlen = 1; - tbdf->cbd_sc |= BD_SC_READY; -} - -char -serial_getc(void *ignored) -{ - char c; - - if (cons_hold_cnt <= 0) { - cons_hold_cnt = serial_readbuf(cons_hold); - sgptr = cons_hold; - } - c = *sgptr++; - cons_hold_cnt--; - - return(c); -} - -int -serial_readbuf(u_char *cbuf) -{ - volatile cbd_t *rbdf; - volatile char *buf; - volatile smc_uart_t *up; - volatile scc_uart_t *sup; - volatile immap_t *ip; - int i, nc; - - ip = (immap_t *)IMAP_ADDR; - -#ifdef SCC_CONSOLE - sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)]; - rbdf = (cbd_t *)&ip->im_dprambase[sup->scc_genscc.scc_rbase]; -#else - up = (smc_uart_t *)&(ip->im_dprambase[PROFF_SMC1]); - rbdf = (cbd_t *)&ip->im_dprambase[up->smc_rbase]; -#endif - - /* Wait for character to show up. - */ - buf = (char *)rbdf->cbd_bufaddr; - while (rbdf->cbd_sc & BD_SC_EMPTY); - nc = rbdf->cbd_datlen; - for (i=0; icbd_sc |= BD_SC_EMPTY; - - return(nc); -} - -int -serial_tstc(void *ignored) -{ - volatile cbd_t *rbdf; - volatile smc_uart_t *up; - volatile scc_uart_t *sup; - volatile immap_t *ip; - - ip = (immap_t *)IMAP_ADDR; -#ifdef SCC_CONSOLE - sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)]; - rbdf = (cbd_t *)&ip->im_dprambase[sup->scc_genscc.scc_rbase]; -#else - up = (smc_uart_t *)&(ip->im_dprambase[PROFF_SMC1]); - rbdf = (cbd_t *)&ip->im_dprambase[up->smc_rbase]; -#endif - - return(!(rbdf->cbd_sc & BD_SC_EMPTY)); -} diff -urN linux-2.4.18/arch/ppc/boot/mbx/m8xx_tty.c linuxppc-2.4.18/arch/ppc/boot/mbx/m8xx_tty.c --- linux-2.4.18/arch/ppc/boot/mbx/m8xx_tty.c Wed Oct 10 12:38:52 2001 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/m8xx_tty.c Thu Jan 1 10:00:00 1970 @@ -1,288 +0,0 @@ -/* - * BK Id: SCCS/s.m8xx_tty.c 1.10 09/14/01 19:30:13 trini - */ - - -/* Minimal serial functions needed to send messages out the serial - * port on the MBX console. - * - * The MBX uxes SMC1 for the serial port. We reset the port and use - * only the first BD that EPPC-Bug set up as a character FIFO. - * - * Later versions (at least 1.4, maybe earlier) of the MBX EPPC-Bug - * use COM1 instead of SMC1 as the console port. This kinda sucks - * for the rest of the kernel, so here we force the use of SMC1 again. - */ -#include -#include -#include -#include -#include - -#ifdef CONFIG_MBX -#define MBX_CSR1 ((volatile u_char *)0xfa100000) -#define CSR1_COMEN (u_char)0x02 -#endif - -#ifdef TQM_SMC2_CONSOLE -#define PROFF_CONS PROFF_SMC2 -#define CPM_CR_CH_CONS CPM_CR_CH_SMC2 -#define SMC_INDEX 1 -static volatile iop8xx_t *iopp = (iop8xx_t *)&(((immap_t *)IMAP_ADDR)->im_ioport); -#else -#define PROFF_CONS PROFF_SMC1 -#define CPM_CR_CH_CONS CPM_CR_CH_SMC1 -#define SMC_INDEX 0 -#endif - -static cpm8xx_t *cpmp = (cpm8xx_t *)&(((immap_t *)IMAP_ADDR)->im_cpm); - -void -serial_init(bd_t *bd) -{ - volatile smc_t *sp; - volatile smc_uart_t *up; - volatile cbd_t *tbdf, *rbdf; - volatile cpm8xx_t *cp; - uint dpaddr, memaddr, ui; - - cp = cpmp; - sp = (smc_t*)&(cp->cp_smc[SMC_INDEX]); - up = (smc_uart_t *)&cp->cp_dparam[PROFF_CONS]; - - /* Disable transmitter/receiver. - */ - sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); - -#ifdef CONFIG_FADS - /* Enable SMC1/2 transceivers. - */ - *((volatile uint *)BCSR1) &= ~(BCSR1_RS232EN_1|BCSR1_RS232EN_2); -#endif - -#ifndef CONFIG_MBX - { - /* Initialize SMCx and use it for the console port. - */ - - /* Enable SDMA. - */ - ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sdcr = 1; - -#ifdef TQM_SMC2_CONSOLE - /* Use Port A for SMC2 instead of other functions. - */ - iopp->iop_papar |= 0x00c0; - iopp->iop_padir &= ~0x00c0; - iopp->iop_paodr &= ~0x00c0; -#else - /* Use Port B for SMCs instead of other functions. - */ - cp->cp_pbpar |= 0x00000cc0; - cp->cp_pbdir &= ~0x00000cc0; - cp->cp_pbodr &= ~0x00000cc0; -#endif - - /* Allocate space for two buffer descriptors in the DP ram. - * For now, this address seems OK, but it may have to - * change with newer versions of the firmware. - */ - dpaddr = 0x0800; - - /* Grab a few bytes from the top of memory for SMC FIFOs. - */ - memaddr = (bd->bi_memsize - 32) & ~15; - - /* Set the physical address of the host memory buffers in - * the buffer descriptors. - */ - rbdf = (cbd_t *)&cp->cp_dpmem[dpaddr]; - rbdf->cbd_bufaddr = memaddr; - rbdf->cbd_sc = 0; - tbdf = rbdf + 1; - tbdf->cbd_bufaddr = memaddr+4; - tbdf->cbd_sc = 0; - - /* Set up the uart parameters in the parameter ram. - */ - up->smc_rbase = dpaddr; - up->smc_tbase = dpaddr+sizeof(cbd_t); - up->smc_rfcr = SMC_EB; - up->smc_tfcr = SMC_EB; - - /* Set UART mode, 8 bit, no parity, one stop. - * Enable receive and transmit. - */ - sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART; - - /* Mask all interrupts and remove anything pending. - */ - sp->smc_smcm = 0; - sp->smc_smce = 0xff; - - /* Set up the baud rate generator. - * See 8xx_io/commproc.c for details. - * This wires BRG1 to SMC1 and BRG2 to SMC2; - */ - cp->cp_simode = 0x10000000; - ui = bd->bi_intfreq / 16 / bd->bi_baudrate; -#ifdef TQM_SMC2_CONSOLE - cp->cp_brgc2 = -#else - cp->cp_brgc1 = -#endif - ((ui - 1) < 4096) - ? (((ui - 1) << 1) | CPM_BRG_EN) - : ((((ui / 16) - 1) << 1) | CPM_BRG_EN | CPM_BRG_DIV16); - -#else /* CONFIG_MBX */ - if (*MBX_CSR1 & CSR1_COMEN) { - /* COM1 is enabled. Initialize SMC1 and use it for - * the console port. - */ - - /* Enable SDMA. - */ - ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sdcr = 1; - - /* Use Port B for SMCs instead of other functions. - */ - cp->cp_pbpar |= 0x00000cc0; - cp->cp_pbdir &= ~0x00000cc0; - cp->cp_pbodr &= ~0x00000cc0; - - /* Allocate space for two buffer descriptors in the DP ram. - * For now, this address seems OK, but it may have to - * change with newer versions of the firmware. - */ - dpaddr = 0x0800; - - /* Grab a few bytes from the top of memory. EPPC-Bug isn't - * running any more, so we can do this. - */ - memaddr = (bd->bi_memsize - 32) & ~15; - - /* Set the physical address of the host memory buffers in - * the buffer descriptors. - */ - rbdf = (cbd_t *)&cp->cp_dpmem[dpaddr]; - rbdf->cbd_bufaddr = memaddr; - rbdf->cbd_sc = 0; - tbdf = rbdf + 1; - tbdf->cbd_bufaddr = memaddr+4; - tbdf->cbd_sc = 0; - - /* Set up the uart parameters in the parameter ram. - */ - up->smc_rbase = dpaddr; - up->smc_tbase = dpaddr+sizeof(cbd_t); - up->smc_rfcr = SMC_EB; - up->smc_tfcr = SMC_EB; - - /* Set UART mode, 8 bit, no parity, one stop. - * Enable receive and transmit. - */ - sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART; - - /* Mask all interrupts and remove anything pending. - */ - sp->smc_smcm = 0; - sp->smc_smce = 0xff; - - /* Set up the baud rate generator. - * See 8xx_io/commproc.c for details. - */ - cp->cp_simode = 0x10000000; - cp->cp_brgc1 = - (((bd->bi_intfreq/16) / 9600) << 1) | CPM_BRG_EN; - - /* Enable SMC1 for console output. - */ - *MBX_CSR1 &= ~CSR1_COMEN; - } - else { -#endif /* ndef CONFIG_MBX */ - /* SMCx is used as console port. - */ - tbdf = (cbd_t *)&cp->cp_dpmem[up->smc_tbase]; - rbdf = (cbd_t *)&cp->cp_dpmem[up->smc_rbase]; - - /* Issue a stop transmit, and wait for it. - */ - cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_CONS, - CPM_CR_STOP_TX) | CPM_CR_FLG; - while (cp->cp_cpcr & CPM_CR_FLG); - } - - /* Make the first buffer the only buffer. - */ - tbdf->cbd_sc |= BD_SC_WRAP; - rbdf->cbd_sc |= BD_SC_EMPTY | BD_SC_WRAP; - - /* Single character receive. - */ - up->smc_mrblr = 1; - up->smc_maxidl = 0; - - /* Initialize Tx/Rx parameters. - */ - cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_CONS, CPM_CR_INIT_TRX) | CPM_CR_FLG; - while (cp->cp_cpcr & CPM_CR_FLG); - - /* Enable transmitter/receiver. - */ - sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN; -} - -void -serial_putc(void *ignored, const char c) -{ - volatile cbd_t *tbdf; - volatile char *buf; - volatile smc_uart_t *up; - - up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONS]; - tbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_tbase]; - - /* Wait for last character to go. - */ - buf = (char *)tbdf->cbd_bufaddr; - while (tbdf->cbd_sc & BD_SC_READY); - - *buf = c; - tbdf->cbd_datlen = 1; - tbdf->cbd_sc |= BD_SC_READY; -} - -char -serial_getc(void *ignored) -{ - volatile cbd_t *rbdf; - volatile char *buf; - volatile smc_uart_t *up; - char c; - - up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONS]; - rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase]; - - /* Wait for character to show up. - */ - buf = (char *)rbdf->cbd_bufaddr; - while (rbdf->cbd_sc & BD_SC_EMPTY); - c = *buf; - rbdf->cbd_sc |= BD_SC_EMPTY; - - return(c); -} - -int -serial_tstc(void *ignored) -{ - volatile cbd_t *rbdf; - volatile smc_uart_t *up; - - up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONS]; - rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase]; - - return(!(rbdf->cbd_sc & BD_SC_EMPTY)); -} diff -urN linux-2.4.18/arch/ppc/boot/mbx/misc.c linuxppc-2.4.18/arch/ppc/boot/mbx/misc.c --- linux-2.4.18/arch/ppc/boot/mbx/misc.c Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/misc.c Thu Jan 1 10:00:00 1970 @@ -1,248 +0,0 @@ -/* - * BK Id: SCCS/s.misc.c 1.15 10/15/01 10:53:29 trini - */ -/* - * Adapted for PowerPC by Gary Thomas - * - * Rewritten by Cort Dougan (cort@cs.nmt.edu) - * One day to be replaced by a single bootloader for chrp/prep/pmac. -- Cort - */ - -#include -#include -#include "zlib.h" -#include -#include -#include -#include -#include -#ifdef CONFIG_8xx -#include -#endif -#ifdef CONFIG_8260 -#include -#endif - -#include "nonstdio.h" - -/* - * The following references are needed to cause the linker to pull in the - * gzimage.o and rdimage.o files. These object files are special, - * since they get placed into the .gzimage and .rdimage ELF sections - * of the zvmlinux and zvmlinux.initrd files. - */ -extern char dummy_for_gzimage; -extern char dummy_for_rdimage; - -/* - * Please send me load/board info and such data for hardware not - * listed here so I can keep track since things are getting tricky - * with the different load addrs with different firmware. This will - * help to avoid breaking the load/boot process. - * -- Cort - */ -char *avail_ram; -char *end_avail; - -/* Because of the limited amount of memory on embedded, it presents - * loading problems. The biggest is that we load this boot program - * into a relatively low memory address, and the Linux kernel Bss often - * extends into this space when it get loaded. When the kernel starts - * and zeros the BSS space, it also writes over the information we - * save here and pass to the kernel (command line and board info). - * On these boards, we grab some known memory holes to hold this information. - */ -char cmd_buf[256]; -char *cmd_line = cmd_buf; - -/* We need to pass along a 'dummy' com_port. */ -unsigned long com_port = 0; - -/* This is the default cmdline that will be given to the user at boot time.. - * If none was specified at compile time, we'll give it one that should work. - * -- Tom */ -#ifdef CONFIG_CMDLINE_BOOL -char compiled_string[] = CONFIG_CMDLINE; -#endif -char ramroot_string[] = "root=/dev/ram"; -char netroot_string[] = "root=/dev/nfs rw"; - -bd_t hold_resid_buf; -bd_t *hold_residual = &hold_resid_buf; -unsigned long initrd_start = 0, initrd_end = 0; -char *zimage_start; - -extern void gunzip(void *, int, unsigned char *, int *); - -unsigned long -decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp) -{ - int timer, zimage_size = ZIMAGE_SIZE; - extern unsigned long start; - char *cp, ch; - -#ifdef CONFIG_8260 - /* I don't know why I didn't do it this way on the 8xx....... - */ - embed_config(&bp); - serial_init(bp); -#endif - - /* Grab some space for the command line and board info. Since - * we no longer use the ELF header, but it was loaded, grab - * that space. - */ -#ifdef CONFIG_MBX - cmd_line = (char *)(load_addr - 0x10000); - - /* To be like everyone else, we need one too, although this - * board information is passed from the boot rom. - */ - bp->bi_baudrate = 9600; -#else - cmd_line = (char *)(0x200000); -#endif - hold_residual = (bd_t *)(cmd_line + sizeof(cmd_buf)); - /* copy board data */ - if (bp) - memcpy(hold_residual,bp,sizeof(bd_t)); - - /* Set end of memory available to us. It is always the highest - * memory address provided by the board information. - */ - end_avail = (char *)(bp->bi_memsize); - - puts("loaded at: "); puthex(load_addr); - puts(" "); puthex((unsigned long)(load_addr + (4*num_words))); puts("\n"); - if ( (unsigned long)load_addr != (unsigned long)&start ) - { - puts("relocated to: "); puthex((unsigned long)&start); - puts(" "); - puthex((unsigned long)((unsigned long)&start + (4*num_words))); - puts("\n"); - } - - if ( bp ) - { - puts("board data at: "); puthex((unsigned long)bp); - puts(" "); - puthex((unsigned long)((unsigned long)bp + sizeof(bd_t))); - puts("\n"); - puts("relocated to: "); - puthex((unsigned long)hold_residual); - puts(" "); - puthex((unsigned long)((unsigned long)hold_residual + sizeof(bd_t))); - puts("\n"); - } - - /* we have to subtract 0x10000 here to correct for objdump including the - size of the elf header which we strip -- Cort */ - zimage_start = (char *)(load_addr - 0x10000 + ZIMAGE_OFFSET); - - if ( INITRD_OFFSET ) - initrd_start = load_addr - 0x10000 + INITRD_OFFSET; - else - initrd_start = 0; - initrd_end = INITRD_SIZE + initrd_start; - - /* - * setup avail_ram - this is the first part of ram usable - * by the uncompress code. -- Cort - */ - avail_ram = (char *)PAGE_ALIGN((unsigned long)zimage_start+zimage_size); - if ( ((load_addr+(num_words*4)) > (unsigned long) avail_ram) - && (load_addr <= 0x01000000) ) - avail_ram = (char *)(load_addr+(num_words*4)); - if ( (((unsigned long)&start+(num_words*4)) > (unsigned long) avail_ram) - && (load_addr <= 0x01000000) ) - avail_ram = (char *)((unsigned long)&start+(num_words*4)); - - /* relocate zimage */ - puts("zimage at: "); puthex((unsigned long)zimage_start); - puts(" "); puthex((unsigned long)(zimage_size+zimage_start)); puts("\n"); - /* - * There is no reason (yet) to relocate zImage for embedded boards. - * To support boot from flash rom on 8xx embedded boards, I - * assume if zimage start is over 16M we are booting from flash. - * In this case, avilable ram will start just above the space we - * have allocated for the command buffer and board information. - */ - if ((unsigned long)zimage_start > 0x01000000) - avail_ram = (char *)PAGE_ALIGN((unsigned long)hold_residual + sizeof(bd_t)); - - /* relocate initrd */ - if ( initrd_start ) - { - puts("initrd at: "); puthex(initrd_start); - puts(" "); puthex(initrd_end); puts("\n"); - - /* We only have to relocate initrd if we find it is in Flash - * rom. This is because the kernel thinks it can toss the - * pages into the free memory pool after it is done. Use - * the same 16M test. - */ - if ((unsigned long)initrd_start > 0x01000000) { - memcpy ((void *)PAGE_ALIGN(-PAGE_SIZE+(unsigned long)end_avail-INITRD_SIZE), - (void *)initrd_start, - INITRD_SIZE ); - initrd_start = PAGE_ALIGN(-PAGE_SIZE+(unsigned long)end_avail-INITRD_SIZE); - initrd_end = initrd_start + INITRD_SIZE; - end_avail = (char *)initrd_start; - puts("relocated to: "); puthex(initrd_start); - puts(" "); puthex(initrd_end); puts("\n"); - } - else { - avail_ram = (char *)PAGE_ALIGN((unsigned long)initrd_end); - } - } - - - puts("avail ram: "); puthex((unsigned long)avail_ram); puts(" "); - puthex((unsigned long)end_avail); puts("\n"); - puts("\nLinux/PPC load: "); - timer = 0; - cp = cmd_line; - /* This is where we try and pick the right command line for booting. - * If we were given one at compile time, use it. It Is Right. - * If we weren't, see if we have a ramdisk. If so, thats root. - * When in doubt, give them the netroot (root=/dev/nfs rw) -- Tom */ -#ifdef CONFIG_CMDLINE_BOOL - memcpy (cmd_line, compiled_string, sizeof(compiled_string)); -#else - if (initrd_start) - memcpy (cmd_line, ramroot_string, sizeof(ramroot_string)); - else - memcpy (cmd_line, netroot_string, sizeof(netroot_string)); -#endif - while ( *cp ) putc(*cp++); - while (timer++ < 5*1000) { - if (tstc()) { - while ((ch = getc()) != '\n' && ch != '\r') { - if (ch == '\b' || ch == '\177') { - if (cp != cmd_line) { - cp--; - puts("\b \b"); - } - } else if (ch == '\030' /* ^x */ - || ch == '\025') { /* ^u */ - while (cp != cmd_line) { - cp--; - puts("\b \b"); - } - } else { - *cp++ = ch; - putc(ch); - } - } - break; /* Exit 'timer' loop */ - } - udelay(1000); /* 1 msec */ - } - *cp = 0; - puts("\nUncompressing Linux..."); - - gunzip(0, 0x400000, zimage_start, &zimage_size); - puts("done.\n"); - puts("Now booting the kernel\n"); - return (unsigned long)hold_residual; -} diff -urN linux-2.4.18/arch/ppc/boot/mbx/pci.c linuxppc-2.4.18/arch/ppc/boot/mbx/pci.c --- linux-2.4.18/arch/ppc/boot/mbx/pci.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/pci.c Thu Jan 1 10:00:00 1970 @@ -1,255 +0,0 @@ -/* - * BK Id: SCCS/s.pci.c 1.6 05/18/01 15:17:06 cort - */ -/* Stand alone funtions for QSpan Tundra support. - */ -#include -#include -#include -#include - -/* To map PCI devices, you first write 0xffffffff into the device - * base address registers. When the register is read back, the - * number of most significant '1' bits describes the amount of address - * space needed for mapping. If the most significant bit is not set, - * either the device does not use that address register, or it has - * a fixed address that we can't change. After the address is assigned, - * the command register has to be written to enable the card. - */ -typedef struct { - u_char pci_bus; - u_char pci_devfn; - ushort pci_command; - uint pci_addrs[6]; -} pci_map_t; - -/* We should probably dynamically allocate these structures. -*/ -#define MAX_PCI_DEVS 32 -int pci_dev_cnt; -pci_map_t pci_map[MAX_PCI_DEVS]; - -void pci_conf_write(int bus, int device, int func, int reg, uint writeval); -void pci_conf_read(int bus, int device, int func, int reg, void *readval); -void probe_addresses(int bus, int devfn); -void map_pci_addrs(void); - -/* This is a really stripped version of PCI bus scan. All we are - * looking for are devices that exist. - */ -pci_scanner(int addr_probe) -{ - unsigned int devfn, l, max, class, bus_number; - unsigned char cmd, irq, tmp, hdr_type, is_multi; - int reg; - - is_multi = 0; - bus_number = 0; - for (devfn = 0; devfn < 0xff; ++devfn) { - /* The device numbers are comprised of upper 5 bits of - * device number and lower 3 bits of multi-function number. - */ - if ((devfn & 7) && !is_multi) { - /* Don't scan multifunction addresses if this is - * not a multifunction device. - */ - continue; - } - - /* Read the header to determine card type. - */ - qs_pci_read_config_byte(bus_number, devfn, PCI_HEADER_TYPE, - &hdr_type); - - /* If this is a base device number, check the header to - * determine if it is mulifunction. - */ - if ((devfn & 7) == 0) - is_multi = hdr_type & 0x80; - - /* Check to see if the board is really in the slot. - */ - qs_pci_read_config_dword(bus_number, devfn, PCI_VENDOR_ID, &l); - /* some broken boards return 0 if a slot is empty: */ - if (l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff || - l == 0xffff0000) { - /* Nothing there. - */ - is_multi = 0; - continue; - } - - /* If we are not performing an address probe, - * just simply print out some information. - */ - if (!addr_probe) { - qs_pci_read_config_dword(bus_number, devfn, - PCI_CLASS_REVISION, &class); - - class >>= 8; /* upper 3 bytes */ - -#if 0 - printf("Found (%3d:%d): vendor 0x%04x, device 0x%04x, class 0x%06x\n", - (devfn >> 3), (devfn & 7), - (l & 0xffff), (l >> 16) & 0xffff, class); -#else - puts("Found ("); puthex(devfn >> 3); - puts(":"); puthex(devfn & 7); - puts("): vendor "); puthex(l & 0xffff); - puts(", device "); puthex((l >> 16) & 0xffff); - puts(", class "); puthex(class); puts("\n"); -#endif - } - else { - /* If this is a "normal" device, build address list. - */ - if ((hdr_type & 0x7f) == PCI_HEADER_TYPE_NORMAL) - probe_addresses(bus_number, devfn); - } - } - - /* Now map the boards. - */ - if (addr_probe) - map_pci_addrs(); -} - -/* Probe addresses for the specified device. This is a destructive - * operation because it writes the registers. - */ -void -probe_addresses(bus, devfn) -{ - int i; - uint pciaddr; - ushort pcicmd; - pci_map_t *pm; - - if (pci_dev_cnt >= MAX_PCI_DEVS) { - puts("Too many PCI devices\n"); - return; - } - - pm = &pci_map[pci_dev_cnt++]; - - pm->pci_bus = bus; - pm->pci_devfn = devfn; - - for (i=0; i<6; i++) { - qs_pci_write_config_dword(bus, devfn, PCI_BASE_ADDRESS_0 + (i * 4), -1); - qs_pci_read_config_dword(bus, devfn, PCI_BASE_ADDRESS_0 + (i * 4), - &pciaddr); - pm->pci_addrs[i] = pciaddr; - qs_pci_read_config_word(bus, devfn, PCI_COMMAND, &pcicmd); - pm->pci_command = pcicmd; - } -} - -/* Map the cards into the PCI space. The PCI has separate memory - * and I/O spaces. In addition, some memory devices require mapping - * below 1M. The least significant 4 bits of the address register - * provide information. If this is an I/O device, only the LS bit - * is used to indicate that, so I/O devices can be mapped to a two byte - * boundard. Memory addresses can be mapped to a 32 byte boundary. - * The QSpan implementations usually have a 1Gbyte space for each - * memory and I/O spaces. - * - * This isn't a terribly fancy algorithm. I just map the spaces from - * the top starting with the largest address space. When finished, - * the registers are written and the card enabled. - * - * While the Tundra can map a large address space on most boards, we - * need to be careful because it may overlap other devices (like IMMR). - */ -#define MEMORY_SPACE_SIZE 0x20000000 -#define IO_SPACE_SIZE 0x20000000 - -void -map_pci_addrs() -{ - uint pci_mem_top, pci_mem_low; - uint pci_io_top; - uint addr_mask, reg_addr, space; - int i, j; - pci_map_t *pm; - - pci_mem_top = MEMORY_SPACE_SIZE; - pci_io_top = IO_SPACE_SIZE; - pci_mem_low = (1 * 1024 * 1024); /* Below one meg addresses */ - - /* We can't map anything more than the maximum space, but test - * for it anyway to catch devices out of range. - */ - addr_mask = 0x80000000; - - do { - space = (~addr_mask) + 1; /* Size of the space */ - for (i=0; ipci_addrs[j]; - if ((reg_addr & 0x80000000) == 0) - continue; - if (reg_addr & PCI_BASE_ADDRESS_SPACE_IO) { - if ((reg_addr & PCI_BASE_ADDRESS_IO_MASK) != addr_mask) - continue; - if (pci_io_top < space) { - puts("Out of PCI I/O space\n"); - } - else { - pci_io_top -= space; - pm->pci_addrs[j] = pci_io_top; - pm->pci_command |= PCI_COMMAND_IO; - } - } - else { - if ((reg_addr & PCI_BASE_ADDRESS_MEM_MASK) != addr_mask) - continue; - - /* Memory space. Test if below 1M. - */ - if (reg_addr & PCI_BASE_ADDRESS_MEM_TYPE_1M) { - if (pci_mem_low < space) { - puts("Out of PCI 1M space\n"); - } - else { - pci_mem_low -= space; - pm->pci_addrs[j] = pci_mem_low; - } - } - else { - if (pci_mem_top < space) { - puts("Out of PCI Mem space\n"); - } - else { - pci_mem_top -= space; - pm->pci_addrs[j] = pci_mem_top; - } - } - pm->pci_command |= PCI_COMMAND_MEMORY; - } - } - } - addr_mask >>= 1; - addr_mask |= 0x80000000; - } while (addr_mask != 0xfffffffe); - - /* Now, run the list one more time and map everything. - */ - for (i=0; ipci_bus, pm->pci_devfn, - PCI_BASE_ADDRESS_0 + (j * 4), pm->pci_addrs[j]); - } - - /* Enable memory or address mapping. - */ - qs_pci_write_config_word(pm->pci_bus, pm->pci_devfn, PCI_COMMAND, - pm->pci_command); - } -} - diff -urN linux-2.4.18/arch/ppc/boot/mbx/qspan_pci.c linuxppc-2.4.18/arch/ppc/boot/mbx/qspan_pci.c --- linux-2.4.18/arch/ppc/boot/mbx/qspan_pci.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/qspan_pci.c Thu Jan 1 10:00:00 1970 @@ -1,271 +0,0 @@ -/* - * BK Id: SCCS/s.qspan_pci.c 1.6 05/18/01 15:17:06 cort - */ -/* - * LinuxPPC arch/ppc/kernel/qspan_pci.c Dan Malek (dmalek@jlc.net) - * - * QSpan Motorola bus to PCI bridge. The config address register - * is located 0x500 from the base of the bridge control/status registers. - * The data register is located at 0x504. - * This is a two step operation. First, the address register is written, - * then the data register is read/written as required. - * I don't know what to do about interrupts (yet). - */ - -#include -#include -#include -#include - -/* - * When reading the configuration space, if something does not respond - * the bus times out and we get a machine check interrupt. So, the - * good ol' exception tables come to mind to trap it and return some - * value. - * - * On an error we just return a -1, since that is what the caller wants - * returned if nothing is present. I copied this from __get_user_asm, - * with the only difference of returning -1 instead of EFAULT. - * There is an associated hack in the machine check trap code. - * - * The QSPAN is also a big endian device, that is it makes the PCI - * look big endian to us. This presents a problem for the Linux PCI - * functions, which assume little endian. For example, we see the - * first 32-bit word like this: - * ------------------------ - * | Device ID | Vendor ID | - * ------------------------ - * If we read/write as a double word, that's OK. But in our world, - * when read as a word, device ID is at location 0, not location 2 as - * the little endian PCI would believe. We have to switch bits in - * the PCI addresses given to us to get the data to/from the correct - * byte lanes. - * - * The QSPAN only supports 4 bits of "slot" in the dev_fn instead of 5. - * It always forces the MS bit to zero. Therefore, dev_fn values - * greater than 128 are returned as "no device found" errors. - * - * The QSPAN can only perform long word (32-bit) configuration cycles. - * The "offset" must have the two LS bits set to zero. Read operations - * require we read the entire word and then sort out what should be - * returned. Write operations other than long word require that we - * read the long word, update the proper word or byte, then write the - * entire long word back. - * - * PCI Bridge hack. We assume (correctly) that bus 0 is the primary - * PCI bus from the QSPAN. If we are called with a bus number other - * than zero, we create a Type 1 configuration access that a downstream - * PCI bridge will interpret. - */ - -#define __get_pci_config(x, addr, op) \ - __asm__ __volatile__( \ - "1: "op" %0,0(%1)\n" \ - " eieio\n" \ - "2:\n" \ - ".section .fixup,\"ax\"\n" \ - "3: li %0,-1\n" \ - " b 2b\n" \ - ".section __ex_table,\"a\"\n" \ - " .align 2\n" \ - " .long 1b,3b\n" \ - ".text" \ - : "=r"(x) : "r"(addr)) - -#define QS_CONFIG_ADDR ((volatile uint *)(PCI_CSR_ADDR + 0x500)) -#define QS_CONFIG_DATA ((volatile uint *)(PCI_CSR_ADDR + 0x504)) - -#define mk_config_addr(bus, dev, offset) \ - (((bus)<<16) | ((dev)<<8) | (offset & 0xfc)) - -#define mk_config_type1(bus, dev, offset) \ - mk_config_addr(bus, dev, offset) | 1; - -/* Initialize the QSpan device registers after power up. -*/ -qspan_init() -{ - uint *qptr; - - - - qptr = (uint *)PCI_CSR_ADDR; - - /* PCI Configuration/status. Upper bits written to clear - * pending interrupt or status. Lower bits enable QSPAN as - * PCI master, enable memory and I/O cycles, and enable PCI - * parity error checking. - * IMPORTANT: The last two bits of this word enable PCI - * master cycles into the QBus. The QSpan is broken and can't - * meet the timing specs of the PQ bus for this to work. Therefore, - * if you don't have external bus arbitration, you can't use - * this function. - */ -#ifdef EXTERNAL_PQ_ARB - qptr[1] = 0xf9000147; -#else - qptr[1] = 0xf9000144; -#endif - - /* PCI Misc configuration. Set PCI latency timer resolution - * of 8 cycles, set cache size to 4 x 32. - */ - qptr[3] = 0; - - /* Set up PCI Target address mapping. Enable, Posted writes, - * 2Gbyte space (processor memory controller determines actual size). - */ - qptr[64] = 0x8f000080; - - /* Map processor 0x80000000 to PCI 0x00000000. - * Processor address bit 1 determines I/O type access (0x80000000) - * or memory type access (0xc0000000). - */ - qptr[65] = 0x80000000; - - /* Enable error logging and clear any pending error status. - */ - qptr[80] = 0x90000000; - - qptr[512] = 0x000c0003; - - /* Set up Qbus slave image. - */ - qptr[960] = 0x01000000; - qptr[961] = 0x000000d1; - qptr[964] = 0x00000000; - qptr[965] = 0x000000d1; - -} - -/* Functions to support PCI bios-like features to read/write configuration - * space. If the function fails for any reason, a -1 (0xffffffff) value - * must be returned. - */ -#define DEVICE_NOT_FOUND (-1) -#define SUCCESSFUL 0 - -int qs_pci_read_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char *val) -{ - uint temp; - u_char *cp; - - if ((bus > 7) || (dev_fn > 127)) { - *val = 0xff; - return DEVICE_NOT_FOUND; - } - - if (bus == 0) - *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset); - else - *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset); - __get_pci_config(temp, QS_CONFIG_DATA, "lwz"); - - offset ^= 0x03; - cp = ((u_char *)&temp) + (offset & 0x03); - *val = *cp; - return SUCCESSFUL; -} - -int qs_pci_read_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short *val) -{ - uint temp; - ushort *sp; - - if ((bus > 7) || (dev_fn > 127)) { - *val = 0xffff; - return DEVICE_NOT_FOUND; - } - - if (bus == 0) - *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset); - else - *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset); - __get_pci_config(temp, QS_CONFIG_DATA, "lwz"); - offset ^= 0x02; - - sp = ((ushort *)&temp) + ((offset >> 1) & 1); - *val = *sp; - return SUCCESSFUL; -} - -int qs_pci_read_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int *val) -{ - if ((bus > 7) || (dev_fn > 127)) { - *val = 0xffffffff; - return DEVICE_NOT_FOUND; - } - if (bus == 0) - *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset); - else - *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset); - __get_pci_config(*val, QS_CONFIG_DATA, "lwz"); - return SUCCESSFUL; -} - -int qs_pci_write_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char val) -{ - uint temp; - u_char *cp; - - if ((bus > 7) || (dev_fn > 127)) - return DEVICE_NOT_FOUND; - - qs_pci_read_config_dword(bus, dev_fn, offset, &temp); - - offset ^= 0x03; - cp = ((u_char *)&temp) + (offset & 0x03); - *cp = val; - - if (bus == 0) - *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset); - else - *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset); - *QS_CONFIG_DATA = temp; - - return SUCCESSFUL; -} - -int qs_pci_write_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short val) -{ - uint temp; - ushort *sp; - - if ((bus > 7) || (dev_fn > 127)) - return DEVICE_NOT_FOUND; - - qs_pci_read_config_dword(bus, dev_fn, offset, &temp); - - offset ^= 0x02; - sp = ((ushort *)&temp) + ((offset >> 1) & 1); - *sp = val; - - if (bus == 0) - *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset); - else - *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset); - *QS_CONFIG_DATA = temp; - - return SUCCESSFUL; -} - -int qs_pci_write_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int val) -{ - if ((bus > 7) || (dev_fn > 127)) - return DEVICE_NOT_FOUND; - - if (bus == 0) - *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset); - else - *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset); - *(unsigned int *)QS_CONFIG_DATA = val; - - return SUCCESSFUL; -} - diff -urN linux-2.4.18/arch/ppc/boot/mbx/rdimage.c linuxppc-2.4.18/arch/ppc/boot/mbx/rdimage.c --- linux-2.4.18/arch/ppc/boot/mbx/rdimage.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/mbx/rdimage.c Thu Jan 1 10:00:00 1970 @@ -1,11 +0,0 @@ -/* - * BK Id: SCCS/s.rdimage.c 1.6 05/18/01 15:17:06 cort - */ -/* - * rdimage.c - * - * Dummy file to allow a compressed initrd to be added - * into a linker section, accessed by the boot coode - */ - -char dummy_for_rdimage; diff -urN linux-2.4.18/arch/ppc/boot/pmac/Makefile linuxppc-2.4.18/arch/ppc/boot/pmac/Makefile --- linux-2.4.18/arch/ppc/boot/pmac/Makefile Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/pmac/Makefile Thu Mar 7 10:52:13 2002 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.16 09/28/01 07:39:37 trini +# BK Id: SCCS/s.Makefile 1.19 01/16/02 11:08:07 trini # # Makefile for making XCOFF bootable images for booting on PowerMacs # using Open Firmware. @@ -9,10 +9,10 @@ # Tom Rini January 2001 OBJCOPY_ARGS = -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment -COFF_LD_ARGS = -e _start -T ld.script -Ttext 500000 -Tdata 510000 -Bstatic -CHRP_LD_ARGS = -Ttext 0x01000000 +COFF_LD_ARGS = -T ../ld.script -e _start -Ttext 0x00500000 -Bstatic +CHRP_LD_ARGS = -T ../ld.script -Ttext 0x01000000 -COMMONOBJS = start.o misc.o ../common/string.o image.o ../common/ofcommon.o +COMMONOBJS = start.o misc.o ../common/string.o ../common/ofcommon.o COFFOBJS = ../common/coffcrt0.o $(COMMONOBJS) coffmain.o CHRPOBJS = ../common/crt0.o $(COMMONOBJS) chrpmain.o LIBS = $(TOPDIR)/lib/lib.a ../lib/zlib.a @@ -20,29 +20,31 @@ MKNOTE := ../utils/mknote SIZE := ../utils/size OFFSET := ../utils/offset -PIGGYBACK := ../utils/piggyback HACKCOFF := ../utils/hack-coff -ifeq ($(CONFIG_PPC64BRIDGE),y) -MSIZE=.64 -else -MSIZE= +ifdef CONFIG_SMP +END := .smp endif - -ifeq ($(CONFIG_SMP),y) -TFTPIMAGE=/tftpboot/zImage.pmac.smp$(MSIZE) -else -TFTPIMAGE=/tftpboot/zImage.pmac$(MSIZE) +ifdef CONFIG_PPC64BRIDGE +END += .64 endif -../common/crt0.o: - $(MAKE) -C ../common crt0.o +TFTPIMAGE=/tftpboot/zImage.pmac$(END) + +AFLAGS_../common/crt0.o += -I$(TOPDIR)/arch/$(ARCH)/kernel ../common/coffcrt0.o: $(MAKE) -C ../common coffcrt0.o -chrpmain.o: chrpmain.c - $(CC) $(CFLAGS) -DSYSMAP_OFFSET=0 -DSYSMAP_SIZE=0 -c chrpmain.c +image.o: ../images/vmlinux.gz ../common/dummy.o + $(OBJCOPY) ../common/dummy.o $@ -R .comment \ + --add-section=.image=../images/vmlinux.gz \ + --set-section-flags=.image=contents,alloc,load,readonly,data +ifdef CONFIG_XMON + $(OBJCOPY) $@ $@ \ + --add-section=.sysmap=$(TOPDIR)/System.map \ + --set-section-flags=.sysmap=contents,alloc,load,readonly,data +endif znetboot: vmlinux.coff vmlinux.elf-pmac zImage cp ../images/vmlinux.coff $(TFTPIMAGE) @@ -52,30 +54,26 @@ cp ../images/vmlinux.initrd.coff $(TFTPIMAGE) cp ../images/vmlinux.initrd.elf-pmac $(TFTPIMAGE).elf -#floppy: zImage -# mount -t hfs /dev/fd0 /mnt -# cp vmlinux.coff /mnt -# umount /mnt - -miboot.image: dummy.o ../images/vmlinux.gz +miboot.image: ../common/dummy.o ../images/vmlinux.gz $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=image=../images/vmlinux.gz \ - dummy.o ../images/$@ + ../common/dummy.o ../images/$@ miboot.initrd.image: miboot.image ../images/ramdisk.image.gz $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=initrd=../images/ramdisk.image.gz \ ../images/miboot.image ../images/$@ -coffboot: $(COFFOBJS) $(LIBS) ../common/no_initrd.o ld.script ../images/vmlinux.gz - $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) ../common/no_initrd.o $(LIBS) - -coffboot.initrd: $(COFFOBJS) $(LIBS) initrd.o ld.script ../images/vmlinux.gz - $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) initrd.o $(LIBS) - -image.o: $(PIGGYBACK) ../images/vmlinux.gz - $(PIGGYBACK) image < ../images/vmlinux.gz | $(AS) -o $@ - -initrd.o: ../images/ramdisk.image.gz $(PIGGYBACK) - $(PIGGYBACK) initrd < ../images/ramdisk.image.gz | $(AS) -o $@ +coffboot: $(COFFOBJS) image.o $(LIBS) ../ld.script + $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) image.o $(LIBS) + $(OBJCOPY) $@ $@ -R .comment + +coffboot.initrd: $(COFFOBJS) image.o $(LIBS) ../ld.script \ + ../images/ramdisk.image.gz + $(OBJCOPY) image.o image-coff.o \ + --add-section=.ramdisk=../images/ramdisk.image.gz \ + --set-section-flags=.ramdisk=contents,alloc,load,readonly,data + $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) image-coff.o $(LIBS) + $(OBJCOPY) $@ $@ -R .comment + rm -f image-coff.o vmlinux.coff: coffboot $(HACKCOFF) $(OBJCOPY) $(OBJCOPY_ARGS) coffboot ../images/$@ @@ -89,24 +87,23 @@ rm -f coffboot.initrd ln -sf vmlinux.initrd.coff ../images/zImage.initrd.pmac -vmlinux.elf-pmac: $(CHRPOBJS) $(LIBS) ../common/no_initrd.o $(MKNOTE) ../images/vmlinux.gz - $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) ../common/no_initrd.o $(LIBS) +vmlinux.elf-pmac: $(CHRPOBJS) $(LIBS) $(MKNOTE) image.o + $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) $(LIBS) image.o $(MKNOTE) > note $(OBJCOPY) ../images/$@ ../images/$@ --add-section=.note=note \ - --add-section=sysmap=$(TOPDIR)/System.map -R .comment - $(CC) $(CFLAGS) chrpmain.c -c -o chrpmain.o \ - -DSYSMAP_OFFSET=`sh $(OFFSET) $(OBJDUMP) ../images/$@ sysmap` \ - -DSYSMAP_SIZE=`sh $(SIZE) $(OBJDUMP) ../images/$@ sysmap` - $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) ../common/no_initrd.o $(LIBS) - $(OBJCOPY) ../images/$@ ../images/$@ --add-section=.note=note \ - --add-section=sysmap=$(TOPDIR)/System.map -R .comment + -R .comment -R .ramdisk rm -f note -vmlinux.initrd.elf-pmac: $(CHRPOBJS) $(LIBS) initrd.o $(MKNOTE) ../images/vmlinux.gz - $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) initrd.o $(LIBS) +vmlinux.initrd.elf-pmac: $(CHRPOBJS) $(LIBS) $(MKNOTE) image.o \ + ../images/ramdisk.image.gz + $(OBJCOPY) image.o image-elf.o \ + --add-section=.ramdisk=../images/ramdisk.image.gz \ + --set-section-flags=.ramdisk=contents,alloc,load,readonly,data + $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) $(LIBS) image-elf.o $(MKNOTE) > note - $(OBJCOPY) ../images/$@ ../images/$@ --add-section=.note=note -R .comment - rm -f note + $(OBJCOPY) ../images/$@ ../images/$@ --add-section=.note=note \ + -R .comment + rm -f note image-elf.o zImage: vmlinux.coff vmlinux.elf-pmac miboot.image diff -urN linux-2.4.18/arch/ppc/boot/pmac/chrpmain.c linuxppc-2.4.18/arch/ppc/boot/pmac/chrpmain.c --- linux-2.4.18/arch/ppc/boot/pmac/chrpmain.c Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/pmac/chrpmain.c Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.chrpmain.c 1.16 07/27/01 20:24:18 trini + * BK Id: SCCS/s.chrpmain.c 1.18 01/11/02 10:46:07 trini */ /* * Copyright (C) Paul Mackerras 1997. @@ -10,15 +10,17 @@ * 2 of the License, or (at your option) any later version. */ #include "nonstdio.h" -#include "zlib.h" #include +#include + +/* Passed from the linker */ +extern char __image_begin, __image_end; +extern char __ramdisk_begin[], __ramdisk_end; +extern char _start, _end; -extern char _end[]; -extern char image_data[], initrd_data[]; -extern int image_len, initrd_len; extern int getprop(void *, const char *, void *, int); extern unsigned int heap_max; -extern void *claim(unsigned int, unsigned int, unsigned int); +extern void *claim(unsigned int virt, unsigned int size, unsigned int align); extern void *finddevice(const char *); extern void flush_cache(void *start, unsigned int len); extern void gunzip(void *, int, unsigned char *, int *); @@ -45,21 +47,23 @@ void *dst; unsigned char *im; unsigned initrd_start, initrd_size; - extern char _start; printf("chrpboot starting: loaded at 0x%p\n", &_start); - if (initrd_len) { - initrd_size = initrd_len; + + initrd_size = (char *)(&__ramdisk_end) - (char *)(&__ramdisk_begin); + if (initrd_size) { initrd_start = (RAM_END - initrd_size) & ~0xFFF; a1 = initrd_start; a2 = initrd_size; claim(initrd_start, RAM_END - initrd_start, 0); - printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n", initrd_start, - initrd_data,initrd_size); - memcpy((char *)initrd_start, initrd_data, initrd_size); - } - im = image_data; - len = image_len; + printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n\r", + initrd_start, (char *)(&__ramdisk_begin), initrd_size); + memcpy((char *)initrd_start, (char *)(&__ramdisk_begin), initrd_size); + } else + a2 = 0xdeadbeef; + + im = (char *)(&__image_begin); + len = (char *)(&__image_end) - (char *)(&__image_begin); /* claim 3MB starting at PROG_START */ claim(PROG_START, PROG_SIZE, 0); dst = (void *) PROG_START; diff -urN linux-2.4.18/arch/ppc/boot/pmac/coffmain.c linuxppc-2.4.18/arch/ppc/boot/pmac/coffmain.c --- linux-2.4.18/arch/ppc/boot/pmac/coffmain.c Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/pmac/coffmain.c Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.coffmain.c 1.14 07/27/01 20:24:18 trini + * BK Id: SCCS/s.coffmain.c 1.15 01/11/02 10:46:07 trini */ /* * Copyright (C) Paul Mackerras 1997. @@ -9,11 +9,17 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include +#include + #include "nonstdio.h" #include "zlib.h" -#include -extern char _start[], _end[]; +/* Passed from the linker */ +extern char __image_begin, __image_end; +extern char __ramdisk_begin[], __ramdisk_end; +extern char _start, _end; + extern char *claim(unsigned, unsigned, unsigned); extern char image_data[], initrd_data[]; extern int initrd_len, image_len; @@ -50,18 +56,21 @@ printf("coffboot starting: loaded at 0x%p\n", &_start); setup_bats(RAM_START); - if (initrd_len) { - initrd_size = initrd_len; + + initrd_size = (char *)(&__ramdisk_end) - (char *)(&__ramdisk_begin); + if (initrd_size) { initrd_start = (RAM_END - initrd_size) & ~0xFFF; a1 = initrd_start; a2 = initrd_size; - claim(initrd_start - RAM_START, RAM_END - initrd_start, 0); - printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n", - initrd_start, initrd_data, initrd_size); - memcpy((char *)initrd_start, initrd_data, initrd_size); - } - im = image_data; - len = image_len; + claim(initrd_start, RAM_END - initrd_start, 0); + printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n\r", + initrd_start, (char *)(&__ramdisk_begin), initrd_size); + memcpy((char *)initrd_start, (char *)(&__ramdisk_begin), initrd_size); + } else + a2 = 0xdeadbeef; + + im = (char *)(&__image_begin); + len = (char *)(&__image_end) - (char *)(&__image_begin); /* claim 4MB starting at 0 */ claim(0, PROG_SIZE, 0); dst = (void *) RAM_START; diff -urN linux-2.4.18/arch/ppc/boot/pmac/dummy.c linuxppc-2.4.18/arch/ppc/boot/pmac/dummy.c --- linux-2.4.18/arch/ppc/boot/pmac/dummy.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/pmac/dummy.c Thu Jan 1 10:00:00 1970 @@ -1,7 +0,0 @@ -/* - * BK Id: SCCS/s.dummy.c 1.6 05/18/01 15:17:15 cort - */ -int main(void) -{ - return 0; -} diff -urN linux-2.4.18/arch/ppc/boot/pmac/ld.script linuxppc-2.4.18/arch/ppc/boot/pmac/ld.script --- linux-2.4.18/arch/ppc/boot/pmac/ld.script Wed Jul 4 14:33:18 2001 +++ linuxppc-2.4.18/arch/ppc/boot/pmac/ld.script Thu Jan 1 10:00:00 1970 @@ -1,69 +0,0 @@ -OUTPUT_ARCH(powerpc) -SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; */ -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - . = + SIZEOF_HEADERS; - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .rel.text : { *(.rel.text) } - .rela.text : { *(.rela.text) } - .rel.data : { *(.rel.data) } - .rela.data : { *(.rela.data) } - .rel.rodata : { *(.rel.rodata) } - .rela.rodata : { *(.rela.rodata) } - .rel.got : { *(.rel.got) } - .rela.got : { *(.rela.got) } - .rel.ctors : { *(.rel.ctors) } - .rela.ctors : { *(.rela.ctors) } - .rel.dtors : { *(.rel.dtors) } - .rela.dtors : { *(.rela.dtors) } - .rel.bss : { *(.rel.bss) } - .rela.bss : { *(.rela.bss) } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } - .init : { *(.init) } =0 - .plt : { *(.plt) } - .text : - { - *(.text) - *(.rodata) - *(.rodata.*) - *(.rodata1) - *(.got1) - } - .fini : { *(.fini) } =0 - .ctors : { *(.ctors) } - .dtors : { *(.dtors) } - _etext = .; - PROVIDE (etext = .); - /* Read-write section, merged into data segment: */ - . = (. + 0x0FFF) & 0xFFFFF000; - .data : - { - *(.data) - *(.data1) - *(.sdata) - *(.sdata2) - *(.got.plt) *(.got) - *(.dynamic) - CONSTRUCTORS - } - _edata = .; - PROVIDE (edata = .); - __bss_start = .; - .bss : - { - *(.sbss) *(.scommon) - *(.dynbss) - *(.bss) - *(COMMON) - } - _end = . ; - PROVIDE (end = .); -} - diff -urN linux-2.4.18/arch/ppc/boot/pmac/misc.S linuxppc-2.4.18/arch/ppc/boot/pmac/misc.S --- linux-2.4.18/arch/ppc/boot/pmac/misc.S Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/pmac/misc.S Thu Mar 7 10:51:49 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.misc.S 1.6 05/18/01 15:17:15 cort + * BK Id: SCCS/s.misc.S 1.7 06/05/01 20:20:05 paulus */ /* * Copyright (C) Paul Mackerras 1997. diff -urN linux-2.4.18/arch/ppc/boot/pmac/start.c linuxppc-2.4.18/arch/ppc/boot/pmac/start.c --- linux-2.4.18/arch/ppc/boot/pmac/start.c Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/pmac/start.c Thu Mar 7 10:52:23 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.start.c 1.10 07/25/01 18:13:07 trini + * BK Id: SCCS/s.start.c 1.11 08/29/01 08:49:23 paulus */ /* * Copyright (C) Paul Mackerras 1997. diff -urN linux-2.4.18/arch/ppc/boot/prep/Makefile linuxppc-2.4.18/arch/ppc/boot/prep/Makefile --- linux-2.4.18/arch/ppc/boot/prep/Makefile Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/prep/Makefile Thu Mar 7 10:52:21 2002 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.28 10/21/01 20:47:58 trini +# BK Id: SCCS/s.Makefile 1.30 01/26/02 12:27:41 trini # # arch/ppc/boot/Makefile # @@ -17,16 +17,15 @@ USE_STANDARD_AS_RULE := true -ifeq ($(CONFIG_SMP),y) -TFTPIMAGE = /tftpboot/zImage.prep.smp -else TFTPIMAGE = /tftpboot/zImage.prep +ifeq ($(CONFIG_SMP),y) +TFTPIMAGE = $(TFTPBOOT).smp endif -ZLINKFLAGS = -T $(TOPDIR)/arch/$(ARCH)/vmlinux.lds \ - -Ttext 0x00800000 -obj-y := head.o misc.o ../common/misc-common.o \ - ../common/string.o of1275.o +LD_ARGS = -T ../ld.script -Ttext 0x00800000 -Bstatic +obj-y := head.o ../simple/legacy.o misc.o of1275.o \ + ../common/util.o ../common/string.o \ + ../common/misc-common.o OBJCOPY_ARGS = -O elf32-powerpc LIBS = ../lib/zlib.a @@ -38,69 +37,38 @@ SIZE := ../utils/size OFFSET := ../utils/offset -all: zImage +# 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 -misc.o: misc.c - $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 -DZIMAGE_OFFSET=0 \ - -DZIMAGE_SIZE=0 -c -o $@ $*.c +all: zImage -zvmlinux.initrd: $(obj-y) $(LIBS) ../images/vmlinux.gz -# -# Recompile misc.oagain with more 'correct' bogus offsets -# - $(CC) $(CFLAGS) -DINITRD_OFFSET=0x00138466 -DINITRD_SIZE=0x0000111a \ - -DZIMAGE_OFFSET=0x0001b000 -DZIMAGE_SIZE=0x0011d460 \ - -c -o misc.o misc.c - $(LD) $(ZLINKFLAGS) -o $@.tmp $(obj-y) $(LIBS) - $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ - --add-section=initrd=../images/ramdisk.image.gz \ - --add-section=image=../images/vmlinux.gz \ - $@.tmp $@ - $(CC) $(CFLAGS) -DINITRD_OFFSET=`sh $(OFFSET) $(OBJDUMP) $@ initrd` \ - -DINITRD_SIZE=`sh $(SIZE) $(OBJDUMP) $@ initrd` \ - -DZIMAGE_OFFSET=`sh $(OFFSET) $(OBJDUMP) $@ image` \ - -DZIMAGE_SIZE=`sh $(SIZE) $(OBJDUMP) $@ image` \ - -c -o misc.o misc.c - $(LD) $(ZLINKFLAGS) -o $@.tmp $(obj-y) $(LIBS) +zImage: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz ../common/dummy.o \ + $(MKPREP) $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ - --add-section=initrd=../images/ramdisk.image.gz \ - --add-section=image=../images/vmlinux.gz \ - $@.tmp $@ - rm -f $@.tmp - -zImage: zvmlinux $(MKPREP) - $(MKPREP) -pbp zvmlinux ../images/$@.prep - rm -f zvmlinux - -zImage.initrd: zvmlinux.initrd $(MKPREP) - $(MKPREP) -pbp zvmlinux.initrd ../images/$@.prep - rm -f zvmlinux.initrd + --add-section=.image=../images/vmlinux.gz \ + --set-section-flags=.image=contents,alloc,load,readonly,data \ + ../common/dummy.o image.o + $(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS) + $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr + $(MKPREP) -pbp $@ ../images/$@.prep + rm -f $@ -zvmlinux: $(obj-y) $(LIBS) ../images/vmlinux.gz -# -# Recompile misc.oagain with more 'correct' bogus offsets -# - $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 \ - -DZIMAGE_OFFSET=0x0001b000 -DZIMAGE_SIZE=0x0011d460 \ - -c -o misc.o misc.c -# -# build the boot loader image and then compute the offset into it -# for the kernel image -# - $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(obj-y) $(LIBS) - $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ - --add-section=image=../images/vmlinux.gz zvmlinux.tmp $@ -# -# then with the offset rebuild the bootloader so we know where the kernel is -# - $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 \ - -DZIMAGE_OFFSET=`sh $(OFFSET) $(OBJDUMP) zvmlinux image` \ - -DZIMAGE_SIZE=`sh $(SIZE) $(OBJDUMP) zvmlinux image` \ - -c -o misc.o misc.c - $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(obj-y) $(LIBS) +zImage.initrd: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz $(MKPREP) \ + ../common/dummy.o $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ - --add-section=image=../images/vmlinux.gz $@.tmp $@ - rm -f $@.tmp + --add-section=.ramdisk=../images/ramdisk.image.gz \ + --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \ + --add-section=.image=../images/vmlinux.gz \ + --set-section-flags=.image=contents,alloc,load,readonly,data \ + ../common/dummy.o image.o + $(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS) + $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr + $(MKPREP) -pbp $@ ../images/$@.prep + rm -f $@ floppy: zImage dd if=../images/zImage.prep of=/dev/fd0H1440 bs=64b diff -urN linux-2.4.18/arch/ppc/boot/prep/head.S linuxppc-2.4.18/arch/ppc/boot/prep/head.S --- linux-2.4.18/arch/ppc/boot/prep/head.S Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/prep/head.S Thu Mar 7 10:51:41 2002 @@ -1,8 +1,8 @@ /* - * BK Id: SCCS/s.head.S 1.11 07/31/01 16:36:06 trini + * BK Id: SCCS/s.head.S 1.13 01/11/02 10:46:07 trini */ -#include "../../kernel/ppc_defs.h" -#include "../../kernel/ppc_asm.tmpl" + +#include "ppc_asm.h" #include #include @@ -22,34 +22,49 @@ start: bl start_ start_: + + /* Enable, invalidate, Disable L1 icache/dcache */ + li r8, 0 + ori r8, r8, (HID0_ICE|HID0_DCE|HID0_ICFI|HID0_DCI) + mfspr r11,HID0 + or r11,r11,r8 + andc r10,r11,r8 + isync + mtspr HID0,r8 + sync + isync + mtspr HID0,r10 + sync + isync + mr r11,r3 /* Save pointer to residual/board data */ - mr r25,r5 /* Save OFW pointer */ - li r3,MSR_IP /* Establish default MSR value */ + mr r25,r5 /* Save OFW pointer */ + + /* Save the original MSR value */ + mfmsr r26 + + /* Establish default MSR value */ + li r3,MSR_IP|MSR_FP mtmsr r3 -/* check if we need to relocate ourselves to the link addr or were we - loaded there to begin with -- Cort */ - lis r4,start@h - ori r4,r4,start@l - mflr r3 - subi r3,r3,4 /* we get the nip, not the ip of the branch */ - mr r8,r3 - cmp 0,r3,r4 - bne 1010f -/* compute size of whole image in words. this should be moved to - * start_ldr() -- Cort - */ + /* compute the size of the whole image in words. */ lis r4,start@h ori r4,r4,start@l lis r5,end@h ori r5,r5,end@l addi r5,r5,3 /* round up */ - sub r5,r5,r4 + sub r5,r5,r4 /* end - start */ srwi r5,r5,2 - mr r7,r5 - b start_ldr -1010: -/* + mr r7,r5 /* Save for later use. */ + + /* check if we need to relocate ourselves to the link addr or were + * we loaded there to begin with -- Cort */ + mflr r3 + subi r3,r3,4 /* we get the nip, not the ip of the branch */ + mr r8,r3 + cmp 0,r3,r4 + beq start_ldr /* If 0, we don't need to relocate */ +/* * no matter where we're loaded, move ourselves to -Ttext address */ relocate: @@ -58,15 +73,10 @@ mr r8,r3 lis r4,start@h ori r4,r4,start@l - lis r5,end@h - ori r5,r5,end@l - addi r5,r5,3 /* Round up - just in case */ - sub r5,r5,r4 /* Compute # longwords to move */ - srwi r5,r5,2 - mtctr r5 - mr r7,r5 + mr r5,r7 /* Get the # of longwords again */ + mtctr r5 /* Setup for loop */ li r6,0 - subi r3,r3,4 /* Set up for loop */ + subi r3,r3,4 subi r4,r4,4 00: lwzu r5,4(r3) stwu r5,4(r4) @@ -74,9 +84,17 @@ bdnz 00b lis r3,start_ldr@h ori r3,r3,start_ldr@l - mtlr r3 /* Easiest way to do an absolute jump */ + mtlr r3 /* Easiest way to do an absolute jump */ blr + start_ldr: +/* Some boards don't boot up with the I-cache enabled. Do that + * now because the decompress runs much faster that way. + * As a side effect, we have to ensure the data cache is not enabled + * so we can access the serial I/O without trouble. + */ + bl flush_instruction_cache + /* Clear all of BSS */ lis r3,edata@h ori r3,r3,edata@l @@ -95,11 +113,12 @@ subi r1,r1,256 li r2,0x000F /* Mask pointer to 16-byte boundary */ andc r1,r1,r2 -/* Setup ISA_io */ - lis r3,ISA_io@h - ori r3,r3,ISA_io@l - lis r4,0x8000 - stw r4,0(r3) + + /* 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 */ @@ -107,147 +126,61 @@ mr r6,r11 /* Residual data */ mr r7,r25 /* OFW interfaces */ bl decompress_kernel - - /* changed to use r3 (as firmware does) for kernel - as ptr to residual -- Cort*/ - lis r6,cmd_line@h - ori r6,r6,cmd_line@l - lwz r6, 0(r6) - subi r7,r6,1 -00: lbzu r2,1(r7) - cmpi 0,r2,0 - bne 00b - - /* r4,r5 have initrd_start, size */ - lis r2,initrd_start@h - ori r2,r2,initrd_start@l - lwz r4,0(r2) - lis r2,initrd_end@h - ori r2,r2,initrd_end@l - lwz r5,0(r2) - - - /* tell kernel we're prep */ - /* - * get start address of kernel code which is stored as a coff - * entry. see boot/head.S -- Cort + + /* + * We have to do this after decompress_kernel, just to make + * sure we don't wipe out things mapped in BATs which we need. + * -- Tom */ - li r9,0x4 + li r6,0 + /* Test for a 601 */ + mfspr r9,PVR + srwi r9,r9,16 + cmpi 0,r9,1 /* 601 ? */ + beq .clearbats_601 + + /* Clear BATS */ + mtspr DBAT0U,r6 + mtspr DBAT0L,r6 + mtspr DBAT1U,r6 + mtspr DBAT1L,r6 + mtspr DBAT2U,r6 + mtspr DBAT2L,r6 + mtspr DBAT3U,r6 + mtspr DBAT3L,r6 +.clearbats_601: + mtspr IBAT0U,r6 + mtspr IBAT0L,r6 + mtspr IBAT1U,r6 + mtspr IBAT1L,r6 + mtspr IBAT2U,r6 + mtspr IBAT2L,r6 + mtspr IBAT3U,r6 + mtspr IBAT3L,r6 + isync + sync + sync + + /* Set segment registers */ + li r6,16 /* load up segment register values */ + mtctr r6 /* for context 0 */ + lis r6,0x2000 /* Ku = 1, VSID = 0 */ + li r10,0 +3: mtsrin r6,r10 + addi r6,r6,0x111 /* increment VSID */ + addis r10,r10,0x1000 /* address of next segment */ + bdnz 3b + + /* tell kernel we're prep, by putting 0xdeadc0de at KERNELLOAD, + * and tell the kernel to start on the 4th instruction since we + * overwrite the first 3 sometimes (which are 'nop'). + */ + li r9,0xc mtlr r9 lis r10,0xdeadc0de@h ori r10,r10,0xdeadc0de@l li r9,0 stw r10,0(r9) -/* - * The Radstone firmware maps PCI memory at 0xc0000000 using BAT2 - * so disable BATs before setting this to avoid a clash - */ - li r8,0 - mtspr DBAT0U,r8 - mtspr DBAT1U,r8 - mtspr DBAT2U,r8 - mtspr DBAT3U,r8 - mtspr IBAT0U,r8 - mtspr IBAT1U,r8 - mtspr IBAT2U,r8 - mtspr IBAT3U,r8 - - blr -hang: - b hang - -/* - * Delay for a number of microseconds - * -- Use the BUS timer (assumes 66MHz) - */ - .globl udelay -udelay: - mfspr r4,PVR - srwi r4,r4,16 - cmpi 0,r4,1 /* 601 ? */ - bne .udelay_not_601 -00: li r0,86 /* Instructions / microsecond? */ - mtctr r0 -10: addi r0,r0,0 /* NOP */ - bdnz 10b - subic. r3,r3,1 - bne 00b - blr - -.udelay_not_601: - mulli r4,r3,1000 /* nanoseconds */ - addi r4,r4,59 - li r5,60 - divw r4,r4,r5 /* BUS ticks */ -1: mftbu r5 - mftb r6 - mftbu r7 - cmp 0,r5,r7 - bne 1b /* Get [synced] base time */ - addc r9,r6,r4 /* Compute end time */ - addze r8,r5 -2: mftbu r5 - cmp 0,r5,r8 - blt 2b - bgt 3f - mftb r6 - cmp 0,r6,r9 - blt 2b -3: blr - -.globl _get_HID0 -_get_HID0: - mfspr r3,HID0 - blr - -.globl _put_HID0 -_put_HID0: - mtspr HID0,r3 - blr - -.globl _get_MSR -_get_MSR: - mfmsr r3 - blr - -.globl _put_MSR -_put_MSR: - mtmsr r3 blr -/* - * Flush instruction cache - * *** I'm really paranoid here! - */ -_GLOBAL(flush_instruction_cache) - mflr r5 - bl flush_data_cache - mfspr r3,HID0 /* Caches are controlled by this register */ - li r4,0 - ori r4,r4,(HID0_ICE|HID0_ICFI) - or r3,r3,r4 /* Need to enable+invalidate to clear */ - mtspr HID0,r3 - andc r3,r3,r4 - ori r3,r3,HID0_ICE /* Enable cache */ - mtspr HID0,r3 - mtlr r5 - blr - -#define NUM_CACHE_LINES 128*8 -#define CACHE_LINE_SIZE 32 -#define cache_flush_buffer 0x1000 - -/* - * Flush data cache - * *** I'm really paranoid here! - */ -_GLOBAL(flush_data_cache) - lis r3,cache_flush_buffer@h - ori r3,r3,cache_flush_buffer@l - li r4,NUM_CACHE_LINES - mtctr r4 -00: lwz r4,0(r3) - addi r3,r3,CACHE_LINE_SIZE /* Next line, please */ - bdnz 00b -10: blr .comm .stack,4096*2,4 diff -urN linux-2.4.18/arch/ppc/boot/prep/iso_font.h linuxppc-2.4.18/arch/ppc/boot/prep/iso_font.h --- linux-2.4.18/arch/ppc/boot/prep/iso_font.h Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/prep/iso_font.h Thu Mar 7 10:52:18 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.iso_font.h 1.6 05/18/01 15:16:42 cort + * BK Id: SCCS/s.iso_font.h 1.7 06/05/01 20:20:05 paulus */ static const unsigned char font[] = { /* 0x00 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, diff -urN linux-2.4.18/arch/ppc/boot/prep/kbd.c linuxppc-2.4.18/arch/ppc/boot/prep/kbd.c --- linux-2.4.18/arch/ppc/boot/prep/kbd.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/prep/kbd.c Thu Mar 7 10:52:08 2002 @@ -1,9 +1,10 @@ /* - * BK Id: SCCS/s.kbd.c 1.7 05/18/01 06:20:29 patch + * BK Id: SCCS/s.kbd.c 1.9 01/11/02 10:46:07 trini */ + #include -#include <../drivers/char/defkeymap.c> /* yeah I know it's bad -- Cort */ +#include "defkeymap.c" /* yeah I know it's bad -- Cort */ unsigned char shfts, ctls, alts, caps; @@ -130,20 +131,29 @@ goto loop; } -static void kbdreset(void) +static int __kbdreset(void) { unsigned char c; - int i; + int i, t; /* flush input queue */ + t = 2000; while ((inb(KBSTATP) & KBINRDY)) { (void)inb(KBDATAP); + if (--t == 0) + return 1; } /* Send self-test */ - while (inb(KBSTATP) & KBOUTRDY) ; + t = 20000; + while (inb(KBSTATP) & KBOUTRDY) + if (--t == 0) + return 2; outb(KBSTATP,0xAA); - while ((inb(KBSTATP) & KBINRDY) == 0) ; /* wait input ready */ + t = 200000; + while ((inb(KBSTATP) & KBINRDY) == 0) /* wait input ready */ + if (--t == 0) + return 3; if ((c = inb(KBDATAP)) != 0x55) { puts("Keyboard self test failed - result:"); @@ -151,15 +161,23 @@ puts("\n"); } /* Enable interrupts and keyboard controller */ - while (inb(KBSTATP) & KBOUTRDY) ; - outb(KBSTATP,0x60); - while (inb(KBSTATP) & KBOUTRDY) ; + t = 20000; + while (inb(KBSTATP) & KBOUTRDY) + if (--t == 0) return 4; + outb(KBSTATP,0x60); + t = 20000; + while (inb(KBSTATP) & KBOUTRDY) + if (--t == 0) return 5; outb(KBDATAP,0x45); for (i = 0; i < 10000; i++) udelay(1); - - while (inb(KBSTATP) & KBOUTRDY) ; + + t = 20000; + while (inb(KBSTATP) & KBOUTRDY) + if (--t == 0) return 6; outb(KBSTATP,0x20); - while ((inb(KBSTATP) & KBINRDY) == 0) ; /* wait input ready */ + t = 200000; + while ((inb(KBSTATP) & KBINRDY) == 0) /* wait input ready */ + if (--t == 0) return 7; if (! (inb(KBDATAP) & 0x40)) { /* * Quote from PS/2 System Reference Manual: @@ -169,15 +187,31 @@ * output-buffer-full bit in the Controller Status * register are set 0." (KBINRDY and KBOUTRDY) */ - - while (inb(KBSTATP) & (KBINRDY | KBOUTRDY)) ; + t = 200000; + while (inb(KBSTATP) & (KBINRDY | KBOUTRDY)) + if (--t == 0) return 8; outb(KBDATAP,0xF0); - while (inb(KBSTATP) & (KBINRDY | KBOUTRDY)) ; + t = 200000; + while (inb(KBSTATP) & (KBINRDY | KBOUTRDY)) + if (--t == 0) return 9; outb(KBDATAP,0x01); } - - while (inb(KBSTATP) & KBOUTRDY) ; + t = 20000; + while (inb(KBSTATP) & KBOUTRDY) + if (--t == 0) return 10; outb(KBSTATP,0xAE); + return 0; +} + +static void kbdreset(void) +{ + int ret = __kbdreset(); + + if (ret) { + puts("__kbdreset failed: "); + puthex(ret); + puts("\n"); + } } /* We have to actually read the keyboard when CRT_tstc is called, diff -urN linux-2.4.18/arch/ppc/boot/prep/misc.c linuxppc-2.4.18/arch/ppc/boot/prep/misc.c --- linux-2.4.18/arch/ppc/boot/prep/misc.c Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/prep/misc.c Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.misc.c 1.22 10/15/01 17:46:21 trini + * BK Id: SCCS/s.misc.c 1.25 01/26/02 12:27:41 trini * * arch/ppc/boot/prep/misc.c * @@ -32,12 +32,16 @@ */ char *avail_ram; char *end_avail; + +/* The linker tells us where the image is. */ +extern char __image_begin, __image_end; +extern char __ramdisk_begin, __ramdisk_end; extern char _end[]; #ifdef CONFIG_CMDLINE #define CMDLINE CONFIG_CMDLINE #else -#define CMDLINE ""; +#define CMDLINE "" #endif char cmd_preset[] = CMDLINE; char cmd_buf[256]; @@ -46,7 +50,8 @@ int keyb_present = 1; /* keyboard controller is present by default */ RESIDUAL hold_resid_buf; RESIDUAL *hold_residual = &hold_resid_buf; -unsigned long initrd_start = 0, initrd_end = 0; +unsigned long initrd_size = 0; +unsigned long orig_MSR; char *zimage_start; int zimage_size; @@ -63,16 +68,14 @@ 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, +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_HID0(unsigned int val); extern void _put_MSR(unsigned int val); -extern unsigned int _get_HID0(void); -extern unsigned int _get_MSR(void); -extern unsigned long serial_init(int chan); +extern unsigned long serial_init(int chan, void *ignored); +extern void setup_legacy(void); void writel(unsigned int val, unsigned int address) @@ -82,7 +85,7 @@ *(unsigned int *)address = cpu_to_le32(val); } -unsigned int +unsigned int readl(unsigned int address) { /* Ensure I/O operations complete */ @@ -90,8 +93,8 @@ return le32_to_cpu(*(unsigned int *)address); } -#define PCI_CFG_ADDR(dev,off) ((0x80<<24) | (dev<<8) | (off&0xfc)) -#define PCI_CFG_DATA(off) (0x80000cfc+(off&3)) +#define PCI_CFG_ADDR(dev,off) ((0x80<<24) | (dev<<8) | (off&0xfc)) +#define PCI_CFG_DATA(off) (0x80000cfc+(off&3)) static void pci_read_config_32(unsigned char devfn, @@ -115,38 +118,14 @@ } #endif /* CONFIG_VGA_CONSOLE */ -/* - * This routine is used to control the second processor on the - * Motorola dual processor platforms. - */ -void -park_cpus(void) -{ - volatile void (*go)(RESIDUAL *, int, int, char *, int); - unsigned int i; - volatile unsigned long *smp_iar = &(hold_residual->VitalProductData.SmpIar); - - /* Wait for indication to continue. If the kernel - was not compiled with SMP support then the second - processor will spin forever here makeing the kernel - multiprocessor safe. */ - while (*smp_iar == 0) { - for (i=0; i < 512; i++); - } - - (unsigned long)go = hold_residual->VitalProductData.SmpIar; - go(hold_residual, 0, 0, cmd_line, sizeof(cmd_preset)); -} - unsigned long decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, RESIDUAL *residual, void *OFW_interface) { - int timer; + int timer = 0; extern unsigned long start; char *cp, ch; unsigned long TotalMemory; - unsigned long orig_MSR; int dev_handle; int mem_info[2]; int res, size; @@ -154,26 +133,42 @@ unsigned char base_mod; int start_multi = 0; unsigned int pci_viddid, pci_did, tulip_pci_base, tulip_base; - - /* - * IBM's have the MMU on, so we have to disable it or - * things get really unhappy in the kernel when - * trying to setup the BATs with the MMU on - * -- Cort - */ - flush_instruction_cache(); - _put_HID0(_get_HID0() & ~0x0000C000); - _put_MSR((orig_MSR = _get_MSR()) & ~0x0030); + setup_legacy(); #if defined(CONFIG_SERIAL_CONSOLE) - com_port = serial_init(0); + com_port = serial_init(0, NULL); #endif /* CONFIG_SERIAL_CONSOLE */ #if defined(CONFIG_VGA_CONSOLE) vga_init((unsigned char *)0xC0000000); #endif /* CONFIG_VGA_CONSOLE */ - if (residual) - { + /* + * Tell the user where we were loaded at and where we were relocated + * to for debugging this process. + */ + puts("loaded at: "); puthex(load_addr); + puts(" "); puthex((unsigned long)(load_addr + (4*num_words))); puts("\n"); + if ( (unsigned long)load_addr != (unsigned long)&start ) { + puts("relocated to: "); puthex((unsigned long)&start); + puts(" "); + puthex((unsigned long)((unsigned long)&start + (4*num_words))); + puts("\n"); + } + + if (residual) { + /* + * Tell the user where the residual data is. + */ + puts("board data at: "); puthex((unsigned long)residual); + puts(" "); + puthex((unsigned long)((unsigned long)residual + + sizeof(RESIDUAL))); + puts("\nrelocated to: ");puthex((unsigned long)hold_residual); + puts(" "); + puthex((unsigned long)((unsigned long)hold_residual + + sizeof(RESIDUAL))); + puts("\n"); + /* Is this Motorola PPCBug? */ if ((1 & residual->VitalProductData.FirmwareSupports) && (1 == residual->VitalProductData.FirmwareSupplier)) { @@ -190,8 +185,7 @@ ((pci_did == PCI_DEVICE_ID_DEC_TULIP_FAST) || (pci_did == PCI_DEVICE_ID_DEC_TULIP) || (pci_did == PCI_DEVICE_ID_DEC_TULIP_PLUS) || - (pci_did == PCI_DEVICE_ID_DEC_21142))) - { + (pci_did == PCI_DEVICE_ID_DEC_21142))) { pci_read_config_32(0x70, 0x10, &tulip_pci_base); @@ -205,7 +199,7 @@ /* If this is genesis 2 board then check for no * keyboard controller and more than one processor. */ - if (board_type == 0xe0) { + if (board_type == 0xe0) { base_mod = inb(0x803); /* if a MVME2300/2400 or a Sitka then no keyboard */ if((base_mod == 0xFA) || (base_mod == 0xF9) || @@ -217,14 +211,17 @@ * park the other processor so that the * kernel knows where to find them. */ - if (residual->MaxNumCpus > 1) { + if (residual->MaxNumCpus > 1) start_multi = 1; - } } memcpy(hold_residual,residual,sizeof(RESIDUAL)); } 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 @@ -232,116 +229,66 @@ */ while (OFW_interface && ((unsigned long)OFW_interface < 0x10000000) ) { - /* The MMU needs to be on when we call OFW */ + /* 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", + res = of_finddevice("/memory@0", &dev_handle); - // puthex(res); puts("\n"); - if (res) break; - + if (res) + break; + /* get the info */ - // puts("get info = "); - res = of_getprop(dev_handle, - "reg", - mem_info, - sizeof(mem_info), + res = of_getprop(dev_handle, + "reg", + mem_info, + sizeof(mem_info), &size); - // puthex(res); puts(", info = "); puthex(mem_info[0]); - // puts(" "); puthex(mem_info[1]); puts("\n"); - if (res) break; - + if (res) + break; + TotalMemory = mem_info[1]; break; } + hold_residual->TotalMemory = TotalMemory; residual = hold_residual; - /* Turn MMU back off */ - _put_MSR(orig_MSR & ~0x0030); - } - if (start_multi) { - hold_residual->VitalProductData.SmpIar = 0; - hold_residual->Cpus[1].CpuState = CPU_GOOD_FW; - residual->VitalProductData.SmpIar = (unsigned long)park_cpus; - residual->Cpus[1].CpuState = CPU_GOOD; - hold_residual->VitalProductData.Reserved5 = 0xdeadbeef; - } + /* Enforce a sane MSR for booting. */ + _put_MSR(MSR_IP); + } /* assume the chunk below 8M is free */ end_avail = (char *)0x00800000; - /* tell the user where we were loaded at and where we - * were relocated to for debugging this process + /* + * We link ourself to 0x00800000. When we run, we relocate + * ourselves there. So we just need __image_begin for the + * start. -- Tom */ - puts("loaded at: "); puthex(load_addr); - puts(" "); puthex((unsigned long)(load_addr + (4*num_words))); puts("\n"); - if ( (unsigned long)load_addr != (unsigned long)&start ) - { - puts("relocated to: "); puthex((unsigned long)&start); - puts(" "); - puthex((unsigned long)((unsigned long)&start + (4*num_words))); - puts("\n"); - } - - if ( residual ) - { - puts("board data at: "); puthex((unsigned long)residual); - puts(" "); - puthex((unsigned long)((unsigned long)residual + sizeof(RESIDUAL))); - puts("\n"); - puts("relocated to: "); - puthex((unsigned long)hold_residual); - puts(" "); - puthex((unsigned long)((unsigned long)hold_residual + sizeof(RESIDUAL))); - puts("\n"); - } + zimage_start = (char *)(unsigned long)(&__image_begin); + zimage_size = (unsigned long)(&__image_end) - + (unsigned long)(&__image_begin); - /* we have to subtract 0x10000 here to correct for objdump including the - size of the elf header which we strip -- Cort */ - zimage_start = (char *)(load_addr - 0x10000 + ZIMAGE_OFFSET); - zimage_size = ZIMAGE_SIZE; - - if ( INITRD_OFFSET ) - initrd_start = load_addr - 0x10000 + INITRD_OFFSET; - else - initrd_start = 0; - initrd_end = INITRD_SIZE + initrd_start; + initrd_size = (unsigned long)(&__ramdisk_end) - + (unsigned long)(&__ramdisk_begin); /* - * Find a place to stick the zimage and initrd and - * relocate them if we have to. -- Cort + * The zImage and initrd will be between start and _end, so they've + * already been moved once. We're good to go now. -- Tom */ avail_ram = (char *)PAGE_ALIGN((unsigned long)_end); puts("zimage at: "); puthex((unsigned long)zimage_start); - puts(" "); puthex((unsigned long)(zimage_size+zimage_start)); puts("\n"); - if ( (unsigned long)zimage_start <= 0x00800000 ) - { - memcpy( (void *)avail_ram, (void *)zimage_start, zimage_size ); - zimage_start = (char *)avail_ram; - puts("relocated to: "); puthex((unsigned long)zimage_start); - puts(" "); - puthex((unsigned long)zimage_size+(unsigned long)zimage_start); - puts("\n"); + puts(" "); puthex((unsigned long)(zimage_size+zimage_start)); + puts("\n"); - /* relocate initrd */ - if ( initrd_start ) - { - puts("initrd at: "); puthex(initrd_start); - puts(" "); puthex(initrd_end); puts("\n"); - avail_ram = (char *)PAGE_ALIGN( - (unsigned long)zimage_size+(unsigned long)zimage_start); - memcpy ((void *)avail_ram, (void *)initrd_start, INITRD_SIZE ); - initrd_start = (unsigned long)avail_ram; - initrd_end = initrd_start + INITRD_SIZE; - puts("relocated to: "); puthex(initrd_start); - puts(" "); puthex(initrd_end); puts("\n"); - } - } else if ( initrd_start ) { - puts("initrd at: "); puthex(initrd_start); - puts(" "); puthex(initrd_end); puts("\n"); + if ( initrd_size ) { + puts("initrd at: "); + puthex((unsigned long)(&__ramdisk_begin)); + puts(" "); puthex((unsigned long)(&__ramdisk_end));puts("\n"); } avail_ram = (char *)0x00400000; @@ -353,10 +300,10 @@ CRT_tstc(); /* Forces keyboard to be initialized */ puts("\nLinux/PPC load: "); - timer = 0; cp = cmd_line; memcpy (cmd_line, cmd_preset, sizeof(cmd_preset)); - while ( *cp ) putc(*cp++); + while ( *cp ) + putc(*cp++); while (timer++ < 5*1000) { if (tstc()) { while ((ch = getc()) != '\n' && ch != '\r') { @@ -382,26 +329,24 @@ udelay(1000); /* 1 msec */ } *cp = 0; - puts("\n"); + puts("\nUncompressing Linux..."); - /* mappings on early boot can only handle 16M */ - if ( (int)(cmd_line) > (16<<20)) - puts("cmd_line located > 16M\n"); - if ( (int)hold_residual > (16<<20)) - puts("hold_residual located > 16M\n"); - if ( initrd_start > (16<<20)) - puts("initrd_start located > 16M\n"); - - puts("Uncompressing Linux..."); - gunzip(0, 0x400000, zimage_start, &zimage_size); puts("done.\n"); - + + if (start_multi) { + puts("Parking cpu1 at 0xc0\n"); + residual->VitalProductData.SmpIar = (unsigned long)0xc0; + residual->Cpus[1].CpuState = CPU_GOOD; + hold_residual->VitalProductData.Reserved5 = 0xdeadbeef; + } + { struct bi_record *rec; - - rec = (struct bi_record *)_ALIGN((unsigned long)(zimage_size)+(1<<20)-1,(1<<20)); - + + rec = (struct bi_record *)_ALIGN((unsigned long)(zimage_size) + + (1 << 20) - 1, (1 << 20)); + rec->tag = BI_FIRST; rec->size = sizeof(struct bi_record); rec = (struct bi_record *)((unsigned long)rec + rec->size); @@ -410,31 +355,33 @@ memcpy( (void *)rec->data, "prepboot", 9); rec->size = sizeof(struct bi_record) + 8 + 1; rec = (struct bi_record *)((unsigned long)rec + rec->size); - + rec->tag = BI_MACHTYPE; rec->data[0] = _MACH_prep; rec->data[1] = 0; - rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long); + rec->size = sizeof(struct bi_record) + 2 * + 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; - rec = (struct bi_record *)((ulong)rec + rec->size); - + rec = (struct bi_record *)((unsigned long)rec + rec->size); + + if ( initrd_size ) { + rec->tag = BI_INITRD; + rec->data[0] = (unsigned long)(&__ramdisk_begin); + rec->data[1] = initrd_size; + rec->size = sizeof(struct bi_record) + 2 * + sizeof(unsigned long); + rec = (struct bi_record *)((unsigned long)rec + + rec->size); + } + 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"); return (unsigned long)hold_residual; -} - -/* - * PCI/ISA I/O support - */ -unsigned long -local_to_PCI(unsigned long addr) -{ - return (addr | 0x80000000); } diff -urN linux-2.4.18/arch/ppc/boot/prep/of1275.c linuxppc-2.4.18/arch/ppc/boot/prep/of1275.c --- linux-2.4.18/arch/ppc/boot/prep/of1275.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/prep/of1275.c Thu Mar 7 10:52:07 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.of1275.c 1.6 05/18/01 15:16:42 cort + * BK Id: SCCS/s.of1275.c 1.7 06/05/01 20:20:05 paulus */ /* Open Firmware Client Interface */ diff -urN linux-2.4.18/arch/ppc/boot/prep/of1275.h linuxppc-2.4.18/arch/ppc/boot/prep/of1275.h --- linux-2.4.18/arch/ppc/boot/prep/of1275.h Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/prep/of1275.h Thu Mar 7 10:51:52 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.of1275.h 1.6 05/18/01 15:16:42 cort + * BK Id: SCCS/s.of1275.h 1.7 06/05/01 20:20:05 paulus */ /* 6.3.2.1 Client interface */ diff -urN linux-2.4.18/arch/ppc/boot/prep/vreset.c linuxppc-2.4.18/arch/ppc/boot/prep/vreset.c --- linux-2.4.18/arch/ppc/boot/prep/vreset.c Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/boot/prep/vreset.c Thu Mar 7 10:52:07 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.vreset.c 1.11 07/25/01 18:13:07 trini + * BK Id: SCCS/s.vreset.c 1.13 01/11/02 10:46:08 trini */ /* * vreset.c @@ -29,7 +29,7 @@ struct VaRegs; /* - * VGA Register + * VGA Register */ struct VgaRegs { @@ -108,51 +108,6 @@ { ENDMK } }; -struct VgaRegs S3TextRegs[NREGS+1] = { - /* port index value */ - /* SR Regs */ - { 0x3c4, 0x1, 0x0 }, - { 0x3c4, 0x2, 0x3 }, - { 0x3c4, 0x3, 0x0 }, - { 0x3c4, 0x4, 0x2 }, - /* CR Regs */ - { 0x3d4, 0x0, 0x5f }, - { 0x3d4, 0x1, 0x4f }, - { 0x3d4, 0x2, 0x50 }, - { 0x3d4, 0x3, 0x82 }, - { 0x3d4, 0x4, 0x55 }, - { 0x3d4, 0x5, 0x81 }, - { 0x3d4, 0x6, 0xbf }, - { 0x3d4, 0x7, 0x1f }, - { 0x3d4, 0x8, 0x00 }, - { 0x3d4, 0x9, 0x4f }, - { 0x3d4, 0xa, 0x0d }, - { 0x3d4, 0xb, 0x0e }, - { 0x3d4, 0xc, 0x00 }, - { 0x3d4, 0xd, 0x00 }, - { 0x3d4, 0xe, 0x00 }, - { 0x3d4, 0xf, 0x00 }, - { 0x3d4, 0x10, 0x9c }, - { 0x3d4, 0x11, 0x8e }, - { 0x3d4, 0x12, 0x8f }, - { 0x3d4, 0x13, 0x28 }, - { 0x3d4, 0x14, 0x1f }, - { 0x3d4, 0x15, 0x96 }, - { 0x3d4, 0x16, 0xb9 }, - { 0x3d4, 0x17, 0xa3 }, - /* GR Regs */ - { 0x3ce, 0x0, 0x0 }, - { 0x3ce, 0x1, 0x0 }, - { 0x3ce, 0x2, 0x0 }, - { 0x3ce, 0x3, 0x0 }, - { 0x3ce, 0x4, 0x0 }, - { 0x3ce, 0x5, 0x10 }, - { 0x3ce, 0x6, 0xe }, - { 0x3ce, 0x7, 0x0 }, - { 0x3ce, 0x8, 0xff }, - { ENDMK } -}; - struct RGBColors { unsigned char r, g, b; @@ -161,9 +116,9 @@ /* * Default console text mode color table. * These values were obtained by booting Linux with - * text mode firmware & then dumping the registers. + * text mode firmware & then dumping the registers. */ -struct RGBColors TextCLUT[256] = +struct RGBColors TextCLUT[256] = { /* red green blue */ { 0x0, 0x0, 0x0 }, @@ -424,8 +379,8 @@ }; unsigned char AC[21] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, - 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, + 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x0C, 0x00, 0x0F, 0x08, 0x00}; static int scanPCI(int start_slt); @@ -443,20 +398,13 @@ outb(port, val >> 8); outb(port+1, val); } - -#define PPC_601 1 int vga_init(unsigned char *ISA_mem) { int slot; struct VgaRegs *VgaTextRegs; -#if 0 - if ((_get_PVR()>>16) == PPC_601) { - return(old_vga_init(ISA_mem)); - } -#endif - + /* See if VGA already in TEXT mode - exit if so! */ outb(0x3CE, 0x06); if ((inb(0x3CF) & 0x01) == 0){ @@ -470,20 +418,19 @@ while((slot = scanPCI(slot)) > -1) { /* find video card in use */ unlockVideo(slot); /* enable I/O to card */ VgaTextRegs = GenVgaTextRegs; - + switch (PCIVendor(slot)) { default: break; case(S3Vendor): unlockS3(); - VgaTextRegs = S3TextRegs; break; - + case(CirrusVendor): outw(0x3C4, 0x0612); /* unlock ext regs */ outw(0x3C4, 0x0700); /* reset ext sequence mode */ break; - + case(ParadiseVendor): /* IBM Portable 850 */ outw(0x3ce, 0x0f05); /* unlock pardise registers */ outw(0x3c4, 0x0648); @@ -508,7 +455,7 @@ } outw(0x3d4, 0x34a0); break; - + #if 0 /* Untested - probably doesn't work */ case(MatroxVendor): case(DiamondVendor): @@ -518,7 +465,7 @@ mdelay(1000); #endif }; - + outw(0x3C4, 0x0120); /* disable video */ setTextRegs(VgaTextRegs); /* initial register setup */ setTextCLUT(0); /* load color lookup table */ @@ -526,23 +473,23 @@ setTextRegs(VgaTextRegs); /* reload registers */ outw(0x3C4, 0x0100); /* re-enable video */ clearVideoMemory(); - + if (PCIVendor(slot) == S3Vendor) { outb(0x3c2, 0x63); /* MISC */ } /* endif */ - + #ifdef DEBUG printslots(); mdelay(5000); #endif - + mdelay(1000); /* give time for the video monitor to come up */ } return (1); /* 'CRT' I/O supported */ } /* - * Write to VGA Attribute registers. + * Write to VGA Attribute registers. */ void writeAttr(unsigned char index, unsigned char data, unsigned char videoOn) @@ -563,18 +510,18 @@ /* * saved settings - */ + */ while( svp->io_port != ENDMK ) { outb(svp->io_port, svp->io_index); outb(svp->io_port+1, svp->io_value); - svp++; + svp++; } outb(0x3c2, 0x67); /* MISC */ outb(0x3c6, 0xff); /* MASK */ for ( i = 0; i < 0x10; i++) - writeAttr(i, AC[i], 0); /* pallete */ + writeAttr(i, AC[i], 0); /* pallete */ writeAttr(0x10, 0x0c, 0); /* text mode */ writeAttr(0x11, 0x00, 0); /* overscan color (border) */ writeAttr(0x12, 0x0f, 0); /* plane enable */ @@ -587,9 +534,9 @@ { int i; - outb(0x3C6, 0xFF); + outb(0x3C6, 0xFF); i = inb(0x3C7); - outb(0x3C8, 0); + outb(0x3C8, 0); i = inb(0x3C7); for ( i = 0; i < 256; i++) { @@ -604,14 +551,14 @@ { int i, j; unsigned char *font_page = (unsigned char *) &ISA_mem[0xA0000]; - + outb(0x3C2, 0x67); - /* - * Load font + /* + * Load font */ i = inb(0x3DA); /* Reset Attr toggle */ - outb(0x3C0,0x30); + outb(0x3C0,0x30); outb(0x3C0, 0x01); /* graphics mode */ outw(0x3C4, 0x0001); /* reset sequencer */ @@ -706,7 +653,7 @@ } /* - * cursor() sets an offset (0-1999) into the 80x25 text area + * cursor() sets an offset (0-1999) into the 80x25 text area. */ void cursor(int x, int y) @@ -737,14 +684,14 @@ #define NPCIREGS 5 -/* - should use devfunc number/indirect method to be totally safe on - all machines, this works for now on 3 slot Moto boxes +/* + should use devfunc number/indirect method to be totally safe on + all machines, this works for now on 3 slot Moto boxes */ struct PCI_ConfigInfo { unsigned long * config_addr; - unsigned long regs[NPCIREGS]; + unsigned long regs[NPCIREGS]; } PCI_slots [NSLOTS] = { { (unsigned long *)0x80808000, 0xDEADBEEF }, /* onboard */ @@ -761,10 +708,10 @@ /* * The following code modifies the PCI Command register - * to enable memory and I/O accesses. - */ + * to enable memory and I/O accesses. + */ void -unlockVideo(int slot) +unlockVideo(int slot) { volatile unsigned char * ppci; @@ -811,13 +758,13 @@ pslot->regs[r] = SwapBytes ( pslot->config_addr[r] ); } /* card in slot ? */ - if ( pslot->regs[DEVID] != 0xFFFFFFFF ) { + if ( pslot->regs[DEVID] != 0xFFFFFFFF ) { /* VGA ? */ - if ( ((pslot->regs[CLASS] & 0xFFFFFF00) == 0x03000000) || + if ( ((pslot->regs[CLASS] & 0xFFFFFF00) == 0x03000000) || ((pslot->regs[CLASS] & 0xFFFFFF00) == 0x00010000)) { highVgaSlot = slt; /* did firmware enable it ? */ - if ( (pslot->regs[CMD] & 0x03) ) { + if ( (pslot->regs[CMD] & 0x03) ) { theSlot = slt; break; } @@ -840,7 +787,7 @@ #ifdef DEBUG static -void printslots(void) +void printslots(void) { int i; #if 0 @@ -853,7 +800,7 @@ i, pslot->config_addr, pslot->regs[0], pslot->regs[2]); #else puts("PCI Slot number: "); puthex(i); - puts(" Vendor ID: "); + puts(" Vendor ID: "); puthex(PCIVendor(i)); puts("\n"); #endif } diff -urN linux-2.4.18/arch/ppc/boot/simple/Makefile linuxppc-2.4.18/arch/ppc/boot/simple/Makefile --- linux-2.4.18/arch/ppc/boot/simple/Makefile Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/simple/Makefile Thu Mar 7 10:51:45 2002 @@ -0,0 +1,135 @@ +# This is far from simple, but I couldn't think of a good name. This is +# for making the 'zImage' or 'zImage.initrd' on a number of targets. +# +# Author: Tom Rini +# +# Copyright 2001 MontaVista Software Inc. +# +# Notes: For machine targets which produce more than one image, define +# ZNETBOOT and ZNETBOOTRD to the image which should be available for +# 'znetboot' and 'znetboot.initrd` +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. + +USE_STANDARD_AS_RULE := true + +# Normally, we use the 'misc-simple.c' file for decompress_kernel and +# whatnot. Sometimes we need to override this however. +MISC := ../common/misc-simple.o +ifeq ($(CONFIG_EMBEDDEDBOOT),y) +ZIMAGE := zImage-EMBEDDED +ZIMAGEINITRD := zImage.initrd-EMBEDDED +TFTPIMAGE := /tftpboot/zImage.embedded +MISC := misc-embedded.o +endif +ifeq ($(CONFIG_GEMINI),y) +ZIMAGE := zImage-SMON +ZIMAGEINITRD := zImage.initrd-SMON +HEADHELP := direct.o +TFTPIMAGE := /tftpboot/zImage.gemini +endif +ifeq ($(CONFIG_SMP),y) +TFTPIMAGE += .smp +endif + +# Setup a default address to put ourselves, change it as needed. +LD_ARGS = -T ../ld.script -Ttext 0x00800000 -Bstatic +ifdef CONFIG_8xx +LD_ARGS := -T ../ld.script -Ttext 0x00180000 -Bstatic +endif +ifeq ($(CONFIG_8260)$(CONFIG_4xx),y) +LD_ARGS := -T ../ld.script -Ttext 0x00400000 -Bstatic +endif +OBJCOPY_ARGS := -O elf32-powerpc + +# head.o and ../common/relocate.o must be at the start. +obj-y := head.o ../common/relocate.o $(HEADHELP) \ + $(MISC) ../common/misc-common.o \ + ../common/string.o ../common/util.o +obj-$(CONFIG_4xx) += embed_config.o +obj-$(CONFIG_8xx) += embed_config.o +obj-$(CONFIG_8260) += embed_config.o +obj-$(CONFIG_BSEIP) += iic.o +obj-$(CONFIG_MBX) += iic.o +obj-$(CONFIG_RPXCLASSIC) += iic.o +obj-$(CONFIG_RPXLITE) += iic.o +# Different boards need different serial implementations. +ifeq ($(CONFIG_SERIAL_CONSOLE),y) +obj-$(CONFIG_8xx) += m8xx_tty.o +obj-$(CONFIG_8260) += m8260_tty.o +obj-$(CONFIG_SERIAL) += ../common/ns16550.o +endif + +LIBS := ../lib/zlib.a + +# Tools +MKPREP := ../utils/mkprep +MKTREE := ../utils/mktree + +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 + +zvmlinux: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz ../common/dummy.o + $(OBJCOPY) $(OBJCOPY_ARGS) \ + --add-section=.image=../images/vmlinux.gz \ + --set-section-flags=.image=contents,alloc,load,readonly,data \ + ../common/dummy.o image.o + $(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS) + $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr \ + -R .ramdisk -R .sysmap + +zvmlinux.initrd: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz \ + ../common/dummy.o + $(OBJCOPY) $(OBJCOPY_ARGS) \ + --add-section=.ramdisk=../images/ramdisk.image.gz \ + --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \ + --add-section=.image=../images/vmlinux.gz \ + --set-section-flags=.image=contents,alloc,load,readonly,data \ + ../common/dummy.o image.o + $(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS) + $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr \ + -R .sysmap + +# Sort-of dummy rules, that let us format the image we want. +zImage: $(ZIMAGE) + rm -f zvmlinux +zImage.initrd: $(ZIMAGEINITRD) + rm -f zvmlinux.initrd + +znetboot: zImage +ifneq ($(ZNETBOOT),) + cp ../images/$(ZNETBOOT) $(TFTPIMAGE) +else + cp ../images/zImage.* $(TFTPIMAGE) +endif + +znetboot.initrd: zImage.initrd +ifneq ($(ZNETBOOTRD),) + cp ../images/$(ZNETBOOTRD) $(TFTPIMAGE) +else + cp ../images/zImage.* $(TFTPIMAGE) +endif + +zImage-EMBEDDED: zvmlinux + mv zvmlinux ../images/zImage.embedded + +zImage.initrd-EMBEDDED: zvmlinux.initrd + mv zvmlinux.initrd ../images/zImage.initrd.embedded + +zImage-SMON: zvmlinux + dd if=zvmlinux of=../images/zImage.gemini skip=64 bs=1k + +zImage.initrd-SMON: zvmlinux.initrd + dd if=zvmlinux.initrd of=../images/zImage.initrd.gemini skip=64 bs=1k + +zImage-TREE: zvmlinux + $(MKTREE) zvmlinux ../images/zImage.treeboot + +zImage.initrd-TREE: zvmlinux.initrd + $(MKTREE) zvmlinux.initrd ../images/zImage.initrd.treeboot + +include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ppc/boot/simple/direct.S linuxppc-2.4.18/arch/ppc/boot/simple/direct.S --- linux-2.4.18/arch/ppc/boot/simple/direct.S Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/simple/direct.S Thu Mar 7 10:52:18 2002 @@ -0,0 +1,14 @@ +/* + * arch/ppc/boot/simple/direct.S + * + * Author: Tom Rini + * + * This is an empty function for machines which use SERIAL_IO_MEM + * and don't need ISA_io set to anything but 0; + */ + + .text + + .globl setup_legacy +setup_legacy: + blr diff -urN linux-2.4.18/arch/ppc/boot/simple/embed_config.c linuxppc-2.4.18/arch/ppc/boot/simple/embed_config.c --- linux-2.4.18/arch/ppc/boot/simple/embed_config.c Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/simple/embed_config.c Thu Mar 7 10:51:38 2002 @@ -0,0 +1,755 @@ +/* + * BK Id: %F% %I% %G% %U% %#% + */ + +/* Board specific functions for those embedded 8xx boards that do + * not have boot monitor support for board information. + */ +#include +#include +#ifdef CONFIG_8xx +#include +#endif +#ifdef CONFIG_8260 +#include +#include +#endif +#ifdef CONFIG_4xx +#include +#endif +#if defined(CONFIG_405GP) || defined(CONFIG_NP405H) || defined(CONFIG_NP405L) +#include +#endif + +/* For those boards that don't provide one. +*/ +#if !defined(CONFIG_MBX) +static bd_t bdinfo; +#endif + +/* IIC functions. + * These are just the basic master read/write operations so we can + * examine serial EEPROM. + */ +extern void iic_read(uint devaddr, u_char *buf, uint offset, uint count); + +/* Supply a default Ethernet address for those eval boards that don't + * ship with one. This is an address from the MBX board I have, so + * it is unlikely you will find it on your network. + */ +static ushort def_enet_addr[] = { 0x0800, 0x3e26, 0x1559 }; + +#if defined(CONFIG_MBX) + +/* The MBX hands us a pretty much ready to go board descriptor. This + * is where the idea started in the first place. + */ +void +embed_config(bd_t **bdp) +{ + u_char *mp; + u_char eebuf[128]; + int i; + bd_t *bd; + + bd = *bdp; + + /* Read the first 128 bytes of the EEPROM. There is more, + * but this is all we need. + */ + iic_read(0xa4, eebuf, 0, 128); + + /* All we are looking for is the Ethernet MAC address. The + * first 8 bytes are 'MOTOROLA', so check for part of that. + * If it's there, assume we have a valid MAC address. If not, + * grab our default one. + */ + if ((*(uint *)eebuf) == 0x4d4f544f) + mp = &eebuf[0x4c]; + else + mp = (u_char *)def_enet_addr; + + for (i=0; i<6; i++) + bd->bi_enetaddr[i] = *mp++; + + /* The boot rom passes these to us in MHz. Linux now expects + * them to be in Hz. + */ + bd->bi_intfreq *= 1000000; + bd->bi_busfreq *= 1000000; + + /* Stuff a baud rate here as well. + */ + bd->bi_baudrate = 9600; +} +#endif /* CONFIG_MBX */ + +#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) || \ + defined(CONFIG_RPX6) || defined(CONFIG_EP405) +/* Helper functions for Embedded Planet boards. +*/ +/* Because I didn't find anything that would do this....... +*/ +u_char +aschex_to_byte(u_char *cp) +{ + u_char byte, c; + + c = *cp++; + + if ((c >= 'A') && (c <= 'F')) { + c -= 'A'; + c += 10; + } else if ((c >= 'a') && (c <= 'f')) { + c -= 'a'; + c += 10; + } else + c -= '0'; + + byte = c * 16; + + c = *cp; + + if ((c >= 'A') && (c <= 'F')) { + c -= 'A'; + c += 10; + } else if ((c >= 'a') && (c <= 'f')) { + c -= 'a'; + c += 10; + } else + c -= '0'; + + byte += c; + + return(byte); +} + +static void +rpx_eth(bd_t *bd, u_char *cp) +{ + int i; + + for (i=0; i<6; i++) { + bd->bi_enetaddr[i] = aschex_to_byte(cp); + cp += 2; + } +} + +#ifdef CONFIG_RPX6 +static uint +rpx_baseten(u_char *cp) +{ + uint retval; + + retval = 0; + + while (*cp != '\n') { + retval *= 10; + retval += (*cp) - '0'; + cp++; + } + return(retval); +} +#endif + +#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) +static void +rpx_brate(bd_t *bd, u_char *cp) +{ + uint rate; + + rate = 0; + + while (*cp != '\n') { + rate *= 10; + rate += (*cp) - '0'; + cp++; + } + + bd->bi_baudrate = rate * 100; +} + +static void +rpx_cpuspeed(bd_t *bd, u_char *cp) +{ + uint num, den; + + num = den = 0; + + while (*cp != '\n') { + num *= 10; + num += (*cp) - '0'; + cp++; + if (*cp == '/') { + cp++; + den = (*cp) - '0'; + break; + } + } + + /* I don't know why the RPX just can't state the actual + * CPU speed..... + */ + if (den) { + num /= den; + num *= den; + } + bd->bi_intfreq = bd->bi_busfreq = num * 1000000; + + /* The 8xx can only run a maximum 50 MHz bus speed (until + * Motorola changes this :-). Greater than 50 MHz parts + * run internal/2 for bus speed. + */ + if (num > 50) + bd->bi_busfreq /= 2; +} +#endif + +#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) || defined(CONFIG_EP405) +static void +rpx_memsize(bd_t *bd, u_char *cp) +{ + uint size; + + size = 0; + + while (*cp != '\n') { + size *= 10; + size += (*cp) - '0'; + cp++; + } + + bd->bi_memsize = size * 1024 * 1024; +} +#endif /* LITE || CLASSIC || EP405 */ + +#endif /* Embedded Planet boards */ + +#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) + +/* Read the EEPROM on the RPX-Lite board. +*/ +void +embed_config(bd_t **bdp) +{ + u_char eebuf[256], *cp; + bd_t *bd; + + /* Read the first 256 bytes of the EEPROM. I think this + * is really all there is, and I hope if it gets bigger the + * info we want is still up front. + */ + bd = &bdinfo; + *bdp = bd; + +#if 1 + iic_read(0xa8, eebuf, 0, 128); + iic_read(0xa8, &eebuf[128], 128, 128); + + /* We look for two things, the Ethernet address and the + * serial baud rate. The records are separated by + * newlines. + */ + cp = eebuf; + for (;;) { + if (*cp == 'E') { + cp++; + if (*cp == 'A') { + cp += 2; + rpx_eth(bd, cp); + } + } + if (*cp == 'S') { + cp++; + if (*cp == 'B') { + cp += 2; + rpx_brate(bd, cp); + } + } + if (*cp == 'D') { + cp++; + if (*cp == '1') { + cp += 2; + rpx_memsize(bd, cp); + } + } + if (*cp == 'H') { + cp++; + if (*cp == 'Z') { + cp += 2; + rpx_cpuspeed(bd, cp); + } + } + + /* Scan to the end of the record. + */ + while ((*cp != '\n') && (*cp != 0xff)) + cp++; + + /* If the next character is a 0 or ff, we are done. + */ + cp++; + if ((*cp == 0) || (*cp == 0xff)) + break; + } + bd->bi_memstart = 0; +#else + /* For boards without initialized EEPROM. + */ + bd->bi_memstart = 0; + bd->bi_memsize = (8 * 1024 * 1024); + bd->bi_intfreq = 48000000; + bd->bi_busfreq = 48000000; + bd->bi_baudrate = 9600; +#endif +} +#endif /* RPXLITE || RPXCLASSIC */ + +#ifdef CONFIG_BSEIP +/* Build a board information structure for the BSE ip-Engine. + * There is more to come since we will add some environment + * variables and a function to read them. + */ +void +embed_config(bd_t **bdp) +{ + u_char *cp; + int i; + bd_t *bd; + + bd = &bdinfo; + *bdp = bd; + + /* Baud rate and processor speed will eventually come + * from the environment variables. + */ + bd->bi_baudrate = 9600; + + /* Get the Ethernet station address from the Flash ROM. + */ + cp = (u_char *)0xfe003ffa; + for (i=0; i<6; i++) { + bd->bi_enetaddr[i] = *cp++; + } + + /* The rest of this should come from the environment as well. + */ + bd->bi_memstart = 0; + bd->bi_memsize = (16 * 1024 * 1024); + bd->bi_intfreq = 48000000; + bd->bi_busfreq = 48000000; +} +#endif /* BSEIP */ + +#ifdef CONFIG_FADS +/* Build a board information structure for the FADS. + */ +void +embed_config(bd_t **bdp) +{ + u_char *cp; + int i; + bd_t *bd; + + bd = &bdinfo; + *bdp = bd; + + /* Just fill in some known values. + */ + bd->bi_baudrate = 9600; + + /* Use default enet. + */ + cp = (u_char *)def_enet_addr; + for (i=0; i<6; i++) { + bd->bi_enetaddr[i] = *cp++; + } + + bd->bi_memstart = 0; + bd->bi_memsize = (8 * 1024 * 1024); + bd->bi_intfreq = 40000000; + bd->bi_busfreq = 40000000; +} +#endif /* FADS */ + +#ifdef CONFIG_8260 +/* Compute 8260 clock values if the rom doesn't provide them. + * We can't compute the internal core frequency (I don't know how to + * do that). + */ +static void +clk_8260(bd_t *bd) +{ + uint scmr, vco_out, clkin; + uint plldf, pllmf, busdf, brgdf, cpmdf; + volatile immap_t *ip; + + ip = (immap_t *)IMAP_ADDR; + scmr = ip->im_clkrst.car_scmr; + + /* The clkin is always bus frequency. + */ + clkin = bd->bi_busfreq; + + /* Collect the bits from the scmr. + */ + plldf = (scmr >> 12) & 1; + pllmf = scmr & 0xfff; + cpmdf = (scmr >> 16) & 0x0f; + busdf = (scmr >> 20) & 0x0f; + + /* This is arithmetic from the 8260 manual. + */ + vco_out = clkin / (plldf + 1); + vco_out *= 2 * (pllmf + 1); + bd->bi_vco = vco_out; /* Save for later */ + + bd->bi_cpmfreq = vco_out / 2; /* CPM Freq, in MHz */ + + /* Set Baud rate divisor. The power up default is divide by 16, + * but we set it again here in case it was changed. + */ + ip->im_clkrst.car_sccr = 1; /* DIV 16 BRG */ + bd->bi_brgfreq = vco_out / 16; +} +#endif + +#ifdef CONFIG_EST8260 +void +embed_config(bd_t **bdp) +{ + u_char *cp; + int i; + bd_t *bd; + + bd = *bdp; +#if 0 + /* This is actually provided by my boot rom. I have it + * here for those people that may load the kernel with + * a JTAG/COP tool and not the rom monitor. + */ + bd->bi_baudrate = 115200; + bd->bi_intfreq = 200000000; + bd->bi_busfreq = 66666666; + bd->bi_cpmfreq = 66666666; + bd->bi_brgfreq = 33333333; + bd->bi_memsize = 16 * 1024 * 1024; +#else + /* The boot rom passes these to us in MHz. Linux now expects + * them to be in Hz. + */ + bd->bi_intfreq *= 1000000; + bd->bi_busfreq *= 1000000; + bd->bi_cpmfreq *= 1000000; + bd->bi_brgfreq *= 1000000; +#endif + + cp = (u_char *)def_enet_addr; + for (i=0; i<6; i++) { + bd->bi_enetaddr[i] = *cp++; + } +} +#endif /* EST8260 */ + +#ifdef CONFIG_SBS8260 +void +embed_config(bd_t **bdp) +{ + u_char *cp; + int i; + bd_t *bd; + + /* This should provided by the boot rom. + */ + bd = &bdinfo; + *bdp = bd; + bd->bi_baudrate = 9600; + bd->bi_memsize = 64 * 1024 * 1024; + + /* Set all of the clocks. We have to know the speed of the + * external clock. The development board had 66 MHz. + */ + bd->bi_busfreq = 66666666; + clk_8260(bd); + + /* I don't know how to compute this yet. + */ + bd->bi_intfreq = 133000000; + + + cp = (u_char *)def_enet_addr; + for (i=0; i<6; i++) { + bd->bi_enetaddr[i] = *cp++; + } +} +#endif /* SBS8260 */ + +#ifdef CONFIG_RPX6 +void +embed_config(bd_t **bdp) +{ + u_char *cp, *keyvals; + int i; + bd_t *bd; + + keyvals = (u_char *)*bdp; + + bd = &bdinfo; + *bdp = bd; + + /* This is almost identical to the RPX-Lite/Classic functions + * on the 8xx boards. It would be nice to have a key lookup + * function in a string, but the format of all of the fields + * is slightly different. + */ + cp = keyvals; + for (;;) { + if (*cp == 'E') { + cp++; + if (*cp == 'A') { + cp += 2; + rpx_eth(bd, cp); + } + } + if (*cp == 'S') { + cp++; + if (*cp == 'B') { + cp += 2; + bd->bi_baudrate = rpx_baseten(cp); + } + } + if (*cp == 'D') { + cp++; + if (*cp == '1') { + cp += 2; + bd->bi_memsize = rpx_baseten(cp) * 1024 * 1024; + } + } + if (*cp == 'X') { + cp++; + if (*cp == 'T') { + cp += 2; + bd->bi_busfreq = rpx_baseten(cp); + } + } + if (*cp == 'N') { + cp++; + if (*cp == 'V') { + cp += 2; + bd->bi_nvsize = rpx_baseten(cp) * 1024 * 1024; + } + } + + /* Scan to the end of the record. + */ + while ((*cp != '\n') && (*cp != 0xff)) + cp++; + + /* If the next character is a 0 or ff, we are done. + */ + cp++; + if ((*cp == 0) || (*cp == 0xff)) + break; + } + bd->bi_memstart = 0; + + /* The memory size includes both the 60x and local bus DRAM. + * I don't want to use the local bus DRAM for real memory, + * so subtract it out. It would be nice if they were separate + * keys. + */ + bd->bi_memsize -= 32 * 1024 * 1024; + + /* Set all of the clocks. We have to know the speed of the + * external clock. + */ + clk_8260(bd); + + /* I don't know how to compute this yet. + */ + bd->bi_intfreq = 200000000; +} +#endif /* RPX6 for testing */ + +#ifdef CONFIG_ADS8260 +void +embed_config(bd_t **bdp) +{ + u_char *cp; + int i; + bd_t *bd; + + /* This should provided by the boot rom. + */ + bd = &bdinfo; + *bdp = bd; + bd->bi_baudrate = 9600; + bd->bi_memsize = 16 * 1024 * 1024; + + /* Set all of the clocks. We have to know the speed of the + * external clock. The development board had 66 MHz. + */ + bd->bi_busfreq = 66666666; + clk_8260(bd); + + /* I don't know how to compute this yet. + */ + bd->bi_intfreq = 200000000; + + + cp = (u_char *)def_enet_addr; + for (i=0; i<6; i++) { + bd->bi_enetaddr[i] = *cp++; + } +} +#endif /* ADS8260 */ + +#ifdef CONFIG_WILLOW +void +embed_config(bd_t **bdp) +{ + u_char *cp; + int i; + bd_t *bd; + + /* Willow has Open Firmware....I should learn how to get this + * information from it. + */ + bd = &bdinfo; + *bdp = bd; + bd->bi_baudrate = 9600; + bd->bi_memsize = 32 * 1024 * 1024; + + /* Set all of the clocks. We have to know the speed of the + * external clock. The development board had 66 MHz. + */ + bd->bi_busfreq = 66666666; + clk_8260(bd); + + /* I don't know how to compute this yet. + */ + bd->bi_intfreq = 200000000; + + + cp = (u_char *)def_enet_addr; + for (i=0; i<6; i++) { + bd->bi_enetaddr[i] = *cp++; + } +} +#endif /* WILLOW */ + +#ifdef CONFIG_TREEBOOT +/* This could possibly work for all treeboot roms. +*/ +#define BOARD_INFO_VECTOR 0xFFFE0B50 + +void +embed_config(bd_t **bdp) +{ + u_char *cp; + int i; + bd_t *bd, *treeboot_bd; + bd_t *(*get_board_info)(void) = + (bd_t *(*)(void))(*(unsigned long *)BOARD_INFO_VECTOR); +#if !defined(CONFIG_STB03xxx) + volatile emac_t *emacp; + emacp = (emac_t *)EMAC0_BASE; /* assume 1st emac - armin */ + + /* 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 */ + emacp->em0mr0 = 0x20000000; /* then reset EMAC */ + eieio(); +#endif + + bd = &bdinfo; + *bdp = bd; + if ((treeboot_bd = get_board_info()) != NULL) { + memcpy(bd, treeboot_bd, sizeof(bd_t)); + } + else { + /* Hmmm...better try to stuff some defaults. + */ + bd->bi_memsize = 16 * 1024 * 1024; + cp = (u_char *)def_enet_addr; + for (i=0; i<6; i++) { + /* I should probably put different ones here, + * hopefully only one is used. + */ + bd->BD_EMAC_ADDR(0,i) = *cp; + +#ifdef CONFIG_PCI + bd->bi_pci_enetaddr[i] = *cp++; +#endif + } + 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 + } +} +#endif + +#ifdef CONFIG_EP405 +void +embed_config(bd_t **bdp) +{ + u_char *cp; + bd_t *bd; + + bd = &bdinfo; + *bdp = bd; +#if 1 + cp = (u_char *)0xF0000EE0; + for (;;) { + if (*cp == 'E') { + cp++; + if (*cp == 'A') { + cp += 2; + rpx_eth(bd, cp); + } + } + + if (*cp == 'D') { + cp++; + if (*cp == '1') { + cp += 2; + rpx_memsize(bd, cp); + } + } + + while ((*cp != '\n') && (*cp != 0xff)) + cp++; + + cp++; + if ((*cp == 0) || (*cp == 0xff)) + break; + } + bd->bi_intfreq = 200000000; + bd->bi_busfreq = 100000000; + bd->bi_pci_busfreq= 33000000 ; +#else + + bd->bi_memsize = 64000000; + bd->bi_intfreq = 200000000; + bd->bi_busfreq = 100000000; + bd->bi_pci_busfreq= 33000000 ; +#endif +} +#endif + diff -urN linux-2.4.18/arch/ppc/boot/simple/head.S linuxppc-2.4.18/arch/ppc/boot/simple/head.S --- linux-2.4.18/arch/ppc/boot/simple/head.S Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/simple/head.S Thu Mar 7 10:52:17 2002 @@ -0,0 +1,120 @@ +/* + * arch/ppc/boot/simple/head.S + * + * Initial board bringup code for many different boards. + * + * Author: Tom Rini + * trini@mvista.com + * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others). + * + * Copyright 2001 MontaVista Software Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include "ppc_asm.h" + + .text + +/* + * Begin at some arbitrary location in RAM or Flash + * Initialize core registers + * Configure memory controller (Not executing from RAM) + * Move the boot code to the link address (8M) + * Setup C stack + * Initialize UART + * Decompress the kernel to 0x0 + * Jump to the kernel entry + * + */ + + .globl start +start: + bl start_ +#ifdef CONFIG_TREEBOOT + /* The IBM "Tree" bootrom knows that the address of the bootrom + * read only structure is 4 bytes after _start. + */ + .long 0x62726f6d # structure ID - "brom" + .long 0x5f726f00 # - "_ro\0" + .long 1 # structure version + .long bootrom_cmdline # address of *bootrom_cmdline +#endif + +start_: +#ifdef CONFIG_FORCE + /* We have some really bad firmware. We must disable the L1 + * icache/dcache now or the board won't boot. + */ + li r4,0x0000 + isync + mtspr HID0,r4 + sync + isync +#endif + +#if defined(CONFIG_MBX) || defined(CONFIG_RPX6) + mr r29,r3 /* On the MBX860, r3 is the board info pointer. + * On the RPXSUPER, r3 points to the + * NVRAM configuration keys. + */ +#endif + + mflr r3 /* Save our actual starting address. */ + + /* The following functions we call must not modify r3 or r4..... + */ +#ifdef CONFIG_6xx + bl disable_6xx_mmu + bl disable_6xx_l1cache +#if defined(CONFIG_FORCE) || defined(CONFIG_K2) || defined(CONFIG_EV64260) + bl _setup_L2CR +#endif +#endif + +#ifdef CONFIG_8xx + mfmsr r8 /* Turn off interrupts */ + li r9,0 + ori r9,r9,MSR_EE + andc r8,r8,r9 + mtmsr r8 + + /* We do this because some boot roms don't initialize the + * processor correctly. Don't do this if you want to debug + * using a BDM device. + */ + li r4,0 /* Zero DER to prevent FRZ */ + mtspr SPRN_DER,r4 +#endif + +#ifdef CONFIG_REDWOOD_4 + /* All of this Redwood 4 stuff will soon disappear when the + * boot rom is straightened out. + */ + mr r29, r3 /* Easier than changing the other code */ + bl HdwInit + mr r3, r29 +#endif + +#if defined(CONFIG_MBX) || defined(CONFIG_RPX6) + mr r4,r29 /* put the board info pointer where the relocate + * routine will find it + */ +#endif + +#ifdef CONFIG_EV64260 + /* Move 64260's base regs & CS window for external UART */ + bl ev64260_init +#endif + + /* Get the load address. + */ + subi r3, r3, 4 /* Get the actual IP, not NIP */ + b relocate + diff -urN linux-2.4.18/arch/ppc/boot/simple/iic.c linuxppc-2.4.18/arch/ppc/boot/simple/iic.c --- linux-2.4.18/arch/ppc/boot/simple/iic.c Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/simple/iic.c Thu Mar 7 10:51:52 2002 @@ -0,0 +1,218 @@ +/* + * BK Id: %F% %I% %G% %U% %#% + */ + +/* Minimal support functions to read configuration from IIC EEPROMS + * on MPC8xx boards. Originally written for RPGC RPX-Lite. + * Dan Malek (dmalek@jlc.net). + */ +#include +#include +#include +#include + + +/* IIC functions. + * These are just the basic master read/write operations so we can + * examine serial EEPROM. + */ +void iic_read(uint devaddr, u_char *buf, uint offset, uint count); + +static int iic_init_done; + +static void +iic_init(void) +{ + volatile iic_t *iip; + volatile i2c8xx_t *i2c; + volatile cpm8xx_t *cp; + volatile immap_t *immap; + uint dpaddr; + + immap = (immap_t *)IMAP_ADDR; + cp = (cpm8xx_t *)&(immap->im_cpm); + + /* Reset the CPM. This is necessary on the 860 processors + * that may have started the SCC1 ethernet without relocating + * the IIC. + * This also stops the Ethernet in case we were loaded by a + * BOOTP rom monitor. + */ + cp->cp_cpcr = (CPM_CR_RST | CPM_CR_FLG); + + /* Wait for it. + */ + while (cp->cp_cpcr & (CPM_CR_RST | CPM_CR_FLG)); + + /* Remove any microcode patches. We will install our own + * later. + */ + cp->cp_cpmcr1 = 0; + cp->cp_cpmcr2 = 0; + cp->cp_cpmcr3 = 0; + cp->cp_cpmcr4 = 0; + cp->cp_rccr = 0; + + iip = (iic_t *)&cp->cp_dparam[PROFF_IIC]; + i2c = (i2c8xx_t *)&(immap->im_i2c); + + /* Initialize Port B IIC pins. + */ + cp->cp_pbpar |= 0x00000030; + cp->cp_pbdir |= 0x00000030; + cp->cp_pbodr |= 0x00000030; + + /* Initialize the parameter ram. + */ + + /* Allocate space for a two transmit and one receive buffer + * descriptor in the DP ram. + * For now, this address seems OK, but it may have to + * change with newer versions of the firmware. + */ + dpaddr = 0x0840; + + /* Set up the IIC parameters in the parameter ram. + */ + iip->iic_tbase = dpaddr; + iip->iic_rbase = dpaddr + (2 * sizeof(cbd_t)); + + iip->iic_tfcr = SMC_EB; + iip->iic_rfcr = SMC_EB; + + /* This should really be done by the reader/writer. + */ + iip->iic_mrblr = 128; + + /* Initialize Tx/Rx parameters. + */ + cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_I2C, CPM_CR_INIT_TRX) | CPM_CR_FLG; + while (cp->cp_cpcr & CPM_CR_FLG); + + /* Select an arbitrary address. Just make sure it is unique. + */ + i2c->i2c_i2add = 0x34; + + /* Make clock run maximum slow. + */ + i2c->i2c_i2brg = 7; + + /* Disable interrupts. + */ + i2c->i2c_i2cmr = 0; + i2c->i2c_i2cer = 0xff; + + /* Enable SDMA. + */ + immap->im_siu_conf.sc_sdcr = 1; + + iic_init_done = 1; +} + +/* Read from IIC. + * Caller provides device address, memory buffer, and byte count. + */ +static u_char iitemp[32]; + +void +iic_read(uint devaddr, u_char *buf, uint offset, uint count) +{ + volatile iic_t *iip; + volatile i2c8xx_t *i2c; + volatile cbd_t *tbdf, *rbdf; + volatile cpm8xx_t *cp; + volatile immap_t *immap; + u_char *tb; + uint temp; + + /* If the interface has not been initialized, do that now. + */ + if (!iic_init_done) + iic_init(); + + immap = (immap_t *)IMAP_ADDR; + cp = (cpm8xx_t *)&(immap->im_cpm); + + iip = (iic_t *)&cp->cp_dparam[PROFF_IIC]; + i2c = (i2c8xx_t *)&(immap->im_i2c); + + tbdf = (cbd_t *)&cp->cp_dpmem[iip->iic_tbase]; + rbdf = (cbd_t *)&cp->cp_dpmem[iip->iic_rbase]; + + /* Send a "dummy write" operation. This is a write request with + * only the offset sent, followed by another start condition. + * This will ensure we start reading from the first location + * of the EEPROM. + */ + tb = iitemp; + tb = (u_char *)(((uint)tb + 15) & ~15); + tbdf->cbd_bufaddr = (int)tb; + *tb = devaddr & 0xfe; /* Device address */ + *(tb+1) = offset; /* Offset */ + tbdf->cbd_datlen = 2; /* Length */ + tbdf->cbd_sc = + BD_SC_READY | BD_SC_LAST | BD_SC_WRAP | BD_IIC_START; + + i2c->i2c_i2mod = 1; /* Enable */ + i2c->i2c_i2cer = 0xff; + i2c->i2c_i2com = 0x81; /* Start master */ + + /* Wait for IIC transfer. + */ +#if 0 + while ((i2c->i2c_i2cer & 3) == 0); + + if (tbdf->cbd_sc & BD_SC_READY) + printf("IIC ra complete but tbuf ready\n"); +#else + temp = 10000000; + while ((tbdf->cbd_sc & BD_SC_READY) && (temp != 0)) + temp--; +#if 0 + /* We can't do this...there is no serial port yet! + */ + if (temp == 0) { + printf("Timeout reading EEPROM\n"); + return; + } +#endif +#endif + + /* Chip errata, clear enable. + */ + i2c->i2c_i2mod = 0; + + /* To read, we need an empty buffer of the proper length. + * All that is used is the first byte for address, the remainder + * is just used for timing (and doesn't really have to exist). + */ + tbdf->cbd_bufaddr = (int)tb; + *tb = devaddr | 1; /* Device address */ + rbdf->cbd_bufaddr = (uint)buf; /* Desination buffer */ + tbdf->cbd_datlen = rbdf->cbd_datlen = count + 1; /* Length */ + tbdf->cbd_sc = BD_SC_READY | BD_SC_LAST | BD_SC_WRAP | BD_IIC_START; + rbdf->cbd_sc = BD_SC_EMPTY | BD_SC_WRAP; + + /* Chip bug, set enable here. + */ + i2c->i2c_i2mod = 1; /* Enable */ + i2c->i2c_i2cer = 0xff; + i2c->i2c_i2com = 0x81; /* Start master */ + + /* Wait for IIC transfer. + */ +#if 0 + while ((i2c->i2c_i2cer & 1) == 0); + + if (rbdf->cbd_sc & BD_SC_EMPTY) + printf("IIC read complete but rbuf empty\n"); +#else + temp = 10000000; + while ((tbdf->cbd_sc & BD_SC_READY) && (temp != 0)) + temp--; +#endif + + /* Chip errata, clear enable. + */ + i2c->i2c_i2mod = 0; +} diff -urN linux-2.4.18/arch/ppc/boot/simple/legacy.S linuxppc-2.4.18/arch/ppc/boot/simple/legacy.S --- linux-2.4.18/arch/ppc/boot/simple/legacy.S Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/simple/legacy.S Thu Mar 7 10:51:49 2002 @@ -0,0 +1,19 @@ +/* + * arch/ppc/boot/simple/legacy.S + * + * Author: Tom Rini + * + * This will go and setup ISA_io to 0x8000000. + */ + +#include "ppc_asm.h" + + .text + + .globl setup_legacy +setup_legacy: + lis r3,ISA_io@h /* Load ISA_io */ + ori r3,r3,ISA_io@l + lis r4,0x8000 /* Load the value, 0x8000000 */ + stw r4,0(r3) /* store */ + blr diff -urN linux-2.4.18/arch/ppc/boot/simple/m8260_tty.c linuxppc-2.4.18/arch/ppc/boot/simple/m8260_tty.c --- linux-2.4.18/arch/ppc/boot/simple/m8260_tty.c Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/simple/m8260_tty.c Thu Mar 7 10:51:48 2002 @@ -0,0 +1,323 @@ +/* + * BK Id: %F% %I% %G% %U% %#% + */ + + +/* Minimal serial functions needed to send messages out the serial + * port on SMC1. + */ +#include +#include +#include + +uint no_print; +extern char *params[]; +extern int nparams; +static u_char cons_hold[128], *sgptr; +static int cons_hold_cnt; + +/* If defined, enables serial console. The value (1 through 4) + * should designate which SCC is used, but this isn't complete. Only + * SCC1 is known to work at this time. + */ +#ifdef CONFIG_SCC_CONSOLE +#define SCC_CONSOLE 1 +#endif + +unsigned long +serial_init(int ignored, bd_t *bd) +{ + volatile smc_t *sp; + volatile smc_uart_t *up; +#ifdef SCC_CONSOLE + volatile scc_t *sccp; + volatile scc_uart_t *sup; +#endif + volatile cbd_t *tbdf, *rbdf; + volatile immap_t *ip; + volatile iop8260_t *io; + volatile cpm8260_t *cp; + uint dpaddr, memaddr; + + ip = (immap_t *)IMAP_ADDR; + cp = &ip->im_cpm; + io = &ip->im_ioport; + + /* Perform a reset. + */ + cp->cp_cpcr = (CPM_CR_RST | CPM_CR_FLG); + + /* Wait for it. + */ + while (cp->cp_cpcr & CPM_CR_FLG); + +#ifdef CONFIG_ADS8260 + /* Enable the RS-232 transceivers. + */ + *(volatile uint *)(BCSR_ADDR + 4) &= + ~(BCSR1_RS232_EN1 | BCSR1_RS232_EN2); +#endif + +#ifdef SCC_CONSOLE + sccp = (scc_t *)&(ip->im_scc[SCC_CONSOLE-1]); + sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)]; + sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX); + sccp->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 + sp = (smc_t*)&(ip->im_smc[0]); + *(ushort *)(&ip->im_dprambase[PROFF_SMC1_BASE]) = PROFF_SMC1; + up = (smc_uart_t *)&ip->im_dprambase[PROFF_SMC1]; + + /* Disable transmitter/receiver. + */ + sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); + + /* Use Port D for SMC1 instead of other functions. + */ + io->iop_ppard |= 0x00c00000; + io->iop_pdird |= 0x00400000; + io->iop_pdird &= ~0x00800000; + io->iop_psord &= ~0x00c00000; +#endif + + /* Allocate space for two buffer descriptors in the DP ram. + * For now, this address seems OK, but it may have to + * change with newer versions of the firmware. + */ + dpaddr = 0x0800; + + /* Grab a few bytes from the top of memory. + */ + memaddr = (bd->bi_memsize - 256) & ~15; + + /* Set the physical address of the host memory buffers in + * the buffer descriptors. + */ + rbdf = (cbd_t *)&ip->im_dprambase[dpaddr]; + rbdf->cbd_bufaddr = memaddr; + rbdf->cbd_sc = 0; + tbdf = rbdf + 1; + tbdf->cbd_bufaddr = memaddr+128; + tbdf->cbd_sc = 0; + + /* Set up the uart parameters in the parameter ram. + */ +#ifdef SCC_CONSOLE + sup->scc_genscc.scc_rbase = dpaddr; + sup->scc_genscc.scc_tbase = dpaddr + 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 = 128; + sup->scc_maxidl = 8; + 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. + */ + sccp->scc_gsmrh = 0; + sccp->scc_gsmrl = + (SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16); + + /* Disable all interrupts and clear all pending + * events. + */ + sccp->scc_sccm = 0; + sccp->scc_scce = 0xffff; + sccp->scc_dsr = 0x7e7e; + sccp->scc_pmsr = 0x3000; + + /* Wire BRG1 to SCC1. The console driver will take care of + * others. + */ + ip->im_cpmux.cmx_scr = 0; +#else + up->smc_rbase = dpaddr; + up->smc_tbase = dpaddr+sizeof(cbd_t); + up->smc_rfcr = CPMFCR_EB; + up->smc_tfcr = CPMFCR_EB; + up->smc_brklen = 0; + up->smc_brkec = 0; + up->smc_brkcr = 0; + up->smc_mrblr = 128; + up->smc_maxidl = 8; + + /* Set UART mode, 8 bit, no parity, one stop. + * Enable receive and transmit. + */ + sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART; + + /* Mask all interrupts and remove anything pending. + */ + sp->smc_smcm = 0; + sp->smc_smce = 0xff; + + /* Set up the baud rate generator. + */ + ip->im_cpmux.cmx_smr = 0; +#endif + + /* The baud rate divisor needs to be coordinated with clk_8260(). + */ + ip->im_brgc1 = + (((bd->bi_brgfreq/16) / bd->bi_baudrate) << 1) | + CPM_BRG_EN; + + /* Make the first buffer the only buffer. + */ + tbdf->cbd_sc |= BD_SC_WRAP; + rbdf->cbd_sc |= BD_SC_EMPTY | BD_SC_WRAP; + + /* Initialize Tx/Rx parameters. + */ +#ifdef SCC_CONSOLE + sccp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT); +#else + cp->cp_cpcr = mk_cr_cmd(CPM_CR_SMC1_PAGE, CPM_CR_SMC1_SBLOCK, 0, CPM_CR_INIT_TRX) | CPM_CR_FLG; + while (cp->cp_cpcr & CPM_CR_FLG); + + /* Enable transmitter/receiver. + */ + sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN; +#endif + + /* This is ignored. + */ + return 0; +} + +int +serial_readbuf(u_char *cbuf) +{ + volatile cbd_t *rbdf; + volatile char *buf; + volatile smc_uart_t *up; + volatile scc_uart_t *sup; + volatile immap_t *ip; + int i, nc; + + ip = (immap_t *)IMAP_ADDR; + +#ifdef SCC_CONSOLE + sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)]; + rbdf = (cbd_t *)&ip->im_dprambase[sup->scc_genscc.scc_rbase]; +#else + up = (smc_uart_t *)&(ip->im_dprambase[PROFF_SMC1]); + rbdf = (cbd_t *)&ip->im_dprambase[up->smc_rbase]; +#endif + + /* Wait for character to show up. + */ + buf = (char *)rbdf->cbd_bufaddr; + while (rbdf->cbd_sc & BD_SC_EMPTY); + nc = rbdf->cbd_datlen; + for (i=0; icbd_sc |= BD_SC_EMPTY; + + return(nc); +} + +void +serial_putc(void *ignored, const char c) +{ + volatile cbd_t *tbdf; + volatile char *buf; + volatile smc_uart_t *up; + volatile scc_uart_t *sup; + volatile immap_t *ip; + extern bd_t *board_info; + + ip = (immap_t *)IMAP_ADDR; +#ifdef SCC_CONSOLE + sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)]; + tbdf = (cbd_t *)&ip->im_dprambase[sup->scc_genscc.scc_tbase]; +#else + up = (smc_uart_t *)&(ip->im_dprambase[PROFF_SMC1]); + tbdf = (cbd_t *)&ip->im_dprambase[up->smc_tbase]; +#endif + + /* Wait for last character to go. + */ + buf = (char *)tbdf->cbd_bufaddr; + while (tbdf->cbd_sc & BD_SC_READY); + + *buf = c; + tbdf->cbd_datlen = 1; + tbdf->cbd_sc |= BD_SC_READY; +} + +char +serial_getc(void *ignored) +{ + char c; + + if (cons_hold_cnt <= 0) { + cons_hold_cnt = serial_readbuf(cons_hold); + sgptr = cons_hold; + } + c = *sgptr++; + cons_hold_cnt--; + + return(c); +} + +int +serial_tstc(void *ignored) +{ + volatile cbd_t *rbdf; + volatile smc_uart_t *up; + volatile scc_uart_t *sup; + volatile immap_t *ip; + + ip = (immap_t *)IMAP_ADDR; +#ifdef SCC_CONSOLE + sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)]; + rbdf = (cbd_t *)&ip->im_dprambase[sup->scc_genscc.scc_rbase]; +#else + up = (smc_uart_t *)&(ip->im_dprambase[PROFF_SMC1]); + rbdf = (cbd_t *)&ip->im_dprambase[up->smc_rbase]; +#endif + + return(!(rbdf->cbd_sc & BD_SC_EMPTY)); +} + +void +serial_close(unsigned long com_port) +{ +} diff -urN linux-2.4.18/arch/ppc/boot/simple/m8xx_tty.c linuxppc-2.4.18/arch/ppc/boot/simple/m8xx_tty.c --- linux-2.4.18/arch/ppc/boot/simple/m8xx_tty.c Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/simple/m8xx_tty.c Thu Mar 7 10:51:40 2002 @@ -0,0 +1,300 @@ +/* + * BK Id: %F% %I% %G% %U% %#% + */ + + +/* Minimal serial functions needed to send messages out the serial + * port on the MBX console. + * + * The MBX uxes SMC1 for the serial port. We reset the port and use + * only the first BD that EPPC-Bug set up as a character FIFO. + * + * Later versions (at least 1.4, maybe earlier) of the MBX EPPC-Bug + * use COM1 instead of SMC1 as the console port. This kinda sucks + * for the rest of the kernel, so here we force the use of SMC1 again. + */ +#include +#include +#include +#include +#include + +#ifdef CONFIG_MBX +#define MBX_CSR1 ((volatile u_char *)0xfa100000) +#define CSR1_COMEN (u_char)0x02 +#endif + +#ifdef TQM_SMC2_CONSOLE +#define PROFF_CONS PROFF_SMC2 +#define CPM_CR_CH_CONS CPM_CR_CH_SMC2 +#define SMC_INDEX 1 +static volatile iop8xx_t *iopp = (iop8xx_t *)&(((immap_t *)IMAP_ADDR)->im_ioport); +#else +#define PROFF_CONS PROFF_SMC1 +#define CPM_CR_CH_CONS CPM_CR_CH_SMC1 +#define SMC_INDEX 0 +#endif + +static cpm8xx_t *cpmp = (cpm8xx_t *)&(((immap_t *)IMAP_ADDR)->im_cpm); + +unsigned long +serial_init(int ignored, bd_t *bd) +{ + volatile smc_t *sp; + volatile smc_uart_t *up; + volatile cbd_t *tbdf, *rbdf; + volatile cpm8xx_t *cp; + uint dpaddr, memaddr; +#ifndef CONFIG_MBX + uint ui; +#endif + + cp = cpmp; + sp = (smc_t*)&(cp->cp_smc[SMC_INDEX]); + up = (smc_uart_t *)&cp->cp_dparam[PROFF_CONS]; + + /* Disable transmitter/receiver. + */ + sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); + +#ifdef CONFIG_FADS + /* Enable SMC1/2 transceivers. + */ + *((volatile uint *)BCSR1) &= ~(BCSR1_RS232EN_1|BCSR1_RS232EN_2); +#endif + +#ifndef CONFIG_MBX + { + /* Initialize SMCx and use it for the console port. + */ + + /* Enable SDMA. + */ + ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sdcr = 1; + +#ifdef TQM_SMC2_CONSOLE + /* Use Port A for SMC2 instead of other functions. + */ + iopp->iop_papar |= 0x00c0; + iopp->iop_padir &= ~0x00c0; + iopp->iop_paodr &= ~0x00c0; +#else + /* Use Port B for SMCs instead of other functions. + */ + cp->cp_pbpar |= 0x00000cc0; + cp->cp_pbdir &= ~0x00000cc0; + cp->cp_pbodr &= ~0x00000cc0; +#endif + + /* Allocate space for two buffer descriptors in the DP ram. + * For now, this address seems OK, but it may have to + * change with newer versions of the firmware. + */ + dpaddr = 0x0800; + + /* Grab a few bytes from the top of memory for SMC FIFOs. + */ + memaddr = (bd->bi_memsize - 32) & ~15; + + /* Set the physical address of the host memory buffers in + * the buffer descriptors. + */ + rbdf = (cbd_t *)&cp->cp_dpmem[dpaddr]; + rbdf->cbd_bufaddr = memaddr; + rbdf->cbd_sc = 0; + tbdf = rbdf + 1; + tbdf->cbd_bufaddr = memaddr+4; + tbdf->cbd_sc = 0; + + /* Set up the uart parameters in the parameter ram. + */ + up->smc_rbase = dpaddr; + up->smc_tbase = dpaddr+sizeof(cbd_t); + up->smc_rfcr = SMC_EB; + up->smc_tfcr = SMC_EB; + + /* Set UART mode, 8 bit, no parity, one stop. + * Enable receive and transmit. + */ + sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART; + + /* Mask all interrupts and remove anything pending. + */ + sp->smc_smcm = 0; + sp->smc_smce = 0xff; + + /* Set up the baud rate generator. + * See 8xx_io/commproc.c for details. + * This wires BRG1 to SMC1 and BRG2 to SMC2; + */ + cp->cp_simode = 0x10000000; + ui = bd->bi_intfreq / 16 / bd->bi_baudrate; +#ifdef TQM_SMC2_CONSOLE + cp->cp_brgc2 = +#else + cp->cp_brgc1 = +#endif + ((ui - 1) < 4096) + ? (((ui - 1) << 1) | CPM_BRG_EN) + : ((((ui / 16) - 1) << 1) | CPM_BRG_EN | CPM_BRG_DIV16); + +#else /* CONFIG_MBX */ + if (*MBX_CSR1 & CSR1_COMEN) { + /* COM1 is enabled. Initialize SMC1 and use it for + * the console port. + */ + + /* Enable SDMA. + */ + ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sdcr = 1; + + /* Use Port B for SMCs instead of other functions. + */ + cp->cp_pbpar |= 0x00000cc0; + cp->cp_pbdir &= ~0x00000cc0; + cp->cp_pbodr &= ~0x00000cc0; + + /* Allocate space for two buffer descriptors in the DP ram. + * For now, this address seems OK, but it may have to + * change with newer versions of the firmware. + */ + dpaddr = 0x0800; + + /* Grab a few bytes from the top of memory. EPPC-Bug isn't + * running any more, so we can do this. + */ + memaddr = (bd->bi_memsize - 32) & ~15; + + /* Set the physical address of the host memory buffers in + * the buffer descriptors. + */ + rbdf = (cbd_t *)&cp->cp_dpmem[dpaddr]; + rbdf->cbd_bufaddr = memaddr; + rbdf->cbd_sc = 0; + tbdf = rbdf + 1; + tbdf->cbd_bufaddr = memaddr+4; + tbdf->cbd_sc = 0; + + /* Set up the uart parameters in the parameter ram. + */ + up->smc_rbase = dpaddr; + up->smc_tbase = dpaddr+sizeof(cbd_t); + up->smc_rfcr = SMC_EB; + up->smc_tfcr = SMC_EB; + + /* Set UART mode, 8 bit, no parity, one stop. + * Enable receive and transmit. + */ + sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART; + + /* Mask all interrupts and remove anything pending. + */ + sp->smc_smcm = 0; + sp->smc_smce = 0xff; + + /* Set up the baud rate generator. + * See 8xx_io/commproc.c for details. + */ + cp->cp_simode = 0x10000000; + cp->cp_brgc1 = + (((bd->bi_intfreq/16) / 9600) << 1) | CPM_BRG_EN; + + /* Enable SMC1 for console output. + */ + *MBX_CSR1 &= ~CSR1_COMEN; + } + else { +#endif /* ndef CONFIG_MBX */ + /* SMCx is used as console port. + */ + tbdf = (cbd_t *)&cp->cp_dpmem[up->smc_tbase]; + rbdf = (cbd_t *)&cp->cp_dpmem[up->smc_rbase]; + + /* Issue a stop transmit, and wait for it. + */ + cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_CONS, + CPM_CR_STOP_TX) | CPM_CR_FLG; + while (cp->cp_cpcr & CPM_CR_FLG); + } + + /* Make the first buffer the only buffer. + */ + tbdf->cbd_sc |= BD_SC_WRAP; + rbdf->cbd_sc |= BD_SC_EMPTY | BD_SC_WRAP; + + /* Single character receive. + */ + up->smc_mrblr = 1; + up->smc_maxidl = 0; + + /* Initialize Tx/Rx parameters. + */ + cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_CONS, CPM_CR_INIT_TRX) | CPM_CR_FLG; + while (cp->cp_cpcr & CPM_CR_FLG); + + /* Enable transmitter/receiver. + */ + sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN; + + /* This is ignored. + */ + return 0; +} + +void +serial_putc(void *ignored, const char c) +{ + volatile cbd_t *tbdf; + volatile char *buf; + volatile smc_uart_t *up; + + up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONS]; + tbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_tbase]; + + /* Wait for last character to go. + */ + buf = (char *)tbdf->cbd_bufaddr; + while (tbdf->cbd_sc & BD_SC_READY); + + *buf = c; + tbdf->cbd_datlen = 1; + tbdf->cbd_sc |= BD_SC_READY; +} + +char +serial_getc(void *ignored) +{ + volatile cbd_t *rbdf; + volatile char *buf; + volatile smc_uart_t *up; + char c; + + up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONS]; + rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase]; + + /* Wait for character to show up. + */ + buf = (char *)rbdf->cbd_bufaddr; + while (rbdf->cbd_sc & BD_SC_EMPTY); + c = *buf; + rbdf->cbd_sc |= BD_SC_EMPTY; + + return(c); +} + +int +serial_tstc(void *ignored) +{ + volatile cbd_t *rbdf; + volatile smc_uart_t *up; + + up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONS]; + rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase]; + + return(!(rbdf->cbd_sc & BD_SC_EMPTY)); +} + +void +serial_close(unsigned long com_port) +{ +} diff -urN linux-2.4.18/arch/ppc/boot/simple/misc-embedded.c linuxppc-2.4.18/arch/ppc/boot/simple/misc-embedded.c --- linux-2.4.18/arch/ppc/boot/simple/misc-embedded.c Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/simple/misc-embedded.c Thu Mar 7 10:52:12 2002 @@ -0,0 +1,229 @@ +/* + * BK Id: %F% %I% %G% %U% %#% + * + * Originally adapted by Gary Thomas. Much additional work by + * Cort Dougan . On top of that still more work by + * Dan Malek . + * + * Currently maintained by: Tom Rini + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nonstdio.h" +#include "zlib.h" + +/* The linker tells us where the image is. */ +extern char __image_begin, __image_end; +extern char __ramdisk_begin, __ramdisk_end; +extern char _end[]; + +/* Because of the limited amount of memory on embedded, it presents + * loading problems. The biggest is that we load this boot program + * into a relatively low memory address, and the Linux kernel Bss often + * extends into this space when it get loaded. When the kernel starts + * and zeros the BSS space, it also writes over the information we + * save here and pass to the kernel (usually board info). + * On these boards, we grab some known memory holes to hold this information. + */ +char cmd_buf[256]; +char *cmd_line = cmd_buf; +char *avail_ram; +char *end_avail; +char *zimage_start; + +/* This is for 4xx treeboot. It provides a place for the bootrom + * give us a pointer to a rom environment command line. + */ +char *bootrom_cmdline = ""; + +/* This is the default cmdline that will be given to the user at boot time.. + * If none was specified at compile time, we'll give it one that should work. + * -- Tom */ +#ifdef CONFIG_CMDLINE_BOOL +char compiled_string[] = CONFIG_CMDLINE; +#endif +char ramroot_string[] = "root=/dev/ram"; +char netroot_string[] = "root=/dev/nfs rw ip=auto"; + +/* Serial port to use. */ +unsigned long com_port; + +bd_t hold_resid_buf; +bd_t *hold_residual = &hold_resid_buf; + +extern unsigned long serial_init(int chan, bd_t *bp); +extern void serial_close(unsigned long com_port); +extern unsigned long start; +extern void flush_instruction_cache(void); +extern void gunzip(void *, int, unsigned char *, int *); +extern void embed_config(bd_t **bp); + +unsigned long +decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp) +{ + char *cp, ch; + int timer = 0, zimage_size; + unsigned long initrd_size; + + /* First, capture the embedded board information. Then + * initialize the serial console port. + */ + embed_config(&bp); +#ifdef CONFIG_SERIAL_CONSOLE + com_port = serial_init(0, bp); +#endif + + /* copy board data */ + if (bp) + memcpy(hold_residual,bp,sizeof(bd_t)); + + /* Set end of memory available to us. It is always the highest + * memory address provided by the board information. + */ + end_avail = (char *)(bp->bi_memsize); + + puts("\nloaded at: "); puthex(load_addr); + puts(" "); puthex((unsigned long)(load_addr + (4*num_words))); puts("\n"); + if ( (unsigned long)load_addr != (unsigned long)&start ) { + puts("relocated to: "); puthex((unsigned long)&start); + puts(" "); + puthex((unsigned long)((unsigned long)&start + (4*num_words))); + puts("\n"); + } + + if ( bp ) { + puts("board data at: "); puthex((unsigned long)bp); + puts(" "); + puthex((unsigned long)((unsigned long)bp + sizeof(bd_t))); + puts("\nrelocated to: "); + puthex((unsigned long)hold_residual); + puts(" "); + puthex((unsigned long)((unsigned long)hold_residual + sizeof(bd_t))); + puts("\n"); + } + + /* + * We link ourself to an arbitrary low address. When we run, we + * relocate outself to that address. __image_being points to + * the part of the image where the zImage is. -- Tom + */ + zimage_start = (char *)(unsigned long)(&__image_begin); + zimage_size = (unsigned long)(&__image_end) - + (unsigned long)(&__image_begin); + + initrd_size = (unsigned long)(&__ramdisk_end) - + (unsigned long)(&__ramdisk_begin); + + /* + * The zImage and initrd will be between start and _end, so they've + * already been moved once. We're good to go now. -- Tom + */ + puts("zimage at: "); puthex((unsigned long)zimage_start); + puts(" "); puthex((unsigned long)(zimage_size+zimage_start)); + puts("\n"); + + if ( initrd_size ) { + puts("initrd at: "); + puthex((unsigned long)(&__ramdisk_begin)); + puts(" "); puthex((unsigned long)(&__ramdisk_end));puts("\n"); + } + + /* + * setup avail_ram - this is the first part of ram usable + * by the uncompress code. Anything after this program in RAM + * is now fair game. -- Tom + */ + avail_ram = (char *)PAGE_ALIGN((unsigned long)_end); + + puts("avail ram: "); puthex((unsigned long)avail_ram); puts(" "); + puthex((unsigned long)end_avail); puts("\n"); + puts("\nLinux/PPC load: "); + cp = cmd_line; + /* This is where we try and pick the right command line for booting. + * If we were given one at compile time, use it. It Is Right. + * If we weren't, see if we have a ramdisk. If so, thats root. + * When in doubt, give them the netroot (root=/dev/nfs rw) -- Tom + */ +#ifdef CONFIG_CMDLINE_BOOL + memcpy (cmd_line, compiled_string, sizeof(compiled_string)); +#else + if ( initrd_size ) + memcpy (cmd_line, ramroot_string, sizeof(ramroot_string)); + else + memcpy (cmd_line, netroot_string, sizeof(netroot_string)); +#endif + while ( *cp ) + putc(*cp++); + while (timer++ < 5*1000) { + if (tstc()) { + while ((ch = getc()) != '\n' && ch != '\r') { + if (ch == '\b' || ch == '\177') { + if (cp != cmd_line) { + cp--; + puts("\b \b"); + } + } else if (ch == '\030' /* ^x */ + || ch == '\025') { /* ^u */ + while (cp != cmd_line) { + cp--; + puts("\b \b"); + } + } else { + *cp++ = ch; + putc(ch); + } + } + break; /* Exit 'timer' loop */ + } + udelay(1000); /* 1 msec */ + } + *cp = 0; + puts("\nUncompressing Linux..."); + + gunzip(0, 0x400000, zimage_start, &zimage_size); + flush_instruction_cache(); + puts("done.\n"); + { + struct bi_record *rec; + + rec = (struct bi_record *)_ALIGN((unsigned long)zimage_size + + (1 << 20) - 1,(1 << 20)); + + rec->tag = BI_FIRST; + rec->size = sizeof(struct bi_record); + 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; + rec = (struct bi_record *)((unsigned long)rec + rec->size); + + if ( initrd_size ) { + rec->tag = BI_INITRD; + rec->data[0] = (unsigned long)(&__ramdisk_begin); + rec->data[1] = initrd_size; + rec->size = sizeof(struct bi_record) + 2 * + sizeof(unsigned long); + rec = (struct bi_record *)((unsigned long)rec + + rec->size); + } + + 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"); + serial_close(com_port); + + return (unsigned long)hold_residual; +} diff -urN linux-2.4.18/arch/ppc/boot/tree/Makefile linuxppc-2.4.18/arch/ppc/boot/tree/Makefile --- linux-2.4.18/arch/ppc/boot/tree/Makefile Wed Jul 4 14:33:18 2001 +++ linuxppc-2.4.18/arch/ppc/boot/tree/Makefile Thu Jan 1 10:00:00 1970 @@ -1,66 +0,0 @@ -# BK Id: SCCS/s.Makefile 1.7 06/15/01 13:16:10 paulus -# -# -# Module name: Makefile -# -# Description: -# Makefile for the IBM "tree" evaluation board Linux kernel -# boot loaders. -# -# -# Copyright (c) 1999 Grant Erickson -# -# PPC-405 modification -# Copyright 2000-2001 MontaVista Software Inc. -# Author: MontaVista Software, Inc. -# frank_rowand@mvista.com or source@mvista.com -# debbie_chu@mvista.com -# - -HOSTCFLAGS = -O -I$(TOPDIR)/include - -CC = $(CROSS_COMPILE)gcc -LD = $(CROSS_COMPILE)ld -OBJCOPY = $(CROSS_COMPILE)objcopy -OBJDUMP = $(CROSS_COMPILE)objdump - -GZIP = gzip -vf9 -RM = rm -f -MKEVIMG = ../utils/mkevimg -l -c -MKIRIMG = ../utils/mkirimg -CFLAGS += -I$(TOPDIR)/drivers/net -LD_ARGS = -e _start -T ld.script -Ttext 0x00200000 -Bstatic - -OBJS = ../common/crt0.o main.o misc.o irSect.o ../common/string.o \ - ../common/misc-common.o ../common/ns16550.o -LIBS = ../lib/zlib.a - -treeboot: $(OBJS) $(LIBS) ld.script - $(LD) -o $@ $(LD_ARGS) $(OBJS) $(LIBS) - -zImage: vmlinux.img - -zImage.initrd: vmlinux.initrd.img - -treeboot.image: treeboot - $(OBJCOPY) --add-section=image=../images/vmlinux.gz treeboot $@ - -treeboot.initrd: treeboot.image ramdisk.image.gz - $(OBJCOPY) --add-section=initrd=ramdisk.image.gz treeboot.image $@ - -vmlinux.img: treeboot.image - $(OBJDUMP) --syms treeboot.image | grep irSectStart > irSectStart.txt - $(MKIRIMG) treeboot.image treeboot.image.out irSectStart.txt - $(MKEVIMG) treeboot.image.out ../images/vmlinux.tree.img - $(RM) treeboot.image treeboot.image.out irSectStart.txt - -vmlinux.initrd.img: treeboot.initrd - $(OBJDUMP) --all-headers treeboot.initrd | grep irSectStart > irSectStart.txt - $(MKIRIMG) treeboot.initrd treeboot.initrd.out irSectStart.txt - $(MKEVIMG) treeboot.initrd.out ../images/vmlinux.tree.initrd.img - $(RM) treeboot.initrd treeboot.initrd.out irSectStart.txt - -clean: - rm -f treeboot treeboot.image treeboot.initrd irSectStart.txt vmlinux.* - -include $(TOPDIR)/Rules.make diff -urN linux-2.4.18/arch/ppc/boot/tree/irSect.c linuxppc-2.4.18/arch/ppc/boot/tree/irSect.c --- linux-2.4.18/arch/ppc/boot/tree/irSect.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/tree/irSect.c Thu Jan 1 10:00:00 1970 @@ -1,39 +0,0 @@ -/* - * BK Id: SCCS/s.irSect.c 1.6 05/18/01 15:17:22 cort - */ -/* - * - * Copyright (c) 1999 Grant Erickson - * - * Module name: irSect.c - * - * Description: - * Defines variables to hold the absolute starting address and size - * of the Linux kernel "image" and the initial RAM disk "initrd" - * sections within the boot loader. - * - */ - -#include "irSect.h" - - -/* - * The order of globals below must not change. If more globals are added, - * you must change the script 'mkirimg' accordingly. - * - */ - -/* - * irSectStart must be at beginning of file - */ -unsigned int irSectStart = 0xdeadbeaf; - -unsigned int imageSect_start = 0; -unsigned int imageSect_size = 0; -unsigned int initrdSect_start = 0; -unsigned int initrdSect_size = 0; - -/* - * irSectEnd must be at end of file - */ -unsigned int irSectEnd = 0xdeadbeaf; diff -urN linux-2.4.18/arch/ppc/boot/tree/irSect.h linuxppc-2.4.18/arch/ppc/boot/tree/irSect.h --- linux-2.4.18/arch/ppc/boot/tree/irSect.h Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/tree/irSect.h Thu Jan 1 10:00:00 1970 @@ -1,35 +0,0 @@ -/* - * BK Id: SCCS/s.irSect.h 1.6 05/18/01 15:17:22 cort - */ -/* - * - * Copyright (c) 1999 Grant Erickson - * - * Module name: irSect.h - * - * Description: - * Defines variables to hold the absolute starting address and size - * of the Linux kernel "image" and the initial RAM disk "initrd" - * sections within the boot loader. - * - */ - -#ifndef __IRSECT_H__ -#define __IRSECT_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -extern unsigned int imageSect_start; -extern unsigned int imageSect_size; - -extern unsigned int initrdSect_start; -extern unsigned int initrdSect_size; - - -#ifdef __cplusplus -} -#endif - -#endif /* __IRSECT_H__ */ diff -urN linux-2.4.18/arch/ppc/boot/tree/ld.script linuxppc-2.4.18/arch/ppc/boot/tree/ld.script --- linux-2.4.18/arch/ppc/boot/tree/ld.script Wed Jul 4 14:33:18 2001 +++ linuxppc-2.4.18/arch/ppc/boot/tree/ld.script Thu Jan 1 10:00:00 1970 @@ -1,69 +0,0 @@ -OUTPUT_ARCH(powerpc) -SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; */ -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - . = + SIZEOF_HEADERS; - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .rel.text : { *(.rel.text) } - .rela.text : { *(.rela.text) } - .rel.data : { *(.rel.data) } - .rela.data : { *(.rela.data) } - .rel.rodata : { *(.rel.rodata) } - .rela.rodata : { *(.rela.rodata) } - .rel.got : { *(.rel.got) } - .rela.got : { *(.rela.got) } - .rel.ctors : { *(.rel.ctors) } - .rela.ctors : { *(.rela.ctors) } - .rel.dtors : { *(.rel.dtors) } - .rela.dtors : { *(.rela.dtors) } - .rel.bss : { *(.rel.bss) } - .rela.bss : { *(.rela.bss) } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } - .init : { *(.init) } =0 - .plt : { *(.plt) } - .text : - { - *(.text) - *(.rodata) - *(.rodata.*) - *(.rodata1) - *(.got1) - } - .fini : { *(.fini) } =0 - .ctors : { *(.ctors) } - .dtors : { *(.dtors) } - _etext = .; - PROVIDE (etext = .); - /* Read-write section, merged into data segment: */ - . = (. + 0x0FFF) & 0xFFFFF000; - .data : - { - *(.data) - *(.data1) - *(.sdata) - *(.sdata2) - *(.got.plt) *(.got) - *(.dynamic) - CONSTRUCTORS - } - _edata = .; - PROVIDE (edata = .); - __bss_start = .; - .bss : - { - *(.sbss) *(.scommon) - *(.dynbss) - *(.bss) - *(COMMON) - } - _end = . ; - PROVIDE (end = .); -} - diff -urN linux-2.4.18/arch/ppc/boot/tree/main.c linuxppc-2.4.18/arch/ppc/boot/tree/main.c --- linux-2.4.18/arch/ppc/boot/tree/main.c Wed Jul 4 14:33:18 2001 +++ linuxppc-2.4.18/arch/ppc/boot/tree/main.c Thu Jan 1 10:00:00 1970 @@ -1,212 +0,0 @@ -/* - * BK Id: SCCS/s.main.c 1.9 06/15/01 13:16:10 paulus - */ -/* - * Copyright (c) 1997 Paul Mackerras - * Initial Power Macintosh COFF version. - * Copyright (c) 1999 Grant Erickson - * Modifications for an ELF-based IBM evaluation board version. - * Copyright 2000-2001 MontaVista Software Inc. - * PPC405GP modifications - * Author: MontaVista Software, Inc. - * frank_rowand@mvista.com or source@mvista.com - * debbie_chu@mvista.com - * - * Module name: main.c - * - * Description: - * This module does most of the real work for the boot loader. It - * checks the variables holding the absolute start address and size - * of the Linux kernel "image" and initial RAM disk "initrd" sections - * and if they are present, moves them to their "proper" locations. - * - * For the Linux kernel, "proper" is physical address 0x00000000. - * For the RAM disk, "proper" is the image's size below the top - * of physical memory. The Linux kernel may be in either raw - * binary form or compressed with GNU zip (aka gzip). - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - */ - -#include -#include - -#include "nonstdio.h" -#include "irSect.h" -#if defined(CONFIG_SERIAL_CONSOLE) -#include "ns16550.h" -#endif /* CONFIG_SERIAL_CONSOLE */ - - -/* Preprocessor Defines */ - -/* - * Location of the IBM boot ROM function pointer address for retrieving - * the board information structure. - */ - -#define BOARD_INFO_VECTOR 0xFFFE0B50 - -/* - * Warning: the board_info doesn't contain valid data until get_board_info() - * gets called in start(). - */ -#define RAM_SIZE board_info.bi_memsize - -#define RAM_PBASE 0x00000000 -#define RAM_PEND (RAM_PBASE + RAM_SIZE) - -#define RAM_VBASE 0xC0000000 -#define RAM_VEND (RAM_VBASE + RAM_SIZE) - -#define RAM_START RAM_PBASE -#define RAM_END RAM_PEND -#define RAM_FREE (imageSect_start + imageSect_size + initrdSect_size) - -#define PROG_START RAM_START - - -/* Function Macros */ - -#define ALIGN_UP(x, align) (((x) + ((align) - 1)) & ~((align) - 1)) - -/* Global Variables */ - -/* Needed by zalloc and zfree for allocating memory */ - -char *avail_ram; /* Indicates start of RAM available for heap */ -char *end_avail; /* Indicates end of RAM available for heap */ - -/* Needed for serial I/O. -*/ -extern unsigned long *com_port; - -bd_t board_info; - -/* -** The bootrom may change bootrom_cmdline to point to a buffer in the -** bootrom. -*/ -char *bootrom_cmdline = ""; -char treeboot_bootrom_cmdline[512]; - -#ifdef CONFIG_CMDLINE -char *cmdline = CONFIG_CMDLINE; -#else -char *cmdline = ""; -#endif - -/* Function Prototypes */ - -extern void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp); - -void -kick_watchdog(void) -{ -#ifdef CONFIG_405GP - mtspr(SPRN_TSR, (TSR_ENW | TSR_WIS)); -#endif -} - -void start(void) -{ - void *options; - int ns, oh, i; - unsigned long sa, len; - void *dst; - unsigned char *im; - unsigned long initrd_start, initrd_size; - bd_t *(*get_board_info)(void) = - (bd_t *(*)(void))(*(unsigned long *)BOARD_INFO_VECTOR); - bd_t *bip = NULL; - - - com_port = (struct NS16550 *)serial_init(0); - -#ifdef CONFIG_405GP - /* turn off on-chip ethernet */ - /* This is to fix a problem with early walnut bootrom. */ - - { - /* Physical mapping of ethernet register space. */ - static struct ppc405_enet_regs *ppc405_enet_regp = - (struct ppc405_enet_regs *)PPC405_EM0_REG_ADDR; - - mtdcr(DCRN_MALCR, MALCR_MMSR); /* 1st reset MAL */ - - while (mfdcr(DCRN_MALCR) & MALCR_MMSR) {}; /* wait for the reset */ - - ppc405_enet_regp->em0mr0 = 0x20000000; /* then reset EMAC */ - } -#endif - - if ((bip = get_board_info()) != NULL) - memcpy(&board_info, bip, sizeof(bd_t)); - - /* Init RAM disk (initrd) section */ - - kick_watchdog(); - - if (initrdSect_start != 0 && (initrd_size = initrdSect_size) != 0) { - initrd_start = (RAM_END - initrd_size) & ~0xFFF; - - _printk("Initial RAM disk at 0x%08x (%u bytes)\n", - initrd_start, initrd_size); - - memcpy((char *)initrd_start, - (char *)(initrdSect_start), - initrdSect_size); - - end_avail = (char *)initrd_start; - } else { - initrd_start = initrd_size = 0; - end_avail = (char *)RAM_END; - } - - /* Linux kernel image section */ - - kick_watchdog(); - - im = (unsigned char *)(imageSect_start); - len = imageSect_size; - dst = (void *)PROG_START; - - /* Check for the gzip archive magic numbers */ - - if (im[0] == 0x1f && im[1] == 0x8b) { - - /* The gunzip routine needs everything nice and aligned */ - - void *cp = (void *)ALIGN_UP(RAM_FREE, 8); - avail_ram = (void *)(cp + ALIGN_UP(len, 8)); /* used by zalloc() */ - memcpy(cp, im, len); - - /* I'm not sure what the 0x200000 parameter is for, but it works. */ - /* It tells gzip the end of the area you wish to reserve, and it - * can use data past that point....unfortunately, this value - * isn't big enough (luck ran out). -- Dan - */ - - gunzip(dst, 0x400000, cp, (int *)&len); - } else { - memmove(dst, im, len); - } - - kick_watchdog(); - - flush_cache(dst, len); - - sa = (unsigned long)dst; - - (*(void (*)())sa)(&board_info, - initrd_start, - initrd_start + initrd_size, - cmdline, - cmdline + strlen(cmdline)); - - pause(); -} diff -urN linux-2.4.18/arch/ppc/boot/tree/misc.S linuxppc-2.4.18/arch/ppc/boot/tree/misc.S --- linux-2.4.18/arch/ppc/boot/tree/misc.S Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/tree/misc.S Thu Jan 1 10:00:00 1970 @@ -1,43 +0,0 @@ -/* - * BK Id: SCCS/s.misc.S 1.7 05/18/01 06:20:29 patch - */ -/* - * Copyright (C) Paul Mackerras 1997. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include "../../kernel/ppc_asm.tmpl" - - .text - -/* - * Flush the dcache and invalidate the icache for a range of addresses. - * - * flush_cache(addr, len) - */ - .global flush_cache -flush_cache: - mfpvr r5 # Get processor version register - extrwi r5,r5,16,0 # Get the version bits - cmpwi cr0,r5,0x0020 # Is this a 403-based processor? - beq 1f # Yes, it is - li r5,32 # It is not a 403, set to 32 bytes - addi r4,r4,32-1 # len += line_size - 1 - srwi. r4,r4,5 # Convert from bytes to lines - b 2f -1: li r5,16 # It is a 403, set to 16 bytes - addi r4,r4,16-1 # len += line_size - 1 - srwi. r4,r4,4 # Convert from bytes to lines -2: mtctr r4 # Set-up the counter register - beqlr # If it is 0, we are done -3: dcbf r0,r3 # Flush and invalidate the data line - icbi r0,r3 # Invalidate the instruction line - add r3,r3,r5 # Move to the next line - bdnz 3b # Are we done yet? - sync - isync - blr # Return to the caller diff -urN linux-2.4.18/arch/ppc/boot/utils/Makefile linuxppc-2.4.18/arch/ppc/boot/utils/Makefile --- linux-2.4.18/arch/ppc/boot/utils/Makefile Sat Jul 21 09:51:52 2001 +++ linuxppc-2.4.18/arch/ppc/boot/utils/Makefile Thu Mar 7 10:51:47 2002 @@ -10,7 +10,7 @@ all: dummy # Simple programs with 1 file and no extra CFLAGS -UTILS = addnote hack-coff mkprep mksimage mknote piggyback mkpmon mkbugboot +UTILS = addnote hack-coff mkprep mknote mktree $(UTILS): $(HOSTCC) $(HOSTCFLAGS) -o $@ $@.c diff -urN linux-2.4.18/arch/ppc/boot/utils/addnote.c linuxppc-2.4.18/arch/ppc/boot/utils/addnote.c --- linux-2.4.18/arch/ppc/boot/utils/addnote.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/utils/addnote.c Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.addnote.c 1.7 05/18/01 15:17:23 cort + * BK Id: SCCS/s.addnote.c 1.8 06/05/01 20:20:06 paulus */ /* * Program to hack in a PT_NOTE program header entry in an ELF file. diff -urN linux-2.4.18/arch/ppc/boot/utils/hack-coff.c linuxppc-2.4.18/arch/ppc/boot/utils/hack-coff.c --- linux-2.4.18/arch/ppc/boot/utils/hack-coff.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/utils/hack-coff.c Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.hack-coff.c 1.8 05/18/01 06:20:29 patch + * BK Id: SCCS/s.hack-coff.c 1.9 06/05/01 20:20:06 paulus */ /* * hack-coff.c - hack the header of an xcoff file to fill in diff -urN linux-2.4.18/arch/ppc/boot/utils/mkevimg linuxppc-2.4.18/arch/ppc/boot/utils/mkevimg --- linux-2.4.18/arch/ppc/boot/utils/mkevimg Wed Jul 4 14:33:18 2001 +++ linuxppc-2.4.18/arch/ppc/boot/utils/mkevimg Thu Jan 1 10:00:00 1970 @@ -1,488 +0,0 @@ -#!/usr/bin/perl - -# -# Copyright (c) 1998-1999 TiVo, Inc. -# All rights reserved. -# -# Copyright (c) 1999 Grant Erickson -# Major syntactic and usability rework. -# -# Module name: mkevimg -# -# Description: -# Converts an ELF output file from the linker into the format used by -# the IBM evaluation board ROM Monitor to load programs from a host -# onto the evaluation board. The ELF file must be an otherwise execut- -# able file (with the text and data addresses bound at link time) and -# have space reserved after the entry point for the load information -# block: -# -# typedef struct boot_block { -# unsigned long magic; 0x0052504F -# unsigned long dest; Target address of the image -# unsigned long num_512blocks; Size, rounded-up, in 512 byte blocks -# unsigned long debug_flag; Run the debugger or image after load -# unsigned long entry_point; The image address to jump to after load -# unsigned long checksum; 32 bit checksum including header -# unsigned long reserved[2]; -# } boot_block_t; -# -# - -use File::Basename; -use Getopt::Std; - -# -# usage() -# -# Description: -# This routine prints out the proper command line usage for this program -# -# Input(s): -# status - Flag determining what usage information will be printed and what -# the exit status of the program will be after the information is -# printed. -# -# Output(s): -# N/A -# -# Returns: -# This subroutine does not return. -# - -sub usage { - my($status); - $status = $_[0]; - - printf("Usage: %s [-hlvV] \n", - $program); - - if ($status != 0) { - printf("Try `%s -h' for more information.\n", $program); - } - - if ($status != 1) { - print(" -c Put checksum in load information block.\n"); - print(" -h Print out this message and exit.\n"); - print(" -l Linux mode; if present, copy 'image' and 'initrd' sections.\n"); - print(" -v Verbose. Print out lots of ELF information.\n"); - print(" -V Print out version information and exit.\n"); - } - - exit($status); -} - -# -# version() -# -# Description: -# This routine prints out program version information -# -# Input(s): -# N/A -# -# Output(s): -# N/A -# -# Returns: -# This subroutine does not return. -# - -sub version { - print("mkevimg Version 1.1.0\n"); - print("Copyright (c) 1998-1999 TiVo, Inc.\n"); - print("Copyright (c) 1999 Grant Erickson \n"); - - exit (0); -} - -# -# file_check() -# -# Description: -# This routine checks an input file to ensure that it exists, is a -# regular file, and is readable. -# -# Input(s): -# file - Input file to be checked. -# -# Output(s): -# N/A -# -# Returns: -# 0 if the file exists, is a regular file, and is readable, otherwise -1. -# - -sub file_check { - my($file); - $file = $_[0]; - - if (!(-e $file)) { - printf("The file \"%s\" does not exist.\n", $file); - return (-1); - } elsif (!(-f $file)) { - printf("The file \"%s\" is not a regular file.\n", $file); - return (-1); - } elsif (!(-r $file)) { - printf("The file \"%s\" is not readable.\n", $file); - return (-1); - } - - return (0); -} - -# -# decode_options() -# -# Description: -# This routine steps through the command-line arguments, parsing out -# recognzied options. -# -# Input(s): -# N/A -# -# Output(s): -# N/A -# -# Returns: -# N/A -# - -sub decode_options { - - if (!getopts("chlvV")) { - usage(1); - } - - if ($opt_c) { - $do_checksum = 1; - } - - if ($opt_h) { - usage(0); - } - - if ($opt_l) { - $linux = 1; - } - - if ($opt_V) { - version(); - exit (0); - } - - if ($opt_v) { - $verbose = 1; - } - - if (!($ifile = shift(@ARGV))) { - usage(1); - } - - if (!($ofile = shift(@ARGV))) { - usage (1); - } - - if (file_check($ifile)) { - exit(1); - } - -} - -# -# ELF file and section header field numbers -# - -require '../utils/elf.pl'; - -# -# Main program body -# - -{ - $program = basename($0); - - decode_options(); - - open(ELF, "<$ifile") || die "Cannot open input file"; - - $ifilesize = (-s $ifile); - - if ($verbose) { - print("Output file: $ofile\n"); - print("Input file: $ifile, $ifilesize bytes.\n"); - } - - if (read(ELF, $ibuf, $ifilesize) != $ifilesize) { - print("Failed to read input file!\n"); - exit(1); - } - - # - # Parse ELF header - # - - @eh = unpack("a16n2N5n6", $ibuf); - - # - # Make sure this is actually a PowerPC ELF file. - # - - if (substr($eh[$e_ident], 0, 4) ne "\177ELF") { - printf("The file \"%s\" is not an ELF file.\n", $ifile); - exit (1); - } elsif ($eh[$e_machine] != 20) { - printf("The file \"%s\" is not a PowerPC ELF file.\n", $ifile); - exit (1); - } - - if ($verbose) { - print("File header:\n"); - printf(" Identifier: %s\n", $eh[$e_ident]); - printf(" Type: %d\n", $eh[$e_type]); - printf(" Machine: %d\n", $eh[$e_machine]); - printf(" Version: %d\n", $eh[$e_version]); - printf(" Entry point: 0x%08x\n", $eh[$e_entry]); - printf(" Program header offset: 0x%x\n", $eh[$e_phoff]); - printf(" Section header offset: 0x%x\n", $eh[$e_shoff]); - printf(" Flags: 0x%08x\n", $eh[$e_flags]); - printf(" Header size: %d\n", $eh[$e_ehsize]); - printf(" Program entry size: %d\n", $eh[$e_phentsize]); - printf(" Program table entries: %d\n", $eh[$e_phnum]); - printf(" Section header size: %d\n", $eh[$e_shentsize]); - printf(" Section table entries: %d\n", $eh[$e_shnum]); - printf(" String table section: %d\n", $eh[$e_shstrndx]); - } - - # - # Find the section header for the string table. - # - - $strtable_section_offset = $eh[$e_shoff] + - $eh[$e_shstrndx] * $eh[$e_shentsize]; - - if ($verbose) { - printf("String table section header offset: 0x%x\n", - $strtable_section_offset); - } - - # - # Find the start of the string table. - # - - @strh = unpack("N10", substr($ibuf, $strtable_section_offset, - $eh[$e_shentsize])); - - if ($verbose) { - printf("Section name strings start at: 0x%x, %d bytes.\n", - $strh[$sh_offset], $strh[$sh_size]); - } - - $names = substr($ibuf, $strh[$sh_offset], $strh[$sh_size]); - - # Grab each section header and find '.text' and '.bss' sections in - # particular. - - if ($verbose) { - print("Section headers:\n"); - print("Idx Name Size Address File off Algn\n"); - print("--- ------------------------ -------- -------- -------- ----\n"); - } - - $off = $eh[$e_shoff]; - - for($i = 0; $i < $eh[$e_shnum]; $i++, $off += $eh[$e_shentsize]) { - @sh = unpack("N10", substr($ibuf, $off, $eh[$e_shentsize])); - - # Take the first section name from the array returned by split. - - ($name) = split(/\000/, substr($names, $sh[$sh_name])); - - if ($verbose) { - printf("%3d %-24s %8x %08x %08x %4d\n", - $i, $name, $sh[$sh_size], $sh[$sh_addr], - $sh[$sh_offset], $sh[$sh_addralign]); - } - - # Attempt to find the .text and .bss sections - - if ($name =~ /^\.bss$/) { - ($bss_addr, $bss_offset, $bss_size) = - ($sh[$sh_addr], $sh[$sh_offset], $sh[$sh_size]); - - } elsif ($name =~ /^\.text$/) { - ($text_addr, $text_offset, $text_size) = - ($sh[$sh_addr], $sh[$sh_offset], $sh[$sh_size]); - - } elsif ($linux && ($name =~ /^\image$/)) { - $image_found = 1; - - ($image_addr, $image_offset, $image_size) = - ($sh[$sh_addr], $sh[$sh_offset], $sh[$sh_size]); - - } elsif ($linux && ($name =~ /^\initrd$/)) { - $initrd_found = 1; - - ($initrd_addr, $initrd_offset, $initrd_size) = - ($sh[$sh_addr], $sh[$sh_offset], $sh[$sh_size]); - - } - } - - printf("Text section - Address: 0x%08x, Size: 0x%08x\n", - $text_addr, $text_size); - printf("Bss section - Address: 0x%08x, Size: 0x%08x\n", - $bss_addr, $bss_size); - - if ($linux) { - if ($image_found) { - printf("Image section - Address: 0x%08x, Size: 0x%08x\n", - $image_addr, $image_size); - } - - if ($initrd_found) { - printf("Initrd section - Address: 0x%08x, Size: 0x%08x\n", - $initrd_addr, $initrd_size); - } - } - - # - # Open output file - # - - open(BOOT, ">$ofile") || die "Cannot open output file"; - - # - # Compute image size - # - - $output_size = $bss_offset - $text_offset + $bss_size; - - if ($linux && $image_found) { - $output_size += $image_size; - } - - if ($linux && $initrd_found) { - $output_size += $initrd_size; - } - - # - # Compute size with header - # - - $header = pack("H8N7", "0052504f", 0, 0, 0, 0, 0, 0, 0); - $num_blocks = ($output_size + length($header) + 511) / 512; - - # - # Write IBM PowerPC evaluation board boot_block_t header - # - - $header = pack("H8N7", "0052504f", $text_addr, $num_blocks, 0, - $text_addr, 0, 0, 0); - - - $bytes = length($header); - - if (($resid = syswrite(BOOT, $header, $bytes)) != $bytes) { - die("Could not write boot image header to output file."); - } - - printf("Entry point = 0x%08x\n", $text_addr); - printf("Image size = 0x%08x (%d bytes) (%d blocks).\n", - $output_size, $output_size, $num_blocks); - - # - # Write image starting after ELF and program headers and - # continuing to beginning of bss - # - - $bytes = $bss_offset - $text_offset + $bss_size; - - if (($resid = syswrite(BOOT, $ibuf, $bytes, $text_offset)) != $bytes) { - die("Could not write boot image to output file.\n"); - } - - # - # If configured, write out the image and initrd sections as well - # - - if ($linux) { - if ($image_found) { - $bytes = $image_size; - if (($resid = syswrite(BOOT, $ibuf, $bytes, $image_offset)) != $bytes) { - die("Could not write boot image to output file.\n"); - } - } - - if ($initrd_found) { - $bytes = $initrd_size; - if (($resid = syswrite(BOOT, $ibuf, $bytes, $initrd_offset)) != $bytes) { - die("Could not write boot image to output file.\n"); - } - } - } - - # - # Pad to a multiple of 512 bytes - # If the (size of the boot image mod 512) is between 509 and 511 bytes - # then the tftp to the Walnut fails. This may be fixed in more recent - # Walnut bootrom. - # - - $pad_size = 512 - ((length($header) + $output_size) % 512); - if ($pad_size == 512) { - $pad_size = 0; - } - - if ($pad_size != 0) { - - if ($verbose) { - print("Padding boot image by an additional $pad_size bytes.\n"); - } - - $pad_string = pack("H8","deadbeef") x 128; - - syswrite(BOOT, $pad_string, $pad_size) or - die "Could not pad boot image in output file.\n"; - - } - - # - # Compute 32 bit checksum over entire file. - # - - if ($do_checksum) { - - close(BOOT); - open(BOOT, "+<$ofile") || die "Cannot open output file"; - undef $/; - $temp = unpack("%32N*", ); - # Solaris and PPC Linux return 0x80000000 for "-$temp" when $temp - # is negative. "~($temp - 1)" negates $temp properly. - $csum = ~($temp - 1); - printf("Checksum = 0x%08x\r\n", $csum); - - # - # Rewrite IBM PowerPC evaluation board boot_block_t header, - # this time with the checksum included - # - - $header = pack("H8N7", "0052504f", $text_addr, $num_blocks, 0, - $text_addr, $csum, 0, 0); - - seek(BOOT, 0, 0); - syswrite(BOOT, $header, length($header)) or - die("Could not write boot image header to output file."); - - } - - # - # Clean-up and leave - # - - close(BOOT); - - print("\nBoot image file \"$ofile\" built successfully.\n\n"); - - exit(0); -} diff -urN linux-2.4.18/arch/ppc/boot/utils/mkimage.wrapper linuxppc-2.4.18/arch/ppc/boot/utils/mkimage.wrapper --- linux-2.4.18/arch/ppc/boot/utils/mkimage.wrapper Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/utils/mkimage.wrapper Thu Mar 7 10:51:52 2002 @@ -0,0 +1,16 @@ +#!/bin/bash + +# +# Build PPCBoot image when `mkimage' tool is available. +# + +MKIMAGE=$(type -path mkimage) + +if [ -z "${MKIMAGE}" ]; then + # Doesn't exist + echo '"mkimage" command not found - PPCBoot images will not be built' >&2 + exit 0; +fi + +# Call "mkimage" to create PPCBoot image +${MKIMAGE} "$@" diff -urN linux-2.4.18/arch/ppc/boot/utils/mkirimg linuxppc-2.4.18/arch/ppc/boot/utils/mkirimg --- linux-2.4.18/arch/ppc/boot/utils/mkirimg Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/utils/mkirimg Thu Jan 1 10:00:00 1970 @@ -1,367 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (c) 1998-1999 TiVo, Inc. -# Original ELF parsing code. -# -# Copyright (c) 1999 Grant Erickson -# Original code from 'mkevimg'. -# -# Module name: mkirimg -# -# Description: -# Reads an ELF file and assigns global variables 'imageSect_start', -# 'imageSect_size', 'initrdSect_start', and 'initrdSect_size' from -# the "image" and "initrd" section header information. It then -# rewrites the input ELF file with assigned globals to an output -# file. -# -# An input file, "irSectStart.txt" has the memory address of -# 'irSectStart'. The irSectStart memory address is used to find -# the global variables in the ".data" section of the ELF file. -# The 'irSectStart' and the above global variables are defined -# in "irSect.c". -# -# - -use File::Basename; -use Getopt::Std; - -# -# usage() -# -# Description: -# This routine prints out the proper command line usage for this program -# -# Input(s): -# status - Flag determining what usage information will be printed and what -# the exit status of the program will be after the information is -# printed. -# -# Output(s): -# N/A -# -# Returns: -# This subroutine does not return. -# - -sub usage { - my($status); - $status = $_[0]; - - printf("Usage: %s [-hvV] \n", - $program); - - if ($status != 0) { - printf("Try `%s -h' for more information.\n", $program); - } - - if ($status != 1) { - print(" -h Print out this message and exit.\n"); - print(" -v Verbose. Print out lots of ELF information.\n"); - print(" -V Print out version information and exit.\n"); - } - - exit($status); -} - -# -# version() -# -# Description: -# This routine prints out program version information -# -# Input(s): -# N/A -# -# Output(s): -# N/A -# -# Returns: -# This subroutine does not return. -# - -sub version { - print("mkirimg Version 1.1.0\n"); - print("Copyright (c) 1998-1999 TiVo, Inc.\n"); - print("Copyright (c) 1999 Grant Erickson \n"); - - exit (0); -} - -# -# file_check() -# -# Description: -# This routine checks an input file to ensure that it exists, is a -# regular file, and is readable. -# -# Input(s): -# file - Input file to be checked. -# -# Output(s): -# N/A -# -# Returns: -# 0 if the file exists, is a regular file, and is readable, otherwise -1. -# - -sub file_check { - my($file); - $file = $_[0]; - - if (!(-e $file)) { - printf("The file \"%s\" does not exist.\n", $file); - return (-1); - } elsif (!(-f $file)) { - printf("The file \"%s\" is not a regular file.\n", $file); - return (-1); - } elsif (!(-r $file)) { - printf("The file \"%s\" is not readable.\n", $file); - return (-1); - } - - return (0); -} - -# -# decode_options() -# -# Description: -# This routine steps through the command-line arguments, parsing out -# recognzied options. -# -# Input(s): -# N/A -# -# Output(s): -# N/A -# -# Returns: -# N/A -# - -sub decode_options { - - if (!getopts("hvV")) { - usage(1); - } - - if ($opt_h) { - usage(0); - } - - if ($opt_V) { - version(); - exit (0); - } - - if ($opt_v) { - $verbose = 1; - } - - if (!($ElfFile = shift(@ARGV))) { - usage(1); - } - - if (!($OutputFile = shift(@ARGV))) { - usage (1); - } - - if (!($IrFile = shift(@ARGV))) { - usage (1); - } - - if (file_check($ElfFile)) { - exit(1); - } - - if (file_check($IrFile)) { - exit(1); - } -} - -# -# ELF file and section header field numbers -# - -require '../utils/elf.pl'; - -# -# Main program body -# - -{ - $program = basename($0); - decode_options(); - - open(ELF, "<$ElfFile") || die "Cannot open input file"; - open(OUTPUT, ">$OutputFile") || die "Cannot open output file"; - open(IR, "$IrFile") || die "Cannot open input file"; - - $ElfFilesize = (-s $ElfFile); - - if (read(ELF, $ibuf, $ElfFilesize) != $ElfFilesize) { - print("Failed to read ELF input file!\n"); - exit(1); - } - - if (read(IR, $irbuf, 8) != 8) { - print("Failed to read Ir input file!\n"); - exit(1); - } - - # - # Parse ELF header - # - - @eh = unpack("a16n2N5n6", $ibuf); - - # - # Make sure this is actually a PowerPC ELF file. - # - - if (substr($eh[$e_ident], 0, 4) ne "\177ELF") { - printf("The file \"%s\" is not an ELF file.\n", $ElfFile); - exit (1); - } elsif ($eh[$e_machine] != 20) { - printf("The file \"%s\" is not a PowerPC ELF file.\n", $ElfFile); - exit (1); - } - - # - # Find the section header for the string table. - # - - $strtable_section_offset = $eh[$e_shoff] + - - $eh[$e_shstrndx] * $eh[$e_shentsize]; - - if ($verbose) { - printf("String table section header offset: 0x%x\n", - $strtable_section_offset); - } - - # - # Find the start of the string table. - # - - @strh = unpack("N10", substr($ibuf, $strtable_section_offset, - $eh[$e_shentsize])); - - if ($verbose) { - printf("Section name strings start at: 0x%x, %d bytes.\n", - $strh[$sh_offset], $strh[$sh_size]); - } - - $names = substr($ibuf, $strh[$sh_offset], $strh[$sh_size]); - - # Grab each section header and find '.data', 'image', and - # 'initrd' sections in particular. - - $off = $eh[$e_shoff]; - $imageFound = 0; - $initrdFound = 0; - - for($i = 0; $i < $eh[$e_shnum]; $i++, $off += $eh[$e_shentsize]) { - @sh = unpack("N10", substr($ibuf, $off, $eh[$e_shentsize])); - - # Take the first section name from the array returned by split. - - ($name) = split(/\000/, substr($names, $sh[$sh_name])); - - # Attempt to find the .data, image, and initrd sections - - if ($name =~ /^\image$/) { - ($image_addr, $image_offset, $image_size) = - ($sh[$sh_addr], $sh[$sh_offset], $sh[$sh_size]); - $imageFound = 1; - - } elsif ($name =~ /^\initrd$/) { - ($initrd_addr, $initrd_offset, $initrd_size) = - ($sh[$sh_addr], $sh[$sh_offset], $sh[$sh_size]); - $initrdFound = 1; - - } elsif ($name =~ /^\.data$/) { - ($data_addr, $data_offset, $data_size) = - ($sh[$sh_addr], $sh[$sh_offset], $sh[$sh_size]); - - } elsif ($name =~ /^\.bss$/) { - ($bss_addr, $bss_offset, $bss_size) = - ($sh[$sh_addr], $sh[$sh_offset], $sh[$sh_size]); - - } - } - - if ($verbose) { - printf("Data section - Address: 0x%08x, Size: 0x%08x, File Offset 0x%08x\n", - $data_addr, $data_size, $data_offset); - printf("Bss section - Address: 0x%08x, Size: 0x%08x, File Offset 0x%08x\n", - $bss_addr, $bss_size, $bss_offset); - } - - if ($verbose) { - if ($imageFound) { - printf("Image section - Address: 0x%08x, Size: 0x%08x\n", - $image_addr, $image_size); - } else { - printf("Image section not found in file: $ElfFile\n"); - } - - if ($initrdFound) { - printf("Initrd section - Address: 0x%08x, Size: 0x%08x\n", - $initrd_addr, $initrd_size); - } else { - printf("Initrd section not found in file: $ElfFile\n"); - } - } - - # get file offset of irSectStart - - $irSectStartoffset = hex ($irbuf); - - if ($verbose) { - printf("irSectStartOffset Address: 0x%08x\n", $irSectStartoffset); - } - - # get the offset of global variables - - $initialOffset = ($irSectStartoffset - $data_addr) + $data_offset + 4; - - # write modified values to OUTPUT file - - syswrite(OUTPUT, $ibuf, $initialOffset); - - if ($imageFound) { - $testN = pack ("N2", $bss_addr + $bss_size, $image_size); - syswrite(OUTPUT, $testN, length($testN)); - printf("Updated symbol \"imageSect_start\" to 0x%08x\n", - $bss_addr + $bss_size); - printf("Updated symbol \"imageSect_size\" to 0x%08x\n", $image_size); - } else { - syswrite(OUTPUT, $ibuf, 8, $initialOffset); - } - - if ($initrdFound) { - $testN = pack ("N2", $bss_addr + $bss_size + $image_size, $initrd_size); - syswrite(OUTPUT, $testN, length($testN)); - printf("Updated symbol \"initrdSect_start\" to 0x%08x\n", - $bss_addr + $bss_size + $image_size); - printf("Updated symbol \"initrdSect_size\" to 0x%08x\n", $initrd_size); - } else { - syswrite(OUTPUT, $ibuf,8, $initialOffset + 8); - } - - syswrite(OUTPUT, $ibuf, $ElfFilesize - ($initialOffset + 16), - $initialOffset + 16); - - # - # Clean-up and leave - # - - close (ELF); - close (OUTPUT); - close (IR); - - exit (0); -} - diff -urN linux-2.4.18/arch/ppc/boot/utils/mknote.c linuxppc-2.4.18/arch/ppc/boot/utils/mknote.c --- linux-2.4.18/arch/ppc/boot/utils/mknote.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/utils/mknote.c Thu Mar 7 10:52:12 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mknote.c 1.7 05/18/01 15:17:23 cort + * BK Id: SCCS/s.mknote.c 1.8 06/05/01 20:20:06 paulus */ /* * Copyright (C) Cort Dougan 1999. diff -urN linux-2.4.18/arch/ppc/boot/utils/mkprep.c linuxppc-2.4.18/arch/ppc/boot/utils/mkprep.c --- linux-2.4.18/arch/ppc/boot/utils/mkprep.c Sat May 26 12:39:40 2001 +++ linuxppc-2.4.18/arch/ppc/boot/utils/mkprep.c Thu Mar 7 10:51:43 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mkprep.c 1.7 05/18/01 06:20:29 patch + * BK Id: SCCS/s.mkprep.c 1.8 06/05/01 20:20:06 paulus */ /* * Makes a prep bootable image which can be dd'd onto diff -urN linux-2.4.18/arch/ppc/boot/utils/mksimage.c linuxppc-2.4.18/arch/ppc/boot/utils/mksimage.c --- linux-2.4.18/arch/ppc/boot/utils/mksimage.c Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/utils/mksimage.c Thu Jan 1 10:00:00 1970 @@ -1,127 +0,0 @@ -/* - * BK Id: SCCS/s.mksimage.c 1.7 10/11/01 11:59:05 trini - */ -/* - * - * - * - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - - -#define SIZE 1024 -#define BLOCK_ALIGN(x) (((x)+SIZE-1)&(~(SIZE-1))) - -static void -die(const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - vfprintf(stderr, fmt, args); - fputc('\n', stderr); - exit(1); -} - -static void -usage(void) -{ - printf("Usage: mkbinimg -o \n"); - exit(1); -} - -static int -copy_blocks(int ifd, int ofd, unsigned long *offset, unsigned long *size) -{ - off_t cur; - int amt; - unsigned long len = 0; - char buffer[SIZE]; - - cur = lseek(ofd, 0, SEEK_CUR); - - if (cur % SIZE) { - cur = BLOCK_ALIGN(cur); - cur = lseek(ofd, cur, SEEK_SET); - } - - *offset = (unsigned long) cur; - while((amt = read(ifd, buffer, SIZE)) > 0) { - write(ofd, buffer, amt); - len += amt; - } - *size = len; - return 0; -} - - -int -main(int argc, char *argv[]) -{ - char *kernel, *loader, *rdimage = NULL; - unsigned long ld_off, kern_off, rd_off; - unsigned long ld_size, kern_size, rd_size; - int fd, ofd, len; - char buffer[500]; - - if (argc < 5 && !strcmp(argv[argc-2], "-o")) - usage(); - - if (argc > 5) - rdimage = argv[3]; - - kernel = argv[2]; - loader = argv[1]; - - ofd = open(argv[argc-1], (O_RDWR|O_CREAT), 0755); - if (ofd < 0) { - die("can't open %s: %s", argv[5], strerror(errno)); - } - - ld_off = kern_off = rd_off = 0; - ld_size = kern_size = rd_size = 0; - memset(buffer, 0, 500); - len = 0; - - fd = open(loader, O_RDONLY); - if (fd < 0) - die("can't open loader: %s", strerror(errno)); - - copy_blocks(fd, ofd, &ld_off, &ld_size); - len = sprintf(buffer, "bootloader: %lx %lx\n", ld_off, ld_size); - close(fd); - - fd = open(kernel, O_RDONLY); - if (fd < 0) - die("can't open kernel: %s", strerror(errno)); - - copy_blocks(fd, ofd, &kern_off, &kern_size); - len += sprintf(buffer+len, "zimage: %lx %lx\n", kern_off, kern_size); - close(fd); - - if (rdimage) { - fd = open(rdimage, O_RDONLY); - if (fd < 0) - die("can't get ramdisk: %s", strerror(errno)); - - copy_blocks(fd, ofd, &rd_off, &rd_size); - close(fd); - } - - len += sprintf(buffer+len, "initrd: %lx %lx", rd_off, rd_size); - - close(ofd); - - printf("%s\n", buffer); - - return 0; -} - diff -urN linux-2.4.18/arch/ppc/boot/utils/mktree.c linuxppc-2.4.18/arch/ppc/boot/utils/mktree.c --- linux-2.4.18/arch/ppc/boot/utils/mktree.c Thu Jan 1 10:00:00 1970 +++ linuxppc-2.4.18/arch/ppc/boot/utils/mktree.c Thu Mar 7 10:51:43 2002 @@ -0,0 +1,149 @@ +/* + * BK Id: %F% %I% %G% %U% %#% + * + * Makes a tree bootable image for IBM Evaluation boards. + * Basically, just take a zImage, skip the ELF header, and stuff + * a 32 byte header on the front. + * + * We use htonl, which is a network macro, to make sure we're doing + * The Right Thing on an LE machine. It's non-obvious, but it should + * work on anything BSD'ish. + */ + +#include +#include +#include +#include +#include +#include +#include + +/* This gets tacked on the front of the image. There are also a few + * bytes allocated after the _start label used by the boot rom (see + * head.S for details). + */ +typedef struct boot_block { + unsigned long bb_magic; /* 0x0052504F */ + unsigned long bb_dest; /* Target address of the image */ + unsigned long bb_num_512blocks; /* Size, rounded-up, in 512 byte blks */ + unsigned long bb_debug_flag; /* Run debugger or image after load */ + unsigned long bb_entry_point; /* The image address to start */ + unsigned long bb_checksum; /* 32 bit checksum including header */ + unsigned long reserved[2]; +} boot_block_t; + +#define IMGBLK 512 +char tmpbuf[IMGBLK]; + +int main(int argc, char *argv[]) +{ + int in_fd, out_fd; + int nblks, i; + uint cksum, *cp; + struct stat st; + boot_block_t bt; + + if (argc < 3) { + fprintf(stderr, "usage: %s [entry-point]\n",argv[0]); + exit(1); + } + + if (stat(argv[1], &st) < 0) { + perror("stat"); + exit(2); + } + + nblks = (st.st_size + IMGBLK) / IMGBLK; + + bt.bb_magic = htonl(0x0052504F); + + /* If we have the optional entry point parameter, use it */ + if (argc == 4) + bt.bb_dest = bt.bb_entry_point = htonl(strtoul(argv[3], NULL, 0)); + else + bt.bb_dest = bt.bb_entry_point = htonl(0x500000); + + /* We know these from the linker command. + * ...and then move it up into memory a little more so the + * relocation can happen. + */ + bt.bb_num_512blocks = htonl(nblks); + bt.bb_debug_flag = 0; + + bt.bb_checksum = 0; + + /* To be neat and tidy :-). + */ + bt.reserved[0] = 0; + bt.reserved[1] = 0; + + if ((in_fd = open(argv[1], O_RDONLY)) < 0) { + perror("zImage open"); + exit(3); + } + + if ((out_fd = open(argv[2], (O_RDWR | O_CREAT | O_TRUNC), 0666)) < 0) { + perror("bootfile open"); + exit(3); + } + + cksum = 0; + cp = (uint *)&bt; + for (i=0; i 0) { + if (read(in_fd, tmpbuf, IMGBLK) < 0) { + perror("zImage read"); + exit(5); + } + cp = (uint *)tmpbuf; + for (i=0; i -#include - -extern long ce_exec_config[]; - -int main(int argc, char *argv[]) -{ - int i, cnt, pos, len; - unsigned int cksum, val; - unsigned char *lp; - unsigned char buf[8192]; - if (argc != 2) - { - fprintf(stderr, "usage: %s name out-file\n", - argv[0]); - exit(1); - } - fprintf(stdout, "#\n"); - fprintf(stdout, "# Miscellaneous data structures:\n"); - fprintf(stdout, "# WARNING - this file is automatically generated!\n"); - fprintf(stdout, "#\n"); - fprintf(stdout, "\n"); - fprintf(stdout, "\t.data\n"); - fprintf(stdout, "\t.globl %s_data\n", argv[1]); - fprintf(stdout, "%s_data:\n", argv[1]); - pos = 0; - cksum = 0; - while ((len = read(0, buf, sizeof(buf))) > 0) - { - cnt = 0; - lp = (unsigned char *)buf; - len = (len + 3) & ~3; /* Round up to longwords */ - for (i = 0; i < len; i += 4) - { - if (cnt == 0) - { - fprintf(stdout, "\t.long\t"); - } - fprintf(stdout, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]); - val = *(unsigned long *)lp; - cksum ^= val; - lp += 4; - if (++cnt == 4) - { - cnt = 0; - fprintf(stdout, " # %x \n", pos+i-12); - fflush(stdout); - } else - { - fprintf(stdout, ","); - } - } - if (cnt) - { - fprintf(stdout, "0\n"); - } - pos += len; - } - fprintf(stdout, "\t.globl %s_len\n", argv[1]); - fprintf(stdout, "%s_len:\t.long\t0x%x\n", argv[1], pos); - fflush(stdout); - fclose(stdout); - fprintf(stderr, "cksum = %x\n", cksum); - exit(0); -} - diff -urN linux-2.4.18/arch/ppc/boot/utils/sioffset linuxppc-2.4.18/arch/ppc/boot/utils/sioffset --- linux-2.4.18/arch/ppc/boot/utils/sioffset Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/utils/sioffset Thu Jan 1 10:00:00 1970 @@ -1,4 +0,0 @@ -#!/bin/sh - -OFFSET=`grep $1 sImage.map | awk '{print $2}'` -echo "0x"$OFFSET diff -urN linux-2.4.18/arch/ppc/boot/utils/sisize linuxppc-2.4.18/arch/ppc/boot/utils/sisize --- linux-2.4.18/arch/ppc/boot/utils/sisize Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/utils/sisize Thu Jan 1 10:00:00 1970 @@ -1,4 +0,0 @@ -#!/bin/sh - -OFFSET=`grep $1 sImage.map | awk '{print $3}'` -echo "0x"$OFFSET diff -urN linux-2.4.18/arch/ppc/boot/utils/size linuxppc-2.4.18/arch/ppc/boot/utils/size --- linux-2.4.18/arch/ppc/boot/utils/size Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/boot/utils/size Thu Jan 1 10:00:00 1970 @@ -1,4 +0,0 @@ -#!/bin/sh - -OFFSET=`$1 -h $2 | grep $3 | grep -v zvmlinux | awk '{print $3}'` -echo "0x"$OFFSET diff -urN linux-2.4.18/arch/ppc/config.in linuxppc-2.4.18/arch/ppc/config.in --- linux-2.4.18/arch/ppc/config.in Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/config.in Thu Mar 7 10:51:42 2002 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.config.in 1.47 12/01/01 20:09:06 benh +# BK Id: SCCS/s.config.in 1.50 02/05/02 18:08:35 trini # # For a description of the syntax of this configuration file, # see Documentation/kbuild/config-language.txt. @@ -122,6 +122,9 @@ bool 'Math emulation' CONFIG_MATH_EMULATION fi +if [ "$CONFIG_8xx" = "y" -o "$CONFIG_8260" = "y" ]; then + define_bool CONFIG_EMBEDDEDBOOT y +fi endmenu mainmenu_option next_comment @@ -194,6 +197,7 @@ 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 fi bool 'Default bootloader kernel arguments' CONFIG_CMDLINE_BOOL diff -urN linux-2.4.18/arch/ppc/kernel/Makefile linuxppc-2.4.18/arch/ppc/kernel/Makefile --- linux-2.4.18/arch/ppc/kernel/Makefile Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/Makefile Thu Mar 7 10:51:53 2002 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.36 12/01/01 20:09:06 benh +# BK Id: SCCS/s.Makefile 1.39 01/03/02 12:29:31 trini # # # Makefile for the linux kernel. @@ -14,6 +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 # Start off with 'head.o', change as needed. HEAD-y := head.o diff -urN linux-2.4.18/arch/ppc/kernel/align.c linuxppc-2.4.18/arch/ppc/kernel/align.c --- linux-2.4.18/arch/ppc/kernel/align.c Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/align.c Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.align.c 1.5 05/17/01 18:14:21 cort + * BK Id: SCCS/s.align.c 1.7 06/05/01 21:22:02 paulus */ /* * align.c - handle alignment exceptions for the Power PC. diff -urN linux-2.4.18/arch/ppc/kernel/apus_setup.c linuxppc-2.4.18/arch/ppc/kernel/apus_setup.c --- linux-2.4.18/arch/ppc/kernel/apus_setup.c Fri Nov 23 18:16:33 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/apus_setup.c Thu Mar 7 10:51:45 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.apus_setup.c 1.24 11/13/01 21:26:07 paulus + * BK Id: SCCS/s.apus_setup.c 1.25 11/18/01 16:35:07 paulus */ /* * linux/arch/ppc/kernel/apus_setup.c diff -urN linux-2.4.18/arch/ppc/kernel/bitops.c linuxppc-2.4.18/arch/ppc/kernel/bitops.c --- linux-2.4.18/arch/ppc/kernel/bitops.c Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/bitops.c Thu Mar 7 10:51:46 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.bitops.c 1.7 05/17/01 18:14:21 cort + * BK Id: SCCS/s.bitops.c 1.9 06/05/01 21:22:02 paulus */ /* * Copyright (C) 1996 Paul Mackerras. diff -urN linux-2.4.18/arch/ppc/kernel/btext.c linuxppc-2.4.18/arch/ppc/kernel/btext.c --- linux-2.4.18/arch/ppc/kernel/btext.c Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/btext.c Thu Mar 7 10:51:48 2002 @@ -69,8 +69,6 @@ void __init btext_init(boot_infos_t *bi) { - unsigned long offset = reloc_offset(); - RELOC(g_loc_X) = 0; RELOC(g_loc_Y) = 0; RELOC(g_max_loc_X) = (bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) / 8; @@ -81,10 +79,9 @@ void __init btext_welcome(boot_infos_t* bi) { - unsigned long offset = reloc_offset(); unsigned long flags; unsigned long pvr; - + btext_drawstring(RELOC("Welcome to Linux, kernel " UTS_RELEASE "\n")); btext_drawstring(RELOC("\nlinked at : 0x")); btext_drawhex(KERNELBASE); @@ -131,7 +128,6 @@ void __init btext_prepare_BAT(void) { - unsigned long offset = reloc_offset(); boot_infos_t* bi = PTRRELOC(RELOC(disp_bi)); unsigned long vaddr = KERNELBASE + 0x10000000; unsigned long addr; @@ -169,7 +165,6 @@ btext_setup_display(int width, int height, int depth, int pitch, unsigned long address) { - unsigned long offset = reloc_offset(); boot_infos_t* bi; RELOC(disp_bi) = &fake_bi; @@ -261,7 +256,6 @@ void BTEXT btext_clearscreen(void) { - unsigned long offset = reloc_offset(); boot_infos_t* bi = PTRRELOC(RELOC(disp_bi)); unsigned long *base = (unsigned long *)calc_base(bi, 0, 0); unsigned long width = ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) * @@ -284,7 +278,6 @@ void BTEXT btext_flushscreen(void) { - unsigned long offset = reloc_offset(); boot_infos_t* bi = PTRRELOC(RELOC(disp_bi)); unsigned long *base = (unsigned long *)calc_base(bi, 0, 0); unsigned long width = ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) * @@ -306,7 +299,6 @@ static BTEXT void scrollscreen(void) { - unsigned long offset = reloc_offset(); boot_infos_t* bi = PTRRELOC(RELOC(disp_bi)); unsigned long *src = (unsigned long *)calc_base(bi,0,16); unsigned long *dst = (unsigned long *)calc_base(bi,0,0); @@ -341,7 +333,6 @@ void BTEXT btext_drawchar(char c) { - unsigned long offset = reloc_offset(); int cline = 0, x; if (!RELOC(boot_text_mapped)) @@ -391,8 +382,6 @@ void BTEXT btext_drawstring(const char *c) { - unsigned long offset = reloc_offset(); - if (!RELOC(boot_text_mapped)) return; while (*c) @@ -403,7 +392,6 @@ btext_drawhex(unsigned long v) { static char hex_table[] = "0123456789abcdef"; - unsigned long offset = reloc_offset(); if (!RELOC(boot_text_mapped)) return; @@ -421,7 +409,6 @@ static void BTEXT draw_byte(unsigned char c, long locX, long locY) { - unsigned long offset = reloc_offset(); boot_infos_t* bi = PTRRELOC(RELOC(disp_bi)); unsigned char *base = calc_base(bi, locX << 3, locY << 4); unsigned char *font = &RELOC(vga_font)[((unsigned long)c) * 16]; @@ -497,7 +484,6 @@ int l, bits; int fg = 0xFFFFFFFFUL; int bg = 0x00000000UL; - unsigned long offset = reloc_offset(); unsigned long *eb = RELOC(expand_bits_16); for (l = 0; l < 16; ++l) @@ -517,7 +503,6 @@ int l, bits; int fg = 0x0F0F0F0FUL; int bg = 0x00000000UL; - unsigned long offset = reloc_offset(); unsigned long *eb = RELOC(expand_bits_8); for (l = 0; l < 16; ++l) diff -urN linux-2.4.18/arch/ppc/kernel/checks.c linuxppc-2.4.18/arch/ppc/kernel/checks.c --- linux-2.4.18/arch/ppc/kernel/checks.c Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/checks.c Thu Mar 7 10:52:13 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.checks.c 1.6 05/17/01 18:14:21 cort + * BK Id: SCCS/s.checks.c 1.8 06/05/01 21:22:02 paulus */ #include #include diff -urN linux-2.4.18/arch/ppc/kernel/chrp_pci.c linuxppc-2.4.18/arch/ppc/kernel/chrp_pci.c --- linux-2.4.18/arch/ppc/kernel/chrp_pci.c Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/chrp_pci.c Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.chrp_pci.c 1.22 09/08/01 15:47:42 paulus + * BK Id: SCCS/s.chrp_pci.c 1.23 09/09/01 12:20:43 trini */ /* * CHRP pci routines. diff -urN linux-2.4.18/arch/ppc/kernel/chrp_setup.c linuxppc-2.4.18/arch/ppc/kernel/chrp_setup.c --- linux-2.4.18/arch/ppc/kernel/chrp_setup.c Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/chrp_setup.c Thu Mar 7 10:51:53 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.chrp_setup.c 1.40 12/19/01 09:45:54 trini + * BK Id: SCCS/s.chrp_setup.c 1.41 12/27/01 10:08:49 trini */ /* * linux/arch/ppc/kernel/setup.c diff -urN linux-2.4.18/arch/ppc/kernel/chrp_time.c linuxppc-2.4.18/arch/ppc/kernel/chrp_time.c --- linux-2.4.18/arch/ppc/kernel/chrp_time.c Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/chrp_time.c Thu Mar 7 10:51:43 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.chrp_time.c 1.10 09/08/01 15:47:42 paulus + * BK Id: SCCS/s.chrp_time.c 1.11 09/09/01 12:20:43 trini */ /* * linux/arch/i386/kernel/time.c diff -urN linux-2.4.18/arch/ppc/kernel/entry.S linuxppc-2.4.18/arch/ppc/kernel/entry.S --- linux-2.4.18/arch/ppc/kernel/entry.S Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/entry.S Thu Mar 7 10:51:54 2002 @@ -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.27 02/05/02 20:01:26 paulus */ /* * PowerPC version diff -urN linux-2.4.18/arch/ppc/kernel/find_name.c linuxppc-2.4.18/arch/ppc/kernel/find_name.c --- linux-2.4.18/arch/ppc/kernel/find_name.c Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/find_name.c Thu Mar 7 10:52:08 2002 @@ -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 -urN linux-2.4.18/arch/ppc/kernel/galaxy_pci.c linuxppc-2.4.18/arch/ppc/kernel/galaxy_pci.c --- linux-2.4.18/arch/ppc/kernel/galaxy_pci.c Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/galaxy_pci.c Thu Mar 7 10:52:26 2002 @@ -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.9 06/05/01 21:22:02 paulus */ /* * diff -urN linux-2.4.18/arch/ppc/kernel/gemini_setup.c linuxppc-2.4.18/arch/ppc/kernel/gemini_setup.c --- linux-2.4.18/arch/ppc/kernel/gemini_setup.c Fri Nov 23 18:16:33 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/gemini_setup.c Thu Mar 7 10:52:19 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.gemini_setup.c 1.14 10/18/01 11:16:28 trini + * BK Id: SCCS/s.gemini_setup.c 1.17 11/21/01 17:33:09 paulus */ /* * linux/arch/ppc/kernel/setup.c diff -urN linux-2.4.18/arch/ppc/kernel/head.S linuxppc-2.4.18/arch/ppc/kernel/head.S --- linux-2.4.18/arch/ppc/kernel/head.S Mon Mar 4 20:52:33 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/head.S Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.head.S 1.34 12/02/01 11:35:27 benh + * BK Id: SCCS/s.head.S 1.35 12/27/01 10:08:49 trini */ /* * PowerPC version diff -urN linux-2.4.18/arch/ppc/kernel/head_4xx.S linuxppc-2.4.18/arch/ppc/kernel/head_4xx.S --- linux-2.4.18/arch/ppc/kernel/head_4xx.S Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/head_4xx.S Thu Mar 7 10:52:20 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.head_4xx.S 1.6 05/21/01 11:50:00 paulus + * BK Id: SCCS/s.head_4xx.S 1.8 06/05/01 21:22:02 paulus */ /* * Copyright (c) 1995-1996 Gary Thomas diff -urN linux-2.4.18/arch/ppc/kernel/head_8xx.S linuxppc-2.4.18/arch/ppc/kernel/head_8xx.S --- linux-2.4.18/arch/ppc/kernel/head_8xx.S Tue Nov 6 18:21:29 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/head_8xx.S Thu Mar 7 10:51:39 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.head_8xx.S 1.23 09/16/01 19:32:54 trini + * BK Id: SCCS/s.head_8xx.S 1.25 01/08/02 16:41:27 trini */ /* * arch/ppc/kernel/except_8xx.S @@ -520,6 +520,34 @@ mfspr r20, DSISR andis. r21, r20, 0x0200 /* If set, indicates store op */ beq 2f + + /* The EA of a data TLB miss is automatically stored in the MD_EPN + * register. The EA of a data TLB error is automatically stored in + * the DAR, but not the MD_EPN register. We must copy the 20 most + * significant bits of the EA from the DAR to MD_EPN before we + * start walking the page tables. We also need to copy the CASID + * value from the M_CASID register. + * Addendum: The EA of a data TLB error is _supposed_ to be stored + * in DAR, but it seems that this doesn't happen in some cases, such + * as when the error is due to a dcbi instruction to a page with a + * TLB that doesn't have the changed bit set. In such cases, there + * does not appear to be any way to recover the EA of the error + * since it is neither in DAR nor MD_EPN. As a workaround, the + * _PAGE_HWWRITE bit is set for all kernel data pages when the PTEs + * are initialized in mapin_ram(). This will avoid the problem, + * assuming we only use the dcbi instruction on kernel addresses. + */ + mfspr r20, DAR + rlwinm r21, r20, 0, 0, 19 + ori r21, r21, MD_EVALID + mfspr r20, M_CASID + rlwimi r21, r20, 0, 28, 31 +#ifdef CONFIG_8xx_CPU6 + li r3, 0x3780 + stw r3, 12(r0) + lwz r3, 12(r0) +#endif + mtspr MD_EPN, r21 mfspr r20, M_TWB /* Get level 1 table entry address */ diff -urN linux-2.4.18/arch/ppc/kernel/i8259.c linuxppc-2.4.18/arch/ppc/kernel/i8259.c --- linux-2.4.18/arch/ppc/kernel/i8259.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/i8259.c Thu Mar 7 10:51:47 2002 @@ -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.12 12/27/01 10:08:49 trini */ #include diff -urN linux-2.4.18/arch/ppc/kernel/i8259.h linuxppc-2.4.18/arch/ppc/kernel/i8259.h --- linux-2.4.18/arch/ppc/kernel/i8259.h Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/i8259.h Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.i8259.h 1.8 12/19/01 09:45:54 trini + * BK Id: SCCS/s.i8259.h 1.9 12/27/01 10:08:49 trini */ #ifndef _PPC_KERNEL_i8259_H diff -urN linux-2.4.18/arch/ppc/kernel/idle.c linuxppc-2.4.18/arch/ppc/kernel/idle.c --- linux-2.4.18/arch/ppc/kernel/idle.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/idle.c Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.idle.c 1.18 12/01/01 20:09:06 benh + * BK Id: SCCS/s.idle.c 1.19 12/27/01 10:08:50 trini */ /* * Idle daemon for PowerPC. Idle daemon will handle any action diff -urN linux-2.4.18/arch/ppc/kernel/indirect_pci.c linuxppc-2.4.18/arch/ppc/kernel/indirect_pci.c --- linux-2.4.18/arch/ppc/kernel/indirect_pci.c Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/indirect_pci.c Thu Mar 7 10:51:41 2002 @@ -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.11 09/09/01 12:20:43 trini */ /* * Support for indirect PCI bridges. diff -urN linux-2.4.18/arch/ppc/kernel/irq.c linuxppc-2.4.18/arch/ppc/kernel/irq.c --- linux-2.4.18/arch/ppc/kernel/irq.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/irq.c Thu Mar 7 10:51:53 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.irq.c 1.34 12/01/01 20:09:06 benh + * BK Id: SCCS/s.irq.c 1.35 12/27/01 10:08:50 trini */ /* * arch/ppc/kernel/irq.c diff -urN linux-2.4.18/arch/ppc/kernel/local_irq.h linuxppc-2.4.18/arch/ppc/kernel/local_irq.h --- linux-2.4.18/arch/ppc/kernel/local_irq.h Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/local_irq.h Thu Mar 7 10:51:53 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.local_irq.h 1.7 05/17/01 18:14:21 cort + * BK Id: SCCS/s.local_irq.h 1.9 06/05/01 21:22:03 paulus */ #ifndef _PPC_KERNEL_LOCAL_IRQ_H diff -urN linux-2.4.18/arch/ppc/kernel/m8260_setup.c linuxppc-2.4.18/arch/ppc/kernel/m8260_setup.c --- linux-2.4.18/arch/ppc/kernel/m8260_setup.c Fri Nov 23 18:16:33 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/m8260_setup.c Thu Mar 7 10:52:14 2002 @@ -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.31 11/18/01 16:35:07 paulus */ /* * linux/arch/ppc/kernel/setup.c diff -urN linux-2.4.18/arch/ppc/kernel/m8xx_setup.c linuxppc-2.4.18/arch/ppc/kernel/m8xx_setup.c --- linux-2.4.18/arch/ppc/kernel/m8xx_setup.c Fri Nov 23 18:16:33 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/m8xx_setup.c Thu Mar 7 10:52:21 2002 @@ -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.41 11/18/01 16:35:07 paulus * * linux/arch/ppc/kernel/setup.c * diff -urN linux-2.4.18/arch/ppc/kernel/misc.S linuxppc-2.4.18/arch/ppc/kernel/misc.S --- linux-2.4.18/arch/ppc/kernel/misc.S Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/misc.S Thu Mar 7 10:51:53 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.misc.S 1.36 12/01/01 20:09:06 benh + * BK Id: SCCS/s.misc.S 1.38 01/03/02 21:58:52 paulus */ /* * This file contains miscellaneous low-level functions. @@ -39,7 +39,6 @@ * Returns (address we're running at) - (address we were linked at) * for use before the text and data are mapped to KERNELBASE. */ - _GLOBAL(reloc_offset) mflr r0 bl 1f @@ -47,6 +46,34 @@ lis r4,1b@ha addi r4,r4,1b@l subf r3,r4,r3 + mtlr r0 + blr + +/* + * add_reloc_offset(x) returns x + reloc_offset(). + */ +_GLOBAL(add_reloc_offset) + mflr r0 + bl 1f +1: mflr r5 + lis r4,1b@ha + addi r4,r4,1b@l + subf r5,r4,r5 + add r3,r3,r5 + mtlr r0 + blr + +/* + * sub_reloc_offset(x) returns x - reloc_offset(). + */ +_GLOBAL(sub_reloc_offset) + mflr r0 + bl 1f +1: mflr r5 + lis r4,1b@ha + addi r4,r4,1b@l + subf r5,r4,r5 + subf r3,r5,r3 mtlr r0 blr diff -urN linux-2.4.18/arch/ppc/kernel/mk_defs.c linuxppc-2.4.18/arch/ppc/kernel/mk_defs.c --- linux-2.4.18/arch/ppc/kernel/mk_defs.c Mon Sep 24 09:31:16 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/mk_defs.c Thu Mar 7 10:51:41 2002 @@ -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.12 08/29/01 08:49:24 paulus */ /* * This program is used to generate definitions needed by diff -urN linux-2.4.18/arch/ppc/kernel/oak_setup.c linuxppc-2.4.18/arch/ppc/kernel/oak_setup.c --- linux-2.4.18/arch/ppc/kernel/oak_setup.c Fri Nov 23 18:16:33 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/oak_setup.c Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.oak_setup.c 1.12 11/13/01 21:26:07 paulus + * BK Id: SCCS/s.oak_setup.c 1.13 11/18/01 16:35:07 paulus */ /* * diff -urN linux-2.4.18/arch/ppc/kernel/oak_setup.h linuxppc-2.4.18/arch/ppc/kernel/oak_setup.h --- linux-2.4.18/arch/ppc/kernel/oak_setup.h Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/oak_setup.h Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.oak_setup.h 1.5 05/17/01 18:14:21 cort + * BK Id: SCCS/s.oak_setup.h 1.7 06/05/01 21:22:03 paulus */ /* * diff -urN linux-2.4.18/arch/ppc/kernel/open_pic.c linuxppc-2.4.18/arch/ppc/kernel/open_pic.c --- linux-2.4.18/arch/ppc/kernel/open_pic.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/open_pic.c Thu Mar 7 10:52:08 2002 @@ -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.34 12/27/01 10:08:50 trini */ /* * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling diff -urN linux-2.4.18/arch/ppc/kernel/open_pic.h linuxppc-2.4.18/arch/ppc/kernel/open_pic.h --- linux-2.4.18/arch/ppc/kernel/open_pic.h Tue Nov 6 18:21:29 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/open_pic.h Thu Mar 7 10:51:49 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.open_pic.h 1.14 10/11/01 12:09:12 trini + * BK Id: SCCS/s.open_pic.h 1.15 11/04/01 22:58:20 paulus */ /* * arch/ppc/kernel/open_pic.h -- OpenPIC Interrupt Handling diff -urN linux-2.4.18/arch/ppc/kernel/pci-dma.c linuxppc-2.4.18/arch/ppc/kernel/pci-dma.c --- linux-2.4.18/arch/ppc/kernel/pci-dma.c Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/pci-dma.c Thu Mar 7 10:51:51 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pci-dma.c 1.5 05/17/01 18:14:21 cort + * BK Id: SCCS/s.pci-dma.c 1.7 06/05/01 21:22:03 paulus */ /* * Copyright (C) 2000 Ani Joshi diff -urN linux-2.4.18/arch/ppc/kernel/pci.c linuxppc-2.4.18/arch/ppc/kernel/pci.c --- linux-2.4.18/arch/ppc/kernel/pci.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/pci.c Thu Mar 7 10:52:17 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pci.c 1.40 01/25/02 15:15:24 benh + * BK Id: SCCS/s.pci.c 1.41 02/05/02 20:01:26 paulus */ /* * Common pmac/prep/chrp pci routines. -- Cort diff -urN linux-2.4.18/arch/ppc/kernel/pci.h linuxppc-2.4.18/arch/ppc/kernel/pci.h --- linux-2.4.18/arch/ppc/kernel/pci.h Fri Aug 17 08:28:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/pci.h Thu Mar 7 10:51:39 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pci.h 1.10 08/08/01 16:35:43 paulus + * BK Id: SCCS/s.pci.h 1.11 08/13/01 10:44:12 paulus */ #ifndef __PPC_KERNEL_PCI_H__ diff -urN linux-2.4.18/arch/ppc/kernel/pmac_backlight.c linuxppc-2.4.18/arch/ppc/kernel/pmac_backlight.c --- linux-2.4.18/arch/ppc/kernel/pmac_backlight.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/pmac_backlight.c Thu Mar 7 10:51:48 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pmac_backlight.c 1.10 12/01/01 20:09:06 benh + * BK Id: SCCS/s.pmac_backlight.c 1.11 12/27/01 10:08:50 trini */ /* * Miscellaneous procedures for dealing with the PowerMac hardware. diff -urN linux-2.4.18/arch/ppc/kernel/pmac_feature.c linuxppc-2.4.18/arch/ppc/kernel/pmac_feature.c --- linux-2.4.18/arch/ppc/kernel/pmac_feature.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/pmac_feature.c Thu Mar 7 10:51:52 2002 @@ -1665,6 +1665,10 @@ PMAC_TYPE_IBOOK2, pangea_features, PMAC_MB_CAN_SLEEP | PMAC_MB_HAS_FW_POWER }, + { "PowerMac4,2", "Flat panel iMac", + PMAC_TYPE_FLAT_PANEL_IMAC, pangea_features, + PMAC_MB_CAN_SLEEP + }, { "PowerMac1,1", "Blue&White G3", PMAC_TYPE_YOSEMITE, paddington_features, 0 diff -urN linux-2.4.18/arch/ppc/kernel/pmac_nvram.c linuxppc-2.4.18/arch/ppc/kernel/pmac_nvram.c --- linux-2.4.18/arch/ppc/kernel/pmac_nvram.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/pmac_nvram.c Thu Mar 7 10:52:17 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pmac_nvram.c 1.17 12/01/01 20:09:06 benh + * BK Id: SCCS/s.pmac_nvram.c 1.18 12/27/01 10:08:50 trini */ /* * Miscellaneous procedures for dealing with the PowerMac hardware. diff -urN linux-2.4.18/arch/ppc/kernel/pmac_pci.c linuxppc-2.4.18/arch/ppc/kernel/pmac_pci.c --- linux-2.4.18/arch/ppc/kernel/pmac_pci.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/pmac_pci.c Thu Mar 7 10:52:21 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pmac_pci.c 1.31 01/20/02 23:53:11 benh + * BK Id: SCCS/s.pmac_pci.c 1.32 02/05/02 20:01:26 paulus */ /* * Support for PCI bridges found on Power Macintoshes. diff -urN linux-2.4.18/arch/ppc/kernel/pmac_pic.c linuxppc-2.4.18/arch/ppc/kernel/pmac_pic.c --- linux-2.4.18/arch/ppc/kernel/pmac_pic.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/pmac_pic.c Thu Mar 7 10:51:43 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pmac_pic.c 1.24 12/19/01 10:53:01 paulus + * BK Id: SCCS/s.pmac_pic.c 1.25 12/27/01 10:08:50 trini */ #include #include diff -urN linux-2.4.18/arch/ppc/kernel/pmac_pic.h linuxppc-2.4.18/arch/ppc/kernel/pmac_pic.h --- linux-2.4.18/arch/ppc/kernel/pmac_pic.h Mon Sep 24 09:31:17 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/pmac_pic.h Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pmac_pic.h 1.9 08/19/01 22:23:04 paulus + * BK Id: SCCS/s.pmac_pic.h 1.10 08/29/01 08:49:24 paulus */ #ifndef _PPC_KERNEL_PMAC_PIC_H #define _PPC_KERNEL_PMAC_PIC_H diff -urN linux-2.4.18/arch/ppc/kernel/pmac_setup.c linuxppc-2.4.18/arch/ppc/kernel/pmac_setup.c --- linux-2.4.18/arch/ppc/kernel/pmac_setup.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/pmac_setup.c Thu Mar 7 10:51:43 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pmac_setup.c 1.45 12/01/01 20:09:06 benh + * BK Id: SCCS/s.pmac_setup.c 1.47 01/02/02 22:16:19 trini */ /* * linux/arch/ppc/kernel/setup.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -67,12 +68,14 @@ #include #include #include - #include #include + #include "local_irq.h" #include "pmac_pic.h" -#include "../mm/mem_pieces.h" +#include "mem_pieces.h" +#include "scsi.h" /* sd_find_target */ +#include "sd.h" #undef SHOW_GATWICK_IRQS @@ -274,16 +277,6 @@ return 0; } - -#ifdef CONFIG_SCSI -/* Find the device number for the disk (if any) at target tgt - on host adaptor host. We just need to get the prototype from - sd.h */ -#include -#include "../../../drivers/scsi/scsi.h" -#include "../../../drivers/scsi/sd.h" - -#endif #ifdef CONFIG_VT /* diff -urN linux-2.4.18/arch/ppc/kernel/pmac_time.c linuxppc-2.4.18/arch/ppc/kernel/pmac_time.c --- linux-2.4.18/arch/ppc/kernel/pmac_time.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/pmac_time.c Thu Mar 7 10:52:10 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pmac_time.c 1.19 12/04/01 01:24:51 benh + * BK Id: SCCS/s.pmac_time.c 1.20 12/27/01 10:08:50 trini */ /* * Support for periodic interrupts (100 per second) and for getting diff -urN linux-2.4.18/arch/ppc/kernel/ppc-stub.c linuxppc-2.4.18/arch/ppc/kernel/ppc-stub.c --- linux-2.4.18/arch/ppc/kernel/ppc-stub.c Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/ppc-stub.c Thu Mar 7 10:52:14 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc-stub.c 1.6 05/17/01 18:14:21 cort + * BK Id: SCCS/s.ppc-stub.c 1.8 06/05/01 21:22:03 paulus */ /* * ppc-stub.c: KGDB support for the Linux kernel. diff -urN linux-2.4.18/arch/ppc/kernel/ppc4xx_pic.c linuxppc-2.4.18/arch/ppc/kernel/ppc4xx_pic.c --- linux-2.4.18/arch/ppc/kernel/ppc4xx_pic.c Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/ppc4xx_pic.c Thu Mar 7 10:52:12 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc4xx_pic.c 1.5 05/17/01 18:14:21 cort + * BK Id: SCCS/s.ppc4xx_pic.c 1.7 06/05/01 21:22:03 paulus */ /* * diff -urN linux-2.4.18/arch/ppc/kernel/ppc4xx_pic.h linuxppc-2.4.18/arch/ppc/kernel/ppc4xx_pic.h --- linux-2.4.18/arch/ppc/kernel/ppc4xx_pic.h Wed Jul 4 14:33:18 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/ppc4xx_pic.h Thu Mar 7 10:51:38 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc4xx_pic.h 1.8 06/15/01 13:56:56 paulus + * BK Id: SCCS/s.ppc4xx_pic.h 1.9 07/03/01 15:00:30 paulus */ /* * diff -urN linux-2.4.18/arch/ppc/kernel/ppc8260_pic.c linuxppc-2.4.18/arch/ppc/kernel/ppc8260_pic.c --- linux-2.4.18/arch/ppc/kernel/ppc8260_pic.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/ppc8260_pic.c Thu Mar 7 10:52:16 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc8260_pic.c 1.5 05/17/01 18:14:21 cort + * BK Id: SCCS/s.ppc8260_pic.c 1.9 02/14/02 12:33:42 trini */ #include diff -urN linux-2.4.18/arch/ppc/kernel/ppc8260_pic.h linuxppc-2.4.18/arch/ppc/kernel/ppc8260_pic.h --- linux-2.4.18/arch/ppc/kernel/ppc8260_pic.h Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/ppc8260_pic.h Thu Mar 7 10:52:21 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc8260_pic.h 1.7 05/17/01 18:14:21 cort + * BK Id: SCCS/s.ppc8260_pic.h 1.9 06/05/01 21:22:03 paulus */ #ifndef _PPC_KERNEL_PPC8260_H diff -urN linux-2.4.18/arch/ppc/kernel/ppc8xx_pic.c linuxppc-2.4.18/arch/ppc/kernel/ppc8xx_pic.c --- linux-2.4.18/arch/ppc/kernel/ppc8xx_pic.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/ppc8xx_pic.c Thu Mar 7 10:51:45 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc8xx_pic.c 1.13 12/01/01 17:19:48 trini + * BK Id: SCCS/s.ppc8xx_pic.c 1.14 12/27/01 10:08:50 trini */ #include #include diff -urN linux-2.4.18/arch/ppc/kernel/ppc8xx_pic.h linuxppc-2.4.18/arch/ppc/kernel/ppc8xx_pic.h --- linux-2.4.18/arch/ppc/kernel/ppc8xx_pic.h Sat May 26 12:39:41 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/ppc8xx_pic.h Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc8xx_pic.h 1.7 05/17/01 18:14:21 cort + * BK Id: SCCS/s.ppc8xx_pic.h 1.9 06/05/01 21:22:03 paulus */ #ifndef _PPC_KERNEL_PPC8xx_H #define _PPC_KERNEL_PPC8xx_H diff -urN linux-2.4.18/arch/ppc/kernel/ppc_asm.h linuxppc-2.4.18/arch/ppc/kernel/ppc_asm.h --- linux-2.4.18/arch/ppc/kernel/ppc_asm.h Tue Nov 6 18:21:30 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/ppc_asm.h Thu Mar 7 10:52:16 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc_asm.h 1.18 10/18/01 15:02:09 trini + * BK Id: SCCS/s.ppc_asm.h 1.19 11/04/01 22:58:20 paulus */ /* * arch/ppc/kernel/ppc_asm.h diff -urN linux-2.4.18/arch/ppc/kernel/ppc_htab.c linuxppc-2.4.18/arch/ppc/kernel/ppc_htab.c --- linux-2.4.18/arch/ppc/kernel/ppc_htab.c Tue Nov 6 18:21:30 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/ppc_htab.c Thu Mar 7 10:52:19 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ppc_htab.c 1.19 10/16/01 15:58:42 trini + * BK Id: SCCS/s.ppc_htab.c 1.20 11/04/01 22:58:20 paulus */ /* * PowerPC hash table management proc entry. Will show information diff -urN linux-2.4.18/arch/ppc/kernel/ppc_ksyms.c linuxppc-2.4.18/arch/ppc/kernel/ppc_ksyms.c --- linux-2.4.18/arch/ppc/kernel/ppc_ksyms.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/ppc_ksyms.c Thu Mar 7 10:52:08 2002 @@ -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.64 01/22/02 13:39:52 trini */ #include #include diff -urN linux-2.4.18/arch/ppc/kernel/prep_nvram.c linuxppc-2.4.18/arch/ppc/kernel/prep_nvram.c --- linux-2.4.18/arch/ppc/kernel/prep_nvram.c Mon Sep 24 09:31:17 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/prep_nvram.c Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.prep_nvram.c 1.12 09/08/01 15:47:42 paulus + * BK Id: SCCS/s.prep_nvram.c 1.13 09/09/01 12:20:43 trini */ /* * linux/arch/ppc/kernel/prep_nvram.c diff -urN linux-2.4.18/arch/ppc/kernel/prep_pci.c linuxppc-2.4.18/arch/ppc/kernel/prep_pci.c --- linux-2.4.18/arch/ppc/kernel/prep_pci.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/prep_pci.c Thu Mar 7 10:52:21 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.prep_pci.c 1.33 12/20/01 15:36:12 trini + * BK Id: SCCS/s.prep_pci.c 1.34 12/27/01 10:08:51 trini */ /* * PReP pci functions. diff -urN linux-2.4.18/arch/ppc/kernel/prep_setup.c linuxppc-2.4.18/arch/ppc/kernel/prep_setup.c --- linux-2.4.18/arch/ppc/kernel/prep_setup.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/prep_setup.c Thu Mar 7 10:51:54 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.prep_setup.c 1.47 12/19/01 09:45:54 trini + * BK Id: SCCS/s.prep_setup.c 1.51 01/31/02 11:28:11 trini */ /* * linux/arch/ppc/kernel/setup.c @@ -209,15 +209,13 @@ static int __prep prep_show_percpuinfo(struct seq_file *m, int i) { - int len = 0; - /* PREP's without residual data will give incorrect values here */ seq_printf(m, "clock\t\t: "); #ifdef CONFIG_PREP_RESIDUAL if (res->ResidualLength) seq_printf(m, "%ldMHz\n", (res->VitalProductData.ProcessorHz > 1024) ? - res->VitalProductData.ProcessorHz>>20 : + res->VitalProductData.ProcessorHz / 1000000 : res->VitalProductData.ProcessorHz); else #endif /* CONFIG_PREP_RESIDUAL */ @@ -248,13 +246,6 @@ outb(reg, SIO_CONFIG_RD); outb(reg, SIO_CONFIG_RD); /* Have to write twice to change! */ - /* - * We need to set up the NvRAM access routines early as prep_init - * has yet to be called - */ - ppc_md.nvram_read_val = prep_nvram_read_val; - ppc_md.nvram_write_val = prep_nvram_write_val; - /* we should determine this according to what we find! -- Cort */ switch ( _prep_type ) { @@ -840,21 +831,6 @@ } #endif -#ifdef CONFIG_BLK_DEV_INITRD - if ( r4 ) - { - initrd_start = r4 + KERNELBASE; - initrd_end = r5 + KERNELBASE; - } -#endif /* CONFIG_BLK_DEV_INITRD */ - - /* Copy cmd_line parameters */ - if ( r6 ) - { - *(char *)(r7 + KERNELBASE) = 0; - strcpy(cmd_line, (char *)(r6 + KERNELBASE)); - } - isa_io_base = PREP_ISA_IO_BASE; isa_mem_base = PREP_ISA_MEM_BASE; pci_dram_offset = PREP_PCI_DRAM_OFFSET; @@ -889,6 +865,9 @@ ppc_md.restart = prep_restart; ppc_md.power_off = prep_power_off; ppc_md.halt = prep_halt; + + ppc_md.nvram_read_val = prep_nvram_read_val; + ppc_md.nvram_write_val = prep_nvram_write_val; ppc_md.time_init = NULL; if (_prep_type == _PREP_IBM) { diff -urN linux-2.4.18/arch/ppc/kernel/prep_time.c linuxppc-2.4.18/arch/ppc/kernel/prep_time.c --- linux-2.4.18/arch/ppc/kernel/prep_time.c Mon Sep 24 09:31:17 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/prep_time.c Thu Mar 7 10:52:23 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.prep_time.c 1.10 09/08/01 15:47:42 paulus + * BK Id: SCCS/s.prep_time.c 1.11 09/09/01 12:20:43 trini */ /* * linux/arch/i386/kernel/time.c diff -urN linux-2.4.18/arch/ppc/kernel/process.c linuxppc-2.4.18/arch/ppc/kernel/process.c --- linux-2.4.18/arch/ppc/kernel/process.c Tue Nov 27 15:42:01 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/process.c Thu Mar 7 10:51:51 2002 @@ -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.35 11/24/01 15:10:57 trini */ /* * linux/arch/ppc/kernel/process.c diff -urN linux-2.4.18/arch/ppc/kernel/prom.c linuxppc-2.4.18/arch/ppc/kernel/prom.c --- linux-2.4.18/arch/ppc/kernel/prom.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/prom.c Thu Mar 7 10:52:11 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.prom.c 1.48 12/19/01 10:50:58 paulus + * BK Id: SCCS/s.prom.c 1.51 01/16/02 11:49:20 benh */ /* * Procedures for interfacing to the Open Firmware PROM on @@ -174,7 +174,6 @@ prom_exit() { struct prom_args args; - unsigned long offset = reloc_offset(); args.service = "exit"; args.nargs = 0; @@ -188,7 +187,6 @@ prom_enter(void) { struct prom_args args; - unsigned long offset = reloc_offset(); args.service = RELOC("enter"); args.nargs = 0; @@ -201,7 +199,6 @@ { va_list list; int i; - unsigned long offset = reloc_offset(); struct prom_args prom_args; prom_args.service = service; @@ -221,7 +218,6 @@ prom_print(const char *msg) { const char *p, *q; - unsigned long offset = reloc_offset(); if (RELOC(prom_stdout) == 0) return; @@ -286,9 +282,9 @@ unsigned long i; int cpu; phandle node; - unsigned long offset = reloc_offset(); char type[16], *path; unsigned int reg; + unsigned long offset = reloc_offset(); /* * XXX: hack to make sure we're chrp, assume that if we're @@ -353,7 +349,6 @@ unsigned long space; unsigned long ptr, x; char *model; - unsigned long offset = reloc_offset(); RELOC(boot_infos) = PTRUNRELOC(bi); if (!BOOT_INFO_IS_V2_COMPATIBLE(bi)) @@ -411,7 +406,7 @@ * are in the hash table - the aim is to try to avoid * getting DSI exceptions while copying the kernel image. */ - for (ptr = (KERNELBASE + offset) & PAGE_MASK; + for (ptr = add_reloc_offset(KERNELBASE) & PAGE_MASK; ptr < (unsigned long)bi + space; ptr += PAGE_SIZE) x = *(volatile unsigned long *)ptr; } @@ -501,7 +496,6 @@ ihandle prom_rtas; unsigned int i; struct prom_args prom_args; - unsigned long offset = reloc_offset(); prom_rtas = call_prom(RELOC("finddevice"), 1, 1, RELOC("/rtas")); if (prom_rtas == (void *) -1) @@ -676,7 +670,6 @@ unsigned long words[16]; double align; } u; - unsigned long offset = reloc_offset(); void (*rtas)(void *, unsigned long); int i; @@ -696,7 +689,6 @@ prom_set_color(ihandle ih, int i, int r, int g, int b) { struct prom_args prom_args; - unsigned long offset = reloc_offset(); prom_args.service = RELOC("call-method"); prom_args.nargs = 6; @@ -725,7 +717,6 @@ phandle node; ihandle ih; int i; - unsigned long offset = reloc_offset(); char type[16], *path; static unsigned char default_colors[] = { 0x00, 0x00, 0x00, @@ -840,7 +831,6 @@ { int width = 640, height = 480, depth = 8, pitch; unsigned address; - unsigned long offset = reloc_offset(); struct pci_reg_property addrs[8]; int i, naddrs; char name[32]; @@ -896,7 +886,6 @@ prom_next_node(phandle *nodep) { phandle node; - unsigned long offset = reloc_offset(); if ((node = *nodep) != 0 && (*nodep = call_prom(RELOC("child"), 1, 1, node)) != 0) @@ -920,7 +909,6 @@ phandle root; unsigned long new_start; struct device_node **allnextp; - unsigned long offset = reloc_offset(); root = call_prom(RELOC("peer"), 1, 1, (phandle)0); if (root == (phandle)0) { @@ -945,7 +933,6 @@ struct property *pp, **prev_propp; char *prev_name, *namep; unsigned char *valp; - unsigned long offset = reloc_offset(); np = (struct device_node *) mem_start; mem_start += sizeof(struct device_node); diff -urN linux-2.4.18/arch/ppc/kernel/ptrace.c linuxppc-2.4.18/arch/ppc/kernel/ptrace.c --- linux-2.4.18/arch/ppc/kernel/ptrace.c Tue Nov 27 15:42:01 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/ptrace.c Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ptrace.c 1.12 11/23/01 16:38:30 paulus + * BK Id: SCCS/s.ptrace.c 1.14 01/17/02 23:05:50 paulus */ /* * linux/arch/ppc/kernel/ptrace.c @@ -71,6 +71,64 @@ return -EIO; } +#ifdef CONFIG_ALTIVEC +/* + * Get contents of AltiVec register state in task TASK + */ +static inline int get_vrregs(unsigned long *data, struct task_struct *task) +{ + int i, j; + + if (!access_ok(VERIFY_WRITE, data, 133 * sizeof(unsigned long))) + return -EFAULT; + + /* copy AltiVec registers VR[0] .. VR[31] */ + for (i = 0; i < 32; i++) + for (j = 0; j < 4; j++, data++) + if (__put_user(task->thread.vr[i].u[j], data)) + return -EFAULT; + + /* copy VSCR */ + for (i = 0; i < 4; i++, data++) + if (__put_user(task->thread.vscr.u[i], data)) + return -EFAULT; + + /* copy VRSAVE */ + if (__put_user(task->thread.vrsave, data)) + return -EFAULT; + + return 0; +} + +/* + * Write contents of AltiVec register state into task TASK. + */ +static inline int set_vrregs(struct task_struct *task, unsigned long *data) +{ + int i, j; + + if (!access_ok(VERIFY_READ, data, 133 * sizeof(unsigned long))) + return -EFAULT; + + /* copy AltiVec registers VR[0] .. VR[31] */ + for (i = 0; i < 32; i++) + for (j = 0; j < 4; j++, data++) + if (__get_user(task->thread.vr[i].u[j], data)) + return -EFAULT; + + /* copy VSCR */ + for (i = 0; i < 4; i++, data++) + if (__get_user(task->thread.vscr.u[i], data)) + return -EFAULT; + + /* copy VRSAVE */ + if (__get_user(task->thread.vrsave, data)) + return -EFAULT; + + return 0; +} +#endif + static inline void set_single_step(struct task_struct *task) { @@ -258,6 +316,24 @@ case PTRACE_DETACH: ret = ptrace_detach(child, data); break; + +#ifdef CONFIG_ALTIVEC + case PTRACE_GETVRREGS: + /* Get the child altivec register state. */ + if (child->thread.regs->msr & MSR_VEC) + giveup_altivec(child); + ret = get_vrregs((unsigned long *)data, child); + break; + + case PTRACE_SETVRREGS: + /* Set the child altivec register state. */ + /* this is to clear the MSR_VEC bit to force a reload + * of register state from memory */ + if (child->thread.regs->msr & MSR_VEC) + giveup_altivec(child); + ret = set_vrregs(child, (unsigned long *)data); + break; +#endif default: ret = -EIO; diff -urN linux-2.4.18/arch/ppc/kernel/qspan_pci.c linuxppc-2.4.18/arch/ppc/kernel/qspan_pci.c --- linux-2.4.18/arch/ppc/kernel/qspan_pci.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/qspan_pci.c Thu Mar 7 10:52:14 2002 @@ -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.7 06/05/01 21:22:03 paulus */ /* * QSpan pci routines. diff -urN linux-2.4.18/arch/ppc/kernel/residual.c linuxppc-2.4.18/arch/ppc/kernel/residual.c --- linux-2.4.18/arch/ppc/kernel/residual.c Wed Oct 10 12:38:52 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/residual.c Thu Mar 7 10:52:13 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.residual.c 1.13 09/11/01 16:54:34 trini + * BK Id: SCCS/s.residual.c 1.15 02/05/02 18:08:35 trini */ /* * Code to deal with the PReP residual data. @@ -876,3 +876,38 @@ }; return 0; /* not found */ } + +#ifdef CONFIG_PROC_PREPRESIDUAL +static int proc_prep_residual_read(char * buf, char ** start, off_t off, + int count, int *eof, void *data) +{ + int n; + + n = res->ResidualLength - off; + if (n < 0) { + *eof = 1; + n = 0; + } + else { + if (n > count) + n = count; + else + *eof = 1; + + memcpy(buf, (char *)res + off, n); + *start = buf; + } + + return n; +} + +void __init +proc_prep_residual_init(void) +{ + if (res->ResidualLength) + create_proc_read_entry("residual", S_IRUGO, NULL, + proc_prep_residual_read, NULL); +} + +__initcall(proc_prep_residual_init); +#endif diff -urN linux-2.4.18/arch/ppc/kernel/semaphore.c linuxppc-2.4.18/arch/ppc/kernel/semaphore.c --- linux-2.4.18/arch/ppc/kernel/semaphore.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/semaphore.c Thu Mar 7 10:51:52 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.semaphore.c 1.12 05/17/01 18:14:22 cort + * BK Id: SCCS/s.semaphore.c 1.14 06/05/01 21:22:03 paulus */ /* * PowerPC-specific semaphore code. diff -urN linux-2.4.18/arch/ppc/kernel/setup.c linuxppc-2.4.18/arch/ppc/kernel/setup.c --- linux-2.4.18/arch/ppc/kernel/setup.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/setup.c Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.setup.c 1.67 12/01/01 20:09:07 benh + * BK Id: SCCS/s.setup.c 1.70 02/15/02 09:27:13 trini */ /* * Common prep/pmac/chrp boot and setup code. @@ -50,7 +50,6 @@ 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); -extern unsigned long reloc_offset(void); extern void identify_cpu(unsigned long offset, unsigned long cpu); extern void do_cpu_ftr_fixups(unsigned long offset); @@ -59,7 +58,8 @@ #endif extern boot_infos_t *boot_infos; -char saved_command_line[256]; +char saved_command_line[512]; +extern char cmd_line[512]; unsigned char aux_device_present; struct ide_machdep_calls ppc_ide_md; char *sysmap; diff -urN linux-2.4.18/arch/ppc/kernel/signal.c linuxppc-2.4.18/arch/ppc/kernel/signal.c --- linux-2.4.18/arch/ppc/kernel/signal.c Tue Nov 27 15:42:01 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/signal.c Thu Mar 7 10:51:51 2002 @@ -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.11 11/24/01 15:10:57 trini */ /* * linux/arch/ppc/kernel/signal.c diff -urN linux-2.4.18/arch/ppc/kernel/sleep.S linuxppc-2.4.18/arch/ppc/kernel/sleep.S --- linux-2.4.18/arch/ppc/kernel/sleep.S Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/sleep.S Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.sleep.S 1.18 12/02/01 12:38:54 benh + * BK Id: SCCS/s.sleep.S 1.19 12/27/01 10:08:51 trini */ /* * This file contains sleep low-level functions for PowerBook G3. diff -urN linux-2.4.18/arch/ppc/kernel/smp.c linuxppc-2.4.18/arch/ppc/kernel/smp.c --- linux-2.4.18/arch/ppc/kernel/smp.c Sat Dec 22 08:41:03 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/smp.c Thu Mar 7 10:51:43 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.smp.c 1.37 11/23/01 16:38:30 paulus + * BK Id: SCCS/s.smp.c 1.39 12/07/01 19:16:30 trini */ /* * Smp support for ppc. diff -urN linux-2.4.18/arch/ppc/kernel/softemu8xx.c linuxppc-2.4.18/arch/ppc/kernel/softemu8xx.c --- linux-2.4.18/arch/ppc/kernel/softemu8xx.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/softemu8xx.c Thu Mar 7 10:52:22 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.softemu8xx.c 1.8 05/17/01 18:14:22 cort + * BK Id: SCCS/s.softemu8xx.c 1.10 06/05/01 21:22:04 paulus */ /* * Software emulation of some PPC instructions for the 8xx core. diff -urN linux-2.4.18/arch/ppc/kernel/syscalls.c linuxppc-2.4.18/arch/ppc/kernel/syscalls.c --- linux-2.4.18/arch/ppc/kernel/syscalls.c Tue Nov 6 18:21:30 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/syscalls.c Thu Mar 7 10:52:22 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.syscalls.c 1.11 10/16/01 15:58:42 trini + * BK Id: SCCS/s.syscalls.c 1.12 11/04/01 22:58:20 paulus */ /* * linux/arch/ppc/kernel/sys_ppc.c diff -urN linux-2.4.18/arch/ppc/kernel/time.c linuxppc-2.4.18/arch/ppc/kernel/time.c --- linux-2.4.18/arch/ppc/kernel/time.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/time.c Thu Mar 7 10:51:40 2002 @@ -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.31 02/05/02 19:58:03 paulus */ /* * Common time routines among all ppc machines. diff -urN linux-2.4.18/arch/ppc/kernel/traps.c linuxppc-2.4.18/arch/ppc/kernel/traps.c --- linux-2.4.18/arch/ppc/kernel/traps.c Tue Nov 6 18:21:30 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/traps.c Thu Mar 7 10:52:14 2002 @@ -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.23 11/04/01 22:58:20 paulus */ /* * linux/arch/ppc/kernel/traps.c diff -urN linux-2.4.18/arch/ppc/kernel/walnut_setup.c linuxppc-2.4.18/arch/ppc/kernel/walnut_setup.c --- linux-2.4.18/arch/ppc/kernel/walnut_setup.c Fri Nov 23 18:16:33 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/walnut_setup.c Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.walnut_setup.c 1.10 11/13/01 21:26:07 paulus + * BK Id: SCCS/s.walnut_setup.c 1.11 11/18/01 16:35:08 paulus */ /* * diff -urN linux-2.4.18/arch/ppc/kernel/walnut_setup.h linuxppc-2.4.18/arch/ppc/kernel/walnut_setup.h --- linux-2.4.18/arch/ppc/kernel/walnut_setup.h Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/walnut_setup.h Thu Mar 7 10:52:22 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.walnut_setup.h 1.5 05/17/01 18:14:22 cort + * BK Id: SCCS/s.walnut_setup.h 1.7 06/05/01 21:22:04 paulus */ /* * diff -urN linux-2.4.18/arch/ppc/kernel/xics.c linuxppc-2.4.18/arch/ppc/kernel/xics.c --- linux-2.4.18/arch/ppc/kernel/xics.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/kernel/xics.c Thu Mar 7 10:52:21 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.xics.c 1.8 12/19/01 09:48:40 trini + * BK Id: SCCS/s.xics.c 1.9 12/27/01 10:08:51 trini */ /* * arch/ppc/kernel/xics.c diff -urN linux-2.4.18/arch/ppc/kernel/xics.h linuxppc-2.4.18/arch/ppc/kernel/xics.h --- linux-2.4.18/arch/ppc/kernel/xics.h Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/kernel/xics.h Thu Mar 7 10:52:07 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.xics.h 1.5 05/17/01 18:14:22 cort + * BK Id: SCCS/s.xics.h 1.7 06/05/01 21:22:04 paulus */ /* * arch/ppc/kernel/xics.h diff -urN linux-2.4.18/arch/ppc/lib/Makefile linuxppc-2.4.18/arch/ppc/lib/Makefile --- linux-2.4.18/arch/ppc/lib/Makefile Fri Nov 23 18:16:33 2001 +++ linuxppc-2.4.18/arch/ppc/lib/Makefile Thu Mar 7 10:51:52 2002 @@ -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 -urN linux-2.4.18/arch/ppc/lib/checksum.S linuxppc-2.4.18/arch/ppc/lib/checksum.S --- linux-2.4.18/arch/ppc/lib/checksum.S Mon Sep 24 09:31:17 2001 +++ linuxppc-2.4.18/arch/ppc/lib/checksum.S Thu Mar 7 10:52:09 2002 @@ -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.9 08/29/01 08:49:24 paulus */ /* * This file contains assembly-language implementations diff -urN linux-2.4.18/arch/ppc/lib/locks.c linuxppc-2.4.18/arch/ppc/lib/locks.c --- linux-2.4.18/arch/ppc/lib/locks.c Mon Sep 24 09:31:17 2001 +++ linuxppc-2.4.18/arch/ppc/lib/locks.c Thu Mar 7 10:51:39 2002 @@ -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.12 08/29/01 08:49:24 paulus */ /* * Locks for smp ppc diff -urN linux-2.4.18/arch/ppc/lib/strcase.c linuxppc-2.4.18/arch/ppc/lib/strcase.c --- linux-2.4.18/arch/ppc/lib/strcase.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/lib/strcase.c Thu Mar 7 10:52:09 2002 @@ -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 -urN linux-2.4.18/arch/ppc/lib/string.S linuxppc-2.4.18/arch/ppc/lib/string.S --- linux-2.4.18/arch/ppc/lib/string.S Tue Nov 6 18:21:30 2001 +++ linuxppc-2.4.18/arch/ppc/lib/string.S Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.string.S 1.9 10/25/01 10:08:51 trini + * BK Id: SCCS/s.string.S 1.10 11/04/01 22:58:20 paulus */ /* * String handling functions for PowerPC. diff -urN linux-2.4.18/arch/ppc/math-emu/Makefile linuxppc-2.4.18/arch/ppc/math-emu/Makefile --- linux-2.4.18/arch/ppc/math-emu/Makefile Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/Makefile Thu Mar 7 10:51:43 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/double.h linuxppc-2.4.18/arch/ppc/math-emu/double.h --- linux-2.4.18/arch/ppc/math-emu/double.h Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/double.h Thu Mar 7 10:52:17 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fabs.c linuxppc-2.4.18/arch/ppc/math-emu/fabs.c --- linux-2.4.18/arch/ppc/math-emu/fabs.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fabs.c Thu Mar 7 10:52:21 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fadd.c linuxppc-2.4.18/arch/ppc/math-emu/fadd.c --- linux-2.4.18/arch/ppc/math-emu/fadd.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fadd.c Thu Mar 7 10:52:21 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fadds.c linuxppc-2.4.18/arch/ppc/math-emu/fadds.c --- linux-2.4.18/arch/ppc/math-emu/fadds.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fadds.c Thu Mar 7 10:51:48 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fcmpo.c linuxppc-2.4.18/arch/ppc/math-emu/fcmpo.c --- linux-2.4.18/arch/ppc/math-emu/fcmpo.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fcmpo.c Thu Mar 7 10:51:43 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fcmpu.c linuxppc-2.4.18/arch/ppc/math-emu/fcmpu.c --- linux-2.4.18/arch/ppc/math-emu/fcmpu.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fcmpu.c Thu Mar 7 10:51:50 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fctiw.c linuxppc-2.4.18/arch/ppc/math-emu/fctiw.c --- linux-2.4.18/arch/ppc/math-emu/fctiw.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fctiw.c Thu Mar 7 10:52:08 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fctiwz.c linuxppc-2.4.18/arch/ppc/math-emu/fctiwz.c --- linux-2.4.18/arch/ppc/math-emu/fctiwz.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fctiwz.c Thu Mar 7 10:52:21 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fdiv.c linuxppc-2.4.18/arch/ppc/math-emu/fdiv.c --- linux-2.4.18/arch/ppc/math-emu/fdiv.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fdiv.c Thu Mar 7 10:52:07 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fdivs.c linuxppc-2.4.18/arch/ppc/math-emu/fdivs.c --- linux-2.4.18/arch/ppc/math-emu/fdivs.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fdivs.c Thu Mar 7 10:52:07 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fmadd.c linuxppc-2.4.18/arch/ppc/math-emu/fmadd.c --- linux-2.4.18/arch/ppc/math-emu/fmadd.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fmadd.c Thu Mar 7 10:52:07 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fmadds.c linuxppc-2.4.18/arch/ppc/math-emu/fmadds.c --- linux-2.4.18/arch/ppc/math-emu/fmadds.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fmadds.c Thu Mar 7 10:52:11 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fmr.c linuxppc-2.4.18/arch/ppc/math-emu/fmr.c --- linux-2.4.18/arch/ppc/math-emu/fmr.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fmr.c Thu Mar 7 10:52:13 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fmsub.c linuxppc-2.4.18/arch/ppc/math-emu/fmsub.c --- linux-2.4.18/arch/ppc/math-emu/fmsub.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fmsub.c Thu Mar 7 10:51:41 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fmsubs.c linuxppc-2.4.18/arch/ppc/math-emu/fmsubs.c --- linux-2.4.18/arch/ppc/math-emu/fmsubs.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fmsubs.c Thu Mar 7 10:52:08 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fmul.c linuxppc-2.4.18/arch/ppc/math-emu/fmul.c --- linux-2.4.18/arch/ppc/math-emu/fmul.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fmul.c Thu Mar 7 10:51:51 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fmuls.c linuxppc-2.4.18/arch/ppc/math-emu/fmuls.c --- linux-2.4.18/arch/ppc/math-emu/fmuls.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fmuls.c Thu Mar 7 10:51:51 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fnabs.c linuxppc-2.4.18/arch/ppc/math-emu/fnabs.c --- linux-2.4.18/arch/ppc/math-emu/fnabs.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fnabs.c Thu Mar 7 10:52:12 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fneg.c linuxppc-2.4.18/arch/ppc/math-emu/fneg.c --- linux-2.4.18/arch/ppc/math-emu/fneg.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fneg.c Thu Mar 7 10:51:40 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fnmadd.c linuxppc-2.4.18/arch/ppc/math-emu/fnmadd.c --- linux-2.4.18/arch/ppc/math-emu/fnmadd.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fnmadd.c Thu Mar 7 10:51:42 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fnmadds.c linuxppc-2.4.18/arch/ppc/math-emu/fnmadds.c --- linux-2.4.18/arch/ppc/math-emu/fnmadds.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fnmadds.c Thu Mar 7 10:51:54 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fnmsub.c linuxppc-2.4.18/arch/ppc/math-emu/fnmsub.c --- linux-2.4.18/arch/ppc/math-emu/fnmsub.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fnmsub.c Thu Mar 7 10:51:40 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fnmsubs.c linuxppc-2.4.18/arch/ppc/math-emu/fnmsubs.c --- linux-2.4.18/arch/ppc/math-emu/fnmsubs.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fnmsubs.c Thu Mar 7 10:52:17 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fres.c linuxppc-2.4.18/arch/ppc/math-emu/fres.c --- linux-2.4.18/arch/ppc/math-emu/fres.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fres.c Thu Mar 7 10:52:07 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/frsp.c linuxppc-2.4.18/arch/ppc/math-emu/frsp.c --- linux-2.4.18/arch/ppc/math-emu/frsp.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/frsp.c Thu Mar 7 10:51:51 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/frsqrte.c linuxppc-2.4.18/arch/ppc/math-emu/frsqrte.c --- linux-2.4.18/arch/ppc/math-emu/frsqrte.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/frsqrte.c Thu Mar 7 10:52:14 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fsel.c linuxppc-2.4.18/arch/ppc/math-emu/fsel.c --- linux-2.4.18/arch/ppc/math-emu/fsel.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fsel.c Thu Mar 7 10:52:16 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fsqrt.c linuxppc-2.4.18/arch/ppc/math-emu/fsqrt.c --- linux-2.4.18/arch/ppc/math-emu/fsqrt.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fsqrt.c Thu Mar 7 10:51:39 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fsqrts.c linuxppc-2.4.18/arch/ppc/math-emu/fsqrts.c --- linux-2.4.18/arch/ppc/math-emu/fsqrts.c Sat May 26 12:39:42 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fsqrts.c Thu Mar 7 10:52:09 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fsub.c linuxppc-2.4.18/arch/ppc/math-emu/fsub.c --- linux-2.4.18/arch/ppc/math-emu/fsub.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fsub.c Thu Mar 7 10:52:12 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/fsubs.c linuxppc-2.4.18/arch/ppc/math-emu/fsubs.c --- linux-2.4.18/arch/ppc/math-emu/fsubs.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/fsubs.c Thu Mar 7 10:51:50 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/lfd.c linuxppc-2.4.18/arch/ppc/math-emu/lfd.c --- linux-2.4.18/arch/ppc/math-emu/lfd.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/lfd.c Thu Mar 7 10:51:51 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/lfs.c linuxppc-2.4.18/arch/ppc/math-emu/lfs.c --- linux-2.4.18/arch/ppc/math-emu/lfs.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/lfs.c Thu Mar 7 10:52:24 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/math.c linuxppc-2.4.18/arch/ppc/math-emu/math.c --- linux-2.4.18/arch/ppc/math-emu/math.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/math.c Thu Mar 7 10:52:07 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/mcrfs.c linuxppc-2.4.18/arch/ppc/math-emu/mcrfs.c --- linux-2.4.18/arch/ppc/math-emu/mcrfs.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/mcrfs.c Thu Mar 7 10:51:42 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/mffs.c linuxppc-2.4.18/arch/ppc/math-emu/mffs.c --- linux-2.4.18/arch/ppc/math-emu/mffs.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/mffs.c Thu Mar 7 10:51:53 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/mtfsb0.c linuxppc-2.4.18/arch/ppc/math-emu/mtfsb0.c --- linux-2.4.18/arch/ppc/math-emu/mtfsb0.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/mtfsb0.c Thu Mar 7 10:52:08 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/mtfsb1.c linuxppc-2.4.18/arch/ppc/math-emu/mtfsb1.c --- linux-2.4.18/arch/ppc/math-emu/mtfsb1.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/mtfsb1.c Thu Mar 7 10:51:42 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/mtfsf.c linuxppc-2.4.18/arch/ppc/math-emu/mtfsf.c --- linux-2.4.18/arch/ppc/math-emu/mtfsf.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/mtfsf.c Thu Mar 7 10:51:39 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/mtfsfi.c linuxppc-2.4.18/arch/ppc/math-emu/mtfsfi.c --- linux-2.4.18/arch/ppc/math-emu/mtfsfi.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/mtfsfi.c Thu Mar 7 10:51:52 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/op-1.h linuxppc-2.4.18/arch/ppc/math-emu/op-1.h --- linux-2.4.18/arch/ppc/math-emu/op-1.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/op-1.h Thu Mar 7 10:52:07 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/op-2.h linuxppc-2.4.18/arch/ppc/math-emu/op-2.h --- linux-2.4.18/arch/ppc/math-emu/op-2.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/op-2.h Thu Mar 7 10:52:19 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/op-4.h linuxppc-2.4.18/arch/ppc/math-emu/op-4.h --- linux-2.4.18/arch/ppc/math-emu/op-4.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/op-4.h Thu Mar 7 10:52:19 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/op-common.h linuxppc-2.4.18/arch/ppc/math-emu/op-common.h --- linux-2.4.18/arch/ppc/math-emu/op-common.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/op-common.h Thu Mar 7 10:51:52 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/sfp-machine.h linuxppc-2.4.18/arch/ppc/math-emu/sfp-machine.h --- linux-2.4.18/arch/ppc/math-emu/sfp-machine.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/sfp-machine.h Thu Mar 7 10:52:09 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/single.h linuxppc-2.4.18/arch/ppc/math-emu/single.h --- linux-2.4.18/arch/ppc/math-emu/single.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/single.h Thu Mar 7 10:52:13 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/soft-fp.h linuxppc-2.4.18/arch/ppc/math-emu/soft-fp.h --- linux-2.4.18/arch/ppc/math-emu/soft-fp.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/soft-fp.h Thu Mar 7 10:52:08 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/stfd.c linuxppc-2.4.18/arch/ppc/math-emu/stfd.c --- linux-2.4.18/arch/ppc/math-emu/stfd.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/stfd.c Thu Mar 7 10:52:26 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/stfiwx.c linuxppc-2.4.18/arch/ppc/math-emu/stfiwx.c --- linux-2.4.18/arch/ppc/math-emu/stfiwx.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/stfiwx.c Thu Mar 7 10:51:43 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/stfs.c linuxppc-2.4.18/arch/ppc/math-emu/stfs.c --- linux-2.4.18/arch/ppc/math-emu/stfs.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/stfs.c Thu Mar 7 10:52:13 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/types.c linuxppc-2.4.18/arch/ppc/math-emu/types.c --- linux-2.4.18/arch/ppc/math-emu/types.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/types.c Thu Mar 7 10:51:48 2002 @@ -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 -urN linux-2.4.18/arch/ppc/math-emu/udivmodti4.c linuxppc-2.4.18/arch/ppc/math-emu/udivmodti4.c --- linux-2.4.18/arch/ppc/math-emu/udivmodti4.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/math-emu/udivmodti4.c Thu Mar 7 10:52:21 2002 @@ -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 -urN linux-2.4.18/arch/ppc/mm/4xx_tlb.c linuxppc-2.4.18/arch/ppc/mm/4xx_tlb.c --- linux-2.4.18/arch/ppc/mm/4xx_tlb.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/mm/4xx_tlb.c Thu Mar 7 10:52:18 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.4xx_tlb.c 1.5 05/17/01 18:14:23 cort + * BK Id: SCCS/s.4xx_tlb.c 1.7 06/05/01 21:22:05 paulus */ /* * diff -urN linux-2.4.18/arch/ppc/mm/4xx_tlb.h linuxppc-2.4.18/arch/ppc/mm/4xx_tlb.h --- linux-2.4.18/arch/ppc/mm/4xx_tlb.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/mm/4xx_tlb.h Thu Mar 7 10:51:48 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.4xx_tlb.h 1.5 05/17/01 18:14:23 cort + * BK Id: SCCS/s.4xx_tlb.h 1.7 06/05/01 21:22:05 paulus */ /* * diff -urN linux-2.4.18/arch/ppc/mm/Makefile linuxppc-2.4.18/arch/ppc/mm/Makefile --- linux-2.4.18/arch/ppc/mm/Makefile Mon Sep 24 09:31:17 2001 +++ linuxppc-2.4.18/arch/ppc/mm/Makefile Thu Mar 7 10:52:21 2002 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.8 08/16/01 17:25:47 paulus +# BK Id: SCCS/s.Makefile 1.9 08/29/01 08:49:24 paulus # # # Makefile for the linux ppc-specific parts of the memory manager. diff -urN linux-2.4.18/arch/ppc/mm/extable.c linuxppc-2.4.18/arch/ppc/mm/extable.c --- linux-2.4.18/arch/ppc/mm/extable.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/mm/extable.c Thu Mar 7 10:52:20 2002 @@ -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 -urN linux-2.4.18/arch/ppc/mm/fault.c linuxppc-2.4.18/arch/ppc/mm/fault.c --- linux-2.4.18/arch/ppc/mm/fault.c Wed Oct 10 12:38:52 2001 +++ linuxppc-2.4.18/arch/ppc/mm/fault.c Thu Mar 7 10:51:53 2002 @@ -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.16 10/04/01 09:21:24 trini */ /* * arch/ppc/mm/fault.c diff -urN linux-2.4.18/arch/ppc/mm/hashtable.S linuxppc-2.4.18/arch/ppc/mm/hashtable.S --- linux-2.4.18/arch/ppc/mm/hashtable.S Mon Sep 24 09:31:17 2001 +++ linuxppc-2.4.18/arch/ppc/mm/hashtable.S Thu Mar 7 10:52:11 2002 @@ -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.19 08/29/01 08:49:24 paulus */ /* * arch/ppc/kernel/hashtable.S diff -urN linux-2.4.18/arch/ppc/mm/init.c linuxppc-2.4.18/arch/ppc/mm/init.c --- linux-2.4.18/arch/ppc/mm/init.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/mm/init.c Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.init.c 1.40 01/25/02 15:15:24 benh + * BK Id: SCCS/s.init.c 1.42 02/09/02 10:12:19 trini */ /* * PowerPC version @@ -570,9 +570,6 @@ /* remove the RTAS pages from the available memory */ if (rtas_data) mem_pieces_remove(&phys_avail, rtas_data, rtas_size, 1); - /* remove the sysmap pages from the available memory */ - if (sysmap) - mem_pieces_remove(&phys_avail, __pa(sysmap), sysmap_size, 1); /* Because of some uninorth weirdness, we need a page of * memory as high as possible (it must be outside of the * bus address seen as the AGP aperture). It will be used @@ -588,6 +585,9 @@ agp_special_page = (unsigned long)__va(agp_special_page); } #endif /* CONFIG_ALL_PPC */ + /* remove the sysmap pages from the available memory */ + if (sysmap) + mem_pieces_remove(&phys_avail, __pa(sysmap), sysmap_size, 1); } /* Mark some memory as reserved by removing it from phys_avail. */ diff -urN linux-2.4.18/arch/ppc/mm/mem_pieces.c linuxppc-2.4.18/arch/ppc/mm/mem_pieces.c --- linux-2.4.18/arch/ppc/mm/mem_pieces.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/mm/mem_pieces.c Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mem_pieces.c 1.5 05/17/01 18:14:23 cort + * BK Id: SCCS/s.mem_pieces.c 1.7 06/05/01 21:22:06 paulus */ /* * Copyright (c) 1996 Paul Mackerras diff -urN linux-2.4.18/arch/ppc/mm/mem_pieces.h linuxppc-2.4.18/arch/ppc/mm/mem_pieces.h --- linux-2.4.18/arch/ppc/mm/mem_pieces.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/mm/mem_pieces.h Thu Mar 7 10:52:17 2002 @@ -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 -urN linux-2.4.18/arch/ppc/mm/pgtable.c linuxppc-2.4.18/arch/ppc/mm/pgtable.c --- linux-2.4.18/arch/ppc/mm/pgtable.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/mm/pgtable.c Thu Mar 7 10:52:19 2002 @@ -275,17 +275,17 @@ f = _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_SHARED; #if defined(CONFIG_KGDB) || defined(CONFIG_XMON) /* Allows stub to set breakpoints everywhere */ - f |= _PAGE_RW | _PAGE_DIRTY; -#else + f |= _PAGE_WRENABLE; +#else /* !CONFIG_KGDB && !CONFIG_XMON */ if ((char *) v < _stext || (char *) v >= etext) - f |= _PAGE_RW | _PAGE_DIRTY; + f |= _PAGE_WRENABLE; #ifdef CONFIG_PPC_STD_MMU else /* On the powerpc (not all), no user access forces R/W kernel access */ f |= _PAGE_USER; #endif /* CONFIG_PPC_STD_MMU */ -#endif /* CONFIG_KGDB */ +#endif /* CONFIG_KGDB || CONFIG_XMON */ map_page(v, p, f); v += PAGE_SIZE; p += PAGE_SIZE; diff -urN linux-2.4.18/arch/ppc/xmon/Makefile linuxppc-2.4.18/arch/ppc/xmon/Makefile --- linux-2.4.18/arch/ppc/xmon/Makefile Wed Jul 4 14:33:18 2001 +++ linuxppc-2.4.18/arch/ppc/xmon/Makefile Thu Mar 7 10:52:14 2002 @@ -1,4 +1,4 @@ -# BK Id: SCCS/s.Makefile 1.6 06/27/01 14:49:58 trini +# BK Id: SCCS/s.Makefile 1.7 07/03/01 15:00:31 paulus # # Makefile for xmon diff -urN linux-2.4.18/arch/ppc/xmon/adb.c linuxppc-2.4.18/arch/ppc/xmon/adb.c --- linux-2.4.18/arch/ppc/xmon/adb.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/xmon/adb.c Thu Mar 7 10:52:22 2002 @@ -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 -urN linux-2.4.18/arch/ppc/xmon/ansidecl.h linuxppc-2.4.18/arch/ppc/xmon/ansidecl.h --- linux-2.4.18/arch/ppc/xmon/ansidecl.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/xmon/ansidecl.h Thu Mar 7 10:52:07 2002 @@ -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 -urN linux-2.4.18/arch/ppc/xmon/nonstdio.h linuxppc-2.4.18/arch/ppc/xmon/nonstdio.h --- linux-2.4.18/arch/ppc/xmon/nonstdio.h Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/xmon/nonstdio.h Thu Mar 7 10:51:40 2002 @@ -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.9 12/27/01 10:08:51 trini */ typedef int FILE; extern FILE *xmon_stdin, *xmon_stdout; diff -urN linux-2.4.18/arch/ppc/xmon/ppc-dis.c linuxppc-2.4.18/arch/ppc/xmon/ppc-dis.c --- linux-2.4.18/arch/ppc/xmon/ppc-dis.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/xmon/ppc-dis.c Thu Mar 7 10:51:43 2002 @@ -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 -urN linux-2.4.18/arch/ppc/xmon/ppc-opc.c linuxppc-2.4.18/arch/ppc/xmon/ppc-opc.c --- linux-2.4.18/arch/ppc/xmon/ppc-opc.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/xmon/ppc-opc.c Thu Mar 7 10:51:51 2002 @@ -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 -urN linux-2.4.18/arch/ppc/xmon/ppc.h linuxppc-2.4.18/arch/ppc/xmon/ppc.h --- linux-2.4.18/arch/ppc/xmon/ppc.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/xmon/ppc.h Thu Mar 7 10:52:17 2002 @@ -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 -urN linux-2.4.18/arch/ppc/xmon/privinst.h linuxppc-2.4.18/arch/ppc/xmon/privinst.h --- linux-2.4.18/arch/ppc/xmon/privinst.h Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/xmon/privinst.h Thu Mar 7 10:52:18 2002 @@ -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 -urN linux-2.4.18/arch/ppc/xmon/setjmp.c linuxppc-2.4.18/arch/ppc/xmon/setjmp.c --- linux-2.4.18/arch/ppc/xmon/setjmp.c Sat May 26 12:39:43 2001 +++ linuxppc-2.4.18/arch/ppc/xmon/setjmp.c Thu Mar 7 10:52:08 2002 @@ -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 -urN linux-2.4.18/arch/ppc/xmon/start.c linuxppc-2.4.18/arch/ppc/xmon/start.c --- linux-2.4.18/arch/ppc/xmon/start.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/xmon/start.c Thu Mar 7 10:51:43 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.start.c 1.18 12/01/01 20:09:07 benh + * BK Id: SCCS/s.start.c 1.19 12/27/01 10:08:51 trini */ /* * Copyright (C) 1996 Paul Mackerras. diff -urN linux-2.4.18/arch/ppc/xmon/start_8xx.c linuxppc-2.4.18/arch/ppc/xmon/start_8xx.c --- linux-2.4.18/arch/ppc/xmon/start_8xx.c Wed Oct 10 12:38:52 2001 +++ linuxppc-2.4.18/arch/ppc/xmon/start_8xx.c Thu Mar 7 10:51:52 2002 @@ -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 -urN linux-2.4.18/arch/ppc/xmon/subr_prf.c linuxppc-2.4.18/arch/ppc/xmon/subr_prf.c --- linux-2.4.18/arch/ppc/xmon/subr_prf.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/xmon/subr_prf.c Thu Mar 7 10:51:40 2002 @@ -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.9 12/27/01 10:08:51 trini */ /* * Written by Cort Dougan to replace the version originally used diff -urN linux-2.4.18/arch/ppc/xmon/xmon.c linuxppc-2.4.18/arch/ppc/xmon/xmon.c --- linux-2.4.18/arch/ppc/xmon/xmon.c Mon Mar 4 20:52:34 2002 +++ linuxppc-2.4.18/arch/ppc/xmon/xmon.c Thu Mar 7 10:51:40 2002 @@ -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.19 12/27/01 10:08:51 trini */ /* * Routines providing a simple monitor for use on the PowerMac. diff -urN linux-2.4.18/drivers/ide/aec62xx.c linuxppc-2.4.18/drivers/ide/aec62xx.c --- linux-2.4.18/drivers/ide/aec62xx.c Wed Jun 21 00:52:36 2000 +++ linuxppc-2.4.18/drivers/ide/aec62xx.c Thu Mar 7 10:52:17 2002 @@ -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 -urN linux-2.4.18/drivers/ide/ide-features.c linuxppc-2.4.18/drivers/ide/ide-features.c --- linux-2.4.18/drivers/ide/ide-features.c Thu Feb 22 14:25:06 2001 +++ linuxppc-2.4.18/drivers/ide/ide-features.c Thu Mar 7 10:51:40 2002 @@ -287,7 +287,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) */ /* @@ -356,10 +360,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 -urN linux-2.4.18/drivers/ide/ide-pci.c linuxppc-2.4.18/drivers/ide/ide-pci.c --- linux-2.4.18/drivers/ide/ide-pci.c Tue Nov 6 18:21:32 2001 +++ linuxppc-2.4.18/drivers/ide/ide-pci.c Thu Mar 7 10:51:50 2002 @@ -66,6 +66,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}) @@ -424,6 +426,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 }, @@ -461,6 +465,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; @@ -778,6 +784,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 -urN linux-2.4.18/drivers/net/Config.in linuxppc-2.4.18/drivers/net/Config.in --- linux-2.4.18/drivers/net/Config.in Mon Mar 4 20:52:39 2002 +++ linuxppc-2.4.18/drivers/net/Config.in Thu Mar 7 10:51:47 2002 @@ -3,7 +3,6 @@ # source drivers/net/arcnet/Config.in -source drivers/net/appletalk/Config.in tristate 'Dummy net driver support' CONFIG_DUMMY tristate 'Bonding driver support' CONFIG_BONDING diff -urN linux-2.4.18/drivers/net/Makefile linuxppc-2.4.18/drivers/net/Makefile --- linux-2.4.18/drivers/net/Makefile Mon Mar 4 20:52:39 2002 +++ linuxppc-2.4.18/drivers/net/Makefile Thu Mar 7 10:51:53 2002 @@ -37,7 +37,7 @@ subdir-$(CONFIG_WAN) += wan subdir-$(CONFIG_NET_FC) += fc subdir-$(CONFIG_ARCNET) += arcnet -subdir-$(CONFIG_APPLETALK) += appletalk +subdir-$(CONFIG_DEV_APPLETALK) += appletalk subdir-$(CONFIG_SK98LIN) += sk98lin subdir-$(CONFIG_SKFP) += skfp diff -urN linux-2.4.18/drivers/net/appletalk/Config.in linuxppc-2.4.18/drivers/net/appletalk/Config.in --- linux-2.4.18/drivers/net/appletalk/Config.in Fri Nov 23 18:16:35 2001 +++ linuxppc-2.4.18/drivers/net/appletalk/Config.in Thu Mar 7 10:52:13 2002 @@ -2,22 +2,14 @@ # Appletalk driver configuration # -if [ "$CONFIG_ATALK" != "n" ]; then - mainmenu_option next_comment - comment 'Appletalk devices' - bool 'Appletalk interfaces support' CONFIG_APPLETALK - if [ "$CONFIG_ATALK" != "n" ]; then - dep_tristate ' Apple/Farallon LocalTalk PC support' CONFIG_LTPC $CONFIG_DEV_APPLETALK - dep_tristate ' COPS LocalTalk PC support' CONFIG_COPS $CONFIG_DEV_APPLETALK - if [ "$CONFIG_COPS" != "n" ]; then - bool ' Dayna firmware support' CONFIG_COPS_DAYNA - bool ' Tangent firmware support' CONFIG_COPS_TANGENT - fi - dep_tristate ' Appletalk-IP driver support' CONFIG_IPDDP $CONFIG_DEV_APPLETALK - if [ "$CONFIG_IPDDP" != "n" ]; then - bool ' IP to Appletalk-IP Encapsulation support' CONFIG_IPDDP_ENCAP - bool ' Appletalk-IP to IP Decapsulation support' CONFIG_IPDDP_DECAP - fi - fi - endmenu -fi +mainmenu_option next_comment +comment 'Appletalk devices' +dep_mbool 'Appletalk interfaces support' CONFIG_DEV_APPLETALK $CONFIG_ATALK +dep_tristate ' Apple/Farallon LocalTalk PC support' CONFIG_LTPC $CONFIG_DEV_APPLETALK +dep_tristate ' COPS LocalTalk PC support' CONFIG_COPS $CONFIG_DEV_APPLETALK + dep_mbool ' Dayna firmware support' CONFIG_COPS_DAYNA $CONFIG_COPS + dep_mbool ' Tangent firmware support' CONFIG_COPS_TANGENT $CONFIG_COPS +dep_tristate ' Appletalk-IP driver support' CONFIG_IPDDP $CONFIG_DEV_APPLETALK $CONFIG_ATALK + dep_mbool ' IP to Appletalk-IP Encapsulation support' CONFIG_IPDDP_ENCAP $CONFIG_IPDDP + dep_mbool ' Appletalk-IP to IP Decapsulation support' CONFIG_IPDDP_DECAP $CONFIG_IPDDP +endmenu diff -urN linux-2.4.18/drivers/net/bmac.c linuxppc-2.4.18/drivers/net/bmac.c --- linux-2.4.18/drivers/net/bmac.c Mon Mar 4 20:52:39 2002 +++ linuxppc-2.4.18/drivers/net/bmac.c Thu Mar 7 10:51:50 2002 @@ -24,11 +24,11 @@ #include #include #include +#include #ifdef CONFIG_PMAC_PBOOK #include #include -#include -#endif +#endif /* CONFIG_PMAC_PBOOK */ #include "bmac.h" #define trunc_page(x) ((void *)(((unsigned long)(x)) & ~((unsigned long)(PAGE_SIZE - 1)))) diff -urN linux-2.4.18/drivers/net/ne2k-pci.c linuxppc-2.4.18/drivers/net/ne2k-pci.c --- linux-2.4.18/drivers/net/ne2k-pci.c Sat Dec 22 08:41:07 2001 +++ linuxppc-2.4.18/drivers/net/ne2k-pci.c Thu Mar 7 10:51:50 2002 @@ -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 -urN linux-2.4.18/drivers/usb/usb-ohci.h linuxppc-2.4.18/drivers/usb/usb-ohci.h --- linux-2.4.18/drivers/usb/usb-ohci.h Tue Nov 6 18:21:35 2001 +++ linuxppc-2.4.18/drivers/usb/usb-ohci.h Thu Mar 7 10:52:13 2002 @@ -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 -urN linux-2.4.18/drivers/video/Config.in linuxppc-2.4.18/drivers/video/Config.in --- linux-2.4.18/drivers/video/Config.in Mon Mar 4 20:52:48 2002 +++ linuxppc-2.4.18/drivers/video/Config.in Thu Mar 7 10:51:42 2002 @@ -70,7 +70,7 @@ dep_bool ' Apple "valkyrie" display support' CONFIG_FB_VALKYRIE $CONFIG_ALL_PPC 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 + dep_bool ' S3 Trio display support' CONFIG_FB_S3TRIO $CONFIG_ALL_PPC tristate ' VGA 16-color graphics console' CONFIG_FB_VGA16 fi if [ "$CONFIG_PARISC" = "y" ]; then diff -urN linux-2.4.18/drivers/video/fbmem.c linuxppc-2.4.18/drivers/video/fbmem.c --- linux-2.4.18/drivers/video/fbmem.c Mon Mar 4 20:52:48 2002 +++ linuxppc-2.4.18/drivers/video/fbmem.c Thu Mar 7 10:52:12 2002 @@ -602,6 +602,7 @@ #endif #elif defined(__powerpc__) pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE|_PAGE_GUARDED; + vma->vm_flags |= VM_IO; #elif defined(__alpha__) /* Caching is off in the I/O space quadrant by design. */ #elif defined(__i386__) || defined(__x86_64__) diff -urN linux-2.4.18/drivers/video/radeon.h linuxppc-2.4.18/drivers/video/radeon.h --- linux-2.4.18/drivers/video/radeon.h Mon Mar 4 20:52:48 2002 +++ linuxppc-2.4.18/drivers/video/radeon.h Thu Mar 7 10:51:43 2002 @@ -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 -urN linux-2.4.18/drivers/video/radeonfb.c linuxppc-2.4.18/drivers/video/radeonfb.c --- linux-2.4.18/drivers/video/radeonfb.c Mon Mar 4 20:52:48 2002 +++ linuxppc-2.4.18/drivers/video/radeonfb.c Thu Mar 7 10:51:51 2002 @@ -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 -urN linux-2.4.18/fs/binfmt_elf.c linuxppc-2.4.18/fs/binfmt_elf.c --- linux-2.4.18/fs/binfmt_elf.c Mon Mar 4 20:52:49 2002 +++ linuxppc-2.4.18/fs/binfmt_elf.c Thu Mar 7 10:52:10 2002 @@ -583,6 +583,9 @@ bprm->argc++; } } + } else { + /* Executables without an interpreter also need a personality */ + SET_PERSONALITY(elf_ex, ibcs2_interpreter); } /* Flush all traces of the currently running executable */ diff -urN linux-2.4.18/include/asm-ppc/8xx_immap.h linuxppc-2.4.18/include/asm-ppc/8xx_immap.h --- linux-2.4.18/include/asm-ppc/8xx_immap.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/8xx_immap.h Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.8xx_immap.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.8xx_immap.h 1.7 06/05/01 21:45:20 paulus */ /* diff -urN linux-2.4.18/include/asm-ppc/a.out.h linuxppc-2.4.18/include/asm-ppc/a.out.h --- linux-2.4.18/include/asm-ppc/a.out.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/a.out.h Thu Mar 7 10:52:21 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.a.out.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.a.out.h 1.7 06/05/01 21:45:20 paulus */ #ifndef __PPC_A_OUT_H__ #define __PPC_A_OUT_H__ diff -urN linux-2.4.18/include/asm-ppc/amigahw.h linuxppc-2.4.18/include/asm-ppc/amigahw.h --- linux-2.4.18/include/asm-ppc/amigahw.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/amigahw.h Thu Mar 7 10:51:52 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.amigahw.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.amigahw.h 1.7 06/05/01 21:45:20 paulus */ #ifdef __KERNEL__ #ifndef __ASMPPC_AMIGAHW_H diff -urN linux-2.4.18/include/asm-ppc/amigaints.h linuxppc-2.4.18/include/asm-ppc/amigaints.h --- linux-2.4.18/include/asm-ppc/amigaints.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/amigaints.h Thu Mar 7 10:52:08 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.amigaints.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.amigaints.h 1.7 06/05/01 21:45:20 paulus */ /* ** amigaints.h -- Amiga Linux interrupt handling structs and prototypes diff -urN linux-2.4.18/include/asm-ppc/amigappc.h linuxppc-2.4.18/include/asm-ppc/amigappc.h --- linux-2.4.18/include/asm-ppc/amigappc.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/amigappc.h Thu Mar 7 10:51:43 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.amigappc.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.amigappc.h 1.7 06/05/01 21:45:20 paulus */ /* ** asm-m68k/amigappc.h -- This header defines some values and pointers for diff -urN linux-2.4.18/include/asm-ppc/amigayle.h linuxppc-2.4.18/include/asm-ppc/amigayle.h --- linux-2.4.18/include/asm-ppc/amigayle.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/amigayle.h Thu Mar 7 10:51:43 2002 @@ -1,4 +1,4 @@ /* - * BK Id: SCCS/s.amigayle.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.amigayle.h 1.7 06/05/01 21:45:20 paulus */ #include diff -urN linux-2.4.18/include/asm-ppc/amipcmcia.h linuxppc-2.4.18/include/asm-ppc/amipcmcia.h --- linux-2.4.18/include/asm-ppc/amipcmcia.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/amipcmcia.h Thu Mar 7 10:51:43 2002 @@ -1,4 +1,4 @@ /* - * BK Id: SCCS/s.amipcmcia.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.amipcmcia.h 1.7 06/05/01 21:45:20 paulus */ #include diff -urN linux-2.4.18/include/asm-ppc/atomic.h linuxppc-2.4.18/include/asm-ppc/atomic.h --- linux-2.4.18/include/asm-ppc/atomic.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/atomic.h Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.atomic.h 1.15 10/28/01 10:37:22 trini + * BK Id: SCCS/s.atomic.h 1.16 11/04/01 22:58:20 paulus */ /* * PowerPC atomic operations diff -urN linux-2.4.18/include/asm-ppc/backlight.h linuxppc-2.4.18/include/asm-ppc/backlight.h --- linux-2.4.18/include/asm-ppc/backlight.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/backlight.h Thu Mar 7 10:51:43 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.backlight.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.backlight.h 1.7 06/05/01 21:45:20 paulus */ /* * Routines for handling backlight control on PowerBooks diff -urN linux-2.4.18/include/asm-ppc/bitops.h linuxppc-2.4.18/include/asm-ppc/bitops.h --- linux-2.4.18/include/asm-ppc/bitops.h Wed Jul 4 14:33:56 2001 +++ linuxppc-2.4.18/include/asm-ppc/bitops.h Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.bitops.h 1.9 05/26/01 14:48:14 paulus + * BK Id: SCCS/s.bitops.h 1.10 06/09/01 12:06:37 paulus */ /* * bitops.h: Bit string operations on the ppc diff -urN linux-2.4.18/include/asm-ppc/board.h linuxppc-2.4.18/include/asm-ppc/board.h --- linux-2.4.18/include/asm-ppc/board.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/board.h Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.board.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.board.h 1.7 06/05/01 20:45:54 paulus */ /* * diff -urN linux-2.4.18/include/asm-ppc/bootinfo.h linuxppc-2.4.18/include/asm-ppc/bootinfo.h --- linux-2.4.18/include/asm-ppc/bootinfo.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/bootinfo.h Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.bootinfo.h 1.11 08/17/01 15:23:17 paulus + * BK Id: SCCS/s.bootinfo.h 1.12 08/29/01 08:49:25 paulus */ /* * Non-machine dependent bootinfo structure. Basic idea diff -urN linux-2.4.18/include/asm-ppc/bootx.h linuxppc-2.4.18/include/asm-ppc/bootx.h --- linux-2.4.18/include/asm-ppc/bootx.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/bootx.h Thu Mar 7 10:51:52 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.bootx.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.bootx.h 1.7 06/05/01 21:45:20 paulus */ /* * This file describes the structure passed from the BootX application diff -urN linux-2.4.18/include/asm-ppc/bseip.h linuxppc-2.4.18/include/asm-ppc/bseip.h --- linux-2.4.18/include/asm-ppc/bseip.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/bseip.h Thu Mar 7 10:52:16 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.bseip.h 1.10 08/17/01 15:23:17 paulus + * BK Id: SCCS/s.bseip.h 1.11 08/29/01 08:49:25 paulus */ /* diff -urN linux-2.4.18/include/asm-ppc/bugs.h linuxppc-2.4.18/include/asm-ppc/bugs.h --- linux-2.4.18/include/asm-ppc/bugs.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/bugs.h Thu Mar 7 10:52:13 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.bugs.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.bugs.h 1.7 06/05/01 21:45:20 paulus */ /* * This file is included by 'init/main.c' diff -urN linux-2.4.18/include/asm-ppc/byteorder.h linuxppc-2.4.18/include/asm-ppc/byteorder.h --- linux-2.4.18/include/asm-ppc/byteorder.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/byteorder.h Thu Mar 7 10:52:17 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.byteorder.h 1.8 10/11/01 13:02:49 trini + * BK Id: SCCS/s.byteorder.h 1.9 11/04/01 22:58:21 paulus */ #ifndef _PPC_BYTEORDER_H #define _PPC_BYTEORDER_H diff -urN linux-2.4.18/include/asm-ppc/cache.h linuxppc-2.4.18/include/asm-ppc/cache.h --- linux-2.4.18/include/asm-ppc/cache.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/cache.h Thu Mar 7 10:52:19 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.cache.h 1.10 10/18/01 15:02:09 trini + * BK Id: SCCS/s.cache.h 1.11 11/04/01 22:58:21 paulus */ /* * include/asm-ppc/cache.h diff -urN linux-2.4.18/include/asm-ppc/checksum.h linuxppc-2.4.18/include/asm-ppc/checksum.h --- linux-2.4.18/include/asm-ppc/checksum.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/checksum.h Thu Mar 7 10:51:51 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.checksum.h 1.8 05/17/01 18:14:24 cort + * BK Id: SCCS/s.checksum.h 1.10 06/05/01 21:45:20 paulus */ #ifdef __KERNEL__ #ifndef _PPC_CHECKSUM_H diff -urN linux-2.4.18/include/asm-ppc/cpm_8260.h linuxppc-2.4.18/include/asm-ppc/cpm_8260.h --- linux-2.4.18/include/asm-ppc/cpm_8260.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/cpm_8260.h Thu Mar 7 10:52:18 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.cpm_8260.h 1.7 05/17/01 18:14:24 cort + * BK Id: SCCS/s.cpm_8260.h 1.11 06/05/01 21:45:21 paulus */ /* diff -urN linux-2.4.18/include/asm-ppc/current.h linuxppc-2.4.18/include/asm-ppc/current.h --- linux-2.4.18/include/asm-ppc/current.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/current.h Thu Mar 7 10:52:22 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.current.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.current.h 1.7 06/05/01 21:45:21 paulus */ #ifdef __KERNEL__ #ifndef _PPC_CURRENT_H diff -urN linux-2.4.18/include/asm-ppc/dbdma.h linuxppc-2.4.18/include/asm-ppc/dbdma.h --- linux-2.4.18/include/asm-ppc/dbdma.h Mon Mar 4 20:52:51 2002 +++ linuxppc-2.4.18/include/asm-ppc/dbdma.h Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.dbdma.h 1.8 12/01/01 20:09:11 benh + * BK Id: SCCS/s.dbdma.h 1.9 12/27/01 10:08:52 trini */ /* * Definitions for using the Apple Descriptor-Based DMA controller diff -urN linux-2.4.18/include/asm-ppc/delay.h linuxppc-2.4.18/include/asm-ppc/delay.h --- linux-2.4.18/include/asm-ppc/delay.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/delay.h Thu Mar 7 10:52:23 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.delay.h 1.7 05/17/01 18:14:24 cort + * BK Id: SCCS/s.delay.h 1.9 06/05/01 20:45:54 paulus */ #ifdef __KERNEL__ #ifndef _PPC_DELAY_H diff -urN linux-2.4.18/include/asm-ppc/div64.h linuxppc-2.4.18/include/asm-ppc/div64.h --- linux-2.4.18/include/asm-ppc/div64.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/div64.h Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.div64.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.div64.h 1.7 06/05/01 21:45:21 paulus */ #ifndef __PPC_DIV64 #define __PPC_DIV64 diff -urN linux-2.4.18/include/asm-ppc/dma.h linuxppc-2.4.18/include/asm-ppc/dma.h --- linux-2.4.18/include/asm-ppc/dma.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/dma.h Thu Mar 7 10:52:14 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.dma.h 1.8 05/17/01 18:14:24 cort + * BK Id: SCCS/s.dma.h 1.10 06/05/01 21:45:21 paulus */ /* * linux/include/asm/dma.h: Defines for using and allocating dma channels. diff -urN linux-2.4.18/include/asm-ppc/elf.h linuxppc-2.4.18/include/asm-ppc/elf.h --- linux-2.4.18/include/asm-ppc/elf.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/elf.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.elf.h 1.14 08/21/01 16:07:48 trini + * BK Id: SCCS/s.elf.h 1.15 08/29/01 08:49:25 paulus */ #ifndef __PPC_ELF_H #define __PPC_ELF_H diff -urN linux-2.4.18/include/asm-ppc/errno.h linuxppc-2.4.18/include/asm-ppc/errno.h --- linux-2.4.18/include/asm-ppc/errno.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/errno.h Thu Mar 7 10:52:14 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.errno.h 1.7 05/17/01 18:14:24 cort + * BK Id: SCCS/s.errno.h 1.9 06/05/01 21:45:21 paulus */ #ifndef _PPC_ERRNO_H #define _PPC_ERRNO_H diff -urN linux-2.4.18/include/asm-ppc/est8260.h linuxppc-2.4.18/include/asm-ppc/est8260.h --- linux-2.4.18/include/asm-ppc/est8260.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/est8260.h Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.est8260.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.est8260.h 1.7 06/05/01 21:45:21 paulus */ /* Board information for the EST8260, which should be generic for diff -urN linux-2.4.18/include/asm-ppc/fads.h linuxppc-2.4.18/include/asm-ppc/fads.h --- linux-2.4.18/include/asm-ppc/fads.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/fads.h Thu Mar 7 10:51:53 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.fads.h 1.14 10/26/01 10:14:09 trini + * BK Id: SCCS/s.fads.h 1.15 11/04/01 22:58:21 paulus */ /* diff -urN linux-2.4.18/include/asm-ppc/fcntl.h linuxppc-2.4.18/include/asm-ppc/fcntl.h --- linux-2.4.18/include/asm-ppc/fcntl.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/fcntl.h Thu Mar 7 10:52:08 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.fcntl.h 1.8 09/19/01 23:06:01 paulus + * BK Id: SCCS/s.fcntl.h 1.9 11/04/01 22:58:21 paulus */ #ifndef _PPC_FCNTL_H #define _PPC_FCNTL_H diff -urN linux-2.4.18/include/asm-ppc/floppy.h linuxppc-2.4.18/include/asm-ppc/floppy.h --- linux-2.4.18/include/asm-ppc/floppy.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/floppy.h Thu Mar 7 10:52:08 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.floppy.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.floppy.h 1.8 10/26/01 08:52:33 trini */ /* * Architecture specific parts of the Floppy driver diff -urN linux-2.4.18/include/asm-ppc/gg2.h linuxppc-2.4.18/include/asm-ppc/gg2.h --- linux-2.4.18/include/asm-ppc/gg2.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/gg2.h Thu Mar 7 10:51:44 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.gg2.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.gg2.h 1.7 06/05/01 21:45:21 paulus */ /* * asm-ppc/gg2.h -- VLSI VAS96011/12 `Golden Gate 2' register definitions diff -urN linux-2.4.18/include/asm-ppc/hardirq.h linuxppc-2.4.18/include/asm-ppc/hardirq.h --- linux-2.4.18/include/asm-ppc/hardirq.h Sat Jul 21 09:51:58 2001 +++ linuxppc-2.4.18/include/asm-ppc/hardirq.h Thu Mar 7 10:52:17 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.hardirq.h 1.12 07/10/01 11:26:58 trini + * BK Id: SCCS/s.hardirq.h 1.13 07/18/01 20:18:42 trini */ #ifdef __KERNEL__ #ifndef __ASM_HARDIRQ_H diff -urN linux-2.4.18/include/asm-ppc/hdreg.h linuxppc-2.4.18/include/asm-ppc/hdreg.h --- linux-2.4.18/include/asm-ppc/hdreg.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/hdreg.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.hdreg.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.hdreg.h 1.7 06/05/01 21:45:21 paulus */ /* * linux/include/asm-ppc/hdreg.h diff -urN linux-2.4.18/include/asm-ppc/heathrow.h linuxppc-2.4.18/include/asm-ppc/heathrow.h --- linux-2.4.18/include/asm-ppc/heathrow.h Mon Mar 4 20:52:51 2002 +++ linuxppc-2.4.18/include/asm-ppc/heathrow.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.heathrow.h 1.10 12/01/01 20:09:11 benh + * BK Id: SCCS/s.heathrow.h 1.11 12/27/01 10:08:52 trini */ /* * heathrow.h: definitions for using the "Heathrow" I/O controller chip. diff -urN linux-2.4.18/include/asm-ppc/highmem.h linuxppc-2.4.18/include/asm-ppc/highmem.h --- linux-2.4.18/include/asm-ppc/highmem.h Wed Jul 4 14:33:56 2001 +++ linuxppc-2.4.18/include/asm-ppc/highmem.h Thu Mar 7 10:52:22 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.highmem.h 1.10 06/28/01 15:50:17 paulus + * BK Id: SCCS/s.highmem.h 1.11 07/03/01 15:00:31 paulus */ /* * highmem.h: virtual kernel memory mappings for high memory diff -urN linux-2.4.18/include/asm-ppc/hw_irq.h linuxppc-2.4.18/include/asm-ppc/hw_irq.h --- linux-2.4.18/include/asm-ppc/hw_irq.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/hw_irq.h Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.hw_irq.h 1.10 05/17/01 18:14:24 cort + * BK Id: SCCS/s.hw_irq.h 1.12 06/05/01 21:45:21 paulus */ /* * Copyright (C) 1999 Cort Dougan diff -urN linux-2.4.18/include/asm-ppc/hydra.h linuxppc-2.4.18/include/asm-ppc/hydra.h --- linux-2.4.18/include/asm-ppc/hydra.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/hydra.h Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.hydra.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.hydra.h 1.7 06/05/01 21:45:21 paulus */ /* * asm-ppc/hydra.h -- Mac I/O `Hydra' definitions diff -urN linux-2.4.18/include/asm-ppc/ide.h linuxppc-2.4.18/include/asm-ppc/ide.h --- linux-2.4.18/include/asm-ppc/ide.h Wed Oct 10 12:39:11 2001 +++ linuxppc-2.4.18/include/asm-ppc/ide.h Thu Mar 7 10:51:52 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ide.h 1.16 09/28/01 07:54:24 trini + * BK Id: SCCS/s.ide.h 1.17 10/08/01 16:49:27 trini */ /* * linux/include/asm-ppc/ide.h diff -urN linux-2.4.18/include/asm-ppc/immap_8260.h linuxppc-2.4.18/include/asm-ppc/immap_8260.h --- linux-2.4.18/include/asm-ppc/immap_8260.h Sat Jul 21 09:51:58 2001 +++ linuxppc-2.4.18/include/asm-ppc/immap_8260.h Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.immap_8260.h 1.8 07/18/01 15:46:50 trini + * BK Id: SCCS/s.immap_8260.h 1.9 07/18/01 20:22:25 trini */ /* diff -urN linux-2.4.18/include/asm-ppc/io.h linuxppc-2.4.18/include/asm-ppc/io.h --- linux-2.4.18/include/asm-ppc/io.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/io.h Thu Mar 7 10:51:51 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.io.h 1.14 10/16/01 15:58:42 trini + * BK Id: SCCS/s.io.h 1.15 11/04/01 22:58:21 paulus */ #ifdef __KERNEL__ #ifndef _PPC_IO_H diff -urN linux-2.4.18/include/asm-ppc/ioctl.h linuxppc-2.4.18/include/asm-ppc/ioctl.h --- linux-2.4.18/include/asm-ppc/ioctl.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/ioctl.h Thu Mar 7 10:52:20 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ioctl.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.ioctl.h 1.7 06/05/01 21:45:21 paulus */ #ifndef _PPC_IOCTL_H #define _PPC_IOCTL_H diff -urN linux-2.4.18/include/asm-ppc/ioctls.h linuxppc-2.4.18/include/asm-ppc/ioctls.h --- linux-2.4.18/include/asm-ppc/ioctls.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/ioctls.h Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ioctls.h 1.7 05/17/01 18:14:24 cort + * BK Id: SCCS/s.ioctls.h 1.9 06/05/01 21:45:21 paulus */ #ifndef _ASM_PPC_IOCTLS_H #define _ASM_PPC_IOCTLS_H diff -urN linux-2.4.18/include/asm-ppc/ipc.h linuxppc-2.4.18/include/asm-ppc/ipc.h --- linux-2.4.18/include/asm-ppc/ipc.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/ipc.h Thu Mar 7 10:51:52 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ipc.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.ipc.h 1.7 06/05/01 21:45:21 paulus */ #ifndef __PPC_IPC_H__ #define __PPC_IPC_H__ diff -urN linux-2.4.18/include/asm-ppc/ipcbuf.h linuxppc-2.4.18/include/asm-ppc/ipcbuf.h --- linux-2.4.18/include/asm-ppc/ipcbuf.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/ipcbuf.h Thu Mar 7 10:51:49 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ipcbuf.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.ipcbuf.h 1.7 06/05/01 21:45:21 paulus */ #ifndef __PPC_IPCBUF_H__ #define __PPC_IPCBUF_H__ diff -urN linux-2.4.18/include/asm-ppc/irq.h linuxppc-2.4.18/include/asm-ppc/irq.h --- linux-2.4.18/include/asm-ppc/irq.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/irq.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.irq.h 1.9 05/17/01 18:14:24 cort + * BK Id: SCCS/s.irq.h 1.11 06/05/01 21:45:21 paulus */ #ifdef __KERNEL__ #ifndef _ASM_IRQ_H diff -urN linux-2.4.18/include/asm-ppc/keylargo.h linuxppc-2.4.18/include/asm-ppc/keylargo.h --- linux-2.4.18/include/asm-ppc/keylargo.h Mon Mar 4 20:52:51 2002 +++ linuxppc-2.4.18/include/asm-ppc/keylargo.h Thu Mar 7 10:52:07 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.keylargo.h 1.17 01/20/02 23:53:12 benh + * BK Id: SCCS/s.keylargo.h 1.18 02/05/02 20:01:26 paulus */ /* * keylargo.h: definitions for using the "KeyLargo" I/O controller chip. diff -urN linux-2.4.18/include/asm-ppc/kgdb.h linuxppc-2.4.18/include/asm-ppc/kgdb.h --- linux-2.4.18/include/asm-ppc/kgdb.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/kgdb.h Thu Mar 7 10:51:53 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.kgdb.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.kgdb.h 1.7 06/05/01 21:45:21 paulus */ /* * kgdb.h: Defines and declarations for serial line source level diff -urN linux-2.4.18/include/asm-ppc/kmap_types.h linuxppc-2.4.18/include/asm-ppc/kmap_types.h --- linux-2.4.18/include/asm-ppc/kmap_types.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/kmap_types.h Thu Mar 7 10:52:14 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.kmap_types.h 1.9 08/29/01 14:03:05 paulus + * BK Id: SCCS/s.kmap_types.h 1.11 09/18/01 11:19:07 paulus */ #ifdef __KERNEL__ #ifndef _ASM_KMAP_TYPES_H diff -urN linux-2.4.18/include/asm-ppc/linux_logo.h linuxppc-2.4.18/include/asm-ppc/linux_logo.h --- linux-2.4.18/include/asm-ppc/linux_logo.h Wed Jul 4 14:33:57 2001 +++ linuxppc-2.4.18/include/asm-ppc/linux_logo.h Thu Mar 7 10:51:43 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.linux_logo.h 1.7 05/17/01 18:14:24 cort + * BK Id: SCCS/s.linux_logo.h 1.10 06/09/01 12:03:45 paulus */ /* * include/asm-ppc/linux_logo.h: A linux logo to be displayed on boot diff -urN linux-2.4.18/include/asm-ppc/m48t35.h linuxppc-2.4.18/include/asm-ppc/m48t35.h --- linux-2.4.18/include/asm-ppc/m48t35.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/m48t35.h Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.m48t35.h 1.8 10/16/01 15:58:42 trini + * BK Id: SCCS/s.m48t35.h 1.9 11/04/01 22:58:21 paulus */ /* * Registers for the SGS-Thomson M48T35 Timekeeper RAM chip diff -urN linux-2.4.18/include/asm-ppc/machdep.h linuxppc-2.4.18/include/asm-ppc/machdep.h --- linux-2.4.18/include/asm-ppc/machdep.h Mon Mar 4 20:52:51 2002 +++ linuxppc-2.4.18/include/asm-ppc/machdep.h Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.machdep.h 1.27 12/01/01 20:09:11 benh + * BK Id: SCCS/s.machdep.h 1.29 02/14/02 17:27:01 trini */ #ifdef __KERNEL__ #ifndef _PPC_MACHDEP_H @@ -113,7 +113,7 @@ }; extern struct machdep_calls ppc_md; -extern char cmd_line[512]; +extern char cmd_line[]; extern void setup_pci_ptrs(void); diff -urN linux-2.4.18/include/asm-ppc/mbx.h linuxppc-2.4.18/include/asm-ppc/mbx.h --- linux-2.4.18/include/asm-ppc/mbx.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/mbx.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mbx.h 1.11 08/17/01 15:23:17 paulus + * BK Id: SCCS/s.mbx.h 1.12 08/29/01 08:49:25 paulus */ /* * A collection of structures, addresses, and values associated with diff -urN linux-2.4.18/include/asm-ppc/mc146818rtc.h linuxppc-2.4.18/include/asm-ppc/mc146818rtc.h --- linux-2.4.18/include/asm-ppc/mc146818rtc.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/mc146818rtc.h Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mc146818rtc.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.mc146818rtc.h 1.7 06/05/01 21:45:22 paulus */ /* * Machine dependent access functions for RTC registers. diff -urN linux-2.4.18/include/asm-ppc/md.h linuxppc-2.4.18/include/asm-ppc/md.h --- linux-2.4.18/include/asm-ppc/md.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/md.h Thu Mar 7 10:52:08 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.md.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.md.h 1.7 06/05/01 21:45:22 paulus */ /* * md.h: High speed xor_block operation for RAID4/5 diff -urN linux-2.4.18/include/asm-ppc/mediabay.h linuxppc-2.4.18/include/asm-ppc/mediabay.h --- linux-2.4.18/include/asm-ppc/mediabay.h Mon Mar 4 20:52:51 2002 +++ linuxppc-2.4.18/include/asm-ppc/mediabay.h Thu Mar 7 10:51:51 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mediabay.h 1.8 12/01/01 20:09:11 benh + * BK Id: SCCS/s.mediabay.h 1.9 12/27/01 10:08:52 trini */ /* * mediabay.h: definitions for using the media bay diff -urN linux-2.4.18/include/asm-ppc/mk48t59.h linuxppc-2.4.18/include/asm-ppc/mk48t59.h --- linux-2.4.18/include/asm-ppc/mk48t59.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/mk48t59.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mk48t59.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.mk48t59.h 1.7 06/05/01 21:45:22 paulus */ /* * Registers for the mk48t59 real-time-clock diff -urN linux-2.4.18/include/asm-ppc/mman.h linuxppc-2.4.18/include/asm-ppc/mman.h --- linux-2.4.18/include/asm-ppc/mman.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/mman.h Thu Mar 7 10:52:18 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mman.h 1.7 05/17/01 18:14:25 cort + * BK Id: SCCS/s.mman.h 1.9 06/05/01 21:45:22 paulus */ #ifndef __PPC_MMAN_H__ #define __PPC_MMAN_H__ diff -urN linux-2.4.18/include/asm-ppc/mmu.h linuxppc-2.4.18/include/asm-ppc/mmu.h --- linux-2.4.18/include/asm-ppc/mmu.h Wed Jul 4 14:33:57 2001 +++ linuxppc-2.4.18/include/asm-ppc/mmu.h Thu Mar 7 10:51:53 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mmu.h 1.10 06/28/01 15:50:17 paulus + * BK Id: SCCS/s.mmu.h 1.11 07/03/01 15:00:31 paulus */ /* * PowerPC memory management structures diff -urN linux-2.4.18/include/asm-ppc/mmu_context.h linuxppc-2.4.18/include/asm-ppc/mmu_context.h --- linux-2.4.18/include/asm-ppc/mmu_context.h Wed Oct 10 12:39:11 2001 +++ linuxppc-2.4.18/include/asm-ppc/mmu_context.h Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mmu_context.h 1.18 09/26/01 16:02:49 paulus + * BK Id: SCCS/s.mmu_context.h 1.19 10/04/01 09:21:24 trini */ #ifdef __KERNEL__ #ifndef __PPC_MMU_CONTEXT_H diff -urN linux-2.4.18/include/asm-ppc/module.h linuxppc-2.4.18/include/asm-ppc/module.h --- linux-2.4.18/include/asm-ppc/module.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/module.h Thu Mar 7 10:52:14 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.module.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.module.h 1.8 09/14/01 21:05:58 paulus */ #ifndef _ASM_PPC_MODULE_H #define _ASM_PPC_MODULE_H diff -urN linux-2.4.18/include/asm-ppc/mpc8260.h linuxppc-2.4.18/include/asm-ppc/mpc8260.h --- linux-2.4.18/include/asm-ppc/mpc8260.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/mpc8260.h Thu Mar 7 10:51:49 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mpc8260.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.mpc8260.h 1.9 06/05/01 21:45:22 paulus */ /* This is the single file included by all MPC8260 build options. diff -urN linux-2.4.18/include/asm-ppc/mpc8xx.h linuxppc-2.4.18/include/asm-ppc/mpc8xx.h --- linux-2.4.18/include/asm-ppc/mpc8xx.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/mpc8xx.h Thu Mar 7 10:51:44 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mpc8xx.h 1.15 11/01/01 12:48:53 trini + * BK Id: SCCS/s.mpc8xx.h 1.16 11/04/01 22:58:21 paulus */ /* This is the single file included by all MPC8xx build options. diff -urN linux-2.4.18/include/asm-ppc/msgbuf.h linuxppc-2.4.18/include/asm-ppc/msgbuf.h --- linux-2.4.18/include/asm-ppc/msgbuf.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/msgbuf.h Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.msgbuf.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.msgbuf.h 1.7 06/05/01 21:45:22 paulus */ #ifndef _PPC_MSGBUF_H #define _PPC_MSGBUF_H diff -urN linux-2.4.18/include/asm-ppc/namei.h linuxppc-2.4.18/include/asm-ppc/namei.h --- linux-2.4.18/include/asm-ppc/namei.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/namei.h Thu Mar 7 10:52:17 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.namei.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.namei.h 1.7 06/05/01 21:45:22 paulus */ /* linux/include/asm-ppc/namei.h * Adapted from linux/include/asm-alpha/namei.h diff -urN linux-2.4.18/include/asm-ppc/nvram.h linuxppc-2.4.18/include/asm-ppc/nvram.h --- linux-2.4.18/include/asm-ppc/nvram.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/nvram.h Thu Mar 7 10:51:51 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.nvram.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.nvram.h 1.7 06/05/01 21:45:22 paulus */ /* * PreP compliant NVRAM access diff -urN linux-2.4.18/include/asm-ppc/oak.h linuxppc-2.4.18/include/asm-ppc/oak.h --- linux-2.4.18/include/asm-ppc/oak.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/oak.h Thu Mar 7 10:52:22 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.oak.h 1.12 10/11/01 13:05:07 trini + * BK Id: SCCS/s.oak.h 1.13 11/04/01 22:58:21 paulus */ /* * diff -urN linux-2.4.18/include/asm-ppc/ohare.h linuxppc-2.4.18/include/asm-ppc/ohare.h --- linux-2.4.18/include/asm-ppc/ohare.h Mon Mar 4 20:52:52 2002 +++ linuxppc-2.4.18/include/asm-ppc/ohare.h Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ohare.h 1.8 12/01/01 20:09:11 benh + * BK Id: SCCS/s.ohare.h 1.9 12/27/01 10:08:52 trini */ /* * ohare.h: definitions for using the "O'Hare" I/O controller chip. diff -urN linux-2.4.18/include/asm-ppc/page.h linuxppc-2.4.18/include/asm-ppc/page.h --- linux-2.4.18/include/asm-ppc/page.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/page.h Thu Mar 7 10:51:46 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.page.h 1.8 08/19/01 20:06:47 paulus + * BK Id: SCCS/s.page.h 1.9 08/29/01 08:49:25 paulus */ #ifndef _PPC_PAGE_H #define _PPC_PAGE_H diff -urN linux-2.4.18/include/asm-ppc/param.h linuxppc-2.4.18/include/asm-ppc/param.h --- linux-2.4.18/include/asm-ppc/param.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/param.h Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.param.h 1.8 08/20/01 22:50:29 paulus + * BK Id: SCCS/s.param.h 1.9 08/29/01 08:49:25 paulus */ #ifndef _ASM_PPC_PARAM_H #define _ASM_PPC_PARAM_H diff -urN linux-2.4.18/include/asm-ppc/pci-bridge.h linuxppc-2.4.18/include/asm-ppc/pci-bridge.h --- linux-2.4.18/include/asm-ppc/pci-bridge.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/pci-bridge.h Thu Mar 7 10:51:44 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pci-bridge.h 1.11 05/21/01 01:31:30 cort + * BK Id: SCCS/s.pci-bridge.h 1.13 06/05/01 21:45:22 paulus */ #ifdef __KERNEL__ #ifndef _ASM_PCI_BRIDGE_H diff -urN linux-2.4.18/include/asm-ppc/pci.h linuxppc-2.4.18/include/asm-ppc/pci.h --- linux-2.4.18/include/asm-ppc/pci.h Mon Mar 4 20:52:53 2002 +++ linuxppc-2.4.18/include/asm-ppc/pci.h Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pci.h 1.16 10/15/01 22:51:33 paulus + * BK Id: SCCS/s.pci.h 1.19 01/22/02 13:31:30 trini */ #ifndef __PPC_PCI_H #define __PPC_PCI_H diff -urN linux-2.4.18/include/asm-ppc/pgalloc.h linuxppc-2.4.18/include/asm-ppc/pgalloc.h --- linux-2.4.18/include/asm-ppc/pgalloc.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/pgalloc.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pgalloc.h 1.9 05/17/01 18:14:25 cort + * BK Id: SCCS/s.pgalloc.h 1.11 06/05/01 21:45:22 paulus */ #ifdef __KERNEL__ #ifndef _PPC_PGALLOC_H diff -urN linux-2.4.18/include/asm-ppc/pgtable.h linuxppc-2.4.18/include/asm-ppc/pgtable.h --- linux-2.4.18/include/asm-ppc/pgtable.h Fri Nov 23 18:16:40 2001 +++ linuxppc-2.4.18/include/asm-ppc/pgtable.h Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pgtable.h 1.15 09/22/01 11:26:52 trini + * BK Id: SCCS/s.pgtable.h 1.19 01/11/02 13:57:24 paulus */ #ifdef __KERNEL__ #ifndef _PPC_PGTABLE_H @@ -263,15 +263,6 @@ #define _PAGE_HWWRITE 0 #endif -/* We can't use _PAGE_HWWRITE on any SMP due to the lack of ability - * to atomically manage _PAGE_HWWRITE and it's coordination flags, - * _PAGE_DIRTY or _PAGE_RW. The SMP systems must manage HWWRITE - * or its logical equivalent in the MMU management software. - */ -#if CONFIG_SMP && _PAGE_HWWRITE -#error "You can't configure SMP and HWWRITE" -#endif - #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) /* @@ -281,7 +272,7 @@ * another purpose. -- paulus. */ #define _PAGE_BASE _PAGE_PRESENT | _PAGE_ACCESSED -#define _PAGE_WRENABLE _PAGE_RW | _PAGE_DIRTY +#define _PAGE_WRENABLE _PAGE_RW | _PAGE_DIRTY | _PAGE_HWWRITE #define _PAGE_KERNEL _PAGE_BASE | _PAGE_WRENABLE | _PAGE_SHARED #define _PAGE_IO _PAGE_KERNEL | _PAGE_NO_CACHE | _PAGE_GUARDED diff -urN linux-2.4.18/include/asm-ppc/pmac_feature.h linuxppc-2.4.18/include/asm-ppc/pmac_feature.h --- linux-2.4.18/include/asm-ppc/pmac_feature.h Mon Mar 4 20:52:53 2002 +++ linuxppc-2.4.18/include/asm-ppc/pmac_feature.h Thu Mar 7 10:51:50 2002 @@ -90,6 +90,7 @@ */ #define PMAC_TYPE_PANGEA_IMAC 0x100 /* Flower Power iMac */ #define PMAC_TYPE_IBOOK2 0x101 /* iBook2 (polycarbonate) */ +#define PMAC_TYPE_FLAT_PANEL_IMAC 0x102 /* Flat panel iMac */ #define PMAC_TYPE_UNKNOWN_PANGEA 0x10f /* diff -urN linux-2.4.18/include/asm-ppc/pnp.h linuxppc-2.4.18/include/asm-ppc/pnp.h --- linux-2.4.18/include/asm-ppc/pnp.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/pnp.h Thu Mar 7 10:52:21 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.pnp.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.pnp.h 1.7 06/05/01 21:45:22 paulus */ #ifdef __KERNEL__ /* 11/02/95 */ diff -urN linux-2.4.18/include/asm-ppc/poll.h linuxppc-2.4.18/include/asm-ppc/poll.h --- linux-2.4.18/include/asm-ppc/poll.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/poll.h Thu Mar 7 10:51:40 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.poll.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.poll.h 1.7 06/05/01 21:45:22 paulus */ #ifndef __PPC_POLL_H #define __PPC_POLL_H diff -urN linux-2.4.18/include/asm-ppc/posix_types.h linuxppc-2.4.18/include/asm-ppc/posix_types.h --- linux-2.4.18/include/asm-ppc/posix_types.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/posix_types.h Thu Mar 7 10:51:43 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.posix_types.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.posix_types.h 1.7 06/05/01 21:45:22 paulus */ #ifndef _PPC_POSIX_TYPES_H #define _PPC_POSIX_TYPES_H diff -urN linux-2.4.18/include/asm-ppc/prep_nvram.h linuxppc-2.4.18/include/asm-ppc/prep_nvram.h --- linux-2.4.18/include/asm-ppc/prep_nvram.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/prep_nvram.h Thu Mar 7 10:51:46 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.prep_nvram.h 1.7 05/17/01 18:14:25 cort + * BK Id: SCCS/s.prep_nvram.h 1.9 06/05/01 21:45:22 paulus */ /* * PreP compliant NVRAM access diff -urN linux-2.4.18/include/asm-ppc/processor.h linuxppc-2.4.18/include/asm-ppc/processor.h --- linux-2.4.18/include/asm-ppc/processor.h Mon Mar 4 20:52:54 2002 +++ linuxppc-2.4.18/include/asm-ppc/processor.h Thu Mar 7 10:51:51 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.processor.h 1.33 12/01/01 20:09:11 benh + * BK Id: SCCS/s.processor.h 1.34 12/27/01 10:08:52 trini */ #ifdef __KERNEL__ #ifndef __ASM_PPC_PROCESSOR_H diff -urN linux-2.4.18/include/asm-ppc/prom.h linuxppc-2.4.18/include/asm-ppc/prom.h --- linux-2.4.18/include/asm-ppc/prom.h Mon Mar 4 20:52:54 2002 +++ linuxppc-2.4.18/include/asm-ppc/prom.h Thu Mar 7 10:52:07 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.prom.h 1.21 12/01/01 20:09:11 benh + * BK Id: SCCS/s.prom.h 1.23 01/03/02 21:58:52 paulus */ /* * Definitions for talking to the Open Firmware PROM on @@ -107,9 +107,11 @@ * pointer values. See arch/ppc/kernel/prom.c for how these are used. */ extern unsigned long reloc_offset(void); +extern unsigned long add_reloc_offset(unsigned long); +extern unsigned long sub_reloc_offset(unsigned long); -#define PTRRELOC(x) ((typeof(x))((unsigned long)(x) + offset)) -#define PTRUNRELOC(x) ((typeof(x))((unsigned long)(x) - offset)) +#define PTRRELOC(x) ((typeof(x))add_reloc_offset((unsigned long)(x))) +#define PTRUNRELOC(x) ((typeof(x))sub_reloc_offset((unsigned long)(x))) #define RELOC(x) (*PTRRELOC(&(x))) #endif /* _PPC_PROM_H */ diff -urN linux-2.4.18/include/asm-ppc/ptrace.h linuxppc-2.4.18/include/asm-ppc/ptrace.h --- linux-2.4.18/include/asm-ppc/ptrace.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/ptrace.h Thu Mar 7 10:51:39 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ptrace.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.ptrace.h 1.8 01/17/02 23:05:50 paulus */ #ifndef _PPC_PTRACE_H #define _PPC_PTRACE_H @@ -103,5 +103,8 @@ #define PT_FPR31 (PT_FPR0 + 2*31) #define PT_FPSCR (PT_FPR0 + 2*32 + 1) -#endif +/* Get/set all the altivec registers vr0..vr31, vscr, vrsave, in one go */ +#define PTRACE_GETVRREGS 18 +#define PTRACE_SETVRREGS 19 +#endif diff -urN linux-2.4.18/include/asm-ppc/raven.h linuxppc-2.4.18/include/asm-ppc/raven.h --- linux-2.4.18/include/asm-ppc/raven.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/raven.h Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.raven.h 1.7 05/17/01 18:14:25 cort + * BK Id: SCCS/s.raven.h 1.9 06/05/01 21:45:22 paulus */ /* * asm-ppc/raven.h -- Raven MPIC chip. diff -urN linux-2.4.18/include/asm-ppc/residual.h linuxppc-2.4.18/include/asm-ppc/residual.h --- linux-2.4.18/include/asm-ppc/residual.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/residual.h Thu Mar 7 10:52:21 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.residual.h 1.8 08/09/01 09:11:24 trini + * BK Id: SCCS/s.residual.h 1.9 08/29/01 08:49:25 paulus */ /* 7/18/95 */ /*----------------------------------------------------------------------------*/ diff -urN linux-2.4.18/include/asm-ppc/resource.h linuxppc-2.4.18/include/asm-ppc/resource.h --- linux-2.4.18/include/asm-ppc/resource.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/resource.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.resource.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.resource.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _PPC_RESOURCE_H #define _PPC_RESOURCE_H diff -urN linux-2.4.18/include/asm-ppc/rpxclassic.h linuxppc-2.4.18/include/asm-ppc/rpxclassic.h --- linux-2.4.18/include/asm-ppc/rpxclassic.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/rpxclassic.h Thu Mar 7 10:52:23 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.rpxclassic.h 1.11 08/17/01 15:23:17 paulus + * BK Id: SCCS/s.rpxclassic.h 1.12 08/29/01 08:49:25 paulus */ /* diff -urN linux-2.4.18/include/asm-ppc/rpxlite.h linuxppc-2.4.18/include/asm-ppc/rpxlite.h --- linux-2.4.18/include/asm-ppc/rpxlite.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/rpxlite.h Thu Mar 7 10:52:21 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.rpxlite.h 1.11 08/17/01 15:23:17 paulus + * BK Id: SCCS/s.rpxlite.h 1.12 08/29/01 08:49:25 paulus */ /* diff -urN linux-2.4.18/include/asm-ppc/scatterlist.h linuxppc-2.4.18/include/asm-ppc/scatterlist.h --- linux-2.4.18/include/asm-ppc/scatterlist.h Wed Oct 24 23:05:18 2001 +++ linuxppc-2.4.18/include/asm-ppc/scatterlist.h Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.scatterlist.h 1.9 10/15/01 22:51:33 paulus + * BK Id: SCCS/s.scatterlist.h 1.10 10/22/01 10:22:27 paulus */ #ifdef __KERNEL__ #ifndef _PPC_SCATTERLIST_H diff -urN linux-2.4.18/include/asm-ppc/segment.h linuxppc-2.4.18/include/asm-ppc/segment.h --- linux-2.4.18/include/asm-ppc/segment.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/segment.h Thu Mar 7 10:52:17 2002 @@ -1,4 +1,4 @@ /* - * BK Id: SCCS/s.segment.h 1.7 05/17/01 18:14:25 cort + * BK Id: SCCS/s.segment.h 1.9 06/05/01 21:45:23 paulus */ #include diff -urN linux-2.4.18/include/asm-ppc/semaphore.h linuxppc-2.4.18/include/asm-ppc/semaphore.h --- linux-2.4.18/include/asm-ppc/semaphore.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/semaphore.h Thu Mar 7 10:51:54 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.semaphore.h 1.15 05/17/01 18:14:25 cort + * BK Id: SCCS/s.semaphore.h 1.17 06/05/01 21:45:23 paulus */ #ifndef _PPC_SEMAPHORE_H #define _PPC_SEMAPHORE_H diff -urN linux-2.4.18/include/asm-ppc/sembuf.h linuxppc-2.4.18/include/asm-ppc/sembuf.h --- linux-2.4.18/include/asm-ppc/sembuf.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/sembuf.h Thu Mar 7 10:51:46 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.sembuf.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.sembuf.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _PPC_SEMBUF_H #define _PPC_SEMBUF_H diff -urN linux-2.4.18/include/asm-ppc/serial.h linuxppc-2.4.18/include/asm-ppc/serial.h --- linux-2.4.18/include/asm-ppc/serial.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/serial.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.serial.h 1.15 10/23/01 08:09:35 trini + * BK Id: SCCS/s.serial.h 1.16 11/04/01 22:58:21 paulus */ /* * include/asm-ppc/serial.h diff -urN linux-2.4.18/include/asm-ppc/setup.h linuxppc-2.4.18/include/asm-ppc/setup.h --- linux-2.4.18/include/asm-ppc/setup.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/setup.h Thu Mar 7 10:51:48 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.setup.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.setup.h 1.7 06/05/01 21:45:23 paulus */ #ifdef __KERNEL__ #ifndef _PPC_SETUP_H diff -urN linux-2.4.18/include/asm-ppc/shmbuf.h linuxppc-2.4.18/include/asm-ppc/shmbuf.h --- linux-2.4.18/include/asm-ppc/shmbuf.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/shmbuf.h Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.shmbuf.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.shmbuf.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _PPC_SHMBUF_H #define _PPC_SHMBUF_H diff -urN linux-2.4.18/include/asm-ppc/shmparam.h linuxppc-2.4.18/include/asm-ppc/shmparam.h --- linux-2.4.18/include/asm-ppc/shmparam.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/shmparam.h Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.shmparam.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.shmparam.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _PPC_SHMPARAM_H #define _PPC_SHMPARAM_H diff -urN linux-2.4.18/include/asm-ppc/sigcontext.h linuxppc-2.4.18/include/asm-ppc/sigcontext.h --- linux-2.4.18/include/asm-ppc/sigcontext.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/sigcontext.h Thu Mar 7 10:52:14 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.sigcontext.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.sigcontext.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _ASM_PPC_SIGCONTEXT_H #define _ASM_PPC_SIGCONTEXT_H diff -urN linux-2.4.18/include/asm-ppc/siginfo.h linuxppc-2.4.18/include/asm-ppc/siginfo.h --- linux-2.4.18/include/asm-ppc/siginfo.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/siginfo.h Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.siginfo.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.siginfo.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _PPC_SIGINFO_H #define _PPC_SIGINFO_H diff -urN linux-2.4.18/include/asm-ppc/signal.h linuxppc-2.4.18/include/asm-ppc/signal.h --- linux-2.4.18/include/asm-ppc/signal.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/signal.h Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.signal.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.signal.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _ASMPPC_SIGNAL_H #define _ASMPPC_SIGNAL_H diff -urN linux-2.4.18/include/asm-ppc/smp.h linuxppc-2.4.18/include/asm-ppc/smp.h --- linux-2.4.18/include/asm-ppc/smp.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/smp.h Thu Mar 7 10:51:52 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.smp.h 1.12 08/16/01 07:49:31 paulus + * BK Id: SCCS/s.smp.h 1.13 08/29/01 08:49:25 paulus */ /* smp.h: PPC specific SMP stuff. * diff -urN linux-2.4.18/include/asm-ppc/smplock.h linuxppc-2.4.18/include/asm-ppc/smplock.h --- linux-2.4.18/include/asm-ppc/smplock.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/smplock.h Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.smplock.h 1.10 10/23/01 08:09:35 trini + * BK Id: SCCS/s.smplock.h 1.11 11/04/01 22:58:21 paulus */ /* * diff -urN linux-2.4.18/include/asm-ppc/socket.h linuxppc-2.4.18/include/asm-ppc/socket.h --- linux-2.4.18/include/asm-ppc/socket.h Wed Jul 4 14:33:57 2001 +++ linuxppc-2.4.18/include/asm-ppc/socket.h Thu Mar 7 10:51:51 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.socket.h 1.6 05/17/01 18:14:25 cort + * BK Id: SCCS/s.socket.h 1.9 06/25/01 14:03:57 paulus */ #ifndef _ASM_SOCKET_H #define _ASM_SOCKET_H diff -urN linux-2.4.18/include/asm-ppc/sockios.h linuxppc-2.4.18/include/asm-ppc/sockios.h --- linux-2.4.18/include/asm-ppc/sockios.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/sockios.h Thu Mar 7 10:52:09 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.sockios.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.sockios.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _ASM_PPC_SOCKIOS_H #define _ASM_PPC_SOCKIOS_H diff -urN linux-2.4.18/include/asm-ppc/softirq.h linuxppc-2.4.18/include/asm-ppc/softirq.h --- linux-2.4.18/include/asm-ppc/softirq.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/softirq.h Thu Mar 7 10:52:24 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.softirq.h 1.13 07/12/01 20:02:34 paulus + * BK Id: SCCS/s.softirq.h 1.15 09/09/01 12:18:02 trini */ #ifdef __KERNEL__ #ifndef __ASM_SOFTIRQ_H diff -urN linux-2.4.18/include/asm-ppc/spinlock.h linuxppc-2.4.18/include/asm-ppc/spinlock.h --- linux-2.4.18/include/asm-ppc/spinlock.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/spinlock.h Thu Mar 7 10:52:21 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.spinlock.h 1.9 08/21/01 16:07:48 trini + * BK Id: SCCS/s.spinlock.h 1.10 08/29/01 08:49:25 paulus */ #ifndef __ASM_SPINLOCK_H #define __ASM_SPINLOCK_H diff -urN linux-2.4.18/include/asm-ppc/stat.h linuxppc-2.4.18/include/asm-ppc/stat.h --- linux-2.4.18/include/asm-ppc/stat.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/stat.h Thu Mar 7 10:52:07 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.stat.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.stat.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _PPC_STAT_H #define _PPC_STAT_H diff -urN linux-2.4.18/include/asm-ppc/statfs.h linuxppc-2.4.18/include/asm-ppc/statfs.h --- linux-2.4.18/include/asm-ppc/statfs.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/statfs.h Thu Mar 7 10:52:12 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.statfs.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.statfs.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _PPC_STATFS_H #define _PPC_STATFS_H diff -urN linux-2.4.18/include/asm-ppc/string.h linuxppc-2.4.18/include/asm-ppc/string.h --- linux-2.4.18/include/asm-ppc/string.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/string.h Thu Mar 7 10:52:14 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.string.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.string.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _PPC_STRING_H_ #define _PPC_STRING_H_ diff -urN linux-2.4.18/include/asm-ppc/system.h linuxppc-2.4.18/include/asm-ppc/system.h --- linux-2.4.18/include/asm-ppc/system.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/system.h Thu Mar 7 10:51:39 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.system.h 1.14 08/20/01 14:34:41 paulus + * BK Id: SCCS/s.system.h 1.19 01/22/02 15:57:22 trini */ /* * Copyright (C) 1999 Cort Dougan @@ -59,7 +59,7 @@ extern long _get_L2CR(void); extern void _set_L2CR(unsigned long); #else -#define _get_L2CR() 0 +#define _get_L2CR() 0L #define _set_L2CR(val) do { } while(0) #endif extern void via_cuda_init(void); @@ -120,10 +120,6 @@ #define local_irq_save(flags) __save_and_cli(flags) #define local_irq_restore(flags) __restore_flags(flags) -#endif /* __KERNEL__ */ - -#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) - static __inline__ unsigned long xchg_u32(volatile void *p, unsigned long val) { @@ -222,4 +218,5 @@ (unsigned long)_n_, sizeof(*(ptr))); \ }) +#endif /* __KERNEL__ */ #endif /* __PPC_SYSTEM_H */ diff -urN linux-2.4.18/include/asm-ppc/termbits.h linuxppc-2.4.18/include/asm-ppc/termbits.h --- linux-2.4.18/include/asm-ppc/termbits.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/termbits.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.termbits.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.termbits.h 1.7 06/05/01 21:45:23 paulus */ #ifndef _PPC_TERMBITS_H #define _PPC_TERMBITS_H diff -urN linux-2.4.18/include/asm-ppc/termios.h linuxppc-2.4.18/include/asm-ppc/termios.h --- linux-2.4.18/include/asm-ppc/termios.h Wed Jul 4 14:33:57 2001 +++ linuxppc-2.4.18/include/asm-ppc/termios.h Thu Mar 7 10:51:51 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.termios.h 1.8 05/17/01 18:14:26 cort + * BK Id: SCCS/s.termios.h 1.11 06/09/01 12:03:45 paulus */ #ifndef _PPC_TERMIOS_H #define _PPC_TERMIOS_H diff -urN linux-2.4.18/include/asm-ppc/time.h linuxppc-2.4.18/include/asm-ppc/time.h --- linux-2.4.18/include/asm-ppc/time.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/time.h Thu Mar 7 10:51:53 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.time.h 1.17 10/23/01 08:09:35 trini + * BK Id: SCCS/s.time.h 1.18 11/04/01 22:58:21 paulus */ /* * Common time prototypes and such for all ppc machines. diff -urN linux-2.4.18/include/asm-ppc/timex.h linuxppc-2.4.18/include/asm-ppc/timex.h --- linux-2.4.18/include/asm-ppc/timex.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/timex.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.timex.h 1.8 08/15/01 22:43:07 paulus + * BK Id: SCCS/s.timex.h 1.9 08/29/01 08:49:25 paulus */ /* * linux/include/asm-ppc/timex.h diff -urN linux-2.4.18/include/asm-ppc/traps.h linuxppc-2.4.18/include/asm-ppc/traps.h --- linux-2.4.18/include/asm-ppc/traps.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/traps.h Thu Mar 7 10:51:39 2002 @@ -1,4 +1,4 @@ /* - * BK Id: SCCS/s.traps.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.traps.h 1.7 06/05/01 21:45:23 paulus */ #include diff -urN linux-2.4.18/include/asm-ppc/types.h linuxppc-2.4.18/include/asm-ppc/types.h --- linux-2.4.18/include/asm-ppc/types.h Wed Oct 24 23:05:18 2001 +++ linuxppc-2.4.18/include/asm-ppc/types.h Thu Mar 7 10:52:23 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.types.h 1.10 10/15/01 22:51:33 paulus + * BK Id: SCCS/s.types.h 1.11 10/22/01 10:22:27 paulus */ #ifndef _PPC_TYPES_H #define _PPC_TYPES_H diff -urN linux-2.4.18/include/asm-ppc/uaccess.h linuxppc-2.4.18/include/asm-ppc/uaccess.h --- linux-2.4.18/include/asm-ppc/uaccess.h Mon Sep 24 09:31:36 2001 +++ linuxppc-2.4.18/include/asm-ppc/uaccess.h Thu Mar 7 10:52:23 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.uaccess.h 1.8 09/11/01 18:10:06 paulus + * BK Id: SCCS/s.uaccess.h 1.9 09/14/01 21:06:49 paulus */ #ifdef __KERNEL__ #ifndef _PPC_UACCESS_H diff -urN linux-2.4.18/include/asm-ppc/ucontext.h linuxppc-2.4.18/include/asm-ppc/ucontext.h --- linux-2.4.18/include/asm-ppc/ucontext.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/ucontext.h Thu Mar 7 10:52:22 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ucontext.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.ucontext.h 1.7 06/05/01 21:45:24 paulus */ #ifndef _ASMPPC_UCONTEXT_H #define _ASMPPC_UCONTEXT_H diff -urN linux-2.4.18/include/asm-ppc/unaligned.h linuxppc-2.4.18/include/asm-ppc/unaligned.h --- linux-2.4.18/include/asm-ppc/unaligned.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/unaligned.h Thu Mar 7 10:51:39 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.unaligned.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.unaligned.h 1.7 06/05/01 21:45:24 paulus */ #ifdef __KERNEL__ #ifndef __PPC_UNALIGNED_H diff -urN linux-2.4.18/include/asm-ppc/uninorth.h linuxppc-2.4.18/include/asm-ppc/uninorth.h --- linux-2.4.18/include/asm-ppc/uninorth.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/uninorth.h Thu Mar 7 10:51:44 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.uninorth.h 1.13 10/23/01 08:09:35 trini + * BK Id: SCCS/s.uninorth.h 1.14 11/04/01 22:58:21 paulus */ /* * uninorth.h: definitions for using the "UniNorth" host bridge chip diff -urN linux-2.4.18/include/asm-ppc/unistd.h linuxppc-2.4.18/include/asm-ppc/unistd.h --- linux-2.4.18/include/asm-ppc/unistd.h Tue Nov 6 18:21:37 2001 +++ linuxppc-2.4.18/include/asm-ppc/unistd.h Thu Mar 7 10:51:50 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.unistd.h 1.11 10/18/01 17:29:53 trini + * BK Id: SCCS/s.unistd.h 1.12 11/04/01 22:58:21 paulus */ #ifndef _ASM_PPC_UNISTD_H_ #define _ASM_PPC_UNISTD_H_ diff -urN linux-2.4.18/include/asm-ppc/user.h linuxppc-2.4.18/include/asm-ppc/user.h --- linux-2.4.18/include/asm-ppc/user.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/user.h Thu Mar 7 10:52:22 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.user.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.user.h 1.7 06/05/01 21:45:24 paulus */ #ifdef __KERNEL__ #ifndef _PPC_USER_H diff -urN linux-2.4.18/include/asm-ppc/vc_ioctl.h linuxppc-2.4.18/include/asm-ppc/vc_ioctl.h --- linux-2.4.18/include/asm-ppc/vc_ioctl.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/vc_ioctl.h Thu Mar 7 10:51:41 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.vc_ioctl.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.vc_ioctl.h 1.7 06/05/01 21:45:24 paulus */ #ifndef _LINUX_VC_IOCTL_H #define _LINUX_VC_IOCTL_H diff -urN linux-2.4.18/include/asm-ppc/vga.h linuxppc-2.4.18/include/asm-ppc/vga.h --- linux-2.4.18/include/asm-ppc/vga.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/vga.h Thu Mar 7 10:51:42 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.vga.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.vga.h 1.7 06/05/01 21:45:24 paulus */ /* * Access to VGA videoram diff -urN linux-2.4.18/include/asm-ppc/walnut.h linuxppc-2.4.18/include/asm-ppc/walnut.h --- linux-2.4.18/include/asm-ppc/walnut.h Wed Oct 10 12:39:11 2001 +++ linuxppc-2.4.18/include/asm-ppc/walnut.h Thu Mar 7 10:51:52 2002 @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.walnut.h 1.10 09/14/01 17:37:56 trini + * BK Id: SCCS/s.walnut.h 1.11 10/08/01 16:49:27 trini */ /* * diff -urN linux-2.4.18/include/asm-ppc/xor.h linuxppc-2.4.18/include/asm-ppc/xor.h --- linux-2.4.18/include/asm-ppc/xor.h Sat May 26 12:39:54 2001 +++ linuxppc-2.4.18/include/asm-ppc/xor.h Thu Mar 7 10:52:17 2002 @@ -1,4 +1,4 @@ /* - * BK Id: SCCS/s.xor.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.xor.h 1.7 06/05/01 21:45:24 paulus */ #include diff -urN linux-2.4.18/net/Config.in linuxppc-2.4.18/net/Config.in --- linux-2.4.18/net/Config.in Mon Mar 4 20:52:55 2002 +++ linuxppc-2.4.18/net/Config.in Thu Mar 7 10:52:13 2002 @@ -54,7 +54,10 @@ if [ "$CONFIG_IPX" != "n" ]; then source net/ipx/Config.in fi + tristate 'Appletalk protocol support' CONFIG_ATALK +source drivers/net/appletalk/Config.in + tristate 'DECnet Support' CONFIG_DECNET if [ "$CONFIG_DECNET" != "n" ]; then source net/decnet/Config.in