Skip to content

Commit

Permalink
Merge branch 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/paulus/powerpc

* 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (255 commits)
  [POWERPC] Remove dev_dbg redefinition in drivers/ps3/vuart.c
  [POWERPC] remove kernel module option for booke wdt
  [POWERPC] Avoid putting cpu node twice
  [POWERPC] Spinlock initializer cleanup
  [POWERPC] ppc4xx_sgdma needs dma-mapping.h
  [POWERPC] arch/powerpc/sysdev/timer.c build fix
  [POWERPC] get_property cleanups
  [POWERPC] Remove the unused HTDMSOUND driver
  [POWERPC] cell: cbe_cpufreq cleanup and crash fix
  [POWERPC] Declare enable_kernel_spe in a header
  [POWERPC] Add dt_xlate_addr() to bootwrapper
  [POWERPC] bootwrapper: CONFIG_ -> CONFIG_DEVICE_TREE
  [POWERPC] Don't define a custom bd_t for Xilixn Virtex based boards.
  [POWERPC] Add sane defaults for Xilinx EDK generated xparameters files
  [POWERPC] Add uartlite boot console driver for the zImage wrapper
  [POWERPC] Stop using ppc_sys for Xilinx Virtex boards
  [POWERPC] New registration for common Xilinx Virtex ppc405 platform devices
  [POWERPC] Merge common virtex header files
  [POWERPC] Rework Kconfig dependancies for Xilinx Virtex ppc405 platform
  [POWERPC] Clean up cpufreq Kconfig dependencies
  ...
  • Loading branch information
Linus Torvalds committed Apr 30, 2007
2 parents e389f9a + f900e97 commit 24a77da
Show file tree
Hide file tree
Showing 376 changed files with 11,546 additions and 7,892 deletions.
256 changes: 167 additions & 89 deletions Documentation/powerpc/booting-without-of.txt

Large diffs are not rendered by default.

472 changes: 49 additions & 423 deletions arch/powerpc/Kconfig

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions arch/powerpc/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ config DEBUG_STACK_USAGE

This option will slow down process creation somewhat.

config DEBUG_PAGEALLOC
bool "Debug page memory allocations"
depends on DEBUG_KERNEL && !SOFTWARE_SUSPEND
help
Unmap pages from the kernel linear mapping after free_pages().
This results in a large slowdown, but helps to find certain types
of memory corruptions.


config HCALL_STATS
bool "Hypervisor call instrumentation"
depends on PPC_PSERIES && DEBUG_FS
Expand Down Expand Up @@ -132,8 +141,7 @@ config BOOTX_TEXT

config SERIAL_TEXT_DEBUG
bool "Support for early boot texts over serial port"
depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \
PPC_GEN550 || PPC_MPC52xx
depends on 4xx

config PPC_EARLY_DEBUG
bool "Early debugging (dangerous)"
Expand Down
11 changes: 7 additions & 4 deletions arch/powerpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ CFLAGS += $(call cc-option,-mno-altivec)
# kernel considerably.
CFLAGS += $(call cc-option,-funit-at-a-time)

ifndef CONFIG_FSL_BOOKE
CFLAGS += -mstring
endif
# Never use string load/store instructions as they are
# often slow when they are implemented at all
CFLAGS += -mno-string

ifeq ($(CONFIG_6xx),y)
CFLAGS += -mcpu=powerpc
Expand Down Expand Up @@ -148,7 +148,7 @@ all: $(KBUILD_IMAGE)

CPPFLAGS_vmlinux.lds := -Upowerpc

BOOT_TARGETS = zImage zImage.initrd uImage
BOOT_TARGETS = zImage zImage.initrd uImage cuImage

PHONY += $(BOOT_TARGETS)

Expand All @@ -166,6 +166,9 @@ define archhelp
@echo ' *_defconfig - Select default config from arch/$(ARCH)/configs'
endef

install:
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install

archclean:
$(Q)$(MAKE) $(clean)=$(boot)

Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/boot/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ kernel-vmlinux.strip.c
kernel-vmlinux.strip.gz
mktree
uImage
cuImage
cuImage.bin.gz
cuImage.elf
zImage
zImage.chrp
zImage.coff
Expand Down
122 changes: 62 additions & 60 deletions arch/powerpc/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ zliblinuxheader := zlib.h zconf.h zutil.h
$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) \
$(addprefix $(obj)/,$(zlibheader))

src-wlib := string.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
ns16550.c serial.c simple_alloc.c div64.S util.S $(zlib)
src-plat := of.c
src-boot := crt0.S $(src-wlib) $(src-plat) empty.c
src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
ns16550.c serial.c simple_alloc.c div64.S util.S \
gunzip_util.c elf_util.c $(zlib) devtree.c
src-plat := of.c cuboot-83xx.c cuboot-85xx.c
src-boot := $(src-wlib) $(src-plat) empty.c

src-boot := $(addprefix $(obj)/, $(src-boot))
obj-boot := $(addsuffix .o, $(basename $(src-boot)))
Expand Down Expand Up @@ -75,7 +76,7 @@ $(obj)/zImage.lds $(obj)/zImage.coff.lds: $(obj)/%: $(srctree)/$(src)/%.S
@cp $< $@

clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
empty.c zImage zImage.coff.lds zImage.lds zImage.sandpoint
empty.c zImage.coff.lds zImage.lds

quiet_cmd_bootcc = BOOTCC $@
cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<
Expand All @@ -84,23 +85,25 @@ quiet_cmd_bootas = BOOTAS $@
cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<

quiet_cmd_bootar = BOOTAR $@
cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $^; mv $@.$$$$ $@
cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@

$(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c
$(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE
$(call if_changed_dep,bootcc)
$(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S
$(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
$(call if_changed_dep,bootas)

$(obj)/wrapper.a: $(obj-wlib)
$(call cmd,bootar)
$(obj)/wrapper.a: $(obj-wlib) FORCE
$(call if_changed,bootar)

hostprogs-y := addnote addRamDisk hack-coff mktree

extra-y := $(obj)/crt0.o $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
$(obj)/zImage.lds $(obj)/zImage.coff.lds

wrapper :=$(srctree)/$(src)/wrapper
wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree)
wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
$(wrapper) FORCE

#############
# Bits for building various flavours of zImage
Expand All @@ -113,50 +116,10 @@ CROSSWRAP := -C "$(CROSS_COMPILE)"
endif
endif

# args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd
quiet_cmd_wrap = WRAP $@
cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) vmlinux
quiet_cmd_wrap_initrd = WRAP $@
cmd_wrap_initrd =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
-i $(obj)/ramdisk.image.gz vmlinux

$(obj)/zImage.chrp: vmlinux $(wrapperbits)
$(call cmd,wrap,chrp)

$(obj)/zImage.initrd.chrp: vmlinux $(wrapperbits)
$(call cmd,wrap_initrd,chrp)

$(obj)/zImage.pseries: vmlinux $(wrapperbits)
$(call cmd,wrap,pseries)

$(obj)/zImage.initrd.pseries: vmlinux $(wrapperbits)
$(call cmd,wrap_initrd,pseries)

$(obj)/zImage.pmac: vmlinux $(wrapperbits)
$(call cmd,wrap,pmac)

$(obj)/zImage.initrd.pmac: vmlinux $(wrapperbits)
$(call cmd,wrap_initrd,pmac)

$(obj)/zImage.coff: vmlinux $(wrapperbits)
$(call cmd,wrap,pmaccoff)

$(obj)/zImage.initrd.coff: vmlinux $(wrapperbits)
$(call cmd,wrap_initrd,pmaccoff)

$(obj)/zImage.miboot: vmlinux $(wrapperbits)
$(call cmd,wrap,miboot)

$(obj)/zImage.initrd.miboot: vmlinux $(wrapperbits)
$(call cmd,wrap_initrd,miboot)

$(obj)/zImage.ps3: vmlinux
$(STRIP) -s -R .comment $< -o $@

$(obj)/zImage.initrd.ps3: vmlinux
@echo " WARNING zImage.initrd.ps3 not supported (yet)"

$(obj)/uImage: vmlinux $(wrapperbits)
$(call cmd,wrap,uboot)
cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
$(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) vmlinux

image-$(CONFIG_PPC_PSERIES) += zImage.pseries
image-$(CONFIG_PPC_MAPLE) += zImage.pseries
Expand All @@ -166,24 +129,63 @@ image-$(CONFIG_PPC_CELLEB) += zImage.pseries
image-$(CONFIG_PPC_CHRP) += zImage.chrp
image-$(CONFIG_PPC_EFIKA) += zImage.chrp
image-$(CONFIG_PPC_PMAC) += zImage.pmac
image-$(CONFIG_DEFAULT_UIMAGE) += uImage
image-$(CONFIG_DEFAULT_UIMAGE) += uImage cuImage

# For 32-bit powermacs, build the COFF and miboot images
# as well as the ELF images.
ifeq ($(CONFIG_PPC32),y)
image-$(CONFIG_PPC_PMAC) += zImage.coff zImage.miboot
endif

initrd- := $(patsubst zImage%, zImage.initrd%, $(image-n) $(image-))
initrd-y := $(patsubst zImage%, zImage.initrd%, $(image-y))
initrd-y := $(filter-out $(image-y), $(initrd-y))
targets += $(image-y) $(initrd-y)

$(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz

# Don't put the ramdisk on the pattern rule; when its missing make will try
# the pattern rule with less dependencies that also matches (even with the
# hard dependency listed).
$(obj)/zImage.initrd.%: vmlinux $(wrapperbits)
$(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz)

$(obj)/zImage.%: vmlinux $(wrapperbits)
$(call if_changed,wrap,$*)

$(obj)/zImage.ps3: vmlinux
$(STRIP) -s -R .comment $< -o $@

$(obj)/zImage.initrd.ps3: vmlinux
@echo " WARNING zImage.initrd.ps3 not supported (yet)"

$(obj)/uImage: vmlinux $(wrapperbits)
$(call if_changed,wrap,uboot)

cuboot-plat-$(CONFIG_83xx) += 83xx
cuboot-plat-$(CONFIG_85xx) += 85xx
cuboot-plat-y += unknown-platform

dts = $(if $(shell echo $(CONFIG_DEVICE_TREE) | grep '^/'),\
,$(srctree)/$(src)/dts/)$(CONFIG_DEVICE_TREE)

$(obj)/cuImage: vmlinux $(wrapperbits)
$(call if_changed,wrap,cuboot-$(word 1,$(cuboot-plat-y)),$(dts))

$(obj)/zImage: $(addprefix $(obj)/, $(image-y))
@rm -f $@; ln $< $@
$(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y))
@rm -f $@; ln $< $@

install: $(CONFIGURE) $(image-y)
install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $<

clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.strip.gz)
clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.bin.gz)
clean-files += $(image-)
# anything not in $(targets)
clean-files += $(image-) $(initrd-) zImage zImage.initrd \
cuImage.elf cuImage.bin.gz

# clean up files cached by wrapper
clean-kernel := vmlinux.strip vmlinux.bin
clean-kernel += $(addsuffix .gz,$(clean-kernel))
# If not absolute clean-files are relative to $(obj).
clean-files += $(addprefix $(objtree)/, $(clean-kernel))
37 changes: 34 additions & 3 deletions arch/powerpc/boot/crt0.S
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
_zimage_start_opd:
.long _zimage_start, 0, 0, 0

.weak _zimage_start
.globl _zimage_start
_zimage_start:
.globl _zimage_start_lib
_zimage_start_lib:
/* Work out the offset between the address we were linked at
and the address where we're running. */
bl 1f
Expand All @@ -44,7 +47,7 @@ _zimage_start:
addi r9,r9,4
bdnz 2b

/* Do a cache flush for our text, in case OF didn't */
/* Do a cache flush for our text, in case the loader didn't */
3: lis r9,_start@ha
addi r9,r9,_start@l
add r9,r0,r9
Expand All @@ -59,6 +62,34 @@ _zimage_start:
sync
isync

mr r6,r1
b start
/* Clear the BSS */
lis r9,__bss_start@ha
addi r9,r9,__bss_start@l
add r9,r0,r9
lis r8,_end@ha
addi r8,r8,_end@l
add r8,r0,r8
li r10,0
5: stw r10,0(r9)
addi r9,r9,4
cmplw cr0,r9,r8
blt 5b

/* Possibly set up a custom stack */
.weak _platform_stack_top
lis r8,_platform_stack_top@ha
addi r8,r8,_platform_stack_top@l
cmpwi r8,0
beq 6f
add r8,r0,r8
lwz r1,0(r8)
add r1,r0,r1
li r0,0
stwu r0,-16(r1) /* establish a stack frame */
6:

/* Call platform_init() */
bl platform_init

/* Call start */
b start
68 changes: 68 additions & 0 deletions arch/powerpc/boot/cuboot-83xx.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Old U-boot compatibility for 83xx
*
* Author: Scott Wood <[email protected]>
*
* Copyright (c) 2007 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/

#include "ops.h"
#include "stdio.h"

#define TARGET_83xx
#include "ppcboot.h"

static bd_t bd;
extern char _end[];
extern char _dtb_start[], _dtb_end[];

static void platform_fixups(void)
{
void *soc;

dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);

/* Unfortunately, the specific model number is encoded in the
* soc node name in existing dts files -- once that is fixed,
* this can do a simple path lookup.
*/
soc = find_node_by_devtype(NULL, "soc");
if (soc) {
void *serial = NULL;

setprop(soc, "bus-frequency", &bd.bi_busfreq,
sizeof(bd.bi_busfreq));

while ((serial = find_node_by_devtype(serial, "serial"))) {
if (get_parent(serial) != soc)
continue;

setprop(serial, "clock-frequency", &bd.bi_busfreq,
sizeof(bd.bi_busfreq));
}
}
}

void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7)
{
unsigned long end_of_ram = bd.bi_memstart + bd.bi_memsize;
unsigned long avail_ram = end_of_ram - (unsigned long)_end;

memcpy(&bd, (bd_t *)r3, sizeof(bd));
loader_info.initrd_addr = r4;
loader_info.initrd_size = r4 ? r5 : 0;
loader_info.cmdline = (char *)r6;
loader_info.cmdline_len = r7 - r6;

simple_alloc_init(_end, avail_ram - 1024*1024, 32, 64);
ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
serial_console_init();
platform_ops.fixups = platform_fixups;
}
Loading

0 comments on commit 24a77da

Please sign in to comment.