aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap1/id.c2
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c10
-rw-r--r--arch/arm/mach-omap2/board-ldp.c10
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c7
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c10
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c10
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c10
-rw-r--r--arch/arm/mach-omap2/board-zoom2.c10
-rw-r--r--arch/arm/mach-omap2/cm4xxx.c17
-rw-r--r--arch/arm/mach-omap2/devices.c65
-rw-r--r--arch/arm/mach-omap2/io.c4
-rw-r--r--arch/arm/mach-omap2/iommu2.c2
-rw-r--r--arch/arm/mach-omap2/mailbox.c33
-rw-r--r--arch/arm/mach-omap2/mux.c4
-rw-r--r--arch/arm/mach-omap2/serial.c6
-rw-r--r--arch/arm/plat-omap/gpio.c2
-rw-r--r--arch/arm/plat-omap/include/mach/keypad.h5
-rw-r--r--arch/arm/plat-omap/include/mach/mux.h2
-rw-r--r--arch/arm/plat-omap/iovmm.c5
-rw-r--r--arch/mips/alchemy/common/dbdma.c8
-rw-r--r--arch/mips/basler/excite/excite_iodev.c2
-rw-r--r--arch/mips/bcm63xx/Makefile2
-rw-r--r--arch/mips/bcm63xx/boards/board_bcm963xx.c8
-rw-r--r--arch/mips/bcm63xx/dev-pcmcia.c144
-rw-r--r--arch/mips/bcm63xx/dev-uart.c41
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pcmcia.h13
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h6
-rw-r--r--arch/mips/include/asm/smp.h15
-rw-r--r--arch/mips/include/asm/unaligned.h4
-rw-r--r--arch/mips/kernel/kspd.c33
-rw-r--r--arch/mips/kernel/rtlx.c15
-rw-r--r--arch/mips/kernel/smp.c14
-rw-r--r--arch/mips/kernel/smtc.c5
-rw-r--r--arch/mips/kernel/vpe.c77
-rw-r--r--arch/mips/mm/sc-mips.c5
-rw-r--r--arch/mips/oprofile/op_model_loongson2.c14
-rw-r--r--arch/mips/pci/ops-pmcmsp.c5
-rw-r--r--arch/mips/sgi-ip27/ip27-smp.c2
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c4
-rw-r--r--arch/mips/sibyte/common/sb_tbprof.c33
-rw-r--r--arch/mips/sibyte/swarm/setup.c2
-rw-r--r--arch/sparc/Kconfig3
-rw-r--r--arch/sparc/kernel/smp_64.c53
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c5
44 files changed, 531 insertions, 196 deletions
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index 4ef26faf083e..e5dcdf764c91 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -38,7 +38,7 @@ static struct omap_id omap_ids[] __initdata = {
38 { .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type = 0x03100000}, 38 { .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type = 0x03100000},
39 { .jtag_id = 0x355f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300100}, 39 { .jtag_id = 0x355f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300100},
40 { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300300}, 40 { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300300},
41 { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320500, .type = 0x08500000}, 41 { .jtag_id = 0xb62c, .die_rev = 0x1, .omap_id = 0x03320500, .type = 0x08500000},
42 { .jtag_id = 0xb470, .die_rev = 0x0, .omap_id = 0x03310100, .type = 0x15100000}, 42 { .jtag_id = 0xb470, .die_rev = 0x0, .omap_id = 0x03310100, .type = 0x15100000},
43 { .jtag_id = 0xb576, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x16100000}, 43 { .jtag_id = 0xb576, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x16100000},
44 { .jtag_id = 0xb576, .die_rev = 0x2, .omap_id = 0x03320100, .type = 0x16110000}, 44 { .jtag_id = 0xb576, .die_rev = 0x2, .omap_id = 0x03320100, .type = 0x16110000},
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index bd57ec76dc5e..efaf053eba85 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -54,7 +54,7 @@
54 54
55#define TWL4030_MSECURE_GPIO 22 55#define TWL4030_MSECURE_GPIO 22
56 56
57static int sdp3430_keymap[] = { 57static int board_keymap[] = {
58 KEY(0, 0, KEY_LEFT), 58 KEY(0, 0, KEY_LEFT),
59 KEY(0, 1, KEY_RIGHT), 59 KEY(0, 1, KEY_RIGHT),
60 KEY(0, 2, KEY_A), 60 KEY(0, 2, KEY_A),
@@ -88,11 +88,15 @@ static int sdp3430_keymap[] = {
88 0 88 0
89}; 89};
90 90
91static struct matrix_keymap_data board_map_data = {
92 .keymap = board_keymap,
93 .keymap_size = ARRAY_SIZE(board_keymap),
94};
95
91static struct twl4030_keypad_data sdp3430_kp_data = { 96static struct twl4030_keypad_data sdp3430_kp_data = {
97 .keymap_data = &board_map_data,
92 .rows = 5, 98 .rows = 5,
93 .cols = 6, 99 .cols = 6,
94 .keymap = sdp3430_keymap,
95 .keymapsize = ARRAY_SIZE(sdp3430_keymap),
96 .rep = 1, 100 .rep = 1,
97}; 101};
98 102
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index ec6854cbdd9f..d110a7fdfbd8 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -80,7 +80,7 @@ static struct platform_device ldp_smsc911x_device = {
80 }, 80 },
81}; 81};
82 82
83static int ldp_twl4030_keymap[] = { 83static int board_keymap[] = {
84 KEY(0, 0, KEY_1), 84 KEY(0, 0, KEY_1),
85 KEY(1, 0, KEY_2), 85 KEY(1, 0, KEY_2),
86 KEY(2, 0, KEY_3), 86 KEY(2, 0, KEY_3),
@@ -101,11 +101,15 @@ static int ldp_twl4030_keymap[] = {
101 0 101 0
102}; 102};
103 103
104static struct matrix_keymap_data board_map_data = {
105 .keymap = board_keymap,
106 .keymap_size = ARRAY_SIZE(board_keymap),
107};
108
104static struct twl4030_keypad_data ldp_kp_twl4030_data = { 109static struct twl4030_keypad_data ldp_kp_twl4030_data = {
110 .keymap_data = &board_map_data,
105 .rows = 6, 111 .rows = 6,
106 .cols = 6, 112 .cols = 6,
107 .keymap = ldp_twl4030_keymap,
108 .keymapsize = ARRAY_SIZE(ldp_twl4030_keymap),
109 .rep = 1, 113 .rep = 1,
110}; 114};
111 115
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 500c9956876d..70df6b4dbcd4 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -139,8 +139,13 @@ static struct gpio_led gpio_leds[];
139static int beagle_twl_gpio_setup(struct device *dev, 139static int beagle_twl_gpio_setup(struct device *dev,
140 unsigned gpio, unsigned ngpio) 140 unsigned gpio, unsigned ngpio)
141{ 141{
142 if (system_rev >= 0x20 && system_rev <= 0x34301000) {
143 omap_cfg_reg(AG9_34XX_GPIO23);
144 mmc[0].gpio_wp = 23;
145 } else {
146 omap_cfg_reg(AH8_34XX_GPIO29);
147 }
142 /* gpio + 0 is "mmc0_cd" (input/IRQ) */ 148 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
143 omap_cfg_reg(AH8_34XX_GPIO29);
144 mmc[0].gpio_cd = gpio + 0; 149 mmc[0].gpio_cd = gpio + 0;
145 twl4030_mmc_init(mmc); 150 twl4030_mmc_init(mmc);
146 151
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index d50b9be90580..e4ec0c591216 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -159,7 +159,7 @@ static struct twl4030_usb_data omap3evm_usb_data = {
159 .usb_mode = T2_USB_MODE_ULPI, 159 .usb_mode = T2_USB_MODE_ULPI,
160}; 160};
161 161
162static int omap3evm_keymap[] = { 162static int board_keymap[] = {
163 KEY(0, 0, KEY_LEFT), 163 KEY(0, 0, KEY_LEFT),
164 KEY(0, 1, KEY_RIGHT), 164 KEY(0, 1, KEY_RIGHT),
165 KEY(0, 2, KEY_A), 165 KEY(0, 2, KEY_A),
@@ -178,11 +178,15 @@ static int omap3evm_keymap[] = {
178 KEY(3, 3, KEY_P) 178 KEY(3, 3, KEY_P)
179}; 179};
180 180
181static struct matrix_keymap_data board_map_data = {
182 .keymap = board_keymap,
183 .keymap_size = ARRAY_SIZE(board_keymap),
184};
185
181static struct twl4030_keypad_data omap3evm_kp_data = { 186static struct twl4030_keypad_data omap3evm_kp_data = {
187 .keymap_data = &board_map_data,
182 .rows = 4, 188 .rows = 4,
183 .cols = 4, 189 .cols = 4,
184 .keymap = omap3evm_keymap,
185 .keymapsize = ARRAY_SIZE(omap3evm_keymap),
186 .rep = 1, 190 .rep = 1,
187}; 191};
188 192
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index b43f6e36b6d9..7f6bf8772af7 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -133,7 +133,7 @@ static void __init pandora_keys_gpio_init(void)
133 omap_set_gpio_debounce_time(32 * 5, GPIO_DEBOUNCE_TIME); 133 omap_set_gpio_debounce_time(32 * 5, GPIO_DEBOUNCE_TIME);
134} 134}
135 135
136static int pandora_keypad_map[] = { 136static int board_keymap[] = {
137 /* col, row, code */ 137 /* col, row, code */
138 KEY(0, 0, KEY_9), 138 KEY(0, 0, KEY_9),
139 KEY(0, 1, KEY_0), 139 KEY(0, 1, KEY_0),
@@ -180,11 +180,15 @@ static int pandora_keypad_map[] = {
180 KEY(5, 2, KEY_FN), 180 KEY(5, 2, KEY_FN),
181}; 181};
182 182
183static struct matrix_keymap_data board_map_data = {
184 .keymap = board_keymap,
185 .keymap_size = ARRAY_SIZE(board_keymap),
186};
187
183static struct twl4030_keypad_data pandora_kp_data = { 188static struct twl4030_keypad_data pandora_kp_data = {
189 .keymap_data = &board_map_data,
184 .rows = 8, 190 .rows = 8,
185 .cols = 6, 191 .cols = 6,
186 .keymap = pandora_keypad_map,
187 .keymapsize = ARRAY_SIZE(pandora_keypad_map),
188 .rep = 1, 192 .rep = 1,
189}; 193};
190 194
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index e6e8290b7828..b45ad312c587 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -36,7 +36,7 @@
36#define SYSTEM_REV_B_USES_VAUX3 0x1699 36#define SYSTEM_REV_B_USES_VAUX3 0x1699
37#define SYSTEM_REV_S_USES_VAUX3 0x8 37#define SYSTEM_REV_S_USES_VAUX3 0x8
38 38
39static int rx51_keymap[] = { 39static int board_keymap[] = {
40 KEY(0, 0, KEY_Q), 40 KEY(0, 0, KEY_Q),
41 KEY(0, 1, KEY_W), 41 KEY(0, 1, KEY_W),
42 KEY(0, 2, KEY_E), 42 KEY(0, 2, KEY_E),
@@ -83,11 +83,15 @@ static int rx51_keymap[] = {
83 KEY(0xff, 5, KEY_F10), 83 KEY(0xff, 5, KEY_F10),
84}; 84};
85 85
86static struct matrix_keymap_data board_map_data = {
87 .keymap = board_keymap,
88 .keymap_size = ARRAY_SIZE(board_keymap),
89};
90
86static struct twl4030_keypad_data rx51_kp_data = { 91static struct twl4030_keypad_data rx51_kp_data = {
92 .keymap_data = &board_map_data,
87 .rows = 8, 93 .rows = 8,
88 .cols = 8, 94 .cols = 8,
89 .keymap = rx51_keymap,
90 .keymapsize = ARRAY_SIZE(rx51_keymap),
91 .rep = 1, 95 .rep = 1,
92}; 96};
93 97
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
index 324009edbd53..b7b32208ced7 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -27,7 +27,7 @@
27#include "mmc-twl4030.h" 27#include "mmc-twl4030.h"
28 28
29/* Zoom2 has Qwerty keyboard*/ 29/* Zoom2 has Qwerty keyboard*/
30static int zoom2_twl4030_keymap[] = { 30static int board_keymap[] = {
31 KEY(0, 0, KEY_E), 31 KEY(0, 0, KEY_E),
32 KEY(1, 0, KEY_R), 32 KEY(1, 0, KEY_R),
33 KEY(2, 0, KEY_T), 33 KEY(2, 0, KEY_T),
@@ -82,11 +82,15 @@ static int zoom2_twl4030_keymap[] = {
82 0 82 0
83}; 83};
84 84
85static struct matrix_keymap_data board_map_data = {
86 .keymap = board_keymap,
87 .keymap_size = ARRAY_SIZE(board_keymap),
88};
89
85static struct twl4030_keypad_data zoom2_kp_twl4030_data = { 90static struct twl4030_keypad_data zoom2_kp_twl4030_data = {
91 .keymap_data = &board_map_data,
86 .rows = 8, 92 .rows = 8,
87 .cols = 8, 93 .cols = 8,
88 .keymap = zoom2_twl4030_keymap,
89 .keymapsize = ARRAY_SIZE(zoom2_twl4030_keymap),
90 .rep = 1, 94 .rep = 1,
91}; 95};
92 96
diff --git a/arch/arm/mach-omap2/cm4xxx.c b/arch/arm/mach-omap2/cm4xxx.c
index e4ebd6d53135..4af76bb1003a 100644
--- a/arch/arm/mach-omap2/cm4xxx.c
+++ b/arch/arm/mach-omap2/cm4xxx.c
@@ -22,7 +22,6 @@
22#include <asm/atomic.h> 22#include <asm/atomic.h>
23 23
24#include "cm.h" 24#include "cm.h"
25#include "cm-regbits-4xxx.h"
26 25
27/* XXX move this to cm.h */ 26/* XXX move this to cm.h */
28/* MAX_MODULE_READY_TIME: max milliseconds for module to leave idle */ 27/* MAX_MODULE_READY_TIME: max milliseconds for module to leave idle */
@@ -50,19 +49,7 @@
50 */ 49 */
51int omap4_cm_wait_idlest_ready(u32 prcm_mod, u8 prcm_dev_offs) 50int omap4_cm_wait_idlest_ready(u32 prcm_mod, u8 prcm_dev_offs)
52{ 51{
53 int i = 0; 52 /* FIXME: Add clock manager related code */
54 u8 cm_id; 53 return 0;
55 u16 prcm_mod_offs;
56 u32 mask = OMAP4_PRCM_CM_CLKCTRL_IDLEST_MASK;
57
58 cm_id = prcm_mod >> OMAP4_PRCM_MOD_CM_ID_SHIFT;
59 prcm_mod_offs = prcm_mod & OMAP4_PRCM_MOD_OFFS_MASK;
60
61 while (((omap4_cm_read_mod_reg(cm_id, prcm_mod_offs, prcm_dev_offs,
62 OMAP4_CM_CLKCTRL_DREG) & mask) != 0) &&
63 (i++ < MAX_MODULE_READY_TIME))
64 udelay(1);
65
66 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
67} 54}
68 55
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index bcfcfc7fdb9b..faf7a1e0c525 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -355,29 +355,60 @@ static struct platform_device omap2_mcspi4 = {
355}; 355};
356#endif 356#endif
357 357
358static void omap_init_mcspi(void) 358#ifdef CONFIG_ARCH_OMAP4
359static inline void omap4_mcspi_fixup(void)
359{ 360{
360 if (cpu_is_omap44xx()) { 361 omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE;
361 omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE; 362 omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff;
362 omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff; 363 omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE;
363 omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE; 364 omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff;
364 omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff; 365 omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE;
365 omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE; 366 omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff;
366 omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff; 367 omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE;
367 omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE; 368 omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff;
368 omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff; 369}
369 } 370#else
370 platform_device_register(&omap2_mcspi1); 371static inline void omap4_mcspi_fixup(void)
371 platform_device_register(&omap2_mcspi2); 372{
373}
374#endif
375
372#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ 376#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
373 defined(CONFIG_ARCH_OMAP4) 377 defined(CONFIG_ARCH_OMAP4)
374 if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx()) 378static inline void omap2_mcspi3_init(void)
375 platform_device_register(&omap2_mcspi3); 379{
380 platform_device_register(&omap2_mcspi3);
381}
382#else
383static inline void omap2_mcspi3_init(void)
384{
385}
376#endif 386#endif
387
377#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 388#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
378 if (cpu_is_omap343x() || cpu_is_omap44xx()) 389static inline void omap2_mcspi4_init(void)
379 platform_device_register(&omap2_mcspi4); 390{
391 platform_device_register(&omap2_mcspi4);
392}
393#else
394static inline void omap2_mcspi4_init(void)
395{
396}
380#endif 397#endif
398
399static void omap_init_mcspi(void)
400{
401 if (cpu_is_omap44xx())
402 omap4_mcspi_fixup();
403
404 platform_device_register(&omap2_mcspi1);
405 platform_device_register(&omap2_mcspi2);
406
407 if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx())
408 omap2_mcspi3_init();
409
410 if (cpu_is_omap343x() || cpu_is_omap44xx())
411 omap2_mcspi4_init();
381} 412}
382 413
383#else 414#else
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 7574b6f20e8e..e3a3bad1d84f 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -294,10 +294,10 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
294 else if (cpu_is_omap34xx()) 294 else if (cpu_is_omap34xx())
295 hwmods = omap34xx_hwmods; 295 hwmods = omap34xx_hwmods;
296 296
297 omap_hwmod_init(hwmods);
298 omap2_mux_init();
299#ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */ 297#ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */
300 /* The OPP tables have to be registered before a clk init */ 298 /* The OPP tables have to be registered before a clk init */
299 omap_hwmod_init(hwmods);
300 omap2_mux_init();
301 omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); 301 omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
302 pwrdm_init(powerdomains_omap); 302 pwrdm_init(powerdomains_omap);
303 clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); 303 clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c
index 2d9b5cc981cd..4a0e1cd5c1f4 100644
--- a/arch/arm/mach-omap2/iommu2.c
+++ b/arch/arm/mach-omap2/iommu2.c
@@ -79,7 +79,7 @@ static int omap2_iommu_enable(struct iommu *obj)
79 l = iommu_read_reg(obj, MMU_SYSSTATUS); 79 l = iommu_read_reg(obj, MMU_SYSSTATUS);
80 if (l & MMU_SYS_RESETDONE) 80 if (l & MMU_SYS_RESETDONE)
81 break; 81 break;
82 } while (time_after(jiffies, timeout)); 82 } while (!time_after(jiffies, timeout));
83 83
84 if (!(l & MMU_SYS_RESETDONE)) { 84 if (!(l & MMU_SYS_RESETDONE)) {
85 dev_err(obj->dev, "can't take mmu out of reset\n"); 85 dev_err(obj->dev, "can't take mmu out of reset\n");
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 6f71f3730c97..c035ad3426d0 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -30,6 +30,14 @@
30#define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u))) 30#define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u)))
31#define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1)) 31#define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1))
32 32
33/* SYSCONFIG: register bit definition */
34#define AUTOIDLE (1 << 0)
35#define SOFTRESET (1 << 1)
36#define SMARTIDLE (2 << 3)
37
38/* SYSSTATUS: register bit definition */
39#define RESETDONE (1 << 0)
40
33#define MBOX_REG_SIZE 0x120 41#define MBOX_REG_SIZE 0x120
34#define MBOX_NR_REGS (MBOX_REG_SIZE / sizeof(u32)) 42#define MBOX_NR_REGS (MBOX_REG_SIZE / sizeof(u32))
35 43
@@ -69,21 +77,33 @@ static inline void mbox_write_reg(u32 val, size_t ofs)
69/* Mailbox H/W preparations */ 77/* Mailbox H/W preparations */
70static int omap2_mbox_startup(struct omap_mbox *mbox) 78static int omap2_mbox_startup(struct omap_mbox *mbox)
71{ 79{
72 unsigned int l; 80 u32 l;
81 unsigned long timeout;
73 82
74 mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); 83 mbox_ick_handle = clk_get(NULL, "mailboxes_ick");
75 if (IS_ERR(mbox_ick_handle)) { 84 if (IS_ERR(mbox_ick_handle)) {
76 printk("Could not get mailboxes_ick\n"); 85 pr_err("Can't get mailboxes_ick\n");
77 return -ENODEV; 86 return -ENODEV;
78 } 87 }
79 clk_enable(mbox_ick_handle); 88 clk_enable(mbox_ick_handle);
80 89
90 mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG);
91 timeout = jiffies + msecs_to_jiffies(20);
92 do {
93 l = mbox_read_reg(MAILBOX_SYSSTATUS);
94 if (l & RESETDONE)
95 break;
96 } while (!time_after(jiffies, timeout));
97
98 if (!(l & RESETDONE)) {
99 pr_err("Can't take mmu out of reset\n");
100 return -ENODEV;
101 }
102
81 l = mbox_read_reg(MAILBOX_REVISION); 103 l = mbox_read_reg(MAILBOX_REVISION);
82 pr_info("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); 104 pr_info("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f));
83 105
84 /* set smart-idle & autoidle */ 106 l = SMARTIDLE | AUTOIDLE;
85 l = mbox_read_reg(MAILBOX_SYSCONFIG);
86 l |= 0x00000011;
87 mbox_write_reg(l, MAILBOX_SYSCONFIG); 107 mbox_write_reg(l, MAILBOX_SYSCONFIG);
88 108
89 omap2_mbox_enable_irq(mbox, IRQ_RX); 109 omap2_mbox_enable_irq(mbox, IRQ_RX);
@@ -156,6 +176,9 @@ static void omap2_mbox_ack_irq(struct omap_mbox *mbox,
156 u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; 176 u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit;
157 177
158 mbox_write_reg(bit, p->irqstatus); 178 mbox_write_reg(bit, p->irqstatus);
179
180 /* Flush posted write for irq status to avoid spurious interrupts */
181 mbox_read_reg(p->irqstatus);
159} 182}
160 183
161static int omap2_mbox_is_irq(struct omap_mbox *mbox, 184static int omap2_mbox_is_irq(struct omap_mbox *mbox,
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 2daa595aaff4..b5fac32aae70 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -460,6 +460,8 @@ MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0,
460 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) 460 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
461MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18, 461MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18,
462 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) 462 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
463MUX_CFG_34XX("AG9_34XX_GPIO23", 0x5ee,
464 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
463MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa, 465MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
464 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) 466 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
465MUX_CFG_34XX("U8_34XX_GPIO54_OUT", 0x0b4, 467MUX_CFG_34XX("U8_34XX_GPIO54_OUT", 0x0b4,
@@ -472,6 +474,8 @@ MUX_CFG_34XX("G25_34XX_GPIO86_OUT", 0x0fc,
472 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) 474 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
473MUX_CFG_34XX("AG4_34XX_GPIO134_OUT", 0x160, 475MUX_CFG_34XX("AG4_34XX_GPIO134_OUT", 0x160,
474 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) 476 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
477MUX_CFG_34XX("AF4_34XX_GPIO135_OUT", 0x162,
478 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
475MUX_CFG_34XX("AE4_34XX_GPIO136_OUT", 0x164, 479MUX_CFG_34XX("AE4_34XX_GPIO136_OUT", 0x164,
476 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) 480 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
477MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c, 481MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c,
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 3a529c77daa8..ae2186892c85 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -110,7 +110,7 @@ static struct plat_serial8250_port serial_platform_data2[] = {
110 .uartclk = OMAP24XX_BASE_BAUD * 16, 110 .uartclk = OMAP24XX_BASE_BAUD * 16,
111 }, { 111 }, {
112#ifdef CONFIG_ARCH_OMAP4 112#ifdef CONFIG_ARCH_OMAP4
113 .membase = IO_ADDRESS(OMAP_UART4_BASE), 113 .membase = OMAP2_IO_ADDRESS(OMAP_UART4_BASE),
114 .mapbase = OMAP_UART4_BASE, 114 .mapbase = OMAP_UART4_BASE,
115 .irq = 70, 115 .irq = 70,
116 .flags = UPF_BOOT_AUTOCONF, 116 .flags = UPF_BOOT_AUTOCONF,
@@ -126,7 +126,7 @@ static struct plat_serial8250_port serial_platform_data2[] = {
126#ifdef CONFIG_ARCH_OMAP4 126#ifdef CONFIG_ARCH_OMAP4
127static struct plat_serial8250_port serial_platform_data3[] = { 127static struct plat_serial8250_port serial_platform_data3[] = {
128 { 128 {
129 .membase = IO_ADDRESS(OMAP_UART4_BASE), 129 .membase = OMAP2_IO_ADDRESS(OMAP_UART4_BASE),
130 .mapbase = OMAP_UART4_BASE, 130 .mapbase = OMAP_UART4_BASE,
131 .irq = 70, 131 .irq = 70,
132 .flags = UPF_BOOT_AUTOCONF, 132 .flags = UPF_BOOT_AUTOCONF,
@@ -579,7 +579,7 @@ static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = {
579 { 579 {
580 .pdev = { 580 .pdev = {
581 .name = "serial8250", 581 .name = "serial8250",
582 .id = 3 582 .id = 3,
583 .dev = { 583 .dev = {
584 .platform_data = serial_platform_data3, 584 .platform_data = serial_platform_data3,
585 }, 585 },
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 693839c89ad0..71ebd7fcfea1 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -250,7 +250,7 @@ static struct gpio_bank gpio_bank_730[7] = {
250 250
251#ifdef CONFIG_ARCH_OMAP850 251#ifdef CONFIG_ARCH_OMAP850
252static struct gpio_bank gpio_bank_850[7] = { 252static struct gpio_bank gpio_bank_850[7] = {
253 { OMAP1_MPUIO_BASE, INT_850_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, 253 { OMAP1_MPUIO_VBASE, INT_850_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
254 { OMAP850_GPIO1_BASE, INT_850_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_850 }, 254 { OMAP850_GPIO1_BASE, INT_850_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_850 },
255 { OMAP850_GPIO2_BASE, INT_850_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_850 }, 255 { OMAP850_GPIO2_BASE, INT_850_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_850 },
256 { OMAP850_GPIO3_BASE, INT_850_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_850 }, 256 { OMAP850_GPIO3_BASE, INT_850_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_850 },
diff --git a/arch/arm/plat-omap/include/mach/keypad.h b/arch/arm/plat-omap/include/mach/keypad.h
index 45ea3ae3c995..d91b9be334ff 100644
--- a/arch/arm/plat-omap/include/mach/keypad.h
+++ b/arch/arm/plat-omap/include/mach/keypad.h
@@ -10,6 +10,8 @@
10#ifndef ASMARM_ARCH_KEYPAD_H 10#ifndef ASMARM_ARCH_KEYPAD_H
11#define ASMARM_ARCH_KEYPAD_H 11#define ASMARM_ARCH_KEYPAD_H
12 12
13#include <linux/input/matrix_keypad.h>
14
13struct omap_kp_platform_data { 15struct omap_kp_platform_data {
14 int rows; 16 int rows;
15 int cols; 17 int cols;
@@ -35,9 +37,6 @@ struct omap_kp_platform_data {
35 37
36#define KEY_PERSISTENT 0x00800000 38#define KEY_PERSISTENT 0x00800000
37#define KEYNUM_MASK 0x00EFFFFF 39#define KEYNUM_MASK 0x00EFFFFF
38#define KEY(col, row, val) (((col) << 28) | ((row) << 24) | (val))
39#define PERSISTENT_KEY(col, row) (((col) << 28) | ((row) << 24) | \
40 KEY_PERSISTENT)
41 40
42#endif 41#endif
43 42
diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/mach/mux.h
index 98dfab651dfc..0f49d2d563d9 100644
--- a/arch/arm/plat-omap/include/mach/mux.h
+++ b/arch/arm/plat-omap/include/mach/mux.h
@@ -840,12 +840,14 @@ enum omap34xx_index {
840 */ 840 */
841 AF26_34XX_GPIO0, 841 AF26_34XX_GPIO0,
842 AF22_34XX_GPIO9, 842 AF22_34XX_GPIO9,
843 AG9_34XX_GPIO23,
843 AH8_34XX_GPIO29, 844 AH8_34XX_GPIO29,
844 U8_34XX_GPIO54_OUT, 845 U8_34XX_GPIO54_OUT,
845 U8_34XX_GPIO54_DOWN, 846 U8_34XX_GPIO54_DOWN,
846 L8_34XX_GPIO63, 847 L8_34XX_GPIO63,
847 G25_34XX_GPIO86_OUT, 848 G25_34XX_GPIO86_OUT,
848 AG4_34XX_GPIO134_OUT, 849 AG4_34XX_GPIO134_OUT,
850 AF4_34XX_GPIO135_OUT,
849 AE4_34XX_GPIO136_OUT, 851 AE4_34XX_GPIO136_OUT,
850 AF6_34XX_GPIO140_UP, 852 AF6_34XX_GPIO140_UP,
851 AE6_34XX_GPIO141, 853 AE6_34XX_GPIO141,
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index 6fc52fcbdc03..57f7122a0919 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -199,7 +199,8 @@ static void *vmap_sg(const struct sg_table *sgt)
199 va += bytes; 199 va += bytes;
200 } 200 }
201 201
202 flush_cache_vmap(new->addr, new->addr + total); 202 flush_cache_vmap((unsigned long)new->addr,
203 (unsigned long)(new->addr + total));
203 return new->addr; 204 return new->addr;
204 205
205err_out: 206err_out:
@@ -390,7 +391,7 @@ static void sgtable_fill_vmalloc(struct sg_table *sgt, void *_va)
390 } 391 }
391 392
392 va_end = _va + PAGE_SIZE * i; 393 va_end = _va + PAGE_SIZE * i;
393 flush_cache_vmap(_va, va_end); 394 flush_cache_vmap((unsigned long)_va, (unsigned long)va_end);
394} 395}
395 396
396static inline void sgtable_drain_vmalloc(struct sg_table *sgt) 397static inline void sgtable_drain_vmalloc(struct sg_table *sgt)
diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c
index 3ab6d80d150d..19c1c82849ff 100644
--- a/arch/mips/alchemy/common/dbdma.c
+++ b/arch/mips/alchemy/common/dbdma.c
@@ -175,7 +175,7 @@ static dbdev_tab_t dbdev_tab[] = {
175#define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab) 175#define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab)
176 176
177#ifdef CONFIG_PM 177#ifdef CONFIG_PM
178static u32 au1xxx_dbdma_pm_regs[NUM_DBDMA_CHANS + 1][8]; 178static u32 au1xxx_dbdma_pm_regs[NUM_DBDMA_CHANS + 1][6];
179#endif 179#endif
180 180
181 181
@@ -993,14 +993,13 @@ void au1xxx_dbdma_suspend(void)
993 au1xxx_dbdma_pm_regs[0][3] = au_readl(addr + 0x0c); 993 au1xxx_dbdma_pm_regs[0][3] = au_readl(addr + 0x0c);
994 994
995 /* save channel configurations */ 995 /* save channel configurations */
996 for (i = 1, addr = DDMA_CHANNEL_BASE; i < NUM_DBDMA_CHANS; i++) { 996 for (i = 1, addr = DDMA_CHANNEL_BASE; i <= NUM_DBDMA_CHANS; i++) {
997 au1xxx_dbdma_pm_regs[i][0] = au_readl(addr + 0x00); 997 au1xxx_dbdma_pm_regs[i][0] = au_readl(addr + 0x00);
998 au1xxx_dbdma_pm_regs[i][1] = au_readl(addr + 0x04); 998 au1xxx_dbdma_pm_regs[i][1] = au_readl(addr + 0x04);
999 au1xxx_dbdma_pm_regs[i][2] = au_readl(addr + 0x08); 999 au1xxx_dbdma_pm_regs[i][2] = au_readl(addr + 0x08);
1000 au1xxx_dbdma_pm_regs[i][3] = au_readl(addr + 0x0c); 1000 au1xxx_dbdma_pm_regs[i][3] = au_readl(addr + 0x0c);
1001 au1xxx_dbdma_pm_regs[i][4] = au_readl(addr + 0x10); 1001 au1xxx_dbdma_pm_regs[i][4] = au_readl(addr + 0x10);
1002 au1xxx_dbdma_pm_regs[i][5] = au_readl(addr + 0x14); 1002 au1xxx_dbdma_pm_regs[i][5] = au_readl(addr + 0x14);
1003 au1xxx_dbdma_pm_regs[i][6] = au_readl(addr + 0x18);
1004 1003
1005 /* halt channel */ 1004 /* halt channel */
1006 au_writel(au1xxx_dbdma_pm_regs[i][0] & ~1, addr + 0x00); 1005 au_writel(au1xxx_dbdma_pm_regs[i][0] & ~1, addr + 0x00);
@@ -1027,14 +1026,13 @@ void au1xxx_dbdma_resume(void)
1027 au_writel(au1xxx_dbdma_pm_regs[0][3], addr + 0x0c); 1026 au_writel(au1xxx_dbdma_pm_regs[0][3], addr + 0x0c);
1028 1027
1029 /* restore channel configurations */ 1028 /* restore channel configurations */
1030 for (i = 1, addr = DDMA_CHANNEL_BASE; i < NUM_DBDMA_CHANS; i++) { 1029 for (i = 1, addr = DDMA_CHANNEL_BASE; i <= NUM_DBDMA_CHANS; i++) {
1031 au_writel(au1xxx_dbdma_pm_regs[i][0], addr + 0x00); 1030 au_writel(au1xxx_dbdma_pm_regs[i][0], addr + 0x00);
1032 au_writel(au1xxx_dbdma_pm_regs[i][1], addr + 0x04); 1031 au_writel(au1xxx_dbdma_pm_regs[i][1], addr + 0x04);
1033 au_writel(au1xxx_dbdma_pm_regs[i][2], addr + 0x08); 1032 au_writel(au1xxx_dbdma_pm_regs[i][2], addr + 0x08);
1034 au_writel(au1xxx_dbdma_pm_regs[i][3], addr + 0x0c); 1033 au_writel(au1xxx_dbdma_pm_regs[i][3], addr + 0x0c);
1035 au_writel(au1xxx_dbdma_pm_regs[i][4], addr + 0x10); 1034 au_writel(au1xxx_dbdma_pm_regs[i][4], addr + 0x10);
1036 au_writel(au1xxx_dbdma_pm_regs[i][5], addr + 0x14); 1035 au_writel(au1xxx_dbdma_pm_regs[i][5], addr + 0x14);
1037 au_writel(au1xxx_dbdma_pm_regs[i][6], addr + 0x18);
1038 au_sync(); 1036 au_sync();
1039 addr += 0x100; /* next channel base */ 1037 addr += 0x100; /* next channel base */
1040 } 1038 }
diff --git a/arch/mips/basler/excite/excite_iodev.c b/arch/mips/basler/excite/excite_iodev.c
index dfbfd7e2ac08..938b1d0b7652 100644
--- a/arch/mips/basler/excite/excite_iodev.c
+++ b/arch/mips/basler/excite/excite_iodev.c
@@ -112,10 +112,8 @@ static int iodev_open(struct inode *i, struct file *f)
112{ 112{
113 int ret; 113 int ret;
114 114
115 lock_kernel();
116 ret = request_irq(iodev_irq, iodev_irqhdl, IRQF_DISABLED, 115 ret = request_irq(iodev_irq, iodev_irqhdl, IRQF_DISABLED,
117 iodev_name, &miscdev); 116 iodev_name, &miscdev);
118 unlock_kernel();
119 117
120 return ret; 118 return ret;
121} 119}
diff --git a/arch/mips/bcm63xx/Makefile b/arch/mips/bcm63xx/Makefile
index aaa585cf26e3..c146d1ededed 100644
--- a/arch/mips/bcm63xx/Makefile
+++ b/arch/mips/bcm63xx/Makefile
@@ -1,5 +1,5 @@
1obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \ 1obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
2 dev-dsp.o dev-enet.o 2 dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o
3obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 3obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
4 4
5obj-y += boards/ 5obj-y += boards/
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index fd77f548207a..78e155d21be6 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -20,10 +20,11 @@
20#include <bcm63xx_cpu.h> 20#include <bcm63xx_cpu.h>
21#include <bcm63xx_regs.h> 21#include <bcm63xx_regs.h>
22#include <bcm63xx_io.h> 22#include <bcm63xx_io.h>
23#include <bcm63xx_board.h>
24#include <bcm63xx_dev_pci.h> 23#include <bcm63xx_dev_pci.h>
25#include <bcm63xx_dev_enet.h> 24#include <bcm63xx_dev_enet.h>
26#include <bcm63xx_dev_dsp.h> 25#include <bcm63xx_dev_dsp.h>
26#include <bcm63xx_dev_pcmcia.h>
27#include <bcm63xx_dev_uart.h>
27#include <board_bcm963xx.h> 28#include <board_bcm963xx.h>
28 29
29#define PFX "board_bcm963xx: " 30#define PFX "board_bcm963xx: "
@@ -793,6 +794,11 @@ int __init board_register_devices(void)
793{ 794{
794 u32 val; 795 u32 val;
795 796
797 bcm63xx_uart_register();
798
799 if (board.has_pccard)
800 bcm63xx_pcmcia_register();
801
796 if (board.has_enet0 && 802 if (board.has_enet0 &&
797 !board_get_mac_address(board.enet0.mac_addr)) 803 !board_get_mac_address(board.enet0.mac_addr))
798 bcm63xx_enet_register(0, &board.enet0); 804 bcm63xx_enet_register(0, &board.enet0);
diff --git a/arch/mips/bcm63xx/dev-pcmcia.c b/arch/mips/bcm63xx/dev-pcmcia.c
new file mode 100644
index 000000000000..de4d917fd54d
--- /dev/null
+++ b/arch/mips/bcm63xx/dev-pcmcia.c
@@ -0,0 +1,144 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/init.h>
10#include <linux/kernel.h>
11#include <asm/bootinfo.h>
12#include <linux/platform_device.h>
13#include <bcm63xx_cs.h>
14#include <bcm63xx_cpu.h>
15#include <bcm63xx_dev_pcmcia.h>
16#include <bcm63xx_io.h>
17#include <bcm63xx_regs.h>
18
19static struct resource pcmcia_resources[] = {
20 /* pcmcia registers */
21 {
22 /* start & end filled at runtime */
23 .flags = IORESOURCE_MEM,
24 },
25
26 /* pcmcia memory zone resources */
27 {
28 .start = BCM_PCMCIA_COMMON_BASE_PA,
29 .end = BCM_PCMCIA_COMMON_END_PA,
30 .flags = IORESOURCE_MEM,
31 },
32 {
33 .start = BCM_PCMCIA_ATTR_BASE_PA,
34 .end = BCM_PCMCIA_ATTR_END_PA,
35 .flags = IORESOURCE_MEM,
36 },
37 {
38 .start = BCM_PCMCIA_IO_BASE_PA,
39 .end = BCM_PCMCIA_IO_END_PA,
40 .flags = IORESOURCE_MEM,
41 },
42
43 /* PCMCIA irq */
44 {
45 /* start filled at runtime */
46 .flags = IORESOURCE_IRQ,
47 },
48
49 /* declare PCMCIA IO resource also */
50 {
51 .start = BCM_PCMCIA_IO_BASE_PA,
52 .end = BCM_PCMCIA_IO_END_PA,
53 .flags = IORESOURCE_IO,
54 },
55};
56
57static struct bcm63xx_pcmcia_platform_data pd;
58
59static struct platform_device bcm63xx_pcmcia_device = {
60 .name = "bcm63xx_pcmcia",
61 .id = 0,
62 .num_resources = ARRAY_SIZE(pcmcia_resources),
63 .resource = pcmcia_resources,
64 .dev = {
65 .platform_data = &pd,
66 },
67};
68
69static int __init config_pcmcia_cs(unsigned int cs,
70 u32 base, unsigned int size)
71{
72 int ret;
73
74 ret = bcm63xx_set_cs_status(cs, 0);
75 if (!ret)
76 ret = bcm63xx_set_cs_base(cs, base, size);
77 if (!ret)
78 ret = bcm63xx_set_cs_status(cs, 1);
79 return ret;
80}
81
82static const __initdata struct {
83 unsigned int cs;
84 unsigned int base;
85 unsigned int size;
86} pcmcia_cs[3] = {
87 {
88 .cs = MPI_CS_PCMCIA_COMMON,
89 .base = BCM_PCMCIA_COMMON_BASE_PA,
90 .size = BCM_PCMCIA_COMMON_SIZE
91 },
92 {
93 .cs = MPI_CS_PCMCIA_ATTR,
94 .base = BCM_PCMCIA_ATTR_BASE_PA,
95 .size = BCM_PCMCIA_ATTR_SIZE
96 },
97 {
98 .cs = MPI_CS_PCMCIA_IO,
99 .base = BCM_PCMCIA_IO_BASE_PA,
100 .size = BCM_PCMCIA_IO_SIZE
101 },
102};
103
104int __init bcm63xx_pcmcia_register(void)
105{
106 int ret, i;
107
108 if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358())
109 return 0;
110
111 /* use correct pcmcia ready gpio depending on processor */
112 switch (bcm63xx_get_cpu_id()) {
113 case BCM6348_CPU_ID:
114 pd.ready_gpio = 22;
115 break;
116
117 case BCM6358_CPU_ID:
118 pd.ready_gpio = 18;
119 break;
120
121 default:
122 return -ENODEV;
123 }
124
125 pcmcia_resources[0].start = bcm63xx_regset_address(RSET_PCMCIA);
126 pcmcia_resources[0].end = pcmcia_resources[0].start +
127 RSET_PCMCIA_SIZE - 1;
128 pcmcia_resources[4].start = bcm63xx_get_irq_number(IRQ_PCMCIA);
129
130 /* configure pcmcia chip selects */
131 for (i = 0; i < 3; i++) {
132 ret = config_pcmcia_cs(pcmcia_cs[i].cs,
133 pcmcia_cs[i].base,
134 pcmcia_cs[i].size);
135 if (ret)
136 goto out_err;
137 }
138
139 return platform_device_register(&bcm63xx_pcmcia_device);
140
141out_err:
142 printk(KERN_ERR "unable to set pcmcia chip select\n");
143 return ret;
144}
diff --git a/arch/mips/bcm63xx/dev-uart.c b/arch/mips/bcm63xx/dev-uart.c
new file mode 100644
index 000000000000..5f3d89c4a988
--- /dev/null
+++ b/arch/mips/bcm63xx/dev-uart.c
@@ -0,0 +1,41 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/init.h>
10#include <linux/kernel.h>
11#include <linux/platform_device.h>
12#include <bcm63xx_cpu.h>
13#include <bcm63xx_dev_uart.h>
14
15static struct resource uart_resources[] = {
16 {
17 .start = -1, /* filled at runtime */
18 .end = -1, /* filled at runtime */
19 .flags = IORESOURCE_MEM,
20 },
21 {
22 .start = -1, /* filled at runtime */
23 .flags = IORESOURCE_IRQ,
24 },
25};
26
27static struct platform_device bcm63xx_uart_device = {
28 .name = "bcm63xx_uart",
29 .id = 0,
30 .num_resources = ARRAY_SIZE(uart_resources),
31 .resource = uart_resources,
32};
33
34int __init bcm63xx_uart_register(void)
35{
36 uart_resources[0].start = bcm63xx_regset_address(RSET_UART0);
37 uart_resources[0].end = uart_resources[0].start;
38 uart_resources[0].end += RSET_UART_SIZE - 1;
39 uart_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0);
40 return platform_device_register(&bcm63xx_uart_device);
41}
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pcmcia.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pcmcia.h
new file mode 100644
index 000000000000..2beb3969ce3b
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pcmcia.h
@@ -0,0 +1,13 @@
1#ifndef BCM63XX_DEV_PCMCIA_H_
2#define BCM63XX_DEV_PCMCIA_H_
3
4/*
5 * PCMCIA driver platform data
6 */
7struct bcm63xx_pcmcia_platform_data {
8 unsigned int ready_gpio;
9};
10
11int bcm63xx_pcmcia_register(void);
12
13#endif /* BCM63XX_DEV_PCMCIA_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h
new file mode 100644
index 000000000000..bf348f573bbc
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h
@@ -0,0 +1,6 @@
1#ifndef BCM63XX_DEV_UART_H_
2#define BCM63XX_DEV_UART_H_
3
4int bcm63xx_uart_register(void);
5
6#endif /* BCM63XX_DEV_UART_H_ */
diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h
index e15f11a09311..af42385245d5 100644
--- a/arch/mips/include/asm/smp.h
+++ b/arch/mips/include/asm/smp.h
@@ -77,7 +77,18 @@ extern void play_dead(void);
77 77
78extern asmlinkage void smp_call_function_interrupt(void); 78extern asmlinkage void smp_call_function_interrupt(void);
79 79
80extern void arch_send_call_function_single_ipi(int cpu); 80static inline void arch_send_call_function_single_ipi(int cpu)
81extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 81{
82 extern struct plat_smp_ops *mp_ops; /* private */
83
84 mp_ops->send_ipi_mask(&cpumask_of_cpu(cpu), SMP_CALL_FUNCTION);
85}
86
87static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask)
88{
89 extern struct plat_smp_ops *mp_ops; /* private */
90
91 mp_ops->send_ipi_mask(mask, SMP_CALL_FUNCTION);
92}
82 93
83#endif /* __ASM_SMP_H */ 94#endif /* __ASM_SMP_H */
diff --git a/arch/mips/include/asm/unaligned.h b/arch/mips/include/asm/unaligned.h
index 792404948571..42f66c311473 100644
--- a/arch/mips/include/asm/unaligned.h
+++ b/arch/mips/include/asm/unaligned.h
@@ -12,17 +12,17 @@
12#if defined(__MIPSEB__) 12#if defined(__MIPSEB__)
13# include <linux/unaligned/be_struct.h> 13# include <linux/unaligned/be_struct.h>
14# include <linux/unaligned/le_byteshift.h> 14# include <linux/unaligned/le_byteshift.h>
15# include <linux/unaligned/generic.h>
16# define get_unaligned __get_unaligned_be 15# define get_unaligned __get_unaligned_be
17# define put_unaligned __put_unaligned_be 16# define put_unaligned __put_unaligned_be
18#elif defined(__MIPSEL__) 17#elif defined(__MIPSEL__)
19# include <linux/unaligned/le_struct.h> 18# include <linux/unaligned/le_struct.h>
20# include <linux/unaligned/be_byteshift.h> 19# include <linux/unaligned/be_byteshift.h>
21# include <linux/unaligned/generic.h>
22# define get_unaligned __get_unaligned_le 20# define get_unaligned __get_unaligned_le
23# define put_unaligned __put_unaligned_le 21# define put_unaligned __put_unaligned_le
24#else 22#else
25# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" 23# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
26#endif 24#endif
27 25
26# include <linux/unaligned/generic.h>
27
28#endif /* _ASM_MIPS_UNALIGNED_H */ 28#endif /* _ASM_MIPS_UNALIGNED_H */
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c
index f2397f00db43..ad4e017ed2f3 100644
--- a/arch/mips/kernel/kspd.c
+++ b/arch/mips/kernel/kspd.c
@@ -172,13 +172,20 @@ static unsigned int translate_open_flags(int flags)
172} 172}
173 173
174 174
175static void sp_setfsuidgid( uid_t uid, gid_t gid) 175static int sp_setfsuidgid(uid_t uid, gid_t gid)
176{ 176{
177 current->cred->fsuid = uid; 177 struct cred *new;
178 current->cred->fsgid = gid;
179 178
180 key_fsuid_changed(current); 179 new = prepare_creds();
181 key_fsgid_changed(current); 180 if (!new)
181 return -ENOMEM;
182
183 new->fsuid = uid;
184 new->fsgid = gid;
185
186 commit_creds(new);
187
188 return 0;
182} 189}
183 190
184/* 191/*
@@ -196,7 +203,7 @@ void sp_work_handle_request(void)
196 mm_segment_t old_fs; 203 mm_segment_t old_fs;
197 struct timeval tv; 204 struct timeval tv;
198 struct timezone tz; 205 struct timezone tz;
199 int cmd; 206 int err, cmd;
200 207
201 char *vcwd; 208 char *vcwd;
202 int size; 209 int size;
@@ -225,8 +232,11 @@ void sp_work_handle_request(void)
225 /* Run the syscall at the privilege of the user who loaded the 232 /* Run the syscall at the privilege of the user who loaded the
226 SP program */ 233 SP program */
227 234
228 if (vpe_getuid(tclimit)) 235 if (vpe_getuid(tclimit)) {
229 sp_setfsuidgid(vpe_getuid(tclimit), vpe_getgid(tclimit)); 236 err = sp_setfsuidgid(vpe_getuid(tclimit), vpe_getgid(tclimit));
237 if (!err)
238 pr_err("Change of creds failed\n");
239 }
230 240
231 switch (sc.cmd) { 241 switch (sc.cmd) {
232 /* needs the flags argument translating from SDE kit to 242 /* needs the flags argument translating from SDE kit to
@@ -283,8 +293,11 @@ void sp_work_handle_request(void)
283 break; 293 break;
284 } /* switch */ 294 } /* switch */
285 295
286 if (vpe_getuid(tclimit)) 296 if (vpe_getuid(tclimit)) {
287 sp_setfsuidgid( 0, 0); 297 err = sp_setfsuidgid(0, 0);
298 if (!err)
299 pr_err("restoring old creds failed\n");
300 }
288 301
289 old_fs = get_fs(); 302 old_fs = get_fs();
290 set_fs(KERNEL_DS); 303 set_fs(KERNEL_DS);
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index a10ebfdc28ae..364f066cb497 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -72,8 +72,9 @@ static void rtlx_dispatch(void)
72*/ 72*/
73static irqreturn_t rtlx_interrupt(int irq, void *dev_id) 73static irqreturn_t rtlx_interrupt(int irq, void *dev_id)
74{ 74{
75 unsigned int vpeflags;
76 unsigned long flags;
75 int i; 77 int i;
76 unsigned int flags, vpeflags;
77 78
78 /* Ought not to be strictly necessary for SMTC builds */ 79 /* Ought not to be strictly necessary for SMTC builds */
79 local_irq_save(flags); 80 local_irq_save(flags);
@@ -392,20 +393,12 @@ out:
392 393
393static int file_open(struct inode *inode, struct file *filp) 394static int file_open(struct inode *inode, struct file *filp)
394{ 395{
395 int minor = iminor(inode); 396 return rtlx_open(iminor(inode), (filp->f_flags & O_NONBLOCK) ? 0 : 1);
396 int err;
397
398 lock_kernel();
399 err = rtlx_open(minor, (filp->f_flags & O_NONBLOCK) ? 0 : 1);
400 unlock_kernel();
401 return err;
402} 397}
403 398
404static int file_release(struct inode *inode, struct file *filp) 399static int file_release(struct inode *inode, struct file *filp)
405{ 400{
406 int minor = iminor(inode); 401 return rtlx_release(iminor(inode));
407
408 return rtlx_release(minor);
409} 402}
410 403
411static unsigned int file_poll(struct file *file, poll_table * wait) 404static unsigned int file_poll(struct file *file, poll_table * wait)
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 4eb106c6a3ec..e72e6844d134 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -32,7 +32,6 @@
32#include <linux/cpumask.h> 32#include <linux/cpumask.h>
33#include <linux/cpu.h> 33#include <linux/cpu.h>
34#include <linux/err.h> 34#include <linux/err.h>
35#include <linux/smp.h>
36 35
37#include <asm/atomic.h> 36#include <asm/atomic.h>
38#include <asm/cpu.h> 37#include <asm/cpu.h>
@@ -128,19 +127,6 @@ asmlinkage __cpuinit void start_secondary(void)
128 cpu_idle(); 127 cpu_idle();
129} 128}
130 129
131void arch_send_call_function_ipi_mask(const struct cpumask *mask)
132{
133 mp_ops->send_ipi_mask(mask, SMP_CALL_FUNCTION);
134}
135
136/*
137 * We reuse the same vector for the single IPI
138 */
139void arch_send_call_function_single_ipi(int cpu)
140{
141 mp_ops->send_ipi_mask(cpumask_of_cpu(cpu), SMP_CALL_FUNCTION);
142}
143
144/* 130/*
145 * Call into both interrupt handlers, as we share the IPI for them 131 * Call into both interrupt handlers, as we share the IPI for them
146 */ 132 */
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index 67153a0dc267..4d181df44a40 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -1098,9 +1098,8 @@ static void ipi_irq_dispatch(void)
1098 1098
1099static struct irqaction irq_ipi = { 1099static struct irqaction irq_ipi = {
1100 .handler = ipi_interrupt, 1100 .handler = ipi_interrupt,
1101 .flags = IRQF_DISABLED, 1101 .flags = IRQF_DISABLED | IRQF_PERCPU,
1102 .name = "SMTC_IPI", 1102 .name = "SMTC_IPI"
1103 .flags = IRQF_PERCPU
1104}; 1103};
1105 1104
1106static void setup_cross_vpe_interrupts(unsigned int nvpe) 1105static void setup_cross_vpe_interrupts(unsigned int nvpe)
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index eb6c4c5b7fbe..03092ab2a296 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -144,14 +144,15 @@ struct tc {
144}; 144};
145 145
146struct { 146struct {
147 /* Virtual processing elements */ 147 spinlock_t vpe_list_lock;
148 struct list_head vpe_list; 148 struct list_head vpe_list; /* Virtual processing elements */
149 149 spinlock_t tc_list_lock;
150 /* Thread contexts */ 150 struct list_head tc_list; /* Thread contexts */
151 struct list_head tc_list;
152} vpecontrol = { 151} vpecontrol = {
153 .vpe_list = LIST_HEAD_INIT(vpecontrol.vpe_list), 152 .vpe_list_lock = SPIN_LOCK_UNLOCKED,
154 .tc_list = LIST_HEAD_INIT(vpecontrol.tc_list) 153 .vpe_list = LIST_HEAD_INIT(vpecontrol.vpe_list),
154 .tc_list_lock = SPIN_LOCK_UNLOCKED,
155 .tc_list = LIST_HEAD_INIT(vpecontrol.tc_list)
155}; 156};
156 157
157static void release_progmem(void *ptr); 158static void release_progmem(void *ptr);
@@ -159,28 +160,38 @@ static void release_progmem(void *ptr);
159/* get the vpe associated with this minor */ 160/* get the vpe associated with this minor */
160static struct vpe *get_vpe(int minor) 161static struct vpe *get_vpe(int minor)
161{ 162{
162 struct vpe *v; 163 struct vpe *res, *v;
163 164
164 if (!cpu_has_mipsmt) 165 if (!cpu_has_mipsmt)
165 return NULL; 166 return NULL;
166 167
168 res = NULL;
169 spin_lock(&vpecontrol.vpe_list_lock);
167 list_for_each_entry(v, &vpecontrol.vpe_list, list) { 170 list_for_each_entry(v, &vpecontrol.vpe_list, list) {
168 if (v->minor == minor) 171 if (v->minor == minor) {
169 return v; 172 res = v;
173 break;
174 }
170 } 175 }
176 spin_unlock(&vpecontrol.vpe_list_lock);
171 177
172 return NULL; 178 return res;
173} 179}
174 180
175/* get the vpe associated with this minor */ 181/* get the vpe associated with this minor */
176static struct tc *get_tc(int index) 182static struct tc *get_tc(int index)
177{ 183{
178 struct tc *t; 184 struct tc *res, *t;
179 185
186 res = NULL;
187 spin_lock(&vpecontrol.tc_list_lock);
180 list_for_each_entry(t, &vpecontrol.tc_list, list) { 188 list_for_each_entry(t, &vpecontrol.tc_list, list) {
181 if (t->index == index) 189 if (t->index == index) {
182 return t; 190 res = t;
191 break;
192 }
183 } 193 }
194 spin_unlock(&vpecontrol.tc_list_lock);
184 195
185 return NULL; 196 return NULL;
186} 197}
@@ -190,15 +201,17 @@ static struct vpe *alloc_vpe(int minor)
190{ 201{
191 struct vpe *v; 202 struct vpe *v;
192 203
193 if ((v = kzalloc(sizeof(struct vpe), GFP_KERNEL)) == NULL) { 204 if ((v = kzalloc(sizeof(struct vpe), GFP_KERNEL)) == NULL)
194 return NULL; 205 return NULL;
195 }
196 206
197 INIT_LIST_HEAD(&v->tc); 207 INIT_LIST_HEAD(&v->tc);
208 spin_lock(&vpecontrol.vpe_list_lock);
198 list_add_tail(&v->list, &vpecontrol.vpe_list); 209 list_add_tail(&v->list, &vpecontrol.vpe_list);
210 spin_unlock(&vpecontrol.vpe_list_lock);
199 211
200 INIT_LIST_HEAD(&v->notify); 212 INIT_LIST_HEAD(&v->notify);
201 v->minor = minor; 213 v->minor = minor;
214
202 return v; 215 return v;
203} 216}
204 217
@@ -212,7 +225,10 @@ static struct tc *alloc_tc(int index)
212 225
213 INIT_LIST_HEAD(&tc->tc); 226 INIT_LIST_HEAD(&tc->tc);
214 tc->index = index; 227 tc->index = index;
228
229 spin_lock(&vpecontrol.tc_list_lock);
215 list_add_tail(&tc->list, &vpecontrol.tc_list); 230 list_add_tail(&tc->list, &vpecontrol.tc_list);
231 spin_unlock(&vpecontrol.tc_list_lock);
216 232
217out: 233out:
218 return tc; 234 return tc;
@@ -227,7 +243,7 @@ static void release_vpe(struct vpe *v)
227 kfree(v); 243 kfree(v);
228} 244}
229 245
230static void dump_mtregs(void) 246static void __maybe_unused dump_mtregs(void)
231{ 247{
232 unsigned long val; 248 unsigned long val;
233 249
@@ -1048,20 +1064,19 @@ static int vpe_open(struct inode *inode, struct file *filp)
1048 enum vpe_state state; 1064 enum vpe_state state;
1049 struct vpe_notifications *not; 1065 struct vpe_notifications *not;
1050 struct vpe *v; 1066 struct vpe *v;
1051 int ret, err = 0; 1067 int ret;
1052 1068
1053 lock_kernel();
1054 if (minor != iminor(inode)) { 1069 if (minor != iminor(inode)) {
1055 /* assume only 1 device at the moment. */ 1070 /* assume only 1 device at the moment. */
1056 printk(KERN_WARNING "VPE loader: only vpe1 is supported\n"); 1071 pr_warning("VPE loader: only vpe1 is supported\n");
1057 err = -ENODEV; 1072
1058 goto out; 1073 return -ENODEV;
1059 } 1074 }
1060 1075
1061 if ((v = get_vpe(tclimit)) == NULL) { 1076 if ((v = get_vpe(tclimit)) == NULL) {
1062 printk(KERN_WARNING "VPE loader: unable to get vpe\n"); 1077 pr_warning("VPE loader: unable to get vpe\n");
1063 err = -ENODEV; 1078
1064 goto out; 1079 return -ENODEV;
1065 } 1080 }
1066 1081
1067 state = xchg(&v->state, VPE_STATE_INUSE); 1082 state = xchg(&v->state, VPE_STATE_INUSE);
@@ -1101,8 +1116,8 @@ static int vpe_open(struct inode *inode, struct file *filp)
1101 v->shared_ptr = NULL; 1116 v->shared_ptr = NULL;
1102 v->__start = 0; 1117 v->__start = 0;
1103 1118
1104out:
1105 unlock_kernel(); 1119 unlock_kernel();
1120
1106 return 0; 1121 return 0;
1107} 1122}
1108 1123
@@ -1594,14 +1609,14 @@ static void __exit vpe_module_exit(void)
1594{ 1609{
1595 struct vpe *v, *n; 1610 struct vpe *v, *n;
1596 1611
1612 device_del(&vpe_device);
1613 unregister_chrdev(major, module_name);
1614
1615 /* No locking needed here */
1597 list_for_each_entry_safe(v, n, &vpecontrol.vpe_list, list) { 1616 list_for_each_entry_safe(v, n, &vpecontrol.vpe_list, list) {
1598 if (v->state != VPE_STATE_UNUSED) { 1617 if (v->state != VPE_STATE_UNUSED)
1599 release_vpe(v); 1618 release_vpe(v);
1600 }
1601 } 1619 }
1602
1603 device_del(&vpe_device);
1604 unregister_chrdev(major, module_name);
1605} 1620}
1606 1621
1607module_init(vpe_module_init); 1622module_init(vpe_module_init);
diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c
index b55c2d1b998f..5ab5fa8c1d82 100644
--- a/arch/mips/mm/sc-mips.c
+++ b/arch/mips/mm/sc-mips.c
@@ -32,6 +32,11 @@ static void mips_sc_wback_inv(unsigned long addr, unsigned long size)
32 */ 32 */
33static void mips_sc_inv(unsigned long addr, unsigned long size) 33static void mips_sc_inv(unsigned long addr, unsigned long size)
34{ 34{
35 unsigned long lsize = cpu_scache_line_size();
36 unsigned long almask = ~(lsize - 1);
37
38 cache_op(Hit_Writeback_Inv_SD, addr & almask);
39 cache_op(Hit_Writeback_Inv_SD, (addr + size - 1) & almask);
35 blast_inv_scache_range(addr, addr + size); 40 blast_inv_scache_range(addr, addr + size);
36} 41}
37 42
diff --git a/arch/mips/oprofile/op_model_loongson2.c b/arch/mips/oprofile/op_model_loongson2.c
index 655cb8dec340..deed1d5d4982 100644
--- a/arch/mips/oprofile/op_model_loongson2.c
+++ b/arch/mips/oprofile/op_model_loongson2.c
@@ -44,7 +44,7 @@ static struct loongson2_register_config {
44 unsigned int ctrl; 44 unsigned int ctrl;
45 unsigned long long reset_counter1; 45 unsigned long long reset_counter1;
46 unsigned long long reset_counter2; 46 unsigned long long reset_counter2;
47 int cnt1_enalbed, cnt2_enalbed; 47 int cnt1_enabled, cnt2_enabled;
48} reg; 48} reg;
49 49
50DEFINE_SPINLOCK(sample_lock); 50DEFINE_SPINLOCK(sample_lock);
@@ -81,8 +81,8 @@ static void loongson2_reg_setup(struct op_counter_config *cfg)
81 81
82 reg.ctrl = ctrl; 82 reg.ctrl = ctrl;
83 83
84 reg.cnt1_enalbed = cfg[0].enabled; 84 reg.cnt1_enabled = cfg[0].enabled;
85 reg.cnt2_enalbed = cfg[1].enabled; 85 reg.cnt2_enabled = cfg[1].enabled;
86 86
87} 87}
88 88
@@ -99,7 +99,7 @@ static void loongson2_cpu_setup(void *args)
99static void loongson2_cpu_start(void *args) 99static void loongson2_cpu_start(void *args)
100{ 100{
101 /* Start all counters on current CPU */ 101 /* Start all counters on current CPU */
102 if (reg.cnt1_enalbed || reg.cnt2_enalbed) 102 if (reg.cnt1_enabled || reg.cnt2_enabled)
103 write_c0_perfctrl(reg.ctrl); 103 write_c0_perfctrl(reg.ctrl);
104} 104}
105 105
@@ -125,7 +125,7 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id)
125 */ 125 */
126 126
127 /* Check whether the irq belongs to me */ 127 /* Check whether the irq belongs to me */
128 enabled = reg.cnt1_enalbed | reg.cnt2_enalbed; 128 enabled = reg.cnt1_enabled | reg.cnt2_enabled;
129 if (!enabled) 129 if (!enabled)
130 return IRQ_NONE; 130 return IRQ_NONE;
131 131
@@ -136,12 +136,12 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id)
136 spin_lock_irqsave(&sample_lock, flags); 136 spin_lock_irqsave(&sample_lock, flags);
137 137
138 if (counter1 & LOONGSON2_PERFCNT_OVERFLOW) { 138 if (counter1 & LOONGSON2_PERFCNT_OVERFLOW) {
139 if (reg.cnt1_enalbed) 139 if (reg.cnt1_enabled)
140 oprofile_add_sample(regs, 0); 140 oprofile_add_sample(regs, 0);
141 counter1 = reg.reset_counter1; 141 counter1 = reg.reset_counter1;
142 } 142 }
143 if (counter2 & LOONGSON2_PERFCNT_OVERFLOW) { 143 if (counter2 & LOONGSON2_PERFCNT_OVERFLOW) {
144 if (reg.cnt2_enalbed) 144 if (reg.cnt2_enabled)
145 oprofile_add_sample(regs, 1); 145 oprofile_add_sample(regs, 1);
146 counter2 = reg.reset_counter2; 146 counter2 = reg.reset_counter2;
147 } 147 }
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c
index 109c95ca698b..32548b5d68d6 100644
--- a/arch/mips/pci/ops-pmcmsp.c
+++ b/arch/mips/pci/ops-pmcmsp.c
@@ -385,6 +385,7 @@ int msp_pcibios_config_access(unsigned char access_type,
385 unsigned long intr; 385 unsigned long intr;
386 unsigned long value; 386 unsigned long value;
387 static char pciirqflag; 387 static char pciirqflag;
388 int ret;
388#if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL) 389#if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
389 unsigned int vpe_status; 390 unsigned int vpe_status;
390#endif 391#endif
@@ -402,11 +403,13 @@ int msp_pcibios_config_access(unsigned char access_type,
402 * allocation assigns an interrupt handler to the interrupt. 403 * allocation assigns an interrupt handler to the interrupt.
403 */ 404 */
404 if (pciirqflag == 0) { 405 if (pciirqflag == 0) {
405 request_irq(MSP_INT_PCI,/* Hardcoded internal MSP7120 wiring */ 406 ret = request_irq(MSP_INT_PCI,/* Hardcoded internal MSP7120 wiring */
406 bpci_interrupt, 407 bpci_interrupt,
407 IRQF_SHARED | IRQF_DISABLED, 408 IRQF_SHARED | IRQF_DISABLED,
408 "PMC MSP PCI Host", 409 "PMC MSP PCI Host",
409 preg); 410 preg);
411 if (ret != 0)
412 return ret;
410 pciirqflag = ~0; 413 pciirqflag = ~0;
411 } 414 }
412 415
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c
index 9aa8f2951df6..c6851df9ab74 100644
--- a/arch/mips/sgi-ip27/ip27-smp.c
+++ b/arch/mips/sgi-ip27/ip27-smp.c
@@ -165,7 +165,7 @@ static void ip27_send_ipi_single(int destid, unsigned int action)
165 REMOTE_HUB_SEND_INTR(COMPACT_TO_NASID_NODEID(cpu_to_node(destid)), irq); 165 REMOTE_HUB_SEND_INTR(COMPACT_TO_NASID_NODEID(cpu_to_node(destid)), irq);
166} 166}
167 167
168static void ip27_send_ipi(const struct cpumask *mask, unsigned int action) 168static void ip27_send_ipi_mask(const struct cpumask *mask, unsigned int action)
169{ 169{
170 unsigned int i; 170 unsigned int i;
171 171
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index ba59839a021e..4070268aa769 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -117,10 +117,6 @@ static int bcm1480_set_affinity(unsigned int irq, const struct cpumask *mask)
117 unsigned long flags; 117 unsigned long flags;
118 unsigned int irq_dirty; 118 unsigned int irq_dirty;
119 119
120 if (cpumask_weight(mask) != 1) {
121 printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq);
122 return -1;
123 }
124 i = cpumask_first(mask); 120 i = cpumask_first(mask);
125 121
126 /* Convert logical CPU to physical CPU */ 122 /* Convert logical CPU to physical CPU */
diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
index 637a194e5cd5..15ea778b5e66 100644
--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -403,36 +403,31 @@ static int sbprof_zbprof_stop(void)
403static int sbprof_tb_open(struct inode *inode, struct file *filp) 403static int sbprof_tb_open(struct inode *inode, struct file *filp)
404{ 404{
405 int minor; 405 int minor;
406 int err = 0;
407 406
408 lock_kernel();
409 minor = iminor(inode); 407 minor = iminor(inode);
410 if (minor != 0) { 408 if (minor != 0)
411 err = -ENODEV; 409 return -ENODEV;
412 goto out;
413 }
414 410
415 if (xchg(&sbp.open, SB_OPENING) != SB_CLOSED) { 411 if (xchg(&sbp.open, SB_OPENING) != SB_CLOSED)
416 err = -EBUSY; 412 return -EBUSY;
417 goto out;
418 }
419 413
420 memset(&sbp, 0, sizeof(struct sbprof_tb)); 414 memset(&sbp, 0, sizeof(struct sbprof_tb));
421 sbp.sbprof_tbbuf = vmalloc(MAX_TBSAMPLE_BYTES); 415 sbp.sbprof_tbbuf = vmalloc(MAX_TBSAMPLE_BYTES);
422 if (!sbp.sbprof_tbbuf) { 416 if (!sbp.sbprof_tbbuf) {
423 err = -ENOMEM; 417 sbp.open = SB_CLOSED;
424 goto out; 418 wmb();
419 return -ENOMEM;
425 } 420 }
421
426 memset(sbp.sbprof_tbbuf, 0, MAX_TBSAMPLE_BYTES); 422 memset(sbp.sbprof_tbbuf, 0, MAX_TBSAMPLE_BYTES);
427 init_waitqueue_head(&sbp.tb_sync); 423 init_waitqueue_head(&sbp.tb_sync);
428 init_waitqueue_head(&sbp.tb_read); 424 init_waitqueue_head(&sbp.tb_read);
429 mutex_init(&sbp.lock); 425 mutex_init(&sbp.lock);
430 426
431 sbp.open = SB_OPEN; 427 sbp.open = SB_OPEN;
428 wmb();
432 429
433 out: 430 return 0;
434 unlock_kernel();
435 return err;
436} 431}
437 432
438static int sbprof_tb_release(struct inode *inode, struct file *filp) 433static int sbprof_tb_release(struct inode *inode, struct file *filp)
@@ -440,7 +435,7 @@ static int sbprof_tb_release(struct inode *inode, struct file *filp)
440 int minor; 435 int minor;
441 436
442 minor = iminor(inode); 437 minor = iminor(inode);
443 if (minor != 0 || !sbp.open) 438 if (minor != 0 || sbp.open != SB_CLOSED)
444 return -ENODEV; 439 return -ENODEV;
445 440
446 mutex_lock(&sbp.lock); 441 mutex_lock(&sbp.lock);
@@ -449,7 +444,8 @@ static int sbprof_tb_release(struct inode *inode, struct file *filp)
449 sbprof_zbprof_stop(); 444 sbprof_zbprof_stop();
450 445
451 vfree(sbp.sbprof_tbbuf); 446 vfree(sbp.sbprof_tbbuf);
452 sbp.open = 0; 447 sbp.open = SB_CLOSED;
448 wmb();
453 449
454 mutex_unlock(&sbp.lock); 450 mutex_unlock(&sbp.lock);
455 451
@@ -583,7 +579,8 @@ static int __init sbprof_tb_init(void)
583 } 579 }
584 tb_dev = dev; 580 tb_dev = dev;
585 581
586 sbp.open = 0; 582 sbp.open = SB_CLOSED;
583 wmb();
587 tb_period = zbbus_mhz * 10000LL; 584 tb_period = zbbus_mhz * 10000LL;
588 pr_info(DEVNAME ": initialized - tb_period = %lld\n", 585 pr_info(DEVNAME ": initialized - tb_period = %lld\n",
589 (long long) tb_period); 586 (long long) tb_period);
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c
index 623ffc933c4c..5277aac96b0f 100644
--- a/arch/mips/sibyte/swarm/setup.c
+++ b/arch/mips/sibyte/swarm/setup.c
@@ -106,7 +106,7 @@ void read_persistent_clock(struct timespec *ts)
106 break; 106 break;
107 } 107 }
108 ts->tv_sec = sec; 108 ts->tv_sec = sec;
109 tv->tv_nsec = 0; 109 ts->tv_nsec = 0;
110} 110}
111 111
112int rtc_mips_set_time(unsigned long sec) 112int rtc_mips_set_time(unsigned long sec)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 97fca4695e0b..ac45aab741a5 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -102,6 +102,9 @@ config HAVE_SETUP_PER_CPU_AREA
102config NEED_PER_CPU_EMBED_FIRST_CHUNK 102config NEED_PER_CPU_EMBED_FIRST_CHUNK
103 def_bool y if SPARC64 103 def_bool y if SPARC64
104 104
105config NEED_PER_CPU_PAGE_FIRST_CHUNK
106 def_bool y if SPARC64
107
105config GENERIC_HARDIRQS_NO__DO_IRQ 108config GENERIC_HARDIRQS_NO__DO_IRQ
106 bool 109 bool
107 def_bool y if SPARC64 110 def_bool y if SPARC64
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index ff68373ce6d6..aa36223497b9 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1420,7 +1420,7 @@ static void __init pcpu_free_bootmem(void *ptr, size_t size)
1420 free_bootmem(__pa(ptr), size); 1420 free_bootmem(__pa(ptr), size);
1421} 1421}
1422 1422
1423static int pcpu_cpu_distance(unsigned int from, unsigned int to) 1423static int __init pcpu_cpu_distance(unsigned int from, unsigned int to)
1424{ 1424{
1425 if (cpu_to_node(from) == cpu_to_node(to)) 1425 if (cpu_to_node(from) == cpu_to_node(to))
1426 return LOCAL_DISTANCE; 1426 return LOCAL_DISTANCE;
@@ -1428,18 +1428,53 @@ static int pcpu_cpu_distance(unsigned int from, unsigned int to)
1428 return REMOTE_DISTANCE; 1428 return REMOTE_DISTANCE;
1429} 1429}
1430 1430
1431static void __init pcpu_populate_pte(unsigned long addr)
1432{
1433 pgd_t *pgd = pgd_offset_k(addr);
1434 pud_t *pud;
1435 pmd_t *pmd;
1436
1437 pud = pud_offset(pgd, addr);
1438 if (pud_none(*pud)) {
1439 pmd_t *new;
1440
1441 new = __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE);
1442 pud_populate(&init_mm, pud, new);
1443 }
1444
1445 pmd = pmd_offset(pud, addr);
1446 if (!pmd_present(*pmd)) {
1447 pte_t *new;
1448
1449 new = __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE);
1450 pmd_populate_kernel(&init_mm, pmd, new);
1451 }
1452}
1453
1431void __init setup_per_cpu_areas(void) 1454void __init setup_per_cpu_areas(void)
1432{ 1455{
1433 unsigned long delta; 1456 unsigned long delta;
1434 unsigned int cpu; 1457 unsigned int cpu;
1435 int rc; 1458 int rc = -EINVAL;
1436 1459
1437 rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE, 1460 if (pcpu_chosen_fc != PCPU_FC_PAGE) {
1438 PERCPU_DYNAMIC_RESERVE, 4 << 20, 1461 rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE,
1439 pcpu_cpu_distance, pcpu_alloc_bootmem, 1462 PERCPU_DYNAMIC_RESERVE, 4 << 20,
1440 pcpu_free_bootmem); 1463 pcpu_cpu_distance,
1441 if (rc) 1464 pcpu_alloc_bootmem,
1442 panic("failed to initialize first chunk (%d)", rc); 1465 pcpu_free_bootmem);
1466 if (rc)
1467 pr_warning("PERCPU: %s allocator failed (%d), "
1468 "falling back to page size\n",
1469 pcpu_fc_names[pcpu_chosen_fc], rc);
1470 }
1471 if (rc < 0)
1472 rc = pcpu_page_first_chunk(PERCPU_MODULE_RESERVE,
1473 pcpu_alloc_bootmem,
1474 pcpu_free_bootmem,
1475 pcpu_populate_pte);
1476 if (rc < 0)
1477 panic("cannot initialize percpu area (err=%d)", rc);
1443 1478
1444 delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start; 1479 delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start;
1445 for_each_possible_cpu(cpu) 1480 for_each_possible_cpu(cpu)
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 4b2af86e3e8d..183c3457d2f4 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -204,10 +204,7 @@ static void print_mce_head(void)
204static void print_mce_tail(void) 204static void print_mce_tail(void)
205{ 205{
206 printk(KERN_EMERG "This is not a software problem!\n" 206 printk(KERN_EMERG "This is not a software problem!\n"
207#if (!defined(CONFIG_EDAC) || !defined(CONFIG_CPU_SUP_AMD)) 207 "Run through mcelog --ascii to decode and contact your hardware vendor\n");
208 "Run through mcelog --ascii to decode and contact your hardware vendor\n"
209#endif
210 );
211} 208}
212 209
213#define PANIC_TIMEOUT 5 /* 5 seconds */ 210#define PANIC_TIMEOUT 5 /* 5 seconds */