Commit de6639d2 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://ppc.bkbits.net/for-linus-ppc

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 393a9572 69d423da
...@@ -64,7 +64,7 @@ drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/ ...@@ -64,7 +64,7 @@ drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/ drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
drivers-$(CONFIG_8260) += arch/ppc/8260_io/ drivers-$(CONFIG_8260) += arch/ppc/8260_io/
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot makeboot = $(call descend,arch/ppc/boot,$(1))
BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd pImage vmlinux.sm BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd pImage vmlinux.sm
...@@ -74,14 +74,14 @@ AFLAGS_vmlinux.lds.o := -Upowerpc ...@@ -74,14 +74,14 @@ AFLAGS_vmlinux.lds.o := -Upowerpc
bzImage: zImage bzImage: zImage
$(BOOT_TARGETS): vmlinux $(BOOT_TARGETS): vmlinux
@$(MAKEBOOT) $@ +@$(call makeboot,$@)
%_config: arch/ppc/configs/%_defconfig %_config: arch/ppc/configs/%_defconfig
rm -f .config arch/ppc/defconfig rm -f .config arch/ppc/defconfig
cp -f arch/ppc/configs/$(@:config=defconfig) .config cp -f arch/ppc/configs/$(@:config=defconfig) .config
archclean: archclean:
@$(MAKEBOOT) clean +@$(call makeboot,clean)
archmrproper: archmrproper:
......
...@@ -10,25 +10,16 @@ ...@@ -10,25 +10,16 @@
# modified by Cort (cort@cs.nmt.edu) # modified by Cort (cort@cs.nmt.edu)
# #
GZIP_FLAGS = -v9f
CFLAGS += -fno-builtin -D__BOOTER__ -I$(TOPDIR)/arch/$(ARCH)/boot/include CFLAGS += -fno-builtin -D__BOOTER__ -I$(TOPDIR)/arch/$(ARCH)/boot/include
AFLAGS += -D__BOOTER__ AFLAGS += -D__BOOTER__
OBJCOPY_ARGS = -O elf32-powerpc OBJCOPY_ARGS = -O elf32-powerpc
MKIMAGE := ./utils/mkimage.wrapper subdir-y := simple
subdir-$(CONFIG_ALL_PPC) := openfirmware prep
lib/lib.a: lib/zlib.c
$(MAKE) -C lib
images/vmlinux.gz: $(TOPDIR)/vmlinux HOSTCFLAGS += -Iarch/$(ARCH)/boot/include
$(MAKE) -C images vmlinux.gz
# 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) := openfirmware prep
tools-$(CONFIG_ALL_PPC) := addnote mknote hack-coff mkprep tools-$(CONFIG_ALL_PPC) := addnote mknote hack-coff mkprep
tools-$(CONFIG_PPLUS) := mkbugboot mkprep tools-$(CONFIG_PPLUS) := mkbugboot mkprep
tools-$(CONFIG_4xx) := mktree tools-$(CONFIG_4xx) := mktree
...@@ -40,49 +31,24 @@ tools-$(CONFIG_PRPMC750) := mkbugboot mkprep ...@@ -40,49 +31,24 @@ tools-$(CONFIG_PRPMC750) := mkbugboot mkprep
tools-$(CONFIG_PRPMC800) := mkbugboot mkprep tools-$(CONFIG_PRPMC800) := mkbugboot mkprep
tools-$(CONFIG_SPRUCE) := mktree tools-$(CONFIG_SPRUCE) := mktree
# These are dirs we don't want to go into on BOOT_TARGETS. We have them for all-tools := addnote mknote hack-coff mkprep mkbugboot mktree
# the 'depend' stage.
NONBOOT := lib common
# These are the subdirs we want to use host-progs := $(addprefix utils/,$(tools-y))
BOOTDIRS = $(filter-out $(NONBOOT), $(subdir-y))
makeof1275: include $(TOPDIR)/Rules.make
$(MAKE) -C of1275
# This will make the tools we need. We do it like this to ensure that we use
# HOSTCC. -- Tom
maketools:
$(MAKE) -C utils $(tools-y)
# The targets all boards support for boot images.
BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
$(BOOT_TARGETS): vmapus lib/lib.a images/vmlinux.gz makeof1275 maketools zImage zImage.initrd znetboot znetboot.initrd: $(subdir-y)
ifneq ($(BOOTDIRS),)
for d in $(BOOTDIRS); do $(MAKE) -C $$d $@; done
endif
vmapus: $(TOPDIR)/vmlinux simple openfirmware prep: lib common images
ifdef CONFIG_APUS openfirmware prep: of1275
$(STRIP) $(TOPDIR)/vmlinux -o images/vmapus
gzip $(GZIP_FLAGS) images/vmapus
endif
# Make an image for PPCBoot lib common of1275 images: FORCE
pImage: images/vmlinux.gz +@$(call descend,$(obj)/$@,)
$(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
vmlinux.sm: $(TOPDIR)/vmlinux utils/addSystemMap openfirmware prep simple: FORCE
./utils/addSystemMap $(TOPDIR)/System.map $(TOPDIR)/vmlinux images/vmlinux.sm +@$(call descend,$(obj)/$@,$(MAKECMDGOALS))
# These are subdirs with files not normally rm'ed. -- Tom CLEAN_FILES += $(addprefix $(obj)/utils,$(all-tools))
clean:
$(MAKE) -C images clean
$(MAKE) -C utils clean
$(MAKE) -C openfirmware clean
include $(TOPDIR)/Rules.make clean: FORCE
+@$(call descend,$(obj)/images,clean)
...@@ -8,7 +8,12 @@ ...@@ -8,7 +8,12 @@
# Tom Rini January 2001 # Tom Rini January 2001
# #
coffcrt0.o: L_TARGET := lib.a
$(CC) $(AFLAGS) -DXCOFF -traditional -c -o coffcrt0.o crt0.S
obj-y := string.o util.o misc-common.o
obj-$(CONFIG_ALL_PPC) += mpc10x_memory.o
obj-$(CONFIG_LOPEC) += mpc10x_memory.o
obj-$(CONFIG_PAL4) += cpc700_memory.o
obj-$(CONFIG_SERIAL_8250_CONSOLE) += ns16550.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -2,11 +2,16 @@ ...@@ -2,11 +2,16 @@
# This dir holds all of the images for PPC machines. # This dir holds all of the images for PPC machines.
# Tom Rini January 2001 # Tom Rini January 2001
all: $(obj)/vmlinux.gz
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
vmlinux.gz: $(TOPDIR)/vmlinux GZIP_FLAGS = -v9f
$(OBJCOPY) --strip-all -S -O binary $(TOPDIR)/vmlinux vmlinux
gzip -vf9 vmlinux $(obj)/vmlinux.gz: vmlinux
$(OBJCOPY) -S -O binary vmlinux $(obj)/vmlinux
gzip $(GZIP_FLAGS) $(obj)/vmlinux
clean: clean:
rm -f sImage vmapus vmlinux* miboot* zImage* zvmlinux* rm -f $(obj)/sImage $(obj)/vmapus $(obj)/vmlinux* $(obj)/miboot*
rm -f $(obj)/zImage* z$(obj)/vmlinux*
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
#define MPC10X_MCTLR_EXT_MEM_START_2 0x8c /* Banks 4-7 */ #define MPC10X_MCTLR_EXT_MEM_START_2 0x8c /* Banks 4-7 */
#define MPC10X_MCTLR_MEM_END_1 0x90 /* Banks 0-3 */ #define MPC10X_MCTLR_MEM_END_1 0x90 /* Banks 0-3 */
#define MPC10X_MCTLR_MEM_END_2i 0x94 /* Banks 4-7 */ #define MPC10X_MCTLR_MEM_END_2 0x94 /* Banks 4-7 */
#define MPC10X_MCTLR_EXT_MEM_END_1 0x98 /* Banks 0-3 */ #define MPC10X_MCTLR_EXT_MEM_END_1 0x98 /* Banks 0-3 */
#define MPC10X_MCTLR_EXT_MEM_END_2 0x9c /* Banks 4-7 */ #define MPC10X_MCTLR_EXT_MEM_END_2 0x9c /* Banks 4-7 */
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
L_TARGET := lib.a L_TARGET := lib.a
obj-y := zlib.o obj-y := zlib.o div64.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
/*
* Divide a 64-bit unsigned number by a 32-bit unsigned number.
* This routine assumes that the top 32 bits of the dividend are
* non-zero to start with.
* On entry, r3 points to the dividend, which get overwritten with
* the 64-bit quotient, and r4 contains the divisor.
* On exit, r3 contains the remainder.
*
* Copyright (C) 2002 Paul Mackerras, IBM Corp.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <asm/ppc_asm.h>
#include <asm/processor.h>
_GLOBAL(__div64_32)
lwz r5,0(r3) # get the dividend into r5/r6
lwz r6,4(r3)
cmplw r5,r4
li r7,0
li r8,0
blt 1f
divwu r7,r5,r4 # if dividend.hi >= divisor,
mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor
subf. r5,r0,r5 # dividend.hi %= divisor
beq 3f
1: mr r11,r5 # here dividend.hi != 0
andis. r0,r5,0xc000
bne 2f
cntlzw r0,r5 # we are shifting the dividend right
li r10,-1 # to make it < 2^32, and shifting
srw r10,r10,r0 # the divisor right the same amount,
add r9,r4,r10 # rounding up (so the estimate cannot
andc r11,r6,r10 # ever be too large, only too small)
andc r9,r9,r10
or r11,r5,r11
rotlw r9,r9,r0
rotlw r11,r11,r0
divwu r11,r11,r9 # then we divide the shifted quantities
2: mullw r10,r11,r4 # to get an estimate of the quotient,
mulhwu r9,r11,r4 # multiply the estimate by the divisor,
subfc r6,r10,r6 # take the product from the divisor,
add r8,r8,r11 # and add the estimate to the accumulated
subfe. r5,r9,r5 # quotient
bne 1b
3: cmplw r6,r4
blt 4f
divwu r0,r6,r4 # perform the remaining 32-bit division
mullw r10,r0,r4 # and get the remainder
add r8,r8,r0
subf r6,r10,r6
4: stw r7,0(r3) # return the quotient in *r3
stw r8,4(r3)
mr r3,r6 # return the remainder in r3
blr
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile of1275 stuff # Makefile of1275 stuff
# #
L_TARGET := of1275.a L_TARGET := lib.a
obj-y := claim.o enter.o exit.o finddevice.o getprop.o ofinit.o \ obj-y := claim.o enter.o exit.o finddevice.o getprop.o ofinit.o \
ofstdio.o read.o release.o write.o ofstdio.o read.o release.o write.o
......
...@@ -10,24 +10,37 @@ ...@@ -10,24 +10,37 @@
# Merged 'chrp' and 'pmac' into 'openfirmware', and cleaned up the # Merged 'chrp' and 'pmac' into 'openfirmware', and cleaned up the
# rules. # rules.
EXTRA_TARGETS := start.o misc.o crt0.o coffcrt0.o coffmain.o chrpmain.o \
newworldmain.o common.o
boot: zImage
include $(TOPDIR)/Rules.make
boot := arch/ppc/boot
common := $(boot)/common
utils := $(boot)/utils
bootlib := $(boot)/lib
of1275 := $(boot)/of1275
images := $(boot)/images
OBJCOPY_ARGS = -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment OBJCOPY_ARGS = -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
COFF_LD_ARGS = -T ../ld.script -e _start -Ttext 0x00500000 -Bstatic COFF_LD_ARGS = -T $(boot)/ld.script -e _start -Ttext 0x00700000 -Bstatic
CHRP_LD_ARGS = -T ../ld.script -e _start -Ttext 0x00400000 CHRP_LD_ARGS = -T $(boot)/ld.script -e _start -Ttext 0x00800000
NEWWORLD_LD_ARGS = -T ../ld.script -e _start -Ttext 0x01000000 NEWWORLD_LD_ARGS = -T $(boot)/ld.script -e _start -Ttext 0x01000000
COMMONOBJS = start.o misc.o ../common/string.o common.o COMMONOBJS = $(obj)/start.o $(obj)/misc.o $(obj)/common.o
COFFOBJS = ../common/coffcrt0.o $(COMMONOBJS) coffmain.o COFFOBJS = $(obj)/coffcrt0.o $(COMMONOBJS) $(obj)/coffmain.o
CHRPOBJS = ../common/crt0.o $(COMMONOBJS) chrpmain.o CHRPOBJS = $(obj)/crt0.o $(COMMONOBJS) $(obj)/chrpmain.o
NEWWORLDOBJS = ../common/crt0.o $(COMMONOBJS) newworldmain.o NEWWORLDOBJS = $(obj)/crt0.o $(COMMONOBJS) $(obj)/newworldmain.o
EXTRA_TARGETS := $(COFFOBJS) $(CHRPOBJS) $(NEWWORLDOBJS) LIBS = lib/lib.a $(bootlib)/lib.a $(of1275)/lib.a $(common)/lib.a
LIBS = $(TOPDIR)/lib/lib.a ../lib/lib.a ../of1275/of1275.a
ADDNOTE := ../utils/addnote ADDNOTE := $(utils)/addnote
MKNOTE := ../utils/mknote MKNOTE := $(utils)/mknote
SIZE := ../utils/size SIZE := $(utils)/size
OFFSET := ../utils/offset OFFSET := $(utils)/offset
HACKCOFF := ../utils/hack-coff HACKCOFF := $(utils)/hack-coff
ifdef CONFIG_SMP ifdef CONFIG_SMP
END := .smp END := .smp
...@@ -38,12 +51,12 @@ endif ...@@ -38,12 +51,12 @@ endif
TFTPIMAGE=/tftpboot/zImage. TFTPIMAGE=/tftpboot/zImage.
../common/coffcrt0.o: $(obj)/dummy.o: $(common)/dummy.c
$(MAKE) -C ../common coffcrt0.o $(CC) -c -o $@ $(common)/dummy.c
image.o: ../images/vmlinux.gz ../common/dummy.o $(obj)/image.o: $(images)/vmlinux.gz $(obj)/dummy.o
$(OBJCOPY) ../common/dummy.o $@ -R .comment \ $(OBJCOPY) $(obj)/dummy.o $@ -R .comment \
--add-section=.image=../images/vmlinux.gz \ --add-section=.image=$(images)/vmlinux.gz \
--set-section-flags=.image=contents,alloc,load,readonly,data --set-section-flags=.image=contents,alloc,load,readonly,data
ifdef CONFIG_XMON ifdef CONFIG_XMON
$(OBJCOPY) $@ $@ \ $(OBJCOPY) $@ $@ \
...@@ -52,86 +65,93 @@ ifdef CONFIG_XMON ...@@ -52,86 +65,93 @@ ifdef CONFIG_XMON
endif endif
# Place the ramdisk in the initrd image. # Place the ramdisk in the initrd image.
image-initrd.o: image.o ../images/ramdisk.image.gz $(obj)/image-initrd.o: $(obj)/image.o $(images)/ramdisk.image.gz
$(OBJCOPY) image.o $@ \ $(OBJCOPY) $(obj)/image.o $@ \
--add-section=.ramdisk=../images/ramdisk.image.gz \ --add-section=.ramdisk=$(images)/ramdisk.image.gz \
--set-section-flags=.ramdisk=contents,alloc,load,readonly,data --set-section-flags=.ramdisk=contents,alloc,load,readonly,data
# Create the note section for New-World PowerMacs. # Create the note section for New-World PowerMacs.
note: $(MKNOTE) $(obj)/note: $(MKNOTE)
$(MKNOTE) > note $(MKNOTE) > $(obj)/note
znetboot: vmlinux.coff vmlinux.elf-pmac zImage znetboot: $(images)/vmlinux.coff $(images)/vmlinux.elf-pmac $(images)/zImage.chrp
cp ../images/vmlinux.coff $(TFTPIMAGE).pmac$(END) cp $(images)/vmlinux.coff $(TFTPIMAGE).pmac$(END)
cp ../images/vmlinux.elf-pmac $(TFTPIMAGE).pmac$(END)elf cp $(images)/vmlinux.elf-pmac $(TFTPIMAGE).pmac$(END)elf
cp ../images/zImage.chrp $(TFTPIMAGE).chrp$(END) cp $(images)/zImage.chrp $(TFTPIMAGE).chrp$(END)
znetboot.initrd: vmlinux.initrd.coff vmlinux.initrd.elf-pmac znetboot.initrd: $(images)/vmlinux.initrd.coff \
cp ../images/vmlinux.initrd.coff $(TFTPIMAGE).pmac$(END) $(images)/vmlinux.initrd.elf-pmac \
cp ../images/vmlinux.initrd.elf-pmac $(TFTPIMAGE).pmac$(END).elf $(images)/zImage.initrd.chrp
cp ../images/zImage.initrd.chrp $(TFTPIMAGE).chrp$(END) cp $(images)/vmlinux.initrd.coff $(TFTPIMAGE).pmac$(END)
cp $(images)/vmlinux.initrd.elf-pmac $(TFTPIMAGE).pmac$(END).elf
cp $(images)/zImage.initrd.chrp $(TFTPIMAGE).chrp$(END)
$(images)/miboot.image: $(obj)/dummy.o $(images)/vmlinux.gz
$(OBJCOPY) $(OBJCOPY_ARGS) --add-section=image=$(images)/vmlinux.gz \
$(obj)/dummy.o $@
$(images)/miboot.initrd.image: $(images)/miboot.image $(images)/ramdisk.image.gz
$(OBJCOPY) $(OBJCOPY_ARGS) \
--add-section=initrd=$(images)/ramdisk.image.gz \
$(images)/miboot.image $@
miboot.image: ../common/dummy.o ../images/vmlinux.gz $(obj)/coffcrt0.o: $(common)/crt0.S
$(OBJCOPY) $(OBJCOPY_ARGS) --add-section=image=../images/vmlinux.gz \ $(CC) $(AFLAGS) -DXCOFF -traditional -c -o $@ $(common)/crt0.S
../common/dummy.o ../images/$@
miboot.initrd.image: miboot.image ../images/ramdisk.image.gz $(obj)/crt0.o: $(common)/crt0.S
$(OBJCOPY) $(OBJCOPY_ARGS) \ $(CC) $(AFLAGS) -traditional -c -o $@ $(common)/crt0.S
--add-section=initrd=../images/ramdisk.image.gz \
../images/miboot.image ../images/$@
coffboot: $(COFFOBJS) image.o $(LIBS) $(obj)/coffboot: $(COFFOBJS) $(obj)/image.o $(LIBS)
$(LD) -o $@ $(COFF_LD_ARGS) $^ $(LD) -o $@ $(COFF_LD_ARGS) $^
$(OBJCOPY) $@ $@ -R .comment -R .ramdisk $(OBJCOPY) $@ $@ -R .comment -R .ramdisk
coffboot.initrd: $(COFFOBJS) image-initrd.o $(LIBS) $(obj)/coffboot.initrd: $(COFFOBJS) $(obj)/image-initrd.o $(LIBS)
$(LD) -o $@ $(COFF_LD_ARGS) $^ $(LD) -o $@ $(COFF_LD_ARGS) $^
$(OBJCOPY) $@ $@ -R .comment $(OBJCOPY) $@ $@ -R .comment
vmlinux.coff: coffboot $(HACKCOFF) $(images)/vmlinux.coff: $(obj)/coffboot
$(OBJCOPY) $(OBJCOPY_ARGS) coffboot ../images/$@ $(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/coffboot $@
$(HACKCOFF) ../images/$@ $(HACKCOFF) $@
rm -f coffboot ln -sf vmlinux.coff $(images)/zImage.pmac
ln -sf vmlinux.coff ../images/zImage.pmac
vmlinux.initrd.coff: coffboot.initrd $(HACKCOFF)
$(OBJCOPY) $(OBJCOPY_ARGS) coffboot.initrd ../images/$@
$(HACKCOFF) ../images/$@
rm -f coffboot.initrd
ln -sf vmlinux.initrd.coff ../images/zImage.initrd.pmac
vmlinux.elf-pmac: $(NEWWORLDOBJS) $(LIBS) image.o
$(LD) $(NEWWORLD_LD_ARGS) -o ../images/$@ $^
vmlinux.initrd.elf-pmac: $(NEWWORLDOBJS) $(LIBS) image-initrd.o
$(LD) $(NEWWORLD_LD_ARGS) -o ../images/$@ $^
zImage.chrp: $(CHRPOBJS) image.o $(LIBS)
$(LD) $(CHRP_LD_ARGS) -o ../images/$@ $^
zImage.initrd.chrp: $(CHRPOBJS) image-initrd.o $(LIBS)
$(LD) $(CHRP_LD_ARGS) -o ../images/$@ $^
zImage: vmlinux.coff vmlinux.elf-pmac zImage.chrp miboot.image $(ADDNOTE) \
note
$(OBJCOPY) ../images/vmlinux.elf-pmac ../images/vmlinux.elf-pmac \
--add-section=.note=note -R .comment -R .ramdisk
$(OBJCOPY) ../images/zImage.chrp ../images/zImage.chrp \
-R .comment -R .ramdisk
cp ../images/zImage.chrp ../images/zImage.chrp-rs6k
$(ADDNOTE) ../images/zImage.chrp-rs6k
zImage.initrd: vmlinux.initrd.coff vmlinux.initrd.elf-pmac zImage.initrd.chrp \
miboot.initrd.image $(ADDNOTE) note
$(OBJCOPY) ../images/vmlinux.initrd.elf-pmac \
../images/vmlinux.initrd.elf-pmac --add-section=.note=note \
-R .comment
$(OBJCOPY) ../images/zImage.initrd.chrp ../images/zImage.initrd.chrp \
-R .comment
cp ../images/zImage.initrd.chrp ../images/zImage.initrd.chrp-rs6k
$(ADDNOTE) ../images/zImage.initrd.chrp-rs6k
clean: $(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd
rm -f note $(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/coffboot.initrd $@
$(HACKCOFF) $@
ln -sf vmlinux.initrd.coff $(images)/zImage.initrd.pmac
include $(TOPDIR)/Rules.make $(images)/vmlinux.elf-pmac: $(NEWWORLDOBJS) $(LIBS) $(obj)/image.o $(obj)/note
$(LD) $(NEWWORLD_LD_ARGS) -o $@ $(NEWWORLDOBJS) $(LIBS) $(obj)/image.o
$(OBJCOPY) $@ $@ \
--add-section=.note=$(obj)/note -R .comment -R .ramdisk
$(images)/vmlinux.initrd.elf-pmac: $(NEWWORLDOBJS) $(LIBS) \
$(obj)/image-initrd.o $(obj)/note
$(LD) $(NEWWORLD_LD_ARGS) -o $@ $(NEWWORLDOBJS) $(LIBS) \
$(obj)/image-initrd.o
$(OBJCOPY) $@ $@ \
--add-section=.note=$(obj)/note -R .comment
$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS)
$(LD) $(CHRP_LD_ARGS) -o $@ $^
$(OBJCOPY) $@ $@ -R .comment -R .ramdisk
$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image-initrd.o $(LIBS)
$(LD) $(CHRP_LD_ARGS) -o $@ $^
$(OBJCOPY) $@ $@ -R .comment
$(images)/zImage.chrp-rs6k: $(images)/zImage.chrp
cp $(images)/zImage.chrp $@
$(ADDNOTE) $@
$(images)/zImage.initrd.chrp-rs6k: $(images)/zImage.initrd.chrp
cp $(images)/zImage.initrd.chrp $@
$(ADDNOTE) $@
zImage: $(images)/vmlinux.coff $(images)/vmlinux.elf-pmac \
$(images)/zImage.chrp $(images)/miboot.image
zImage.initrd: $(images)/vmlinux.initrd.coff $(images)/vmlinux.initrd.elf-pmac\
$(images)/zImage.initrd.chrp $(images)/miboot.initrd.image
clean:
rm -f $(obj)/note $(obj)/image.o $(obj)/coffboot $(obj)/coffboot.initrd
...@@ -13,65 +13,79 @@ ...@@ -13,65 +13,79 @@
# modified by Cort (cort@cs.nmt.edu) # modified by Cort (cort@cs.nmt.edu)
# #
boot: zImage
TFTPIMAGE = /tftpboot/zImage.prep TFTPIMAGE = /tftpboot/zImage.prep
ifeq ($(CONFIG_SMP),y) ifeq ($(CONFIG_SMP),y)
TFTPIMAGE = $(TFTPBOOT).smp TFTPIMAGE = $(TFTPBOOT).smp
endif endif
LD_ARGS = -T ../ld.script -Ttext 0x00800000 -Bstatic LD_ARGS = -T $(boot)/ld.script -Ttext 0x00800000 -Bstatic
boot-y := head.o ../simple/legacy.o misc.o \
../common/util.o ../common/string.o \
../common/misc-common.o \
../common/mpc10x_memory.o
OBJCOPY_ARGS = -O elf32-powerpc OBJCOPY_ARGS = -O elf32-powerpc
LIBS = ../lib/lib.a LIBS = $(common)/lib.a $(bootlib)/lib.a
boot-$(CONFIG_SERIAL_8250_CONSOLE) += ../common/ns16550.o boot-y := head.o misc.o
boot-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o boot-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
EXTRA_TARGETS := $(boot-y) EXTRA_TARGETS := $(boot-y) ../simple/legacy.o
include $(TOPDIR)/Rules.make
boot := arch/ppc/boot
common := $(boot)/common
utils := $(boot)/utils
bootlib := $(boot)/lib
of1275 := $(boot)/of1275
images := $(boot)/images
simple := $(boot)/simple
OBJS := $(addprefix $(obj)/,$(boot-y)) $(simple)/legacy.o
# Tools # Tools
MKPREP := ../utils/mkprep MKPREP := $(utils)/mkprep
SIZE := ../utils/size SIZE := $(utils)/size
OFFSET := ../utils/offset OFFSET := $(utils)/offset
# Extra include search dirs # Extra include search dirs
CFLAGS_kbd.o += -I$(TOPDIR)/drivers/char CFLAGS_kbd.o += -Idrivers/char
all: zImage zImage: $(images)/zImage.prep
zImage.initrd: $(images)/zImage.initrd.prep
zImage: $(boot-y) $(LIBS) ../ld.script ../images/vmlinux.gz ../common/dummy.o \ $(obj)/dummy.o: $(common)/dummy.c
$(MKPREP) $(CC) -c -o $@ $(common)/dummy.c
$(images)/zImage.prep: $(OBJS) $(LIBS) $(boot)/ld.script \
$(images)/vmlinux.gz $(obj)/dummy.o
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section=.image=../images/vmlinux.gz \ --add-section=.image=$(images)/vmlinux.gz \
--set-section-flags=.image=contents,alloc,load,readonly,data \ --set-section-flags=.image=contents,alloc,load,readonly,data \
../common/dummy.o image.o $(obj)/dummy.o $(obj)/image.o
$(LD) $(LD_ARGS) -o $@ $(boot-y) image.o $(LIBS) $(LD) $(LD_ARGS) -o $(obj)/zImage $(OBJS) $(obj)/image.o $(LIBS)
$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr $(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/zImage $(obj)/zImage \
$(MKPREP) -pbp $@ ../images/$@.prep -R .comment -R .stab -R .stabstr
rm -f $@ $(MKPREP) -pbp $(obj)/zImage $@
rm -f $(obj)/zImage
zImage.initrd: $(boot-y) $(LIBS) ../ld.script ../images/vmlinux.gz $(MKPREP) \
../common/dummy.o $(images)/zImage.initrd.prep: $(OBJS) $(LIBS) $(boot)/ld.script \
$(images)/vmlinux.gz $(obj)/dummy.o
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section=.ramdisk=../images/ramdisk.image.gz \ --add-section=.ramdisk=$(images)/ramdisk.image.gz \
--set-section-flags=.ramdisk=contents,alloc,load,readonly,data \ --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \
--add-section=.image=../images/vmlinux.gz \ --add-section=.image=$(images)/vmlinux.gz \
--set-section-flags=.image=contents,alloc,load,readonly,data \ --set-section-flags=.image=contents,alloc,load,readonly,data \
../common/dummy.o image.o $(obj)/dummy.o $(obj)/image.o
$(LD) $(LD_ARGS) -o $@ $(boot-y) image.o $(LIBS) $(LD) $(LD_ARGS) -o $(obj)/zImage.initrd $(OBJS) $(obj)/image.o $(LIBS)
$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr $(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/zImage.initrd $(obj)/zImage.initrd \
$(MKPREP) -pbp $@ ../images/$@.prep -R .comment -R .stab -R .stabstr
rm -f $@ $(MKPREP) -pbp $(obj)/zImage.initrd $@
rm -f $(obj)/zImage.initrd
floppy: zImage floppy: zImage
dd if=../images/zImage.prep of=/dev/fd0H1440 bs=64b dd if=$(images)/zImage.prep of=/dev/fd0H1440 bs=64b
znetboot : zImage znetboot : zImage
cp ../images/zImage.prep $(TFTPIMAGE) cp $(images)/zImage.prep $(TFTPIMAGE)
znetboot.initrd : zImage.initrd znetboot.initrd : zImage.initrd
cp ../images/zImage.initrd.prep $(TFTPIMAGE) cp $(images)/zImage.initrd.prep $(TFTPIMAGE)
include $(TOPDIR)/Rules.make
...@@ -132,11 +132,6 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, ...@@ -132,11 +132,6 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
vga_init((unsigned char *)0xC0000000); vga_init((unsigned char *)0xC0000000);
#endif /* CONFIG_VGA_CONSOLE */ #endif /* CONFIG_VGA_CONSOLE */
/*
* Find out how much memory we have.
*/
TotalMemory = get_mem_size();
/* /*
* Tell the user where we were loaded at and where we were relocated * Tell the user where we were loaded at and where we were relocated
* to for debugging this process. * to for debugging this process.
...@@ -215,6 +210,29 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, ...@@ -215,6 +210,29 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
puts("No residual data found.\n"); puts("No residual data found.\n");
} }
/* First, figure out what kind of host bridge we are on. If it's
* an MPC10x, we can ask it directly how much memory it has.
* Otherwise, see if the residual data has anything. This isn't
* the best way, but it can be the only way. If there's nothing,
* assume 32MB. -- Tom.
*/
/* See what our host bridge is. */
pci_read_config_32(0x00, 0x00, &pci_viddid);
pci_did = (pci_viddid & 0xffff0000) >> 16;
/* See if we are on an MPC10x. */
if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA)
&& ((pci_did == PCI_DEVICE_ID_MOTOROLA_MPC105)
|| (pci_did == PCI_DEVICE_ID_MOTOROLA_MPC106)
|| (pci_did == PCI_DEVICE_ID_MOTOROLA_MPC107)))
TotalMemory = get_mem_size();
/* If it's not, see if we have anything in the residual data. */
else if (residual && residual->TotalMemory)
TotalMemory = residual->TotalMemory;
/* Fall back to hard-coding 32MB. */
else
TotalMemory = 32*1024*1024;
/* assume the chunk below 8M is free */ /* assume the chunk below 8M is free */
end_avail = (char *)0x00800000; end_avail = (char *)0x00800000;
......
...@@ -24,9 +24,11 @@ ...@@ -24,9 +24,11 @@
# Free Software Foundation; either version 2 of the License, or (at your # Free Software Foundation; either version 2 of the License, or (at your
# option) any later version. # option) any later version.
# Normally, we use the 'misc-simple.c' file for decompress_kernel and boot: zImage
# Normally, we use the 'misc.c' file for decompress_kernel and
# whatnot. Sometimes we need to override this however. # whatnot. Sometimes we need to override this however.
MISC := ../common/misc-simple.o MISC := misc.o
ifeq ($(CONFIG_IBM_OPENBIOS),y) ifeq ($(CONFIG_IBM_OPENBIOS),y)
ZIMAGE := zImage-TREE ZIMAGE := zImage-TREE
ZIMAGEINITRD := zImage.initrd-TREE ZIMAGEINITRD := zImage.initrd-TREE
...@@ -38,6 +40,14 @@ ifeq ($(CONFIG_EMBEDDEDBOOT),y) ...@@ -38,6 +40,14 @@ ifeq ($(CONFIG_EMBEDDEDBOOT),y)
TFTPIMAGE := /tftpboot/zImage.embedded TFTPIMAGE := /tftpboot/zImage.embedded
MISC := misc-embedded.o MISC := misc-embedded.o
endif endif
ifeq ($(CONFIG_EBONY),y)
ZIMAGE := zImage-TREE
ZIMAGEINITRD := zImage.initrd-TREE
EXTRA := direct.o
END := ebony
ENTRYPOINT := 0x01000000
TFTPIMAGE := /tftpboot/zImage.$(END)
endif
ifeq ($(CONFIG_EV64260),y) ifeq ($(CONFIG_EV64260),y)
EXTRA := direct.o misc-ev64260.o EXTRA := direct.o misc-ev64260.o
TFTPIMAGE := /tftpboot/zImage.ev64260 TFTPIMAGE := /tftpboot/zImage.ev64260
...@@ -72,11 +82,8 @@ endif ...@@ -72,11 +82,8 @@ endif
ifeq ($(CONFIG_PPLUS),y) ifeq ($(CONFIG_PPLUS),y)
EXTRA := legacy.o EXTRA := legacy.o
endif endif
ifeq ($(CONFIG_LOPEC),y)
EXTRA += ../common/mpc10x_memory.o
endif
ifeq ($(CONFIG_PAL4),y) ifeq ($(CONFIG_PAL4),y)
EXTRA := direct.o ../common/cpc700_memory.o EXTRA := direct.o
endif endif
ifeq ($(CONFIG_PCORE)$(CONFIG_POWERPMC250),y) ifeq ($(CONFIG_PCORE)$(CONFIG_POWERPMC250),y)
ZIMAGE := zImage-STRIPELF ZIMAGE := zImage-STRIPELF
...@@ -122,21 +129,25 @@ endif ...@@ -122,21 +129,25 @@ endif
# Default linker args. Link at 0x00800000 or 0x00400000 by default, but # Default linker args. Link at 0x00800000 or 0x00400000 by default, but
# allow it to be overridden. # allow it to be overridden.
ifeq ($(CONFIG_BOOT_LOAD_BOOL),y) ifeq ($(CONFIG_BOOT_LOAD_BOOL),y)
LD_ARGS := -T ../ld.script -Ttext $(CONFIG_BOOT_LOAD) \ LD_ARGS := -T $(boot)/ld.script \
-Bstatic -Ttext $(CONFIG_BOOT_LOAD) -Bstatic
else else
LD_ARGS = -T ../ld.script -Ttext 0x00800000 -Bstatic LD_ARGS = -T $(boot)/ld.script \
ifeq ($(CONFIG_8260)$(CONFIG_4xx)$(CONFIG_8xx),y) -Ttext 0x00800000 -Bstatic
LD_ARGS := -T ../ld.script -Ttext 0x00400000 -Bstatic ifeq ($(CONFIG_8260)$(CONFIG_40x)$(CONFIG_8xx),y)
LD_ARGS := -T $(boot)/ld.script -Ttext 0x00400000 \
-Bstatic
endif
ifeq ($(CONFIG_440),y)
LD_ARGS := -T $(boot)/ld.script -Ttext 0x01000000 \
-Bstatic
endif endif
endif endif
OBJCOPY_ARGS := -O elf32-powerpc OBJCOPY_ARGS := -O elf32-powerpc
# head.o and ../common/relocate.o must be at the start. # head.o and relocate.o must be at the start.
boot-y := head.o ../common/relocate.o $(EXTRA) \ boot-y := head.o relocate.o $(EXTRA) $(MISC)
$(MISC) ../common/misc-common.o \ boot-$(CONFIG_40x) += embed_config.o
../common/string.o ../common/util.o
boot-$(CONFIG_4xx) += embed_config.o
boot-$(CONFIG_8xx) += embed_config.o boot-$(CONFIG_8xx) += embed_config.o
boot-$(CONFIG_8260) += embed_config.o boot-$(CONFIG_8260) += embed_config.o
boot-$(CONFIG_BSEIP) += iic.o boot-$(CONFIG_BSEIP) += iic.o
...@@ -149,84 +160,97 @@ boot-$(CONFIG_8xx) += m8xx_tty.o ...@@ -149,84 +160,97 @@ boot-$(CONFIG_8xx) += m8xx_tty.o
boot-$(CONFIG_8260) += m8260_tty.o boot-$(CONFIG_8260) += m8260_tty.o
boot-$(CONFIG_GT64260_CONSOLE) += gt64260_tty.o boot-$(CONFIG_GT64260_CONSOLE) += gt64260_tty.o
endif endif
boot-$(CONFIG_SERIAL_8250_CONSOLE) += ../common/ns16550.o
boot := arch/ppc/boot
common := $(boot)/common
utils := $(boot)/utils
bootlib := $(boot)/lib
images := $(boot)/images
EXTRA_TARGETS := $(boot-y) EXTRA_TARGETS := $(boot-y)
LIBS := ../lib/lib.a LIBS := $(common)/lib.a $(bootlib)/lib.a
include $(TOPDIR)/Rules.make
OBJS := $(addprefix $(obj)/,$(boot-y))
# Tools # Tools
MKBUGBOOT := ../utils/mkbugboot MKBUGBOOT := $(utils)/mkbugboot
MKPREP := ../utils/mkprep MKPREP := $(utils)/mkprep
MKTREE := ../utils/mktree MKTREE := $(utils)/mktree
$(obj)/dummy.o: $(common)/dummy.c
$(CC) -c -o $@ $(common)/dummy.c
zvmlinux: $(boot-y) $(LIBS) ../ld.script ../images/vmlinux.gz ../common/dummy.o $(obj)/zvmlinux: $(OBJS) $(LIBS) $(boot)/ld.script $(images)/vmlinux.gz \
$(obj)/dummy.o
$(OBJCOPY) $(OBJCOPY_ARGS) \ $(OBJCOPY) $(OBJCOPY_ARGS) \
--add-section=.image=../images/vmlinux.gz \ --add-section=.image=$(images)/vmlinux.gz \
--set-section-flags=.image=contents,alloc,load,readonly,data \ --set-section-flags=.image=contents,alloc,load,readonly,data \
../common/dummy.o image.o $(obj)/dummy.o $(obj)/image.o
$(LD) $(LD_ARGS) -o $@ $(boot-y) image.o $(LIBS) $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS)
$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr \ $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \
-R .ramdisk -R .sysmap -R .stabstr -R .ramdisk -R .sysmap
zvmlinux.initrd: $(boot-y) $(LIBS) ../ld.script ../images/vmlinux.gz \ $(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(boot)/ld.script \
../common/dummy.o $(images)/vmlinux.gz $(obj)/dummy.o
$(OBJCOPY) $(OBJCOPY_ARGS) \ $(OBJCOPY) $(OBJCOPY_ARGS) \
--add-section=.ramdisk=../images/ramdisk.image.gz \ --add-section=.ramdisk=$(images)/ramdisk.image.gz \
--set-section-flags=.ramdisk=contents,alloc,load,readonly,data \ --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \
--add-section=.image=../images/vmlinux.gz \ --add-section=.image=$(images)/vmlinux.gz \
--set-section-flags=.image=contents,alloc,load,readonly,data \ --set-section-flags=.image=contents,alloc,load,readonly,data \
../common/dummy.o image.o $(obj)/dummy.o $(obj)/image.o
$(LD) $(LD_ARGS) -o $@ $(boot-y) image.o $(LIBS) $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS)
$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr \ $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \
-R .sysmap -R .stabstr -R .sysmap
# Sort-of dummy rules, that let us format the image we want. # Sort-of dummy rules, that let us format the image we want.
zImage: $(ZIMAGE) zvmlinux zImage: $(images)/$(ZIMAGE) $(obj)/zvmlinux
cp -f zvmlinux ../images/zImage.elf cp -f $(obj)/zvmlinux $(images)/zImage.elf
rm -f zvmlinux rm -f $(obj)/zvmlinux
zImage.initrd: $(ZIMAGEINITRD) zvmlinux.initrd zImage.initrd: $(images)/$(ZIMAGEINITRD) $(obj)/zvmlinux.initrd
cp -f zvmlinux.initrd ../images/zImage.initrd.elf cp -f $(obj)/zvmlinux.initrd $(images)/zImage.initrd.elf
rm -f zvmlinux.initrd rm -f $(obj)/zvmlinux.initrd
znetboot: zImage znetboot: zImage
ifneq ($(ZNETBOOT),) ifneq ($(ZNETBOOT),)
cp ../images/$(ZNETBOOT) $(TFTPIMAGE) cp $(images)/$(ZNETBOOT) $(TFTPIMAGE)
else else
cp ../images/zImage.* $(TFTPIMAGE) cp $(images)/zImage.* $(TFTPIMAGE)
endif endif
znetboot.initrd: zImage.initrd znetboot.initrd: zImage.initrd
ifneq ($(ZNETBOOTRD),) ifneq ($(ZNETBOOTRD),)
cp ../images/$(ZNETBOOTRD) $(TFTPIMAGE) cp $(images)/$(ZNETBOOTRD) $(TFTPIMAGE)
else else
cp ../images/zImage.* $(TFTPIMAGE) cp $(images)/zImage.* $(TFTPIMAGE)
endif endif
zImage-STRIPELF: zvmlinux $(images)/zImage-STRIPELF: $(obj)/zvmlinux
dd if=zvmlinux of=../images/zImage.$(END) skip=64 bs=1k dd if=$(obj)/zvmlinux of=$(images)/zImage.$(END) skip=64 bs=1k
zImage.initrd-STRIPELF: zvmlinux.initrd $(images)/zImage.initrd-STRIPELF: $(obj)/zvmlinux.initrd
dd if=zvmlinux.initrd of=../images/zImage.initrd.$(END) skip=64 bs=1k dd if=$(obj)/zvmlinux.initrd of=$(images)/zImage.initrd.$(END) \
skip=64 bs=1k
zImage-TREE: zvmlinux $(images)/zImage-TREE: $(obj)/zvmlinux
$(MKTREE) zvmlinux ../images/zImage.$(END) $(ENTRYPOINT) $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(END) $(ENTRYPOINT)
zImage.initrd-TREE: zvmlinux.initrd $(images)/zImage.initrd-TREE: $(obj)/zvmlinux.initrd
$(MKTREE) zvmlinux.initrd ../images/zImage.initrd.$(END) $(ENTRYPOINT) $(MKTREE) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(END) \
$(ENTRYPOINT)
zImage-MENF1: zvmlinux $(images)/zImage-MENF1: $(obj)/zvmlinux
$(MKPREP) -pbp zvmlinux ../images/zImage.menf1 $(MKPREP) -pbp $(obj)/zvmlinux $(images)/zImage.menf1
zImage.initrd-MENF1: zvmlinux.initrd $(images)/zImage.initrd-MENF1: $(obj)/zvmlinux.initrd
$(MKPREP) -pbp zvmlinux.initrd ../images/zImage.initrd.menf1 $(MKPREP) -pbp $(obj)/zvmlinux.initrd $(images)/zImage.initrd.menf1
zImage-PPLUS: zvmlinux $(MKPREP) $(MKBUGBOOT) $(images)/zImage-PPLUS: $(obj)/zvmlinux $(MKPREP) $(MKBUGBOOT)
$(MKPREP) -pbp zvmlinux ../images/zImage.pplus $(MKPREP) -pbp $(obj)/zvmlinux $(images)/zImage.pplus
$(MKBUGBOOT) zvmlinux ../images/zImage.bugboot $(MKBUGBOOT) $(obj)/zvmlinux $(images)/zImage.bugboot
zImage.initrd-PPLUS: zvmlinux.initrd $(MKPREP) $(MKBUGBOOT) $(images)/zImage.initrd-PPLUS: $(obj)/zvmlinux.initrd $(MKPREP) $(MKBUGBOOT)
$(MKPREP) -pbp zvmlinux.initrd ../images/zImage.initrd.pplus $(MKPREP) -pbp $(obj)/zvmlinux.initrd $(images)/zImage.initrd.pplus
$(MKBUGBOOT) zvmlinux.initrd ../images/zImage.initrd.bugboot $(MKBUGBOOT) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.bugboot
include $(TOPDIR)/Rules.make
...@@ -131,6 +131,7 @@ if [ "$CONFIG_6xx" = "y" -a "$CONFIG_8260" = "n" ]; then ...@@ -131,6 +131,7 @@ if [ "$CONFIG_6xx" = "y" -a "$CONFIG_8260" = "n" ]; then
Motorola-Sandpoint CONFIG_SANDPOINT \ Motorola-Sandpoint CONFIG_SANDPOINT \
SBS-Adirondack CONFIG_ADIR \ SBS-Adirondack CONFIG_ADIR \
SBS-K2 CONFIG_K2 \ SBS-K2 CONFIG_K2 \
SBS-Palomar4 CONFIG_PAL4 \
Synergy-Gemini CONFIG_GEMINI \ Synergy-Gemini CONFIG_GEMINI \
Zynx-ZX4500 CONFIG_ZX4500" CHRP/PowerMac/PReP Zynx-ZX4500 CONFIG_ZX4500" CHRP/PowerMac/PReP
...@@ -584,23 +585,31 @@ source lib/Config.in ...@@ -584,23 +585,31 @@ source lib/Config.in
mainmenu_option next_comment mainmenu_option next_comment
comment 'Kernel hacking' comment 'Kernel hacking'
bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ bool 'Kernel debugging' CONFIG_DEBUG_KERNEL
bool 'Spinlock debugging' CONFIG_DEBUG_SPINLOCK if [ "$CONFIG_DEBUG_KERNEL" = "y" ]; then
bool 'Include kgdb kernel debugger' CONFIG_KGDB bool ' Debug memory allocations' CONFIG_DEBUG_SLAB
if [ "$CONFIG_KGDB" = "y" ]; then bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ
choice 'Serial Port' \ bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK
"ttyS0 CONFIG_KGDB_TTYS0 \ if [ "$CONFIG_HIGHMEM" = "y" ]; then
ttyS1 CONFIG_KGDB_TTYS1 \ bool ' Highmem debugging' CONFIG_DEBUG_HIGHMEM
ttyS2 CONFIG_KGDB_TTYS2 \ fi
ttyS3 CONFIG_KGDB_TTYS3" ttyS1 bool ' Load all symbols for debugging/kksymoops' CONFIG_KALLSYMS
fi bool ' Include kgdb kernel debugger' CONFIG_KGDB
bool 'Include xmon kernel debugger' CONFIG_XMON if [ "$CONFIG_KGDB" = "y" ]; then
bool 'Include BDI-2000 user context switcher' CONFIG_BDI_SWITCH choice ' Serial Port' \
if [ "$CONFIG_KGDB" = "y" -o "$CONFIG_XMON" = "y" \ "ttyS0 CONFIG_KGDB_TTYS0 \
-o "$CONFIG_BDI_SWITCH" = "y" ]; then ttyS1 CONFIG_KGDB_TTYS1 \
bool 'Add any additional compile options' CONFIG_MORE_COMPILE_OPTIONS ttyS2 CONFIG_KGDB_TTYS2 \
if [ "$CONFIG_MORE_COMPILE_OPTIONS" = "y" ]; then ttyS3 CONFIG_KGDB_TTYS3" ttyS1
string 'Additional compile arguments' CONFIG_COMPILE_OPTIONS "-g -ggdb" fi
bool ' Include xmon kernel debugger' CONFIG_XMON
bool ' Include BDI-2000 user context switcher' CONFIG_BDI_SWITCH
if [ "$CONFIG_KGDB" = "y" -o "$CONFIG_XMON" = "y" \
-o "$CONFIG_BDI_SWITCH" = "y" ]; then
bool ' Add any additional compile options' CONFIG_MORE_COMPILE_OPTIONS
if [ "$CONFIG_MORE_COMPILE_OPTIONS" = "y" ]; then
string ' Additional compile arguments' CONFIG_COMPILE_OPTIONS "-g -ggdb"
fi
fi fi
fi fi
......
...@@ -27,13 +27,18 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, ...@@ -27,13 +27,18 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
{ {
struct pci_controller *hose = bus->sysdata; struct pci_controller *hose = bus->sysdata;
volatile unsigned char *cfg_data; volatile unsigned char *cfg_data;
u8 cfg_type = 0;
if (ppc_md.pci_exclude_device) if (ppc_md.pci_exclude_device)
if (ppc_md.pci_exclude_device(bus->number, devfn)) if (ppc_md.pci_exclude_device(bus->number, devfn))
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
if (hose->set_cfg_type)
if (bus->number != hose->first_busno)
cfg_type = 1;
out_be32(hose->cfg_addr, out_be32(hose->cfg_addr,
((offset & 0xfc) << 24) | (devfn << 16) (((offset & 0xfc) | cfg_type) << 24) | (devfn << 16)
| ((bus->number - hose->bus_offset) << 8) | 0x80); | ((bus->number - hose->bus_offset) << 8) | 0x80);
/* /*
* Note: the caller has already checked that offset is * Note: the caller has already checked that offset is
...@@ -60,13 +65,18 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset, ...@@ -60,13 +65,18 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
{ {
struct pci_controller *hose = bus->sysdata; struct pci_controller *hose = bus->sysdata;
volatile unsigned char *cfg_data; volatile unsigned char *cfg_data;
u8 cfg_type = 0;
if (ppc_md.pci_exclude_device) if (ppc_md.pci_exclude_device)
if (ppc_md.pci_exclude_device(bus->number, devfn)) if (ppc_md.pci_exclude_device(bus->number, devfn))
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
if (hose->set_cfg_type)
if (bus->number != hose->first_busno)
cfg_type = 1;
out_be32(hose->cfg_addr, out_be32(hose->cfg_addr,
((offset & 0xfc) << 24) | (devfn << 16) (((offset & 0xfc) | cfg_type) << 24) | (devfn << 16)
| ((bus->number - hose->bus_offset) << 8) | 0x80); | ((bus->number - hose->bus_offset) << 8) | 0x80);
/* /*
* Note: the caller has already checked that offset is * Note: the caller has already checked that offset is
......
...@@ -751,21 +751,6 @@ _GLOBAL(copy_page) ...@@ -751,21 +751,6 @@ _GLOBAL(copy_page)
blr blr
#endif /* CONFIG_PPC_ISERIES */ #endif /* CONFIG_PPC_ISERIES */
/*
* Atomic [test&set] exchange
*
* unsigned long xchg_u32(void *ptr, unsigned long val)
* Changes the memory location '*ptr' to be val and returns
* the previous value stored there.
*/
_GLOBAL(xchg_u32)
mr r5,r3 /* Save pointer */
10: lwarx r3,0,r5 /* Fetch old value & reserve */
PPC405_ERR77(0,r5)
stwcx. r4,0,r5 /* Update with new value */
bne- 10b /* Retry if "reservation" (i.e. lock) lost */
blr
/* /*
* void atomic_clear_mask(atomic_t mask, atomic_t *addr) * void atomic_clear_mask(atomic_t mask, atomic_t *addr)
* void atomic_set_mask(atomic_t mask, atomic_t *addr); * void atomic_set_mask(atomic_t mask, atomic_t *addr);
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include <linux/pmu.h> #include <linux/pmu.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/system.h> #include <asm/system.h>
#define __KERNEL_SYSCALLS__
#include <asm/unistd.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
...@@ -180,6 +182,10 @@ EXPORT_SYMBOL(consistent_free); ...@@ -180,6 +182,10 @@ EXPORT_SYMBOL(consistent_free);
EXPORT_SYMBOL(consistent_sync); EXPORT_SYMBOL(consistent_sync);
#endif #endif
EXPORT_SYMBOL(open);
EXPORT_SYMBOL(read);
EXPORT_SYMBOL(lseek);
EXPORT_SYMBOL(close);
EXPORT_SYMBOL(start_thread); EXPORT_SYMBOL(start_thread);
EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(kernel_thread);
...@@ -191,7 +197,6 @@ EXPORT_SYMBOL(flush_dcache_range); ...@@ -191,7 +197,6 @@ EXPORT_SYMBOL(flush_dcache_range);
EXPORT_SYMBOL(flush_icache_user_range); EXPORT_SYMBOL(flush_icache_user_range);
EXPORT_SYMBOL(flush_icache_page); EXPORT_SYMBOL(flush_icache_page);
EXPORT_SYMBOL(flush_dcache_page); EXPORT_SYMBOL(flush_dcache_page);
EXPORT_SYMBOL(xchg_u32);
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
EXPORT_SYMBOL(last_task_used_altivec); EXPORT_SYMBOL(last_task_used_altivec);
EXPORT_SYMBOL(giveup_altivec); EXPORT_SYMBOL(giveup_altivec);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
export-objs := dec_and_lock.o export-objs := dec_and_lock.o
obj-y := checksum.o string.o strcase.o dec_and_lock.o obj-y := checksum.o string.o strcase.o dec_and_lock.o div64.o
obj-$(CONFIG_SMP) += locks.o obj-$(CONFIG_SMP) += locks.o
......
/*
* Divide a 64-bit unsigned number by a 32-bit unsigned number.
* This routine assumes that the top 32 bits of the dividend are
* non-zero to start with.
* On entry, r3 points to the dividend, which get overwritten with
* the 64-bit quotient, and r4 contains the divisor.
* On exit, r3 contains the remainder.
*
* Copyright (C) 2002 Paul Mackerras, IBM Corp.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <asm/ppc_asm.h>
#include <asm/processor.h>
_GLOBAL(__div64_32)
lwz r5,0(r3) # get the dividend into r5/r6
lwz r6,4(r3)
cmplw r5,r4
li r7,0
li r8,0
blt 1f
divwu r7,r5,r4 # if dividend.hi >= divisor,
mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor
subf. r5,r0,r5 # dividend.hi %= divisor
beq 3f
1: mr r11,r5 # here dividend.hi != 0
andis. r0,r5,0xc000
bne 2f
cntlzw r0,r5 # we are shifting the dividend right
li r10,-1 # to make it < 2^32, and shifting
srw r10,r10,r0 # the divisor right the same amount,
add r9,r4,r10 # rounding up (so the estimate cannot
andc r11,r6,r10 # ever be too large, only too small)
andc r9,r9,r10
or r11,r5,r11
rotlw r9,r9,r0
rotlw r11,r11,r0
divwu r11,r11,r9 # then we divide the shifted quantities
2: mullw r10,r11,r4 # to get an estimate of the quotient,
mulhwu r9,r11,r4 # multiply the estimate by the divisor,
subfc r6,r10,r6 # take the product from the divisor,
add r8,r8,r11 # and add the estimate to the accumulated
subfe. r5,r9,r5 # quotient
bne 1b
3: cmplw r6,r4
blt 4f
divwu r0,r6,r4 # perform the remaining 32-bit division
mullw r10,r0,r4 # and get the remainder
add r8,r8,r0
subf r6,r10,r6
4: stw r7,0(r3) # return the quotient in *r3
stw r8,4(r3)
mr r3,r6 # return the remainder in r3
blr
...@@ -37,6 +37,7 @@ obj-$(CONFIG_LOPEC) += lopec_setup.o lopec_pci.o ...@@ -37,6 +37,7 @@ obj-$(CONFIG_LOPEC) += lopec_setup.o lopec_pci.o
obj-$(CONFIG_MCPN765) += mcpn765_setup.o mcpn765_pci.o obj-$(CONFIG_MCPN765) += mcpn765_setup.o mcpn765_pci.o
obj-$(CONFIG_MENF1) += menf1_setup.o menf1_pci.o obj-$(CONFIG_MENF1) += menf1_setup.o menf1_pci.o
obj-$(CONFIG_MVME5100) += mvme5100_setup.o mvme5100_pci.o obj-$(CONFIG_MVME5100) += mvme5100_setup.o mvme5100_pci.o
obj-$(CONFIG_PAL4) += pal4_setup.o pal4_pci.o cpc700_pic.o
obj-$(CONFIG_PCORE) += pcore_setup.o pcore_pci.o obj-$(CONFIG_PCORE) += pcore_setup.o pcore_pci.o
obj-$(CONFIG_POWERPMC250) += powerpmc250.o obj-$(CONFIG_POWERPMC250) += powerpmc250.o
obj-$(CONFIG_PPLUS) += pplus_pci.o pplus_setup.o obj-$(CONFIG_PPLUS) += pplus_pci.o pplus_setup.o
......
/*
* arch/ppc/platforms/pal4.h
*
* Definitions for SBS Palomar IV board
*
* Author: Dan Cox
*
* Copyright 2002 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.
*/
#ifndef __PPC_PLATFORMS_PAL4_H
#define __PPC_PLATFORMS_PAL4_H
#define PAL4_NVRAM 0xfffc0000
#define PAL4_NVRAM_SIZE 0x8000
#define PAL4_DRAM 0xfff80000
#define PAL4_DRAM_BR_MASK 0xc0
#define PAL4_DRAM_BR_SHIFT 6
#define PAL4_DRAM_RESET 0x10
#define PAL4_DRAM_EREADY 0x40
#define PAL4_MISC 0xfff80004
#define PAL4_MISC_FB_MASK 0xc0
#define PAL4_MISC_FLASH 0x20 /* StratFlash mapping: 1->0xff80, 0->0xfff0 */
#define PAL4_MISC_MISC 0x08
#define PAL4_MISC_BITF 0x02
#define PAL4_MISC_NVKS 0x01
#define PAL4_L2 0xfff80008
#define PAL4_L2_MASK 0x07
#define PAL4_PLDR 0xfff8000c
/* Only two Ethernet devices on the board... */
#define PAL4_ETH 31
#define PAL4_INTA 20
#endif /* __PPC_PLATFORMS_PAL4_H */
/*
* arch/ppc/platforms/pal4_pci.c
*
* PCI support for SBS Palomar IV
*
* Author: Dan Cox
*
* Copyright 2002 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 <linux/kernel.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <asm/byteorder.h>
#include <asm/machdep.h>
#include <asm/io.h>
#include <asm/pci-bridge.h>
#include <asm/uaccess.h>
#include "cpc700.h"
#include "pal4.h"
/* not much to this.... */
static inline int __init
pal4_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
{
if (idsel == 9)
return PAL4_ETH;
else
return PAL4_INTA + (idsel - 3);
}
void __init
pal4_find_bridges(void)
{
struct pci_controller *hose;
hose = pcibios_alloc_controller();
if (!hose)
return;
hose->first_busno = 0;
hose->last_busno = 0xff;
hose->pci_mem_offset = 0;
/* Could snatch these from the CPC700.... */
pci_init_resource(&hose->io_resource,
0x0,
0x03ffffff,
IORESOURCE_IO,
"PCI host bridge");
pci_init_resource(&hose->mem_resources[0],
0x90000000,
0x9fffffff,
IORESOURCE_MEM,
"PCI host bridge");
hose->io_space.start = 0x00800000;
hose->io_space.end = 0x03ffffff;
hose->mem_space.start = 0x90000000;
hose->mem_space.end = 0x9fffffff;
hose->io_base_virt = (void *) 0xf8000000;
setup_indirect_pci(hose, CPC700_PCI_CONFIG_ADDR,
CPC700_PCI_CONFIG_DATA);
hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
ppc_md.pci_swizzle = common_swizzle;
ppc_md.pci_map_irq = pal4_map_irq;
}
/*
* arch/ppc/platforms/pal4_serial.h
*
* Definitions for SBS PalomarIV serial support
*
* Author: Dan Cox
*
* Copyright 2002 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.
*/
#ifndef __PPC_PAL4_SERIAL_H
#define __PPC_PAL4_SERIAL_H
#define CPC700_SERIAL_1 0xff600300
#define CPC700_SERIAL_2 0xff600400
#define RS_TABLE_SIZE 2
#define BASE_BAUD (33333333 / 4 / 16)
#ifdef CONFIG_SERIAL_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ)
#else
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF)
#endif
#define SERIAL_PORT_DFNS \
{0, BASE_BAUD, CPC700_SERIAL_1, 3, STD_COM_FLAGS, \
iomem_base: (unsigned char *) CPC700_SERIAL_1, \
io_type: SERIAL_IO_MEM}, /* ttyS0 */ \
{0, BASE_BAUD, CPC700_SERIAL_2, 4, STD_COM_FLAGS, \
iomem_base: (unsigned char *) CPC700_SERIAL_2, \
io_type: SERIAL_IO_MEM}
#endif
/*
* arch/ppc/platforms/pal4_setup.c
*
* Board setup routines for the SBS PalomarIV.
*
* Author: Dan Cox
*
* Copyright 2002 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 <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/reboot.h>
#include <linux/time.h>
#include <linux/irq.h>
#include <linux/kdev_t.h>
#include <linux/blk.h>
#include <linux/console.h>
#include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <asm/io.h>
#include <asm/todc.h>
#include <asm/bootinfo.h>
#include "cpc700.h"
#include "pal4.h"
extern void pal4_find_bridges(void);
unsigned int cpc700_irq_assigns[][2] = {
{1, 1}, /* IRQ 0: ECC correctable error */
{1, 1}, /* IRQ 1: PCI write to memory range */
{0, 1}, /* IRQ 2: PCI write to command register */
{0, 1}, /* IRQ 3: UART 0 */
{0, 1}, /* IRQ 4: UART 1 */
{0, 1}, /* IRQ 5: ICC 0 */
{0, 1}, /* IRQ 6: ICC 1 */
{0, 1}, /* IRQ 7: GPT compare 0 */
{0, 1}, /* IRQ 8: GPT compare 1 */
{0, 1}, /* IRQ 9: GPT compare 2 */
{0, 1}, /* IRQ 10: GPT compare 3 */
{0, 1}, /* IRQ 11: GPT compare 4 */
{0, 1}, /* IRQ 12: GPT capture 0 */
{0, 1}, /* IRQ 13: GPT capture 1 */
{0, 1}, /* IRQ 14: GPT capture 2 */
{0, 1}, /* IRQ 15: GPT capture 3 */
{0, 1}, /* IRQ 16: GPT capture 4 */
{0, 0}, /* IRQ 17: reserved */
{0, 0}, /* IRQ 18: reserved */
{0, 0}, /* IRQ 19: reserved */
{0, 0}, /* IRQ 20: reserved */
{0, 1}, /* IRQ 21: Ethernet */
{0, 0}, /* IRQ 22: reserved */
{0, 0}, /* IRQ 23: reserved */
{0, 0}, /* IRQ 24: resreved */
{0, 0}, /* IRQ 25: reserved */
{0, 0}, /* IRQ 26: reserved */
{0, 0}, /* IRQ 27: reserved */
{0, 0}, /* IRQ 28: reserved */
{0, 0}, /* IRQ 29: reserved */
{0, 0}, /* IRQ 30: reserved */
{0, 0}, /* IRQ 31: reserved */
};
static int
pal4_show_cpuinfo(struct seq_file *m)
{
seq_printf(m, "board\t\t: SBS Palomar IV\n");
return 0;
}
static void
pal4_restart(char *cmd)
{
__cli();
__asm__ __volatile__("lis 3,0xfff0\n \
ori 3,3,0x100\n \
mtspr 26,3\n \
li 3,0\n \
mtspr 27,3\n \
rfi");
for(;;);
}
static void
pal4_power_off(void)
{
__cli();
for(;;);
}
static void
pal4_halt(void)
{
pal4_power_off();
}
TODC_ALLOC();
static void __init
pal4_setup_arch(void)
{
unsigned long l2;
TODC_INIT(TODC_TYPE_MK48T37, 0, 0,
ioremap(PAL4_NVRAM, PAL4_NVRAM_SIZE), 8);
pal4_find_bridges();
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start)
ROOT_DEV = Root_RAM0;
else
#endif
ROOT_DEV = Root_NFS;
/* The L2 gets disabled in the bootloader, but all the proper
bits should be present from the fw, so just re-enable it */
l2 = _get_L2CR();
if (!(l2 & L2CR_L2E)) {
/* presume that it was initially set if the size is
still present. */
if (l2 ^ L2CR_L2SIZ_MASK)
_set_L2CR(l2 | L2CR_L2E);
else
printk("L2 not set by firmware; left disabled.\n");
}
}
static void __init
pal4_map_io(void)
{
io_block_mapping(0xf0000000, 0xf0000000, 0x10000000, _PAGE_IO);
}
void __init
platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7)
{
parse_bootinfo(find_bootinfo());
isa_io_base = 0 /*PAL4_ISA_IO_BASE*/;
pci_dram_offset = 0 /*PAL4_PCI_SYS_MEM_BASE*/;
ppc_md.setup_arch = pal4_setup_arch;
ppc_md.show_cpuinfo = pal4_show_cpuinfo;
ppc_md.setup_io_mappings = pal4_map_io;
ppc_md.init_IRQ = cpc700_init_IRQ;
ppc_md.get_irq = cpc700_get_irq;
ppc_md.restart = pal4_restart;
ppc_md.halt = pal4_halt;
ppc_md.power_off = pal4_power_off;
ppc_md.time_init = todc_time_init;
ppc_md.set_rtc_time = todc_set_rtc_time;
ppc_md.get_rtc_time = todc_get_rtc_time;
ppc_md.calibrate_decr = todc_calibrate_decr;
ppc_md.nvram_read_val = todc_direct_read_val;
ppc_md.nvram_write_val = todc_direct_write_val;
}
...@@ -168,13 +168,7 @@ pcore_init_IRQ(void) ...@@ -168,13 +168,7 @@ pcore_init_IRQ(void)
for ( i = 0 ; i < 16 ; i++ ) for ( i = 0 ; i < 16 ; i++ )
irq_desc[i].handler = &i8259_pic; irq_desc[i].handler = &i8259_pic;
i8259_init(NULL); i8259_init(0);
}
static int
pcore_get_irq(struct pt_regs *regs)
{
return i8259_poll();
} }
/* /*
...@@ -184,22 +178,16 @@ static __inline__ void ...@@ -184,22 +178,16 @@ static __inline__ void
pcore_set_bat(void) pcore_set_bat(void)
{ {
unsigned long bat3u, bat3l; unsigned long bat3u, bat3l;
static int mapping_set = 0;
__asm__ __volatile__(
if (!mapping_set) { " lis %0,0xf000\n \
__asm__ __volatile__( ori %1,%0,0x002a\n \
" lis %0,0xf000\n \ ori %0,%0,0x1ffe\n \
ori %1,%0,0x002a\n \ mtspr 0x21e,%0\n \
ori %0,%0,0x1ffe\n \ mtspr 0x21f,%1\n \
mtspr 0x21e,%0\n \ isync\n \
mtspr 0x21f,%1\n \ sync "
isync\n \ : "=r" (bat3u), "=r" (bat3l));
sync "
: "=r" (bat3u), "=r" (bat3l));
mapping_set = 1;
}
return;
} }
static unsigned long __init static unsigned long __init
...@@ -233,7 +221,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -233,7 +221,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = pcore_setup_arch; ppc_md.setup_arch = pcore_setup_arch;
ppc_md.show_cpuinfo = pcore_show_cpuinfo; ppc_md.show_cpuinfo = pcore_show_cpuinfo;
ppc_md.init_IRQ = pcore_init_IRQ; ppc_md.init_IRQ = pcore_init_IRQ;
ppc_md.get_irq = pcore_get_irq; ppc_md.get_irq = i8259_irq;
ppc_md.find_end_of_memory = pcore_find_end_of_memory; ppc_md.find_end_of_memory = pcore_find_end_of_memory;
ppc_md.setup_io_mappings = pcore_map_io; ppc_md.setup_io_mappings = pcore_map_io;
......
...@@ -87,9 +87,9 @@ SECTIONS ...@@ -87,9 +87,9 @@ SECTIONS
. = ALIGN(4096); . = ALIGN(4096);
__init_begin = .; __init_begin = .;
.text.init : { *(.text.init) } .init.text : { *(.init.text) }
.data.init : { .init.data : {
*(.data.init); *(.init.data);
__vtop_table_begin = .; __vtop_table_begin = .;
*(.vtop_fixup); *(.vtop_fixup);
__vtop_table_end = .; __vtop_table_end = .;
...@@ -99,7 +99,7 @@ SECTIONS ...@@ -99,7 +99,7 @@ SECTIONS
} }
. = ALIGN(16); . = ALIGN(16);
__setup_start = .; __setup_start = .;
.setup.init : { *(.setup.init) } .init.setup : { *(.init.setup) }
__setup_end = .; __setup_end = .;
__initcall_start = .; __initcall_start = .;
.initcall.init : { .initcall.init : {
...@@ -121,29 +121,29 @@ SECTIONS ...@@ -121,29 +121,29 @@ SECTIONS
. = ALIGN(4096); . = ALIGN(4096);
__pmac_begin = .; __pmac_begin = .;
.text.pmac : { *(.text.pmac) } .pmac.text : { *(.pmac.text) }
.data.pmac : { *(.data.pmac) } .pmac.data : { *(.pmac.data) }
. = ALIGN(4096); . = ALIGN(4096);
__pmac_end = .; __pmac_end = .;
. = ALIGN(4096); . = ALIGN(4096);
__prep_begin = .; __prep_begin = .;
.text.prep : { *(.text.prep) } .prep.text : { *(.prep.text) }
.data.prep : { *(.data.prep) } .prep.data : { *(.prep.data) }
. = ALIGN(4096); . = ALIGN(4096);
__prep_end = .; __prep_end = .;
. = ALIGN(4096); . = ALIGN(4096);
__chrp_begin = .; __chrp_begin = .;
.text.chrp : { *(.text.chrp) } .chrp.text : { *(.chrp.text) }
.data.chrp : { *(.data.chrp) } .chrp.data : { *(.chrp.data) }
. = ALIGN(4096); . = ALIGN(4096);
__chrp_end = .; __chrp_end = .;
. = ALIGN(4096); . = ALIGN(4096);
__openfirmware_begin = .; __openfirmware_begin = .;
.text.openfirmware : { *(.text.openfirmware) } .openfirmware.text : { *(.openfirmware.text) }
.data.openfirmware : { *(.data.openfirmware) } .openfirmware.data : { *(.openfirmware.data) }
. = ALIGN(4096); . = ALIGN(4096);
__openfirmware_end = .; __openfirmware_end = .;
......
#ifndef __PPC_DIV64 #ifndef __PPC_DIV64
#define __PPC_DIV64 #define __PPC_DIV64
#define do_div(n,base) ({ \ #include <linux/types.h>
int __res; \
__res = ((unsigned long) n) % (unsigned) base; \ extern u32 __div64_32(u64 *dividend, u32 div);
n = ((unsigned long) n) / (unsigned) base; \
__res; }) #define do_div(n, div) ({ \
u64 __n = (n); \
u32 __d = (div); \
u32 __q, __r; \
if ((__n >> 32) == 0) { \
__q = (u32)__n / __d; \
__r = (u32)__n - __q * __d; \
(n) = __q; \
} else { \
__r = __div64_32(&__n, __d); \
(n) = __n; \
} \
__r; \
})
#endif #endif
...@@ -68,6 +68,11 @@ struct pci_controller { ...@@ -68,6 +68,11 @@ struct pci_controller {
struct pci_ops *ops; struct pci_ops *ops;
volatile unsigned int *cfg_addr; volatile unsigned int *cfg_addr;
volatile unsigned char *cfg_data; volatile unsigned char *cfg_data;
/*
* If set, indirect method will set the cfg_type bit as
* needed to generate type 1 configuration transactions.
*/
int set_cfg_type;
/* Currently, we limit ourselves to 1 IO range and 3 mem /* Currently, we limit ourselves to 1 IO range and 3 mem
* ranges since the common pci_bus structure can't handle more * ranges since the common pci_bus structure can't handle more
......
...@@ -2,27 +2,27 @@ ...@@ -2,27 +2,27 @@
#ifndef _PPC_SECTIONS_H #ifndef _PPC_SECTIONS_H
#define _PPC_SECTIONS_H #define _PPC_SECTIONS_H
#define __pmac __attribute__ ((__section__ (".text.pmac"))) #define __pmac __attribute__ ((__section__ (".pmac.text")))
#define __pmacdata __attribute__ ((__section__ (".data.pmac"))) #define __pmacdata __attribute__ ((__section__ (".pmac.data")))
#define __pmacfunc(__argpmac) \ #define __pmacfunc(__argpmac) \
__argpmac __pmac; \ __argpmac __pmac; \
__argpmac __argpmac
#define __prep __attribute__ ((__section__ (".text.prep"))) #define __prep __attribute__ ((__section__ (".prep.text")))
#define __prepdata __attribute__ ((__section__ (".data.prep"))) #define __prepdata __attribute__ ((__section__ (".prep.data")))
#define __prepfunc(__argprep) \ #define __prepfunc(__argprep) \
__argprep __prep; \ __argprep __prep; \
__argprep __argprep
#define __chrp __attribute__ ((__section__ (".text.chrp"))) #define __chrp __attribute__ ((__section__ (".chrp.text")))
#define __chrpdata __attribute__ ((__section__ (".data.chrp"))) #define __chrpdata __attribute__ ((__section__ (".chrp.data")))
#define __chrpfunc(__argchrp) \ #define __chrpfunc(__argchrp) \
__argchrp __chrp; \ __argchrp __chrp; \
__argchrp __argchrp
/* this is actually just common chrp/pmac code, not OF code -- Cort */ /* this is actually just common chrp/pmac code, not OF code -- Cort */
#define __openfirmware __attribute__ ((__section__ (".text.openfirmware"))) #define __openfirmware __attribute__ ((__section__ (".openfirmware.text")))
#define __openfirmwaredata __attribute__ ((__section__ (".data.openfirmware"))) #define __openfirmwaredata __attribute__ ((__section__ (".openfirmware.data")))
#define __openfirmwarefunc(__argopenfirmware) \ #define __openfirmwarefunc(__argopenfirmware) \
__argopenfirmware __openfirmware; \ __argopenfirmware __openfirmware; \
__argopenfirmware __argopenfirmware
......
...@@ -119,14 +119,14 @@ extern void __xchg_called_with_bad_pointer(void); ...@@ -119,14 +119,14 @@ extern void __xchg_called_with_bad_pointer(void);
#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
#define tas(ptr) (xchg((ptr),1)) #define tas(ptr) (xchg((ptr),1))
static inline unsigned long __xchg(unsigned long x, void * ptr, int size) static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
{ {
switch (size) { switch (size) {
case 4: case 4:
return (unsigned long )xchg_u32(ptr, x); return (unsigned long) xchg_u32(ptr, x);
#if 0 /* xchg_u64 doesn't exist on 32-bit PPC */ #if 0 /* xchg_u64 doesn't exist on 32-bit PPC */
case 8: case 8:
return (unsigned long )xchg_u64(ptr, x); return (unsigned long) xchg_u64(ptr, x);
#endif /* 0 */ #endif /* 0 */
} }
__xchg_called_with_bad_pointer(); __xchg_called_with_bad_pointer();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment