aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/Kconfig18
-rw-r--r--arch/sh/boards/board-ap325rxa.c1
-rw-r--r--arch/sh/boards/board-urquell.c30
-rw-r--r--arch/sh/configs/sh7785lcr_defconfig57
-rw-r--r--arch/sh/drivers/pci/ops-sh7785lcr.c5
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.h2
-rw-r--r--arch/sh/drivers/pci/pci.c3
-rw-r--r--arch/sh/include/asm/dma-mapping.h36
-rw-r--r--arch/sh/include/asm/ptrace.h2
-rw-r--r--arch/sh/include/asm/scatterlist.h11
-rw-r--r--arch/sh/include/asm/topology.h7
-rw-r--r--arch/sh/include/asm/unistd_32.h4
-rw-r--r--arch/sh/include/asm/unistd_64.h4
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7722.c1
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7723.c1
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c14
-rw-r--r--arch/sh/kernel/cpu/sh5/entry.S5
-rw-r--r--arch/sh/kernel/head_32.S3
-rw-r--r--arch/sh/kernel/head_64.S5
-rw-r--r--arch/sh/kernel/sys_sh.c9
-rw-r--r--arch/sh/kernel/syscalls_32.S2
-rw-r--r--arch/sh/kernel/syscalls_64.S2
-rw-r--r--arch/sh/kernel/time_32.c2
-rw-r--r--arch/sh/kernel/timers/timer-tmu.c2
-rw-r--r--arch/sh/kernel/vmlinux_32.lds.S2
-rw-r--r--arch/sh/kernel/vmlinux_64.lds.S2
-rw-r--r--arch/sh/mm/consistent.c31
27 files changed, 200 insertions, 61 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 5e4babecf934..e7390dd0283d 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -14,6 +14,7 @@ config SUPERH
14 select HAVE_GENERIC_DMA_COHERENT 14 select HAVE_GENERIC_DMA_COHERENT
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 help 18 help
18 The SuperH is a RISC processor targeted for use in embedded systems 19 The SuperH is a RISC processor targeted for use in embedded systems
19 and consumer electronics; it was also used in the Sega Dreamcast 20 and consumer electronics; it was also used in the Sega Dreamcast
@@ -21,7 +22,7 @@ config SUPERH
21 <http://www.linux-sh.org/>. 22 <http://www.linux-sh.org/>.
22 23
23config SUPERH32 24config SUPERH32
24 def_bool !SUPERH64 25 def_bool ARCH = "sh"
25 select HAVE_KPROBES 26 select HAVE_KPROBES
26 select HAVE_KRETPROBES 27 select HAVE_KRETPROBES
27 select HAVE_FUNCTION_TRACER 28 select HAVE_FUNCTION_TRACER
@@ -31,7 +32,7 @@ config SUPERH32
31 select ARCH_HIBERNATION_POSSIBLE if MMU 32 select ARCH_HIBERNATION_POSSIBLE if MMU
32 33
33config SUPERH64 34config SUPERH64
34 def_bool y if CPU_SH5 35 def_bool ARCH = "sh64"
35 36
36config ARCH_DEFCONFIG 37config ARCH_DEFCONFIG
37 string 38 string
@@ -187,6 +188,8 @@ config ARCH_SHMOBILE
187 bool 188 bool
188 select ARCH_SUSPEND_POSSIBLE 189 select ARCH_SUSPEND_POSSIBLE
189 190
191if SUPERH32
192
190choice 193choice
191 prompt "Processor sub-type selection" 194 prompt "Processor sub-type selection"
192 195
@@ -408,6 +411,15 @@ config CPU_SUBTYPE_SH7366
408 select SYS_SUPPORTS_NUMA 411 select SYS_SUPPORTS_NUMA
409 select SYS_SUPPORTS_CMT 412 select SYS_SUPPORTS_CMT
410 413
414endchoice
415
416endif
417
418if SUPERH64
419
420choice
421 prompt "Processor sub-type selection"
422
411# SH-5 Processor Support 423# SH-5 Processor Support
412 424
413config CPU_SUBTYPE_SH5_101 425config CPU_SUBTYPE_SH5_101
@@ -420,6 +432,8 @@ config CPU_SUBTYPE_SH5_103
420 432
421endchoice 433endchoice
422 434
435endif
436
423source "arch/sh/mm/Kconfig" 437source "arch/sh/mm/Kconfig"
424 438
425source "arch/sh/Kconfig.cpu" 439source "arch/sh/Kconfig.cpu"
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c
index 912458f666eb..39e46919df14 100644
--- a/arch/sh/boards/board-ap325rxa.c
+++ b/arch/sh/boards/board-ap325rxa.c
@@ -349,6 +349,7 @@ static int ov7725_power(struct device *dev, int mode)
349static struct ov772x_camera_info ov7725_info = { 349static struct ov772x_camera_info ov7725_info = {
350 .buswidth = SOCAM_DATAWIDTH_8, 350 .buswidth = SOCAM_DATAWIDTH_8,
351 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, 351 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP,
352 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
352 .link = { 353 .link = {
353 .power = ov7725_power, 354 .power = ov7725_power,
354 }, 355 },
diff --git a/arch/sh/boards/board-urquell.c b/arch/sh/boards/board-urquell.c
index 8367d1d789c3..beb88c4da2c1 100644
--- a/arch/sh/boards/board-urquell.c
+++ b/arch/sh/boards/board-urquell.c
@@ -2,6 +2,8 @@
2 * Renesas Technology Corp. SH7786 Urquell Support. 2 * Renesas Technology Corp. SH7786 Urquell Support.
3 * 3 *
4 * Copyright (C) 2008 Kuninori Morimoto <morimoto.kuninori@renesas.com> 4 * Copyright (C) 2008 Kuninori Morimoto <morimoto.kuninori@renesas.com>
5 *
6 * Based on board-sh7785lcr.c
5 * Copyright (C) 2008 Yoshihiro Shimoda 7 * Copyright (C) 2008 Yoshihiro Shimoda
6 * 8 *
7 * This file is subject to the terms and conditions of the GNU General Public 9 * This file is subject to the terms and conditions of the GNU General Public
@@ -21,6 +23,32 @@
21#include <asm/heartbeat.h> 23#include <asm/heartbeat.h>
22#include <asm/sizes.h> 24#include <asm/sizes.h>
23 25
26/*
27 * bit 1234 5678
28 *----------------------------
29 * SW1 0101 0010 -> Pck 33MHz version
30 * (1101 0010) Pck 66MHz version
31 * SW2 0x1x xxxx -> little endian
32 * 29bit mode
33 * SW47 0001 1000 -> CS0 : on-board flash
34 * CS1 : SRAM, registers, LAN, PCMCIA
35 * 38400 bps for SCIF1
36 *
37 * Address
38 * 0x00000000 - 0x04000000 (CS0) Nor Flash
39 * 0x04000000 - 0x04200000 (CS1) SRAM
40 * 0x05000000 - 0x05800000 (CS1) on board register
41 * 0x05800000 - 0x06000000 (CS1) LAN91C111
42 * 0x06000000 - 0x06400000 (CS1) PCMCIA
43 * 0x08000000 - 0x10000000 (CS2-CS3) DDR3
44 * 0x10000000 - 0x14000000 (CS4) PCIe
45 * 0x14000000 - 0x14800000 (CS5) Core0 LRAM/URAM
46 * 0x14800000 - 0x15000000 (CS5) Core1 LRAM/URAM
47 * 0x18000000 - 0x1C000000 (CS6) ATA/NAND-Flash
48 * 0x1C000000 - (CS7) SH7786 Control register
49 */
50
51/* HeartBeat */
24static struct resource heartbeat_resources[] = { 52static struct resource heartbeat_resources[] = {
25 [0] = { 53 [0] = {
26 .start = BOARDREG(SLEDR), 54 .start = BOARDREG(SLEDR),
@@ -43,6 +71,7 @@ static struct platform_device heartbeat_device = {
43 .resource = heartbeat_resources, 71 .resource = heartbeat_resources,
44}; 72};
45 73
74/* LAN91C111 */
46static struct smc91x_platdata smc91x_info = { 75static struct smc91x_platdata smc91x_info = {
47 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, 76 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
48}; 77};
@@ -69,6 +98,7 @@ static struct platform_device smc91x_eth_device = {
69 }, 98 },
70}; 99};
71 100
101/* Nor Flash */
72static struct mtd_partition nor_flash_partitions[] = { 102static struct mtd_partition nor_flash_partitions[] = {
73 { 103 {
74 .name = "loader", 104 .name = "loader",
diff --git a/arch/sh/configs/sh7785lcr_defconfig b/arch/sh/configs/sh7785lcr_defconfig
index 8a42bbef1f50..e4fac2efc055 100644
--- a/arch/sh/configs/sh7785lcr_defconfig
+++ b/arch/sh/configs/sh7785lcr_defconfig
@@ -1,10 +1,11 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29 3# Linux kernel version: 2.6.30-rc2
4# Thu Apr 2 19:15:58 2009 4# Wed Apr 22 19:17:56 2009
5# 5#
6CONFIG_SUPERH=y 6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y 7CONFIG_SUPERH32=y
8# CONFIG_SUPERH64 is not set
8CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig" 9CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 10CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_BUG=y 11CONFIG_GENERIC_BUG=y
@@ -79,6 +80,7 @@ CONFIG_SYSCTL_SYSCALL=y
79CONFIG_KALLSYMS=y 80CONFIG_KALLSYMS=y
80# CONFIG_KALLSYMS_ALL is not set 81# CONFIG_KALLSYMS_ALL is not set
81# CONFIG_KALLSYMS_EXTRA_PASS is not set 82# CONFIG_KALLSYMS_EXTRA_PASS is not set
83# CONFIG_STRIP_ASM_SYMS is not set
82CONFIG_HOTPLUG=y 84CONFIG_HOTPLUG=y
83CONFIG_PRINTK=y 85CONFIG_PRINTK=y
84CONFIG_BUG=y 86CONFIG_BUG=y
@@ -98,6 +100,7 @@ CONFIG_SLAB=y
98# CONFIG_SLUB is not set 100# CONFIG_SLUB is not set
99# CONFIG_SLOB is not set 101# CONFIG_SLOB is not set
100CONFIG_PROFILING=y 102CONFIG_PROFILING=y
103# CONFIG_MARKERS is not set
101# CONFIG_OPROFILE is not set 104# CONFIG_OPROFILE is not set
102CONFIG_HAVE_OPROFILE=y 105CONFIG_HAVE_OPROFILE=y
103# CONFIG_KPROBES is not set 106# CONFIG_KPROBES is not set
@@ -106,6 +109,8 @@ CONFIG_HAVE_KPROBES=y
106CONFIG_HAVE_KRETPROBES=y 109CONFIG_HAVE_KRETPROBES=y
107CONFIG_HAVE_ARCH_TRACEHOOK=y 110CONFIG_HAVE_ARCH_TRACEHOOK=y
108CONFIG_HAVE_CLK=y 111CONFIG_HAVE_CLK=y
112CONFIG_HAVE_DMA_API_DEBUG=y
113# CONFIG_SLOW_WORK is not set
109CONFIG_HAVE_GENERIC_DMA_COHERENT=y 114CONFIG_HAVE_GENERIC_DMA_COHERENT=y
110CONFIG_SLABINFO=y 115CONFIG_SLABINFO=y
111CONFIG_RT_MUTEXES=y 116CONFIG_RT_MUTEXES=y
@@ -118,7 +123,6 @@ CONFIG_MODULE_UNLOAD=y
118# CONFIG_MODULE_SRCVERSION_ALL is not set 123# CONFIG_MODULE_SRCVERSION_ALL is not set
119CONFIG_BLOCK=y 124CONFIG_BLOCK=y
120# CONFIG_LBD is not set 125# CONFIG_LBD is not set
121# CONFIG_BLK_DEV_IO_TRACE is not set
122# CONFIG_BLK_DEV_BSG is not set 126# CONFIG_BLK_DEV_BSG is not set
123# CONFIG_BLK_DEV_INTEGRITY is not set 127# CONFIG_BLK_DEV_INTEGRITY is not set
124 128
@@ -166,6 +170,7 @@ CONFIG_CPU_SHX2=y
166# CONFIG_CPU_SUBTYPE_SH7760 is not set 170# CONFIG_CPU_SUBTYPE_SH7760 is not set
167# CONFIG_CPU_SUBTYPE_SH4_202 is not set 171# CONFIG_CPU_SUBTYPE_SH4_202 is not set
168# CONFIG_CPU_SUBTYPE_SH7723 is not set 172# CONFIG_CPU_SUBTYPE_SH7723 is not set
173# CONFIG_CPU_SUBTYPE_SH7724 is not set
169# CONFIG_CPU_SUBTYPE_SH7763 is not set 174# CONFIG_CPU_SUBTYPE_SH7763 is not set
170# CONFIG_CPU_SUBTYPE_SH7770 is not set 175# CONFIG_CPU_SUBTYPE_SH7770 is not set
171# CONFIG_CPU_SUBTYPE_SH7780 is not set 176# CONFIG_CPU_SUBTYPE_SH7780 is not set
@@ -175,8 +180,6 @@ CONFIG_CPU_SUBTYPE_SH7785=y
175# CONFIG_CPU_SUBTYPE_SH7343 is not set 180# CONFIG_CPU_SUBTYPE_SH7343 is not set
176# CONFIG_CPU_SUBTYPE_SH7722 is not set 181# CONFIG_CPU_SUBTYPE_SH7722 is not set
177# CONFIG_CPU_SUBTYPE_SH7366 is not set 182# CONFIG_CPU_SUBTYPE_SH7366 is not set
178# CONFIG_CPU_SUBTYPE_SH5_101 is not set
179# CONFIG_CPU_SUBTYPE_SH5_103 is not set
180 183
181# 184#
182# Memory management options 185# Memory management options
@@ -186,38 +189,31 @@ CONFIG_MMU=y
186CONFIG_PAGE_OFFSET=0x80000000 189CONFIG_PAGE_OFFSET=0x80000000
187CONFIG_MEMORY_START=0x08000000 190CONFIG_MEMORY_START=0x08000000
188CONFIG_MEMORY_SIZE=0x08000000 191CONFIG_MEMORY_SIZE=0x08000000
189# CONFIG_29BIT is not set 192CONFIG_29BIT=y
190CONFIG_32BIT=y 193# CONFIG_PMB_ENABLE is not set
191CONFIG_PMB_ENABLE=y
192# CONFIG_PMB is not set
193CONFIG_PMB_FIXED=y
194# CONFIG_X2TLB is not set 194# CONFIG_X2TLB is not set
195CONFIG_VSYSCALL=y 195CONFIG_VSYSCALL=y
196# CONFIG_NUMA is not set 196# CONFIG_NUMA is not set
197CONFIG_ARCH_FLATMEM_ENABLE=y 197CONFIG_ARCH_FLATMEM_ENABLE=y
198CONFIG_ARCH_SPARSEMEM_ENABLE=y 198CONFIG_ARCH_SPARSEMEM_ENABLE=y
199CONFIG_ARCH_SPARSEMEM_DEFAULT=y 199CONFIG_ARCH_SPARSEMEM_DEFAULT=y
200CONFIG_MAX_ACTIVE_REGIONS=2 200CONFIG_MAX_ACTIVE_REGIONS=1
201CONFIG_ARCH_POPULATES_NODE_MAP=y 201CONFIG_ARCH_POPULATES_NODE_MAP=y
202CONFIG_ARCH_SELECT_MEMORY_MODEL=y 202CONFIG_ARCH_SELECT_MEMORY_MODEL=y
203CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
204CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
205CONFIG_PAGE_SIZE_4KB=y 203CONFIG_PAGE_SIZE_4KB=y
206# CONFIG_PAGE_SIZE_8KB is not set 204# CONFIG_PAGE_SIZE_8KB is not set
207# CONFIG_PAGE_SIZE_16KB is not set 205# CONFIG_PAGE_SIZE_16KB is not set
208# CONFIG_PAGE_SIZE_64KB is not set 206# CONFIG_PAGE_SIZE_64KB is not set
209CONFIG_ENTRY_OFFSET=0x00001000 207CONFIG_ENTRY_OFFSET=0x00001000
210CONFIG_SELECT_MEMORY_MODEL=y 208CONFIG_SELECT_MEMORY_MODEL=y
211# CONFIG_FLATMEM_MANUAL is not set 209CONFIG_FLATMEM_MANUAL=y
212# CONFIG_DISCONTIGMEM_MANUAL is not set 210# CONFIG_DISCONTIGMEM_MANUAL is not set
213CONFIG_SPARSEMEM_MANUAL=y 211# CONFIG_SPARSEMEM_MANUAL is not set
214CONFIG_SPARSEMEM=y 212CONFIG_FLATMEM=y
215CONFIG_HAVE_MEMORY_PRESENT=y 213CONFIG_FLAT_NODE_MEM_MAP=y
216CONFIG_SPARSEMEM_STATIC=y 214CONFIG_SPARSEMEM_STATIC=y
217# CONFIG_MEMORY_HOTPLUG is not set
218CONFIG_PAGEFLAGS_EXTENDED=y 215CONFIG_PAGEFLAGS_EXTENDED=y
219CONFIG_SPLIT_PTLOCK_CPUS=4 216CONFIG_SPLIT_PTLOCK_CPUS=4
220CONFIG_MIGRATION=y
221# CONFIG_PHYS_ADDR_T_64BIT is not set 217# CONFIG_PHYS_ADDR_T_64BIT is not set
222CONFIG_ZONE_DMA_FLAG=0 218CONFIG_ZONE_DMA_FLAG=0
223CONFIG_NR_QUICK=2 219CONFIG_NR_QUICK=2
@@ -249,6 +245,7 @@ CONFIG_CPU_HAS_FPU=y
249# 245#
250# CONFIG_SH_HIGHLANDER is not set 246# CONFIG_SH_HIGHLANDER is not set
251CONFIG_SH_SH7785LCR=y 247CONFIG_SH_SH7785LCR=y
248CONFIG_SH_SH7785LCR_29BIT_PHYSMAPS=y
252 249
253# 250#
254# Timer and clock configuration 251# Timer and clock configuration
@@ -672,6 +669,7 @@ CONFIG_NETDEV_1000=y
672# CONFIG_E1000E is not set 669# CONFIG_E1000E is not set
673# CONFIG_IP1000 is not set 670# CONFIG_IP1000 is not set
674# CONFIG_IGB is not set 671# CONFIG_IGB is not set
672# CONFIG_IGBVF is not set
675# CONFIG_NS83820 is not set 673# CONFIG_NS83820 is not set
676# CONFIG_HAMACHI is not set 674# CONFIG_HAMACHI is not set
677# CONFIG_YELLOWFIN is not set 675# CONFIG_YELLOWFIN is not set
@@ -1009,15 +1007,17 @@ CONFIG_USB_HID=y
1009# 1007#
1010# Special HID drivers 1008# Special HID drivers
1011# 1009#
1012CONFIG_HID_COMPAT=y
1013CONFIG_HID_A4TECH=y 1010CONFIG_HID_A4TECH=y
1014CONFIG_HID_APPLE=y 1011CONFIG_HID_APPLE=y
1015CONFIG_HID_BELKIN=y 1012CONFIG_HID_BELKIN=y
1016CONFIG_HID_CHERRY=y 1013CONFIG_HID_CHERRY=y
1017CONFIG_HID_CHICONY=y 1014CONFIG_HID_CHICONY=y
1018CONFIG_HID_CYPRESS=y 1015CONFIG_HID_CYPRESS=y
1016# CONFIG_DRAGONRISE_FF is not set
1019CONFIG_HID_EZKEY=y 1017CONFIG_HID_EZKEY=y
1018# CONFIG_HID_KYE is not set
1020CONFIG_HID_GYRATION=y 1019CONFIG_HID_GYRATION=y
1020# CONFIG_HID_KENSINGTON is not set
1021CONFIG_HID_LOGITECH=y 1021CONFIG_HID_LOGITECH=y
1022# CONFIG_LOGITECH_FF is not set 1022# CONFIG_LOGITECH_FF is not set
1023# CONFIG_LOGIRUMBLEPAD2_FF is not set 1023# CONFIG_LOGIRUMBLEPAD2_FF is not set
@@ -1218,6 +1218,7 @@ CONFIG_EXT2_FS=y
1218# CONFIG_EXT2_FS_XATTR is not set 1218# CONFIG_EXT2_FS_XATTR is not set
1219# CONFIG_EXT2_FS_XIP is not set 1219# CONFIG_EXT2_FS_XIP is not set
1220CONFIG_EXT3_FS=y 1220CONFIG_EXT3_FS=y
1221# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1221CONFIG_EXT3_FS_XATTR=y 1222CONFIG_EXT3_FS_XATTR=y
1222# CONFIG_EXT3_FS_POSIX_ACL is not set 1223# CONFIG_EXT3_FS_POSIX_ACL is not set
1223# CONFIG_EXT3_FS_SECURITY is not set 1224# CONFIG_EXT3_FS_SECURITY is not set
@@ -1240,6 +1241,11 @@ CONFIG_INOTIFY_USER=y
1240# CONFIG_FUSE_FS is not set 1241# CONFIG_FUSE_FS is not set
1241 1242
1242# 1243#
1244# Caches
1245#
1246# CONFIG_FSCACHE is not set
1247
1248#
1243# CD-ROM/DVD Filesystems 1249# CD-ROM/DVD Filesystems
1244# 1250#
1245# CONFIG_ISO9660_FS is not set 1251# CONFIG_ISO9660_FS is not set
@@ -1289,6 +1295,7 @@ CONFIG_MINIX_FS=y
1289# CONFIG_ROMFS_FS is not set 1295# CONFIG_ROMFS_FS is not set
1290# CONFIG_SYSV_FS is not set 1296# CONFIG_SYSV_FS is not set
1291# CONFIG_UFS_FS is not set 1297# CONFIG_UFS_FS is not set
1298# CONFIG_NILFS2_FS is not set
1292CONFIG_NETWORK_FILESYSTEMS=y 1299CONFIG_NETWORK_FILESYSTEMS=y
1293CONFIG_NFS_FS=y 1300CONFIG_NFS_FS=y
1294CONFIG_NFS_V3=y 1301CONFIG_NFS_V3=y
@@ -1377,6 +1384,9 @@ CONFIG_DEBUG_KERNEL=y
1377CONFIG_DETECT_SOFTLOCKUP=y 1384CONFIG_DETECT_SOFTLOCKUP=y
1378# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1385# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1379CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1386CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1387CONFIG_DETECT_HUNG_TASK=y
1388# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1389CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1380CONFIG_SCHED_DEBUG=y 1390CONFIG_SCHED_DEBUG=y
1381# CONFIG_SCHEDSTATS is not set 1391# CONFIG_SCHEDSTATS is not set
1382# CONFIG_TIMER_STATS is not set 1392# CONFIG_TIMER_STATS is not set
@@ -1413,6 +1423,7 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
1413CONFIG_HAVE_FUNCTION_TRACER=y 1423CONFIG_HAVE_FUNCTION_TRACER=y
1414CONFIG_HAVE_DYNAMIC_FTRACE=y 1424CONFIG_HAVE_DYNAMIC_FTRACE=y
1415CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1425CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1426CONFIG_TRACING_SUPPORT=y
1416 1427
1417# 1428#
1418# Tracers 1429# Tracers
@@ -1422,9 +1433,14 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1422# CONFIG_PREEMPT_TRACER is not set 1433# CONFIG_PREEMPT_TRACER is not set
1423# CONFIG_SCHED_TRACER is not set 1434# CONFIG_SCHED_TRACER is not set
1424# CONFIG_CONTEXT_SWITCH_TRACER is not set 1435# CONFIG_CONTEXT_SWITCH_TRACER is not set
1436# CONFIG_EVENT_TRACER is not set
1425# CONFIG_BOOT_TRACER is not set 1437# CONFIG_BOOT_TRACER is not set
1426# CONFIG_TRACE_BRANCH_PROFILING is not set 1438# CONFIG_TRACE_BRANCH_PROFILING is not set
1427# CONFIG_STACK_TRACER is not set 1439# CONFIG_STACK_TRACER is not set
1440# CONFIG_KMEMTRACE is not set
1441# CONFIG_WORKQUEUE_TRACER is not set
1442# CONFIG_BLK_DEV_IO_TRACE is not set
1443# CONFIG_DMA_API_DEBUG is not set
1428# CONFIG_SAMPLES is not set 1444# CONFIG_SAMPLES is not set
1429CONFIG_HAVE_ARCH_KGDB=y 1445CONFIG_HAVE_ARCH_KGDB=y
1430# CONFIG_KGDB is not set 1446# CONFIG_KGDB is not set
@@ -1542,6 +1558,7 @@ CONFIG_CRYPTO_DES=y
1542# 1558#
1543# CONFIG_CRYPTO_ANSI_CPRNG is not set 1559# CONFIG_CRYPTO_ANSI_CPRNG is not set
1544# CONFIG_CRYPTO_HW is not set 1560# CONFIG_CRYPTO_HW is not set
1561# CONFIG_BINARY_PRINTF is not set
1545 1562
1546# 1563#
1547# Library routines 1564# Library routines
diff --git a/arch/sh/drivers/pci/ops-sh7785lcr.c b/arch/sh/drivers/pci/ops-sh7785lcr.c
index e8b7446a7c2b..fb0869f0bef8 100644
--- a/arch/sh/drivers/pci/ops-sh7785lcr.c
+++ b/arch/sh/drivers/pci/ops-sh7785lcr.c
@@ -48,8 +48,13 @@ EXPORT_SYMBOL(board_pci_channels);
48 48
49static struct sh4_pci_address_map sh7785_pci_map = { 49static struct sh4_pci_address_map sh7785_pci_map = {
50 .window0 = { 50 .window0 = {
51#if defined(CONFIG_32BIT)
52 .base = SH7780_32BIT_DDR_BASE_ADDR,
53 .size = 0x40000000,
54#else
51 .base = SH7780_CS0_BASE_ADDR, 55 .base = SH7780_CS0_BASE_ADDR,
52 .size = 0x20000000, 56 .size = 0x20000000,
57#endif
53 }, 58 },
54 59
55 .flags = SH4_PCIC_NO_RESET, 60 .flags = SH4_PCIC_NO_RESET,
diff --git a/arch/sh/drivers/pci/pci-sh7780.h b/arch/sh/drivers/pci/pci-sh7780.h
index 97b2c98f05c4..93adc7119b79 100644
--- a/arch/sh/drivers/pci/pci-sh7780.h
+++ b/arch/sh/drivers/pci/pci-sh7780.h
@@ -104,6 +104,8 @@
104#define SH7780_CS5_BASE_ADDR (SH7780_CS4_BASE_ADDR + SH7780_MEM_REGION_SIZE) 104#define SH7780_CS5_BASE_ADDR (SH7780_CS4_BASE_ADDR + SH7780_MEM_REGION_SIZE)
105#define SH7780_CS6_BASE_ADDR (SH7780_CS5_BASE_ADDR + SH7780_MEM_REGION_SIZE) 105#define SH7780_CS6_BASE_ADDR (SH7780_CS5_BASE_ADDR + SH7780_MEM_REGION_SIZE)
106 106
107#define SH7780_32BIT_DDR_BASE_ADDR 0x40000000
108
107struct sh4_pci_address_map; 109struct sh4_pci_address_map;
108 110
109/* arch/sh/drivers/pci/pci-sh7780.c */ 111/* arch/sh/drivers/pci/pci-sh7780.c */
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index e36c7b870861..0d6ac7a1db49 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -19,6 +19,7 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/pci.h> 20#include <linux/pci.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/dma-debug.h>
22#include <asm/io.h> 23#include <asm/io.h>
23 24
24static int __init pcibios_init(void) 25static int __init pcibios_init(void)
@@ -43,6 +44,8 @@ static int __init pcibios_init(void)
43 44
44 pci_fixup_irqs(pci_common_swizzle, pcibios_map_platform_irq); 45 pci_fixup_irqs(pci_common_swizzle, pcibios_map_platform_irq);
45 46
47 dma_debug_add_bus(&pci_bus_type);
48
46 return 0; 49 return 0;
47} 50}
48subsys_initcall(pcibios_init); 51subsys_initcall(pcibios_init);
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h
index 627315ecdb52..ea9d4f41c9d2 100644
--- a/arch/sh/include/asm/dma-mapping.h
+++ b/arch/sh/include/asm/dma-mapping.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <linux/scatterlist.h> 5#include <linux/scatterlist.h>
6#include <linux/dma-debug.h>
6#include <asm/cacheflush.h> 7#include <asm/cacheflush.h>
7#include <asm/io.h> 8#include <asm/io.h>
8#include <asm-generic/dma-coherent.h> 9#include <asm-generic/dma-coherent.h>
@@ -38,16 +39,26 @@ static inline dma_addr_t dma_map_single(struct device *dev,
38 void *ptr, size_t size, 39 void *ptr, size_t size,
39 enum dma_data_direction dir) 40 enum dma_data_direction dir)
40{ 41{
42 dma_addr_t addr = virt_to_phys(ptr);
43
41#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT) 44#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
42 if (dev->bus == &pci_bus_type) 45 if (dev->bus == &pci_bus_type)
43 return virt_to_phys(ptr); 46 return addr;
44#endif 47#endif
45 dma_cache_sync(dev, ptr, size, dir); 48 dma_cache_sync(dev, ptr, size, dir);
46 49
47 return virt_to_phys(ptr); 50 debug_dma_map_page(dev, virt_to_page(ptr),
51 (unsigned long)ptr & ~PAGE_MASK, size,
52 dir, addr, true);
53
54 return addr;
48} 55}
49 56
50#define dma_unmap_single(dev, addr, size, dir) do { } while (0) 57static inline void dma_unmap_single(struct device *dev, dma_addr_t addr,
58 size_t size, enum dma_data_direction dir)
59{
60 debug_dma_unmap_page(dev, addr, size, dir, true);
61}
51 62
52static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, 63static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
53 int nents, enum dma_data_direction dir) 64 int nents, enum dma_data_direction dir)
@@ -59,12 +70,19 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
59 dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); 70 dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
60#endif 71#endif
61 sg[i].dma_address = sg_phys(&sg[i]); 72 sg[i].dma_address = sg_phys(&sg[i]);
73 sg[i].dma_length = sg[i].length;
62 } 74 }
63 75
76 debug_dma_map_sg(dev, sg, nents, i, dir);
77
64 return nents; 78 return nents;
65} 79}
66 80
67#define dma_unmap_sg(dev, sg, nents, dir) do { } while (0) 81static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
82 int nents, enum dma_data_direction dir)
83{
84 debug_dma_unmap_sg(dev, sg, nents, dir);
85}
68 86
69static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, 87static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
70 unsigned long offset, size_t size, 88 unsigned long offset, size_t size,
@@ -111,6 +129,7 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
111 dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); 129 dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
112#endif 130#endif
113 sg[i].dma_address = sg_phys(&sg[i]); 131 sg[i].dma_address = sg_phys(&sg[i]);
132 sg[i].dma_length = sg[i].length;
114 } 133 }
115} 134}
116 135
@@ -119,6 +138,7 @@ static inline void dma_sync_single_for_cpu(struct device *dev,
119 enum dma_data_direction dir) 138 enum dma_data_direction dir)
120{ 139{
121 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);
122} 142}
123 143
124static inline void dma_sync_single_for_device(struct device *dev, 144static inline void dma_sync_single_for_device(struct device *dev,
@@ -127,6 +147,7 @@ static inline void dma_sync_single_for_device(struct device *dev,
127 enum dma_data_direction dir) 147 enum dma_data_direction dir)
128{ 148{
129 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);
130} 151}
131 152
132static inline void dma_sync_single_range_for_cpu(struct device *dev, 153static inline void dma_sync_single_range_for_cpu(struct device *dev,
@@ -136,6 +157,8 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
136 enum dma_data_direction direction) 157 enum dma_data_direction direction)
137{ 158{
138 dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction); 159 dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction);
160 debug_dma_sync_single_range_for_cpu(dev, dma_handle,
161 offset, size, direction);
139} 162}
140 163
141static inline void dma_sync_single_range_for_device(struct device *dev, 164static inline void dma_sync_single_range_for_device(struct device *dev,
@@ -145,6 +168,8 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
145 enum dma_data_direction direction) 168 enum dma_data_direction direction)
146{ 169{
147 dma_sync_single_for_device(dev, dma_handle+offset, size, direction); 170 dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
171 debug_dma_sync_single_range_for_device(dev, dma_handle,
172 offset, size, direction);
148} 173}
149 174
150 175
@@ -153,6 +178,7 @@ static inline void dma_sync_sg_for_cpu(struct device *dev,
153 enum dma_data_direction dir) 178 enum dma_data_direction dir)
154{ 179{
155 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);
156} 182}
157 183
158static inline void dma_sync_sg_for_device(struct device *dev, 184static inline void dma_sync_sg_for_device(struct device *dev,
@@ -160,9 +186,9 @@ static inline void dma_sync_sg_for_device(struct device *dev,
160 enum dma_data_direction dir) 186 enum dma_data_direction dir)
161{ 187{
162 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);
163} 190}
164 191
165
166static inline int dma_get_cache_alignment(void) 192static inline int dma_get_cache_alignment(void)
167{ 193{
168 /* 194 /*
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h
index d3f6caa936b0..68e20ff9aa9b 100644
--- a/arch/sh/include/asm/ptrace.h
+++ b/arch/sh/include/asm/ptrace.h
@@ -9,7 +9,7 @@
9struct pt_regs { 9struct pt_regs {
10 unsigned long long pc; 10 unsigned long long pc;
11 unsigned long long sr; 11 unsigned long long sr;
12 unsigned long long syscall_nr; 12 long long syscall_nr;
13 unsigned long long regs[63]; 13 unsigned long long regs[63];
14 unsigned long long tregs[8]; 14 unsigned long long tregs[8];
15 unsigned long long pad[2]; 15 unsigned long long pad[2];
diff --git a/arch/sh/include/asm/scatterlist.h b/arch/sh/include/asm/scatterlist.h
index 2084d0373693..c693d268a413 100644
--- a/arch/sh/include/asm/scatterlist.h
+++ b/arch/sh/include/asm/scatterlist.h
@@ -5,12 +5,13 @@
5 5
6struct scatterlist { 6struct scatterlist {
7#ifdef CONFIG_DEBUG_SG 7#ifdef CONFIG_DEBUG_SG
8 unsigned long sg_magic; 8 unsigned long sg_magic;
9#endif 9#endif
10 unsigned long page_link; 10 unsigned long page_link;
11 unsigned int offset;/* for highmem, page offset */ 11 unsigned int offset; /* for highmem, page offset */
12 dma_addr_t dma_address; 12 unsigned int length;
13 unsigned int length; 13 dma_addr_t dma_address;
14 unsigned int dma_length;
14}; 15};
15 16
16#define ISA_DMA_THRESHOLD PHYS_ADDR_MASK 17#define ISA_DMA_THRESHOLD PHYS_ADDR_MASK
diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h
index a3f239545897..8489a0905a87 100644
--- a/arch/sh/include/asm/topology.h
+++ b/arch/sh/include/asm/topology.h
@@ -37,8 +37,11 @@
37#define pcibus_to_node(bus) ((void)(bus), -1) 37#define pcibus_to_node(bus) ((void)(bus), -1)
38#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \ 38#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
39 CPU_MASK_ALL : \ 39 CPU_MASK_ALL : \
40 node_to_cpumask(pcibus_to_node(bus)) \ 40 node_to_cpumask(pcibus_to_node(bus)))
41 ) 41#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
42 CPU_MASK_ALL_PTR : \
43 cpumask_of_node(pcibus_to_node(bus)))
44
42#endif 45#endif
43 46
44#include <asm-generic/topology.h> 47#include <asm-generic/topology.h>
diff --git a/arch/sh/include/asm/unistd_32.h b/arch/sh/include/asm/unistd_32.h
index d52c000cf924..2efb819e2db3 100644
--- a/arch/sh/include/asm/unistd_32.h
+++ b/arch/sh/include/asm/unistd_32.h
@@ -341,8 +341,10 @@
341#define __NR_dup3 330 341#define __NR_dup3 330
342#define __NR_pipe2 331 342#define __NR_pipe2 331
343#define __NR_inotify_init1 332 343#define __NR_inotify_init1 332
344#define __NR_preadv 333
345#define __NR_pwritev 334
344 346
345#define NR_syscalls 333 347#define NR_syscalls 335
346 348
347#ifdef __KERNEL__ 349#ifdef __KERNEL__
348 350
diff --git a/arch/sh/include/asm/unistd_64.h b/arch/sh/include/asm/unistd_64.h
index 7c54e91753c1..6eb9d2934c0f 100644
--- a/arch/sh/include/asm/unistd_64.h
+++ b/arch/sh/include/asm/unistd_64.h
@@ -381,10 +381,12 @@
381#define __NR_dup3 358 381#define __NR_dup3 358
382#define __NR_pipe2 359 382#define __NR_pipe2 359
383#define __NR_inotify_init1 360 383#define __NR_inotify_init1 360
384#define __NR_preadv 361
385#define __NR_pwritev 362
384 386
385#ifdef __KERNEL__ 387#ifdef __KERNEL__
386 388
387#define NR_syscalls 361 389#define NR_syscalls 363
388 390
389#define __ARCH_WANT_IPC_PARSE_VERSION 391#define __ARCH_WANT_IPC_PARSE_VERSION
390#define __ARCH_WANT_OLD_READDIR 392#define __ARCH_WANT_OLD_READDIR
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index 0e5d204bc792..406747f07dc0 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -256,7 +256,6 @@ static int __init sh7722_devices_setup(void)
256{ 256{
257 clk_always_enable("uram0"); /* URAM */ 257 clk_always_enable("uram0"); /* URAM */
258 clk_always_enable("xymem0"); /* XYMEM */ 258 clk_always_enable("xymem0"); /* XYMEM */
259 clk_always_enable("rtc0"); /* RTC */
260 clk_always_enable("veu0"); /* VEU */ 259 clk_always_enable("veu0"); /* VEU */
261 clk_always_enable("vpu0"); /* VPU */ 260 clk_always_enable("vpu0"); /* VPU */
262 clk_always_enable("jpu0"); /* JPU */ 261 clk_always_enable("jpu0"); /* JPU */
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
index 5338dacbcfba..a800466b938c 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -267,7 +267,6 @@ static struct platform_device *sh7723_devices[] __initdata = {
267static int __init sh7723_devices_setup(void) 267static int __init sh7723_devices_setup(void)
268{ 268{
269 clk_always_enable("meram0"); /* MERAM */ 269 clk_always_enable("meram0"); /* MERAM */
270 clk_always_enable("rtc0"); /* RTC */
271 clk_always_enable("veu1"); /* VEU2H1 */ 270 clk_always_enable("veu1"); /* VEU2H1 */
272 clk_always_enable("veu0"); /* VEU2H0 */ 271 clk_always_enable("veu0"); /* VEU2H0 */
273 clk_always_enable("vpu0"); /* VPU */ 272 clk_always_enable("vpu0"); /* VPU */
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index 5a47e1cf442e..90e8cfff55fd 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -143,14 +143,14 @@ static void __init sh7786_usb_setup(void)
143 * Set the PHY and PLL enable bit 143 * Set the PHY and PLL enable bit
144 */ 144 */
145 __raw_writel(PHY_ENB | PLL_ENB, USBPCTL1); 145 __raw_writel(PHY_ENB | PLL_ENB, USBPCTL1);
146 while (i-- && 146 while (i--) {
147 ((__raw_readl(USBST) & ACT_PLL_STATUS) != ACT_PLL_STATUS)) 147 if (ACT_PLL_STATUS == (__raw_readl(USBST) & ACT_PLL_STATUS)) {
148 /* Set the PHY RST bit */
149 __raw_writel(PHY_ENB | PLL_ENB | PHY_RST, USBPCTL1);
150 printk(KERN_INFO "sh7786 usb setup done\n");
151 break;
152 }
148 cpu_relax(); 153 cpu_relax();
149
150 if (i) {
151 /* Set the PHY RST bit */
152 __raw_writel(PHY_ENB | PLL_ENB | PHY_RST, USBPCTL1);
153 printk(KERN_INFO "sh7786 usb setup done\n");
154 } 154 }
155} 155}
156 156
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index e640c63d5811..7e49cb812f8b 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -10,6 +10,7 @@
10 * for more details. 10 * for more details.
11 */ 11 */
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/init.h>
13#include <linux/sys.h> 14#include <linux/sys.h>
14#include <cpu/registers.h> 15#include <cpu/registers.h>
15#include <asm/processor.h> 16#include <asm/processor.h>
@@ -2058,10 +2059,10 @@ asm_uaccess_end:
2058 2059
2059 2060
2060/* 2061/*
2061 * --- .text.init Section 2062 * --- .init.text Section
2062 */ 2063 */
2063 2064
2064 .section .text.init, "ax" 2065 __INIT
2065 2066
2066/* 2067/*
2067 * void trap_init (void) 2068 * void trap_init (void)
diff --git a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S
index 788605ff7088..a78be74b8d3e 100644
--- a/arch/sh/kernel/head_32.S
+++ b/arch/sh/kernel/head_32.S
@@ -10,6 +10,7 @@
10 * 10 *
11 * Head.S contains the SH exception handlers and startup code. 11 * Head.S contains the SH exception handlers and startup code.
12 */ 12 */
13#include <linux/init.h>
13#include <linux/linkage.h> 14#include <linux/linkage.h>
14#include <asm/thread_info.h> 15#include <asm/thread_info.h>
15 16
@@ -40,7 +41,7 @@ ENTRY(empty_zero_page)
401: 411:
41 .skip PAGE_SIZE - empty_zero_page - 1b 42 .skip PAGE_SIZE - empty_zero_page - 1b
42 43
43 .section .text.head, "ax" 44 __HEAD
44 45
45/* 46/*
46 * Condition at the entry of _stext: 47 * Condition at the entry of _stext:
diff --git a/arch/sh/kernel/head_64.S b/arch/sh/kernel/head_64.S
index 7ccfb995a398..3ea765844c74 100644
--- a/arch/sh/kernel/head_64.S
+++ b/arch/sh/kernel/head_64.S
@@ -8,6 +8,9 @@
8 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details. 9 * for more details.
10 */ 10 */
11
12#include <linux/init.h>
13
11#include <asm/page.h> 14#include <asm/page.h>
12#include <asm/cache.h> 15#include <asm/cache.h>
13#include <asm/tlb.h> 16#include <asm/tlb.h>
@@ -110,7 +113,7 @@ empty_bad_pte_table:
110fpu_in_use: .quad 0 113fpu_in_use: .quad 0
111 114
112 115
113 .section .text.head, "ax" 116 __HEAD
114 .balign L1_CACHE_BYTES 117 .balign L1_CACHE_BYTES
115/* 118/*
116 * Condition at the entry of __stext: 119 * Condition at the entry of __stext:
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c
index 58dfc02c7af1..e3a7e36639ef 100644
--- a/arch/sh/kernel/sys_sh.c
+++ b/arch/sh/kernel/sys_sh.c
@@ -63,6 +63,15 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
63 unsigned long prot, unsigned long flags, 63 unsigned long prot, unsigned long flags,
64 unsigned long fd, unsigned long pgoff) 64 unsigned long fd, unsigned long pgoff)
65{ 65{
66 /*
67 * The shift for mmap2 is constant, regardless of PAGE_SIZE
68 * setting.
69 */
70 if (pgoff & ((1 << (PAGE_SHIFT - 12)) - 1))
71 return -EINVAL;
72
73 pgoff >>= PAGE_SHIFT - 12;
74
66 return do_mmap2(addr, len, prot, flags, fd, pgoff); 75 return do_mmap2(addr, len, prot, flags, fd, pgoff);
67} 76}
68 77
diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S
index e67c1733e1b9..05202edd8e21 100644
--- a/arch/sh/kernel/syscalls_32.S
+++ b/arch/sh/kernel/syscalls_32.S
@@ -349,3 +349,5 @@ ENTRY(sys_call_table)
349 .long sys_dup3 /* 330 */ 349 .long sys_dup3 /* 330 */
350 .long sys_pipe2 350 .long sys_pipe2
351 .long sys_inotify_init1 351 .long sys_inotify_init1
352 .long sys_preadv
353 .long sys_writev
diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S
index 557cb91f5caf..a083609f9284 100644
--- a/arch/sh/kernel/syscalls_64.S
+++ b/arch/sh/kernel/syscalls_64.S
@@ -387,3 +387,5 @@ sys_call_table:
387 .long sys_dup3 387 .long sys_dup3
388 .long sys_pipe2 388 .long sys_pipe2
389 .long sys_inotify_init1 /* 360 */ 389 .long sys_inotify_init1 /* 360 */
390 .long sys_preadv
391 .long sys_pwritev
diff --git a/arch/sh/kernel/time_32.c b/arch/sh/kernel/time_32.c
index c34e1e0f9b02..1700d2465f6c 100644
--- a/arch/sh/kernel/time_32.c
+++ b/arch/sh/kernel/time_32.c
@@ -208,7 +208,7 @@ unsigned long long sched_clock(void)
208 if (!clocksource_sh.rating) 208 if (!clocksource_sh.rating)
209 return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ); 209 return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
210 210
211 cycles = clocksource_sh.read(); 211 cycles = clocksource_sh.read(&clocksource_sh);
212 return cyc2ns(&clocksource_sh, cycles); 212 return cyc2ns(&clocksource_sh, cycles);
213} 213}
214#endif 214#endif
diff --git a/arch/sh/kernel/timers/timer-tmu.c b/arch/sh/kernel/timers/timer-tmu.c
index c5d3396f5960..fe8d8930ccb6 100644
--- a/arch/sh/kernel/timers/timer-tmu.c
+++ b/arch/sh/kernel/timers/timer-tmu.c
@@ -81,7 +81,7 @@ static int tmu_timer_stop(void)
81 */ 81 */
82static int tmus_are_scaled; 82static int tmus_are_scaled;
83 83
84static cycle_t tmu_timer_read(void) 84static cycle_t tmu_timer_read(struct clocksource *cs)
85{ 85{
86 return ((cycle_t)(~_tmu_read(TMU1)))<<tmus_are_scaled; 86 return ((cycle_t)(~_tmu_read(TMU1)))<<tmus_are_scaled;
87} 87}
diff --git a/arch/sh/kernel/vmlinux_32.lds.S b/arch/sh/kernel/vmlinux_32.lds.S
index d0b2a715cd14..dd9b2ee1312d 100644
--- a/arch/sh/kernel/vmlinux_32.lds.S
+++ b/arch/sh/kernel/vmlinux_32.lds.S
@@ -31,7 +31,7 @@ SECTIONS
31 } = 0 31 } = 0
32 32
33 .text : { 33 .text : {
34 *(.text.head) 34 HEAD_TEXT
35 TEXT_TEXT 35 TEXT_TEXT
36 SCHED_TEXT 36 SCHED_TEXT
37 LOCK_TEXT 37 LOCK_TEXT
diff --git a/arch/sh/kernel/vmlinux_64.lds.S b/arch/sh/kernel/vmlinux_64.lds.S
index 33fa46451406..69664460c688 100644
--- a/arch/sh/kernel/vmlinux_64.lds.S
+++ b/arch/sh/kernel/vmlinux_64.lds.S
@@ -42,7 +42,7 @@ SECTIONS
42 } = 0 42 } = 0
43 43
44 .text : C_PHYS(.text) { 44 .text : C_PHYS(.text) {
45 *(.text.head) 45 HEAD_TEXT
46 TEXT_TEXT 46 TEXT_TEXT
47 *(.text64) 47 *(.text64)
48 *(.text..SHmedia32) 48 *(.text..SHmedia32)
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index edcd5fbf9651..e098ec158ddb 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -10,11 +10,22 @@
10 * for more details. 10 * for more details.
11 */ 11 */
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/init.h>
13#include <linux/platform_device.h> 14#include <linux/platform_device.h>
14#include <linux/dma-mapping.h> 15#include <linux/dma-mapping.h>
16#include <linux/dma-debug.h>
17#include <linux/io.h>
15#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
16#include <asm/addrspace.h> 19#include <asm/addrspace.h>
17#include <asm/io.h> 20
21#define PREALLOC_DMA_DEBUG_ENTRIES 4096
22
23static int __init dma_init(void)
24{
25 dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
26 return 0;
27}
28fs_initcall(dma_init);
18 29
19void *dma_alloc_coherent(struct device *dev, size_t size, 30void *dma_alloc_coherent(struct device *dev, size_t size,
20 dma_addr_t *dma_handle, gfp_t gfp) 31 dma_addr_t *dma_handle, gfp_t gfp)
@@ -45,6 +56,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
45 split_page(pfn_to_page(virt_to_phys(ret) >> PAGE_SHIFT), order); 56 split_page(pfn_to_page(virt_to_phys(ret) >> PAGE_SHIFT), order);
46 57
47 *dma_handle = virt_to_phys(ret); 58 *dma_handle = virt_to_phys(ret);
59
60 debug_dma_alloc_coherent(dev, size, *dma_handle, ret_nocache);
61
48 return ret_nocache; 62 return ret_nocache;
49} 63}
50EXPORT_SYMBOL(dma_alloc_coherent); 64EXPORT_SYMBOL(dma_alloc_coherent);
@@ -56,12 +70,15 @@ void dma_free_coherent(struct device *dev, size_t size,
56 unsigned long pfn = dma_handle >> PAGE_SHIFT; 70 unsigned long pfn = dma_handle >> PAGE_SHIFT;
57 int k; 71 int k;
58 72
59 if (!dma_release_from_coherent(dev, order, vaddr)) { 73 WARN_ON(irqs_disabled()); /* for portability */
60 WARN_ON(irqs_disabled()); /* for portability */ 74
61 for (k = 0; k < (1 << order); k++) 75 if (dma_release_from_coherent(dev, order, vaddr))
62 __free_pages(pfn_to_page(pfn + k), 0); 76 return;
63 iounmap(vaddr); 77
64 } 78 debug_dma_free_coherent(dev, size, vaddr, dma_handle);
79 for (k = 0; k < (1 << order); k++)
80 __free_pages(pfn_to_page(pfn + k), 0);
81 iounmap(vaddr);
65} 82}
66EXPORT_SYMBOL(dma_free_coherent); 83EXPORT_SYMBOL(dma_free_coherent);
67 84