diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-16 10:58:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-16 10:58:48 -0500 |
commit | d58a75ef75ad98f2d20ee6dccfc71f881aabffb0 (patch) | |
tree | fbfa28526e3e2695c61d83a1a4997a8c3d00b686 /arch/powerpc | |
parent | f6ff56cd56b83d8edf4b3cffc5c53c56b37a5081 (diff) | |
parent | 5d66da3d71e6aeca80ca08dbebd8a1cd72e6ee1f (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
Diffstat (limited to 'arch/powerpc')
39 files changed, 2734 insertions, 337 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index d41ad2e675db..99dbea8c5c50 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -14,10 +14,6 @@ | |||
14 | 14 | ||
15 | HAS_BIARCH := $(call cc-option-yn, -m32) | 15 | HAS_BIARCH := $(call cc-option-yn, -m32) |
16 | 16 | ||
17 | ifeq ($(CONFIG_PPC64),y) | ||
18 | OLDARCH := ppc64 | ||
19 | SZ := 64 | ||
20 | |||
21 | # Set default 32 bits cross compilers for vdso and boot wrapper | 17 | # Set default 32 bits cross compilers for vdso and boot wrapper |
22 | CROSS32_COMPILE ?= | 18 | CROSS32_COMPILE ?= |
23 | 19 | ||
@@ -37,6 +33,10 @@ endif | |||
37 | 33 | ||
38 | export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY | 34 | export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY |
39 | 35 | ||
36 | ifeq ($(CONFIG_PPC64),y) | ||
37 | OLDARCH := ppc64 | ||
38 | SZ := 64 | ||
39 | |||
40 | new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) | 40 | new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) |
41 | 41 | ||
42 | ifeq ($(new_nm),y) | 42 | ifeq ($(new_nm),y) |
@@ -139,7 +139,7 @@ drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/ | |||
139 | 139 | ||
140 | drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ | 140 | drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ |
141 | 141 | ||
142 | defaultimage-$(CONFIG_PPC32) := uImage zImage | 142 | defaultimage-$(CONFIG_PPC32) := zImage |
143 | defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux | 143 | defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux |
144 | defaultimage-$(CONFIG_PPC_PSERIES) := zImage | 144 | defaultimage-$(CONFIG_PPC_PSERIES) := zImage |
145 | KBUILD_IMAGE := $(defaultimage-y) | 145 | KBUILD_IMAGE := $(defaultimage-y) |
@@ -154,23 +154,13 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm | |||
154 | 154 | ||
155 | .PHONY: $(BOOT_TARGETS) | 155 | .PHONY: $(BOOT_TARGETS) |
156 | 156 | ||
157 | boot := arch/$(OLDARCH)/boot | 157 | boot := arch/$(ARCH)/boot |
158 | 158 | ||
159 | # urk | ||
160 | ifeq ($(CONFIG_PPC64),y) | ||
161 | $(BOOT_TARGETS): vmlinux | 159 | $(BOOT_TARGETS): vmlinux |
162 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) | 160 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
163 | else | ||
164 | $(BOOT_TARGETS): vmlinux | ||
165 | $(Q)$(MAKE) ARCH=ppc $(build)=$(boot) $@ | ||
166 | endif | ||
167 | |||
168 | uImage: vmlinux | ||
169 | $(Q)$(MAKE) ARCH=$(OLDARCH) $(build)=$(boot)/images $(boot)/images/$@ | ||
170 | 161 | ||
171 | define archhelp | 162 | define archhelp |
172 | @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)' | 163 | @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' |
173 | @echo ' uImage - Create a bootable image for U-Boot / PPCBoot' | ||
174 | @echo ' install - Install kernel using' | 164 | @echo ' install - Install kernel using' |
175 | @echo ' (your) ~/bin/installkernel or' | 165 | @echo ' (your) ~/bin/installkernel or' |
176 | @echo ' (distribution) /sbin/installkernel or' | 166 | @echo ' (distribution) /sbin/installkernel or' |
@@ -180,7 +170,6 @@ endef | |||
180 | 170 | ||
181 | archclean: | 171 | archclean: |
182 | $(Q)$(MAKE) $(clean)=$(boot) | 172 | $(Q)$(MAKE) $(clean)=$(boot) |
183 | # Temporary hack until we have migrated to asm-powerpc | ||
184 | $(Q)rm -rf arch/$(ARCH)/include | 173 | $(Q)rm -rf arch/$(ARCH)/include |
185 | 174 | ||
186 | archprepare: checkbin | 175 | archprepare: checkbin |
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile new file mode 100644 index 000000000000..9770f587af73 --- /dev/null +++ b/arch/powerpc/boot/Makefile | |||
@@ -0,0 +1,149 @@ | |||
1 | # Makefile for making ELF bootable images for booting on CHRP | ||
2 | # using Open Firmware. | ||
3 | # | ||
4 | # Geert Uytterhoeven September 1997 | ||
5 | # | ||
6 | # Based on coffboot by Paul Mackerras | ||
7 | # Simplified for ppc64 by Todd Inglett | ||
8 | # | ||
9 | # NOTE: this code is built for 32 bit in ELF32 format even though | ||
10 | # it packages a 64 bit kernel. We do this to simplify the | ||
11 | # bootloader and increase compatibility with OpenFirmware. | ||
12 | # | ||
13 | # To this end we need to define BOOTCC, etc, as the tools | ||
14 | # needed to build the 32 bit image. These are normally HOSTCC, | ||
15 | # but may be a third compiler if, for example, you are cross | ||
16 | # compiling from an intel box. Once the 64bit ppc gcc is | ||
17 | # stable it will probably simply be a compiler switch to | ||
18 | # compile for 32bit mode. | ||
19 | # To make it easier to setup a cross compiler, | ||
20 | # CROSS32_COMPILE is setup as a prefix just like CROSS_COMPILE | ||
21 | # in the toplevel makefile. | ||
22 | |||
23 | |||
24 | HOSTCC := gcc | ||
25 | BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \ | ||
26 | $(shell $(CROSS32CC) -print-file-name=include) -fPIC | ||
27 | BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc | ||
28 | BOOTLFLAGS := -T $(srctree)/$(src)/zImage.lds | ||
29 | OBJCOPYFLAGS := contents,alloc,load,readonly,data | ||
30 | |||
31 | zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c | ||
32 | zlibheader := infblock.h infcodes.h inffast.h inftrees.h infutil.h | ||
33 | zliblinuxheader := zlib.h zconf.h zutil.h | ||
34 | |||
35 | $(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) | ||
36 | #$(addprefix $(obj)/,main.o): $(addprefix $(obj)/,zlib.h) | ||
37 | |||
38 | src-boot := string.S prom.c main.c div64.S crt0.S | ||
39 | src-boot += $(zlib) | ||
40 | src-boot := $(addprefix $(obj)/, $(src-boot)) | ||
41 | obj-boot := $(addsuffix .o, $(basename $(src-boot))) | ||
42 | |||
43 | BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) | ||
44 | |||
45 | quiet_cmd_copy_zlib = COPY $@ | ||
46 | cmd_copy_zlib = sed "s@__attribute_used__@@;s@<linux/\([^>]\+\).*@\"\1\"@" $< > $@ | ||
47 | |||
48 | quiet_cmd_copy_zlibheader = COPY $@ | ||
49 | cmd_copy_zlibheader = sed "s@<linux/\([^>]\+\).*@\"\1\"@" $< > $@ | ||
50 | # stddef.h for NULL | ||
51 | quiet_cmd_copy_zliblinuxheader = COPY $@ | ||
52 | cmd_copy_zliblinuxheader = sed "s@<linux/string.h>@\"string.h\"@;s@<linux/kernel.h>@<stddef.h>@;s@<linux/\([^>]\+\).*@\"\1\"@" $< > $@ | ||
53 | |||
54 | $(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/% | ||
55 | $(call cmd,copy_zlib) | ||
56 | |||
57 | $(addprefix $(obj)/,$(zlibheader)): $(obj)/%: $(srctree)/lib/zlib_inflate/% | ||
58 | $(call cmd,copy_zlibheader) | ||
59 | |||
60 | $(addprefix $(obj)/,$(zliblinuxheader)): $(obj)/%: $(srctree)/include/linux/% | ||
61 | $(call cmd,copy_zliblinuxheader) | ||
62 | |||
63 | clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) | ||
64 | |||
65 | |||
66 | quiet_cmd_bootcc = BOOTCC $@ | ||
67 | cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< | ||
68 | |||
69 | quiet_cmd_bootas = BOOTAS $@ | ||
70 | cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $< | ||
71 | |||
72 | quiet_cmd_bootld = BOOTLD $@ | ||
73 | cmd_bootld = $(CROSS32LD) $(BOOTLFLAGS) -o $@ $(2) | ||
74 | |||
75 | $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c | ||
76 | $(call if_changed_dep,bootcc) | ||
77 | $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S | ||
78 | $(call if_changed_dep,bootas) | ||
79 | |||
80 | #----------------------------------------------------------- | ||
81 | # ELF sections within the zImage bootloader/wrapper | ||
82 | #----------------------------------------------------------- | ||
83 | required := vmlinux.strip | ||
84 | initrd := initrd | ||
85 | |||
86 | obj-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.o, $(section))) | ||
87 | src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section))) | ||
88 | gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section))) | ||
89 | |||
90 | hostprogs-y := addnote addRamDisk | ||
91 | targets += zImage.vmode zImage.initrd.vmode zImage zImage.initrd \ | ||
92 | $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \ | ||
93 | $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \ | ||
94 | $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \ | ||
95 | vmlinux.initrd | ||
96 | extra-y := initrd.o | ||
97 | |||
98 | quiet_cmd_ramdisk = RAMDISK $@ | ||
99 | cmd_ramdisk = $(obj)/addRamDisk $(obj)/ramdisk.image.gz $< $@ | ||
100 | |||
101 | quiet_cmd_stripvm = STRIP $@ | ||
102 | cmd_stripvm = $(STRIP) -s -R .comment $< -o $@ | ||
103 | |||
104 | vmlinux.strip: vmlinux | ||
105 | $(call if_changed,stripvm) | ||
106 | $(obj)/vmlinux.initrd: vmlinux.strip $(obj)/addRamDisk $(obj)/ramdisk.image.gz | ||
107 | $(call if_changed,ramdisk) | ||
108 | |||
109 | quiet_cmd_addsection = ADDSEC $@ | ||
110 | cmd_addsection = $(CROSS32OBJCOPY) $@ \ | ||
111 | --add-section=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(patsubst %.o,%.gz, $@) \ | ||
112 | --set-section-flags=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(OBJCOPYFLAGS) | ||
113 | |||
114 | quiet_cmd_addnote = ADDNOTE $@ | ||
115 | cmd_addnote = $(obj)/addnote $@ | ||
116 | |||
117 | $(call gz-sec, $(required)): $(obj)/kernel-%.gz: % | ||
118 | $(call if_changed,gzip) | ||
119 | |||
120 | $(obj)/kernel-initrd.gz: $(obj)/ramdisk.image.gz | ||
121 | cp -f $(obj)/ramdisk.image.gz $@ | ||
122 | |||
123 | $(call src-sec, $(required) $(initrd)): $(obj)/kernel-%.c: $(obj)/kernel-%.gz | ||
124 | @touch $@ | ||
125 | |||
126 | $(call obj-sec, $(required) $(initrd)): $(obj)/kernel-%.o: $(obj)/kernel-%.c | ||
127 | $(call if_changed_dep,bootcc) | ||
128 | $(call cmd,addsection) | ||
129 | |||
130 | $(obj)/zImage.vmode: obj-boot += $(call obj-sec, $(required)) | ||
131 | $(obj)/zImage.vmode: $(call obj-sec, $(required)) $(obj-boot) $(srctree)/$(src)/zImage.lds | ||
132 | $(call cmd,bootld,$(obj-boot)) | ||
133 | |||
134 | $(obj)/zImage.initrd.vmode: obj-boot += $(call obj-sec, $(required) $(initrd)) | ||
135 | $(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(srctree)/$(src)/zImage.lds | ||
136 | $(call cmd,bootld,$(obj-boot)) | ||
137 | |||
138 | $(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote | ||
139 | @cp -f $< $@ | ||
140 | $(call if_changed,addnote) | ||
141 | |||
142 | $(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote | ||
143 | @cp -f $< $@ | ||
144 | $(call if_changed,addnote) | ||
145 | |||
146 | install: $(CONFIGURE) $(BOOTIMAGE) | ||
147 | sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)" | ||
148 | |||
149 | clean-files := $(addprefix $(objtree)/, $(obj-boot) vmlinux.strip) | ||
diff --git a/arch/powerpc/boot/README b/arch/powerpc/boot/README new file mode 100644 index 000000000000..3e11058760e4 --- /dev/null +++ b/arch/powerpc/boot/README | |||
@@ -0,0 +1,11 @@ | |||
1 | |||
2 | To extract the kernel vmlinux, System.map, .config or initrd from the zImage binary: | ||
3 | |||
4 | objcopy -j .kernel:vmlinux -O binary zImage vmlinux.gz | ||
5 | objcopy -j .kernel:System.map -O binary zImage System.map.gz | ||
6 | objcopy -j .kernel:.config -O binary zImage config.gz | ||
7 | objcopy -j .kernel:initrd -O binary zImage.initrd initrd.gz | ||
8 | |||
9 | |||
10 | Peter | ||
11 | |||
diff --git a/arch/powerpc/boot/addRamDisk.c b/arch/powerpc/boot/addRamDisk.c new file mode 100644 index 000000000000..c02a99952be7 --- /dev/null +++ b/arch/powerpc/boot/addRamDisk.c | |||
@@ -0,0 +1,311 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <netinet/in.h> | ||
4 | #include <unistd.h> | ||
5 | #include <sys/types.h> | ||
6 | #include <sys/stat.h> | ||
7 | #include <string.h> | ||
8 | #include <elf.h> | ||
9 | |||
10 | #define ElfHeaderSize (64 * 1024) | ||
11 | #define ElfPages (ElfHeaderSize / 4096) | ||
12 | #define KERNELBASE (0xc000000000000000) | ||
13 | #define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1))) | ||
14 | |||
15 | struct addr_range { | ||
16 | unsigned long long addr; | ||
17 | unsigned long memsize; | ||
18 | unsigned long offset; | ||
19 | }; | ||
20 | |||
21 | static int check_elf64(void *p, int size, struct addr_range *r) | ||
22 | { | ||
23 | Elf64_Ehdr *elf64 = p; | ||
24 | Elf64_Phdr *elf64ph; | ||
25 | |||
26 | if (elf64->e_ident[EI_MAG0] != ELFMAG0 || | ||
27 | elf64->e_ident[EI_MAG1] != ELFMAG1 || | ||
28 | elf64->e_ident[EI_MAG2] != ELFMAG2 || | ||
29 | elf64->e_ident[EI_MAG3] != ELFMAG3 || | ||
30 | elf64->e_ident[EI_CLASS] != ELFCLASS64 || | ||
31 | elf64->e_ident[EI_DATA] != ELFDATA2MSB || | ||
32 | elf64->e_type != ET_EXEC || elf64->e_machine != EM_PPC64) | ||
33 | return 0; | ||
34 | |||
35 | if ((elf64->e_phoff + sizeof(Elf64_Phdr)) > size) | ||
36 | return 0; | ||
37 | |||
38 | elf64ph = (Elf64_Phdr *) ((unsigned long)elf64 + | ||
39 | (unsigned long)elf64->e_phoff); | ||
40 | |||
41 | r->memsize = (unsigned long)elf64ph->p_memsz; | ||
42 | r->offset = (unsigned long)elf64ph->p_offset; | ||
43 | r->addr = (unsigned long long)elf64ph->p_vaddr; | ||
44 | |||
45 | #ifdef DEBUG | ||
46 | printf("PPC64 ELF file, ph:\n"); | ||
47 | printf("p_type 0x%08x\n", elf64ph->p_type); | ||
48 | printf("p_flags 0x%08x\n", elf64ph->p_flags); | ||
49 | printf("p_offset 0x%016llx\n", elf64ph->p_offset); | ||
50 | printf("p_vaddr 0x%016llx\n", elf64ph->p_vaddr); | ||
51 | printf("p_paddr 0x%016llx\n", elf64ph->p_paddr); | ||
52 | printf("p_filesz 0x%016llx\n", elf64ph->p_filesz); | ||
53 | printf("p_memsz 0x%016llx\n", elf64ph->p_memsz); | ||
54 | printf("p_align 0x%016llx\n", elf64ph->p_align); | ||
55 | printf("... skipping 0x%08lx bytes of ELF header\n", | ||
56 | (unsigned long)elf64ph->p_offset); | ||
57 | #endif | ||
58 | |||
59 | return 64; | ||
60 | } | ||
61 | void get4k(FILE *file, char *buf ) | ||
62 | { | ||
63 | unsigned j; | ||
64 | unsigned num = fread(buf, 1, 4096, file); | ||
65 | for ( j=num; j<4096; ++j ) | ||
66 | buf[j] = 0; | ||
67 | } | ||
68 | |||
69 | void put4k(FILE *file, char *buf ) | ||
70 | { | ||
71 | fwrite(buf, 1, 4096, file); | ||
72 | } | ||
73 | |||
74 | void death(const char *msg, FILE *fdesc, const char *fname) | ||
75 | { | ||
76 | fprintf(stderr, msg); | ||
77 | fclose(fdesc); | ||
78 | unlink(fname); | ||
79 | exit(1); | ||
80 | } | ||
81 | |||
82 | int main(int argc, char **argv) | ||
83 | { | ||
84 | char inbuf[4096]; | ||
85 | struct addr_range vmlinux; | ||
86 | FILE *ramDisk; | ||
87 | FILE *inputVmlinux; | ||
88 | FILE *outputVmlinux; | ||
89 | |||
90 | char *rd_name, *lx_name, *out_name; | ||
91 | |||
92 | size_t i; | ||
93 | unsigned long ramFileLen; | ||
94 | unsigned long ramLen; | ||
95 | unsigned long roundR; | ||
96 | unsigned long offset_end; | ||
97 | |||
98 | unsigned long kernelLen; | ||
99 | unsigned long actualKernelLen; | ||
100 | unsigned long round; | ||
101 | unsigned long roundedKernelLen; | ||
102 | unsigned long ramStartOffs; | ||
103 | unsigned long ramPages; | ||
104 | unsigned long roundedKernelPages; | ||
105 | unsigned long hvReleaseData; | ||
106 | u_int32_t eyeCatcher = 0xc8a5d9c4; | ||
107 | unsigned long naca; | ||
108 | unsigned long xRamDisk; | ||
109 | unsigned long xRamDiskSize; | ||
110 | long padPages; | ||
111 | |||
112 | |||
113 | if (argc < 2) { | ||
114 | fprintf(stderr, "Name of RAM disk file missing.\n"); | ||
115 | exit(1); | ||
116 | } | ||
117 | rd_name = argv[1]; | ||
118 | |||
119 | if (argc < 3) { | ||
120 | fprintf(stderr, "Name of vmlinux file missing.\n"); | ||
121 | exit(1); | ||
122 | } | ||
123 | lx_name = argv[2]; | ||
124 | |||
125 | if (argc < 4) { | ||
126 | fprintf(stderr, "Name of vmlinux output file missing.\n"); | ||
127 | exit(1); | ||
128 | } | ||
129 | out_name = argv[3]; | ||
130 | |||
131 | |||
132 | ramDisk = fopen(rd_name, "r"); | ||
133 | if ( ! ramDisk ) { | ||
134 | fprintf(stderr, "RAM disk file \"%s\" failed to open.\n", rd_name); | ||
135 | exit(1); | ||
136 | } | ||
137 | |||
138 | inputVmlinux = fopen(lx_name, "r"); | ||
139 | if ( ! inputVmlinux ) { | ||
140 | fprintf(stderr, "vmlinux file \"%s\" failed to open.\n", lx_name); | ||
141 | exit(1); | ||
142 | } | ||
143 | |||
144 | outputVmlinux = fopen(out_name, "w+"); | ||
145 | if ( ! outputVmlinux ) { | ||
146 | fprintf(stderr, "output vmlinux file \"%s\" failed to open.\n", out_name); | ||
147 | exit(1); | ||
148 | } | ||
149 | |||
150 | i = fread(inbuf, 1, sizeof(inbuf), inputVmlinux); | ||
151 | if (i != sizeof(inbuf)) { | ||
152 | fprintf(stderr, "can not read vmlinux file %s: %u\n", lx_name, i); | ||
153 | exit(1); | ||
154 | } | ||
155 | |||
156 | i = check_elf64(inbuf, sizeof(inbuf), &vmlinux); | ||
157 | if (i == 0) { | ||
158 | fprintf(stderr, "You must have a linux kernel specified as argv[2]\n"); | ||
159 | exit(1); | ||
160 | } | ||
161 | |||
162 | /* Input Vmlinux file */ | ||
163 | fseek(inputVmlinux, 0, SEEK_END); | ||
164 | kernelLen = ftell(inputVmlinux); | ||
165 | fseek(inputVmlinux, 0, SEEK_SET); | ||
166 | printf("kernel file size = %lu\n", kernelLen); | ||
167 | |||
168 | actualKernelLen = kernelLen - ElfHeaderSize; | ||
169 | |||
170 | printf("actual kernel length (minus ELF header) = %lu\n", actualKernelLen); | ||
171 | |||
172 | round = actualKernelLen % 4096; | ||
173 | roundedKernelLen = actualKernelLen; | ||
174 | if ( round ) | ||
175 | roundedKernelLen += (4096 - round); | ||
176 | printf("Vmlinux length rounded up to a 4k multiple = %ld/0x%lx \n", roundedKernelLen, roundedKernelLen); | ||
177 | roundedKernelPages = roundedKernelLen / 4096; | ||
178 | printf("Vmlinux pages to copy = %ld/0x%lx \n", roundedKernelPages, roundedKernelPages); | ||
179 | |||
180 | offset_end = _ALIGN_UP(vmlinux.memsize, 4096); | ||
181 | /* calc how many pages we need to insert between the vmlinux and the start of the ram disk */ | ||
182 | padPages = offset_end/4096 - roundedKernelPages; | ||
183 | |||
184 | /* Check and see if the vmlinux is already larger than _end in System.map */ | ||
185 | if (padPages < 0) { | ||
186 | /* vmlinux is larger than _end - adjust the offset to the start of the embedded ram disk */ | ||
187 | offset_end = roundedKernelLen; | ||
188 | printf("vmlinux is larger than _end indicates it needs to be - offset_end = %lx \n", offset_end); | ||
189 | padPages = 0; | ||
190 | printf("will insert %lx pages between the vmlinux and the start of the ram disk \n", padPages); | ||
191 | } | ||
192 | else { | ||
193 | /* _end is larger than vmlinux - use the offset to _end that we calculated from the system map */ | ||
194 | printf("vmlinux is smaller than _end indicates is needed - offset_end = %lx \n", offset_end); | ||
195 | printf("will insert %lx pages between the vmlinux and the start of the ram disk \n", padPages); | ||
196 | } | ||
197 | |||
198 | |||
199 | |||
200 | /* Input Ram Disk file */ | ||
201 | // Set the offset that the ram disk will be started at. | ||
202 | ramStartOffs = offset_end; /* determined from the input vmlinux file and the system map */ | ||
203 | printf("Ram Disk will start at offset = 0x%lx \n", ramStartOffs); | ||
204 | |||
205 | fseek(ramDisk, 0, SEEK_END); | ||
206 | ramFileLen = ftell(ramDisk); | ||
207 | fseek(ramDisk, 0, SEEK_SET); | ||
208 | printf("%s file size = %ld/0x%lx \n", rd_name, ramFileLen, ramFileLen); | ||
209 | |||
210 | ramLen = ramFileLen; | ||
211 | |||
212 | roundR = 4096 - (ramLen % 4096); | ||
213 | if ( roundR ) { | ||
214 | printf("Rounding RAM disk file up to a multiple of 4096, adding %ld/0x%lx \n", roundR, roundR); | ||
215 | ramLen += roundR; | ||
216 | } | ||
217 | |||
218 | printf("Rounded RAM disk size is %ld/0x%lx \n", ramLen, ramLen); | ||
219 | ramPages = ramLen / 4096; | ||
220 | printf("RAM disk pages to copy = %ld/0x%lx\n", ramPages, ramPages); | ||
221 | |||
222 | |||
223 | |||
224 | // Copy 64K ELF header | ||
225 | for (i=0; i<(ElfPages); ++i) { | ||
226 | get4k( inputVmlinux, inbuf ); | ||
227 | put4k( outputVmlinux, inbuf ); | ||
228 | } | ||
229 | |||
230 | /* Copy the vmlinux (as full pages). */ | ||
231 | fseek(inputVmlinux, ElfHeaderSize, SEEK_SET); | ||
232 | for ( i=0; i<roundedKernelPages; ++i ) { | ||
233 | get4k( inputVmlinux, inbuf ); | ||
234 | put4k( outputVmlinux, inbuf ); | ||
235 | } | ||
236 | |||
237 | /* Insert pad pages (if appropriate) that are needed between */ | ||
238 | /* | the end of the vmlinux and the ram disk. */ | ||
239 | for (i=0; i<padPages; ++i) { | ||
240 | memset(inbuf, 0, 4096); | ||
241 | put4k(outputVmlinux, inbuf); | ||
242 | } | ||
243 | |||
244 | /* Copy the ram disk (as full pages). */ | ||
245 | for ( i=0; i<ramPages; ++i ) { | ||
246 | get4k( ramDisk, inbuf ); | ||
247 | put4k( outputVmlinux, inbuf ); | ||
248 | } | ||
249 | |||
250 | /* Close the input files */ | ||
251 | fclose(ramDisk); | ||
252 | fclose(inputVmlinux); | ||
253 | /* And flush the written output file */ | ||
254 | fflush(outputVmlinux); | ||
255 | |||
256 | |||
257 | |||
258 | /* Fixup the new vmlinux to contain the ram disk starting offset (xRamDisk) and the ram disk size (xRamDiskSize) */ | ||
259 | /* fseek to the hvReleaseData pointer */ | ||
260 | fseek(outputVmlinux, ElfHeaderSize + 0x24, SEEK_SET); | ||
261 | if (fread(&hvReleaseData, 4, 1, outputVmlinux) != 1) { | ||
262 | death("Could not read hvReleaseData pointer\n", outputVmlinux, out_name); | ||
263 | } | ||
264 | hvReleaseData = ntohl(hvReleaseData); /* Convert to native int */ | ||
265 | printf("hvReleaseData is at %08lx\n", hvReleaseData); | ||
266 | |||
267 | /* fseek to the hvReleaseData */ | ||
268 | fseek(outputVmlinux, ElfHeaderSize + hvReleaseData, SEEK_SET); | ||
269 | if (fread(inbuf, 0x40, 1, outputVmlinux) != 1) { | ||
270 | death("Could not read hvReleaseData\n", outputVmlinux, out_name); | ||
271 | } | ||
272 | /* Check hvReleaseData sanity */ | ||
273 | if (memcmp(inbuf, &eyeCatcher, 4) != 0) { | ||
274 | death("hvReleaseData is invalid\n", outputVmlinux, out_name); | ||
275 | } | ||
276 | /* Get the naca pointer */ | ||
277 | naca = ntohl(*((u_int32_t*) &inbuf[0x0C])) - KERNELBASE; | ||
278 | printf("Naca is at offset 0x%lx \n", naca); | ||
279 | |||
280 | /* fseek to the naca */ | ||
281 | fseek(outputVmlinux, ElfHeaderSize + naca, SEEK_SET); | ||
282 | if (fread(inbuf, 0x18, 1, outputVmlinux) != 1) { | ||
283 | death("Could not read naca\n", outputVmlinux, out_name); | ||
284 | } | ||
285 | xRamDisk = ntohl(*((u_int32_t *) &inbuf[0x0c])); | ||
286 | xRamDiskSize = ntohl(*((u_int32_t *) &inbuf[0x14])); | ||
287 | /* Make sure a RAM disk isn't already present */ | ||
288 | if ((xRamDisk != 0) || (xRamDiskSize != 0)) { | ||
289 | death("RAM disk is already attached to this kernel\n", outputVmlinux, out_name); | ||
290 | } | ||
291 | /* Fill in the values */ | ||
292 | *((u_int32_t *) &inbuf[0x0c]) = htonl(ramStartOffs); | ||
293 | *((u_int32_t *) &inbuf[0x14]) = htonl(ramPages); | ||
294 | |||
295 | /* Write out the new naca */ | ||
296 | fflush(outputVmlinux); | ||
297 | fseek(outputVmlinux, ElfHeaderSize + naca, SEEK_SET); | ||
298 | if (fwrite(inbuf, 0x18, 1, outputVmlinux) != 1) { | ||
299 | death("Could not write naca\n", outputVmlinux, out_name); | ||
300 | } | ||
301 | printf("Ram Disk of 0x%lx pages is attached to the kernel at offset 0x%08lx\n", | ||
302 | ramPages, ramStartOffs); | ||
303 | |||
304 | /* Done */ | ||
305 | fclose(outputVmlinux); | ||
306 | /* Set permission to executable */ | ||
307 | chmod(out_name, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH); | ||
308 | |||
309 | return 0; | ||
310 | } | ||
311 | |||
diff --git a/arch/powerpc/boot/addnote.c b/arch/powerpc/boot/addnote.c new file mode 100644 index 000000000000..8041a9845ab7 --- /dev/null +++ b/arch/powerpc/boot/addnote.c | |||
@@ -0,0 +1,205 @@ | |||
1 | /* | ||
2 | * Program to hack in a PT_NOTE program header entry in an ELF file. | ||
3 | * This is needed for OF on RS/6000s to load an image correctly. | ||
4 | * Note that OF needs a program header entry for the note, not an | ||
5 | * ELF section. | ||
6 | * | ||
7 | * Copyright 2000 Paul Mackerras. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | * | ||
14 | * Usage: addnote zImage | ||
15 | */ | ||
16 | #include <stdio.h> | ||
17 | #include <stdlib.h> | ||
18 | #include <fcntl.h> | ||
19 | #include <unistd.h> | ||
20 | #include <string.h> | ||
21 | |||
22 | /* CHRP note section */ | ||
23 | char arch[] = "PowerPC"; | ||
24 | |||
25 | #define N_DESCR 6 | ||
26 | unsigned int descr[N_DESCR] = { | ||
27 | 0xffffffff, /* real-mode = true */ | ||
28 | 0x00c00000, /* real-base, i.e. where we expect OF to be */ | ||
29 | 0xffffffff, /* real-size */ | ||
30 | 0xffffffff, /* virt-base */ | ||
31 | 0xffffffff, /* virt-size */ | ||
32 | 0x4000, /* load-base */ | ||
33 | }; | ||
34 | |||
35 | /* RPA note section */ | ||
36 | char rpaname[] = "IBM,RPA-Client-Config"; | ||
37 | |||
38 | /* | ||
39 | * Note: setting ignore_my_client_config *should* mean that OF ignores | ||
40 | * all the other fields, but there is a firmware bug which means that | ||
41 | * it looks at the splpar field at least. So these values need to be | ||
42 | * reasonable. | ||
43 | */ | ||
44 | #define N_RPA_DESCR 8 | ||
45 | unsigned int rpanote[N_RPA_DESCR] = { | ||
46 | 0, /* lparaffinity */ | ||
47 | 64, /* min_rmo_size */ | ||
48 | 0, /* min_rmo_percent */ | ||
49 | 40, /* max_pft_size */ | ||
50 | 1, /* splpar */ | ||
51 | -1, /* min_load */ | ||
52 | 0, /* new_mem_def */ | ||
53 | 1, /* ignore_my_client_config */ | ||
54 | }; | ||
55 | |||
56 | #define ROUNDUP(len) (((len) + 3) & ~3) | ||
57 | |||
58 | unsigned char buf[512]; | ||
59 | |||
60 | #define GET_16BE(off) ((buf[off] << 8) + (buf[(off)+1])) | ||
61 | #define GET_32BE(off) ((GET_16BE(off) << 16) + GET_16BE((off)+2)) | ||
62 | |||
63 | #define PUT_16BE(off, v) (buf[off] = ((v) >> 8) & 0xff, \ | ||
64 | buf[(off) + 1] = (v) & 0xff) | ||
65 | #define PUT_32BE(off, v) (PUT_16BE((off), (v) >> 16), \ | ||
66 | PUT_16BE((off) + 2, (v))) | ||
67 | |||
68 | /* Structure of an ELF file */ | ||
69 | #define E_IDENT 0 /* ELF header */ | ||
70 | #define E_PHOFF 28 | ||
71 | #define E_PHENTSIZE 42 | ||
72 | #define E_PHNUM 44 | ||
73 | #define E_HSIZE 52 /* size of ELF header */ | ||
74 | |||
75 | #define EI_MAGIC 0 /* offsets in E_IDENT area */ | ||
76 | #define EI_CLASS 4 | ||
77 | #define EI_DATA 5 | ||
78 | |||
79 | #define PH_TYPE 0 /* ELF program header */ | ||
80 | #define PH_OFFSET 4 | ||
81 | #define PH_FILESZ 16 | ||
82 | #define PH_HSIZE 32 /* size of program header */ | ||
83 | |||
84 | #define PT_NOTE 4 /* Program header type = note */ | ||
85 | |||
86 | #define ELFCLASS32 1 | ||
87 | #define ELFDATA2MSB 2 | ||
88 | |||
89 | unsigned char elf_magic[4] = { 0x7f, 'E', 'L', 'F' }; | ||
90 | |||
91 | int | ||
92 | main(int ac, char **av) | ||
93 | { | ||
94 | int fd, n, i; | ||
95 | int ph, ps, np; | ||
96 | int nnote, nnote2, ns; | ||
97 | |||
98 | if (ac != 2) { | ||
99 | fprintf(stderr, "Usage: %s elf-file\n", av[0]); | ||
100 | exit(1); | ||
101 | } | ||
102 | fd = open(av[1], O_RDWR); | ||
103 | if (fd < 0) { | ||
104 | perror(av[1]); | ||
105 | exit(1); | ||
106 | } | ||
107 | |||
108 | nnote = 12 + ROUNDUP(strlen(arch) + 1) + sizeof(descr); | ||
109 | nnote2 = 12 + ROUNDUP(strlen(rpaname) + 1) + sizeof(rpanote); | ||
110 | |||
111 | n = read(fd, buf, sizeof(buf)); | ||
112 | if (n < 0) { | ||
113 | perror("read"); | ||
114 | exit(1); | ||
115 | } | ||
116 | |||
117 | if (n < E_HSIZE || memcmp(&buf[E_IDENT+EI_MAGIC], elf_magic, 4) != 0) | ||
118 | goto notelf; | ||
119 | |||
120 | if (buf[E_IDENT+EI_CLASS] != ELFCLASS32 | ||
121 | || buf[E_IDENT+EI_DATA] != ELFDATA2MSB) { | ||
122 | fprintf(stderr, "%s is not a big-endian 32-bit ELF image\n", | ||
123 | av[1]); | ||
124 | exit(1); | ||
125 | } | ||
126 | |||
127 | ph = GET_32BE(E_PHOFF); | ||
128 | ps = GET_16BE(E_PHENTSIZE); | ||
129 | np = GET_16BE(E_PHNUM); | ||
130 | if (ph < E_HSIZE || ps < PH_HSIZE || np < 1) | ||
131 | goto notelf; | ||
132 | if (ph + (np + 2) * ps + nnote + nnote2 > n) | ||
133 | goto nospace; | ||
134 | |||
135 | for (i = 0; i < np; ++i) { | ||
136 | if (GET_32BE(ph + PH_TYPE) == PT_NOTE) { | ||
137 | fprintf(stderr, "%s already has a note entry\n", | ||
138 | av[1]); | ||
139 | exit(0); | ||
140 | } | ||
141 | ph += ps; | ||
142 | } | ||
143 | |||
144 | /* XXX check that the area we want to use is all zeroes */ | ||
145 | for (i = 0; i < 2 * ps + nnote + nnote2; ++i) | ||
146 | if (buf[ph + i] != 0) | ||
147 | goto nospace; | ||
148 | |||
149 | /* fill in the program header entry */ | ||
150 | ns = ph + 2 * ps; | ||
151 | PUT_32BE(ph + PH_TYPE, PT_NOTE); | ||
152 | PUT_32BE(ph + PH_OFFSET, ns); | ||
153 | PUT_32BE(ph + PH_FILESZ, nnote); | ||
154 | |||
155 | /* fill in the note area we point to */ | ||
156 | /* XXX we should probably make this a proper section */ | ||
157 | PUT_32BE(ns, strlen(arch) + 1); | ||
158 | PUT_32BE(ns + 4, N_DESCR * 4); | ||
159 | PUT_32BE(ns + 8, 0x1275); | ||
160 | strcpy((char *) &buf[ns + 12], arch); | ||
161 | ns += 12 + strlen(arch) + 1; | ||
162 | for (i = 0; i < N_DESCR; ++i, ns += 4) | ||
163 | PUT_32BE(ns, descr[i]); | ||
164 | |||
165 | /* fill in the second program header entry and the RPA note area */ | ||
166 | ph += ps; | ||
167 | PUT_32BE(ph + PH_TYPE, PT_NOTE); | ||
168 | PUT_32BE(ph + PH_OFFSET, ns); | ||
169 | PUT_32BE(ph + PH_FILESZ, nnote2); | ||
170 | |||
171 | /* fill in the note area we point to */ | ||
172 | PUT_32BE(ns, strlen(rpaname) + 1); | ||
173 | PUT_32BE(ns + 4, sizeof(rpanote)); | ||
174 | PUT_32BE(ns + 8, 0x12759999); | ||
175 | strcpy((char *) &buf[ns + 12], rpaname); | ||
176 | ns += 12 + ROUNDUP(strlen(rpaname) + 1); | ||
177 | for (i = 0; i < N_RPA_DESCR; ++i, ns += 4) | ||
178 | PUT_32BE(ns, rpanote[i]); | ||
179 | |||
180 | /* Update the number of program headers */ | ||
181 | PUT_16BE(E_PHNUM, np + 2); | ||
182 | |||
183 | /* write back */ | ||
184 | lseek(fd, (long) 0, SEEK_SET); | ||
185 | i = write(fd, buf, n); | ||
186 | if (i < 0) { | ||
187 | perror("write"); | ||
188 | exit(1); | ||
189 | } | ||
190 | if (i < n) { | ||
191 | fprintf(stderr, "%s: write truncated\n", av[1]); | ||
192 | exit(1); | ||
193 | } | ||
194 | |||
195 | exit(0); | ||
196 | |||
197 | notelf: | ||
198 | fprintf(stderr, "%s does not appear to be an ELF file\n", av[1]); | ||
199 | exit(1); | ||
200 | |||
201 | nospace: | ||
202 | fprintf(stderr, "sorry, I can't find space in %s to put the note\n", | ||
203 | av[1]); | ||
204 | exit(1); | ||
205 | } | ||
diff --git a/arch/powerpc/boot/crt0.S b/arch/powerpc/boot/crt0.S new file mode 100644 index 000000000000..9cc442263939 --- /dev/null +++ b/arch/powerpc/boot/crt0.S | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (C) Paul Mackerras 1997. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | * | ||
9 | * NOTE: this code runs in 32 bit mode and is packaged as ELF32. | ||
10 | */ | ||
11 | |||
12 | #include "ppc_asm.h" | ||
13 | |||
14 | .text | ||
15 | .globl _zimage_start | ||
16 | _zimage_start: | ||
17 | bl reloc_offset | ||
18 | |||
19 | reloc_offset: | ||
20 | mflr r0 | ||
21 | lis r9,reloc_offset@ha | ||
22 | addi r9,r9,reloc_offset@l | ||
23 | subf. r0,r9,r0 | ||
24 | beq clear_caches | ||
25 | |||
26 | reloc_got2: | ||
27 | lis r9,__got2_start@ha | ||
28 | addi r9,r9,__got2_start@l | ||
29 | lis r8,__got2_end@ha | ||
30 | addi r8,r8,__got2_end@l | ||
31 | subf. r8,r9,r8 | ||
32 | beq clear_caches | ||
33 | srwi. r8,r8,2 | ||
34 | mtctr r8 | ||
35 | add r9,r0,r9 | ||
36 | reloc_got2_loop: | ||
37 | lwz r8,0(r9) | ||
38 | add r8,r8,r0 | ||
39 | stw r8,0(r9) | ||
40 | addi r9,r9,4 | ||
41 | bdnz reloc_got2_loop | ||
42 | |||
43 | clear_caches: | ||
44 | lis r9,_start@h | ||
45 | add r9,r0,r9 | ||
46 | lis r8,_etext@ha | ||
47 | addi r8,r8,_etext@l | ||
48 | add r8,r0,r8 | ||
49 | 1: dcbf r0,r9 | ||
50 | icbi r0,r9 | ||
51 | addi r9,r9,0x20 | ||
52 | cmplwi 0,r9,8 | ||
53 | blt 1b | ||
54 | sync | ||
55 | isync | ||
56 | |||
57 | mr r6,r1 | ||
58 | b start | ||
59 | |||
diff --git a/arch/powerpc/boot/div64.S b/arch/powerpc/boot/div64.S new file mode 100644 index 000000000000..722f360a32a9 --- /dev/null +++ b/arch/powerpc/boot/div64.S | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * Divide a 64-bit unsigned number by a 32-bit unsigned number. | ||
3 | * This routine assumes that the top 32 bits of the dividend are | ||
4 | * non-zero to start with. | ||
5 | * On entry, r3 points to the dividend, which get overwritten with | ||
6 | * the 64-bit quotient, and r4 contains the divisor. | ||
7 | * On exit, r3 contains the remainder. | ||
8 | * | ||
9 | * Copyright (C) 2002 Paul Mackerras, IBM Corp. | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License | ||
13 | * as published by the Free Software Foundation; either version | ||
14 | * 2 of the License, or (at your option) any later version. | ||
15 | */ | ||
16 | #include "ppc_asm.h" | ||
17 | |||
18 | .globl __div64_32 | ||
19 | __div64_32: | ||
20 | lwz r5,0(r3) # get the dividend into r5/r6 | ||
21 | lwz r6,4(r3) | ||
22 | cmplw r5,r4 | ||
23 | li r7,0 | ||
24 | li r8,0 | ||
25 | blt 1f | ||
26 | divwu r7,r5,r4 # if dividend.hi >= divisor, | ||
27 | mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor | ||
28 | subf. r5,r0,r5 # dividend.hi %= divisor | ||
29 | beq 3f | ||
30 | 1: mr r11,r5 # here dividend.hi != 0 | ||
31 | andis. r0,r5,0xc000 | ||
32 | bne 2f | ||
33 | cntlzw r0,r5 # we are shifting the dividend right | ||
34 | li r10,-1 # to make it < 2^32, and shifting | ||
35 | srw r10,r10,r0 # the divisor right the same amount, | ||
36 | add r9,r4,r10 # rounding up (so the estimate cannot | ||
37 | andc r11,r6,r10 # ever be too large, only too small) | ||
38 | andc r9,r9,r10 | ||
39 | or r11,r5,r11 | ||
40 | rotlw r9,r9,r0 | ||
41 | rotlw r11,r11,r0 | ||
42 | divwu r11,r11,r9 # then we divide the shifted quantities | ||
43 | 2: mullw r10,r11,r4 # to get an estimate of the quotient, | ||
44 | mulhwu r9,r11,r4 # multiply the estimate by the divisor, | ||
45 | subfc r6,r10,r6 # take the product from the divisor, | ||
46 | add r8,r8,r11 # and add the estimate to the accumulated | ||
47 | subfe. r5,r9,r5 # quotient | ||
48 | bne 1b | ||
49 | 3: cmplw r6,r4 | ||
50 | blt 4f | ||
51 | divwu r0,r6,r4 # perform the remaining 32-bit division | ||
52 | mullw r10,r0,r4 # and get the remainder | ||
53 | add r8,r8,r0 | ||
54 | subf r6,r10,r6 | ||
55 | 4: stw r7,0(r3) # return the quotient in *r3 | ||
56 | stw r8,4(r3) | ||
57 | mr r3,r6 # return the remainder in r3 | ||
58 | blr | ||
diff --git a/arch/powerpc/boot/elf.h b/arch/powerpc/boot/elf.h new file mode 100644 index 000000000000..d4828fcf1cb9 --- /dev/null +++ b/arch/powerpc/boot/elf.h | |||
@@ -0,0 +1,149 @@ | |||
1 | #ifndef _PPC_BOOT_ELF_H_ | ||
2 | #define _PPC_BOOT_ELF_H_ | ||
3 | |||
4 | /* 32-bit ELF base types. */ | ||
5 | typedef unsigned int Elf32_Addr; | ||
6 | typedef unsigned short Elf32_Half; | ||
7 | typedef unsigned int Elf32_Off; | ||
8 | typedef signed int Elf32_Sword; | ||
9 | typedef unsigned int Elf32_Word; | ||
10 | |||
11 | /* 64-bit ELF base types. */ | ||
12 | typedef unsigned long long Elf64_Addr; | ||
13 | typedef unsigned short Elf64_Half; | ||
14 | typedef signed short Elf64_SHalf; | ||
15 | typedef unsigned long long Elf64_Off; | ||
16 | typedef signed int Elf64_Sword; | ||
17 | typedef unsigned int Elf64_Word; | ||
18 | typedef unsigned long long Elf64_Xword; | ||
19 | typedef signed long long Elf64_Sxword; | ||
20 | |||
21 | /* These constants are for the segment types stored in the image headers */ | ||
22 | #define PT_NULL 0 | ||
23 | #define PT_LOAD 1 | ||
24 | #define PT_DYNAMIC 2 | ||
25 | #define PT_INTERP 3 | ||
26 | #define PT_NOTE 4 | ||
27 | #define PT_SHLIB 5 | ||
28 | #define PT_PHDR 6 | ||
29 | #define PT_TLS 7 /* Thread local storage segment */ | ||
30 | #define PT_LOOS 0x60000000 /* OS-specific */ | ||
31 | #define PT_HIOS 0x6fffffff /* OS-specific */ | ||
32 | #define PT_LOPROC 0x70000000 | ||
33 | #define PT_HIPROC 0x7fffffff | ||
34 | #define PT_GNU_EH_FRAME 0x6474e550 | ||
35 | |||
36 | #define PT_GNU_STACK (PT_LOOS + 0x474e551) | ||
37 | |||
38 | /* These constants define the different elf file types */ | ||
39 | #define ET_NONE 0 | ||
40 | #define ET_REL 1 | ||
41 | #define ET_EXEC 2 | ||
42 | #define ET_DYN 3 | ||
43 | #define ET_CORE 4 | ||
44 | #define ET_LOPROC 0xff00 | ||
45 | #define ET_HIPROC 0xffff | ||
46 | |||
47 | /* These constants define the various ELF target machines */ | ||
48 | #define EM_NONE 0 | ||
49 | #define EM_PPC 20 /* PowerPC */ | ||
50 | #define EM_PPC64 21 /* PowerPC64 */ | ||
51 | |||
52 | #define EI_NIDENT 16 | ||
53 | |||
54 | typedef struct elf32_hdr { | ||
55 | unsigned char e_ident[EI_NIDENT]; | ||
56 | Elf32_Half e_type; | ||
57 | Elf32_Half e_machine; | ||
58 | Elf32_Word e_version; | ||
59 | Elf32_Addr e_entry; /* Entry point */ | ||
60 | Elf32_Off e_phoff; | ||
61 | Elf32_Off e_shoff; | ||
62 | Elf32_Word e_flags; | ||
63 | Elf32_Half e_ehsize; | ||
64 | Elf32_Half e_phentsize; | ||
65 | Elf32_Half e_phnum; | ||
66 | Elf32_Half e_shentsize; | ||
67 | Elf32_Half e_shnum; | ||
68 | Elf32_Half e_shstrndx; | ||
69 | } Elf32_Ehdr; | ||
70 | |||
71 | typedef struct elf64_hdr { | ||
72 | unsigned char e_ident[16]; /* ELF "magic number" */ | ||
73 | Elf64_Half e_type; | ||
74 | Elf64_Half e_machine; | ||
75 | Elf64_Word e_version; | ||
76 | Elf64_Addr e_entry; /* Entry point virtual address */ | ||
77 | Elf64_Off e_phoff; /* Program header table file offset */ | ||
78 | Elf64_Off e_shoff; /* Section header table file offset */ | ||
79 | Elf64_Word e_flags; | ||
80 | Elf64_Half e_ehsize; | ||
81 | Elf64_Half e_phentsize; | ||
82 | Elf64_Half e_phnum; | ||
83 | Elf64_Half e_shentsize; | ||
84 | Elf64_Half e_shnum; | ||
85 | Elf64_Half e_shstrndx; | ||
86 | } Elf64_Ehdr; | ||
87 | |||
88 | /* These constants define the permissions on sections in the program | ||
89 | header, p_flags. */ | ||
90 | #define PF_R 0x4 | ||
91 | #define PF_W 0x2 | ||
92 | #define PF_X 0x1 | ||
93 | |||
94 | typedef struct elf32_phdr { | ||
95 | Elf32_Word p_type; | ||
96 | Elf32_Off p_offset; | ||
97 | Elf32_Addr p_vaddr; | ||
98 | Elf32_Addr p_paddr; | ||
99 | Elf32_Word p_filesz; | ||
100 | Elf32_Word p_memsz; | ||
101 | Elf32_Word p_flags; | ||
102 | Elf32_Word p_align; | ||
103 | } Elf32_Phdr; | ||
104 | |||
105 | typedef struct elf64_phdr { | ||
106 | Elf64_Word p_type; | ||
107 | Elf64_Word p_flags; | ||
108 | Elf64_Off p_offset; /* Segment file offset */ | ||
109 | Elf64_Addr p_vaddr; /* Segment virtual address */ | ||
110 | Elf64_Addr p_paddr; /* Segment physical address */ | ||
111 | Elf64_Xword p_filesz; /* Segment size in file */ | ||
112 | Elf64_Xword p_memsz; /* Segment size in memory */ | ||
113 | Elf64_Xword p_align; /* Segment alignment, file & memory */ | ||
114 | } Elf64_Phdr; | ||
115 | |||
116 | #define EI_MAG0 0 /* e_ident[] indexes */ | ||
117 | #define EI_MAG1 1 | ||
118 | #define EI_MAG2 2 | ||
119 | #define EI_MAG3 3 | ||
120 | #define EI_CLASS 4 | ||
121 | #define EI_DATA 5 | ||
122 | #define EI_VERSION 6 | ||
123 | #define EI_OSABI 7 | ||
124 | #define EI_PAD 8 | ||
125 | |||
126 | #define ELFMAG0 0x7f /* EI_MAG */ | ||
127 | #define ELFMAG1 'E' | ||
128 | #define ELFMAG2 'L' | ||
129 | #define ELFMAG3 'F' | ||
130 | #define ELFMAG "\177ELF" | ||
131 | #define SELFMAG 4 | ||
132 | |||
133 | #define ELFCLASSNONE 0 /* EI_CLASS */ | ||
134 | #define ELFCLASS32 1 | ||
135 | #define ELFCLASS64 2 | ||
136 | #define ELFCLASSNUM 3 | ||
137 | |||
138 | #define ELFDATANONE 0 /* e_ident[EI_DATA] */ | ||
139 | #define ELFDATA2LSB 1 | ||
140 | #define ELFDATA2MSB 2 | ||
141 | |||
142 | #define EV_NONE 0 /* e_version, EI_VERSION */ | ||
143 | #define EV_CURRENT 1 | ||
144 | #define EV_NUM 2 | ||
145 | |||
146 | #define ELFOSABI_NONE 0 | ||
147 | #define ELFOSABI_LINUX 3 | ||
148 | |||
149 | #endif /* _PPC_BOOT_ELF_H_ */ | ||
diff --git a/arch/powerpc/boot/install.sh b/arch/powerpc/boot/install.sh new file mode 100644 index 000000000000..eacce9590816 --- /dev/null +++ b/arch/powerpc/boot/install.sh | |||
@@ -0,0 +1,42 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # arch/ppc64/boot/install.sh | ||
4 | # | ||
5 | # This file is subject to the terms and conditions of the GNU General Public | ||
6 | # License. See the file "COPYING" in the main directory of this archive | ||
7 | # for more details. | ||
8 | # | ||
9 | # Copyright (C) 1995 by Linus Torvalds | ||
10 | # | ||
11 | # Blatantly stolen from in arch/i386/boot/install.sh by Dave Hansen | ||
12 | # | ||
13 | # "make install" script for ppc64 architecture | ||
14 | # | ||
15 | # Arguments: | ||
16 | # $1 - kernel version | ||
17 | # $2 - kernel image file | ||
18 | # $3 - kernel map file | ||
19 | # $4 - default install path (blank if root directory) | ||
20 | # $5 - kernel boot file, the zImage | ||
21 | # | ||
22 | |||
23 | # User may have a custom install script | ||
24 | |||
25 | if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi | ||
26 | if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi | ||
27 | |||
28 | # Default install | ||
29 | |||
30 | # this should work for both the pSeries zImage and the iSeries vmlinux.sm | ||
31 | image_name=`basename $2` | ||
32 | |||
33 | if [ -f $4/$image_name ]; then | ||
34 | mv $4/$image_name $4/$image_name.old | ||
35 | fi | ||
36 | |||
37 | if [ -f $4/System.map ]; then | ||
38 | mv $4/System.map $4/System.old | ||
39 | fi | ||
40 | |||
41 | cat $2 > $4/$image_name | ||
42 | cp $3 $4/System.map | ||
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c new file mode 100644 index 000000000000..64ec93116fa6 --- /dev/null +++ b/arch/powerpc/boot/main.c | |||
@@ -0,0 +1,321 @@ | |||
1 | /* | ||
2 | * Copyright (C) Paul Mackerras 1997. | ||
3 | * | ||
4 | * Updates for PPC64 by Todd Inglett, Dave Engebretsen & Peter Bergner. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | #include <stdarg.h> | ||
12 | #include <stddef.h> | ||
13 | #include "elf.h" | ||
14 | #include "page.h" | ||
15 | #include "string.h" | ||
16 | #include "stdio.h" | ||
17 | #include "prom.h" | ||
18 | #include "zlib.h" | ||
19 | |||
20 | extern void flush_cache(void *, unsigned long); | ||
21 | |||
22 | |||
23 | /* Value picked to match that used by yaboot */ | ||
24 | #define PROG_START 0x01400000 | ||
25 | #define RAM_END (512<<20) // Fixme: use OF */ | ||
26 | #define ONE_MB 0x100000 | ||
27 | |||
28 | extern char _start[]; | ||
29 | extern char __bss_start[]; | ||
30 | extern char _end[]; | ||
31 | extern char _vmlinux_start[]; | ||
32 | extern char _vmlinux_end[]; | ||
33 | extern char _initrd_start[]; | ||
34 | extern char _initrd_end[]; | ||
35 | |||
36 | struct addr_range { | ||
37 | unsigned long addr; | ||
38 | unsigned long size; | ||
39 | unsigned long memsize; | ||
40 | }; | ||
41 | static struct addr_range vmlinux; | ||
42 | static struct addr_range vmlinuz; | ||
43 | static struct addr_range initrd; | ||
44 | |||
45 | static unsigned long elfoffset; | ||
46 | |||
47 | static char scratch[46912]; /* scratch space for gunzip, from zlib_inflate_workspacesize() */ | ||
48 | static char elfheader[256]; | ||
49 | |||
50 | |||
51 | typedef void (*kernel_entry_t)( unsigned long, | ||
52 | unsigned long, | ||
53 | void *, | ||
54 | void *); | ||
55 | |||
56 | |||
57 | #undef DEBUG | ||
58 | |||
59 | static unsigned long claim_base; | ||
60 | |||
61 | #define HEAD_CRC 2 | ||
62 | #define EXTRA_FIELD 4 | ||
63 | #define ORIG_NAME 8 | ||
64 | #define COMMENT 0x10 | ||
65 | #define RESERVED 0xe0 | ||
66 | |||
67 | static void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp) | ||
68 | { | ||
69 | z_stream s; | ||
70 | int r, i, flags; | ||
71 | |||
72 | /* skip header */ | ||
73 | i = 10; | ||
74 | flags = src[3]; | ||
75 | if (src[2] != Z_DEFLATED || (flags & RESERVED) != 0) { | ||
76 | printf("bad gzipped data\n\r"); | ||
77 | exit(); | ||
78 | } | ||
79 | if ((flags & EXTRA_FIELD) != 0) | ||
80 | i = 12 + src[10] + (src[11] << 8); | ||
81 | if ((flags & ORIG_NAME) != 0) | ||
82 | while (src[i++] != 0) | ||
83 | ; | ||
84 | if ((flags & COMMENT) != 0) | ||
85 | while (src[i++] != 0) | ||
86 | ; | ||
87 | if ((flags & HEAD_CRC) != 0) | ||
88 | i += 2; | ||
89 | if (i >= *lenp) { | ||
90 | printf("gunzip: ran out of data in header\n\r"); | ||
91 | exit(); | ||
92 | } | ||
93 | |||
94 | if (zlib_inflate_workspacesize() > sizeof(scratch)) { | ||
95 | printf("gunzip needs more mem\n"); | ||
96 | exit(); | ||
97 | } | ||
98 | memset(&s, 0, sizeof(s)); | ||
99 | s.workspace = scratch; | ||
100 | r = zlib_inflateInit2(&s, -MAX_WBITS); | ||
101 | if (r != Z_OK) { | ||
102 | printf("inflateInit2 returned %d\n\r", r); | ||
103 | exit(); | ||
104 | } | ||
105 | s.next_in = src + i; | ||
106 | s.avail_in = *lenp - i; | ||
107 | s.next_out = dst; | ||
108 | s.avail_out = dstlen; | ||
109 | r = zlib_inflate(&s, Z_FULL_FLUSH); | ||
110 | if (r != Z_OK && r != Z_STREAM_END) { | ||
111 | printf("inflate returned %d msg: %s\n\r", r, s.msg); | ||
112 | exit(); | ||
113 | } | ||
114 | *lenp = s.next_out - (unsigned char *) dst; | ||
115 | zlib_inflateEnd(&s); | ||
116 | } | ||
117 | |||
118 | static unsigned long try_claim(unsigned long size) | ||
119 | { | ||
120 | unsigned long addr = 0; | ||
121 | |||
122 | for(; claim_base < RAM_END; claim_base += ONE_MB) { | ||
123 | #ifdef DEBUG | ||
124 | printf(" trying: 0x%08lx\n\r", claim_base); | ||
125 | #endif | ||
126 | addr = (unsigned long)claim(claim_base, size, 0); | ||
127 | if ((void *)addr != (void *)-1) | ||
128 | break; | ||
129 | } | ||
130 | if (addr == 0) | ||
131 | return 0; | ||
132 | claim_base = PAGE_ALIGN(claim_base + size); | ||
133 | return addr; | ||
134 | } | ||
135 | |||
136 | static int is_elf64(void *hdr) | ||
137 | { | ||
138 | Elf64_Ehdr *elf64 = hdr; | ||
139 | Elf64_Phdr *elf64ph; | ||
140 | unsigned int i; | ||
141 | |||
142 | if (!(elf64->e_ident[EI_MAG0] == ELFMAG0 && | ||
143 | elf64->e_ident[EI_MAG1] == ELFMAG1 && | ||
144 | elf64->e_ident[EI_MAG2] == ELFMAG2 && | ||
145 | elf64->e_ident[EI_MAG3] == ELFMAG3 && | ||
146 | elf64->e_ident[EI_CLASS] == ELFCLASS64 && | ||
147 | elf64->e_ident[EI_DATA] == ELFDATA2MSB && | ||
148 | elf64->e_type == ET_EXEC && | ||
149 | elf64->e_machine == EM_PPC64)) | ||
150 | return 0; | ||
151 | |||
152 | elf64ph = (Elf64_Phdr *)((unsigned long)elf64 + | ||
153 | (unsigned long)elf64->e_phoff); | ||
154 | for (i = 0; i < (unsigned int)elf64->e_phnum; i++, elf64ph++) | ||
155 | if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0) | ||
156 | break; | ||
157 | if (i >= (unsigned int)elf64->e_phnum) | ||
158 | return 0; | ||
159 | |||
160 | elfoffset = (unsigned long)elf64ph->p_offset; | ||
161 | vmlinux.size = (unsigned long)elf64ph->p_filesz + elfoffset; | ||
162 | vmlinux.memsize = (unsigned long)elf64ph->p_memsz + elfoffset; | ||
163 | return 1; | ||
164 | } | ||
165 | |||
166 | static int is_elf32(void *hdr) | ||
167 | { | ||
168 | Elf32_Ehdr *elf32 = hdr; | ||
169 | Elf32_Phdr *elf32ph; | ||
170 | unsigned int i; | ||
171 | |||
172 | if (!(elf32->e_ident[EI_MAG0] == ELFMAG0 && | ||
173 | elf32->e_ident[EI_MAG1] == ELFMAG1 && | ||
174 | elf32->e_ident[EI_MAG2] == ELFMAG2 && | ||
175 | elf32->e_ident[EI_MAG3] == ELFMAG3 && | ||
176 | elf32->e_ident[EI_CLASS] == ELFCLASS32 && | ||
177 | elf32->e_ident[EI_DATA] == ELFDATA2MSB && | ||
178 | elf32->e_type == ET_EXEC && | ||
179 | elf32->e_machine == EM_PPC)) | ||
180 | return 0; | ||
181 | |||
182 | elf32 = (Elf32_Ehdr *)elfheader; | ||
183 | elf32ph = (Elf32_Phdr *) ((unsigned long)elf32 + elf32->e_phoff); | ||
184 | for (i = 0; i < elf32->e_phnum; i++, elf32ph++) | ||
185 | if (elf32ph->p_type == PT_LOAD && elf32ph->p_offset != 0) | ||
186 | break; | ||
187 | if (i >= elf32->e_phnum) | ||
188 | return 0; | ||
189 | |||
190 | elfoffset = elf32ph->p_offset; | ||
191 | vmlinux.size = elf32ph->p_filesz + elf32ph->p_offset; | ||
192 | vmlinux.memsize = elf32ph->p_memsz + elf32ph->p_offset; | ||
193 | return 1; | ||
194 | } | ||
195 | |||
196 | void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) | ||
197 | { | ||
198 | int len; | ||
199 | kernel_entry_t kernel_entry; | ||
200 | |||
201 | memset(__bss_start, 0, _end - __bss_start); | ||
202 | |||
203 | prom = (int (*)(void *)) promptr; | ||
204 | chosen_handle = finddevice("/chosen"); | ||
205 | if (chosen_handle == (void *) -1) | ||
206 | exit(); | ||
207 | if (getprop(chosen_handle, "stdout", &stdout, sizeof(stdout)) != 4) | ||
208 | exit(); | ||
209 | stderr = stdout; | ||
210 | if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4) | ||
211 | exit(); | ||
212 | |||
213 | printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", _start, sp); | ||
214 | |||
215 | vmlinuz.addr = (unsigned long)_vmlinux_start; | ||
216 | vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start); | ||
217 | |||
218 | /* gunzip the ELF header of the kernel */ | ||
219 | if (*(unsigned short *)vmlinuz.addr == 0x1f8b) { | ||
220 | len = vmlinuz.size; | ||
221 | gunzip(elfheader, sizeof(elfheader), | ||
222 | (unsigned char *)vmlinuz.addr, &len); | ||
223 | } else | ||
224 | memcpy(elfheader, (const void *)vmlinuz.addr, sizeof(elfheader)); | ||
225 | |||
226 | if (!is_elf64(elfheader) && !is_elf32(elfheader)) { | ||
227 | printf("Error: not a valid PPC32 or PPC64 ELF file!\n\r"); | ||
228 | exit(); | ||
229 | } | ||
230 | |||
231 | /* | ||
232 | * The first available claim_base must be above the end of the | ||
233 | * the loaded kernel wrapper file (_start to _end includes the | ||
234 | * initrd image if it is present) and rounded up to a nice | ||
235 | * 1 MB boundary for good measure. | ||
236 | */ | ||
237 | |||
238 | claim_base = _ALIGN_UP((unsigned long)_end, ONE_MB); | ||
239 | |||
240 | #if defined(PROG_START) | ||
241 | /* | ||
242 | * Maintain a "magic" minimum address. This keeps some older | ||
243 | * firmware platforms running. | ||
244 | */ | ||
245 | |||
246 | if (claim_base < PROG_START) | ||
247 | claim_base = PROG_START; | ||
248 | #endif | ||
249 | |||
250 | /* We need to claim the memsize plus the file offset since gzip | ||
251 | * will expand the header (file offset), then the kernel, then | ||
252 | * possible rubbish we don't care about. But the kernel bss must | ||
253 | * be claimed (it will be zero'd by the kernel itself) | ||
254 | */ | ||
255 | printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux.memsize); | ||
256 | vmlinux.addr = try_claim(vmlinux.memsize); | ||
257 | if (vmlinux.addr == 0) { | ||
258 | printf("Can't allocate memory for kernel image !\n\r"); | ||
259 | exit(); | ||
260 | } | ||
261 | |||
262 | /* | ||
263 | * Now we try to claim memory for the initrd (and copy it there) | ||
264 | */ | ||
265 | initrd.size = (unsigned long)(_initrd_end - _initrd_start); | ||
266 | initrd.memsize = initrd.size; | ||
267 | if ( initrd.size > 0 ) { | ||
268 | printf("Allocating 0x%lx bytes for initrd ...\n\r", initrd.size); | ||
269 | initrd.addr = try_claim(initrd.size); | ||
270 | if (initrd.addr == 0) { | ||
271 | printf("Can't allocate memory for initial ramdisk !\n\r"); | ||
272 | exit(); | ||
273 | } | ||
274 | a1 = initrd.addr; | ||
275 | a2 = initrd.size; | ||
276 | printf("initial ramdisk moving 0x%lx <- 0x%lx (0x%lx bytes)\n\r", | ||
277 | initrd.addr, (unsigned long)_initrd_start, initrd.size); | ||
278 | memmove((void *)initrd.addr, (void *)_initrd_start, initrd.size); | ||
279 | printf("initrd head: 0x%lx\n\r", *((unsigned long *)initrd.addr)); | ||
280 | } | ||
281 | |||
282 | /* Eventually gunzip the kernel */ | ||
283 | if (*(unsigned short *)vmlinuz.addr == 0x1f8b) { | ||
284 | printf("gunzipping (0x%lx <- 0x%lx:0x%0lx)...", | ||
285 | vmlinux.addr, vmlinuz.addr, vmlinuz.addr+vmlinuz.size); | ||
286 | len = vmlinuz.size; | ||
287 | gunzip((void *)vmlinux.addr, vmlinux.memsize, | ||
288 | (unsigned char *)vmlinuz.addr, &len); | ||
289 | printf("done 0x%lx bytes\n\r", len); | ||
290 | } else { | ||
291 | memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,vmlinuz.size); | ||
292 | } | ||
293 | |||
294 | /* Skip over the ELF header */ | ||
295 | #ifdef DEBUG | ||
296 | printf("... skipping 0x%lx bytes of ELF header\n\r", | ||
297 | elfoffset); | ||
298 | #endif | ||
299 | vmlinux.addr += elfoffset; | ||
300 | |||
301 | flush_cache((void *)vmlinux.addr, vmlinux.size); | ||
302 | |||
303 | kernel_entry = (kernel_entry_t)vmlinux.addr; | ||
304 | #ifdef DEBUG | ||
305 | printf( "kernel:\n\r" | ||
306 | " entry addr = 0x%lx\n\r" | ||
307 | " a1 = 0x%lx,\n\r" | ||
308 | " a2 = 0x%lx,\n\r" | ||
309 | " prom = 0x%lx,\n\r" | ||
310 | " bi_recs = 0x%lx,\n\r", | ||
311 | (unsigned long)kernel_entry, a1, a2, | ||
312 | (unsigned long)prom, NULL); | ||
313 | #endif | ||
314 | |||
315 | kernel_entry(a1, a2, prom, NULL); | ||
316 | |||
317 | printf("Error: Linux kernel returned to zImage bootloader!\n\r"); | ||
318 | |||
319 | exit(); | ||
320 | } | ||
321 | |||
diff --git a/arch/powerpc/boot/page.h b/arch/powerpc/boot/page.h new file mode 100644 index 000000000000..14eca30fef64 --- /dev/null +++ b/arch/powerpc/boot/page.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef _PPC_BOOT_PAGE_H | ||
2 | #define _PPC_BOOT_PAGE_H | ||
3 | /* | ||
4 | * Copyright (C) 2001 PPC64 Team, IBM Corp | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifdef __ASSEMBLY__ | ||
13 | #define ASM_CONST(x) x | ||
14 | #else | ||
15 | #define __ASM_CONST(x) x##UL | ||
16 | #define ASM_CONST(x) __ASM_CONST(x) | ||
17 | #endif | ||
18 | |||
19 | /* PAGE_SHIFT determines the page size */ | ||
20 | #define PAGE_SHIFT 12 | ||
21 | #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT) | ||
22 | #define PAGE_MASK (~(PAGE_SIZE-1)) | ||
23 | |||
24 | /* align addr on a size boundary - adjust address up/down if needed */ | ||
25 | #define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1))) | ||
26 | #define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1))) | ||
27 | |||
28 | /* align addr on a size boundary - adjust address up if needed */ | ||
29 | #define _ALIGN(addr,size) _ALIGN_UP(addr,size) | ||
30 | |||
31 | /* to align the pointer to the (next) page boundary */ | ||
32 | #define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE) | ||
33 | |||
34 | #endif /* _PPC_BOOT_PAGE_H */ | ||
diff --git a/arch/powerpc/boot/ppc_asm.h b/arch/powerpc/boot/ppc_asm.h new file mode 100644 index 000000000000..1c2c2817f9b7 --- /dev/null +++ b/arch/powerpc/boot/ppc_asm.h | |||
@@ -0,0 +1,62 @@ | |||
1 | #ifndef _PPC64_PPC_ASM_H | ||
2 | #define _PPC64_PPC_ASM_H | ||
3 | /* | ||
4 | * | ||
5 | * Definitions used by various bits of low-level assembly code on PowerPC. | ||
6 | * | ||
7 | * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | */ | ||
14 | |||
15 | /* Condition Register Bit Fields */ | ||
16 | |||
17 | #define cr0 0 | ||
18 | #define cr1 1 | ||
19 | #define cr2 2 | ||
20 | #define cr3 3 | ||
21 | #define cr4 4 | ||
22 | #define cr5 5 | ||
23 | #define cr6 6 | ||
24 | #define cr7 7 | ||
25 | |||
26 | |||
27 | /* General Purpose Registers (GPRs) */ | ||
28 | |||
29 | #define r0 0 | ||
30 | #define r1 1 | ||
31 | #define r2 2 | ||
32 | #define r3 3 | ||
33 | #define r4 4 | ||
34 | #define r5 5 | ||
35 | #define r6 6 | ||
36 | #define r7 7 | ||
37 | #define r8 8 | ||
38 | #define r9 9 | ||
39 | #define r10 10 | ||
40 | #define r11 11 | ||
41 | #define r12 12 | ||
42 | #define r13 13 | ||
43 | #define r14 14 | ||
44 | #define r15 15 | ||
45 | #define r16 16 | ||
46 | #define r17 17 | ||
47 | #define r18 18 | ||
48 | #define r19 19 | ||
49 | #define r20 20 | ||
50 | #define r21 21 | ||
51 | #define r22 22 | ||
52 | #define r23 23 | ||
53 | #define r24 24 | ||
54 | #define r25 25 | ||
55 | #define r26 26 | ||
56 | #define r27 27 | ||
57 | #define r28 28 | ||
58 | #define r29 29 | ||
59 | #define r30 30 | ||
60 | #define r31 31 | ||
61 | |||
62 | #endif /* _PPC64_PPC_ASM_H */ | ||
diff --git a/arch/powerpc/boot/prom.c b/arch/powerpc/boot/prom.c new file mode 100644 index 000000000000..4bea2f4dcb06 --- /dev/null +++ b/arch/powerpc/boot/prom.c | |||
@@ -0,0 +1,499 @@ | |||
1 | /* | ||
2 | * Copyright (C) Paul Mackerras 1997. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | #include <stdarg.h> | ||
10 | #include <stddef.h> | ||
11 | #include "string.h" | ||
12 | #include "stdio.h" | ||
13 | #include "prom.h" | ||
14 | |||
15 | int (*prom)(void *); | ||
16 | |||
17 | void *chosen_handle; | ||
18 | |||
19 | void *stdin; | ||
20 | void *stdout; | ||
21 | void *stderr; | ||
22 | |||
23 | |||
24 | int | ||
25 | write(void *handle, void *ptr, int nb) | ||
26 | { | ||
27 | struct prom_args { | ||
28 | char *service; | ||
29 | int nargs; | ||
30 | int nret; | ||
31 | void *ihandle; | ||
32 | void *addr; | ||
33 | int len; | ||
34 | int actual; | ||
35 | } args; | ||
36 | |||
37 | args.service = "write"; | ||
38 | args.nargs = 3; | ||
39 | args.nret = 1; | ||
40 | args.ihandle = handle; | ||
41 | args.addr = ptr; | ||
42 | args.len = nb; | ||
43 | args.actual = -1; | ||
44 | (*prom)(&args); | ||
45 | return args.actual; | ||
46 | } | ||
47 | |||
48 | int | ||
49 | read(void *handle, void *ptr, int nb) | ||
50 | { | ||
51 | struct prom_args { | ||
52 | char *service; | ||
53 | int nargs; | ||
54 | int nret; | ||
55 | void *ihandle; | ||
56 | void *addr; | ||
57 | int len; | ||
58 | int actual; | ||
59 | } args; | ||
60 | |||
61 | args.service = "read"; | ||
62 | args.nargs = 3; | ||
63 | args.nret = 1; | ||
64 | args.ihandle = handle; | ||
65 | args.addr = ptr; | ||
66 | args.len = nb; | ||
67 | args.actual = -1; | ||
68 | (*prom)(&args); | ||
69 | return args.actual; | ||
70 | } | ||
71 | |||
72 | void | ||
73 | exit() | ||
74 | { | ||
75 | struct prom_args { | ||
76 | char *service; | ||
77 | } args; | ||
78 | |||
79 | for (;;) { | ||
80 | args.service = "exit"; | ||
81 | (*prom)(&args); | ||
82 | } | ||
83 | } | ||
84 | |||
85 | void | ||
86 | pause(void) | ||
87 | { | ||
88 | struct prom_args { | ||
89 | char *service; | ||
90 | } args; | ||
91 | |||
92 | args.service = "enter"; | ||
93 | (*prom)(&args); | ||
94 | } | ||
95 | |||
96 | void * | ||
97 | finddevice(const char *name) | ||
98 | { | ||
99 | struct prom_args { | ||
100 | char *service; | ||
101 | int nargs; | ||
102 | int nret; | ||
103 | const char *devspec; | ||
104 | void *phandle; | ||
105 | } args; | ||
106 | |||
107 | args.service = "finddevice"; | ||
108 | args.nargs = 1; | ||
109 | args.nret = 1; | ||
110 | args.devspec = name; | ||
111 | args.phandle = (void *) -1; | ||
112 | (*prom)(&args); | ||
113 | return args.phandle; | ||
114 | } | ||
115 | |||
116 | void * | ||
117 | claim(unsigned long virt, unsigned long size, unsigned long align) | ||
118 | { | ||
119 | struct prom_args { | ||
120 | char *service; | ||
121 | int nargs; | ||
122 | int nret; | ||
123 | unsigned int virt; | ||
124 | unsigned int size; | ||
125 | unsigned int align; | ||
126 | void *ret; | ||
127 | } args; | ||
128 | |||
129 | args.service = "claim"; | ||
130 | args.nargs = 3; | ||
131 | args.nret = 1; | ||
132 | args.virt = virt; | ||
133 | args.size = size; | ||
134 | args.align = align; | ||
135 | (*prom)(&args); | ||
136 | return args.ret; | ||
137 | } | ||
138 | |||
139 | int | ||
140 | getprop(void *phandle, const char *name, void *buf, int buflen) | ||
141 | { | ||
142 | struct prom_args { | ||
143 | char *service; | ||
144 | int nargs; | ||
145 | int nret; | ||
146 | void *phandle; | ||
147 | const char *name; | ||
148 | void *buf; | ||
149 | int buflen; | ||
150 | int size; | ||
151 | } args; | ||
152 | |||
153 | args.service = "getprop"; | ||
154 | args.nargs = 4; | ||
155 | args.nret = 1; | ||
156 | args.phandle = phandle; | ||
157 | args.name = name; | ||
158 | args.buf = buf; | ||
159 | args.buflen = buflen; | ||
160 | args.size = -1; | ||
161 | (*prom)(&args); | ||
162 | return args.size; | ||
163 | } | ||
164 | |||
165 | int | ||
166 | putc(int c, void *f) | ||
167 | { | ||
168 | char ch = c; | ||
169 | |||
170 | if (c == '\n') | ||
171 | putc('\r', f); | ||
172 | return write(f, &ch, 1) == 1? c: -1; | ||
173 | } | ||
174 | |||
175 | int | ||
176 | putchar(int c) | ||
177 | { | ||
178 | return putc(c, stdout); | ||
179 | } | ||
180 | |||
181 | int | ||
182 | fputs(char *str, void *f) | ||
183 | { | ||
184 | int n = strlen(str); | ||
185 | |||
186 | return write(f, str, n) == n? 0: -1; | ||
187 | } | ||
188 | |||
189 | size_t strnlen(const char * s, size_t count) | ||
190 | { | ||
191 | const char *sc; | ||
192 | |||
193 | for (sc = s; count-- && *sc != '\0'; ++sc) | ||
194 | /* nothing */; | ||
195 | return sc - s; | ||
196 | } | ||
197 | |||
198 | extern unsigned int __div64_32(unsigned long long *dividend, | ||
199 | unsigned int divisor); | ||
200 | |||
201 | /* The unnecessary pointer compare is there | ||
202 | * to check for type safety (n must be 64bit) | ||
203 | */ | ||
204 | # define do_div(n,base) ({ \ | ||
205 | unsigned int __base = (base); \ | ||
206 | unsigned int __rem; \ | ||
207 | (void)(((typeof((n)) *)0) == ((unsigned long long *)0)); \ | ||
208 | if (((n) >> 32) == 0) { \ | ||
209 | __rem = (unsigned int)(n) % __base; \ | ||
210 | (n) = (unsigned int)(n) / __base; \ | ||
211 | } else \ | ||
212 | __rem = __div64_32(&(n), __base); \ | ||
213 | __rem; \ | ||
214 | }) | ||
215 | |||
216 | static int skip_atoi(const char **s) | ||
217 | { | ||
218 | int i, c; | ||
219 | |||
220 | for (i = 0; '0' <= (c = **s) && c <= '9'; ++*s) | ||
221 | i = i*10 + c - '0'; | ||
222 | return i; | ||
223 | } | ||
224 | |||
225 | #define ZEROPAD 1 /* pad with zero */ | ||
226 | #define SIGN 2 /* unsigned/signed long */ | ||
227 | #define PLUS 4 /* show plus */ | ||
228 | #define SPACE 8 /* space if plus */ | ||
229 | #define LEFT 16 /* left justified */ | ||
230 | #define SPECIAL 32 /* 0x */ | ||
231 | #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ | ||
232 | |||
233 | static char * number(char * str, unsigned long long num, int base, int size, int precision, int type) | ||
234 | { | ||
235 | char c,sign,tmp[66]; | ||
236 | const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; | ||
237 | int i; | ||
238 | |||
239 | if (type & LARGE) | ||
240 | digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | ||
241 | if (type & LEFT) | ||
242 | type &= ~ZEROPAD; | ||
243 | if (base < 2 || base > 36) | ||
244 | return 0; | ||
245 | c = (type & ZEROPAD) ? '0' : ' '; | ||
246 | sign = 0; | ||
247 | if (type & SIGN) { | ||
248 | if ((signed long long)num < 0) { | ||
249 | sign = '-'; | ||
250 | num = - (signed long long)num; | ||
251 | size--; | ||
252 | } else if (type & PLUS) { | ||
253 | sign = '+'; | ||
254 | size--; | ||
255 | } else if (type & SPACE) { | ||
256 | sign = ' '; | ||
257 | size--; | ||
258 | } | ||
259 | } | ||
260 | if (type & SPECIAL) { | ||
261 | if (base == 16) | ||
262 | size -= 2; | ||
263 | else if (base == 8) | ||
264 | size--; | ||
265 | } | ||
266 | i = 0; | ||
267 | if (num == 0) | ||
268 | tmp[i++]='0'; | ||
269 | else while (num != 0) { | ||
270 | tmp[i++] = digits[do_div(num, base)]; | ||
271 | } | ||
272 | if (i > precision) | ||
273 | precision = i; | ||
274 | size -= precision; | ||
275 | if (!(type&(ZEROPAD+LEFT))) | ||
276 | while(size-->0) | ||
277 | *str++ = ' '; | ||
278 | if (sign) | ||
279 | *str++ = sign; | ||
280 | if (type & SPECIAL) { | ||
281 | if (base==8) | ||
282 | *str++ = '0'; | ||
283 | else if (base==16) { | ||
284 | *str++ = '0'; | ||
285 | *str++ = digits[33]; | ||
286 | } | ||
287 | } | ||
288 | if (!(type & LEFT)) | ||
289 | while (size-- > 0) | ||
290 | *str++ = c; | ||
291 | while (i < precision--) | ||
292 | *str++ = '0'; | ||
293 | while (i-- > 0) | ||
294 | *str++ = tmp[i]; | ||
295 | while (size-- > 0) | ||
296 | *str++ = ' '; | ||
297 | return str; | ||
298 | } | ||
299 | |||
300 | int vsprintf(char *buf, const char *fmt, va_list args) | ||
301 | { | ||
302 | int len; | ||
303 | unsigned long long num; | ||
304 | int i, base; | ||
305 | char * str; | ||
306 | const char *s; | ||
307 | |||
308 | int flags; /* flags to number() */ | ||
309 | |||
310 | int field_width; /* width of output field */ | ||
311 | int precision; /* min. # of digits for integers; max | ||
312 | number of chars for from string */ | ||
313 | int qualifier; /* 'h', 'l', or 'L' for integer fields */ | ||
314 | /* 'z' support added 23/7/1999 S.H. */ | ||
315 | /* 'z' changed to 'Z' --davidm 1/25/99 */ | ||
316 | |||
317 | |||
318 | for (str=buf ; *fmt ; ++fmt) { | ||
319 | if (*fmt != '%') { | ||
320 | *str++ = *fmt; | ||
321 | continue; | ||
322 | } | ||
323 | |||
324 | /* process flags */ | ||
325 | flags = 0; | ||
326 | repeat: | ||
327 | ++fmt; /* this also skips first '%' */ | ||
328 | switch (*fmt) { | ||
329 | case '-': flags |= LEFT; goto repeat; | ||
330 | case '+': flags |= PLUS; goto repeat; | ||
331 | case ' ': flags |= SPACE; goto repeat; | ||
332 | case '#': flags |= SPECIAL; goto repeat; | ||
333 | case '0': flags |= ZEROPAD; goto repeat; | ||
334 | } | ||
335 | |||
336 | /* get field width */ | ||
337 | field_width = -1; | ||
338 | if ('0' <= *fmt && *fmt <= '9') | ||
339 | field_width = skip_atoi(&fmt); | ||
340 | else if (*fmt == '*') { | ||
341 | ++fmt; | ||
342 | /* it's the next argument */ | ||
343 | field_width = va_arg(args, int); | ||
344 | if (field_width < 0) { | ||
345 | field_width = -field_width; | ||
346 | flags |= LEFT; | ||
347 | } | ||
348 | } | ||
349 | |||
350 | /* get the precision */ | ||
351 | precision = -1; | ||
352 | if (*fmt == '.') { | ||
353 | ++fmt; | ||
354 | if ('0' <= *fmt && *fmt <= '9') | ||
355 | precision = skip_atoi(&fmt); | ||
356 | else if (*fmt == '*') { | ||
357 | ++fmt; | ||
358 | /* it's the next argument */ | ||
359 | precision = va_arg(args, int); | ||
360 | } | ||
361 | if (precision < 0) | ||
362 | precision = 0; | ||
363 | } | ||
364 | |||
365 | /* get the conversion qualifier */ | ||
366 | qualifier = -1; | ||
367 | if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z') { | ||
368 | qualifier = *fmt; | ||
369 | ++fmt; | ||
370 | } | ||
371 | |||
372 | /* default base */ | ||
373 | base = 10; | ||
374 | |||
375 | switch (*fmt) { | ||
376 | case 'c': | ||
377 | if (!(flags & LEFT)) | ||
378 | while (--field_width > 0) | ||
379 | *str++ = ' '; | ||
380 | *str++ = (unsigned char) va_arg(args, int); | ||
381 | while (--field_width > 0) | ||
382 | *str++ = ' '; | ||
383 | continue; | ||
384 | |||
385 | case 's': | ||
386 | s = va_arg(args, char *); | ||
387 | if (!s) | ||
388 | s = "<NULL>"; | ||
389 | |||
390 | len = strnlen(s, precision); | ||
391 | |||
392 | if (!(flags & LEFT)) | ||
393 | while (len < field_width--) | ||
394 | *str++ = ' '; | ||
395 | for (i = 0; i < len; ++i) | ||
396 | *str++ = *s++; | ||
397 | while (len < field_width--) | ||
398 | *str++ = ' '; | ||
399 | continue; | ||
400 | |||
401 | case 'p': | ||
402 | if (field_width == -1) { | ||
403 | field_width = 2*sizeof(void *); | ||
404 | flags |= ZEROPAD; | ||
405 | } | ||
406 | str = number(str, | ||
407 | (unsigned long) va_arg(args, void *), 16, | ||
408 | field_width, precision, flags); | ||
409 | continue; | ||
410 | |||
411 | |||
412 | case 'n': | ||
413 | if (qualifier == 'l') { | ||
414 | long * ip = va_arg(args, long *); | ||
415 | *ip = (str - buf); | ||
416 | } else if (qualifier == 'Z') { | ||
417 | size_t * ip = va_arg(args, size_t *); | ||
418 | *ip = (str - buf); | ||
419 | } else { | ||
420 | int * ip = va_arg(args, int *); | ||
421 | *ip = (str - buf); | ||
422 | } | ||
423 | continue; | ||
424 | |||
425 | case '%': | ||
426 | *str++ = '%'; | ||
427 | continue; | ||
428 | |||
429 | /* integer number formats - set up the flags and "break" */ | ||
430 | case 'o': | ||
431 | base = 8; | ||
432 | break; | ||
433 | |||
434 | case 'X': | ||
435 | flags |= LARGE; | ||
436 | case 'x': | ||
437 | base = 16; | ||
438 | break; | ||
439 | |||
440 | case 'd': | ||
441 | case 'i': | ||
442 | flags |= SIGN; | ||
443 | case 'u': | ||
444 | break; | ||
445 | |||
446 | default: | ||
447 | *str++ = '%'; | ||
448 | if (*fmt) | ||
449 | *str++ = *fmt; | ||
450 | else | ||
451 | --fmt; | ||
452 | continue; | ||
453 | } | ||
454 | if (qualifier == 'l') { | ||
455 | num = va_arg(args, unsigned long); | ||
456 | if (flags & SIGN) | ||
457 | num = (signed long) num; | ||
458 | } else if (qualifier == 'Z') { | ||
459 | num = va_arg(args, size_t); | ||
460 | } else if (qualifier == 'h') { | ||
461 | num = (unsigned short) va_arg(args, int); | ||
462 | if (flags & SIGN) | ||
463 | num = (signed short) num; | ||
464 | } else { | ||
465 | num = va_arg(args, unsigned int); | ||
466 | if (flags & SIGN) | ||
467 | num = (signed int) num; | ||
468 | } | ||
469 | str = number(str, num, base, field_width, precision, flags); | ||
470 | } | ||
471 | *str = '\0'; | ||
472 | return str-buf; | ||
473 | } | ||
474 | |||
475 | int sprintf(char * buf, const char *fmt, ...) | ||
476 | { | ||
477 | va_list args; | ||
478 | int i; | ||
479 | |||
480 | va_start(args, fmt); | ||
481 | i=vsprintf(buf,fmt,args); | ||
482 | va_end(args); | ||
483 | return i; | ||
484 | } | ||
485 | |||
486 | static char sprint_buf[1024]; | ||
487 | |||
488 | int | ||
489 | printf(const char *fmt, ...) | ||
490 | { | ||
491 | va_list args; | ||
492 | int n; | ||
493 | |||
494 | va_start(args, fmt); | ||
495 | n = vsprintf(sprint_buf, fmt, args); | ||
496 | va_end(args); | ||
497 | write(stdout, sprint_buf, n); | ||
498 | return n; | ||
499 | } | ||
diff --git a/arch/powerpc/boot/prom.h b/arch/powerpc/boot/prom.h new file mode 100644 index 000000000000..96ab5aec740c --- /dev/null +++ b/arch/powerpc/boot/prom.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef _PPC_BOOT_PROM_H_ | ||
2 | #define _PPC_BOOT_PROM_H_ | ||
3 | |||
4 | extern int (*prom) (void *); | ||
5 | extern void *chosen_handle; | ||
6 | |||
7 | extern void *stdin; | ||
8 | extern void *stdout; | ||
9 | extern void *stderr; | ||
10 | |||
11 | extern int write(void *handle, void *ptr, int nb); | ||
12 | extern int read(void *handle, void *ptr, int nb); | ||
13 | extern void exit(void); | ||
14 | extern void pause(void); | ||
15 | extern void *finddevice(const char *); | ||
16 | extern void *claim(unsigned long virt, unsigned long size, unsigned long align); | ||
17 | extern int getprop(void *phandle, const char *name, void *buf, int buflen); | ||
18 | #endif /* _PPC_BOOT_PROM_H_ */ | ||
diff --git a/arch/powerpc/boot/stdio.h b/arch/powerpc/boot/stdio.h new file mode 100644 index 000000000000..24bd3a8dee94 --- /dev/null +++ b/arch/powerpc/boot/stdio.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef _PPC_BOOT_STDIO_H_ | ||
2 | #define _PPC_BOOT_STDIO_H_ | ||
3 | |||
4 | extern int printf(const char *fmt, ...); | ||
5 | |||
6 | extern int sprintf(char *buf, const char *fmt, ...); | ||
7 | |||
8 | extern int vsprintf(char *buf, const char *fmt, va_list args); | ||
9 | |||
10 | extern int putc(int c, void *f); | ||
11 | extern int putchar(int c); | ||
12 | extern int getchar(void); | ||
13 | |||
14 | extern int fputs(char *str, void *f); | ||
15 | |||
16 | #endif /* _PPC_BOOT_STDIO_H_ */ | ||
diff --git a/arch/powerpc/boot/string.S b/arch/powerpc/boot/string.S new file mode 100644 index 000000000000..b1eeaed7db17 --- /dev/null +++ b/arch/powerpc/boot/string.S | |||
@@ -0,0 +1,216 @@ | |||
1 | /* | ||
2 | * Copyright (C) Paul Mackerras 1997. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | * | ||
9 | * NOTE: this code runs in 32 bit mode and is packaged as ELF32. | ||
10 | */ | ||
11 | |||
12 | #include "ppc_asm.h" | ||
13 | |||
14 | .text | ||
15 | .globl strcpy | ||
16 | strcpy: | ||
17 | addi r5,r3,-1 | ||
18 | addi r4,r4,-1 | ||
19 | 1: lbzu r0,1(r4) | ||
20 | cmpwi 0,r0,0 | ||
21 | stbu r0,1(r5) | ||
22 | bne 1b | ||
23 | blr | ||
24 | |||
25 | .globl strncpy | ||
26 | strncpy: | ||
27 | cmpwi 0,r5,0 | ||
28 | beqlr | ||
29 | mtctr r5 | ||
30 | addi r6,r3,-1 | ||
31 | addi r4,r4,-1 | ||
32 | 1: lbzu r0,1(r4) | ||
33 | cmpwi 0,r0,0 | ||
34 | stbu r0,1(r6) | ||
35 | bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */ | ||
36 | blr | ||
37 | |||
38 | .globl strcat | ||
39 | strcat: | ||
40 | addi r5,r3,-1 | ||
41 | addi r4,r4,-1 | ||
42 | 1: lbzu r0,1(r5) | ||
43 | cmpwi 0,r0,0 | ||
44 | bne 1b | ||
45 | addi r5,r5,-1 | ||
46 | 1: lbzu r0,1(r4) | ||
47 | cmpwi 0,r0,0 | ||
48 | stbu r0,1(r5) | ||
49 | bne 1b | ||
50 | blr | ||
51 | |||
52 | .globl strcmp | ||
53 | strcmp: | ||
54 | addi r5,r3,-1 | ||
55 | addi r4,r4,-1 | ||
56 | 1: lbzu r3,1(r5) | ||
57 | cmpwi 1,r3,0 | ||
58 | lbzu r0,1(r4) | ||
59 | subf. r3,r0,r3 | ||
60 | beqlr 1 | ||
61 | beq 1b | ||
62 | blr | ||
63 | |||
64 | .globl strlen | ||
65 | strlen: | ||
66 | addi r4,r3,-1 | ||
67 | 1: lbzu r0,1(r4) | ||
68 | cmpwi 0,r0,0 | ||
69 | bne 1b | ||
70 | subf r3,r3,r4 | ||
71 | blr | ||
72 | |||
73 | .globl memset | ||
74 | memset: | ||
75 | rlwimi r4,r4,8,16,23 | ||
76 | rlwimi r4,r4,16,0,15 | ||
77 | addi r6,r3,-4 | ||
78 | cmplwi 0,r5,4 | ||
79 | blt 7f | ||
80 | stwu r4,4(r6) | ||
81 | beqlr | ||
82 | andi. r0,r6,3 | ||
83 | add r5,r0,r5 | ||
84 | subf r6,r0,r6 | ||
85 | rlwinm r0,r5,32-2,2,31 | ||
86 | mtctr r0 | ||
87 | bdz 6f | ||
88 | 1: stwu r4,4(r6) | ||
89 | bdnz 1b | ||
90 | 6: andi. r5,r5,3 | ||
91 | 7: cmpwi 0,r5,0 | ||
92 | beqlr | ||
93 | mtctr r5 | ||
94 | addi r6,r6,3 | ||
95 | 8: stbu r4,1(r6) | ||
96 | bdnz 8b | ||
97 | blr | ||
98 | |||
99 | .globl memmove | ||
100 | memmove: | ||
101 | cmplw 0,r3,r4 | ||
102 | bgt backwards_memcpy | ||
103 | /* fall through */ | ||
104 | |||
105 | .globl memcpy | ||
106 | memcpy: | ||
107 | rlwinm. r7,r5,32-3,3,31 /* r7 = r5 >> 3 */ | ||
108 | addi r6,r3,-4 | ||
109 | addi r4,r4,-4 | ||
110 | beq 2f /* if less than 8 bytes to do */ | ||
111 | andi. r0,r6,3 /* get dest word aligned */ | ||
112 | mtctr r7 | ||
113 | bne 5f | ||
114 | 1: lwz r7,4(r4) | ||
115 | lwzu r8,8(r4) | ||
116 | stw r7,4(r6) | ||
117 | stwu r8,8(r6) | ||
118 | bdnz 1b | ||
119 | andi. r5,r5,7 | ||
120 | 2: cmplwi 0,r5,4 | ||
121 | blt 3f | ||
122 | lwzu r0,4(r4) | ||
123 | addi r5,r5,-4 | ||
124 | stwu r0,4(r6) | ||
125 | 3: cmpwi 0,r5,0 | ||
126 | beqlr | ||
127 | mtctr r5 | ||
128 | addi r4,r4,3 | ||
129 | addi r6,r6,3 | ||
130 | 4: lbzu r0,1(r4) | ||
131 | stbu r0,1(r6) | ||
132 | bdnz 4b | ||
133 | blr | ||
134 | 5: subfic r0,r0,4 | ||
135 | mtctr r0 | ||
136 | 6: lbz r7,4(r4) | ||
137 | addi r4,r4,1 | ||
138 | stb r7,4(r6) | ||
139 | addi r6,r6,1 | ||
140 | bdnz 6b | ||
141 | subf r5,r0,r5 | ||
142 | rlwinm. r7,r5,32-3,3,31 | ||
143 | beq 2b | ||
144 | mtctr r7 | ||
145 | b 1b | ||
146 | |||
147 | .globl backwards_memcpy | ||
148 | backwards_memcpy: | ||
149 | rlwinm. r7,r5,32-3,3,31 /* r7 = r5 >> 3 */ | ||
150 | add r6,r3,r5 | ||
151 | add r4,r4,r5 | ||
152 | beq 2f | ||
153 | andi. r0,r6,3 | ||
154 | mtctr r7 | ||
155 | bne 5f | ||
156 | 1: lwz r7,-4(r4) | ||
157 | lwzu r8,-8(r4) | ||
158 | stw r7,-4(r6) | ||
159 | stwu r8,-8(r6) | ||
160 | bdnz 1b | ||
161 | andi. r5,r5,7 | ||
162 | 2: cmplwi 0,r5,4 | ||
163 | blt 3f | ||
164 | lwzu r0,-4(r4) | ||
165 | subi r5,r5,4 | ||
166 | stwu r0,-4(r6) | ||
167 | 3: cmpwi 0,r5,0 | ||
168 | beqlr | ||
169 | mtctr r5 | ||
170 | 4: lbzu r0,-1(r4) | ||
171 | stbu r0,-1(r6) | ||
172 | bdnz 4b | ||
173 | blr | ||
174 | 5: mtctr r0 | ||
175 | 6: lbzu r7,-1(r4) | ||
176 | stbu r7,-1(r6) | ||
177 | bdnz 6b | ||
178 | subf r5,r0,r5 | ||
179 | rlwinm. r7,r5,32-3,3,31 | ||
180 | beq 2b | ||
181 | mtctr r7 | ||
182 | b 1b | ||
183 | |||
184 | .globl memcmp | ||
185 | memcmp: | ||
186 | cmpwi 0,r5,0 | ||
187 | blelr | ||
188 | mtctr r5 | ||
189 | addi r6,r3,-1 | ||
190 | addi r4,r4,-1 | ||
191 | 1: lbzu r3,1(r6) | ||
192 | lbzu r0,1(r4) | ||
193 | subf. r3,r0,r3 | ||
194 | bdnzt 2,1b | ||
195 | blr | ||
196 | |||
197 | |||
198 | /* | ||
199 | * Flush the dcache and invalidate the icache for a range of addresses. | ||
200 | * | ||
201 | * flush_cache(addr, len) | ||
202 | */ | ||
203 | .global flush_cache | ||
204 | flush_cache: | ||
205 | addi 4,4,0x1f /* len = (len + 0x1f) / 0x20 */ | ||
206 | rlwinm. 4,4,27,5,31 | ||
207 | mtctr 4 | ||
208 | beqlr | ||
209 | 1: dcbf 0,3 | ||
210 | icbi 0,3 | ||
211 | addi 3,3,0x20 | ||
212 | bdnz 1b | ||
213 | sync | ||
214 | isync | ||
215 | blr | ||
216 | |||
diff --git a/arch/powerpc/boot/string.h b/arch/powerpc/boot/string.h new file mode 100644 index 000000000000..9fdff1cc0d70 --- /dev/null +++ b/arch/powerpc/boot/string.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _PPC_BOOT_STRING_H_ | ||
2 | #define _PPC_BOOT_STRING_H_ | ||
3 | #include <stddef.h> | ||
4 | |||
5 | extern char *strcpy(char *dest, const char *src); | ||
6 | extern char *strncpy(char *dest, const char *src, size_t n); | ||
7 | extern char *strcat(char *dest, const char *src); | ||
8 | extern int strcmp(const char *s1, const char *s2); | ||
9 | extern size_t strlen(const char *s); | ||
10 | extern size_t strnlen(const char *s, size_t count); | ||
11 | |||
12 | extern void *memset(void *s, int c, size_t n); | ||
13 | extern void *memmove(void *dest, const void *src, unsigned long n); | ||
14 | extern void *memcpy(void *dest, const void *src, unsigned long n); | ||
15 | extern int memcmp(const void *s1, const void *s2, size_t n); | ||
16 | |||
17 | #endif /* _PPC_BOOT_STRING_H_ */ | ||
diff --git a/arch/powerpc/boot/zImage.lds b/arch/powerpc/boot/zImage.lds new file mode 100644 index 000000000000..4b6bb3ffe3dc --- /dev/null +++ b/arch/powerpc/boot/zImage.lds | |||
@@ -0,0 +1,46 @@ | |||
1 | OUTPUT_ARCH(powerpc:common) | ||
2 | ENTRY(_zimage_start) | ||
3 | SECTIONS | ||
4 | { | ||
5 | . = (4*1024*1024); | ||
6 | _start = .; | ||
7 | .text : | ||
8 | { | ||
9 | *(.text) | ||
10 | *(.fixup) | ||
11 | } | ||
12 | _etext = .; | ||
13 | . = ALIGN(4096); | ||
14 | .data : | ||
15 | { | ||
16 | *(.rodata*) | ||
17 | *(.data*) | ||
18 | *(.sdata*) | ||
19 | __got2_start = .; | ||
20 | *(.got2) | ||
21 | __got2_end = .; | ||
22 | } | ||
23 | |||
24 | . = ALIGN(4096); | ||
25 | _vmlinux_start = .; | ||
26 | .kernel:vmlinux.strip : { *(.kernel:vmlinux.strip) } | ||
27 | _vmlinux_end = .; | ||
28 | |||
29 | . = ALIGN(4096); | ||
30 | _initrd_start = .; | ||
31 | .kernel:initrd : { *(.kernel:initrd) } | ||
32 | _initrd_end = .; | ||
33 | |||
34 | . = ALIGN(4096); | ||
35 | _edata = .; | ||
36 | |||
37 | . = ALIGN(4096); | ||
38 | __bss_start = .; | ||
39 | .bss : | ||
40 | { | ||
41 | *(.sbss) | ||
42 | *(.bss) | ||
43 | } | ||
44 | . = ALIGN(4096); | ||
45 | _end = . ; | ||
46 | } | ||
diff --git a/arch/powerpc/configs/cell_defconfig b/arch/powerpc/configs/cell_defconfig index 67ffecbc05cb..4b433411b9e3 100644 --- a/arch/powerpc/configs/cell_defconfig +++ b/arch/powerpc/configs/cell_defconfig | |||
@@ -1,18 +1,33 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.14-rc4 | 3 | # Linux kernel version: 2.6.15-rc1 |
4 | # Thu Oct 20 08:29:10 2005 | 4 | # Tue Nov 15 14:36:20 2005 |
5 | # | 5 | # |
6 | CONFIG_PPC64=y | ||
6 | CONFIG_64BIT=y | 7 | CONFIG_64BIT=y |
8 | CONFIG_PPC_MERGE=y | ||
7 | CONFIG_MMU=y | 9 | CONFIG_MMU=y |
10 | CONFIG_GENERIC_HARDIRQS=y | ||
8 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | 11 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y |
9 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 12 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
10 | CONFIG_GENERIC_ISA_DMA=y | 13 | CONFIG_PPC=y |
11 | CONFIG_EARLY_PRINTK=y | 14 | CONFIG_EARLY_PRINTK=y |
12 | CONFIG_COMPAT=y | 15 | CONFIG_COMPAT=y |
16 | CONFIG_SYSVIPC_COMPAT=y | ||
13 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y | 17 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y |
14 | CONFIG_ARCH_MAY_HAVE_PC_FDC=y | 18 | CONFIG_ARCH_MAY_HAVE_PC_FDC=y |
15 | CONFIG_FORCE_MAX_ZONEORDER=13 | 19 | |
20 | # | ||
21 | # Processor support | ||
22 | # | ||
23 | # CONFIG_POWER4_ONLY is not set | ||
24 | CONFIG_POWER3=y | ||
25 | CONFIG_POWER4=y | ||
26 | CONFIG_PPC_FPU=y | ||
27 | CONFIG_ALTIVEC=y | ||
28 | CONFIG_PPC_STD_MMU=y | ||
29 | CONFIG_SMP=y | ||
30 | CONFIG_NR_CPUS=4 | ||
16 | 31 | ||
17 | # | 32 | # |
18 | # Code maturity level options | 33 | # Code maturity level options |
@@ -66,31 +81,69 @@ CONFIG_OBSOLETE_MODPARM=y | |||
66 | # CONFIG_MODULE_SRCVERSION_ALL is not set | 81 | # CONFIG_MODULE_SRCVERSION_ALL is not set |
67 | # CONFIG_KMOD is not set | 82 | # CONFIG_KMOD is not set |
68 | CONFIG_STOP_MACHINE=y | 83 | CONFIG_STOP_MACHINE=y |
69 | CONFIG_SYSVIPC_COMPAT=y | 84 | |
85 | # | ||
86 | # Block layer | ||
87 | # | ||
88 | |||
89 | # | ||
90 | # IO Schedulers | ||
91 | # | ||
92 | CONFIG_IOSCHED_NOOP=y | ||
93 | CONFIG_IOSCHED_AS=y | ||
94 | CONFIG_IOSCHED_DEADLINE=y | ||
95 | CONFIG_IOSCHED_CFQ=y | ||
96 | CONFIG_DEFAULT_AS=y | ||
97 | # CONFIG_DEFAULT_DEADLINE is not set | ||
98 | # CONFIG_DEFAULT_CFQ is not set | ||
99 | # CONFIG_DEFAULT_NOOP is not set | ||
100 | CONFIG_DEFAULT_IOSCHED="anticipatory" | ||
70 | 101 | ||
71 | # | 102 | # |
72 | # Platform support | 103 | # Platform support |
73 | # | 104 | # |
74 | # CONFIG_PPC_ISERIES is not set | ||
75 | CONFIG_PPC_MULTIPLATFORM=y | 105 | CONFIG_PPC_MULTIPLATFORM=y |
106 | # CONFIG_PPC_ISERIES is not set | ||
107 | # CONFIG_EMBEDDED6xx is not set | ||
108 | # CONFIG_APUS is not set | ||
76 | # CONFIG_PPC_PSERIES is not set | 109 | # CONFIG_PPC_PSERIES is not set |
77 | CONFIG_PPC_BPA=y | ||
78 | # CONFIG_PPC_PMAC is not set | 110 | # CONFIG_PPC_PMAC is not set |
79 | # CONFIG_PPC_MAPLE is not set | 111 | # CONFIG_PPC_MAPLE is not set |
80 | CONFIG_PPC=y | 112 | CONFIG_PPC_CELL=y |
81 | CONFIG_PPC64=y | ||
82 | CONFIG_PPC_OF=y | 113 | CONFIG_PPC_OF=y |
83 | CONFIG_BPA_IIC=y | ||
84 | CONFIG_ALTIVEC=y | ||
85 | CONFIG_KEXEC=y | ||
86 | # CONFIG_U3_DART is not set | 114 | # CONFIG_U3_DART is not set |
87 | # CONFIG_BOOTX_TEXT is not set | 115 | CONFIG_PPC_RTAS=y |
88 | # CONFIG_POWER4_ONLY is not set | 116 | # CONFIG_RTAS_ERROR_LOGGING is not set |
117 | CONFIG_RTAS_PROC=y | ||
118 | CONFIG_RTAS_FLASH=y | ||
119 | CONFIG_MMIO_NVRAM=y | ||
120 | CONFIG_CELL_IIC=y | ||
121 | # CONFIG_PPC_MPC106 is not set | ||
122 | # CONFIG_GENERIC_TBSYNC is not set | ||
123 | # CONFIG_CPU_FREQ is not set | ||
124 | # CONFIG_WANT_EARLY_SERIAL is not set | ||
125 | |||
126 | # | ||
127 | # Kernel options | ||
128 | # | ||
129 | # CONFIG_HZ_100 is not set | ||
130 | CONFIG_HZ_250=y | ||
131 | # CONFIG_HZ_1000 is not set | ||
132 | CONFIG_HZ=250 | ||
133 | CONFIG_PREEMPT_NONE=y | ||
134 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
135 | # CONFIG_PREEMPT is not set | ||
136 | CONFIG_PREEMPT_BKL=y | ||
137 | CONFIG_BINFMT_ELF=y | ||
138 | # CONFIG_BINFMT_MISC is not set | ||
139 | CONFIG_FORCE_MAX_ZONEORDER=13 | ||
89 | # CONFIG_IOMMU_VMERGE is not set | 140 | # CONFIG_IOMMU_VMERGE is not set |
90 | CONFIG_SMP=y | 141 | CONFIG_KEXEC=y |
91 | CONFIG_NR_CPUS=4 | 142 | CONFIG_IRQ_ALL_CPUS=y |
143 | # CONFIG_NUMA is not set | ||
92 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | 144 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y |
93 | CONFIG_ARCH_FLATMEM_ENABLE=y | 145 | CONFIG_ARCH_FLATMEM_ENABLE=y |
146 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | ||
94 | CONFIG_SELECT_MEMORY_MODEL=y | 147 | CONFIG_SELECT_MEMORY_MODEL=y |
95 | CONFIG_FLATMEM_MANUAL=y | 148 | CONFIG_FLATMEM_MANUAL=y |
96 | # CONFIG_DISCONTIGMEM_MANUAL is not set | 149 | # CONFIG_DISCONTIGMEM_MANUAL is not set |
@@ -98,30 +151,21 @@ CONFIG_FLATMEM_MANUAL=y | |||
98 | CONFIG_FLATMEM=y | 151 | CONFIG_FLATMEM=y |
99 | CONFIG_FLAT_NODE_MEM_MAP=y | 152 | CONFIG_FLAT_NODE_MEM_MAP=y |
100 | # CONFIG_SPARSEMEM_STATIC is not set | 153 | # CONFIG_SPARSEMEM_STATIC is not set |
101 | # CONFIG_NUMA is not set | 154 | CONFIG_SPLIT_PTLOCK_CPUS=4096 |
155 | # CONFIG_PPC_64K_PAGES is not set | ||
102 | CONFIG_SCHED_SMT=y | 156 | CONFIG_SCHED_SMT=y |
103 | CONFIG_PREEMPT_NONE=y | ||
104 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
105 | # CONFIG_PREEMPT is not set | ||
106 | CONFIG_PREEMPT_BKL=y | ||
107 | # CONFIG_HZ_100 is not set | ||
108 | CONFIG_HZ_250=y | ||
109 | # CONFIG_HZ_1000 is not set | ||
110 | CONFIG_HZ=250 | ||
111 | CONFIG_GENERIC_HARDIRQS=y | ||
112 | CONFIG_PPC_RTAS=y | ||
113 | CONFIG_RTAS_PROC=y | ||
114 | CONFIG_RTAS_FLASH=y | ||
115 | CONFIG_SECCOMP=y | ||
116 | CONFIG_BINFMT_ELF=y | ||
117 | # CONFIG_BINFMT_MISC is not set | ||
118 | CONFIG_PROC_DEVICETREE=y | 157 | CONFIG_PROC_DEVICETREE=y |
119 | # CONFIG_CMDLINE_BOOL is not set | 158 | # CONFIG_CMDLINE_BOOL is not set |
159 | # CONFIG_PM is not set | ||
160 | CONFIG_SECCOMP=y | ||
120 | CONFIG_ISA_DMA_API=y | 161 | CONFIG_ISA_DMA_API=y |
121 | 162 | ||
122 | # | 163 | # |
123 | # Bus Options | 164 | # Bus options |
124 | # | 165 | # |
166 | CONFIG_GENERIC_ISA_DMA=y | ||
167 | # CONFIG_PPC_I8259 is not set | ||
168 | # CONFIG_PPC_INDIRECT_PCI is not set | ||
125 | CONFIG_PCI=y | 169 | CONFIG_PCI=y |
126 | CONFIG_PCI_DOMAINS=y | 170 | CONFIG_PCI_DOMAINS=y |
127 | CONFIG_PCI_LEGACY_PROC=y | 171 | CONFIG_PCI_LEGACY_PROC=y |
@@ -136,6 +180,7 @@ CONFIG_PCI_LEGACY_PROC=y | |||
136 | # PCI Hotplug Support | 180 | # PCI Hotplug Support |
137 | # | 181 | # |
138 | # CONFIG_HOTPLUG_PCI is not set | 182 | # CONFIG_HOTPLUG_PCI is not set |
183 | CONFIG_KERNEL_START=0xc000000000000000 | ||
139 | 184 | ||
140 | # | 185 | # |
141 | # Networking | 186 | # Networking |
@@ -183,6 +228,10 @@ CONFIG_INET6_TUNNEL=m | |||
183 | CONFIG_IPV6_TUNNEL=m | 228 | CONFIG_IPV6_TUNNEL=m |
184 | CONFIG_NETFILTER=y | 229 | CONFIG_NETFILTER=y |
185 | # CONFIG_NETFILTER_DEBUG is not set | 230 | # CONFIG_NETFILTER_DEBUG is not set |
231 | |||
232 | # | ||
233 | # Core Netfilter Configuration | ||
234 | # | ||
186 | # CONFIG_NETFILTER_NETLINK is not set | 235 | # CONFIG_NETFILTER_NETLINK is not set |
187 | 236 | ||
188 | # | 237 | # |
@@ -284,6 +333,10 @@ CONFIG_IP_NF_ARP_MANGLE=m | |||
284 | # CONFIG_NET_DIVERT is not set | 333 | # CONFIG_NET_DIVERT is not set |
285 | # CONFIG_ECONET is not set | 334 | # CONFIG_ECONET is not set |
286 | # CONFIG_WAN_ROUTER is not set | 335 | # CONFIG_WAN_ROUTER is not set |
336 | |||
337 | # | ||
338 | # QoS and/or fair queueing | ||
339 | # | ||
287 | # CONFIG_NET_SCHED is not set | 340 | # CONFIG_NET_SCHED is not set |
288 | CONFIG_NET_CLS_ROUTE=y | 341 | CONFIG_NET_CLS_ROUTE=y |
289 | 342 | ||
@@ -345,14 +398,6 @@ CONFIG_BLK_DEV_RAM_COUNT=16 | |||
345 | CONFIG_BLK_DEV_RAM_SIZE=131072 | 398 | CONFIG_BLK_DEV_RAM_SIZE=131072 |
346 | CONFIG_BLK_DEV_INITRD=y | 399 | CONFIG_BLK_DEV_INITRD=y |
347 | # CONFIG_CDROM_PKTCDVD is not set | 400 | # CONFIG_CDROM_PKTCDVD is not set |
348 | |||
349 | # | ||
350 | # IO Schedulers | ||
351 | # | ||
352 | CONFIG_IOSCHED_NOOP=y | ||
353 | CONFIG_IOSCHED_AS=y | ||
354 | CONFIG_IOSCHED_DEADLINE=y | ||
355 | CONFIG_IOSCHED_CFQ=y | ||
356 | # CONFIG_ATA_OVER_ETH is not set | 401 | # CONFIG_ATA_OVER_ETH is not set |
357 | 402 | ||
358 | # | 403 | # |
@@ -442,6 +487,7 @@ CONFIG_IDEDMA_AUTO=y | |||
442 | # | 487 | # |
443 | # Macintosh device drivers | 488 | # Macintosh device drivers |
444 | # | 489 | # |
490 | # CONFIG_WINDFARM is not set | ||
445 | 491 | ||
446 | # | 492 | # |
447 | # Network device support | 493 | # Network device support |
@@ -495,7 +541,6 @@ CONFIG_SKGE=m | |||
495 | # CONFIG_SK98LIN is not set | 541 | # CONFIG_SK98LIN is not set |
496 | # CONFIG_TIGON3 is not set | 542 | # CONFIG_TIGON3 is not set |
497 | # CONFIG_BNX2 is not set | 543 | # CONFIG_BNX2 is not set |
498 | # CONFIG_SPIDER_NET is not set | ||
499 | # CONFIG_MV643XX_ETH is not set | 544 | # CONFIG_MV643XX_ETH is not set |
500 | 545 | ||
501 | # | 546 | # |
@@ -625,7 +670,7 @@ CONFIG_WATCHDOG=y | |||
625 | # Watchdog Device Drivers | 670 | # Watchdog Device Drivers |
626 | # | 671 | # |
627 | # CONFIG_SOFT_WATCHDOG is not set | 672 | # CONFIG_SOFT_WATCHDOG is not set |
628 | CONFIG_WATCHDOG_RTAS=y | 673 | # CONFIG_WATCHDOG_RTAS is not set |
629 | 674 | ||
630 | # | 675 | # |
631 | # PCI-based Watchdog Cards | 676 | # PCI-based Watchdog Cards |
@@ -633,6 +678,8 @@ CONFIG_WATCHDOG_RTAS=y | |||
633 | # CONFIG_PCIPCWATCHDOG is not set | 678 | # CONFIG_PCIPCWATCHDOG is not set |
634 | # CONFIG_WDTPCI is not set | 679 | # CONFIG_WDTPCI is not set |
635 | # CONFIG_RTC is not set | 680 | # CONFIG_RTC is not set |
681 | CONFIG_GEN_RTC=y | ||
682 | # CONFIG_GEN_RTC_X is not set | ||
636 | # CONFIG_DTLK is not set | 683 | # CONFIG_DTLK is not set |
637 | # CONFIG_R3964 is not set | 684 | # CONFIG_R3964 is not set |
638 | # CONFIG_APPLICOM is not set | 685 | # CONFIG_APPLICOM is not set |
@@ -649,6 +696,7 @@ CONFIG_WATCHDOG_RTAS=y | |||
649 | # TPM devices | 696 | # TPM devices |
650 | # | 697 | # |
651 | # CONFIG_TCG_TPM is not set | 698 | # CONFIG_TCG_TPM is not set |
699 | # CONFIG_TELCLOCK is not set | ||
652 | 700 | ||
653 | # | 701 | # |
654 | # I2C support | 702 | # I2C support |
@@ -699,6 +747,7 @@ CONFIG_I2C_ALGOBIT=y | |||
699 | # CONFIG_SENSORS_PCF8591 is not set | 747 | # CONFIG_SENSORS_PCF8591 is not set |
700 | # CONFIG_SENSORS_RTC8564 is not set | 748 | # CONFIG_SENSORS_RTC8564 is not set |
701 | # CONFIG_SENSORS_MAX6875 is not set | 749 | # CONFIG_SENSORS_MAX6875 is not set |
750 | # CONFIG_RTC_X1205_I2C is not set | ||
702 | # CONFIG_I2C_DEBUG_CORE is not set | 751 | # CONFIG_I2C_DEBUG_CORE is not set |
703 | # CONFIG_I2C_DEBUG_ALGO is not set | 752 | # CONFIG_I2C_DEBUG_ALGO is not set |
704 | # CONFIG_I2C_DEBUG_BUS is not set | 753 | # CONFIG_I2C_DEBUG_BUS is not set |
@@ -757,6 +806,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y | |||
757 | # CONFIG_USB is not set | 806 | # CONFIG_USB is not set |
758 | 807 | ||
759 | # | 808 | # |
809 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | ||
810 | # | ||
811 | |||
812 | # | ||
760 | # USB Gadget Support | 813 | # USB Gadget Support |
761 | # | 814 | # |
762 | # CONFIG_USB_GADGET is not set | 815 | # CONFIG_USB_GADGET is not set |
@@ -943,9 +996,24 @@ CONFIG_NLS_ISO8859_15=m | |||
943 | # CONFIG_NLS_UTF8 is not set | 996 | # CONFIG_NLS_UTF8 is not set |
944 | 997 | ||
945 | # | 998 | # |
946 | # Profiling support | 999 | # Library routines |
1000 | # | ||
1001 | # CONFIG_CRC_CCITT is not set | ||
1002 | # CONFIG_CRC16 is not set | ||
1003 | CONFIG_CRC32=y | ||
1004 | # CONFIG_LIBCRC32C is not set | ||
1005 | CONFIG_ZLIB_INFLATE=m | ||
1006 | CONFIG_ZLIB_DEFLATE=m | ||
1007 | CONFIG_TEXTSEARCH=y | ||
1008 | CONFIG_TEXTSEARCH_KMP=m | ||
1009 | CONFIG_TEXTSEARCH_BM=m | ||
1010 | CONFIG_TEXTSEARCH_FSM=m | ||
1011 | |||
1012 | # | ||
1013 | # Instrumentation Support | ||
947 | # | 1014 | # |
948 | # CONFIG_PROFILING is not set | 1015 | # CONFIG_PROFILING is not set |
1016 | # CONFIG_KPROBES is not set | ||
949 | 1017 | ||
950 | # | 1018 | # |
951 | # Kernel hacking | 1019 | # Kernel hacking |
@@ -962,13 +1030,14 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y | |||
962 | # CONFIG_DEBUG_KOBJECT is not set | 1030 | # CONFIG_DEBUG_KOBJECT is not set |
963 | # CONFIG_DEBUG_INFO is not set | 1031 | # CONFIG_DEBUG_INFO is not set |
964 | CONFIG_DEBUG_FS=y | 1032 | CONFIG_DEBUG_FS=y |
1033 | # CONFIG_DEBUG_VM is not set | ||
1034 | # CONFIG_RCU_TORTURE_TEST is not set | ||
965 | # CONFIG_DEBUG_STACKOVERFLOW is not set | 1035 | # CONFIG_DEBUG_STACKOVERFLOW is not set |
966 | # CONFIG_KPROBES is not set | ||
967 | # CONFIG_DEBUG_STACK_USAGE is not set | 1036 | # CONFIG_DEBUG_STACK_USAGE is not set |
968 | CONFIG_DEBUGGER=y | 1037 | CONFIG_DEBUGGER=y |
969 | # CONFIG_XMON is not set | 1038 | # CONFIG_XMON is not set |
970 | # CONFIG_PPCDBG is not set | ||
971 | CONFIG_IRQSTACKS=y | 1039 | CONFIG_IRQSTACKS=y |
1040 | # CONFIG_BOOTX_TEXT is not set | ||
972 | 1041 | ||
973 | # | 1042 | # |
974 | # Security options | 1043 | # Security options |
@@ -1008,17 +1077,3 @@ CONFIG_CRYPTO_DEFLATE=m | |||
1008 | # | 1077 | # |
1009 | # Hardware crypto devices | 1078 | # Hardware crypto devices |
1010 | # | 1079 | # |
1011 | |||
1012 | # | ||
1013 | # Library routines | ||
1014 | # | ||
1015 | # CONFIG_CRC_CCITT is not set | ||
1016 | # CONFIG_CRC16 is not set | ||
1017 | CONFIG_CRC32=y | ||
1018 | # CONFIG_LIBCRC32C is not set | ||
1019 | CONFIG_ZLIB_INFLATE=m | ||
1020 | CONFIG_ZLIB_DEFLATE=m | ||
1021 | CONFIG_TEXTSEARCH=y | ||
1022 | CONFIG_TEXTSEARCH_KMP=m | ||
1023 | CONFIG_TEXTSEARCH_BM=m | ||
1024 | CONFIG_TEXTSEARCH_FSM=m | ||
diff --git a/arch/powerpc/configs/g5_defconfig b/arch/powerpc/configs/g5_defconfig index e76854f8c121..e7c23e3902b8 100644 --- a/arch/powerpc/configs/g5_defconfig +++ b/arch/powerpc/configs/g5_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.14 | 3 | # Linux kernel version: 2.6.15-rc1 |
4 | # Mon Nov 7 13:37:59 2005 | 4 | # Tue Nov 15 14:39:20 2005 |
5 | # | 5 | # |
6 | CONFIG_PPC64=y | 6 | CONFIG_PPC64=y |
7 | CONFIG_64BIT=y | 7 | CONFIG_64BIT=y |
@@ -83,6 +83,23 @@ CONFIG_KMOD=y | |||
83 | CONFIG_STOP_MACHINE=y | 83 | CONFIG_STOP_MACHINE=y |
84 | 84 | ||
85 | # | 85 | # |
86 | # Block layer | ||
87 | # | ||
88 | |||
89 | # | ||
90 | # IO Schedulers | ||
91 | # | ||
92 | CONFIG_IOSCHED_NOOP=y | ||
93 | CONFIG_IOSCHED_AS=y | ||
94 | CONFIG_IOSCHED_DEADLINE=y | ||
95 | CONFIG_IOSCHED_CFQ=y | ||
96 | CONFIG_DEFAULT_AS=y | ||
97 | # CONFIG_DEFAULT_DEADLINE is not set | ||
98 | # CONFIG_DEFAULT_CFQ is not set | ||
99 | # CONFIG_DEFAULT_NOOP is not set | ||
100 | CONFIG_DEFAULT_IOSCHED="anticipatory" | ||
101 | |||
102 | # | ||
86 | # Platform support | 103 | # Platform support |
87 | # | 104 | # |
88 | CONFIG_PPC_MULTIPLATFORM=y | 105 | CONFIG_PPC_MULTIPLATFORM=y |
@@ -137,6 +154,7 @@ CONFIG_IRQ_ALL_CPUS=y | |||
137 | # CONFIG_NUMA is not set | 154 | # CONFIG_NUMA is not set |
138 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | 155 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y |
139 | CONFIG_ARCH_FLATMEM_ENABLE=y | 156 | CONFIG_ARCH_FLATMEM_ENABLE=y |
157 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | ||
140 | CONFIG_SELECT_MEMORY_MODEL=y | 158 | CONFIG_SELECT_MEMORY_MODEL=y |
141 | CONFIG_FLATMEM_MANUAL=y | 159 | CONFIG_FLATMEM_MANUAL=y |
142 | # CONFIG_DISCONTIGMEM_MANUAL is not set | 160 | # CONFIG_DISCONTIGMEM_MANUAL is not set |
@@ -144,7 +162,7 @@ CONFIG_FLATMEM_MANUAL=y | |||
144 | CONFIG_FLATMEM=y | 162 | CONFIG_FLATMEM=y |
145 | CONFIG_FLAT_NODE_MEM_MAP=y | 163 | CONFIG_FLAT_NODE_MEM_MAP=y |
146 | # CONFIG_SPARSEMEM_STATIC is not set | 164 | # CONFIG_SPARSEMEM_STATIC is not set |
147 | CONFIG_SPLIT_PTLOCK_CPUS=4 | 165 | CONFIG_SPLIT_PTLOCK_CPUS=4096 |
148 | # CONFIG_PPC_64K_PAGES is not set | 166 | # CONFIG_PPC_64K_PAGES is not set |
149 | # CONFIG_SCHED_SMT is not set | 167 | # CONFIG_SCHED_SMT is not set |
150 | CONFIG_PROC_DEVICETREE=y | 168 | CONFIG_PROC_DEVICETREE=y |
@@ -215,6 +233,10 @@ CONFIG_TCP_CONG_BIC=y | |||
215 | # CONFIG_IPV6 is not set | 233 | # CONFIG_IPV6 is not set |
216 | CONFIG_NETFILTER=y | 234 | CONFIG_NETFILTER=y |
217 | # CONFIG_NETFILTER_DEBUG is not set | 235 | # CONFIG_NETFILTER_DEBUG is not set |
236 | |||
237 | # | ||
238 | # Core Netfilter Configuration | ||
239 | # | ||
218 | # CONFIG_NETFILTER_NETLINK is not set | 240 | # CONFIG_NETFILTER_NETLINK is not set |
219 | 241 | ||
220 | # | 242 | # |
@@ -382,19 +404,6 @@ CONFIG_BLK_DEV_INITRD=y | |||
382 | CONFIG_CDROM_PKTCDVD=m | 404 | CONFIG_CDROM_PKTCDVD=m |
383 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 405 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
384 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 406 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
385 | |||
386 | # | ||
387 | # IO Schedulers | ||
388 | # | ||
389 | CONFIG_IOSCHED_NOOP=y | ||
390 | CONFIG_IOSCHED_AS=y | ||
391 | CONFIG_IOSCHED_DEADLINE=y | ||
392 | CONFIG_IOSCHED_CFQ=y | ||
393 | CONFIG_DEFAULT_AS=y | ||
394 | # CONFIG_DEFAULT_DEADLINE is not set | ||
395 | # CONFIG_DEFAULT_CFQ is not set | ||
396 | # CONFIG_DEFAULT_NOOP is not set | ||
397 | CONFIG_DEFAULT_IOSCHED="anticipatory" | ||
398 | # CONFIG_ATA_OVER_ETH is not set | 407 | # CONFIG_ATA_OVER_ETH is not set |
399 | 408 | ||
400 | # | 409 | # |
@@ -656,7 +665,6 @@ CONFIG_SUNGEM=y | |||
656 | # CONFIG_NET_TULIP is not set | 665 | # CONFIG_NET_TULIP is not set |
657 | # CONFIG_HP100 is not set | 666 | # CONFIG_HP100 is not set |
658 | # CONFIG_NET_PCI is not set | 667 | # CONFIG_NET_PCI is not set |
659 | # CONFIG_FEC_8XX is not set | ||
660 | 668 | ||
661 | # | 669 | # |
662 | # Ethernet (1000 Mbit) | 670 | # Ethernet (1000 Mbit) |
@@ -710,6 +718,7 @@ CONFIG_PPP_ASYNC=m | |||
710 | CONFIG_PPP_SYNC_TTY=m | 718 | CONFIG_PPP_SYNC_TTY=m |
711 | CONFIG_PPP_DEFLATE=m | 719 | CONFIG_PPP_DEFLATE=m |
712 | CONFIG_PPP_BSDCOMP=m | 720 | CONFIG_PPP_BSDCOMP=m |
721 | # CONFIG_PPP_MPPE is not set | ||
713 | CONFIG_PPPOE=m | 722 | CONFIG_PPPOE=m |
714 | # CONFIG_SLIP is not set | 723 | # CONFIG_SLIP is not set |
715 | # CONFIG_NET_FC is not set | 724 | # CONFIG_NET_FC is not set |
@@ -804,6 +813,8 @@ CONFIG_LEGACY_PTY_COUNT=256 | |||
804 | # | 813 | # |
805 | # CONFIG_WATCHDOG is not set | 814 | # CONFIG_WATCHDOG is not set |
806 | # CONFIG_RTC is not set | 815 | # CONFIG_RTC is not set |
816 | CONFIG_GEN_RTC=y | ||
817 | # CONFIG_GEN_RTC_X is not set | ||
807 | # CONFIG_DTLK is not set | 818 | # CONFIG_DTLK is not set |
808 | # CONFIG_R3964 is not set | 819 | # CONFIG_R3964 is not set |
809 | # CONFIG_APPLICOM is not set | 820 | # CONFIG_APPLICOM is not set |
@@ -917,7 +928,6 @@ CONFIG_FB=y | |||
917 | CONFIG_FB_CFB_FILLRECT=y | 928 | CONFIG_FB_CFB_FILLRECT=y |
918 | CONFIG_FB_CFB_COPYAREA=y | 929 | CONFIG_FB_CFB_COPYAREA=y |
919 | CONFIG_FB_CFB_IMAGEBLIT=y | 930 | CONFIG_FB_CFB_IMAGEBLIT=y |
920 | CONFIG_FB_SOFT_CURSOR=y | ||
921 | CONFIG_FB_MACMODES=y | 931 | CONFIG_FB_MACMODES=y |
922 | CONFIG_FB_MODE_HELPERS=y | 932 | CONFIG_FB_MODE_HELPERS=y |
923 | CONFIG_FB_TILEBLITTING=y | 933 | CONFIG_FB_TILEBLITTING=y |
@@ -932,6 +942,7 @@ CONFIG_FB_OF=y | |||
932 | # CONFIG_FB_ASILIANT is not set | 942 | # CONFIG_FB_ASILIANT is not set |
933 | # CONFIG_FB_IMSTT is not set | 943 | # CONFIG_FB_IMSTT is not set |
934 | # CONFIG_FB_VGA16 is not set | 944 | # CONFIG_FB_VGA16 is not set |
945 | # CONFIG_FB_S1D13XXX is not set | ||
935 | CONFIG_FB_NVIDIA=y | 946 | CONFIG_FB_NVIDIA=y |
936 | CONFIG_FB_NVIDIA_I2C=y | 947 | CONFIG_FB_NVIDIA_I2C=y |
937 | # CONFIG_FB_RIVA is not set | 948 | # CONFIG_FB_RIVA is not set |
@@ -950,7 +961,6 @@ CONFIG_FB_RADEON_I2C=y | |||
950 | # CONFIG_FB_VOODOO1 is not set | 961 | # CONFIG_FB_VOODOO1 is not set |
951 | # CONFIG_FB_CYBLA is not set | 962 | # CONFIG_FB_CYBLA is not set |
952 | # CONFIG_FB_TRIDENT is not set | 963 | # CONFIG_FB_TRIDENT is not set |
953 | # CONFIG_FB_S1D13XXX is not set | ||
954 | # CONFIG_FB_VIRTUAL is not set | 964 | # CONFIG_FB_VIRTUAL is not set |
955 | 965 | ||
956 | # | 966 | # |
@@ -959,6 +969,7 @@ CONFIG_FB_RADEON_I2C=y | |||
959 | # CONFIG_VGA_CONSOLE is not set | 969 | # CONFIG_VGA_CONSOLE is not set |
960 | CONFIG_DUMMY_CONSOLE=y | 970 | CONFIG_DUMMY_CONSOLE=y |
961 | CONFIG_FRAMEBUFFER_CONSOLE=y | 971 | CONFIG_FRAMEBUFFER_CONSOLE=y |
972 | # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set | ||
962 | # CONFIG_FONTS is not set | 973 | # CONFIG_FONTS is not set |
963 | CONFIG_FONT_8x8=y | 974 | CONFIG_FONT_8x8=y |
964 | CONFIG_FONT_8x16=y | 975 | CONFIG_FONT_8x16=y |
@@ -1474,10 +1485,11 @@ CONFIG_TEXTSEARCH_BM=m | |||
1474 | CONFIG_TEXTSEARCH_FSM=m | 1485 | CONFIG_TEXTSEARCH_FSM=m |
1475 | 1486 | ||
1476 | # | 1487 | # |
1477 | # Profiling support | 1488 | # Instrumentation Support |
1478 | # | 1489 | # |
1479 | CONFIG_PROFILING=y | 1490 | CONFIG_PROFILING=y |
1480 | CONFIG_OPROFILE=y | 1491 | CONFIG_OPROFILE=y |
1492 | # CONFIG_KPROBES is not set | ||
1481 | 1493 | ||
1482 | # | 1494 | # |
1483 | # Kernel hacking | 1495 | # Kernel hacking |
@@ -1497,7 +1509,6 @@ CONFIG_DEBUG_FS=y | |||
1497 | # CONFIG_DEBUG_VM is not set | 1509 | # CONFIG_DEBUG_VM is not set |
1498 | # CONFIG_RCU_TORTURE_TEST is not set | 1510 | # CONFIG_RCU_TORTURE_TEST is not set |
1499 | # CONFIG_DEBUG_STACKOVERFLOW is not set | 1511 | # CONFIG_DEBUG_STACKOVERFLOW is not set |
1500 | # CONFIG_KPROBES is not set | ||
1501 | # CONFIG_DEBUG_STACK_USAGE is not set | 1512 | # CONFIG_DEBUG_STACK_USAGE is not set |
1502 | # CONFIG_DEBUGGER is not set | 1513 | # CONFIG_DEBUGGER is not set |
1503 | CONFIG_IRQSTACKS=y | 1514 | CONFIG_IRQSTACKS=y |
diff --git a/arch/powerpc/configs/iseries_defconfig b/arch/powerpc/configs/iseries_defconfig index 62e92c7e9e27..5d0866707a75 100644 --- a/arch/powerpc/configs/iseries_defconfig +++ b/arch/powerpc/configs/iseries_defconfig | |||
@@ -1,18 +1,33 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.14-rc4 | 3 | # Linux kernel version: 2.6.15-rc1 |
4 | # Thu Oct 20 08:30:56 2005 | 4 | # Tue Nov 15 14:38:09 2005 |
5 | # | 5 | # |
6 | CONFIG_PPC64=y | ||
6 | CONFIG_64BIT=y | 7 | CONFIG_64BIT=y |
8 | CONFIG_PPC_MERGE=y | ||
7 | CONFIG_MMU=y | 9 | CONFIG_MMU=y |
10 | CONFIG_GENERIC_HARDIRQS=y | ||
8 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | 11 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y |
9 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 12 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
10 | CONFIG_GENERIC_ISA_DMA=y | 13 | CONFIG_PPC=y |
11 | CONFIG_EARLY_PRINTK=y | 14 | CONFIG_EARLY_PRINTK=y |
12 | CONFIG_COMPAT=y | 15 | CONFIG_COMPAT=y |
16 | CONFIG_SYSVIPC_COMPAT=y | ||
13 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y | 17 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y |
14 | CONFIG_ARCH_MAY_HAVE_PC_FDC=y | 18 | CONFIG_ARCH_MAY_HAVE_PC_FDC=y |
15 | CONFIG_FORCE_MAX_ZONEORDER=13 | 19 | |
20 | # | ||
21 | # Processor support | ||
22 | # | ||
23 | # CONFIG_POWER4_ONLY is not set | ||
24 | CONFIG_POWER3=y | ||
25 | CONFIG_POWER4=y | ||
26 | CONFIG_PPC_FPU=y | ||
27 | # CONFIG_ALTIVEC is not set | ||
28 | CONFIG_PPC_STD_MMU=y | ||
29 | CONFIG_SMP=y | ||
30 | CONFIG_NR_CPUS=32 | ||
16 | 31 | ||
17 | # | 32 | # |
18 | # Code maturity level options | 33 | # Code maturity level options |
@@ -68,22 +83,60 @@ CONFIG_MODVERSIONS=y | |||
68 | CONFIG_MODULE_SRCVERSION_ALL=y | 83 | CONFIG_MODULE_SRCVERSION_ALL=y |
69 | CONFIG_KMOD=y | 84 | CONFIG_KMOD=y |
70 | CONFIG_STOP_MACHINE=y | 85 | CONFIG_STOP_MACHINE=y |
71 | CONFIG_SYSVIPC_COMPAT=y | 86 | |
87 | # | ||
88 | # Block layer | ||
89 | # | ||
90 | |||
91 | # | ||
92 | # IO Schedulers | ||
93 | # | ||
94 | CONFIG_IOSCHED_NOOP=y | ||
95 | CONFIG_IOSCHED_AS=y | ||
96 | CONFIG_IOSCHED_DEADLINE=y | ||
97 | CONFIG_IOSCHED_CFQ=y | ||
98 | CONFIG_DEFAULT_AS=y | ||
99 | # CONFIG_DEFAULT_DEADLINE is not set | ||
100 | # CONFIG_DEFAULT_CFQ is not set | ||
101 | # CONFIG_DEFAULT_NOOP is not set | ||
102 | CONFIG_DEFAULT_IOSCHED="anticipatory" | ||
72 | 103 | ||
73 | # | 104 | # |
74 | # Platform support | 105 | # Platform support |
75 | # | 106 | # |
76 | CONFIG_PPC_ISERIES=y | ||
77 | # CONFIG_PPC_MULTIPLATFORM is not set | 107 | # CONFIG_PPC_MULTIPLATFORM is not set |
78 | CONFIG_PPC=y | 108 | CONFIG_PPC_ISERIES=y |
79 | CONFIG_PPC64=y | 109 | # CONFIG_EMBEDDED6xx is not set |
110 | # CONFIG_APUS is not set | ||
111 | # CONFIG_PPC_RTAS is not set | ||
112 | # CONFIG_MMIO_NVRAM is not set | ||
80 | CONFIG_IBMVIO=y | 113 | CONFIG_IBMVIO=y |
81 | # CONFIG_POWER4_ONLY is not set | 114 | # CONFIG_PPC_MPC106 is not set |
115 | # CONFIG_GENERIC_TBSYNC is not set | ||
116 | # CONFIG_CPU_FREQ is not set | ||
117 | # CONFIG_WANT_EARLY_SERIAL is not set | ||
118 | |||
119 | # | ||
120 | # Kernel options | ||
121 | # | ||
122 | # CONFIG_HZ_100 is not set | ||
123 | CONFIG_HZ_250=y | ||
124 | # CONFIG_HZ_1000 is not set | ||
125 | CONFIG_HZ=250 | ||
126 | CONFIG_PREEMPT_NONE=y | ||
127 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
128 | # CONFIG_PREEMPT is not set | ||
129 | # CONFIG_PREEMPT_BKL is not set | ||
130 | CONFIG_BINFMT_ELF=y | ||
131 | # CONFIG_BINFMT_MISC is not set | ||
132 | CONFIG_FORCE_MAX_ZONEORDER=13 | ||
82 | CONFIG_IOMMU_VMERGE=y | 133 | CONFIG_IOMMU_VMERGE=y |
83 | CONFIG_SMP=y | 134 | CONFIG_IRQ_ALL_CPUS=y |
84 | CONFIG_NR_CPUS=32 | 135 | CONFIG_LPARCFG=y |
136 | # CONFIG_NUMA is not set | ||
85 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | 137 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y |
86 | CONFIG_ARCH_FLATMEM_ENABLE=y | 138 | CONFIG_ARCH_FLATMEM_ENABLE=y |
139 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | ||
87 | CONFIG_SELECT_MEMORY_MODEL=y | 140 | CONFIG_SELECT_MEMORY_MODEL=y |
88 | CONFIG_FLATMEM_MANUAL=y | 141 | CONFIG_FLATMEM_MANUAL=y |
89 | # CONFIG_DISCONTIGMEM_MANUAL is not set | 142 | # CONFIG_DISCONTIGMEM_MANUAL is not set |
@@ -91,26 +144,20 @@ CONFIG_FLATMEM_MANUAL=y | |||
91 | CONFIG_FLATMEM=y | 144 | CONFIG_FLATMEM=y |
92 | CONFIG_FLAT_NODE_MEM_MAP=y | 145 | CONFIG_FLAT_NODE_MEM_MAP=y |
93 | # CONFIG_SPARSEMEM_STATIC is not set | 146 | # CONFIG_SPARSEMEM_STATIC is not set |
94 | # CONFIG_NUMA is not set | 147 | CONFIG_SPLIT_PTLOCK_CPUS=4096 |
148 | # CONFIG_PPC_64K_PAGES is not set | ||
95 | # CONFIG_SCHED_SMT is not set | 149 | # CONFIG_SCHED_SMT is not set |
96 | CONFIG_PREEMPT_NONE=y | 150 | CONFIG_PROC_DEVICETREE=y |
97 | # CONFIG_PREEMPT_VOLUNTARY is not set | 151 | # CONFIG_PM is not set |
98 | # CONFIG_PREEMPT is not set | ||
99 | # CONFIG_PREEMPT_BKL is not set | ||
100 | # CONFIG_HZ_100 is not set | ||
101 | CONFIG_HZ_250=y | ||
102 | # CONFIG_HZ_1000 is not set | ||
103 | CONFIG_HZ=250 | ||
104 | CONFIG_GENERIC_HARDIRQS=y | ||
105 | CONFIG_LPARCFG=y | ||
106 | CONFIG_SECCOMP=y | 152 | CONFIG_SECCOMP=y |
107 | CONFIG_BINFMT_ELF=y | ||
108 | # CONFIG_BINFMT_MISC is not set | ||
109 | CONFIG_ISA_DMA_API=y | 153 | CONFIG_ISA_DMA_API=y |
110 | 154 | ||
111 | # | 155 | # |
112 | # Bus Options | 156 | # Bus options |
113 | # | 157 | # |
158 | CONFIG_GENERIC_ISA_DMA=y | ||
159 | # CONFIG_PPC_I8259 is not set | ||
160 | # CONFIG_PPC_INDIRECT_PCI is not set | ||
114 | CONFIG_PCI=y | 161 | CONFIG_PCI=y |
115 | CONFIG_PCI_DOMAINS=y | 162 | CONFIG_PCI_DOMAINS=y |
116 | CONFIG_PCI_LEGACY_PROC=y | 163 | CONFIG_PCI_LEGACY_PROC=y |
@@ -125,6 +172,7 @@ CONFIG_PCI_LEGACY_PROC=y | |||
125 | # PCI Hotplug Support | 172 | # PCI Hotplug Support |
126 | # | 173 | # |
127 | # CONFIG_HOTPLUG_PCI is not set | 174 | # CONFIG_HOTPLUG_PCI is not set |
175 | CONFIG_KERNEL_START=0xc000000000000000 | ||
128 | 176 | ||
129 | # | 177 | # |
130 | # Networking | 178 | # Networking |
@@ -166,6 +214,10 @@ CONFIG_TCP_CONG_BIC=y | |||
166 | # CONFIG_IPV6 is not set | 214 | # CONFIG_IPV6 is not set |
167 | CONFIG_NETFILTER=y | 215 | CONFIG_NETFILTER=y |
168 | # CONFIG_NETFILTER_DEBUG is not set | 216 | # CONFIG_NETFILTER_DEBUG is not set |
217 | |||
218 | # | ||
219 | # Core Netfilter Configuration | ||
220 | # | ||
169 | # CONFIG_NETFILTER_NETLINK is not set | 221 | # CONFIG_NETFILTER_NETLINK is not set |
170 | 222 | ||
171 | # | 223 | # |
@@ -265,6 +317,10 @@ CONFIG_LLC=y | |||
265 | # CONFIG_NET_DIVERT is not set | 317 | # CONFIG_NET_DIVERT is not set |
266 | # CONFIG_ECONET is not set | 318 | # CONFIG_ECONET is not set |
267 | # CONFIG_WAN_ROUTER is not set | 319 | # CONFIG_WAN_ROUTER is not set |
320 | |||
321 | # | ||
322 | # QoS and/or fair queueing | ||
323 | # | ||
268 | # CONFIG_NET_SCHED is not set | 324 | # CONFIG_NET_SCHED is not set |
269 | CONFIG_NET_CLS_ROUTE=y | 325 | CONFIG_NET_CLS_ROUTE=y |
270 | 326 | ||
@@ -326,14 +382,6 @@ CONFIG_BLK_DEV_RAM_COUNT=16 | |||
326 | CONFIG_BLK_DEV_RAM_SIZE=65536 | 382 | CONFIG_BLK_DEV_RAM_SIZE=65536 |
327 | CONFIG_BLK_DEV_INITRD=y | 383 | CONFIG_BLK_DEV_INITRD=y |
328 | # CONFIG_CDROM_PKTCDVD is not set | 384 | # CONFIG_CDROM_PKTCDVD is not set |
329 | |||
330 | # | ||
331 | # IO Schedulers | ||
332 | # | ||
333 | CONFIG_IOSCHED_NOOP=y | ||
334 | CONFIG_IOSCHED_AS=y | ||
335 | CONFIG_IOSCHED_DEADLINE=y | ||
336 | CONFIG_IOSCHED_CFQ=y | ||
337 | # CONFIG_ATA_OVER_ETH is not set | 385 | # CONFIG_ATA_OVER_ETH is not set |
338 | 386 | ||
339 | # | 387 | # |
@@ -377,6 +425,7 @@ CONFIG_SCSI_FC_ATTRS=y | |||
377 | # | 425 | # |
378 | # SCSI low-level drivers | 426 | # SCSI low-level drivers |
379 | # | 427 | # |
428 | # CONFIG_ISCSI_TCP is not set | ||
380 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set | 429 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set |
381 | # CONFIG_SCSI_3W_9XXX is not set | 430 | # CONFIG_SCSI_3W_9XXX is not set |
382 | # CONFIG_SCSI_ACARD is not set | 431 | # CONFIG_SCSI_ACARD is not set |
@@ -454,6 +503,7 @@ CONFIG_DM_ZERO=m | |||
454 | # | 503 | # |
455 | # Macintosh device drivers | 504 | # Macintosh device drivers |
456 | # | 505 | # |
506 | # CONFIG_WINDFARM is not set | ||
457 | 507 | ||
458 | # | 508 | # |
459 | # Network device support | 509 | # Network device support |
@@ -561,6 +611,7 @@ CONFIG_PPP_ASYNC=m | |||
561 | CONFIG_PPP_SYNC_TTY=m | 611 | CONFIG_PPP_SYNC_TTY=m |
562 | CONFIG_PPP_DEFLATE=m | 612 | CONFIG_PPP_DEFLATE=m |
563 | CONFIG_PPP_BSDCOMP=m | 613 | CONFIG_PPP_BSDCOMP=m |
614 | # CONFIG_PPP_MPPE is not set | ||
564 | CONFIG_PPPOE=m | 615 | CONFIG_PPPOE=m |
565 | # CONFIG_SLIP is not set | 616 | # CONFIG_SLIP is not set |
566 | # CONFIG_NET_FC is not set | 617 | # CONFIG_NET_FC is not set |
@@ -643,6 +694,8 @@ CONFIG_LEGACY_PTY_COUNT=256 | |||
643 | # | 694 | # |
644 | # CONFIG_WATCHDOG is not set | 695 | # CONFIG_WATCHDOG is not set |
645 | # CONFIG_RTC is not set | 696 | # CONFIG_RTC is not set |
697 | CONFIG_GEN_RTC=y | ||
698 | # CONFIG_GEN_RTC_X is not set | ||
646 | # CONFIG_DTLK is not set | 699 | # CONFIG_DTLK is not set |
647 | # CONFIG_R3964 is not set | 700 | # CONFIG_R3964 is not set |
648 | # CONFIG_APPLICOM is not set | 701 | # CONFIG_APPLICOM is not set |
@@ -660,6 +713,7 @@ CONFIG_MAX_RAW_DEVS=256 | |||
660 | # TPM devices | 713 | # TPM devices |
661 | # | 714 | # |
662 | # CONFIG_TCG_TPM is not set | 715 | # CONFIG_TCG_TPM is not set |
716 | # CONFIG_TELCLOCK is not set | ||
663 | 717 | ||
664 | # | 718 | # |
665 | # I2C support | 719 | # I2C support |
@@ -713,6 +767,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y | |||
713 | # CONFIG_USB is not set | 767 | # CONFIG_USB is not set |
714 | 768 | ||
715 | # | 769 | # |
770 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | ||
771 | # | ||
772 | |||
773 | # | ||
716 | # USB Gadget Support | 774 | # USB Gadget Support |
717 | # | 775 | # |
718 | # CONFIG_USB_GADGET is not set | 776 | # CONFIG_USB_GADGET is not set |
@@ -917,10 +975,25 @@ CONFIG_VIOTAPE=m | |||
917 | CONFIG_VIOPATH=y | 975 | CONFIG_VIOPATH=y |
918 | 976 | ||
919 | # | 977 | # |
920 | # Profiling support | 978 | # Library routines |
979 | # | ||
980 | CONFIG_CRC_CCITT=m | ||
981 | # CONFIG_CRC16 is not set | ||
982 | CONFIG_CRC32=y | ||
983 | CONFIG_LIBCRC32C=m | ||
984 | CONFIG_ZLIB_INFLATE=y | ||
985 | CONFIG_ZLIB_DEFLATE=m | ||
986 | CONFIG_TEXTSEARCH=y | ||
987 | CONFIG_TEXTSEARCH_KMP=m | ||
988 | CONFIG_TEXTSEARCH_BM=m | ||
989 | CONFIG_TEXTSEARCH_FSM=m | ||
990 | |||
991 | # | ||
992 | # Instrumentation Support | ||
921 | # | 993 | # |
922 | CONFIG_PROFILING=y | 994 | CONFIG_PROFILING=y |
923 | CONFIG_OPROFILE=y | 995 | CONFIG_OPROFILE=y |
996 | # CONFIG_KPROBES is not set | ||
924 | 997 | ||
925 | # | 998 | # |
926 | # Kernel hacking | 999 | # Kernel hacking |
@@ -937,11 +1010,11 @@ CONFIG_DETECT_SOFTLOCKUP=y | |||
937 | # CONFIG_DEBUG_KOBJECT is not set | 1010 | # CONFIG_DEBUG_KOBJECT is not set |
938 | # CONFIG_DEBUG_INFO is not set | 1011 | # CONFIG_DEBUG_INFO is not set |
939 | CONFIG_DEBUG_FS=y | 1012 | CONFIG_DEBUG_FS=y |
1013 | # CONFIG_DEBUG_VM is not set | ||
1014 | # CONFIG_RCU_TORTURE_TEST is not set | ||
940 | CONFIG_DEBUG_STACKOVERFLOW=y | 1015 | CONFIG_DEBUG_STACKOVERFLOW=y |
941 | # CONFIG_KPROBES is not set | ||
942 | CONFIG_DEBUG_STACK_USAGE=y | 1016 | CONFIG_DEBUG_STACK_USAGE=y |
943 | # CONFIG_DEBUGGER is not set | 1017 | # CONFIG_DEBUGGER is not set |
944 | # CONFIG_PPCDBG is not set | ||
945 | CONFIG_IRQSTACKS=y | 1018 | CONFIG_IRQSTACKS=y |
946 | 1019 | ||
947 | # | 1020 | # |
@@ -982,17 +1055,3 @@ CONFIG_CRYPTO_TEST=m | |||
982 | # | 1055 | # |
983 | # Hardware crypto devices | 1056 | # Hardware crypto devices |
984 | # | 1057 | # |
985 | |||
986 | # | ||
987 | # Library routines | ||
988 | # | ||
989 | CONFIG_CRC_CCITT=m | ||
990 | # CONFIG_CRC16 is not set | ||
991 | CONFIG_CRC32=y | ||
992 | CONFIG_LIBCRC32C=m | ||
993 | CONFIG_ZLIB_INFLATE=y | ||
994 | CONFIG_ZLIB_DEFLATE=m | ||
995 | CONFIG_TEXTSEARCH=y | ||
996 | CONFIG_TEXTSEARCH_KMP=m | ||
997 | CONFIG_TEXTSEARCH_BM=m | ||
998 | CONFIG_TEXTSEARCH_FSM=m | ||
diff --git a/arch/powerpc/configs/maple_defconfig b/arch/powerpc/configs/maple_defconfig index 7b480f3d1406..92e42613ef06 100644 --- a/arch/powerpc/configs/maple_defconfig +++ b/arch/powerpc/configs/maple_defconfig | |||
@@ -1,18 +1,32 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.14-rc4 | 3 | # Linux kernel version: 2.6.15-rc1 |
4 | # Thu Oct 20 08:31:24 2005 | 4 | # Tue Nov 15 14:38:58 2005 |
5 | # | 5 | # |
6 | CONFIG_PPC64=y | ||
6 | CONFIG_64BIT=y | 7 | CONFIG_64BIT=y |
8 | CONFIG_PPC_MERGE=y | ||
7 | CONFIG_MMU=y | 9 | CONFIG_MMU=y |
10 | CONFIG_GENERIC_HARDIRQS=y | ||
8 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | 11 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y |
9 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 12 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
10 | CONFIG_GENERIC_ISA_DMA=y | 13 | CONFIG_PPC=y |
11 | CONFIG_EARLY_PRINTK=y | 14 | CONFIG_EARLY_PRINTK=y |
12 | CONFIG_COMPAT=y | 15 | CONFIG_COMPAT=y |
16 | CONFIG_SYSVIPC_COMPAT=y | ||
13 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y | 17 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y |
14 | CONFIG_ARCH_MAY_HAVE_PC_FDC=y | 18 | CONFIG_ARCH_MAY_HAVE_PC_FDC=y |
15 | CONFIG_FORCE_MAX_ZONEORDER=13 | 19 | |
20 | # | ||
21 | # Processor support | ||
22 | # | ||
23 | CONFIG_POWER4_ONLY=y | ||
24 | CONFIG_POWER4=y | ||
25 | CONFIG_PPC_FPU=y | ||
26 | # CONFIG_ALTIVEC is not set | ||
27 | CONFIG_PPC_STD_MMU=y | ||
28 | CONFIG_SMP=y | ||
29 | CONFIG_NR_CPUS=2 | ||
16 | 30 | ||
17 | # | 31 | # |
18 | # Code maturity level options | 32 | # Code maturity level options |
@@ -67,32 +81,67 @@ CONFIG_MODVERSIONS=y | |||
67 | CONFIG_MODULE_SRCVERSION_ALL=y | 81 | CONFIG_MODULE_SRCVERSION_ALL=y |
68 | CONFIG_KMOD=y | 82 | CONFIG_KMOD=y |
69 | CONFIG_STOP_MACHINE=y | 83 | CONFIG_STOP_MACHINE=y |
70 | CONFIG_SYSVIPC_COMPAT=y | 84 | |
85 | # | ||
86 | # Block layer | ||
87 | # | ||
88 | |||
89 | # | ||
90 | # IO Schedulers | ||
91 | # | ||
92 | CONFIG_IOSCHED_NOOP=y | ||
93 | CONFIG_IOSCHED_AS=y | ||
94 | CONFIG_IOSCHED_DEADLINE=y | ||
95 | CONFIG_IOSCHED_CFQ=y | ||
96 | CONFIG_DEFAULT_AS=y | ||
97 | # CONFIG_DEFAULT_DEADLINE is not set | ||
98 | # CONFIG_DEFAULT_CFQ is not set | ||
99 | # CONFIG_DEFAULT_NOOP is not set | ||
100 | CONFIG_DEFAULT_IOSCHED="anticipatory" | ||
71 | 101 | ||
72 | # | 102 | # |
73 | # Platform support | 103 | # Platform support |
74 | # | 104 | # |
75 | # CONFIG_PPC_ISERIES is not set | ||
76 | CONFIG_PPC_MULTIPLATFORM=y | 105 | CONFIG_PPC_MULTIPLATFORM=y |
106 | # CONFIG_PPC_ISERIES is not set | ||
107 | # CONFIG_EMBEDDED6xx is not set | ||
108 | # CONFIG_APUS is not set | ||
77 | # CONFIG_PPC_PSERIES is not set | 109 | # CONFIG_PPC_PSERIES is not set |
78 | # CONFIG_PPC_BPA is not set | ||
79 | # CONFIG_PPC_PMAC is not set | 110 | # CONFIG_PPC_PMAC is not set |
80 | CONFIG_PPC_MAPLE=y | 111 | CONFIG_PPC_MAPLE=y |
81 | CONFIG_PPC=y | 112 | # CONFIG_PPC_CELL is not set |
82 | CONFIG_PPC64=y | ||
83 | CONFIG_PPC_OF=y | 113 | CONFIG_PPC_OF=y |
84 | CONFIG_MPIC=y | ||
85 | # CONFIG_ALTIVEC is not set | ||
86 | CONFIG_KEXEC=y | ||
87 | CONFIG_U3_DART=y | 114 | CONFIG_U3_DART=y |
115 | CONFIG_MPIC=y | ||
116 | # CONFIG_PPC_RTAS is not set | ||
117 | # CONFIG_MMIO_NVRAM is not set | ||
88 | CONFIG_MPIC_BROKEN_U3=y | 118 | CONFIG_MPIC_BROKEN_U3=y |
89 | CONFIG_BOOTX_TEXT=y | 119 | # CONFIG_PPC_MPC106 is not set |
90 | CONFIG_POWER4_ONLY=y | 120 | CONFIG_GENERIC_TBSYNC=y |
121 | # CONFIG_CPU_FREQ is not set | ||
122 | # CONFIG_WANT_EARLY_SERIAL is not set | ||
123 | |||
124 | # | ||
125 | # Kernel options | ||
126 | # | ||
127 | # CONFIG_HZ_100 is not set | ||
128 | CONFIG_HZ_250=y | ||
129 | # CONFIG_HZ_1000 is not set | ||
130 | CONFIG_HZ=250 | ||
131 | CONFIG_PREEMPT_NONE=y | ||
132 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
133 | # CONFIG_PREEMPT is not set | ||
134 | # CONFIG_PREEMPT_BKL is not set | ||
135 | CONFIG_BINFMT_ELF=y | ||
136 | # CONFIG_BINFMT_MISC is not set | ||
137 | CONFIG_FORCE_MAX_ZONEORDER=13 | ||
91 | CONFIG_IOMMU_VMERGE=y | 138 | CONFIG_IOMMU_VMERGE=y |
92 | CONFIG_SMP=y | 139 | CONFIG_KEXEC=y |
93 | CONFIG_NR_CPUS=2 | 140 | CONFIG_IRQ_ALL_CPUS=y |
141 | # CONFIG_NUMA is not set | ||
94 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | 142 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y |
95 | CONFIG_ARCH_FLATMEM_ENABLE=y | 143 | CONFIG_ARCH_FLATMEM_ENABLE=y |
144 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | ||
96 | CONFIG_SELECT_MEMORY_MODEL=y | 145 | CONFIG_SELECT_MEMORY_MODEL=y |
97 | CONFIG_FLATMEM_MANUAL=y | 146 | CONFIG_FLATMEM_MANUAL=y |
98 | # CONFIG_DISCONTIGMEM_MANUAL is not set | 147 | # CONFIG_DISCONTIGMEM_MANUAL is not set |
@@ -100,27 +149,21 @@ CONFIG_FLATMEM_MANUAL=y | |||
100 | CONFIG_FLATMEM=y | 149 | CONFIG_FLATMEM=y |
101 | CONFIG_FLAT_NODE_MEM_MAP=y | 150 | CONFIG_FLAT_NODE_MEM_MAP=y |
102 | # CONFIG_SPARSEMEM_STATIC is not set | 151 | # CONFIG_SPARSEMEM_STATIC is not set |
103 | # CONFIG_NUMA is not set | 152 | CONFIG_SPLIT_PTLOCK_CPUS=4096 |
153 | # CONFIG_PPC_64K_PAGES is not set | ||
104 | # CONFIG_SCHED_SMT is not set | 154 | # CONFIG_SCHED_SMT is not set |
105 | CONFIG_PREEMPT_NONE=y | ||
106 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
107 | # CONFIG_PREEMPT is not set | ||
108 | # CONFIG_PREEMPT_BKL is not set | ||
109 | # CONFIG_HZ_100 is not set | ||
110 | CONFIG_HZ_250=y | ||
111 | # CONFIG_HZ_1000 is not set | ||
112 | CONFIG_HZ=250 | ||
113 | CONFIG_GENERIC_HARDIRQS=y | ||
114 | CONFIG_SECCOMP=y | ||
115 | CONFIG_BINFMT_ELF=y | ||
116 | # CONFIG_BINFMT_MISC is not set | ||
117 | CONFIG_PROC_DEVICETREE=y | 155 | CONFIG_PROC_DEVICETREE=y |
118 | # CONFIG_CMDLINE_BOOL is not set | 156 | # CONFIG_CMDLINE_BOOL is not set |
157 | # CONFIG_PM is not set | ||
158 | CONFIG_SECCOMP=y | ||
119 | CONFIG_ISA_DMA_API=y | 159 | CONFIG_ISA_DMA_API=y |
120 | 160 | ||
121 | # | 161 | # |
122 | # Bus Options | 162 | # Bus options |
123 | # | 163 | # |
164 | CONFIG_GENERIC_ISA_DMA=y | ||
165 | # CONFIG_PPC_I8259 is not set | ||
166 | # CONFIG_PPC_INDIRECT_PCI is not set | ||
124 | CONFIG_PCI=y | 167 | CONFIG_PCI=y |
125 | CONFIG_PCI_DOMAINS=y | 168 | CONFIG_PCI_DOMAINS=y |
126 | CONFIG_PCI_LEGACY_PROC=y | 169 | CONFIG_PCI_LEGACY_PROC=y |
@@ -135,6 +178,7 @@ CONFIG_PCI_LEGACY_PROC=y | |||
135 | # PCI Hotplug Support | 178 | # PCI Hotplug Support |
136 | # | 179 | # |
137 | # CONFIG_HOTPLUG_PCI is not set | 180 | # CONFIG_HOTPLUG_PCI is not set |
181 | CONFIG_KERNEL_START=0xc000000000000000 | ||
138 | 182 | ||
139 | # | 183 | # |
140 | # Networking | 184 | # Networking |
@@ -193,6 +237,10 @@ CONFIG_TCP_CONG_BIC=y | |||
193 | # CONFIG_NET_DIVERT is not set | 237 | # CONFIG_NET_DIVERT is not set |
194 | # CONFIG_ECONET is not set | 238 | # CONFIG_ECONET is not set |
195 | # CONFIG_WAN_ROUTER is not set | 239 | # CONFIG_WAN_ROUTER is not set |
240 | |||
241 | # | ||
242 | # QoS and/or fair queueing | ||
243 | # | ||
196 | # CONFIG_NET_SCHED is not set | 244 | # CONFIG_NET_SCHED is not set |
197 | # CONFIG_NET_CLS_ROUTE is not set | 245 | # CONFIG_NET_CLS_ROUTE is not set |
198 | 246 | ||
@@ -254,14 +302,6 @@ CONFIG_BLK_DEV_RAM_COUNT=16 | |||
254 | CONFIG_BLK_DEV_RAM_SIZE=8192 | 302 | CONFIG_BLK_DEV_RAM_SIZE=8192 |
255 | # CONFIG_BLK_DEV_INITRD is not set | 303 | # CONFIG_BLK_DEV_INITRD is not set |
256 | # CONFIG_CDROM_PKTCDVD is not set | 304 | # CONFIG_CDROM_PKTCDVD is not set |
257 | |||
258 | # | ||
259 | # IO Schedulers | ||
260 | # | ||
261 | CONFIG_IOSCHED_NOOP=y | ||
262 | CONFIG_IOSCHED_AS=y | ||
263 | CONFIG_IOSCHED_DEADLINE=y | ||
264 | CONFIG_IOSCHED_CFQ=y | ||
265 | # CONFIG_ATA_OVER_ETH is not set | 305 | # CONFIG_ATA_OVER_ETH is not set |
266 | 306 | ||
267 | # | 307 | # |
@@ -351,6 +391,7 @@ CONFIG_IDEDMA_AUTO=y | |||
351 | # | 391 | # |
352 | # Macintosh device drivers | 392 | # Macintosh device drivers |
353 | # | 393 | # |
394 | # CONFIG_WINDFARM is not set | ||
354 | 395 | ||
355 | # | 396 | # |
356 | # Network device support | 397 | # Network device support |
@@ -533,6 +574,8 @@ CONFIG_LEGACY_PTY_COUNT=256 | |||
533 | # | 574 | # |
534 | # CONFIG_WATCHDOG is not set | 575 | # CONFIG_WATCHDOG is not set |
535 | # CONFIG_RTC is not set | 576 | # CONFIG_RTC is not set |
577 | CONFIG_GEN_RTC=y | ||
578 | # CONFIG_GEN_RTC_X is not set | ||
536 | # CONFIG_DTLK is not set | 579 | # CONFIG_DTLK is not set |
537 | # CONFIG_R3964 is not set | 580 | # CONFIG_R3964 is not set |
538 | # CONFIG_APPLICOM is not set | 581 | # CONFIG_APPLICOM is not set |
@@ -549,6 +592,7 @@ CONFIG_LEGACY_PTY_COUNT=256 | |||
549 | # TPM devices | 592 | # TPM devices |
550 | # | 593 | # |
551 | # CONFIG_TCG_TPM is not set | 594 | # CONFIG_TCG_TPM is not set |
595 | # CONFIG_TELCLOCK is not set | ||
552 | 596 | ||
553 | # | 597 | # |
554 | # I2C support | 598 | # I2C support |
@@ -599,6 +643,7 @@ CONFIG_I2C_AMD8111=y | |||
599 | # CONFIG_SENSORS_PCF8591 is not set | 643 | # CONFIG_SENSORS_PCF8591 is not set |
600 | # CONFIG_SENSORS_RTC8564 is not set | 644 | # CONFIG_SENSORS_RTC8564 is not set |
601 | # CONFIG_SENSORS_MAX6875 is not set | 645 | # CONFIG_SENSORS_MAX6875 is not set |
646 | # CONFIG_RTC_X1205_I2C is not set | ||
602 | # CONFIG_I2C_DEBUG_CORE is not set | 647 | # CONFIG_I2C_DEBUG_CORE is not set |
603 | # CONFIG_I2C_DEBUG_ALGO is not set | 648 | # CONFIG_I2C_DEBUG_ALGO is not set |
604 | # CONFIG_I2C_DEBUG_BUS is not set | 649 | # CONFIG_I2C_DEBUG_BUS is not set |
@@ -681,12 +726,15 @@ CONFIG_USB_UHCI_HCD=y | |||
681 | # | 726 | # |
682 | # USB Device Class drivers | 727 | # USB Device Class drivers |
683 | # | 728 | # |
684 | # CONFIG_USB_BLUETOOTH_TTY is not set | ||
685 | # CONFIG_USB_ACM is not set | 729 | # CONFIG_USB_ACM is not set |
686 | # CONFIG_USB_PRINTER is not set | 730 | # CONFIG_USB_PRINTER is not set |
687 | 731 | ||
688 | # | 732 | # |
689 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information | 733 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' |
734 | # | ||
735 | |||
736 | # | ||
737 | # may also be needed; see USB_STORAGE Help for more information | ||
690 | # | 738 | # |
691 | # CONFIG_USB_STORAGE is not set | 739 | # CONFIG_USB_STORAGE is not set |
692 | 740 | ||
@@ -776,6 +824,7 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y | |||
776 | # CONFIG_USB_SERIAL_KLSI is not set | 824 | # CONFIG_USB_SERIAL_KLSI is not set |
777 | # CONFIG_USB_SERIAL_KOBIL_SCT is not set | 825 | # CONFIG_USB_SERIAL_KOBIL_SCT is not set |
778 | # CONFIG_USB_SERIAL_MCT_U232 is not set | 826 | # CONFIG_USB_SERIAL_MCT_U232 is not set |
827 | # CONFIG_USB_SERIAL_NOKIA_DKU2 is not set | ||
779 | # CONFIG_USB_SERIAL_PL2303 is not set | 828 | # CONFIG_USB_SERIAL_PL2303 is not set |
780 | # CONFIG_USB_SERIAL_HP4X is not set | 829 | # CONFIG_USB_SERIAL_HP4X is not set |
781 | # CONFIG_USB_SERIAL_SAFE is not set | 830 | # CONFIG_USB_SERIAL_SAFE is not set |
@@ -985,9 +1034,19 @@ CONFIG_NLS_DEFAULT="utf-8" | |||
985 | CONFIG_NLS_UTF8=y | 1034 | CONFIG_NLS_UTF8=y |
986 | 1035 | ||
987 | # | 1036 | # |
988 | # Profiling support | 1037 | # Library routines |
1038 | # | ||
1039 | CONFIG_CRC_CCITT=y | ||
1040 | # CONFIG_CRC16 is not set | ||
1041 | CONFIG_CRC32=y | ||
1042 | # CONFIG_LIBCRC32C is not set | ||
1043 | CONFIG_ZLIB_INFLATE=y | ||
1044 | |||
1045 | # | ||
1046 | # Instrumentation Support | ||
989 | # | 1047 | # |
990 | # CONFIG_PROFILING is not set | 1048 | # CONFIG_PROFILING is not set |
1049 | # CONFIG_KPROBES is not set | ||
991 | 1050 | ||
992 | # | 1051 | # |
993 | # Kernel hacking | 1052 | # Kernel hacking |
@@ -1004,14 +1063,15 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y | |||
1004 | # CONFIG_DEBUG_KOBJECT is not set | 1063 | # CONFIG_DEBUG_KOBJECT is not set |
1005 | # CONFIG_DEBUG_INFO is not set | 1064 | # CONFIG_DEBUG_INFO is not set |
1006 | CONFIG_DEBUG_FS=y | 1065 | CONFIG_DEBUG_FS=y |
1066 | # CONFIG_DEBUG_VM is not set | ||
1067 | # CONFIG_RCU_TORTURE_TEST is not set | ||
1007 | CONFIG_DEBUG_STACKOVERFLOW=y | 1068 | CONFIG_DEBUG_STACKOVERFLOW=y |
1008 | # CONFIG_KPROBES is not set | ||
1009 | CONFIG_DEBUG_STACK_USAGE=y | 1069 | CONFIG_DEBUG_STACK_USAGE=y |
1010 | CONFIG_DEBUGGER=y | 1070 | CONFIG_DEBUGGER=y |
1011 | CONFIG_XMON=y | 1071 | CONFIG_XMON=y |
1012 | CONFIG_XMON_DEFAULT=y | 1072 | CONFIG_XMON_DEFAULT=y |
1013 | # CONFIG_PPCDBG is not set | ||
1014 | # CONFIG_IRQSTACKS is not set | 1073 | # CONFIG_IRQSTACKS is not set |
1074 | CONFIG_BOOTX_TEXT=y | ||
1015 | 1075 | ||
1016 | # | 1076 | # |
1017 | # Security options | 1077 | # Security options |
@@ -1051,12 +1111,3 @@ CONFIG_CRYPTO_DES=y | |||
1051 | # | 1111 | # |
1052 | # Hardware crypto devices | 1112 | # Hardware crypto devices |
1053 | # | 1113 | # |
1054 | |||
1055 | # | ||
1056 | # Library routines | ||
1057 | # | ||
1058 | CONFIG_CRC_CCITT=y | ||
1059 | # CONFIG_CRC16 is not set | ||
1060 | CONFIG_CRC32=y | ||
1061 | # CONFIG_LIBCRC32C is not set | ||
1062 | CONFIG_ZLIB_INFLATE=y | ||
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig index 913962c1dae0..b4745c918a4a 100644 --- a/arch/powerpc/configs/pseries_defconfig +++ b/arch/powerpc/configs/pseries_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.15-rc1 | 3 | # Linux kernel version: 2.6.15-rc1 |
4 | # Mon Nov 14 15:27:00 2005 | 4 | # Tue Nov 15 14:36:55 2005 |
5 | # | 5 | # |
6 | CONFIG_PPC64=y | 6 | CONFIG_PPC64=y |
7 | CONFIG_64BIT=y | 7 | CONFIG_64BIT=y |
@@ -144,7 +144,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13 | |||
144 | CONFIG_IOMMU_VMERGE=y | 144 | CONFIG_IOMMU_VMERGE=y |
145 | CONFIG_HOTPLUG_CPU=y | 145 | CONFIG_HOTPLUG_CPU=y |
146 | CONFIG_KEXEC=y | 146 | CONFIG_KEXEC=y |
147 | # CONFIG_IRQ_ALL_CPUS is not set | 147 | CONFIG_IRQ_ALL_CPUS=y |
148 | CONFIG_PPC_SPLPAR=y | 148 | CONFIG_PPC_SPLPAR=y |
149 | CONFIG_EEH=y | 149 | CONFIG_EEH=y |
150 | CONFIG_SCANLOG=m | 150 | CONFIG_SCANLOG=m |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 3cef1b8f57f0..5a5b24685081 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -30,10 +30,10 @@ | |||
30 | #include <asm/byteorder.h> | 30 | #include <asm/byteorder.h> |
31 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
32 | #include <asm/machdep.h> | 32 | #include <asm/machdep.h> |
33 | #include <asm/udbg.h> | ||
34 | #include <asm/ppc-pci.h> | 33 | #include <asm/ppc-pci.h> |
35 | 34 | ||
36 | #ifdef DEBUG | 35 | #ifdef DEBUG |
36 | #include <asm/udbg.h> | ||
37 | #define DBG(fmt...) udbg_printf(fmt) | 37 | #define DBG(fmt...) udbg_printf(fmt) |
38 | #else | 38 | #else |
39 | #define DBG(fmt...) | 39 | #define DBG(fmt...) |
@@ -187,7 +187,7 @@ static DEFINE_SPINLOCK(hose_spinlock); | |||
187 | /* | 187 | /* |
188 | * pci_controller(phb) initialized common variables. | 188 | * pci_controller(phb) initialized common variables. |
189 | */ | 189 | */ |
190 | void __devinit pci_setup_pci_controller(struct pci_controller *hose) | 190 | static void __devinit pci_setup_pci_controller(struct pci_controller *hose) |
191 | { | 191 | { |
192 | memset(hose, 0, sizeof(struct pci_controller)); | 192 | memset(hose, 0, sizeof(struct pci_controller)); |
193 | 193 | ||
@@ -197,6 +197,65 @@ void __devinit pci_setup_pci_controller(struct pci_controller *hose) | |||
197 | spin_unlock(&hose_spinlock); | 197 | spin_unlock(&hose_spinlock); |
198 | } | 198 | } |
199 | 199 | ||
200 | static void add_linux_pci_domain(struct device_node *dev, | ||
201 | struct pci_controller *phb) | ||
202 | { | ||
203 | struct property *of_prop; | ||
204 | unsigned int size; | ||
205 | |||
206 | of_prop = (struct property *) | ||
207 | get_property(dev, "linux,pci-domain", &size); | ||
208 | if (of_prop != NULL) | ||
209 | return; | ||
210 | WARN_ON(of_prop && size < sizeof(int)); | ||
211 | if (of_prop && size < sizeof(int)) | ||
212 | of_prop = NULL; | ||
213 | size = sizeof(struct property) + sizeof(int); | ||
214 | if (of_prop == NULL) { | ||
215 | if (mem_init_done) | ||
216 | of_prop = kmalloc(size, GFP_KERNEL); | ||
217 | else | ||
218 | of_prop = alloc_bootmem(size); | ||
219 | } | ||
220 | memset(of_prop, 0, sizeof(struct property)); | ||
221 | of_prop->name = "linux,pci-domain"; | ||
222 | of_prop->length = sizeof(int); | ||
223 | of_prop->value = (unsigned char *)&of_prop[1]; | ||
224 | *((int *)of_prop->value) = phb->global_number; | ||
225 | prom_add_property(dev, of_prop); | ||
226 | } | ||
227 | |||
228 | struct pci_controller * pcibios_alloc_controller(struct device_node *dev) | ||
229 | { | ||
230 | struct pci_controller *phb; | ||
231 | |||
232 | if (mem_init_done) | ||
233 | phb = kmalloc(sizeof(struct pci_controller), GFP_KERNEL); | ||
234 | else | ||
235 | phb = alloc_bootmem(sizeof (struct pci_controller)); | ||
236 | if (phb == NULL) | ||
237 | return NULL; | ||
238 | pci_setup_pci_controller(phb); | ||
239 | phb->arch_data = dev; | ||
240 | phb->is_dynamic = mem_init_done; | ||
241 | if (dev) | ||
242 | add_linux_pci_domain(dev, phb); | ||
243 | return phb; | ||
244 | } | ||
245 | |||
246 | void pcibios_free_controller(struct pci_controller *phb) | ||
247 | { | ||
248 | if (phb->arch_data) { | ||
249 | struct device_node *np = phb->arch_data; | ||
250 | int *domain = (int *)get_property(np, | ||
251 | "linux,pci-domain", NULL); | ||
252 | if (domain) | ||
253 | *domain = -1; | ||
254 | } | ||
255 | if (phb->is_dynamic) | ||
256 | kfree(phb); | ||
257 | } | ||
258 | |||
200 | static void __init pcibios_claim_one_bus(struct pci_bus *b) | 259 | static void __init pcibios_claim_one_bus(struct pci_bus *b) |
201 | { | 260 | { |
202 | struct pci_dev *dev; | 261 | struct pci_dev *dev; |
@@ -907,9 +966,10 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
907 | * (size depending on dev->n_addr_cells) | 966 | * (size depending on dev->n_addr_cells) |
908 | * cells 4+5 or 5+6: the size of the range | 967 | * cells 4+5 or 5+6: the size of the range |
909 | */ | 968 | */ |
910 | rlen = 0; | ||
911 | hose->io_base_phys = 0; | ||
912 | ranges = (unsigned int *) get_property(dev, "ranges", &rlen); | 969 | ranges = (unsigned int *) get_property(dev, "ranges", &rlen); |
970 | if (ranges == NULL) | ||
971 | return; | ||
972 | hose->io_base_phys = 0; | ||
913 | while ((rlen -= np * sizeof(unsigned int)) >= 0) { | 973 | while ((rlen -= np * sizeof(unsigned int)) >= 0) { |
914 | res = NULL; | 974 | res = NULL; |
915 | pci_space = ranges[0]; | 975 | pci_space = ranges[0]; |
@@ -1107,6 +1167,8 @@ int remap_bus_range(struct pci_bus *bus) | |||
1107 | 1167 | ||
1108 | if (get_bus_io_range(bus, &start_phys, &start_virt, &size)) | 1168 | if (get_bus_io_range(bus, &start_phys, &start_virt, &size)) |
1109 | return 1; | 1169 | return 1; |
1170 | if (start_phys == 0) | ||
1171 | return 1; | ||
1110 | printk("mapping IO %lx -> %lx, size: %lx\n", start_phys, start_virt, size); | 1172 | printk("mapping IO %lx -> %lx, size: %lx\n", start_phys, start_virt, size); |
1111 | if (__ioremap_explicit(start_phys, start_virt, size, | 1173 | if (__ioremap_explicit(start_phys, start_virt, size, |
1112 | _PAGE_NO_CACHE | _PAGE_GUARDED)) | 1174 | _PAGE_NO_CACHE | _PAGE_GUARDED)) |
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c index 0e5a8e116653..60dec2401c26 100644 --- a/arch/powerpc/kernel/rtas_pci.c +++ b/arch/powerpc/kernel/rtas_pci.c | |||
@@ -304,75 +304,18 @@ static int __devinit setup_phb(struct device_node *dev, | |||
304 | struct pci_controller *phb, | 304 | struct pci_controller *phb, |
305 | unsigned int addr_size_words) | 305 | unsigned int addr_size_words) |
306 | { | 306 | { |
307 | pci_setup_pci_controller(phb); | ||
308 | |||
309 | if (is_python(dev)) | 307 | if (is_python(dev)) |
310 | python_countermeasures(dev, addr_size_words); | 308 | python_countermeasures(dev, addr_size_words); |
311 | 309 | ||
312 | if (phb_set_bus_ranges(dev, phb)) | 310 | if (phb_set_bus_ranges(dev, phb)) |
313 | return 1; | 311 | return 1; |
314 | 312 | ||
315 | phb->arch_data = dev; | ||
316 | phb->ops = &rtas_pci_ops; | 313 | phb->ops = &rtas_pci_ops; |
317 | phb->buid = get_phb_buid(dev); | 314 | phb->buid = get_phb_buid(dev); |
318 | 315 | ||
319 | return 0; | 316 | return 0; |
320 | } | 317 | } |
321 | 318 | ||
322 | static void __devinit add_linux_pci_domain(struct device_node *dev, | ||
323 | struct pci_controller *phb, | ||
324 | struct property *of_prop) | ||
325 | { | ||
326 | memset(of_prop, 0, sizeof(struct property)); | ||
327 | of_prop->name = "linux,pci-domain"; | ||
328 | of_prop->length = sizeof(phb->global_number); | ||
329 | of_prop->value = (unsigned char *)&of_prop[1]; | ||
330 | memcpy(of_prop->value, &phb->global_number, sizeof(phb->global_number)); | ||
331 | prom_add_property(dev, of_prop); | ||
332 | } | ||
333 | |||
334 | static struct pci_controller * __init alloc_phb(struct device_node *dev, | ||
335 | unsigned int addr_size_words) | ||
336 | { | ||
337 | struct pci_controller *phb; | ||
338 | struct property *of_prop; | ||
339 | |||
340 | phb = alloc_bootmem(sizeof(struct pci_controller)); | ||
341 | if (phb == NULL) | ||
342 | return NULL; | ||
343 | |||
344 | of_prop = alloc_bootmem(sizeof(struct property) + | ||
345 | sizeof(phb->global_number)); | ||
346 | if (!of_prop) | ||
347 | return NULL; | ||
348 | |||
349 | if (setup_phb(dev, phb, addr_size_words)) | ||
350 | return NULL; | ||
351 | |||
352 | add_linux_pci_domain(dev, phb, of_prop); | ||
353 | |||
354 | return phb; | ||
355 | } | ||
356 | |||
357 | static struct pci_controller * __devinit alloc_phb_dynamic(struct device_node *dev, unsigned int addr_size_words) | ||
358 | { | ||
359 | struct pci_controller *phb; | ||
360 | |||
361 | phb = (struct pci_controller *)kmalloc(sizeof(struct pci_controller), | ||
362 | GFP_KERNEL); | ||
363 | if (phb == NULL) | ||
364 | return NULL; | ||
365 | |||
366 | if (setup_phb(dev, phb, addr_size_words)) | ||
367 | return NULL; | ||
368 | |||
369 | phb->is_dynamic = 1; | ||
370 | |||
371 | /* TODO: linux,pci-domain? */ | ||
372 | |||
373 | return phb; | ||
374 | } | ||
375 | |||
376 | unsigned long __init find_and_init_phbs(void) | 319 | unsigned long __init find_and_init_phbs(void) |
377 | { | 320 | { |
378 | struct device_node *node; | 321 | struct device_node *node; |
@@ -397,10 +340,10 @@ unsigned long __init find_and_init_phbs(void) | |||
397 | if (node->type == NULL || strcmp(node->type, "pci") != 0) | 340 | if (node->type == NULL || strcmp(node->type, "pci") != 0) |
398 | continue; | 341 | continue; |
399 | 342 | ||
400 | phb = alloc_phb(node, root_size_cells); | 343 | phb = pcibios_alloc_controller(node); |
401 | if (!phb) | 344 | if (!phb) |
402 | continue; | 345 | continue; |
403 | 346 | setup_phb(node, phb, root_size_cells); | |
404 | pci_process_bridge_OF_ranges(phb, node, 0); | 347 | pci_process_bridge_OF_ranges(phb, node, 0); |
405 | pci_setup_phb_io(phb, index == 0); | 348 | pci_setup_phb_io(phb, index == 0); |
406 | #ifdef CONFIG_PPC_PSERIES | 349 | #ifdef CONFIG_PPC_PSERIES |
@@ -446,10 +389,10 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) | |||
446 | root_size_cells = prom_n_size_cells(root); | 389 | root_size_cells = prom_n_size_cells(root); |
447 | 390 | ||
448 | primary = list_empty(&hose_list); | 391 | primary = list_empty(&hose_list); |
449 | phb = alloc_phb_dynamic(dn, root_size_cells); | 392 | phb = pcibios_alloc_controller(dn); |
450 | if (!phb) | 393 | if (!phb) |
451 | return NULL; | 394 | return NULL; |
452 | 395 | setup_phb(dn, phb, root_size_cells); | |
453 | pci_process_bridge_OF_ranges(phb, dn, primary); | 396 | pci_process_bridge_OF_ranges(phb, dn, primary); |
454 | 397 | ||
455 | pci_setup_phb_io_dynamic(phb, primary); | 398 | pci_setup_phb_io_dynamic(phb, primary); |
@@ -505,8 +448,7 @@ int pcibios_remove_root_bus(struct pci_controller *phb) | |||
505 | } | 448 | } |
506 | 449 | ||
507 | list_del(&phb->list_node); | 450 | list_del(&phb->list_node); |
508 | if (phb->is_dynamic) | 451 | pcibios_free_controller(phb); |
509 | kfree(phb); | ||
510 | 452 | ||
511 | return 0; | 453 | return 0; |
512 | } | 454 | } |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 33e7f2c7f194..bd3eb4292b53 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -59,6 +59,7 @@ | |||
59 | #undef DEBUG | 59 | #undef DEBUG |
60 | 60 | ||
61 | #ifdef DEBUG | 61 | #ifdef DEBUG |
62 | #include <asm/udbg.h> | ||
62 | #define DBG(fmt...) udbg_printf(fmt) | 63 | #define DBG(fmt...) udbg_printf(fmt) |
63 | #else | 64 | #else |
64 | #define DBG(fmt...) | 65 | #define DBG(fmt...) |
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 62dfc5b8d765..30374d2f88e5 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -49,15 +49,16 @@ | |||
49 | #include <asm/paca.h> | 49 | #include <asm/paca.h> |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | int smp_hw_index[NR_CPUS]; | ||
53 | struct thread_info *secondary_ti; | ||
54 | |||
55 | #ifdef DEBUG | 52 | #ifdef DEBUG |
53 | #include <asm/udbg.h> | ||
56 | #define DBG(fmt...) udbg_printf(fmt) | 54 | #define DBG(fmt...) udbg_printf(fmt) |
57 | #else | 55 | #else |
58 | #define DBG(fmt...) | 56 | #define DBG(fmt...) |
59 | #endif | 57 | #endif |
60 | 58 | ||
59 | int smp_hw_index[NR_CPUS]; | ||
60 | struct thread_info *secondary_ti; | ||
61 | |||
61 | cpumask_t cpu_possible_map = CPU_MASK_NONE; | 62 | cpumask_t cpu_possible_map = CPU_MASK_NONE; |
62 | cpumask_t cpu_online_map = CPU_MASK_NONE; | 63 | cpumask_t cpu_online_map = CPU_MASK_NONE; |
63 | cpumask_t cpu_sibling_map[NR_CPUS] = { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; | 64 | cpumask_t cpu_sibling_map[NR_CPUS] = { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; |
diff --git a/arch/powerpc/kernel/vdso32/cacheflush.S b/arch/powerpc/kernel/vdso32/cacheflush.S index c8db993574ee..09629aea3e47 100644 --- a/arch/powerpc/kernel/vdso32/cacheflush.S +++ b/arch/powerpc/kernel/vdso32/cacheflush.S | |||
@@ -35,6 +35,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache) | |||
35 | subf r8,r6,r4 /* compute length */ | 35 | subf r8,r6,r4 /* compute length */ |
36 | add r8,r8,r5 /* ensure we get enough */ | 36 | add r8,r8,r5 /* ensure we get enough */ |
37 | srwi. r8,r8,7 /* compute line count */ | 37 | srwi. r8,r8,7 /* compute line count */ |
38 | crclr cr0*4+so | ||
38 | beqlr /* nothing to do? */ | 39 | beqlr /* nothing to do? */ |
39 | mtctr r8 | 40 | mtctr r8 |
40 | mr r3,r6 | 41 | mr r3,r6 |
@@ -58,6 +59,7 @@ V_FUNCTION_END(__kernel_sync_dicache) | |||
58 | */ | 59 | */ |
59 | V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) | 60 | V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) |
60 | .cfi_startproc | 61 | .cfi_startproc |
62 | crclr cr0*4+so | ||
61 | sync | 63 | sync |
62 | isync | 64 | isync |
63 | li r3,0 | 65 | li r3,0 |
diff --git a/arch/powerpc/kernel/vdso32/datapage.S b/arch/powerpc/kernel/vdso32/datapage.S index f6b38472318d..4709f1d9542c 100644 --- a/arch/powerpc/kernel/vdso32/datapage.S +++ b/arch/powerpc/kernel/vdso32/datapage.S | |||
@@ -54,7 +54,6 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) | |||
54 | .cfi_startproc | 54 | .cfi_startproc |
55 | mflr r12 | 55 | mflr r12 |
56 | .cfi_register lr,r12 | 56 | .cfi_register lr,r12 |
57 | |||
58 | mr r4,r3 | 57 | mr r4,r3 |
59 | bl __get_datapage@local | 58 | bl __get_datapage@local |
60 | mtlr r12 | 59 | mtlr r12 |
@@ -63,6 +62,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) | |||
63 | beqlr | 62 | beqlr |
64 | li r0,__NR_syscalls | 63 | li r0,__NR_syscalls |
65 | stw r0,0(r4) | 64 | stw r0,0(r4) |
65 | crclr cr0*4+so | ||
66 | blr | 66 | blr |
67 | .cfi_endproc | 67 | .cfi_endproc |
68 | V_FUNCTION_END(__kernel_get_syscall_map) | 68 | V_FUNCTION_END(__kernel_get_syscall_map) |
@@ -80,6 +80,7 @@ V_FUNCTION_BEGIN(__kernel_get_tbfreq) | |||
80 | lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3) | 80 | lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3) |
81 | lwz r3,CFG_TB_TICKS_PER_SEC(r3) | 81 | lwz r3,CFG_TB_TICKS_PER_SEC(r3) |
82 | mtlr r12 | 82 | mtlr r12 |
83 | crclr cr0*4+so | ||
83 | blr | 84 | blr |
84 | .cfi_endproc | 85 | .cfi_endproc |
85 | V_FUNCTION_END(__kernel_get_tbfreq) | 86 | V_FUNCTION_END(__kernel_get_tbfreq) |
diff --git a/arch/powerpc/kernel/vdso32/gettimeofday.S b/arch/powerpc/kernel/vdso32/gettimeofday.S index 0a32a41d50b0..7eebff03a041 100644 --- a/arch/powerpc/kernel/vdso32/gettimeofday.S +++ b/arch/powerpc/kernel/vdso32/gettimeofday.S | |||
@@ -59,6 +59,7 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday) | |||
59 | stw r5,TZONE_TZ_DSTTIME(r11) | 59 | stw r5,TZONE_TZ_DSTTIME(r11) |
60 | 60 | ||
61 | 1: mtlr r12 | 61 | 1: mtlr r12 |
62 | crclr cr0*4+so | ||
62 | li r3,0 | 63 | li r3,0 |
63 | blr | 64 | blr |
64 | 65 | ||
@@ -117,6 +118,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) | |||
117 | mulli r5,r5,1000 | 118 | mulli r5,r5,1000 |
118 | stw r5,TSPC32_TV_NSEC(r11) | 119 | stw r5,TSPC32_TV_NSEC(r11) |
119 | mtlr r12 | 120 | mtlr r12 |
121 | crclr cr0*4+so | ||
120 | li r3,0 | 122 | li r3,0 |
121 | blr | 123 | blr |
122 | 124 | ||
@@ -185,6 +187,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) | |||
185 | stw r4,TSPC32_TV_NSEC(r11) | 187 | stw r4,TSPC32_TV_NSEC(r11) |
186 | 188 | ||
187 | mtlr r12 | 189 | mtlr r12 |
190 | crclr cr0*4+so | ||
188 | li r3,0 | 191 | li r3,0 |
189 | blr | 192 | blr |
190 | 193 | ||
@@ -219,6 +222,7 @@ V_FUNCTION_BEGIN(__kernel_clock_getres) | |||
219 | 222 | ||
220 | li r3,0 | 223 | li r3,0 |
221 | cmpli cr0,r4,0 | 224 | cmpli cr0,r4,0 |
225 | crclr cr0*4+so | ||
222 | beqlr | 226 | beqlr |
223 | lis r5,CLOCK_REALTIME_RES@h | 227 | lis r5,CLOCK_REALTIME_RES@h |
224 | ori r5,r5,CLOCK_REALTIME_RES@l | 228 | ori r5,r5,CLOCK_REALTIME_RES@l |
diff --git a/arch/powerpc/kernel/vdso64/cacheflush.S b/arch/powerpc/kernel/vdso64/cacheflush.S index d4a0ad28d534..cb4ae0a5edd0 100644 --- a/arch/powerpc/kernel/vdso64/cacheflush.S +++ b/arch/powerpc/kernel/vdso64/cacheflush.S | |||
@@ -35,6 +35,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache) | |||
35 | subf r8,r6,r4 /* compute length */ | 35 | subf r8,r6,r4 /* compute length */ |
36 | add r8,r8,r5 /* ensure we get enough */ | 36 | add r8,r8,r5 /* ensure we get enough */ |
37 | srwi. r8,r8,7 /* compute line count */ | 37 | srwi. r8,r8,7 /* compute line count */ |
38 | crclr cr0*4+so | ||
38 | beqlr /* nothing to do? */ | 39 | beqlr /* nothing to do? */ |
39 | mtctr r8 | 40 | mtctr r8 |
40 | mr r3,r6 | 41 | mr r3,r6 |
@@ -58,6 +59,7 @@ V_FUNCTION_END(__kernel_sync_dicache) | |||
58 | */ | 59 | */ |
59 | V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) | 60 | V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) |
60 | .cfi_startproc | 61 | .cfi_startproc |
62 | crclr cr0*4+so | ||
61 | sync | 63 | sync |
62 | isync | 64 | isync |
63 | li r3,0 | 65 | li r3,0 |
diff --git a/arch/powerpc/kernel/vdso64/datapage.S b/arch/powerpc/kernel/vdso64/datapage.S index 6393e4137bc7..3b2dd7d0c1eb 100644 --- a/arch/powerpc/kernel/vdso64/datapage.S +++ b/arch/powerpc/kernel/vdso64/datapage.S | |||
@@ -54,12 +54,12 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) | |||
54 | .cfi_startproc | 54 | .cfi_startproc |
55 | mflr r12 | 55 | mflr r12 |
56 | .cfi_register lr,r12 | 56 | .cfi_register lr,r12 |
57 | |||
58 | mr r4,r3 | 57 | mr r4,r3 |
59 | bl V_LOCAL_FUNC(__get_datapage) | 58 | bl V_LOCAL_FUNC(__get_datapage) |
60 | mtlr r12 | 59 | mtlr r12 |
61 | addi r3,r3,CFG_SYSCALL_MAP64 | 60 | addi r3,r3,CFG_SYSCALL_MAP64 |
62 | cmpli cr0,r4,0 | 61 | cmpli cr0,r4,0 |
62 | crclr cr0*4+so | ||
63 | beqlr | 63 | beqlr |
64 | li r0,__NR_syscalls | 64 | li r0,__NR_syscalls |
65 | stw r0,0(r4) | 65 | stw r0,0(r4) |
@@ -80,6 +80,7 @@ V_FUNCTION_BEGIN(__kernel_get_tbfreq) | |||
80 | bl V_LOCAL_FUNC(__get_datapage) | 80 | bl V_LOCAL_FUNC(__get_datapage) |
81 | ld r3,CFG_TB_TICKS_PER_SEC(r3) | 81 | ld r3,CFG_TB_TICKS_PER_SEC(r3) |
82 | mtlr r12 | 82 | mtlr r12 |
83 | crclr cr0*4+so | ||
83 | blr | 84 | blr |
84 | .cfi_endproc | 85 | .cfi_endproc |
85 | V_FUNCTION_END(__kernel_get_tbfreq) | 86 | V_FUNCTION_END(__kernel_get_tbfreq) |
diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S index 1a89094715cc..ccaeda5136d1 100644 --- a/arch/powerpc/kernel/vdso64/gettimeofday.S +++ b/arch/powerpc/kernel/vdso64/gettimeofday.S | |||
@@ -52,6 +52,7 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday) | |||
52 | stw r4,TZONE_TZ_MINWEST(r10) | 52 | stw r4,TZONE_TZ_MINWEST(r10) |
53 | stw r5,TZONE_TZ_DSTTIME(r10) | 53 | stw r5,TZONE_TZ_DSTTIME(r10) |
54 | 1: mtlr r12 | 54 | 1: mtlr r12 |
55 | crclr cr0*4+so | ||
55 | li r3,0 /* always success */ | 56 | li r3,0 /* always success */ |
56 | blr | 57 | blr |
57 | .cfi_endproc | 58 | .cfi_endproc |
@@ -99,6 +100,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) | |||
99 | std r0,TSPC64_TV_NSEC(r11) /* store nsec in tp */ | 100 | std r0,TSPC64_TV_NSEC(r11) /* store nsec in tp */ |
100 | 101 | ||
101 | mtlr r12 | 102 | mtlr r12 |
103 | crclr cr0*4+so | ||
102 | li r3,0 | 104 | li r3,0 |
103 | blr | 105 | blr |
104 | 106 | ||
@@ -159,6 +161,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) | |||
159 | std r7,TSPC64_TV_NSEC(r11) | 161 | std r7,TSPC64_TV_NSEC(r11) |
160 | 162 | ||
161 | mtlr r12 | 163 | mtlr r12 |
164 | crclr cr0*4+so | ||
162 | li r3,0 | 165 | li r3,0 |
163 | blr | 166 | blr |
164 | 167 | ||
@@ -193,6 +196,7 @@ V_FUNCTION_BEGIN(__kernel_clock_getres) | |||
193 | 196 | ||
194 | li r3,0 | 197 | li r3,0 |
195 | cmpli cr0,r4,0 | 198 | cmpli cr0,r4,0 |
199 | crclr cr0*4+so | ||
196 | beqlr | 200 | beqlr |
197 | lis r5,CLOCK_REALTIME_RES@h | 201 | lis r5,CLOCK_REALTIME_RES@h |
198 | ori r5,r5,CLOCK_REALTIME_RES@l | 202 | ori r5,r5,CLOCK_REALTIME_RES@l |
diff --git a/arch/powerpc/mm/lmb.c b/arch/powerpc/mm/lmb.c index 9b5aa6808eb8..9584608fd768 100644 --- a/arch/powerpc/mm/lmb.c +++ b/arch/powerpc/mm/lmb.c | |||
@@ -22,35 +22,38 @@ | |||
22 | #include "mmu_decl.h" /* for __max_low_memory */ | 22 | #include "mmu_decl.h" /* for __max_low_memory */ |
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | struct lmb lmb; | ||
26 | |||
27 | #undef DEBUG | 25 | #undef DEBUG |
28 | 26 | ||
27 | #ifdef DEBUG | ||
28 | #include <asm/udbg.h> | ||
29 | #define DBG(fmt...) udbg_printf(fmt) | ||
30 | #else | ||
31 | #define DBG(fmt...) | ||
32 | #endif | ||
33 | |||
34 | struct lmb lmb; | ||
35 | |||
29 | void lmb_dump_all(void) | 36 | void lmb_dump_all(void) |
30 | { | 37 | { |
31 | #ifdef DEBUG | 38 | #ifdef DEBUG |
32 | unsigned long i; | 39 | unsigned long i; |
33 | 40 | ||
34 | udbg_printf("lmb_dump_all:\n"); | 41 | DBG("lmb_dump_all:\n"); |
35 | udbg_printf(" memory.cnt = 0x%lx\n", | 42 | DBG(" memory.cnt = 0x%lx\n", lmb.memory.cnt); |
36 | lmb.memory.cnt); | 43 | DBG(" memory.size = 0x%lx\n", lmb.memory.size); |
37 | udbg_printf(" memory.size = 0x%lx\n", | ||
38 | lmb.memory.size); | ||
39 | for (i=0; i < lmb.memory.cnt ;i++) { | 44 | for (i=0; i < lmb.memory.cnt ;i++) { |
40 | udbg_printf(" memory.region[0x%x].base = 0x%lx\n", | 45 | DBG(" memory.region[0x%x].base = 0x%lx\n", |
41 | i, lmb.memory.region[i].base); | 46 | i, lmb.memory.region[i].base); |
42 | udbg_printf(" .size = 0x%lx\n", | 47 | DBG(" .size = 0x%lx\n", |
43 | lmb.memory.region[i].size); | 48 | lmb.memory.region[i].size); |
44 | } | 49 | } |
45 | 50 | ||
46 | udbg_printf("\n reserved.cnt = 0x%lx\n", | 51 | DBG("\n reserved.cnt = 0x%lx\n", lmb.reserved.cnt); |
47 | lmb.reserved.cnt); | 52 | DBG(" reserved.size = 0x%lx\n", lmb.reserved.size); |
48 | udbg_printf(" reserved.size = 0x%lx\n", | ||
49 | lmb.reserved.size); | ||
50 | for (i=0; i < lmb.reserved.cnt ;i++) { | 53 | for (i=0; i < lmb.reserved.cnt ;i++) { |
51 | udbg_printf(" reserved.region[0x%x].base = 0x%lx\n", | 54 | DBG(" reserved.region[0x%x].base = 0x%lx\n", |
52 | i, lmb.reserved.region[i].base); | 55 | i, lmb.reserved.region[i].base); |
53 | udbg_printf(" .size = 0x%lx\n", | 56 | DBG(" .size = 0x%lx\n", |
54 | lmb.reserved.region[i].size); | 57 | lmb.reserved.region[i].size); |
55 | } | 58 | } |
56 | #endif /* DEBUG */ | 59 | #endif /* DEBUG */ |
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index 4b75131773a6..dafc518fbb83 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c | |||
@@ -244,10 +244,9 @@ unsigned long __init find_and_init_phbs(void) | |||
244 | if (ret == 0) { | 244 | if (ret == 0) { |
245 | printk("bus %d appears to exist\n", bus); | 245 | printk("bus %d appears to exist\n", bus); |
246 | 246 | ||
247 | phb = (struct pci_controller *)kmalloc(sizeof(struct pci_controller), GFP_KERNEL); | 247 | phb = pcibios_alloc_controller(NULL); |
248 | if (phb == NULL) | 248 | if (phb == NULL) |
249 | return -ENOMEM; | 249 | return -ENOMEM; |
250 | pci_setup_pci_controller(phb); | ||
251 | 250 | ||
252 | phb->pci_mem_offset = phb->local_number = bus; | 251 | phb->pci_mem_offset = phb->local_number = bus; |
253 | phb->first_busno = bus; | 252 | phb->first_busno = bus; |
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c index 895aeb3f75d0..f40451da037c 100644 --- a/arch/powerpc/platforms/maple/pci.c +++ b/arch/powerpc/platforms/maple/pci.c | |||
@@ -326,26 +326,12 @@ static int __init add_bridge(struct device_node *dev) | |||
326 | dev->full_name); | 326 | dev->full_name); |
327 | } | 327 | } |
328 | 328 | ||
329 | hose = alloc_bootmem(sizeof(struct pci_controller)); | 329 | hose = pcibios_alloc_controller(dev); |
330 | if (hose == NULL) | 330 | if (hose == NULL) |
331 | return -ENOMEM; | 331 | return -ENOMEM; |
332 | pci_setup_pci_controller(hose); | ||
333 | |||
334 | hose->arch_data = dev; | ||
335 | hose->first_busno = bus_range ? bus_range[0] : 0; | 332 | hose->first_busno = bus_range ? bus_range[0] : 0; |
336 | hose->last_busno = bus_range ? bus_range[1] : 0xff; | 333 | hose->last_busno = bus_range ? bus_range[1] : 0xff; |
337 | 334 | ||
338 | of_prop = alloc_bootmem(sizeof(struct property) + | ||
339 | sizeof(hose->global_number)); | ||
340 | if (of_prop) { | ||
341 | memset(of_prop, 0, sizeof(struct property)); | ||
342 | of_prop->name = "linux,pci-domain"; | ||
343 | of_prop->length = sizeof(hose->global_number); | ||
344 | of_prop->value = (unsigned char *)&of_prop[1]; | ||
345 | memcpy(of_prop->value, &hose->global_number, sizeof(hose->global_number)); | ||
346 | prom_add_property(dev, of_prop); | ||
347 | } | ||
348 | |||
349 | disp_name = NULL; | 335 | disp_name = NULL; |
350 | if (device_is_compatible(dev, "u3-agp")) { | 336 | if (device_is_compatible(dev, "u3-agp")) { |
351 | setup_u3_agp(hose); | 337 | setup_u3_agp(hose); |
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index 10f1d942c661..0d7fa00fcb00 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -2362,6 +2362,14 @@ static struct pmac_mb_def pmac_mb_defs[] = { | |||
2362 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, | 2362 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, |
2363 | PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, | 2363 | PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, |
2364 | }, | 2364 | }, |
2365 | { "PowerBook5,8", "PowerBook G4 15\"", | ||
2366 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, | ||
2367 | PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, | ||
2368 | }, | ||
2369 | { "PowerBook5,9", "PowerBook G4 17\"", | ||
2370 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, | ||
2371 | PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, | ||
2372 | }, | ||
2365 | { "PowerBook6,1", "PowerBook G4 12\"", | 2373 | { "PowerBook6,1", "PowerBook G4 12\"", |
2366 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, | 2374 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, |
2367 | PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, | 2375 | PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, |
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index dfd41b9781a9..443be526cde7 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -640,15 +640,16 @@ static void __init setup_u3_ht(struct pci_controller* hose) | |||
640 | * the reg address cell, we shall fix that by killing struct | 640 | * the reg address cell, we shall fix that by killing struct |
641 | * reg_property and using some accessor functions instead | 641 | * reg_property and using some accessor functions instead |
642 | */ | 642 | */ |
643 | hose->cfg_data = (volatile unsigned char *)ioremap(0xf2000000, 0x02000000); | 643 | hose->cfg_data = (volatile unsigned char *)ioremap(0xf2000000, |
644 | 0x02000000); | ||
644 | 645 | ||
645 | /* | 646 | /* |
646 | * /ht node doesn't expose a "ranges" property, so we "remove" regions that | 647 | * /ht node doesn't expose a "ranges" property, so we "remove" |
647 | * have been allocated to AGP. So far, this version of the code doesn't assign | 648 | * regions that have been allocated to AGP. So far, this version of |
648 | * any of the 0xfxxxxxxx "fine" memory regions to /ht. | 649 | * the code doesn't assign any of the 0xfxxxxxxx "fine" memory regions |
649 | * We need to fix that sooner or later by either parsing all child "ranges" | 650 | * to /ht. We need to fix that sooner or later by either parsing all |
650 | * properties or figuring out the U3 address space decoding logic and | 651 | * child "ranges" properties or figuring out the U3 address space |
651 | * then read its configuration register (if any). | 652 | * decoding logic and then read its configuration register (if any). |
652 | */ | 653 | */ |
653 | hose->io_base_phys = 0xf4000000; | 654 | hose->io_base_phys = 0xf4000000; |
654 | hose->pci_io_size = 0x00400000; | 655 | hose->pci_io_size = 0x00400000; |
@@ -671,10 +672,10 @@ static void __init setup_u3_ht(struct pci_controller* hose) | |||
671 | return; | 672 | return; |
672 | } | 673 | } |
673 | 674 | ||
674 | /* We "remove" the AGP resources from the resources allocated to HT, that | 675 | /* We "remove" the AGP resources from the resources allocated to HT, |
675 | * is we create "holes". However, that code does assumptions that so far | 676 | * that is we create "holes". However, that code does assumptions |
676 | * happen to be true (cross fingers...), typically that resources in the | 677 | * that so far happen to be true (cross fingers...), typically that |
677 | * AGP node are properly ordered | 678 | * resources in the AGP node are properly ordered |
678 | */ | 679 | */ |
679 | cur = 0; | 680 | cur = 0; |
680 | for (i=0; i<3; i++) { | 681 | for (i=0; i<3; i++) { |
@@ -684,23 +685,30 @@ static void __init setup_u3_ht(struct pci_controller* hose) | |||
684 | /* We don't care about "fine" resources */ | 685 | /* We don't care about "fine" resources */ |
685 | if (res->start >= 0xf0000000) | 686 | if (res->start >= 0xf0000000) |
686 | continue; | 687 | continue; |
687 | /* Check if it's just a matter of "shrinking" us in one direction */ | 688 | /* Check if it's just a matter of "shrinking" us in one |
689 | * direction | ||
690 | */ | ||
688 | if (hose->mem_resources[cur].start == res->start) { | 691 | if (hose->mem_resources[cur].start == res->start) { |
689 | DBG("U3/HT: shrink start of %d, %08lx -> %08lx\n", | 692 | DBG("U3/HT: shrink start of %d, %08lx -> %08lx\n", |
690 | cur, hose->mem_resources[cur].start, res->end + 1); | 693 | cur, hose->mem_resources[cur].start, |
694 | res->end + 1); | ||
691 | hose->mem_resources[cur].start = res->end + 1; | 695 | hose->mem_resources[cur].start = res->end + 1; |
692 | continue; | 696 | continue; |
693 | } | 697 | } |
694 | if (hose->mem_resources[cur].end == res->end) { | 698 | if (hose->mem_resources[cur].end == res->end) { |
695 | DBG("U3/HT: shrink end of %d, %08lx -> %08lx\n", | 699 | DBG("U3/HT: shrink end of %d, %08lx -> %08lx\n", |
696 | cur, hose->mem_resources[cur].end, res->start - 1); | 700 | cur, hose->mem_resources[cur].end, |
701 | res->start - 1); | ||
697 | hose->mem_resources[cur].end = res->start - 1; | 702 | hose->mem_resources[cur].end = res->start - 1; |
698 | continue; | 703 | continue; |
699 | } | 704 | } |
700 | /* No, it's not the case, we need a hole */ | 705 | /* No, it's not the case, we need a hole */ |
701 | if (cur == 2) { | 706 | if (cur == 2) { |
702 | /* not enough resources for a hole, we drop part of the range */ | 707 | /* not enough resources for a hole, we drop part |
703 | printk(KERN_WARNING "Running out of resources for /ht host !\n"); | 708 | * of the range |
709 | */ | ||
710 | printk(KERN_WARNING "Running out of resources" | ||
711 | " for /ht host !\n"); | ||
704 | hose->mem_resources[cur].end = res->start - 1; | 712 | hose->mem_resources[cur].end = res->start - 1; |
705 | continue; | 713 | continue; |
706 | } | 714 | } |
@@ -714,17 +722,6 @@ static void __init setup_u3_ht(struct pci_controller* hose) | |||
714 | hose->mem_resources[cur-1].end = res->start - 1; | 722 | hose->mem_resources[cur-1].end = res->start - 1; |
715 | } | 723 | } |
716 | } | 724 | } |
717 | |||
718 | /* XXX this needs to be converged between ppc32 and ppc64... */ | ||
719 | static struct pci_controller * __init pcibios_alloc_controller(void) | ||
720 | { | ||
721 | struct pci_controller *hose; | ||
722 | |||
723 | hose = alloc_bootmem(sizeof(struct pci_controller)); | ||
724 | if (hose) | ||
725 | pci_setup_pci_controller(hose); | ||
726 | return hose; | ||
727 | } | ||
728 | #endif | 725 | #endif |
729 | 726 | ||
730 | /* | 727 | /* |
@@ -756,11 +753,16 @@ static int __init add_bridge(struct device_node *dev) | |||
756 | #endif | 753 | #endif |
757 | bus_range = (int *) get_property(dev, "bus-range", &len); | 754 | bus_range = (int *) get_property(dev, "bus-range", &len); |
758 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 755 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
759 | printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n", | 756 | printk(KERN_WARNING "Can't get bus-range for %s, assume" |
760 | dev->full_name); | 757 | " bus 0\n", dev->full_name); |
761 | } | 758 | } |
762 | 759 | ||
760 | /* XXX Different prototypes, to be merged */ | ||
761 | #ifdef CONFIG_PPC64 | ||
762 | hose = pcibios_alloc_controller(dev); | ||
763 | #else | ||
763 | hose = pcibios_alloc_controller(); | 764 | hose = pcibios_alloc_controller(); |
765 | #endif | ||
764 | if (!hose) | 766 | if (!hose) |
765 | return -ENOMEM; | 767 | return -ENOMEM; |
766 | hose->arch_data = dev; | 768 | hose->arch_data = dev; |
@@ -768,7 +770,7 @@ static int __init add_bridge(struct device_node *dev) | |||
768 | hose->last_busno = bus_range ? bus_range[1] : 0xff; | 770 | hose->last_busno = bus_range ? bus_range[1] : 0xff; |
769 | 771 | ||
770 | disp_name = NULL; | 772 | disp_name = NULL; |
771 | #ifdef CONFIG_POWER4 | 773 | #ifdef CONFIG_PPC64 |
772 | if (device_is_compatible(dev, "u3-agp")) { | 774 | if (device_is_compatible(dev, "u3-agp")) { |
773 | setup_u3_agp(hose); | 775 | setup_u3_agp(hose); |
774 | disp_name = "U3-AGP"; | 776 | disp_name = "U3-AGP"; |
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 5800cde7d5ad..25181c594d73 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #include "plpar_wrappers.h" | 51 | #include "plpar_wrappers.h" |
52 | 52 | ||
53 | #ifdef DEBUG | 53 | #ifdef DEBUG |
54 | #include <asm/udbg.h> | ||
54 | #define DBG(fmt...) udbg_printf(fmt) | 55 | #define DBG(fmt...) udbg_printf(fmt) |
55 | #else | 56 | #else |
56 | #define DBG(fmt...) | 57 | #define DBG(fmt...) |