aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-11-17 11:16:39 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-11-17 11:16:39 -0500
commit67cb6e842e7f1e534a5e0e8708a8779e33b60520 (patch)
tree1c887edd39fddb9016949976fea48f7ca22bae4b
parent8bb6030b62a70edc0cb8129338f83e9063aeaf92 (diff)
parenta2c91a8819e315e9fd1aef3ff57badb6c1be3f80 (diff)
Merge branch 'upstream-fixes'
-rw-r--r--arch/powerpc/Makefile25
-rw-r--r--arch/powerpc/boot/Makefile (renamed from arch/ppc64/boot/Makefile)5
-rw-r--r--arch/powerpc/boot/README (renamed from arch/ppc64/boot/README)0
-rw-r--r--arch/powerpc/boot/addRamDisk.c (renamed from arch/ppc64/boot/addRamDisk.c)0
-rw-r--r--arch/powerpc/boot/addnote.c (renamed from arch/ppc64/boot/addnote.c)0
-rw-r--r--arch/powerpc/boot/crt0.S (renamed from arch/ppc64/boot/crt0.S)0
-rw-r--r--arch/powerpc/boot/div64.S (renamed from arch/ppc64/boot/div64.S)0
-rw-r--r--arch/powerpc/boot/elf.h (renamed from arch/ppc64/boot/elf.h)0
-rw-r--r--arch/powerpc/boot/install.sh (renamed from arch/ppc64/boot/install.sh)0
-rw-r--r--arch/powerpc/boot/main.c (renamed from arch/ppc64/boot/main.c)122
-rw-r--r--arch/powerpc/boot/page.h (renamed from arch/ppc64/boot/page.h)0
-rw-r--r--arch/powerpc/boot/ppc_asm.h (renamed from arch/ppc64/boot/ppc_asm.h)0
-rw-r--r--arch/powerpc/boot/prom.c (renamed from arch/ppc64/boot/prom.c)0
-rw-r--r--arch/powerpc/boot/prom.h (renamed from arch/ppc64/boot/prom.h)0
-rw-r--r--arch/powerpc/boot/stdio.h (renamed from arch/ppc64/boot/stdio.h)0
-rw-r--r--arch/powerpc/boot/string.S (renamed from arch/ppc64/boot/string.S)0
-rw-r--r--arch/powerpc/boot/string.h (renamed from arch/ppc64/boot/string.h)0
-rw-r--r--arch/powerpc/boot/zImage.lds (renamed from arch/ppc64/boot/zImage.lds)0
-rw-r--r--arch/powerpc/configs/cell_defconfig175
-rw-r--r--arch/powerpc/configs/g5_defconfig53
-rw-r--r--arch/powerpc/configs/iseries_defconfig159
-rw-r--r--arch/powerpc/configs/maple_defconfig155
-rw-r--r--arch/powerpc/configs/pseries_defconfig4
-rw-r--r--arch/powerpc/kernel/pci_64.c70
-rw-r--r--arch/powerpc/kernel/rtas_pci.c68
-rw-r--r--arch/powerpc/kernel/setup-common.c1
-rw-r--r--arch/powerpc/kernel/smp.c7
-rw-r--r--arch/powerpc/kernel/vdso32/cacheflush.S2
-rw-r--r--arch/powerpc/kernel/vdso32/datapage.S3
-rw-r--r--arch/powerpc/kernel/vdso32/gettimeofday.S4
-rw-r--r--arch/powerpc/kernel/vdso64/cacheflush.S2
-rw-r--r--arch/powerpc/kernel/vdso64/datapage.S3
-rw-r--r--arch/powerpc/kernel/vdso64/gettimeofday.S4
-rw-r--r--arch/powerpc/mm/lmb.c33
-rw-r--r--arch/powerpc/platforms/iseries/pci.c3
-rw-r--r--arch/powerpc/platforms/maple/pci.c16
-rw-r--r--arch/powerpc/platforms/powermac/feature.c8
-rw-r--r--arch/powerpc/platforms/powermac/pci.c62
-rw-r--r--arch/powerpc/platforms/pseries/smp.c1
-rw-r--r--arch/ppc/kernel/setup.c14
-rw-r--r--arch/ppc/mm/init.c23
-rw-r--r--arch/ppc/xmon/start.c5
-rw-r--r--drivers/media/dvb/cinergyT2/cinergyT2.c9
-rw-r--r--drivers/scsi/Kconfig2
-rw-r--r--drivers/scsi/libata-core.c32
-rw-r--r--drivers/scsi/sata_mv.c991
-rw-r--r--fs/compat_ioctl.c133
-rw-r--r--include/asm-powerpc/ppc-pci.h1
-rw-r--r--include/asm-powerpc/vdso.h2
-rw-r--r--include/asm-ppc/pgalloc.h2
-rw-r--r--include/asm-ppc64/pci-bridge.h14
-rw-r--r--include/linux/compat_ioctl.h67
-rw-r--r--sound/ppc/tumbler.c8
53 files changed, 1708 insertions, 580 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
15HAS_BIARCH := $(call cc-option-yn, -m32) 15HAS_BIARCH := $(call cc-option-yn, -m32)
16 16
17ifeq ($(CONFIG_PPC64),y)
18OLDARCH := ppc64
19SZ := 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
22CROSS32_COMPILE ?= 18CROSS32_COMPILE ?=
23 19
@@ -37,6 +33,10 @@ endif
37 33
38export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY 34export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY
39 35
36ifeq ($(CONFIG_PPC64),y)
37OLDARCH := ppc64
38SZ := 64
39
40new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) 40new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
41 41
42ifeq ($(new_nm),y) 42ifeq ($(new_nm),y)
@@ -139,7 +139,7 @@ drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
139 139
140drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ 140drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
141 141
142defaultimage-$(CONFIG_PPC32) := uImage zImage 142defaultimage-$(CONFIG_PPC32) := zImage
143defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux 143defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
144defaultimage-$(CONFIG_PPC_PSERIES) := zImage 144defaultimage-$(CONFIG_PPC_PSERIES) := zImage
145KBUILD_IMAGE := $(defaultimage-y) 145KBUILD_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
157boot := arch/$(OLDARCH)/boot 157boot := arch/$(ARCH)/boot
158 158
159# urk
160ifeq ($(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)/%,$@)
163else
164$(BOOT_TARGETS): vmlinux
165 $(Q)$(MAKE) ARCH=ppc $(build)=$(boot) $@
166endif
167
168uImage: vmlinux
169 $(Q)$(MAKE) ARCH=$(OLDARCH) $(build)=$(boot)/images $(boot)/images/$@
170 161
171define archhelp 162define 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
181archclean: 171archclean:
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
186archprepare: checkbin 175archprepare: checkbin
diff --git a/arch/ppc64/boot/Makefile b/arch/powerpc/boot/Makefile
index 301bc1536c49..9770f587af73 100644
--- a/arch/ppc64/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -22,7 +22,8 @@
22 22
23 23
24HOSTCC := gcc 24HOSTCC := gcc
25BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem $(shell $(CROSS32CC) -print-file-name=include) -fPIC 25BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \
26 $(shell $(CROSS32CC) -print-file-name=include) -fPIC
26BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc 27BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
27BOOTLFLAGS := -T $(srctree)/$(src)/zImage.lds 28BOOTLFLAGS := -T $(srctree)/$(src)/zImage.lds
28OBJCOPYFLAGS := contents,alloc,load,readonly,data 29OBJCOPYFLAGS := contents,alloc,load,readonly,data
@@ -98,7 +99,7 @@ quiet_cmd_ramdisk = RAMDISK $@
98 cmd_ramdisk = $(obj)/addRamDisk $(obj)/ramdisk.image.gz $< $@ 99 cmd_ramdisk = $(obj)/addRamDisk $(obj)/ramdisk.image.gz $< $@
99 100
100quiet_cmd_stripvm = STRIP $@ 101quiet_cmd_stripvm = STRIP $@
101 cmd_stripvm = $(STRIP) -s $< -o $@ 102 cmd_stripvm = $(STRIP) -s -R .comment $< -o $@
102 103
103vmlinux.strip: vmlinux 104vmlinux.strip: vmlinux
104 $(call if_changed,stripvm) 105 $(call if_changed,stripvm)
diff --git a/arch/ppc64/boot/README b/arch/powerpc/boot/README
index 3e11058760e4..3e11058760e4 100644
--- a/arch/ppc64/boot/README
+++ b/arch/powerpc/boot/README
diff --git a/arch/ppc64/boot/addRamDisk.c b/arch/powerpc/boot/addRamDisk.c
index c02a99952be7..c02a99952be7 100644
--- a/arch/ppc64/boot/addRamDisk.c
+++ b/arch/powerpc/boot/addRamDisk.c
diff --git a/arch/ppc64/boot/addnote.c b/arch/powerpc/boot/addnote.c
index 8041a9845ab7..8041a9845ab7 100644
--- a/arch/ppc64/boot/addnote.c
+++ b/arch/powerpc/boot/addnote.c
diff --git a/arch/ppc64/boot/crt0.S b/arch/powerpc/boot/crt0.S
index 9cc442263939..9cc442263939 100644
--- a/arch/ppc64/boot/crt0.S
+++ b/arch/powerpc/boot/crt0.S
diff --git a/arch/ppc64/boot/div64.S b/arch/powerpc/boot/div64.S
index 722f360a32a9..722f360a32a9 100644
--- a/arch/ppc64/boot/div64.S
+++ b/arch/powerpc/boot/div64.S
diff --git a/arch/ppc64/boot/elf.h b/arch/powerpc/boot/elf.h
index d4828fcf1cb9..d4828fcf1cb9 100644
--- a/arch/ppc64/boot/elf.h
+++ b/arch/powerpc/boot/elf.h
diff --git a/arch/ppc64/boot/install.sh b/arch/powerpc/boot/install.sh
index eacce9590816..eacce9590816 100644
--- a/arch/ppc64/boot/install.sh
+++ b/arch/powerpc/boot/install.sh
diff --git a/arch/ppc64/boot/main.c b/arch/powerpc/boot/main.c
index e0dde24a72ce..64ec93116fa6 100644
--- a/arch/ppc64/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -42,6 +42,8 @@ static struct addr_range vmlinux;
42static struct addr_range vmlinuz; 42static struct addr_range vmlinuz;
43static struct addr_range initrd; 43static struct addr_range initrd;
44 44
45static unsigned long elfoffset;
46
45static char scratch[46912]; /* scratch space for gunzip, from zlib_inflate_workspacesize() */ 47static char scratch[46912]; /* scratch space for gunzip, from zlib_inflate_workspacesize() */
46static char elfheader[256]; 48static char elfheader[256];
47 49
@@ -131,13 +133,70 @@ static unsigned long try_claim(unsigned long size)
131 return addr; 133 return addr;
132} 134}
133 135
136static 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
166static 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
134void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) 196void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
135{ 197{
136 unsigned long i;
137 int len; 198 int len;
138 kernel_entry_t kernel_entry; 199 kernel_entry_t kernel_entry;
139 Elf64_Ehdr *elf64;
140 Elf64_Phdr *elf64ph;
141 200
142 memset(__bss_start, 0, _end - __bss_start); 201 memset(__bss_start, 0, _end - __bss_start);
143 202
@@ -153,6 +212,22 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
153 212
154 printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", _start, sp); 213 printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", _start, sp);
155 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
156 /* 231 /*
157 * The first available claim_base must be above the end of the 232 * The first available claim_base must be above the end of the
158 * the loaded kernel wrapper file (_start to _end includes the 233 * the loaded kernel wrapper file (_start to _end includes the
@@ -172,46 +247,11 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
172 claim_base = PROG_START; 247 claim_base = PROG_START;
173#endif 248#endif
174 249
175 vmlinuz.addr = (unsigned long)_vmlinux_start;
176 vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start);
177
178 /* gunzip the ELF header of the kernel */
179 if (*(unsigned short *)vmlinuz.addr == 0x1f8b) {
180 len = vmlinuz.size;
181 gunzip(elfheader, sizeof(elfheader),
182 (unsigned char *)vmlinuz.addr, &len);
183 } else
184 memcpy(elfheader, (const void *)vmlinuz.addr, sizeof(elfheader));
185
186 elf64 = (Elf64_Ehdr *)elfheader;
187 if ( elf64->e_ident[EI_MAG0] != ELFMAG0 ||
188 elf64->e_ident[EI_MAG1] != ELFMAG1 ||
189 elf64->e_ident[EI_MAG2] != ELFMAG2 ||
190 elf64->e_ident[EI_MAG3] != ELFMAG3 ||
191 elf64->e_ident[EI_CLASS] != ELFCLASS64 ||
192 elf64->e_ident[EI_DATA] != ELFDATA2MSB ||
193 elf64->e_type != ET_EXEC ||
194 elf64->e_machine != EM_PPC64 )
195 {
196 printf("Error: not a valid PPC64 ELF file!\n\r");
197 exit();
198 }
199
200 elf64ph = (Elf64_Phdr *)((unsigned long)elf64 +
201 (unsigned long)elf64->e_phoff);
202 for(i=0; i < (unsigned int)elf64->e_phnum ;i++,elf64ph++) {
203 if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0)
204 break;
205 }
206 vmlinux.size = (unsigned long)elf64ph->p_filesz +
207 (unsigned long)elf64ph->p_offset;
208 /* We need to claim the memsize plus the file offset since gzip 250 /* We need to claim the memsize plus the file offset since gzip
209 * will expand the header (file offset), then the kernel, then 251 * will expand the header (file offset), then the kernel, then
210 * possible rubbish we don't care about. But the kernel bss must 252 * possible rubbish we don't care about. But the kernel bss must
211 * be claimed (it will be zero'd by the kernel itself) 253 * be claimed (it will be zero'd by the kernel itself)
212 */ 254 */
213 vmlinux.memsize = (unsigned long)elf64ph->p_memsz +
214 (unsigned long)elf64ph->p_offset;
215 printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux.memsize); 255 printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux.memsize);
216 vmlinux.addr = try_claim(vmlinux.memsize); 256 vmlinux.addr = try_claim(vmlinux.memsize);
217 if (vmlinux.addr == 0) { 257 if (vmlinux.addr == 0) {
@@ -254,9 +294,9 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
254 /* Skip over the ELF header */ 294 /* Skip over the ELF header */
255#ifdef DEBUG 295#ifdef DEBUG
256 printf("... skipping 0x%lx bytes of ELF header\n\r", 296 printf("... skipping 0x%lx bytes of ELF header\n\r",
257 (unsigned long)elf64ph->p_offset); 297 elfoffset);
258#endif 298#endif
259 vmlinux.addr += (unsigned long)elf64ph->p_offset; 299 vmlinux.addr += elfoffset;
260 300
261 flush_cache((void *)vmlinux.addr, vmlinux.size); 301 flush_cache((void *)vmlinux.addr, vmlinux.size);
262 302
@@ -272,7 +312,7 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
272 (unsigned long)prom, NULL); 312 (unsigned long)prom, NULL);
273#endif 313#endif
274 314
275 kernel_entry( a1, a2, prom, NULL ); 315 kernel_entry(a1, a2, prom, NULL);
276 316
277 printf("Error: Linux kernel returned to zImage bootloader!\n\r"); 317 printf("Error: Linux kernel returned to zImage bootloader!\n\r");
278 318
diff --git a/arch/ppc64/boot/page.h b/arch/powerpc/boot/page.h
index 14eca30fef64..14eca30fef64 100644
--- a/arch/ppc64/boot/page.h
+++ b/arch/powerpc/boot/page.h
diff --git a/arch/ppc64/boot/ppc_asm.h b/arch/powerpc/boot/ppc_asm.h
index 1c2c2817f9b7..1c2c2817f9b7 100644
--- a/arch/ppc64/boot/ppc_asm.h
+++ b/arch/powerpc/boot/ppc_asm.h
diff --git a/arch/ppc64/boot/prom.c b/arch/powerpc/boot/prom.c
index 4bea2f4dcb06..4bea2f4dcb06 100644
--- a/arch/ppc64/boot/prom.c
+++ b/arch/powerpc/boot/prom.c
diff --git a/arch/ppc64/boot/prom.h b/arch/powerpc/boot/prom.h
index 96ab5aec740c..96ab5aec740c 100644
--- a/arch/ppc64/boot/prom.h
+++ b/arch/powerpc/boot/prom.h
diff --git a/arch/ppc64/boot/stdio.h b/arch/powerpc/boot/stdio.h
index 24bd3a8dee94..24bd3a8dee94 100644
--- a/arch/ppc64/boot/stdio.h
+++ b/arch/powerpc/boot/stdio.h
diff --git a/arch/ppc64/boot/string.S b/arch/powerpc/boot/string.S
index b1eeaed7db17..b1eeaed7db17 100644
--- a/arch/ppc64/boot/string.S
+++ b/arch/powerpc/boot/string.S
diff --git a/arch/ppc64/boot/string.h b/arch/powerpc/boot/string.h
index 9fdff1cc0d70..9fdff1cc0d70 100644
--- a/arch/ppc64/boot/string.h
+++ b/arch/powerpc/boot/string.h
diff --git a/arch/ppc64/boot/zImage.lds b/arch/powerpc/boot/zImage.lds
index 4b6bb3ffe3dc..4b6bb3ffe3dc 100644
--- a/arch/ppc64/boot/zImage.lds
+++ b/arch/powerpc/boot/zImage.lds
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#
6CONFIG_PPC64=y
6CONFIG_64BIT=y 7CONFIG_64BIT=y
8CONFIG_PPC_MERGE=y
7CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y 11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 12CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_GENERIC_ISA_DMA=y 13CONFIG_PPC=y
11CONFIG_EARLY_PRINTK=y 14CONFIG_EARLY_PRINTK=y
12CONFIG_COMPAT=y 15CONFIG_COMPAT=y
16CONFIG_SYSVIPC_COMPAT=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=y 18CONFIG_ARCH_MAY_HAVE_PC_FDC=y
15CONFIG_FORCE_MAX_ZONEORDER=13 19
20#
21# Processor support
22#
23# CONFIG_POWER4_ONLY is not set
24CONFIG_POWER3=y
25CONFIG_POWER4=y
26CONFIG_PPC_FPU=y
27CONFIG_ALTIVEC=y
28CONFIG_PPC_STD_MMU=y
29CONFIG_SMP=y
30CONFIG_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
68CONFIG_STOP_MACHINE=y 83CONFIG_STOP_MACHINE=y
69CONFIG_SYSVIPC_COMPAT=y 84
85#
86# Block layer
87#
88
89#
90# IO Schedulers
91#
92CONFIG_IOSCHED_NOOP=y
93CONFIG_IOSCHED_AS=y
94CONFIG_IOSCHED_DEADLINE=y
95CONFIG_IOSCHED_CFQ=y
96CONFIG_DEFAULT_AS=y
97# CONFIG_DEFAULT_DEADLINE is not set
98# CONFIG_DEFAULT_CFQ is not set
99# CONFIG_DEFAULT_NOOP is not set
100CONFIG_DEFAULT_IOSCHED="anticipatory"
70 101
71# 102#
72# Platform support 103# Platform support
73# 104#
74# CONFIG_PPC_ISERIES is not set
75CONFIG_PPC_MULTIPLATFORM=y 105CONFIG_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
77CONFIG_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
80CONFIG_PPC=y 112CONFIG_PPC_CELL=y
81CONFIG_PPC64=y
82CONFIG_PPC_OF=y 113CONFIG_PPC_OF=y
83CONFIG_BPA_IIC=y
84CONFIG_ALTIVEC=y
85CONFIG_KEXEC=y
86# CONFIG_U3_DART is not set 114# CONFIG_U3_DART is not set
87# CONFIG_BOOTX_TEXT is not set 115CONFIG_PPC_RTAS=y
88# CONFIG_POWER4_ONLY is not set 116# CONFIG_RTAS_ERROR_LOGGING is not set
117CONFIG_RTAS_PROC=y
118CONFIG_RTAS_FLASH=y
119CONFIG_MMIO_NVRAM=y
120CONFIG_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
130CONFIG_HZ_250=y
131# CONFIG_HZ_1000 is not set
132CONFIG_HZ=250
133CONFIG_PREEMPT_NONE=y
134# CONFIG_PREEMPT_VOLUNTARY is not set
135# CONFIG_PREEMPT is not set
136CONFIG_PREEMPT_BKL=y
137CONFIG_BINFMT_ELF=y
138# CONFIG_BINFMT_MISC is not set
139CONFIG_FORCE_MAX_ZONEORDER=13
89# CONFIG_IOMMU_VMERGE is not set 140# CONFIG_IOMMU_VMERGE is not set
90CONFIG_SMP=y 141CONFIG_KEXEC=y
91CONFIG_NR_CPUS=4 142CONFIG_IRQ_ALL_CPUS=y
143# CONFIG_NUMA is not set
92CONFIG_ARCH_SELECT_MEMORY_MODEL=y 144CONFIG_ARCH_SELECT_MEMORY_MODEL=y
93CONFIG_ARCH_FLATMEM_ENABLE=y 145CONFIG_ARCH_FLATMEM_ENABLE=y
146CONFIG_ARCH_SPARSEMEM_ENABLE=y
94CONFIG_SELECT_MEMORY_MODEL=y 147CONFIG_SELECT_MEMORY_MODEL=y
95CONFIG_FLATMEM_MANUAL=y 148CONFIG_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
98CONFIG_FLATMEM=y 151CONFIG_FLATMEM=y
99CONFIG_FLAT_NODE_MEM_MAP=y 152CONFIG_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 154CONFIG_SPLIT_PTLOCK_CPUS=4096
155# CONFIG_PPC_64K_PAGES is not set
102CONFIG_SCHED_SMT=y 156CONFIG_SCHED_SMT=y
103CONFIG_PREEMPT_NONE=y
104# CONFIG_PREEMPT_VOLUNTARY is not set
105# CONFIG_PREEMPT is not set
106CONFIG_PREEMPT_BKL=y
107# CONFIG_HZ_100 is not set
108CONFIG_HZ_250=y
109# CONFIG_HZ_1000 is not set
110CONFIG_HZ=250
111CONFIG_GENERIC_HARDIRQS=y
112CONFIG_PPC_RTAS=y
113CONFIG_RTAS_PROC=y
114CONFIG_RTAS_FLASH=y
115CONFIG_SECCOMP=y
116CONFIG_BINFMT_ELF=y
117# CONFIG_BINFMT_MISC is not set
118CONFIG_PROC_DEVICETREE=y 157CONFIG_PROC_DEVICETREE=y
119# CONFIG_CMDLINE_BOOL is not set 158# CONFIG_CMDLINE_BOOL is not set
159# CONFIG_PM is not set
160CONFIG_SECCOMP=y
120CONFIG_ISA_DMA_API=y 161CONFIG_ISA_DMA_API=y
121 162
122# 163#
123# Bus Options 164# Bus options
124# 165#
166CONFIG_GENERIC_ISA_DMA=y
167# CONFIG_PPC_I8259 is not set
168# CONFIG_PPC_INDIRECT_PCI is not set
125CONFIG_PCI=y 169CONFIG_PCI=y
126CONFIG_PCI_DOMAINS=y 170CONFIG_PCI_DOMAINS=y
127CONFIG_PCI_LEGACY_PROC=y 171CONFIG_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
183CONFIG_KERNEL_START=0xc000000000000000
139 184
140# 185#
141# Networking 186# Networking
@@ -183,6 +228,10 @@ CONFIG_INET6_TUNNEL=m
183CONFIG_IPV6_TUNNEL=m 228CONFIG_IPV6_TUNNEL=m
184CONFIG_NETFILTER=y 229CONFIG_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
288CONFIG_NET_CLS_ROUTE=y 341CONFIG_NET_CLS_ROUTE=y
289 342
@@ -345,14 +398,6 @@ CONFIG_BLK_DEV_RAM_COUNT=16
345CONFIG_BLK_DEV_RAM_SIZE=131072 398CONFIG_BLK_DEV_RAM_SIZE=131072
346CONFIG_BLK_DEV_INITRD=y 399CONFIG_BLK_DEV_INITRD=y
347# CONFIG_CDROM_PKTCDVD is not set 400# CONFIG_CDROM_PKTCDVD is not set
348
349#
350# IO Schedulers
351#
352CONFIG_IOSCHED_NOOP=y
353CONFIG_IOSCHED_AS=y
354CONFIG_IOSCHED_DEADLINE=y
355CONFIG_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
628CONFIG_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
681CONFIG_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
1003CONFIG_CRC32=y
1004# CONFIG_LIBCRC32C is not set
1005CONFIG_ZLIB_INFLATE=m
1006CONFIG_ZLIB_DEFLATE=m
1007CONFIG_TEXTSEARCH=y
1008CONFIG_TEXTSEARCH_KMP=m
1009CONFIG_TEXTSEARCH_BM=m
1010CONFIG_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
964CONFIG_DEBUG_FS=y 1032CONFIG_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
968CONFIG_DEBUGGER=y 1037CONFIG_DEBUGGER=y
969# CONFIG_XMON is not set 1038# CONFIG_XMON is not set
970# CONFIG_PPCDBG is not set
971CONFIG_IRQSTACKS=y 1039CONFIG_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
1017CONFIG_CRC32=y
1018# CONFIG_LIBCRC32C is not set
1019CONFIG_ZLIB_INFLATE=m
1020CONFIG_ZLIB_DEFLATE=m
1021CONFIG_TEXTSEARCH=y
1022CONFIG_TEXTSEARCH_KMP=m
1023CONFIG_TEXTSEARCH_BM=m
1024CONFIG_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#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -83,6 +83,23 @@ CONFIG_KMOD=y
83CONFIG_STOP_MACHINE=y 83CONFIG_STOP_MACHINE=y
84 84
85# 85#
86# Block layer
87#
88
89#
90# IO Schedulers
91#
92CONFIG_IOSCHED_NOOP=y
93CONFIG_IOSCHED_AS=y
94CONFIG_IOSCHED_DEADLINE=y
95CONFIG_IOSCHED_CFQ=y
96CONFIG_DEFAULT_AS=y
97# CONFIG_DEFAULT_DEADLINE is not set
98# CONFIG_DEFAULT_CFQ is not set
99# CONFIG_DEFAULT_NOOP is not set
100CONFIG_DEFAULT_IOSCHED="anticipatory"
101
102#
86# Platform support 103# Platform support
87# 104#
88CONFIG_PPC_MULTIPLATFORM=y 105CONFIG_PPC_MULTIPLATFORM=y
@@ -137,6 +154,7 @@ CONFIG_IRQ_ALL_CPUS=y
137# CONFIG_NUMA is not set 154# CONFIG_NUMA is not set
138CONFIG_ARCH_SELECT_MEMORY_MODEL=y 155CONFIG_ARCH_SELECT_MEMORY_MODEL=y
139CONFIG_ARCH_FLATMEM_ENABLE=y 156CONFIG_ARCH_FLATMEM_ENABLE=y
157CONFIG_ARCH_SPARSEMEM_ENABLE=y
140CONFIG_SELECT_MEMORY_MODEL=y 158CONFIG_SELECT_MEMORY_MODEL=y
141CONFIG_FLATMEM_MANUAL=y 159CONFIG_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
144CONFIG_FLATMEM=y 162CONFIG_FLATMEM=y
145CONFIG_FLAT_NODE_MEM_MAP=y 163CONFIG_FLAT_NODE_MEM_MAP=y
146# CONFIG_SPARSEMEM_STATIC is not set 164# CONFIG_SPARSEMEM_STATIC is not set
147CONFIG_SPLIT_PTLOCK_CPUS=4 165CONFIG_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
150CONFIG_PROC_DEVICETREE=y 168CONFIG_PROC_DEVICETREE=y
@@ -215,6 +233,10 @@ CONFIG_TCP_CONG_BIC=y
215# CONFIG_IPV6 is not set 233# CONFIG_IPV6 is not set
216CONFIG_NETFILTER=y 234CONFIG_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
382CONFIG_CDROM_PKTCDVD=m 404CONFIG_CDROM_PKTCDVD=m
383CONFIG_CDROM_PKTCDVD_BUFFERS=8 405CONFIG_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#
389CONFIG_IOSCHED_NOOP=y
390CONFIG_IOSCHED_AS=y
391CONFIG_IOSCHED_DEADLINE=y
392CONFIG_IOSCHED_CFQ=y
393CONFIG_DEFAULT_AS=y
394# CONFIG_DEFAULT_DEADLINE is not set
395# CONFIG_DEFAULT_CFQ is not set
396# CONFIG_DEFAULT_NOOP is not set
397CONFIG_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
710CONFIG_PPP_SYNC_TTY=m 718CONFIG_PPP_SYNC_TTY=m
711CONFIG_PPP_DEFLATE=m 719CONFIG_PPP_DEFLATE=m
712CONFIG_PPP_BSDCOMP=m 720CONFIG_PPP_BSDCOMP=m
721# CONFIG_PPP_MPPE is not set
713CONFIG_PPPOE=m 722CONFIG_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
816CONFIG_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
917CONFIG_FB_CFB_FILLRECT=y 928CONFIG_FB_CFB_FILLRECT=y
918CONFIG_FB_CFB_COPYAREA=y 929CONFIG_FB_CFB_COPYAREA=y
919CONFIG_FB_CFB_IMAGEBLIT=y 930CONFIG_FB_CFB_IMAGEBLIT=y
920CONFIG_FB_SOFT_CURSOR=y
921CONFIG_FB_MACMODES=y 931CONFIG_FB_MACMODES=y
922CONFIG_FB_MODE_HELPERS=y 932CONFIG_FB_MODE_HELPERS=y
923CONFIG_FB_TILEBLITTING=y 933CONFIG_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
935CONFIG_FB_NVIDIA=y 946CONFIG_FB_NVIDIA=y
936CONFIG_FB_NVIDIA_I2C=y 947CONFIG_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
960CONFIG_DUMMY_CONSOLE=y 970CONFIG_DUMMY_CONSOLE=y
961CONFIG_FRAMEBUFFER_CONSOLE=y 971CONFIG_FRAMEBUFFER_CONSOLE=y
972# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
962# CONFIG_FONTS is not set 973# CONFIG_FONTS is not set
963CONFIG_FONT_8x8=y 974CONFIG_FONT_8x8=y
964CONFIG_FONT_8x16=y 975CONFIG_FONT_8x16=y
@@ -1474,10 +1485,11 @@ CONFIG_TEXTSEARCH_BM=m
1474CONFIG_TEXTSEARCH_FSM=m 1485CONFIG_TEXTSEARCH_FSM=m
1475 1486
1476# 1487#
1477# Profiling support 1488# Instrumentation Support
1478# 1489#
1479CONFIG_PROFILING=y 1490CONFIG_PROFILING=y
1480CONFIG_OPROFILE=y 1491CONFIG_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
1503CONFIG_IRQSTACKS=y 1514CONFIG_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#
6CONFIG_PPC64=y
6CONFIG_64BIT=y 7CONFIG_64BIT=y
8CONFIG_PPC_MERGE=y
7CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y 11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 12CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_GENERIC_ISA_DMA=y 13CONFIG_PPC=y
11CONFIG_EARLY_PRINTK=y 14CONFIG_EARLY_PRINTK=y
12CONFIG_COMPAT=y 15CONFIG_COMPAT=y
16CONFIG_SYSVIPC_COMPAT=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=y 18CONFIG_ARCH_MAY_HAVE_PC_FDC=y
15CONFIG_FORCE_MAX_ZONEORDER=13 19
20#
21# Processor support
22#
23# CONFIG_POWER4_ONLY is not set
24CONFIG_POWER3=y
25CONFIG_POWER4=y
26CONFIG_PPC_FPU=y
27# CONFIG_ALTIVEC is not set
28CONFIG_PPC_STD_MMU=y
29CONFIG_SMP=y
30CONFIG_NR_CPUS=32
16 31
17# 32#
18# Code maturity level options 33# Code maturity level options
@@ -68,22 +83,60 @@ CONFIG_MODVERSIONS=y
68CONFIG_MODULE_SRCVERSION_ALL=y 83CONFIG_MODULE_SRCVERSION_ALL=y
69CONFIG_KMOD=y 84CONFIG_KMOD=y
70CONFIG_STOP_MACHINE=y 85CONFIG_STOP_MACHINE=y
71CONFIG_SYSVIPC_COMPAT=y 86
87#
88# Block layer
89#
90
91#
92# IO Schedulers
93#
94CONFIG_IOSCHED_NOOP=y
95CONFIG_IOSCHED_AS=y
96CONFIG_IOSCHED_DEADLINE=y
97CONFIG_IOSCHED_CFQ=y
98CONFIG_DEFAULT_AS=y
99# CONFIG_DEFAULT_DEADLINE is not set
100# CONFIG_DEFAULT_CFQ is not set
101# CONFIG_DEFAULT_NOOP is not set
102CONFIG_DEFAULT_IOSCHED="anticipatory"
72 103
73# 104#
74# Platform support 105# Platform support
75# 106#
76CONFIG_PPC_ISERIES=y
77# CONFIG_PPC_MULTIPLATFORM is not set 107# CONFIG_PPC_MULTIPLATFORM is not set
78CONFIG_PPC=y 108CONFIG_PPC_ISERIES=y
79CONFIG_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
80CONFIG_IBMVIO=y 113CONFIG_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
123CONFIG_HZ_250=y
124# CONFIG_HZ_1000 is not set
125CONFIG_HZ=250
126CONFIG_PREEMPT_NONE=y
127# CONFIG_PREEMPT_VOLUNTARY is not set
128# CONFIG_PREEMPT is not set
129# CONFIG_PREEMPT_BKL is not set
130CONFIG_BINFMT_ELF=y
131# CONFIG_BINFMT_MISC is not set
132CONFIG_FORCE_MAX_ZONEORDER=13
82CONFIG_IOMMU_VMERGE=y 133CONFIG_IOMMU_VMERGE=y
83CONFIG_SMP=y 134CONFIG_IRQ_ALL_CPUS=y
84CONFIG_NR_CPUS=32 135CONFIG_LPARCFG=y
136# CONFIG_NUMA is not set
85CONFIG_ARCH_SELECT_MEMORY_MODEL=y 137CONFIG_ARCH_SELECT_MEMORY_MODEL=y
86CONFIG_ARCH_FLATMEM_ENABLE=y 138CONFIG_ARCH_FLATMEM_ENABLE=y
139CONFIG_ARCH_SPARSEMEM_ENABLE=y
87CONFIG_SELECT_MEMORY_MODEL=y 140CONFIG_SELECT_MEMORY_MODEL=y
88CONFIG_FLATMEM_MANUAL=y 141CONFIG_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
91CONFIG_FLATMEM=y 144CONFIG_FLATMEM=y
92CONFIG_FLAT_NODE_MEM_MAP=y 145CONFIG_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 147CONFIG_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
96CONFIG_PREEMPT_NONE=y 150CONFIG_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
101CONFIG_HZ_250=y
102# CONFIG_HZ_1000 is not set
103CONFIG_HZ=250
104CONFIG_GENERIC_HARDIRQS=y
105CONFIG_LPARCFG=y
106CONFIG_SECCOMP=y 152CONFIG_SECCOMP=y
107CONFIG_BINFMT_ELF=y
108# CONFIG_BINFMT_MISC is not set
109CONFIG_ISA_DMA_API=y 153CONFIG_ISA_DMA_API=y
110 154
111# 155#
112# Bus Options 156# Bus options
113# 157#
158CONFIG_GENERIC_ISA_DMA=y
159# CONFIG_PPC_I8259 is not set
160# CONFIG_PPC_INDIRECT_PCI is not set
114CONFIG_PCI=y 161CONFIG_PCI=y
115CONFIG_PCI_DOMAINS=y 162CONFIG_PCI_DOMAINS=y
116CONFIG_PCI_LEGACY_PROC=y 163CONFIG_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
175CONFIG_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
167CONFIG_NETFILTER=y 215CONFIG_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
269CONFIG_NET_CLS_ROUTE=y 325CONFIG_NET_CLS_ROUTE=y
270 326
@@ -326,14 +382,6 @@ CONFIG_BLK_DEV_RAM_COUNT=16
326CONFIG_BLK_DEV_RAM_SIZE=65536 382CONFIG_BLK_DEV_RAM_SIZE=65536
327CONFIG_BLK_DEV_INITRD=y 383CONFIG_BLK_DEV_INITRD=y
328# CONFIG_CDROM_PKTCDVD is not set 384# CONFIG_CDROM_PKTCDVD is not set
329
330#
331# IO Schedulers
332#
333CONFIG_IOSCHED_NOOP=y
334CONFIG_IOSCHED_AS=y
335CONFIG_IOSCHED_DEADLINE=y
336CONFIG_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
561CONFIG_PPP_SYNC_TTY=m 611CONFIG_PPP_SYNC_TTY=m
562CONFIG_PPP_DEFLATE=m 612CONFIG_PPP_DEFLATE=m
563CONFIG_PPP_BSDCOMP=m 613CONFIG_PPP_BSDCOMP=m
614# CONFIG_PPP_MPPE is not set
564CONFIG_PPPOE=m 615CONFIG_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
697CONFIG_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
917CONFIG_VIOPATH=y 975CONFIG_VIOPATH=y
918 976
919# 977#
920# Profiling support 978# Library routines
979#
980CONFIG_CRC_CCITT=m
981# CONFIG_CRC16 is not set
982CONFIG_CRC32=y
983CONFIG_LIBCRC32C=m
984CONFIG_ZLIB_INFLATE=y
985CONFIG_ZLIB_DEFLATE=m
986CONFIG_TEXTSEARCH=y
987CONFIG_TEXTSEARCH_KMP=m
988CONFIG_TEXTSEARCH_BM=m
989CONFIG_TEXTSEARCH_FSM=m
990
991#
992# Instrumentation Support
921# 993#
922CONFIG_PROFILING=y 994CONFIG_PROFILING=y
923CONFIG_OPROFILE=y 995CONFIG_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
939CONFIG_DEBUG_FS=y 1012CONFIG_DEBUG_FS=y
1013# CONFIG_DEBUG_VM is not set
1014# CONFIG_RCU_TORTURE_TEST is not set
940CONFIG_DEBUG_STACKOVERFLOW=y 1015CONFIG_DEBUG_STACKOVERFLOW=y
941# CONFIG_KPROBES is not set
942CONFIG_DEBUG_STACK_USAGE=y 1016CONFIG_DEBUG_STACK_USAGE=y
943# CONFIG_DEBUGGER is not set 1017# CONFIG_DEBUGGER is not set
944# CONFIG_PPCDBG is not set
945CONFIG_IRQSTACKS=y 1018CONFIG_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#
989CONFIG_CRC_CCITT=m
990# CONFIG_CRC16 is not set
991CONFIG_CRC32=y
992CONFIG_LIBCRC32C=m
993CONFIG_ZLIB_INFLATE=y
994CONFIG_ZLIB_DEFLATE=m
995CONFIG_TEXTSEARCH=y
996CONFIG_TEXTSEARCH_KMP=m
997CONFIG_TEXTSEARCH_BM=m
998CONFIG_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#
6CONFIG_PPC64=y
6CONFIG_64BIT=y 7CONFIG_64BIT=y
8CONFIG_PPC_MERGE=y
7CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y 11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 12CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_GENERIC_ISA_DMA=y 13CONFIG_PPC=y
11CONFIG_EARLY_PRINTK=y 14CONFIG_EARLY_PRINTK=y
12CONFIG_COMPAT=y 15CONFIG_COMPAT=y
16CONFIG_SYSVIPC_COMPAT=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=y 18CONFIG_ARCH_MAY_HAVE_PC_FDC=y
15CONFIG_FORCE_MAX_ZONEORDER=13 19
20#
21# Processor support
22#
23CONFIG_POWER4_ONLY=y
24CONFIG_POWER4=y
25CONFIG_PPC_FPU=y
26# CONFIG_ALTIVEC is not set
27CONFIG_PPC_STD_MMU=y
28CONFIG_SMP=y
29CONFIG_NR_CPUS=2
16 30
17# 31#
18# Code maturity level options 32# Code maturity level options
@@ -67,32 +81,67 @@ CONFIG_MODVERSIONS=y
67CONFIG_MODULE_SRCVERSION_ALL=y 81CONFIG_MODULE_SRCVERSION_ALL=y
68CONFIG_KMOD=y 82CONFIG_KMOD=y
69CONFIG_STOP_MACHINE=y 83CONFIG_STOP_MACHINE=y
70CONFIG_SYSVIPC_COMPAT=y 84
85#
86# Block layer
87#
88
89#
90# IO Schedulers
91#
92CONFIG_IOSCHED_NOOP=y
93CONFIG_IOSCHED_AS=y
94CONFIG_IOSCHED_DEADLINE=y
95CONFIG_IOSCHED_CFQ=y
96CONFIG_DEFAULT_AS=y
97# CONFIG_DEFAULT_DEADLINE is not set
98# CONFIG_DEFAULT_CFQ is not set
99# CONFIG_DEFAULT_NOOP is not set
100CONFIG_DEFAULT_IOSCHED="anticipatory"
71 101
72# 102#
73# Platform support 103# Platform support
74# 104#
75# CONFIG_PPC_ISERIES is not set
76CONFIG_PPC_MULTIPLATFORM=y 105CONFIG_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
80CONFIG_PPC_MAPLE=y 111CONFIG_PPC_MAPLE=y
81CONFIG_PPC=y 112# CONFIG_PPC_CELL is not set
82CONFIG_PPC64=y
83CONFIG_PPC_OF=y 113CONFIG_PPC_OF=y
84CONFIG_MPIC=y
85# CONFIG_ALTIVEC is not set
86CONFIG_KEXEC=y
87CONFIG_U3_DART=y 114CONFIG_U3_DART=y
115CONFIG_MPIC=y
116# CONFIG_PPC_RTAS is not set
117# CONFIG_MMIO_NVRAM is not set
88CONFIG_MPIC_BROKEN_U3=y 118CONFIG_MPIC_BROKEN_U3=y
89CONFIG_BOOTX_TEXT=y 119# CONFIG_PPC_MPC106 is not set
90CONFIG_POWER4_ONLY=y 120CONFIG_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
128CONFIG_HZ_250=y
129# CONFIG_HZ_1000 is not set
130CONFIG_HZ=250
131CONFIG_PREEMPT_NONE=y
132# CONFIG_PREEMPT_VOLUNTARY is not set
133# CONFIG_PREEMPT is not set
134# CONFIG_PREEMPT_BKL is not set
135CONFIG_BINFMT_ELF=y
136# CONFIG_BINFMT_MISC is not set
137CONFIG_FORCE_MAX_ZONEORDER=13
91CONFIG_IOMMU_VMERGE=y 138CONFIG_IOMMU_VMERGE=y
92CONFIG_SMP=y 139CONFIG_KEXEC=y
93CONFIG_NR_CPUS=2 140CONFIG_IRQ_ALL_CPUS=y
141# CONFIG_NUMA is not set
94CONFIG_ARCH_SELECT_MEMORY_MODEL=y 142CONFIG_ARCH_SELECT_MEMORY_MODEL=y
95CONFIG_ARCH_FLATMEM_ENABLE=y 143CONFIG_ARCH_FLATMEM_ENABLE=y
144CONFIG_ARCH_SPARSEMEM_ENABLE=y
96CONFIG_SELECT_MEMORY_MODEL=y 145CONFIG_SELECT_MEMORY_MODEL=y
97CONFIG_FLATMEM_MANUAL=y 146CONFIG_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
100CONFIG_FLATMEM=y 149CONFIG_FLATMEM=y
101CONFIG_FLAT_NODE_MEM_MAP=y 150CONFIG_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 152CONFIG_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
105CONFIG_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
110CONFIG_HZ_250=y
111# CONFIG_HZ_1000 is not set
112CONFIG_HZ=250
113CONFIG_GENERIC_HARDIRQS=y
114CONFIG_SECCOMP=y
115CONFIG_BINFMT_ELF=y
116# CONFIG_BINFMT_MISC is not set
117CONFIG_PROC_DEVICETREE=y 155CONFIG_PROC_DEVICETREE=y
118# CONFIG_CMDLINE_BOOL is not set 156# CONFIG_CMDLINE_BOOL is not set
157# CONFIG_PM is not set
158CONFIG_SECCOMP=y
119CONFIG_ISA_DMA_API=y 159CONFIG_ISA_DMA_API=y
120 160
121# 161#
122# Bus Options 162# Bus options
123# 163#
164CONFIG_GENERIC_ISA_DMA=y
165# CONFIG_PPC_I8259 is not set
166# CONFIG_PPC_INDIRECT_PCI is not set
124CONFIG_PCI=y 167CONFIG_PCI=y
125CONFIG_PCI_DOMAINS=y 168CONFIG_PCI_DOMAINS=y
126CONFIG_PCI_LEGACY_PROC=y 169CONFIG_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
181CONFIG_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
254CONFIG_BLK_DEV_RAM_SIZE=8192 302CONFIG_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#
261CONFIG_IOSCHED_NOOP=y
262CONFIG_IOSCHED_AS=y
263CONFIG_IOSCHED_DEADLINE=y
264CONFIG_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
577CONFIG_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"
985CONFIG_NLS_UTF8=y 1034CONFIG_NLS_UTF8=y
986 1035
987# 1036#
988# Profiling support 1037# Library routines
1038#
1039CONFIG_CRC_CCITT=y
1040# CONFIG_CRC16 is not set
1041CONFIG_CRC32=y
1042# CONFIG_LIBCRC32C is not set
1043CONFIG_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
1006CONFIG_DEBUG_FS=y 1065CONFIG_DEBUG_FS=y
1066# CONFIG_DEBUG_VM is not set
1067# CONFIG_RCU_TORTURE_TEST is not set
1007CONFIG_DEBUG_STACKOVERFLOW=y 1068CONFIG_DEBUG_STACKOVERFLOW=y
1008# CONFIG_KPROBES is not set
1009CONFIG_DEBUG_STACK_USAGE=y 1069CONFIG_DEBUG_STACK_USAGE=y
1010CONFIG_DEBUGGER=y 1070CONFIG_DEBUGGER=y
1011CONFIG_XMON=y 1071CONFIG_XMON=y
1012CONFIG_XMON_DEFAULT=y 1072CONFIG_XMON_DEFAULT=y
1013# CONFIG_PPCDBG is not set
1014# CONFIG_IRQSTACKS is not set 1073# CONFIG_IRQSTACKS is not set
1074CONFIG_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#
1058CONFIG_CRC_CCITT=y
1059# CONFIG_CRC16 is not set
1060CONFIG_CRC32=y
1061# CONFIG_LIBCRC32C is not set
1062CONFIG_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#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -144,7 +144,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
144CONFIG_IOMMU_VMERGE=y 144CONFIG_IOMMU_VMERGE=y
145CONFIG_HOTPLUG_CPU=y 145CONFIG_HOTPLUG_CPU=y
146CONFIG_KEXEC=y 146CONFIG_KEXEC=y
147# CONFIG_IRQ_ALL_CPUS is not set 147CONFIG_IRQ_ALL_CPUS=y
148CONFIG_PPC_SPLPAR=y 148CONFIG_PPC_SPLPAR=y
149CONFIG_EEH=y 149CONFIG_EEH=y
150CONFIG_SCANLOG=m 150CONFIG_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 */
190void __devinit pci_setup_pci_controller(struct pci_controller *hose) 190static 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
200static 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
228struct 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
246void 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
200static void __init pcibios_claim_one_bus(struct pci_bus *b) 259static 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
322static 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
334static 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
357static 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
376unsigned long __init find_and_init_phbs(void) 319unsigned 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
52int smp_hw_index[NR_CPUS];
53struct 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
59int smp_hw_index[NR_CPUS];
60struct thread_info *secondary_ti;
61
61cpumask_t cpu_possible_map = CPU_MASK_NONE; 62cpumask_t cpu_possible_map = CPU_MASK_NONE;
62cpumask_t cpu_online_map = CPU_MASK_NONE; 63cpumask_t cpu_online_map = CPU_MASK_NONE;
63cpumask_t cpu_sibling_map[NR_CPUS] = { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; 64cpumask_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 */
59V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) 60V_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
68V_FUNCTION_END(__kernel_get_syscall_map) 68V_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
85V_FUNCTION_END(__kernel_get_tbfreq) 86V_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
611: mtlr r12 611: 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 */
59V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) 60V_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
85V_FUNCTION_END(__kernel_get_tbfreq) 86V_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)
541: mtlr r12 541: 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
25struct 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
34struct lmb lmb;
35
29void lmb_dump_all(void) 36void 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... */
719static 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...)
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index dc55e1abc45b..0eb0b7085e6a 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -602,7 +602,19 @@ void parse_bootinfo(struct bi_record *rec)
602#endif /* CONFIG_BLK_DEV_INITRD */ 602#endif /* CONFIG_BLK_DEV_INITRD */
603#ifdef CONFIG_PPC_MULTIPLATFORM 603#ifdef CONFIG_PPC_MULTIPLATFORM
604 case BI_MACHTYPE: 604 case BI_MACHTYPE:
605 _machine = data[0]; 605 /* Machine types changed with the merge. Since the
606 * bootinfo are now deprecated, we can just hard code
607 * the appropriate conversion here for when we are
608 * called with yaboot which passes us a machine type
609 * this way.
610 */
611 switch(data[0]) {
612 case 1: _machine = _MACH_prep; break;
613 case 2: _machine = _MACH_Pmac; break;
614 case 4: _machine = _MACH_chrp; break;
615 default:
616 _machine = data[0];
617 }
606 break; 618 break;
607#endif 619#endif
608 case BI_MEMSIZE: 620 case BI_MEMSIZE:
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index 99b48abd3296..45f0782059f1 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -597,21 +597,20 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
597 597
598 if (pfn_valid(pfn)) { 598 if (pfn_valid(pfn)) {
599 struct page *page = pfn_to_page(pfn); 599 struct page *page = pfn_to_page(pfn);
600 if (!PageReserved(page)
601 && !test_bit(PG_arch_1, &page->flags)) {
602 if (vma->vm_mm == current->active_mm) {
603#ifdef CONFIG_8xx 600#ifdef CONFIG_8xx
604 /* On 8xx, cache control instructions (particularly 601 /* On 8xx, the TLB handlers work in 2 stages:
605 * "dcbst" from flush_dcache_icache) fault as write 602 * First, a zeroed entry is loaded by TLBMiss handler,
606 * operation if there is an unpopulated TLB entry 603 * which causes the TLBError handler to be triggered.
607 * for the address in question. To workaround that, 604 * That means the zeroed TLB has to be invalidated
608 * we invalidate the TLB here, thus avoiding dcbst 605 * whenever a page miss occurs.
609 * misbehaviour. 606 */
610 */ 607 _tlbie(address);
611 _tlbie(address);
612#endif 608#endif
609 if (!PageReserved(page)
610 && !test_bit(PG_arch_1, &page->flags)) {
611 if (vma->vm_mm == current->active_mm)
613 __flush_dcache_icache((void *) address); 612 __flush_dcache_icache((void *) address);
614 } else 613 else
615 flush_dcache_icache_page(page); 614 flush_dcache_icache_page(page);
616 set_bit(PG_arch_1, &page->flags); 615 set_bit(PG_arch_1, &page->flags);
617 } 616 }
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c
index 98612d420346..c80177f8ec04 100644
--- a/arch/ppc/xmon/start.c
+++ b/arch/ppc/xmon/start.c
@@ -184,7 +184,9 @@ xmon_map_scc(void)
184 sccc = base + (addr & ~PAGE_MASK); 184 sccc = base + (addr & ~PAGE_MASK);
185 sccd = sccc + 0x10; 185 sccd = sccc + 0x10;
186 186
187 } else { 187 }
188#ifdef CONFIG_PPC_CHRP
189 else {
188 base = (volatile unsigned char *) isa_io_base; 190 base = (volatile unsigned char *) isa_io_base;
189 if (_machine == _MACH_chrp) 191 if (_machine == _MACH_chrp)
190 base = (volatile unsigned char *) 192 base = (volatile unsigned char *)
@@ -200,6 +202,7 @@ xmon_map_scc(void)
200 RXRDY = 1; 202 RXRDY = 1;
201 DLAB = 0x80; 203 DLAB = 0x80;
202 } 204 }
205#endif /* CONFIG_PPC_CHRP */
203#elif defined(CONFIG_GEMINI) 206#elif defined(CONFIG_GEMINI)
204 /* should already be mapped by the kernel boot */ 207 /* should already be mapped by the kernel boot */
205 sccc = (volatile unsigned char *) 0xffeffb0d; 208 sccc = (volatile unsigned char *) 0xffeffb0d;
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c
index a1607e7d6d6b..fb394a0d838c 100644
--- a/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -276,7 +276,7 @@ static void cinergyt2_free_stream_urbs (struct cinergyt2 *cinergyt2)
276 if (cinergyt2->stream_urb[i]) 276 if (cinergyt2->stream_urb[i])
277 usb_free_urb(cinergyt2->stream_urb[i]); 277 usb_free_urb(cinergyt2->stream_urb[i]);
278 278
279 pci_free_consistent(NULL, STREAM_URB_COUNT*STREAM_BUF_SIZE, 279 usb_buffer_free(cinergyt2->udev, STREAM_URB_COUNT*STREAM_BUF_SIZE,
280 cinergyt2->streambuf, cinergyt2->streambuf_dmahandle); 280 cinergyt2->streambuf, cinergyt2->streambuf_dmahandle);
281} 281}
282 282
@@ -284,9 +284,8 @@ static int cinergyt2_alloc_stream_urbs (struct cinergyt2 *cinergyt2)
284{ 284{
285 int i; 285 int i;
286 286
287 cinergyt2->streambuf = pci_alloc_consistent(NULL, 287 cinergyt2->streambuf = usb_buffer_alloc(cinergyt2->udev, STREAM_URB_COUNT*STREAM_BUF_SIZE,
288 STREAM_URB_COUNT*STREAM_BUF_SIZE, 288 SLAB_KERNEL, &cinergyt2->streambuf_dmahandle);
289 &cinergyt2->streambuf_dmahandle);
290 if (!cinergyt2->streambuf) { 289 if (!cinergyt2->streambuf) {
291 dprintk(1, "failed to alloc consistent stream memory area, bailing out!\n"); 290 dprintk(1, "failed to alloc consistent stream memory area, bailing out!\n");
292 return -ENOMEM; 291 return -ENOMEM;
@@ -780,6 +779,8 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2)
780 779
781 input_register_device(cinergyt2->rc_input_dev); 780 input_register_device(cinergyt2->rc_input_dev);
782 schedule_delayed_work(&cinergyt2->rc_query_work, HZ/2); 781 schedule_delayed_work(&cinergyt2->rc_query_work, HZ/2);
782
783 return 0;
783} 784}
784 785
785static void cinergyt2_unregister_rc(struct cinergyt2 *cinergyt2) 786static void cinergyt2_unregister_rc(struct cinergyt2 *cinergyt2)
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 84c42c44e04d..20dd85a77813 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -497,7 +497,7 @@ config SCSI_ATA_PIIX
497 If unsure, say N. 497 If unsure, say N.
498 498
499config SCSI_SATA_MV 499config SCSI_SATA_MV
500 tristate "Marvell SATA support" 500 tristate "Marvell SATA support (HIGHLY EXPERIMENTAL)"
501 depends on SCSI_SATA && PCI && EXPERIMENTAL 501 depends on SCSI_SATA && PCI && EXPERIMENTAL
502 help 502 help
503 This option enables support for the Marvell Serial ATA family. 503 This option enables support for the Marvell Serial ATA family.
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index bb604dfbdef6..665ae79e1fd6 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1046,6 +1046,30 @@ static unsigned int ata_pio_modes(const struct ata_device *adev)
1046 return modes; 1046 return modes;
1047} 1047}
1048 1048
1049static int ata_qc_wait_err(struct ata_queued_cmd *qc,
1050 struct completion *wait)
1051{
1052 int rc = 0;
1053
1054 if (wait_for_completion_timeout(wait, 30 * HZ) < 1) {
1055 /* timeout handling */
1056 unsigned int err_mask = ac_err_mask(ata_chk_status(qc->ap));
1057
1058 if (!err_mask) {
1059 printk(KERN_WARNING "ata%u: slow completion (cmd %x)\n",
1060 qc->ap->id, qc->tf.command);
1061 } else {
1062 printk(KERN_WARNING "ata%u: qc timeout (cmd %x)\n",
1063 qc->ap->id, qc->tf.command);
1064 rc = -EIO;
1065 }
1066
1067 ata_qc_complete(qc, err_mask);
1068 }
1069
1070 return rc;
1071}
1072
1049/** 1073/**
1050 * ata_dev_identify - obtain IDENTIFY x DEVICE page 1074 * ata_dev_identify - obtain IDENTIFY x DEVICE page
1051 * @ap: port on which device we wish to probe resides 1075 * @ap: port on which device we wish to probe resides
@@ -1125,7 +1149,7 @@ retry:
1125 if (rc) 1149 if (rc)
1126 goto err_out; 1150 goto err_out;
1127 else 1151 else
1128 wait_for_completion(&wait); 1152 ata_qc_wait_err(qc, &wait);
1129 1153
1130 spin_lock_irqsave(&ap->host_set->lock, flags); 1154 spin_lock_irqsave(&ap->host_set->lock, flags);
1131 ap->ops->tf_read(ap, &qc->tf); 1155 ap->ops->tf_read(ap, &qc->tf);
@@ -2269,7 +2293,7 @@ static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)
2269 if (rc) 2293 if (rc)
2270 ata_port_disable(ap); 2294 ata_port_disable(ap);
2271 else 2295 else
2272 wait_for_completion(&wait); 2296 ata_qc_wait_err(qc, &wait);
2273 2297
2274 DPRINTK("EXIT\n"); 2298 DPRINTK("EXIT\n");
2275} 2299}
@@ -2317,7 +2341,7 @@ static void ata_dev_reread_id(struct ata_port *ap, struct ata_device *dev)
2317 if (rc) 2341 if (rc)
2318 goto err_out; 2342 goto err_out;
2319 2343
2320 wait_for_completion(&wait); 2344 ata_qc_wait_err(qc, &wait);
2321 2345
2322 swap_buf_le16(dev->id, ATA_ID_WORDS); 2346 swap_buf_le16(dev->id, ATA_ID_WORDS);
2323 2347
@@ -2373,7 +2397,7 @@ static void ata_dev_init_params(struct ata_port *ap, struct ata_device *dev)
2373 if (rc) 2397 if (rc)
2374 ata_port_disable(ap); 2398 ata_port_disable(ap);
2375 else 2399 else
2376 wait_for_completion(&wait); 2400 ata_qc_wait_err(qc, &wait);
2377 2401
2378 DPRINTK("EXIT\n"); 2402 DPRINTK("EXIT\n");
2379} 2403}
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c
index 257c128f4aaa..ac184e60797e 100644
--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * sata_mv.c - Marvell SATA support 2 * sata_mv.c - Marvell SATA support
3 * 3 *
4 * Copyright 2005: EMC Corporation, all rights reserved. 4 * Copyright 2005: EMC Corporation, all rights reserved.
5 * 5 *
6 * Please ALWAYS copy linux-ide@vger.kernel.org on emails. 6 * Please ALWAYS copy linux-ide@vger.kernel.org on emails.
7 * 7 *
@@ -50,6 +50,9 @@ enum {
50 MV_PCI_REG_BASE = 0, 50 MV_PCI_REG_BASE = 0,
51 MV_IRQ_COAL_REG_BASE = 0x18000, /* 6xxx part only */ 51 MV_IRQ_COAL_REG_BASE = 0x18000, /* 6xxx part only */
52 MV_SATAHC0_REG_BASE = 0x20000, 52 MV_SATAHC0_REG_BASE = 0x20000,
53 MV_FLASH_CTL = 0x1046c,
54 MV_GPIO_PORT_CTL = 0x104f0,
55 MV_RESET_CFG = 0x180d8,
53 56
54 MV_PCI_REG_SZ = MV_MAJOR_REG_AREA_SZ, 57 MV_PCI_REG_SZ = MV_MAJOR_REG_AREA_SZ,
55 MV_SATAHC_REG_SZ = MV_MAJOR_REG_AREA_SZ, 58 MV_SATAHC_REG_SZ = MV_MAJOR_REG_AREA_SZ,
@@ -72,11 +75,6 @@ enum {
72 MV_SG_TBL_SZ = (16 * MV_MAX_SG_CT), 75 MV_SG_TBL_SZ = (16 * MV_MAX_SG_CT),
73 MV_PORT_PRIV_DMA_SZ = (MV_CRQB_Q_SZ + MV_CRPB_Q_SZ + MV_SG_TBL_SZ), 76 MV_PORT_PRIV_DMA_SZ = (MV_CRQB_Q_SZ + MV_CRPB_Q_SZ + MV_SG_TBL_SZ),
74 77
75 /* Our DMA boundary is determined by an ePRD being unable to handle
76 * anything larger than 64KB
77 */
78 MV_DMA_BOUNDARY = 0xffffU,
79
80 MV_PORTS_PER_HC = 4, 78 MV_PORTS_PER_HC = 4,
81 /* == (port / MV_PORTS_PER_HC) to determine HC from 0-7 port */ 79 /* == (port / MV_PORTS_PER_HC) to determine HC from 0-7 port */
82 MV_PORT_HC_SHIFT = 2, 80 MV_PORT_HC_SHIFT = 2,
@@ -86,16 +84,9 @@ enum {
86 /* Host Flags */ 84 /* Host Flags */
87 MV_FLAG_DUAL_HC = (1 << 30), /* two SATA Host Controllers */ 85 MV_FLAG_DUAL_HC = (1 << 30), /* two SATA Host Controllers */
88 MV_FLAG_IRQ_COALESCE = (1 << 29), /* IRQ coalescing capability */ 86 MV_FLAG_IRQ_COALESCE = (1 << 29), /* IRQ coalescing capability */
89 MV_FLAG_GLBL_SFT_RST = (1 << 28), /* Global Soft Reset support */
90 MV_COMMON_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 87 MV_COMMON_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
91 ATA_FLAG_SATA_RESET | ATA_FLAG_MMIO), 88 ATA_FLAG_SATA_RESET | ATA_FLAG_MMIO),
92 MV_6XXX_FLAGS = (MV_FLAG_IRQ_COALESCE | 89 MV_6XXX_FLAGS = MV_FLAG_IRQ_COALESCE,
93 MV_FLAG_GLBL_SFT_RST),
94
95 chip_504x = 0,
96 chip_508x = 1,
97 chip_604x = 2,
98 chip_608x = 3,
99 90
100 CRQB_FLAG_READ = (1 << 0), 91 CRQB_FLAG_READ = (1 << 0),
101 CRQB_TAG_SHIFT = 1, 92 CRQB_TAG_SHIFT = 1,
@@ -116,8 +107,19 @@ enum {
116 PCI_MASTER_EMPTY = (1 << 3), 107 PCI_MASTER_EMPTY = (1 << 3),
117 GLOB_SFT_RST = (1 << 4), 108 GLOB_SFT_RST = (1 << 4),
118 109
119 PCI_IRQ_CAUSE_OFS = 0x1d58, 110 MV_PCI_MODE = 0xd00,
120 PCI_IRQ_MASK_OFS = 0x1d5c, 111 MV_PCI_EXP_ROM_BAR_CTL = 0xd2c,
112 MV_PCI_DISC_TIMER = 0xd04,
113 MV_PCI_MSI_TRIGGER = 0xc38,
114 MV_PCI_SERR_MASK = 0xc28,
115 MV_PCI_XBAR_TMOUT = 0x1d04,
116 MV_PCI_ERR_LOW_ADDRESS = 0x1d40,
117 MV_PCI_ERR_HIGH_ADDRESS = 0x1d44,
118 MV_PCI_ERR_ATTRIBUTE = 0x1d48,
119 MV_PCI_ERR_COMMAND = 0x1d50,
120
121 PCI_IRQ_CAUSE_OFS = 0x1d58,
122 PCI_IRQ_MASK_OFS = 0x1d5c,
121 PCI_UNMASK_ALL_IRQS = 0x7fffff, /* bits 22-0 */ 123 PCI_UNMASK_ALL_IRQS = 0x7fffff, /* bits 22-0 */
122 124
123 HC_MAIN_IRQ_CAUSE_OFS = 0x1d60, 125 HC_MAIN_IRQ_CAUSE_OFS = 0x1d60,
@@ -134,7 +136,7 @@ enum {
134 SELF_INT = (1 << 23), 136 SELF_INT = (1 << 23),
135 TWSI_INT = (1 << 24), 137 TWSI_INT = (1 << 24),
136 HC_MAIN_RSVD = (0x7f << 25), /* bits 31-25 */ 138 HC_MAIN_RSVD = (0x7f << 25), /* bits 31-25 */
137 HC_MAIN_MASKED_IRQS = (TRAN_LO_DONE | TRAN_HI_DONE | 139 HC_MAIN_MASKED_IRQS = (TRAN_LO_DONE | TRAN_HI_DONE |
138 PORTS_0_7_COAL_DONE | GPIO_INT | TWSI_INT | 140 PORTS_0_7_COAL_DONE | GPIO_INT | TWSI_INT |
139 HC_MAIN_RSVD), 141 HC_MAIN_RSVD),
140 142
@@ -153,6 +155,15 @@ enum {
153 /* SATA registers */ 155 /* SATA registers */
154 SATA_STATUS_OFS = 0x300, /* ctrl, err regs follow status */ 156 SATA_STATUS_OFS = 0x300, /* ctrl, err regs follow status */
155 SATA_ACTIVE_OFS = 0x350, 157 SATA_ACTIVE_OFS = 0x350,
158 PHY_MODE3 = 0x310,
159 PHY_MODE4 = 0x314,
160 PHY_MODE2 = 0x330,
161 MV5_PHY_MODE = 0x74,
162 MV5_LT_MODE = 0x30,
163 MV5_PHY_CTL = 0x0C,
164 SATA_INTERFACE_CTL = 0x050,
165
166 MV_M2_PREAMP_MASK = 0x7e0,
156 167
157 /* Port registers */ 168 /* Port registers */
158 EDMA_CFG_OFS = 0, 169 EDMA_CFG_OFS = 0,
@@ -182,17 +193,16 @@ enum {
182 EDMA_ERR_LNK_CTRL_TX = (0x1f << 21), 193 EDMA_ERR_LNK_CTRL_TX = (0x1f << 21),
183 EDMA_ERR_LNK_DATA_TX = (0x1f << 26), 194 EDMA_ERR_LNK_DATA_TX = (0x1f << 26),
184 EDMA_ERR_TRANS_PROTO = (1 << 31), 195 EDMA_ERR_TRANS_PROTO = (1 << 31),
185 EDMA_ERR_FATAL = (EDMA_ERR_D_PAR | EDMA_ERR_PRD_PAR | 196 EDMA_ERR_FATAL = (EDMA_ERR_D_PAR | EDMA_ERR_PRD_PAR |
186 EDMA_ERR_DEV_DCON | EDMA_ERR_CRBQ_PAR | 197 EDMA_ERR_DEV_DCON | EDMA_ERR_CRBQ_PAR |
187 EDMA_ERR_CRPB_PAR | EDMA_ERR_INTRL_PAR | 198 EDMA_ERR_CRPB_PAR | EDMA_ERR_INTRL_PAR |
188 EDMA_ERR_IORDY | EDMA_ERR_LNK_CTRL_RX_2 | 199 EDMA_ERR_IORDY | EDMA_ERR_LNK_CTRL_RX_2 |
189 EDMA_ERR_LNK_DATA_RX | 200 EDMA_ERR_LNK_DATA_RX |
190 EDMA_ERR_LNK_DATA_TX | 201 EDMA_ERR_LNK_DATA_TX |
191 EDMA_ERR_TRANS_PROTO), 202 EDMA_ERR_TRANS_PROTO),
192 203
193 EDMA_REQ_Q_BASE_HI_OFS = 0x10, 204 EDMA_REQ_Q_BASE_HI_OFS = 0x10,
194 EDMA_REQ_Q_IN_PTR_OFS = 0x14, /* also contains BASE_LO */ 205 EDMA_REQ_Q_IN_PTR_OFS = 0x14, /* also contains BASE_LO */
195 EDMA_REQ_Q_BASE_LO_MASK = 0xfffffc00U,
196 206
197 EDMA_REQ_Q_OUT_PTR_OFS = 0x18, 207 EDMA_REQ_Q_OUT_PTR_OFS = 0x18,
198 EDMA_REQ_Q_PTR_SHIFT = 5, 208 EDMA_REQ_Q_PTR_SHIFT = 5,
@@ -200,7 +210,6 @@ enum {
200 EDMA_RSP_Q_BASE_HI_OFS = 0x1c, 210 EDMA_RSP_Q_BASE_HI_OFS = 0x1c,
201 EDMA_RSP_Q_IN_PTR_OFS = 0x20, 211 EDMA_RSP_Q_IN_PTR_OFS = 0x20,
202 EDMA_RSP_Q_OUT_PTR_OFS = 0x24, /* also contains BASE_LO */ 212 EDMA_RSP_Q_OUT_PTR_OFS = 0x24, /* also contains BASE_LO */
203 EDMA_RSP_Q_BASE_LO_MASK = 0xffffff00U,
204 EDMA_RSP_Q_PTR_SHIFT = 3, 213 EDMA_RSP_Q_PTR_SHIFT = 3,
205 214
206 EDMA_CMD_OFS = 0x28, 215 EDMA_CMD_OFS = 0x28,
@@ -208,14 +217,44 @@ enum {
208 EDMA_DS = (1 << 1), 217 EDMA_DS = (1 << 1),
209 ATA_RST = (1 << 2), 218 ATA_RST = (1 << 2),
210 219
220 EDMA_IORDY_TMOUT = 0x34,
221 EDMA_ARB_CFG = 0x38,
222
211 /* Host private flags (hp_flags) */ 223 /* Host private flags (hp_flags) */
212 MV_HP_FLAG_MSI = (1 << 0), 224 MV_HP_FLAG_MSI = (1 << 0),
225 MV_HP_ERRATA_50XXB0 = (1 << 1),
226 MV_HP_ERRATA_50XXB2 = (1 << 2),
227 MV_HP_ERRATA_60X1B2 = (1 << 3),
228 MV_HP_ERRATA_60X1C0 = (1 << 4),
229 MV_HP_50XX = (1 << 5),
213 230
214 /* Port private flags (pp_flags) */ 231 /* Port private flags (pp_flags) */
215 MV_PP_FLAG_EDMA_EN = (1 << 0), 232 MV_PP_FLAG_EDMA_EN = (1 << 0),
216 MV_PP_FLAG_EDMA_DS_ACT = (1 << 1), 233 MV_PP_FLAG_EDMA_DS_ACT = (1 << 1),
217}; 234};
218 235
236#define IS_50XX(hpriv) ((hpriv)->hp_flags & MV_HP_50XX)
237#define IS_60XX(hpriv) (((hpriv)->hp_flags & MV_HP_50XX) == 0)
238
239enum {
240 /* Our DMA boundary is determined by an ePRD being unable to handle
241 * anything larger than 64KB
242 */
243 MV_DMA_BOUNDARY = 0xffffU,
244
245 EDMA_REQ_Q_BASE_LO_MASK = 0xfffffc00U,
246
247 EDMA_RSP_Q_BASE_LO_MASK = 0xffffff00U,
248};
249
250enum chip_type {
251 chip_504x,
252 chip_508x,
253 chip_5080,
254 chip_604x,
255 chip_608x,
256};
257
219/* Command ReQuest Block: 32B */ 258/* Command ReQuest Block: 32B */
220struct mv_crqb { 259struct mv_crqb {
221 u32 sg_addr; 260 u32 sg_addr;
@@ -252,14 +291,37 @@ struct mv_port_priv {
252 u32 pp_flags; 291 u32 pp_flags;
253}; 292};
254 293
294struct mv_port_signal {
295 u32 amps;
296 u32 pre;
297};
298
299struct mv_host_priv;
300struct mv_hw_ops {
301 void (*phy_errata)(struct mv_host_priv *hpriv, void __iomem *mmio,
302 unsigned int port);
303 void (*enable_leds)(struct mv_host_priv *hpriv, void __iomem *mmio);
304 void (*read_preamp)(struct mv_host_priv *hpriv, int idx,
305 void __iomem *mmio);
306 int (*reset_hc)(struct mv_host_priv *hpriv, void __iomem *mmio,
307 unsigned int n_hc);
308 void (*reset_flash)(struct mv_host_priv *hpriv, void __iomem *mmio);
309 void (*reset_bus)(struct pci_dev *pdev, void __iomem *mmio);
310};
311
255struct mv_host_priv { 312struct mv_host_priv {
256 u32 hp_flags; 313 u32 hp_flags;
314 struct mv_port_signal signal[8];
315 const struct mv_hw_ops *ops;
257}; 316};
258 317
259static void mv_irq_clear(struct ata_port *ap); 318static void mv_irq_clear(struct ata_port *ap);
260static u32 mv_scr_read(struct ata_port *ap, unsigned int sc_reg_in); 319static u32 mv_scr_read(struct ata_port *ap, unsigned int sc_reg_in);
261static void mv_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val); 320static void mv_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val);
321static u32 mv5_scr_read(struct ata_port *ap, unsigned int sc_reg_in);
322static void mv5_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val);
262static void mv_phy_reset(struct ata_port *ap); 323static void mv_phy_reset(struct ata_port *ap);
324static void __mv_phy_reset(struct ata_port *ap, int can_sleep);
263static void mv_host_stop(struct ata_host_set *host_set); 325static void mv_host_stop(struct ata_host_set *host_set);
264static int mv_port_start(struct ata_port *ap); 326static int mv_port_start(struct ata_port *ap);
265static void mv_port_stop(struct ata_port *ap); 327static void mv_port_stop(struct ata_port *ap);
@@ -270,6 +332,29 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance,
270static void mv_eng_timeout(struct ata_port *ap); 332static void mv_eng_timeout(struct ata_port *ap);
271static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); 333static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
272 334
335static void mv5_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio,
336 unsigned int port);
337static void mv5_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio);
338static void mv5_read_preamp(struct mv_host_priv *hpriv, int idx,
339 void __iomem *mmio);
340static int mv5_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio,
341 unsigned int n_hc);
342static void mv5_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio);
343static void mv5_reset_bus(struct pci_dev *pdev, void __iomem *mmio);
344
345static void mv6_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio,
346 unsigned int port);
347static void mv6_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio);
348static void mv6_read_preamp(struct mv_host_priv *hpriv, int idx,
349 void __iomem *mmio);
350static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio,
351 unsigned int n_hc);
352static void mv6_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio);
353static void mv_reset_pci_bus(struct pci_dev *pdev, void __iomem *mmio);
354static void mv_channel_reset(struct mv_host_priv *hpriv, void __iomem *mmio,
355 unsigned int port_no);
356static void mv_stop_and_reset(struct ata_port *ap);
357
273static struct scsi_host_template mv_sht = { 358static struct scsi_host_template mv_sht = {
274 .module = THIS_MODULE, 359 .module = THIS_MODULE,
275 .name = DRV_NAME, 360 .name = DRV_NAME,
@@ -278,7 +363,7 @@ static struct scsi_host_template mv_sht = {
278 .eh_strategy_handler = ata_scsi_error, 363 .eh_strategy_handler = ata_scsi_error,
279 .can_queue = MV_USE_Q_DEPTH, 364 .can_queue = MV_USE_Q_DEPTH,
280 .this_id = ATA_SHT_THIS_ID, 365 .this_id = ATA_SHT_THIS_ID,
281 .sg_tablesize = MV_MAX_SG_CT, 366 .sg_tablesize = MV_MAX_SG_CT / 2,
282 .max_sectors = ATA_MAX_SECTORS, 367 .max_sectors = ATA_MAX_SECTORS,
283 .cmd_per_lun = ATA_SHT_CMD_PER_LUN, 368 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
284 .emulated = ATA_SHT_EMULATED, 369 .emulated = ATA_SHT_EMULATED,
@@ -290,7 +375,34 @@ static struct scsi_host_template mv_sht = {
290 .ordered_flush = 1, 375 .ordered_flush = 1,
291}; 376};
292 377
293static const struct ata_port_operations mv_ops = { 378static const struct ata_port_operations mv5_ops = {
379 .port_disable = ata_port_disable,
380
381 .tf_load = ata_tf_load,
382 .tf_read = ata_tf_read,
383 .check_status = ata_check_status,
384 .exec_command = ata_exec_command,
385 .dev_select = ata_std_dev_select,
386
387 .phy_reset = mv_phy_reset,
388
389 .qc_prep = mv_qc_prep,
390 .qc_issue = mv_qc_issue,
391
392 .eng_timeout = mv_eng_timeout,
393
394 .irq_handler = mv_interrupt,
395 .irq_clear = mv_irq_clear,
396
397 .scr_read = mv5_scr_read,
398 .scr_write = mv5_scr_write,
399
400 .port_start = mv_port_start,
401 .port_stop = mv_port_stop,
402 .host_stop = mv_host_stop,
403};
404
405static const struct ata_port_operations mv6_ops = {
294 .port_disable = ata_port_disable, 406 .port_disable = ata_port_disable,
295 407
296 .tf_load = ata_tf_load, 408 .tf_load = ata_tf_load,
@@ -322,37 +434,44 @@ static struct ata_port_info mv_port_info[] = {
322 .sht = &mv_sht, 434 .sht = &mv_sht,
323 .host_flags = MV_COMMON_FLAGS, 435 .host_flags = MV_COMMON_FLAGS,
324 .pio_mask = 0x1f, /* pio0-4 */ 436 .pio_mask = 0x1f, /* pio0-4 */
325 .udma_mask = 0, /* 0x7f (udma0-6 disabled for now) */ 437 .udma_mask = 0x7f, /* udma0-6 */
326 .port_ops = &mv_ops, 438 .port_ops = &mv5_ops,
327 }, 439 },
328 { /* chip_508x */ 440 { /* chip_508x */
329 .sht = &mv_sht, 441 .sht = &mv_sht,
330 .host_flags = (MV_COMMON_FLAGS | MV_FLAG_DUAL_HC), 442 .host_flags = (MV_COMMON_FLAGS | MV_FLAG_DUAL_HC),
331 .pio_mask = 0x1f, /* pio0-4 */ 443 .pio_mask = 0x1f, /* pio0-4 */
332 .udma_mask = 0, /* 0x7f (udma0-6 disabled for now) */ 444 .udma_mask = 0x7f, /* udma0-6 */
333 .port_ops = &mv_ops, 445 .port_ops = &mv5_ops,
446 },
447 { /* chip_5080 */
448 .sht = &mv_sht,
449 .host_flags = (MV_COMMON_FLAGS | MV_FLAG_DUAL_HC),
450 .pio_mask = 0x1f, /* pio0-4 */
451 .udma_mask = 0x7f, /* udma0-6 */
452 .port_ops = &mv5_ops,
334 }, 453 },
335 { /* chip_604x */ 454 { /* chip_604x */
336 .sht = &mv_sht, 455 .sht = &mv_sht,
337 .host_flags = (MV_COMMON_FLAGS | MV_6XXX_FLAGS), 456 .host_flags = (MV_COMMON_FLAGS | MV_6XXX_FLAGS),
338 .pio_mask = 0x1f, /* pio0-4 */ 457 .pio_mask = 0x1f, /* pio0-4 */
339 .udma_mask = 0x7f, /* udma0-6 */ 458 .udma_mask = 0x7f, /* udma0-6 */
340 .port_ops = &mv_ops, 459 .port_ops = &mv6_ops,
341 }, 460 },
342 { /* chip_608x */ 461 { /* chip_608x */
343 .sht = &mv_sht, 462 .sht = &mv_sht,
344 .host_flags = (MV_COMMON_FLAGS | MV_6XXX_FLAGS | 463 .host_flags = (MV_COMMON_FLAGS | MV_6XXX_FLAGS |
345 MV_FLAG_DUAL_HC), 464 MV_FLAG_DUAL_HC),
346 .pio_mask = 0x1f, /* pio0-4 */ 465 .pio_mask = 0x1f, /* pio0-4 */
347 .udma_mask = 0x7f, /* udma0-6 */ 466 .udma_mask = 0x7f, /* udma0-6 */
348 .port_ops = &mv_ops, 467 .port_ops = &mv6_ops,
349 }, 468 },
350}; 469};
351 470
352static const struct pci_device_id mv_pci_tbl[] = { 471static const struct pci_device_id mv_pci_tbl[] = {
353 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5040), 0, 0, chip_504x}, 472 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5040), 0, 0, chip_504x},
354 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5041), 0, 0, chip_504x}, 473 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5041), 0, 0, chip_504x},
355 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5080), 0, 0, chip_508x}, 474 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5080), 0, 0, chip_5080},
356 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5081), 0, 0, chip_508x}, 475 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5081), 0, 0, chip_508x},
357 476
358 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6040), 0, 0, chip_604x}, 477 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6040), 0, 0, chip_604x},
@@ -371,6 +490,24 @@ static struct pci_driver mv_pci_driver = {
371 .remove = ata_pci_remove_one, 490 .remove = ata_pci_remove_one,
372}; 491};
373 492
493static const struct mv_hw_ops mv5xxx_ops = {
494 .phy_errata = mv5_phy_errata,
495 .enable_leds = mv5_enable_leds,
496 .read_preamp = mv5_read_preamp,
497 .reset_hc = mv5_reset_hc,
498 .reset_flash = mv5_reset_flash,
499 .reset_bus = mv5_reset_bus,
500};
501
502static const struct mv_hw_ops mv6xxx_ops = {
503 .phy_errata = mv6_phy_errata,
504 .enable_leds = mv6_enable_leds,
505 .read_preamp = mv6_read_preamp,
506 .reset_hc = mv6_reset_hc,
507 .reset_flash = mv6_reset_flash,
508 .reset_bus = mv_reset_pci_bus,
509};
510
374/* 511/*
375 * Functions 512 * Functions
376 */ 513 */
@@ -386,11 +523,27 @@ static inline void __iomem *mv_hc_base(void __iomem *base, unsigned int hc)
386 return (base + MV_SATAHC0_REG_BASE + (hc * MV_SATAHC_REG_SZ)); 523 return (base + MV_SATAHC0_REG_BASE + (hc * MV_SATAHC_REG_SZ));
387} 524}
388 525
526static inline unsigned int mv_hc_from_port(unsigned int port)
527{
528 return port >> MV_PORT_HC_SHIFT;
529}
530
531static inline unsigned int mv_hardport_from_port(unsigned int port)
532{
533 return port & MV_PORT_MASK;
534}
535
536static inline void __iomem *mv_hc_base_from_port(void __iomem *base,
537 unsigned int port)
538{
539 return mv_hc_base(base, mv_hc_from_port(port));
540}
541
389static inline void __iomem *mv_port_base(void __iomem *base, unsigned int port) 542static inline void __iomem *mv_port_base(void __iomem *base, unsigned int port)
390{ 543{
391 return (mv_hc_base(base, port >> MV_PORT_HC_SHIFT) + 544 return mv_hc_base_from_port(base, port) +
392 MV_SATAHC_ARBTR_REG_SZ + 545 MV_SATAHC_ARBTR_REG_SZ +
393 ((port & MV_PORT_MASK) * MV_PORT_REG_SZ)); 546 (mv_hardport_from_port(port) * MV_PORT_REG_SZ);
394} 547}
395 548
396static inline void __iomem *mv_ap_base(struct ata_port *ap) 549static inline void __iomem *mv_ap_base(struct ata_port *ap)
@@ -398,9 +551,9 @@ static inline void __iomem *mv_ap_base(struct ata_port *ap)
398 return mv_port_base(ap->host_set->mmio_base, ap->port_no); 551 return mv_port_base(ap->host_set->mmio_base, ap->port_no);
399} 552}
400 553
401static inline int mv_get_hc_count(unsigned long hp_flags) 554static inline int mv_get_hc_count(unsigned long host_flags)
402{ 555{
403 return ((hp_flags & MV_FLAG_DUAL_HC) ? 2 : 1); 556 return ((host_flags & MV_FLAG_DUAL_HC) ? 2 : 1);
404} 557}
405 558
406static void mv_irq_clear(struct ata_port *ap) 559static void mv_irq_clear(struct ata_port *ap)
@@ -452,7 +605,7 @@ static void mv_stop_dma(struct ata_port *ap)
452 } else { 605 } else {
453 assert(!(EDMA_EN & readl(port_mmio + EDMA_CMD_OFS))); 606 assert(!(EDMA_EN & readl(port_mmio + EDMA_CMD_OFS)));
454 } 607 }
455 608
456 /* now properly wait for the eDMA to stop */ 609 /* now properly wait for the eDMA to stop */
457 for (i = 1000; i > 0; i--) { 610 for (i = 1000; i > 0; i--) {
458 reg = readl(port_mmio + EDMA_CMD_OFS); 611 reg = readl(port_mmio + EDMA_CMD_OFS);
@@ -503,7 +656,7 @@ static void mv_dump_all_regs(void __iomem *mmio_base, int port,
503 struct pci_dev *pdev) 656 struct pci_dev *pdev)
504{ 657{
505#ifdef ATA_DEBUG 658#ifdef ATA_DEBUG
506 void __iomem *hc_base = mv_hc_base(mmio_base, 659 void __iomem *hc_base = mv_hc_base(mmio_base,
507 port >> MV_PORT_HC_SHIFT); 660 port >> MV_PORT_HC_SHIFT);
508 void __iomem *port_base; 661 void __iomem *port_base;
509 int start_port, num_ports, p, start_hc, num_hcs, hc; 662 int start_port, num_ports, p, start_hc, num_hcs, hc;
@@ -517,7 +670,7 @@ static void mv_dump_all_regs(void __iomem *mmio_base, int port,
517 start_port = port; 670 start_port = port;
518 num_ports = num_hcs = 1; 671 num_ports = num_hcs = 1;
519 } 672 }
520 DPRINTK("All registers for port(s) %u-%u:\n", start_port, 673 DPRINTK("All registers for port(s) %u-%u:\n", start_port,
521 num_ports > 1 ? num_ports - 1 : start_port); 674 num_ports > 1 ? num_ports - 1 : start_port);
522 675
523 if (NULL != pdev) { 676 if (NULL != pdev) {
@@ -585,70 +738,6 @@ static void mv_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val)
585} 738}
586 739
587/** 740/**
588 * mv_global_soft_reset - Perform the 6xxx global soft reset
589 * @mmio_base: base address of the HBA
590 *
591 * This routine only applies to 6xxx parts.
592 *
593 * LOCKING:
594 * Inherited from caller.
595 */
596static int mv_global_soft_reset(void __iomem *mmio_base)
597{
598 void __iomem *reg = mmio_base + PCI_MAIN_CMD_STS_OFS;
599 int i, rc = 0;
600 u32 t;
601
602 /* Following procedure defined in PCI "main command and status
603 * register" table.
604 */
605 t = readl(reg);
606 writel(t | STOP_PCI_MASTER, reg);
607
608 for (i = 0; i < 1000; i++) {
609 udelay(1);
610 t = readl(reg);
611 if (PCI_MASTER_EMPTY & t) {
612 break;
613 }
614 }
615 if (!(PCI_MASTER_EMPTY & t)) {
616 printk(KERN_ERR DRV_NAME ": PCI master won't flush\n");
617 rc = 1;
618 goto done;
619 }
620
621 /* set reset */
622 i = 5;
623 do {
624 writel(t | GLOB_SFT_RST, reg);
625 t = readl(reg);
626 udelay(1);
627 } while (!(GLOB_SFT_RST & t) && (i-- > 0));
628
629 if (!(GLOB_SFT_RST & t)) {
630 printk(KERN_ERR DRV_NAME ": can't set global reset\n");
631 rc = 1;
632 goto done;
633 }
634
635 /* clear reset and *reenable the PCI master* (not mentioned in spec) */
636 i = 5;
637 do {
638 writel(t & ~(GLOB_SFT_RST | STOP_PCI_MASTER), reg);
639 t = readl(reg);
640 udelay(1);
641 } while ((GLOB_SFT_RST & t) && (i-- > 0));
642
643 if (GLOB_SFT_RST & t) {
644 printk(KERN_ERR DRV_NAME ": can't clear global reset\n");
645 rc = 1;
646 }
647done:
648 return rc;
649}
650
651/**
652 * mv_host_stop - Host specific cleanup/stop routine. 741 * mv_host_stop - Host specific cleanup/stop routine.
653 * @host_set: host data structure 742 * @host_set: host data structure
654 * 743 *
@@ -701,7 +790,7 @@ static int mv_port_start(struct ata_port *ap)
701 goto err_out; 790 goto err_out;
702 memset(pp, 0, sizeof(*pp)); 791 memset(pp, 0, sizeof(*pp));
703 792
704 mem = dma_alloc_coherent(dev, MV_PORT_PRIV_DMA_SZ, &mem_dma, 793 mem = dma_alloc_coherent(dev, MV_PORT_PRIV_DMA_SZ, &mem_dma,
705 GFP_KERNEL); 794 GFP_KERNEL);
706 if (!mem) 795 if (!mem)
707 goto err_out_pp; 796 goto err_out_pp;
@@ -711,7 +800,7 @@ static int mv_port_start(struct ata_port *ap)
711 if (rc) 800 if (rc)
712 goto err_out_priv; 801 goto err_out_priv;
713 802
714 /* First item in chunk of DMA memory: 803 /* First item in chunk of DMA memory:
715 * 32-slot command request table (CRQB), 32 bytes each in size 804 * 32-slot command request table (CRQB), 32 bytes each in size
716 */ 805 */
717 pp->crqb = mem; 806 pp->crqb = mem;
@@ -719,7 +808,7 @@ static int mv_port_start(struct ata_port *ap)
719 mem += MV_CRQB_Q_SZ; 808 mem += MV_CRQB_Q_SZ;
720 mem_dma += MV_CRQB_Q_SZ; 809 mem_dma += MV_CRQB_Q_SZ;
721 810
722 /* Second item: 811 /* Second item:
723 * 32-slot command response table (CRPB), 8 bytes each in size 812 * 32-slot command response table (CRPB), 8 bytes each in size
724 */ 813 */
725 pp->crpb = mem; 814 pp->crpb = mem;
@@ -733,18 +822,18 @@ static int mv_port_start(struct ata_port *ap)
733 pp->sg_tbl = mem; 822 pp->sg_tbl = mem;
734 pp->sg_tbl_dma = mem_dma; 823 pp->sg_tbl_dma = mem_dma;
735 824
736 writelfl(EDMA_CFG_Q_DEPTH | EDMA_CFG_RD_BRST_EXT | 825 writelfl(EDMA_CFG_Q_DEPTH | EDMA_CFG_RD_BRST_EXT |
737 EDMA_CFG_WR_BUFF_LEN, port_mmio + EDMA_CFG_OFS); 826 EDMA_CFG_WR_BUFF_LEN, port_mmio + EDMA_CFG_OFS);
738 827
739 writel((pp->crqb_dma >> 16) >> 16, port_mmio + EDMA_REQ_Q_BASE_HI_OFS); 828 writel((pp->crqb_dma >> 16) >> 16, port_mmio + EDMA_REQ_Q_BASE_HI_OFS);
740 writelfl(pp->crqb_dma & EDMA_REQ_Q_BASE_LO_MASK, 829 writelfl(pp->crqb_dma & EDMA_REQ_Q_BASE_LO_MASK,
741 port_mmio + EDMA_REQ_Q_IN_PTR_OFS); 830 port_mmio + EDMA_REQ_Q_IN_PTR_OFS);
742 831
743 writelfl(0, port_mmio + EDMA_REQ_Q_OUT_PTR_OFS); 832 writelfl(0, port_mmio + EDMA_REQ_Q_OUT_PTR_OFS);
744 writelfl(0, port_mmio + EDMA_RSP_Q_IN_PTR_OFS); 833 writelfl(0, port_mmio + EDMA_RSP_Q_IN_PTR_OFS);
745 834
746 writel((pp->crpb_dma >> 16) >> 16, port_mmio + EDMA_RSP_Q_BASE_HI_OFS); 835 writel((pp->crpb_dma >> 16) >> 16, port_mmio + EDMA_RSP_Q_BASE_HI_OFS);
747 writelfl(pp->crpb_dma & EDMA_RSP_Q_BASE_LO_MASK, 836 writelfl(pp->crpb_dma & EDMA_RSP_Q_BASE_LO_MASK,
748 port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); 837 port_mmio + EDMA_RSP_Q_OUT_PTR_OFS);
749 838
750 pp->req_producer = pp->rsp_consumer = 0; 839 pp->req_producer = pp->rsp_consumer = 0;
@@ -805,20 +894,30 @@ static void mv_fill_sg(struct ata_queued_cmd *qc)
805 struct scatterlist *sg; 894 struct scatterlist *sg;
806 895
807 ata_for_each_sg(sg, qc) { 896 ata_for_each_sg(sg, qc) {
808 u32 sg_len;
809 dma_addr_t addr; 897 dma_addr_t addr;
898 u32 sg_len, len, offset;
810 899
811 addr = sg_dma_address(sg); 900 addr = sg_dma_address(sg);
812 sg_len = sg_dma_len(sg); 901 sg_len = sg_dma_len(sg);
813 902
814 pp->sg_tbl[i].addr = cpu_to_le32(addr & 0xffffffff); 903 while (sg_len) {
815 pp->sg_tbl[i].addr_hi = cpu_to_le32((addr >> 16) >> 16); 904 offset = addr & MV_DMA_BOUNDARY;
816 assert(0 == (sg_len & ~MV_DMA_BOUNDARY)); 905 len = sg_len;
817 pp->sg_tbl[i].flags_size = cpu_to_le32(sg_len); 906 if ((offset + sg_len) > 0x10000)
818 if (ata_sg_is_last(sg, qc)) 907 len = 0x10000 - offset;
819 pp->sg_tbl[i].flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL); 908
909 pp->sg_tbl[i].addr = cpu_to_le32(addr & 0xffffffff);
910 pp->sg_tbl[i].addr_hi = cpu_to_le32((addr >> 16) >> 16);
911 pp->sg_tbl[i].flags_size = cpu_to_le32(len);
912
913 sg_len -= len;
914 addr += len;
915
916 if (!sg_len && ata_sg_is_last(sg, qc))
917 pp->sg_tbl[i].flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
820 918
821 i++; 919 i++;
920 }
822 } 921 }
823} 922}
824 923
@@ -859,7 +958,7 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
859 } 958 }
860 959
861 /* the req producer index should be the same as we remember it */ 960 /* the req producer index should be the same as we remember it */
862 assert(((readl(mv_ap_base(qc->ap) + EDMA_REQ_Q_IN_PTR_OFS) >> 961 assert(((readl(mv_ap_base(qc->ap) + EDMA_REQ_Q_IN_PTR_OFS) >>
863 EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) == 962 EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) ==
864 pp->req_producer); 963 pp->req_producer);
865 964
@@ -871,9 +970,9 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
871 assert(MV_MAX_Q_DEPTH > qc->tag); 970 assert(MV_MAX_Q_DEPTH > qc->tag);
872 flags |= qc->tag << CRQB_TAG_SHIFT; 971 flags |= qc->tag << CRQB_TAG_SHIFT;
873 972
874 pp->crqb[pp->req_producer].sg_addr = 973 pp->crqb[pp->req_producer].sg_addr =
875 cpu_to_le32(pp->sg_tbl_dma & 0xffffffff); 974 cpu_to_le32(pp->sg_tbl_dma & 0xffffffff);
876 pp->crqb[pp->req_producer].sg_addr_hi = 975 pp->crqb[pp->req_producer].sg_addr_hi =
877 cpu_to_le32((pp->sg_tbl_dma >> 16) >> 16); 976 cpu_to_le32((pp->sg_tbl_dma >> 16) >> 16);
878 pp->crqb[pp->req_producer].ctrl_flags = cpu_to_le16(flags); 977 pp->crqb[pp->req_producer].ctrl_flags = cpu_to_le16(flags);
879 978
@@ -896,7 +995,7 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
896#ifdef LIBATA_NCQ /* FIXME: remove this line when NCQ added */ 995#ifdef LIBATA_NCQ /* FIXME: remove this line when NCQ added */
897 case ATA_CMD_FPDMA_READ: 996 case ATA_CMD_FPDMA_READ:
898 case ATA_CMD_FPDMA_WRITE: 997 case ATA_CMD_FPDMA_WRITE:
899 mv_crqb_pack_cmd(cw++, tf->hob_feature, ATA_REG_FEATURE, 0); 998 mv_crqb_pack_cmd(cw++, tf->hob_feature, ATA_REG_FEATURE, 0);
900 mv_crqb_pack_cmd(cw++, tf->feature, ATA_REG_FEATURE, 0); 999 mv_crqb_pack_cmd(cw++, tf->feature, ATA_REG_FEATURE, 0);
901 break; 1000 break;
902#endif /* FIXME: remove this line when NCQ added */ 1001#endif /* FIXME: remove this line when NCQ added */
@@ -962,7 +1061,7 @@ static int mv_qc_issue(struct ata_queued_cmd *qc)
962 pp->req_producer); 1061 pp->req_producer);
963 /* until we do queuing, the queue should be empty at this point */ 1062 /* until we do queuing, the queue should be empty at this point */
964 assert(((in_ptr >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) == 1063 assert(((in_ptr >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) ==
965 ((readl(port_mmio + EDMA_REQ_Q_OUT_PTR_OFS) >> 1064 ((readl(port_mmio + EDMA_REQ_Q_OUT_PTR_OFS) >>
966 EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK)); 1065 EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK));
967 1066
968 mv_inc_q_index(&pp->req_producer); /* now incr producer index */ 1067 mv_inc_q_index(&pp->req_producer); /* now incr producer index */
@@ -999,15 +1098,15 @@ static u8 mv_get_crpb_status(struct ata_port *ap)
999 out_ptr = readl(port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); 1098 out_ptr = readl(port_mmio + EDMA_RSP_Q_OUT_PTR_OFS);
1000 1099
1001 /* the response consumer index should be the same as we remember it */ 1100 /* the response consumer index should be the same as we remember it */
1002 assert(((out_ptr >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) == 1101 assert(((out_ptr >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) ==
1003 pp->rsp_consumer); 1102 pp->rsp_consumer);
1004 1103
1005 /* increment our consumer index... */ 1104 /* increment our consumer index... */
1006 pp->rsp_consumer = mv_inc_q_index(&pp->rsp_consumer); 1105 pp->rsp_consumer = mv_inc_q_index(&pp->rsp_consumer);
1007 1106
1008 /* and, until we do NCQ, there should only be 1 CRPB waiting */ 1107 /* and, until we do NCQ, there should only be 1 CRPB waiting */
1009 assert(((readl(port_mmio + EDMA_RSP_Q_IN_PTR_OFS) >> 1108 assert(((readl(port_mmio + EDMA_RSP_Q_IN_PTR_OFS) >>
1010 EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) == 1109 EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) ==
1011 pp->rsp_consumer); 1110 pp->rsp_consumer);
1012 1111
1013 /* write out our inc'd consumer index so EDMA knows we're caught up */ 1112 /* write out our inc'd consumer index so EDMA knows we're caught up */
@@ -1055,7 +1154,7 @@ static void mv_err_intr(struct ata_port *ap)
1055 1154
1056 /* check for fatal here and recover if needed */ 1155 /* check for fatal here and recover if needed */
1057 if (EDMA_ERR_FATAL & edma_err_cause) { 1156 if (EDMA_ERR_FATAL & edma_err_cause) {
1058 mv_phy_reset(ap); 1157 mv_stop_and_reset(ap);
1059 } 1158 }
1060} 1159}
1061 1160
@@ -1120,6 +1219,10 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant,
1120 handled++; 1219 handled++;
1121 } 1220 }
1122 1221
1222 if (ap &&
1223 (ap->flags & (ATA_FLAG_PORT_DISABLED | ATA_FLAG_NOINTR)))
1224 continue;
1225
1123 err_mask = ac_err_mask(ata_status); 1226 err_mask = ac_err_mask(ata_status);
1124 1227
1125 shift = port << 1; /* (port * 2) */ 1228 shift = port << 1; /* (port * 2) */
@@ -1131,14 +1234,15 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant,
1131 err_mask |= AC_ERR_OTHER; 1234 err_mask |= AC_ERR_OTHER;
1132 handled++; 1235 handled++;
1133 } 1236 }
1134 1237
1135 if (handled && ap) { 1238 if (handled && ap) {
1136 qc = ata_qc_from_tag(ap, ap->active_tag); 1239 qc = ata_qc_from_tag(ap, ap->active_tag);
1137 if (NULL != qc) { 1240 if (NULL != qc) {
1138 VPRINTK("port %u IRQ found for qc, " 1241 VPRINTK("port %u IRQ found for qc, "
1139 "ata_status 0x%x\n", port,ata_status); 1242 "ata_status 0x%x\n", port,ata_status);
1140 /* mark qc status appropriately */ 1243 /* mark qc status appropriately */
1141 ata_qc_complete(qc, err_mask); 1244 if (!(qc->tf.ctl & ATA_NIEN))
1245 ata_qc_complete(qc, err_mask);
1142 } 1246 }
1143 } 1247 }
1144 } 1248 }
@@ -1146,7 +1250,7 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant,
1146} 1250}
1147 1251
1148/** 1252/**
1149 * mv_interrupt - 1253 * mv_interrupt -
1150 * @irq: unused 1254 * @irq: unused
1151 * @dev_instance: private data; in this case the host structure 1255 * @dev_instance: private data; in this case the host structure
1152 * @regs: unused 1256 * @regs: unused
@@ -1156,7 +1260,7 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant,
1156 * routine to handle. Also check for PCI errors which are only 1260 * routine to handle. Also check for PCI errors which are only
1157 * reported here. 1261 * reported here.
1158 * 1262 *
1159 * LOCKING: 1263 * LOCKING:
1160 * This routine holds the host_set lock while processing pending 1264 * This routine holds the host_set lock while processing pending
1161 * interrupts. 1265 * interrupts.
1162 */ 1266 */
@@ -1202,8 +1306,422 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance,
1202 return IRQ_RETVAL(handled); 1306 return IRQ_RETVAL(handled);
1203} 1307}
1204 1308
1309static void __iomem *mv5_phy_base(void __iomem *mmio, unsigned int port)
1310{
1311 void __iomem *hc_mmio = mv_hc_base_from_port(mmio, port);
1312 unsigned long ofs = (mv_hardport_from_port(port) + 1) * 0x100UL;
1313
1314 return hc_mmio + ofs;
1315}
1316
1317static unsigned int mv5_scr_offset(unsigned int sc_reg_in)
1318{
1319 unsigned int ofs;
1320
1321 switch (sc_reg_in) {
1322 case SCR_STATUS:
1323 case SCR_ERROR:
1324 case SCR_CONTROL:
1325 ofs = sc_reg_in * sizeof(u32);
1326 break;
1327 default:
1328 ofs = 0xffffffffU;
1329 break;
1330 }
1331 return ofs;
1332}
1333
1334static u32 mv5_scr_read(struct ata_port *ap, unsigned int sc_reg_in)
1335{
1336 void __iomem *mmio = mv5_phy_base(ap->host_set->mmio_base, ap->port_no);
1337 unsigned int ofs = mv5_scr_offset(sc_reg_in);
1338
1339 if (ofs != 0xffffffffU)
1340 return readl(mmio + ofs);
1341 else
1342 return (u32) ofs;
1343}
1344
1345static void mv5_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val)
1346{
1347 void __iomem *mmio = mv5_phy_base(ap->host_set->mmio_base, ap->port_no);
1348 unsigned int ofs = mv5_scr_offset(sc_reg_in);
1349
1350 if (ofs != 0xffffffffU)
1351 writelfl(val, mmio + ofs);
1352}
1353
1354static void mv5_reset_bus(struct pci_dev *pdev, void __iomem *mmio)
1355{
1356 u8 rev_id;
1357 int early_5080;
1358
1359 pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id);
1360
1361 early_5080 = (pdev->device == 0x5080) && (rev_id == 0);
1362
1363 if (!early_5080) {
1364 u32 tmp = readl(mmio + MV_PCI_EXP_ROM_BAR_CTL);
1365 tmp |= (1 << 0);
1366 writel(tmp, mmio + MV_PCI_EXP_ROM_BAR_CTL);
1367 }
1368
1369 mv_reset_pci_bus(pdev, mmio);
1370}
1371
1372static void mv5_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio)
1373{
1374 writel(0x0fcfffff, mmio + MV_FLASH_CTL);
1375}
1376
1377static void mv5_read_preamp(struct mv_host_priv *hpriv, int idx,
1378 void __iomem *mmio)
1379{
1380 void __iomem *phy_mmio = mv5_phy_base(mmio, idx);
1381 u32 tmp;
1382
1383 tmp = readl(phy_mmio + MV5_PHY_MODE);
1384
1385 hpriv->signal[idx].pre = tmp & 0x1800; /* bits 12:11 */
1386 hpriv->signal[idx].amps = tmp & 0xe0; /* bits 7:5 */
1387}
1388
1389static void mv5_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio)
1390{
1391 u32 tmp;
1392
1393 writel(0, mmio + MV_GPIO_PORT_CTL);
1394
1395 /* FIXME: handle MV_HP_ERRATA_50XXB2 errata */
1396
1397 tmp = readl(mmio + MV_PCI_EXP_ROM_BAR_CTL);
1398 tmp |= ~(1 << 0);
1399 writel(tmp, mmio + MV_PCI_EXP_ROM_BAR_CTL);
1400}
1401
1402static void mv5_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio,
1403 unsigned int port)
1404{
1405 void __iomem *phy_mmio = mv5_phy_base(mmio, port);
1406 const u32 mask = (1<<12) | (1<<11) | (1<<7) | (1<<6) | (1<<5);
1407 u32 tmp;
1408 int fix_apm_sq = (hpriv->hp_flags & MV_HP_ERRATA_50XXB0);
1409
1410 if (fix_apm_sq) {
1411 tmp = readl(phy_mmio + MV5_LT_MODE);
1412 tmp |= (1 << 19);
1413 writel(tmp, phy_mmio + MV5_LT_MODE);
1414
1415 tmp = readl(phy_mmio + MV5_PHY_CTL);
1416 tmp &= ~0x3;
1417 tmp |= 0x1;
1418 writel(tmp, phy_mmio + MV5_PHY_CTL);
1419 }
1420
1421 tmp = readl(phy_mmio + MV5_PHY_MODE);
1422 tmp &= ~mask;
1423 tmp |= hpriv->signal[port].pre;
1424 tmp |= hpriv->signal[port].amps;
1425 writel(tmp, phy_mmio + MV5_PHY_MODE);
1426}
1427
1428
1429#undef ZERO
1430#define ZERO(reg) writel(0, port_mmio + (reg))
1431static void mv5_reset_hc_port(struct mv_host_priv *hpriv, void __iomem *mmio,
1432 unsigned int port)
1433{
1434 void __iomem *port_mmio = mv_port_base(mmio, port);
1435
1436 writelfl(EDMA_DS, port_mmio + EDMA_CMD_OFS);
1437
1438 mv_channel_reset(hpriv, mmio, port);
1439
1440 ZERO(0x028); /* command */
1441 writel(0x11f, port_mmio + EDMA_CFG_OFS);
1442 ZERO(0x004); /* timer */
1443 ZERO(0x008); /* irq err cause */
1444 ZERO(0x00c); /* irq err mask */
1445 ZERO(0x010); /* rq bah */
1446 ZERO(0x014); /* rq inp */
1447 ZERO(0x018); /* rq outp */
1448 ZERO(0x01c); /* respq bah */
1449 ZERO(0x024); /* respq outp */
1450 ZERO(0x020); /* respq inp */
1451 ZERO(0x02c); /* test control */
1452 writel(0xbc, port_mmio + EDMA_IORDY_TMOUT);
1453}
1454#undef ZERO
1455
1456#define ZERO(reg) writel(0, hc_mmio + (reg))
1457static void mv5_reset_one_hc(struct mv_host_priv *hpriv, void __iomem *mmio,
1458 unsigned int hc)
1459{
1460 void __iomem *hc_mmio = mv_hc_base(mmio, hc);
1461 u32 tmp;
1462
1463 ZERO(0x00c);
1464 ZERO(0x010);
1465 ZERO(0x014);
1466 ZERO(0x018);
1467
1468 tmp = readl(hc_mmio + 0x20);
1469 tmp &= 0x1c1c1c1c;
1470 tmp |= 0x03030303;
1471 writel(tmp, hc_mmio + 0x20);
1472}
1473#undef ZERO
1474
1475static int mv5_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio,
1476 unsigned int n_hc)
1477{
1478 unsigned int hc, port;
1479
1480 for (hc = 0; hc < n_hc; hc++) {
1481 for (port = 0; port < MV_PORTS_PER_HC; port++)
1482 mv5_reset_hc_port(hpriv, mmio,
1483 (hc * MV_PORTS_PER_HC) + port);
1484
1485 mv5_reset_one_hc(hpriv, mmio, hc);
1486 }
1487
1488 return 0;
1489}
1490
1491#undef ZERO
1492#define ZERO(reg) writel(0, mmio + (reg))
1493static void mv_reset_pci_bus(struct pci_dev *pdev, void __iomem *mmio)
1494{
1495 u32 tmp;
1496
1497 tmp = readl(mmio + MV_PCI_MODE);
1498 tmp &= 0xff00ffff;
1499 writel(tmp, mmio + MV_PCI_MODE);
1500
1501 ZERO(MV_PCI_DISC_TIMER);
1502 ZERO(MV_PCI_MSI_TRIGGER);
1503 writel(0x000100ff, mmio + MV_PCI_XBAR_TMOUT);
1504 ZERO(HC_MAIN_IRQ_MASK_OFS);
1505 ZERO(MV_PCI_SERR_MASK);
1506 ZERO(PCI_IRQ_CAUSE_OFS);
1507 ZERO(PCI_IRQ_MASK_OFS);
1508 ZERO(MV_PCI_ERR_LOW_ADDRESS);
1509 ZERO(MV_PCI_ERR_HIGH_ADDRESS);
1510 ZERO(MV_PCI_ERR_ATTRIBUTE);
1511 ZERO(MV_PCI_ERR_COMMAND);
1512}
1513#undef ZERO
1514
1515static void mv6_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio)
1516{
1517 u32 tmp;
1518
1519 mv5_reset_flash(hpriv, mmio);
1520
1521 tmp = readl(mmio + MV_GPIO_PORT_CTL);
1522 tmp &= 0x3;
1523 tmp |= (1 << 5) | (1 << 6);
1524 writel(tmp, mmio + MV_GPIO_PORT_CTL);
1525}
1526
1527/**
1528 * mv6_reset_hc - Perform the 6xxx global soft reset
1529 * @mmio: base address of the HBA
1530 *
1531 * This routine only applies to 6xxx parts.
1532 *
1533 * LOCKING:
1534 * Inherited from caller.
1535 */
1536static int mv6_reset_hc(struct mv_host_priv *hpriv, void __iomem *mmio,
1537 unsigned int n_hc)
1538{
1539 void __iomem *reg = mmio + PCI_MAIN_CMD_STS_OFS;
1540 int i, rc = 0;
1541 u32 t;
1542
1543 /* Following procedure defined in PCI "main command and status
1544 * register" table.
1545 */
1546 t = readl(reg);
1547 writel(t | STOP_PCI_MASTER, reg);
1548
1549 for (i = 0; i < 1000; i++) {
1550 udelay(1);
1551 t = readl(reg);
1552 if (PCI_MASTER_EMPTY & t) {
1553 break;
1554 }
1555 }
1556 if (!(PCI_MASTER_EMPTY & t)) {
1557 printk(KERN_ERR DRV_NAME ": PCI master won't flush\n");
1558 rc = 1;
1559 goto done;
1560 }
1561
1562 /* set reset */
1563 i = 5;
1564 do {
1565 writel(t | GLOB_SFT_RST, reg);
1566 t = readl(reg);
1567 udelay(1);
1568 } while (!(GLOB_SFT_RST & t) && (i-- > 0));
1569
1570 if (!(GLOB_SFT_RST & t)) {
1571 printk(KERN_ERR DRV_NAME ": can't set global reset\n");
1572 rc = 1;
1573 goto done;
1574 }
1575
1576 /* clear reset and *reenable the PCI master* (not mentioned in spec) */
1577 i = 5;
1578 do {
1579 writel(t & ~(GLOB_SFT_RST | STOP_PCI_MASTER), reg);
1580 t = readl(reg);
1581 udelay(1);
1582 } while ((GLOB_SFT_RST & t) && (i-- > 0));
1583
1584 if (GLOB_SFT_RST & t) {
1585 printk(KERN_ERR DRV_NAME ": can't clear global reset\n");
1586 rc = 1;
1587 }
1588done:
1589 return rc;
1590}
1591
1592static void mv6_read_preamp(struct mv_host_priv *hpriv, int idx,
1593 void __iomem *mmio)
1594{
1595 void __iomem *port_mmio;
1596 u32 tmp;
1597
1598 tmp = readl(mmio + MV_RESET_CFG);
1599 if ((tmp & (1 << 0)) == 0) {
1600 hpriv->signal[idx].amps = 0x7 << 8;
1601 hpriv->signal[idx].pre = 0x1 << 5;
1602 return;
1603 }
1604
1605 port_mmio = mv_port_base(mmio, idx);
1606 tmp = readl(port_mmio + PHY_MODE2);
1607
1608 hpriv->signal[idx].amps = tmp & 0x700; /* bits 10:8 */
1609 hpriv->signal[idx].pre = tmp & 0xe0; /* bits 7:5 */
1610}
1611
1612static void mv6_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio)
1613{
1614 writel(0x00000060, mmio + MV_GPIO_PORT_CTL);
1615}
1616
1617static void mv6_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio,
1618 unsigned int port)
1619{
1620 void __iomem *port_mmio = mv_port_base(mmio, port);
1621
1622 u32 hp_flags = hpriv->hp_flags;
1623 int fix_phy_mode2 =
1624 hp_flags & (MV_HP_ERRATA_60X1B2 | MV_HP_ERRATA_60X1C0);
1625 int fix_phy_mode4 =
1626 hp_flags & (MV_HP_ERRATA_60X1B2 | MV_HP_ERRATA_60X1C0);
1627 u32 m2, tmp;
1628
1629 if (fix_phy_mode2) {
1630 m2 = readl(port_mmio + PHY_MODE2);
1631 m2 &= ~(1 << 16);
1632 m2 |= (1 << 31);
1633 writel(m2, port_mmio + PHY_MODE2);
1634
1635 udelay(200);
1636
1637 m2 = readl(port_mmio + PHY_MODE2);
1638 m2 &= ~((1 << 16) | (1 << 31));
1639 writel(m2, port_mmio + PHY_MODE2);
1640
1641 udelay(200);
1642 }
1643
1644 /* who knows what this magic does */
1645 tmp = readl(port_mmio + PHY_MODE3);
1646 tmp &= ~0x7F800000;
1647 tmp |= 0x2A800000;
1648 writel(tmp, port_mmio + PHY_MODE3);
1649
1650 if (fix_phy_mode4) {
1651 u32 m4;
1652
1653 m4 = readl(port_mmio + PHY_MODE4);
1654
1655 if (hp_flags & MV_HP_ERRATA_60X1B2)
1656 tmp = readl(port_mmio + 0x310);
1657
1658 m4 = (m4 & ~(1 << 1)) | (1 << 0);
1659
1660 writel(m4, port_mmio + PHY_MODE4);
1661
1662 if (hp_flags & MV_HP_ERRATA_60X1B2)
1663 writel(tmp, port_mmio + 0x310);
1664 }
1665
1666 /* Revert values of pre-emphasis and signal amps to the saved ones */
1667 m2 = readl(port_mmio + PHY_MODE2);
1668
1669 m2 &= ~MV_M2_PREAMP_MASK;
1670 m2 |= hpriv->signal[port].amps;
1671 m2 |= hpriv->signal[port].pre;
1672 m2 &= ~(1 << 16);
1673
1674 writel(m2, port_mmio + PHY_MODE2);
1675}
1676
1677static void mv_channel_reset(struct mv_host_priv *hpriv, void __iomem *mmio,
1678 unsigned int port_no)
1679{
1680 void __iomem *port_mmio = mv_port_base(mmio, port_no);
1681
1682 writelfl(ATA_RST, port_mmio + EDMA_CMD_OFS);
1683
1684 if (IS_60XX(hpriv)) {
1685 u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL);
1686 ifctl |= (1 << 12) | (1 << 7);
1687 writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL);
1688 }
1689
1690 udelay(25); /* allow reset propagation */
1691
1692 /* Spec never mentions clearing the bit. Marvell's driver does
1693 * clear the bit, however.
1694 */
1695 writelfl(0, port_mmio + EDMA_CMD_OFS);
1696
1697 hpriv->ops->phy_errata(hpriv, mmio, port_no);
1698
1699 if (IS_50XX(hpriv))
1700 mdelay(1);
1701}
1702
1703static void mv_stop_and_reset(struct ata_port *ap)
1704{
1705 struct mv_host_priv *hpriv = ap->host_set->private_data;
1706 void __iomem *mmio = ap->host_set->mmio_base;
1707
1708 mv_stop_dma(ap);
1709
1710 mv_channel_reset(hpriv, mmio, ap->port_no);
1711
1712 __mv_phy_reset(ap, 0);
1713}
1714
1715static inline void __msleep(unsigned int msec, int can_sleep)
1716{
1717 if (can_sleep)
1718 msleep(msec);
1719 else
1720 mdelay(msec);
1721}
1722
1205/** 1723/**
1206 * mv_phy_reset - Perform eDMA reset followed by COMRESET 1724 * __mv_phy_reset - Perform eDMA reset followed by COMRESET
1207 * @ap: ATA channel to manipulate 1725 * @ap: ATA channel to manipulate
1208 * 1726 *
1209 * Part of this is taken from __sata_phy_reset and modified to 1727 * Part of this is taken from __sata_phy_reset and modified to
@@ -1213,41 +1731,47 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance,
1213 * Inherited from caller. This is coded to safe to call at 1731 * Inherited from caller. This is coded to safe to call at
1214 * interrupt level, i.e. it does not sleep. 1732 * interrupt level, i.e. it does not sleep.
1215 */ 1733 */
1216static void mv_phy_reset(struct ata_port *ap) 1734static void __mv_phy_reset(struct ata_port *ap, int can_sleep)
1217{ 1735{
1736 struct mv_port_priv *pp = ap->private_data;
1737 struct mv_host_priv *hpriv = ap->host_set->private_data;
1218 void __iomem *port_mmio = mv_ap_base(ap); 1738 void __iomem *port_mmio = mv_ap_base(ap);
1219 struct ata_taskfile tf; 1739 struct ata_taskfile tf;
1220 struct ata_device *dev = &ap->device[0]; 1740 struct ata_device *dev = &ap->device[0];
1221 unsigned long timeout; 1741 unsigned long timeout;
1742 int retry = 5;
1743 u32 sstatus;
1222 1744
1223 VPRINTK("ENTER, port %u, mmio 0x%p\n", ap->port_no, port_mmio); 1745 VPRINTK("ENTER, port %u, mmio 0x%p\n", ap->port_no, port_mmio);
1224 1746
1225 mv_stop_dma(ap); 1747 DPRINTK("S-regs after ATA_RST: SStat 0x%08x SErr 0x%08x "
1226
1227 writelfl(ATA_RST, port_mmio + EDMA_CMD_OFS);
1228 udelay(25); /* allow reset propagation */
1229
1230 /* Spec never mentions clearing the bit. Marvell's driver does
1231 * clear the bit, however.
1232 */
1233 writelfl(0, port_mmio + EDMA_CMD_OFS);
1234
1235 VPRINTK("S-regs after ATA_RST: SStat 0x%08x SErr 0x%08x "
1236 "SCtrl 0x%08x\n", mv_scr_read(ap, SCR_STATUS), 1748 "SCtrl 0x%08x\n", mv_scr_read(ap, SCR_STATUS),
1237 mv_scr_read(ap, SCR_ERROR), mv_scr_read(ap, SCR_CONTROL)); 1749 mv_scr_read(ap, SCR_ERROR), mv_scr_read(ap, SCR_CONTROL));
1238 1750
1239 /* proceed to init communications via the scr_control reg */ 1751 /* Issue COMRESET via SControl */
1752comreset_retry:
1240 scr_write_flush(ap, SCR_CONTROL, 0x301); 1753 scr_write_flush(ap, SCR_CONTROL, 0x301);
1241 mdelay(1); 1754 __msleep(1, can_sleep);
1755
1242 scr_write_flush(ap, SCR_CONTROL, 0x300); 1756 scr_write_flush(ap, SCR_CONTROL, 0x300);
1243 timeout = jiffies + (HZ * 1); 1757 __msleep(20, can_sleep);
1758
1759 timeout = jiffies + msecs_to_jiffies(200);
1244 do { 1760 do {
1245 mdelay(10); 1761 sstatus = scr_read(ap, SCR_STATUS) & 0x3;
1246 if ((scr_read(ap, SCR_STATUS) & 0xf) != 1) 1762 if ((sstatus == 3) || (sstatus == 0))
1247 break; 1763 break;
1764
1765 __msleep(1, can_sleep);
1248 } while (time_before(jiffies, timeout)); 1766 } while (time_before(jiffies, timeout));
1249 1767
1250 VPRINTK("S-regs after PHY wake: SStat 0x%08x SErr 0x%08x " 1768 /* work around errata */
1769 if (IS_60XX(hpriv) &&
1770 (sstatus != 0x0) && (sstatus != 0x113) && (sstatus != 0x123) &&
1771 (retry-- > 0))
1772 goto comreset_retry;
1773
1774 DPRINTK("S-regs after PHY wake: SStat 0x%08x SErr 0x%08x "
1251 "SCtrl 0x%08x\n", mv_scr_read(ap, SCR_STATUS), 1775 "SCtrl 0x%08x\n", mv_scr_read(ap, SCR_STATUS),
1252 mv_scr_read(ap, SCR_ERROR), mv_scr_read(ap, SCR_CONTROL)); 1776 mv_scr_read(ap, SCR_ERROR), mv_scr_read(ap, SCR_CONTROL));
1253 1777
@@ -1261,6 +1785,21 @@ static void mv_phy_reset(struct ata_port *ap)
1261 } 1785 }
1262 ap->cbl = ATA_CBL_SATA; 1786 ap->cbl = ATA_CBL_SATA;
1263 1787
1788 /* even after SStatus reflects that device is ready,
1789 * it seems to take a while for link to be fully
1790 * established (and thus Status no longer 0x80/0x7F),
1791 * so we poll a bit for that, here.
1792 */
1793 retry = 20;
1794 while (1) {
1795 u8 drv_stat = ata_check_status(ap);
1796 if ((drv_stat != 0x80) && (drv_stat != 0x7f))
1797 break;
1798 __msleep(500, can_sleep);
1799 if (retry-- <= 0)
1800 break;
1801 }
1802
1264 tf.lbah = readb((void __iomem *) ap->ioaddr.lbah_addr); 1803 tf.lbah = readb((void __iomem *) ap->ioaddr.lbah_addr);
1265 tf.lbam = readb((void __iomem *) ap->ioaddr.lbam_addr); 1804 tf.lbam = readb((void __iomem *) ap->ioaddr.lbam_addr);
1266 tf.lbal = readb((void __iomem *) ap->ioaddr.lbal_addr); 1805 tf.lbal = readb((void __iomem *) ap->ioaddr.lbal_addr);
@@ -1271,9 +1810,19 @@ static void mv_phy_reset(struct ata_port *ap)
1271 VPRINTK("Port disabled post-sig: No device present.\n"); 1810 VPRINTK("Port disabled post-sig: No device present.\n");
1272 ata_port_disable(ap); 1811 ata_port_disable(ap);
1273 } 1812 }
1813
1814 writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS);
1815
1816 pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN;
1817
1274 VPRINTK("EXIT\n"); 1818 VPRINTK("EXIT\n");
1275} 1819}
1276 1820
1821static void mv_phy_reset(struct ata_port *ap)
1822{
1823 __mv_phy_reset(ap, 1);
1824}
1825
1277/** 1826/**
1278 * mv_eng_timeout - Routine called by libata when SCSI times out I/O 1827 * mv_eng_timeout - Routine called by libata when SCSI times out I/O
1279 * @ap: ATA channel to manipulate 1828 * @ap: ATA channel to manipulate
@@ -1291,16 +1840,16 @@ static void mv_eng_timeout(struct ata_port *ap)
1291 1840
1292 printk(KERN_ERR "ata%u: Entering mv_eng_timeout\n",ap->id); 1841 printk(KERN_ERR "ata%u: Entering mv_eng_timeout\n",ap->id);
1293 DPRINTK("All regs @ start of eng_timeout\n"); 1842 DPRINTK("All regs @ start of eng_timeout\n");
1294 mv_dump_all_regs(ap->host_set->mmio_base, ap->port_no, 1843 mv_dump_all_regs(ap->host_set->mmio_base, ap->port_no,
1295 to_pci_dev(ap->host_set->dev)); 1844 to_pci_dev(ap->host_set->dev));
1296 1845
1297 qc = ata_qc_from_tag(ap, ap->active_tag); 1846 qc = ata_qc_from_tag(ap, ap->active_tag);
1298 printk(KERN_ERR "mmio_base %p ap %p qc %p scsi_cmnd %p &cmnd %p\n", 1847 printk(KERN_ERR "mmio_base %p ap %p qc %p scsi_cmnd %p &cmnd %p\n",
1299 ap->host_set->mmio_base, ap, qc, qc->scsicmd, 1848 ap->host_set->mmio_base, ap, qc, qc->scsicmd,
1300 &qc->scsicmd->cmnd); 1849 &qc->scsicmd->cmnd);
1301 1850
1302 mv_err_intr(ap); 1851 mv_err_intr(ap);
1303 mv_phy_reset(ap); 1852 mv_stop_and_reset(ap);
1304 1853
1305 if (!qc) { 1854 if (!qc) {
1306 printk(KERN_ERR "ata%u: BUG: timeout without command\n", 1855 printk(KERN_ERR "ata%u: BUG: timeout without command\n",
@@ -1336,17 +1885,17 @@ static void mv_port_init(struct ata_ioports *port, void __iomem *port_mmio)
1336 unsigned long shd_base = (unsigned long) port_mmio + SHD_BLK_OFS; 1885 unsigned long shd_base = (unsigned long) port_mmio + SHD_BLK_OFS;
1337 unsigned serr_ofs; 1886 unsigned serr_ofs;
1338 1887
1339 /* PIO related setup 1888 /* PIO related setup
1340 */ 1889 */
1341 port->data_addr = shd_base + (sizeof(u32) * ATA_REG_DATA); 1890 port->data_addr = shd_base + (sizeof(u32) * ATA_REG_DATA);
1342 port->error_addr = 1891 port->error_addr =
1343 port->feature_addr = shd_base + (sizeof(u32) * ATA_REG_ERR); 1892 port->feature_addr = shd_base + (sizeof(u32) * ATA_REG_ERR);
1344 port->nsect_addr = shd_base + (sizeof(u32) * ATA_REG_NSECT); 1893 port->nsect_addr = shd_base + (sizeof(u32) * ATA_REG_NSECT);
1345 port->lbal_addr = shd_base + (sizeof(u32) * ATA_REG_LBAL); 1894 port->lbal_addr = shd_base + (sizeof(u32) * ATA_REG_LBAL);
1346 port->lbam_addr = shd_base + (sizeof(u32) * ATA_REG_LBAM); 1895 port->lbam_addr = shd_base + (sizeof(u32) * ATA_REG_LBAM);
1347 port->lbah_addr = shd_base + (sizeof(u32) * ATA_REG_LBAH); 1896 port->lbah_addr = shd_base + (sizeof(u32) * ATA_REG_LBAH);
1348 port->device_addr = shd_base + (sizeof(u32) * ATA_REG_DEVICE); 1897 port->device_addr = shd_base + (sizeof(u32) * ATA_REG_DEVICE);
1349 port->status_addr = 1898 port->status_addr =
1350 port->command_addr = shd_base + (sizeof(u32) * ATA_REG_STATUS); 1899 port->command_addr = shd_base + (sizeof(u32) * ATA_REG_STATUS);
1351 /* special case: control/altstatus doesn't have ATA_REG_ address */ 1900 /* special case: control/altstatus doesn't have ATA_REG_ address */
1352 port->altstatus_addr = port->ctl_addr = shd_base + SHD_CTL_AST_OFS; 1901 port->altstatus_addr = port->ctl_addr = shd_base + SHD_CTL_AST_OFS;
@@ -1362,14 +1911,92 @@ static void mv_port_init(struct ata_ioports *port, void __iomem *port_mmio)
1362 /* unmask all EDMA error interrupts */ 1911 /* unmask all EDMA error interrupts */
1363 writelfl(~0, port_mmio + EDMA_ERR_IRQ_MASK_OFS); 1912 writelfl(~0, port_mmio + EDMA_ERR_IRQ_MASK_OFS);
1364 1913
1365 VPRINTK("EDMA cfg=0x%08x EDMA IRQ err cause/mask=0x%08x/0x%08x\n", 1914 VPRINTK("EDMA cfg=0x%08x EDMA IRQ err cause/mask=0x%08x/0x%08x\n",
1366 readl(port_mmio + EDMA_CFG_OFS), 1915 readl(port_mmio + EDMA_CFG_OFS),
1367 readl(port_mmio + EDMA_ERR_IRQ_CAUSE_OFS), 1916 readl(port_mmio + EDMA_ERR_IRQ_CAUSE_OFS),
1368 readl(port_mmio + EDMA_ERR_IRQ_MASK_OFS)); 1917 readl(port_mmio + EDMA_ERR_IRQ_MASK_OFS));
1369} 1918}
1370 1919
1920static int mv_chip_id(struct pci_dev *pdev, struct mv_host_priv *hpriv,
1921 unsigned int board_idx)
1922{
1923 u8 rev_id;
1924 u32 hp_flags = hpriv->hp_flags;
1925
1926 pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id);
1927
1928 switch(board_idx) {
1929 case chip_5080:
1930 hpriv->ops = &mv5xxx_ops;
1931 hp_flags |= MV_HP_50XX;
1932
1933 switch (rev_id) {
1934 case 0x1:
1935 hp_flags |= MV_HP_ERRATA_50XXB0;
1936 break;
1937 case 0x3:
1938 hp_flags |= MV_HP_ERRATA_50XXB2;
1939 break;
1940 default:
1941 dev_printk(KERN_WARNING, &pdev->dev,
1942 "Applying 50XXB2 workarounds to unknown rev\n");
1943 hp_flags |= MV_HP_ERRATA_50XXB2;
1944 break;
1945 }
1946 break;
1947
1948 case chip_504x:
1949 case chip_508x:
1950 hpriv->ops = &mv5xxx_ops;
1951 hp_flags |= MV_HP_50XX;
1952
1953 switch (rev_id) {
1954 case 0x0:
1955 hp_flags |= MV_HP_ERRATA_50XXB0;
1956 break;
1957 case 0x3:
1958 hp_flags |= MV_HP_ERRATA_50XXB2;
1959 break;
1960 default:
1961 dev_printk(KERN_WARNING, &pdev->dev,
1962 "Applying B2 workarounds to unknown rev\n");
1963 hp_flags |= MV_HP_ERRATA_50XXB2;
1964 break;
1965 }
1966 break;
1967
1968 case chip_604x:
1969 case chip_608x:
1970 hpriv->ops = &mv6xxx_ops;
1971
1972 switch (rev_id) {
1973 case 0x7:
1974 hp_flags |= MV_HP_ERRATA_60X1B2;
1975 break;
1976 case 0x9:
1977 hp_flags |= MV_HP_ERRATA_60X1C0;
1978 break;
1979 default:
1980 dev_printk(KERN_WARNING, &pdev->dev,
1981 "Applying B2 workarounds to unknown rev\n");
1982 hp_flags |= MV_HP_ERRATA_60X1B2;
1983 break;
1984 }
1985 break;
1986
1987 default:
1988 printk(KERN_ERR DRV_NAME ": BUG: invalid board index %u\n", board_idx);
1989 return 1;
1990 }
1991
1992 hpriv->hp_flags = hp_flags;
1993
1994 return 0;
1995}
1996
1371/** 1997/**
1372 * mv_host_init - Perform some early initialization of the host. 1998 * mv_init_host - Perform some early initialization of the host.
1999 * @pdev: host PCI device
1373 * @probe_ent: early data struct representing the host 2000 * @probe_ent: early data struct representing the host
1374 * 2001 *
1375 * If possible, do an early global reset of the host. Then do 2002 * If possible, do an early global reset of the host. Then do
@@ -1378,23 +2005,48 @@ static void mv_port_init(struct ata_ioports *port, void __iomem *port_mmio)
1378 * LOCKING: 2005 * LOCKING:
1379 * Inherited from caller. 2006 * Inherited from caller.
1380 */ 2007 */
1381static int mv_host_init(struct ata_probe_ent *probe_ent) 2008static int mv_init_host(struct pci_dev *pdev, struct ata_probe_ent *probe_ent,
2009 unsigned int board_idx)
1382{ 2010{
1383 int rc = 0, n_hc, port, hc; 2011 int rc = 0, n_hc, port, hc;
1384 void __iomem *mmio = probe_ent->mmio_base; 2012 void __iomem *mmio = probe_ent->mmio_base;
1385 void __iomem *port_mmio; 2013 struct mv_host_priv *hpriv = probe_ent->private_data;
1386 2014
1387 if ((MV_FLAG_GLBL_SFT_RST & probe_ent->host_flags) && 2015 /* global interrupt mask */
1388 mv_global_soft_reset(probe_ent->mmio_base)) { 2016 writel(0, mmio + HC_MAIN_IRQ_MASK_OFS);
1389 rc = 1; 2017
2018 rc = mv_chip_id(pdev, hpriv, board_idx);
2019 if (rc)
1390 goto done; 2020 goto done;
1391 }
1392 2021
1393 n_hc = mv_get_hc_count(probe_ent->host_flags); 2022 n_hc = mv_get_hc_count(probe_ent->host_flags);
1394 probe_ent->n_ports = MV_PORTS_PER_HC * n_hc; 2023 probe_ent->n_ports = MV_PORTS_PER_HC * n_hc;
1395 2024
2025 for (port = 0; port < probe_ent->n_ports; port++)
2026 hpriv->ops->read_preamp(hpriv, port, mmio);
2027
2028 rc = hpriv->ops->reset_hc(hpriv, mmio, n_hc);
2029 if (rc)
2030 goto done;
2031
2032 hpriv->ops->reset_flash(hpriv, mmio);
2033 hpriv->ops->reset_bus(pdev, mmio);
2034 hpriv->ops->enable_leds(hpriv, mmio);
2035
1396 for (port = 0; port < probe_ent->n_ports; port++) { 2036 for (port = 0; port < probe_ent->n_ports; port++) {
1397 port_mmio = mv_port_base(mmio, port); 2037 if (IS_60XX(hpriv)) {
2038 void __iomem *port_mmio = mv_port_base(mmio, port);
2039
2040 u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL);
2041 ifctl |= (1 << 12);
2042 writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL);
2043 }
2044
2045 hpriv->ops->phy_errata(hpriv, mmio, port);
2046 }
2047
2048 for (port = 0; port < probe_ent->n_ports; port++) {
2049 void __iomem *port_mmio = mv_port_base(mmio, port);
1398 mv_port_init(&probe_ent->port[port], port_mmio); 2050 mv_port_init(&probe_ent->port[port], port_mmio);
1399 } 2051 }
1400 2052
@@ -1418,11 +2070,12 @@ static int mv_host_init(struct ata_probe_ent *probe_ent)
1418 writelfl(~HC_MAIN_MASKED_IRQS, mmio + HC_MAIN_IRQ_MASK_OFS); 2070 writelfl(~HC_MAIN_MASKED_IRQS, mmio + HC_MAIN_IRQ_MASK_OFS);
1419 2071
1420 VPRINTK("HC MAIN IRQ cause/mask=0x%08x/0x%08x " 2072 VPRINTK("HC MAIN IRQ cause/mask=0x%08x/0x%08x "
1421 "PCI int cause/mask=0x%08x/0x%08x\n", 2073 "PCI int cause/mask=0x%08x/0x%08x\n",
1422 readl(mmio + HC_MAIN_IRQ_CAUSE_OFS), 2074 readl(mmio + HC_MAIN_IRQ_CAUSE_OFS),
1423 readl(mmio + HC_MAIN_IRQ_MASK_OFS), 2075 readl(mmio + HC_MAIN_IRQ_MASK_OFS),
1424 readl(mmio + PCI_IRQ_CAUSE_OFS), 2076 readl(mmio + PCI_IRQ_CAUSE_OFS),
1425 readl(mmio + PCI_IRQ_MASK_OFS)); 2077 readl(mmio + PCI_IRQ_MASK_OFS));
2078
1426done: 2079done:
1427 return rc; 2080 return rc;
1428} 2081}
@@ -1458,7 +2111,7 @@ static void mv_print_info(struct ata_probe_ent *probe_ent)
1458 2111
1459 dev_printk(KERN_INFO, &pdev->dev, 2112 dev_printk(KERN_INFO, &pdev->dev,
1460 "%u slots %u ports %s mode IRQ via %s\n", 2113 "%u slots %u ports %s mode IRQ via %s\n",
1461 (unsigned)MV_MAX_Q_DEPTH, probe_ent->n_ports, 2114 (unsigned)MV_MAX_Q_DEPTH, probe_ent->n_ports,
1462 scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx"); 2115 scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx");
1463} 2116}
1464 2117
@@ -1528,7 +2181,7 @@ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1528 probe_ent->private_data = hpriv; 2181 probe_ent->private_data = hpriv;
1529 2182
1530 /* initialize adapter */ 2183 /* initialize adapter */
1531 rc = mv_host_init(probe_ent); 2184 rc = mv_init_host(pdev, probe_ent, board_idx);
1532 if (rc) { 2185 if (rc) {
1533 goto err_out_hpriv; 2186 goto err_out_hpriv;
1534 } 2187 }
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 26300fccb4fc..f07e60f9e102 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -121,6 +121,11 @@
121 121
122#include <linux/hiddev.h> 122#include <linux/hiddev.h>
123 123
124#include <linux/dvb/audio.h>
125#include <linux/dvb/dmx.h>
126#include <linux/dvb/frontend.h>
127#include <linux/dvb/video.h>
128
124#undef INCLUDES 129#undef INCLUDES
125#endif 130#endif
126 131
@@ -413,6 +418,128 @@ out:
413 return err; 418 return err;
414} 419}
415 420
421struct compat_dmx_event {
422 dmx_event_t event;
423 compat_time_t timeStamp;
424 union
425 {
426 dmx_scrambling_status_t scrambling;
427 } u;
428};
429
430static int do_dmx_get_event(unsigned int fd, unsigned int cmd, unsigned long arg)
431{
432 struct dmx_event kevent;
433 mm_segment_t old_fs = get_fs();
434 int err;
435
436 set_fs(KERNEL_DS);
437 err = sys_ioctl(fd, cmd, (unsigned long) &kevent);
438 set_fs(old_fs);
439
440 if (!err) {
441 struct compat_dmx_event __user *up = compat_ptr(arg);
442
443 err = put_user(kevent.event, &up->event);
444 err |= put_user(kevent.timeStamp, &up->timeStamp);
445 err |= put_user(kevent.u.scrambling, &up->u.scrambling);
446 if (err)
447 err = -EFAULT;
448 }
449
450 return err;
451}
452
453struct compat_video_event {
454 int32_t type;
455 compat_time_t timestamp;
456 union {
457 video_size_t size;
458 unsigned int frame_rate;
459 } u;
460};
461
462static int do_video_get_event(unsigned int fd, unsigned int cmd, unsigned long arg)
463{
464 struct video_event kevent;
465 mm_segment_t old_fs = get_fs();
466 int err;
467
468 set_fs(KERNEL_DS);
469 err = sys_ioctl(fd, cmd, (unsigned long) &kevent);
470 set_fs(old_fs);
471
472 if (!err) {
473 struct compat_video_event __user *up = compat_ptr(arg);
474
475 err = put_user(kevent.type, &up->type);
476 err |= put_user(kevent.timestamp, &up->timestamp);
477 err |= put_user(kevent.u.size.w, &up->u.size.w);
478 err |= put_user(kevent.u.size.h, &up->u.size.h);
479 err |= put_user(kevent.u.size.aspect_ratio,
480 &up->u.size.aspect_ratio);
481 if (err)
482 err = -EFAULT;
483 }
484
485 return err;
486}
487
488struct compat_video_still_picture {
489 compat_uptr_t iFrame;
490 int32_t size;
491};
492
493static int do_video_stillpicture(unsigned int fd, unsigned int cmd, unsigned long arg)
494{
495 struct compat_video_still_picture __user *up;
496 struct video_still_picture __user *up_native;
497 compat_uptr_t fp;
498 int32_t size;
499 int err;
500
501 up = (struct compat_video_still_picture __user *) arg;
502 err = get_user(fp, &up->iFrame);
503 err |= get_user(size, &up->size);
504 if (err)
505 return -EFAULT;
506
507 up_native =
508 compat_alloc_user_space(sizeof(struct video_still_picture));
509
510 put_user(compat_ptr(fp), &up_native->iFrame);
511 put_user(size, &up_native->size);
512
513 err = sys_ioctl(fd, cmd, (unsigned long) up_native);
514
515 return err;
516}
517
518struct compat_video_spu_palette {
519 int length;
520 compat_uptr_t palette;
521};
522
523static int do_video_set_spu_palette(unsigned int fd, unsigned int cmd, unsigned long arg)
524{
525 struct compat_video_spu_palette __user *up;
526 struct video_spu_palette __user *up_native;
527 compat_uptr_t palp;
528 int length, err;
529
530 up = (struct compat_video_spu_palette __user *) arg;
531 err = get_user(palp, &up->palette);
532 err |= get_user(length, &up->length);
533
534 up_native = compat_alloc_user_space(sizeof(struct video_spu_palette));
535 put_user(compat_ptr(palp), &up_native->palette);
536 put_user(length, &up_native->length);
537
538 err = sys_ioctl(fd, cmd, (unsigned long) up_native);
539
540 return err;
541}
542
416#ifdef CONFIG_NET 543#ifdef CONFIG_NET
417static int do_siocgstamp(unsigned int fd, unsigned int cmd, unsigned long arg) 544static int do_siocgstamp(unsigned int fd, unsigned int cmd, unsigned long arg)
418{ 545{
@@ -2954,5 +3081,11 @@ HANDLE_IOCTL(NCP_IOC_GETPRIVATEDATA_32, do_ncp_getprivatedata)
2954HANDLE_IOCTL(NCP_IOC_SETPRIVATEDATA_32, do_ncp_setprivatedata) 3081HANDLE_IOCTL(NCP_IOC_SETPRIVATEDATA_32, do_ncp_setprivatedata)
2955#endif 3082#endif
2956 3083
3084/* dvb */
3085HANDLE_IOCTL(DMX_GET_EVENT, do_dmx_get_event)
3086HANDLE_IOCTL(VIDEO_GET_EVENT, do_video_get_event)
3087HANDLE_IOCTL(VIDEO_STILLPICTURE, do_video_stillpicture)
3088HANDLE_IOCTL(VIDEO_SET_SPU_PALETTE, do_video_set_spu_palette)
3089
2957#undef DECLARES 3090#undef DECLARES
2958#endif 3091#endif
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h
index 9896fade98a7..2e36e5a7f4f3 100644
--- a/include/asm-powerpc/ppc-pci.h
+++ b/include/asm-powerpc/ppc-pci.h
@@ -14,7 +14,6 @@
14 14
15extern unsigned long isa_io_base; 15extern unsigned long isa_io_base;
16 16
17extern void pci_setup_pci_controller(struct pci_controller *hose);
18extern void pci_setup_phb_io(struct pci_controller *hose, int primary); 17extern void pci_setup_phb_io(struct pci_controller *hose, int primary);
19extern void pci_setup_phb_io_dynamic(struct pci_controller *hose, int primary); 18extern void pci_setup_phb_io_dynamic(struct pci_controller *hose, int primary);
20 19
diff --git a/include/asm-powerpc/vdso.h b/include/asm-powerpc/vdso.h
index 85d8a7be25c4..b9f9118b1607 100644
--- a/include/asm-powerpc/vdso.h
+++ b/include/asm-powerpc/vdso.h
@@ -11,7 +11,7 @@
11#define VDSO32_MBASE VDSO32_LBASE 11#define VDSO32_MBASE VDSO32_LBASE
12#define VDSO64_MBASE VDSO64_LBASE 12#define VDSO64_MBASE VDSO64_LBASE
13 13
14#define VDSO_VERSION_STRING LINUX_2.6.12 14#define VDSO_VERSION_STRING LINUX_2.6.15
15 15
16/* Define if 64 bits VDSO has procedure descriptors */ 16/* Define if 64 bits VDSO has procedure descriptors */
17#undef VDS64_HAS_DESCRIPTORS 17#undef VDS64_HAS_DESCRIPTORS
diff --git a/include/asm-ppc/pgalloc.h b/include/asm-ppc/pgalloc.h
index 931b6de7ef53..bdefd1c4a558 100644
--- a/include/asm-ppc/pgalloc.h
+++ b/include/asm-ppc/pgalloc.h
@@ -28,7 +28,7 @@ extern void pgd_free(pgd_t *pgd);
28#define pmd_populate_kernel(mm, pmd, pte) \ 28#define pmd_populate_kernel(mm, pmd, pte) \
29 (pmd_val(*(pmd)) = (unsigned long)pte | _PMD_PRESENT) 29 (pmd_val(*(pmd)) = (unsigned long)pte | _PMD_PRESENT)
30#define pmd_populate(mm, pmd, pte) \ 30#define pmd_populate(mm, pmd, pte) \
31 (pmd_val(*(pmd)) = (unsigned long)page_to_virt(pte) | _PMD_PRESENT) 31 (pmd_val(*(pmd)) = (unsigned long)lowmem_page_address(pte) | _PMD_PRESENT)
32#endif 32#endif
33 33
34extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); 34extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
diff --git a/include/asm-ppc64/pci-bridge.h b/include/asm-ppc64/pci-bridge.h
index efbdaece0cf0..cf04327a597a 100644
--- a/include/asm-ppc64/pci-bridge.h
+++ b/include/asm-ppc64/pci-bridge.h
@@ -61,12 +61,14 @@ struct pci_dn {
61 int busno; /* for pci devices */ 61 int busno; /* for pci devices */
62 int bussubno; /* for pci devices */ 62 int bussubno; /* for pci devices */
63 int devfn; /* for pci devices */ 63 int devfn; /* for pci devices */
64
65#ifdef CONFIG_PPC_PSERIES
64 int eeh_mode; /* See eeh.h for possible EEH_MODEs */ 66 int eeh_mode; /* See eeh.h for possible EEH_MODEs */
65 int eeh_config_addr; 67 int eeh_config_addr;
66 int eeh_check_count; /* # times driver ignored error */ 68 int eeh_check_count; /* # times driver ignored error */
67 int eeh_freeze_count; /* # times this device froze up. */ 69 int eeh_freeze_count; /* # times this device froze up. */
68 int eeh_is_bridge; /* device is pci-to-pci bridge */ 70 int eeh_is_bridge; /* device is pci-to-pci bridge */
69 71#endif
70 int pci_ext_config_space; /* for pci devices */ 72 int pci_ext_config_space; /* for pci devices */
71 struct pci_controller *phb; /* for pci devices */ 73 struct pci_controller *phb; /* for pci devices */
72 struct iommu_table *iommu_table; /* for phb's or bridges */ 74 struct iommu_table *iommu_table; /* for phb's or bridges */
@@ -74,9 +76,9 @@ struct pci_dn {
74 struct device_node *node; /* back-pointer to the device_node */ 76 struct device_node *node; /* back-pointer to the device_node */
75#ifdef CONFIG_PPC_ISERIES 77#ifdef CONFIG_PPC_ISERIES
76 struct list_head Device_List; 78 struct list_head Device_List;
77 int Irq; /* Assigned IRQ */ 79 int Irq; /* Assigned IRQ */
78 int Flags; /* Possible flags(disable/bist)*/ 80 int Flags; /* Possible flags(disable/bist)*/
79 u8 LogicalSlot; /* Hv Slot Index for Tces */ 81 u8 LogicalSlot; /* Hv Slot Index for Tces */
80#endif 82#endif
81 u32 config_space[16]; /* saved PCI config space */ 83 u32 config_space[16]; /* saved PCI config space */
82}; 84};
@@ -136,6 +138,10 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
136 return PCI_DN(busdn)->phb; 138 return PCI_DN(busdn)->phb;
137} 139}
138 140
141extern struct pci_controller *
142pcibios_alloc_controller(struct device_node *dev);
143extern void pcibios_free_controller(struct pci_controller *phb);
144
139/* Return values for ppc_md.pci_probe_mode function */ 145/* Return values for ppc_md.pci_probe_mode function */
140#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ 146#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */
141#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ 147#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index 174f3379e5d9..119f9d064cc6 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -795,3 +795,70 @@ COMPATIBLE_IOCTL(HIDIOCGFLAG)
795COMPATIBLE_IOCTL(HIDIOCSFLAG) 795COMPATIBLE_IOCTL(HIDIOCSFLAG)
796COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX) 796COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX)
797COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO) 797COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO)
798/* dvb */
799COMPATIBLE_IOCTL(AUDIO_STOP)
800COMPATIBLE_IOCTL(AUDIO_PLAY)
801COMPATIBLE_IOCTL(AUDIO_PAUSE)
802COMPATIBLE_IOCTL(AUDIO_CONTINUE)
803COMPATIBLE_IOCTL(AUDIO_SELECT_SOURCE)
804COMPATIBLE_IOCTL(AUDIO_SET_MUTE)
805COMPATIBLE_IOCTL(AUDIO_SET_AV_SYNC)
806COMPATIBLE_IOCTL(AUDIO_SET_BYPASS_MODE)
807COMPATIBLE_IOCTL(AUDIO_CHANNEL_SELECT)
808COMPATIBLE_IOCTL(AUDIO_GET_STATUS)
809COMPATIBLE_IOCTL(AUDIO_GET_CAPABILITIES)
810COMPATIBLE_IOCTL(AUDIO_CLEAR_BUFFER)
811COMPATIBLE_IOCTL(AUDIO_SET_ID)
812COMPATIBLE_IOCTL(AUDIO_SET_MIXER)
813COMPATIBLE_IOCTL(AUDIO_SET_STREAMTYPE)
814COMPATIBLE_IOCTL(AUDIO_SET_EXT_ID)
815COMPATIBLE_IOCTL(AUDIO_SET_ATTRIBUTES)
816COMPATIBLE_IOCTL(AUDIO_SET_KARAOKE)
817COMPATIBLE_IOCTL(DMX_START)
818COMPATIBLE_IOCTL(DMX_STOP)
819COMPATIBLE_IOCTL(DMX_SET_FILTER)
820COMPATIBLE_IOCTL(DMX_SET_PES_FILTER)
821COMPATIBLE_IOCTL(DMX_SET_BUFFER_SIZE)
822COMPATIBLE_IOCTL(DMX_GET_PES_PIDS)
823COMPATIBLE_IOCTL(DMX_GET_CAPS)
824COMPATIBLE_IOCTL(DMX_SET_SOURCE)
825COMPATIBLE_IOCTL(DMX_GET_STC)
826COMPATIBLE_IOCTL(FE_GET_INFO)
827COMPATIBLE_IOCTL(FE_DISEQC_RESET_OVERLOAD)
828COMPATIBLE_IOCTL(FE_DISEQC_SEND_MASTER_CMD)
829COMPATIBLE_IOCTL(FE_DISEQC_RECV_SLAVE_REPLY)
830COMPATIBLE_IOCTL(FE_DISEQC_SEND_BURST)
831COMPATIBLE_IOCTL(FE_SET_TONE)
832COMPATIBLE_IOCTL(FE_SET_VOLTAGE)
833COMPATIBLE_IOCTL(FE_ENABLE_HIGH_LNB_VOLTAGE)
834COMPATIBLE_IOCTL(FE_READ_STATUS)
835COMPATIBLE_IOCTL(FE_READ_BER)
836COMPATIBLE_IOCTL(FE_READ_SIGNAL_STRENGTH)
837COMPATIBLE_IOCTL(FE_READ_SNR)
838COMPATIBLE_IOCTL(FE_READ_UNCORRECTED_BLOCKS)
839COMPATIBLE_IOCTL(FE_SET_FRONTEND)
840COMPATIBLE_IOCTL(FE_GET_FRONTEND)
841COMPATIBLE_IOCTL(FE_GET_EVENT)
842COMPATIBLE_IOCTL(FE_DISHNETWORK_SEND_LEGACY_CMD)
843COMPATIBLE_IOCTL(VIDEO_STOP)
844COMPATIBLE_IOCTL(VIDEO_PLAY)
845COMPATIBLE_IOCTL(VIDEO_FREEZE)
846COMPATIBLE_IOCTL(VIDEO_CONTINUE)
847COMPATIBLE_IOCTL(VIDEO_SELECT_SOURCE)
848COMPATIBLE_IOCTL(VIDEO_SET_BLANK)
849COMPATIBLE_IOCTL(VIDEO_GET_STATUS)
850COMPATIBLE_IOCTL(VIDEO_SET_DISPLAY_FORMAT)
851COMPATIBLE_IOCTL(VIDEO_FAST_FORWARD)
852COMPATIBLE_IOCTL(VIDEO_SLOWMOTION)
853COMPATIBLE_IOCTL(VIDEO_GET_CAPABILITIES)
854COMPATIBLE_IOCTL(VIDEO_CLEAR_BUFFER)
855COMPATIBLE_IOCTL(VIDEO_SET_ID)
856COMPATIBLE_IOCTL(VIDEO_SET_STREAMTYPE)
857COMPATIBLE_IOCTL(VIDEO_SET_FORMAT)
858COMPATIBLE_IOCTL(VIDEO_SET_SYSTEM)
859COMPATIBLE_IOCTL(VIDEO_SET_HIGHLIGHT)
860COMPATIBLE_IOCTL(VIDEO_SET_SPU)
861COMPATIBLE_IOCTL(VIDEO_GET_NAVI)
862COMPATIBLE_IOCTL(VIDEO_SET_ATTRIBUTES)
863COMPATIBLE_IOCTL(VIDEO_GET_SIZE)
864COMPATIBLE_IOCTL(VIDEO_GET_FRAME_RATE)
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 65384afcfc3f..d74bfabe5300 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -1194,8 +1194,14 @@ static void tumbler_resume(pmac_t *chip)
1194 tumbler_set_master_volume(mix); 1194 tumbler_set_master_volume(mix);
1195 if (chip->update_automute) 1195 if (chip->update_automute)
1196 chip->update_automute(chip, 0); 1196 chip->update_automute(chip, 0);
1197 if (mix->headphone_irq >= 0) 1197 if (mix->headphone_irq >= 0) {
1198 unsigned char val;
1199
1198 enable_irq(mix->headphone_irq); 1200 enable_irq(mix->headphone_irq);
1201 /* activate headphone status interrupts */
1202 val = do_gpio_read(&mix->hp_detect);
1203 do_gpio_write(&mix->hp_detect, val | 0x80);
1204 }
1199 if (mix->lineout_irq >= 0) 1205 if (mix->lineout_irq >= 0)
1200 enable_irq(mix->lineout_irq); 1206 enable_irq(mix->lineout_irq);
1201} 1207}