aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-11-18 03:35:56 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-11-18 03:35:56 -0500
commit0421860a5a75b59a76b7a864a172eb090e3d0785 (patch)
treedf22f28abfa4c8bb77d650b674a44e0aedc586be /arch/arm
parentcf655c36fad7b6488a56f18ab56f7d608ca6552b (diff)
parent89ba4d12fca24d373e1b10fce498d68157bafaf0 (diff)
Merge branch 'rmobile/ag5' into rmobile-latest
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig43
-rw-r--r--arch/arm/common/gic.c28
-rw-r--r--arch/arm/configs/ag5evm_defconfig83
-rw-r--r--arch/arm/include/asm/hardware/it8152.h2
-rw-r--r--arch/arm/kernel/hw_breakpoint.c3
-rw-r--r--arch/arm/kernel/perf_event.c2
-rw-r--r--arch/arm/kernel/stacktrace.c2
-rw-r--r--arch/arm/kernel/traps.c5
-rw-r--r--arch/arm/kernel/unwind.c2
-rw-r--r--arch/arm/mach-ep93xx/include/mach/dma.h111
-rw-r--r--arch/arm/mach-kirkwood/common.c7
-rw-r--r--arch/arm/mach-kirkwood/d2net_v2-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/lacie_v2-common.c14
-rw-r--r--arch/arm/mach-kirkwood/lacie_v2-common.h2
-rw-r--r--arch/arm/mach-kirkwood/mpp.c4
-rw-r--r--arch/arm/mach-kirkwood/netspace_v2-setup.c6
-rw-r--r--arch/arm/mach-kirkwood/netxbig_v2-setup.c4
-rw-r--r--arch/arm/mach-kirkwood/ts41x-setup.c14
-rw-r--r--arch/arm/mach-mmp/include/mach/cputype.h3
-rw-r--r--arch/arm/mach-mv78xx0/mpp.c4
-rw-r--r--arch/arm/mach-omap1/devices.c5
-rw-r--r--arch/arm/mach-omap1/include/mach/camera.h2
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c3
-rw-r--r--arch/arm/mach-orion5x/mpp.c4
-rw-r--r--arch/arm/mach-orion5x/ts78xx-setup.c2
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c2
-rw-r--r--arch/arm/mach-pxa/saar.c2
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig2
-rw-r--r--arch/arm/mach-shmobile/Kconfig24
-rw-r--r--arch/arm/mach-shmobile/Makefile2
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c159
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c4
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c101
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h4
-rw-r--r--arch/arm/mach-shmobile/include/mach/entry-macro-gic.S89
-rw-r--r--arch/arm/mach-shmobile/include/mach/entry-macro-intc.S39
-rw-r--r--arch/arm/mach-shmobile/include/mach/entry-macro.S30
-rw-r--r--arch/arm/mach-shmobile/include/mach/irqs.h3
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh73a0.h6
-rw-r--r--arch/arm/mach-shmobile/setup-sh73a0.c234
-rw-r--r--arch/arm/mach-vexpress/ct-ca9x4.c2
-rw-r--r--arch/arm/mm/Kconfig2
-rw-r--r--arch/arm/mm/dma-mapping.c2
-rw-r--r--arch/arm/plat-omap/devices.c4
-rw-r--r--arch/arm/plat-omap/dma.c2
-rw-r--r--arch/arm/plat-orion/include/plat/pcie.h3
-rw-r--r--arch/arm/plat-orion/pcie.c5
47 files changed, 947 insertions, 131 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a19a5266d5fc..81c71daf1a90 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -6,7 +6,7 @@ config ARM
6 select HAVE_MEMBLOCK 6 select HAVE_MEMBLOCK
7 select RTC_LIB 7 select RTC_LIB
8 select SYS_SUPPORTS_APM_EMULATION 8 select SYS_SUPPORTS_APM_EMULATION
9 select GENERIC_ATOMIC64 if (!CPU_32v6K) 9 select GENERIC_ATOMIC64 if (!CPU_32v6K || !AEABI)
10 select HAVE_OPROFILE if (HAVE_PERF_EVENTS) 10 select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
11 select HAVE_ARCH_KGDB 11 select HAVE_ARCH_KGDB
12 select HAVE_KPROBES if (!XIP_KERNEL) 12 select HAVE_KPROBES if (!XIP_KERNEL)
@@ -606,9 +606,14 @@ config ARCH_MSM
606 (clock and power control, etc). 606 (clock and power control, etc).
607 607
608config ARCH_SHMOBILE 608config ARCH_SHMOBILE
609 bool "Renesas SH-Mobile" 609 bool "Renesas SH-Mobile / R-Mobile"
610 select HAVE_CLK
611 select COMMON_CLKDEV
612 select GENERIC_CLOCKEVENTS
613 select NO_IOPORT
614 select SPARSE_IRQ
610 help 615 help
611 Support for Renesas's SH-Mobile ARM platforms 616 Support for Renesas's SH-Mobile and R-Mobile ARM platforms.
612 617
613config ARCH_RPC 618config ARCH_RPC
614 bool "RiscPC" 619 bool "RiscPC"
@@ -646,7 +651,7 @@ config ARCH_S3C2410
646 select ARCH_HAS_CPUFREQ 651 select ARCH_HAS_CPUFREQ
647 select HAVE_CLK 652 select HAVE_CLK
648 select ARCH_USES_GETTIMEOFFSET 653 select ARCH_USES_GETTIMEOFFSET
649 select HAVE_S3C2410_I2C 654 select HAVE_S3C2410_I2C if I2C
650 help 655 help
651 Samsung S3C2410X CPU based systems, such as the Simtec Electronics 656 Samsung S3C2410X CPU based systems, such as the Simtec Electronics
652 BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or 657 BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
@@ -676,8 +681,8 @@ config ARCH_S3C64XX
676 select S3C_DEV_NAND 681 select S3C_DEV_NAND
677 select USB_ARCH_HAS_OHCI 682 select USB_ARCH_HAS_OHCI
678 select SAMSUNG_GPIOLIB_4BIT 683 select SAMSUNG_GPIOLIB_4BIT
679 select HAVE_S3C2410_I2C 684 select HAVE_S3C2410_I2C if I2C
680 select HAVE_S3C2410_WATCHDOG 685 select HAVE_S3C2410_WATCHDOG if WATCHDOG
681 help 686 help
682 Samsung S3C64XX series based systems 687 Samsung S3C64XX series based systems
683 688
@@ -686,10 +691,10 @@ config ARCH_S5P64X0
686 select CPU_V6 691 select CPU_V6
687 select GENERIC_GPIO 692 select GENERIC_GPIO
688 select HAVE_CLK 693 select HAVE_CLK
689 select HAVE_S3C2410_WATCHDOG 694 select HAVE_S3C2410_WATCHDOG if WATCHDOG
690 select ARCH_USES_GETTIMEOFFSET 695 select ARCH_USES_GETTIMEOFFSET
691 select HAVE_S3C2410_I2C 696 select HAVE_S3C2410_I2C if I2C
692 select HAVE_S3C_RTC 697 select HAVE_S3C_RTC if RTC_CLASS
693 help 698 help
694 Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440, 699 Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440,
695 SMDK6450. 700 SMDK6450.
@@ -700,7 +705,7 @@ config ARCH_S5P6442
700 select GENERIC_GPIO 705 select GENERIC_GPIO
701 select HAVE_CLK 706 select HAVE_CLK
702 select ARCH_USES_GETTIMEOFFSET 707 select ARCH_USES_GETTIMEOFFSET
703 select HAVE_S3C2410_WATCHDOG 708 select HAVE_S3C2410_WATCHDOG if WATCHDOG
704 help 709 help
705 Samsung S5P6442 CPU based systems 710 Samsung S5P6442 CPU based systems
706 711
@@ -711,9 +716,9 @@ config ARCH_S5PC100
711 select CPU_V7 716 select CPU_V7
712 select ARM_L1_CACHE_SHIFT_6 717 select ARM_L1_CACHE_SHIFT_6
713 select ARCH_USES_GETTIMEOFFSET 718 select ARCH_USES_GETTIMEOFFSET
714 select HAVE_S3C2410_I2C 719 select HAVE_S3C2410_I2C if I2C
715 select HAVE_S3C_RTC 720 select HAVE_S3C_RTC if RTC_CLASS
716 select HAVE_S3C2410_WATCHDOG 721 select HAVE_S3C2410_WATCHDOG if WATCHDOG
717 help 722 help
718 Samsung S5PC100 series based systems 723 Samsung S5PC100 series based systems
719 724
@@ -726,9 +731,9 @@ config ARCH_S5PV210
726 select ARM_L1_CACHE_SHIFT_6 731 select ARM_L1_CACHE_SHIFT_6
727 select ARCH_HAS_CPUFREQ 732 select ARCH_HAS_CPUFREQ
728 select ARCH_USES_GETTIMEOFFSET 733 select ARCH_USES_GETTIMEOFFSET
729 select HAVE_S3C2410_I2C 734 select HAVE_S3C2410_I2C if I2C
730 select HAVE_S3C_RTC 735 select HAVE_S3C_RTC if RTC_CLASS
731 select HAVE_S3C2410_WATCHDOG 736 select HAVE_S3C2410_WATCHDOG if WATCHDOG
732 help 737 help
733 Samsung S5PV210/S5PC110 series based systems 738 Samsung S5PV210/S5PC110 series based systems
734 739
@@ -739,9 +744,9 @@ config ARCH_S5PV310
739 select GENERIC_GPIO 744 select GENERIC_GPIO
740 select HAVE_CLK 745 select HAVE_CLK
741 select GENERIC_CLOCKEVENTS 746 select GENERIC_CLOCKEVENTS
742 select HAVE_S3C_RTC 747 select HAVE_S3C_RTC if RTC_CLASS
743 select HAVE_S3C2410_I2C 748 select HAVE_S3C2410_I2C if I2C
744 select HAVE_S3C2410_WATCHDOG 749 select HAVE_S3C2410_WATCHDOG if WATCHDOG
745 help 750 help
746 Samsung S5PV310 series based systems 751 Samsung S5PV310 series based systems
747 752
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index ada6359160eb..772f95f1aecd 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -251,15 +251,16 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base,
251 writel(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); 251 writel(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);
252 252
253 /* 253 /*
254 * Set priority on all interrupts. 254 * Set priority on all global interrupts.
255 */ 255 */
256 for (i = 0; i < max_irq; i += 4) 256 for (i = 32; i < max_irq; i += 4)
257 writel(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4); 257 writel(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4);
258 258
259 /* 259 /*
260 * Disable all interrupts. 260 * Disable all interrupts. Leave the PPI and SGIs alone
261 * as these enables are banked registers.
261 */ 262 */
262 for (i = 0; i < max_irq; i += 32) 263 for (i = 32; i < max_irq; i += 32)
263 writel(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32); 264 writel(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32);
264 265
265 /* 266 /*
@@ -277,11 +278,30 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base,
277 278
278void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base) 279void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base)
279{ 280{
281 void __iomem *dist_base;
282 int i;
283
280 if (gic_nr >= MAX_GIC_NR) 284 if (gic_nr >= MAX_GIC_NR)
281 BUG(); 285 BUG();
282 286
287 dist_base = gic_data[gic_nr].dist_base;
288 BUG_ON(!dist_base);
289
283 gic_data[gic_nr].cpu_base = base; 290 gic_data[gic_nr].cpu_base = base;
284 291
292 /*
293 * Deal with the banked PPI and SGI interrupts - disable all
294 * PPI interrupts, ensure all SGI interrupts are enabled.
295 */
296 writel(0xffff0000, dist_base + GIC_DIST_ENABLE_CLEAR);
297 writel(0x0000ffff, dist_base + GIC_DIST_ENABLE_SET);
298
299 /*
300 * Set priority on PPI and SGI interrupts
301 */
302 for (i = 0; i < 32; i += 4)
303 writel(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4 / 4);
304
285 writel(0xf0, base + GIC_CPU_PRIMASK); 305 writel(0xf0, base + GIC_CPU_PRIMASK);
286 writel(1, base + GIC_CPU_CTRL); 306 writel(1, base + GIC_CPU_CTRL);
287} 307}
diff --git a/arch/arm/configs/ag5evm_defconfig b/arch/arm/configs/ag5evm_defconfig
new file mode 100644
index 000000000000..2b9cf56db363
--- /dev/null
+++ b/arch/arm/configs/ag5evm_defconfig
@@ -0,0 +1,83 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_IKCONFIG=y
4CONFIG_IKCONFIG_PROC=y
5CONFIG_LOG_BUF_SHIFT=16
6CONFIG_NAMESPACES=y
7# CONFIG_UTS_NS is not set
8# CONFIG_IPC_NS is not set
9# CONFIG_USER_NS is not set
10# CONFIG_PID_NS is not set
11CONFIG_BLK_DEV_INITRD=y
12CONFIG_INITRAMFS_SOURCE=""
13CONFIG_EMBEDDED=y
14CONFIG_SLAB=y
15# CONFIG_BLK_DEV_BSG is not set
16# CONFIG_IOSCHED_DEADLINE is not set
17# CONFIG_IOSCHED_CFQ is not set
18CONFIG_ARCH_SHMOBILE=y
19CONFIG_ARCH_SH73A0=y
20CONFIG_MACH_AG5EVM=y
21CONFIG_MEMORY_SIZE=0x10000000
22CONFIG_CPU_BPREDICT_DISABLE=y
23CONFIG_ARM_ERRATA_430973=y
24CONFIG_ARM_ERRATA_458693=y
25CONFIG_NO_HZ=y
26CONFIG_AEABI=y
27# CONFIG_OABI_COMPAT is not set
28CONFIG_HIGHMEM=y
29CONFIG_ZBOOT_ROM_TEXT=0x0
30CONFIG_ZBOOT_ROM_BSS=0x0
31CONFIG_CMDLINE="console=tty0 console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel"
32CONFIG_CMDLINE_FORCE=y
33CONFIG_KEXEC=y
34# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
35CONFIG_PM=y
36# CONFIG_SUSPEND is not set
37CONFIG_PM_RUNTIME=y
38CONFIG_NET=y
39CONFIG_PACKET=y
40CONFIG_UNIX=y
41CONFIG_INET=y
42# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
43# CONFIG_INET_XFRM_MODE_TUNNEL is not set
44# CONFIG_INET_XFRM_MODE_BEET is not set
45# CONFIG_INET_LRO is not set
46# CONFIG_INET_DIAG is not set
47# CONFIG_IPV6 is not set
48# CONFIG_WIRELESS is not set
49CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
50# CONFIG_BLK_DEV is not set
51CONFIG_NETDEVICES=y
52CONFIG_NET_ETHERNET=y
53CONFIG_SMSC911X=y
54# CONFIG_NETDEV_1000 is not set
55# CONFIG_NETDEV_10000 is not set
56# CONFIG_WLAN is not set
57CONFIG_INPUT_SPARSEKMAP=y
58# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
59CONFIG_INPUT_EVDEV=y
60# CONFIG_INPUT_KEYBOARD is not set
61# CONFIG_INPUT_MOUSE is not set
62CONFIG_SERIAL_SH_SCI=y
63CONFIG_SERIAL_SH_SCI_NR_UARTS=9
64CONFIG_SERIAL_SH_SCI_CONSOLE=y
65# CONFIG_LEGACY_PTYS is not set
66# CONFIG_HW_RANDOM is not set
67CONFIG_I2C=y
68CONFIG_I2C_SH_MOBILE=y
69# CONFIG_HWMON is not set
70# CONFIG_MFD_SUPPORT is not set
71CONFIG_FB=y
72CONFIG_FB_SH_MOBILE_LCDC=y
73CONFIG_FRAMEBUFFER_CONSOLE=y
74CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
75# CONFIG_HID_SUPPORT is not set
76# CONFIG_USB_SUPPORT is not set
77# CONFIG_DNOTIFY is not set
78# CONFIG_INOTIFY_USER is not set
79CONFIG_TMPFS=y
80# CONFIG_MISC_FILESYSTEMS is not set
81CONFIG_MAGIC_SYSRQ=y
82CONFIG_DEBUG_KERNEL=y
83# CONFIG_FTRACE is not set
diff --git a/arch/arm/include/asm/hardware/it8152.h b/arch/arm/include/asm/hardware/it8152.h
index 6700c7fc7ebd..21fa272301f8 100644
--- a/arch/arm/include/asm/hardware/it8152.h
+++ b/arch/arm/include/asm/hardware/it8152.h
@@ -75,7 +75,7 @@ extern unsigned long it8152_base_address;
75 IT8152_PD_IRQ(1) USB (USBR) 75 IT8152_PD_IRQ(1) USB (USBR)
76 IT8152_PD_IRQ(0) Audio controller (ACR) 76 IT8152_PD_IRQ(0) Audio controller (ACR)
77 */ 77 */
78#define IT8152_IRQ(x) (IRQ_BOARD_END + (x)) 78#define IT8152_IRQ(x) (IRQ_BOARD_START + (x))
79 79
80/* IRQ-sources in 3 groups - local devices, LPC (serial), and external PCI */ 80/* IRQ-sources in 3 groups - local devices, LPC (serial), and external PCI */
81#define IT8152_LD_IRQ_COUNT 9 81#define IT8152_LD_IRQ_COUNT 9
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index 54593b0c241b..21e3a4ab3b8c 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -748,8 +748,7 @@ static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr,
748 breakpoint_handler(addr, regs); 748 breakpoint_handler(addr, regs);
749 break; 749 break;
750 case ARM_ENTRY_ASYNC_WATCHPOINT: 750 case ARM_ENTRY_ASYNC_WATCHPOINT:
751 WARN_ON("Asynchronous watchpoint exception taken. " 751 WARN(1, "Asynchronous watchpoint exception taken. Debugging results may be unreliable\n");
752 "Debugging results may be unreliable");
753 case ARM_ENTRY_SYNC_WATCHPOINT: 752 case ARM_ENTRY_SYNC_WATCHPOINT:
754 watchpoint_handler(addr, regs); 753 watchpoint_handler(addr, regs);
755 break; 754 break;
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 49643b1467e6..07a50357492a 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -1749,7 +1749,7 @@ static inline int armv7_pmnc_has_overflowed(unsigned long pmnc)
1749static inline int armv7_pmnc_counter_has_overflowed(unsigned long pmnc, 1749static inline int armv7_pmnc_counter_has_overflowed(unsigned long pmnc,
1750 enum armv7_counters counter) 1750 enum armv7_counters counter)
1751{ 1751{
1752 int ret; 1752 int ret = 0;
1753 1753
1754 if (counter == ARMV7_CYCLE_COUNTER) 1754 if (counter == ARMV7_CYCLE_COUNTER)
1755 ret = pmnc & ARMV7_FLAG_C; 1755 ret = pmnc & ARMV7_FLAG_C;
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
index 20b7411e47fd..c2e112e1a05f 100644
--- a/arch/arm/kernel/stacktrace.c
+++ b/arch/arm/kernel/stacktrace.c
@@ -28,7 +28,7 @@ int notrace unwind_frame(struct stackframe *frame)
28 28
29 /* only go to a higher address on the stack */ 29 /* only go to a higher address on the stack */
30 low = frame->sp; 30 low = frame->sp;
31 high = ALIGN(low, THREAD_SIZE) + THREAD_SIZE; 31 high = ALIGN(low, THREAD_SIZE);
32 32
33 /* check current frame pointer is within bounds */ 33 /* check current frame pointer is within bounds */
34 if (fp < (low + 12) || fp + 4 >= high) 34 if (fp < (low + 12) || fp + 4 >= high)
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index cda78d59aa31..446aee97436f 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -53,10 +53,7 @@ static void dump_mem(const char *, const char *, unsigned long, unsigned long);
53void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame) 53void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame)
54{ 54{
55#ifdef CONFIG_KALLSYMS 55#ifdef CONFIG_KALLSYMS
56 char sym1[KSYM_SYMBOL_LEN], sym2[KSYM_SYMBOL_LEN]; 56 printk("[<%08lx>] (%pS) from [<%08lx>] (%pS)\n", where, (void *)where, from, (void *)from);
57 sprint_symbol(sym1, where);
58 sprint_symbol(sym2, from);
59 printk("[<%08lx>] (%s) from [<%08lx>] (%s)\n", where, sym1, from, sym2);
60#else 57#else
61 printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); 58 printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
62#endif 59#endif
diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c
index 2a161765f6d5..d2cb0b3c9872 100644
--- a/arch/arm/kernel/unwind.c
+++ b/arch/arm/kernel/unwind.c
@@ -279,7 +279,7 @@ int unwind_frame(struct stackframe *frame)
279 279
280 /* only go to a higher address on the stack */ 280 /* only go to a higher address on the stack */
281 low = frame->sp; 281 low = frame->sp;
282 high = ALIGN(low, THREAD_SIZE) + THREAD_SIZE; 282 high = ALIGN(low, THREAD_SIZE);
283 283
284 pr_debug("%s(pc = %08lx lr = %08lx sp = %08lx)\n", __func__, 284 pr_debug("%s(pc = %08lx lr = %08lx sp = %08lx)\n", __func__,
285 frame->pc, frame->lr, frame->sp); 285 frame->pc, frame->lr, frame->sp);
diff --git a/arch/arm/mach-ep93xx/include/mach/dma.h b/arch/arm/mach-ep93xx/include/mach/dma.h
index 3a5961d3f3b1..5e31b2b25da9 100644
--- a/arch/arm/mach-ep93xx/include/mach/dma.h
+++ b/arch/arm/mach-ep93xx/include/mach/dma.h
@@ -1,5 +1,13 @@
1/* 1/**
2 * arch/arm/mach-ep93xx/include/mach/dma.h 2 * DOC: EP93xx DMA M2P memory to peripheral and peripheral to memory engine
3 *
4 * The EP93xx DMA M2P subsystem handles DMA transfers between memory and
5 * peripherals. DMA M2P channels are available for audio, UARTs and IrDA.
6 * See chapter 10 of the EP93xx users guide for full details on the DMA M2P
7 * engine.
8 *
9 * See sound/soc/ep93xx/ep93xx-pcm.c for an example use of the DMA M2P code.
10 *
3 */ 11 */
4 12
5#ifndef __ASM_ARCH_DMA_H 13#ifndef __ASM_ARCH_DMA_H
@@ -8,12 +16,34 @@
8#include <linux/list.h> 16#include <linux/list.h>
9#include <linux/types.h> 17#include <linux/types.h>
10 18
19/**
20 * struct ep93xx_dma_buffer - Information about a buffer to be transferred
21 * using the DMA M2P engine
22 *
23 * @list: Entry in DMA buffer list
24 * @bus_addr: Physical address of the buffer
25 * @size: Size of the buffer in bytes
26 */
11struct ep93xx_dma_buffer { 27struct ep93xx_dma_buffer {
12 struct list_head list; 28 struct list_head list;
13 u32 bus_addr; 29 u32 bus_addr;
14 u16 size; 30 u16 size;
15}; 31};
16 32
33/**
34 * struct ep93xx_dma_m2p_client - Information about a DMA M2P client
35 *
36 * @name: Unique name for this client
37 * @flags: Client flags
38 * @cookie: User data to pass to callback functions
39 * @buffer_started: Non NULL function to call when a transfer is started.
40 * The arguments are the user data cookie and the DMA
41 * buffer which is starting.
42 * @buffer_finished: Non NULL function to call when a transfer is completed.
43 * The arguments are the user data cookie, the DMA buffer
44 * which has completed, and a boolean flag indicating if
45 * the transfer had an error.
46 */
17struct ep93xx_dma_m2p_client { 47struct ep93xx_dma_m2p_client {
18 char *name; 48 char *name;
19 u8 flags; 49 u8 flags;
@@ -24,10 +54,11 @@ struct ep93xx_dma_m2p_client {
24 struct ep93xx_dma_buffer *buf, 54 struct ep93xx_dma_buffer *buf,
25 int bytes, int error); 55 int bytes, int error);
26 56
27 /* Internal to the DMA code. */ 57 /* private: Internal use only */
28 void *channel; 58 void *channel;
29}; 59};
30 60
61/* DMA M2P ports */
31#define EP93XX_DMA_M2P_PORT_I2S1 0x00 62#define EP93XX_DMA_M2P_PORT_I2S1 0x00
32#define EP93XX_DMA_M2P_PORT_I2S2 0x01 63#define EP93XX_DMA_M2P_PORT_I2S2 0x01
33#define EP93XX_DMA_M2P_PORT_AAC1 0x02 64#define EP93XX_DMA_M2P_PORT_AAC1 0x02
@@ -39,18 +70,80 @@ struct ep93xx_dma_m2p_client {
39#define EP93XX_DMA_M2P_PORT_UART3 0x08 70#define EP93XX_DMA_M2P_PORT_UART3 0x08
40#define EP93XX_DMA_M2P_PORT_IRDA 0x09 71#define EP93XX_DMA_M2P_PORT_IRDA 0x09
41#define EP93XX_DMA_M2P_PORT_MASK 0x0f 72#define EP93XX_DMA_M2P_PORT_MASK 0x0f
42#define EP93XX_DMA_M2P_TX 0x00
43#define EP93XX_DMA_M2P_RX 0x10
44#define EP93XX_DMA_M2P_ABORT_ON_ERROR 0x20
45#define EP93XX_DMA_M2P_IGNORE_ERROR 0x40
46#define EP93XX_DMA_M2P_ERROR_MASK 0x60
47 73
48int ep93xx_dma_m2p_client_register(struct ep93xx_dma_m2p_client *m2p); 74/* DMA M2P client flags */
75#define EP93XX_DMA_M2P_TX 0x00 /* Memory to peripheral */
76#define EP93XX_DMA_M2P_RX 0x10 /* Peripheral to memory */
77
78/*
79 * DMA M2P client error handling flags. See the EP93xx users guide
80 * documentation on the DMA M2P CONTROL register for more details
81 */
82#define EP93XX_DMA_M2P_ABORT_ON_ERROR 0x20 /* Abort on peripheral error */
83#define EP93XX_DMA_M2P_IGNORE_ERROR 0x40 /* Ignore peripheral errors */
84#define EP93XX_DMA_M2P_ERROR_MASK 0x60 /* Mask of error bits */
85
86/**
87 * ep93xx_dma_m2p_client_register - Register a client with the DMA M2P
88 * subsystem
89 *
90 * @m2p: Client information to register
91 * returns 0 on success
92 *
93 * The DMA M2P subsystem allocates a channel and an interrupt line for the DMA
94 * client
95 */
96int ep93xx_dma_m2p_client_register(struct ep93xx_dma_m2p_client *m2p);
97
98/**
99 * ep93xx_dma_m2p_client_unregister - Unregister a client from the DMA M2P
100 * subsystem
101 *
102 * @m2p: Client to unregister
103 *
104 * Any transfers currently in progress will be completed in hardware, but
105 * ignored in software.
106 */
49void ep93xx_dma_m2p_client_unregister(struct ep93xx_dma_m2p_client *m2p); 107void ep93xx_dma_m2p_client_unregister(struct ep93xx_dma_m2p_client *m2p);
108
109/**
110 * ep93xx_dma_m2p_submit - Submit a DMA M2P transfer
111 *
112 * @m2p: DMA Client to submit the transfer on
113 * @buf: DMA Buffer to submit
114 *
115 * If the current or next transfer positions are free on the M2P client then
116 * the transfer is started immediately. If not, the transfer is added to the
117 * list of pending transfers. This function must not be called from the
118 * buffer_finished callback for an M2P channel.
119 *
120 */
50void ep93xx_dma_m2p_submit(struct ep93xx_dma_m2p_client *m2p, 121void ep93xx_dma_m2p_submit(struct ep93xx_dma_m2p_client *m2p,
51 struct ep93xx_dma_buffer *buf); 122 struct ep93xx_dma_buffer *buf);
123
124/**
125 * ep93xx_dma_m2p_submit_recursive - Put a DMA transfer on the pending list
126 * for an M2P channel
127 *
128 * @m2p: DMA Client to submit the transfer on
129 * @buf: DMA Buffer to submit
130 *
131 * This function must only be called from the buffer_finished callback for an
132 * M2P channel. It is commonly used to add the next transfer in a chained list
133 * of DMA transfers.
134 */
52void ep93xx_dma_m2p_submit_recursive(struct ep93xx_dma_m2p_client *m2p, 135void ep93xx_dma_m2p_submit_recursive(struct ep93xx_dma_m2p_client *m2p,
53 struct ep93xx_dma_buffer *buf); 136 struct ep93xx_dma_buffer *buf);
137
138/**
139 * ep93xx_dma_m2p_flush - Flush all pending transfers on a DMA M2P client
140 *
141 * @m2p: DMA client to flush transfers on
142 *
143 * Any transfers currently in progress will be completed in hardware, but
144 * ignored in software.
145 *
146 */
54void ep93xx_dma_m2p_flush(struct ep93xx_dma_m2p_client *m2p); 147void ep93xx_dma_m2p_flush(struct ep93xx_dma_m2p_client *m2p);
55 148
56#endif /* __ASM_ARCH_DMA_H */ 149#endif /* __ASM_ARCH_DMA_H */
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 51ff23b72d3a..3688123b5ad8 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -854,10 +854,9 @@ int __init kirkwood_find_tclk(void)
854 854
855 kirkwood_pcie_id(&dev, &rev); 855 kirkwood_pcie_id(&dev, &rev);
856 856
857 if ((dev == MV88F6281_DEV_ID && (rev == MV88F6281_REV_A0 || 857 if (dev == MV88F6281_DEV_ID || dev == MV88F6282_DEV_ID)
858 rev == MV88F6281_REV_A1)) || 858 if (((readl(SAMPLE_AT_RESET) >> 21) & 1) == 0)
859 (dev == MV88F6282_DEV_ID)) 859 return 200000000;
860 return 200000000;
861 860
862 return 166666667; 861 return 166666667;
863} 862}
diff --git a/arch/arm/mach-kirkwood/d2net_v2-setup.c b/arch/arm/mach-kirkwood/d2net_v2-setup.c
index 4aa86e4a152c..a31c9499ab36 100644
--- a/arch/arm/mach-kirkwood/d2net_v2-setup.c
+++ b/arch/arm/mach-kirkwood/d2net_v2-setup.c
@@ -225,5 +225,5 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
225 .init_machine = d2net_v2_init, 225 .init_machine = d2net_v2_init,
226 .map_io = kirkwood_map_io, 226 .map_io = kirkwood_map_io,
227 .init_irq = kirkwood_init_irq, 227 .init_irq = kirkwood_init_irq,
228 .timer = &lacie_v2_timer, 228 .timer = &kirkwood_timer,
229MACHINE_END 229MACHINE_END
diff --git a/arch/arm/mach-kirkwood/lacie_v2-common.c b/arch/arm/mach-kirkwood/lacie_v2-common.c
index d3ea1b6c8a02..285edab776e9 100644
--- a/arch/arm/mach-kirkwood/lacie_v2-common.c
+++ b/arch/arm/mach-kirkwood/lacie_v2-common.c
@@ -111,17 +111,3 @@ void __init lacie_v2_hdd_power_init(int hdd_num)
111 pr_err("Failed to power up HDD%d\n", i + 1); 111 pr_err("Failed to power up HDD%d\n", i + 1);
112 } 112 }
113} 113}
114
115/*****************************************************************************
116 * Timer
117 ****************************************************************************/
118
119static void lacie_v2_timer_init(void)
120{
121 kirkwood_tclk = 166666667;
122 orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk);
123}
124
125struct sys_timer lacie_v2_timer = {
126 .init = lacie_v2_timer_init,
127};
diff --git a/arch/arm/mach-kirkwood/lacie_v2-common.h b/arch/arm/mach-kirkwood/lacie_v2-common.h
index af521315b87b..fc64f578536e 100644
--- a/arch/arm/mach-kirkwood/lacie_v2-common.h
+++ b/arch/arm/mach-kirkwood/lacie_v2-common.h
@@ -13,6 +13,4 @@ void lacie_v2_register_flash(void);
13void lacie_v2_register_i2c_devices(void); 13void lacie_v2_register_i2c_devices(void);
14void lacie_v2_hdd_power_init(int hdd_num); 14void lacie_v2_hdd_power_init(int hdd_num);
15 15
16extern struct sys_timer lacie_v2_timer;
17
18#endif 16#endif
diff --git a/arch/arm/mach-kirkwood/mpp.c b/arch/arm/mach-kirkwood/mpp.c
index 065187d177c6..27901f702feb 100644
--- a/arch/arm/mach-kirkwood/mpp.c
+++ b/arch/arm/mach-kirkwood/mpp.c
@@ -59,7 +59,7 @@ void __init kirkwood_mpp_conf(unsigned int *mpp_list)
59 } 59 }
60 printk("\n"); 60 printk("\n");
61 61
62 while (*mpp_list) { 62 for ( ; *mpp_list; mpp_list++) {
63 unsigned int num = MPP_NUM(*mpp_list); 63 unsigned int num = MPP_NUM(*mpp_list);
64 unsigned int sel = MPP_SEL(*mpp_list); 64 unsigned int sel = MPP_SEL(*mpp_list);
65 int shift, gpio_mode; 65 int shift, gpio_mode;
@@ -88,8 +88,6 @@ void __init kirkwood_mpp_conf(unsigned int *mpp_list)
88 if (sel != 0) 88 if (sel != 0)
89 gpio_mode = 0; 89 gpio_mode = 0;
90 orion_gpio_set_valid(num, gpio_mode); 90 orion_gpio_set_valid(num, gpio_mode);
91
92 mpp_list++;
93 } 91 }
94 92
95 printk(KERN_DEBUG " final MPP regs:"); 93 printk(KERN_DEBUG " final MPP regs:");
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c
index 5ea66f1f4178..65ee21fd2f3b 100644
--- a/arch/arm/mach-kirkwood/netspace_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c
@@ -262,7 +262,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
262 .init_machine = netspace_v2_init, 262 .init_machine = netspace_v2_init,
263 .map_io = kirkwood_map_io, 263 .map_io = kirkwood_map_io,
264 .init_irq = kirkwood_init_irq, 264 .init_irq = kirkwood_init_irq,
265 .timer = &lacie_v2_timer, 265 .timer = &kirkwood_timer,
266MACHINE_END 266MACHINE_END
267#endif 267#endif
268 268
@@ -272,7 +272,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
272 .init_machine = netspace_v2_init, 272 .init_machine = netspace_v2_init,
273 .map_io = kirkwood_map_io, 273 .map_io = kirkwood_map_io,
274 .init_irq = kirkwood_init_irq, 274 .init_irq = kirkwood_init_irq,
275 .timer = &lacie_v2_timer, 275 .timer = &kirkwood_timer,
276MACHINE_END 276MACHINE_END
277#endif 277#endif
278 278
@@ -282,6 +282,6 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
282 .init_machine = netspace_v2_init, 282 .init_machine = netspace_v2_init,
283 .map_io = kirkwood_map_io, 283 .map_io = kirkwood_map_io,
284 .init_irq = kirkwood_init_irq, 284 .init_irq = kirkwood_init_irq,
285 .timer = &lacie_v2_timer, 285 .timer = &kirkwood_timer,
286MACHINE_END 286MACHINE_END
287#endif 287#endif
diff --git a/arch/arm/mach-kirkwood/netxbig_v2-setup.c b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
index a1b45d501aef..93afd3c8bfd8 100644
--- a/arch/arm/mach-kirkwood/netxbig_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
@@ -403,7 +403,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2")
403 .init_machine = netxbig_v2_init, 403 .init_machine = netxbig_v2_init,
404 .map_io = kirkwood_map_io, 404 .map_io = kirkwood_map_io,
405 .init_irq = kirkwood_init_irq, 405 .init_irq = kirkwood_init_irq,
406 .timer = &lacie_v2_timer, 406 .timer = &kirkwood_timer,
407MACHINE_END 407MACHINE_END
408#endif 408#endif
409 409
@@ -413,6 +413,6 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2")
413 .init_machine = netxbig_v2_init, 413 .init_machine = netxbig_v2_init,
414 .map_io = kirkwood_map_io, 414 .map_io = kirkwood_map_io,
415 .init_irq = kirkwood_init_irq, 415 .init_irq = kirkwood_init_irq,
416 .timer = &lacie_v2_timer, 416 .timer = &kirkwood_timer,
417MACHINE_END 417MACHINE_END
418#endif 418#endif
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c
index 8be09a0ce4ac..3587a281d993 100644
--- a/arch/arm/mach-kirkwood/ts41x-setup.c
+++ b/arch/arm/mach-kirkwood/ts41x-setup.c
@@ -27,6 +27,10 @@
27#include "mpp.h" 27#include "mpp.h"
28#include "tsx1x-common.h" 28#include "tsx1x-common.h"
29 29
30/* for the PCIe reset workaround */
31#include <plat/pcie.h>
32
33
30#define QNAP_TS41X_JUMPER_JP1 45 34#define QNAP_TS41X_JUMPER_JP1 45
31 35
32static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc = { 36static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc = {
@@ -140,8 +144,16 @@ static void __init qnap_ts41x_init(void)
140 144
141static int __init ts41x_pci_init(void) 145static int __init ts41x_pci_init(void)
142{ 146{
143 if (machine_is_ts41x()) 147 if (machine_is_ts41x()) {
148 /*
149 * Without this explicit reset, the PCIe SATA controller
150 * (Marvell 88sx7042/sata_mv) is known to stop working
151 * after a few minutes.
152 */
153 orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE);
154
144 kirkwood_pcie_init(KW_PCIE0); 155 kirkwood_pcie_init(KW_PCIE0);
156 }
145 157
146 return 0; 158 return 0;
147} 159}
diff --git a/arch/arm/mach-mmp/include/mach/cputype.h b/arch/arm/mach-mmp/include/mach/cputype.h
index f43a68b213f1..8a3b56dfd35d 100644
--- a/arch/arm/mach-mmp/include/mach/cputype.h
+++ b/arch/arm/mach-mmp/include/mach/cputype.h
@@ -46,7 +46,8 @@ static inline int cpu_is_pxa910(void)
46#ifdef CONFIG_CPU_MMP2 46#ifdef CONFIG_CPU_MMP2
47static inline int cpu_is_mmp2(void) 47static inline int cpu_is_mmp2(void)
48{ 48{
49 return (((cpu_readid_id() >> 8) & 0xff) == 0x58); 49 return (((read_cpuid_id() >> 8) & 0xff) == 0x58);
50}
50#else 51#else
51#define cpu_is_mmp2() (0) 52#define cpu_is_mmp2() (0)
52#endif 53#endif
diff --git a/arch/arm/mach-mv78xx0/mpp.c b/arch/arm/mach-mv78xx0/mpp.c
index 354ac514eb89..84db2dfc475c 100644
--- a/arch/arm/mach-mv78xx0/mpp.c
+++ b/arch/arm/mach-mv78xx0/mpp.c
@@ -54,7 +54,7 @@ void __init mv78xx0_mpp_conf(unsigned int *mpp_list)
54 } 54 }
55 printk("\n"); 55 printk("\n");
56 56
57 while (*mpp_list) { 57 for ( ; *mpp_list; mpp_list++) {
58 unsigned int num = MPP_NUM(*mpp_list); 58 unsigned int num = MPP_NUM(*mpp_list);
59 unsigned int sel = MPP_SEL(*mpp_list); 59 unsigned int sel = MPP_SEL(*mpp_list);
60 int shift, gpio_mode; 60 int shift, gpio_mode;
@@ -83,8 +83,6 @@ void __init mv78xx0_mpp_conf(unsigned int *mpp_list)
83 if (sel != 0) 83 if (sel != 0)
84 gpio_mode = 0; 84 gpio_mode = 0;
85 orion_gpio_set_valid(num, gpio_mode); 85 orion_gpio_set_valid(num, gpio_mode);
86
87 mpp_list++;
88 } 86 }
89 87
90 printk(KERN_DEBUG " final MPP regs:"); 88 printk(KERN_DEBUG " final MPP regs:");
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index ea0d80a89da7..e7f9ee63dce5 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -321,10 +321,9 @@ static struct platform_device omap_wdt_device = {
321static int __init omap_init_wdt(void) 321static int __init omap_init_wdt(void)
322{ 322{
323 if (!cpu_is_omap16xx()) 323 if (!cpu_is_omap16xx())
324 return; 324 return -ENODEV;
325 325
326 platform_device_register(&omap_wdt_device); 326 return platform_device_register(&omap_wdt_device);
327 return 0;
328} 327}
329subsys_initcall(omap_init_wdt); 328subsys_initcall(omap_init_wdt);
330#endif 329#endif
diff --git a/arch/arm/mach-omap1/include/mach/camera.h b/arch/arm/mach-omap1/include/mach/camera.h
index fd54b452eb22..847d00f0bb0a 100644
--- a/arch/arm/mach-omap1/include/mach/camera.h
+++ b/arch/arm/mach-omap1/include/mach/camera.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_ARCH_CAMERA_H_ 1#ifndef __ASM_ARCH_CAMERA_H_
2#define __ASM_ARCH_CAMERA_H_ 2#define __ASM_ARCH_CAMERA_H_
3 3
4#include <media/omap1_camera.h>
5
4void omap1_camera_init(void *); 6void omap1_camera_init(void *);
5 7
6static inline void omap1_set_camera_info(struct omap1_cam_platform_data *info) 8static inline void omap1_set_camera_info(struct omap1_cam_platform_data *info)
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 067f4379c87f..53ac762518bd 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -242,9 +242,6 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
242 mmc[0].gpio_cd = gpio + 0; 242 mmc[0].gpio_cd = gpio + 0;
243 omap2_hsmmc_init(mmc); 243 omap2_hsmmc_init(mmc);
244 244
245 /* link regulators to MMC adapters */
246 devkit8000_vmmc1_supply.dev = mmc[0].dev;
247
248 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ 245 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
249 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; 246 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
250 247
diff --git a/arch/arm/mach-orion5x/mpp.c b/arch/arm/mach-orion5x/mpp.c
index bc4c3b9aaf83..db485d3b8144 100644
--- a/arch/arm/mach-orion5x/mpp.c
+++ b/arch/arm/mach-orion5x/mpp.c
@@ -127,7 +127,7 @@ void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode)
127 /* Initialize gpiolib. */ 127 /* Initialize gpiolib. */
128 orion_gpio_init(); 128 orion_gpio_init();
129 129
130 while (mode->mpp >= 0) { 130 for ( ; mode->mpp >= 0; mode++) {
131 u32 *reg; 131 u32 *reg;
132 int num_type; 132 int num_type;
133 int shift; 133 int shift;
@@ -160,8 +160,6 @@ void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode)
160 orion_gpio_set_unused(mode->mpp); 160 orion_gpio_set_unused(mode->mpp);
161 161
162 orion_gpio_set_valid(mode->mpp, !!(mode->type == MPP_GPIO)); 162 orion_gpio_set_valid(mode->mpp, !!(mode->type == MPP_GPIO));
163
164 mode++;
165 } 163 }
166 164
167 writel(mpp_0_7_ctrl, MPP_0_7_CTRL); 165 writel(mpp_0_7_ctrl, MPP_0_7_CTRL);
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index 16f1bd5324be..c1c1cd04bdde 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -239,7 +239,7 @@ static struct platform_nand_data ts78xx_ts_nand_data = {
239static struct resource ts78xx_ts_nand_resources = { 239static struct resource ts78xx_ts_nand_resources = {
240 .start = TS_NAND_DATA, 240 .start = TS_NAND_DATA,
241 .end = TS_NAND_DATA + 4, 241 .end = TS_NAND_DATA + 4,
242 .flags = IORESOURCE_IO, 242 .flags = IORESOURCE_MEM,
243}; 243};
244 244
245static struct platform_device ts78xx_ts_nand_device = { 245static struct platform_device ts78xx_ts_nand_device = {
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index ac5598ce9724..d34b99febeb9 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -476,8 +476,6 @@ static void __init cmx2xx_init(void)
476 476
477static void __init cmx2xx_init_irq(void) 477static void __init cmx2xx_init_irq(void)
478{ 478{
479 pxa27x_init_irq();
480
481 if (cpu_is_pxa25x()) { 479 if (cpu_is_pxa25x()) {
482 pxa25x_init_irq(); 480 pxa25x_init_irq();
483 cmx2xx_pci_init_irq(CMX255_GPIO_IT8152_IRQ); 481 cmx2xx_pci_init_irq(CMX255_GPIO_IT8152_IRQ);
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c
index 4b521e045d75..ffa50e633ee6 100644
--- a/arch/arm/mach-pxa/saar.c
+++ b/arch/arm/mach-pxa/saar.c
@@ -116,7 +116,7 @@ static struct platform_device smc91x_device = {
116 }, 116 },
117}; 117};
118 118
119#if defined(CONFIG_FB_PXA) || (CONFIG_FB_PXA_MODULE) 119#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
120static uint16_t lcd_power_on[] = { 120static uint16_t lcd_power_on[] = {
121 /* single frame */ 121 /* single frame */
122 SMART_CMD_NOOP, 122 SMART_CMD_NOOP,
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 1ca7bdc6485c..579d2f0f4dd0 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -143,7 +143,7 @@ config MACH_SMDK6410
143 select S3C_DEV_USB_HSOTG 143 select S3C_DEV_USB_HSOTG
144 select S3C_DEV_WDT 144 select S3C_DEV_WDT
145 select SAMSUNG_DEV_KEYPAD 145 select SAMSUNG_DEV_KEYPAD
146 select HAVE_S3C2410_WATCHDOG 146 select HAVE_S3C2410_WATCHDOG if WATCHDOG
147 select S3C64XX_SETUP_SDHCI 147 select S3C64XX_SETUP_SDHCI
148 select S3C64XX_SETUP_I2C1 148 select S3C64XX_SETUP_I2C1
149 select S3C64XX_SETUP_IDE 149 select S3C64XX_SETUP_IDE
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 51dcd59eda6a..e397a92888f2 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -5,26 +5,26 @@ comment "SH-Mobile System Type"
5config ARCH_SH7367 5config ARCH_SH7367
6 bool "SH-Mobile G3 (SH7367)" 6 bool "SH-Mobile G3 (SH7367)"
7 select CPU_V6 7 select CPU_V6
8 select HAVE_CLK
9 select COMMON_CLKDEV
10 select SH_CLK_CPG 8 select SH_CLK_CPG
11 select GENERIC_CLOCKEVENTS 9 select ARCH_WANT_OPTIONAL_GPIOLIB
12 10
13config ARCH_SH7377 11config ARCH_SH7377
14 bool "SH-Mobile G4 (SH7377)" 12 bool "SH-Mobile G4 (SH7377)"
15 select CPU_V7 13 select CPU_V7
16 select HAVE_CLK
17 select COMMON_CLKDEV
18 select SH_CLK_CPG 14 select SH_CLK_CPG
19 select GENERIC_CLOCKEVENTS 15 select ARCH_WANT_OPTIONAL_GPIOLIB
20 16
21config ARCH_SH7372 17config ARCH_SH7372
22 bool "SH-Mobile AP4 (SH7372)" 18 bool "SH-Mobile AP4 (SH7372)"
23 select CPU_V7 19 select CPU_V7
24 select HAVE_CLK
25 select COMMON_CLKDEV
26 select SH_CLK_CPG 20 select SH_CLK_CPG
27 select GENERIC_CLOCKEVENTS 21 select ARCH_WANT_OPTIONAL_GPIOLIB
22
23config ARCH_SH73A0
24 bool "SH-Mobile AG5 (R8A73A00)"
25 select CPU_V7
26 select SH_CLK_CPG
27 select ARM_GIC
28 28
29comment "SH-Mobile Board Type" 29comment "SH-Mobile Board Type"
30 30
@@ -57,6 +57,10 @@ config AP4EVB_WVGA
57 57
58endchoice 58endchoice
59 59
60config MACH_AG5EVM
61 bool "AG5EVM board"
62 depends on ARCH_SH73A0
63
60comment "SH-Mobile System Configuration" 64comment "SH-Mobile System Configuration"
61 65
62menu "Memory configuration" 66menu "Memory configuration"
@@ -66,6 +70,7 @@ config MEMORY_START
66 default "0x50000000" if MACH_G3EVM 70 default "0x50000000" if MACH_G3EVM
67 default "0x40000000" if MACH_G4EVM 71 default "0x40000000" if MACH_G4EVM
68 default "0x40000000" if MACH_AP4EVB 72 default "0x40000000" if MACH_AP4EVB
73 default "0x40000000" if MACH_AG5EVM
69 default "0x00000000" 74 default "0x00000000"
70 ---help--- 75 ---help---
71 Tweak this only when porting to a new machine which does not 76 Tweak this only when porting to a new machine which does not
@@ -77,6 +82,7 @@ config MEMORY_SIZE
77 default "0x08000000" if MACH_G3EVM 82 default "0x08000000" if MACH_G3EVM
78 default "0x08000000" if MACH_G4EVM 83 default "0x08000000" if MACH_G4EVM
79 default "0x10000000" if MACH_AP4EVB 84 default "0x10000000" if MACH_AP4EVB
85 default "0x20000000" if MACH_AG5EVM
80 default "0x04000000" 86 default "0x04000000"
81 help 87 help
82 This sets the default memory size assumed by your kernel. It can 88 This sets the default memory size assumed by your kernel. It can
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index ae416fe7daf2..7a8705ef6d8f 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -9,6 +9,7 @@ obj-y := timer.o console.o clock.o pm_runtime.o
9obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o 9obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o
10obj-$(CONFIG_ARCH_SH7377) += setup-sh7377.o clock-sh7377.o intc-sh7377.o 10obj-$(CONFIG_ARCH_SH7377) += setup-sh7377.o clock-sh7377.o intc-sh7377.o
11obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o 11obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o
12obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o
12 13
13# Pinmux setup 14# Pinmux setup
14pfc-$(CONFIG_ARCH_SH7367) := pfc-sh7367.o 15pfc-$(CONFIG_ARCH_SH7367) := pfc-sh7367.o
@@ -20,3 +21,4 @@ obj-$(CONFIG_GENERIC_GPIO) += $(pfc-y)
20obj-$(CONFIG_MACH_G3EVM) += board-g3evm.o 21obj-$(CONFIG_MACH_G3EVM) += board-g3evm.o
21obj-$(CONFIG_MACH_G4EVM) += board-g4evm.o 22obj-$(CONFIG_MACH_G4EVM) += board-g4evm.o
22obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o 23obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o
24obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
new file mode 100644
index 000000000000..bade04accc80
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -0,0 +1,159 @@
1/*
2 * arch/arm/mach-shmobile/board-ag5evm.c
3 *
4 * Copyright (C) 2010 Takashi Yoshii <yoshii.takashi.zj@renesas.com>
5 * Copyright (C) 2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/interrupt.h>
25#include <linux/irq.h>
26#include <linux/platform_device.h>
27#include <linux/delay.h>
28#include <linux/io.h>
29#include <linux/dma-mapping.h>
30#include <linux/serial_sci.h>
31#include <linux/smsc911x.h>
32#include <linux/gpio.h>
33#include <mach/hardware.h>
34#include <mach/sh73a0.h>
35#include <mach/common.h>
36#include <asm/mach-types.h>
37#include <asm/mach/arch.h>
38#include <asm/mach/map.h>
39#include <asm/mach/time.h>
40#include <asm/hardware/gic.h>
41#include <asm/hardware/cache-l2x0.h>
42#include <asm/traps.h>
43
44static struct resource smsc9220_resources[] = {
45 [0] = {
46 .start = 0x14000000,
47 .end = 0x14000000 + SZ_64K - 1,
48 .flags = IORESOURCE_MEM,
49 },
50 [1] = {
51 .start = gic_spi(33), /* PINT1 */
52 .flags = IORESOURCE_IRQ,
53 },
54};
55
56static struct smsc911x_platform_config smsc9220_platdata = {
57 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
58 .phy_interface = PHY_INTERFACE_MODE_MII,
59 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
60 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
61};
62
63static struct platform_device eth_device = {
64 .name = "smsc911x",
65 .id = 0,
66 .dev = {
67 .platform_data = &smsc9220_platdata,
68 },
69 .resource = smsc9220_resources,
70 .num_resources = ARRAY_SIZE(smsc9220_resources),
71};
72
73static struct platform_device *ag5evm_devices[] __initdata = {
74 &eth_device,
75};
76
77static struct map_desc ag5evm_io_desc[] __initdata = {
78 /* create a 1:1 entity map for 0xe6xxxxxx
79 * used by CPGA, INTC and PFC.
80 */
81 {
82 .virtual = 0xe6000000,
83 .pfn = __phys_to_pfn(0xe6000000),
84 .length = 256 << 20,
85 .type = MT_DEVICE_NONSHARED
86 },
87};
88
89static void __init ag5evm_map_io(void)
90{
91 iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));
92
93 /* setup early devices and console here as well */
94 sh73a0_add_early_devices();
95 shmobile_setup_console();
96}
97
98#define PINTC_ADDR 0xe6900000
99#define PINTER0A (PINTC_ADDR + 0xa0)
100#define PINTCR0A (PINTC_ADDR + 0xb0)
101
102void __init ag5evm_init_irq(void)
103{
104 /* setup PINT: enable PINTA2 as active low */
105 __raw_writel(__raw_readl(PINTER0A) | (1<<29), PINTER0A);
106 __raw_writew(__raw_readw(PINTCR0A) | (2<<10), PINTCR0A);
107
108 gic_dist_init(0, __io(0xf0001000), 29);
109 gic_cpu_init(0, __io(0xf0000100));
110}
111
112#define PORT144CR 0xe6052090
113#define PORT145CR 0xe6052091
114
115#define PORT154CR 0xe605209a
116#define PORT155CR 0xe605209b
117#define PORT156CR 0xe605209c
118#define PORT157CR 0xe605209d
119
120#define PORTR159_128DR 0xe6056004
121
122static void __init ag5evm_init(void)
123{
124 /* enable SCIFA2 */
125 __raw_writeb(0x12, PORT154CR); /* TXD */
126 __raw_writeb(0x22, PORT155CR); /* RXD */
127 __raw_writeb(0x12, PORT156CR); /* RTS */
128 __raw_writeb(0x22, PORT157CR); /* CTS */
129
130 /* enable SMSC911X */
131 __raw_writeb(0x20, PORT144CR); /* PINTA2 */
132 __raw_writeb(0x10, PORT145CR); /* RESET */
133 __raw_writel(__raw_readl(PORTR159_128DR) & ~(1 << 17), PORTR159_128DR);
134
135#ifdef CONFIG_CACHE_L2X0
136 /* Shared attribute override enable, 64K*8way */
137 l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff);
138#endif
139 sh73a0_add_standard_devices();
140 platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
141}
142
143static void __init ag5evm_timer_init(void)
144{
145 sh73a0_clock_init();
146 shmobile_timer.init();
147 return;
148}
149
150struct sys_timer ag5evm_timer = {
151 .init = ag5evm_timer_init,
152};
153
154MACHINE_START(AG5EVM, "ag5evm")
155 .map_io = ag5evm_map_io,
156 .init_irq = ag5evm_init_irq,
157 .init_machine = ag5evm_init,
158 .timer = &ag5evm_timer,
159MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 63c2fcac8e1e..d3260542b943 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -583,6 +583,10 @@ static int fsi_set_rate(int is_porta, int rate)
583 return -EINVAL; 583 return -EINVAL;
584 584
585 switch (rate) { 585 switch (rate) {
586 case 44100:
587 clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 11283000));
588 ret = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
589 break;
586 case 48000: 590 case 48000:
587 clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 85428000)); 591 clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 85428000));
588 clk_set_rate(fdiv_clk, clk_round_rate(fdiv_clk, 12204000)); 592 clk_set_rate(fdiv_clk, clk_round_rate(fdiv_clk, 12204000));
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
new file mode 100644
index 000000000000..f2390aefefe8
--- /dev/null
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -0,0 +1,101 @@
1/*
2 * sh73a0 clock framework support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/io.h>
22#include <linux/sh_clk.h>
23#include <mach/common.h>
24#include <asm/clkdev.h>
25
26#define SMSTPCR0 0xe6150130
27#define SMSTPCR1 0xe6150134
28#define SMSTPCR2 0xe6150138
29#define SMSTPCR3 0xe615013c
30#define SMSTPCR4 0xe6150140
31#define SMSTPCR5 0xe6150144
32
33/* Fixed 32 KHz root clock from EXTALR pin */
34static struct clk r_clk = {
35 .rate = 32768,
36};
37
38/* Temporarily fixed 48 MHz SUB clock */
39static struct clk sub_clk = {
40 .rate = 48000000,
41};
42
43static struct clk *main_clks[] = {
44 &r_clk,
45 &sub_clk,
46};
47
48enum { MSTP219,
49 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
50 MSTP331, MSTP329,
51 MSTP_NR };
52
53#define MSTP(_parent, _reg, _bit, _flags) \
54 SH_CLK_MSTP32(_parent, _reg, _bit, _flags)
55
56static struct clk mstp_clks[MSTP_NR] = {
57 [MSTP219] = MSTP(&sub_clk, SMSTPCR2, 19, 0), /* SCIFA7 */
58 [MSTP207] = MSTP(&sub_clk, SMSTPCR2, 7, 0), /* SCIFA5 */
59 [MSTP206] = MSTP(&sub_clk, SMSTPCR2, 6, 0), /* SCIFB */
60 [MSTP204] = MSTP(&sub_clk, SMSTPCR2, 4, 0), /* SCIFA0 */
61 [MSTP203] = MSTP(&sub_clk, SMSTPCR2, 3, 0), /* SCIFA1 */
62 [MSTP202] = MSTP(&sub_clk, SMSTPCR2, 2, 0), /* SCIFA2 */
63 [MSTP201] = MSTP(&sub_clk, SMSTPCR2, 1, 0), /* SCIFA3 */
64 [MSTP200] = MSTP(&sub_clk, SMSTPCR2, 0, 0), /* SCIFA4 */
65 [MSTP331] = MSTP(&sub_clk, SMSTPCR3, 31, 0), /* SCIFA6 */
66 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
67};
68
69#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
70
71static struct clk_lookup lookups[] = {
72 /* MSTP32 clocks */
73 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */
74 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
75 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */
76 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */
77 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */
78 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */
79 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */
80 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
81 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
82 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
83};
84
85void __init sh73a0_clock_init(void)
86{
87 int k, ret = 0;
88
89 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
90 ret = clk_register(main_clks[k]);
91
92 if (!ret)
93 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
94
95 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
96
97 if (!ret)
98 clk_init();
99 else
100 panic("failed to setup sh73a0 clocks\n");
101}
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index efeef778a875..f1dbcdca61ba 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -30,4 +30,8 @@ extern void sh7372_pinmux_init(void);
30extern struct clk sh7372_extal1_clk; 30extern struct clk sh7372_extal1_clk;
31extern struct clk sh7372_extal2_clk; 31extern struct clk sh7372_extal2_clk;
32 32
33extern void sh73a0_add_early_devices(void);
34extern void sh73a0_add_standard_devices(void);
35extern void sh73a0_clock_init(void);
36
33#endif /* __ARCH_MACH_COMMON_H */ 37#endif /* __ARCH_MACH_COMMON_H */
diff --git a/arch/arm/mach-shmobile/include/mach/entry-macro-gic.S b/arch/arm/mach-shmobile/include/mach/entry-macro-gic.S
new file mode 100644
index 000000000000..50b1f16d54a2
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/entry-macro-gic.S
@@ -0,0 +1,89 @@
1/*
2 * Copyright (C) 2010 Renesas Solutions Corp.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17#include <mach/hardware.h>
18#include <asm/hardware/gic.h>
19
20 .macro disable_fiq
21 .endm
22
23 .macro get_irqnr_preamble, base, tmp
24 ldr \base, =(0xf0000100)
25 .endm
26
27 .macro arch_ret_to_user, tmp1, tmp2
28 .endm
29
30 /*
31 * The interrupt numbering scheme is defined in the
32 * interrupt controller spec. To wit:
33 *
34 * Interrupts 0-15 are IPI
35 * 16-28 are reserved
36 * 29-31 are local. We allow 30 to be used for the watchdog.
37 * 32-1020 are global
38 * 1021-1022 are reserved
39 * 1023 is "spurious" (no interrupt)
40 *
41 * For now, we ignore all local interrupts so only return an
42 * interrupt if it's between 30 and 1020. The test_for_ipi
43 * routine below will pick up on IPIs.
44 *
45 * A simple read from the controller will tell us the number of
46 * the highest priority enabled interrupt. We then just need to
47 * check whether it is in the valid range for an IRQ (30-1020
48 * inclusive).
49 */
50
51 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
52
53 ldr \irqstat, [\base, #GIC_CPU_INTACK]
54 /* bits 12-10 = src CPU, 9-0 = int # */
55
56 ldr \tmp, =1021
57 bic \irqnr, \irqstat, #0x1c00
58 cmp \irqnr, #29
59 cmpcc \irqnr, \irqnr
60 cmpne \irqnr, \tmp
61 cmpcs \irqnr, \irqnr
62
63 .endm
64
65 /*
66 * We assume that irqstat (the raw value of the IRQ acknowledge
67 * register) is preserved from the macro above.
68 * If there is an IPI, we immediately signal end of interrupt on the
69 * controller, since this requires the original irqstat value which
70 * we won't easily be able to recreate later.
71 */
72
73 .macro test_for_ipi, irqnr, irqstat, base, tmp
74 bic \irqnr, \irqstat, #0x1c00
75 cmp \irqnr, #16
76 strcc \irqstat, [\base, #GIC_CPU_EOI]
77 cmpcs \irqnr, \irqnr
78 .endm
79
80 /* As above, this assumes that irqstat and base are preserved.. */
81
82 .macro test_for_ltirq, irqnr, irqstat, base, tmp
83 bic \irqnr, \irqstat, #0x1c00
84 mov \tmp, #0
85 cmp \irqnr, #29
86 moveq \tmp, #1
87 streq \irqstat, [\base, #GIC_CPU_EOI]
88 cmp \tmp, #0
89 .endm
diff --git a/arch/arm/mach-shmobile/include/mach/entry-macro-intc.S b/arch/arm/mach-shmobile/include/mach/entry-macro-intc.S
new file mode 100644
index 000000000000..a285d13c7416
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/entry-macro-intc.S
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2008 Renesas Solutions Corp.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17#include <mach/hardware.h>
18#include <mach/irqs.h>
19
20 .macro disable_fiq
21 .endm
22
23 .macro get_irqnr_preamble, base, tmp
24 ldr \base, =INTFLGA
25 .endm
26
27 .macro arch_ret_to_user, tmp1, tmp2
28 .endm
29
30 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
31 ldr \irqnr, [\base]
32 cmp \irqnr, #0
33 beq 1000f
34 /* intevt to irq number */
35 lsr \irqnr, \irqnr, #0x5
36 subs \irqnr, \irqnr, #16
37
381000:
39 .endm
diff --git a/arch/arm/mach-shmobile/include/mach/entry-macro.S b/arch/arm/mach-shmobile/include/mach/entry-macro.S
index a285d13c7416..26e401167605 100644
--- a/arch/arm/mach-shmobile/include/mach/entry-macro.S
+++ b/arch/arm/mach-shmobile/include/mach/entry-macro.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2008 Renesas Solutions Corp. 2 * Copyright (C) 2010 Paul Mundt
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -14,26 +14,8 @@
14 * along with this program; if not, write to the Free Software 14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */ 16 */
17#include <mach/hardware.h> 17#if defined(CONFIG_ARM_GIC)
18#include <mach/irqs.h> 18#include <mach/entry-macro-gic.S>
19 19#else
20 .macro disable_fiq 20#include <mach/entry-macro-intc.S>
21 .endm 21#endif
22
23 .macro get_irqnr_preamble, base, tmp
24 ldr \base, =INTFLGA
25 .endm
26
27 .macro arch_ret_to_user, tmp1, tmp2
28 .endm
29
30 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
31 ldr \irqnr, [\base]
32 cmp \irqnr, #0
33 beq 1000f
34 /* intevt to irq number */
35 lsr \irqnr, \irqnr, #0x5
36 subs \irqnr, \irqnr, #16
37
381000:
39 .endm
diff --git a/arch/arm/mach-shmobile/include/mach/irqs.h b/arch/arm/mach-shmobile/include/mach/irqs.h
index fa15b5f8a001..09e0ab7d343e 100644
--- a/arch/arm/mach-shmobile/include/mach/irqs.h
+++ b/arch/arm/mach-shmobile/include/mach/irqs.h
@@ -3,6 +3,9 @@
3 3
4#define NR_IRQS 512 4#define NR_IRQS 512
5 5
6/* GIC */
7#define gic_spi(nr) ((nr) + 32)
8
6/* INTCA */ 9/* INTCA */
7#define evt2irq(evt) (((evt) >> 5) - 16) 10#define evt2irq(evt) (((evt) >> 5) - 16)
8#define irq2evt(irq) (((irq) + 16) << 5) 11#define irq2evt(irq) (((irq) + 16) << 5)
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
new file mode 100644
index 000000000000..5d691fe5181c
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_SH73A0_H__
2#define __ASM_SH73A0_H__
3
4/* This will soon be replaced by pinmux enums */
5
6#endif /* __ASM_SH73A0_H__ */
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
new file mode 100644
index 000000000000..0bc110615aa9
--- /dev/null
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -0,0 +1,234 @@
1/*
2 * sh73a0 processor support
3 *
4 * Copyright (C) 2010 Takashi Yoshii
5 * Copyright (C) 2010 Magnus Damm
6 * Copyright (C) 2008 Yoshihiro Shimoda
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/interrupt.h>
24#include <linux/irq.h>
25#include <linux/platform_device.h>
26#include <linux/delay.h>
27#include <linux/input.h>
28#include <linux/io.h>
29#include <linux/serial_sci.h>
30#include <linux/sh_intc.h>
31#include <linux/sh_timer.h>
32#include <mach/hardware.h>
33#include <asm/mach-types.h>
34#include <asm/mach/arch.h>
35
36static struct plat_sci_port scif0_platform_data = {
37 .mapbase = 0xe6c40000,
38 .flags = UPF_BOOT_AUTOCONF,
39 .type = PORT_SCIFA,
40 .irqs = { gic_spi(72), gic_spi(72),
41 gic_spi(72), gic_spi(72) },
42};
43
44static struct platform_device scif0_device = {
45 .name = "sh-sci",
46 .id = 0,
47 .dev = {
48 .platform_data = &scif0_platform_data,
49 },
50};
51
52static struct plat_sci_port scif1_platform_data = {
53 .mapbase = 0xe6c50000,
54 .flags = UPF_BOOT_AUTOCONF,
55 .type = PORT_SCIFA,
56 .irqs = { gic_spi(73), gic_spi(73),
57 gic_spi(73), gic_spi(73) },
58};
59
60static struct platform_device scif1_device = {
61 .name = "sh-sci",
62 .id = 1,
63 .dev = {
64 .platform_data = &scif1_platform_data,
65 },
66};
67
68static struct plat_sci_port scif2_platform_data = {
69 .mapbase = 0xe6c60000,
70 .flags = UPF_BOOT_AUTOCONF,
71 .type = PORT_SCIFA,
72 .irqs = { gic_spi(74), gic_spi(74),
73 gic_spi(74), gic_spi(74) },
74};
75
76static struct platform_device scif2_device = {
77 .name = "sh-sci",
78 .id = 2,
79 .dev = {
80 .platform_data = &scif2_platform_data,
81 },
82};
83
84static struct plat_sci_port scif3_platform_data = {
85 .mapbase = 0xe6c70000,
86 .flags = UPF_BOOT_AUTOCONF,
87 .type = PORT_SCIFA,
88 .irqs = { gic_spi(75), gic_spi(75),
89 gic_spi(75), gic_spi(75) },
90};
91
92static struct platform_device scif3_device = {
93 .name = "sh-sci",
94 .id = 3,
95 .dev = {
96 .platform_data = &scif3_platform_data,
97 },
98};
99
100static struct plat_sci_port scif4_platform_data = {
101 .mapbase = 0xe6c80000,
102 .flags = UPF_BOOT_AUTOCONF,
103 .type = PORT_SCIFA,
104 .irqs = { gic_spi(78), gic_spi(78),
105 gic_spi(78), gic_spi(78) },
106};
107
108static struct platform_device scif4_device = {
109 .name = "sh-sci",
110 .id = 4,
111 .dev = {
112 .platform_data = &scif4_platform_data,
113 },
114};
115
116static struct plat_sci_port scif5_platform_data = {
117 .mapbase = 0xe6cb0000,
118 .flags = UPF_BOOT_AUTOCONF,
119 .type = PORT_SCIFA,
120 .irqs = { gic_spi(79), gic_spi(79),
121 gic_spi(79), gic_spi(79) },
122};
123
124static struct platform_device scif5_device = {
125 .name = "sh-sci",
126 .id = 5,
127 .dev = {
128 .platform_data = &scif5_platform_data,
129 },
130};
131
132static struct plat_sci_port scif6_platform_data = {
133 .mapbase = 0xe6cc0000,
134 .flags = UPF_BOOT_AUTOCONF,
135 .type = PORT_SCIFA,
136 .irqs = { gic_spi(156), gic_spi(156),
137 gic_spi(156), gic_spi(156) },
138};
139
140static struct platform_device scif6_device = {
141 .name = "sh-sci",
142 .id = 6,
143 .dev = {
144 .platform_data = &scif6_platform_data,
145 },
146};
147
148static struct plat_sci_port scif7_platform_data = {
149 .mapbase = 0xe6cd0000,
150 .flags = UPF_BOOT_AUTOCONF,
151 .type = PORT_SCIFA,
152 .irqs = { gic_spi(143), gic_spi(143),
153 gic_spi(143), gic_spi(143) },
154};
155
156static struct platform_device scif7_device = {
157 .name = "sh-sci",
158 .id = 7,
159 .dev = {
160 .platform_data = &scif7_platform_data,
161 },
162};
163
164static struct plat_sci_port scif8_platform_data = {
165 .mapbase = 0xe6c30000,
166 .flags = UPF_BOOT_AUTOCONF,
167 .type = PORT_SCIFB,
168 .irqs = { gic_spi(80), gic_spi(80),
169 gic_spi(80), gic_spi(80) },
170};
171
172static struct platform_device scif8_device = {
173 .name = "sh-sci",
174 .id = 8,
175 .dev = {
176 .platform_data = &scif8_platform_data,
177 },
178};
179
180static struct sh_timer_config cmt10_platform_data = {
181 .name = "CMT10",
182 .channel_offset = 0x10,
183 .timer_bit = 0,
184 .clockevent_rating = 125,
185 .clocksource_rating = 125,
186};
187
188static struct resource cmt10_resources[] = {
189 [0] = {
190 .name = "CMT10",
191 .start = 0xe6138010,
192 .end = 0xe613801b,
193 .flags = IORESOURCE_MEM,
194 },
195 [1] = {
196 .start = gic_spi(65),
197 .flags = IORESOURCE_IRQ,
198 },
199};
200
201static struct platform_device cmt10_device = {
202 .name = "sh_cmt",
203 .id = 10,
204 .dev = {
205 .platform_data = &cmt10_platform_data,
206 },
207 .resource = cmt10_resources,
208 .num_resources = ARRAY_SIZE(cmt10_resources),
209};
210
211static struct platform_device *sh73a0_early_devices[] __initdata = {
212 &scif0_device,
213 &scif1_device,
214 &scif2_device,
215 &scif3_device,
216 &scif4_device,
217 &scif5_device,
218 &scif6_device,
219 &scif7_device,
220 &scif8_device,
221 &cmt10_device,
222};
223
224void __init sh73a0_add_standard_devices(void)
225{
226 platform_add_devices(sh73a0_early_devices,
227 ARRAY_SIZE(sh73a0_early_devices));
228}
229
230void __init sh73a0_add_early_devices(void)
231{
232 early_platform_add_devices(sh73a0_early_devices,
233 ARRAY_SIZE(sh73a0_early_devices));
234}
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index c2e405a9e025..fd25ccd7272f 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -54,7 +54,9 @@ static struct map_desc ct_ca9x4_io_desc[] __initdata = {
54 54
55static void __init ct_ca9x4_map_io(void) 55static void __init ct_ca9x4_map_io(void)
56{ 56{
57#ifdef CONFIG_LOCAL_TIMERS
57 twd_base = MMIO_P2V(A9_MPCORE_TWD); 58 twd_base = MMIO_P2V(A9_MPCORE_TWD);
59#endif
58 v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); 60 v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
59} 61}
60 62
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 4414a01e1e8a..8206842ddd9e 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -772,7 +772,7 @@ config CACHE_L2X0
772 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ 772 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \
773 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || \ 773 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || \
774 ARCH_NOMADIK || ARCH_OMAP4 || ARCH_S5PV310 || ARCH_TEGRA || \ 774 ARCH_NOMADIK || ARCH_OMAP4 || ARCH_S5PV310 || ARCH_TEGRA || \
775 ARCH_U8500 || ARCH_VEXPRESS_CA9X4 775 ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_SHMOBILE
776 default y 776 default y
777 select OUTER_CACHE 777 select OUTER_CACHE
778 select OUTER_CACHE_SYNC 778 select OUTER_CACHE_SYNC
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index e4dd0646e859..ac6a36142fcd 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -198,7 +198,7 @@ __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot)
198 * fragmentation of the DMA space, and also prevents allocations 198 * fragmentation of the DMA space, and also prevents allocations
199 * smaller than a section from crossing a section boundary. 199 * smaller than a section from crossing a section boundary.
200 */ 200 */
201 bit = fls(size - 1) + 1; 201 bit = fls(size - 1);
202 if (bit > SECTION_SHIFT) 202 if (bit > SECTION_SHIFT)
203 bit = SECTION_SHIFT; 203 bit = SECTION_SHIFT;
204 align = 1 << bit; 204 align = 1 << bit;
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 6f42a18b8aa4..fc819120978d 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -284,12 +284,14 @@ void __init omap_dsp_reserve_sdram_memblock(void)
284 if (!size) 284 if (!size)
285 return; 285 return;
286 286
287 paddr = __memblock_alloc_base(size, SZ_1M, MEMBLOCK_REAL_LIMIT); 287 paddr = memblock_alloc(size, SZ_1M);
288 if (!paddr) { 288 if (!paddr) {
289 pr_err("%s: failed to reserve %x bytes\n", 289 pr_err("%s: failed to reserve %x bytes\n",
290 __func__, size); 290 __func__, size);
291 return; 291 return;
292 } 292 }
293 memblock_free(paddr, size);
294 memblock_remove(paddr, size);
293 295
294 omap_dsp_phys_mempool_base = paddr; 296 omap_dsp_phys_mempool_base = paddr;
295} 297}
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index f5c5b8da9a87..2c2826571d45 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -1983,6 +1983,8 @@ static int omap2_dma_handle_ch(int ch)
1983 1983
1984 dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(ch)); 1984 dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(ch));
1985 dma_write(1 << ch, IRQSTATUS_L0); 1985 dma_write(1 << ch, IRQSTATUS_L0);
1986 /* read back the register to flush the write */
1987 dma_read(IRQSTATUS_L0);
1986 1988
1987 /* If the ch is not chained then chain_id will be -1 */ 1989 /* If the ch is not chained then chain_id will be -1 */
1988 if (dma_chan[ch].chain_id != -1) { 1990 if (dma_chan[ch].chain_id != -1) {
diff --git a/arch/arm/plat-orion/include/plat/pcie.h b/arch/arm/plat-orion/include/plat/pcie.h
index 3ebfef72b4e7..cc99163e73fd 100644
--- a/arch/arm/plat-orion/include/plat/pcie.h
+++ b/arch/arm/plat-orion/include/plat/pcie.h
@@ -11,12 +11,15 @@
11#ifndef __PLAT_PCIE_H 11#ifndef __PLAT_PCIE_H
12#define __PLAT_PCIE_H 12#define __PLAT_PCIE_H
13 13
14struct pci_bus;
15
14u32 orion_pcie_dev_id(void __iomem *base); 16u32 orion_pcie_dev_id(void __iomem *base);
15u32 orion_pcie_rev(void __iomem *base); 17u32 orion_pcie_rev(void __iomem *base);
16int orion_pcie_link_up(void __iomem *base); 18int orion_pcie_link_up(void __iomem *base);
17int orion_pcie_x4_mode(void __iomem *base); 19int orion_pcie_x4_mode(void __iomem *base);
18int orion_pcie_get_local_bus_nr(void __iomem *base); 20int orion_pcie_get_local_bus_nr(void __iomem *base);
19void orion_pcie_set_local_bus_nr(void __iomem *base, int nr); 21void orion_pcie_set_local_bus_nr(void __iomem *base, int nr);
22void orion_pcie_reset(void __iomem *base);
20void orion_pcie_setup(void __iomem *base, 23void orion_pcie_setup(void __iomem *base,
21 struct mbus_dram_target_info *dram); 24 struct mbus_dram_target_info *dram);
22int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus, 25int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus,
diff --git a/arch/arm/plat-orion/pcie.c b/arch/arm/plat-orion/pcie.c
index 779553a1595e..af2d733c50b5 100644
--- a/arch/arm/plat-orion/pcie.c
+++ b/arch/arm/plat-orion/pcie.c
@@ -182,11 +182,6 @@ void __init orion_pcie_setup(void __iomem *base,
182 u32 mask; 182 u32 mask;
183 183
184 /* 184 /*
185 * soft reset PCIe unit
186 */
187 orion_pcie_reset(base);
188
189 /*
190 * Point PCIe unit MBUS decode windows to DRAM space. 185 * Point PCIe unit MBUS decode windows to DRAM space.
191 */ 186 */
192 orion_pcie_setup_wins(base, dram); 187 orion_pcie_setup_wins(base, dram);