Commit 41bd1f6e authored by Paul Mackerras's avatar Paul Mackerras

Merge samba.org:/home/paulus/kernel/linux-2.5

into samba.org:/home/paulus/kernel/for-linus-ppc
parents ad6ea5a3 a673bb96
...@@ -1111,7 +1111,7 @@ config HIGHMEM_START ...@@ -1111,7 +1111,7 @@ config HIGHMEM_START
config LOWMEM_SIZE_BOOL config LOWMEM_SIZE_BOOL
bool "Set maximum low memory" bool "Set maximum low memory"
depends on ADVANCED_OPTIONS && HIGHMEM depends on ADVANCED_OPTIONS
help help
This option allows you to set the maximum amount of memory which This option allows you to set the maximum amount of memory which
will be used as "low memory", that is, memory which the kernel can will be used as "low memory", that is, memory which the kernel can
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
# #
# This must match PAGE_OFFSET in include/asm-ppc/page.h. # This must match PAGE_OFFSET in include/asm-ppc/page.h.
KERNELLOAD =$(CONFIG_KERNEL_START) KERNELLOAD := $(CONFIG_KERNEL_START)
LDFLAGS_BLOB := --format binary --oformat elf32-powerpc LDFLAGS_BLOB := --format binary --oformat elf32-powerpc
LDFLAGS_vmlinux = -Ttext $(KERNELLOAD) -Bstatic LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
CPPFLAGS += -Iarch/$(ARCH) CPPFLAGS += -Iarch/$(ARCH)
AFLAGS += -Iarch/$(ARCH) AFLAGS += -Iarch/$(ARCH)
cflags-y += -Iarch/$(ARCH) -msoft-float -pipe \ cflags-y += -Iarch/$(ARCH) -msoft-float -pipe \
......
...@@ -17,24 +17,13 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd ...@@ -17,24 +17,13 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
bootdir-y := simple bootdir-y := simple
bootdir-$(CONFIG_ALL_PPC) := openfirmware prep bootdir-$(CONFIG_ALL_PPC) := openfirmware prep
subdir-y := lib common images subdir-y := lib/ common/ images/
subdir-$(CONFIG_ALL_PPC) += of1275 subdir-$(CONFIG_ALL_PPC) += of1275/
# for cleaning # for cleaning
subdir- += simple/ openfirmware/ prep/ subdir- += simple/ openfirmware/ prep/
tools-$(CONFIG_ALL_PPC) := addnote mknote hack-coff mkprep host-progs := $(addprefix utils/, addnote mknote hack-coff mkprep mkbugboot mktree)
tools-$(CONFIG_PPLUS) := mkbugboot mkprep
tools-$(CONFIG_4xx) := mktree
tools-$(CONFIG_LOPEC) := mkbugboot mkprep
tools-$(CONFIG_MCPN765) := mkbugboot mkprep
tools-$(CONFIG_MENF1) := mkprep
tools-$(CONFIG_MVME5100) := mkbugboot mkprep
tools-$(CONFIG_PRPMC750) := mkbugboot mkprep
tools-$(CONFIG_PRPMC800) := mkbugboot mkprep
tools-$(CONFIG_SPRUCE) := mktree
host-progs := $(addprefix utils/,$(tools-y))
.PHONY: $(BOOT_TARGETS) $(bootdir-y) .PHONY: $(BOOT_TARGETS) $(bootdir-y)
......
...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
# 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
extra-y := vmlinux.gz extra-y := vmlinux.bin vmlinux.gz
GZIP_FLAGS := -v9f
$(obj)/vmlinux.gz: vmlinux OBJCOPYFLAGS_vmlinux.bin := -O binary
$(OBJCOPY) -O binary $< $(@:.gz=) $(obj)/vmlinux.bin: vmlinux FORCE
gzip $(GZIP_FLAGS) $(@:.gz=) $(call if_changed,objcopy)
$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)
# Files generated that shall be removed upon make clean # Files generated that shall be removed upon make clean
clean-files := sImage vmapus vmlinux* miboot* zImage* clean-files := sImage vmapus vmlinux* miboot* zImage*
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
# Merged 'chrp' and 'pmac' into 'openfirmware', and cleaned up the # Merged 'chrp' and 'pmac' into 'openfirmware', and cleaned up the
# rules. # rules.
clean-files := note coffboot coffboot.initrd zImage.initrd znetboot.initrd: del-ramdisk-sec := -R .ramdisk
zImage.initrd znetboot.initrd: initrd := .initrd
boot: zImage
boot := arch/ppc/boot boot := arch/ppc/boot
common := $(boot)/common common := $(boot)/common
...@@ -21,25 +21,23 @@ bootlib := $(boot)/lib ...@@ -21,25 +21,23 @@ bootlib := $(boot)/lib
of1275 := $(boot)/of1275 of1275 := $(boot)/of1275
images := $(boot)/images 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 $(boot)/ld.script -e _start -Ttext 0x00700000 -Bstatic COFF_LD_ARGS := -T $(boot)/ld.script -e _start -Ttext 0x00700000 -Bstatic
CHRP_LD_ARGS = -T $(boot)/ld.script -e _start -Ttext 0x00800000 CHRP_LD_ARGS := -T $(boot)/ld.script -e _start -Ttext 0x00800000
NEWWORLD_LD_ARGS = -T $(boot)/ld.script -e _start -Ttext 0x01000000 NEWWORLD_LD_ARGS:= -T $(boot)/ld.script -e _start -Ttext 0x01000000
COMMONOBJS := start.o misc.o common.o COMMONOBJS := start.o misc.o common.o
COFFOBJS := coffcrt0.o $(COMMONOBJS) coffmain.o COFFOBJS := coffcrt0.o $(COMMONOBJS) coffmain.o
CHRPOBJS := crt0.o $(COMMONOBJS) chrpmain.o CHRPOBJS := crt0.o $(COMMONOBJS) chrpmain.o
NEWWORLDOBJS := crt0.o $(COMMONOBJS) newworldmain.o NEWWORLDOBJS := crt0.o $(COMMONOBJS) newworldmain.o
EXTRA_TARGETS := $(COFFOBJS) $(CHRPOBJS) $(NEWWORLDOBJS) targets := $(COFFOBJS) $(CHRPOBJS) $(NEWWORLDOBJS) dummy.o
COFFOBJS := $(addprefix $(obj)/, $(COFFOBJS)) COFFOBJS := $(addprefix $(obj)/, $(COFFOBJS))
CHRPOBJS := $(addprefix $(obj)/, $(CHRPOBJS)) CHRPOBJS := $(addprefix $(obj)/, $(CHRPOBJS))
NEWWORLDOBJS := $(addprefix $(obj)/, $(NEWWORLDOBJS)) NEWWORLDOBJS := $(addprefix $(obj)/, $(NEWWORLDOBJS))
LIBS = lib/lib.a $(bootlib)/lib.a $(of1275)/lib.a $(common)/lib.a LIBS := lib/lib.a $(bootlib)/lib.a $(of1275)/lib.a $(common)/lib.a
ADDNOTE := $(utils)/addnote
MKNOTE := $(utils)/mknote
HACKCOFF := $(utils)/hack-coff HACKCOFF := $(utils)/hack-coff
ifdef CONFIG_SMP ifdef CONFIG_SMP
...@@ -49,108 +47,136 @@ ifdef CONFIG_PPC64BRIDGE ...@@ -49,108 +47,136 @@ ifdef CONFIG_PPC64BRIDGE
END += .64 END += .64
endif endif
TFTPIMAGE=/tftpboot/zImage.
$(obj)/dummy.o: $(common)/dummy.c $(images)/ramdisk.image.gz:
$(CC) -c -o $@ $(common)/dummy.c @echo ' MISSING $@'
@echo ' RAM disk image must be provided seperatly'
@/bin/false
$(obj)/image.o: $(images)/vmlinux.gz $(obj)/dummy.o objcpxmon-$(CONFIG_XMON) := --add-section=.sysmap=System.map \
$(OBJCOPY) $(obj)/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 --set-section-flags=.sysmap=contents,alloc,load,readonly,data
endif quiet_cmd_genimage = GEN $@
cmd_genimage = $(OBJCOPY) -R .comment \
--add-section=.image=$(images)/vmlinux.gz \
--set-section-flags=.image=contents,alloc,load,readonly,data \
$(objcpxmon-y) $< $@
targets += image.o
$(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz FORCE
$(call if_changed,genimage)
# Place the ramdisk in the initrd image. # Place the ramdisk in the initrd image.
$(obj)/image-initrd.o: $(obj)/image.o $(images)/ramdisk.image.gz quiet_cmd_genimage-initrd = GEN $@
$(OBJCOPY) $(obj)/image.o $@ \ cmd_genimage-initrd = $(OBJCOPY) $< $@ \
--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
targets += image.initrd.o
$(obj)/image.initrd.o: $(obj)/image.o $(images)/ramdisk.image.gz FORCE
$(call if_changed,genimage-initrd)
# Create the note section for New-World PowerMacs. # Create the note section for New-World PowerMacs.
$(obj)/note: $(MKNOTE) quit_cmd_mknote = MKNOTE $@
$(MKNOTE) > $(obj)/note cmd_mknote = $(utils)/mknote > $@
targets += note
znetboot: $(images)/vmlinux.coff $(images)/vmlinux.elf-pmac $(images)/zImage.chrp $(obj)/note: $(utils)/mknote FORCE
cp $(images)/vmlinux.coff $(TFTPIMAGE).pmac$(END) $(call if_changed,mknote)
cp $(images)/vmlinux.elf-pmac $(TFTPIMAGE).pmac$(END)elf
cp $(images)/zImage.chrp $(TFTPIMAGE).chrp$(END)
$(obj)/coffcrt0.o: EXTRA_AFLAGS := -traditional -DXCOFF
znetboot.initrd: $(images)/vmlinux.initrd.coff \ $(obj)/crt0.o: EXTRA_AFLAGS := -traditional
$(images)/vmlinux.initrd.elf-pmac \ targets += coffcrt0.o crt0.o
$(images)/zImage.initrd.chrp $(obj)/coffcrt0.o $(obj)/crt0.o: $(common)/crt0.S FORCE
cp $(images)/vmlinux.initrd.coff $(TFTPIMAGE).pmac$(END) $(call if_changed_dep,as_o_S)
cp $(images)/vmlinux.initrd.elf-pmac $(TFTPIMAGE).pmac$(END).elf
cp $(images)/zImage.initrd.chrp $(TFTPIMAGE).chrp$(END) quiet_cmd_gencoffb = COFF $@
cmd_gencoffb = $(LD) -o $@ $(COFF_LD_ARGS) $(filter-out FORCE,$^) && \
$(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
targets += coffboot
$(obj)/coffboot: $(COFFOBJS) $(obj)/image.o $(LIBS) FORCE
$(call if_changed,gencoffb)
targets += coffboot.initrd
$(obj)/coffboot.initrd: $(COFFOBJS) $(obj)/image.initrd.o $(LIBS) FORCE
$(call if_changed,gencoffb)
quiet_cmd_gen-coff = COFF $@
cmd_gen-coff = $(OBJCOPY) $(OBJCOPY_ARGS) $< $@ && \
$(HACKCOFF) $@ && \
ln -sf $(notdir $@) $(images)/zImage$(initrd).pmac
$(images)/vmlinux.coff: $(obj)/coffboot
$(call cmd,gen-coff)
$(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd
$(call cmd,gen-coff)
quiet_cmd_gen-elf-pmac = ELF $@
cmd_gen-elf-pmac = $(LD) $(NEWWORLD_LD_ARGS) -o $@ \
$(NEWWORLDOBJS) $(LIBS) $< && \
$(OBJCOPY) $@ $@ --add-section=.note=$(obj)/note \
-R .comment $(del-ramdisk-sec)
$(images)/vmlinux.elf-pmac: $(obj)/image.o $(NEWWORLDOBJS) $(LIBS) $(obj)/note
$(call cmd,gen-elf-pmac)
$(images)/vmlinux.initrd.elf-pmac: $(obj)/image.initrd.o $(NEWWORLDOBJS) \
$(LIBS) $(obj)/note
$(call cmd,gen-elf-pmac)
quiet_cmd_gen-chrp = CHRP $@
cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $^ && \
$(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS)
$(call cmd,gen-chrp)
$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS)
$(call cmd,gen-chrp)
quiet_cmd_addnote = ADDNOTE $@
cmd_addnote = cat $< > $@ && $(utils)/addnote $@
$(images)/zImage.chrp-rs6k $(images)/zImage.initrd.chrp-rs6k: \
%-rs6k: %
$(call cmd,addnote)
quiet_cmd_gen-miboot = GEN $@
cmd_gen-miboot = $(OBJCOPY) $(OBJCOPY_ARGS) \
--add-section=$1=$(word 2, $^) $< $@
$(images)/miboot.image: $(obj)/dummy.o $(images)/vmlinux.gz $(images)/miboot.image: $(obj)/dummy.o $(images)/vmlinux.gz
$(OBJCOPY) $(OBJCOPY_ARGS) --add-section=image=$(images)/vmlinux.gz \ $(call cmd,gen-miboot,image)
$(obj)/dummy.o $@
$(images)/miboot.initrd.image: $(images)/miboot.image $(images)/ramdisk.image.gz $(images)/miboot.initrd.image: $(images)/miboot.image $(images)/ramdisk.image.gz
$(OBJCOPY) $(OBJCOPY_ARGS) \ $(call cmd,gen-miboot,initrd)
--add-section=initrd=$(images)/ramdisk.image.gz \
$(images)/miboot.image $@
$(obj)/coffcrt0.o: $(common)/crt0.S
$(CC) $(AFLAGS) -DXCOFF -traditional -c -o $@ $(common)/crt0.S
$(obj)/crt0.o: $(common)/crt0.S
$(CC) $(AFLAGS) -traditional -c -o $@ $(common)/crt0.S
$(obj)/coffboot: $(COFFOBJS) $(obj)/image.o $(LIBS)
$(LD) -o $@ $(COFF_LD_ARGS) $^
$(OBJCOPY) $@ $@ -R .comment -R .ramdisk
$(obj)/coffboot.initrd: $(COFFOBJS) $(obj)/image-initrd.o $(LIBS)
$(LD) -o $@ $(COFF_LD_ARGS) $^
$(OBJCOPY) $@ $@ -R .comment
$(images)/vmlinux.coff: $(obj)/coffboot $(HACKCOFF)
$(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/coffboot $@
$(HACKCOFF) $@
ln -sf vmlinux.coff $(images)/zImage.pmac
$(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd $(HACKCOFF)
$(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/coffboot.initrd $@
$(HACKCOFF) $@
ln -sf vmlinux.initrd.coff $(images)/zImage.initrd.pmac
$(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) # The targets used on the make command-line
$(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 $(ADDNOTE) .PHONY: zImage zImage.initrd
cp $(images)/zImage.chrp $@ zImage: $(images)/vmlinux.coff \
$(ADDNOTE) $@ $(images)/vmlinux.elf-pmac \
$(images)/zImage.chrp \
$(images)/zImage.chrp-rs6k \
$(images)/miboot.image
@echo ' kernel: $@ is ready ($<)'
zImage.initrd: $(images)/vmlinux.initrd.coff \
$(images)/vmlinux.initrd.elf-pmac \
$(images)/zImage.initrd.chrp \
$(images)/zImage.initrd.chrp-rs6k \
$(images)/miboot.initrd.image
@echo ' kernel: $@ is ready ($<)'
$(images)/zImage.initrd.chrp-rs6k: $(images)/zImage.initrd.chrp $(ADDNOTE) TFTPIMAGE := /tftpboot/zImage.
cp $(images)/zImage.initrd.chrp $@
$(ADDNOTE) $@
zImage: $(images)/vmlinux.coff $(images)/vmlinux.elf-pmac \ .PHONY: znetboot znetboot.initrd
$(images)/zImage.chrp $(images)/zImage.chrp-rs6k \ znetboot: $(images)/vmlinux.coff \
$(images)/miboot.image $(images)/vmlinux.elf-pmac \
$(images)/zImage.chrp
cp $(images)/vmlinux.coff $(TFTPIMAGE).pmac$(END)
cp $(images)/vmlinux.elf-pmac $(TFTPIMAGE).pmac$(END).elf
cp $(images)/zImage.chrp $(TFTPIMAGE).chrp$(END)
@echo ' kernel: $@ is ready ($<)'
znetboot.initrd:$(images)/vmlinux.initrd.coff \
$(images)/vmlinux.initrd.elf-pmac \
$(images)/zImage.initrd.chrp
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)
@echo ' kernel: $@ is ready ($<)'
zImage.initrd: $(images)/vmlinux.initrd.coff $(images)/vmlinux.initrd.elf-pmac\
$(images)/zImage.initrd.chrp $(images)/zImage.initrd.chrp-rs6k\
$(images)/miboot.initrd.image
...@@ -13,17 +13,11 @@ ...@@ -13,17 +13,11 @@
# 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 $(boot)/ld.script -Ttext 0x00800000 -Bstatic
OBJCOPY_ARGS = -O elf32-powerpc
LIBS = $(common)/lib.a $(bootlib)/lib.a
boot-y := head.o misc.o boot-y := head.o misc.o
boot-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o boot-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
...@@ -31,56 +25,84 @@ boot := arch/ppc/boot ...@@ -31,56 +25,84 @@ boot := arch/ppc/boot
common := $(boot)/common common := $(boot)/common
utils := $(boot)/utils utils := $(boot)/utils
bootlib := $(boot)/lib bootlib := $(boot)/lib
of1275 := $(boot)/of1275
images := $(boot)/images images := $(boot)/images
simple := $(boot)/simple simple := $(boot)/simple
EXTRA_TARGETS := $(boot-y) ../simple/legacy.o OBJCOPYFLAGS := -O elf32-powerpc
OBJS := $(addprefix $(obj)/,$(boot-y)) $(simple)/legacy.o LIBS := $(common)/lib.a $(bootlib)/lib.a
# Tools targets := $(boot-y) dummy.o ../simple/legacy.o
MKPREP := $(utils)/mkprep OBJS := $(addprefix $(obj)/,$(boot-y)) $(simple)/legacy.o
# Extra include search dirs # Extra include search dirs
CFLAGS_kbd.o += -Idrivers/char CFLAGS_kbd.o += -Idrivers/char
zImage: initrd :=
zImage: $(images)/zImage.prep zImage: $(images)/zImage.prep
@echo ' kernel: $@ is ready ($<)'
zImage.initrd: initrd := .initrd
zImage.initrd: $(images)/zImage.initrd.prep zImage.initrd: $(images)/zImage.initrd.prep
@echo ' kernel: $@ is ready ($<)'
$(obj)/dummy.o: $(common)/dummy.c $(images)/ramdisk.image.gz:
$(CC) -c -o $@ $(common)/dummy.c @echo ' MISSING $@'
@echo ' RAM disk image must be provided separatly'
@/bin/false
$(images)/zImage.prep: $(OBJS) $(LIBS) $(boot)/ld.script $(images)/vmlinux.gz \ OBJCOPYFLAGS_image.o := \
$(obj)/dummy.o $(MKPREP)
$(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
$(obj)/dummy.o $(obj)/image.o targets += image.o
$(LD) $(LD_ARGS) -o $(obj)/zImage $(OBJS) $(obj)/image.o $(LIBS) $(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz
$(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/zImage $(obj)/zImage \ $(call if_changed,objcopy)
-R .comment -R .stab -R .stabstr
$(MKPREP) -pbp $(obj)/zImage $@ OBJCOPYFLAGS_image.initrd.o := \
rm -f $(obj)/zImage
$(images)/zImage.initrd.prep: $(OBJS) $(LIBS) $(boot)/ld.script \
$(images)/vmlinux.gz $(obj)/dummy.o $(MKPREP)
$(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
$(obj)/dummy.o $(obj)/image.o targets += image.initrd.o
$(LD) $(LD_ARGS) -o $(obj)/zImage.initrd $(OBJS) $(obj)/image.o $(LIBS) $(obj)/image.initrd.o: $(obj)/dummy.o $(images)/vmlinux.gz $(images)/ramdisk.image.gz
$(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/zImage.initrd $(obj)/zImage.initrd \ $(call if_changed,objcopy)
-R .comment -R .stab -R .stabstr
$(MKPREP) -pbp $(obj)/zImage.initrd $@ LDFLAGS_zImage.bin := -Ttext 0x00800000 -Bstatic -T
rm -f $(obj)/zImage.initrd LDFLAGS_zImage.initrd.bin := -Ttext 0x00800000 -Bstatic -T
targets += zImage.bin
$(obj)/zImage.bin: $(boot)/ld.script $(OBJS) $(obj)/image.o $(LIBS)
$(call if_changed,ld)
targets += zImage.initrd.bin
$(obj)/zImage.initrd.bin: $(boot)/ld.script $(OBJS) $(obj)/image.initrd.o $(LIBS)
$(call if_changed,ld)
OBJCOPYFLAGS_zImage := -R .comment -R .stab -R .stabstr
OBJCOPYFLAGS_zImage.initrd := -R .comment -R .stab -R .stabstr
targets += zImage
$(obj)/zImage: %: %.bin FORCE
$(call if_changed,objcopy)
targets += zImage.initrd
$(obj)/zImage.initrd: %: %.bin FORCE
$(call if_changed,objcopy)
quiet_cmd_mkprep = MKPREP $@
cmd_mkprep = $(utils)/mkprep -pbp $< $@
$(images)/zImage.prep: $(obj)/zImage $(utils)/mkprep
$(call cmd,mkprep)
$(images)/zImage.initrd.prep: $(obj)/zImage.initrd $(utils)/mkprep
$(call cmd,mkprep)
#
# Convinient shorthands for various targets
#
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)
@echo ' kernel: $@ is ready ($<)'
znetboot.initrd : zImage.initrd znetboot.initrd : zImage.initrd
cp $(images)/zImage.initrd.prep $(TFTPIMAGE) cp $(images)/zImage.initrd.prep $(TFTPIMAGE)
@echo ' kernel: $@ is ready ($<)'
int main(void)
{
return 0;
}
...@@ -160,8 +160,7 @@ MKBUGBOOT := $(utils)/mkbugboot ...@@ -160,8 +160,7 @@ MKBUGBOOT := $(utils)/mkbugboot
MKPREP := $(utils)/mkprep MKPREP := $(utils)/mkprep
MKTREE := $(utils)/mktree MKTREE := $(utils)/mktree
$(obj)/dummy.o: $(common)/dummy.c targets := dummy.o
$(CC) -c -o $@ $(common)/dummy.c
$(obj)/zvmlinux: $(OBJS) $(LIBS) $(boot)/ld.script $(images)/vmlinux.gz \ $(obj)/zvmlinux: $(OBJS) $(LIBS) $(boot)/ld.script $(images)/vmlinux.gz \
$(obj)/dummy.o $(obj)/dummy.o
......
int main(void)
{
return 0;
}
#
# arch/ppc/boot/utils/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.
HOSTCFLAGS += -I$(TOPDIR)/arch/$(ARCH)/boot/include
all: FORCE
# Simple programs with 1 file and no extra CFLAGS
UTILS = addnote hack-coff mkprep mknote mkbugboot mktree \
addSystemMap addRamdDisk
$(UTILS):
$(HOSTCC) $(HOSTCFLAGS) -o $@ $@.c
clean:
rm -f $(UTILS)
...@@ -10,12 +10,10 @@ EXTRA_AFLAGS := -Wa,-m405 ...@@ -10,12 +10,10 @@ EXTRA_AFLAGS := -Wa,-m405
endif endif
# Start off with 'head.o', change as needed. # Start off with 'head.o', change as needed.
HEAD-y := head.o extra-y := head.o
HEAD-$(CONFIG_40x) := head_4xx.o extra-$(CONFIG_40x) := head_4xx.o
HEAD-$(CONFIG_8xx) := head_8xx.o extra-$(CONFIG_8xx) := head_8xx.o
HEAD-$(CONFIG_6xx) += idle_6xx.o extra-$(CONFIG_6xx) += idle_6xx.o
extra-y := $(HEAD-y)
obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
process.o signal.o ptrace.o align.o \ process.o signal.o ptrace.o align.o \
......
...@@ -534,7 +534,7 @@ _GLOBAL(flush_instruction_cache) ...@@ -534,7 +534,7 @@ _GLOBAL(flush_instruction_cache)
isync isync
lis r5, IDC_INVALL@h lis r5, IDC_INVALL@h
mtspr IC_CST, r5 mtspr IC_CST, r5
#elif defined(CONFIG_40x) #elif defined(CONFIG_4xx)
#ifdef CONFIG_403GCX #ifdef CONFIG_403GCX
li r3, 512 li r3, 512
mtctr r3 mtctr r3
......
...@@ -22,6 +22,7 @@ void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, ...@@ -22,6 +22,7 @@ void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
if (hwdev == NULL || hwdev->dma_mask != 0xffffffff) if (hwdev == NULL || hwdev->dma_mask != 0xffffffff)
gfp |= GFP_DMA; gfp |= GFP_DMA;
#ifdef CONFIG_NOT_COHERENT_CACHE #ifdef CONFIG_NOT_COHERENT_CACHE
ret = consistent_alloc(gfp, size, dma_handle); ret = consistent_alloc(gfp, size, dma_handle);
#else #else
...@@ -30,7 +31,9 @@ void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, ...@@ -30,7 +31,9 @@ void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
if (ret != NULL) { if (ret != NULL) {
memset(ret, 0, size); memset(ret, 0, size);
#ifndef CONFIG_NOT_COHERENT_CACHE
*dma_handle = virt_to_bus(ret); *dma_handle = virt_to_bus(ret);
#endif
} }
return ret; return ret;
} }
......
...@@ -406,6 +406,7 @@ int __cpu_up(unsigned int cpu) ...@@ -406,6 +406,7 @@ int __cpu_up(unsigned int cpu)
p = copy_process(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL); p = copy_process(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
if (IS_ERR(p)) if (IS_ERR(p))
panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p)); panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
wake_up_forked_process(p);
init_idle(p, cpu); init_idle(p, cpu);
unhash_process(p); unhash_process(p);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* PowerPC version derived from arch/arm/mm/consistent.c * PowerPC version derived from arch/arm/mm/consistent.c
* Copyright (C) 2001 Dan Malek (dmalek@jlc.net) * Copyright (C) 2001 Dan Malek (dmalek@jlc.net)
* *
* arch/arm/mm/consistent.c * arch/ppc/mm/cachemap.c
* *
* Copyright (C) 2000 Russell King * Copyright (C) 2000 Russell King
* *
...@@ -59,57 +59,69 @@ int map_page(unsigned long va, unsigned long pa, int flags); ...@@ -59,57 +59,69 @@ int map_page(unsigned long va, unsigned long pa, int flags);
*/ */
void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle) void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle)
{ {
int order, err, i; int order, err;
unsigned long page, va, pa, flags; struct page *page, *free, *end;
struct vm_struct *area; unsigned long pa, flags, offset;
void *ret; struct vm_struct *area = NULL;
unsigned long va = 0;
if (in_interrupt()) BUG_ON(in_interrupt());
BUG();
/* Only allocate page size areas. /* Only allocate page size areas */
*/
size = PAGE_ALIGN(size); size = PAGE_ALIGN(size);
order = get_order(size); order = get_order(size);
page = __get_free_pages(gfp, order); free = page = alloc_pages(gfp, order);
if (!page) { if (! page)
BUG();
return NULL; return NULL;
}
pa = page_to_phys(page);
*dma_handle = page_to_bus(page);
end = page + (1 << order);
/* /*
* we need to ensure that there are no cachelines in use, * we need to ensure that there are no cachelines in use,
* or worse dirty in this area. * or worse dirty in this area.
*/ */
invalidate_dcache_range(page, page + size); invalidate_dcache_range((unsigned long)page_address(page),
(unsigned long)page_address(page) + size);
/* Allocate some common virtual space to map the new pages. /*
* alloc_pages() expects the block to be handled as a unit, so
* it only sets the page count on the first page. We set the
* counts on each page so they can be freed individually
*/ */
for (; page < end; page++)
set_page_count(page, 1);
/* Allocate some common virtual space to map the new pages*/
area = get_vm_area(size, VM_ALLOC); area = get_vm_area(size, VM_ALLOC);
if (area == 0) { if (! area)
free_pages(page, order); goto out;
return NULL;
}
va = VMALLOC_VMADDR(area->addr);
ret = (void *)va;
/* This gives us the real physical address of the first page. va = VMALLOC_VMADDR(area->addr);
*/
*dma_handle = pa = virt_to_bus((void *)page);
flags = _PAGE_KERNEL | _PAGE_NO_CACHE; flags = _PAGE_KERNEL | _PAGE_NO_CACHE;
err = 0; for (offset = 0; offset < size; offset += PAGE_SIZE) {
for (i = 0; i < size && err == 0; i += PAGE_SIZE) err = map_page(va+offset, pa+offset, flags);
err = map_page(va+i, pa+i, flags);
if (err) { if (err) {
vfree((void *)va); vfree((void *)va);
return NULL; va = 0;
goto out;
} }
return ret; free++;
}
out:
/* Free pages which weren't mapped */
for (; free < end; free++) {
__free_page(free);
}
return (void *)va;
} }
/* /*
...@@ -117,8 +129,7 @@ void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle) ...@@ -117,8 +129,7 @@ void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle)
*/ */
void consistent_free(void *vaddr) void consistent_free(void *vaddr)
{ {
if (in_interrupt()) BUG_ON(in_interrupt());
BUG();
vfree(vaddr); vfree(vaddr);
} }
...@@ -155,6 +166,6 @@ void consistent_sync_page(struct page *page, unsigned long offset, ...@@ -155,6 +166,6 @@ void consistent_sync_page(struct page *page, unsigned long offset,
{ {
unsigned long start; unsigned long start;
start = page_address(page) + offset; start = (unsigned long)page_address(page) + offset;
consistent_sync((void *)start, size, direction); consistent_sync((void *)start, size, direction);
} }
# #
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile...
#
# NB: cribbed from the drivers/sbus/Makefile -- PMM
obj-y += ocp.o ocp-driver.o ocp-probe.o obj-y := ocp.o ocp-driver.o ocp-probe.o
...@@ -55,7 +55,7 @@ static void openpic_set_spurious(u_int vector); ...@@ -55,7 +55,7 @@ static void openpic_set_spurious(u_int vector);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* Interprocessor Interrupts */ /* Interprocessor Interrupts */
static void openpic_initipi(u_int ipi, u_int pri, u_int vector); static void openpic_initipi(u_int ipi, u_int pri, u_int vector);
static void openpic_ipi_action(int cpl, void *dev_id, struct pt_regs *regs); static irqreturn_t openpic_ipi_action(int cpl, void *dev_id, struct pt_regs *);
#endif #endif
/* Timer Interrupts */ /* Timer Interrupts */
......
...@@ -54,8 +54,7 @@ extern void kunmap_high(struct page *page); ...@@ -54,8 +54,7 @@ extern void kunmap_high(struct page *page);
static inline void *kmap(struct page *page) static inline void *kmap(struct page *page)
{ {
if (in_interrupt()) might_sleep();
BUG();
if (page < highmem_start_page) if (page < highmem_start_page)
return page_address(page); return page_address(page);
return kmap_high(page); return kmap_high(page);
......
...@@ -102,6 +102,9 @@ static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, ...@@ -102,6 +102,9 @@ static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
{ {
if (direction == PCI_DMA_NONE) if (direction == PCI_DMA_NONE)
BUG(); BUG();
consistent_sync(ptr, size, direction);
return virt_to_bus(ptr); return virt_to_bus(ptr);
} }
...@@ -203,7 +206,8 @@ static inline void pci_dma_sync_single(struct pci_dev *hwdev, ...@@ -203,7 +206,8 @@ static inline void pci_dma_sync_single(struct pci_dev *hwdev,
{ {
if (direction == PCI_DMA_NONE) if (direction == PCI_DMA_NONE)
BUG(); BUG();
/* nothing to do */
consistent_sync(bus_to_virt(dma_handle), size, direction);
} }
/* Make physical memory consistent for a set of streaming /* Make physical memory consistent for a set of streaming
......
...@@ -300,6 +300,7 @@ extern unsigned long ioremap_bot, ioremap_base; ...@@ -300,6 +300,7 @@ extern unsigned long ioremap_bot, ioremap_base;
#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC) #define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
#define PAGE_KERNEL __pgprot(_PAGE_RAM) #define PAGE_KERNEL __pgprot(_PAGE_RAM)
#define PAGE_KERNEL_NOCACHE __pgprot(_PAGE_IO)
/* /*
* The PowerPC can only do execute protection on a segment (256MB) basis, * The PowerPC can only do execute protection on a segment (256MB) basis,
...@@ -515,7 +516,7 @@ extern void paging_init(void); ...@@ -515,7 +516,7 @@ extern void paging_init(void);
/* /*
* When flushing the tlb entry for a page, we also need to flush the hash * When flushing the tlb entry for a page, we also need to flush the hash
* table entry. flush_hash_page is assembler (for speed) in hashtable.S. * table entry. flush_hash_pages is assembler (for speed) in hashtable.S.
*/ */
extern int flush_hash_pages(unsigned context, unsigned long va, extern int flush_hash_pages(unsigned context, unsigned long va,
unsigned long pmdval, int count); unsigned long pmdval, int count);
......
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