aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/avr32/boards/atstk1000/Makefile2
-rw-r--r--arch/avr32/boards/atstk1000/atstk1002.c53
-rw-r--r--arch/avr32/boards/atstk1000/spi.c27
-rw-r--r--arch/avr32/kernel/cpu.c1
-rw-r--r--arch/avr32/kernel/irq.c1
-rw-r--r--arch/avr32/kernel/setup.c4
-rw-r--r--arch/avr32/lib/libgcc.h33
-rw-r--r--arch/avr32/lib/longlong.h98
-rw-r--r--arch/avr32/mach-at32ap/Makefile2
-rw-r--r--arch/avr32/mach-at32ap/at32ap7000.c60
-rw-r--r--arch/avr32/mach-at32ap/extint.c36
-rw-r--r--arch/avr32/mach-at32ap/pio.c255
-rw-r--r--arch/avr32/mm/cache.c32
-rw-r--r--arch/i386/kernel/hpet.c5
-rw-r--r--arch/i386/kernel/io_apic.c2
-rw-r--r--arch/i386/mm/pageattr.c2
-rw-r--r--arch/ia64/kernel/crash.c2
-rw-r--r--arch/ia64/kernel/smp.c4
-rw-r--r--arch/powerpc/platforms/cell/iommu.c5
-rw-r--r--arch/powerpc/platforms/celleb/pci.c12
-rw-r--r--arch/powerpc/platforms/celleb/scc_epci.c56
-rw-r--r--arch/powerpc/platforms/chrp/setup.c4
-rw-r--r--arch/powerpc/platforms/ps3/interrupt.c2
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c2
-rw-r--r--arch/powerpc/xmon/spu-dis.c2
-rw-r--r--arch/s390/defconfig3
26 files changed, 438 insertions, 267 deletions
diff --git a/arch/avr32/boards/atstk1000/Makefile b/arch/avr32/boards/atstk1000/Makefile
index df9499480530..8e0992201bb9 100644
--- a/arch/avr32/boards/atstk1000/Makefile
+++ b/arch/avr32/boards/atstk1000/Makefile
@@ -1,2 +1,2 @@
1obj-y += setup.o spi.o flash.o 1obj-y += setup.o flash.o
2obj-$(CONFIG_BOARD_ATSTK1002) += atstk1002.o 2obj-$(CONFIG_BOARD_ATSTK1002) += atstk1002.o
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c
index 32b361f31c2c..d47e39f0e971 100644
--- a/arch/avr32/boards/atstk1000/atstk1002.c
+++ b/arch/avr32/boards/atstk1000/atstk1002.c
@@ -8,17 +8,24 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/device.h>
11#include <linux/etherdevice.h> 12#include <linux/etherdevice.h>
12#include <linux/init.h> 13#include <linux/init.h>
13#include <linux/kernel.h> 14#include <linux/kernel.h>
14#include <linux/platform_device.h> 15#include <linux/platform_device.h>
15#include <linux/string.h> 16#include <linux/string.h>
16#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/spi/spi.h>
17 19
18#include <asm/io.h> 20#include <asm/io.h>
19#include <asm/setup.h> 21#include <asm/setup.h>
22#include <asm/arch/at32ap7000.h>
20#include <asm/arch/board.h> 23#include <asm/arch/board.h>
21#include <asm/arch/init.h> 24#include <asm/arch/init.h>
25#include <asm/arch/portmux.h>
26
27
28#define SW2_DEFAULT /* MMCI and UART_A available */
22 29
23struct eth_addr { 30struct eth_addr {
24 u8 addr[6]; 31 u8 addr[6];
@@ -29,6 +36,16 @@ static struct eth_addr __initdata hw_addr[2];
29static struct eth_platform_data __initdata eth_data[2]; 36static struct eth_platform_data __initdata eth_data[2];
30extern struct lcdc_platform_data atstk1000_fb0_data; 37extern struct lcdc_platform_data atstk1000_fb0_data;
31 38
39static struct spi_board_info spi_board_info[] __initdata = {
40 {
41 .modalias = "ltv350qv",
42 .controller_data = (void *)GPIO_PIN_PA(4),
43 .max_speed_hz = 16000000,
44 .bus_num = 0,
45 .chip_select = 1,
46 },
47};
48
32/* 49/*
33 * The next two functions should go away as the boot loader is 50 * The next two functions should go away as the boot loader is
34 * supposed to initialize the macb address registers with a valid 51 * supposed to initialize the macb address registers with a valid
@@ -86,23 +103,53 @@ static void __init set_hw_addr(struct platform_device *pdev)
86 103
87void __init setup_board(void) 104void __init setup_board(void)
88{ 105{
89 at32_map_usart(1, 0); /* /dev/ttyS0 */ 106#ifdef SW2_DEFAULT
90 at32_map_usart(2, 1); /* /dev/ttyS1 */ 107 at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */
91 at32_map_usart(3, 2); /* /dev/ttyS2 */ 108#else
109 at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */
110#endif
111 /* USART 2/unused: expansion connector */
112 at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */
92 113
93 at32_setup_serial_console(0); 114 at32_setup_serial_console(0);
94} 115}
95 116
96static int __init atstk1002_init(void) 117static int __init atstk1002_init(void)
97{ 118{
119 /*
120 * ATSTK1000 uses 32-bit SDRAM interface. Reserve the
121 * SDRAM-specific pins so that nobody messes with them.
122 */
123 at32_reserve_pin(GPIO_PIN_PE(0)); /* DATA[16] */
124 at32_reserve_pin(GPIO_PIN_PE(1)); /* DATA[17] */
125 at32_reserve_pin(GPIO_PIN_PE(2)); /* DATA[18] */
126 at32_reserve_pin(GPIO_PIN_PE(3)); /* DATA[19] */
127 at32_reserve_pin(GPIO_PIN_PE(4)); /* DATA[20] */
128 at32_reserve_pin(GPIO_PIN_PE(5)); /* DATA[21] */
129 at32_reserve_pin(GPIO_PIN_PE(6)); /* DATA[22] */
130 at32_reserve_pin(GPIO_PIN_PE(7)); /* DATA[23] */
131 at32_reserve_pin(GPIO_PIN_PE(8)); /* DATA[24] */
132 at32_reserve_pin(GPIO_PIN_PE(9)); /* DATA[25] */
133 at32_reserve_pin(GPIO_PIN_PE(10)); /* DATA[26] */
134 at32_reserve_pin(GPIO_PIN_PE(11)); /* DATA[27] */
135 at32_reserve_pin(GPIO_PIN_PE(12)); /* DATA[28] */
136 at32_reserve_pin(GPIO_PIN_PE(13)); /* DATA[29] */
137 at32_reserve_pin(GPIO_PIN_PE(14)); /* DATA[30] */
138 at32_reserve_pin(GPIO_PIN_PE(15)); /* DATA[31] */
139 at32_reserve_pin(GPIO_PIN_PE(26)); /* SDCS */
140
98 at32_add_system_devices(); 141 at32_add_system_devices();
99 142
143#ifdef SW2_DEFAULT
100 at32_add_device_usart(0); 144 at32_add_device_usart(0);
145#else
101 at32_add_device_usart(1); 146 at32_add_device_usart(1);
147#endif
102 at32_add_device_usart(2); 148 at32_add_device_usart(2);
103 149
104 set_hw_addr(at32_add_device_eth(0, &eth_data[0])); 150 set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
105 151
152 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
106 at32_add_device_spi(0); 153 at32_add_device_spi(0);
107 at32_add_device_lcdc(0, &atstk1000_fb0_data); 154 at32_add_device_lcdc(0, &atstk1000_fb0_data);
108 155
diff --git a/arch/avr32/boards/atstk1000/spi.c b/arch/avr32/boards/atstk1000/spi.c
deleted file mode 100644
index 567726c82c6e..000000000000
--- a/arch/avr32/boards/atstk1000/spi.c
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * ATSTK1000 SPI devices
3 *
4 * Copyright (C) 2005 Atmel Norway
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/device.h>
11#include <linux/spi/spi.h>
12
13static struct spi_board_info spi_board_info[] __initdata = {
14 {
15 .modalias = "ltv350qv",
16 .max_speed_hz = 16000000,
17 .bus_num = 0,
18 .chip_select = 1,
19 },
20};
21
22static int board_init_spi(void)
23{
24 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
25 return 0;
26}
27arch_initcall(board_init_spi);
diff --git a/arch/avr32/kernel/cpu.c b/arch/avr32/kernel/cpu.c
index 342452ba2049..2e72fd2699df 100644
--- a/arch/avr32/kernel/cpu.c
+++ b/arch/avr32/kernel/cpu.c
@@ -9,6 +9,7 @@
9#include <linux/sysdev.h> 9#include <linux/sysdev.h>
10#include <linux/seq_file.h> 10#include <linux/seq_file.h>
11#include <linux/cpu.h> 11#include <linux/cpu.h>
12#include <linux/module.h>
12#include <linux/percpu.h> 13#include <linux/percpu.h>
13#include <linux/param.h> 14#include <linux/param.h>
14#include <linux/errno.h> 15#include <linux/errno.h>
diff --git a/arch/avr32/kernel/irq.c b/arch/avr32/kernel/irq.c
index 856f3548e664..fd311248c143 100644
--- a/arch/avr32/kernel/irq.c
+++ b/arch/avr32/kernel/irq.c
@@ -57,6 +57,7 @@ int show_interrupts(struct seq_file *p, void *v)
57 seq_printf(p, "%3d: ", i); 57 seq_printf(p, "%3d: ", i);
58 for_each_online_cpu(cpu) 58 for_each_online_cpu(cpu)
59 seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]); 59 seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]);
60 seq_printf(p, " %8s", irq_desc[i].chip->name ? : "-");
60 seq_printf(p, " %s", action->name); 61 seq_printf(p, " %s", action->name);
61 for (action = action->next; action; action = action->next) 62 for (action = action->next; action; action = action->next)
62 seq_printf(p, ", %s", action->name); 63 seq_printf(p, ", %s", action->name);
diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c
index a34211601008..c6734aefb559 100644
--- a/arch/avr32/kernel/setup.c
+++ b/arch/avr32/kernel/setup.c
@@ -16,6 +16,7 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/root_dev.h> 17#include <linux/root_dev.h>
18#include <linux/cpu.h> 18#include <linux/cpu.h>
19#include <linux/kernel.h>
19 20
20#include <asm/sections.h> 21#include <asm/sections.h>
21#include <asm/processor.h> 22#include <asm/processor.h>
@@ -174,8 +175,7 @@ static int __init parse_tag_mem_range(struct tag *tag,
174 * Copy the data so the bootmem init code doesn't need to care 175 * Copy the data so the bootmem init code doesn't need to care
175 * about it. 176 * about it.
176 */ 177 */
177 if (mem_range_next_free >= 178 if (mem_range_next_free >= ARRAY_SIZE(mem_range_cache))
178 (sizeof(mem_range_cache) / sizeof(mem_range_cache[0])))
179 panic("Physical memory map too complex!\n"); 179 panic("Physical memory map too complex!\n");
180 180
181 new = &mem_range_cache[mem_range_next_free++]; 181 new = &mem_range_cache[mem_range_next_free++];
diff --git a/arch/avr32/lib/libgcc.h b/arch/avr32/lib/libgcc.h
deleted file mode 100644
index 5a091b5e3618..000000000000
--- a/arch/avr32/lib/libgcc.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/* Definitions for various functions 'borrowed' from gcc-3.4.3 */
2
3#define BITS_PER_UNIT 8
4
5typedef int QItype __attribute__ ((mode (QI)));
6typedef unsigned int UQItype __attribute__ ((mode (QI)));
7typedef int HItype __attribute__ ((mode (HI)));
8typedef unsigned int UHItype __attribute__ ((mode (HI)));
9typedef int SItype __attribute__ ((mode (SI)));
10typedef unsigned int USItype __attribute__ ((mode (SI)));
11typedef int DItype __attribute__ ((mode (DI)));
12typedef unsigned int UDItype __attribute__ ((mode (DI)));
13typedef float SFtype __attribute__ ((mode (SF)));
14typedef float DFtype __attribute__ ((mode (DF)));
15typedef int word_type __attribute__ ((mode (__word__)));
16
17#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
18#define Wtype SItype
19#define UWtype USItype
20#define HWtype SItype
21#define UHWtype USItype
22#define DWtype DItype
23#define UDWtype UDItype
24#define __NW(a,b) __ ## a ## si ## b
25#define __NDW(a,b) __ ## a ## di ## b
26
27struct DWstruct {Wtype high, low;};
28
29typedef union
30{
31 struct DWstruct s;
32 DWtype ll;
33} DWunion;
diff --git a/arch/avr32/lib/longlong.h b/arch/avr32/lib/longlong.h
deleted file mode 100644
index cd5e369ac437..000000000000
--- a/arch/avr32/lib/longlong.h
+++ /dev/null
@@ -1,98 +0,0 @@
1/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
2 Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000
3 Free Software Foundation, Inc.
4
5 This definition file is free software; you can redistribute it
6 and/or modify it under the terms of the GNU General Public
7 License as published by the Free Software Foundation; either
8 version 2, or (at your option) any later version.
9
10 This definition file is distributed in the hope that it will be
11 useful, but WITHOUT ANY WARRANTY; without even the implied
12 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
19
20/* Borrowed from gcc-3.4.3 */
21
22#define __BITS4 (W_TYPE_SIZE / 4)
23#define __ll_B ((UWtype) 1 << (W_TYPE_SIZE / 2))
24#define __ll_lowpart(t) ((UWtype) (t) & (__ll_B - 1))
25#define __ll_highpart(t) ((UWtype) (t) >> (W_TYPE_SIZE / 2))
26
27#define count_leading_zeros(count, x) ((count) = __builtin_clz(x))
28
29#define __udiv_qrnnd_c(q, r, n1, n0, d) \
30 do { \
31 UWtype __d1, __d0, __q1, __q0; \
32 UWtype __r1, __r0, __m; \
33 __d1 = __ll_highpart (d); \
34 __d0 = __ll_lowpart (d); \
35 \
36 __r1 = (n1) % __d1; \
37 __q1 = (n1) / __d1; \
38 __m = (UWtype) __q1 * __d0; \
39 __r1 = __r1 * __ll_B | __ll_highpart (n0); \
40 if (__r1 < __m) \
41 { \
42 __q1--, __r1 += (d); \
43 if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\
44 if (__r1 < __m) \
45 __q1--, __r1 += (d); \
46 } \
47 __r1 -= __m; \
48 \
49 __r0 = __r1 % __d1; \
50 __q0 = __r1 / __d1; \
51 __m = (UWtype) __q0 * __d0; \
52 __r0 = __r0 * __ll_B | __ll_lowpart (n0); \
53 if (__r0 < __m) \
54 { \
55 __q0--, __r0 += (d); \
56 if (__r0 >= (d)) \
57 if (__r0 < __m) \
58 __q0--, __r0 += (d); \
59 } \
60 __r0 -= __m; \
61 \
62 (q) = (UWtype) __q1 * __ll_B | __q0; \
63 (r) = __r0; \
64 } while (0)
65
66#define udiv_qrnnd __udiv_qrnnd_c
67
68#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
69 do { \
70 UWtype __x; \
71 __x = (al) - (bl); \
72 (sh) = (ah) - (bh) - (__x > (al)); \
73 (sl) = __x; \
74 } while (0)
75
76#define umul_ppmm(w1, w0, u, v) \
77 do { \
78 UWtype __x0, __x1, __x2, __x3; \
79 UHWtype __ul, __vl, __uh, __vh; \
80 \
81 __ul = __ll_lowpart (u); \
82 __uh = __ll_highpart (u); \
83 __vl = __ll_lowpart (v); \
84 __vh = __ll_highpart (v); \
85 \
86 __x0 = (UWtype) __ul * __vl; \
87 __x1 = (UWtype) __ul * __vh; \
88 __x2 = (UWtype) __uh * __vl; \
89 __x3 = (UWtype) __uh * __vh; \
90 \
91 __x1 += __ll_highpart (__x0);/* this can't give carry */ \
92 __x1 += __x2; /* but this indeed can */ \
93 if (__x1 < __x2) /* did we get it? */ \
94 __x3 += __ll_B; /* yes, add it in the proper pos. */ \
95 \
96 (w1) = __x3 + __ll_highpart (__x1); \
97 (w0) = __ll_lowpart (__x1) * __ll_B + __ll_lowpart (__x0); \
98 } while (0)
diff --git a/arch/avr32/mach-at32ap/Makefile b/arch/avr32/mach-at32ap/Makefile
index f62eb6915510..b21bea9af8b1 100644
--- a/arch/avr32/mach-at32ap/Makefile
+++ b/arch/avr32/mach-at32ap/Makefile
@@ -1,2 +1,2 @@
1obj-y += at32ap.o clock.o pio.o intc.o extint.o hsmc.o 1obj-y += at32ap.o clock.o intc.o extint.o pio.o hsmc.o
2obj-$(CONFIG_CPU_AT32AP7000) += at32ap7000.o 2obj-$(CONFIG_CPU_AT32AP7000) += at32ap7000.o
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c
index 48f4ef38c70e..c1e477ec7576 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -496,9 +496,16 @@ static struct resource pio3_resource[] = {
496DEFINE_DEV(pio, 3); 496DEFINE_DEV(pio, 3);
497DEV_CLK(mck, pio3, pba, 13); 497DEV_CLK(mck, pio3, pba, 13);
498 498
499static struct resource pio4_resource[] = {
500 PBMEM(0xffe03800),
501 IRQ(17),
502};
503DEFINE_DEV(pio, 4);
504DEV_CLK(mck, pio4, pba, 14);
505
499void __init at32_add_system_devices(void) 506void __init at32_add_system_devices(void)
500{ 507{
501 system_manager.eim_first_irq = NR_INTERNAL_IRQS; 508 system_manager.eim_first_irq = EIM_IRQ_BASE;
502 509
503 platform_device_register(&at32_sm_device); 510 platform_device_register(&at32_sm_device);
504 platform_device_register(&at32_intc0_device); 511 platform_device_register(&at32_intc0_device);
@@ -509,6 +516,7 @@ void __init at32_add_system_devices(void)
509 platform_device_register(&pio1_device); 516 platform_device_register(&pio1_device);
510 platform_device_register(&pio2_device); 517 platform_device_register(&pio2_device);
511 platform_device_register(&pio3_device); 518 platform_device_register(&pio3_device);
519 platform_device_register(&pio4_device);
512} 520}
513 521
514/* -------------------------------------------------------------------- 522/* --------------------------------------------------------------------
@@ -521,7 +529,7 @@ static struct atmel_uart_data atmel_usart0_data = {
521}; 529};
522static struct resource atmel_usart0_resource[] = { 530static struct resource atmel_usart0_resource[] = {
523 PBMEM(0xffe00c00), 531 PBMEM(0xffe00c00),
524 IRQ(7), 532 IRQ(6),
525}; 533};
526DEFINE_DEV_DATA(atmel_usart, 0); 534DEFINE_DEV_DATA(atmel_usart, 0);
527DEV_CLK(usart, atmel_usart0, pba, 4); 535DEV_CLK(usart, atmel_usart0, pba, 4);
@@ -583,7 +591,7 @@ static inline void configure_usart3_pins(void)
583 select_peripheral(PB(17), PERIPH_B, 0); /* TXD */ 591 select_peripheral(PB(17), PERIPH_B, 0); /* TXD */
584} 592}
585 593
586static struct platform_device *at32_usarts[4]; 594static struct platform_device *__initdata at32_usarts[4];
587 595
588void __init at32_map_usart(unsigned int hw_id, unsigned int line) 596void __init at32_map_usart(unsigned int hw_id, unsigned int line)
589{ 597{
@@ -728,12 +736,19 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data)
728/* -------------------------------------------------------------------- 736/* --------------------------------------------------------------------
729 * SPI 737 * SPI
730 * -------------------------------------------------------------------- */ 738 * -------------------------------------------------------------------- */
731static struct resource spi0_resource[] = { 739static struct resource atmel_spi0_resource[] = {
732 PBMEM(0xffe00000), 740 PBMEM(0xffe00000),
733 IRQ(3), 741 IRQ(3),
734}; 742};
735DEFINE_DEV(spi, 0); 743DEFINE_DEV(atmel_spi, 0);
736DEV_CLK(mck, spi0, pba, 0); 744DEV_CLK(spi_clk, atmel_spi0, pba, 0);
745
746static struct resource atmel_spi1_resource[] = {
747 PBMEM(0xffe00400),
748 IRQ(4),
749};
750DEFINE_DEV(atmel_spi, 1);
751DEV_CLK(spi_clk, atmel_spi1, pba, 1);
737 752
738struct platform_device *__init at32_add_device_spi(unsigned int id) 753struct platform_device *__init at32_add_device_spi(unsigned int id)
739{ 754{
@@ -741,13 +756,33 @@ struct platform_device *__init at32_add_device_spi(unsigned int id)
741 756
742 switch (id) { 757 switch (id) {
743 case 0: 758 case 0:
744 pdev = &spi0_device; 759 pdev = &atmel_spi0_device;
745 select_peripheral(PA(0), PERIPH_A, 0); /* MISO */ 760 select_peripheral(PA(0), PERIPH_A, 0); /* MISO */
746 select_peripheral(PA(1), PERIPH_A, 0); /* MOSI */ 761 select_peripheral(PA(1), PERIPH_A, 0); /* MOSI */
747 select_peripheral(PA(2), PERIPH_A, 0); /* SCK */ 762 select_peripheral(PA(2), PERIPH_A, 0); /* SCK */
748 select_peripheral(PA(3), PERIPH_A, 0); /* NPCS0 */ 763
749 select_peripheral(PA(4), PERIPH_A, 0); /* NPCS1 */ 764 /* NPCS[2:0] */
750 select_peripheral(PA(5), PERIPH_A, 0); /* NPCS2 */ 765 at32_select_gpio(GPIO_PIN_PA(3),
766 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
767 at32_select_gpio(GPIO_PIN_PA(4),
768 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
769 at32_select_gpio(GPIO_PIN_PA(5),
770 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
771 break;
772
773 case 1:
774 pdev = &atmel_spi1_device;
775 select_peripheral(PB(0), PERIPH_B, 0); /* MISO */
776 select_peripheral(PB(1), PERIPH_B, 0); /* MOSI */
777 select_peripheral(PB(5), PERIPH_B, 0); /* SCK */
778
779 /* NPCS[2:0] */
780 at32_select_gpio(GPIO_PIN_PB(2),
781 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
782 at32_select_gpio(GPIO_PIN_PB(3),
783 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
784 at32_select_gpio(GPIO_PIN_PB(4),
785 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
751 break; 786 break;
752 787
753 default: 788 default:
@@ -860,6 +895,7 @@ struct clk *at32_clock_list[] = {
860 &pio1_mck, 895 &pio1_mck,
861 &pio2_mck, 896 &pio2_mck,
862 &pio3_mck, 897 &pio3_mck,
898 &pio4_mck,
863 &atmel_usart0_usart, 899 &atmel_usart0_usart,
864 &atmel_usart1_usart, 900 &atmel_usart1_usart,
865 &atmel_usart2_usart, 901 &atmel_usart2_usart,
@@ -868,7 +904,8 @@ struct clk *at32_clock_list[] = {
868 &macb0_pclk, 904 &macb0_pclk,
869 &macb1_hclk, 905 &macb1_hclk,
870 &macb1_pclk, 906 &macb1_pclk,
871 &spi0_mck, 907 &atmel_spi0_spi_clk,
908 &atmel_spi1_spi_clk,
872 &lcdc0_hclk, 909 &lcdc0_hclk,
873 &lcdc0_pixclk, 910 &lcdc0_pixclk,
874}; 911};
@@ -880,6 +917,7 @@ void __init at32_portmux_init(void)
880 at32_init_pio(&pio1_device); 917 at32_init_pio(&pio1_device);
881 at32_init_pio(&pio2_device); 918 at32_init_pio(&pio2_device);
882 at32_init_pio(&pio3_device); 919 at32_init_pio(&pio3_device);
920 at32_init_pio(&pio4_device);
883} 921}
884 922
885void __init at32_clock_init(void) 923void __init at32_clock_init(void)
diff --git a/arch/avr32/mach-at32ap/extint.c b/arch/avr32/mach-at32ap/extint.c
index b59272e81b9a..4a60eccfebd2 100644
--- a/arch/avr32/mach-at32ap/extint.c
+++ b/arch/avr32/mach-at32ap/extint.c
@@ -55,20 +55,11 @@ static int eim_set_irq_type(unsigned int irq, unsigned int flow_type)
55 unsigned long flags; 55 unsigned long flags;
56 int ret = 0; 56 int ret = 0;
57 57
58 flow_type &= IRQ_TYPE_SENSE_MASK;
58 if (flow_type == IRQ_TYPE_NONE) 59 if (flow_type == IRQ_TYPE_NONE)
59 flow_type = IRQ_TYPE_LEVEL_LOW; 60 flow_type = IRQ_TYPE_LEVEL_LOW;
60 61
61 desc = &irq_desc[irq]; 62 desc = &irq_desc[irq];
62 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
63 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
64
65 if (flow_type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) {
66 desc->status |= IRQ_LEVEL;
67 set_irq_handler(irq, handle_level_irq);
68 } else {
69 set_irq_handler(irq, handle_edge_irq);
70 }
71
72 spin_lock_irqsave(&sm->lock, flags); 63 spin_lock_irqsave(&sm->lock, flags);
73 64
74 mode = sm_readl(sm, EIM_MODE); 65 mode = sm_readl(sm, EIM_MODE);
@@ -97,9 +88,16 @@ static int eim_set_irq_type(unsigned int irq, unsigned int flow_type)
97 break; 88 break;
98 } 89 }
99 90
100 sm_writel(sm, EIM_MODE, mode); 91 if (ret == 0) {
101 sm_writel(sm, EIM_EDGE, edge); 92 sm_writel(sm, EIM_MODE, mode);
102 sm_writel(sm, EIM_LEVEL, level); 93 sm_writel(sm, EIM_EDGE, edge);
94 sm_writel(sm, EIM_LEVEL, level);
95
96 if (flow_type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
97 flow_type |= IRQ_LEVEL;
98 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
99 desc->status |= flow_type;
100 }
103 101
104 spin_unlock_irqrestore(&sm->lock, flags); 102 spin_unlock_irqrestore(&sm->lock, flags);
105 103
@@ -122,8 +120,6 @@ static void demux_eim_irq(unsigned int irq, struct irq_desc *desc)
122 unsigned long status, pending; 120 unsigned long status, pending;
123 unsigned int i, ext_irq; 121 unsigned int i, ext_irq;
124 122
125 spin_lock(&sm->lock);
126
127 status = sm_readl(sm, EIM_ISR); 123 status = sm_readl(sm, EIM_ISR);
128 pending = status & sm_readl(sm, EIM_IMR); 124 pending = status & sm_readl(sm, EIM_IMR);
129 125
@@ -133,10 +129,11 @@ static void demux_eim_irq(unsigned int irq, struct irq_desc *desc)
133 129
134 ext_irq = i + sm->eim_first_irq; 130 ext_irq = i + sm->eim_first_irq;
135 ext_desc = irq_desc + ext_irq; 131 ext_desc = irq_desc + ext_irq;
136 ext_desc->handle_irq(ext_irq, ext_desc); 132 if (ext_desc->status & IRQ_LEVEL)
133 handle_level_irq(ext_irq, ext_desc);
134 else
135 handle_edge_irq(ext_irq, ext_desc);
137 } 136 }
138
139 spin_unlock(&sm->lock);
140} 137}
141 138
142static int __init eim_init(void) 139static int __init eim_init(void)
@@ -168,8 +165,9 @@ static int __init eim_init(void)
168 sm->eim_chip = &eim_chip; 165 sm->eim_chip = &eim_chip;
169 166
170 for (i = 0; i < nr_irqs; i++) { 167 for (i = 0; i < nr_irqs; i++) {
168 /* NOTE the handler we set here is ignored by the demux */
171 set_irq_chip_and_handler(sm->eim_first_irq + i, &eim_chip, 169 set_irq_chip_and_handler(sm->eim_first_irq + i, &eim_chip,
172 handle_edge_irq); 170 handle_level_irq);
173 set_irq_chip_data(sm->eim_first_irq + i, sm); 171 set_irq_chip_data(sm->eim_first_irq + i, sm);
174 } 172 }
175 173
diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c
index f1280ed8ed6d..9ba5654cde11 100644
--- a/arch/avr32/mach-at32ap/pio.c
+++ b/arch/avr32/mach-at32ap/pio.c
@@ -12,7 +12,9 @@
12#include <linux/debugfs.h> 12#include <linux/debugfs.h>
13#include <linux/fs.h> 13#include <linux/fs.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/irq.h>
15 16
17#include <asm/gpio.h>
16#include <asm/io.h> 18#include <asm/io.h>
17 19
18#include <asm/arch/portmux.h> 20#include <asm/arch/portmux.h>
@@ -26,7 +28,8 @@ struct pio_device {
26 const struct platform_device *pdev; 28 const struct platform_device *pdev;
27 struct clk *clk; 29 struct clk *clk;
28 u32 pinmux_mask; 30 u32 pinmux_mask;
29 char name[32]; 31 u32 gpio_mask;
32 char name[8];
30}; 33};
31 34
32static struct pio_device pio_dev[MAX_NR_PIO_DEVICES]; 35static struct pio_device pio_dev[MAX_NR_PIO_DEVICES];
@@ -76,6 +79,9 @@ void __init at32_select_periph(unsigned int pin, unsigned int periph,
76 if (!(flags & AT32_GPIOF_PULLUP)) 79 if (!(flags & AT32_GPIOF_PULLUP))
77 pio_writel(pio, PUDR, mask); 80 pio_writel(pio, PUDR, mask);
78 81
82 /* gpio_request NOT allowed */
83 set_bit(pin_index, &pio->gpio_mask);
84
79 return; 85 return;
80 86
81fail: 87fail:
@@ -99,19 +105,52 @@ void __init at32_select_gpio(unsigned int pin, unsigned long flags)
99 goto fail; 105 goto fail;
100 } 106 }
101 107
102 pio_writel(pio, PUER, mask); 108 if (flags & AT32_GPIOF_OUTPUT) {
103 if (flags & AT32_GPIOF_HIGH) 109 if (flags & AT32_GPIOF_HIGH)
104 pio_writel(pio, SODR, mask); 110 pio_writel(pio, SODR, mask);
105 else 111 else
106 pio_writel(pio, CODR, mask); 112 pio_writel(pio, CODR, mask);
107 if (flags & AT32_GPIOF_OUTPUT) 113 pio_writel(pio, PUDR, mask);
108 pio_writel(pio, OER, mask); 114 pio_writel(pio, OER, mask);
109 else 115 } else {
116 if (flags & AT32_GPIOF_PULLUP)
117 pio_writel(pio, PUER, mask);
118 else
119 pio_writel(pio, PUDR, mask);
120 if (flags & AT32_GPIOF_DEGLITCH)
121 pio_writel(pio, IFER, mask);
122 else
123 pio_writel(pio, IFDR, mask);
110 pio_writel(pio, ODR, mask); 124 pio_writel(pio, ODR, mask);
125 }
111 126
112 pio_writel(pio, PER, mask); 127 pio_writel(pio, PER, mask);
113 if (!(flags & AT32_GPIOF_PULLUP)) 128
114 pio_writel(pio, PUDR, mask); 129 /* gpio_request now allowed */
130 clear_bit(pin_index, &pio->gpio_mask);
131
132 return;
133
134fail:
135 dump_stack();
136}
137
138/* Reserve a pin, preventing anyone else from changing its configuration. */
139void __init at32_reserve_pin(unsigned int pin)
140{
141 struct pio_device *pio;
142 unsigned int pin_index = pin & 0x1f;
143
144 pio = gpio_to_pio(pin);
145 if (unlikely(!pio)) {
146 printk("pio: invalid pin %u\n", pin);
147 goto fail;
148 }
149
150 if (unlikely(test_and_set_bit(pin_index, &pio->pinmux_mask))) {
151 printk("%s: pin %u is busy\n", pio->name, pin_index);
152 goto fail;
153 }
115 154
116 return; 155 return;
117 156
@@ -119,20 +158,197 @@ fail:
119 dump_stack(); 158 dump_stack();
120} 159}
121 160
161/*--------------------------------------------------------------------------*/
162
163/* GPIO API */
164
165int gpio_request(unsigned int gpio, const char *label)
166{
167 struct pio_device *pio;
168 unsigned int pin;
169
170 pio = gpio_to_pio(gpio);
171 if (!pio)
172 return -ENODEV;
173
174 pin = gpio & 0x1f;
175 if (test_and_set_bit(pin, &pio->gpio_mask))
176 return -EBUSY;
177
178 return 0;
179}
180EXPORT_SYMBOL(gpio_request);
181
182void gpio_free(unsigned int gpio)
183{
184 struct pio_device *pio;
185 unsigned int pin;
186
187 pio = gpio_to_pio(gpio);
188 if (!pio) {
189 printk(KERN_ERR
190 "gpio: attempted to free invalid pin %u\n", gpio);
191 return;
192 }
193
194 pin = gpio & 0x1f;
195 if (!test_and_clear_bit(pin, &pio->gpio_mask))
196 printk(KERN_ERR "gpio: freeing free or non-gpio pin %s-%u\n",
197 pio->name, pin);
198}
199EXPORT_SYMBOL(gpio_free);
200
201int gpio_direction_input(unsigned int gpio)
202{
203 struct pio_device *pio;
204 unsigned int pin;
205
206 pio = gpio_to_pio(gpio);
207 if (!pio)
208 return -ENODEV;
209
210 pin = gpio & 0x1f;
211 pio_writel(pio, ODR, 1 << pin);
212
213 return 0;
214}
215EXPORT_SYMBOL(gpio_direction_input);
216
217int gpio_direction_output(unsigned int gpio)
218{
219 struct pio_device *pio;
220 unsigned int pin;
221
222 pio = gpio_to_pio(gpio);
223 if (!pio)
224 return -ENODEV;
225
226 pin = gpio & 0x1f;
227 pio_writel(pio, OER, 1 << pin);
228
229 return 0;
230}
231EXPORT_SYMBOL(gpio_direction_output);
232
233int gpio_get_value(unsigned int gpio)
234{
235 struct pio_device *pio = &pio_dev[gpio >> 5];
236
237 return (pio_readl(pio, PDSR) >> (gpio & 0x1f)) & 1;
238}
239EXPORT_SYMBOL(gpio_get_value);
240
241void gpio_set_value(unsigned int gpio, int value)
242{
243 struct pio_device *pio = &pio_dev[gpio >> 5];
244 u32 mask;
245
246 mask = 1 << (gpio & 0x1f);
247 if (value)
248 pio_writel(pio, SODR, mask);
249 else
250 pio_writel(pio, CODR, mask);
251}
252EXPORT_SYMBOL(gpio_set_value);
253
254/*--------------------------------------------------------------------------*/
255
256/* GPIO IRQ support */
257
258static void gpio_irq_mask(unsigned irq)
259{
260 unsigned gpio = irq_to_gpio(irq);
261 struct pio_device *pio = &pio_dev[gpio >> 5];
262
263 pio_writel(pio, IDR, 1 << (gpio & 0x1f));
264}
265
266static void gpio_irq_unmask(unsigned irq)
267{
268 unsigned gpio = irq_to_gpio(irq);
269 struct pio_device *pio = &pio_dev[gpio >> 5];
270
271 pio_writel(pio, IER, 1 << (gpio & 0x1f));
272}
273
274static int gpio_irq_type(unsigned irq, unsigned type)
275{
276 if (type != IRQ_TYPE_EDGE_BOTH && type != IRQ_TYPE_NONE)
277 return -EINVAL;
278
279 return 0;
280}
281
282static struct irq_chip gpio_irqchip = {
283 .name = "gpio",
284 .mask = gpio_irq_mask,
285 .unmask = gpio_irq_unmask,
286 .set_type = gpio_irq_type,
287};
288
289static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
290{
291 struct pio_device *pio = get_irq_chip_data(irq);
292 unsigned gpio_irq;
293
294 gpio_irq = (unsigned) get_irq_data(irq);
295 for (;;) {
296 u32 isr;
297 struct irq_desc *d;
298
299 /* ack pending GPIO interrupts */
300 isr = pio_readl(pio, ISR) & pio_readl(pio, IMR);
301 if (!isr)
302 break;
303 do {
304 int i;
305
306 i = ffs(isr) - 1;
307 isr &= ~(1 << i);
308
309 i += gpio_irq;
310 d = &irq_desc[i];
311
312 d->handle_irq(i, d);
313 } while (isr);
314 }
315}
316
317static void __init
318gpio_irq_setup(struct pio_device *pio, int irq, int gpio_irq)
319{
320 unsigned i;
321
322 set_irq_chip_data(irq, pio);
323 set_irq_data(irq, (void *) gpio_irq);
324
325 for (i = 0; i < 32; i++, gpio_irq++) {
326 set_irq_chip_data(gpio_irq, pio);
327 set_irq_chip_and_handler(gpio_irq, &gpio_irqchip,
328 handle_simple_irq);
329 }
330
331 set_irq_chained_handler(irq, gpio_irq_handler);
332}
333
334/*--------------------------------------------------------------------------*/
335
122static int __init pio_probe(struct platform_device *pdev) 336static int __init pio_probe(struct platform_device *pdev)
123{ 337{
124 struct pio_device *pio = NULL; 338 struct pio_device *pio = NULL;
339 int irq = platform_get_irq(pdev, 0);
340 int gpio_irq_base = GPIO_IRQ_BASE + pdev->id * 32;
125 341
126 BUG_ON(pdev->id >= MAX_NR_PIO_DEVICES); 342 BUG_ON(pdev->id >= MAX_NR_PIO_DEVICES);
127 pio = &pio_dev[pdev->id]; 343 pio = &pio_dev[pdev->id];
128 BUG_ON(!pio->regs); 344 BUG_ON(!pio->regs);
129 345
130 /* TODO: Interrupts */ 346 gpio_irq_setup(pio, irq, gpio_irq_base);
131 347
132 platform_set_drvdata(pdev, pio); 348 platform_set_drvdata(pdev, pio);
133 349
134 printk(KERN_INFO "%s: Atmel Port Multiplexer at 0x%p (irq %d)\n", 350 printk(KERN_DEBUG "%s: base 0x%p, irq %d chains %d..%d\n",
135 pio->name, pio->regs, platform_get_irq(pdev, 0)); 351 pio->name, pio->regs, irq, gpio_irq_base, gpio_irq_base + 31);
136 352
137 return 0; 353 return 0;
138} 354}
@@ -148,7 +364,7 @@ static int __init pio_init(void)
148{ 364{
149 return platform_driver_register(&pio_driver); 365 return platform_driver_register(&pio_driver);
150} 366}
151subsys_initcall(pio_init); 367postcore_initcall(pio_init);
152 368
153void __init at32_init_pio(struct platform_device *pdev) 369void __init at32_init_pio(struct platform_device *pdev)
154{ 370{
@@ -184,6 +400,13 @@ void __init at32_init_pio(struct platform_device *pdev)
184 pio->pdev = pdev; 400 pio->pdev = pdev;
185 pio->regs = ioremap(regs->start, regs->end - regs->start + 1); 401 pio->regs = ioremap(regs->start, regs->end - regs->start + 1);
186 402
187 pio_writel(pio, ODR, ~0UL); 403 /*
188 pio_writel(pio, PER, ~0UL); 404 * request_gpio() is only valid for pins that have been
405 * explicitly configured as GPIO and not previously requested
406 */
407 pio->gpio_mask = ~0UL;
408
409 /* start with irqs disabled and acked */
410 pio_writel(pio, IDR, ~0UL);
411 (void) pio_readl(pio, ISR);
189} 412}
diff --git a/arch/avr32/mm/cache.c b/arch/avr32/mm/cache.c
index 450515b245a0..fb13f72e9a02 100644
--- a/arch/avr32/mm/cache.c
+++ b/arch/avr32/mm/cache.c
@@ -22,18 +22,34 @@
22 22
23void invalidate_dcache_region(void *start, size_t size) 23void invalidate_dcache_region(void *start, size_t size)
24{ 24{
25 unsigned long v, begin, end, linesz; 25 unsigned long v, begin, end, linesz, mask;
26 int flush = 0;
26 27
27 linesz = boot_cpu_data.dcache.linesz; 28 linesz = boot_cpu_data.dcache.linesz;
29 mask = linesz - 1;
30
31 /* when first and/or last cachelines are shared, flush them
32 * instead of invalidating ... never discard valid data!
33 */
34 begin = (unsigned long)start;
35 end = begin + size - 1;
36
37 if (begin & mask) {
38 flush_dcache_line(start);
39 begin += linesz;
40 flush = 1;
41 }
42 if ((end & mask) != mask) {
43 flush_dcache_line((void *)end);
44 end -= linesz;
45 flush = 1;
46 }
28 47
29 //printk("invalidate dcache: %p + %u\n", start, size); 48 /* remaining cachelines only need invalidation */
30 49 for (v = begin; v <= end; v += linesz)
31 /* You asked for it, you got it */
32 begin = (unsigned long)start & ~(linesz - 1);
33 end = ((unsigned long)start + size + linesz - 1) & ~(linesz - 1);
34
35 for (v = begin; v < end; v += linesz)
36 invalidate_dcache_line((void *)v); 50 invalidate_dcache_line((void *)v);
51 if (flush)
52 flush_write_buffer();
37} 53}
38 54
39void clean_dcache_region(void *start, size_t size) 55void clean_dcache_region(void *start, size_t size)
diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
index 45a8685bb60b..0b29d41322a2 100644
--- a/arch/i386/kernel/hpet.c
+++ b/arch/i386/kernel/hpet.c
@@ -12,7 +12,7 @@
12/* FSEC = 10^-15 NSEC = 10^-9 */ 12/* FSEC = 10^-15 NSEC = 10^-9 */
13#define FSEC_PER_NSEC 1000000 13#define FSEC_PER_NSEC 1000000
14 14
15static void *hpet_ptr; 15static void __iomem *hpet_ptr;
16 16
17static cycle_t read_hpet(void) 17static cycle_t read_hpet(void)
18{ 18{
@@ -40,8 +40,7 @@ static int __init init_hpet_clocksource(void)
40 return -ENODEV; 40 return -ENODEV;
41 41
42 /* calculate the hpet address: */ 42 /* calculate the hpet address: */
43 hpet_base = 43 hpet_base = ioremap_nocache(hpet_address, HPET_MMAP_SIZE);
44 (void __iomem*)ioremap_nocache(hpet_address, HPET_MMAP_SIZE);
45 hpet_ptr = hpet_base + HPET_COUNTER; 44 hpet_ptr = hpet_base + HPET_COUNTER;
46 45
47 /* calculate the frequency: */ 46 /* calculate the frequency: */
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 5592fa6e1fa1..ba8d302a0b72 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -126,7 +126,7 @@ static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned i
126 */ 126 */
127static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value) 127static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
128{ 128{
129 volatile struct io_apic *io_apic = io_apic_base(apic); 129 volatile struct io_apic __iomem *io_apic = io_apic_base(apic);
130 if (sis_apic_bug) 130 if (sis_apic_bug)
131 writel(reg, &io_apic->index); 131 writel(reg, &io_apic->index);
132 writel(value, &io_apic->data); 132 writel(value, &io_apic->data);
diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c
index ad91528bdc14..e223b1d4981c 100644
--- a/arch/i386/mm/pageattr.c
+++ b/arch/i386/mm/pageattr.c
@@ -224,7 +224,7 @@ void global_flush_tlb(void)
224 list_replace_init(&df_list, &l); 224 list_replace_init(&df_list, &l);
225 spin_unlock_irq(&cpa_lock); 225 spin_unlock_irq(&cpa_lock);
226 if (!cpu_has_clflush) 226 if (!cpu_has_clflush)
227 flush_map(0); 227 flush_map(NULL);
228 list_for_each_entry_safe(pg, next, &l, lru) { 228 list_for_each_entry_safe(pg, next, &l, lru) {
229 if (cpu_has_clflush) 229 if (cpu_has_clflush)
230 flush_map(page_address(pg)); 230 flush_map(page_address(pg));
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c
index 9d92097ce96d..37bb16f07fc3 100644
--- a/arch/ia64/kernel/crash.c
+++ b/arch/ia64/kernel/crash.c
@@ -52,7 +52,7 @@ extern void ia64_dump_cpu_regs(void *);
52static DEFINE_PER_CPU(struct elf_prstatus, elf_prstatus); 52static DEFINE_PER_CPU(struct elf_prstatus, elf_prstatus);
53 53
54void 54void
55crash_save_this_cpu() 55crash_save_this_cpu(void)
56{ 56{
57 void *buf; 57 void *buf;
58 unsigned long cfm, sof, sol; 58 unsigned long cfm, sof, sol;
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
index f4c7f7769cf7..55ddd809b02d 100644
--- a/arch/ia64/kernel/smp.c
+++ b/arch/ia64/kernel/smp.c
@@ -221,13 +221,13 @@ send_IPI_self (int op)
221 221
222#ifdef CONFIG_KEXEC 222#ifdef CONFIG_KEXEC
223void 223void
224kdump_smp_send_stop() 224kdump_smp_send_stop(void)
225{ 225{
226 send_IPI_allbutself(IPI_KDUMP_CPU_STOP); 226 send_IPI_allbutself(IPI_KDUMP_CPU_STOP);
227} 227}
228 228
229void 229void
230kdump_smp_send_init() 230kdump_smp_send_init(void)
231{ 231{
232 unsigned int cpu, self_cpu; 232 unsigned int cpu, self_cpu;
233 self_cpu = smp_processor_id(); 233 self_cpu = smp_processor_id();
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index b43466ba8096..67d617b60a23 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -149,7 +149,8 @@ static int cbe_nr_iommus;
149static void invalidate_tce_cache(struct cbe_iommu *iommu, unsigned long *pte, 149static void invalidate_tce_cache(struct cbe_iommu *iommu, unsigned long *pte,
150 long n_ptes) 150 long n_ptes)
151{ 151{
152 unsigned long *reg, val; 152 unsigned long __iomem *reg;
153 unsigned long val;
153 long n; 154 long n;
154 155
155 reg = iommu->xlate_regs + IOC_IOPT_CacheInvd; 156 reg = iommu->xlate_regs + IOC_IOPT_CacheInvd;
@@ -592,7 +593,7 @@ static void __init cell_iommu_init_one(struct device_node *np, unsigned long off
592 /* Init base fields */ 593 /* Init base fields */
593 i = cbe_nr_iommus++; 594 i = cbe_nr_iommus++;
594 iommu = &iommus[i]; 595 iommu = &iommus[i];
595 iommu->stab = 0; 596 iommu->stab = NULL;
596 iommu->nid = nid; 597 iommu->nid = nid;
597 snprintf(iommu->name, sizeof(iommu->name), "iommu%d", i); 598 snprintf(iommu->name, sizeof(iommu->name), "iommu%d", i);
598 INIT_LIST_HEAD(&iommu->windows); 599 INIT_LIST_HEAD(&iommu->windows);
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c
index 867f83a7d0c9..98de836dfed3 100644
--- a/arch/powerpc/platforms/celleb/pci.c
+++ b/arch/powerpc/platforms/celleb/pci.c
@@ -65,13 +65,13 @@ static inline u8 celleb_fake_config_readb(void *addr)
65 65
66static inline u16 celleb_fake_config_readw(void *addr) 66static inline u16 celleb_fake_config_readw(void *addr)
67{ 67{
68 u16 *p = addr; 68 __le16 *p = addr;
69 return le16_to_cpu(*p); 69 return le16_to_cpu(*p);
70} 70}
71 71
72static inline u32 celleb_fake_config_readl(void *addr) 72static inline u32 celleb_fake_config_readl(void *addr)
73{ 73{
74 u32 *p = addr; 74 __le32 *p = addr;
75 return le32_to_cpu(*p); 75 return le32_to_cpu(*p);
76} 76}
77 77
@@ -83,16 +83,16 @@ static inline void celleb_fake_config_writeb(u32 val, void *addr)
83 83
84static inline void celleb_fake_config_writew(u32 val, void *addr) 84static inline void celleb_fake_config_writew(u32 val, void *addr)
85{ 85{
86 u16 val16; 86 __le16 val16;
87 u16 *p = addr; 87 __le16 *p = addr;
88 val16 = cpu_to_le16(val); 88 val16 = cpu_to_le16(val);
89 *p = val16; 89 *p = val16;
90} 90}
91 91
92static inline void celleb_fake_config_writel(u32 val, void *addr) 92static inline void celleb_fake_config_writel(u32 val, void *addr)
93{ 93{
94 u32 val32; 94 __le32 val32;
95 u32 *p = addr; 95 __le32 *p = addr;
96 val32 = cpu_to_le32(val); 96 val32 = cpu_to_le32(val);
97 *p = val32; 97 *p = val32;
98} 98}
diff --git a/arch/powerpc/platforms/celleb/scc_epci.c b/arch/powerpc/platforms/celleb/scc_epci.c
index 0edbc0c4f338..c11b39c3776a 100644
--- a/arch/powerpc/platforms/celleb/scc_epci.c
+++ b/arch/powerpc/platforms/celleb/scc_epci.c
@@ -47,7 +47,7 @@
47#if 0 /* test code for epci dummy read */ 47#if 0 /* test code for epci dummy read */
48static void celleb_epci_dummy_read(struct pci_dev *dev) 48static void celleb_epci_dummy_read(struct pci_dev *dev)
49{ 49{
50 void *epci_base; 50 void __iomem *epci_base;
51 struct device_node *node; 51 struct device_node *node;
52 struct pci_controller *hose; 52 struct pci_controller *hose;
53 u32 val; 53 u32 val;
@@ -58,7 +58,7 @@ static void celleb_epci_dummy_read(struct pci_dev *dev)
58 if (!hose) 58 if (!hose)
59 return; 59 return;
60 60
61 epci_base = (void *)hose->cfg_addr; 61 epci_base = hose->cfg_addr;
62 62
63 val = in_be32(epci_base + SCC_EPCI_WATRP); 63 val = in_be32(epci_base + SCC_EPCI_WATRP);
64 iosync(); 64 iosync();
@@ -71,18 +71,18 @@ static inline void clear_and_disable_master_abort_interrupt(
71 struct pci_controller *hose) 71 struct pci_controller *hose)
72{ 72{
73 void __iomem *addr; 73 void __iomem *addr;
74 addr = (void *)hose->cfg_addr + PCI_COMMAND; 74 addr = hose->cfg_addr + PCI_COMMAND;
75 out_be32(addr, in_be32(addr) | (PCI_STATUS_REC_MASTER_ABORT << 16)); 75 out_be32(addr, in_be32(addr) | (PCI_STATUS_REC_MASTER_ABORT << 16));
76} 76}
77 77
78static int celleb_epci_check_abort(struct pci_controller *hose, 78static int celleb_epci_check_abort(struct pci_controller *hose,
79 unsigned long addr) 79 void __iomem *addr)
80{ 80{
81 void __iomem *reg, *epci_base; 81 void __iomem *reg, *epci_base;
82 u32 val; 82 u32 val;
83 83
84 iob(); 84 iob();
85 epci_base = (void *)hose->cfg_addr; 85 epci_base = hose->cfg_addr;
86 86
87 reg = epci_base + PCI_COMMAND; 87 reg = epci_base + PCI_COMMAND;
88 val = in_be32(reg); 88 val = in_be32(reg);
@@ -108,23 +108,23 @@ static int celleb_epci_check_abort(struct pci_controller *hose,
108 return PCIBIOS_SUCCESSFUL; 108 return PCIBIOS_SUCCESSFUL;
109} 109}
110 110
111static unsigned long celleb_epci_make_config_addr(struct pci_controller *hose, 111static void __iomem *celleb_epci_make_config_addr(struct pci_controller *hose,
112 unsigned int devfn, int where) 112 unsigned int devfn, int where)
113{ 113{
114 unsigned long addr; 114 void __iomem *addr;
115 struct pci_bus *bus = hose->bus; 115 struct pci_bus *bus = hose->bus;
116 116
117 if (bus->self) 117 if (bus->self)
118 addr = (unsigned long)hose->cfg_data + 118 addr = hose->cfg_data +
119 (((bus->number & 0xff) << 16) 119 (((bus->number & 0xff) << 16)
120 | ((devfn & 0xff) << 8) 120 | ((devfn & 0xff) << 8)
121 | (where & 0xff) 121 | (where & 0xff)
122 | 0x01000000); 122 | 0x01000000);
123 else 123 else
124 addr = (unsigned long)hose->cfg_data + 124 addr = hose->cfg_data +
125 (((devfn & 0xff) << 8) | (where & 0xff)); 125 (((devfn & 0xff) << 8) | (where & 0xff));
126 126
127 pr_debug("EPCI: config_addr = 0x%016lx\n", addr); 127 pr_debug("EPCI: config_addr = 0x%p\n", addr);
128 128
129 return addr; 129 return addr;
130} 130}
@@ -132,7 +132,7 @@ static unsigned long celleb_epci_make_config_addr(struct pci_controller *hose,
132static int celleb_epci_read_config(struct pci_bus *bus, 132static int celleb_epci_read_config(struct pci_bus *bus,
133 unsigned int devfn, int where, int size, u32 * val) 133 unsigned int devfn, int where, int size, u32 * val)
134{ 134{
135 unsigned long addr; 135 void __iomem *addr;
136 struct device_node *node; 136 struct device_node *node;
137 struct pci_controller *hose; 137 struct pci_controller *hose;
138 138
@@ -148,17 +148,17 @@ static int celleb_epci_read_config(struct pci_bus *bus,
148 if (bus->number == hose->first_busno && devfn == 0) { 148 if (bus->number == hose->first_busno && devfn == 0) {
149 /* EPCI controller self */ 149 /* EPCI controller self */
150 150
151 addr = (unsigned long)hose->cfg_addr + where; 151 addr = hose->cfg_addr + where;
152 152
153 switch (size) { 153 switch (size) {
154 case 1: 154 case 1:
155 *val = in_8((u8 *)addr); 155 *val = in_8(addr);
156 break; 156 break;
157 case 2: 157 case 2:
158 *val = in_be16((u16 *)addr); 158 *val = in_be16(addr);
159 break; 159 break;
160 case 4: 160 case 4:
161 *val = in_be32((u32 *)addr); 161 *val = in_be32(addr);
162 break; 162 break;
163 default: 163 default:
164 return PCIBIOS_DEVICE_NOT_FOUND; 164 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -171,13 +171,13 @@ static int celleb_epci_read_config(struct pci_bus *bus,
171 171
172 switch (size) { 172 switch (size) {
173 case 1: 173 case 1:
174 *val = in_8((u8 *)addr); 174 *val = in_8(addr);
175 break; 175 break;
176 case 2: 176 case 2:
177 *val = in_le16((u16 *)addr); 177 *val = in_le16(addr);
178 break; 178 break;
179 case 4: 179 case 4:
180 *val = in_le32((u32 *)addr); 180 *val = in_le32(addr);
181 break; 181 break;
182 default: 182 default:
183 return PCIBIOS_DEVICE_NOT_FOUND; 183 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -188,13 +188,13 @@ static int celleb_epci_read_config(struct pci_bus *bus,
188 "addr=0x%lx, devfn=0x%x, where=0x%x, size=0x%x, val=0x%x\n", 188 "addr=0x%lx, devfn=0x%x, where=0x%x, size=0x%x, val=0x%x\n",
189 addr, devfn, where, size, *val); 189 addr, devfn, where, size, *val);
190 190
191 return celleb_epci_check_abort(hose, 0); 191 return celleb_epci_check_abort(hose, NULL);
192} 192}
193 193
194static int celleb_epci_write_config(struct pci_bus *bus, 194static int celleb_epci_write_config(struct pci_bus *bus,
195 unsigned int devfn, int where, int size, u32 val) 195 unsigned int devfn, int where, int size, u32 val)
196{ 196{
197 unsigned long addr; 197 void __iomem *addr;
198 struct device_node *node; 198 struct device_node *node;
199 struct pci_controller *hose; 199 struct pci_controller *hose;
200 200
@@ -210,17 +210,17 @@ static int celleb_epci_write_config(struct pci_bus *bus,
210 if (bus->number == hose->first_busno && devfn == 0) { 210 if (bus->number == hose->first_busno && devfn == 0) {
211 /* EPCI controller self */ 211 /* EPCI controller self */
212 212
213 addr = (unsigned long)hose->cfg_addr + where; 213 addr = hose->cfg_addr + where;
214 214
215 switch (size) { 215 switch (size) {
216 case 1: 216 case 1:
217 out_8((u8 *)addr, val); 217 out_8(addr, val);
218 break; 218 break;
219 case 2: 219 case 2:
220 out_be16((u16 *)addr, val); 220 out_be16(addr, val);
221 break; 221 break;
222 case 4: 222 case 4:
223 out_be32((u32 *)addr, val); 223 out_be32(addr, val);
224 break; 224 break;
225 default: 225 default:
226 return PCIBIOS_DEVICE_NOT_FOUND; 226 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -233,13 +233,13 @@ static int celleb_epci_write_config(struct pci_bus *bus,
233 233
234 switch (size) { 234 switch (size) {
235 case 1: 235 case 1:
236 out_8((u8 *)addr, val); 236 out_8(addr, val);
237 break; 237 break;
238 case 2: 238 case 2:
239 out_le16((u16 *)addr, val); 239 out_le16(addr, val);
240 break; 240 break;
241 case 4: 241 case 4:
242 out_le32((u32 *)addr, val); 242 out_le32(addr, val);
243 break; 243 break;
244 default: 244 default:
245 return PCIBIOS_DEVICE_NOT_FOUND; 245 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -261,7 +261,7 @@ static int __devinit celleb_epci_init(struct pci_controller *hose)
261 void __iomem *reg, *epci_base; 261 void __iomem *reg, *epci_base;
262 int hwres = 0; 262 int hwres = 0;
263 263
264 epci_base = (void *)hose->cfg_addr; 264 epci_base = hose->cfg_addr;
265 265
266 /* PCI core reset(Internal bus and PCI clock) */ 266 /* PCI core reset(Internal bus and PCI clock) */
267 reg = epci_base + SCC_EPCI_CKCTRL; 267 reg = epci_base + SCC_EPCI_CKCTRL;
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index e1f51d455984..117c9a0055bd 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -75,7 +75,7 @@ extern irqreturn_t xmon_irq(int, void *);
75extern unsigned long loops_per_jiffy; 75extern unsigned long loops_per_jiffy;
76 76
77/* To be replaced by RTAS when available */ 77/* To be replaced by RTAS when available */
78static unsigned int *briq_SPOR; 78static unsigned int __iomem *briq_SPOR;
79 79
80#ifdef CONFIG_SMP 80#ifdef CONFIG_SMP
81extern struct smp_ops_t chrp_smp_ops; 81extern struct smp_ops_t chrp_smp_ops;
@@ -267,7 +267,7 @@ void __init chrp_setup_arch(void)
267 } else if (machine && strncmp(machine, "TotalImpact,BRIQ-1", 18) == 0) { 267 } else if (machine && strncmp(machine, "TotalImpact,BRIQ-1", 18) == 0) {
268 _chrp_type = _CHRP_briq; 268 _chrp_type = _CHRP_briq;
269 /* Map the SPOR register on briq and change the restart hook */ 269 /* Map the SPOR register on briq and change the restart hook */
270 briq_SPOR = (unsigned int *)ioremap(0xff0000e8, 4); 270 briq_SPOR = ioremap(0xff0000e8, 4);
271 ppc_md.restart = briq_restart; 271 ppc_md.restart = briq_restart;
272 } else { 272 } else {
273 /* Let's assume it is an IBM chrp if all else fails */ 273 /* Let's assume it is an IBM chrp if all else fails */
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c
index bb17283275aa..631c30095617 100644
--- a/arch/powerpc/platforms/ps3/interrupt.c
+++ b/arch/powerpc/platforms/ps3/interrupt.c
@@ -194,6 +194,7 @@ int ps3_alloc_io_irq(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
194 194
195 return result; 195 return result;
196} 196}
197EXPORT_SYMBOL_GPL(ps3_alloc_io_irq);
197 198
198int ps3_free_io_irq(unsigned int virq) 199int ps3_free_io_irq(unsigned int virq)
199{ 200{
@@ -209,6 +210,7 @@ int ps3_free_io_irq(unsigned int virq)
209 210
210 return result; 211 return result;
211} 212}
213EXPORT_SYMBOL_GPL(ps3_free_io_irq);
212 214
213/** 215/**
214 * ps3_alloc_event_irq - Allocate a virq for use with a system event. 216 * ps3_alloc_event_irq - Allocate a virq for use with a system event.
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index bce6136cbce7..a9f7e4a39a2a 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -57,6 +57,7 @@ int ps3_mmio_region_create(struct ps3_mmio_region *r)
57 dump_mmio_region(r); 57 dump_mmio_region(r);
58 return result; 58 return result;
59} 59}
60EXPORT_SYMBOL_GPL(ps3_mmio_region_create);
60 61
61int ps3_free_mmio_region(struct ps3_mmio_region *r) 62int ps3_free_mmio_region(struct ps3_mmio_region *r)
62{ 63{
@@ -72,6 +73,7 @@ int ps3_free_mmio_region(struct ps3_mmio_region *r)
72 r->lpar_addr = 0; 73 r->lpar_addr = 0;
73 return result; 74 return result;
74} 75}
76EXPORT_SYMBOL_GPL(ps3_free_mmio_region);
75 77
76static int ps3_system_bus_match(struct device *_dev, 78static int ps3_system_bus_match(struct device *_dev,
77 struct device_driver *_drv) 79 struct device_driver *_drv)
diff --git a/arch/powerpc/xmon/spu-dis.c b/arch/powerpc/xmon/spu-dis.c
index ee929c641bf3..e5f89837c82e 100644
--- a/arch/powerpc/xmon/spu-dis.c
+++ b/arch/powerpc/xmon/spu-dis.c
@@ -85,7 +85,7 @@ get_index_for_opcode (unsigned int insn)
85 if ((index = spu_disassemble_table[opcode & 0x7ff]) != 0) 85 if ((index = spu_disassemble_table[opcode & 0x7ff]) != 0)
86 return index; 86 return index;
87 87
88 return 0; 88 return NULL;
89} 89}
90 90
91/* Print a Spu instruction. */ 91/* Print a Spu instruction. */
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 7c621b8ef683..1406400bf3ea 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -179,6 +179,8 @@ CONFIG_XFRM=y
179# CONFIG_XFRM_USER is not set 179# CONFIG_XFRM_USER is not set
180# CONFIG_XFRM_SUB_POLICY is not set 180# CONFIG_XFRM_SUB_POLICY is not set
181CONFIG_NET_KEY=y 181CONFIG_NET_KEY=y
182CONFIG_IUCV=m
183CONFIG_AFIUCV=m
182CONFIG_INET=y 184CONFIG_INET=y
183CONFIG_IP_MULTICAST=y 185CONFIG_IP_MULTICAST=y
184# CONFIG_IP_ADVANCED_ROUTER is not set 186# CONFIG_IP_ADVANCED_ROUTER is not set
@@ -508,7 +510,6 @@ CONFIG_NET_ETHERNET=y
508# 510#
509CONFIG_LCS=m 511CONFIG_LCS=m
510CONFIG_CTC=m 512CONFIG_CTC=m
511CONFIG_IUCV=m
512# CONFIG_NETIUCV is not set 513# CONFIG_NETIUCV is not set
513# CONFIG_SMSGIUCV is not set 514# CONFIG_SMSGIUCV is not set
514# CONFIG_CLAW is not set 515# CONFIG_CLAW is not set