aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/kernel/armksyms.c1
-rw-r--r--arch/arm/kernel/stacktrace.c12
-rw-r--r--arch/arm/mach-at91/Makefile1
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c3
-rw-r--r--arch/arm/mach-ebsa110/io.c8
-rw-r--r--arch/i386/kernel/head.S38
-rw-r--r--arch/i386/kernel/paravirt.c1
-rw-r--r--arch/i386/kernel/vmlinux.lds.S6
-rw-r--r--arch/powerpc/boot/dts/mpc832x_mds.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc834x_mds.dts4
-rw-r--r--arch/powerpc/configs/celleb_defconfig129
-rw-r--r--arch/powerpc/kernel/pci_64.c37
-rw-r--r--arch/powerpc/kernel/prom.c47
-rw-r--r--arch/powerpc/lib/Makefile2
-rw-r--r--arch/powerpc/lib/rheap.c117
-rw-r--r--arch/powerpc/mm/hash_native_64.c37
-rw-r--r--arch/powerpc/platforms/83xx/mpc8313_rdb.c2
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_rdb.c2
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_itx.c2
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_mds.c2
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c7
-rw-r--r--arch/powerpc/platforms/celleb/pci.c1
-rw-r--r--arch/powerpc/platforms/celleb/scc_epci.c8
-rw-r--r--arch/powerpc/platforms/celleb/setup.c2
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c13
-rw-r--r--arch/powerpc/platforms/pseries/eeh_driver.c7
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c3
-rw-r--r--arch/powerpc/platforms/pseries/kexec.c1
-rw-r--r--arch/powerpc/sysdev/commproc.c20
-rw-r--r--arch/powerpc/sysdev/cpm2_common.c21
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe.c29
-rw-r--r--arch/powerpc/sysdev/qe_lib/ucc_fast.c5
-rw-r--r--arch/powerpc/sysdev/qe_lib/ucc_slow.c7
-rw-r--r--arch/ppc/8xx_io/commproc.c22
-rw-r--r--arch/ppc/lib/Makefile3
-rw-r--r--arch/ppc/lib/rheap.c692
-rw-r--r--arch/ppc/syslib/cpm2_common.c23
-rw-r--r--arch/s390/Kconfig49
-rw-r--r--arch/s390/defconfig234
-rw-r--r--arch/s390/hypfs/inode.c2
-rw-r--r--arch/s390/kernel/ipl.c26
-rw-r--r--arch/s390/mm/fault.c5
-rw-r--r--arch/sparc64/kernel/pci.c2
-rw-r--r--arch/sparc64/kernel/pci_common.c194
-rw-r--r--arch/sparc64/kernel/pci_fire.c135
-rw-r--r--arch/sparc64/kernel/pci_impl.h6
-rw-r--r--arch/sparc64/kernel/pci_psycho.c119
-rw-r--r--arch/sparc64/kernel/pci_sabre.c288
-rw-r--r--arch/sparc64/kernel/pci_schizo.c122
-rw-r--r--arch/sparc64/kernel/pci_sun4v.c86
-rw-r--r--arch/sparc64/kernel/prom.c19
-rw-r--r--arch/x86_64/kernel/traps.c1
53 files changed, 717 insertions, 1889 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d7c0984d4a86..0d8fac3b0371 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -354,7 +354,6 @@ config ARCH_SA1100
354config ARCH_S3C2410 354config ARCH_S3C2410
355 bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443" 355 bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
356 select GENERIC_GPIO 356 select GENERIC_GPIO
357 select GENERIC_TIME
358 help 357 help
359 Samsung S3C2410X CPU based systems, such as the Simtec Electronics 358 Samsung S3C2410X CPU based systems, such as the Simtec Electronics
360 BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or 359 BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 4779f474f911..9179e8220314 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -76,6 +76,7 @@ EXPORT_SYMBOL(__const_udelay);
76 76
77 /* networking */ 77 /* networking */
78EXPORT_SYMBOL(csum_partial); 78EXPORT_SYMBOL(csum_partial);
79EXPORT_SYMBOL(csum_partial_copy_from_user);
79EXPORT_SYMBOL(csum_partial_copy_nocheck); 80EXPORT_SYMBOL(csum_partial_copy_nocheck);
80EXPORT_SYMBOL(__csum_ipv6_magic); 81EXPORT_SYMBOL(__csum_ipv6_magic);
81 82
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
index 77ef35efaa8d..398d0c0511eb 100644
--- a/arch/arm/kernel/stacktrace.c
+++ b/arch/arm/kernel/stacktrace.c
@@ -52,21 +52,15 @@ static int save_trace(struct stackframe *frame, void *d)
52 return trace->nr_entries >= trace->max_entries; 52 return trace->nr_entries >= trace->max_entries;
53} 53}
54 54
55void save_stack_trace(struct stack_trace *trace, struct task_struct *task) 55void save_stack_trace(struct stack_trace *trace)
56{ 56{
57 struct stack_trace_data data; 57 struct stack_trace_data data;
58 unsigned long fp, base; 58 unsigned long fp, base;
59 59
60 data.trace = trace; 60 data.trace = trace;
61 data.skip = trace->skip; 61 data.skip = trace->skip;
62 62 base = (unsigned long)task_stack_page(current);
63 if (task) { 63 asm("mov %0, fp" : "=r" (fp));
64 base = (unsigned long)task_stack_page(task);
65 fp = 0; /* FIXME */
66 } else {
67 base = (unsigned long)task_stack_page(current);
68 asm("mov %0, fp" : "=r" (fp));
69 }
70 64
71 walk_stackframe(fp, base, base + THREAD_SIZE, save_trace, &data); 65 walk_stackframe(fp, base, base + THREAD_SIZE, save_trace, &data);
72} 66}
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index a412ae18a421..cd1bc541f28e 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -39,6 +39,7 @@ obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o
39# LEDs support 39# LEDs support
40led-$(CONFIG_ARCH_AT91RM9200DK) += leds.o 40led-$(CONFIG_ARCH_AT91RM9200DK) += leds.o
41led-$(CONFIG_MACH_AT91RM9200EK) += leds.o 41led-$(CONFIG_MACH_AT91RM9200EK) += leds.o
42led-$(CONFIG_MACH_AT91SAM9261EK)+= leds.o
42led-$(CONFIG_MACH_CSB337) += leds.o 43led-$(CONFIG_MACH_CSB337) += leds.o
43led-$(CONFIG_MACH_CSB637) += leds.o 44led-$(CONFIG_MACH_CSB637) += leds.o
44led-$(CONFIG_MACH_KB9200) += leds.o 45led-$(CONFIG_MACH_KB9200) += leds.o
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index bcf71536cc6d..1f0c8a400b3a 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -60,6 +60,9 @@ static void __init ek_map_io(void)
60 /* Initialize processor: 18.432 MHz crystal */ 60 /* Initialize processor: 18.432 MHz crystal */
61 at91sam9261_initialize(18432000); 61 at91sam9261_initialize(18432000);
62 62
63 /* Setup the LEDs */
64 at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14);
65
63 /* Setup the serial ports and console */ 66 /* Setup the serial ports and console */
64 at91_init_serial(&ek_uart_config); 67 at91_init_serial(&ek_uart_config);
65} 68}
diff --git a/arch/arm/mach-ebsa110/io.c b/arch/arm/mach-ebsa110/io.c
index bbf0d332407e..6b2380e153ef 100644
--- a/arch/arm/mach-ebsa110/io.c
+++ b/arch/arm/mach-ebsa110/io.c
@@ -102,7 +102,7 @@ EXPORT_SYMBOL(__readb);
102EXPORT_SYMBOL(__readw); 102EXPORT_SYMBOL(__readw);
103EXPORT_SYMBOL(__readl); 103EXPORT_SYMBOL(__readl);
104 104
105void readsw(void __iomem *addr, void *data, int len) 105void readsw(const void __iomem *addr, void *data, int len)
106{ 106{
107 void __iomem *a = __isamem_convert_addr(addr); 107 void __iomem *a = __isamem_convert_addr(addr);
108 108
@@ -112,7 +112,7 @@ void readsw(void __iomem *addr, void *data, int len)
112} 112}
113EXPORT_SYMBOL(readsw); 113EXPORT_SYMBOL(readsw);
114 114
115void readsl(void __iomem *addr, void *data, int len) 115void readsl(const void __iomem *addr, void *data, int len)
116{ 116{
117 void __iomem *a = __isamem_convert_addr(addr); 117 void __iomem *a = __isamem_convert_addr(addr);
118 118
@@ -157,7 +157,7 @@ EXPORT_SYMBOL(__writeb);
157EXPORT_SYMBOL(__writew); 157EXPORT_SYMBOL(__writew);
158EXPORT_SYMBOL(__writel); 158EXPORT_SYMBOL(__writel);
159 159
160void writesw(void __iomem *addr, void *data, int len) 160void writesw(void __iomem *addr, const void *data, int len)
161{ 161{
162 void __iomem *a = __isamem_convert_addr(addr); 162 void __iomem *a = __isamem_convert_addr(addr);
163 163
@@ -167,7 +167,7 @@ void writesw(void __iomem *addr, void *data, int len)
167} 167}
168EXPORT_SYMBOL(writesw); 168EXPORT_SYMBOL(writesw);
169 169
170void writesl(void __iomem *addr, void *data, int len) 170void writesl(void __iomem *addr, const void *data, int len)
171{ 171{
172 void __iomem *a = __isamem_convert_addr(addr); 172 void __iomem *a = __isamem_convert_addr(addr);
173 173
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index 9b10af65faaa..f74dfc419b56 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -71,12 +71,6 @@ INIT_MAP_BEYOND_END = BOOTBITMAP_SIZE + (PAGE_TABLE_SIZE + ALLOCATOR_SLOP)*PAGE_
71.section .text.head,"ax",@progbits 71.section .text.head,"ax",@progbits
72ENTRY(startup_32) 72ENTRY(startup_32)
73 73
74#ifdef CONFIG_PARAVIRT
75 movl %cs, %eax
76 testl $0x3, %eax
77 jnz startup_paravirt
78#endif
79
80/* 74/*
81 * Set segments to known values. 75 * Set segments to known values.
82 */ 76 */
@@ -501,38 +495,6 @@ ignore_int:
501 iret 495 iret
502 496
503.section .text 497.section .text
504#ifdef CONFIG_PARAVIRT
505startup_paravirt:
506 cld
507 movl $(init_thread_union+THREAD_SIZE),%esp
508
509 /* We take pains to preserve all the regs. */
510 pushl %edx
511 pushl %ecx
512 pushl %eax
513
514 pushl $__start_paravirtprobe
5151:
516 movl 0(%esp), %eax
517 cmpl $__stop_paravirtprobe, %eax
518 je unhandled_paravirt
519 pushl (%eax)
520 movl 8(%esp), %eax
521 call *(%esp)
522 popl %eax
523
524 movl 4(%esp), %eax
525 movl 8(%esp), %ecx
526 movl 12(%esp), %edx
527
528 addl $4, (%esp)
529 jmp 1b
530
531unhandled_paravirt:
532 /* Nothing wanted us: we're screwed. */
533 ud2
534#endif
535
536/* 498/*
537 * Real beginning of normal "text" segment 499 * Real beginning of normal "text" segment
538 */ 500 */
diff --git a/arch/i386/kernel/paravirt.c b/arch/i386/kernel/paravirt.c
index 5c10f376bce1..faab09abca5e 100644
--- a/arch/i386/kernel/paravirt.c
+++ b/arch/i386/kernel/paravirt.c
@@ -19,7 +19,6 @@
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/efi.h> 20#include <linux/efi.h>
21#include <linux/bcd.h> 21#include <linux/bcd.h>
22#include <linux/start_kernel.h>
23#include <linux/highmem.h> 22#include <linux/highmem.h>
24 23
25#include <asm/bug.h> 24#include <asm/bug.h>
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S
index 23e8614edeee..80bec6640230 100644
--- a/arch/i386/kernel/vmlinux.lds.S
+++ b/arch/i386/kernel/vmlinux.lds.S
@@ -78,12 +78,6 @@ SECTIONS
78 CONSTRUCTORS 78 CONSTRUCTORS
79 } :data 79 } :data
80 80
81 .paravirtprobe : AT(ADDR(.paravirtprobe) - LOAD_OFFSET) {
82 __start_paravirtprobe = .;
83 *(.paravirtprobe)
84 __stop_paravirtprobe = .;
85 }
86
87 . = ALIGN(4096); 81 . = ALIGN(4096);
88 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { 82 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
89 __nosave_begin = .; 83 __nosave_begin = .;
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index 93b760696010..112dd5198fe2 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -146,7 +146,7 @@
146 interrupt-parent = < &ipic >; 146 interrupt-parent = < &ipic >;
147 interrupts = <42 8>; 147 interrupts = <42 8>;
148 bus-range = <0 0>; 148 bus-range = <0 0>;
149 ranges = <02000000 0 a0000000 90000000 0 10000000 149 ranges = <02000000 0 90000000 90000000 0 10000000
150 42000000 0 80000000 80000000 0 10000000 150 42000000 0 80000000 80000000 0 10000000
151 01000000 0 00000000 d0000000 0 00100000>; 151 01000000 0 00000000 d0000000 0 00100000>;
152 clock-frequency = <0>; 152 clock-frequency = <0>;
diff --git a/arch/powerpc/boot/dts/mpc834x_mds.dts b/arch/powerpc/boot/dts/mpc834x_mds.dts
index 07bcc5194d2b..df773fafe9d1 100644
--- a/arch/powerpc/boot/dts/mpc834x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc834x_mds.dts
@@ -223,7 +223,7 @@
223 interrupt-parent = < &ipic >; 223 interrupt-parent = < &ipic >;
224 interrupts = <42 8>; 224 interrupts = <42 8>;
225 bus-range = <0 0>; 225 bus-range = <0 0>;
226 ranges = <02000000 0 a0000000 a0000000 0 10000000 226 ranges = <02000000 0 90000000 90000000 0 10000000
227 42000000 0 80000000 80000000 0 10000000 227 42000000 0 80000000 80000000 0 10000000
228 01000000 0 00000000 e2000000 0 00100000>; 228 01000000 0 00000000 e2000000 0 00100000>;
229 clock-frequency = <3f940aa>; 229 clock-frequency = <3f940aa>;
@@ -284,7 +284,7 @@
284 interrupts = <42 8>; 284 interrupts = <42 8>;
285 bus-range = <0 0>; 285 bus-range = <0 0>;
286 ranges = <02000000 0 b0000000 b0000000 0 10000000 286 ranges = <02000000 0 b0000000 b0000000 0 10000000
287 42000000 0 90000000 90000000 0 10000000 287 42000000 0 a0000000 a0000000 0 10000000
288 01000000 0 00000000 e2100000 0 00100000>; 288 01000000 0 00000000 e2100000 0 00100000>;
289 clock-frequency = <3f940aa>; 289 clock-frequency = <3f940aa>;
290 #interrupt-cells = <1>; 290 #interrupt-cells = <1>;
diff --git a/arch/powerpc/configs/celleb_defconfig b/arch/powerpc/configs/celleb_defconfig
index a1fe97197ead..91b657b339b4 100644
--- a/arch/powerpc/configs/celleb_defconfig
+++ b/arch/powerpc/configs/celleb_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.20-rc4 3# Linux kernel version: 2.6.21
4# Thu Jan 11 20:55:33 2007 4# Tue May 8 12:32:16 2007
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -60,6 +60,7 @@ CONFIG_LOCALVERSION_AUTO=y
60CONFIG_SWAP=y 60CONFIG_SWAP=y
61CONFIG_SYSVIPC=y 61CONFIG_SYSVIPC=y
62# CONFIG_IPC_NS is not set 62# CONFIG_IPC_NS is not set
63CONFIG_SYSVIPC_SYSCTL=y
63# CONFIG_POSIX_MQUEUE is not set 64# CONFIG_POSIX_MQUEUE is not set
64# CONFIG_BSD_PROCESS_ACCT is not set 65# CONFIG_BSD_PROCESS_ACCT is not set
65# CONFIG_TASKSTATS is not set 66# CONFIG_TASKSTATS is not set
@@ -70,6 +71,7 @@ CONFIG_IKCONFIG_PROC=y
70# CONFIG_CPUSETS is not set 71# CONFIG_CPUSETS is not set
71CONFIG_SYSFS_DEPRECATED=y 72CONFIG_SYSFS_DEPRECATED=y
72# CONFIG_RELAY is not set 73# CONFIG_RELAY is not set
74CONFIG_BLK_DEV_INITRD=y
73CONFIG_INITRAMFS_SOURCE="" 75CONFIG_INITRAMFS_SOURCE=""
74CONFIG_CC_OPTIMIZE_FOR_SIZE=y 76CONFIG_CC_OPTIMIZE_FOR_SIZE=y
75CONFIG_SYSCTL=y 77CONFIG_SYSCTL=y
@@ -132,15 +134,26 @@ CONFIG_PPC_MULTIPLATFORM=y
132# CONFIG_PPC_PSERIES is not set 134# CONFIG_PPC_PSERIES is not set
133# CONFIG_PPC_ISERIES is not set 135# CONFIG_PPC_ISERIES is not set
134# CONFIG_PPC_MPC52xx is not set 136# CONFIG_PPC_MPC52xx is not set
137# CONFIG_PPC_MPC5200 is not set
135# CONFIG_PPC_PMAC is not set 138# CONFIG_PPC_PMAC is not set
136# CONFIG_PPC_MAPLE is not set 139# CONFIG_PPC_MAPLE is not set
137# CONFIG_PPC_PASEMI is not set 140# CONFIG_PPC_PASEMI is not set
141CONFIG_PPC_CELLEB=y
142# CONFIG_PPC_PS3 is not set
138CONFIG_PPC_CELL=y 143CONFIG_PPC_CELL=y
139# CONFIG_PPC_CELL_NATIVE is not set 144# CONFIG_PPC_CELL_NATIVE is not set
140# CONFIG_PPC_IBM_CELL_BLADE is not set 145# CONFIG_PPC_IBM_CELL_BLADE is not set
141# CONFIG_PPC_PS3 is not set 146
142CONFIG_PPC_CELLEB=y 147#
148# Cell Broadband Engine options
149#
150CONFIG_SPU_FS=y
151CONFIG_SPU_BASE=y
152# CONFIG_PQ2ADS is not set
143CONFIG_PPC_UDBG_BEAT=y 153CONFIG_PPC_UDBG_BEAT=y
154# CONFIG_MPIC is not set
155# CONFIG_MPIC_WEIRD is not set
156# CONFIG_PPC_I8259 is not set
144# CONFIG_U3_DART is not set 157# CONFIG_U3_DART is not set
145# CONFIG_PPC_RTAS is not set 158# CONFIG_PPC_RTAS is not set
146# CONFIG_MMIO_NVRAM is not set 159# CONFIG_MMIO_NVRAM is not set
@@ -149,15 +162,7 @@ CONFIG_PPC_UDBG_BEAT=y
149# CONFIG_PPC_INDIRECT_IO is not set 162# CONFIG_PPC_INDIRECT_IO is not set
150# CONFIG_GENERIC_IOMAP is not set 163# CONFIG_GENERIC_IOMAP is not set
151# CONFIG_CPU_FREQ is not set 164# CONFIG_CPU_FREQ is not set
152# CONFIG_WANT_EARLY_SERIAL is not set 165# CONFIG_CPM2 is not set
153# CONFIG_MPIC is not set
154
155#
156# Cell Broadband Engine options
157#
158CONFIG_SPU_FS=y
159CONFIG_SPU_BASE=y
160# CONFIG_CBE_RAS is not set
161 166
162# 167#
163# Kernel options 168# Kernel options
@@ -183,7 +188,6 @@ CONFIG_NUMA=y
183CONFIG_NODES_SHIFT=4 188CONFIG_NODES_SHIFT=4
184CONFIG_ARCH_SELECT_MEMORY_MODEL=y 189CONFIG_ARCH_SELECT_MEMORY_MODEL=y
185CONFIG_ARCH_SPARSEMEM_ENABLE=y 190CONFIG_ARCH_SPARSEMEM_ENABLE=y
186CONFIG_ARCH_SPARSEMEM_DEFAULT=y
187CONFIG_ARCH_POPULATES_NODE_MAP=y 191CONFIG_ARCH_POPULATES_NODE_MAP=y
188CONFIG_SELECT_MEMORY_MODEL=y 192CONFIG_SELECT_MEMORY_MODEL=y
189# CONFIG_FLATMEM_MANUAL is not set 193# CONFIG_FLATMEM_MANUAL is not set
@@ -199,6 +203,7 @@ CONFIG_MEMORY_HOTPLUG_SPARSE=y
199CONFIG_SPLIT_PTLOCK_CPUS=4 203CONFIG_SPLIT_PTLOCK_CPUS=4
200CONFIG_MIGRATION=y 204CONFIG_MIGRATION=y
201CONFIG_RESOURCES_64BIT=y 205CONFIG_RESOURCES_64BIT=y
206CONFIG_ZONE_DMA_FLAG=1
202CONFIG_ARCH_MEMORY_PROBE=y 207CONFIG_ARCH_MEMORY_PROBE=y
203CONFIG_NODES_SPAN_OTHER_NODES=y 208CONFIG_NODES_SPAN_OTHER_NODES=y
204# CONFIG_PPC_64K_PAGES is not set 209# CONFIG_PPC_64K_PAGES is not set
@@ -207,14 +212,14 @@ CONFIG_PROC_DEVICETREE=y
207# CONFIG_CMDLINE_BOOL is not set 212# CONFIG_CMDLINE_BOOL is not set
208# CONFIG_PM is not set 213# CONFIG_PM is not set
209CONFIG_SECCOMP=y 214CONFIG_SECCOMP=y
215# CONFIG_WANT_DEVICE_TREE is not set
210CONFIG_ISA_DMA_API=y 216CONFIG_ISA_DMA_API=y
211 217
212# 218#
213# Bus options 219# Bus options
214# 220#
221CONFIG_ZONE_DMA=y
215CONFIG_GENERIC_ISA_DMA=y 222CONFIG_GENERIC_ISA_DMA=y
216# CONFIG_MPIC_WEIRD is not set
217# CONFIG_PPC_I8259 is not set
218# CONFIG_PPC_INDIRECT_PCI is not set 223# CONFIG_PPC_INDIRECT_PCI is not set
219CONFIG_PCI=y 224CONFIG_PCI=y
220CONFIG_PCI_DOMAINS=y 225CONFIG_PCI_DOMAINS=y
@@ -240,13 +245,13 @@ CONFIG_NET=y
240# 245#
241# Networking options 246# Networking options
242# 247#
243# CONFIG_NETDEBUG is not set
244CONFIG_PACKET=y 248CONFIG_PACKET=y
245# CONFIG_PACKET_MMAP is not set 249# CONFIG_PACKET_MMAP is not set
246CONFIG_UNIX=y 250CONFIG_UNIX=y
247CONFIG_XFRM=y 251CONFIG_XFRM=y
248# CONFIG_XFRM_USER is not set 252# CONFIG_XFRM_USER is not set
249# CONFIG_XFRM_SUB_POLICY is not set 253# CONFIG_XFRM_SUB_POLICY is not set
254# CONFIG_XFRM_MIGRATE is not set
250# CONFIG_NET_KEY is not set 255# CONFIG_NET_KEY is not set
251CONFIG_INET=y 256CONFIG_INET=y
252CONFIG_IP_MULTICAST=y 257CONFIG_IP_MULTICAST=y
@@ -262,7 +267,7 @@ CONFIG_SYN_COOKIES=y
262# CONFIG_INET_ESP is not set 267# CONFIG_INET_ESP is not set
263# CONFIG_INET_IPCOMP is not set 268# CONFIG_INET_IPCOMP is not set
264# CONFIG_INET_XFRM_TUNNEL is not set 269# CONFIG_INET_XFRM_TUNNEL is not set
265# CONFIG_INET_TUNNEL is not set 270CONFIG_INET_TUNNEL=y
266CONFIG_INET_XFRM_MODE_TRANSPORT=y 271CONFIG_INET_XFRM_MODE_TRANSPORT=y
267CONFIG_INET_XFRM_MODE_TUNNEL=y 272CONFIG_INET_XFRM_MODE_TUNNEL=y
268CONFIG_INET_XFRM_MODE_BEET=y 273CONFIG_INET_XFRM_MODE_BEET=y
@@ -280,6 +285,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
280CONFIG_IPV6=y 285CONFIG_IPV6=y
281# CONFIG_IPV6_PRIVACY is not set 286# CONFIG_IPV6_PRIVACY is not set
282# CONFIG_IPV6_ROUTER_PREF is not set 287# CONFIG_IPV6_ROUTER_PREF is not set
288# CONFIG_IPV6_OPTIMISTIC_DAD is not set
283CONFIG_INET6_AH=m 289CONFIG_INET6_AH=m
284CONFIG_INET6_ESP=m 290CONFIG_INET6_ESP=m
285CONFIG_INET6_IPCOMP=m 291CONFIG_INET6_IPCOMP=m
@@ -302,17 +308,21 @@ CONFIG_NETFILTER=y
302# 308#
303# CONFIG_NETFILTER_NETLINK is not set 309# CONFIG_NETFILTER_NETLINK is not set
304# CONFIG_NF_CONNTRACK_ENABLED is not set 310# CONFIG_NF_CONNTRACK_ENABLED is not set
311# CONFIG_NF_CONNTRACK is not set
305# CONFIG_NETFILTER_XTABLES is not set 312# CONFIG_NETFILTER_XTABLES is not set
306 313
307# 314#
308# IP: Netfilter Configuration 315# IP: Netfilter Configuration
309# 316#
310CONFIG_IP_NF_QUEUE=m 317CONFIG_IP_NF_QUEUE=m
318# CONFIG_IP_NF_IPTABLES is not set
319# CONFIG_IP_NF_ARPTABLES is not set
311 320
312# 321#
313# IPv6: Netfilter Configuration (EXPERIMENTAL) 322# IPv6: Netfilter Configuration (EXPERIMENTAL)
314# 323#
315# CONFIG_IP6_NF_QUEUE is not set 324# CONFIG_IP6_NF_QUEUE is not set
325# CONFIG_IP6_NF_IPTABLES is not set
316 326
317# 327#
318# DCCP Configuration (EXPERIMENTAL) 328# DCCP Configuration (EXPERIMENTAL)
@@ -352,6 +362,13 @@ CONFIG_IP_NF_QUEUE=m
352# CONFIG_HAMRADIO is not set 362# CONFIG_HAMRADIO is not set
353# CONFIG_IRDA is not set 363# CONFIG_IRDA is not set
354# CONFIG_BT is not set 364# CONFIG_BT is not set
365# CONFIG_AF_RXRPC is not set
366
367#
368# Wireless
369#
370# CONFIG_CFG80211 is not set
371# CONFIG_WIRELESS_EXT is not set
355# CONFIG_IEEE80211 is not set 372# CONFIG_IEEE80211 is not set
356 373
357# 374#
@@ -365,16 +382,13 @@ CONFIG_STANDALONE=y
365CONFIG_PREVENT_FIRMWARE_BUILD=y 382CONFIG_PREVENT_FIRMWARE_BUILD=y
366CONFIG_FW_LOADER=y 383CONFIG_FW_LOADER=y
367# CONFIG_DEBUG_DRIVER is not set 384# CONFIG_DEBUG_DRIVER is not set
385# CONFIG_DEBUG_DEVRES is not set
368# CONFIG_SYS_HYPERVISOR is not set 386# CONFIG_SYS_HYPERVISOR is not set
369 387
370# 388#
371# Connector - unified userspace <-> kernelspace linker 389# Connector - unified userspace <-> kernelspace linker
372# 390#
373# CONFIG_CONNECTOR is not set 391# CONFIG_CONNECTOR is not set
374
375#
376# Memory Technology Devices (MTD)
377#
378# CONFIG_MTD is not set 392# CONFIG_MTD is not set
379 393
380# 394#
@@ -385,6 +399,7 @@ CONFIG_FW_LOADER=y
385# 399#
386# Plug and Play support 400# Plug and Play support
387# 401#
402# CONFIG_PNPACPI is not set
388 403
389# 404#
390# Block devices 405# Block devices
@@ -404,7 +419,6 @@ CONFIG_BLK_DEV_RAM=y
404CONFIG_BLK_DEV_RAM_COUNT=16 419CONFIG_BLK_DEV_RAM_COUNT=16
405CONFIG_BLK_DEV_RAM_SIZE=131072 420CONFIG_BLK_DEV_RAM_SIZE=131072
406CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 421CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
407CONFIG_BLK_DEV_INITRD=y
408# CONFIG_CDROM_PKTCDVD is not set 422# CONFIG_CDROM_PKTCDVD is not set
409# CONFIG_ATA_OVER_ETH is not set 423# CONFIG_ATA_OVER_ETH is not set
410 424
@@ -443,7 +457,6 @@ CONFIG_BLK_DEV_GENERIC=y
443# CONFIG_BLK_DEV_OPTI621 is not set 457# CONFIG_BLK_DEV_OPTI621 is not set
444CONFIG_BLK_DEV_IDEDMA_PCI=y 458CONFIG_BLK_DEV_IDEDMA_PCI=y
445# CONFIG_BLK_DEV_IDEDMA_FORCED is not set 459# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
446CONFIG_IDEDMA_PCI_AUTO=y
447# CONFIG_IDEDMA_ONLYDISK is not set 460# CONFIG_IDEDMA_ONLYDISK is not set
448# CONFIG_BLK_DEV_AEC62XX is not set 461# CONFIG_BLK_DEV_AEC62XX is not set
449# CONFIG_BLK_DEV_ALI15X3 is not set 462# CONFIG_BLK_DEV_ALI15X3 is not set
@@ -458,6 +471,7 @@ CONFIG_IDEDMA_PCI_AUTO=y
458# CONFIG_BLK_DEV_JMICRON is not set 471# CONFIG_BLK_DEV_JMICRON is not set
459# CONFIG_BLK_DEV_SC1200 is not set 472# CONFIG_BLK_DEV_SC1200 is not set
460# CONFIG_BLK_DEV_PIIX is not set 473# CONFIG_BLK_DEV_PIIX is not set
474# CONFIG_BLK_DEV_IT8213 is not set
461# CONFIG_BLK_DEV_IT821X is not set 475# CONFIG_BLK_DEV_IT821X is not set
462# CONFIG_BLK_DEV_NS87415 is not set 476# CONFIG_BLK_DEV_NS87415 is not set
463# CONFIG_BLK_DEV_PDC202XX_OLD is not set 477# CONFIG_BLK_DEV_PDC202XX_OLD is not set
@@ -468,11 +482,11 @@ CONFIG_IDEDMA_PCI_AUTO=y
468# CONFIG_BLK_DEV_SLC90E66 is not set 482# CONFIG_BLK_DEV_SLC90E66 is not set
469# CONFIG_BLK_DEV_TRM290 is not set 483# CONFIG_BLK_DEV_TRM290 is not set
470# CONFIG_BLK_DEV_VIA82CXXX is not set 484# CONFIG_BLK_DEV_VIA82CXXX is not set
471CONFIG_BLK_DEV_IDE_CELLEB=y 485# CONFIG_BLK_DEV_TC86C001 is not set
486CONFIG_BLK_DEV_CELLEB=y
472# CONFIG_IDE_ARM is not set 487# CONFIG_IDE_ARM is not set
473CONFIG_BLK_DEV_IDEDMA=y 488CONFIG_BLK_DEV_IDEDMA=y
474# CONFIG_IDEDMA_IVB is not set 489# CONFIG_IDEDMA_IVB is not set
475CONFIG_IDEDMA_AUTO=y
476# CONFIG_BLK_DEV_HD is not set 490# CONFIG_BLK_DEV_HD is not set
477 491
478# 492#
@@ -546,6 +560,7 @@ CONFIG_SCSI_MULTI_LUN=y
546# CONFIG_SCSI_DC395x is not set 560# CONFIG_SCSI_DC395x is not set
547# CONFIG_SCSI_DC390T is not set 561# CONFIG_SCSI_DC390T is not set
548# CONFIG_SCSI_DEBUG is not set 562# CONFIG_SCSI_DEBUG is not set
563# CONFIG_SCSI_ESP_CORE is not set
549# CONFIG_SCSI_SRP is not set 564# CONFIG_SCSI_SRP is not set
550 565
551# 566#
@@ -591,12 +606,7 @@ CONFIG_DM_MULTIPATH=m
591# I2O device support 606# I2O device support
592# 607#
593# CONFIG_I2O is not set 608# CONFIG_I2O is not set
594 609# CONFIG_MACINTOSH_DRIVERS is not set
595#
596# Macintosh device drivers
597#
598# CONFIG_MAC_EMUMOUSEBTN is not set
599# CONFIG_WINDFARM is not set
600 610
601# 611#
602# Network device support 612# Network device support
@@ -652,15 +662,18 @@ CONFIG_MII=y
652# CONFIG_BNX2 is not set 662# CONFIG_BNX2 is not set
653CONFIG_SPIDER_NET=y 663CONFIG_SPIDER_NET=y
654# CONFIG_QLA3XXX is not set 664# CONFIG_QLA3XXX is not set
665# CONFIG_ATL1 is not set
655 666
656# 667#
657# Ethernet (10000 Mbit) 668# Ethernet (10000 Mbit)
658# 669#
659# CONFIG_CHELSIO_T1 is not set 670# CONFIG_CHELSIO_T1 is not set
671# CONFIG_CHELSIO_T3 is not set
660# CONFIG_IXGB is not set 672# CONFIG_IXGB is not set
661# CONFIG_S2IO is not set 673# CONFIG_S2IO is not set
662# CONFIG_MYRI10GE is not set 674# CONFIG_MYRI10GE is not set
663# CONFIG_NETXEN_NIC is not set 675# CONFIG_NETXEN_NIC is not set
676# CONFIG_PASEMI_MAC is not set
664 677
665# 678#
666# Token Ring devices 679# Token Ring devices
@@ -668,9 +681,10 @@ CONFIG_SPIDER_NET=y
668# CONFIG_TR is not set 681# CONFIG_TR is not set
669 682
670# 683#
671# Wireless LAN (non-hamradio) 684# Wireless LAN
672# 685#
673# CONFIG_NET_RADIO is not set 686# CONFIG_WLAN_PRE80211 is not set
687# CONFIG_WLAN_80211 is not set
674 688
675# 689#
676# Wan interfaces 690# Wan interfaces
@@ -770,6 +784,7 @@ CONFIG_SERIAL_CORE=y
770CONFIG_SERIAL_CORE_CONSOLE=y 784CONFIG_SERIAL_CORE_CONSOLE=y
771CONFIG_SERIAL_TXX9=y 785CONFIG_SERIAL_TXX9=y
772CONFIG_HAS_TXX9_SERIAL=y 786CONFIG_HAS_TXX9_SERIAL=y
787CONFIG_SERIAL_TXX9_NR_UARTS=3
773CONFIG_SERIAL_TXX9_CONSOLE=y 788CONFIG_SERIAL_TXX9_CONSOLE=y
774# CONFIG_SERIAL_TXX9_STDSERIAL is not set 789# CONFIG_SERIAL_TXX9_STDSERIAL is not set
775# CONFIG_SERIAL_JSM is not set 790# CONFIG_SERIAL_JSM is not set
@@ -891,6 +906,11 @@ CONFIG_I2C_ALGOBIT=y
891# CONFIG_HWMON_VID is not set 906# CONFIG_HWMON_VID is not set
892 907
893# 908#
909# Multifunction device drivers
910#
911# CONFIG_MFD_SM501 is not set
912
913#
894# Multimedia devices 914# Multimedia devices
895# 915#
896# CONFIG_VIDEO_DEV is not set 916# CONFIG_VIDEO_DEV is not set
@@ -904,7 +924,7 @@ CONFIG_I2C_ALGOBIT=y
904# 924#
905# Graphics support 925# Graphics support
906# 926#
907# CONFIG_FIRMWARE_EDID is not set 927# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
908# CONFIG_FB is not set 928# CONFIG_FB is not set
909# CONFIG_FB_IBM_GXT4500 is not set 929# CONFIG_FB_IBM_GXT4500 is not set
910 930
@@ -913,7 +933,6 @@ CONFIG_I2C_ALGOBIT=y
913# 933#
914# CONFIG_VGA_CONSOLE is not set 934# CONFIG_VGA_CONSOLE is not set
915CONFIG_DUMMY_CONSOLE=y 935CONFIG_DUMMY_CONSOLE=y
916# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
917 936
918# 937#
919# Sound 938# Sound
@@ -924,6 +943,15 @@ CONFIG_DUMMY_CONSOLE=y
924# HID Devices 943# HID Devices
925# 944#
926CONFIG_HID=y 945CONFIG_HID=y
946# CONFIG_HID_DEBUG is not set
947
948#
949# USB Input Devices
950#
951CONFIG_USB_HID=y
952# CONFIG_USB_HIDINPUT_POWERBOOK is not set
953# CONFIG_HID_FF is not set
954CONFIG_USB_HIDDEV=y
927 955
928# 956#
929# USB support 957# USB support
@@ -938,9 +966,8 @@ CONFIG_USB=y
938# Miscellaneous USB options 966# Miscellaneous USB options
939# 967#
940CONFIG_USB_DEVICEFS=y 968CONFIG_USB_DEVICEFS=y
941# CONFIG_USB_BANDWIDTH is not set 969# CONFIG_USB_DEVICE_CLASS is not set
942# CONFIG_USB_DYNAMIC_MINORS is not set 970# CONFIG_USB_DYNAMIC_MINORS is not set
943# CONFIG_USB_MULTITHREAD_PROBE is not set
944# CONFIG_USB_OTG is not set 971# CONFIG_USB_OTG is not set
945 972
946# 973#
@@ -953,6 +980,7 @@ CONFIG_USB_EHCI_HCD=m
953CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y 980CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
954# CONFIG_USB_ISP116X_HCD is not set 981# CONFIG_USB_ISP116X_HCD is not set
955CONFIG_USB_OHCI_HCD=m 982CONFIG_USB_OHCI_HCD=m
983# CONFIG_USB_OHCI_HCD_PPC_OF is not set
956# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 984# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
957CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 985CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
958CONFIG_USB_OHCI_LITTLE_ENDIAN=y 986CONFIG_USB_OHCI_LITTLE_ENDIAN=y
@@ -989,10 +1017,6 @@ CONFIG_USB_STORAGE=m
989# 1017#
990# USB Input Devices 1018# USB Input Devices
991# 1019#
992CONFIG_USB_HID=y
993# CONFIG_USB_HIDINPUT_POWERBOOK is not set
994# CONFIG_HID_FF is not set
995CONFIG_USB_HIDDEV=y
996# CONFIG_USB_AIPTEK is not set 1020# CONFIG_USB_AIPTEK is not set
997# CONFIG_USB_WACOM is not set 1021# CONFIG_USB_WACOM is not set
998# CONFIG_USB_ACECAD is not set 1022# CONFIG_USB_ACECAD is not set
@@ -1005,6 +1029,7 @@ CONFIG_USB_HIDDEV=y
1005# CONFIG_USB_ATI_REMOTE2 is not set 1029# CONFIG_USB_ATI_REMOTE2 is not set
1006# CONFIG_USB_KEYSPAN_REMOTE is not set 1030# CONFIG_USB_KEYSPAN_REMOTE is not set
1007# CONFIG_USB_APPLETOUCH is not set 1031# CONFIG_USB_APPLETOUCH is not set
1032# CONFIG_USB_GTCO is not set
1008 1033
1009# 1034#
1010# USB Imaging devices 1035# USB Imaging devices
@@ -1042,6 +1067,7 @@ CONFIG_USB_MON=y
1042# CONFIG_USB_RIO500 is not set 1067# CONFIG_USB_RIO500 is not set
1043# CONFIG_USB_LEGOTOWER is not set 1068# CONFIG_USB_LEGOTOWER is not set
1044# CONFIG_USB_LCD is not set 1069# CONFIG_USB_LCD is not set
1070# CONFIG_USB_BERRY_CHARGE is not set
1045# CONFIG_USB_LED is not set 1071# CONFIG_USB_LED is not set
1046# CONFIG_USB_CYPRESS_CY7C63 is not set 1072# CONFIG_USB_CYPRESS_CY7C63 is not set
1047# CONFIG_USB_CYTHERM is not set 1073# CONFIG_USB_CYTHERM is not set
@@ -1052,6 +1078,7 @@ CONFIG_USB_MON=y
1052# CONFIG_USB_SISUSBVGA is not set 1078# CONFIG_USB_SISUSBVGA is not set
1053# CONFIG_USB_LD is not set 1079# CONFIG_USB_LD is not set
1054# CONFIG_USB_TRANCEVIBRATOR is not set 1080# CONFIG_USB_TRANCEVIBRATOR is not set
1081# CONFIG_USB_IOWARRIOR is not set
1055# CONFIG_USB_TEST is not set 1082# CONFIG_USB_TEST is not set
1056 1083
1057# 1084#
@@ -1109,6 +1136,10 @@ CONFIG_USB_MON=y
1109# 1136#
1110 1137
1111# 1138#
1139# Auxiliary Display support
1140#
1141
1142#
1112# Virtualization 1143# Virtualization
1113# 1144#
1114 1145
@@ -1293,6 +1324,8 @@ CONFIG_NLS_ISO8859_15=m
1293# Distributed Lock Manager 1324# Distributed Lock Manager
1294# 1325#
1295# CONFIG_DLM is not set 1326# CONFIG_DLM is not set
1327# CONFIG_UCC_SLOW is not set
1328# CONFIG_UCC_FAST is not set
1296 1329
1297# 1330#
1298# Library routines 1331# Library routines
@@ -1305,7 +1338,8 @@ CONFIG_LIBCRC32C=m
1305CONFIG_ZLIB_INFLATE=m 1338CONFIG_ZLIB_INFLATE=m
1306CONFIG_ZLIB_DEFLATE=m 1339CONFIG_ZLIB_DEFLATE=m
1307CONFIG_PLIST=y 1340CONFIG_PLIST=y
1308CONFIG_IOMAP_COPY=y 1341CONFIG_HAS_IOMEM=y
1342CONFIG_HAS_IOPORT=y
1309 1343
1310# 1344#
1311# Instrumentation Support 1345# Instrumentation Support
@@ -1323,15 +1357,16 @@ CONFIG_MAGIC_SYSRQ=y
1323CONFIG_DEBUG_FS=y 1357CONFIG_DEBUG_FS=y
1324# CONFIG_HEADERS_CHECK is not set 1358# CONFIG_HEADERS_CHECK is not set
1325CONFIG_DEBUG_KERNEL=y 1359CONFIG_DEBUG_KERNEL=y
1360# CONFIG_DEBUG_SHIRQ is not set
1326CONFIG_LOG_BUF_SHIFT=15 1361CONFIG_LOG_BUF_SHIFT=15
1327CONFIG_DETECT_SOFTLOCKUP=y 1362CONFIG_DETECT_SOFTLOCKUP=y
1328# CONFIG_SCHEDSTATS is not set 1363# CONFIG_SCHEDSTATS is not set
1364# CONFIG_TIMER_STATS is not set
1329# CONFIG_DEBUG_SLAB is not set 1365# CONFIG_DEBUG_SLAB is not set
1330# CONFIG_DEBUG_RT_MUTEXES is not set 1366# CONFIG_DEBUG_RT_MUTEXES is not set
1331# CONFIG_RT_MUTEX_TESTER is not set 1367# CONFIG_RT_MUTEX_TESTER is not set
1332# CONFIG_DEBUG_SPINLOCK is not set 1368# CONFIG_DEBUG_SPINLOCK is not set
1333CONFIG_DEBUG_MUTEXES=y 1369CONFIG_DEBUG_MUTEXES=y
1334# CONFIG_DEBUG_RWSEMS is not set
1335CONFIG_DEBUG_SPINLOCK_SLEEP=y 1370CONFIG_DEBUG_SPINLOCK_SLEEP=y
1336# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1371# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1337# CONFIG_DEBUG_KOBJECT is not set 1372# CONFIG_DEBUG_KOBJECT is not set
@@ -1341,8 +1376,10 @@ CONFIG_DEBUG_BUGVERBOSE=y
1341# CONFIG_DEBUG_LIST is not set 1376# CONFIG_DEBUG_LIST is not set
1342# CONFIG_FORCED_INLINING is not set 1377# CONFIG_FORCED_INLINING is not set
1343# CONFIG_RCU_TORTURE_TEST is not set 1378# CONFIG_RCU_TORTURE_TEST is not set
1379# CONFIG_FAULT_INJECTION is not set
1344# CONFIG_DEBUG_STACKOVERFLOW is not set 1380# CONFIG_DEBUG_STACKOVERFLOW is not set
1345# CONFIG_DEBUG_STACK_USAGE is not set 1381# CONFIG_DEBUG_STACK_USAGE is not set
1382# CONFIG_DEBUG_PAGEALLOC is not set
1346CONFIG_DEBUGGER=y 1383CONFIG_DEBUGGER=y
1347CONFIG_XMON=y 1384CONFIG_XMON=y
1348CONFIG_XMON_DEFAULT=y 1385CONFIG_XMON_DEFAULT=y
@@ -1356,6 +1393,7 @@ CONFIG_PPC_EARLY_DEBUG=y
1356# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set 1393# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
1357# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set 1394# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
1358# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set 1395# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
1396# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
1359CONFIG_PPC_EARLY_DEBUG_BEAT=y 1397CONFIG_PPC_EARLY_DEBUG_BEAT=y
1360 1398
1361# 1399#
@@ -1385,8 +1423,10 @@ CONFIG_CRYPTO_TGR192=m
1385# CONFIG_CRYPTO_GF128MUL is not set 1423# CONFIG_CRYPTO_GF128MUL is not set
1386CONFIG_CRYPTO_ECB=m 1424CONFIG_CRYPTO_ECB=m
1387CONFIG_CRYPTO_CBC=m 1425CONFIG_CRYPTO_CBC=m
1426CONFIG_CRYPTO_PCBC=m
1388# CONFIG_CRYPTO_LRW is not set 1427# CONFIG_CRYPTO_LRW is not set
1389CONFIG_CRYPTO_DES=m 1428CONFIG_CRYPTO_DES=m
1429# CONFIG_CRYPTO_FCRYPT is not set
1390CONFIG_CRYPTO_BLOWFISH=m 1430CONFIG_CRYPTO_BLOWFISH=m
1391CONFIG_CRYPTO_TWOFISH=m 1431CONFIG_CRYPTO_TWOFISH=m
1392CONFIG_CRYPTO_TWOFISH_COMMON=m 1432CONFIG_CRYPTO_TWOFISH_COMMON=m
@@ -1401,6 +1441,7 @@ CONFIG_CRYPTO_ANUBIS=m
1401CONFIG_CRYPTO_DEFLATE=m 1441CONFIG_CRYPTO_DEFLATE=m
1402CONFIG_CRYPTO_MICHAEL_MIC=m 1442CONFIG_CRYPTO_MICHAEL_MIC=m
1403CONFIG_CRYPTO_CRC32C=m 1443CONFIG_CRYPTO_CRC32C=m
1444# CONFIG_CRYPTO_CAMELLIA is not set
1404CONFIG_CRYPTO_TEST=m 1445CONFIG_CRYPTO_TEST=m
1405 1446
1406# 1447#
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 6d05a1f377b5..b0409e19b1c1 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -1098,35 +1098,24 @@ static int get_bus_io_range(struct pci_bus *bus, unsigned long *start_phys,
1098 unsigned long *start_virt, unsigned long *size) 1098 unsigned long *start_virt, unsigned long *size)
1099{ 1099{
1100 struct pci_controller *hose = pci_bus_to_host(bus); 1100 struct pci_controller *hose = pci_bus_to_host(bus);
1101 struct pci_bus_region region;
1102 struct resource *res; 1101 struct resource *res;
1103 1102
1104 if (bus->self) { 1103 if (bus->self)
1105 res = bus->resource[0]; 1104 res = bus->resource[0];
1106 pcibios_resource_to_bus(bus->self, &region, res); 1105 else
1107 *start_phys = hose->io_base_phys + region.start;
1108 *start_virt = (unsigned long) hose->io_base_virt +
1109 region.start;
1110 if (region.end > region.start)
1111 *size = region.end - region.start + 1;
1112 else {
1113 printk("%s(): unexpected region 0x%lx->0x%lx\n",
1114 __FUNCTION__, region.start, region.end);
1115 return 1;
1116 }
1117
1118 } else {
1119 /* Root Bus */ 1106 /* Root Bus */
1120 res = &hose->io_resource; 1107 res = &hose->io_resource;
1121 *start_phys = hose->io_base_phys + res->start; 1108
1122 *start_virt = (unsigned long) hose->io_base_virt + res->start; 1109 *start_virt = pci_io_base + res->start;
1123 if (res->end > res->start) 1110 *start_phys = *start_virt + hose->io_base_phys
1124 *size = res->end - res->start + 1; 1111 - (unsigned long) hose->io_base_virt;
1125 else { 1112
1126 printk("%s(): unexpected region 0x%lx->0x%lx\n", 1113 if (res->end > res->start)
1127 __FUNCTION__, res->start, res->end); 1114 *size = res->end - res->start + 1;
1128 return 1; 1115 else {
1129 } 1116 printk("%s(): unexpected region 0x%lx->0x%lx\n",
1117 __FUNCTION__, res->start, res->end);
1118 return 1;
1130 } 1119 }
1131 1120
1132 return 0; 1121 return 0;
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index caef555f2dc0..c065b5550368 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -716,11 +716,40 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
716 return 0; 716 return 0;
717} 717}
718 718
719#ifdef CONFIG_BLK_DEV_INITRD
720static void __init early_init_dt_check_for_initrd(unsigned long node)
721{
722 unsigned long l;
723 u32 *prop;
724
725 DBG("Looking for initrd properties... ");
726
727 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l);
728 if (prop) {
729 initrd_start = (unsigned long)__va(of_read_ulong(prop, l/4));
730
731 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l);
732 if (prop) {
733 initrd_end = (unsigned long)
734 __va(of_read_ulong(prop, l/4));
735 initrd_below_start_ok = 1;
736 } else {
737 initrd_start = 0;
738 }
739 }
740
741 DBG("initrd_start=0x%lx initrd_end=0x%lx\n", initrd_start, initrd_end);
742}
743#else
744static inline void early_init_dt_check_for_initrd(unsigned long node)
745{
746}
747#endif /* CONFIG_BLK_DEV_INITRD */
748
719static int __init early_init_dt_scan_chosen(unsigned long node, 749static int __init early_init_dt_scan_chosen(unsigned long node,
720 const char *uname, int depth, void *data) 750 const char *uname, int depth, void *data)
721{ 751{
722 unsigned long *lprop; 752 unsigned long *lprop;
723 u32 *prop;
724 unsigned long l; 753 unsigned long l;
725 char *p; 754 char *p;
726 755
@@ -762,21 +791,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
762 crashk_res.end = crashk_res.start + *lprop - 1; 791 crashk_res.end = crashk_res.start + *lprop - 1;
763#endif 792#endif
764 793
765#ifdef CONFIG_BLK_DEV_INITRD 794 early_init_dt_check_for_initrd(node);
766 DBG("Looking for initrd properties... ");
767 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l);
768 if (prop) {
769 initrd_start = (unsigned long)__va(of_read_ulong(prop, l/4));
770 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l);
771 if (prop) {
772 initrd_end = (unsigned long)__va(of_read_ulong(prop, l/4));
773 initrd_below_start_ok = 1;
774 } else {
775 initrd_start = 0;
776 }
777 }
778 DBG("initrd_start=0x%lx initrd_end=0x%lx\n", initrd_start, initrd_end);
779#endif /* CONFIG_BLK_DEV_INITRD */
780 795
781 /* Retreive command line */ 796 /* Retreive command line */
782 p = of_get_flat_dt_prop(node, "bootargs", &l); 797 p = of_get_flat_dt_prop(node, "bootargs", &l);
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 450258de7ca1..0a486d4b2547 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -23,7 +23,5 @@ obj-$(CONFIG_SMP) += locks.o
23endif 23endif
24 24
25# Temporary hack until we have migrated to asm-powerpc 25# Temporary hack until we have migrated to asm-powerpc
26ifeq ($(CONFIG_PPC_MERGE),y)
27obj-$(CONFIG_8xx) += rheap.o 26obj-$(CONFIG_8xx) += rheap.o
28obj-$(CONFIG_CPM2) += rheap.o 27obj-$(CONFIG_CPM2) += rheap.o
29endif
diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
index 6c5c5dd183ee..b2f6dcc59600 100644
--- a/arch/powerpc/lib/rheap.c
+++ b/arch/powerpc/lib/rheap.c
@@ -133,7 +133,7 @@ static rh_block_t *get_slot(rh_info_t * info)
133 info->empty_slots--; 133 info->empty_slots--;
134 134
135 /* Initialize */ 135 /* Initialize */
136 blk->start = NULL; 136 blk->start = 0;
137 blk->size = 0; 137 blk->size = 0;
138 blk->owner = NULL; 138 blk->owner = NULL;
139 139
@@ -158,7 +158,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
158 158
159 /* We assume that they are aligned properly */ 159 /* We assume that they are aligned properly */
160 size = blkn->size; 160 size = blkn->size;
161 s = (unsigned long)blkn->start; 161 s = blkn->start;
162 e = s + size; 162 e = s + size;
163 163
164 /* Find the blocks immediately before and after the given one 164 /* Find the blocks immediately before and after the given one
@@ -170,7 +170,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
170 list_for_each(l, &info->free_list) { 170 list_for_each(l, &info->free_list) {
171 blk = list_entry(l, rh_block_t, list); 171 blk = list_entry(l, rh_block_t, list);
172 172
173 bs = (unsigned long)blk->start; 173 bs = blk->start;
174 be = bs + blk->size; 174 be = bs + blk->size;
175 175
176 if (next == NULL && s >= bs) 176 if (next == NULL && s >= bs)
@@ -188,10 +188,10 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
188 } 188 }
189 189
190 /* Now check if they are really adjacent */ 190 /* Now check if they are really adjacent */
191 if (before != NULL && s != (unsigned long)before->start + before->size) 191 if (before && s != (before->start + before->size))
192 before = NULL; 192 before = NULL;
193 193
194 if (after != NULL && e != (unsigned long)after->start) 194 if (after && e != after->start)
195 after = NULL; 195 after = NULL;
196 196
197 /* No coalescing; list insert and return */ 197 /* No coalescing; list insert and return */
@@ -216,7 +216,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
216 216
217 /* Grow the after block backwards */ 217 /* Grow the after block backwards */
218 if (before == NULL && after != NULL) { 218 if (before == NULL && after != NULL) {
219 after->start = (int8_t *)after->start - size; 219 after->start -= size;
220 after->size += size; 220 after->size += size;
221 return; 221 return;
222 } 222 }
@@ -321,14 +321,14 @@ void rh_init(rh_info_t * info, unsigned int alignment, int max_blocks,
321} 321}
322 322
323/* Attach a free memory region, coalesces regions if adjuscent */ 323/* Attach a free memory region, coalesces regions if adjuscent */
324int rh_attach_region(rh_info_t * info, void *start, int size) 324int rh_attach_region(rh_info_t * info, unsigned long start, int size)
325{ 325{
326 rh_block_t *blk; 326 rh_block_t *blk;
327 unsigned long s, e, m; 327 unsigned long s, e, m;
328 int r; 328 int r;
329 329
330 /* The region must be aligned */ 330 /* The region must be aligned */
331 s = (unsigned long)start; 331 s = start;
332 e = s + size; 332 e = s + size;
333 m = info->alignment - 1; 333 m = info->alignment - 1;
334 334
@@ -338,9 +338,12 @@ int rh_attach_region(rh_info_t * info, void *start, int size)
338 /* Round end down */ 338 /* Round end down */
339 e = e & ~m; 339 e = e & ~m;
340 340
341 if (IS_ERR_VALUE(e) || (e < s))
342 return -ERANGE;
343
341 /* Take final values */ 344 /* Take final values */
342 start = (void *)s; 345 start = s;
343 size = (int)(e - s); 346 size = e - s;
344 347
345 /* Grow the blocks, if needed */ 348 /* Grow the blocks, if needed */
346 r = assure_empty(info, 1); 349 r = assure_empty(info, 1);
@@ -358,7 +361,7 @@ int rh_attach_region(rh_info_t * info, void *start, int size)
358} 361}
359 362
360/* Detatch given address range, splits free block if needed. */ 363/* Detatch given address range, splits free block if needed. */
361void *rh_detach_region(rh_info_t * info, void *start, int size) 364unsigned long rh_detach_region(rh_info_t * info, unsigned long start, int size)
362{ 365{
363 struct list_head *l; 366 struct list_head *l;
364 rh_block_t *blk, *newblk; 367 rh_block_t *blk, *newblk;
@@ -366,10 +369,10 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)
366 369
367 /* Validate size */ 370 /* Validate size */
368 if (size <= 0) 371 if (size <= 0)
369 return ERR_PTR(-EINVAL); 372 return (unsigned long) -EINVAL;
370 373
371 /* The region must be aligned */ 374 /* The region must be aligned */
372 s = (unsigned long)start; 375 s = start;
373 e = s + size; 376 e = s + size;
374 m = info->alignment - 1; 377 m = info->alignment - 1;
375 378
@@ -380,34 +383,34 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)
380 e = e & ~m; 383 e = e & ~m;
381 384
382 if (assure_empty(info, 1) < 0) 385 if (assure_empty(info, 1) < 0)
383 return ERR_PTR(-ENOMEM); 386 return (unsigned long) -ENOMEM;
384 387
385 blk = NULL; 388 blk = NULL;
386 list_for_each(l, &info->free_list) { 389 list_for_each(l, &info->free_list) {
387 blk = list_entry(l, rh_block_t, list); 390 blk = list_entry(l, rh_block_t, list);
388 /* The range must lie entirely inside one free block */ 391 /* The range must lie entirely inside one free block */
389 bs = (unsigned long)blk->start; 392 bs = blk->start;
390 be = (unsigned long)blk->start + blk->size; 393 be = blk->start + blk->size;
391 if (s >= bs && e <= be) 394 if (s >= bs && e <= be)
392 break; 395 break;
393 blk = NULL; 396 blk = NULL;
394 } 397 }
395 398
396 if (blk == NULL) 399 if (blk == NULL)
397 return ERR_PTR(-ENOMEM); 400 return (unsigned long) -ENOMEM;
398 401
399 /* Perfect fit */ 402 /* Perfect fit */
400 if (bs == s && be == e) { 403 if (bs == s && be == e) {
401 /* Delete from free list, release slot */ 404 /* Delete from free list, release slot */
402 list_del(&blk->list); 405 list_del(&blk->list);
403 release_slot(info, blk); 406 release_slot(info, blk);
404 return (void *)s; 407 return s;
405 } 408 }
406 409
407 /* blk still in free list, with updated start and/or size */ 410 /* blk still in free list, with updated start and/or size */
408 if (bs == s || be == e) { 411 if (bs == s || be == e) {
409 if (bs == s) 412 if (bs == s)
410 blk->start = (int8_t *)blk->start + size; 413 blk->start += size;
411 blk->size -= size; 414 blk->size -= size;
412 415
413 } else { 416 } else {
@@ -416,25 +419,29 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)
416 419
417 /* the back free fragment */ 420 /* the back free fragment */
418 newblk = get_slot(info); 421 newblk = get_slot(info);
419 newblk->start = (void *)e; 422 newblk->start = e;
420 newblk->size = be - e; 423 newblk->size = be - e;
421 424
422 list_add(&newblk->list, &blk->list); 425 list_add(&newblk->list, &blk->list);
423 } 426 }
424 427
425 return (void *)s; 428 return s;
426} 429}
427 430
428void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owner) 431/* Allocate a block of memory at the specified alignment. The value returned
432 * is an offset into the buffer initialized by rh_init(), or a negative number
433 * if there is an error.
434 */
435unsigned long rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owner)
429{ 436{
430 struct list_head *l; 437 struct list_head *l;
431 rh_block_t *blk; 438 rh_block_t *blk;
432 rh_block_t *newblk; 439 rh_block_t *newblk;
433 void *start; 440 unsigned long start;
434 441
435 /* Validate size, (must be power of two) */ 442 /* Validate size, and alignment must be power of two */
436 if (size <= 0 || (alignment & (alignment - 1)) != 0) 443 if (size <= 0 || (alignment & (alignment - 1)) != 0)
437 return ERR_PTR(-EINVAL); 444 return (unsigned long) -EINVAL;
438 445
439 /* given alignment larger that default rheap alignment */ 446 /* given alignment larger that default rheap alignment */
440 if (alignment > info->alignment) 447 if (alignment > info->alignment)
@@ -444,7 +451,7 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
444 size = (size + (info->alignment - 1)) & ~(info->alignment - 1); 451 size = (size + (info->alignment - 1)) & ~(info->alignment - 1);
445 452
446 if (assure_empty(info, 1) < 0) 453 if (assure_empty(info, 1) < 0)
447 return ERR_PTR(-ENOMEM); 454 return (unsigned long) -ENOMEM;
448 455
449 blk = NULL; 456 blk = NULL;
450 list_for_each(l, &info->free_list) { 457 list_for_each(l, &info->free_list) {
@@ -455,7 +462,7 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
455 } 462 }
456 463
457 if (blk == NULL) 464 if (blk == NULL)
458 return ERR_PTR(-ENOMEM); 465 return (unsigned long) -ENOMEM;
459 466
460 /* Just fits */ 467 /* Just fits */
461 if (blk->size == size) { 468 if (blk->size == size) {
@@ -475,7 +482,7 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
475 newblk->owner = owner; 482 newblk->owner = owner;
476 483
477 /* blk still in free list, with updated start, size */ 484 /* blk still in free list, with updated start, size */
478 blk->start = (int8_t *)blk->start + size; 485 blk->start += size;
479 blk->size -= size; 486 blk->size -= size;
480 487
481 start = newblk->start; 488 start = newblk->start;
@@ -486,19 +493,25 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
486 /* this is no problem with the deallocator since */ 493 /* this is no problem with the deallocator since */
487 /* we scan for pointers that lie in the blocks */ 494 /* we scan for pointers that lie in the blocks */
488 if (alignment > info->alignment) 495 if (alignment > info->alignment)
489 start = (void *)(((unsigned long)start + alignment - 1) & 496 start = (start + alignment - 1) & ~(alignment - 1);
490 ~(alignment - 1));
491 497
492 return start; 498 return start;
493} 499}
494 500
495void *rh_alloc(rh_info_t * info, int size, const char *owner) 501/* Allocate a block of memory at the default alignment. The value returned is
502 * an offset into the buffer initialized by rh_init(), or a negative number if
503 * there is an error.
504 */
505unsigned long rh_alloc(rh_info_t * info, int size, const char *owner)
496{ 506{
497 return rh_alloc_align(info, size, info->alignment, owner); 507 return rh_alloc_align(info, size, info->alignment, owner);
498} 508}
499 509
500/* allocate at precisely the given address */ 510/* Allocate a block of memory at the given offset, rounded up to the default
501void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner) 511 * alignment. The value returned is an offset into the buffer initialized by
512 * rh_init(), or a negative number if there is an error.
513 */
514unsigned long rh_alloc_fixed(rh_info_t * info, unsigned long start, int size, const char *owner)
502{ 515{
503 struct list_head *l; 516 struct list_head *l;
504 rh_block_t *blk, *newblk1, *newblk2; 517 rh_block_t *blk, *newblk1, *newblk2;
@@ -506,10 +519,10 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
506 519
507 /* Validate size */ 520 /* Validate size */
508 if (size <= 0) 521 if (size <= 0)
509 return ERR_PTR(-EINVAL); 522 return (unsigned long) -EINVAL;
510 523
511 /* The region must be aligned */ 524 /* The region must be aligned */
512 s = (unsigned long)start; 525 s = start;
513 e = s + size; 526 e = s + size;
514 m = info->alignment - 1; 527 m = info->alignment - 1;
515 528
@@ -520,20 +533,20 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
520 e = e & ~m; 533 e = e & ~m;
521 534
522 if (assure_empty(info, 2) < 0) 535 if (assure_empty(info, 2) < 0)
523 return ERR_PTR(-ENOMEM); 536 return (unsigned long) -ENOMEM;
524 537
525 blk = NULL; 538 blk = NULL;
526 list_for_each(l, &info->free_list) { 539 list_for_each(l, &info->free_list) {
527 blk = list_entry(l, rh_block_t, list); 540 blk = list_entry(l, rh_block_t, list);
528 /* The range must lie entirely inside one free block */ 541 /* The range must lie entirely inside one free block */
529 bs = (unsigned long)blk->start; 542 bs = blk->start;
530 be = (unsigned long)blk->start + blk->size; 543 be = blk->start + blk->size;
531 if (s >= bs && e <= be) 544 if (s >= bs && e <= be)
532 break; 545 break;
533 } 546 }
534 547
535 if (blk == NULL) 548 if (blk == NULL)
536 return ERR_PTR(-ENOMEM); 549 return (unsigned long) -ENOMEM;
537 550
538 /* Perfect fit */ 551 /* Perfect fit */
539 if (bs == s && be == e) { 552 if (bs == s && be == e) {
@@ -551,7 +564,7 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
551 /* blk still in free list, with updated start and/or size */ 564 /* blk still in free list, with updated start and/or size */
552 if (bs == s || be == e) { 565 if (bs == s || be == e) {
553 if (bs == s) 566 if (bs == s)
554 blk->start = (int8_t *)blk->start + size; 567 blk->start += size;
555 blk->size -= size; 568 blk->size -= size;
556 569
557 } else { 570 } else {
@@ -560,14 +573,14 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
560 573
561 /* The back free fragment */ 574 /* The back free fragment */
562 newblk2 = get_slot(info); 575 newblk2 = get_slot(info);
563 newblk2->start = (void *)e; 576 newblk2->start = e;
564 newblk2->size = be - e; 577 newblk2->size = be - e;
565 578
566 list_add(&newblk2->list, &blk->list); 579 list_add(&newblk2->list, &blk->list);
567 } 580 }
568 581
569 newblk1 = get_slot(info); 582 newblk1 = get_slot(info);
570 newblk1->start = (void *)s; 583 newblk1->start = s;
571 newblk1->size = e - s; 584 newblk1->size = e - s;
572 newblk1->owner = owner; 585 newblk1->owner = owner;
573 586
@@ -577,7 +590,11 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
577 return start; 590 return start;
578} 591}
579 592
580int rh_free(rh_info_t * info, void *start) 593/* Deallocate the memory previously allocated by one of the rh_alloc functions.
594 * The return value is the size of the deallocated block, or a negative number
595 * if there is an error.
596 */
597int rh_free(rh_info_t * info, unsigned long start)
581{ 598{
582 rh_block_t *blk, *blk2; 599 rh_block_t *blk, *blk2;
583 struct list_head *l; 600 struct list_head *l;
@@ -642,7 +659,7 @@ int rh_get_stats(rh_info_t * info, int what, int max_stats, rh_stats_t * stats)
642 return nr; 659 return nr;
643} 660}
644 661
645int rh_set_owner(rh_info_t * info, void *start, const char *owner) 662int rh_set_owner(rh_info_t * info, unsigned long start, const char *owner)
646{ 663{
647 rh_block_t *blk, *blk2; 664 rh_block_t *blk, *blk2;
648 struct list_head *l; 665 struct list_head *l;
@@ -684,8 +701,8 @@ void rh_dump(rh_info_t * info)
684 nr = maxnr; 701 nr = maxnr;
685 for (i = 0; i < nr; i++) 702 for (i = 0; i < nr; i++)
686 printk(KERN_INFO 703 printk(KERN_INFO
687 " 0x%p-0x%p (%u)\n", 704 " 0x%lx-0x%lx (%u)\n",
688 st[i].start, (int8_t *) st[i].start + st[i].size, 705 st[i].start, st[i].start + st[i].size,
689 st[i].size); 706 st[i].size);
690 printk(KERN_INFO "\n"); 707 printk(KERN_INFO "\n");
691 708
@@ -695,8 +712,8 @@ void rh_dump(rh_info_t * info)
695 nr = maxnr; 712 nr = maxnr;
696 for (i = 0; i < nr; i++) 713 for (i = 0; i < nr; i++)
697 printk(KERN_INFO 714 printk(KERN_INFO
698 " 0x%p-0x%p (%u) %s\n", 715 " 0x%lx-0x%lx (%u) %s\n",
699 st[i].start, (int8_t *) st[i].start + st[i].size, 716 st[i].start, st[i].start + st[i].size,
700 st[i].size, st[i].owner != NULL ? st[i].owner : ""); 717 st[i].size, st[i].owner != NULL ? st[i].owner : "");
701 printk(KERN_INFO "\n"); 718 printk(KERN_INFO "\n");
702} 719}
@@ -704,6 +721,6 @@ void rh_dump(rh_info_t * info)
704void rh_dump_blk(rh_info_t * info, rh_block_t * blk) 721void rh_dump_blk(rh_info_t * info, rh_block_t * blk)
705{ 722{
706 printk(KERN_INFO 723 printk(KERN_INFO
707 "blk @0x%p: 0x%p-0x%p (%u)\n", 724 "blk @0x%p: 0x%lx-0x%lx (%u)\n",
708 blk, blk->start, (int8_t *) blk->start + blk->size, blk->size); 725 blk, blk->start, blk->start + blk->size, blk->size);
709} 726}
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index 7b7fe2d7b9dc..7d722eea4ea8 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -376,31 +376,28 @@ static void hpte_decode(hpte_t *hpte, unsigned long slot,
376 } 376 }
377 } 377 }
378 378
379 /* 379 /* This works for all page sizes, and for 256M and 1T segments */
380 * FIXME, the code below works for 16M, 64K, and 4K pages as these
381 * fall under the p<=23 rules for calculating the virtual address.
382 * In the case of 16M pages, an extra bit is stolen from the AVPN
383 * field to achieve the requisite 24 bits.
384 *
385 * Does not work for 16G pages or 1 TB segments.
386 */
387 shift = mmu_psize_defs[size].shift; 380 shift = mmu_psize_defs[size].shift;
388 if (mmu_psize_defs[size].avpnm) 381 avpn = (HPTE_V_AVPN_VAL(hpte_v) & ~mmu_psize_defs[size].avpnm) << 23;
389 avpnm_bits = __ilog2_u64(mmu_psize_defs[size].avpnm) + 1;
390 else
391 avpnm_bits = 0;
392 if (shift - avpnm_bits <= 23) {
393 avpn = HPTE_V_AVPN_VAL(hpte_v) << 23;
394 382
395 if (shift < 23) { 383 if (shift < 23) {
396 unsigned long vpi, pteg; 384 unsigned long vpi, vsid, pteg;
397 385
398 pteg = slot / HPTES_PER_GROUP; 386 pteg = slot / HPTES_PER_GROUP;
399 if (hpte_v & HPTE_V_SECONDARY) 387 if (hpte_v & HPTE_V_SECONDARY)
400 pteg = ~pteg; 388 pteg = ~pteg;
389 switch (hpte_v >> HPTE_V_SSIZE_SHIFT) {
390 case MMU_SEGSIZE_256M:
401 vpi = ((avpn >> 28) ^ pteg) & htab_hash_mask; 391 vpi = ((avpn >> 28) ^ pteg) & htab_hash_mask;
402 avpn |= (vpi << mmu_psize_defs[size].shift); 392 break;
393 case MMU_SEGSIZE_1T:
394 vsid = avpn >> 40;
395 vpi = (vsid ^ (vsid << 25) ^ pteg) & htab_hash_mask;
396 break;
397 default:
398 avpn = vpi = psize = 0;
403 } 399 }
400 avpn |= (vpi << mmu_psize_defs[size].shift);
404 } 401 }
405 402
406 *va = avpn; 403 *va = avpn;
diff --git a/arch/powerpc/platforms/83xx/mpc8313_rdb.c b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
index 32e9e9492841..96970ac887ee 100644
--- a/arch/powerpc/platforms/83xx/mpc8313_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
@@ -40,7 +40,9 @@ unsigned long isa_mem_base = 0;
40 */ 40 */
41static void __init mpc8313_rdb_setup_arch(void) 41static void __init mpc8313_rdb_setup_arch(void)
42{ 42{
43#ifdef CONFIG_PCI
43 struct device_node *np; 44 struct device_node *np;
45#endif
44 46
45 if (ppc_md.progress) 47 if (ppc_md.progress)
46 ppc_md.progress("mpc8313_rdb_setup_arch()", 0); 48 ppc_md.progress("mpc8313_rdb_setup_arch()", 0);
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index b0b22bb29de7..3db68b73fc32 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -44,7 +44,9 @@ unsigned long isa_mem_base = 0;
44 */ 44 */
45static void __init mpc832x_rdb_setup_arch(void) 45static void __init mpc832x_rdb_setup_arch(void)
46{ 46{
47#if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE)
47 struct device_node *np; 48 struct device_node *np;
49#endif
48 50
49 if (ppc_md.progress) 51 if (ppc_md.progress)
50 ppc_md.progress("mpc832x_rdb_setup_arch()", 0); 52 ppc_md.progress("mpc832x_rdb_setup_arch()", 0);
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 3c009f6d4a4f..40a01947d684 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -50,7 +50,9 @@ unsigned long isa_mem_base = 0;
50 */ 50 */
51static void __init mpc834x_itx_setup_arch(void) 51static void __init mpc834x_itx_setup_arch(void)
52{ 52{
53#ifdef CONFIG_PCI
53 struct device_node *np; 54 struct device_node *np;
55#endif
54 56
55 if (ppc_md.progress) 57 if (ppc_md.progress)
56 ppc_md.progress("mpc834x_itx_setup_arch()", 0); 58 ppc_md.progress("mpc834x_itx_setup_arch()", 0);
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 8aa9a93e2aa2..10394b2d7e7a 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -120,7 +120,9 @@ static int mpc834x_usb_cfg(void)
120 */ 120 */
121static void __init mpc834x_mds_setup_arch(void) 121static void __init mpc834x_mds_setup_arch(void)
122{ 122{
123#ifdef CONFIG_PCI
123 struct device_node *np; 124 struct device_node *np;
125#endif
124 126
125 if (ppc_md.progress) 127 if (ppc_md.progress)
126 ppc_md.progress("mpc834x_mds_setup_arch()", 0); 128 ppc_md.progress("mpc834x_mds_setup_arch()", 0);
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 90877565caa3..1051702c8d4f 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -168,7 +168,7 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
168{ 168{
169 unsigned short temp; 169 unsigned short temp;
170 struct pci_controller *hose = pci_bus_to_host(dev->bus); 170 struct pci_controller *hose = pci_bus_to_host(dev->bus);
171 unsigned char irq2pin[16]; 171 unsigned char irq2pin[16], c;
172 unsigned long pirq_map_word = 0; 172 unsigned long pirq_map_word = 0;
173 u32 irq; 173 u32 irq;
174 int i; 174 int i;
@@ -288,6 +288,11 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
288 outb(0x1e, 0x4d1); 288 outb(0x1e, 0x4d1);
289 289
290#undef ULI1575_SET_DEV_IRQ 290#undef ULI1575_SET_DEV_IRQ
291
292 /* Disable the HD interface and enable the AC97 interface. */
293 pci_read_config_byte(dev, 0xb8, &c);
294 c &= 0x7f;
295 pci_write_config_byte(dev, 0xb8, c);
291} 296}
292 297
293static void __devinit quirk_uli5288(struct pci_dev *dev) 298static void __devinit quirk_uli5288(struct pci_dev *dev)
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c
index d1adf34cd5e8..e9ac19c4bba4 100644
--- a/arch/powerpc/platforms/celleb/pci.c
+++ b/arch/powerpc/platforms/celleb/pci.c
@@ -457,6 +457,7 @@ int __devinit celleb_setup_phb(struct pci_controller *phb)
457 457
458 pr_debug("PCI: celleb_setup_phb() %s\n", name); 458 pr_debug("PCI: celleb_setup_phb() %s\n", name);
459 phb_set_bus_ranges(dev, phb); 459 phb_set_bus_ranges(dev, phb);
460 phb->buid = 1;
460 461
461 if (strcmp(name, "epci") == 0) { 462 if (strcmp(name, "epci") == 0) {
462 phb->ops = &celleb_epci_ops; 463 phb->ops = &celleb_epci_ops;
diff --git a/arch/powerpc/platforms/celleb/scc_epci.c b/arch/powerpc/platforms/celleb/scc_epci.c
index fb23d53eb09c..c4b011094bd6 100644
--- a/arch/powerpc/platforms/celleb/scc_epci.c
+++ b/arch/powerpc/platforms/celleb/scc_epci.c
@@ -133,13 +133,13 @@ static int celleb_epci_check_abort(struct pci_controller *hose,
133} 133}
134 134
135static volatile void __iomem *celleb_epci_make_config_addr( 135static volatile void __iomem *celleb_epci_make_config_addr(
136 struct pci_bus *bus,
136 struct pci_controller *hose, 137 struct pci_controller *hose,
137 unsigned int devfn, int where) 138 unsigned int devfn, int where)
138{ 139{
139 volatile void __iomem *addr; 140 volatile void __iomem *addr;
140 struct pci_bus *bus = hose->bus;
141 141
142 if (bus->self) 142 if (bus != hose->bus)
143 addr = celleb_epci_get_epci_cfg(hose) + 143 addr = celleb_epci_get_epci_cfg(hose) +
144 (((bus->number & 0xff) << 16) 144 (((bus->number & 0xff) << 16)
145 | ((devfn & 0xff) << 8) 145 | ((devfn & 0xff) << 8)
@@ -193,7 +193,7 @@ static int celleb_epci_read_config(struct pci_bus *bus,
193 } else { 193 } else {
194 194
195 clear_and_disable_master_abort_interrupt(hose); 195 clear_and_disable_master_abort_interrupt(hose);
196 addr = celleb_epci_make_config_addr(hose, devfn, where); 196 addr = celleb_epci_make_config_addr(bus, hose, devfn, where);
197 197
198 switch (size) { 198 switch (size) {
199 case 1: 199 case 1:
@@ -257,7 +257,7 @@ static int celleb_epci_write_config(struct pci_bus *bus,
257 } else { 257 } else {
258 258
259 clear_and_disable_master_abort_interrupt(hose); 259 clear_and_disable_master_abort_interrupt(hose);
260 addr = celleb_epci_make_config_addr(hose, devfn, where); 260 addr = celleb_epci_make_config_addr(bus, hose, devfn, where);
261 261
262 switch (size) { 262 switch (size) {
263 case 1: 263 case 1:
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c
index 596ab2a788d4..5e9f7f163571 100644
--- a/arch/powerpc/platforms/celleb/setup.c
+++ b/arch/powerpc/platforms/celleb/setup.c
@@ -80,7 +80,7 @@ static int celleb_machine_type_hack(char *ptr)
80 return 0; 80 return 0;
81} 81}
82 82
83__setup("celleb_machine_type_hack", celleb_machine_type_hack); 83__setup("celleb_machine_type_hack=", celleb_machine_type_hack);
84 84
85static void celleb_progress(char *s, unsigned short hex) 85static void celleb_progress(char *s, unsigned short hex)
86{ 86{
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 093438b93bd9..5f3e6d8659fe 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -76,7 +76,7 @@
76 */ 76 */
77#define EEH_MAX_FAILS 2100000 77#define EEH_MAX_FAILS 2100000
78 78
79/* Time to wait for a PCI slot to retport status, in milliseconds */ 79/* Time to wait for a PCI slot to report status, in milliseconds */
80#define PCI_BUS_RESET_WAIT_MSEC (60*1000) 80#define PCI_BUS_RESET_WAIT_MSEC (60*1000)
81 81
82/* RTAS tokens */ 82/* RTAS tokens */
@@ -95,11 +95,18 @@ EXPORT_SYMBOL(eeh_subsystem_enabled);
95/* Lock to avoid races due to multiple reports of an error */ 95/* Lock to avoid races due to multiple reports of an error */
96static DEFINE_SPINLOCK(confirm_error_lock); 96static DEFINE_SPINLOCK(confirm_error_lock);
97 97
98/* Buffer for reporting slot-error-detail rtas calls */ 98/* Buffer for reporting slot-error-detail rtas calls. Its here
99 * in BSS, and not dynamically alloced, so that it ends up in
100 * RMO where RTAS can access it.
101 */
99static unsigned char slot_errbuf[RTAS_ERROR_LOG_MAX]; 102static unsigned char slot_errbuf[RTAS_ERROR_LOG_MAX];
100static DEFINE_SPINLOCK(slot_errbuf_lock); 103static DEFINE_SPINLOCK(slot_errbuf_lock);
101static int eeh_error_buf_size; 104static int eeh_error_buf_size;
102 105
106/* Buffer for reporting pci register dumps. Its here in BSS, and
107 * not dynamically alloced, so that it ends up in RMO where RTAS
108 * can access it.
109 */
103#define EEH_PCI_REGS_LOG_LEN 4096 110#define EEH_PCI_REGS_LOG_LEN 4096
104static unsigned char pci_regs_buf[EEH_PCI_REGS_LOG_LEN]; 111static unsigned char pci_regs_buf[EEH_PCI_REGS_LOG_LEN];
105 112
@@ -218,7 +225,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
218void eeh_slot_error_detail(struct pci_dn *pdn, int severity) 225void eeh_slot_error_detail(struct pci_dn *pdn, int severity)
219{ 226{
220 size_t loglen = 0; 227 size_t loglen = 0;
221 memset(pci_regs_buf, 0, EEH_PCI_REGS_LOG_LEN); 228 pci_regs_buf[0] = 0;
222 229
223 rtas_pci_enable(pdn, EEH_THAW_MMIO); 230 rtas_pci_enable(pdn, EEH_THAW_MMIO);
224 loglen = gather_pci_data(pdn, pci_regs_buf, EEH_PCI_REGS_LOG_LEN); 231 loglen = gather_pci_data(pdn, pci_regs_buf, EEH_PCI_REGS_LOG_LEN);
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
index f07d849cfc84..161a5844ab6c 100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -378,8 +378,9 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
378 378
379 /* Since rtas may enable MMIO when posting the error log, 379 /* Since rtas may enable MMIO when posting the error log,
380 * don't post the error log until after all dev drivers 380 * don't post the error log until after all dev drivers
381 * have been informed. */ 381 * have been informed.
382 eeh_slot_error_detail(frozen_pdn, 1 /* Temporary Error */); 382 */
383 eeh_slot_error_detail(frozen_pdn, EEH_LOG_TEMP_FAILURE);
383 384
384 /* If all device drivers were EEH-unaware, then shut 385 /* If all device drivers were EEH-unaware, then shut
385 * down all of the device drivers, and hope they 386 * down all of the device drivers, and hope they
@@ -470,7 +471,7 @@ hard_fail:
470 location, drv_str, pci_str); 471 location, drv_str, pci_str);
471 472
472perm_error: 473perm_error:
473 eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */); 474 eeh_slot_error_detail(frozen_pdn, EEH_LOG_PERM_FAILURE);
474 475
475 /* Notify all devices that they're about to go down. */ 476 /* Notify all devices that they're about to go down. */
476 pci_walk_bus(frozen_bus, eeh_report_failure, NULL); 477 pci_walk_bus(frozen_bus, eeh_report_failure, NULL);
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index eec684a8e44e..be17d2395072 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -520,7 +520,6 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
520 dev->dev.archdata.dma_data = PCI_DN(pdn)->iommu_table; 520 dev->dev.archdata.dma_data = PCI_DN(pdn)->iommu_table;
521 return; 521 return;
522 } 522 }
523 DBG(" found DMA window, table: %p\n", pci->iommu_table);
524 523
525 pci = PCI_DN(pdn); 524 pci = PCI_DN(pdn);
526 if (!pci->iommu_table) { 525 if (!pci->iommu_table) {
@@ -534,6 +533,8 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
534 533
535 pci->iommu_table = iommu_init_table(tbl, pci->phb->node); 534 pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
536 DBG(" created table: %p\n", pci->iommu_table); 535 DBG(" created table: %p\n", pci->iommu_table);
536 } else {
537 DBG(" found DMA window, table: %p\n", pci->iommu_table);
537 } 538 }
538 539
539 dev->dev.archdata.dma_data = pci->iommu_table; 540 dev->dev.archdata.dma_data = pci->iommu_table;
diff --git a/arch/powerpc/platforms/pseries/kexec.c b/arch/powerpc/platforms/pseries/kexec.c
index af2685607458..412a5e7aff2d 100644
--- a/arch/powerpc/platforms/pseries/kexec.c
+++ b/arch/powerpc/platforms/pseries/kexec.c
@@ -12,6 +12,7 @@
12#include <asm/firmware.h> 12#include <asm/firmware.h>
13#include <asm/kexec.h> 13#include <asm/kexec.h>
14#include <asm/mpic.h> 14#include <asm/mpic.h>
15#include <asm/smp.h>
15 16
16#include "pseries.h" 17#include "pseries.h"
17#include "xics.h" 18#include "xics.h"
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index 9b4fafd9a840..4f67b89ba1d0 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -330,7 +330,7 @@ void m8xx_cpm_dpinit(void)
330 * with the processor and the microcode patches applied / activated. 330 * with the processor and the microcode patches applied / activated.
331 * But the following should be at least safe. 331 * But the following should be at least safe.
332 */ 332 */
333 rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE); 333 rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
334} 334}
335 335
336/* 336/*
@@ -338,9 +338,9 @@ void m8xx_cpm_dpinit(void)
338 * This function returns an offset into the DPRAM area. 338 * This function returns an offset into the DPRAM area.
339 * Use cpm_dpram_addr() to get the virtual address of the area. 339 * Use cpm_dpram_addr() to get the virtual address of the area.
340 */ 340 */
341uint cpm_dpalloc(uint size, uint align) 341unsigned long cpm_dpalloc(uint size, uint align)
342{ 342{
343 void *start; 343 unsigned long start;
344 unsigned long flags; 344 unsigned long flags;
345 345
346 spin_lock_irqsave(&cpm_dpmem_lock, flags); 346 spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -352,30 +352,30 @@ uint cpm_dpalloc(uint size, uint align)
352} 352}
353EXPORT_SYMBOL(cpm_dpalloc); 353EXPORT_SYMBOL(cpm_dpalloc);
354 354
355int cpm_dpfree(uint offset) 355int cpm_dpfree(unsigned long offset)
356{ 356{
357 int ret; 357 int ret;
358 unsigned long flags; 358 unsigned long flags;
359 359
360 spin_lock_irqsave(&cpm_dpmem_lock, flags); 360 spin_lock_irqsave(&cpm_dpmem_lock, flags);
361 ret = rh_free(&cpm_dpmem_info, (void *)offset); 361 ret = rh_free(&cpm_dpmem_info, offset);
362 spin_unlock_irqrestore(&cpm_dpmem_lock, flags); 362 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
363 363
364 return ret; 364 return ret;
365} 365}
366EXPORT_SYMBOL(cpm_dpfree); 366EXPORT_SYMBOL(cpm_dpfree);
367 367
368uint cpm_dpalloc_fixed(uint offset, uint size, uint align) 368unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
369{ 369{
370 void *start; 370 unsigned long start;
371 unsigned long flags; 371 unsigned long flags;
372 372
373 spin_lock_irqsave(&cpm_dpmem_lock, flags); 373 spin_lock_irqsave(&cpm_dpmem_lock, flags);
374 cpm_dpmem_info.alignment = align; 374 cpm_dpmem_info.alignment = align;
375 start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc"); 375 start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
376 spin_unlock_irqrestore(&cpm_dpmem_lock, flags); 376 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
377 377
378 return (uint)start; 378 return start;
379} 379}
380EXPORT_SYMBOL(cpm_dpalloc_fixed); 380EXPORT_SYMBOL(cpm_dpalloc_fixed);
381 381
@@ -385,7 +385,7 @@ void cpm_dpdump(void)
385} 385}
386EXPORT_SYMBOL(cpm_dpdump); 386EXPORT_SYMBOL(cpm_dpdump);
387 387
388void *cpm_dpram_addr(uint offset) 388void *cpm_dpram_addr(unsigned long offset)
389{ 389{
390 return (void *)(dpram_vbase + offset); 390 return (void *)(dpram_vbase + offset);
391} 391}
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index ec265995d5d8..924412974795 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -248,15 +248,14 @@ static void cpm2_dpinit(void)
248 * varies with the processor and the microcode patches activated. 248 * varies with the processor and the microcode patches activated.
249 * But the following should be at least safe. 249 * But the following should be at least safe.
250 */ 250 */
251 rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE, 251 rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
252 CPM_DATAONLY_SIZE);
253} 252}
254 253
255/* This function returns an index into the DPRAM area. 254/* This function returns an index into the DPRAM area.
256 */ 255 */
257uint cpm_dpalloc(uint size, uint align) 256unsigned long cpm_dpalloc(uint size, uint align)
258{ 257{
259 void *start; 258 unsigned long start;
260 unsigned long flags; 259 unsigned long flags;
261 260
262 spin_lock_irqsave(&cpm_dpmem_lock, flags); 261 spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -268,13 +267,13 @@ uint cpm_dpalloc(uint size, uint align)
268} 267}
269EXPORT_SYMBOL(cpm_dpalloc); 268EXPORT_SYMBOL(cpm_dpalloc);
270 269
271int cpm_dpfree(uint offset) 270int cpm_dpfree(unsigned long offset)
272{ 271{
273 int ret; 272 int ret;
274 unsigned long flags; 273 unsigned long flags;
275 274
276 spin_lock_irqsave(&cpm_dpmem_lock, flags); 275 spin_lock_irqsave(&cpm_dpmem_lock, flags);
277 ret = rh_free(&cpm_dpmem_info, (void *)offset); 276 ret = rh_free(&cpm_dpmem_info, offset);
278 spin_unlock_irqrestore(&cpm_dpmem_lock, flags); 277 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
279 278
280 return ret; 279 return ret;
@@ -282,17 +281,17 @@ int cpm_dpfree(uint offset)
282EXPORT_SYMBOL(cpm_dpfree); 281EXPORT_SYMBOL(cpm_dpfree);
283 282
284/* not sure if this is ever needed */ 283/* not sure if this is ever needed */
285uint cpm_dpalloc_fixed(uint offset, uint size, uint align) 284unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
286{ 285{
287 void *start; 286 unsigned long start;
288 unsigned long flags; 287 unsigned long flags;
289 288
290 spin_lock_irqsave(&cpm_dpmem_lock, flags); 289 spin_lock_irqsave(&cpm_dpmem_lock, flags);
291 cpm_dpmem_info.alignment = align; 290 cpm_dpmem_info.alignment = align;
292 start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc"); 291 start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
293 spin_unlock_irqrestore(&cpm_dpmem_lock, flags); 292 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
294 293
295 return (uint)start; 294 return start;
296} 295}
297EXPORT_SYMBOL(cpm_dpalloc_fixed); 296EXPORT_SYMBOL(cpm_dpalloc_fixed);
298 297
@@ -302,7 +301,7 @@ void cpm_dpdump(void)
302} 301}
303EXPORT_SYMBOL(cpm_dpdump); 302EXPORT_SYMBOL(cpm_dpdump);
304 303
305void *cpm_dpram_addr(uint offset) 304void *cpm_dpram_addr(unsigned long offset)
306{ 305{
307 return (void *)(im_dprambase + offset); 306 return (void *)(im_dprambase + offset);
308} 307}
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 7f4c07543961..90f87408b5d5 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -244,7 +244,7 @@ EXPORT_SYMBOL(qe_put_snum);
244static int qe_sdma_init(void) 244static int qe_sdma_init(void)
245{ 245{
246 struct sdma *sdma = &qe_immr->sdma; 246 struct sdma *sdma = &qe_immr->sdma;
247 u32 sdma_buf_offset; 247 unsigned long sdma_buf_offset;
248 248
249 if (!sdma) 249 if (!sdma)
250 return -ENODEV; 250 return -ENODEV;
@@ -252,10 +252,10 @@ static int qe_sdma_init(void)
252 /* allocate 2 internal temporary buffers (512 bytes size each) for 252 /* allocate 2 internal temporary buffers (512 bytes size each) for
253 * the SDMA */ 253 * the SDMA */
254 sdma_buf_offset = qe_muram_alloc(512 * 2, 4096); 254 sdma_buf_offset = qe_muram_alloc(512 * 2, 4096);
255 if (IS_MURAM_ERR(sdma_buf_offset)) 255 if (IS_ERR_VALUE(sdma_buf_offset))
256 return -ENOMEM; 256 return -ENOMEM;
257 257
258 out_be32(&sdma->sdebcr, sdma_buf_offset & QE_SDEBCR_BA_MASK); 258 out_be32(&sdma->sdebcr, (u32) sdma_buf_offset & QE_SDEBCR_BA_MASK);
259 out_be32(&sdma->sdmr, (QE_SDMR_GLB_1_MSK | 259 out_be32(&sdma->sdmr, (QE_SDMR_GLB_1_MSK |
260 (0x1 << QE_SDMR_CEN_SHIFT))); 260 (0x1 << QE_SDMR_CEN_SHIFT)));
261 261
@@ -291,33 +291,32 @@ static void qe_muram_init(void)
291 if ((np = of_find_node_by_name(NULL, "data-only")) != NULL) { 291 if ((np = of_find_node_by_name(NULL, "data-only")) != NULL) {
292 address = *of_get_address(np, 0, &size, &flags); 292 address = *of_get_address(np, 0, &size, &flags);
293 of_node_put(np); 293 of_node_put(np);
294 rh_attach_region(&qe_muram_info, 294 rh_attach_region(&qe_muram_info, address, (int) size);
295 (void *)address, (int)size);
296 } 295 }
297} 296}
298 297
299/* This function returns an index into the MURAM area. 298/* This function returns an index into the MURAM area.
300 */ 299 */
301u32 qe_muram_alloc(u32 size, u32 align) 300unsigned long qe_muram_alloc(int size, int align)
302{ 301{
303 void *start; 302 unsigned long start;
304 unsigned long flags; 303 unsigned long flags;
305 304
306 spin_lock_irqsave(&qe_muram_lock, flags); 305 spin_lock_irqsave(&qe_muram_lock, flags);
307 start = rh_alloc_align(&qe_muram_info, size, align, "QE"); 306 start = rh_alloc_align(&qe_muram_info, size, align, "QE");
308 spin_unlock_irqrestore(&qe_muram_lock, flags); 307 spin_unlock_irqrestore(&qe_muram_lock, flags);
309 308
310 return (u32) start; 309 return start;
311} 310}
312EXPORT_SYMBOL(qe_muram_alloc); 311EXPORT_SYMBOL(qe_muram_alloc);
313 312
314int qe_muram_free(u32 offset) 313int qe_muram_free(unsigned long offset)
315{ 314{
316 int ret; 315 int ret;
317 unsigned long flags; 316 unsigned long flags;
318 317
319 spin_lock_irqsave(&qe_muram_lock, flags); 318 spin_lock_irqsave(&qe_muram_lock, flags);
320 ret = rh_free(&qe_muram_info, (void *)offset); 319 ret = rh_free(&qe_muram_info, offset);
321 spin_unlock_irqrestore(&qe_muram_lock, flags); 320 spin_unlock_irqrestore(&qe_muram_lock, flags);
322 321
323 return ret; 322 return ret;
@@ -325,16 +324,16 @@ int qe_muram_free(u32 offset)
325EXPORT_SYMBOL(qe_muram_free); 324EXPORT_SYMBOL(qe_muram_free);
326 325
327/* not sure if this is ever needed */ 326/* not sure if this is ever needed */
328u32 qe_muram_alloc_fixed(u32 offset, u32 size) 327unsigned long qe_muram_alloc_fixed(unsigned long offset, int size)
329{ 328{
330 void *start; 329 unsigned long start;
331 unsigned long flags; 330 unsigned long flags;
332 331
333 spin_lock_irqsave(&qe_muram_lock, flags); 332 spin_lock_irqsave(&qe_muram_lock, flags);
334 start = rh_alloc_fixed(&qe_muram_info, (void *)offset, size, "commproc"); 333 start = rh_alloc_fixed(&qe_muram_info, offset, size, "commproc");
335 spin_unlock_irqrestore(&qe_muram_lock, flags); 334 spin_unlock_irqrestore(&qe_muram_lock, flags);
336 335
337 return (u32) start; 336 return start;
338} 337}
339EXPORT_SYMBOL(qe_muram_alloc_fixed); 338EXPORT_SYMBOL(qe_muram_alloc_fixed);
340 339
@@ -344,7 +343,7 @@ void qe_muram_dump(void)
344} 343}
345EXPORT_SYMBOL(qe_muram_dump); 344EXPORT_SYMBOL(qe_muram_dump);
346 345
347void *qe_muram_addr(u32 offset) 346void *qe_muram_addr(unsigned long offset)
348{ 347{
349 return (void *)&qe_immr->muram[offset]; 348 return (void *)&qe_immr->muram[offset];
350} 349}
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
index 66137bf2dfb0..9143236853fc 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
@@ -18,6 +18,7 @@
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/stddef.h> 19#include <linux/stddef.h>
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/err.h>
21 22
22#include <asm/io.h> 23#include <asm/io.h>
23#include <asm/immap_qe.h> 24#include <asm/immap_qe.h>
@@ -268,7 +269,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
268 /* Allocate memory for Tx Virtual Fifo */ 269 /* Allocate memory for Tx Virtual Fifo */
269 uccf->ucc_fast_tx_virtual_fifo_base_offset = 270 uccf->ucc_fast_tx_virtual_fifo_base_offset =
270 qe_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT); 271 qe_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
271 if (IS_MURAM_ERR(uccf->ucc_fast_tx_virtual_fifo_base_offset)) { 272 if (IS_ERR_VALUE(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
272 printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO", __FUNCTION__); 273 printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO", __FUNCTION__);
273 uccf->ucc_fast_tx_virtual_fifo_base_offset = 0; 274 uccf->ucc_fast_tx_virtual_fifo_base_offset = 0;
274 ucc_fast_free(uccf); 275 ucc_fast_free(uccf);
@@ -280,7 +281,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
280 qe_muram_alloc(uf_info->urfs + 281 qe_muram_alloc(uf_info->urfs +
281 UCC_FAST_RECEIVE_VIRTUAL_FIFO_SIZE_FUDGE_FACTOR, 282 UCC_FAST_RECEIVE_VIRTUAL_FIFO_SIZE_FUDGE_FACTOR,
282 UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT); 283 UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
283 if (IS_MURAM_ERR(uccf->ucc_fast_rx_virtual_fifo_base_offset)) { 284 if (IS_ERR_VALUE(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
284 printk(KERN_ERR "%s: cannot allocate MURAM for RX FIFO", __FUNCTION__); 285 printk(KERN_ERR "%s: cannot allocate MURAM for RX FIFO", __FUNCTION__);
285 uccf->ucc_fast_rx_virtual_fifo_base_offset = 0; 286 uccf->ucc_fast_rx_virtual_fifo_base_offset = 0;
286 ucc_fast_free(uccf); 287 ucc_fast_free(uccf);
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
index b930d686a4d1..1f65c26ce63f 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
@@ -18,6 +18,7 @@
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/stddef.h> 19#include <linux/stddef.h>
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/err.h>
21 22
22#include <asm/io.h> 23#include <asm/io.h>
23#include <asm/immap_qe.h> 24#include <asm/immap_qe.h>
@@ -175,7 +176,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
175 /* Get PRAM base */ 176 /* Get PRAM base */
176 uccs->us_pram_offset = 177 uccs->us_pram_offset =
177 qe_muram_alloc(UCC_SLOW_PRAM_SIZE, ALIGNMENT_OF_UCC_SLOW_PRAM); 178 qe_muram_alloc(UCC_SLOW_PRAM_SIZE, ALIGNMENT_OF_UCC_SLOW_PRAM);
178 if (IS_MURAM_ERR(uccs->us_pram_offset)) { 179 if (IS_ERR_VALUE(uccs->us_pram_offset)) {
179 printk(KERN_ERR "%s: cannot allocate MURAM for PRAM", __FUNCTION__); 180 printk(KERN_ERR "%s: cannot allocate MURAM for PRAM", __FUNCTION__);
180 ucc_slow_free(uccs); 181 ucc_slow_free(uccs);
181 return -ENOMEM; 182 return -ENOMEM;
@@ -210,7 +211,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
210 uccs->rx_base_offset = 211 uccs->rx_base_offset =
211 qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd), 212 qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd),
212 QE_ALIGNMENT_OF_BD); 213 QE_ALIGNMENT_OF_BD);
213 if (IS_MURAM_ERR(uccs->rx_base_offset)) { 214 if (IS_ERR_VALUE(uccs->rx_base_offset)) {
214 printk(KERN_ERR "%s: cannot allocate RX BDs", __FUNCTION__); 215 printk(KERN_ERR "%s: cannot allocate RX BDs", __FUNCTION__);
215 uccs->rx_base_offset = 0; 216 uccs->rx_base_offset = 0;
216 ucc_slow_free(uccs); 217 ucc_slow_free(uccs);
@@ -220,7 +221,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
220 uccs->tx_base_offset = 221 uccs->tx_base_offset =
221 qe_muram_alloc(us_info->tx_bd_ring_len * sizeof(struct qe_bd), 222 qe_muram_alloc(us_info->tx_bd_ring_len * sizeof(struct qe_bd),
222 QE_ALIGNMENT_OF_BD); 223 QE_ALIGNMENT_OF_BD);
223 if (IS_MURAM_ERR(uccs->tx_base_offset)) { 224 if (IS_ERR_VALUE(uccs->tx_base_offset)) {
224 printk(KERN_ERR "%s: cannot allocate TX BDs", __FUNCTION__); 225 printk(KERN_ERR "%s: cannot allocate TX BDs", __FUNCTION__);
225 uccs->tx_base_offset = 0; 226 uccs->tx_base_offset = 0;
226 ucc_slow_free(uccs); 227 ucc_slow_free(uccs);
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 7a8722beac12..e2c6210f234b 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -402,7 +402,7 @@ void m8xx_cpm_dpinit(void)
402 * with the processor and the microcode patches applied / activated. 402 * with the processor and the microcode patches applied / activated.
403 * But the following should be at least safe. 403 * But the following should be at least safe.
404 */ 404 */
405 rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE); 405 rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
406} 406}
407 407
408/* 408/*
@@ -410,9 +410,9 @@ void m8xx_cpm_dpinit(void)
410 * This function returns an offset into the DPRAM area. 410 * This function returns an offset into the DPRAM area.
411 * Use cpm_dpram_addr() to get the virtual address of the area. 411 * Use cpm_dpram_addr() to get the virtual address of the area.
412 */ 412 */
413uint cpm_dpalloc(uint size, uint align) 413unsigned long cpm_dpalloc(uint size, uint align)
414{ 414{
415 void *start; 415 unsigned long start;
416 unsigned long flags; 416 unsigned long flags;
417 417
418 spin_lock_irqsave(&cpm_dpmem_lock, flags); 418 spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -420,34 +420,34 @@ uint cpm_dpalloc(uint size, uint align)
420 start = rh_alloc(&cpm_dpmem_info, size, "commproc"); 420 start = rh_alloc(&cpm_dpmem_info, size, "commproc");
421 spin_unlock_irqrestore(&cpm_dpmem_lock, flags); 421 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
422 422
423 return (uint)start; 423 return start;
424} 424}
425EXPORT_SYMBOL(cpm_dpalloc); 425EXPORT_SYMBOL(cpm_dpalloc);
426 426
427int cpm_dpfree(uint offset) 427int cpm_dpfree(unsigned long offset)
428{ 428{
429 int ret; 429 int ret;
430 unsigned long flags; 430 unsigned long flags;
431 431
432 spin_lock_irqsave(&cpm_dpmem_lock, flags); 432 spin_lock_irqsave(&cpm_dpmem_lock, flags);
433 ret = rh_free(&cpm_dpmem_info, (void *)offset); 433 ret = rh_free(&cpm_dpmem_info, offset);
434 spin_unlock_irqrestore(&cpm_dpmem_lock, flags); 434 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
435 435
436 return ret; 436 return ret;
437} 437}
438EXPORT_SYMBOL(cpm_dpfree); 438EXPORT_SYMBOL(cpm_dpfree);
439 439
440uint cpm_dpalloc_fixed(uint offset, uint size, uint align) 440unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
441{ 441{
442 void *start; 442 unsigned long start;
443 unsigned long flags; 443 unsigned long flags;
444 444
445 spin_lock_irqsave(&cpm_dpmem_lock, flags); 445 spin_lock_irqsave(&cpm_dpmem_lock, flags);
446 cpm_dpmem_info.alignment = align; 446 cpm_dpmem_info.alignment = align;
447 start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc"); 447 start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
448 spin_unlock_irqrestore(&cpm_dpmem_lock, flags); 448 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
449 449
450 return (uint)start; 450 return start;
451} 451}
452EXPORT_SYMBOL(cpm_dpalloc_fixed); 452EXPORT_SYMBOL(cpm_dpalloc_fixed);
453 453
@@ -457,7 +457,7 @@ void cpm_dpdump(void)
457} 457}
458EXPORT_SYMBOL(cpm_dpdump); 458EXPORT_SYMBOL(cpm_dpdump);
459 459
460void *cpm_dpram_addr(uint offset) 460void *cpm_dpram_addr(unsigned long offset)
461{ 461{
462 return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset; 462 return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset;
463} 463}
diff --git a/arch/ppc/lib/Makefile b/arch/ppc/lib/Makefile
index 422bef9bae7b..095e661e79dd 100644
--- a/arch/ppc/lib/Makefile
+++ b/arch/ppc/lib/Makefile
@@ -3,6 +3,3 @@
3# 3#
4 4
5obj-y := checksum.o string.o div64.o 5obj-y := checksum.o string.o div64.o
6
7obj-$(CONFIG_8xx) += rheap.o
8obj-$(CONFIG_CPM2) += rheap.o
diff --git a/arch/ppc/lib/rheap.c b/arch/ppc/lib/rheap.c
deleted file mode 100644
index d40700795a9c..000000000000
--- a/arch/ppc/lib/rheap.c
+++ /dev/null
@@ -1,692 +0,0 @@
1/*
2 * A Remote Heap. Remote means that we don't touch the memory that the
3 * heap points to. Normal heap implementations use the memory they manage
4 * to place their list. We cannot do that because the memory we manage may
5 * have special properties, for example it is uncachable or of different
6 * endianess.
7 *
8 * Author: Pantelis Antoniou <panto@intracom.gr>
9 *
10 * 2004 (c) INTRACOM S.A. Greece. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15#include <linux/types.h>
16#include <linux/errno.h>
17#include <linux/kernel.h>
18#include <linux/mm.h>
19#include <linux/slab.h>
20
21#include <asm/rheap.h>
22
23/*
24 * Fixup a list_head, needed when copying lists. If the pointers fall
25 * between s and e, apply the delta. This assumes that
26 * sizeof(struct list_head *) == sizeof(unsigned long *).
27 */
28static inline void fixup(unsigned long s, unsigned long e, int d,
29 struct list_head *l)
30{
31 unsigned long *pp;
32
33 pp = (unsigned long *)&l->next;
34 if (*pp >= s && *pp < e)
35 *pp += d;
36
37 pp = (unsigned long *)&l->prev;
38 if (*pp >= s && *pp < e)
39 *pp += d;
40}
41
42/* Grow the allocated blocks */
43static int grow(rh_info_t * info, int max_blocks)
44{
45 rh_block_t *block, *blk;
46 int i, new_blocks;
47 int delta;
48 unsigned long blks, blke;
49
50 if (max_blocks <= info->max_blocks)
51 return -EINVAL;
52
53 new_blocks = max_blocks - info->max_blocks;
54
55 block = kmalloc(sizeof(rh_block_t) * max_blocks, GFP_KERNEL);
56 if (block == NULL)
57 return -ENOMEM;
58
59 if (info->max_blocks > 0) {
60
61 /* copy old block area */
62 memcpy(block, info->block,
63 sizeof(rh_block_t) * info->max_blocks);
64
65 delta = (char *)block - (char *)info->block;
66
67 /* and fixup list pointers */
68 blks = (unsigned long)info->block;
69 blke = (unsigned long)(info->block + info->max_blocks);
70
71 for (i = 0, blk = block; i < info->max_blocks; i++, blk++)
72 fixup(blks, blke, delta, &blk->list);
73
74 fixup(blks, blke, delta, &info->empty_list);
75 fixup(blks, blke, delta, &info->free_list);
76 fixup(blks, blke, delta, &info->taken_list);
77
78 /* free the old allocated memory */
79 if ((info->flags & RHIF_STATIC_BLOCK) == 0)
80 kfree(info->block);
81 }
82
83 info->block = block;
84 info->empty_slots += new_blocks;
85 info->max_blocks = max_blocks;
86 info->flags &= ~RHIF_STATIC_BLOCK;
87
88 /* add all new blocks to the free list */
89 for (i = 0, blk = block + info->max_blocks; i < new_blocks; i++, blk++)
90 list_add(&blk->list, &info->empty_list);
91
92 return 0;
93}
94
95/*
96 * Assure at least the required amount of empty slots. If this function
97 * causes a grow in the block area then all pointers kept to the block
98 * area are invalid!
99 */
100static int assure_empty(rh_info_t * info, int slots)
101{
102 int max_blocks;
103
104 /* This function is not meant to be used to grow uncontrollably */
105 if (slots >= 4)
106 return -EINVAL;
107
108 /* Enough space */
109 if (info->empty_slots >= slots)
110 return 0;
111
112 /* Next 16 sized block */
113 max_blocks = ((info->max_blocks + slots) + 15) & ~15;
114
115 return grow(info, max_blocks);
116}
117
118static rh_block_t *get_slot(rh_info_t * info)
119{
120 rh_block_t *blk;
121
122 /* If no more free slots, and failure to extend. */
123 /* XXX: You should have called assure_empty before */
124 if (info->empty_slots == 0) {
125 printk(KERN_ERR "rh: out of slots; crash is imminent.\n");
126 return NULL;
127 }
128
129 /* Get empty slot to use */
130 blk = list_entry(info->empty_list.next, rh_block_t, list);
131 list_del_init(&blk->list);
132 info->empty_slots--;
133
134 /* Initialize */
135 blk->start = NULL;
136 blk->size = 0;
137 blk->owner = NULL;
138
139 return blk;
140}
141
142static inline void release_slot(rh_info_t * info, rh_block_t * blk)
143{
144 list_add(&blk->list, &info->empty_list);
145 info->empty_slots++;
146}
147
148static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
149{
150 rh_block_t *blk;
151 rh_block_t *before;
152 rh_block_t *after;
153 rh_block_t *next;
154 int size;
155 unsigned long s, e, bs, be;
156 struct list_head *l;
157
158 /* We assume that they are aligned properly */
159 size = blkn->size;
160 s = (unsigned long)blkn->start;
161 e = s + size;
162
163 /* Find the blocks immediately before and after the given one
164 * (if any) */
165 before = NULL;
166 after = NULL;
167 next = NULL;
168
169 list_for_each(l, &info->free_list) {
170 blk = list_entry(l, rh_block_t, list);
171
172 bs = (unsigned long)blk->start;
173 be = bs + blk->size;
174
175 if (next == NULL && s >= bs)
176 next = blk;
177
178 if (be == s)
179 before = blk;
180
181 if (e == bs)
182 after = blk;
183
184 /* If both are not null, break now */
185 if (before != NULL && after != NULL)
186 break;
187 }
188
189 /* Now check if they are really adjacent */
190 if (before != NULL && s != (unsigned long)before->start + before->size)
191 before = NULL;
192
193 if (after != NULL && e != (unsigned long)after->start)
194 after = NULL;
195
196 /* No coalescing; list insert and return */
197 if (before == NULL && after == NULL) {
198
199 if (next != NULL)
200 list_add(&blkn->list, &next->list);
201 else
202 list_add(&blkn->list, &info->free_list);
203
204 return;
205 }
206
207 /* We don't need it anymore */
208 release_slot(info, blkn);
209
210 /* Grow the before block */
211 if (before != NULL && after == NULL) {
212 before->size += size;
213 return;
214 }
215
216 /* Grow the after block backwards */
217 if (before == NULL && after != NULL) {
218 after->start = (int8_t *)after->start - size;
219 after->size += size;
220 return;
221 }
222
223 /* Grow the before block, and release the after block */
224 before->size += size + after->size;
225 list_del(&after->list);
226 release_slot(info, after);
227}
228
229static void attach_taken_block(rh_info_t * info, rh_block_t * blkn)
230{
231 rh_block_t *blk;
232 struct list_head *l;
233
234 /* Find the block immediately before the given one (if any) */
235 list_for_each(l, &info->taken_list) {
236 blk = list_entry(l, rh_block_t, list);
237 if (blk->start > blkn->start) {
238 list_add_tail(&blkn->list, &blk->list);
239 return;
240 }
241 }
242
243 list_add_tail(&blkn->list, &info->taken_list);
244}
245
246/*
247 * Create a remote heap dynamically. Note that no memory for the blocks
248 * are allocated. It will upon the first allocation
249 */
250rh_info_t *rh_create(unsigned int alignment)
251{
252 rh_info_t *info;
253
254 /* Alignment must be a power of two */
255 if ((alignment & (alignment - 1)) != 0)
256 return ERR_PTR(-EINVAL);
257
258 info = kmalloc(sizeof(*info), GFP_KERNEL);
259 if (info == NULL)
260 return ERR_PTR(-ENOMEM);
261
262 info->alignment = alignment;
263
264 /* Initially everything as empty */
265 info->block = NULL;
266 info->max_blocks = 0;
267 info->empty_slots = 0;
268 info->flags = 0;
269
270 INIT_LIST_HEAD(&info->empty_list);
271 INIT_LIST_HEAD(&info->free_list);
272 INIT_LIST_HEAD(&info->taken_list);
273
274 return info;
275}
276
277/*
278 * Destroy a dynamically created remote heap. Deallocate only if the areas
279 * are not static
280 */
281void rh_destroy(rh_info_t * info)
282{
283 if ((info->flags & RHIF_STATIC_BLOCK) == 0 && info->block != NULL)
284 kfree(info->block);
285
286 if ((info->flags & RHIF_STATIC_INFO) == 0)
287 kfree(info);
288}
289
290/*
291 * Initialize in place a remote heap info block. This is needed to support
292 * operation very early in the startup of the kernel, when it is not yet safe
293 * to call kmalloc.
294 */
295void rh_init(rh_info_t * info, unsigned int alignment, int max_blocks,
296 rh_block_t * block)
297{
298 int i;
299 rh_block_t *blk;
300
301 /* Alignment must be a power of two */
302 if ((alignment & (alignment - 1)) != 0)
303 return;
304
305 info->alignment = alignment;
306
307 /* Initially everything as empty */
308 info->block = block;
309 info->max_blocks = max_blocks;
310 info->empty_slots = max_blocks;
311 info->flags = RHIF_STATIC_INFO | RHIF_STATIC_BLOCK;
312
313 INIT_LIST_HEAD(&info->empty_list);
314 INIT_LIST_HEAD(&info->free_list);
315 INIT_LIST_HEAD(&info->taken_list);
316
317 /* Add all new blocks to the free list */
318 for (i = 0, blk = block; i < max_blocks; i++, blk++)
319 list_add(&blk->list, &info->empty_list);
320}
321
322/* Attach a free memory region, coalesces regions if adjuscent */
323int rh_attach_region(rh_info_t * info, void *start, int size)
324{
325 rh_block_t *blk;
326 unsigned long s, e, m;
327 int r;
328
329 /* The region must be aligned */
330 s = (unsigned long)start;
331 e = s + size;
332 m = info->alignment - 1;
333
334 /* Round start up */
335 s = (s + m) & ~m;
336
337 /* Round end down */
338 e = e & ~m;
339
340 /* Take final values */
341 start = (void *)s;
342 size = (int)(e - s);
343
344 /* Grow the blocks, if needed */
345 r = assure_empty(info, 1);
346 if (r < 0)
347 return r;
348
349 blk = get_slot(info);
350 blk->start = start;
351 blk->size = size;
352 blk->owner = NULL;
353
354 attach_free_block(info, blk);
355
356 return 0;
357}
358
359/* Detatch given address range, splits free block if needed. */
360void *rh_detach_region(rh_info_t * info, void *start, int size)
361{
362 struct list_head *l;
363 rh_block_t *blk, *newblk;
364 unsigned long s, e, m, bs, be;
365
366 /* Validate size */
367 if (size <= 0)
368 return ERR_PTR(-EINVAL);
369
370 /* The region must be aligned */
371 s = (unsigned long)start;
372 e = s + size;
373 m = info->alignment - 1;
374
375 /* Round start up */
376 s = (s + m) & ~m;
377
378 /* Round end down */
379 e = e & ~m;
380
381 if (assure_empty(info, 1) < 0)
382 return ERR_PTR(-ENOMEM);
383
384 blk = NULL;
385 list_for_each(l, &info->free_list) {
386 blk = list_entry(l, rh_block_t, list);
387 /* The range must lie entirely inside one free block */
388 bs = (unsigned long)blk->start;
389 be = (unsigned long)blk->start + blk->size;
390 if (s >= bs && e <= be)
391 break;
392 blk = NULL;
393 }
394
395 if (blk == NULL)
396 return ERR_PTR(-ENOMEM);
397
398 /* Perfect fit */
399 if (bs == s && be == e) {
400 /* Delete from free list, release slot */
401 list_del(&blk->list);
402 release_slot(info, blk);
403 return (void *)s;
404 }
405
406 /* blk still in free list, with updated start and/or size */
407 if (bs == s || be == e) {
408 if (bs == s)
409 blk->start = (int8_t *)blk->start + size;
410 blk->size -= size;
411
412 } else {
413 /* The front free fragment */
414 blk->size = s - bs;
415
416 /* the back free fragment */
417 newblk = get_slot(info);
418 newblk->start = (void *)e;
419 newblk->size = be - e;
420
421 list_add(&newblk->list, &blk->list);
422 }
423
424 return (void *)s;
425}
426
427void *rh_alloc(rh_info_t * info, int size, const char *owner)
428{
429 struct list_head *l;
430 rh_block_t *blk;
431 rh_block_t *newblk;
432 void *start;
433
434 /* Validate size */
435 if (size <= 0)
436 return ERR_PTR(-EINVAL);
437
438 /* Align to configured alignment */
439 size = (size + (info->alignment - 1)) & ~(info->alignment - 1);
440
441 if (assure_empty(info, 1) < 0)
442 return ERR_PTR(-ENOMEM);
443
444 blk = NULL;
445 list_for_each(l, &info->free_list) {
446 blk = list_entry(l, rh_block_t, list);
447 if (size <= blk->size)
448 break;
449 blk = NULL;
450 }
451
452 if (blk == NULL)
453 return ERR_PTR(-ENOMEM);
454
455 /* Just fits */
456 if (blk->size == size) {
457 /* Move from free list to taken list */
458 list_del(&blk->list);
459 blk->owner = owner;
460 start = blk->start;
461
462 attach_taken_block(info, blk);
463
464 return start;
465 }
466
467 newblk = get_slot(info);
468 newblk->start = blk->start;
469 newblk->size = size;
470 newblk->owner = owner;
471
472 /* blk still in free list, with updated start, size */
473 blk->start = (int8_t *)blk->start + size;
474 blk->size -= size;
475
476 start = newblk->start;
477
478 attach_taken_block(info, newblk);
479
480 return start;
481}
482
483/* allocate at precisely the given address */
484void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
485{
486 struct list_head *l;
487 rh_block_t *blk, *newblk1, *newblk2;
488 unsigned long s, e, m, bs, be;
489
490 /* Validate size */
491 if (size <= 0)
492 return ERR_PTR(-EINVAL);
493
494 /* The region must be aligned */
495 s = (unsigned long)start;
496 e = s + size;
497 m = info->alignment - 1;
498
499 /* Round start up */
500 s = (s + m) & ~m;
501
502 /* Round end down */
503 e = e & ~m;
504
505 if (assure_empty(info, 2) < 0)
506 return ERR_PTR(-ENOMEM);
507
508 blk = NULL;
509 list_for_each(l, &info->free_list) {
510 blk = list_entry(l, rh_block_t, list);
511 /* The range must lie entirely inside one free block */
512 bs = (unsigned long)blk->start;
513 be = (unsigned long)blk->start + blk->size;
514 if (s >= bs && e <= be)
515 break;
516 }
517
518 if (blk == NULL)
519 return ERR_PTR(-ENOMEM);
520
521 /* Perfect fit */
522 if (bs == s && be == e) {
523 /* Move from free list to taken list */
524 list_del(&blk->list);
525 blk->owner = owner;
526
527 start = blk->start;
528 attach_taken_block(info, blk);
529
530 return start;
531
532 }
533
534 /* blk still in free list, with updated start and/or size */
535 if (bs == s || be == e) {
536 if (bs == s)
537 blk->start = (int8_t *)blk->start + size;
538 blk->size -= size;
539
540 } else {
541 /* The front free fragment */
542 blk->size = s - bs;
543
544 /* The back free fragment */
545 newblk2 = get_slot(info);
546 newblk2->start = (void *)e;
547 newblk2->size = be - e;
548
549 list_add(&newblk2->list, &blk->list);
550 }
551
552 newblk1 = get_slot(info);
553 newblk1->start = (void *)s;
554 newblk1->size = e - s;
555 newblk1->owner = owner;
556
557 start = newblk1->start;
558 attach_taken_block(info, newblk1);
559
560 return start;
561}
562
563int rh_free(rh_info_t * info, void *start)
564{
565 rh_block_t *blk, *blk2;
566 struct list_head *l;
567 int size;
568
569 /* Linear search for block */
570 blk = NULL;
571 list_for_each(l, &info->taken_list) {
572 blk2 = list_entry(l, rh_block_t, list);
573 if (start < blk2->start)
574 break;
575 blk = blk2;
576 }
577
578 if (blk == NULL || start > (blk->start + blk->size))
579 return -EINVAL;
580
581 /* Remove from taken list */
582 list_del(&blk->list);
583
584 /* Get size of freed block */
585 size = blk->size;
586 attach_free_block(info, blk);
587
588 return size;
589}
590
591int rh_get_stats(rh_info_t * info, int what, int max_stats, rh_stats_t * stats)
592{
593 rh_block_t *blk;
594 struct list_head *l;
595 struct list_head *h;
596 int nr;
597
598 switch (what) {
599
600 case RHGS_FREE:
601 h = &info->free_list;
602 break;
603
604 case RHGS_TAKEN:
605 h = &info->taken_list;
606 break;
607
608 default:
609 return -EINVAL;
610 }
611
612 /* Linear search for block */
613 nr = 0;
614 list_for_each(l, h) {
615 blk = list_entry(l, rh_block_t, list);
616 if (stats != NULL && nr < max_stats) {
617 stats->start = blk->start;
618 stats->size = blk->size;
619 stats->owner = blk->owner;
620 stats++;
621 }
622 nr++;
623 }
624
625 return nr;
626}
627
628int rh_set_owner(rh_info_t * info, void *start, const char *owner)
629{
630 rh_block_t *blk, *blk2;
631 struct list_head *l;
632 int size;
633
634 /* Linear search for block */
635 blk = NULL;
636 list_for_each(l, &info->taken_list) {
637 blk2 = list_entry(l, rh_block_t, list);
638 if (start < blk2->start)
639 break;
640 blk = blk2;
641 }
642
643 if (blk == NULL || start > (blk->start + blk->size))
644 return -EINVAL;
645
646 blk->owner = owner;
647 size = blk->size;
648
649 return size;
650}
651
652void rh_dump(rh_info_t * info)
653{
654 static rh_stats_t st[32]; /* XXX maximum 32 blocks */
655 int maxnr;
656 int i, nr;
657
658 maxnr = ARRAY_SIZE(st);
659
660 printk(KERN_INFO
661 "info @0x%p (%d slots empty / %d max)\n",
662 info, info->empty_slots, info->max_blocks);
663
664 printk(KERN_INFO " Free:\n");
665 nr = rh_get_stats(info, RHGS_FREE, maxnr, st);
666 if (nr > maxnr)
667 nr = maxnr;
668 for (i = 0; i < nr; i++)
669 printk(KERN_INFO
670 " 0x%p-0x%p (%u)\n",
671 st[i].start, (int8_t *) st[i].start + st[i].size,
672 st[i].size);
673 printk(KERN_INFO "\n");
674
675 printk(KERN_INFO " Taken:\n");
676 nr = rh_get_stats(info, RHGS_TAKEN, maxnr, st);
677 if (nr > maxnr)
678 nr = maxnr;
679 for (i = 0; i < nr; i++)
680 printk(KERN_INFO
681 " 0x%p-0x%p (%u) %s\n",
682 st[i].start, (int8_t *) st[i].start + st[i].size,
683 st[i].size, st[i].owner != NULL ? st[i].owner : "");
684 printk(KERN_INFO "\n");
685}
686
687void rh_dump_blk(rh_info_t * info, rh_block_t * blk)
688{
689 printk(KERN_INFO
690 "blk @0x%p: 0x%p-0x%p (%u)\n",
691 blk, blk->start, (int8_t *) blk->start + blk->size, blk->size);
692}
diff --git a/arch/ppc/syslib/cpm2_common.c b/arch/ppc/syslib/cpm2_common.c
index cbac44b1620c..6cd859d7721f 100644
--- a/arch/ppc/syslib/cpm2_common.c
+++ b/arch/ppc/syslib/cpm2_common.c
@@ -136,15 +136,14 @@ static void cpm2_dpinit(void)
136 * varies with the processor and the microcode patches activated. 136 * varies with the processor and the microcode patches activated.
137 * But the following should be at least safe. 137 * But the following should be at least safe.
138 */ 138 */
139 rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE, 139 rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
140 CPM_DATAONLY_SIZE);
141} 140}
142 141
143/* This function returns an index into the DPRAM area. 142/* This function returns an index into the DPRAM area.
144 */ 143 */
145uint cpm_dpalloc(uint size, uint align) 144unsigned long cpm_dpalloc(uint size, uint align)
146{ 145{
147 void *start; 146 unsigned long start;
148 unsigned long flags; 147 unsigned long flags;
149 148
150 spin_lock_irqsave(&cpm_dpmem_lock, flags); 149 spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -152,17 +151,17 @@ uint cpm_dpalloc(uint size, uint align)
152 start = rh_alloc(&cpm_dpmem_info, size, "commproc"); 151 start = rh_alloc(&cpm_dpmem_info, size, "commproc");
153 spin_unlock_irqrestore(&cpm_dpmem_lock, flags); 152 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
154 153
155 return (uint)start; 154 return start;
156} 155}
157EXPORT_SYMBOL(cpm_dpalloc); 156EXPORT_SYMBOL(cpm_dpalloc);
158 157
159int cpm_dpfree(uint offset) 158int cpm_dpfree(unsigned long offset)
160{ 159{
161 int ret; 160 int ret;
162 unsigned long flags; 161 unsigned long flags;
163 162
164 spin_lock_irqsave(&cpm_dpmem_lock, flags); 163 spin_lock_irqsave(&cpm_dpmem_lock, flags);
165 ret = rh_free(&cpm_dpmem_info, (void *)offset); 164 ret = rh_free(&cpm_dpmem_info, offset);
166 spin_unlock_irqrestore(&cpm_dpmem_lock, flags); 165 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
167 166
168 return ret; 167 return ret;
@@ -170,17 +169,17 @@ int cpm_dpfree(uint offset)
170EXPORT_SYMBOL(cpm_dpfree); 169EXPORT_SYMBOL(cpm_dpfree);
171 170
172/* not sure if this is ever needed */ 171/* not sure if this is ever needed */
173uint cpm_dpalloc_fixed(uint offset, uint size, uint align) 172unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
174{ 173{
175 void *start; 174 unsigned long start;
176 unsigned long flags; 175 unsigned long flags;
177 176
178 spin_lock_irqsave(&cpm_dpmem_lock, flags); 177 spin_lock_irqsave(&cpm_dpmem_lock, flags);
179 cpm_dpmem_info.alignment = align; 178 cpm_dpmem_info.alignment = align;
180 start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc"); 179 start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
181 spin_unlock_irqrestore(&cpm_dpmem_lock, flags); 180 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
182 181
183 return (uint)start; 182 return start;
184} 183}
185EXPORT_SYMBOL(cpm_dpalloc_fixed); 184EXPORT_SYMBOL(cpm_dpalloc_fixed);
186 185
@@ -190,7 +189,7 @@ void cpm_dpdump(void)
190} 189}
191EXPORT_SYMBOL(cpm_dpdump); 190EXPORT_SYMBOL(cpm_dpdump);
192 191
193void *cpm_dpram_addr(uint offset) 192void *cpm_dpram_addr(unsigned long offset)
194{ 193{
195 return (void *)&cpm2_immr->im_dprambase[offset]; 194 return (void *)&cpm2_immr->im_dprambase[offset];
196} 195}
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 1a84719be264..098c62c29f9c 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -4,27 +4,23 @@
4# 4#
5 5
6config MMU 6config MMU
7 bool 7 def_bool y
8 default y
9 8
10config ZONE_DMA 9config ZONE_DMA
11 def_bool y 10 def_bool y
12 depends on 64BIT 11 depends on 64BIT
13 12
14config LOCKDEP_SUPPORT 13config LOCKDEP_SUPPORT
15 bool 14 def_bool y
16 default y
17 15
18config STACKTRACE_SUPPORT 16config STACKTRACE_SUPPORT
19 bool 17 def_bool y
20 default y
21 18
22config RWSEM_GENERIC_SPINLOCK 19config RWSEM_GENERIC_SPINLOCK
23 bool 20 bool
24 21
25config RWSEM_XCHGADD_ALGORITHM 22config RWSEM_XCHGADD_ALGORITHM
26 bool 23 def_bool y
27 default y
28 24
29config ARCH_HAS_ILOG2_U32 25config ARCH_HAS_ILOG2_U32
30 bool 26 bool
@@ -35,8 +31,7 @@ config ARCH_HAS_ILOG2_U64
35 default n 31 default n
36 32
37config GENERIC_HWEIGHT 33config GENERIC_HWEIGHT
38 bool 34 def_bool y
39 default y
40 35
41config GENERIC_TIME 36config GENERIC_TIME
42 def_bool y 37 def_bool y
@@ -55,8 +50,7 @@ config NO_DMA
55mainmenu "Linux Kernel Configuration" 50mainmenu "Linux Kernel Configuration"
56 51
57config S390 52config S390
58 bool 53 def_bool y
59 default y
60 54
61source "init/Kconfig" 55source "init/Kconfig"
62 56
@@ -280,6 +274,10 @@ config WARN_STACK_SIZE
280config ARCH_POPULATES_NODE_MAP 274config ARCH_POPULATES_NODE_MAP
281 def_bool y 275 def_bool y
282 276
277comment "Kernel preemption"
278
279source "kernel/Kconfig.preempt"
280
283source "mm/Kconfig" 281source "mm/Kconfig"
284 282
285config HOLES_IN_ZONE 283config HOLES_IN_ZONE
@@ -320,17 +318,6 @@ config QDIO_DEBUG
320 318
321comment "Misc" 319comment "Misc"
322 320
323config PREEMPT
324 bool "Preemptible Kernel"
325 help
326 This option reduces the latency of the kernel when reacting to
327 real-time or interactive events by allowing a low priority process to
328 be preempted even if it is in kernel mode executing a system call.
329 This allows applications to run more reliably even when the system is
330 under load.
331
332 Say N if you are unsure.
333
334config IPL 321config IPL
335 bool "Builtin IPL record support" 322 bool "Builtin IPL record support"
336 help 323 help
@@ -488,6 +475,8 @@ config APPLDATA_NET_SUM
488 This can also be compiled as a module, which will be called 475 This can also be compiled as a module, which will be called
489 appldata_net_sum.o. 476 appldata_net_sum.o.
490 477
478source kernel/Kconfig.hz
479
491config NO_IDLE_HZ 480config NO_IDLE_HZ
492 bool "No HZ timer ticks in idle" 481 bool "No HZ timer ticks in idle"
493 help 482 help
@@ -535,18 +524,12 @@ endmenu
535source "net/Kconfig" 524source "net/Kconfig"
536 525
537config PCMCIA 526config PCMCIA
538 bool 527 def_bool n
539 default n
540
541source "drivers/base/Kconfig"
542 528
543source "drivers/connector/Kconfig" 529config CCW
544 530 def_bool y
545source "drivers/scsi/Kconfig"
546
547source "drivers/s390/Kconfig"
548 531
549source "drivers/net/Kconfig" 532source "drivers/Kconfig"
550 533
551source "fs/Kconfig" 534source "fs/Kconfig"
552 535
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 0e4da8a7d826..485b60c1983c 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/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.21-rc1 3# Linux kernel version: 2.6.21
4# Wed Feb 21 10:44:30 2007 4# Thu May 10 15:18:19 2007
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_ZONE_DMA=y 7CONFIG_ZONE_DMA=y
@@ -14,6 +14,7 @@ CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_TIME=y 14CONFIG_GENERIC_TIME=y
15CONFIG_GENERIC_BUG=y 15CONFIG_GENERIC_BUG=y
16CONFIG_NO_IOMEM=y 16CONFIG_NO_IOMEM=y
17CONFIG_NO_DMA=y
17CONFIG_S390=y 18CONFIG_S390=y
18CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
19 20
@@ -41,9 +42,11 @@ CONFIG_AUDIT=y
41# CONFIG_AUDITSYSCALL is not set 42# CONFIG_AUDITSYSCALL is not set
42CONFIG_IKCONFIG=y 43CONFIG_IKCONFIG=y
43CONFIG_IKCONFIG_PROC=y 44CONFIG_IKCONFIG_PROC=y
45CONFIG_LOG_BUF_SHIFT=17
44# CONFIG_CPUSETS is not set 46# CONFIG_CPUSETS is not set
45CONFIG_SYSFS_DEPRECATED=y 47CONFIG_SYSFS_DEPRECATED=y
46# CONFIG_RELAY is not set 48# CONFIG_RELAY is not set
49CONFIG_BLK_DEV_INITRD=y
47CONFIG_INITRAMFS_SOURCE="" 50CONFIG_INITRAMFS_SOURCE=""
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 51# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
49CONFIG_SYSCTL=y 52CONFIG_SYSCTL=y
@@ -60,12 +63,14 @@ CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 63CONFIG_FUTEX=y
61CONFIG_EPOLL=y 64CONFIG_EPOLL=y
62CONFIG_SHMEM=y 65CONFIG_SHMEM=y
63CONFIG_SLAB=y
64CONFIG_VM_EVENT_COUNTERS=y 66CONFIG_VM_EVENT_COUNTERS=y
67CONFIG_SLUB_DEBUG=y
68CONFIG_SLAB=y
69# CONFIG_SLUB is not set
70# CONFIG_SLOB is not set
65CONFIG_RT_MUTEXES=y 71CONFIG_RT_MUTEXES=y
66# CONFIG_TINY_SHMEM is not set 72# CONFIG_TINY_SHMEM is not set
67CONFIG_BASE_SMALL=0 73CONFIG_BASE_SMALL=0
68# CONFIG_SLOB is not set
69 74
70# 75#
71# Loadable module support 76# Loadable module support
@@ -128,6 +133,14 @@ CONFIG_CHECK_STACK=y
128CONFIG_STACK_GUARD=256 133CONFIG_STACK_GUARD=256
129# CONFIG_WARN_STACK is not set 134# CONFIG_WARN_STACK is not set
130CONFIG_ARCH_POPULATES_NODE_MAP=y 135CONFIG_ARCH_POPULATES_NODE_MAP=y
136
137#
138# Kernel preemption
139#
140# CONFIG_PREEMPT_NONE is not set
141# CONFIG_PREEMPT_VOLUNTARY is not set
142CONFIG_PREEMPT=y
143CONFIG_PREEMPT_BKL=y
131CONFIG_SELECT_MEMORY_MODEL=y 144CONFIG_SELECT_MEMORY_MODEL=y
132CONFIG_FLATMEM_MANUAL=y 145CONFIG_FLATMEM_MANUAL=y
133# CONFIG_DISCONTIGMEM_MANUAL is not set 146# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -150,7 +163,6 @@ CONFIG_QDIO=y
150# 163#
151# Misc 164# Misc
152# 165#
153CONFIG_PREEMPT=y
154CONFIG_IPL=y 166CONFIG_IPL=y
155# CONFIG_IPL_TAPE is not set 167# CONFIG_IPL_TAPE is not set
156CONFIG_IPL_VM=y 168CONFIG_IPL_VM=y
@@ -163,6 +175,11 @@ CONFIG_PFAULT=y
163CONFIG_VIRT_TIMER=y 175CONFIG_VIRT_TIMER=y
164CONFIG_VIRT_CPU_ACCOUNTING=y 176CONFIG_VIRT_CPU_ACCOUNTING=y
165# CONFIG_APPLDATA_BASE is not set 177# CONFIG_APPLDATA_BASE is not set
178CONFIG_HZ_100=y
179# CONFIG_HZ_250 is not set
180# CONFIG_HZ_300 is not set
181# CONFIG_HZ_1000 is not set
182CONFIG_HZ=100
166CONFIG_NO_IDLE_HZ=y 183CONFIG_NO_IDLE_HZ=y
167CONFIG_NO_IDLE_HZ_INIT=y 184CONFIG_NO_IDLE_HZ_INIT=y
168CONFIG_S390_HYPFS_FS=y 185CONFIG_S390_HYPFS_FS=y
@@ -177,7 +194,6 @@ CONFIG_NET=y
177# 194#
178# Networking options 195# Networking options
179# 196#
180# CONFIG_NETDEBUG is not set
181CONFIG_PACKET=y 197CONFIG_PACKET=y
182# CONFIG_PACKET_MMAP is not set 198# CONFIG_PACKET_MMAP is not set
183CONFIG_UNIX=y 199CONFIG_UNIX=y
@@ -216,6 +232,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
216CONFIG_IPV6=y 232CONFIG_IPV6=y
217# CONFIG_IPV6_PRIVACY is not set 233# CONFIG_IPV6_PRIVACY is not set
218# CONFIG_IPV6_ROUTER_PREF is not set 234# CONFIG_IPV6_ROUTER_PREF is not set
235# CONFIG_IPV6_OPTIMISTIC_DAD is not set
219# CONFIG_INET6_AH is not set 236# CONFIG_INET6_AH is not set
220# CONFIG_INET6_ESP is not set 237# CONFIG_INET6_ESP is not set
221# CONFIG_INET6_IPCOMP is not set 238# CONFIG_INET6_IPCOMP is not set
@@ -240,7 +257,12 @@ CONFIG_IPV6_SIT=y
240# 257#
241# SCTP Configuration (EXPERIMENTAL) 258# SCTP Configuration (EXPERIMENTAL)
242# 259#
243# CONFIG_IP_SCTP is not set 260CONFIG_IP_SCTP=m
261# CONFIG_SCTP_DBG_MSG is not set
262# CONFIG_SCTP_DBG_OBJCNT is not set
263# CONFIG_SCTP_HMAC_NONE is not set
264# CONFIG_SCTP_HMAC_SHA1 is not set
265CONFIG_SCTP_HMAC_MD5=y
244 266
245# 267#
246# TIPC Configuration (EXPERIMENTAL) 268# TIPC Configuration (EXPERIMENTAL)
@@ -263,9 +285,6 @@ CONFIG_IPV6_SIT=y
263# 285#
264CONFIG_NET_SCHED=y 286CONFIG_NET_SCHED=y
265CONFIG_NET_SCH_FIFO=y 287CONFIG_NET_SCH_FIFO=y
266CONFIG_NET_SCH_CLK_JIFFIES=y
267# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
268# CONFIG_NET_SCH_CLK_CPU is not set
269 288
270# 289#
271# Queueing/Scheduling 290# Queueing/Scheduling
@@ -308,11 +327,14 @@ CONFIG_NET_ESTIMATOR=y
308# 327#
309# CONFIG_NET_PKTGEN is not set 328# CONFIG_NET_PKTGEN is not set
310# CONFIG_NET_TCPPROBE is not set 329# CONFIG_NET_TCPPROBE is not set
311# CONFIG_HAMRADIO is not set 330# CONFIG_AF_RXRPC is not set
312# CONFIG_IRDA is not set 331# CONFIG_RFKILL is not set
313# CONFIG_BT is not set
314# CONFIG_IEEE80211 is not set
315# CONFIG_PCMCIA is not set 332# CONFIG_PCMCIA is not set
333CONFIG_CCW=y
334
335#
336# Device Drivers
337#
316 338
317# 339#
318# Generic Driver Options 340# Generic Driver Options
@@ -330,6 +352,37 @@ CONFIG_SYS_HYPERVISOR=y
330# CONFIG_CONNECTOR is not set 352# CONFIG_CONNECTOR is not set
331 353
332# 354#
355# Block devices
356#
357# CONFIG_BLK_DEV_COW_COMMON is not set
358CONFIG_BLK_DEV_LOOP=m
359# CONFIG_BLK_DEV_CRYPTOLOOP is not set
360CONFIG_BLK_DEV_NBD=m
361CONFIG_BLK_DEV_RAM=y
362CONFIG_BLK_DEV_RAM_COUNT=16
363CONFIG_BLK_DEV_RAM_SIZE=4096
364CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
365# CONFIG_CDROM_PKTCDVD is not set
366# CONFIG_ATA_OVER_ETH is not set
367
368#
369# S/390 block device drivers
370#
371CONFIG_BLK_DEV_XPRAM=m
372# CONFIG_DCSSBLK is not set
373CONFIG_DASD=y
374CONFIG_DASD_PROFILE=y
375CONFIG_DASD_ECKD=y
376CONFIG_DASD_FBA=y
377CONFIG_DASD_DIAG=y
378CONFIG_DASD_EER=y
379
380#
381# Misc devices
382#
383# CONFIG_BLINK is not set
384
385#
333# SCSI device support 386# SCSI device support
334# 387#
335# CONFIG_RAID_ATTRS is not set 388# CONFIG_RAID_ATTRS is not set
@@ -356,6 +409,7 @@ CONFIG_SCSI_MULTI_LUN=y
356CONFIG_SCSI_CONSTANTS=y 409CONFIG_SCSI_CONSTANTS=y
357CONFIG_SCSI_LOGGING=y 410CONFIG_SCSI_LOGGING=y
358CONFIG_SCSI_SCAN_ASYNC=y 411CONFIG_SCSI_SCAN_ASYNC=y
412CONFIG_SCSI_WAIT_SCAN=m
359 413
360# 414#
361# SCSI Transports 415# SCSI Transports
@@ -372,34 +426,6 @@ CONFIG_SCSI_FC_ATTRS=y
372# CONFIG_ISCSI_TCP is not set 426# CONFIG_ISCSI_TCP is not set
373# CONFIG_SCSI_DEBUG is not set 427# CONFIG_SCSI_DEBUG is not set
374CONFIG_ZFCP=y 428CONFIG_ZFCP=y
375CONFIG_CCW=y
376
377#
378# Block devices
379#
380# CONFIG_BLK_DEV_COW_COMMON is not set
381CONFIG_BLK_DEV_LOOP=m
382# CONFIG_BLK_DEV_CRYPTOLOOP is not set
383CONFIG_BLK_DEV_NBD=m
384CONFIG_BLK_DEV_RAM=y
385CONFIG_BLK_DEV_RAM_COUNT=16
386CONFIG_BLK_DEV_RAM_SIZE=4096
387CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
388CONFIG_BLK_DEV_INITRD=y
389# CONFIG_CDROM_PKTCDVD is not set
390
391#
392# S/390 block device drivers
393#
394CONFIG_BLK_DEV_XPRAM=m
395# CONFIG_DCSSBLK is not set
396CONFIG_DASD=y
397CONFIG_DASD_PROFILE=y
398CONFIG_DASD_ECKD=y
399CONFIG_DASD_FBA=y
400CONFIG_DASD_DIAG=y
401CONFIG_DASD_EER=y
402# CONFIG_ATA_OVER_ETH is not set
403 429
404# 430#
405# Multi-device support (RAID and LVM) 431# Multi-device support (RAID and LVM)
@@ -421,56 +447,7 @@ CONFIG_DM_MIRROR=y
421CONFIG_DM_ZERO=y 447CONFIG_DM_ZERO=y
422CONFIG_DM_MULTIPATH=y 448CONFIG_DM_MULTIPATH=y
423# CONFIG_DM_MULTIPATH_EMC is not set 449# CONFIG_DM_MULTIPATH_EMC is not set
424 450# CONFIG_DM_DELAY is not set
425#
426# Character device drivers
427#
428CONFIG_UNIX98_PTYS=y
429CONFIG_UNIX98_PTY_COUNT=2048
430# CONFIG_HANGCHECK_TIMER is not set
431
432#
433# Watchdog Cards
434#
435# CONFIG_WATCHDOG is not set
436
437#
438# S/390 character device drivers
439#
440CONFIG_TN3270=y
441CONFIG_TN3270_TTY=y
442CONFIG_TN3270_FS=m
443CONFIG_TN3270_CONSOLE=y
444CONFIG_TN3215=y
445CONFIG_TN3215_CONSOLE=y
446CONFIG_CCW_CONSOLE=y
447CONFIG_SCLP_TTY=y
448CONFIG_SCLP_CONSOLE=y
449CONFIG_SCLP_VT220_TTY=y
450CONFIG_SCLP_VT220_CONSOLE=y
451CONFIG_SCLP_CPI=m
452CONFIG_S390_TAPE=m
453
454#
455# S/390 tape interface support
456#
457CONFIG_S390_TAPE_BLOCK=y
458
459#
460# S/390 tape hardware support
461#
462CONFIG_S390_TAPE_34XX=m
463# CONFIG_S390_TAPE_3590 is not set
464# CONFIG_VMLOGRDR is not set
465# CONFIG_VMCP is not set
466# CONFIG_MONREADER is not set
467CONFIG_MONWRITER=m
468
469#
470# Cryptographic devices
471#
472CONFIG_ZCRYPT=m
473# CONFIG_ZCRYPT_MONOLITHIC is not set
474 451
475# 452#
476# Network device support 453# Network device support
@@ -482,10 +459,6 @@ CONFIG_EQUALIZER=m
482CONFIG_TUN=m 459CONFIG_TUN=m
483 460
484# 461#
485# PHY device support
486#
487
488#
489# Ethernet (10 or 100Mbit) 462# Ethernet (10 or 100Mbit)
490# 463#
491CONFIG_NET_ETHERNET=y 464CONFIG_NET_ETHERNET=y
@@ -498,6 +471,7 @@ CONFIG_NET_ETHERNET=y
498# 471#
499# Ethernet (10000 Mbit) 472# Ethernet (10000 Mbit)
500# 473#
474CONFIG_MLX4_DEBUG=y
501 475
502# 476#
503# Token Ring devices 477# Token Ring devices
@@ -505,11 +479,6 @@ CONFIG_NET_ETHERNET=y
505# CONFIG_TR is not set 479# CONFIG_TR is not set
506 480
507# 481#
508# Wireless LAN (non-hamradio)
509#
510# CONFIG_NET_RADIO is not set
511
512#
513# Wan interfaces 482# Wan interfaces
514# 483#
515# CONFIG_WAN is not set 484# CONFIG_WAN is not set
@@ -537,6 +506,56 @@ CONFIG_CCWGROUP=y
537# CONFIG_NET_POLL_CONTROLLER is not set 506# CONFIG_NET_POLL_CONTROLLER is not set
538 507
539# 508#
509# Character devices
510#
511CONFIG_UNIX98_PTYS=y
512CONFIG_LEGACY_PTYS=y
513CONFIG_LEGACY_PTY_COUNT=256
514
515#
516# Watchdog Cards
517#
518# CONFIG_WATCHDOG is not set
519CONFIG_HW_RANDOM=m
520# CONFIG_R3964 is not set
521CONFIG_RAW_DRIVER=m
522CONFIG_MAX_RAW_DEVS=256
523# CONFIG_HANGCHECK_TIMER is not set
524
525#
526# S/390 character device drivers
527#
528CONFIG_TN3270=y
529CONFIG_TN3270_TTY=y
530CONFIG_TN3270_FS=m
531CONFIG_TN3270_CONSOLE=y
532CONFIG_TN3215=y
533CONFIG_TN3215_CONSOLE=y
534CONFIG_CCW_CONSOLE=y
535CONFIG_SCLP=y
536CONFIG_SCLP_TTY=y
537CONFIG_SCLP_CONSOLE=y
538CONFIG_SCLP_VT220_TTY=y
539CONFIG_SCLP_VT220_CONSOLE=y
540CONFIG_SCLP_CPI=m
541CONFIG_S390_TAPE=m
542
543#
544# S/390 tape interface support
545#
546CONFIG_S390_TAPE_BLOCK=y
547
548#
549# S/390 tape hardware support
550#
551CONFIG_S390_TAPE_34XX=m
552# CONFIG_S390_TAPE_3590 is not set
553# CONFIG_VMLOGRDR is not set
554# CONFIG_VMCP is not set
555# CONFIG_MONREADER is not set
556CONFIG_MONWRITER=m
557
558#
540# File systems 559# File systems
541# 560#
542CONFIG_EXT2_FS=y 561CONFIG_EXT2_FS=y
@@ -628,6 +647,7 @@ CONFIG_LOCKD_V4=y
628CONFIG_EXPORTFS=y 647CONFIG_EXPORTFS=y
629CONFIG_NFS_COMMON=y 648CONFIG_NFS_COMMON=y
630CONFIG_SUNRPC=y 649CONFIG_SUNRPC=y
650# CONFIG_SUNRPC_BIND34 is not set
631# CONFIG_RPCSEC_GSS_KRB5 is not set 651# CONFIG_RPCSEC_GSS_KRB5 is not set
632# CONFIG_RPCSEC_GSS_SPKM3 is not set 652# CONFIG_RPCSEC_GSS_SPKM3 is not set
633# CONFIG_SMB_FS is not set 653# CONFIG_SMB_FS is not set
@@ -658,6 +678,7 @@ CONFIG_MSDOS_PARTITION=y
658# CONFIG_SUN_PARTITION is not set 678# CONFIG_SUN_PARTITION is not set
659# CONFIG_KARMA_PARTITION is not set 679# CONFIG_KARMA_PARTITION is not set
660# CONFIG_EFI_PARTITION is not set 680# CONFIG_EFI_PARTITION is not set
681# CONFIG_SYSV68_PARTITION is not set
661 682
662# 683#
663# Native Language Support 684# Native Language Support
@@ -668,8 +689,6 @@ CONFIG_MSDOS_PARTITION=y
668# Distributed Lock Manager 689# Distributed Lock Manager
669# 690#
670CONFIG_DLM=m 691CONFIG_DLM=m
671CONFIG_DLM_TCP=y
672# CONFIG_DLM_SCTP is not set
673# CONFIG_DLM_DEBUG is not set 692# CONFIG_DLM_DEBUG is not set
674 693
675# 694#
@@ -693,7 +712,6 @@ CONFIG_MAGIC_SYSRQ=y
693CONFIG_DEBUG_FS=y 712CONFIG_DEBUG_FS=y
694CONFIG_HEADERS_CHECK=y 713CONFIG_HEADERS_CHECK=y
695CONFIG_DEBUG_KERNEL=y 714CONFIG_DEBUG_KERNEL=y
696CONFIG_LOG_BUF_SHIFT=17
697# CONFIG_SCHEDSTATS is not set 715# CONFIG_SCHEDSTATS is not set
698# CONFIG_TIMER_STATS is not set 716# CONFIG_TIMER_STATS is not set
699# CONFIG_DEBUG_SLAB is not set 717# CONFIG_DEBUG_SLAB is not set
@@ -729,12 +747,13 @@ CONFIG_FORCED_INLINING=y
729CONFIG_CRYPTO=y 747CONFIG_CRYPTO=y
730CONFIG_CRYPTO_ALGAPI=y 748CONFIG_CRYPTO_ALGAPI=y
731CONFIG_CRYPTO_BLKCIPHER=y 749CONFIG_CRYPTO_BLKCIPHER=y
750CONFIG_CRYPTO_HASH=m
732CONFIG_CRYPTO_MANAGER=y 751CONFIG_CRYPTO_MANAGER=y
733# CONFIG_CRYPTO_HMAC is not set 752CONFIG_CRYPTO_HMAC=m
734# CONFIG_CRYPTO_XCBC is not set 753# CONFIG_CRYPTO_XCBC is not set
735# CONFIG_CRYPTO_NULL is not set 754# CONFIG_CRYPTO_NULL is not set
736# CONFIG_CRYPTO_MD4 is not set 755# CONFIG_CRYPTO_MD4 is not set
737# CONFIG_CRYPTO_MD5 is not set 756CONFIG_CRYPTO_MD5=m
738# CONFIG_CRYPTO_SHA1 is not set 757# CONFIG_CRYPTO_SHA1 is not set
739# CONFIG_CRYPTO_SHA256 is not set 758# CONFIG_CRYPTO_SHA256 is not set
740# CONFIG_CRYPTO_SHA512 is not set 759# CONFIG_CRYPTO_SHA512 is not set
@@ -745,6 +764,7 @@ CONFIG_CRYPTO_ECB=m
745CONFIG_CRYPTO_CBC=y 764CONFIG_CRYPTO_CBC=y
746CONFIG_CRYPTO_PCBC=m 765CONFIG_CRYPTO_PCBC=m
747# CONFIG_CRYPTO_LRW is not set 766# CONFIG_CRYPTO_LRW is not set
767# CONFIG_CRYPTO_CRYPTD is not set
748# CONFIG_CRYPTO_DES is not set 768# CONFIG_CRYPTO_DES is not set
749CONFIG_CRYPTO_FCRYPT=m 769CONFIG_CRYPTO_FCRYPT=m
750# CONFIG_CRYPTO_BLOWFISH is not set 770# CONFIG_CRYPTO_BLOWFISH is not set
@@ -771,6 +791,8 @@ CONFIG_CRYPTO_CAMELLIA=m
771# CONFIG_CRYPTO_DES_S390 is not set 791# CONFIG_CRYPTO_DES_S390 is not set
772# CONFIG_CRYPTO_AES_S390 is not set 792# CONFIG_CRYPTO_AES_S390 is not set
773CONFIG_S390_PRNG=m 793CONFIG_S390_PRNG=m
794CONFIG_ZCRYPT=m
795# CONFIG_ZCRYPT_MONOLITHIC is not set
774 796
775# 797#
776# Library routines 798# Library routines
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index ba5d3167df0d..8e1ea1c40128 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -477,7 +477,7 @@ static int __init hypfs_init(void)
477 goto fail_diag; 477 goto fail_diag;
478 } 478 }
479 } 479 }
480 kset_set_kset_s(&s390_subsys, hypervisor_subsys); 480 kobj_set_kset_s(&s390_subsys, hypervisor_subsys);
481 rc = subsystem_register(&s390_subsys); 481 rc = subsystem_register(&s390_subsys);
482 if (rc) 482 if (rc)
483 goto fail_sysfs; 483 goto fail_sysfs;
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 0ea048d350d8..367caf92ea78 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -816,23 +816,23 @@ static int __init ipl_register_fcp_files(void)
816{ 816{
817 int rc; 817 int rc;
818 818
819 rc = sysfs_create_group(&ipl_subsys.kset.kobj, 819 rc = sysfs_create_group(&ipl_subsys.kobj,
820 &ipl_fcp_attr_group); 820 &ipl_fcp_attr_group);
821 if (rc) 821 if (rc)
822 goto out; 822 goto out;
823 rc = sysfs_create_bin_file(&ipl_subsys.kset.kobj, 823 rc = sysfs_create_bin_file(&ipl_subsys.kobj,
824 &ipl_parameter_attr); 824 &ipl_parameter_attr);
825 if (rc) 825 if (rc)
826 goto out_ipl_parm; 826 goto out_ipl_parm;
827 rc = sysfs_create_bin_file(&ipl_subsys.kset.kobj, 827 rc = sysfs_create_bin_file(&ipl_subsys.kobj,
828 &ipl_scp_data_attr); 828 &ipl_scp_data_attr);
829 if (!rc) 829 if (!rc)
830 goto out; 830 goto out;
831 831
832 sysfs_remove_bin_file(&ipl_subsys.kset.kobj, &ipl_parameter_attr); 832 sysfs_remove_bin_file(&ipl_subsys.kobj, &ipl_parameter_attr);
833 833
834out_ipl_parm: 834out_ipl_parm:
835 sysfs_remove_group(&ipl_subsys.kset.kobj, &ipl_fcp_attr_group); 835 sysfs_remove_group(&ipl_subsys.kobj, &ipl_fcp_attr_group);
836out: 836out:
837 return rc; 837 return rc;
838} 838}
@@ -846,7 +846,7 @@ static int __init ipl_init(void)
846 return rc; 846 return rc;
847 switch (ipl_info.type) { 847 switch (ipl_info.type) {
848 case IPL_TYPE_CCW: 848 case IPL_TYPE_CCW:
849 rc = sysfs_create_group(&ipl_subsys.kset.kobj, 849 rc = sysfs_create_group(&ipl_subsys.kobj,
850 &ipl_ccw_attr_group); 850 &ipl_ccw_attr_group);
851 break; 851 break;
852 case IPL_TYPE_FCP: 852 case IPL_TYPE_FCP:
@@ -854,11 +854,11 @@ static int __init ipl_init(void)
854 rc = ipl_register_fcp_files(); 854 rc = ipl_register_fcp_files();
855 break; 855 break;
856 case IPL_TYPE_NSS: 856 case IPL_TYPE_NSS:
857 rc = sysfs_create_group(&ipl_subsys.kset.kobj, 857 rc = sysfs_create_group(&ipl_subsys.kobj,
858 &ipl_nss_attr_group); 858 &ipl_nss_attr_group);
859 break; 859 break;
860 default: 860 default:
861 rc = sysfs_create_group(&ipl_subsys.kset.kobj, 861 rc = sysfs_create_group(&ipl_subsys.kobj,
862 &ipl_unknown_attr_group); 862 &ipl_unknown_attr_group);
863 break; 863 break;
864 } 864 }
@@ -885,7 +885,7 @@ static int __init reipl_nss_init(void)
885 885
886 if (!MACHINE_IS_VM) 886 if (!MACHINE_IS_VM)
887 return 0; 887 return 0;
888 rc = sysfs_create_group(&reipl_subsys.kset.kobj, &reipl_nss_attr_group); 888 rc = sysfs_create_group(&reipl_subsys.kobj, &reipl_nss_attr_group);
889 if (rc) 889 if (rc)
890 return rc; 890 return rc;
891 strncpy(reipl_nss_name, kernel_nss_name, NSS_NAME_SIZE + 1); 891 strncpy(reipl_nss_name, kernel_nss_name, NSS_NAME_SIZE + 1);
@@ -900,7 +900,7 @@ static int __init reipl_ccw_init(void)
900 reipl_block_ccw = (void *) get_zeroed_page(GFP_KERNEL); 900 reipl_block_ccw = (void *) get_zeroed_page(GFP_KERNEL);
901 if (!reipl_block_ccw) 901 if (!reipl_block_ccw)
902 return -ENOMEM; 902 return -ENOMEM;
903 rc = sysfs_create_group(&reipl_subsys.kset.kobj, &reipl_ccw_attr_group); 903 rc = sysfs_create_group(&reipl_subsys.kobj, &reipl_ccw_attr_group);
904 if (rc) { 904 if (rc) {
905 free_page((unsigned long)reipl_block_ccw); 905 free_page((unsigned long)reipl_block_ccw);
906 return rc; 906 return rc;
@@ -938,7 +938,7 @@ static int __init reipl_fcp_init(void)
938 reipl_block_fcp = (void *) get_zeroed_page(GFP_KERNEL); 938 reipl_block_fcp = (void *) get_zeroed_page(GFP_KERNEL);
939 if (!reipl_block_fcp) 939 if (!reipl_block_fcp)
940 return -ENOMEM; 940 return -ENOMEM;
941 rc = sysfs_create_group(&reipl_subsys.kset.kobj, &reipl_fcp_attr_group); 941 rc = sysfs_create_group(&reipl_subsys.kobj, &reipl_fcp_attr_group);
942 if (rc) { 942 if (rc) {
943 free_page((unsigned long)reipl_block_fcp); 943 free_page((unsigned long)reipl_block_fcp);
944 return rc; 944 return rc;
@@ -990,7 +990,7 @@ static int __init dump_ccw_init(void)
990 dump_block_ccw = (void *) get_zeroed_page(GFP_KERNEL); 990 dump_block_ccw = (void *) get_zeroed_page(GFP_KERNEL);
991 if (!dump_block_ccw) 991 if (!dump_block_ccw)
992 return -ENOMEM; 992 return -ENOMEM;
993 rc = sysfs_create_group(&dump_subsys.kset.kobj, &dump_ccw_attr_group); 993 rc = sysfs_create_group(&dump_subsys.kobj, &dump_ccw_attr_group);
994 if (rc) { 994 if (rc) {
995 free_page((unsigned long)dump_block_ccw); 995 free_page((unsigned long)dump_block_ccw);
996 return rc; 996 return rc;
@@ -1014,7 +1014,7 @@ static int __init dump_fcp_init(void)
1014 dump_block_fcp = (void *) get_zeroed_page(GFP_KERNEL); 1014 dump_block_fcp = (void *) get_zeroed_page(GFP_KERNEL);
1015 if (!dump_block_fcp) 1015 if (!dump_block_fcp)
1016 return -ENOMEM; 1016 return -ENOMEM;
1017 rc = sysfs_create_group(&dump_subsys.kset.kobj, &dump_fcp_attr_group); 1017 rc = sysfs_create_group(&dump_subsys.kobj, &dump_fcp_attr_group);
1018 if (rc) { 1018 if (rc) {
1019 free_page((unsigned long)dump_block_fcp); 1019 free_page((unsigned long)dump_block_fcp);
1020 return rc; 1020 return rc;
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 8b924b359774..d855cdbf8fb8 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -253,7 +253,10 @@ static int signal_return(struct mm_struct *mm, struct pt_regs *regs,
253 unsigned long address, unsigned long error_code) 253 unsigned long address, unsigned long error_code)
254{ 254{
255 u16 instruction; 255 u16 instruction;
256 int rc, compat; 256 int rc;
257#ifdef CONFIG_COMPAT
258 int compat;
259#endif
257 260
258 pagefault_disable(); 261 pagefault_disable();
259 rc = __get_user(instruction, (u16 __user *) regs->psw.addr); 262 rc = __get_user(instruction, (u16 __user *) regs->psw.addr);
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index d85e1ed7c3e4..cf9a75112d0f 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -377,7 +377,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
377 const char *type; 377 const char *type;
378 u32 class; 378 u32 class;
379 379
380 dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); 380 dev = alloc_pci_dev();
381 if (!dev) 381 if (!dev)
382 return NULL; 382 return NULL;
383 383
diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c
index 76faaa8135dd..f974fefc3ebc 100644
--- a/arch/sparc64/kernel/pci_common.c
+++ b/arch/sparc64/kernel/pci_common.c
@@ -14,6 +14,200 @@
14#include <asm/oplib.h> 14#include <asm/oplib.h>
15 15
16#include "pci_impl.h" 16#include "pci_impl.h"
17#include "pci_sun4v.h"
18
19static int config_out_of_range(struct pci_pbm_info *pbm,
20 unsigned long bus,
21 unsigned long devfn,
22 unsigned long reg)
23{
24 if (bus < pbm->pci_first_busno ||
25 bus > pbm->pci_last_busno)
26 return 1;
27 return 0;
28}
29
30static void *sun4u_config_mkaddr(struct pci_pbm_info *pbm,
31 unsigned long bus,
32 unsigned long devfn,
33 unsigned long reg)
34{
35 unsigned long rbits = pbm->config_space_reg_bits;
36
37 if (config_out_of_range(pbm, bus, devfn, reg))
38 return NULL;
39
40 reg = (reg & ((1 << rbits) - 1));
41 devfn <<= rbits;
42 bus <<= rbits + 8;
43
44 return (void *) (pbm->config_space | bus | devfn | reg);
45}
46
47static int sun4u_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
48 int where, int size, u32 *value)
49{
50 struct pci_pbm_info *pbm = bus_dev->sysdata;
51 unsigned char bus = bus_dev->number;
52 u32 *addr;
53 u16 tmp16;
54 u8 tmp8;
55
56 if (bus_dev == pbm->pci_bus && devfn == 0x00)
57 return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
58 size, value);
59
60 switch (size) {
61 case 1:
62 *value = 0xff;
63 break;
64 case 2:
65 *value = 0xffff;
66 break;
67 case 4:
68 *value = 0xffffffff;
69 break;
70 }
71
72 addr = sun4u_config_mkaddr(pbm, bus, devfn, where);
73 if (!addr)
74 return PCIBIOS_SUCCESSFUL;
75
76 switch (size) {
77 case 1:
78 pci_config_read8((u8 *)addr, &tmp8);
79 *value = (u32) tmp8;
80 break;
81
82 case 2:
83 if (where & 0x01) {
84 printk("pci_read_config_word: misaligned reg [%x]\n",
85 where);
86 return PCIBIOS_SUCCESSFUL;
87 }
88 pci_config_read16((u16 *)addr, &tmp16);
89 *value = (u32) tmp16;
90 break;
91
92 case 4:
93 if (where & 0x03) {
94 printk("pci_read_config_dword: misaligned reg [%x]\n",
95 where);
96 return PCIBIOS_SUCCESSFUL;
97 }
98 pci_config_read32(addr, value);
99 break;
100 }
101 return PCIBIOS_SUCCESSFUL;
102}
103
104static int sun4u_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
105 int where, int size, u32 value)
106{
107 struct pci_pbm_info *pbm = bus_dev->sysdata;
108 unsigned char bus = bus_dev->number;
109 u32 *addr;
110
111 if (bus_dev == pbm->pci_bus && devfn == 0x00)
112 return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
113 size, value);
114 addr = sun4u_config_mkaddr(pbm, bus, devfn, where);
115 if (!addr)
116 return PCIBIOS_SUCCESSFUL;
117
118 switch (size) {
119 case 1:
120 pci_config_write8((u8 *)addr, value);
121 break;
122
123 case 2:
124 if (where & 0x01) {
125 printk("pci_write_config_word: misaligned reg [%x]\n",
126 where);
127 return PCIBIOS_SUCCESSFUL;
128 }
129 pci_config_write16((u16 *)addr, value);
130 break;
131
132 case 4:
133 if (where & 0x03) {
134 printk("pci_write_config_dword: misaligned reg [%x]\n",
135 where);
136 return PCIBIOS_SUCCESSFUL;
137 }
138 pci_config_write32(addr, value);
139 }
140 return PCIBIOS_SUCCESSFUL;
141}
142
143struct pci_ops sun4u_pci_ops = {
144 .read = sun4u_read_pci_cfg,
145 .write = sun4u_write_pci_cfg,
146};
147
148static int sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
149 int where, int size, u32 *value)
150{
151 struct pci_pbm_info *pbm = bus_dev->sysdata;
152 u32 devhandle = pbm->devhandle;
153 unsigned int bus = bus_dev->number;
154 unsigned int device = PCI_SLOT(devfn);
155 unsigned int func = PCI_FUNC(devfn);
156 unsigned long ret;
157
158 if (bus_dev == pbm->pci_bus && devfn == 0x00)
159 return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
160 size, value);
161 if (config_out_of_range(pbm, bus, devfn, where)) {
162 ret = ~0UL;
163 } else {
164 ret = pci_sun4v_config_get(devhandle,
165 HV_PCI_DEVICE_BUILD(bus, device, func),
166 where, size);
167 }
168 switch (size) {
169 case 1:
170 *value = ret & 0xff;
171 break;
172 case 2:
173 *value = ret & 0xffff;
174 break;
175 case 4:
176 *value = ret & 0xffffffff;
177 break;
178 };
179
180
181 return PCIBIOS_SUCCESSFUL;
182}
183
184static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
185 int where, int size, u32 value)
186{
187 struct pci_pbm_info *pbm = bus_dev->sysdata;
188 u32 devhandle = pbm->devhandle;
189 unsigned int bus = bus_dev->number;
190 unsigned int device = PCI_SLOT(devfn);
191 unsigned int func = PCI_FUNC(devfn);
192 unsigned long ret;
193
194 if (bus_dev == pbm->pci_bus && devfn == 0x00)
195 return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
196 size, value);
197 if (config_out_of_range(pbm, bus, devfn, where)) {
198 /* Do nothing. */
199 } else {
200 ret = pci_sun4v_config_put(devhandle,
201 HV_PCI_DEVICE_BUILD(bus, device, func),
202 where, size, value);
203 }
204 return PCIBIOS_SUCCESSFUL;
205}
206
207struct pci_ops sun4v_pci_ops = {
208 .read = sun4v_read_pci_cfg,
209 .write = sun4v_write_pci_cfg,
210};
17 211
18void pci_get_pbm_props(struct pci_pbm_info *pbm) 212void pci_get_pbm_props(struct pci_pbm_info *pbm)
19{ 213{
diff --git a/arch/sparc64/kernel/pci_fire.c b/arch/sparc64/kernel/pci_fire.c
index 2e0eb4ee8f71..9198c1a0f7a5 100644
--- a/arch/sparc64/kernel/pci_fire.c
+++ b/arch/sparc64/kernel/pci_fire.c
@@ -27,138 +27,6 @@
27 "i" (ASI_PHYS_BYPASS_EC_E) \ 27 "i" (ASI_PHYS_BYPASS_EC_E) \
28 : "memory") 28 : "memory")
29 29
30/* Fire config space address format is nearly identical to
31 * that of SCHIZO and PSYCHO, except that in order to accomodate
32 * PCI-E extended config space the encoding can handle 12 bits
33 * of register address:
34 *
35 * 32 28 27 20 19 15 14 12 11 2 1 0
36 * -------------------------------------------------
37 * |0 0 0 0 0| bus | device | function | reg | 0 0 |
38 * -------------------------------------------------
39 */
40#define FIRE_CONFIG_BASE(PBM) ((PBM)->config_space)
41#define FIRE_CONFIG_ENCODE(BUS, DEVFN, REG) \
42 (((unsigned long)(BUS) << 20) | \
43 ((unsigned long)(DEVFN) << 12) | \
44 ((unsigned long)(REG)))
45
46static void *fire_pci_config_mkaddr(struct pci_pbm_info *pbm,
47 unsigned char bus,
48 unsigned int devfn,
49 int where)
50{
51 if (!pbm)
52 return NULL;
53 return (void *)
54 (FIRE_CONFIG_BASE(pbm) |
55 FIRE_CONFIG_ENCODE(bus, devfn, where));
56}
57
58/* FIRE PCI configuration space accessors. */
59
60static int fire_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
61 int where, int size, u32 *value)
62{
63 struct pci_pbm_info *pbm = bus_dev->sysdata;
64 unsigned char bus = bus_dev->number;
65 u32 *addr;
66 u16 tmp16;
67 u8 tmp8;
68
69 if (bus_dev == pbm->pci_bus && devfn == 0x00)
70 return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
71 size, value);
72 switch (size) {
73 case 1:
74 *value = 0xff;
75 break;
76 case 2:
77 *value = 0xffff;
78 break;
79 case 4:
80 *value = 0xffffffff;
81 break;
82 }
83
84 addr = fire_pci_config_mkaddr(pbm, bus, devfn, where);
85 if (!addr)
86 return PCIBIOS_SUCCESSFUL;
87
88 switch (size) {
89 case 1:
90 pci_config_read8((u8 *)addr, &tmp8);
91 *value = tmp8;
92 break;
93
94 case 2:
95 if (where & 0x01) {
96 printk("pci_read_config_word: misaligned reg [%x]\n",
97 where);
98 return PCIBIOS_SUCCESSFUL;
99 }
100 pci_config_read16((u16 *)addr, &tmp16);
101 *value = tmp16;
102 break;
103
104 case 4:
105 if (where & 0x03) {
106 printk("pci_read_config_dword: misaligned reg [%x]\n",
107 where);
108 return PCIBIOS_SUCCESSFUL;
109 }
110
111 pci_config_read32(addr, value);
112 break;
113 }
114 return PCIBIOS_SUCCESSFUL;
115}
116
117static int fire_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
118 int where, int size, u32 value)
119{
120 struct pci_pbm_info *pbm = bus_dev->sysdata;
121 unsigned char bus = bus_dev->number;
122 u32 *addr;
123
124 if (bus_dev == pbm->pci_bus && devfn == 0x00)
125 return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
126 size, value);
127 addr = fire_pci_config_mkaddr(pbm, bus, devfn, where);
128 if (!addr)
129 return PCIBIOS_SUCCESSFUL;
130
131 switch (size) {
132 case 1:
133 pci_config_write8((u8 *)addr, value);
134 break;
135
136 case 2:
137 if (where & 0x01) {
138 printk("pci_write_config_word: misaligned reg [%x]\n",
139 where);
140 return PCIBIOS_SUCCESSFUL;
141 }
142 pci_config_write16((u16 *)addr, value);
143 break;
144
145 case 4:
146 if (where & 0x03) {
147 printk("pci_write_config_dword: misaligned reg [%x]\n",
148 where);
149 return PCIBIOS_SUCCESSFUL;
150 }
151
152 pci_config_write32(addr, value);
153 }
154 return PCIBIOS_SUCCESSFUL;
155}
156
157static struct pci_ops pci_fire_ops = {
158 .read = fire_read_pci_cfg,
159 .write = fire_write_pci_cfg,
160};
161
162static void pci_fire_scan_bus(struct pci_pbm_info *pbm) 30static void pci_fire_scan_bus(struct pci_pbm_info *pbm)
163{ 31{
164 pbm->pci_bus = pci_scan_one_pbm(pbm); 32 pbm->pci_bus = pci_scan_one_pbm(pbm);
@@ -314,7 +182,8 @@ static void pci_fire_pbm_init(struct pci_controller_info *p,
314 pci_pbm_root = pbm; 182 pci_pbm_root = pbm;
315 183
316 pbm->scan_bus = pci_fire_scan_bus; 184 pbm->scan_bus = pci_fire_scan_bus;
317 pbm->pci_ops = &pci_fire_ops; 185 pbm->pci_ops = &sun4u_pci_ops;
186 pbm->config_space_reg_bits = 12;
318 187
319 pbm->index = pci_num_pbms++; 188 pbm->index = pci_num_pbms++;
320 189
diff --git a/arch/sparc64/kernel/pci_impl.h b/arch/sparc64/kernel/pci_impl.h
index 8e38023868aa..f660c2b685eb 100644
--- a/arch/sparc64/kernel/pci_impl.h
+++ b/arch/sparc64/kernel/pci_impl.h
@@ -77,6 +77,9 @@ struct pci_pbm_info {
77 /* Base of PCI Config space, can be per-PBM or shared. */ 77 /* Base of PCI Config space, can be per-PBM or shared. */
78 unsigned long config_space; 78 unsigned long config_space;
79 79
80 /* This will be 12 on PCI-E controllers, 8 elsewhere. */
81 unsigned long config_space_reg_bits;
82
80 /* State of 66MHz capabilities on this PBM. */ 83 /* State of 66MHz capabilities on this PBM. */
81 int is_66mhz_capable; 84 int is_66mhz_capable;
82 int all_devs_66mhz; 85 int all_devs_66mhz;
@@ -156,4 +159,7 @@ extern void pci_config_write8(u8 *addr, u8 val);
156extern void pci_config_write16(u16 *addr, u16 val); 159extern void pci_config_write16(u16 *addr, u16 val);
157extern void pci_config_write32(u32 *addr, u32 val); 160extern void pci_config_write32(u32 *addr, u32 val);
158 161
162extern struct pci_ops sun4u_pci_ops;
163extern struct pci_ops sun4v_pci_ops;
164
159#endif /* !(PCI_IMPL_H) */ 165#endif /* !(PCI_IMPL_H) */
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c
index 2edcb1dd13c3..598393a2df16 100644
--- a/arch/sparc64/kernel/pci_psycho.c
+++ b/arch/sparc64/kernel/pci_psycho.c
@@ -94,122 +94,6 @@ static void *psycho_pci_config_mkaddr(struct pci_pbm_info *pbm,
94 PSYCHO_CONFIG_ENCODE(bus, devfn, where)); 94 PSYCHO_CONFIG_ENCODE(bus, devfn, where));
95} 95}
96 96
97static int psycho_out_of_range(struct pci_pbm_info *pbm,
98 unsigned char bus,
99 unsigned char devfn)
100{
101 return ((bus == pbm->pci_first_busno) &&
102 PCI_SLOT(devfn) > 8);
103}
104
105/* PSYCHO PCI configuration space accessors. */
106
107static int psycho_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
108 int where, int size, u32 *value)
109{
110 struct pci_pbm_info *pbm = bus_dev->sysdata;
111 unsigned char bus = bus_dev->number;
112 u32 *addr;
113 u16 tmp16;
114 u8 tmp8;
115
116 if (bus_dev == pbm->pci_bus && devfn == 0x00)
117 return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
118 size, value);
119
120 switch (size) {
121 case 1:
122 *value = 0xff;
123 break;
124 case 2:
125 *value = 0xffff;
126 break;
127 case 4:
128 *value = 0xffffffff;
129 break;
130 }
131
132 addr = psycho_pci_config_mkaddr(pbm, bus, devfn, where);
133 if (!addr)
134 return PCIBIOS_SUCCESSFUL;
135
136 if (psycho_out_of_range(pbm, bus, devfn))
137 return PCIBIOS_SUCCESSFUL;
138 switch (size) {
139 case 1:
140 pci_config_read8((u8 *)addr, &tmp8);
141 *value = (u32) tmp8;
142 break;
143
144 case 2:
145 if (where & 0x01) {
146 printk("pci_read_config_word: misaligned reg [%x]\n",
147 where);
148 return PCIBIOS_SUCCESSFUL;
149 }
150 pci_config_read16((u16 *)addr, &tmp16);
151 *value = (u32) tmp16;
152 break;
153
154 case 4:
155 if (where & 0x03) {
156 printk("pci_read_config_dword: misaligned reg [%x]\n",
157 where);
158 return PCIBIOS_SUCCESSFUL;
159 }
160 pci_config_read32(addr, value);
161 break;
162 }
163 return PCIBIOS_SUCCESSFUL;
164}
165
166static int psycho_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
167 int where, int size, u32 value)
168{
169 struct pci_pbm_info *pbm = bus_dev->sysdata;
170 unsigned char bus = bus_dev->number;
171 u32 *addr;
172
173 if (bus_dev == pbm->pci_bus && devfn == 0x00)
174 return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
175 size, value);
176 addr = psycho_pci_config_mkaddr(pbm, bus, devfn, where);
177 if (!addr)
178 return PCIBIOS_SUCCESSFUL;
179
180 if (psycho_out_of_range(pbm, bus, devfn))
181 return PCIBIOS_SUCCESSFUL;
182
183 switch (size) {
184 case 1:
185 pci_config_write8((u8 *)addr, value);
186 break;
187
188 case 2:
189 if (where & 0x01) {
190 printk("pci_write_config_word: misaligned reg [%x]\n",
191 where);
192 return PCIBIOS_SUCCESSFUL;
193 }
194 pci_config_write16((u16 *)addr, value);
195 break;
196
197 case 4:
198 if (where & 0x03) {
199 printk("pci_write_config_dword: misaligned reg [%x]\n",
200 where);
201 return PCIBIOS_SUCCESSFUL;
202 }
203 pci_config_write32(addr, value);
204 }
205 return PCIBIOS_SUCCESSFUL;
206}
207
208static struct pci_ops psycho_ops = {
209 .read = psycho_read_pci_cfg,
210 .write = psycho_write_pci_cfg,
211};
212
213/* PSYCHO error handling support. */ 97/* PSYCHO error handling support. */
214enum psycho_error_type { 98enum psycho_error_type {
215 UE_ERR, CE_ERR, PCI_ERR 99 UE_ERR, CE_ERR, PCI_ERR
@@ -1089,7 +973,8 @@ static void psycho_pbm_init(struct pci_controller_info *p,
1089 pci_pbm_root = pbm; 973 pci_pbm_root = pbm;
1090 974
1091 pbm->scan_bus = psycho_scan_bus; 975 pbm->scan_bus = psycho_scan_bus;
1092 pbm->pci_ops = &psycho_ops; 976 pbm->pci_ops = &sun4u_pci_ops;
977 pbm->config_space_reg_bits = 8;
1093 978
1094 pbm->index = pci_num_pbms++; 979 pbm->index = pci_num_pbms++;
1095 980
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c
index 4cefe6e83b24..e2377796de89 100644
--- a/arch/sparc64/kernel/pci_sabre.c
+++ b/arch/sparc64/kernel/pci_sabre.c
@@ -205,294 +205,9 @@
205#define SABRE_MEMSPACE 0x100000000UL 205#define SABRE_MEMSPACE 0x100000000UL
206#define SABRE_MEMSPACE_SIZE 0x07fffffffUL 206#define SABRE_MEMSPACE_SIZE 0x07fffffffUL
207 207
208/* UltraSparc-IIi Programmer's Manual, page 325, PCI
209 * configuration space address format:
210 *
211 * 32 24 23 16 15 11 10 8 7 2 1 0
212 * ---------------------------------------------------------
213 * |0 0 0 0 0 0 0 0 1| bus | device | function | reg | 0 0 |
214 * ---------------------------------------------------------
215 */
216#define SABRE_CONFIG_BASE(PBM) \
217 ((PBM)->config_space | (1UL << 24))
218#define SABRE_CONFIG_ENCODE(BUS, DEVFN, REG) \
219 (((unsigned long)(BUS) << 16) | \
220 ((unsigned long)(DEVFN) << 8) | \
221 ((unsigned long)(REG)))
222
223static int hummingbird_p; 208static int hummingbird_p;
224static struct pci_bus *sabre_root_bus; 209static struct pci_bus *sabre_root_bus;
225 210
226static void *sabre_pci_config_mkaddr(struct pci_pbm_info *pbm,
227 unsigned char bus,
228 unsigned int devfn,
229 int where)
230{
231 if (!pbm)
232 return NULL;
233 return (void *)
234 (SABRE_CONFIG_BASE(pbm) |
235 SABRE_CONFIG_ENCODE(bus, devfn, where));
236}
237
238static int sabre_out_of_range(unsigned char devfn)
239{
240 if (hummingbird_p)
241 return 0;
242
243 return (((PCI_SLOT(devfn) == 0) && (PCI_FUNC(devfn) > 0)) ||
244 ((PCI_SLOT(devfn) == 1) && (PCI_FUNC(devfn) > 1)) ||
245 (PCI_SLOT(devfn) > 1));
246}
247
248static int __sabre_out_of_range(struct pci_pbm_info *pbm,
249 unsigned char bus,
250 unsigned char devfn)
251{
252 if (hummingbird_p)
253 return 0;
254
255 return ((pbm->parent == 0) ||
256 ((pbm == &pbm->parent->pbm_A) &&
257 (bus == pbm->pci_first_busno) &&
258 PCI_SLOT(devfn) > 8));
259}
260
261static int __sabre_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
262 int where, int size, u32 *value)
263{
264 struct pci_pbm_info *pbm = bus_dev->sysdata;
265 unsigned char bus = bus_dev->number;
266 u32 *addr;
267 u16 tmp16;
268 u8 tmp8;
269
270 switch (size) {
271 case 1:
272 *value = 0xff;
273 break;
274 case 2:
275 *value = 0xffff;
276 break;
277 case 4:
278 *value = 0xffffffff;
279 break;
280 }
281
282 addr = sabre_pci_config_mkaddr(pbm, bus, devfn, where);
283 if (!addr)
284 return PCIBIOS_SUCCESSFUL;
285
286 if (__sabre_out_of_range(pbm, bus, devfn))
287 return PCIBIOS_SUCCESSFUL;
288
289 switch (size) {
290 case 1:
291 pci_config_read8((u8 *) addr, &tmp8);
292 *value = tmp8;
293 break;
294
295 case 2:
296 if (where & 0x01) {
297 printk("pci_read_config_word: misaligned reg [%x]\n",
298 where);
299 return PCIBIOS_SUCCESSFUL;
300 }
301 pci_config_read16((u16 *) addr, &tmp16);
302 *value = tmp16;
303 break;
304
305 case 4:
306 if (where & 0x03) {
307 printk("pci_read_config_dword: misaligned reg [%x]\n",
308 where);
309 return PCIBIOS_SUCCESSFUL;
310 }
311 pci_config_read32(addr, value);
312 break;
313 }
314
315 return PCIBIOS_SUCCESSFUL;
316}
317
318static int sabre_read_pci_cfg(struct pci_bus *bus, unsigned int devfn,
319 int where, int size, u32 *value)
320{
321 struct pci_pbm_info *pbm = bus->sysdata;
322
323 if (bus == pbm->pci_bus && devfn == 0x00)
324 return pci_host_bridge_read_pci_cfg(bus, devfn, where,
325 size, value);
326
327 if (!bus->number && sabre_out_of_range(devfn)) {
328 switch (size) {
329 case 1:
330 *value = 0xff;
331 break;
332 case 2:
333 *value = 0xffff;
334 break;
335 case 4:
336 *value = 0xffffffff;
337 break;
338 }
339 return PCIBIOS_SUCCESSFUL;
340 }
341
342 if (bus->number || PCI_SLOT(devfn))
343 return __sabre_read_pci_cfg(bus, devfn, where, size, value);
344
345 /* When accessing PCI config space of the PCI controller itself (bus
346 * 0, device slot 0, function 0) there are restrictions. Each
347 * register must be accessed as it's natural size. Thus, for example
348 * the Vendor ID must be accessed as a 16-bit quantity.
349 */
350
351 switch (size) {
352 case 1:
353 if (where < 8) {
354 u32 tmp32;
355 u16 tmp16;
356
357 __sabre_read_pci_cfg(bus, devfn, where & ~1, 2, &tmp32);
358 tmp16 = (u16) tmp32;
359 if (where & 1)
360 *value = tmp16 >> 8;
361 else
362 *value = tmp16 & 0xff;
363 } else
364 return __sabre_read_pci_cfg(bus, devfn, where, 1, value);
365 break;
366
367 case 2:
368 if (where < 8)
369 return __sabre_read_pci_cfg(bus, devfn, where, 2, value);
370 else {
371 u32 tmp32;
372 u8 tmp8;
373
374 __sabre_read_pci_cfg(bus, devfn, where, 1, &tmp32);
375 tmp8 = (u8) tmp32;
376 *value = tmp8;
377 __sabre_read_pci_cfg(bus, devfn, where + 1, 1, &tmp32);
378 tmp8 = (u8) tmp32;
379 *value |= tmp8 << 8;
380 }
381 break;
382
383 case 4: {
384 u32 tmp32;
385 u16 tmp16;
386
387 sabre_read_pci_cfg(bus, devfn, where, 2, &tmp32);
388 tmp16 = (u16) tmp32;
389 *value = tmp16;
390 sabre_read_pci_cfg(bus, devfn, where + 2, 2, &tmp32);
391 tmp16 = (u16) tmp32;
392 *value |= tmp16 << 16;
393 break;
394 }
395 }
396 return PCIBIOS_SUCCESSFUL;
397}
398
399static int __sabre_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
400 int where, int size, u32 value)
401{
402 struct pci_pbm_info *pbm = bus_dev->sysdata;
403 unsigned char bus = bus_dev->number;
404 u32 *addr;
405
406 addr = sabre_pci_config_mkaddr(pbm, bus, devfn, where);
407 if (!addr)
408 return PCIBIOS_SUCCESSFUL;
409
410 if (__sabre_out_of_range(pbm, bus, devfn))
411 return PCIBIOS_SUCCESSFUL;
412
413 switch (size) {
414 case 1:
415 pci_config_write8((u8 *) addr, value);
416 break;
417
418 case 2:
419 if (where & 0x01) {
420 printk("pci_write_config_word: misaligned reg [%x]\n",
421 where);
422 return PCIBIOS_SUCCESSFUL;
423 }
424 pci_config_write16((u16 *) addr, value);
425 break;
426
427 case 4:
428 if (where & 0x03) {
429 printk("pci_write_config_dword: misaligned reg [%x]\n",
430 where);
431 return PCIBIOS_SUCCESSFUL;
432 }
433 pci_config_write32(addr, value);
434 break;
435 }
436
437 return PCIBIOS_SUCCESSFUL;
438}
439
440static int sabre_write_pci_cfg(struct pci_bus *bus, unsigned int devfn,
441 int where, int size, u32 value)
442{
443 struct pci_pbm_info *pbm = bus->sysdata;
444
445 if (bus == pbm->pci_bus && devfn == 0x00)
446 return pci_host_bridge_write_pci_cfg(bus, devfn, where,
447 size, value);
448
449 if (bus->number)
450 return __sabre_write_pci_cfg(bus, devfn, where, size, value);
451
452 if (sabre_out_of_range(devfn))
453 return PCIBIOS_SUCCESSFUL;
454
455 switch (size) {
456 case 1:
457 if (where < 8) {
458 u32 tmp32;
459 u16 tmp16;
460
461 __sabre_read_pci_cfg(bus, devfn, where & ~1, 2, &tmp32);
462 tmp16 = (u16) tmp32;
463 if (where & 1) {
464 value &= 0x00ff;
465 value |= tmp16 << 8;
466 } else {
467 value &= 0xff00;
468 value |= tmp16;
469 }
470 tmp32 = (u32) tmp16;
471 return __sabre_write_pci_cfg(bus, devfn, where & ~1, 2, tmp32);
472 } else
473 return __sabre_write_pci_cfg(bus, devfn, where, 1, value);
474 break;
475 case 2:
476 if (where < 8)
477 return __sabre_write_pci_cfg(bus, devfn, where, 2, value);
478 else {
479 __sabre_write_pci_cfg(bus, devfn, where, 1, value & 0xff);
480 __sabre_write_pci_cfg(bus, devfn, where + 1, 1, value >> 8);
481 }
482 break;
483 case 4:
484 sabre_write_pci_cfg(bus, devfn, where, 2, value & 0xffff);
485 sabre_write_pci_cfg(bus, devfn, where + 2, 2, value >> 16);
486 break;
487 }
488 return PCIBIOS_SUCCESSFUL;
489}
490
491static struct pci_ops sabre_ops = {
492 .read = sabre_read_pci_cfg,
493 .write = sabre_write_pci_cfg,
494};
495
496/* SABRE error handling support. */ 211/* SABRE error handling support. */
497static void sabre_check_iommu_error(struct pci_pbm_info *pbm, 212static void sabre_check_iommu_error(struct pci_pbm_info *pbm,
498 unsigned long afsr, 213 unsigned long afsr,
@@ -1010,7 +725,8 @@ static void sabre_pbm_init(struct pci_controller_info *p, struct pci_pbm_info *p
1010 printk("%s: SABRE PCI Bus Module\n", pbm->name); 725 printk("%s: SABRE PCI Bus Module\n", pbm->name);
1011 726
1012 pbm->scan_bus = sabre_scan_bus; 727 pbm->scan_bus = sabre_scan_bus;
1013 pbm->pci_ops = &sabre_ops; 728 pbm->pci_ops = &sun4u_pci_ops;
729 pbm->config_space_reg_bits = 8;
1014 730
1015 pbm->index = pci_num_pbms++; 731 pbm->index = pci_num_pbms++;
1016 732
diff --git a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c
index e375d72b8eed..ae76898bbe2b 100644
--- a/arch/sparc64/kernel/pci_schizo.c
+++ b/arch/sparc64/kernel/pci_schizo.c
@@ -104,125 +104,6 @@ static void *schizo_pci_config_mkaddr(struct pci_pbm_info *pbm,
104 SCHIZO_CONFIG_ENCODE(bus, devfn, where)); 104 SCHIZO_CONFIG_ENCODE(bus, devfn, where));
105} 105}
106 106
107/* Just make sure the bus number is in range. */
108static int schizo_out_of_range(struct pci_pbm_info *pbm,
109 unsigned char bus,
110 unsigned char devfn)
111{
112 if (bus < pbm->pci_first_busno ||
113 bus > pbm->pci_last_busno)
114 return 1;
115 return 0;
116}
117
118/* SCHIZO PCI configuration space accessors. */
119
120static int schizo_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
121 int where, int size, u32 *value)
122{
123 struct pci_pbm_info *pbm = bus_dev->sysdata;
124 unsigned char bus = bus_dev->number;
125 u32 *addr;
126 u16 tmp16;
127 u8 tmp8;
128
129 if (bus_dev == pbm->pci_bus && devfn == 0x00)
130 return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
131 size, value);
132 switch (size) {
133 case 1:
134 *value = 0xff;
135 break;
136 case 2:
137 *value = 0xffff;
138 break;
139 case 4:
140 *value = 0xffffffff;
141 break;
142 }
143
144 addr = schizo_pci_config_mkaddr(pbm, bus, devfn, where);
145 if (!addr)
146 return PCIBIOS_SUCCESSFUL;
147
148 if (schizo_out_of_range(pbm, bus, devfn))
149 return PCIBIOS_SUCCESSFUL;
150 switch (size) {
151 case 1:
152 pci_config_read8((u8 *)addr, &tmp8);
153 *value = tmp8;
154 break;
155
156 case 2:
157 if (where & 0x01) {
158 printk("pci_read_config_word: misaligned reg [%x]\n",
159 where);
160 return PCIBIOS_SUCCESSFUL;
161 }
162 pci_config_read16((u16 *)addr, &tmp16);
163 *value = tmp16;
164 break;
165
166 case 4:
167 if (where & 0x03) {
168 printk("pci_read_config_dword: misaligned reg [%x]\n",
169 where);
170 return PCIBIOS_SUCCESSFUL;
171 }
172 pci_config_read32(addr, value);
173 break;
174 }
175 return PCIBIOS_SUCCESSFUL;
176}
177
178static int schizo_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
179 int where, int size, u32 value)
180{
181 struct pci_pbm_info *pbm = bus_dev->sysdata;
182 unsigned char bus = bus_dev->number;
183 u32 *addr;
184
185 if (bus_dev == pbm->pci_bus && devfn == 0x00)
186 return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
187 size, value);
188 addr = schizo_pci_config_mkaddr(pbm, bus, devfn, where);
189 if (!addr)
190 return PCIBIOS_SUCCESSFUL;
191
192 if (schizo_out_of_range(pbm, bus, devfn))
193 return PCIBIOS_SUCCESSFUL;
194
195 switch (size) {
196 case 1:
197 pci_config_write8((u8 *)addr, value);
198 break;
199
200 case 2:
201 if (where & 0x01) {
202 printk("pci_write_config_word: misaligned reg [%x]\n",
203 where);
204 return PCIBIOS_SUCCESSFUL;
205 }
206 pci_config_write16((u16 *)addr, value);
207 break;
208
209 case 4:
210 if (where & 0x03) {
211 printk("pci_write_config_dword: misaligned reg [%x]\n",
212 where);
213 return PCIBIOS_SUCCESSFUL;
214 }
215
216 pci_config_write32(addr, value);
217 }
218 return PCIBIOS_SUCCESSFUL;
219}
220
221static struct pci_ops schizo_ops = {
222 .read = schizo_read_pci_cfg,
223 .write = schizo_write_pci_cfg,
224};
225
226/* SCHIZO error handling support. */ 107/* SCHIZO error handling support. */
227enum schizo_error_type { 108enum schizo_error_type {
228 UE_ERR, CE_ERR, PCI_ERR, SAFARI_ERR 109 UE_ERR, CE_ERR, PCI_ERR, SAFARI_ERR
@@ -1494,7 +1375,8 @@ static void schizo_pbm_init(struct pci_controller_info *p,
1494 pci_pbm_root = pbm; 1375 pci_pbm_root = pbm;
1495 1376
1496 pbm->scan_bus = schizo_scan_bus; 1377 pbm->scan_bus = schizo_scan_bus;
1497 pbm->pci_ops = &schizo_ops; 1378 pbm->pci_ops = &sun4u_pci_ops;
1379 pbm->config_space_reg_bits = 8;
1498 1380
1499 pbm->index = pci_num_pbms++; 1381 pbm->index = pci_num_pbms++;
1500 1382
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c
index 0c76a8891a96..34df4047587a 100644
--- a/arch/sparc64/kernel/pci_sun4v.c
+++ b/arch/sparc64/kernel/pci_sun4v.c
@@ -593,89 +593,6 @@ const struct pci_iommu_ops pci_sun4v_iommu_ops = {
593 .dma_sync_sg_for_cpu = pci_4v_dma_sync_sg_for_cpu, 593 .dma_sync_sg_for_cpu = pci_4v_dma_sync_sg_for_cpu,
594}; 594};
595 595
596static inline int pci_sun4v_out_of_range(struct pci_pbm_info *pbm, unsigned int bus, unsigned int device, unsigned int func)
597{
598 if (bus < pbm->pci_first_busno ||
599 bus > pbm->pci_last_busno)
600 return 1;
601 return 0;
602}
603
604static int pci_sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
605 int where, int size, u32 *value)
606{
607 struct pci_pbm_info *pbm = bus_dev->sysdata;
608 u32 devhandle = pbm->devhandle;
609 unsigned int bus = bus_dev->number;
610 unsigned int device = PCI_SLOT(devfn);
611 unsigned int func = PCI_FUNC(devfn);
612 unsigned long ret;
613
614 if (bus_dev == pbm->pci_bus && devfn == 0x00)
615 return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
616 size, value);
617 if (pci_sun4v_out_of_range(pbm, bus, device, func)) {
618 ret = ~0UL;
619 } else {
620 ret = pci_sun4v_config_get(devhandle,
621 HV_PCI_DEVICE_BUILD(bus, device, func),
622 where, size);
623#if 0
624 printk("rcfg: [%x:%x:%x:%d]=[%lx]\n",
625 devhandle, HV_PCI_DEVICE_BUILD(bus, device, func),
626 where, size, ret);
627#endif
628 }
629 switch (size) {
630 case 1:
631 *value = ret & 0xff;
632 break;
633 case 2:
634 *value = ret & 0xffff;
635 break;
636 case 4:
637 *value = ret & 0xffffffff;
638 break;
639 };
640
641
642 return PCIBIOS_SUCCESSFUL;
643}
644
645static int pci_sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
646 int where, int size, u32 value)
647{
648 struct pci_pbm_info *pbm = bus_dev->sysdata;
649 u32 devhandle = pbm->devhandle;
650 unsigned int bus = bus_dev->number;
651 unsigned int device = PCI_SLOT(devfn);
652 unsigned int func = PCI_FUNC(devfn);
653 unsigned long ret;
654
655 if (bus_dev == pbm->pci_bus && devfn == 0x00)
656 return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
657 size, value);
658 if (pci_sun4v_out_of_range(pbm, bus, device, func)) {
659 /* Do nothing. */
660 } else {
661 ret = pci_sun4v_config_put(devhandle,
662 HV_PCI_DEVICE_BUILD(bus, device, func),
663 where, size, value);
664#if 0
665 printk("wcfg: [%x:%x:%x:%d] v[%x] == [%lx]\n",
666 devhandle, HV_PCI_DEVICE_BUILD(bus, device, func),
667 where, size, value, ret);
668#endif
669 }
670 return PCIBIOS_SUCCESSFUL;
671}
672
673static struct pci_ops pci_sun4v_ops = {
674 .read = pci_sun4v_read_pci_cfg,
675 .write = pci_sun4v_write_pci_cfg,
676};
677
678
679static void pci_sun4v_scan_bus(struct pci_pbm_info *pbm) 596static void pci_sun4v_scan_bus(struct pci_pbm_info *pbm)
680{ 597{
681 struct property *prop; 598 struct property *prop;
@@ -1238,7 +1155,8 @@ static void pci_sun4v_pbm_init(struct pci_controller_info *p, struct device_node
1238 pci_pbm_root = pbm; 1155 pci_pbm_root = pbm;
1239 1156
1240 pbm->scan_bus = pci_sun4v_scan_bus; 1157 pbm->scan_bus = pci_sun4v_scan_bus;
1241 pbm->pci_ops = &pci_sun4v_ops; 1158 pbm->pci_ops = &sun4v_pci_ops;
1159 pbm->config_space_reg_bits = 12;
1242 1160
1243 pbm->index = pci_num_pbms++; 1161 pbm->index = pci_num_pbms++;
1244 1162
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index c54d4d8af014..b7976b14d0ba 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -1636,10 +1636,21 @@ static struct device_node * __init create_node(phandle node, struct device_node
1636 1636
1637static struct device_node * __init build_tree(struct device_node *parent, phandle node, struct device_node ***nextp) 1637static struct device_node * __init build_tree(struct device_node *parent, phandle node, struct device_node ***nextp)
1638{ 1638{
1639 struct device_node *ret = NULL, *prev_sibling = NULL;
1639 struct device_node *dp; 1640 struct device_node *dp;
1640 1641
1641 dp = create_node(node, parent); 1642 while (1) {
1642 if (dp) { 1643 dp = create_node(node, parent);
1644 if (!dp)
1645 break;
1646
1647 if (prev_sibling)
1648 prev_sibling->sibling = dp;
1649
1650 if (!ret)
1651 ret = dp;
1652 prev_sibling = dp;
1653
1643 *(*nextp) = dp; 1654 *(*nextp) = dp;
1644 *nextp = &dp->allnext; 1655 *nextp = &dp->allnext;
1645 1656
@@ -1648,10 +1659,10 @@ static struct device_node * __init build_tree(struct device_node *parent, phandl
1648 1659
1649 dp->child = build_tree(dp, prom_getchild(node), nextp); 1660 dp->child = build_tree(dp, prom_getchild(node), nextp);
1650 1661
1651 dp->sibling = build_tree(parent, prom_getsibling(node), nextp); 1662 node = prom_getsibling(node);
1652 } 1663 }
1653 1664
1654 return dp; 1665 return ret;
1655} 1666}
1656 1667
1657void __init prom_build_devicetree(void) 1668void __init prom_build_devicetree(void)
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 8c2ac41187c1..d28f01379b9b 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -778,6 +778,7 @@ asmlinkage __kprobes void default_do_nmi(struct pt_regs *regs)
778 return; 778 return;
779 if (notify_die(DIE_NMI_POST, "nmi_post", regs, reason, 2, 0) 779 if (notify_die(DIE_NMI_POST, "nmi_post", regs, reason, 2, 0)
780 == NOTIFY_STOP) 780 == NOTIFY_STOP)
781 return;
781 if (!do_nmi_callback(regs,cpu)) 782 if (!do_nmi_callback(regs,cpu))
782 unknown_nmi_error(reason, regs); 783 unknown_nmi_error(reason, regs);
783 784