aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-07-03 18:13:18 -0400
committerTejun Heo <tj@kernel.org>2009-07-03 18:13:18 -0400
commitc43768cbb7655ea5ff782ae250f6e2ef4297cf98 (patch)
tree3982e41dde3eecaa3739a5d1a8ed18d04bd74f01 /arch/sh
parent1a8dd307cc0a2119be4e578c517795464e6dabba (diff)
parent746a99a5af60ee676afa2ba469ccd1373493c7e7 (diff)
Merge branch 'master' into for-next
Pull linus#master to merge PER_CPU_DEF_ATTRIBUTES and alpha build fix changes. As alpha in percpu tree uses 'weak' attribute instead of inline assembly, there's no need for __used attribute. Conflicts: arch/alpha/include/asm/percpu.h arch/mn10300/kernel/vmlinux.lds.S include/linux/percpu-defs.h
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/Kconfig12
-rw-r--r--arch/sh/Kconfig.debug4
-rw-r--r--arch/sh/boards/mach-se/7206/io.c2
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c110
-rw-r--r--arch/sh/configs/migor_defconfig53
-rw-r--r--arch/sh/configs/se7724_defconfig25
-rw-r--r--arch/sh/include/asm/dma-mapping.h12
-rw-r--r--arch/sh/include/asm/perf_counter.h2
-rw-r--r--arch/sh/include/asm/syscall_32.h1
-rw-r--r--arch/sh/include/asm/system.h1
-rw-r--r--arch/sh/include/mach-se/mach/se7724.h5
-rw-r--r--arch/sh/kernel/cpu/sh4a/Makefile6
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c29
-rw-r--r--arch/sh/kernel/idle.c23
-rw-r--r--arch/sh/mm/fault_32.c61
-rw-r--r--arch/sh/mm/init.c4
-rw-r--r--arch/sh/mm/tlbflush_64.c15
17 files changed, 282 insertions, 83 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index ac1c620d1c7d..e2bdd7b94fd9 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -15,7 +15,7 @@ config SUPERH
15 select HAVE_IOREMAP_PROT if MMU 15 select HAVE_IOREMAP_PROT if MMU
16 select HAVE_ARCH_TRACEHOOK 16 select HAVE_ARCH_TRACEHOOK
17 select HAVE_DMA_API_DEBUG 17 select HAVE_DMA_API_DEBUG
18 select HAVE_PERF_COUNTER 18 select HAVE_PERF_COUNTERS
19 select RTC_LIB 19 select RTC_LIB
20 select GENERIC_ATOMIC64 20 select GENERIC_ATOMIC64
21 help 21 help
@@ -71,6 +71,9 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
71config GENERIC_IRQ_PROBE 71config GENERIC_IRQ_PROBE
72 def_bool y 72 def_bool y
73 73
74config IRQ_PER_CPU
75 def_bool y
76
74config GENERIC_GPIO 77config GENERIC_GPIO
75 def_bool n 78 def_bool n
76 79
@@ -151,6 +154,9 @@ config ARCH_NO_VIRT_TO_BUS
151config ARCH_HAS_DEFAULT_IDLE 154config ARCH_HAS_DEFAULT_IDLE
152 def_bool y 155 def_bool y
153 156
157config ARCH_HAS_CPU_IDLE_WAIT
158 def_bool y
159
154config IO_TRAPPED 160config IO_TRAPPED
155 bool 161 bool
156 162
@@ -411,6 +417,8 @@ config CPU_SUBTYPE_SH7786
411 select CPU_HAS_PTEAEX 417 select CPU_HAS_PTEAEX
412 select ARCH_SPARSEMEM_ENABLE 418 select ARCH_SPARSEMEM_ENABLE
413 select SYS_SUPPORTS_NUMA 419 select SYS_SUPPORTS_NUMA
420 select SYS_SUPPORTS_SMP
421 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
414 422
415config CPU_SUBTYPE_SHX3 423config CPU_SUBTYPE_SHX3
416 bool "Support SH-X3 processor" 424 bool "Support SH-X3 processor"
@@ -648,7 +656,7 @@ config NR_CPUS
648 int "Maximum number of CPUs (2-32)" 656 int "Maximum number of CPUs (2-32)"
649 range 2 32 657 range 2 32
650 depends on SMP 658 depends on SMP
651 default "4" if CPU_SHX3 659 default "4" if CPU_SUBTYPE_SHX3
652 default "2" 660 default "2"
653 help 661 help
654 This allows you to specify the maximum number of CPUs which this 662 This allows you to specify the maximum number of CPUs which this
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
index 8ece0b5bd028..39224b57c6ef 100644
--- a/arch/sh/Kconfig.debug
+++ b/arch/sh/Kconfig.debug
@@ -61,10 +61,6 @@ config EARLY_PRINTK
61 select both the EARLY_SCIF_CONSOLE and SH_STANDARD_BIOS, using 61 select both the EARLY_SCIF_CONSOLE and SH_STANDARD_BIOS, using
62 the kernel command line option to toggle back and forth. 62 the kernel command line option to toggle back and forth.
63 63
64config DEBUG_BOOTMEM
65 depends on DEBUG_KERNEL
66 bool "Debug BOOTMEM initialization"
67
68config DEBUG_STACKOVERFLOW 64config DEBUG_STACKOVERFLOW
69 bool "Check for stack overflows" 65 bool "Check for stack overflows"
70 depends on DEBUG_KERNEL && SUPERH32 66 depends on DEBUG_KERNEL && SUPERH32
diff --git a/arch/sh/boards/mach-se/7206/io.c b/arch/sh/boards/mach-se/7206/io.c
index 9c3a33210d61..180455642a43 100644
--- a/arch/sh/boards/mach-se/7206/io.c
+++ b/arch/sh/boards/mach-se/7206/io.c
@@ -50,7 +50,7 @@ unsigned char se7206_inb_p(unsigned long port)
50 50
51unsigned short se7206_inw(unsigned long port) 51unsigned short se7206_inw(unsigned long port)
52{ 52{
53 return *port2adr(port);; 53 return *port2adr(port);
54} 54}
55 55
56void se7206_outb(unsigned char value, unsigned long port) 56void se7206_outb(unsigned char value, unsigned long port)
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 9cd04bd558b8..c050a8d76dfd 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -23,6 +23,8 @@
23#include <media/sh_mobile_ceu.h> 23#include <media/sh_mobile_ceu.h>
24#include <asm/io.h> 24#include <asm/io.h>
25#include <asm/heartbeat.h> 25#include <asm/heartbeat.h>
26#include <asm/sh_eth.h>
27#include <asm/clock.h>
26#include <asm/sh_keysc.h> 28#include <asm/sh_keysc.h>
27#include <cpu/sh7724.h> 29#include <cpu/sh7724.h>
28#include <mach-se/mach/se7724.h> 30#include <mach-se/mach/se7724.h>
@@ -272,6 +274,34 @@ static struct platform_device keysc_device = {
272 }, 274 },
273}; 275};
274 276
277/* SH Eth */
278static struct resource sh_eth_resources[] = {
279 [0] = {
280 .start = SH_ETH_ADDR,
281 .end = SH_ETH_ADDR + 0x1FC,
282 .flags = IORESOURCE_MEM,
283 },
284 [1] = {
285 .start = 91,
286 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
287 },
288};
289
290struct sh_eth_plat_data sh_eth_plat = {
291 .phy = 0x1f, /* SMSC LAN8187 */
292 .edmac_endian = EDMAC_LITTLE_ENDIAN,
293};
294
295static struct platform_device sh_eth_device = {
296 .name = "sh-eth",
297 .id = 0,
298 .dev = {
299 .platform_data = &sh_eth_plat,
300 },
301 .num_resources = ARRAY_SIZE(sh_eth_resources),
302 .resource = sh_eth_resources,
303};
304
275static struct platform_device *ms7724se_devices[] __initdata = { 305static struct platform_device *ms7724se_devices[] __initdata = {
276 &heartbeat_device, 306 &heartbeat_device,
277 &smc91x_eth_device, 307 &smc91x_eth_device,
@@ -280,8 +310,57 @@ static struct platform_device *ms7724se_devices[] __initdata = {
280 &ceu0_device, 310 &ceu0_device,
281 &ceu1_device, 311 &ceu1_device,
282 &keysc_device, 312 &keysc_device,
313 &sh_eth_device,
283}; 314};
284 315
316#define EEPROM_OP 0xBA206000
317#define EEPROM_ADR 0xBA206004
318#define EEPROM_DATA 0xBA20600C
319#define EEPROM_STAT 0xBA206010
320#define EEPROM_STRT 0xBA206014
321static int __init sh_eth_is_eeprom_ready(void)
322{
323 int t = 10000;
324
325 while (t--) {
326 if (!ctrl_inw(EEPROM_STAT))
327 return 1;
328 cpu_relax();
329 }
330
331 printk(KERN_ERR "ms7724se can not access to eeprom\n");
332 return 0;
333}
334
335static void __init sh_eth_init(void)
336{
337 int i;
338 u16 mac[3];
339
340 /* check EEPROM status */
341 if (!sh_eth_is_eeprom_ready())
342 return;
343
344 /* read MAC addr from EEPROM */
345 for (i = 0 ; i < 3 ; i++) {
346 ctrl_outw(0x0, EEPROM_OP); /* read */
347 ctrl_outw(i*2, EEPROM_ADR);
348 ctrl_outw(0x1, EEPROM_STRT);
349 if (!sh_eth_is_eeprom_ready())
350 return;
351
352 mac[i] = ctrl_inw(EEPROM_DATA);
353 mac[i] = ((mac[i] & 0xFF) << 8) | (mac[i] >> 8); /* swap */
354 }
355
356 /* reset sh-eth */
357 ctrl_outl(0x1, SH_ETH_ADDR + 0x0);
358
359 /* set MAC addr */
360 ctrl_outl(((mac[0] << 16) | (mac[1])), SH_ETH_MAHR);
361 ctrl_outl((mac[2]), SH_ETH_MALR);
362}
363
285#define SW4140 0xBA201000 364#define SW4140 0xBA201000
286#define FPGA_OUT 0xBA200400 365#define FPGA_OUT 0xBA200400
287#define PORT_HIZA 0xA4050158 366#define PORT_HIZA 0xA4050158
@@ -302,7 +381,8 @@ static int __init devices_setup(void)
302 ctrl_outw(ctrl_inw(FPGA_OUT) & 381 ctrl_outw(ctrl_inw(FPGA_OUT) &
303 ~((1 << 1) | /* LAN */ 382 ~((1 << 1) | /* LAN */
304 (1 << 6) | /* VIDEO DAC */ 383 (1 << 6) | /* VIDEO DAC */
305 (1 << 12)), /* USB0 */ 384 (1 << 12) | /* USB0 */
385 (1 << 14)), /* RMII */
306 FPGA_OUT); 386 FPGA_OUT);
307 387
308 /* enable IRQ 0,1,2 */ 388 /* enable IRQ 0,1,2 */
@@ -374,7 +454,7 @@ static int __init devices_setup(void)
374 gpio_request(GPIO_FN_VIO0_CLK, NULL); 454 gpio_request(GPIO_FN_VIO0_CLK, NULL);
375 gpio_request(GPIO_FN_VIO0_FLD, NULL); 455 gpio_request(GPIO_FN_VIO0_FLD, NULL);
376 gpio_request(GPIO_FN_VIO0_HD, NULL); 456 gpio_request(GPIO_FN_VIO0_HD, NULL);
377 platform_resource_setup_memory(&ceu0_device, "ceu", 4 << 20); 457 platform_resource_setup_memory(&ceu0_device, "ceu0", 4 << 20);
378 458
379 /* enable CEU1 */ 459 /* enable CEU1 */
380 gpio_request(GPIO_FN_VIO1_D7, NULL); 460 gpio_request(GPIO_FN_VIO1_D7, NULL);
@@ -389,7 +469,7 @@ static int __init devices_setup(void)
389 gpio_request(GPIO_FN_VIO1_HD, NULL); 469 gpio_request(GPIO_FN_VIO1_HD, NULL);
390 gpio_request(GPIO_FN_VIO1_VD, NULL); 470 gpio_request(GPIO_FN_VIO1_VD, NULL);
391 gpio_request(GPIO_FN_VIO1_CLK, NULL); 471 gpio_request(GPIO_FN_VIO1_CLK, NULL);
392 platform_resource_setup_memory(&ceu1_device, "ceu", 4 << 20); 472 platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20);
393 473
394 /* KEYSC */ 474 /* KEYSC */
395 gpio_request(GPIO_FN_KEYOUT5_IN5, NULL); 475 gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
@@ -404,6 +484,28 @@ static int __init devices_setup(void)
404 gpio_request(GPIO_FN_KEYOUT1, NULL); 484 gpio_request(GPIO_FN_KEYOUT1, NULL);
405 gpio_request(GPIO_FN_KEYOUT0, NULL); 485 gpio_request(GPIO_FN_KEYOUT0, NULL);
406 486
487 /*
488 * enable SH-Eth
489 *
490 * please remove J33 pin from your board !!
491 *
492 * ms7724 board should not use GPIO_FN_LNKSTA pin
493 * So, This time PTX5 is set to input pin
494 */
495 gpio_request(GPIO_FN_RMII_RXD0, NULL);
496 gpio_request(GPIO_FN_RMII_RXD1, NULL);
497 gpio_request(GPIO_FN_RMII_TXD0, NULL);
498 gpio_request(GPIO_FN_RMII_TXD1, NULL);
499 gpio_request(GPIO_FN_RMII_REF_CLK, NULL);
500 gpio_request(GPIO_FN_RMII_TX_EN, NULL);
501 gpio_request(GPIO_FN_RMII_RX_ER, NULL);
502 gpio_request(GPIO_FN_RMII_CRS_DV, NULL);
503 gpio_request(GPIO_FN_MDIO, NULL);
504 gpio_request(GPIO_FN_MDC, NULL);
505 gpio_request(GPIO_PTX5, NULL);
506 gpio_direction_input(GPIO_PTX5);
507 sh_eth_init();
508
407 if (sw & SW41_B) { 509 if (sw & SW41_B) {
408 /* SVGA */ 510 /* SVGA */
409 lcdc_info.ch[0].lcd_cfg.xres = 800; 511 lcdc_info.ch[0].lcd_cfg.xres = 800;
@@ -437,7 +539,7 @@ static int __init devices_setup(void)
437 } 539 }
438 540
439 return platform_add_devices(ms7724se_devices, 541 return platform_add_devices(ms7724se_devices,
440 ARRAY_SIZE(ms7724se_devices)); 542 ARRAY_SIZE(ms7724se_devices));
441} 543}
442device_initcall(devices_setup); 544device_initcall(devices_setup);
443 545
diff --git a/arch/sh/configs/migor_defconfig b/arch/sh/configs/migor_defconfig
index da627d22c009..b18cfd39cac6 100644
--- a/arch/sh/configs/migor_defconfig
+++ b/arch/sh/configs/migor_defconfig
@@ -309,7 +309,7 @@ CONFIG_ZERO_PAGE_OFFSET=0x00001000
309CONFIG_BOOT_LINK_OFFSET=0x00800000 309CONFIG_BOOT_LINK_OFFSET=0x00800000
310CONFIG_ENTRY_OFFSET=0x00001000 310CONFIG_ENTRY_OFFSET=0x00001000
311CONFIG_CMDLINE_BOOL=y 311CONFIG_CMDLINE_BOOL=y
312CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=serial ip=on root=/dev/nfs ip=dhcp" 312CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 earlyprintk=serial ip=on root=/dev/nfs ip=dhcp"
313 313
314# 314#
315# Bus options 315# Bus options
@@ -858,7 +858,35 @@ CONFIG_VIDEO_SH_MOBILE_CEU=y
858# 858#
859# CONFIG_VGASTATE is not set 859# CONFIG_VGASTATE is not set
860# CONFIG_VIDEO_OUTPUT_CONTROL is not set 860# CONFIG_VIDEO_OUTPUT_CONTROL is not set
861# CONFIG_FB is not set 861CONFIG_FB=y
862# CONFIG_FIRMWARE_EDID is not set
863# CONFIG_FB_DDC is not set
864# CONFIG_FB_BOOT_VESA_SUPPORT is not set
865# CONFIG_FB_CFB_FILLRECT is not set
866# CONFIG_FB_CFB_COPYAREA is not set
867# CONFIG_FB_CFB_IMAGEBLIT is not set
868# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
869CONFIG_FB_SYS_FILLRECT=y
870CONFIG_FB_SYS_COPYAREA=y
871CONFIG_FB_SYS_IMAGEBLIT=y
872# CONFIG_FB_FOREIGN_ENDIAN is not set
873CONFIG_FB_SYS_FOPS=y
874CONFIG_FB_DEFERRED_IO=y
875# CONFIG_FB_SVGALIB is not set
876# CONFIG_FB_MACMODES is not set
877# CONFIG_FB_BACKLIGHT is not set
878# CONFIG_FB_MODE_HELPERS is not set
879# CONFIG_FB_TILEBLITTING is not set
880
881#
882# Frame buffer hardware drivers
883#
884# CONFIG_FB_S1D13XXX is not set
885CONFIG_FB_SH_MOBILE_LCDC=y
886# CONFIG_FB_VIRTUAL is not set
887# CONFIG_FB_METRONOME is not set
888# CONFIG_FB_MB862XX is not set
889# CONFIG_FB_BROADSHEET is not set
862# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 890# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
863 891
864# 892#
@@ -870,6 +898,27 @@ CONFIG_VIDEO_SH_MOBILE_CEU=y
870# Console display driver support 898# Console display driver support
871# 899#
872CONFIG_DUMMY_CONSOLE=y 900CONFIG_DUMMY_CONSOLE=y
901CONFIG_FRAMEBUFFER_CONSOLE=y
902CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
903# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
904CONFIG_FONTS=y
905# CONFIG_FONT_8x8 is not set
906# CONFIG_FONT_8x16 is not set
907# CONFIG_FONT_6x11 is not set
908# CONFIG_FONT_7x14 is not set
909# CONFIG_FONT_PEARL_8x8 is not set
910# CONFIG_FONT_ACORN_8x8 is not set
911CONFIG_FONT_MINI_4x6=y
912# CONFIG_FONT_SUN8x16 is not set
913# CONFIG_FONT_SUN12x22 is not set
914# CONFIG_FONT_10x18 is not set
915CONFIG_LOGO=y
916# CONFIG_LOGO_LINUX_MONO is not set
917# CONFIG_LOGO_LINUX_VGA16 is not set
918# CONFIG_LOGO_LINUX_CLUT224 is not set
919# CONFIG_LOGO_SUPERH_MONO is not set
920CONFIG_LOGO_SUPERH_VGA16=y
921# CONFIG_LOGO_SUPERH_CLUT224 is not set
873# CONFIG_SOUND is not set 922# CONFIG_SOUND is not set
874CONFIG_HID_SUPPORT=y 923CONFIG_HID_SUPPORT=y
875CONFIG_HID=y 924CONFIG_HID=y
diff --git a/arch/sh/configs/se7724_defconfig b/arch/sh/configs/se7724_defconfig
index 3840270283e4..3ee783a0a075 100644
--- a/arch/sh/configs/se7724_defconfig
+++ b/arch/sh/configs/se7724_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30 3# Linux kernel version: 2.6.30
4# Thu Jun 18 16:09:05 2009 4# Mon Jun 29 16:28:43 2009
5# 5#
6CONFIG_SUPERH=y 6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y 7CONFIG_SUPERH32=y
@@ -14,6 +14,7 @@ CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y 14CONFIG_GENERIC_HARDIRQS=y
15CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 15CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
16CONFIG_GENERIC_IRQ_PROBE=y 16CONFIG_GENERIC_IRQ_PROBE=y
17CONFIG_IRQ_PER_CPU=y
17CONFIG_GENERIC_GPIO=y 18CONFIG_GENERIC_GPIO=y
18CONFIG_GENERIC_TIME=y 19CONFIG_GENERIC_TIME=y
19CONFIG_GENERIC_CLOCKEVENTS=y 20CONFIG_GENERIC_CLOCKEVENTS=y
@@ -28,7 +29,9 @@ CONFIG_HAVE_LATENCYTOP_SUPPORT=y
28# CONFIG_ARCH_HAS_ILOG2_U64 is not set 29# CONFIG_ARCH_HAS_ILOG2_U64 is not set
29CONFIG_ARCH_NO_VIRT_TO_BUS=y 30CONFIG_ARCH_NO_VIRT_TO_BUS=y
30CONFIG_ARCH_HAS_DEFAULT_IDLE=y 31CONFIG_ARCH_HAS_DEFAULT_IDLE=y
32CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
31CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 33CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
34CONFIG_CONSTRUCTORS=y
32 35
33# 36#
34# General setup 37# General setup
@@ -88,10 +91,12 @@ CONFIG_TIMERFD=y
88CONFIG_EVENTFD=y 91CONFIG_EVENTFD=y
89CONFIG_SHMEM=y 92CONFIG_SHMEM=y
90CONFIG_AIO=y 93CONFIG_AIO=y
94CONFIG_HAVE_PERF_COUNTERS=y
91 95
92# 96#
93# Performance Counters 97# Performance Counters
94# 98#
99# CONFIG_PERF_COUNTERS is not set
95CONFIG_VM_EVENT_COUNTERS=y 100CONFIG_VM_EVENT_COUNTERS=y
96# CONFIG_STRIP_ASM_SYMS is not set 101# CONFIG_STRIP_ASM_SYMS is not set
97CONFIG_COMPAT_BRK=y 102CONFIG_COMPAT_BRK=y
@@ -107,6 +112,10 @@ CONFIG_HAVE_KRETPROBES=y
107CONFIG_HAVE_ARCH_TRACEHOOK=y 112CONFIG_HAVE_ARCH_TRACEHOOK=y
108CONFIG_HAVE_CLK=y 113CONFIG_HAVE_CLK=y
109CONFIG_HAVE_DMA_API_DEBUG=y 114CONFIG_HAVE_DMA_API_DEBUG=y
115
116#
117# GCOV-based kernel profiling
118#
110# CONFIG_SLOW_WORK is not set 119# CONFIG_SLOW_WORK is not set
111CONFIG_HAVE_GENERIC_DMA_COHERENT=y 120CONFIG_HAVE_GENERIC_DMA_COHERENT=y
112CONFIG_SLABINFO=y 121CONFIG_SLABINFO=y
@@ -119,7 +128,7 @@ CONFIG_MODULE_UNLOAD=y
119# CONFIG_MODVERSIONS is not set 128# CONFIG_MODVERSIONS is not set
120# CONFIG_MODULE_SRCVERSION_ALL is not set 129# CONFIG_MODULE_SRCVERSION_ALL is not set
121CONFIG_BLOCK=y 130CONFIG_BLOCK=y
122# CONFIG_LBD is not set 131CONFIG_LBDAF=y
123# CONFIG_BLK_DEV_BSG is not set 132# CONFIG_BLK_DEV_BSG is not set
124# CONFIG_BLK_DEV_INTEGRITY is not set 133# CONFIG_BLK_DEV_INTEGRITY is not set
125 134
@@ -584,7 +593,6 @@ CONFIG_SCSI_WAIT_SCAN=m
584# CONFIG_SCSI_SRP_ATTRS is not set 593# CONFIG_SCSI_SRP_ATTRS is not set
585CONFIG_SCSI_LOWLEVEL=y 594CONFIG_SCSI_LOWLEVEL=y
586# CONFIG_ISCSI_TCP is not set 595# CONFIG_ISCSI_TCP is not set
587# CONFIG_SCSI_BNX2_ISCSI is not set
588# CONFIG_LIBFC is not set 596# CONFIG_LIBFC is not set
589# CONFIG_LIBFCOE is not set 597# CONFIG_LIBFCOE is not set
590# CONFIG_SCSI_DEBUG is not set 598# CONFIG_SCSI_DEBUG is not set
@@ -624,7 +632,7 @@ CONFIG_NET_ETHERNET=y
624CONFIG_MII=y 632CONFIG_MII=y
625# CONFIG_AX88796 is not set 633# CONFIG_AX88796 is not set
626# CONFIG_STNIC is not set 634# CONFIG_STNIC is not set
627# CONFIG_SH_ETH is not set 635CONFIG_SH_ETH=y
628CONFIG_SMC91X=y 636CONFIG_SMC91X=y
629# CONFIG_ENC28J60 is not set 637# CONFIG_ENC28J60 is not set
630# CONFIG_ETHOC is not set 638# CONFIG_ETHOC is not set
@@ -801,6 +809,11 @@ CONFIG_SPI_BITBANG=y
801# 809#
802# CONFIG_SPI_SPIDEV is not set 810# CONFIG_SPI_SPIDEV is not set
803# CONFIG_SPI_TLE62X0 is not set 811# CONFIG_SPI_TLE62X0 is not set
812
813#
814# PPS support
815#
816# CONFIG_PPS is not set
804CONFIG_ARCH_REQUIRE_GPIOLIB=y 817CONFIG_ARCH_REQUIRE_GPIOLIB=y
805CONFIG_GPIOLIB=y 818CONFIG_GPIOLIB=y
806# CONFIG_GPIO_SYSFS is not set 819# CONFIG_GPIO_SYSFS is not set
@@ -851,6 +864,8 @@ CONFIG_SSB_POSSIBLE=y
851# CONFIG_MFD_WM8400 is not set 864# CONFIG_MFD_WM8400 is not set
852# CONFIG_MFD_WM8350_I2C is not set 865# CONFIG_MFD_WM8350_I2C is not set
853# CONFIG_MFD_PCF50633 is not set 866# CONFIG_MFD_PCF50633 is not set
867# CONFIG_AB3100_CORE is not set
868# CONFIG_EZX_PCAP is not set
854# CONFIG_REGULATOR is not set 869# CONFIG_REGULATOR is not set
855CONFIG_MEDIA_SUPPORT=y 870CONFIG_MEDIA_SUPPORT=y
856 871
@@ -1196,6 +1211,7 @@ CONFIG_RTC_DRV_PCF8563=y
1196# CONFIG_RTC_DRV_S35390A is not set 1211# CONFIG_RTC_DRV_S35390A is not set
1197# CONFIG_RTC_DRV_FM3130 is not set 1212# CONFIG_RTC_DRV_FM3130 is not set
1198# CONFIG_RTC_DRV_RX8581 is not set 1213# CONFIG_RTC_DRV_RX8581 is not set
1214# CONFIG_RTC_DRV_RX8025 is not set
1199 1215
1200# 1216#
1201# SPI RTC drivers 1217# SPI RTC drivers
@@ -1260,6 +1276,7 @@ CONFIG_FS_MBCACHE=y
1260# CONFIG_JFS_FS is not set 1276# CONFIG_JFS_FS is not set
1261CONFIG_FS_POSIX_ACL=y 1277CONFIG_FS_POSIX_ACL=y
1262# CONFIG_XFS_FS is not set 1278# CONFIG_XFS_FS is not set
1279# CONFIG_GFS2_FS is not set
1263# CONFIG_OCFS2_FS is not set 1280# CONFIG_OCFS2_FS is not set
1264# CONFIG_BTRFS_FS is not set 1281# CONFIG_BTRFS_FS is not set
1265CONFIG_FILE_LOCKING=y 1282CONFIG_FILE_LOCKING=y
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h
index ea9d4f41c9d2..69d56dd4c968 100644
--- a/arch/sh/include/asm/dma-mapping.h
+++ b/arch/sh/include/asm/dma-mapping.h
@@ -97,7 +97,7 @@ static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
97 dma_unmap_single(dev, dma_address, size, dir); 97 dma_unmap_single(dev, dma_address, size, dir);
98} 98}
99 99
100static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle, 100static inline void __dma_sync_single(struct device *dev, dma_addr_t dma_handle,
101 size_t size, enum dma_data_direction dir) 101 size_t size, enum dma_data_direction dir)
102{ 102{
103#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT) 103#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
@@ -119,7 +119,7 @@ static inline void dma_sync_single_range(struct device *dev,
119 dma_cache_sync(dev, phys_to_virt(dma_handle) + offset, size, dir); 119 dma_cache_sync(dev, phys_to_virt(dma_handle) + offset, size, dir);
120} 120}
121 121
122static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, 122static inline void __dma_sync_sg(struct device *dev, struct scatterlist *sg,
123 int nelems, enum dma_data_direction dir) 123 int nelems, enum dma_data_direction dir)
124{ 124{
125 int i; 125 int i;
@@ -137,7 +137,7 @@ static inline void dma_sync_single_for_cpu(struct device *dev,
137 dma_addr_t dma_handle, size_t size, 137 dma_addr_t dma_handle, size_t size,
138 enum dma_data_direction dir) 138 enum dma_data_direction dir)
139{ 139{
140 dma_sync_single(dev, dma_handle, size, dir); 140 __dma_sync_single(dev, dma_handle, size, dir);
141 debug_dma_sync_single_for_cpu(dev, dma_handle, size, dir); 141 debug_dma_sync_single_for_cpu(dev, dma_handle, size, dir);
142} 142}
143 143
@@ -146,7 +146,7 @@ static inline void dma_sync_single_for_device(struct device *dev,
146 size_t size, 146 size_t size,
147 enum dma_data_direction dir) 147 enum dma_data_direction dir)
148{ 148{
149 dma_sync_single(dev, dma_handle, size, dir); 149 __dma_sync_single(dev, dma_handle, size, dir);
150 debug_dma_sync_single_for_device(dev, dma_handle, size, dir); 150 debug_dma_sync_single_for_device(dev, dma_handle, size, dir);
151} 151}
152 152
@@ -177,7 +177,7 @@ static inline void dma_sync_sg_for_cpu(struct device *dev,
177 struct scatterlist *sg, int nelems, 177 struct scatterlist *sg, int nelems,
178 enum dma_data_direction dir) 178 enum dma_data_direction dir)
179{ 179{
180 dma_sync_sg(dev, sg, nelems, dir); 180 __dma_sync_sg(dev, sg, nelems, dir);
181 debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir); 181 debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir);
182} 182}
183 183
@@ -185,7 +185,7 @@ static inline void dma_sync_sg_for_device(struct device *dev,
185 struct scatterlist *sg, int nelems, 185 struct scatterlist *sg, int nelems,
186 enum dma_data_direction dir) 186 enum dma_data_direction dir)
187{ 187{
188 dma_sync_sg(dev, sg, nelems, dir); 188 __dma_sync_sg(dev, sg, nelems, dir);
189 debug_dma_sync_sg_for_device(dev, sg, nelems, dir); 189 debug_dma_sync_sg_for_device(dev, sg, nelems, dir);
190} 190}
191 191
diff --git a/arch/sh/include/asm/perf_counter.h b/arch/sh/include/asm/perf_counter.h
index a8153c2aa6fa..61c2b40c802c 100644
--- a/arch/sh/include/asm/perf_counter.h
+++ b/arch/sh/include/asm/perf_counter.h
@@ -2,6 +2,6 @@
2#define __ASM_SH_PERF_COUNTER_H 2#define __ASM_SH_PERF_COUNTER_H
3 3
4/* SH only supports software counters through this interface. */ 4/* SH only supports software counters through this interface. */
5#define set_perf_counter_pending() do { } while (0) 5static inline void set_perf_counter_pending(void) {}
6 6
7#endif /* __ASM_SH_PERF_COUNTER_H */ 7#endif /* __ASM_SH_PERF_COUNTER_H */
diff --git a/arch/sh/include/asm/syscall_32.h b/arch/sh/include/asm/syscall_32.h
index 5bc34681d994..6f83f2cc45c1 100644
--- a/arch/sh/include/asm/syscall_32.h
+++ b/arch/sh/include/asm/syscall_32.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/sched.h> 5#include <linux/sched.h>
6#include <linux/err.h>
6#include <asm/ptrace.h> 7#include <asm/ptrace.h>
7 8
8/* The system call number is given by the user in R3 */ 9/* The system call number is given by the user in R3 */
diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h
index a88895e6dcb0..ab79e1f4fbe0 100644
--- a/arch/sh/include/asm/system.h
+++ b/arch/sh/include/asm/system.h
@@ -154,6 +154,7 @@ extern struct dentry *sh_debugfs_root;
154 154
155void per_cpu_trap_init(void); 155void per_cpu_trap_init(void);
156void default_idle(void); 156void default_idle(void);
157void cpu_idle_wait(void);
157 158
158asmlinkage void break_point_trap(void); 159asmlinkage void break_point_trap(void);
159 160
diff --git a/arch/sh/include/mach-se/mach/se7724.h b/arch/sh/include/mach-se/mach/se7724.h
index 74164b60d0db..29514a39d0f5 100644
--- a/arch/sh/include/mach-se/mach/se7724.h
+++ b/arch/sh/include/mach-se/mach/se7724.h
@@ -20,6 +20,11 @@
20 */ 20 */
21#include <asm/addrspace.h> 21#include <asm/addrspace.h>
22 22
23/* SH Eth */
24#define SH_ETH_ADDR (0xA4600000)
25#define SH_ETH_MAHR (SH_ETH_ADDR + 0x1C0)
26#define SH_ETH_MALR (SH_ETH_ADDR + 0x1C8)
27
23#define PA_LED (0xba203000) /* 8bit LED */ 28#define PA_LED (0xba203000) /* 8bit LED */
24#define IRQ_MODE (0xba200010) 29#define IRQ_MODE (0xba200010)
25#define IRQ0_SR (0xba200014) 30#define IRQ0_SR (0xba200014)
diff --git a/arch/sh/kernel/cpu/sh4a/Makefile b/arch/sh/kernel/cpu/sh4a/Makefile
index 96ea09ca8cc1..ebdd391d5f42 100644
--- a/arch/sh/kernel/cpu/sh4a/Makefile
+++ b/arch/sh/kernel/cpu/sh4a/Makefile
@@ -16,7 +16,7 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7366) += setup-sh7366.o
16obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o 16obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o
17 17
18# SMP setup 18# SMP setup
19smp-$(CONFIG_CPU_SUBTYPE_SHX3) := smp-shx3.o 19smp-$(CONFIG_CPU_SHX3) := smp-shx3.o
20 20
21# Primary on-chip clocks (common) 21# Primary on-chip clocks (common)
22clock-$(CONFIG_CPU_SUBTYPE_SH7763) := clock-sh7763.o 22clock-$(CONFIG_CPU_SUBTYPE_SH7763) := clock-sh7763.o
@@ -38,6 +38,6 @@ pinmux-$(CONFIG_CPU_SUBTYPE_SH7724) := pinmux-sh7724.o
38pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o 38pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o
39pinmux-$(CONFIG_CPU_SUBTYPE_SH7786) := pinmux-sh7786.o 39pinmux-$(CONFIG_CPU_SUBTYPE_SH7786) := pinmux-sh7786.o
40 40
41obj-y += $(clock-y) 41obj-y += $(clock-y)
42obj-$(CONFIG_SMP) += $(smp-y) 42obj-$(CONFIG_SMP) += $(smp-y)
43obj-$(CONFIG_GENERIC_GPIO) += $(pinmux-y) 43obj-$(CONFIG_GENERIC_GPIO) += $(pinmux-y)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index 93e0d2c017e8..b70049470a0b 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -595,9 +595,8 @@ enum {
595 HSPI, 595 HSPI,
596 GPIO0, GPIO1, 596 GPIO0, GPIO1,
597 Thermal, 597 Thermal,
598 INTC0, INTC1, INTC2, INTC3, INTC4, INTC5, INTC6, INTC7, 598 INTICI0, INTICI1, INTICI2, INTICI3,
599 599 INTICI4, INTICI5, INTICI6, INTICI7,
600 /* interrupt groups */
601}; 600};
602 601
603static struct intc_vect vectors[] __initdata = { 602static struct intc_vect vectors[] __initdata = {
@@ -638,10 +637,12 @@ static struct intc_vect vectors[] __initdata = {
638 INTC_VECT(HSPI, 0xe80), 637 INTC_VECT(HSPI, 0xe80),
639 INTC_VECT(GPIO0, 0xea0), INTC_VECT(GPIO1, 0xec0), 638 INTC_VECT(GPIO0, 0xea0), INTC_VECT(GPIO1, 0xec0),
640 INTC_VECT(Thermal, 0xee0), 639 INTC_VECT(Thermal, 0xee0),
640 INTC_VECT(INTICI0, 0xf00), INTC_VECT(INTICI1, 0xf20),
641 INTC_VECT(INTICI2, 0xf40), INTC_VECT(INTICI3, 0xf60),
642 INTC_VECT(INTICI4, 0xf80), INTC_VECT(INTICI5, 0xfa0),
643 INTC_VECT(INTICI6, 0xfc0), INTC_VECT(INTICI7, 0xfe0),
641}; 644};
642 645
643/* FIXME: Main CPU support only now */
644#if 1 /* Main CPU */
645#define CnINTMSK0 0xfe410030 646#define CnINTMSK0 0xfe410030
646#define CnINTMSK1 0xfe410040 647#define CnINTMSK1 0xfe410040
647#define CnINTMSKCLR0 0xfe410050 648#define CnINTMSKCLR0 0xfe410050
@@ -654,21 +655,6 @@ static struct intc_vect vectors[] __initdata = {
654#define CnINT2MSKCR1 0xfe410a34 655#define CnINT2MSKCR1 0xfe410a34
655#define CnINT2MSKCR2 0xfe410a38 656#define CnINT2MSKCR2 0xfe410a38
656#define CnINT2MSKCR3 0xfe410a3c 657#define CnINT2MSKCR3 0xfe410a3c
657#else /* Sub CPU */
658#define CnINTMSK0 0xfe410034
659#define CnINTMSK1 0xfe410044
660#define CnINTMSKCLR0 0xfe410054
661#define CnINTMSKCLR1 0xfe410064
662#define CnINT2MSKR0 0xfe410b20
663#define CnINT2MSKR1 0xfe410b24
664#define CnINT2MSKR2 0xfe410b28
665#define CnINT2MSKR3 0xfe410b2c
666#define CnINT2MSKCR0 0xfe410b30
667#define CnINT2MSKCR1 0xfe410b34
668#define CnINT2MSKCR2 0xfe410b38
669#define CnINT2MSKCR3 0xfe410b3c
670#endif
671
672#define INTMSK2 0xfe410068 658#define INTMSK2 0xfe410068
673#define INTMSKCLR2 0xfe41006c 659#define INTMSKCLR2 0xfe41006c
674 660
@@ -753,6 +739,9 @@ static struct intc_prio_reg prio_registers[] __initdata = {
753 GPIO1, Thermal } }, 739 GPIO1, Thermal } },
754 { 0xfe41085c, 0, 32, 8, /* INT2PRI23 */ { 0, 0, 0, 0 } }, 740 { 0xfe41085c, 0, 32, 8, /* INT2PRI23 */ { 0, 0, 0, 0 } },
755 { 0xfe410860, 0, 32, 8, /* INT2PRI24 */ { 0, 0, 0, 0 } }, 741 { 0xfe410860, 0, 32, 8, /* INT2PRI24 */ { 0, 0, 0, 0 } },
742 { 0xfe410090, 0xfe4100a0, 32, 4, /* CnICIPRI / CnICIPRICLR */
743 { INTICI7, INTICI6, INTICI5, INTICI4,
744 INTICI3, INTICI2, INTICI1, INTICI0 }, INTC_SMP(4, 2) },
756}; 745};
757 746
758static DECLARE_INTC_DESC(intc_desc, "sh7786", vectors, NULL, 747static DECLARE_INTC_DESC(intc_desc, "sh7786", vectors, NULL,
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
index f35ed0348850..27ff2dc093c7 100644
--- a/arch/sh/kernel/idle.c
+++ b/arch/sh/kernel/idle.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * The idle loop for all SuperH platforms. 2 * The idle loop for all SuperH platforms.
3 * 3 *
4 * Copyright (C) 2002 - 2008 Paul Mundt 4 * Copyright (C) 2002 - 2009 Paul Mundt
5 * 5 *
6 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive 7 * License. See the file "COPYING" in the main directory of this archive
@@ -15,6 +15,7 @@
15#include <linux/preempt.h> 15#include <linux/preempt.h>
16#include <linux/thread_info.h> 16#include <linux/thread_info.h>
17#include <linux/irqflags.h> 17#include <linux/irqflags.h>
18#include <linux/smp.h>
18#include <asm/pgalloc.h> 19#include <asm/pgalloc.h>
19#include <asm/system.h> 20#include <asm/system.h>
20#include <asm/atomic.h> 21#include <asm/atomic.h>
@@ -79,3 +80,23 @@ void cpu_idle(void)
79 check_pgt_cache(); 80 check_pgt_cache();
80 } 81 }
81} 82}
83
84static void do_nothing(void *unused)
85{
86}
87
88/*
89 * cpu_idle_wait - Used to ensure that all the CPUs discard old value of
90 * pm_idle and update to new pm_idle value. Required while changing pm_idle
91 * handler on SMP systems.
92 *
93 * Caller must have changed pm_idle to the new value before the call. Old
94 * pm_idle value will not be used by any CPU after the return of this function.
95 */
96void cpu_idle_wait(void)
97{
98 smp_mb();
99 /* kick all the CPUs so that they exit out of pm_idle */
100 smp_call_function(do_nothing, NULL, 1);
101}
102EXPORT_SYMBOL_GPL(cpu_idle_wait);
diff --git a/arch/sh/mm/fault_32.c b/arch/sh/mm/fault_32.c
index cc8ddbdf3d7a..71925946f1e1 100644
--- a/arch/sh/mm/fault_32.c
+++ b/arch/sh/mm/fault_32.c
@@ -15,12 +15,28 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/hardirq.h> 16#include <linux/hardirq.h>
17#include <linux/kprobes.h> 17#include <linux/kprobes.h>
18#include <linux/marker.h> 18#include <linux/perf_counter.h>
19#include <asm/io_trapped.h> 19#include <asm/io_trapped.h>
20#include <asm/system.h> 20#include <asm/system.h>
21#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
22#include <asm/tlbflush.h> 22#include <asm/tlbflush.h>
23 23
24static inline int notify_page_fault(struct pt_regs *regs, int trap)
25{
26 int ret = 0;
27
28#ifdef CONFIG_KPROBES
29 if (!user_mode(regs)) {
30 preempt_disable();
31 if (kprobe_running() && kprobe_fault_handler(regs, trap))
32 ret = 1;
33 preempt_enable();
34 }
35#endif
36
37 return ret;
38}
39
24/* 40/*
25 * This routine handles page faults. It determines the address, 41 * This routine handles page faults. It determines the address,
26 * and the problem, and then passes it off to one of the appropriate 42 * and the problem, and then passes it off to one of the appropriate
@@ -87,13 +103,16 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
87 return; 103 return;
88 } 104 }
89 105
106 mm = tsk->mm;
107
108 if (unlikely(notify_page_fault(regs, lookup_exception_vector())))
109 return;
110
90 /* Only enable interrupts if they were on before the fault */ 111 /* Only enable interrupts if they were on before the fault */
91 if ((regs->sr & SR_IMASK) != SR_IMASK) { 112 if ((regs->sr & SR_IMASK) != SR_IMASK)
92 trace_hardirqs_on();
93 local_irq_enable(); 113 local_irq_enable();
94 }
95 114
96 mm = tsk->mm; 115 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
97 116
98 /* 117 /*
99 * If we're in an interrupt or have no user 118 * If we're in an interrupt or have no user
@@ -141,10 +160,15 @@ survive:
141 goto do_sigbus; 160 goto do_sigbus;
142 BUG(); 161 BUG();
143 } 162 }
144 if (fault & VM_FAULT_MAJOR) 163 if (fault & VM_FAULT_MAJOR) {
145 tsk->maj_flt++; 164 tsk->maj_flt++;
146 else 165 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
166 regs, address);
167 } else {
147 tsk->min_flt++; 168 tsk->min_flt++;
169 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
170 regs, address);
171 }
148 172
149 up_read(&mm->mmap_sem); 173 up_read(&mm->mmap_sem);
150 return; 174 return;
@@ -245,22 +269,6 @@ do_sigbus:
245 goto no_context; 269 goto no_context;
246} 270}
247 271
248static inline int notify_page_fault(struct pt_regs *regs, int trap)
249{
250 int ret = 0;
251
252#ifdef CONFIG_KPROBES
253 if (!user_mode(regs)) {
254 preempt_disable();
255 if (kprobe_running() && kprobe_fault_handler(regs, trap))
256 ret = 1;
257 preempt_enable();
258 }
259#endif
260
261 return ret;
262}
263
264/* 272/*
265 * Called with interrupts disabled. 273 * Called with interrupts disabled.
266 */ 274 */
@@ -273,12 +281,7 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
273 pmd_t *pmd; 281 pmd_t *pmd;
274 pte_t *pte; 282 pte_t *pte;
275 pte_t entry; 283 pte_t entry;
276 int ret = 0; 284 int ret = 1;
277
278 if (notify_page_fault(regs, lookup_exception_vector()))
279 goto out;
280
281 ret = 1;
282 285
283 /* 286 /*
284 * We don't take page faults for P1, P2, and parts of P4, these 287 * We don't take page faults for P1, P2, and parts of P4, these
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index ee8e6bbe882c..fe532aeaa16d 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -70,7 +70,7 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
70 } 70 }
71 71
72 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot)); 72 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot));
73 flush_tlb_one(get_asid(), addr); 73 local_flush_tlb_one(get_asid(), addr);
74} 74}
75 75
76/* 76/*
@@ -177,10 +177,8 @@ void __init paging_init(void)
177 177
178 free_area_init_nodes(max_zone_pfns); 178 free_area_init_nodes(max_zone_pfns);
179 179
180#ifdef CONFIG_SUPERH32
181 /* Set up the uncached fixmap */ 180 /* Set up the uncached fixmap */
182 set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start)); 181 set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start));
183#endif
184} 182}
185 183
186static struct kcore_list kcore_mem, kcore_vmalloc; 184static struct kcore_list kcore_mem, kcore_vmalloc;
diff --git a/arch/sh/mm/tlbflush_64.c b/arch/sh/mm/tlbflush_64.c
index fcbb6e135cef..3ce40ea34824 100644
--- a/arch/sh/mm/tlbflush_64.c
+++ b/arch/sh/mm/tlbflush_64.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2000, 2001 Paolo Alberelli 4 * Copyright (C) 2000, 2001 Paolo Alberelli
5 * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes) 5 * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes)
6 * Copyright (C) 2003 Paul Mundt 6 * Copyright (C) 2003 - 2009 Paul Mundt
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -20,6 +20,7 @@
20#include <linux/mman.h> 20#include <linux/mman.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/perf_counter.h>
23#include <linux/interrupt.h> 24#include <linux/interrupt.h>
24#include <asm/system.h> 25#include <asm/system.h>
25#include <asm/io.h> 26#include <asm/io.h>
@@ -115,6 +116,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
115 /* Not an IO address, so reenable interrupts */ 116 /* Not an IO address, so reenable interrupts */
116 local_irq_enable(); 117 local_irq_enable();
117 118
119 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
120
118 /* 121 /*
119 * If we're in an interrupt or have no user 122 * If we're in an interrupt or have no user
120 * context, we must not take the fault.. 123 * context, we must not take the fault..
@@ -195,10 +198,16 @@ survive:
195 goto do_sigbus; 198 goto do_sigbus;
196 BUG(); 199 BUG();
197 } 200 }
198 if (fault & VM_FAULT_MAJOR) 201
202 if (fault & VM_FAULT_MAJOR) {
199 tsk->maj_flt++; 203 tsk->maj_flt++;
200 else 204 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
205 regs, address);
206 } else {
201 tsk->min_flt++; 207 tsk->min_flt++;
208 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
209 regs, address);
210 }
202 211
203 /* If we get here, the page fault has been handled. Do the TLB refill 212 /* If we get here, the page fault has been handled. Do the TLB refill
204 now from the newly-setup PTE, to avoid having to fault again right 213 now from the newly-setup PTE, to avoid having to fault again right