diff options
Diffstat (limited to 'arch')
354 files changed, 8445 insertions, 2475 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index 4877a8c8ee16..fe48fc7a3eba 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
@@ -32,8 +32,9 @@ config HAVE_OPROFILE | |||
32 | 32 | ||
33 | config KPROBES | 33 | config KPROBES |
34 | bool "Kprobes" | 34 | bool "Kprobes" |
35 | depends on KALLSYMS && MODULES | 35 | depends on MODULES |
36 | depends on HAVE_KPROBES | 36 | depends on HAVE_KPROBES |
37 | select KALLSYMS | ||
37 | help | 38 | help |
38 | Kprobes allows you to trap at almost any kernel address and | 39 | Kprobes allows you to trap at almost any kernel address and |
39 | execute a callback function. register_kprobe() establishes | 40 | execute a callback function. register_kprobe() establishes |
@@ -45,7 +46,6 @@ config OPTPROBES | |||
45 | def_bool y | 46 | def_bool y |
46 | depends on KPROBES && HAVE_OPTPROBES | 47 | depends on KPROBES && HAVE_OPTPROBES |
47 | depends on !PREEMPT | 48 | depends on !PREEMPT |
48 | select KALLSYMS_ALL | ||
49 | 49 | ||
50 | config HAVE_EFFICIENT_UNALIGNED_ACCESS | 50 | config HAVE_EFFICIENT_UNALIGNED_ACCESS |
51 | bool | 51 | bool |
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S index ab1ee0ab082b..6d159cee5f2f 100644 --- a/arch/alpha/kernel/entry.S +++ b/arch/alpha/kernel/entry.S | |||
@@ -73,8 +73,6 @@ | |||
73 | ldq $20, HAE_REG($19); \ | 73 | ldq $20, HAE_REG($19); \ |
74 | stq $21, HAE_CACHE($19); \ | 74 | stq $21, HAE_CACHE($19); \ |
75 | stq $21, 0($20); \ | 75 | stq $21, 0($20); \ |
76 | ldq $0, 0($sp); \ | ||
77 | ldq $1, 8($sp); \ | ||
78 | 99:; \ | 76 | 99:; \ |
79 | ldq $19, 72($sp); \ | 77 | ldq $19, 72($sp); \ |
80 | ldq $20, 80($sp); \ | 78 | ldq $20, 80($sp); \ |
@@ -316,7 +314,7 @@ ret_from_sys_call: | |||
316 | cmovne $26, 0, $19 /* $19 = 0 => non-restartable */ | 314 | cmovne $26, 0, $19 /* $19 = 0 => non-restartable */ |
317 | ldq $0, SP_OFF($sp) | 315 | ldq $0, SP_OFF($sp) |
318 | and $0, 8, $0 | 316 | and $0, 8, $0 |
319 | beq $0, restore_all | 317 | beq $0, ret_to_kernel |
320 | ret_to_user: | 318 | ret_to_user: |
321 | /* Make sure need_resched and sigpending don't change between | 319 | /* Make sure need_resched and sigpending don't change between |
322 | sampling and the rti. */ | 320 | sampling and the rti. */ |
@@ -329,6 +327,11 @@ restore_all: | |||
329 | RESTORE_ALL | 327 | RESTORE_ALL |
330 | call_pal PAL_rti | 328 | call_pal PAL_rti |
331 | 329 | ||
330 | ret_to_kernel: | ||
331 | lda $16, 7 | ||
332 | call_pal PAL_swpipl | ||
333 | br restore_all | ||
334 | |||
332 | .align 3 | 335 | .align 3 |
333 | $syscall_error: | 336 | $syscall_error: |
334 | /* | 337 | /* |
@@ -657,7 +660,7 @@ kernel_thread: | |||
657 | /* We don't actually care for a3 success widgetry in the kernel. | 660 | /* We don't actually care for a3 success widgetry in the kernel. |
658 | Not for positive errno values. */ | 661 | Not for positive errno values. */ |
659 | stq $0, 0($sp) /* $0 */ | 662 | stq $0, 0($sp) /* $0 */ |
660 | br restore_all | 663 | br ret_to_kernel |
661 | .end kernel_thread | 664 | .end kernel_thread |
662 | 665 | ||
663 | /* | 666 | /* |
@@ -912,15 +915,6 @@ sys_execve: | |||
912 | .end sys_execve | 915 | .end sys_execve |
913 | 916 | ||
914 | .align 4 | 917 | .align 4 |
915 | .globl osf_sigprocmask | ||
916 | .ent osf_sigprocmask | ||
917 | osf_sigprocmask: | ||
918 | .prologue 0 | ||
919 | mov $sp, $18 | ||
920 | jmp $31, sys_osf_sigprocmask | ||
921 | .end osf_sigprocmask | ||
922 | |||
923 | .align 4 | ||
924 | .globl alpha_ni_syscall | 918 | .globl alpha_ni_syscall |
925 | .ent alpha_ni_syscall | 919 | .ent alpha_ni_syscall |
926 | alpha_ni_syscall: | 920 | alpha_ni_syscall: |
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 842dba308eab..3ec35066f1dc 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -356,7 +356,7 @@ dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt, struct thread_info *ti) | |||
356 | dest[27] = pt->r27; | 356 | dest[27] = pt->r27; |
357 | dest[28] = pt->r28; | 357 | dest[28] = pt->r28; |
358 | dest[29] = pt->gp; | 358 | dest[29] = pt->gp; |
359 | dest[30] = rdusp(); | 359 | dest[30] = ti == current_thread_info() ? rdusp() : ti->pcb.usp; |
360 | dest[31] = pt->pc; | 360 | dest[31] = pt->pc; |
361 | 361 | ||
362 | /* Once upon a time this was the PS value. Which is stupid | 362 | /* Once upon a time this was the PS value. Which is stupid |
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c index 0f6b51ae865a..6f7feb5db271 100644 --- a/arch/alpha/kernel/signal.c +++ b/arch/alpha/kernel/signal.c | |||
@@ -41,46 +41,20 @@ static void do_signal(struct pt_regs *, struct switch_stack *, | |||
41 | /* | 41 | /* |
42 | * The OSF/1 sigprocmask calling sequence is different from the | 42 | * The OSF/1 sigprocmask calling sequence is different from the |
43 | * C sigprocmask() sequence.. | 43 | * C sigprocmask() sequence.. |
44 | * | ||
45 | * how: | ||
46 | * 1 - SIG_BLOCK | ||
47 | * 2 - SIG_UNBLOCK | ||
48 | * 3 - SIG_SETMASK | ||
49 | * | ||
50 | * We change the range to -1 .. 1 in order to let gcc easily | ||
51 | * use the conditional move instructions. | ||
52 | * | ||
53 | * Note that we don't need to acquire the kernel lock for SMP | ||
54 | * operation, as all of this is local to this thread. | ||
55 | */ | 44 | */ |
56 | SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask, | 45 | SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask) |
57 | struct pt_regs *, regs) | ||
58 | { | 46 | { |
59 | unsigned long oldmask = -EINVAL; | 47 | sigset_t oldmask; |
60 | 48 | sigset_t mask; | |
61 | if ((unsigned long)how-1 <= 2) { | 49 | unsigned long res; |
62 | long sign = how-2; /* -1 .. 1 */ | 50 | |
63 | unsigned long block, unblock; | 51 | siginitset(&mask, newmask & _BLOCKABLE); |
64 | 52 | res = sigprocmask(how, &mask, &oldmask); | |
65 | newmask &= _BLOCKABLE; | 53 | if (!res) { |
66 | spin_lock_irq(¤t->sighand->siglock); | 54 | force_successful_syscall_return(); |
67 | oldmask = current->blocked.sig[0]; | 55 | res = oldmask.sig[0]; |
68 | |||
69 | unblock = oldmask & ~newmask; | ||
70 | block = oldmask | newmask; | ||
71 | if (!sign) | ||
72 | block = unblock; | ||
73 | if (sign <= 0) | ||
74 | newmask = block; | ||
75 | if (_NSIG_WORDS > 1 && sign > 0) | ||
76 | sigemptyset(¤t->blocked); | ||
77 | current->blocked.sig[0] = newmask; | ||
78 | recalc_sigpending(); | ||
79 | spin_unlock_irq(¤t->sighand->siglock); | ||
80 | |||
81 | regs->r0 = 0; /* special no error return */ | ||
82 | } | 56 | } |
83 | return oldmask; | 57 | return res; |
84 | } | 58 | } |
85 | 59 | ||
86 | SYSCALL_DEFINE3(osf_sigaction, int, sig, | 60 | SYSCALL_DEFINE3(osf_sigaction, int, sig, |
@@ -94,9 +68,9 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig, | |||
94 | old_sigset_t mask; | 68 | old_sigset_t mask; |
95 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | 69 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || |
96 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | 70 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || |
97 | __get_user(new_ka.sa.sa_flags, &act->sa_flags)) | 71 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || |
72 | __get_user(mask, &act->sa_mask)) | ||
98 | return -EFAULT; | 73 | return -EFAULT; |
99 | __get_user(mask, &act->sa_mask); | ||
100 | siginitset(&new_ka.sa.sa_mask, mask); | 74 | siginitset(&new_ka.sa.sa_mask, mask); |
101 | new_ka.ka_restorer = NULL; | 75 | new_ka.ka_restorer = NULL; |
102 | } | 76 | } |
@@ -106,9 +80,9 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig, | |||
106 | if (!ret && oact) { | 80 | if (!ret && oact) { |
107 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | 81 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || |
108 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | 82 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || |
109 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags)) | 83 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || |
84 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
110 | return -EFAULT; | 85 | return -EFAULT; |
111 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); | ||
112 | } | 86 | } |
113 | 87 | ||
114 | return ret; | 88 | return ret; |
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S index ce594ef533cc..a6a1de9db16f 100644 --- a/arch/alpha/kernel/systbls.S +++ b/arch/alpha/kernel/systbls.S | |||
@@ -58,7 +58,7 @@ sys_call_table: | |||
58 | .quad sys_open /* 45 */ | 58 | .quad sys_open /* 45 */ |
59 | .quad alpha_ni_syscall | 59 | .quad alpha_ni_syscall |
60 | .quad sys_getxgid | 60 | .quad sys_getxgid |
61 | .quad osf_sigprocmask | 61 | .quad sys_osf_sigprocmask |
62 | .quad alpha_ni_syscall | 62 | .quad alpha_ni_syscall |
63 | .quad alpha_ni_syscall /* 50 */ | 63 | .quad alpha_ni_syscall /* 50 */ |
64 | .quad sys_acct | 64 | .quad sys_acct |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 553b7cf17bfb..7949fe65ecd4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -271,7 +271,6 @@ config ARCH_AT91 | |||
271 | bool "Atmel AT91" | 271 | bool "Atmel AT91" |
272 | select ARCH_REQUIRE_GPIOLIB | 272 | select ARCH_REQUIRE_GPIOLIB |
273 | select HAVE_CLK | 273 | select HAVE_CLK |
274 | select ARCH_USES_GETTIMEOFFSET | ||
275 | help | 274 | help |
276 | This enables support for systems based on the Atmel AT91RM9200, | 275 | This enables support for systems based on the Atmel AT91RM9200, |
277 | AT91SAM9 and AT91CAP9 processors. | 276 | AT91SAM9 and AT91CAP9 processors. |
@@ -511,6 +510,7 @@ config ARCH_MMP | |||
511 | select GENERIC_CLOCKEVENTS | 510 | select GENERIC_CLOCKEVENTS |
512 | select TICK_ONESHOT | 511 | select TICK_ONESHOT |
513 | select PLAT_PXA | 512 | select PLAT_PXA |
513 | select SPARSE_IRQ | ||
514 | help | 514 | help |
515 | Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line. | 515 | Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line. |
516 | 516 | ||
@@ -588,6 +588,7 @@ config ARCH_PXA | |||
588 | select GENERIC_CLOCKEVENTS | 588 | select GENERIC_CLOCKEVENTS |
589 | select TICK_ONESHOT | 589 | select TICK_ONESHOT |
590 | select PLAT_PXA | 590 | select PLAT_PXA |
591 | select SPARSE_IRQ | ||
591 | help | 592 | help |
592 | Support for Intel/Marvell's PXA2xx/PXA3xx processor line. | 593 | Support for Intel/Marvell's PXA2xx/PXA3xx processor line. |
593 | 594 | ||
@@ -748,6 +749,15 @@ config ARCH_SHARK | |||
748 | Support for the StrongARM based Digital DNARD machine, also known | 749 | Support for the StrongARM based Digital DNARD machine, also known |
749 | as "Shark" (<http://www.shark-linux.de/shark.html>). | 750 | as "Shark" (<http://www.shark-linux.de/shark.html>). |
750 | 751 | ||
752 | config ARCH_TCC_926 | ||
753 | bool "Telechips TCC ARM926-based systems" | ||
754 | select CPU_ARM926T | ||
755 | select HAVE_CLK | ||
756 | select COMMON_CLKDEV | ||
757 | select GENERIC_CLOCKEVENTS | ||
758 | help | ||
759 | Support for Telechips TCC ARM926-based systems. | ||
760 | |||
751 | config ARCH_LH7A40X | 761 | config ARCH_LH7A40X |
752 | bool "Sharp LH7A40X" | 762 | bool "Sharp LH7A40X" |
753 | select CPU_ARM922T | 763 | select CPU_ARM922T |
@@ -916,6 +926,8 @@ source "arch/arm/plat-s5p/Kconfig" | |||
916 | 926 | ||
917 | source "arch/arm/plat-spear/Kconfig" | 927 | source "arch/arm/plat-spear/Kconfig" |
918 | 928 | ||
929 | source "arch/arm/plat-tcc/Kconfig" | ||
930 | |||
919 | if ARCH_S3C2410 | 931 | if ARCH_S3C2410 |
920 | source "arch/arm/mach-s3c2400/Kconfig" | 932 | source "arch/arm/mach-s3c2400/Kconfig" |
921 | source "arch/arm/mach-s3c2410/Kconfig" | 933 | source "arch/arm/mach-s3c2410/Kconfig" |
@@ -1051,6 +1063,32 @@ config ARM_ERRATA_460075 | |||
1051 | ACTLR register. Note that setting specific bits in the ACTLR register | 1063 | ACTLR register. Note that setting specific bits in the ACTLR register |
1052 | may not be available in non-secure mode. | 1064 | may not be available in non-secure mode. |
1053 | 1065 | ||
1066 | config ARM_ERRATA_742230 | ||
1067 | bool "ARM errata: DMB operation may be faulty" | ||
1068 | depends on CPU_V7 && SMP | ||
1069 | help | ||
1070 | This option enables the workaround for the 742230 Cortex-A9 | ||
1071 | (r1p0..r2p2) erratum. Under rare circumstances, a DMB instruction | ||
1072 | between two write operations may not ensure the correct visibility | ||
1073 | ordering of the two writes. This workaround sets a specific bit in | ||
1074 | the diagnostic register of the Cortex-A9 which causes the DMB | ||
1075 | instruction to behave as a DSB, ensuring the correct behaviour of | ||
1076 | the two writes. | ||
1077 | |||
1078 | config ARM_ERRATA_742231 | ||
1079 | bool "ARM errata: Incorrect hazard handling in the SCU may lead to data corruption" | ||
1080 | depends on CPU_V7 && SMP | ||
1081 | help | ||
1082 | This option enables the workaround for the 742231 Cortex-A9 | ||
1083 | (r2p0..r2p2) erratum. Under certain conditions, specific to the | ||
1084 | Cortex-A9 MPCore micro-architecture, two CPUs working in SMP mode, | ||
1085 | accessing some data located in the same cache line, may get corrupted | ||
1086 | data due to bad handling of the address hazard when the line gets | ||
1087 | replaced from one of the CPUs at the same time as another CPU is | ||
1088 | accessing it. This workaround sets specific bits in the diagnostic | ||
1089 | register of the Cortex-A9 which reduces the linefill issuing | ||
1090 | capabilities of the processor. | ||
1091 | |||
1054 | config PL310_ERRATA_588369 | 1092 | config PL310_ERRATA_588369 |
1055 | bool "Clean & Invalidate maintenance operations do not invalidate clean lines" | 1093 | bool "Clean & Invalidate maintenance operations do not invalidate clean lines" |
1056 | depends on CACHE_L2X0 && ARCH_OMAP4 | 1094 | depends on CACHE_L2X0 && ARCH_OMAP4 |
@@ -1438,6 +1476,20 @@ config UACCESS_WITH_MEMCPY | |||
1438 | However, if the CPU data cache is using a write-allocate mode, | 1476 | However, if the CPU data cache is using a write-allocate mode, |
1439 | this option is unlikely to provide any performance gain. | 1477 | this option is unlikely to provide any performance gain. |
1440 | 1478 | ||
1479 | config SECCOMP | ||
1480 | bool | ||
1481 | prompt "Enable seccomp to safely compute untrusted bytecode" | ||
1482 | ---help--- | ||
1483 | This kernel feature is useful for number crunching applications | ||
1484 | that may need to compute untrusted bytecode during their | ||
1485 | execution. By using pipes or other transports made available to | ||
1486 | the process as file descriptors supporting the read/write | ||
1487 | syscalls, it's possible to isolate those applications in | ||
1488 | their own address space using seccomp. Once seccomp is | ||
1489 | enabled via prctl(PR_SET_SECCOMP), it cannot be disabled | ||
1490 | and the task is only allowed to execute a few safe syscalls | ||
1491 | defined by each seccomp mode. | ||
1492 | |||
1441 | config CC_STACKPROTECTOR | 1493 | config CC_STACKPROTECTOR |
1442 | bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" | 1494 | bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" |
1443 | help | 1495 | help |
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 91344af75f39..c29fb382aeee 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -2,6 +2,20 @@ menu "Kernel hacking" | |||
2 | 2 | ||
3 | source "lib/Kconfig.debug" | 3 | source "lib/Kconfig.debug" |
4 | 4 | ||
5 | config STRICT_DEVMEM | ||
6 | bool "Filter access to /dev/mem" | ||
7 | depends on MMU | ||
8 | ---help--- | ||
9 | If this option is disabled, you allow userspace (root) access to all | ||
10 | of memory, including kernel and userspace memory. Accidental | ||
11 | access to this is obviously disastrous, but specific access can | ||
12 | be used by people debugging the kernel. | ||
13 | |||
14 | If this option is switched on, the /dev/mem file only allows | ||
15 | userspace access to memory mapped peripherals. | ||
16 | |||
17 | If in doubt, say Y. | ||
18 | |||
5 | # RMK wants arm kernels compiled with frame pointers or stack unwinding. | 19 | # RMK wants arm kernels compiled with frame pointers or stack unwinding. |
6 | # If you know what you are doing and are willing to live without stack | 20 | # If you know what you are doing and are willing to live without stack |
7 | # traces, you can get a slightly smaller kernel by setting this option to | 21 | # traces, you can get a slightly smaller kernel by setting this option to |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 59c1ce858fc8..502255905c4e 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -183,6 +183,7 @@ machine-$(CONFIG_ARCH_SHARK) := shark | |||
183 | machine-$(CONFIG_ARCH_SHMOBILE) := shmobile | 183 | machine-$(CONFIG_ARCH_SHMOBILE) := shmobile |
184 | machine-$(CONFIG_ARCH_STMP378X) := stmp378x | 184 | machine-$(CONFIG_ARCH_STMP378X) := stmp378x |
185 | machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx | 185 | machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx |
186 | machine-$(CONFIG_ARCH_TCC8K) := tcc8k | ||
186 | machine-$(CONFIG_ARCH_TEGRA) := tegra | 187 | machine-$(CONFIG_ARCH_TEGRA) := tegra |
187 | machine-$(CONFIG_ARCH_U300) := u300 | 188 | machine-$(CONFIG_ARCH_U300) := u300 |
188 | machine-$(CONFIG_ARCH_U8500) := ux500 | 189 | machine-$(CONFIG_ARCH_U8500) := ux500 |
@@ -202,6 +203,7 @@ plat-$(CONFIG_ARCH_MXC) := mxc | |||
202 | plat-$(CONFIG_ARCH_OMAP) := omap | 203 | plat-$(CONFIG_ARCH_OMAP) := omap |
203 | plat-$(CONFIG_ARCH_S3C64XX) := samsung | 204 | plat-$(CONFIG_ARCH_S3C64XX) := samsung |
204 | plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx | 205 | plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx |
206 | plat-$(CONFIG_ARCH_TCC_926) := tcc | ||
205 | plat-$(CONFIG_PLAT_IOP) := iop | 207 | plat-$(CONFIG_PLAT_IOP) := iop |
206 | plat-$(CONFIG_PLAT_NOMADIK) := nomadik | 208 | plat-$(CONFIG_PLAT_NOMADIK) := nomadik |
207 | plat-$(CONFIG_PLAT_ORION) := orion | 209 | plat-$(CONFIG_PLAT_ORION) := orion |
@@ -245,13 +247,14 @@ ifeq ($(FASTFPE),$(wildcard $(FASTFPE))) | |||
245 | FASTFPE_OBJ :=$(FASTFPE)/ | 247 | FASTFPE_OBJ :=$(FASTFPE)/ |
246 | endif | 248 | endif |
247 | 249 | ||
248 | # If we have a machine-specific directory, then include it in the build. | ||
249 | core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/ | ||
250 | core-y += $(machdirs) $(platdirs) | ||
251 | core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/ | 250 | core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/ |
252 | core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ) | 251 | core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ) |
253 | core-$(CONFIG_VFP) += arch/arm/vfp/ | 252 | core-$(CONFIG_VFP) += arch/arm/vfp/ |
254 | 253 | ||
254 | # If we have a machine-specific directory, then include it in the build. | ||
255 | core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/ | ||
256 | core-y += $(machdirs) $(platdirs) | ||
257 | |||
255 | drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/ | 258 | drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/ |
256 | 259 | ||
257 | libs-y := arch/arm/lib/ $(libs-y) | 260 | libs-y := arch/arm/lib/ $(libs-y) |
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index b23f6bc46cfa..65a7c1c588a9 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
@@ -116,5 +116,5 @@ CFLAGS_font.o := -Dstatic= | |||
116 | $(obj)/font.c: $(FONTC) | 116 | $(obj)/font.c: $(FONTC) |
117 | $(call cmd,shipped) | 117 | $(call cmd,shipped) |
118 | 118 | ||
119 | $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config | 119 | $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG) |
120 | @sed "$(SEDFLAGS)" < $< > $@ | 120 | @sed "$(SEDFLAGS)" < $< > $@ |
diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c index 7974baacafce..1bec96e85196 100644 --- a/arch/arm/common/it8152.c +++ b/arch/arm/common/it8152.c | |||
@@ -271,6 +271,14 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size) | |||
271 | ((dma_addr + size - PHYS_OFFSET) >= SZ_64M); | 271 | ((dma_addr + size - PHYS_OFFSET) >= SZ_64M); |
272 | } | 272 | } |
273 | 273 | ||
274 | int dma_set_coherent_mask(struct device *dev, u64 mask) | ||
275 | { | ||
276 | if (mask >= PHYS_OFFSET + SZ_64M - 1) | ||
277 | return 0; | ||
278 | |||
279 | return -EIO; | ||
280 | } | ||
281 | |||
274 | int __init it8152_pci_setup(int nr, struct pci_sys_data *sys) | 282 | int __init it8152_pci_setup(int nr, struct pci_sys_data *sys) |
275 | { | 283 | { |
276 | it8152_io.start = IT8152_IO_BASE + 0x12000; | 284 | it8152_io.start = IT8152_IO_BASE + 0x12000; |
diff --git a/arch/arm/configs/at91sam9g20ek_defconfig b/arch/arm/configs/at91sam9g20ek_defconfig index f1bac70d6ce9..9e90e6d79297 100644 --- a/arch/arm/configs/at91sam9g20ek_defconfig +++ b/arch/arm/configs/at91sam9g20ek_defconfig | |||
@@ -13,6 +13,7 @@ CONFIG_MODULE_UNLOAD=y | |||
13 | CONFIG_ARCH_AT91=y | 13 | CONFIG_ARCH_AT91=y |
14 | CONFIG_ARCH_AT91SAM9G20=y | 14 | CONFIG_ARCH_AT91SAM9G20=y |
15 | CONFIG_MACH_AT91SAM9G20EK=y | 15 | CONFIG_MACH_AT91SAM9G20EK=y |
16 | CONFIG_MACH_AT91SAM9G20EK_2MMC=y | ||
16 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | 17 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y |
17 | # CONFIG_ARM_THUMB is not set | 18 | # CONFIG_ARM_THUMB is not set |
18 | CONFIG_AEABI=y | 19 | CONFIG_AEABI=y |
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig index ccc9c9959b82..2f7042813765 100644 --- a/arch/arm/configs/kirkwood_defconfig +++ b/arch/arm/configs/kirkwood_defconfig | |||
@@ -15,6 +15,7 @@ CONFIG_MACH_MV88F6281GTW_GE=y | |||
15 | CONFIG_MACH_SHEEVAPLUG=y | 15 | CONFIG_MACH_SHEEVAPLUG=y |
16 | CONFIG_MACH_ESATA_SHEEVAPLUG=y | 16 | CONFIG_MACH_ESATA_SHEEVAPLUG=y |
17 | CONFIG_MACH_GURUPLUG=y | 17 | CONFIG_MACH_GURUPLUG=y |
18 | CONFIG_MACH_DOCKSTAR=y | ||
18 | CONFIG_MACH_TS219=y | 19 | CONFIG_MACH_TS219=y |
19 | CONFIG_MACH_TS41X=y | 20 | CONFIG_MACH_TS41X=y |
20 | CONFIG_MACH_OPENRD_BASE=y | 21 | CONFIG_MACH_OPENRD_BASE=y |
diff --git a/arch/arm/configs/mx27_defconfig b/arch/arm/configs/mx27_defconfig index b2038b0e266f..813cfb366c18 100644 --- a/arch/arm/configs/mx27_defconfig +++ b/arch/arm/configs/mx27_defconfig | |||
@@ -21,8 +21,14 @@ CONFIG_ARCH_MX2=y | |||
21 | CONFIG_MACH_MX27=y | 21 | CONFIG_MACH_MX27=y |
22 | CONFIG_MACH_MX27ADS=y | 22 | CONFIG_MACH_MX27ADS=y |
23 | CONFIG_MACH_PCM038=y | 23 | CONFIG_MACH_PCM038=y |
24 | CONFIG_MACH_CPUIMX27=y | ||
25 | CONFIG_MACH_EUKREA_CPUIMX27_USESDHC2=y | ||
26 | CONFIG_MACH_EUKREA_CPUIMX27_USEUART4=y | ||
24 | CONFIG_MACH_MX27_3DS=y | 27 | CONFIG_MACH_MX27_3DS=y |
28 | CONFIG_MACH_IMX27_VISSTRIM_M10=y | ||
25 | CONFIG_MACH_IMX27LITE=y | 29 | CONFIG_MACH_IMX27LITE=y |
30 | CONFIG_MACH_PCA100=y | ||
31 | CONFIG_MACH_MXT_TD60=y | ||
26 | CONFIG_MXC_IRQ_PRIOR=y | 32 | CONFIG_MXC_IRQ_PRIOR=y |
27 | CONFIG_MXC_PWM=y | 33 | CONFIG_MXC_PWM=y |
28 | CONFIG_NO_HZ=y | 34 | CONFIG_NO_HZ=y |
@@ -76,7 +82,9 @@ CONFIG_INPUT_EVDEV=y | |||
76 | # CONFIG_INPUT_KEYBOARD is not set | 82 | # CONFIG_INPUT_KEYBOARD is not set |
77 | # CONFIG_INPUT_MOUSE is not set | 83 | # CONFIG_INPUT_MOUSE is not set |
78 | CONFIG_INPUT_TOUCHSCREEN=y | 84 | CONFIG_INPUT_TOUCHSCREEN=y |
85 | CONFIG_TOUCHSCREEN_ADS7846=m | ||
79 | # CONFIG_SERIO is not set | 86 | # CONFIG_SERIO is not set |
87 | CONFIG_SERIAL_8250=m | ||
80 | CONFIG_SERIAL_IMX=y | 88 | CONFIG_SERIAL_IMX=y |
81 | CONFIG_SERIAL_IMX_CONSOLE=y | 89 | CONFIG_SERIAL_IMX_CONSOLE=y |
82 | # CONFIG_LEGACY_PTYS is not set | 90 | # CONFIG_LEGACY_PTYS is not set |
@@ -85,19 +93,20 @@ CONFIG_I2C=y | |||
85 | CONFIG_I2C_CHARDEV=y | 93 | CONFIG_I2C_CHARDEV=y |
86 | CONFIG_I2C_IMX=y | 94 | CONFIG_I2C_IMX=y |
87 | CONFIG_SPI=y | 95 | CONFIG_SPI=y |
88 | CONFIG_SPI_BITBANG=y | 96 | CONFIG_SPI_IMX=y |
89 | CONFIG_W1=y | 97 | CONFIG_W1=y |
90 | CONFIG_W1_MASTER_MXC=y | 98 | CONFIG_W1_MASTER_MXC=y |
91 | CONFIG_W1_SLAVE_THERM=y | 99 | CONFIG_W1_SLAVE_THERM=y |
92 | # CONFIG_HWMON is not set | 100 | # CONFIG_HWMON is not set |
93 | CONFIG_FB=y | 101 | CONFIG_FB=y |
94 | CONFIG_FB_IMX=y | 102 | CONFIG_FB_IMX=y |
95 | # CONFIG_VGA_CONSOLE is not set | ||
96 | CONFIG_FRAMEBUFFER_CONSOLE=y | 103 | CONFIG_FRAMEBUFFER_CONSOLE=y |
97 | CONFIG_FONTS=y | 104 | CONFIG_FONTS=y |
98 | CONFIG_FONT_8x8=y | 105 | CONFIG_FONT_8x8=y |
99 | # CONFIG_HID_SUPPORT is not set | 106 | # CONFIG_HID_SUPPORT is not set |
100 | # CONFIG_USB_SUPPORT is not set | 107 | CONFIG_USB=m |
108 | # CONFIG_USB_DEVICE_CLASS is not set | ||
109 | CONFIG_USB_ULPI=y | ||
101 | CONFIG_MMC=y | 110 | CONFIG_MMC=y |
102 | CONFIG_MMC_MXC=y | 111 | CONFIG_MMC_MXC=y |
103 | CONFIG_RTC_CLASS=y | 112 | CONFIG_RTC_CLASS=y |
diff --git a/arch/arm/configs/mx31pdk_defconfig b/arch/arm/configs/mx31pdk_defconfig deleted file mode 100644 index 2d29329749e4..000000000000 --- a/arch/arm/configs/mx31pdk_defconfig +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | # CONFIG_LOCALVERSION_AUTO is not set | ||
2 | # CONFIG_SWAP is not set | ||
3 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
4 | # CONFIG_COMPAT_BRK is not set | ||
5 | # CONFIG_IOSCHED_DEADLINE is not set | ||
6 | # CONFIG_IOSCHED_CFQ is not set | ||
7 | CONFIG_ARCH_MXC=y | ||
8 | # CONFIG_MACH_MX31ADS is not set | ||
9 | CONFIG_MACH_MX31_3DS=y | ||
10 | CONFIG_AEABI=y | ||
11 | CONFIG_NET=y | ||
12 | CONFIG_PACKET=y | ||
13 | CONFIG_UNIX=y | ||
14 | CONFIG_NET_KEY=y | ||
15 | CONFIG_INET=y | ||
16 | CONFIG_IP_PNP=y | ||
17 | CONFIG_IP_PNP_DHCP=y | ||
18 | # CONFIG_INET_LRO is not set | ||
19 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
20 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | ||
21 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
22 | # CONFIG_BLK_DEV is not set | ||
23 | # CONFIG_MISC_DEVICES is not set | ||
24 | CONFIG_NETDEVICES=y | ||
25 | CONFIG_NET_ETHERNET=y | ||
26 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
27 | # CONFIG_INPUT_KEYBOARD is not set | ||
28 | # CONFIG_INPUT_MOUSE is not set | ||
29 | # CONFIG_SERIO is not set | ||
30 | # CONFIG_DEVKMEM is not set | ||
31 | CONFIG_SERIAL_IMX=y | ||
32 | CONFIG_SERIAL_IMX_CONSOLE=y | ||
33 | # CONFIG_LEGACY_PTYS is not set | ||
34 | # CONFIG_HW_RANDOM is not set | ||
35 | # CONFIG_HWMON is not set | ||
36 | # CONFIG_VGA_CONSOLE is not set | ||
37 | # CONFIG_HID_SUPPORT is not set | ||
38 | # CONFIG_USB_SUPPORT is not set | ||
39 | # CONFIG_DNOTIFY is not set | ||
40 | # CONFIG_ENABLE_WARN_DEPRECATED is not set | ||
41 | # CONFIG_ENABLE_MUST_CHECK is not set | ||
42 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
43 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | ||
44 | # CONFIG_CRC32 is not set | ||
diff --git a/arch/arm/configs/mx3_defconfig b/arch/arm/configs/mx3_defconfig index 161f907b611f..f0c339fd5d21 100644 --- a/arch/arm/configs/mx3_defconfig +++ b/arch/arm/configs/mx3_defconfig | |||
@@ -24,6 +24,7 @@ CONFIG_MACH_PCM043=y | |||
24 | CONFIG_MACH_ARMADILLO5X0=y | 24 | CONFIG_MACH_ARMADILLO5X0=y |
25 | CONFIG_MACH_MX35_3DS=y | 25 | CONFIG_MACH_MX35_3DS=y |
26 | CONFIG_MACH_KZM_ARM11_01=y | 26 | CONFIG_MACH_KZM_ARM11_01=y |
27 | CONFIG_MACH_EUKREA_CPUIMX35=y | ||
27 | CONFIG_MXC_IRQ_PRIOR=y | 28 | CONFIG_MXC_IRQ_PRIOR=y |
28 | CONFIG_MXC_PWM=y | 29 | CONFIG_MXC_PWM=y |
29 | CONFIG_NO_HZ=y | 30 | CONFIG_NO_HZ=y |
@@ -108,7 +109,6 @@ CONFIG_MMC=y | |||
108 | CONFIG_MMC_MXC=y | 109 | CONFIG_MMC_MXC=y |
109 | CONFIG_DMADEVICES=y | 110 | CONFIG_DMADEVICES=y |
110 | # CONFIG_DNOTIFY is not set | 111 | # CONFIG_DNOTIFY is not set |
111 | CONFIG_INOTIFY=y | ||
112 | CONFIG_TMPFS=y | 112 | CONFIG_TMPFS=y |
113 | CONFIG_JFFS2_FS=y | 113 | CONFIG_JFFS2_FS=y |
114 | CONFIG_UBIFS_FS=y | 114 | CONFIG_UBIFS_FS=y |
diff --git a/arch/arm/configs/mx51_defconfig b/arch/arm/configs/mx51_defconfig index a665ecbbe2bc..163cfee7644c 100644 --- a/arch/arm/configs/mx51_defconfig +++ b/arch/arm/configs/mx51_defconfig | |||
@@ -15,6 +15,8 @@ CONFIG_MODULE_SRCVERSION_ALL=y | |||
15 | CONFIG_ARCH_MXC=y | 15 | CONFIG_ARCH_MXC=y |
16 | CONFIG_ARCH_MX5=y | 16 | CONFIG_ARCH_MX5=y |
17 | CONFIG_MACH_MX51_BABBAGE=y | 17 | CONFIG_MACH_MX51_BABBAGE=y |
18 | CONFIG_MACH_MX51_3DS=y | ||
19 | CONFIG_MACH_EUKREA_CPUIMX51=y | ||
18 | CONFIG_NO_HZ=y | 20 | CONFIG_NO_HZ=y |
19 | CONFIG_HIGH_RES_TIMERS=y | 21 | CONFIG_HIGH_RES_TIMERS=y |
20 | CONFIG_PREEMPT_VOLUNTARY=y | 22 | CONFIG_PREEMPT_VOLUNTARY=y |
@@ -69,7 +71,6 @@ CONFIG_REALTEK_PHY=y | |||
69 | CONFIG_NATIONAL_PHY=y | 71 | CONFIG_NATIONAL_PHY=y |
70 | CONFIG_STE10XP=y | 72 | CONFIG_STE10XP=y |
71 | CONFIG_LSI_ET1011C_PHY=y | 73 | CONFIG_LSI_ET1011C_PHY=y |
72 | CONFIG_FIXED_PHY=y | ||
73 | CONFIG_MDIO_BITBANG=y | 74 | CONFIG_MDIO_BITBANG=y |
74 | CONFIG_MDIO_GPIO=y | 75 | CONFIG_MDIO_GPIO=y |
75 | CONFIG_NET_ETHERNET=y | 76 | CONFIG_NET_ETHERNET=y |
@@ -100,7 +101,6 @@ CONFIG_I2C_ALGOPCF=m | |||
100 | CONFIG_I2C_ALGOPCA=m | 101 | CONFIG_I2C_ALGOPCA=m |
101 | CONFIG_GPIO_SYSFS=y | 102 | CONFIG_GPIO_SYSFS=y |
102 | # CONFIG_HWMON is not set | 103 | # CONFIG_HWMON is not set |
103 | # CONFIG_VGA_CONSOLE is not set | ||
104 | # CONFIG_HID_SUPPORT is not set | 104 | # CONFIG_HID_SUPPORT is not set |
105 | CONFIG_USB=y | 105 | CONFIG_USB=y |
106 | CONFIG_USB_EHCI_HCD=y | 106 | CONFIG_USB_EHCI_HCD=y |
@@ -117,13 +117,11 @@ CONFIG_EXT2_FS_XATTR=y | |||
117 | CONFIG_EXT2_FS_POSIX_ACL=y | 117 | CONFIG_EXT2_FS_POSIX_ACL=y |
118 | CONFIG_EXT2_FS_SECURITY=y | 118 | CONFIG_EXT2_FS_SECURITY=y |
119 | CONFIG_EXT3_FS=y | 119 | CONFIG_EXT3_FS=y |
120 | CONFIG_EXT3_DEFAULTS_TO_ORDERED=y | ||
121 | CONFIG_EXT3_FS_POSIX_ACL=y | 120 | CONFIG_EXT3_FS_POSIX_ACL=y |
122 | CONFIG_EXT3_FS_SECURITY=y | 121 | CONFIG_EXT3_FS_SECURITY=y |
123 | CONFIG_EXT4_FS=y | 122 | CONFIG_EXT4_FS=y |
124 | CONFIG_EXT4_FS_POSIX_ACL=y | 123 | CONFIG_EXT4_FS_POSIX_ACL=y |
125 | CONFIG_EXT4_FS_SECURITY=y | 124 | CONFIG_EXT4_FS_SECURITY=y |
126 | CONFIG_INOTIFY=y | ||
127 | CONFIG_QUOTA=y | 125 | CONFIG_QUOTA=y |
128 | CONFIG_QUOTA_NETLINK_INTERFACE=y | 126 | CONFIG_QUOTA_NETLINK_INTERFACE=y |
129 | # CONFIG_PRINT_QUOTA_WARNING is not set | 127 | # CONFIG_PRINT_QUOTA_WARNING is not set |
@@ -136,6 +134,7 @@ CONFIG_ZISOFS=y | |||
136 | CONFIG_UDF_FS=m | 134 | CONFIG_UDF_FS=m |
137 | CONFIG_MSDOS_FS=m | 135 | CONFIG_MSDOS_FS=m |
138 | CONFIG_VFAT_FS=y | 136 | CONFIG_VFAT_FS=y |
137 | CONFIG_TMPFS=y | ||
139 | CONFIG_CONFIGFS_FS=m | 138 | CONFIG_CONFIGFS_FS=m |
140 | CONFIG_NFS_FS=y | 139 | CONFIG_NFS_FS=y |
141 | CONFIG_NFS_V3=y | 140 | CONFIG_NFS_V3=y |
@@ -151,7 +150,6 @@ CONFIG_NLS_UTF8=y | |||
151 | CONFIG_MAGIC_SYSRQ=y | 150 | CONFIG_MAGIC_SYSRQ=y |
152 | CONFIG_DEBUG_FS=y | 151 | CONFIG_DEBUG_FS=y |
153 | CONFIG_DEBUG_KERNEL=y | 152 | CONFIG_DEBUG_KERNEL=y |
154 | # CONFIG_DETECT_SOFTLOCKUP is not set | ||
155 | # CONFIG_SCHED_DEBUG is not set | 153 | # CONFIG_SCHED_DEBUG is not set |
156 | # CONFIG_DEBUG_BUGVERBOSE is not set | 154 | # CONFIG_DEBUG_BUGVERBOSE is not set |
157 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | 155 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set |
@@ -159,7 +157,6 @@ CONFIG_DEBUG_KERNEL=y | |||
159 | # CONFIG_ARM_UNWIND is not set | 157 | # CONFIG_ARM_UNWIND is not set |
160 | CONFIG_DEBUG_LL=y | 158 | CONFIG_DEBUG_LL=y |
161 | CONFIG_EARLY_PRINTK=y | 159 | CONFIG_EARLY_PRINTK=y |
162 | CONFIG_KEYS=y | ||
163 | CONFIG_SECURITYFS=y | 160 | CONFIG_SECURITYFS=y |
164 | CONFIG_CRYPTO_DEFLATE=y | 161 | CONFIG_CRYPTO_DEFLATE=y |
165 | CONFIG_CRYPTO_LZO=y | 162 | CONFIG_CRYPTO_LZO=y |
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h index 5747a8baa413..8bb66bca2e3e 100644 --- a/arch/arm/include/asm/elf.h +++ b/arch/arm/include/asm/elf.h | |||
@@ -127,4 +127,8 @@ struct mm_struct; | |||
127 | extern unsigned long arch_randomize_brk(struct mm_struct *mm); | 127 | extern unsigned long arch_randomize_brk(struct mm_struct *mm); |
128 | #define arch_randomize_brk arch_randomize_brk | 128 | #define arch_randomize_brk arch_randomize_brk |
129 | 129 | ||
130 | extern int vectors_user_mapping(void); | ||
131 | #define arch_setup_additional_pages(bprm, uses_interp) vectors_user_mapping() | ||
132 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES | ||
133 | |||
130 | #endif | 134 | #endif |
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 1261b1f928d9..815efa2d4e07 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h | |||
@@ -294,6 +294,7 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); | |||
294 | #define ARCH_HAS_VALID_PHYS_ADDR_RANGE | 294 | #define ARCH_HAS_VALID_PHYS_ADDR_RANGE |
295 | extern int valid_phys_addr_range(unsigned long addr, size_t size); | 295 | extern int valid_phys_addr_range(unsigned long addr, size_t size); |
296 | extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); | 296 | extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); |
297 | extern int devmem_is_allowed(unsigned long pfn); | ||
297 | #endif | 298 | #endif |
298 | 299 | ||
299 | /* | 300 | /* |
diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h index a0b3cac0547c..71605d9f8e42 100644 --- a/arch/arm/include/asm/mmu_context.h +++ b/arch/arm/include/asm/mmu_context.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
19 | #include <asm/cachetype.h> | 19 | #include <asm/cachetype.h> |
20 | #include <asm/proc-fns.h> | 20 | #include <asm/proc-fns.h> |
21 | #include <asm-generic/mm_hooks.h> | ||
22 | 21 | ||
23 | void __check_kvm_seq(struct mm_struct *mm); | 22 | void __check_kvm_seq(struct mm_struct *mm); |
24 | 23 | ||
@@ -134,4 +133,32 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
134 | #define deactivate_mm(tsk,mm) do { } while (0) | 133 | #define deactivate_mm(tsk,mm) do { } while (0) |
135 | #define activate_mm(prev,next) switch_mm(prev, next, NULL) | 134 | #define activate_mm(prev,next) switch_mm(prev, next, NULL) |
136 | 135 | ||
136 | /* | ||
137 | * We are inserting a "fake" vma for the user-accessible vector page so | ||
138 | * gdb and friends can get to it through ptrace and /proc/<pid>/mem. | ||
139 | * But we also want to remove it before the generic code gets to see it | ||
140 | * during process exit or the unmapping of it would cause total havoc. | ||
141 | * (the macro is used as remove_vma() is static to mm/mmap.c) | ||
142 | */ | ||
143 | #define arch_exit_mmap(mm) \ | ||
144 | do { \ | ||
145 | struct vm_area_struct *high_vma = find_vma(mm, 0xffff0000); \ | ||
146 | if (high_vma) { \ | ||
147 | BUG_ON(high_vma->vm_next); /* it should be last */ \ | ||
148 | if (high_vma->vm_prev) \ | ||
149 | high_vma->vm_prev->vm_next = NULL; \ | ||
150 | else \ | ||
151 | mm->mmap = NULL; \ | ||
152 | rb_erase(&high_vma->vm_rb, &mm->mm_rb); \ | ||
153 | mm->mmap_cache = NULL; \ | ||
154 | mm->map_count--; \ | ||
155 | remove_vma(high_vma); \ | ||
156 | } \ | ||
157 | } while (0) | ||
158 | |||
159 | static inline void arch_dup_mmap(struct mm_struct *oldmm, | ||
160 | struct mm_struct *mm) | ||
161 | { | ||
162 | } | ||
163 | |||
137 | #endif | 164 | #endif |
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index ab68cf1ef80f..e90b167ea848 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
@@ -317,6 +317,10 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | |||
317 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE | 317 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE |
318 | #define pgprot_dmacoherent(prot) \ | 318 | #define pgprot_dmacoherent(prot) \ |
319 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) | 319 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) |
320 | #define __HAVE_PHYS_MEM_ACCESS_PROT | ||
321 | struct file; | ||
322 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | ||
323 | unsigned long size, pgprot_t vma_prot); | ||
320 | #else | 324 | #else |
321 | #define pgprot_dmacoherent(prot) \ | 325 | #define pgprot_dmacoherent(prot) \ |
322 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_UNCACHED) | 326 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_UNCACHED) |
diff --git a/arch/arm/include/asm/seccomp.h b/arch/arm/include/asm/seccomp.h new file mode 100644 index 000000000000..52b156b341f5 --- /dev/null +++ b/arch/arm/include/asm/seccomp.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef _ASM_ARM_SECCOMP_H | ||
2 | #define _ASM_ARM_SECCOMP_H | ||
3 | |||
4 | #include <linux/unistd.h> | ||
5 | |||
6 | #define __NR_seccomp_read __NR_read | ||
7 | #define __NR_seccomp_write __NR_write | ||
8 | #define __NR_seccomp_exit __NR_exit | ||
9 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
10 | |||
11 | #endif /* _ASM_ARM_SECCOMP_H */ | ||
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h index 763e29fa8530..7b5cc8dae06e 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h | |||
@@ -144,6 +144,7 @@ extern void vfp_flush_hwstate(struct thread_info *); | |||
144 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ | 144 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ |
145 | #define TIF_FREEZE 19 | 145 | #define TIF_FREEZE 19 |
146 | #define TIF_RESTORE_SIGMASK 20 | 146 | #define TIF_RESTORE_SIGMASK 20 |
147 | #define TIF_SECCOMP 21 | ||
147 | 148 | ||
148 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | 149 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
149 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | 150 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
@@ -153,6 +154,7 @@ extern void vfp_flush_hwstate(struct thread_info *); | |||
153 | #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) | 154 | #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) |
154 | #define _TIF_FREEZE (1 << TIF_FREEZE) | 155 | #define _TIF_FREEZE (1 << TIF_FREEZE) |
155 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) | 156 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) |
157 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) | ||
156 | 158 | ||
157 | /* | 159 | /* |
158 | * Change these and you break ASM code in entry-common.S | 160 | * Change these and you break ASM code in entry-common.S |
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 1b560825e1cf..0385a8207b67 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -48,6 +48,8 @@ work_pending: | |||
48 | beq no_work_pending | 48 | beq no_work_pending |
49 | mov r0, sp @ 'regs' | 49 | mov r0, sp @ 'regs' |
50 | mov r2, why @ 'syscall' | 50 | mov r2, why @ 'syscall' |
51 | tst r1, #_TIF_SIGPENDING @ delivering a signal? | ||
52 | movne why, #0 @ prevent further restarts | ||
51 | bl do_notify_resume | 53 | bl do_notify_resume |
52 | b ret_slow_syscall @ Check work again | 54 | b ret_slow_syscall @ Check work again |
53 | 55 | ||
@@ -293,7 +295,6 @@ ENTRY(vector_swi) | |||
293 | 295 | ||
294 | get_thread_info tsk | 296 | get_thread_info tsk |
295 | adr tbl, sys_call_table @ load syscall table pointer | 297 | adr tbl, sys_call_table @ load syscall table pointer |
296 | ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing | ||
297 | 298 | ||
298 | #if defined(CONFIG_OABI_COMPAT) | 299 | #if defined(CONFIG_OABI_COMPAT) |
299 | /* | 300 | /* |
@@ -310,8 +311,20 @@ ENTRY(vector_swi) | |||
310 | eor scno, scno, #__NR_SYSCALL_BASE @ check OS number | 311 | eor scno, scno, #__NR_SYSCALL_BASE @ check OS number |
311 | #endif | 312 | #endif |
312 | 313 | ||
314 | ldr r10, [tsk, #TI_FLAGS] @ check for syscall tracing | ||
313 | stmdb sp!, {r4, r5} @ push fifth and sixth args | 315 | stmdb sp!, {r4, r5} @ push fifth and sixth args |
314 | tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? | 316 | |
317 | #ifdef CONFIG_SECCOMP | ||
318 | tst r10, #_TIF_SECCOMP | ||
319 | beq 1f | ||
320 | mov r0, scno | ||
321 | bl __secure_computing | ||
322 | add r0, sp, #S_R0 + S_OFF @ pointer to regs | ||
323 | ldmia r0, {r0 - r3} @ have to reload r0 - r3 | ||
324 | 1: | ||
325 | #endif | ||
326 | |||
327 | tst r10, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? | ||
315 | bne __sys_trace | 328 | bne __sys_trace |
316 | 329 | ||
317 | cmp scno, #NR_syscalls @ check upper syscall limit | 330 | cmp scno, #NR_syscalls @ check upper syscall limit |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 401e38be1f78..66ac9c926200 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -458,3 +458,24 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) | |||
458 | unsigned long range_end = mm->brk + 0x02000000; | 458 | unsigned long range_end = mm->brk + 0x02000000; |
459 | return randomize_range(mm->brk, range_end, 0) ? : mm->brk; | 459 | return randomize_range(mm->brk, range_end, 0) ? : mm->brk; |
460 | } | 460 | } |
461 | |||
462 | /* | ||
463 | * The vectors page is always readable from user space for the | ||
464 | * atomic helpers and the signal restart code. Let's declare a mapping | ||
465 | * for it so it is visible through ptrace and /proc/<pid>/mem. | ||
466 | */ | ||
467 | |||
468 | int vectors_user_mapping(void) | ||
469 | { | ||
470 | struct mm_struct *mm = current->mm; | ||
471 | return install_special_mapping(mm, 0xffff0000, PAGE_SIZE, | ||
472 | VM_READ | VM_EXEC | | ||
473 | VM_MAYREAD | VM_MAYEXEC | | ||
474 | VM_ALWAYSDUMP | VM_RESERVED, | ||
475 | NULL); | ||
476 | } | ||
477 | |||
478 | const char *arch_vma_name(struct vm_area_struct *vma) | ||
479 | { | ||
480 | return (vma->vm_start == 0xffff0000) ? "[vectors]" : NULL; | ||
481 | } | ||
diff --git a/arch/arm/mach-aaec2000/include/mach/vmalloc.h b/arch/arm/mach-aaec2000/include/mach/vmalloc.h index 551f68f666bf..cff4e0a996ce 100644 --- a/arch/arm/mach-aaec2000/include/mach/vmalloc.h +++ b/arch/arm/mach-aaec2000/include/mach/vmalloc.h | |||
@@ -11,6 +11,6 @@ | |||
11 | #ifndef __ASM_ARCH_VMALLOC_H | 11 | #ifndef __ASM_ARCH_VMALLOC_H |
12 | #define __ASM_ARCH_VMALLOC_H | 12 | #define __ASM_ARCH_VMALLOC_H |
13 | 13 | ||
14 | #define VMALLOC_END (PAGE_OFFSET + 0x10000000) | 14 | #define VMALLOC_END 0xd0000000 |
15 | 15 | ||
16 | #endif /* __ASM_ARCH_VMALLOC_H */ | 16 | #endif /* __ASM_ARCH_VMALLOC_H */ |
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 939bccd70569..bbd5efa65099 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -33,6 +33,7 @@ config ARCH_AT91SAM9260 | |||
33 | select HAVE_AT91_USART3 | 33 | select HAVE_AT91_USART3 |
34 | select HAVE_AT91_USART4 | 34 | select HAVE_AT91_USART4 |
35 | select HAVE_AT91_USART5 | 35 | select HAVE_AT91_USART5 |
36 | select HAVE_NET_MACB | ||
36 | 37 | ||
37 | config ARCH_AT91SAM9261 | 38 | config ARCH_AT91SAM9261 |
38 | bool "AT91SAM9261" | 39 | bool "AT91SAM9261" |
@@ -51,6 +52,7 @@ config ARCH_AT91SAM9263 | |||
51 | select CPU_ARM926T | 52 | select CPU_ARM926T |
52 | select GENERIC_CLOCKEVENTS | 53 | select GENERIC_CLOCKEVENTS |
53 | select HAVE_FB_ATMEL | 54 | select HAVE_FB_ATMEL |
55 | select HAVE_NET_MACB | ||
54 | 56 | ||
55 | config ARCH_AT91SAM9RL | 57 | config ARCH_AT91SAM9RL |
56 | bool "AT91SAM9RL" | 58 | bool "AT91SAM9RL" |
@@ -66,6 +68,7 @@ config ARCH_AT91SAM9G20 | |||
66 | select HAVE_AT91_USART3 | 68 | select HAVE_AT91_USART3 |
67 | select HAVE_AT91_USART4 | 69 | select HAVE_AT91_USART4 |
68 | select HAVE_AT91_USART5 | 70 | select HAVE_AT91_USART5 |
71 | select HAVE_NET_MACB | ||
69 | 72 | ||
70 | config ARCH_AT91SAM9G45 | 73 | config ARCH_AT91SAM9G45 |
71 | bool "AT91SAM9G45" | 74 | bool "AT91SAM9G45" |
@@ -73,6 +76,7 @@ config ARCH_AT91SAM9G45 | |||
73 | select GENERIC_CLOCKEVENTS | 76 | select GENERIC_CLOCKEVENTS |
74 | select HAVE_AT91_USART3 | 77 | select HAVE_AT91_USART3 |
75 | select HAVE_FB_ATMEL | 78 | select HAVE_FB_ATMEL |
79 | select HAVE_NET_MACB | ||
76 | 80 | ||
77 | config ARCH_AT91CAP9 | 81 | config ARCH_AT91CAP9 |
78 | bool "AT91CAP9" | 82 | bool "AT91CAP9" |
@@ -338,6 +342,7 @@ config MACH_AT91SAM9G20EK | |||
338 | that embeds only one SD/MMC slot. | 342 | that embeds only one SD/MMC slot. |
339 | 343 | ||
340 | config MACH_AT91SAM9G20EK_2MMC | 344 | config MACH_AT91SAM9G20EK_2MMC |
345 | depends on MACH_AT91SAM9G20EK | ||
341 | bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots" | 346 | bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots" |
342 | select HAVE_NAND_ATMEL_BUSWIDTH_16 | 347 | select HAVE_NAND_ATMEL_BUSWIDTH_16 |
343 | help | 348 | help |
@@ -383,8 +388,8 @@ if ARCH_AT91SAM9G45 | |||
383 | 388 | ||
384 | comment "AT91SAM9G45 Board Type" | 389 | comment "AT91SAM9G45 Board Type" |
385 | 390 | ||
386 | config MACH_AT91SAM9G45EKES | 391 | config MACH_AT91SAM9M10G45EK |
387 | bool "Atmel AT91SAM9G45-EKES Evaluation Kit" | 392 | bool "Atmel AT91SAM9M10G45-EK Evaluation Kits" |
388 | select HAVE_NAND_ATMEL_BUSWIDTH_16 | 393 | select HAVE_NAND_ATMEL_BUSWIDTH_16 |
389 | help | 394 | help |
390 | Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit. | 395 | Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit. |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index ca2ac003f41f..3a07a3696441 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -61,7 +61,6 @@ obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o | |||
61 | 61 | ||
62 | # AT91SAM9G20 board-specific support | 62 | # AT91SAM9G20 board-specific support |
63 | obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o | 63 | obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o |
64 | obj-$(CONFIG_MACH_AT91SAM9G20EK_2MMC) += board-sam9g20ek-2slot-mmc.o | ||
65 | obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o | 64 | obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o |
66 | obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o | 65 | obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o |
67 | obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o | 66 | obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o |
@@ -70,7 +69,7 @@ obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o | |||
70 | obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o | 69 | obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o |
71 | 70 | ||
72 | # AT91SAM9G45 board-specific support | 71 | # AT91SAM9G45 board-specific support |
73 | obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o | 72 | obj-$(CONFIG_MACH_AT91SAM9M10G45EK) += board-sam9m10g45ek.o |
74 | 73 | ||
75 | # AT91CAP9 board-specific support | 74 | # AT91CAP9 board-specific support |
76 | obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o | 75 | obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o |
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index 5e71ccd5e7d3..1276babf84d5 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -426,7 +426,7 @@ static struct i2c_gpio_platform_data pdata_i2c0 = { | |||
426 | .sda_is_open_drain = 1, | 426 | .sda_is_open_drain = 1, |
427 | .scl_pin = AT91_PIN_PA21, | 427 | .scl_pin = AT91_PIN_PA21, |
428 | .scl_is_open_drain = 1, | 428 | .scl_is_open_drain = 1, |
429 | .udelay = 2, /* ~100 kHz */ | 429 | .udelay = 5, /* ~100 kHz */ |
430 | }; | 430 | }; |
431 | 431 | ||
432 | static struct platform_device at91sam9g45_twi0_device = { | 432 | static struct platform_device at91sam9g45_twi0_device = { |
@@ -440,7 +440,7 @@ static struct i2c_gpio_platform_data pdata_i2c1 = { | |||
440 | .sda_is_open_drain = 1, | 440 | .sda_is_open_drain = 1, |
441 | .scl_pin = AT91_PIN_PB11, | 441 | .scl_pin = AT91_PIN_PB11, |
442 | .scl_is_open_drain = 1, | 442 | .scl_is_open_drain = 1, |
443 | .udelay = 2, /* ~100 kHz */ | 443 | .udelay = 5, /* ~100 kHz */ |
444 | }; | 444 | }; |
445 | 445 | ||
446 | static struct platform_device at91sam9g45_twi1_device = { | 446 | static struct platform_device at91sam9g45_twi1_device = { |
diff --git a/arch/arm/mach-at91/board-at572d940hf_ek.c b/arch/arm/mach-at91/board-at572d940hf_ek.c index 5daff277f53e..46651623f208 100644 --- a/arch/arm/mach-at91/board-at572d940hf_ek.c +++ b/arch/arm/mach-at91/board-at572d940hf_ek.c | |||
@@ -216,7 +216,7 @@ static struct atmel_nand_data __initdata eb_nand_data = { | |||
216 | /* .rdy_pin = AT91_PIN_PC16, */ | 216 | /* .rdy_pin = AT91_PIN_PC16, */ |
217 | .enable_pin = AT91_PIN_PA15, | 217 | .enable_pin = AT91_PIN_PA15, |
218 | .partition_info = nand_partitions, | 218 | .partition_info = nand_partitions, |
219 | #if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16) | 219 | #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) |
220 | .bus_width_16 = 1, | 220 | .bus_width_16 = 1, |
221 | #else | 221 | #else |
222 | .bus_width_16 = 0, | 222 | .bus_width_16 = 0, |
diff --git a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c deleted file mode 100644 index c49f5c003ee1..000000000000 --- a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c +++ /dev/null | |||
@@ -1,329 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 SAN People | ||
3 | * Copyright (C) 2008 Atmel | ||
4 | * Copyright (C) 2009 Rob Emanuele | ||
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, or | ||
9 | * (at your option) any later version. | ||
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <linux/mm.h> | ||
24 | #include <linux/module.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/spi/spi.h> | ||
27 | #include <linux/spi/at73c213.h> | ||
28 | #include <linux/clk.h> | ||
29 | #include <linux/regulator/machine.h> | ||
30 | #include <linux/regulator/fixed.h> | ||
31 | #include <linux/regulator/consumer.h> | ||
32 | |||
33 | #include <mach/hardware.h> | ||
34 | #include <asm/setup.h> | ||
35 | #include <asm/mach-types.h> | ||
36 | #include <asm/irq.h> | ||
37 | |||
38 | #include <asm/mach/arch.h> | ||
39 | #include <asm/mach/map.h> | ||
40 | #include <asm/mach/irq.h> | ||
41 | |||
42 | #include <mach/board.h> | ||
43 | #include <mach/gpio.h> | ||
44 | #include <mach/at91sam9_smc.h> | ||
45 | |||
46 | #include "sam9_smc.h" | ||
47 | #include "generic.h" | ||
48 | |||
49 | |||
50 | static void __init ek_map_io(void) | ||
51 | { | ||
52 | /* Initialize processor: 18.432 MHz crystal */ | ||
53 | at91sam9260_initialize(18432000); | ||
54 | |||
55 | /* DGBU on ttyS0. (Rx & Tx only) */ | ||
56 | at91_register_uart(0, 0, 0); | ||
57 | |||
58 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
59 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
60 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD | ||
61 | | ATMEL_UART_RI); | ||
62 | |||
63 | /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */ | ||
64 | at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
65 | |||
66 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
67 | at91_set_serial_console(0); | ||
68 | } | ||
69 | |||
70 | static void __init ek_init_irq(void) | ||
71 | { | ||
72 | at91sam9260_init_interrupts(NULL); | ||
73 | } | ||
74 | |||
75 | |||
76 | /* | ||
77 | * USB Host port | ||
78 | */ | ||
79 | static struct at91_usbh_data __initdata ek_usbh_data = { | ||
80 | .ports = 2, | ||
81 | }; | ||
82 | |||
83 | /* | ||
84 | * USB Device port | ||
85 | */ | ||
86 | static struct at91_udc_data __initdata ek_udc_data = { | ||
87 | .vbus_pin = AT91_PIN_PC5, | ||
88 | .pullup_pin = 0, /* pull-up driven by UDC */ | ||
89 | }; | ||
90 | |||
91 | |||
92 | /* | ||
93 | * SPI devices. | ||
94 | */ | ||
95 | static struct spi_board_info ek_spi_devices[] = { | ||
96 | #if !(defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_AT91)) | ||
97 | { /* DataFlash chip */ | ||
98 | .modalias = "mtd_dataflash", | ||
99 | .chip_select = 1, | ||
100 | .max_speed_hz = 15 * 1000 * 1000, | ||
101 | .bus_num = 0, | ||
102 | }, | ||
103 | #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD) | ||
104 | { /* DataFlash card */ | ||
105 | .modalias = "mtd_dataflash", | ||
106 | .chip_select = 0, | ||
107 | .max_speed_hz = 15 * 1000 * 1000, | ||
108 | .bus_num = 0, | ||
109 | }, | ||
110 | #endif | ||
111 | #endif | ||
112 | }; | ||
113 | |||
114 | |||
115 | /* | ||
116 | * MACB Ethernet device | ||
117 | */ | ||
118 | static struct at91_eth_data __initdata ek_macb_data = { | ||
119 | .phy_irq_pin = AT91_PIN_PB0, | ||
120 | .is_rmii = 1, | ||
121 | }; | ||
122 | |||
123 | |||
124 | /* | ||
125 | * NAND flash | ||
126 | */ | ||
127 | static struct mtd_partition __initdata ek_nand_partition[] = { | ||
128 | { | ||
129 | .name = "Bootstrap", | ||
130 | .offset = 0, | ||
131 | .size = 4 * SZ_1M, | ||
132 | }, | ||
133 | { | ||
134 | .name = "Partition 1", | ||
135 | .offset = MTDPART_OFS_NXTBLK, | ||
136 | .size = 60 * SZ_1M, | ||
137 | }, | ||
138 | { | ||
139 | .name = "Partition 2", | ||
140 | .offset = MTDPART_OFS_NXTBLK, | ||
141 | .size = MTDPART_SIZ_FULL, | ||
142 | }, | ||
143 | }; | ||
144 | |||
145 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
146 | { | ||
147 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
148 | return ek_nand_partition; | ||
149 | } | ||
150 | |||
151 | /* det_pin is not connected */ | ||
152 | static struct atmel_nand_data __initdata ek_nand_data = { | ||
153 | .ale = 21, | ||
154 | .cle = 22, | ||
155 | .rdy_pin = AT91_PIN_PC13, | ||
156 | .enable_pin = AT91_PIN_PC14, | ||
157 | .partition_info = nand_partitions, | ||
158 | #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) | ||
159 | .bus_width_16 = 1, | ||
160 | #else | ||
161 | .bus_width_16 = 0, | ||
162 | #endif | ||
163 | }; | ||
164 | |||
165 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | ||
166 | .ncs_read_setup = 0, | ||
167 | .nrd_setup = 2, | ||
168 | .ncs_write_setup = 0, | ||
169 | .nwe_setup = 2, | ||
170 | |||
171 | .ncs_read_pulse = 4, | ||
172 | .nrd_pulse = 4, | ||
173 | .ncs_write_pulse = 4, | ||
174 | .nwe_pulse = 4, | ||
175 | |||
176 | .read_cycle = 7, | ||
177 | .write_cycle = 7, | ||
178 | |||
179 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE, | ||
180 | .tdf_cycles = 3, | ||
181 | }; | ||
182 | |||
183 | static void __init ek_add_device_nand(void) | ||
184 | { | ||
185 | /* setup bus-width (8 or 16) */ | ||
186 | if (ek_nand_data.bus_width_16) | ||
187 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; | ||
188 | else | ||
189 | ek_nand_smc_config.mode |= AT91_SMC_DBW_8; | ||
190 | |||
191 | /* configure chip-select 3 (NAND) */ | ||
192 | sam9_smc_configure(3, &ek_nand_smc_config); | ||
193 | |||
194 | at91_add_device_nand(&ek_nand_data); | ||
195 | } | ||
196 | |||
197 | |||
198 | /* | ||
199 | * MCI (SD/MMC) | ||
200 | * wp_pin is not connected | ||
201 | */ | ||
202 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) | ||
203 | static struct mci_platform_data __initdata ek_mmc_data = { | ||
204 | .slot[0] = { | ||
205 | .bus_width = 4, | ||
206 | .detect_pin = AT91_PIN_PC2, | ||
207 | .wp_pin = -ENODEV, | ||
208 | }, | ||
209 | .slot[1] = { | ||
210 | .bus_width = 4, | ||
211 | .detect_pin = AT91_PIN_PC9, | ||
212 | .wp_pin = -ENODEV, | ||
213 | }, | ||
214 | |||
215 | }; | ||
216 | #else | ||
217 | static struct at91_mmc_data __initdata ek_mmc_data = { | ||
218 | .slot_b = 1, /* Only one slot so use slot B */ | ||
219 | .wire4 = 1, | ||
220 | .det_pin = AT91_PIN_PC9, | ||
221 | }; | ||
222 | #endif | ||
223 | |||
224 | /* | ||
225 | * LEDs | ||
226 | */ | ||
227 | static struct gpio_led ek_leds[] = { | ||
228 | { /* "bottom" led, green, userled1 to be defined */ | ||
229 | .name = "ds5", | ||
230 | .gpio = AT91_PIN_PB8, | ||
231 | .active_low = 1, | ||
232 | .default_trigger = "none", | ||
233 | }, | ||
234 | { /* "power" led, yellow */ | ||
235 | .name = "ds1", | ||
236 | .gpio = AT91_PIN_PB9, | ||
237 | .default_trigger = "heartbeat", | ||
238 | } | ||
239 | }; | ||
240 | |||
241 | #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) | ||
242 | static struct regulator_consumer_supply ek_audio_consumer_supplies[] = { | ||
243 | REGULATOR_SUPPLY("AVDD", "0-001b"), | ||
244 | REGULATOR_SUPPLY("HPVDD", "0-001b"), | ||
245 | REGULATOR_SUPPLY("DBVDD", "0-001b"), | ||
246 | REGULATOR_SUPPLY("DCVDD", "0-001b"), | ||
247 | }; | ||
248 | |||
249 | static struct regulator_init_data ek_avdd_reg_init_data = { | ||
250 | .constraints = { | ||
251 | .name = "3V3", | ||
252 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
253 | }, | ||
254 | .consumer_supplies = ek_audio_consumer_supplies, | ||
255 | .num_consumer_supplies = ARRAY_SIZE(ek_audio_consumer_supplies), | ||
256 | }; | ||
257 | |||
258 | static struct fixed_voltage_config ek_vdd_pdata = { | ||
259 | .supply_name = "board-3V3", | ||
260 | .microvolts = 3300000, | ||
261 | .gpio = -EINVAL, | ||
262 | .enabled_at_boot = 0, | ||
263 | .init_data = &ek_avdd_reg_init_data, | ||
264 | }; | ||
265 | static struct platform_device ek_voltage_regulator = { | ||
266 | .name = "reg-fixed-voltage", | ||
267 | .id = -1, | ||
268 | .num_resources = 0, | ||
269 | .dev = { | ||
270 | .platform_data = &ek_vdd_pdata, | ||
271 | }, | ||
272 | }; | ||
273 | static void __init ek_add_regulators(void) | ||
274 | { | ||
275 | platform_device_register(&ek_voltage_regulator); | ||
276 | } | ||
277 | #else | ||
278 | static void __init ek_add_regulators(void) {} | ||
279 | #endif | ||
280 | |||
281 | static struct i2c_board_info __initdata ek_i2c_devices[] = { | ||
282 | { | ||
283 | I2C_BOARD_INFO("24c512", 0x50), | ||
284 | }, | ||
285 | }; | ||
286 | |||
287 | |||
288 | static void __init ek_board_init(void) | ||
289 | { | ||
290 | /* Serial */ | ||
291 | at91_add_device_serial(); | ||
292 | /* USB Host */ | ||
293 | at91_add_device_usbh(&ek_usbh_data); | ||
294 | /* USB Device */ | ||
295 | at91_add_device_udc(&ek_udc_data); | ||
296 | /* SPI */ | ||
297 | at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); | ||
298 | /* NAND */ | ||
299 | ek_add_device_nand(); | ||
300 | /* Ethernet */ | ||
301 | at91_add_device_eth(&ek_macb_data); | ||
302 | /* Regulators */ | ||
303 | ek_add_regulators(); | ||
304 | /* MMC */ | ||
305 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) | ||
306 | at91_add_device_mci(0, &ek_mmc_data); | ||
307 | #else | ||
308 | at91_add_device_mmc(0, &ek_mmc_data); | ||
309 | #endif | ||
310 | /* I2C */ | ||
311 | at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); | ||
312 | /* LEDs */ | ||
313 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | ||
314 | /* PCK0 provides MCLK to the WM8731 */ | ||
315 | at91_set_B_periph(AT91_PIN_PC1, 0); | ||
316 | /* SSC (for WM8731) */ | ||
317 | at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX); | ||
318 | } | ||
319 | |||
320 | MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod") | ||
321 | /* Maintainer: Rob Emanuele */ | ||
322 | .phys_io = AT91_BASE_SYS, | ||
323 | .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, | ||
324 | .boot_params = AT91_SDRAM_BASE + 0x100, | ||
325 | .timer = &at91sam926x_timer, | ||
326 | .map_io = ek_map_io, | ||
327 | .init_irq = ek_init_irq, | ||
328 | .init_machine = ek_board_init, | ||
329 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c index 6ea9808b8868..b463e340c4a0 100644 --- a/arch/arm/mach-at91/board-sam9g20ek.c +++ b/arch/arm/mach-at91/board-sam9g20ek.c | |||
@@ -47,6 +47,18 @@ | |||
47 | #include "sam9_smc.h" | 47 | #include "sam9_smc.h" |
48 | #include "generic.h" | 48 | #include "generic.h" |
49 | 49 | ||
50 | /* | ||
51 | * board revision encoding | ||
52 | * bit 0: | ||
53 | * 0 => 1 sd/mmc slot | ||
54 | * 1 => 2 sd/mmc slots connectors (board from revision C) | ||
55 | */ | ||
56 | #define HAVE_2MMC (1 << 0) | ||
57 | static int inline ek_have_2mmc(void) | ||
58 | { | ||
59 | return machine_is_at91sam9g20ek_2mmc() || (system_rev & HAVE_2MMC); | ||
60 | } | ||
61 | |||
50 | 62 | ||
51 | static void __init ek_map_io(void) | 63 | static void __init ek_map_io(void) |
52 | { | 64 | { |
@@ -94,7 +106,7 @@ static struct at91_udc_data __initdata ek_udc_data = { | |||
94 | * SPI devices. | 106 | * SPI devices. |
95 | */ | 107 | */ |
96 | static struct spi_board_info ek_spi_devices[] = { | 108 | static struct spi_board_info ek_spi_devices[] = { |
97 | #if !defined(CONFIG_MMC_AT91) | 109 | #if !(defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_AT91)) |
98 | { /* DataFlash chip */ | 110 | { /* DataFlash chip */ |
99 | .modalias = "mtd_dataflash", | 111 | .modalias = "mtd_dataflash", |
100 | .chip_select = 1, | 112 | .chip_select = 1, |
@@ -121,6 +133,13 @@ static struct at91_eth_data __initdata ek_macb_data = { | |||
121 | .is_rmii = 1, | 133 | .is_rmii = 1, |
122 | }; | 134 | }; |
123 | 135 | ||
136 | static void __init ek_add_device_macb(void) | ||
137 | { | ||
138 | if (ek_have_2mmc()) | ||
139 | ek_macb_data.phy_irq_pin = AT91_PIN_PB0; | ||
140 | |||
141 | at91_add_device_eth(&ek_macb_data); | ||
142 | } | ||
124 | 143 | ||
125 | /* | 144 | /* |
126 | * NAND flash | 145 | * NAND flash |
@@ -198,13 +217,36 @@ static void __init ek_add_device_nand(void) | |||
198 | 217 | ||
199 | /* | 218 | /* |
200 | * MCI (SD/MMC) | 219 | * MCI (SD/MMC) |
201 | * det_pin, wp_pin and vcc_pin are not connected | 220 | * wp_pin and vcc_pin are not connected |
202 | */ | 221 | */ |
222 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) | ||
223 | static struct mci_platform_data __initdata ek_mmc_data = { | ||
224 | .slot[1] = { | ||
225 | .bus_width = 4, | ||
226 | .detect_pin = AT91_PIN_PC9, | ||
227 | }, | ||
228 | |||
229 | }; | ||
230 | #else | ||
203 | static struct at91_mmc_data __initdata ek_mmc_data = { | 231 | static struct at91_mmc_data __initdata ek_mmc_data = { |
204 | .slot_b = 1, | 232 | .slot_b = 1, /* Only one slot so use slot B */ |
205 | .wire4 = 1, | 233 | .wire4 = 1, |
234 | .det_pin = AT91_PIN_PC9, | ||
206 | }; | 235 | }; |
236 | #endif | ||
207 | 237 | ||
238 | static void __init ek_add_device_mmc(void) | ||
239 | { | ||
240 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) | ||
241 | if (ek_have_2mmc()) { | ||
242 | ek_mmc_data.slot[0].bus_width = 4; | ||
243 | ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2; | ||
244 | } | ||
245 | at91_add_device_mci(0, &ek_mmc_data); | ||
246 | #else | ||
247 | at91_add_device_mmc(0, &ek_mmc_data); | ||
248 | #endif | ||
249 | } | ||
208 | 250 | ||
209 | /* | 251 | /* |
210 | * LEDs | 252 | * LEDs |
@@ -223,6 +265,15 @@ static struct gpio_led ek_leds[] = { | |||
223 | } | 265 | } |
224 | }; | 266 | }; |
225 | 267 | ||
268 | static void __init ek_add_device_gpio_leds(void) | ||
269 | { | ||
270 | if (ek_have_2mmc()) { | ||
271 | ek_leds[0].gpio = AT91_PIN_PB8; | ||
272 | ek_leds[1].gpio = AT91_PIN_PB9; | ||
273 | } | ||
274 | |||
275 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | ||
276 | } | ||
226 | 277 | ||
227 | /* | 278 | /* |
228 | * GPIO Buttons | 279 | * GPIO Buttons |
@@ -336,15 +387,15 @@ static void __init ek_board_init(void) | |||
336 | /* NAND */ | 387 | /* NAND */ |
337 | ek_add_device_nand(); | 388 | ek_add_device_nand(); |
338 | /* Ethernet */ | 389 | /* Ethernet */ |
339 | at91_add_device_eth(&ek_macb_data); | 390 | ek_add_device_macb(); |
340 | /* Regulators */ | 391 | /* Regulators */ |
341 | ek_add_regulators(); | 392 | ek_add_regulators(); |
342 | /* MMC */ | 393 | /* MMC */ |
343 | at91_add_device_mmc(0, &ek_mmc_data); | 394 | ek_add_device_mmc(); |
344 | /* I2C */ | 395 | /* I2C */ |
345 | at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); | 396 | at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); |
346 | /* LEDs */ | 397 | /* LEDs */ |
347 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | 398 | ek_add_device_gpio_leds(); |
348 | /* Push Buttons */ | 399 | /* Push Buttons */ |
349 | ek_add_device_buttons(); | 400 | ek_add_device_buttons(); |
350 | /* PCK0 provides MCLK to the WM8731 */ | 401 | /* PCK0 provides MCLK to the WM8731 */ |
@@ -363,3 +414,14 @@ MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK") | |||
363 | .init_irq = ek_init_irq, | 414 | .init_irq = ek_init_irq, |
364 | .init_machine = ek_board_init, | 415 | .init_machine = ek_board_init, |
365 | MACHINE_END | 416 | MACHINE_END |
417 | |||
418 | MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod") | ||
419 | /* Maintainer: Atmel */ | ||
420 | .phys_io = AT91_BASE_SYS, | ||
421 | .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, | ||
422 | .boot_params = AT91_SDRAM_BASE + 0x100, | ||
423 | .timer = &at91sam926x_timer, | ||
424 | .map_io = ek_map_io, | ||
425 | .init_irq = ek_init_irq, | ||
426 | .init_machine = ek_board_init, | ||
427 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c index ee800595594d..ae0e0843e5f5 100644 --- a/arch/arm/mach-at91/board-sam9m10g45ek.c +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c | |||
@@ -135,7 +135,7 @@ static struct atmel_nand_data __initdata ek_nand_data = { | |||
135 | .rdy_pin = AT91_PIN_PC8, | 135 | .rdy_pin = AT91_PIN_PC8, |
136 | .enable_pin = AT91_PIN_PC14, | 136 | .enable_pin = AT91_PIN_PC14, |
137 | .partition_info = nand_partitions, | 137 | .partition_info = nand_partitions, |
138 | #if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16) | 138 | #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) |
139 | .bus_width_16 = 1, | 139 | .bus_width_16 = 1, |
140 | #else | 140 | #else |
141 | .bus_width_16 = 0, | 141 | .bus_width_16 = 0, |
@@ -399,7 +399,7 @@ static void __init ek_board_init(void) | |||
399 | at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led)); | 399 | at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led)); |
400 | } | 400 | } |
401 | 401 | ||
402 | MACHINE_START(AT91SAM9G45EKES, "Atmel AT91SAM9G45-EKES") | 402 | MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK") |
403 | /* Maintainer: Atmel */ | 403 | /* Maintainer: Atmel */ |
404 | .phys_io = AT91_BASE_SYS, | 404 | .phys_io = AT91_BASE_SYS, |
405 | .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, | 405 | .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, |
diff --git a/arch/arm/mach-at91/include/mach/at91x40.h b/arch/arm/mach-at91/include/mach/at91x40.h index d34cdb8abdca..063ac44a0204 100644 --- a/arch/arm/mach-at91/include/mach/at91x40.h +++ b/arch/arm/mach-at91/include/mach/at91x40.h | |||
@@ -52,4 +52,10 @@ | |||
52 | #define AT91_DBGU_CIDR (AT91_SF + 0) /* CIDR in PS segment */ | 52 | #define AT91_DBGU_CIDR (AT91_SF + 0) /* CIDR in PS segment */ |
53 | #define AT91_DBGU_EXID (AT91_SF + 4) /* EXID in PS segment */ | 53 | #define AT91_DBGU_EXID (AT91_SF + 4) /* EXID in PS segment */ |
54 | 54 | ||
55 | /* | ||
56 | * Support defines for the simple Power Controller module. | ||
57 | */ | ||
58 | #define AT91_PS_CR (AT91_PS + 0) /* PS Control register */ | ||
59 | #define AT91_PS_CR_CPU (1 << 0) /* CPU clock disable bit */ | ||
60 | |||
55 | #endif /* AT91X40_H */ | 61 | #endif /* AT91X40_H */ |
diff --git a/arch/arm/mach-at91/include/mach/system.h b/arch/arm/mach-at91/include/mach/system.h index c80e090b3670..bfbb612265d6 100644 --- a/arch/arm/mach-at91/include/mach/system.h +++ b/arch/arm/mach-at91/include/mach/system.h | |||
@@ -33,7 +33,11 @@ static inline void arch_idle(void) | |||
33 | * Disable the processor clock. The processor will be automatically | 33 | * Disable the processor clock. The processor will be automatically |
34 | * re-enabled by an interrupt or by a reset. | 34 | * re-enabled by an interrupt or by a reset. |
35 | */ | 35 | */ |
36 | #ifdef AT91_PS | ||
37 | at91_sys_write(AT91_PS_CR, AT91_PS_CR_CPU); | ||
38 | #else | ||
36 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | 39 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); |
40 | #endif | ||
37 | #else | 41 | #else |
38 | /* | 42 | /* |
39 | * Set the processor (CP15) into 'Wait for Interrupt' mode. | 43 | * Set the processor (CP15) into 'Wait for Interrupt' mode. |
diff --git a/arch/arm/mach-bcmring/include/mach/vmalloc.h b/arch/arm/mach-bcmring/include/mach/vmalloc.h index 35e2ead8395c..3db3a09fd398 100644 --- a/arch/arm/mach-bcmring/include/mach/vmalloc.h +++ b/arch/arm/mach-bcmring/include/mach/vmalloc.h | |||
@@ -22,4 +22,4 @@ | |||
22 | * 0xe0000000 to 0xefffffff. This gives us 256 MB of vm space and handles | 22 | * 0xe0000000 to 0xefffffff. This gives us 256 MB of vm space and handles |
23 | * larger physical memory designs better. | 23 | * larger physical memory designs better. |
24 | */ | 24 | */ |
25 | #define VMALLOC_END (PAGE_OFFSET + 0x30000000) | 25 | #define VMALLOC_END 0xf0000000 |
diff --git a/arch/arm/mach-clps711x/include/mach/vmalloc.h b/arch/arm/mach-clps711x/include/mach/vmalloc.h index ea6cc7beff28..30b3a287ed88 100644 --- a/arch/arm/mach-clps711x/include/mach/vmalloc.h +++ b/arch/arm/mach-clps711x/include/mach/vmalloc.h | |||
@@ -17,4 +17,4 @@ | |||
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ | 19 | */ |
20 | #define VMALLOC_END (PAGE_OFFSET + 0x10000000) | 20 | #define VMALLOC_END 0xd0000000 |
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index 3d996b659ff4..9be261beae7d 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c | |||
@@ -769,8 +769,7 @@ static struct map_desc dm355_io_desc[] = { | |||
769 | .virtual = SRAM_VIRT, | 769 | .virtual = SRAM_VIRT, |
770 | .pfn = __phys_to_pfn(0x00010000), | 770 | .pfn = __phys_to_pfn(0x00010000), |
771 | .length = SZ_32K, | 771 | .length = SZ_32K, |
772 | /* MT_MEMORY_NONCACHED requires supersection alignment */ | 772 | .type = MT_MEMORY_NONCACHED, |
773 | .type = MT_DEVICE, | ||
774 | }, | 773 | }, |
775 | }; | 774 | }; |
776 | 775 | ||
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 6b6f4c643709..7781e35daec3 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c | |||
@@ -969,8 +969,7 @@ static struct map_desc dm365_io_desc[] = { | |||
969 | .virtual = SRAM_VIRT, | 969 | .virtual = SRAM_VIRT, |
970 | .pfn = __phys_to_pfn(0x00010000), | 970 | .pfn = __phys_to_pfn(0x00010000), |
971 | .length = SZ_32K, | 971 | .length = SZ_32K, |
972 | /* MT_MEMORY_NONCACHED requires supersection alignment */ | 972 | .type = MT_MEMORY_NONCACHED, |
973 | .type = MT_DEVICE, | ||
974 | }, | 973 | }, |
975 | }; | 974 | }; |
976 | 975 | ||
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 40fec315c99a..5e5b0a7831fb 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
@@ -653,8 +653,7 @@ static struct map_desc dm644x_io_desc[] = { | |||
653 | .virtual = SRAM_VIRT, | 653 | .virtual = SRAM_VIRT, |
654 | .pfn = __phys_to_pfn(0x00008000), | 654 | .pfn = __phys_to_pfn(0x00008000), |
655 | .length = SZ_16K, | 655 | .length = SZ_16K, |
656 | /* MT_MEMORY_NONCACHED requires supersection alignment */ | 656 | .type = MT_MEMORY_NONCACHED, |
657 | .type = MT_DEVICE, | ||
658 | }, | 657 | }, |
659 | }; | 658 | }; |
660 | 659 | ||
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index e4a3df1872ac..26e8a9c7f50b 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c | |||
@@ -737,8 +737,7 @@ static struct map_desc dm646x_io_desc[] = { | |||
737 | .virtual = SRAM_VIRT, | 737 | .virtual = SRAM_VIRT, |
738 | .pfn = __phys_to_pfn(0x00010000), | 738 | .pfn = __phys_to_pfn(0x00010000), |
739 | .length = SZ_32K, | 739 | .length = SZ_32K, |
740 | /* MT_MEMORY_NONCACHED requires supersection alignment */ | 740 | .type = MT_MEMORY_NONCACHED, |
741 | .type = MT_DEVICE, | ||
742 | }, | 741 | }, |
743 | }; | 742 | }; |
744 | 743 | ||
diff --git a/arch/arm/mach-dove/include/mach/io.h b/arch/arm/mach-dove/include/mach/io.h index 3b3e4721ce2e..eb4936ff90ad 100644 --- a/arch/arm/mach-dove/include/mach/io.h +++ b/arch/arm/mach-dove/include/mach/io.h | |||
@@ -13,8 +13,8 @@ | |||
13 | 13 | ||
14 | #define IO_SPACE_LIMIT 0xffffffff | 14 | #define IO_SPACE_LIMIT 0xffffffff |
15 | 15 | ||
16 | #define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_PHYS_BASE) +\ | 16 | #define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \ |
17 | DOVE_PCIE0_IO_VIRT_BASE)) | 17 | DOVE_PCIE0_IO_VIRT_BASE)) |
18 | #define __mem_pci(a) (a) | 18 | #define __mem_pci(a) (a) |
19 | 19 | ||
20 | #endif | 20 | #endif |
diff --git a/arch/arm/mach-ebsa110/include/mach/vmalloc.h b/arch/arm/mach-ebsa110/include/mach/vmalloc.h index 9b44c19e95ec..60bde56fba4c 100644 --- a/arch/arm/mach-ebsa110/include/mach/vmalloc.h +++ b/arch/arm/mach-ebsa110/include/mach/vmalloc.h | |||
@@ -7,4 +7,4 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #define VMALLOC_END (PAGE_OFFSET + 0x1f000000) | 10 | #define VMALLOC_END 0xdf000000 |
diff --git a/arch/arm/mach-footbridge/include/mach/vmalloc.h b/arch/arm/mach-footbridge/include/mach/vmalloc.h index d0958d860a3c..0ffbb7c85e59 100644 --- a/arch/arm/mach-footbridge/include/mach/vmalloc.h +++ b/arch/arm/mach-footbridge/include/mach/vmalloc.h | |||
@@ -7,4 +7,4 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | 9 | ||
10 | #define VMALLOC_END (PAGE_OFFSET + 0x30000000) | 10 | #define VMALLOC_END 0xf0000000 |
diff --git a/arch/arm/mach-h720x/include/mach/vmalloc.h b/arch/arm/mach-h720x/include/mach/vmalloc.h index ff1460d6841b..a45915b88756 100644 --- a/arch/arm/mach-h720x/include/mach/vmalloc.h +++ b/arch/arm/mach-h720x/include/mach/vmalloc.h | |||
@@ -5,6 +5,6 @@ | |||
5 | #ifndef __ARCH_ARM_VMALLOC_H | 5 | #ifndef __ARCH_ARM_VMALLOC_H |
6 | #define __ARCH_ARM_VMALLOC_H | 6 | #define __ARCH_ARM_VMALLOC_H |
7 | 7 | ||
8 | #define VMALLOC_END (PAGE_OFFSET + 0x10000000) | 8 | #define VMALLOC_END 0xd0000000 |
9 | 9 | ||
10 | #endif | 10 | #endif |
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index c5c0369bb481..9b45f1f523fa 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -146,8 +146,8 @@ choice | |||
146 | default MACH_EUKREA_MBIMX27_BASEBOARD | 146 | default MACH_EUKREA_MBIMX27_BASEBOARD |
147 | 147 | ||
148 | config MACH_EUKREA_MBIMX27_BASEBOARD | 148 | config MACH_EUKREA_MBIMX27_BASEBOARD |
149 | prompt "Eukrea MBIMX27 development board" | 149 | bool "Eukrea MBIMX27 development board" |
150 | bool | 150 | select IMX_HAVE_PLATFORM_IMX_SSI |
151 | select IMX_HAVE_PLATFORM_IMX_UART | 151 | select IMX_HAVE_PLATFORM_IMX_UART |
152 | select IMX_HAVE_PLATFORM_SPI_IMX | 152 | select IMX_HAVE_PLATFORM_SPI_IMX |
153 | help | 153 | help |
@@ -163,6 +163,15 @@ config MACH_MX27_3DS | |||
163 | Include support for MX27PDK platform. This includes specific | 163 | Include support for MX27PDK platform. This includes specific |
164 | configurations for the board and its peripherals. | 164 | configurations for the board and its peripherals. |
165 | 165 | ||
166 | config MACH_IMX27_VISSTRIM_M10 | ||
167 | bool "Vista Silicon i.MX27 Visstrim_m10" | ||
168 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
169 | select IMX_HAVE_PLATFORM_IMX_UART | ||
170 | help | ||
171 | Include support for Visstrim_m10 platform and its different variants. | ||
172 | This includes specific configurations for the board and its | ||
173 | peripherals. | ||
174 | |||
166 | config MACH_IMX27LITE | 175 | config MACH_IMX27LITE |
167 | bool "LogicPD MX27 LITEKIT platform" | 176 | bool "LogicPD MX27 LITEKIT platform" |
168 | select IMX_HAVE_PLATFORM_IMX_UART | 177 | select IMX_HAVE_PLATFORM_IMX_UART |
@@ -173,6 +182,7 @@ config MACH_IMX27LITE | |||
173 | config MACH_PCA100 | 182 | config MACH_PCA100 |
174 | bool "Phytec phyCARD-s (pca100)" | 183 | bool "Phytec phyCARD-s (pca100)" |
175 | select IMX_HAVE_PLATFORM_IMX_I2C | 184 | select IMX_HAVE_PLATFORM_IMX_I2C |
185 | select IMX_HAVE_PLATFORM_IMX_SSI | ||
176 | select IMX_HAVE_PLATFORM_IMX_UART | 186 | select IMX_HAVE_PLATFORM_IMX_UART |
177 | select IMX_HAVE_PLATFORM_MXC_NAND | 187 | select IMX_HAVE_PLATFORM_MXC_NAND |
178 | select IMX_HAVE_PLATFORM_SPI_IMX | 188 | select IMX_HAVE_PLATFORM_SPI_IMX |
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 46a9fdfbbd15..5582692bb176 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -27,6 +27,7 @@ obj-$(CONFIG_MACH_PCM038) += mach-pcm038.o | |||
27 | obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o | 27 | obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o |
28 | obj-$(CONFIG_MACH_MX27_3DS) += mach-mx27_3ds.o | 28 | obj-$(CONFIG_MACH_MX27_3DS) += mach-mx27_3ds.o |
29 | obj-$(CONFIG_MACH_IMX27LITE) += mach-imx27lite.o | 29 | obj-$(CONFIG_MACH_IMX27LITE) += mach-imx27lite.o |
30 | obj-$(CONFIG_MACH_IMX27_VISSTRIM_M10) += mach-imx27_visstrim_m10.o | ||
30 | obj-$(CONFIG_MACH_CPUIMX27) += mach-cpuimx27.o | 31 | obj-$(CONFIG_MACH_CPUIMX27) += mach-cpuimx27.o |
31 | obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o | 32 | obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o |
32 | obj-$(CONFIG_MACH_PCA100) += mach-pca100.o | 33 | obj-$(CONFIG_MACH_PCA100) += mach-pca100.o |
diff --git a/arch/arm/mach-imx/clock-imx1.c b/arch/arm/mach-imx/clock-imx1.c index c05096c38301..daca30b2d5b1 100644 --- a/arch/arm/mach-imx/clock-imx1.c +++ b/arch/arm/mach-imx/clock-imx1.c | |||
@@ -592,7 +592,7 @@ static struct clk_lookup lookups[] __initdata = { | |||
592 | _REGISTER_CLOCK("imx-uart.1", NULL, uart_clk) | 592 | _REGISTER_CLOCK("imx-uart.1", NULL, uart_clk) |
593 | _REGISTER_CLOCK("imx-uart.2", NULL, uart_clk) | 593 | _REGISTER_CLOCK("imx-uart.2", NULL, uart_clk) |
594 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk) | 594 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk) |
595 | _REGISTER_CLOCK("spi_imx.0", NULL, spi_clk) | 595 | _REGISTER_CLOCK("imx1-cspi.0", NULL, spi_clk) |
596 | _REGISTER_CLOCK("imx-mmc.0", NULL, sdhc_clk) | 596 | _REGISTER_CLOCK("imx-mmc.0", NULL, sdhc_clk) |
597 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) | 597 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) |
598 | _REGISTER_CLOCK(NULL, "mshc", mshc_clk) | 598 | _REGISTER_CLOCK(NULL, "mshc", mshc_clk) |
diff --git a/arch/arm/mach-imx/clock-imx21.c b/arch/arm/mach-imx/clock-imx21.c index bb419ef4d133..cf15ea516a72 100644 --- a/arch/arm/mach-imx/clock-imx21.c +++ b/arch/arm/mach-imx/clock-imx21.c | |||
@@ -1172,9 +1172,9 @@ static struct clk_lookup lookups[] = { | |||
1172 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk[0]) | 1172 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk[0]) |
1173 | _REGISTER_CLOCK(NULL, "sdhc1", sdhc_clk[0]) | 1173 | _REGISTER_CLOCK(NULL, "sdhc1", sdhc_clk[0]) |
1174 | _REGISTER_CLOCK(NULL, "sdhc2", sdhc_clk[1]) | 1174 | _REGISTER_CLOCK(NULL, "sdhc2", sdhc_clk[1]) |
1175 | _REGISTER_CLOCK(NULL, "cspi1", cspi_clk[0]) | 1175 | _REGISTER_CLOCK("imx21-cspi.0", NULL, cspi_clk[0]) |
1176 | _REGISTER_CLOCK(NULL, "cspi2", cspi_clk[1]) | 1176 | _REGISTER_CLOCK("imx21-cspi.1", NULL, cspi_clk[1]) |
1177 | _REGISTER_CLOCK(NULL, "cspi3", cspi_clk[2]) | 1177 | _REGISTER_CLOCK("imx21-cspi.2", NULL, cspi_clk[2]) |
1178 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0]) | 1178 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0]) |
1179 | _REGISTER_CLOCK(NULL, "csi", csi_clk[0]) | 1179 | _REGISTER_CLOCK(NULL, "csi", csi_clk[0]) |
1180 | _REGISTER_CLOCK("imx21-hcd.0", NULL, usb_clk[0]) | 1180 | _REGISTER_CLOCK("imx21-hcd.0", NULL, usb_clk[0]) |
diff --git a/arch/arm/mach-imx/clock-imx27.c b/arch/arm/mach-imx/clock-imx27.c index 5a1aa15c8a16..98a25bada783 100644 --- a/arch/arm/mach-imx/clock-imx27.c +++ b/arch/arm/mach-imx/clock-imx27.c | |||
@@ -594,27 +594,27 @@ DEFINE_CLOCK(uart2_clk1, 0, PCCR1, 30, NULL, NULL, &ipg_clk); | |||
594 | DEFINE_CLOCK(uart1_clk1, 0, PCCR1, 31, NULL, NULL, &ipg_clk); | 594 | DEFINE_CLOCK(uart1_clk1, 0, PCCR1, 31, NULL, NULL, &ipg_clk); |
595 | 595 | ||
596 | /* Clocks we cannot directly gate, but drivers need their rates */ | 596 | /* Clocks we cannot directly gate, but drivers need their rates */ |
597 | DEFINE_CLOCK(cspi1_clk, 0, 0, 0, NULL, &cspi1_clk1, &per2_clk); | 597 | DEFINE_CLOCK(cspi1_clk, 0, NULL, 0, NULL, &cspi1_clk1, &per2_clk); |
598 | DEFINE_CLOCK(cspi2_clk, 1, 0, 0, NULL, &cspi2_clk1, &per2_clk); | 598 | DEFINE_CLOCK(cspi2_clk, 1, NULL, 0, NULL, &cspi2_clk1, &per2_clk); |
599 | DEFINE_CLOCK(cspi3_clk, 2, 0, 0, NULL, &cspi13_clk1, &per2_clk); | 599 | DEFINE_CLOCK(cspi3_clk, 2, NULL, 0, NULL, &cspi13_clk1, &per2_clk); |
600 | DEFINE_CLOCK(sdhc1_clk, 0, 0, 0, NULL, &sdhc1_clk1, &per2_clk); | 600 | DEFINE_CLOCK(sdhc1_clk, 0, NULL, 0, NULL, &sdhc1_clk1, &per2_clk); |
601 | DEFINE_CLOCK(sdhc2_clk, 1, 0, 0, NULL, &sdhc2_clk1, &per2_clk); | 601 | DEFINE_CLOCK(sdhc2_clk, 1, NULL, 0, NULL, &sdhc2_clk1, &per2_clk); |
602 | DEFINE_CLOCK(sdhc3_clk, 2, 0, 0, NULL, &sdhc3_clk1, &per2_clk); | 602 | DEFINE_CLOCK(sdhc3_clk, 2, NULL, 0, NULL, &sdhc3_clk1, &per2_clk); |
603 | DEFINE_CLOCK(pwm_clk, 0, 0, 0, NULL, &pwm_clk1, &per1_clk); | 603 | DEFINE_CLOCK(pwm_clk, 0, NULL, 0, NULL, &pwm_clk1, &per1_clk); |
604 | DEFINE_CLOCK(gpt1_clk, 0, 0, 0, NULL, &gpt1_clk1, &per1_clk); | 604 | DEFINE_CLOCK(gpt1_clk, 0, NULL, 0, NULL, &gpt1_clk1, &per1_clk); |
605 | DEFINE_CLOCK(gpt2_clk, 1, 0, 0, NULL, &gpt2_clk1, &per1_clk); | 605 | DEFINE_CLOCK(gpt2_clk, 1, NULL, 0, NULL, &gpt2_clk1, &per1_clk); |
606 | DEFINE_CLOCK(gpt3_clk, 2, 0, 0, NULL, &gpt3_clk1, &per1_clk); | 606 | DEFINE_CLOCK(gpt3_clk, 2, NULL, 0, NULL, &gpt3_clk1, &per1_clk); |
607 | DEFINE_CLOCK(gpt4_clk, 3, 0, 0, NULL, &gpt4_clk1, &per1_clk); | 607 | DEFINE_CLOCK(gpt4_clk, 3, NULL, 0, NULL, &gpt4_clk1, &per1_clk); |
608 | DEFINE_CLOCK(gpt5_clk, 4, 0, 0, NULL, &gpt5_clk1, &per1_clk); | 608 | DEFINE_CLOCK(gpt5_clk, 4, NULL, 0, NULL, &gpt5_clk1, &per1_clk); |
609 | DEFINE_CLOCK(gpt6_clk, 5, 0, 0, NULL, &gpt6_clk1, &per1_clk); | 609 | DEFINE_CLOCK(gpt6_clk, 5, NULL, 0, NULL, &gpt6_clk1, &per1_clk); |
610 | DEFINE_CLOCK(uart1_clk, 0, 0, 0, NULL, &uart1_clk1, &per1_clk); | 610 | DEFINE_CLOCK(uart1_clk, 0, NULL, 0, NULL, &uart1_clk1, &per1_clk); |
611 | DEFINE_CLOCK(uart2_clk, 1, 0, 0, NULL, &uart2_clk1, &per1_clk); | 611 | DEFINE_CLOCK(uart2_clk, 1, NULL, 0, NULL, &uart2_clk1, &per1_clk); |
612 | DEFINE_CLOCK(uart3_clk, 2, 0, 0, NULL, &uart3_clk1, &per1_clk); | 612 | DEFINE_CLOCK(uart3_clk, 2, NULL, 0, NULL, &uart3_clk1, &per1_clk); |
613 | DEFINE_CLOCK(uart4_clk, 3, 0, 0, NULL, &uart4_clk1, &per1_clk); | 613 | DEFINE_CLOCK(uart4_clk, 3, NULL, 0, NULL, &uart4_clk1, &per1_clk); |
614 | DEFINE_CLOCK(uart5_clk, 4, 0, 0, NULL, &uart5_clk1, &per1_clk); | 614 | DEFINE_CLOCK(uart5_clk, 4, NULL, 0, NULL, &uart5_clk1, &per1_clk); |
615 | DEFINE_CLOCK(uart6_clk, 5, 0, 0, NULL, &uart6_clk1, &per1_clk); | 615 | DEFINE_CLOCK(uart6_clk, 5, NULL, 0, NULL, &uart6_clk1, &per1_clk); |
616 | DEFINE_CLOCK1(lcdc_clk, 0, 0, 0, parent, &lcdc_clk1, &per3_clk); | 616 | DEFINE_CLOCK1(lcdc_clk, 0, NULL, 0, parent, &lcdc_clk1, &per3_clk); |
617 | DEFINE_CLOCK1(csi_clk, 0, 0, 0, parent, &csi_clk1, &per4_clk); | 617 | DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk); |
618 | 618 | ||
619 | #define _REGISTER_CLOCK(d, n, c) \ | 619 | #define _REGISTER_CLOCK(d, n, c) \ |
620 | { \ | 620 | { \ |
@@ -640,9 +640,9 @@ static struct clk_lookup lookups[] = { | |||
640 | _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk) | 640 | _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk) |
641 | _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk) | 641 | _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk) |
642 | _REGISTER_CLOCK("mxc-mmc.2", NULL, sdhc3_clk) | 642 | _REGISTER_CLOCK("mxc-mmc.2", NULL, sdhc3_clk) |
643 | _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk) | 643 | _REGISTER_CLOCK("imx27-cspi.0", NULL, cspi1_clk) |
644 | _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk) | 644 | _REGISTER_CLOCK("imx27-cspi.1", NULL, cspi2_clk) |
645 | _REGISTER_CLOCK("spi_imx.2", NULL, cspi3_clk) | 645 | _REGISTER_CLOCK("imx27-cspi.2", NULL, cspi3_clk) |
646 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) | 646 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) |
647 | _REGISTER_CLOCK("mx2-camera.0", NULL, csi_clk) | 647 | _REGISTER_CLOCK("mx2-camera.0", NULL, csi_clk) |
648 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk) | 648 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk) |
diff --git a/arch/arm/mach-imx/devices-imx1.h b/arch/arm/mach-imx/devices-imx1.h index a8d94f078196..81979486218e 100644 --- a/arch/arm/mach-imx/devices-imx1.h +++ b/arch/arm/mach-imx/devices-imx1.h | |||
@@ -9,10 +9,12 @@ | |||
9 | #include <mach/mx1.h> | 9 | #include <mach/mx1.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | #define imx1_add_i2c_imx(pdata) \ | 12 | extern const struct imx_imx_i2c_data imx1_imx_i2c_data __initconst; |
13 | imx_add_imx_i2c(0, MX1_I2C_BASE_ADDR, SZ_4K, MX1_INT_I2C, pdata) | 13 | #define imx1_add_imx_i2c(pdata) \ |
14 | imx_add_imx_i2c(&imx1_imx_i2c_data, pdata) | ||
14 | 15 | ||
15 | #define imx1_add_imx_uart0(pdata) \ | 16 | extern const struct imx_imx_uart_3irq_data imx1_imx_uart_data[] __initconst; |
16 | imx_add_imx_uart_3irq(0, MX1_UART1_BASE_ADDR, 0xd0, MX1_INT_UART1RX, MX1_INT_UART1TX, MX1_INT_UART1RTS, pdata) | 17 | #define imx1_add_imx_uart(id, pdata) \ |
17 | #define imx1_add_imx_uart1(pdata) \ | 18 | imx_add_imx_uart_3irq(&imx1_imx_uart_data[id], pdata) |
18 | imx_add_imx_uart_3irq(0, MX1_UART2_BASE_ADDR, 0xd0, MX1_INT_UART2RX, MX1_INT_UART2TX, MX1_INT_UART2RTS, pdata) | 19 | #define imx1_add_imx_uart0(pdata) imx1_add_imx_uart(0, pdata) |
20 | #define imx1_add_imx_uart1(pdata) imx1_add_imx_uart(1, pdata) | ||
diff --git a/arch/arm/mach-imx/devices-imx21.h b/arch/arm/mach-imx/devices-imx21.h index 42788e99d127..d189039749b0 100644 --- a/arch/arm/mach-imx/devices-imx21.h +++ b/arch/arm/mach-imx/devices-imx21.h | |||
@@ -9,22 +9,28 @@ | |||
9 | #include <mach/mx21.h> | 9 | #include <mach/mx21.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | #define imx21_add_i2c_imx(pdata) \ | 12 | extern const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst; |
13 | imx_add_imx_i2c(0, MX2x_I2C_BASE_ADDR, SZ_4K, MX2x_INT_I2C, pdata) | 13 | #define imx21_add_imx_i2c(pdata) \ |
14 | imx_add_imx_i2c(&imx21_imx_i2c_data, pdata) | ||
14 | 15 | ||
15 | #define imx21_add_imx_uart0(pdata) \ | 16 | extern const struct imx_imx_ssi_data imx21_imx_ssi_data[] __initconst; |
16 | imx_add_imx_uart_1irq(0, MX21_UART1_BASE_ADDR, SZ_4K, MX21_INT_UART1, pdata) | 17 | #define imx21_add_imx_ssi(id, pdata) \ |
17 | #define imx21_add_imx_uart1(pdata) \ | 18 | imx_add_imx_ssi(&imx21_imx_ssi_data[id], pdata) |
18 | imx_add_imx_uart_1irq(1, MX21_UART2_BASE_ADDR, SZ_4K, MX21_INT_UART2, pdata) | ||
19 | #define imx21_add_imx_uart2(pdata) \ | ||
20 | imx_add_imx_uart_1irq(2, MX21_UART3_BASE_ADDR, SZ_4K, MX21_INT_UART3, pdata) | ||
21 | #define imx21_add_imx_uart3(pdata) \ | ||
22 | imx_add_imx_uart_1irq(3, MX21_UART4_BASE_ADDR, SZ_4K, MX21_INT_UART4, pdata) | ||
23 | 19 | ||
20 | extern const struct imx_imx_uart_1irq_data imx21_imx_uart_data[] __initconst; | ||
21 | #define imx21_add_imx_uart(id, pdata) \ | ||
22 | imx_add_imx_uart_1irq(&imx21_imx_uart_data[id], pdata) | ||
23 | #define imx21_add_imx_uart0(pdata) imx21_add_imx_uart(0, pdata) | ||
24 | #define imx21_add_imx_uart1(pdata) imx21_add_imx_uart(1, pdata) | ||
25 | #define imx21_add_imx_uart2(pdata) imx21_add_imx_uart(2, pdata) | ||
26 | #define imx21_add_imx_uart3(pdata) imx21_add_imx_uart(3, pdata) | ||
27 | |||
28 | extern const struct imx_mxc_nand_data imx21_mxc_nand_data __initconst; | ||
24 | #define imx21_add_mxc_nand(pdata) \ | 29 | #define imx21_add_mxc_nand(pdata) \ |
25 | imx_add_mxc_nand_v1(MX21_NFC_BASE_ADDR, MX21_INT_NANDFC, pdata) | 30 | imx_add_mxc_nand(&imx21_mxc_nand_data, pdata) |
26 | 31 | ||
27 | #define imx21_add_spi_imx0(pdata) \ | 32 | extern const struct imx_spi_imx_data imx21_cspi_data[] __initconst; |
28 | imx_add_spi_imx(0, MX21_CSPI1_BASE_ADDR, SZ_4K, MX21_INT_CSPI1, pdata) | 33 | #define imx21_add_cspi(id, pdata) \ |
29 | #define imx21_add_spi_imx1(pdata) \ | 34 | imx_add_spi_imx(&imx21_cspi_data[id], pdata) |
30 | imx_add_spi_imx(1, MX21_CSPI2_BASE_ADDR, SZ_4K, MX21_INT_CSPI2, pdata) | 35 | #define imx21_add_spi_imx0(pdata) imx21_add_cspi(0, pdata) |
36 | #define imx21_add_spi_imx1(pdata) imx21_add_cspi(1, pdata) | ||
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h index 65e7bb7ec2e8..7011690364f2 100644 --- a/arch/arm/mach-imx/devices-imx27.h +++ b/arch/arm/mach-imx/devices-imx27.h | |||
@@ -9,30 +9,35 @@ | |||
9 | #include <mach/mx27.h> | 9 | #include <mach/mx27.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | #define imx27_add_i2c_imx0(pdata) \ | 12 | extern const struct imx_fec_data imx27_fec_data __initconst; |
13 | imx_add_imx_i2c(0, MX27_I2C1_BASE_ADDR, SZ_4K, MX27_INT_I2C1, pdata) | 13 | #define imx27_add_fec(pdata) \ |
14 | #define imx27_add_i2c_imx1(pdata) \ | 14 | imx_add_fec(&imx27_fec_data, pdata) |
15 | imx_add_imx_i2c(1, MX27_I2C2_BASE_ADDR, SZ_4K, MX27_INT_I2C2, pdata) | ||
16 | 15 | ||
17 | #define imx27_add_imx_uart0(pdata) \ | 16 | extern const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst; |
18 | imx_add_imx_uart_1irq(0, MX27_UART1_BASE_ADDR, SZ_4K, MX27_INT_UART1, pdata) | 17 | #define imx27_add_imx_i2c(id, pdata) \ |
19 | #define imx27_add_imx_uart1(pdata) \ | 18 | imx_add_imx_i2c(&imx27_imx_i2c_data[id], pdata) |
20 | imx_add_imx_uart_1irq(1, MX27_UART2_BASE_ADDR, SZ_4K, MX27_INT_UART2, pdata) | ||
21 | #define imx27_add_imx_uart2(pdata) \ | ||
22 | imx_add_imx_uart_1irq(2, MX27_UART3_BASE_ADDR, SZ_4K, MX27_INT_UART3, pdata) | ||
23 | #define imx27_add_imx_uart3(pdata) \ | ||
24 | imx_add_imx_uart_1irq(3, MX27_UART4_BASE_ADDR, SZ_4K, MX27_INT_UART4, pdata) | ||
25 | #define imx27_add_imx_uart4(pdata) \ | ||
26 | imx_add_imx_uart_1irq(4, MX27_UART5_BASE_ADDR, SZ_4K, MX27_INT_UART5, pdata) | ||
27 | #define imx27_add_imx_uart5(pdata) \ | ||
28 | imx_add_imx_uart_1irq(5, MX27_UART6_BASE_ADDR, SZ_4K, MX27_INT_UART6, pdata) | ||
29 | 19 | ||
20 | extern const struct imx_imx_ssi_data imx27_imx_ssi_data[] __initconst; | ||
21 | #define imx27_add_imx_ssi(id, pdata) \ | ||
22 | imx_add_imx_ssi(&imx27_imx_ssi_data[id], pdata) | ||
23 | |||
24 | extern const struct imx_imx_uart_1irq_data imx27_imx_uart_data[] __initconst; | ||
25 | #define imx27_add_imx_uart(id, pdata) \ | ||
26 | imx_add_imx_uart_1irq(&imx27_imx_uart_data[id], pdata) | ||
27 | #define imx27_add_imx_uart0(pdata) imx27_add_imx_uart(0, pdata) | ||
28 | #define imx27_add_imx_uart1(pdata) imx27_add_imx_uart(1, pdata) | ||
29 | #define imx27_add_imx_uart2(pdata) imx27_add_imx_uart(2, pdata) | ||
30 | #define imx27_add_imx_uart3(pdata) imx27_add_imx_uart(3, pdata) | ||
31 | #define imx27_add_imx_uart4(pdata) imx27_add_imx_uart(4, pdata) | ||
32 | #define imx27_add_imx_uart5(pdata) imx27_add_imx_uart(5, pdata) | ||
33 | |||
34 | extern const struct imx_mxc_nand_data imx27_mxc_nand_data __initconst; | ||
30 | #define imx27_add_mxc_nand(pdata) \ | 35 | #define imx27_add_mxc_nand(pdata) \ |
31 | imx_add_mxc_nand_v1(MX27_NFC_BASE_ADDR, MX27_INT_NANDFC, pdata) | 36 | imx_add_mxc_nand(&imx27_mxc_nand_data, pdata) |
32 | 37 | ||
33 | #define imx27_add_spi_imx0(pdata) \ | 38 | extern const struct imx_spi_imx_data imx27_cspi_data[] __initconst; |
34 | imx_add_spi_imx(0, MX27_CSPI1_BASE_ADDR, SZ_4K, MX27_INT_CSPI1, pdata) | 39 | #define imx27_add_cspi(id, pdata) \ |
35 | #define imx27_add_spi_imx1(pdata) \ | 40 | imx_add_spi_imx(&imx27_cspi_data[id], pdata) |
36 | imx_add_spi_imx(1, MX27_CSPI2_BASE_ADDR, SZ_4K, MX27_INT_CSPI2, pdata) | 41 | #define imx27_add_spi_imx0(pdata) imx27_add_cspi(0, pdata) |
37 | #define imx27_add_spi_imx2(pdata) \ | 42 | #define imx27_add_spi_imx1(pdata) imx27_add_cspi(1, pdata) |
38 | imx_add_spi_imx(2, MX27_CSPI3_BASE_ADDR, SZ_4K, MX27_INT_CSPI3, pdata) | 43 | #define imx27_add_spi_imx2(pdata) imx27_add_cspi(2, pdata) |
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c index 9c271a752b84..fba5047de8b1 100644 --- a/arch/arm/mach-imx/devices.c +++ b/arch/arm/mach-imx/devices.c | |||
@@ -314,27 +314,6 @@ struct platform_device mxc_fb_device = { | |||
314 | }, | 314 | }, |
315 | }; | 315 | }; |
316 | 316 | ||
317 | #ifdef CONFIG_MACH_MX27 | ||
318 | static struct resource mxc_fec_resources[] = { | ||
319 | { | ||
320 | .start = MX27_FEC_BASE_ADDR, | ||
321 | .end = MX27_FEC_BASE_ADDR + SZ_4K - 1, | ||
322 | .flags = IORESOURCE_MEM, | ||
323 | }, { | ||
324 | .start = MX27_INT_FEC, | ||
325 | .end = MX27_INT_FEC, | ||
326 | .flags = IORESOURCE_IRQ, | ||
327 | }, | ||
328 | }; | ||
329 | |||
330 | struct platform_device mxc_fec_device = { | ||
331 | .name = "fec", | ||
332 | .id = 0, | ||
333 | .num_resources = ARRAY_SIZE(mxc_fec_resources), | ||
334 | .resource = mxc_fec_resources, | ||
335 | }; | ||
336 | #endif | ||
337 | |||
338 | static struct resource mxc_pwm_resources[] = { | 317 | static struct resource mxc_pwm_resources[] = { |
339 | { | 318 | { |
340 | .start = MX2x_PWM_BASE_ADDR, | 319 | .start = MX2x_PWM_BASE_ADDR, |
@@ -480,41 +459,6 @@ struct platform_device mxc_usbh2 = { | |||
480 | }; | 459 | }; |
481 | #endif | 460 | #endif |
482 | 461 | ||
483 | #define DEFINE_IMX_SSI_DMARES(_name, ssin, suffix) \ | ||
484 | { \ | ||
485 | .name = _name, \ | ||
486 | .start = MX2x_DMA_REQ_SSI ## ssin ## _ ## suffix, \ | ||
487 | .end = MX2x_DMA_REQ_SSI ## ssin ## _ ## suffix, \ | ||
488 | .flags = IORESOURCE_DMA, \ | ||
489 | } | ||
490 | |||
491 | #define DEFINE_IMX_SSI_DEVICE(n, ssin, baseaddr, irq) \ | ||
492 | static struct resource imx_ssi_resources ## n[] = { \ | ||
493 | { \ | ||
494 | .start = MX2x_SSI ## ssin ## _BASE_ADDR, \ | ||
495 | .end = MX2x_SSI ## ssin ## _BASE_ADDR + 0x6f, \ | ||
496 | .flags = IORESOURCE_MEM, \ | ||
497 | }, { \ | ||
498 | .start = MX2x_INT_SSI1, \ | ||
499 | .end = MX2x_INT_SSI1, \ | ||
500 | .flags = IORESOURCE_IRQ, \ | ||
501 | }, \ | ||
502 | DEFINE_IMX_SSI_DMARES("tx0", ssin, TX0), \ | ||
503 | DEFINE_IMX_SSI_DMARES("rx0", ssin, RX0), \ | ||
504 | DEFINE_IMX_SSI_DMARES("tx1", ssin, TX1), \ | ||
505 | DEFINE_IMX_SSI_DMARES("rx1", ssin, RX1), \ | ||
506 | }; \ | ||
507 | \ | ||
508 | struct platform_device imx_ssi_device ## n = { \ | ||
509 | .name = "imx-ssi", \ | ||
510 | .id = n, \ | ||
511 | .num_resources = ARRAY_SIZE(imx_ssi_resources ## n), \ | ||
512 | .resource = imx_ssi_resources ## n, \ | ||
513 | } | ||
514 | |||
515 | DEFINE_IMX_SSI_DEVICE(0, 1, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1); | ||
516 | DEFINE_IMX_SSI_DEVICE(1, 2, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1); | ||
517 | |||
518 | /* GPIO port description */ | 462 | /* GPIO port description */ |
519 | #define DEFINE_MXC_GPIO_PORT_IRQ(SOC, n, _irq) \ | 463 | #define DEFINE_MXC_GPIO_PORT_IRQ(SOC, n, _irq) \ |
520 | { \ | 464 | { \ |
diff --git a/arch/arm/mach-imx/devices.h b/arch/arm/mach-imx/devices.h index efd4527506a5..807f02a031c9 100644 --- a/arch/arm/mach-imx/devices.h +++ b/arch/arm/mach-imx/devices.h | |||
@@ -16,7 +16,6 @@ extern struct platform_device mxc_gpt5; | |||
16 | extern struct platform_device mxc_wdt; | 16 | extern struct platform_device mxc_wdt; |
17 | extern struct platform_device mxc_w1_master_device; | 17 | extern struct platform_device mxc_w1_master_device; |
18 | extern struct platform_device mxc_fb_device; | 18 | extern struct platform_device mxc_fb_device; |
19 | extern struct platform_device mxc_fec_device; | ||
20 | extern struct platform_device mxc_pwm_device; | 19 | extern struct platform_device mxc_pwm_device; |
21 | extern struct platform_device mxc_sdhc_device0; | 20 | extern struct platform_device mxc_sdhc_device0; |
22 | extern struct platform_device mxc_sdhc_device1; | 21 | extern struct platform_device mxc_sdhc_device1; |
@@ -26,7 +25,5 @@ extern struct platform_device mxc_otg_host; | |||
26 | extern struct platform_device mxc_usbh1; | 25 | extern struct platform_device mxc_usbh1; |
27 | extern struct platform_device mxc_usbh2; | 26 | extern struct platform_device mxc_usbh2; |
28 | extern struct platform_device mx21_usbhc_device; | 27 | extern struct platform_device mx21_usbhc_device; |
29 | extern struct platform_device imx_ssi_device0; | ||
30 | extern struct platform_device imx_ssi_device1; | ||
31 | extern struct platform_device imx_kpp_device; | 28 | extern struct platform_device imx_kpp_device; |
32 | #endif | 29 | #endif |
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c index 4edc5f439201..026263c665ca 100644 --- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | |||
@@ -36,13 +36,12 @@ | |||
36 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
37 | #include <mach/mmc.h> | 37 | #include <mach/mmc.h> |
38 | #include <mach/spi.h> | 38 | #include <mach/spi.h> |
39 | #include <mach/ssi.h> | ||
40 | #include <mach/audmux.h> | 39 | #include <mach/audmux.h> |
41 | 40 | ||
42 | #include "devices-imx27.h" | 41 | #include "devices-imx27.h" |
43 | #include "devices.h" | 42 | #include "devices.h" |
44 | 43 | ||
45 | static int eukrea_mbimx27_pins[] = { | 44 | static const int eukrea_mbimx27_pins[] __initconst = { |
46 | /* UART2 */ | 45 | /* UART2 */ |
47 | PE3_PF_UART2_CTS, | 46 | PE3_PF_UART2_CTS, |
48 | PE4_PF_UART2_RTS, | 47 | PE4_PF_UART2_RTS, |
@@ -311,7 +310,8 @@ static struct imxmmc_platform_data sdhc_pdata = { | |||
311 | .dat3_card_detect = 1, | 310 | .dat3_card_detect = 1, |
312 | }; | 311 | }; |
313 | 312 | ||
314 | struct imx_ssi_platform_data eukrea_mbimx27_ssi_pdata = { | 313 | static const |
314 | struct imx_ssi_platform_data eukrea_mbimx27_ssi_pdata __initconst = { | ||
315 | .flags = IMX_SSI_DMA | IMX_SSI_USE_I2S_SLAVE, | 315 | .flags = IMX_SSI_DMA | IMX_SSI_USE_I2S_SLAVE, |
316 | }; | 316 | }; |
317 | 317 | ||
@@ -357,7 +357,7 @@ void __init eukrea_mbimx27_baseboard_init(void) | |||
357 | i2c_register_board_info(0, eukrea_mbimx27_i2c_devices, | 357 | i2c_register_board_info(0, eukrea_mbimx27_i2c_devices, |
358 | ARRAY_SIZE(eukrea_mbimx27_i2c_devices)); | 358 | ARRAY_SIZE(eukrea_mbimx27_i2c_devices)); |
359 | 359 | ||
360 | mxc_register_device(&imx_ssi_device0, &eukrea_mbimx27_ssi_pdata); | 360 | imx27_add_imx_ssi(0, &eukrea_mbimx27_ssi_pdata); |
361 | 361 | ||
362 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) \ | 362 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) \ |
363 | || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | 363 | || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) |
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c index 339150ab0ea5..28f73a1c79f7 100644 --- a/arch/arm/mach-imx/mach-cpuimx27.c +++ b/arch/arm/mach-imx/mach-cpuimx27.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include "devices-imx27.h" | 46 | #include "devices-imx27.h" |
47 | #include "devices.h" | 47 | #include "devices.h" |
48 | 48 | ||
49 | static int eukrea_cpuimx27_pins[] = { | 49 | static const int eukrea_cpuimx27_pins[] __initconst = { |
50 | /* UART1 */ | 50 | /* UART1 */ |
51 | PE12_PF_UART1_TXD, | 51 | PE12_PF_UART1_TXD, |
52 | PE13_PF_UART1_RXD, | 52 | PE13_PF_UART1_RXD, |
@@ -157,7 +157,6 @@ cpuimx27_nand_board_info __initconst = { | |||
157 | 157 | ||
158 | static struct platform_device *platform_devices[] __initdata = { | 158 | static struct platform_device *platform_devices[] __initdata = { |
159 | &eukrea_cpuimx27_nor_mtd_device, | 159 | &eukrea_cpuimx27_nor_mtd_device, |
160 | &mxc_fec_device, | ||
161 | &mxc_wdt, | 160 | &mxc_wdt, |
162 | &mxc_w1_master_device, | 161 | &mxc_w1_master_device, |
163 | }; | 162 | }; |
@@ -259,8 +258,9 @@ static void __init eukrea_cpuimx27_init(void) | |||
259 | i2c_register_board_info(0, eukrea_cpuimx27_i2c_devices, | 258 | i2c_register_board_info(0, eukrea_cpuimx27_i2c_devices, |
260 | ARRAY_SIZE(eukrea_cpuimx27_i2c_devices)); | 259 | ARRAY_SIZE(eukrea_cpuimx27_i2c_devices)); |
261 | 260 | ||
262 | imx27_add_i2c_imx1(&cpuimx27_i2c1_data); | 261 | imx27_add_imx_i2c(1, &cpuimx27_i2c1_data); |
263 | 262 | ||
263 | imx27_add_fec(NULL); | ||
264 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 264 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
265 | 265 | ||
266 | #if defined(CONFIG_MACH_EUKREA_CPUIMX27_USESDHC2) | 266 | #if defined(CONFIG_MACH_EUKREA_CPUIMX27_USESDHC2) |
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c new file mode 100644 index 000000000000..a0d78faa08e8 --- /dev/null +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c | |||
@@ -0,0 +1,263 @@ | |||
1 | /* | ||
2 | * mach-imx27_visstrim_m10.c | ||
3 | * | ||
4 | * Copyright 2010 Javier Martin <javier.martin@vista-silicon.com> | ||
5 | * | ||
6 | * Based on mach-pcm038.c, mach-pca100.c, mach-mx27ads.c and others. | ||
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; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
21 | * MA 02110-1301, USA. | ||
22 | */ | ||
23 | |||
24 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
25 | |||
26 | #include <linux/platform_device.h> | ||
27 | #include <linux/mtd/physmap.h> | ||
28 | #include <linux/i2c.h> | ||
29 | #include <linux/i2c/pca953x.h> | ||
30 | #include <linux/gpio_keys.h> | ||
31 | #include <linux/input.h> | ||
32 | #include <linux/gpio.h> | ||
33 | #include <asm/mach-types.h> | ||
34 | #include <asm/mach/arch.h> | ||
35 | #include <asm/mach/time.h> | ||
36 | #include <mach/common.h> | ||
37 | #include <mach/mmc.h> | ||
38 | #include <mach/iomux.h> | ||
39 | #include <mach/mxc_ehci.h> | ||
40 | |||
41 | #include "devices-imx27.h" | ||
42 | #include "devices.h" | ||
43 | |||
44 | #define OTG_PHY_CS_GPIO (GPIO_PORTF + 17) | ||
45 | #define SDHC1_IRQ IRQ_GPIOB(25) | ||
46 | |||
47 | static const int visstrim_m10_pins[] __initconst = { | ||
48 | /* UART1 (console) */ | ||
49 | PE12_PF_UART1_TXD, | ||
50 | PE13_PF_UART1_RXD, | ||
51 | PE14_PF_UART1_CTS, | ||
52 | PE15_PF_UART1_RTS, | ||
53 | /* FEC */ | ||
54 | PD0_AIN_FEC_TXD0, | ||
55 | PD1_AIN_FEC_TXD1, | ||
56 | PD2_AIN_FEC_TXD2, | ||
57 | PD3_AIN_FEC_TXD3, | ||
58 | PD4_AOUT_FEC_RX_ER, | ||
59 | PD5_AOUT_FEC_RXD1, | ||
60 | PD6_AOUT_FEC_RXD2, | ||
61 | PD7_AOUT_FEC_RXD3, | ||
62 | PD8_AF_FEC_MDIO, | ||
63 | PD9_AIN_FEC_MDC, | ||
64 | PD10_AOUT_FEC_CRS, | ||
65 | PD11_AOUT_FEC_TX_CLK, | ||
66 | PD12_AOUT_FEC_RXD0, | ||
67 | PD13_AOUT_FEC_RX_DV, | ||
68 | PD14_AOUT_FEC_RX_CLK, | ||
69 | PD15_AOUT_FEC_COL, | ||
70 | PD16_AIN_FEC_TX_ER, | ||
71 | PF23_AIN_FEC_TX_EN, | ||
72 | /* SDHC1 */ | ||
73 | PE18_PF_SD1_D0, | ||
74 | PE19_PF_SD1_D1, | ||
75 | PE20_PF_SD1_D2, | ||
76 | PE21_PF_SD1_D3, | ||
77 | PE22_PF_SD1_CMD, | ||
78 | PE23_PF_SD1_CLK, | ||
79 | /* Both I2Cs */ | ||
80 | PD17_PF_I2C_DATA, | ||
81 | PD18_PF_I2C_CLK, | ||
82 | PC5_PF_I2C2_SDA, | ||
83 | PC6_PF_I2C2_SCL, | ||
84 | /* USB OTG */ | ||
85 | OTG_PHY_CS_GPIO | GPIO_GPIO | GPIO_OUT, | ||
86 | PC9_PF_USBOTG_DATA0, | ||
87 | PC11_PF_USBOTG_DATA1, | ||
88 | PC10_PF_USBOTG_DATA2, | ||
89 | PC13_PF_USBOTG_DATA3, | ||
90 | PC12_PF_USBOTG_DATA4, | ||
91 | PC7_PF_USBOTG_DATA5, | ||
92 | PC8_PF_USBOTG_DATA6, | ||
93 | PE25_PF_USBOTG_DATA7, | ||
94 | PE24_PF_USBOTG_CLK, | ||
95 | PE2_PF_USBOTG_DIR, | ||
96 | PE0_PF_USBOTG_NXT, | ||
97 | PE1_PF_USBOTG_STP, | ||
98 | PB23_PF_USB_PWR, | ||
99 | PB24_PF_USB_OC, | ||
100 | }; | ||
101 | |||
102 | /* GPIOs used as events for applications */ | ||
103 | static struct gpio_keys_button visstrim_gpio_keys[] = { | ||
104 | { | ||
105 | .type = EV_KEY, | ||
106 | .code = KEY_RESTART, | ||
107 | .gpio = (GPIO_PORTC + 15), | ||
108 | .desc = "Default config", | ||
109 | .active_low = 0, | ||
110 | .wakeup = 1, | ||
111 | }, | ||
112 | { | ||
113 | .type = EV_KEY, | ||
114 | .code = KEY_RECORD, | ||
115 | .gpio = (GPIO_PORTF + 14), | ||
116 | .desc = "Record", | ||
117 | .active_low = 0, | ||
118 | .wakeup = 1, | ||
119 | }, | ||
120 | { | ||
121 | .type = EV_KEY, | ||
122 | .code = KEY_STOP, | ||
123 | .gpio = (GPIO_PORTF + 13), | ||
124 | .desc = "Stop", | ||
125 | .active_low = 0, | ||
126 | .wakeup = 1, | ||
127 | } | ||
128 | }; | ||
129 | |||
130 | static struct gpio_keys_platform_data visstrim_gpio_keys_platform_data = { | ||
131 | .buttons = visstrim_gpio_keys, | ||
132 | .nbuttons = ARRAY_SIZE(visstrim_gpio_keys), | ||
133 | }; | ||
134 | |||
135 | static struct platform_device visstrim_gpio_keys_device = { | ||
136 | .name = "gpio-keys", | ||
137 | .id = -1, | ||
138 | .dev = { | ||
139 | .platform_data = &visstrim_gpio_keys_platform_data, | ||
140 | }, | ||
141 | }; | ||
142 | |||
143 | /* Visstrim_SM10 has a microSD slot connected to sdhc1 */ | ||
144 | static int visstrim_m10_sdhc1_init(struct device *dev, | ||
145 | irq_handler_t detect_irq, void *data) | ||
146 | { | ||
147 | int ret; | ||
148 | |||
149 | ret = request_irq(SDHC1_IRQ, detect_irq, IRQF_TRIGGER_FALLING, | ||
150 | "mmc-detect", data); | ||
151 | return ret; | ||
152 | } | ||
153 | |||
154 | static void visstrim_m10_sdhc1_exit(struct device *dev, void *data) | ||
155 | { | ||
156 | free_irq(SDHC1_IRQ, data); | ||
157 | } | ||
158 | |||
159 | static struct imxmmc_platform_data visstrim_m10_sdhc_pdata = { | ||
160 | .init = visstrim_m10_sdhc1_init, | ||
161 | .exit = visstrim_m10_sdhc1_exit, | ||
162 | }; | ||
163 | |||
164 | /* Visstrim_SM10 NOR flash */ | ||
165 | static struct physmap_flash_data visstrim_m10_flash_data = { | ||
166 | .width = 2, | ||
167 | }; | ||
168 | |||
169 | static struct resource visstrim_m10_flash_resource = { | ||
170 | .start = 0xc0000000, | ||
171 | .end = 0xc0000000 + SZ_64M - 1, | ||
172 | .flags = IORESOURCE_MEM, | ||
173 | }; | ||
174 | |||
175 | static struct platform_device visstrim_m10_nor_mtd_device = { | ||
176 | .name = "physmap-flash", | ||
177 | .id = 0, | ||
178 | .dev = { | ||
179 | .platform_data = &visstrim_m10_flash_data, | ||
180 | }, | ||
181 | .num_resources = 1, | ||
182 | .resource = &visstrim_m10_flash_resource, | ||
183 | }; | ||
184 | |||
185 | static struct platform_device *platform_devices[] __initdata = { | ||
186 | &visstrim_gpio_keys_device, | ||
187 | &visstrim_m10_nor_mtd_device, | ||
188 | }; | ||
189 | |||
190 | /* Visstrim_M10 uses UART0 as console */ | ||
191 | static const struct imxuart_platform_data uart_pdata __initconst = { | ||
192 | .flags = IMXUART_HAVE_RTSCTS, | ||
193 | }; | ||
194 | |||
195 | /* I2C */ | ||
196 | static const struct imxi2c_platform_data visstrim_m10_i2c_data __initconst = { | ||
197 | .bitrate = 100000, | ||
198 | }; | ||
199 | |||
200 | static struct pca953x_platform_data visstrim_m10_pca9555_pdata = { | ||
201 | .gpio_base = 240, /* After MX27 internal GPIOs */ | ||
202 | .invert = 0, | ||
203 | }; | ||
204 | |||
205 | static struct i2c_board_info visstrim_m10_i2c_devices[] = { | ||
206 | { | ||
207 | I2C_BOARD_INFO("pca9555", 0x20), | ||
208 | .platform_data = &visstrim_m10_pca9555_pdata, | ||
209 | }, | ||
210 | }; | ||
211 | |||
212 | /* USB OTG */ | ||
213 | static int otg_phy_init(struct platform_device *pdev) | ||
214 | { | ||
215 | gpio_set_value(OTG_PHY_CS_GPIO, 0); | ||
216 | return 0; | ||
217 | } | ||
218 | |||
219 | static struct mxc_usbh_platform_data visstrim_m10_usbotg_pdata = { | ||
220 | .init = otg_phy_init, | ||
221 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | ||
222 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
223 | }; | ||
224 | |||
225 | static void __init visstrim_m10_board_init(void) | ||
226 | { | ||
227 | int ret; | ||
228 | |||
229 | ret = mxc_gpio_setup_multiple_pins(visstrim_m10_pins, | ||
230 | ARRAY_SIZE(visstrim_m10_pins), "VISSTRIM_M10"); | ||
231 | if (ret) | ||
232 | pr_err("Failed to setup pins (%d)\n", ret); | ||
233 | |||
234 | imx27_add_imx_uart0(&uart_pdata); | ||
235 | |||
236 | i2c_register_board_info(0, visstrim_m10_i2c_devices, | ||
237 | ARRAY_SIZE(visstrim_m10_i2c_devices)); | ||
238 | imx27_add_imx_i2c(0, &visstrim_m10_i2c_data); | ||
239 | imx27_add_imx_i2c(1, &visstrim_m10_i2c_data); | ||
240 | mxc_register_device(&mxc_sdhc_device0, &visstrim_m10_sdhc_pdata); | ||
241 | mxc_register_device(&mxc_otg_host, &visstrim_m10_usbotg_pdata); | ||
242 | imx27_add_fec(NULL); | ||
243 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | ||
244 | } | ||
245 | |||
246 | static void __init visstrim_m10_timer_init(void) | ||
247 | { | ||
248 | mx27_clocks_init((unsigned long)25000000); | ||
249 | } | ||
250 | |||
251 | static struct sys_timer visstrim_m10_timer = { | ||
252 | .init = visstrim_m10_timer_init, | ||
253 | }; | ||
254 | |||
255 | MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10") | ||
256 | .phys_io = MX27_AIPI_BASE_ADDR, | ||
257 | .io_pg_offst = ((MX27_AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, | ||
258 | .boot_params = MX27_PHYS_OFFSET + 0x100, | ||
259 | .map_io = mx27_map_io, | ||
260 | .init_irq = mx27_init_irq, | ||
261 | .init_machine = visstrim_m10_board_init, | ||
262 | .timer = &visstrim_m10_timer, | ||
263 | MACHINE_END | ||
diff --git a/arch/arm/mach-imx/mach-imx27lite.c b/arch/arm/mach-imx/mach-imx27lite.c index 22a2b5d91213..60d4d0ac4939 100644 --- a/arch/arm/mach-imx/mach-imx27lite.c +++ b/arch/arm/mach-imx/mach-imx27lite.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "devices-imx27.h" | 27 | #include "devices-imx27.h" |
28 | #include "devices.h" | 28 | #include "devices.h" |
29 | 29 | ||
30 | static unsigned int mx27lite_pins[] = { | 30 | static const int mx27lite_pins[] __initconst = { |
31 | /* UART1 */ | 31 | /* UART1 */ |
32 | PE12_PF_UART1_TXD, | 32 | PE12_PF_UART1_TXD, |
33 | PE13_PF_UART1_RXD, | 33 | PE13_PF_UART1_RXD, |
@@ -58,16 +58,12 @@ static const struct imxuart_platform_data uart_pdata __initconst = { | |||
58 | .flags = IMXUART_HAVE_RTSCTS, | 58 | .flags = IMXUART_HAVE_RTSCTS, |
59 | }; | 59 | }; |
60 | 60 | ||
61 | static struct platform_device *platform_devices[] __initdata = { | ||
62 | &mxc_fec_device, | ||
63 | }; | ||
64 | |||
65 | static void __init mx27lite_init(void) | 61 | static void __init mx27lite_init(void) |
66 | { | 62 | { |
67 | mxc_gpio_setup_multiple_pins(mx27lite_pins, ARRAY_SIZE(mx27lite_pins), | 63 | mxc_gpio_setup_multiple_pins(mx27lite_pins, ARRAY_SIZE(mx27lite_pins), |
68 | "imx27lite"); | 64 | "imx27lite"); |
69 | imx27_add_imx_uart0(&uart_pdata); | 65 | imx27_add_imx_uart0(&uart_pdata); |
70 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 66 | imx27_add_fec(NULL); |
71 | } | 67 | } |
72 | 68 | ||
73 | static void __init mx27lite_timer_init(void) | 69 | static void __init mx27lite_timer_init(void) |
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c index 77a760cfadc0..85e2877572b5 100644 --- a/arch/arm/mach-imx/mach-mx1ads.c +++ b/arch/arm/mach-imx/mach-mx1ads.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include "devices-imx1.h" | 32 | #include "devices-imx1.h" |
33 | #include "devices.h" | 33 | #include "devices.h" |
34 | 34 | ||
35 | static int mx1ads_pins[] = { | 35 | static const int mx1ads_pins[] __initconst = { |
36 | /* UART1 */ | 36 | /* UART1 */ |
37 | PC9_PF_UART1_CTS, | 37 | PC9_PF_UART1_CTS, |
38 | PC10_PF_UART1_RTS, | 38 | PC10_PF_UART1_RTS, |
@@ -131,7 +131,7 @@ static void __init mx1ads_init(void) | |||
131 | i2c_register_board_info(0, mx1ads_i2c_devices, | 131 | i2c_register_board_info(0, mx1ads_i2c_devices, |
132 | ARRAY_SIZE(mx1ads_i2c_devices)); | 132 | ARRAY_SIZE(mx1ads_i2c_devices)); |
133 | 133 | ||
134 | imx1_add_i2c_imx(&mx1ads_i2c_data); | 134 | imx1_add_imx_i2c(&mx1ads_i2c_data); |
135 | } | 135 | } |
136 | 136 | ||
137 | static void __init mx1ads_timer_init(void) | 137 | static void __init mx1ads_timer_init(void) |
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c index 96d7f8189f32..7f021e6f6acd 100644 --- a/arch/arm/mach-imx/mach-mx21ads.c +++ b/arch/arm/mach-imx/mach-mx21ads.c | |||
@@ -67,7 +67,7 @@ | |||
67 | #define MX21ADS_IO_LED4_ON 0x4000 | 67 | #define MX21ADS_IO_LED4_ON 0x4000 |
68 | #define MX21ADS_IO_LED3_ON 0x8000 | 68 | #define MX21ADS_IO_LED3_ON 0x8000 |
69 | 69 | ||
70 | static unsigned int mx21ads_pins[] = { | 70 | static const int mx21ads_pins[] __initconst = { |
71 | 71 | ||
72 | /* CS8900A */ | 72 | /* CS8900A */ |
73 | (GPIO_PORTE | GPIO_GPIO | GPIO_IN | 11), | 73 | (GPIO_PORTE | GPIO_GPIO | GPIO_IN | 11), |
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index e66ffaa1c26c..a69dba252658 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include "devices-imx27.h" | 33 | #include "devices-imx27.h" |
34 | #include "devices.h" | 34 | #include "devices.h" |
35 | 35 | ||
36 | static unsigned int mx27pdk_pins[] = { | 36 | static const int mx27pdk_pins[] __initconst = { |
37 | /* UART1 */ | 37 | /* UART1 */ |
38 | PE12_PF_UART1_TXD, | 38 | PE12_PF_UART1_TXD, |
39 | PE13_PF_UART1_RXD, | 39 | PE13_PF_UART1_RXD, |
@@ -64,10 +64,6 @@ static const struct imxuart_platform_data uart_pdata __initconst = { | |||
64 | .flags = IMXUART_HAVE_RTSCTS, | 64 | .flags = IMXUART_HAVE_RTSCTS, |
65 | }; | 65 | }; |
66 | 66 | ||
67 | static struct platform_device *platform_devices[] __initdata = { | ||
68 | &mxc_fec_device, | ||
69 | }; | ||
70 | |||
71 | /* | 67 | /* |
72 | * Matrix keyboard | 68 | * Matrix keyboard |
73 | */ | 69 | */ |
@@ -94,7 +90,7 @@ static void __init mx27pdk_init(void) | |||
94 | mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), | 90 | mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), |
95 | "mx27pdk"); | 91 | "mx27pdk"); |
96 | imx27_add_imx_uart0(&uart_pdata); | 92 | imx27_add_imx_uart0(&uart_pdata); |
97 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 93 | imx27_add_fec(NULL); |
98 | mxc_register_device(&imx_kpp_device, &mx27_3ds_keymap_data); | 94 | mxc_register_device(&imx_kpp_device, &mx27_3ds_keymap_data); |
99 | } | 95 | } |
100 | 96 | ||
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c index 9c77da98a10e..ffb39a42f240 100644 --- a/arch/arm/mach-imx/mach-mx27ads.c +++ b/arch/arm/mach-imx/mach-mx27ads.c | |||
@@ -66,7 +66,7 @@ | |||
66 | /* to determine the correct external crystal reference */ | 66 | /* to determine the correct external crystal reference */ |
67 | #define CKIH_27MHZ_BIT_SET (1 << 3) | 67 | #define CKIH_27MHZ_BIT_SET (1 << 3) |
68 | 68 | ||
69 | static unsigned int mx27ads_pins[] = { | 69 | static const int mx27ads_pins[] __initconst = { |
70 | /* UART0 */ | 70 | /* UART0 */ |
71 | PE12_PF_UART1_TXD, | 71 | PE12_PF_UART1_TXD, |
72 | PE13_PF_UART1_RXD, | 72 | PE13_PF_UART1_RXD, |
@@ -284,7 +284,6 @@ static struct imxmmc_platform_data sdhc2_pdata = { | |||
284 | 284 | ||
285 | static struct platform_device *platform_devices[] __initdata = { | 285 | static struct platform_device *platform_devices[] __initdata = { |
286 | &mx27ads_nor_mtd_device, | 286 | &mx27ads_nor_mtd_device, |
287 | &mxc_fec_device, | ||
288 | &mxc_w1_master_device, | 287 | &mxc_w1_master_device, |
289 | }; | 288 | }; |
290 | 289 | ||
@@ -308,11 +307,12 @@ static void __init mx27ads_board_init(void) | |||
308 | /* only the i2c master 1 is used on this CPU card */ | 307 | /* only the i2c master 1 is used on this CPU card */ |
309 | i2c_register_board_info(1, mx27ads_i2c_devices, | 308 | i2c_register_board_info(1, mx27ads_i2c_devices, |
310 | ARRAY_SIZE(mx27ads_i2c_devices)); | 309 | ARRAY_SIZE(mx27ads_i2c_devices)); |
311 | imx27_add_i2c_imx1(&mx27ads_i2c1_data); | 310 | imx27_add_imx_i2c(1, &mx27ads_i2c1_data); |
312 | mxc_register_device(&mxc_fb_device, &mx27ads_fb_data); | 311 | mxc_register_device(&mxc_fb_device, &mx27ads_fb_data); |
313 | mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); | 312 | mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); |
314 | mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata); | 313 | mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata); |
315 | 314 | ||
315 | imx27_add_fec(NULL); | ||
316 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 316 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
317 | } | 317 | } |
318 | 318 | ||
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c index a3a1e452d4c5..f4c397dec794 100644 --- a/arch/arm/mach-imx/mach-mxt_td60.c +++ b/arch/arm/mach-imx/mach-mxt_td60.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include "devices-imx27.h" | 37 | #include "devices-imx27.h" |
38 | #include "devices.h" | 38 | #include "devices.h" |
39 | 39 | ||
40 | static unsigned int mxt_td60_pins[] __initdata = { | 40 | static const int mxt_td60_pins[] __initconst = { |
41 | /* UART0 */ | 41 | /* UART0 */ |
42 | PE12_PF_UART1_TXD, | 42 | PE12_PF_UART1_TXD, |
43 | PE13_PF_UART1_RXD, | 43 | PE13_PF_UART1_RXD, |
@@ -231,10 +231,6 @@ static struct imxmmc_platform_data sdhc1_pdata = { | |||
231 | .exit = mxt_td60_sdhc1_exit, | 231 | .exit = mxt_td60_sdhc1_exit, |
232 | }; | 232 | }; |
233 | 233 | ||
234 | static struct platform_device *platform_devices[] __initdata = { | ||
235 | &mxc_fec_device, | ||
236 | }; | ||
237 | |||
238 | static const struct imxuart_platform_data uart_pdata __initconst = { | 234 | static const struct imxuart_platform_data uart_pdata __initconst = { |
239 | .flags = IMXUART_HAVE_RTSCTS, | 235 | .flags = IMXUART_HAVE_RTSCTS, |
240 | }; | 236 | }; |
@@ -255,12 +251,11 @@ static void __init mxt_td60_board_init(void) | |||
255 | i2c_register_board_info(1, mxt_td60_i2c2_devices, | 251 | i2c_register_board_info(1, mxt_td60_i2c2_devices, |
256 | ARRAY_SIZE(mxt_td60_i2c2_devices)); | 252 | ARRAY_SIZE(mxt_td60_i2c2_devices)); |
257 | 253 | ||
258 | imx27_add_i2c_imx0(&mxt_td60_i2c0_data); | 254 | imx27_add_imx_i2c(0, &mxt_td60_i2c0_data); |
259 | imx27_add_i2c_imx1(&mxt_td60_i2c1_data); | 255 | imx27_add_imx_i2c(1, &mxt_td60_i2c1_data); |
260 | mxc_register_device(&mxc_fb_device, &mxt_td60_fb_data); | 256 | mxc_register_device(&mxc_fb_device, &mxt_td60_fb_data); |
261 | mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); | 257 | mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); |
262 | 258 | imx27_add_fec(NULL); | |
263 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | ||
264 | } | 259 | } |
265 | 260 | ||
266 | static void __init mxt_td60_timer_init(void) | 261 | static void __init mxt_td60_timer_init(void) |
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c index 23c9e1f37b9c..223c31c48db6 100644 --- a/arch/arm/mach-imx/mach-pca100.c +++ b/arch/arm/mach-imx/mach-pca100.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <mach/iomux-mx27.h> | 38 | #include <mach/iomux-mx27.h> |
39 | #include <asm/mach/time.h> | 39 | #include <asm/mach/time.h> |
40 | #include <mach/audmux.h> | 40 | #include <mach/audmux.h> |
41 | #include <mach/ssi.h> | ||
42 | #include <mach/mxc_nand.h> | 41 | #include <mach/mxc_nand.h> |
43 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
44 | #include <mach/mmc.h> | 43 | #include <mach/mmc.h> |
@@ -55,7 +54,7 @@ | |||
55 | #define SPI1_SS1 (GPIO_PORTD + 27) | 54 | #define SPI1_SS1 (GPIO_PORTD + 27) |
56 | #define SD2_CD (GPIO_PORTC + 29) | 55 | #define SD2_CD (GPIO_PORTC + 29) |
57 | 56 | ||
58 | static int pca100_pins[] = { | 57 | static const int pca100_pins[] __initconst = { |
59 | /* UART1 */ | 58 | /* UART1 */ |
60 | PE12_PF_UART1_TXD, | 59 | PE12_PF_UART1_TXD, |
61 | PE13_PF_UART1_RXD, | 60 | PE13_PF_UART1_RXD, |
@@ -174,7 +173,6 @@ pca100_nand_board_info __initconst = { | |||
174 | 173 | ||
175 | static struct platform_device *platform_devices[] __initdata = { | 174 | static struct platform_device *platform_devices[] __initdata = { |
176 | &mxc_w1_master_device, | 175 | &mxc_w1_master_device, |
177 | &mxc_fec_device, | ||
178 | &mxc_wdt, | 176 | &mxc_wdt, |
179 | }; | 177 | }; |
180 | 178 | ||
@@ -193,11 +191,9 @@ static struct i2c_board_info pca100_i2c_devices[] = { | |||
193 | I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ | 191 | I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ |
194 | .platform_data = &board_eeprom, | 192 | .platform_data = &board_eeprom, |
195 | }, { | 193 | }, { |
196 | I2C_BOARD_INFO("rtc-pcf8563", 0x51), | 194 | I2C_BOARD_INFO("pcf8563", 0x51), |
197 | .type = "pcf8563" | ||
198 | }, { | 195 | }, { |
199 | I2C_BOARD_INFO("lm75", 0x4a), | 196 | I2C_BOARD_INFO("lm75", 0x4a), |
200 | .type = "lm75" | ||
201 | } | 197 | } |
202 | }; | 198 | }; |
203 | 199 | ||
@@ -252,7 +248,7 @@ static void pca100_ac97_cold_reset(struct snd_ac97 *ac97) | |||
252 | msleep(2); | 248 | msleep(2); |
253 | } | 249 | } |
254 | 250 | ||
255 | static struct imx_ssi_platform_data pca100_ssi_pdata = { | 251 | static const struct imx_ssi_platform_data pca100_ssi_pdata __initconst = { |
256 | .ac97_reset = pca100_ac97_cold_reset, | 252 | .ac97_reset = pca100_ac97_cold_reset, |
257 | .ac97_warm_reset = pca100_ac97_warm_reset, | 253 | .ac97_warm_reset = pca100_ac97_warm_reset, |
258 | .flags = IMX_SSI_USE_AC97, | 254 | .flags = IMX_SSI_USE_AC97, |
@@ -389,7 +385,7 @@ static void __init pca100_init(void) | |||
389 | if (ret) | 385 | if (ret) |
390 | printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret); | 386 | printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret); |
391 | 387 | ||
392 | mxc_register_device(&imx_ssi_device0, &pca100_ssi_pdata); | 388 | imx27_add_imx_ssi(0, &pca100_ssi_pdata); |
393 | 389 | ||
394 | imx27_add_imx_uart0(&uart_pdata); | 390 | imx27_add_imx_uart0(&uart_pdata); |
395 | 391 | ||
@@ -401,7 +397,7 @@ static void __init pca100_init(void) | |||
401 | i2c_register_board_info(1, pca100_i2c_devices, | 397 | i2c_register_board_info(1, pca100_i2c_devices, |
402 | ARRAY_SIZE(pca100_i2c_devices)); | 398 | ARRAY_SIZE(pca100_i2c_devices)); |
403 | 399 | ||
404 | imx27_add_i2c_imx1(&pca100_i2c1_data); | 400 | imx27_add_imx_i2c(1, &pca100_i2c1_data); |
405 | 401 | ||
406 | #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) | 402 | #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) |
407 | mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_IN); | 403 | mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_IN); |
@@ -436,6 +432,7 @@ static void __init pca100_init(void) | |||
436 | 432 | ||
437 | mxc_register_device(&mxc_fb_device, &pca100_fb_data); | 433 | mxc_register_device(&mxc_fb_device, &pca100_fb_data); |
438 | 434 | ||
435 | imx27_add_fec(NULL); | ||
439 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 436 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
440 | } | 437 | } |
441 | 438 | ||
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c index 9212e8f37001..b9888a8defc1 100644 --- a/arch/arm/mach-imx/mach-pcm038.c +++ b/arch/arm/mach-imx/mach-pcm038.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #include "devices-imx27.h" | 43 | #include "devices-imx27.h" |
44 | #include "devices.h" | 44 | #include "devices.h" |
45 | 45 | ||
46 | static int pcm038_pins[] = { | 46 | static const int pcm038_pins[] __initconst = { |
47 | /* UART1 */ | 47 | /* UART1 */ |
48 | PE12_PF_UART1_TXD, | 48 | PE12_PF_UART1_TXD, |
49 | PE13_PF_UART1_RXD, | 49 | PE13_PF_UART1_RXD, |
@@ -173,7 +173,6 @@ pcm038_nand_board_info __initconst = { | |||
173 | static struct platform_device *platform_devices[] __initdata = { | 173 | static struct platform_device *platform_devices[] __initdata = { |
174 | &pcm038_nor_mtd_device, | 174 | &pcm038_nor_mtd_device, |
175 | &mxc_w1_master_device, | 175 | &mxc_w1_master_device, |
176 | &mxc_fec_device, | ||
177 | &pcm038_sram_mtd_device, | 176 | &pcm038_sram_mtd_device, |
178 | &mxc_wdt, | 177 | &mxc_wdt, |
179 | }; | 178 | }; |
@@ -257,7 +256,7 @@ static struct regulator_init_data cam_data = { | |||
257 | .consumer_supplies = cam_consumers, | 256 | .consumer_supplies = cam_consumers, |
258 | }; | 257 | }; |
259 | 258 | ||
260 | struct mc13783_regulator_init_data pcm038_regulators[] = { | 259 | static struct mc13783_regulator_init_data pcm038_regulators[] = { |
261 | { | 260 | { |
262 | .id = MC13783_REGU_VCAM, | 261 | .id = MC13783_REGU_VCAM, |
263 | .init_data = &cam_data, | 262 | .init_data = &cam_data, |
@@ -309,7 +308,7 @@ static void __init pcm038_init(void) | |||
309 | i2c_register_board_info(1, pcm038_i2c_devices, | 308 | i2c_register_board_info(1, pcm038_i2c_devices, |
310 | ARRAY_SIZE(pcm038_i2c_devices)); | 309 | ARRAY_SIZE(pcm038_i2c_devices)); |
311 | 310 | ||
312 | imx27_add_i2c_imx1(&pcm038_i2c1_data); | 311 | imx27_add_imx_i2c(1, &pcm038_i2c1_data); |
313 | 312 | ||
314 | /* PE18 for user-LED D40 */ | 313 | /* PE18 for user-LED D40 */ |
315 | mxc_gpio_mode(GPIO_PORTE | 18 | GPIO_GPIO | GPIO_OUT); | 314 | mxc_gpio_mode(GPIO_PORTE | 18 | GPIO_GPIO | GPIO_OUT); |
@@ -325,6 +324,7 @@ static void __init pcm038_init(void) | |||
325 | 324 | ||
326 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 325 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); |
327 | 326 | ||
327 | imx27_add_fec(NULL); | ||
328 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 328 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
329 | 329 | ||
330 | #ifdef CONFIG_MACH_PCM970_BASEBOARD | 330 | #ifdef CONFIG_MACH_PCM970_BASEBOARD |
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c index 88bf0d1e26e6..fb2e5f3d37f6 100644 --- a/arch/arm/mach-imx/mach-scb9328.c +++ b/arch/arm/mach-imx/mach-scb9328.c | |||
@@ -95,7 +95,7 @@ static struct platform_device dm9000x_device = { | |||
95 | } | 95 | } |
96 | }; | 96 | }; |
97 | 97 | ||
98 | static int mxc_uart1_pins[] = { | 98 | static const int mxc_uart1_pins[] = { |
99 | PC9_PF_UART1_CTS, | 99 | PC9_PF_UART1_CTS, |
100 | PC10_PF_UART1_RTS, | 100 | PC10_PF_UART1_RTS, |
101 | PC11_PF_UART1_TXD, | 101 | PC11_PF_UART1_TXD, |
diff --git a/arch/arm/mach-imx/pcm970-baseboard.c b/arch/arm/mach-imx/pcm970-baseboard.c index f490a406d57e..9110d9cca7a2 100644 --- a/arch/arm/mach-imx/pcm970-baseboard.c +++ b/arch/arm/mach-imx/pcm970-baseboard.c | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | #include "devices.h" | 32 | #include "devices.h" |
33 | 33 | ||
34 | static int pcm970_pins[] = { | 34 | static const int pcm970_pins[] __initconst = { |
35 | /* SDHC */ | 35 | /* SDHC */ |
36 | PB4_PF_SD2_D0, | 36 | PB4_PF_SD2_D0, |
37 | PB5_PF_SD2_D1, | 37 | PB5_PF_SD2_D1, |
@@ -200,7 +200,7 @@ static struct resource pcm970_sja1000_resources[] = { | |||
200 | }, | 200 | }, |
201 | }; | 201 | }; |
202 | 202 | ||
203 | struct sja1000_platform_data pcm970_sja1000_platform_data = { | 203 | static struct sja1000_platform_data pcm970_sja1000_platform_data = { |
204 | .osc_freq = 16000000, | 204 | .osc_freq = 16000000, |
205 | .ocr = OCR_TX1_PULLDOWN | OCR_TX0_PUSHPULL, | 205 | .ocr = OCR_TX1_PULLDOWN | OCR_TX0_PUSHPULL, |
206 | .cdr = CDR_CBP, | 206 | .cdr = CDR_CBP, |
diff --git a/arch/arm/mach-integrator/include/mach/vmalloc.h b/arch/arm/mach-integrator/include/mach/vmalloc.h index e87ab0b37bdd..e056e7cf5645 100644 --- a/arch/arm/mach-integrator/include/mach/vmalloc.h +++ b/arch/arm/mach-integrator/include/mach/vmalloc.h | |||
@@ -17,4 +17,4 @@ | |||
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ | 19 | */ |
20 | #define VMALLOC_END (PAGE_OFFSET + 0x10000000) | 20 | #define VMALLOC_END 0xd0000000 |
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c index 61cd4d64b985..24498a932ba6 100644 --- a/arch/arm/mach-ixp4xx/common-pci.c +++ b/arch/arm/mach-ixp4xx/common-pci.c | |||
@@ -503,6 +503,14 @@ struct pci_bus * __devinit ixp4xx_scan_bus(int nr, struct pci_sys_data *sys) | |||
503 | return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys); | 503 | return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys); |
504 | } | 504 | } |
505 | 505 | ||
506 | int dma_set_coherent_mask(struct device *dev, u64 mask) | ||
507 | { | ||
508 | if (mask >= SZ_64M - 1) | ||
509 | return 0; | ||
510 | |||
511 | return -EIO; | ||
512 | } | ||
513 | |||
506 | EXPORT_SYMBOL(ixp4xx_pci_read); | 514 | EXPORT_SYMBOL(ixp4xx_pci_read); |
507 | EXPORT_SYMBOL(ixp4xx_pci_write); | 515 | EXPORT_SYMBOL(ixp4xx_pci_write); |
508 | 516 | ||
diff --git a/arch/arm/mach-ixp4xx/include/mach/hardware.h b/arch/arm/mach-ixp4xx/include/mach/hardware.h index f91ca6d4fbe8..8138371c406e 100644 --- a/arch/arm/mach-ixp4xx/include/mach/hardware.h +++ b/arch/arm/mach-ixp4xx/include/mach/hardware.h | |||
@@ -26,6 +26,8 @@ | |||
26 | #define PCIBIOS_MAX_MEM 0x4BFFFFFF | 26 | #define PCIBIOS_MAX_MEM 0x4BFFFFFF |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | #define ARCH_HAS_DMA_SET_COHERENT_MASK | ||
30 | |||
29 | #define pcibios_assign_all_busses() 1 | 31 | #define pcibios_assign_all_busses() 1 |
30 | 32 | ||
31 | /* Register locations and bits */ | 33 | /* Register locations and bits */ |
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index cc25501b57fa..34106335c728 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig | |||
@@ -58,6 +58,12 @@ config MACH_TS41X | |||
58 | QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS | 58 | QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS |
59 | devices. | 59 | devices. |
60 | 60 | ||
61 | config MACH_DOCKSTAR | ||
62 | bool "Seagate FreeAgent DockStar" | ||
63 | help | ||
64 | Say 'Y' here if you want your kernel to support the | ||
65 | Seagate FreeAgent DockStar. | ||
66 | |||
61 | config MACH_OPENRD | 67 | config MACH_OPENRD |
62 | bool | 68 | bool |
63 | 69 | ||
@@ -100,6 +106,12 @@ config MACH_NETSPACE_MAX_V2 | |||
100 | Say 'Y' here if you want your kernel to support the | 106 | Say 'Y' here if you want your kernel to support the |
101 | LaCie Network Space Max v2 NAS. | 107 | LaCie Network Space Max v2 NAS. |
102 | 108 | ||
109 | config MACH_D2NET_V2 | ||
110 | bool "LaCie d2 Network v2 NAS Board" | ||
111 | help | ||
112 | Say 'Y' here if you want your kernel to support the | ||
113 | LaCie d2 Network v2 NAS. | ||
114 | |||
103 | config MACH_NET2BIG_V2 | 115 | config MACH_NET2BIG_V2 |
104 | bool "LaCie 2Big Network v2 NAS Board" | 116 | bool "LaCie 2Big Network v2 NAS Board" |
105 | help | 117 | help |
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 295d7baa6ae1..5dcaa81a2ec3 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
@@ -7,14 +7,16 @@ obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o | |||
7 | obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o | 7 | obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o |
8 | obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o | 8 | obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o |
9 | obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o | 9 | obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o |
10 | obj-$(CONFIG_MACH_DOCKSTAR) += dockstar-setup.o | ||
10 | obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o | 11 | obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o |
11 | obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o | 12 | obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o |
12 | obj-$(CONFIG_MACH_OPENRD) += openrd-setup.o | 13 | obj-$(CONFIG_MACH_OPENRD) += openrd-setup.o |
13 | obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o | 14 | obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o lacie_v2-common.o |
14 | obj-$(CONFIG_MACH_INETSPACE_V2) += netspace_v2-setup.o | 15 | obj-$(CONFIG_MACH_INETSPACE_V2) += netspace_v2-setup.o lacie_v2-common.o |
15 | obj-$(CONFIG_MACH_NETSPACE_MAX_V2) += netspace_v2-setup.o | 16 | obj-$(CONFIG_MACH_NETSPACE_MAX_V2) += netspace_v2-setup.o lacie_v2-common.o |
16 | obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o | 17 | obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o |
17 | obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o | 18 | obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o |
19 | obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o | ||
18 | obj-$(CONFIG_MACH_T5325) += t5325-setup.o | 20 | obj-$(CONFIG_MACH_T5325) += t5325-setup.o |
19 | 21 | ||
20 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | 22 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o |
diff --git a/arch/arm/mach-kirkwood/d2net_v2-setup.c b/arch/arm/mach-kirkwood/d2net_v2-setup.c new file mode 100644 index 000000000000..cd62d0f82a73 --- /dev/null +++ b/arch/arm/mach-kirkwood/d2net_v2-setup.c | |||
@@ -0,0 +1,231 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/d2net_v2-setup.c | ||
3 | * | ||
4 | * LaCie d2 Network Space v2 Board Setup | ||
5 | * | ||
6 | * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> | ||
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; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #include <linux/kernel.h> | ||
24 | #include <linux/init.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/ata_platform.h> | ||
27 | #include <linux/mv643xx_eth.h> | ||
28 | #include <linux/input.h> | ||
29 | #include <linux/gpio.h> | ||
30 | #include <linux/gpio_keys.h> | ||
31 | #include <linux/leds.h> | ||
32 | #include <asm/mach-types.h> | ||
33 | #include <asm/mach/arch.h> | ||
34 | #include <mach/kirkwood.h> | ||
35 | #include <mach/leds-ns2.h> | ||
36 | #include "common.h" | ||
37 | #include "mpp.h" | ||
38 | #include "lacie_v2-common.h" | ||
39 | |||
40 | /***************************************************************************** | ||
41 | * Ethernet | ||
42 | ****************************************************************************/ | ||
43 | |||
44 | static struct mv643xx_eth_platform_data d2net_v2_ge00_data = { | ||
45 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | ||
46 | }; | ||
47 | |||
48 | /***************************************************************************** | ||
49 | * SATA | ||
50 | ****************************************************************************/ | ||
51 | |||
52 | static struct mv_sata_platform_data d2net_v2_sata_data = { | ||
53 | .n_ports = 2, | ||
54 | }; | ||
55 | |||
56 | /***************************************************************************** | ||
57 | * GPIO keys | ||
58 | ****************************************************************************/ | ||
59 | |||
60 | #define D2NET_V2_GPIO_PUSH_BUTTON 34 | ||
61 | #define D2NET_V2_GPIO_POWER_SWITCH_ON 13 | ||
62 | #define D2NET_V2_GPIO_POWER_SWITCH_OFF 15 | ||
63 | |||
64 | #define D2NET_V2_SWITCH_POWER_ON 0x1 | ||
65 | #define D2NET_V2_SWITCH_POWER_OFF 0x2 | ||
66 | |||
67 | static struct gpio_keys_button d2net_v2_buttons[] = { | ||
68 | [0] = { | ||
69 | .type = EV_SW, | ||
70 | .code = D2NET_V2_SWITCH_POWER_ON, | ||
71 | .gpio = D2NET_V2_GPIO_POWER_SWITCH_ON, | ||
72 | .desc = "Back power switch (on|auto)", | ||
73 | .active_low = 0, | ||
74 | }, | ||
75 | [1] = { | ||
76 | .type = EV_SW, | ||
77 | .code = D2NET_V2_SWITCH_POWER_OFF, | ||
78 | .gpio = D2NET_V2_GPIO_POWER_SWITCH_OFF, | ||
79 | .desc = "Back power switch (auto|off)", | ||
80 | .active_low = 0, | ||
81 | }, | ||
82 | [2] = { | ||
83 | .code = KEY_POWER, | ||
84 | .gpio = D2NET_V2_GPIO_PUSH_BUTTON, | ||
85 | .desc = "Front Push Button", | ||
86 | .active_low = 1, | ||
87 | }, | ||
88 | }; | ||
89 | |||
90 | static struct gpio_keys_platform_data d2net_v2_button_data = { | ||
91 | .buttons = d2net_v2_buttons, | ||
92 | .nbuttons = ARRAY_SIZE(d2net_v2_buttons), | ||
93 | }; | ||
94 | |||
95 | static struct platform_device d2net_v2_gpio_buttons = { | ||
96 | .name = "gpio-keys", | ||
97 | .id = -1, | ||
98 | .dev = { | ||
99 | .platform_data = &d2net_v2_button_data, | ||
100 | }, | ||
101 | }; | ||
102 | |||
103 | /***************************************************************************** | ||
104 | * GPIO LEDs | ||
105 | ****************************************************************************/ | ||
106 | |||
107 | #define D2NET_V2_GPIO_RED_LED 12 | ||
108 | |||
109 | static struct gpio_led d2net_v2_gpio_led_pins[] = { | ||
110 | { | ||
111 | .name = "d2net_v2:red:fail", | ||
112 | .gpio = D2NET_V2_GPIO_RED_LED, | ||
113 | }, | ||
114 | }; | ||
115 | |||
116 | static struct gpio_led_platform_data d2net_v2_gpio_leds_data = { | ||
117 | .num_leds = ARRAY_SIZE(d2net_v2_gpio_led_pins), | ||
118 | .leds = d2net_v2_gpio_led_pins, | ||
119 | }; | ||
120 | |||
121 | static struct platform_device d2net_v2_gpio_leds = { | ||
122 | .name = "leds-gpio", | ||
123 | .id = -1, | ||
124 | .dev = { | ||
125 | .platform_data = &d2net_v2_gpio_leds_data, | ||
126 | }, | ||
127 | }; | ||
128 | |||
129 | /***************************************************************************** | ||
130 | * Dual-GPIO CPLD LEDs | ||
131 | ****************************************************************************/ | ||
132 | |||
133 | #define D2NET_V2_GPIO_BLUE_LED_SLOW 29 | ||
134 | #define D2NET_V2_GPIO_BLUE_LED_CMD 30 | ||
135 | |||
136 | static struct ns2_led d2net_v2_led_pins[] = { | ||
137 | { | ||
138 | .name = "d2net_v2:blue:sata", | ||
139 | .cmd = D2NET_V2_GPIO_BLUE_LED_CMD, | ||
140 | .slow = D2NET_V2_GPIO_BLUE_LED_SLOW, | ||
141 | }, | ||
142 | }; | ||
143 | |||
144 | static struct ns2_led_platform_data d2net_v2_leds_data = { | ||
145 | .num_leds = ARRAY_SIZE(d2net_v2_led_pins), | ||
146 | .leds = d2net_v2_led_pins, | ||
147 | }; | ||
148 | |||
149 | static struct platform_device d2net_v2_leds = { | ||
150 | .name = "leds-ns2", | ||
151 | .id = -1, | ||
152 | .dev = { | ||
153 | .platform_data = &d2net_v2_leds_data, | ||
154 | }, | ||
155 | }; | ||
156 | |||
157 | /***************************************************************************** | ||
158 | * General Setup | ||
159 | ****************************************************************************/ | ||
160 | |||
161 | static unsigned int d2net_v2_mpp_config[] __initdata = { | ||
162 | MPP0_SPI_SCn, | ||
163 | MPP1_SPI_MOSI, | ||
164 | MPP2_SPI_SCK, | ||
165 | MPP3_SPI_MISO, | ||
166 | MPP6_SYSRST_OUTn, | ||
167 | MPP7_GPO, /* Request power-off */ | ||
168 | MPP8_TW0_SDA, | ||
169 | MPP9_TW0_SCK, | ||
170 | MPP10_UART0_TXD, | ||
171 | MPP11_UART0_RXD, | ||
172 | MPP12_GPO, /* Red led */ | ||
173 | MPP13_GPIO, /* Rear power switch (on|auto) */ | ||
174 | MPP14_GPIO, /* USB fuse */ | ||
175 | MPP15_GPIO, /* Rear power switch (auto|off) */ | ||
176 | MPP16_GPIO, /* SATA 0 power */ | ||
177 | MPP21_SATA0_ACTn, | ||
178 | MPP24_GPIO, /* USB mode select */ | ||
179 | MPP26_GPIO, /* USB device vbus */ | ||
180 | MPP28_GPIO, /* USB enable host vbus */ | ||
181 | MPP29_GPIO, /* Blue led (slow register) */ | ||
182 | MPP30_GPIO, /* Blue led (command register) */ | ||
183 | MPP34_GPIO, /* Power button (1 = Released, 0 = Pushed) */ | ||
184 | MPP35_GPIO, /* Inhibit power-off */ | ||
185 | 0 | ||
186 | }; | ||
187 | |||
188 | #define D2NET_V2_GPIO_POWER_OFF 7 | ||
189 | |||
190 | static void d2net_v2_power_off(void) | ||
191 | { | ||
192 | gpio_set_value(D2NET_V2_GPIO_POWER_OFF, 1); | ||
193 | } | ||
194 | |||
195 | static void __init d2net_v2_init(void) | ||
196 | { | ||
197 | /* | ||
198 | * Basic setup. Needs to be called early. | ||
199 | */ | ||
200 | kirkwood_init(); | ||
201 | kirkwood_mpp_conf(d2net_v2_mpp_config); | ||
202 | |||
203 | lacie_v2_hdd_power_init(1); | ||
204 | |||
205 | kirkwood_ehci_init(); | ||
206 | kirkwood_ge00_init(&d2net_v2_ge00_data); | ||
207 | kirkwood_sata_init(&d2net_v2_sata_data); | ||
208 | kirkwood_uart0_init(); | ||
209 | lacie_v2_register_flash(); | ||
210 | lacie_v2_register_i2c_devices(); | ||
211 | |||
212 | platform_device_register(&d2net_v2_leds); | ||
213 | platform_device_register(&d2net_v2_gpio_leds); | ||
214 | platform_device_register(&d2net_v2_gpio_buttons); | ||
215 | |||
216 | if (gpio_request(D2NET_V2_GPIO_POWER_OFF, "power-off") == 0 && | ||
217 | gpio_direction_output(D2NET_V2_GPIO_POWER_OFF, 0) == 0) | ||
218 | pm_power_off = d2net_v2_power_off; | ||
219 | else | ||
220 | pr_err("d2net_v2: failed to configure power-off GPIO\n"); | ||
221 | } | ||
222 | |||
223 | MACHINE_START(D2NET_V2, "LaCie d2 Network v2") | ||
224 | .phys_io = KIRKWOOD_REGS_PHYS_BASE, | ||
225 | .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, | ||
226 | .boot_params = 0x00000100, | ||
227 | .init_machine = d2net_v2_init, | ||
228 | .map_io = kirkwood_map_io, | ||
229 | .init_irq = kirkwood_init_irq, | ||
230 | .timer = &lacie_v2_timer, | ||
231 | MACHINE_END | ||
diff --git a/arch/arm/mach-kirkwood/dockstar-setup.c b/arch/arm/mach-kirkwood/dockstar-setup.c new file mode 100644 index 000000000000..a90475d5059c --- /dev/null +++ b/arch/arm/mach-kirkwood/dockstar-setup.c | |||
@@ -0,0 +1,112 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/dockstar-setup.c | ||
3 | * | ||
4 | * Seagate FreeAgent DockStar Setup | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/ata_platform.h> | ||
15 | #include <linux/mtd/partitions.h> | ||
16 | #include <linux/mv643xx_eth.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/leds.h> | ||
19 | #include <asm/mach-types.h> | ||
20 | #include <asm/mach/arch.h> | ||
21 | #include <mach/kirkwood.h> | ||
22 | #include <plat/mvsdio.h> | ||
23 | #include "common.h" | ||
24 | #include "mpp.h" | ||
25 | |||
26 | static struct mtd_partition dockstar_nand_parts[] = { | ||
27 | { | ||
28 | .name = "u-boot", | ||
29 | .offset = 0, | ||
30 | .size = SZ_1M | ||
31 | }, { | ||
32 | .name = "uImage", | ||
33 | .offset = MTDPART_OFS_NXTBLK, | ||
34 | .size = SZ_4M | ||
35 | }, { | ||
36 | .name = "root", | ||
37 | .offset = MTDPART_OFS_NXTBLK, | ||
38 | .size = MTDPART_SIZ_FULL | ||
39 | }, | ||
40 | }; | ||
41 | |||
42 | static struct mv643xx_eth_platform_data dockstar_ge00_data = { | ||
43 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | ||
44 | }; | ||
45 | |||
46 | static struct gpio_led dockstar_led_pins[] = { | ||
47 | { | ||
48 | .name = "dockstar:green:health", | ||
49 | .default_trigger = "default-on", | ||
50 | .gpio = 46, | ||
51 | .active_low = 1, | ||
52 | }, | ||
53 | { | ||
54 | .name = "dockstar:orange:misc", | ||
55 | .default_trigger = "none", | ||
56 | .gpio = 47, | ||
57 | .active_low = 1, | ||
58 | }, | ||
59 | }; | ||
60 | |||
61 | static struct gpio_led_platform_data dockstar_led_data = { | ||
62 | .leds = dockstar_led_pins, | ||
63 | .num_leds = ARRAY_SIZE(dockstar_led_pins), | ||
64 | }; | ||
65 | |||
66 | static struct platform_device dockstar_leds = { | ||
67 | .name = "leds-gpio", | ||
68 | .id = -1, | ||
69 | .dev = { | ||
70 | .platform_data = &dockstar_led_data, | ||
71 | } | ||
72 | }; | ||
73 | |||
74 | static unsigned int dockstar_mpp_config[] __initdata = { | ||
75 | MPP29_GPIO, /* USB Power Enable */ | ||
76 | MPP46_GPIO, /* LED green */ | ||
77 | MPP47_GPIO, /* LED orange */ | ||
78 | 0 | ||
79 | }; | ||
80 | |||
81 | static void __init dockstar_init(void) | ||
82 | { | ||
83 | /* | ||
84 | * Basic setup. Needs to be called early. | ||
85 | */ | ||
86 | kirkwood_init(); | ||
87 | |||
88 | /* setup gpio pin select */ | ||
89 | kirkwood_mpp_conf(dockstar_mpp_config); | ||
90 | |||
91 | kirkwood_uart0_init(); | ||
92 | kirkwood_nand_init(ARRAY_AND_SIZE(dockstar_nand_parts), 25); | ||
93 | |||
94 | if (gpio_request(29, "USB Power Enable") != 0 || | ||
95 | gpio_direction_output(29, 1) != 0) | ||
96 | printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n"); | ||
97 | kirkwood_ehci_init(); | ||
98 | |||
99 | kirkwood_ge00_init(&dockstar_ge00_data); | ||
100 | |||
101 | platform_device_register(&dockstar_leds); | ||
102 | } | ||
103 | |||
104 | MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar") | ||
105 | .phys_io = KIRKWOOD_REGS_PHYS_BASE, | ||
106 | .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, | ||
107 | .boot_params = 0x00000100, | ||
108 | .init_machine = dockstar_init, | ||
109 | .map_io = kirkwood_map_io, | ||
110 | .init_irq = kirkwood_init_irq, | ||
111 | .timer = &kirkwood_timer, | ||
112 | MACHINE_END | ||
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index 93fc2ec95e76..6e924b398919 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | #define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000 | 39 | #define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000 |
40 | #define KIRKWOOD_PCIE1_IO_VIRT_BASE 0xfef00000 | 40 | #define KIRKWOOD_PCIE1_IO_VIRT_BASE 0xfef00000 |
41 | #define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00000000 | 41 | #define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00100000 |
42 | #define KIRKWOOD_PCIE1_IO_SIZE SZ_1M | 42 | #define KIRKWOOD_PCIE1_IO_SIZE SZ_1M |
43 | 43 | ||
44 | #define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 | 44 | #define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 |
diff --git a/arch/arm/mach-kirkwood/include/mach/leds-netxbig.h b/arch/arm/mach-kirkwood/include/mach/leds-netxbig.h new file mode 100644 index 000000000000..24b536ebdf13 --- /dev/null +++ b/arch/arm/mach-kirkwood/include/mach/leds-netxbig.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/include/mach/leds-netxbig.h | ||
3 | * | ||
4 | * Platform data structure for netxbig LED driver | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MACH_LEDS_NETXBIG_H | ||
12 | #define __MACH_LEDS_NETXBIG_H | ||
13 | |||
14 | struct netxbig_gpio_ext { | ||
15 | unsigned *addr; | ||
16 | int num_addr; | ||
17 | unsigned *data; | ||
18 | int num_data; | ||
19 | unsigned enable; | ||
20 | }; | ||
21 | |||
22 | enum netxbig_led_mode { | ||
23 | NETXBIG_LED_OFF, | ||
24 | NETXBIG_LED_ON, | ||
25 | NETXBIG_LED_SATA, | ||
26 | NETXBIG_LED_TIMER1, | ||
27 | NETXBIG_LED_TIMER2, | ||
28 | NETXBIG_LED_MODE_NUM, | ||
29 | }; | ||
30 | |||
31 | #define NETXBIG_LED_INVALID_MODE NETXBIG_LED_MODE_NUM | ||
32 | |||
33 | struct netxbig_led_timer { | ||
34 | unsigned long delay_on; | ||
35 | unsigned long delay_off; | ||
36 | enum netxbig_led_mode mode; | ||
37 | }; | ||
38 | |||
39 | struct netxbig_led { | ||
40 | const char *name; | ||
41 | const char *default_trigger; | ||
42 | int mode_addr; | ||
43 | int *mode_val; | ||
44 | int bright_addr; | ||
45 | }; | ||
46 | |||
47 | struct netxbig_led_platform_data { | ||
48 | struct netxbig_gpio_ext *gpio_ext; | ||
49 | struct netxbig_led_timer *timer; | ||
50 | int num_timer; | ||
51 | struct netxbig_led *leds; | ||
52 | int num_leds; | ||
53 | }; | ||
54 | |||
55 | #endif /* __MACH_LEDS_NETXBIG_H */ | ||
diff --git a/arch/arm/mach-kirkwood/lacie_v2-common.c b/arch/arm/mach-kirkwood/lacie_v2-common.c new file mode 100644 index 000000000000..d3ea1b6c8a02 --- /dev/null +++ b/arch/arm/mach-kirkwood/lacie_v2-common.c | |||
@@ -0,0 +1,127 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/lacie_v2-common.c | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/init.h> | ||
11 | #include <linux/mtd/physmap.h> | ||
12 | #include <linux/spi/flash.h> | ||
13 | #include <linux/spi/spi.h> | ||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/i2c/at24.h> | ||
16 | #include <linux/gpio.h> | ||
17 | #include <asm/mach/time.h> | ||
18 | #include <mach/kirkwood.h> | ||
19 | #include <mach/irqs.h> | ||
20 | #include <plat/time.h> | ||
21 | #include "common.h" | ||
22 | |||
23 | /***************************************************************************** | ||
24 | * 512KB SPI Flash on Boot Device (MACRONIX MX25L4005) | ||
25 | ****************************************************************************/ | ||
26 | |||
27 | static struct mtd_partition lacie_v2_flash_parts[] = { | ||
28 | { | ||
29 | .name = "u-boot", | ||
30 | .size = MTDPART_SIZ_FULL, | ||
31 | .offset = 0, | ||
32 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
33 | }, | ||
34 | }; | ||
35 | |||
36 | static const struct flash_platform_data lacie_v2_flash = { | ||
37 | .type = "mx25l4005a", | ||
38 | .name = "spi_flash", | ||
39 | .parts = lacie_v2_flash_parts, | ||
40 | .nr_parts = ARRAY_SIZE(lacie_v2_flash_parts), | ||
41 | }; | ||
42 | |||
43 | static struct spi_board_info __initdata lacie_v2_spi_slave_info[] = { | ||
44 | { | ||
45 | .modalias = "m25p80", | ||
46 | .platform_data = &lacie_v2_flash, | ||
47 | .irq = -1, | ||
48 | .max_speed_hz = 20000000, | ||
49 | .bus_num = 0, | ||
50 | .chip_select = 0, | ||
51 | }, | ||
52 | }; | ||
53 | |||
54 | void __init lacie_v2_register_flash(void) | ||
55 | { | ||
56 | spi_register_board_info(lacie_v2_spi_slave_info, | ||
57 | ARRAY_SIZE(lacie_v2_spi_slave_info)); | ||
58 | kirkwood_spi_init(); | ||
59 | } | ||
60 | |||
61 | /***************************************************************************** | ||
62 | * I2C devices | ||
63 | ****************************************************************************/ | ||
64 | |||
65 | static struct at24_platform_data at24c04 = { | ||
66 | .byte_len = SZ_4K / 8, | ||
67 | .page_size = 16, | ||
68 | }; | ||
69 | |||
70 | /* | ||
71 | * i2c addr | chip | description | ||
72 | * 0x50 | HT24LC04 | eeprom (512B) | ||
73 | */ | ||
74 | |||
75 | static struct i2c_board_info __initdata lacie_v2_i2c_info[] = { | ||
76 | { | ||
77 | I2C_BOARD_INFO("24c04", 0x50), | ||
78 | .platform_data = &at24c04, | ||
79 | } | ||
80 | }; | ||
81 | |||
82 | void __init lacie_v2_register_i2c_devices(void) | ||
83 | { | ||
84 | kirkwood_i2c_init(); | ||
85 | i2c_register_board_info(0, lacie_v2_i2c_info, | ||
86 | ARRAY_SIZE(lacie_v2_i2c_info)); | ||
87 | } | ||
88 | |||
89 | /***************************************************************************** | ||
90 | * Hard Disk power | ||
91 | ****************************************************************************/ | ||
92 | |||
93 | static int __initdata lacie_v2_gpio_hdd_power[] = { 16, 17, 41, 42, 43 }; | ||
94 | |||
95 | void __init lacie_v2_hdd_power_init(int hdd_num) | ||
96 | { | ||
97 | int i; | ||
98 | int err; | ||
99 | |||
100 | /* Power up all hard disks. */ | ||
101 | for (i = 0; i < hdd_num; i++) { | ||
102 | err = gpio_request(lacie_v2_gpio_hdd_power[i], NULL); | ||
103 | if (err == 0) { | ||
104 | err = gpio_direction_output( | ||
105 | lacie_v2_gpio_hdd_power[i], 1); | ||
106 | /* Free the HDD power GPIOs. This allow user-space to | ||
107 | * configure them via the gpiolib sysfs interface. */ | ||
108 | gpio_free(lacie_v2_gpio_hdd_power[i]); | ||
109 | } | ||
110 | if (err) | ||
111 | pr_err("Failed to power up HDD%d\n", i + 1); | ||
112 | } | ||
113 | } | ||
114 | |||
115 | /***************************************************************************** | ||
116 | * Timer | ||
117 | ****************************************************************************/ | ||
118 | |||
119 | static void lacie_v2_timer_init(void) | ||
120 | { | ||
121 | kirkwood_tclk = 166666667; | ||
122 | orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); | ||
123 | } | ||
124 | |||
125 | struct 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 new file mode 100644 index 000000000000..af521315b87b --- /dev/null +++ b/arch/arm/mach-kirkwood/lacie_v2-common.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/lacie_v2-common.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ARCH_KIRKWOOD_LACIE_V2_COMMON_H | ||
10 | #define __ARCH_KIRKWOOD_LACIE_V2_COMMON_H | ||
11 | |||
12 | void lacie_v2_register_flash(void); | ||
13 | void lacie_v2_register_i2c_devices(void); | ||
14 | void lacie_v2_hdd_power_init(int hdd_num); | ||
15 | |||
16 | extern struct sys_timer lacie_v2_timer; | ||
17 | |||
18 | #endif | ||
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c index d26bf324738b..fed264d28f4a 100644 --- a/arch/arm/mach-kirkwood/netspace_v2-setup.c +++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c | |||
@@ -24,56 +24,19 @@ | |||
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/mtd/physmap.h> | ||
28 | #include <linux/spi/flash.h> | ||
29 | #include <linux/spi/spi.h> | ||
30 | #include <linux/ata_platform.h> | 27 | #include <linux/ata_platform.h> |
31 | #include <linux/mv643xx_eth.h> | 28 | #include <linux/mv643xx_eth.h> |
32 | #include <linux/i2c.h> | ||
33 | #include <linux/i2c/at24.h> | ||
34 | #include <linux/input.h> | 29 | #include <linux/input.h> |
35 | #include <linux/gpio.h> | 30 | #include <linux/gpio.h> |
36 | #include <linux/gpio_keys.h> | 31 | #include <linux/gpio_keys.h> |
37 | #include <linux/leds.h> | 32 | #include <linux/leds.h> |
38 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
39 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
40 | #include <asm/mach/time.h> | ||
41 | #include <mach/kirkwood.h> | 35 | #include <mach/kirkwood.h> |
42 | #include <mach/leds-ns2.h> | 36 | #include <mach/leds-ns2.h> |
43 | #include <plat/time.h> | ||
44 | #include "common.h" | 37 | #include "common.h" |
45 | #include "mpp.h" | 38 | #include "mpp.h" |
46 | 39 | #include "lacie_v2-common.h" | |
47 | /***************************************************************************** | ||
48 | * 512KB SPI Flash on Boot Device (MACRONIX MX25L4005) | ||
49 | ****************************************************************************/ | ||
50 | |||
51 | static struct mtd_partition netspace_v2_flash_parts[] = { | ||
52 | { | ||
53 | .name = "u-boot", | ||
54 | .size = MTDPART_SIZ_FULL, | ||
55 | .offset = 0, | ||
56 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | static const struct flash_platform_data netspace_v2_flash = { | ||
61 | .type = "mx25l4005a", | ||
62 | .name = "spi_flash", | ||
63 | .parts = netspace_v2_flash_parts, | ||
64 | .nr_parts = ARRAY_SIZE(netspace_v2_flash_parts), | ||
65 | }; | ||
66 | |||
67 | static struct spi_board_info __initdata netspace_v2_spi_slave_info[] = { | ||
68 | { | ||
69 | .modalias = "m25p80", | ||
70 | .platform_data = &netspace_v2_flash, | ||
71 | .irq = -1, | ||
72 | .max_speed_hz = 20000000, | ||
73 | .bus_num = 0, | ||
74 | .chip_select = 0, | ||
75 | }, | ||
76 | }; | ||
77 | 40 | ||
78 | /***************************************************************************** | 41 | /***************************************************************************** |
79 | * Ethernet | 42 | * Ethernet |
@@ -84,27 +47,6 @@ static struct mv643xx_eth_platform_data netspace_v2_ge00_data = { | |||
84 | }; | 47 | }; |
85 | 48 | ||
86 | /***************************************************************************** | 49 | /***************************************************************************** |
87 | * I2C devices | ||
88 | ****************************************************************************/ | ||
89 | |||
90 | static struct at24_platform_data at24c04 = { | ||
91 | .byte_len = SZ_4K / 8, | ||
92 | .page_size = 16, | ||
93 | }; | ||
94 | |||
95 | /* | ||
96 | * i2c addr | chip | description | ||
97 | * 0x50 | HT24LC04 | eeprom (512B) | ||
98 | */ | ||
99 | |||
100 | static struct i2c_board_info __initdata netspace_v2_i2c_info[] = { | ||
101 | { | ||
102 | I2C_BOARD_INFO("24c04", 0x50), | ||
103 | .platform_data = &at24c04, | ||
104 | } | ||
105 | }; | ||
106 | |||
107 | /***************************************************************************** | ||
108 | * SATA | 50 | * SATA |
109 | ****************************************************************************/ | 51 | ****************************************************************************/ |
110 | 52 | ||
@@ -112,35 +54,6 @@ static struct mv_sata_platform_data netspace_v2_sata_data = { | |||
112 | .n_ports = 2, | 54 | .n_ports = 2, |
113 | }; | 55 | }; |
114 | 56 | ||
115 | #define NETSPACE_V2_GPIO_SATA0_POWER 16 | ||
116 | #define NETSPACE_V2_GPIO_SATA1_POWER 17 | ||
117 | |||
118 | static void __init netspace_v2_sata_power_init(void) | ||
119 | { | ||
120 | int err; | ||
121 | |||
122 | err = gpio_request(NETSPACE_V2_GPIO_SATA0_POWER, "SATA0 power"); | ||
123 | if (err == 0) { | ||
124 | err = gpio_direction_output(NETSPACE_V2_GPIO_SATA0_POWER, 1); | ||
125 | if (err) | ||
126 | gpio_free(NETSPACE_V2_GPIO_SATA0_POWER); | ||
127 | } | ||
128 | if (err) | ||
129 | pr_err("netspace_v2: failed to setup SATA0 power\n"); | ||
130 | |||
131 | if (machine_is_netspace_max_v2()) { | ||
132 | err = gpio_request(NETSPACE_V2_GPIO_SATA1_POWER, "SATA1 power"); | ||
133 | if (err == 0) { | ||
134 | err = gpio_direction_output( | ||
135 | NETSPACE_V2_GPIO_SATA1_POWER, 1); | ||
136 | if (err) | ||
137 | gpio_free(NETSPACE_V2_GPIO_SATA1_POWER); | ||
138 | } | ||
139 | if (err) | ||
140 | pr_err("netspace_v2: failed to setup SATA1 power\n"); | ||
141 | } | ||
142 | } | ||
143 | |||
144 | /***************************************************************************** | 57 | /***************************************************************************** |
145 | * GPIO keys | 58 | * GPIO keys |
146 | ****************************************************************************/ | 59 | ****************************************************************************/ |
@@ -224,20 +137,6 @@ static struct platform_device netspace_v2_leds = { | |||
224 | }; | 137 | }; |
225 | 138 | ||
226 | /***************************************************************************** | 139 | /***************************************************************************** |
227 | * Timer | ||
228 | ****************************************************************************/ | ||
229 | |||
230 | static void netspace_v2_timer_init(void) | ||
231 | { | ||
232 | kirkwood_tclk = 166666667; | ||
233 | orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); | ||
234 | } | ||
235 | |||
236 | struct sys_timer netspace_v2_timer = { | ||
237 | .init = netspace_v2_timer_init, | ||
238 | }; | ||
239 | |||
240 | /***************************************************************************** | ||
241 | * General Setup | 140 | * General Setup |
242 | ****************************************************************************/ | 141 | ****************************************************************************/ |
243 | 142 | ||
@@ -291,18 +190,17 @@ static void __init netspace_v2_init(void) | |||
291 | kirkwood_init(); | 190 | kirkwood_init(); |
292 | kirkwood_mpp_conf(netspace_v2_mpp_config); | 191 | kirkwood_mpp_conf(netspace_v2_mpp_config); |
293 | 192 | ||
294 | netspace_v2_sata_power_init(); | 193 | if (machine_is_netspace_max_v2()) |
194 | lacie_v2_hdd_power_init(2); | ||
195 | else | ||
196 | lacie_v2_hdd_power_init(1); | ||
295 | 197 | ||
296 | kirkwood_ehci_init(); | 198 | kirkwood_ehci_init(); |
297 | kirkwood_ge00_init(&netspace_v2_ge00_data); | 199 | kirkwood_ge00_init(&netspace_v2_ge00_data); |
298 | kirkwood_sata_init(&netspace_v2_sata_data); | 200 | kirkwood_sata_init(&netspace_v2_sata_data); |
299 | kirkwood_uart0_init(); | 201 | kirkwood_uart0_init(); |
300 | spi_register_board_info(netspace_v2_spi_slave_info, | 202 | lacie_v2_register_flash(); |
301 | ARRAY_SIZE(netspace_v2_spi_slave_info)); | 203 | lacie_v2_register_i2c_devices(); |
302 | kirkwood_spi_init(); | ||
303 | kirkwood_i2c_init(); | ||
304 | i2c_register_board_info(0, netspace_v2_i2c_info, | ||
305 | ARRAY_SIZE(netspace_v2_i2c_info)); | ||
306 | 204 | ||
307 | platform_device_register(&netspace_v2_leds); | 205 | platform_device_register(&netspace_v2_leds); |
308 | platform_device_register(&netspace_v2_gpio_leds); | 206 | platform_device_register(&netspace_v2_gpio_leds); |
@@ -323,7 +221,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2") | |||
323 | .init_machine = netspace_v2_init, | 221 | .init_machine = netspace_v2_init, |
324 | .map_io = kirkwood_map_io, | 222 | .map_io = kirkwood_map_io, |
325 | .init_irq = kirkwood_init_irq, | 223 | .init_irq = kirkwood_init_irq, |
326 | .timer = &netspace_v2_timer, | 224 | .timer = &lacie_v2_timer, |
327 | MACHINE_END | 225 | MACHINE_END |
328 | #endif | 226 | #endif |
329 | 227 | ||
@@ -335,7 +233,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2") | |||
335 | .init_machine = netspace_v2_init, | 233 | .init_machine = netspace_v2_init, |
336 | .map_io = kirkwood_map_io, | 234 | .map_io = kirkwood_map_io, |
337 | .init_irq = kirkwood_init_irq, | 235 | .init_irq = kirkwood_init_irq, |
338 | .timer = &netspace_v2_timer, | 236 | .timer = &lacie_v2_timer, |
339 | MACHINE_END | 237 | MACHINE_END |
340 | #endif | 238 | #endif |
341 | 239 | ||
@@ -347,6 +245,6 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2") | |||
347 | .init_machine = netspace_v2_init, | 245 | .init_machine = netspace_v2_init, |
348 | .map_io = kirkwood_map_io, | 246 | .map_io = kirkwood_map_io, |
349 | .init_irq = kirkwood_init_irq, | 247 | .init_irq = kirkwood_init_irq, |
350 | .timer = &netspace_v2_timer, | 248 | .timer = &lacie_v2_timer, |
351 | MACHINE_END | 249 | MACHINE_END |
352 | #endif | 250 | #endif |
diff --git a/arch/arm/mach-kirkwood/netxbig_v2-setup.c b/arch/arm/mach-kirkwood/netxbig_v2-setup.c index 2bd14c5079de..d970e1eee37d 100644 --- a/arch/arm/mach-kirkwood/netxbig_v2-setup.c +++ b/arch/arm/mach-kirkwood/netxbig_v2-setup.c | |||
@@ -23,55 +23,19 @@ | |||
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
26 | #include <linux/mtd/physmap.h> | ||
27 | #include <linux/spi/flash.h> | ||
28 | #include <linux/spi/spi.h> | ||
29 | #include <linux/ata_platform.h> | 26 | #include <linux/ata_platform.h> |
30 | #include <linux/mv643xx_eth.h> | 27 | #include <linux/mv643xx_eth.h> |
31 | #include <linux/i2c.h> | ||
32 | #include <linux/i2c/at24.h> | ||
33 | #include <linux/input.h> | 28 | #include <linux/input.h> |
34 | #include <linux/gpio.h> | 29 | #include <linux/gpio.h> |
35 | #include <linux/gpio_keys.h> | 30 | #include <linux/gpio_keys.h> |
36 | #include <linux/leds.h> | 31 | #include <linux/leds.h> |
37 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
38 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
39 | #include <asm/mach/time.h> | ||
40 | #include <mach/kirkwood.h> | 34 | #include <mach/kirkwood.h> |
41 | #include <plat/time.h> | 35 | #include <mach/leds-netxbig.h> |
42 | #include "common.h" | 36 | #include "common.h" |
43 | #include "mpp.h" | 37 | #include "mpp.h" |
44 | 38 | #include "lacie_v2-common.h" | |
45 | /***************************************************************************** | ||
46 | * 512KB SPI Flash on Boot Device (MACRONIX MX25L4005) | ||
47 | ****************************************************************************/ | ||
48 | |||
49 | static struct mtd_partition netxbig_v2_flash_parts[] = { | ||
50 | { | ||
51 | .name = "u-boot", | ||
52 | .size = MTDPART_SIZ_FULL, | ||
53 | .offset = 0, | ||
54 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | static const struct flash_platform_data netxbig_v2_flash = { | ||
59 | .type = "mx25l4005a", | ||
60 | .name = "spi_flash", | ||
61 | .parts = netxbig_v2_flash_parts, | ||
62 | .nr_parts = ARRAY_SIZE(netxbig_v2_flash_parts), | ||
63 | }; | ||
64 | |||
65 | static struct spi_board_info __initdata netxbig_v2_spi_slave_info[] = { | ||
66 | { | ||
67 | .modalias = "m25p80", | ||
68 | .platform_data = &netxbig_v2_flash, | ||
69 | .irq = -1, | ||
70 | .max_speed_hz = 20000000, | ||
71 | .bus_num = 0, | ||
72 | .chip_select = 0, | ||
73 | }, | ||
74 | }; | ||
75 | 39 | ||
76 | /***************************************************************************** | 40 | /***************************************************************************** |
77 | * Ethernet | 41 | * Ethernet |
@@ -86,27 +50,6 @@ static struct mv643xx_eth_platform_data netxbig_v2_ge01_data = { | |||
86 | }; | 50 | }; |
87 | 51 | ||
88 | /***************************************************************************** | 52 | /***************************************************************************** |
89 | * I2C devices | ||
90 | ****************************************************************************/ | ||
91 | |||
92 | static struct at24_platform_data at24c04 = { | ||
93 | .byte_len = SZ_4K / 8, | ||
94 | .page_size = 16, | ||
95 | }; | ||
96 | |||
97 | /* | ||
98 | * i2c addr | chip | description | ||
99 | * 0x50 | HT24LC04 | eeprom (512B) | ||
100 | */ | ||
101 | |||
102 | static struct i2c_board_info __initdata netxbig_v2_i2c_info[] = { | ||
103 | { | ||
104 | I2C_BOARD_INFO("24c04", 0x50), | ||
105 | .platform_data = &at24c04, | ||
106 | } | ||
107 | }; | ||
108 | |||
109 | /***************************************************************************** | ||
110 | * SATA | 53 | * SATA |
111 | ****************************************************************************/ | 54 | ****************************************************************************/ |
112 | 55 | ||
@@ -114,34 +57,6 @@ static struct mv_sata_platform_data netxbig_v2_sata_data = { | |||
114 | .n_ports = 2, | 57 | .n_ports = 2, |
115 | }; | 58 | }; |
116 | 59 | ||
117 | static int __initdata netxbig_v2_gpio_hdd_power[] = { 16, 17, 41, 42, 43 }; | ||
118 | |||
119 | static void __init netxbig_v2_sata_power_init(void) | ||
120 | { | ||
121 | int i; | ||
122 | int err; | ||
123 | int hdd_nb; | ||
124 | |||
125 | if (machine_is_net2big_v2()) | ||
126 | hdd_nb = 2; | ||
127 | else | ||
128 | hdd_nb = 5; | ||
129 | |||
130 | /* Power up all hard disks. */ | ||
131 | for (i = 0; i < hdd_nb; i++) { | ||
132 | err = gpio_request(netxbig_v2_gpio_hdd_power[i], NULL); | ||
133 | if (err == 0) { | ||
134 | err = gpio_direction_output( | ||
135 | netxbig_v2_gpio_hdd_power[i], 1); | ||
136 | /* Free the HDD power GPIOs. This allow user-space to | ||
137 | * configure them via the gpiolib sysfs interface. */ | ||
138 | gpio_free(netxbig_v2_gpio_hdd_power[i]); | ||
139 | } | ||
140 | if (err) | ||
141 | pr_err("netxbig_v2: failed to power up HDD%d\n", i + 1); | ||
142 | } | ||
143 | } | ||
144 | |||
145 | /***************************************************************************** | 60 | /***************************************************************************** |
146 | * GPIO keys | 61 | * GPIO keys |
147 | ****************************************************************************/ | 62 | ****************************************************************************/ |
@@ -190,7 +105,7 @@ static struct platform_device netxbig_v2_gpio_buttons = { | |||
190 | }; | 105 | }; |
191 | 106 | ||
192 | /***************************************************************************** | 107 | /***************************************************************************** |
193 | * GPIO LEDs | 108 | * GPIO extension LEDs |
194 | ****************************************************************************/ | 109 | ****************************************************************************/ |
195 | 110 | ||
196 | /* | 111 | /* |
@@ -200,19 +115,32 @@ static struct platform_device netxbig_v2_gpio_buttons = { | |||
200 | * - address register : bit [0-2] -> GPIO [47-49] | 115 | * - address register : bit [0-2] -> GPIO [47-49] |
201 | * - data register : bit [0-2] -> GPIO [44-46] | 116 | * - data register : bit [0-2] -> GPIO [44-46] |
202 | * - enable register : GPIO 29 | 117 | * - enable register : GPIO 29 |
203 | * | 118 | */ |
119 | |||
120 | static int netxbig_v2_gpio_ext_addr[] = { 47, 48, 49 }; | ||
121 | static int netxbig_v2_gpio_ext_data[] = { 44, 45, 46 }; | ||
122 | |||
123 | static struct netxbig_gpio_ext netxbig_v2_gpio_ext = { | ||
124 | .addr = netxbig_v2_gpio_ext_addr, | ||
125 | .num_addr = ARRAY_SIZE(netxbig_v2_gpio_ext_addr), | ||
126 | .data = netxbig_v2_gpio_ext_data, | ||
127 | .num_data = ARRAY_SIZE(netxbig_v2_gpio_ext_data), | ||
128 | .enable = 29, | ||
129 | }; | ||
130 | |||
131 | /* | ||
204 | * Address register selection: | 132 | * Address register selection: |
205 | * | 133 | * |
206 | * addr | register | 134 | * addr | register |
207 | * ---------------------------- | 135 | * ---------------------------- |
208 | * 0 | front LED | 136 | * 0 | front LED |
209 | * 1 | front LED brightness | 137 | * 1 | front LED brightness |
210 | * 2 | HDD LED brightness | 138 | * 2 | SATA LED brightness |
211 | * 3 | HDD1 LED | 139 | * 3 | SATA0 LED |
212 | * 4 | HDD2 LED | 140 | * 4 | SATA1 LED |
213 | * 5 | HDD3 LED | 141 | * 5 | SATA2 LED |
214 | * 6 | HDD4 LED | 142 | * 6 | SATA3 LED |
215 | * 7 | HDD5 LED | 143 | * 7 | SATA4 LED |
216 | * | 144 | * |
217 | * Data register configuration: | 145 | * Data register configuration: |
218 | * | 146 | * |
@@ -233,30 +161,107 @@ static struct platform_device netxbig_v2_gpio_buttons = { | |||
233 | * 6 | blink blue on=1 sec and red on=1 sec | 161 | * 6 | blink blue on=1 sec and red on=1 sec |
234 | * 7 | blink blue on=0.5 sec and blue off=2.5 sec | 162 | * 7 | blink blue on=0.5 sec and blue off=2.5 sec |
235 | * | 163 | * |
236 | * data | HDD LED mode | 164 | * data | SATA LED mode |
237 | * ------------------------------------------------- | 165 | * ------------------------------------------------- |
238 | * 0 | fix blue on | 166 | * 0 | fix off |
239 | * 1 | SATA activity blink | 167 | * 1 | SATA activity blink |
240 | * 2 | fix red on | 168 | * 2 | fix red on |
241 | * 3 | blink blue on=1 sec and blue off=1 sec | 169 | * 3 | blink blue on=1 sec and blue off=1 sec |
242 | * 4 | blink red on=1 sec and red off=1 sec | 170 | * 4 | blink red on=1 sec and red off=1 sec |
243 | * 5 | blink blue on=2.5 sec and red on=0.5 sec | 171 | * 5 | blink blue on=2.5 sec and red on=0.5 sec |
244 | * 6 | blink blue on=1 sec and red on=1 sec | 172 | * 6 | blink blue on=1 sec and red on=1 sec |
245 | * 7 | blink blue on=0.5 sec and blue off=2.5 sec | 173 | * 7 | fix blue on |
246 | */ | 174 | */ |
247 | 175 | ||
248 | /***************************************************************************** | 176 | static int netxbig_v2_red_mled[NETXBIG_LED_MODE_NUM] = { |
249 | * Timer | 177 | [NETXBIG_LED_OFF] = 0, |
250 | ****************************************************************************/ | 178 | [NETXBIG_LED_ON] = 2, |
179 | [NETXBIG_LED_SATA] = NETXBIG_LED_INVALID_MODE, | ||
180 | [NETXBIG_LED_TIMER1] = 4, | ||
181 | [NETXBIG_LED_TIMER2] = NETXBIG_LED_INVALID_MODE, | ||
182 | }; | ||
251 | 183 | ||
252 | static void netxbig_v2_timer_init(void) | 184 | static int netxbig_v2_blue_pwr_mled[NETXBIG_LED_MODE_NUM] = { |
253 | { | 185 | [NETXBIG_LED_OFF] = 0, |
254 | kirkwood_tclk = 166666667; | 186 | [NETXBIG_LED_ON] = 1, |
255 | orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); | 187 | [NETXBIG_LED_SATA] = NETXBIG_LED_INVALID_MODE, |
256 | } | 188 | [NETXBIG_LED_TIMER1] = 3, |
189 | [NETXBIG_LED_TIMER2] = 7, | ||
190 | }; | ||
191 | |||
192 | static int netxbig_v2_blue_sata_mled[NETXBIG_LED_MODE_NUM] = { | ||
193 | [NETXBIG_LED_OFF] = 0, | ||
194 | [NETXBIG_LED_ON] = 7, | ||
195 | [NETXBIG_LED_SATA] = 1, | ||
196 | [NETXBIG_LED_TIMER1] = 3, | ||
197 | [NETXBIG_LED_TIMER2] = NETXBIG_LED_INVALID_MODE, | ||
198 | }; | ||
199 | |||
200 | static struct netxbig_led_timer netxbig_v2_led_timer[] = { | ||
201 | [0] = { | ||
202 | .delay_on = 500, | ||
203 | .delay_off = 500, | ||
204 | .mode = NETXBIG_LED_TIMER1, | ||
205 | }, | ||
206 | [1] = { | ||
207 | .delay_on = 500, | ||
208 | .delay_off = 1000, | ||
209 | .mode = NETXBIG_LED_TIMER2, | ||
210 | }, | ||
211 | }; | ||
212 | |||
213 | #define NETXBIG_LED(_name, maddr, mval, baddr) \ | ||
214 | { .name = _name, \ | ||
215 | .mode_addr = maddr, \ | ||
216 | .mode_val = mval, \ | ||
217 | .bright_addr = baddr } | ||
218 | |||
219 | static struct netxbig_led net2big_v2_leds_ctrl[] = { | ||
220 | NETXBIG_LED("net2big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled, 1), | ||
221 | NETXBIG_LED("net2big-v2:red:power", 0, netxbig_v2_red_mled, 1), | ||
222 | NETXBIG_LED("net2big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2), | ||
223 | NETXBIG_LED("net2big-v2:red:sata0", 3, netxbig_v2_red_mled, 2), | ||
224 | NETXBIG_LED("net2big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2), | ||
225 | NETXBIG_LED("net2big-v2:red:sata1", 4, netxbig_v2_red_mled, 2), | ||
226 | }; | ||
227 | |||
228 | static struct netxbig_led_platform_data net2big_v2_leds_data = { | ||
229 | .gpio_ext = &netxbig_v2_gpio_ext, | ||
230 | .timer = netxbig_v2_led_timer, | ||
231 | .num_timer = ARRAY_SIZE(netxbig_v2_led_timer), | ||
232 | .leds = net2big_v2_leds_ctrl, | ||
233 | .num_leds = ARRAY_SIZE(net2big_v2_leds_ctrl), | ||
234 | }; | ||
235 | |||
236 | static struct netxbig_led net5big_v2_leds_ctrl[] = { | ||
237 | NETXBIG_LED("net5big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled, 1), | ||
238 | NETXBIG_LED("net5big-v2:red:power", 0, netxbig_v2_red_mled, 1), | ||
239 | NETXBIG_LED("net5big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2), | ||
240 | NETXBIG_LED("net5big-v2:red:sata0", 3, netxbig_v2_red_mled, 2), | ||
241 | NETXBIG_LED("net5big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2), | ||
242 | NETXBIG_LED("net5big-v2:red:sata1", 4, netxbig_v2_red_mled, 2), | ||
243 | NETXBIG_LED("net5big-v2:blue:sata2", 5, netxbig_v2_blue_sata_mled, 2), | ||
244 | NETXBIG_LED("net5big-v2:red:sata2", 5, netxbig_v2_red_mled, 2), | ||
245 | NETXBIG_LED("net5big-v2:blue:sata3", 6, netxbig_v2_blue_sata_mled, 2), | ||
246 | NETXBIG_LED("net5big-v2:red:sata3", 6, netxbig_v2_red_mled, 2), | ||
247 | NETXBIG_LED("net5big-v2:blue:sata4", 7, netxbig_v2_blue_sata_mled, 2), | ||
248 | NETXBIG_LED("net5big-v2:red:sata5", 7, netxbig_v2_red_mled, 2), | ||
249 | }; | ||
257 | 250 | ||
258 | struct sys_timer netxbig_v2_timer = { | 251 | static struct netxbig_led_platform_data net5big_v2_leds_data = { |
259 | .init = netxbig_v2_timer_init, | 252 | .gpio_ext = &netxbig_v2_gpio_ext, |
253 | .timer = netxbig_v2_led_timer, | ||
254 | .num_timer = ARRAY_SIZE(netxbig_v2_led_timer), | ||
255 | .leds = net5big_v2_leds_ctrl, | ||
256 | .num_leds = ARRAY_SIZE(net5big_v2_leds_ctrl), | ||
257 | }; | ||
258 | |||
259 | static struct platform_device netxbig_v2_leds = { | ||
260 | .name = "leds-netxbig", | ||
261 | .id = -1, | ||
262 | .dev = { | ||
263 | .platform_data = &net2big_v2_leds_data, | ||
264 | }, | ||
260 | }; | 265 | }; |
261 | 266 | ||
262 | /***************************************************************************** | 267 | /***************************************************************************** |
@@ -284,18 +289,18 @@ static unsigned int net2big_v2_mpp_config[] __initdata = { | |||
284 | MPP24_GPIO, /* USB mode select */ | 289 | MPP24_GPIO, /* USB mode select */ |
285 | MPP26_GPIO, /* USB device vbus */ | 290 | MPP26_GPIO, /* USB device vbus */ |
286 | MPP28_GPIO, /* USB enable host vbus */ | 291 | MPP28_GPIO, /* USB enable host vbus */ |
287 | MPP29_GPIO, /* CPLD extension ALE */ | 292 | MPP29_GPIO, /* GPIO extension ALE */ |
288 | MPP34_GPIO, /* Rear Push button */ | 293 | MPP34_GPIO, /* Rear Push button */ |
289 | MPP35_GPIO, /* Inhibit switch power-off */ | 294 | MPP35_GPIO, /* Inhibit switch power-off */ |
290 | MPP36_GPIO, /* SATA HDD1 presence */ | 295 | MPP36_GPIO, /* SATA HDD1 presence */ |
291 | MPP37_GPIO, /* SATA HDD2 presence */ | 296 | MPP37_GPIO, /* SATA HDD2 presence */ |
292 | MPP40_GPIO, /* eSATA presence */ | 297 | MPP40_GPIO, /* eSATA presence */ |
293 | MPP44_GPIO, /* CPLD extension (data 0) */ | 298 | MPP44_GPIO, /* GPIO extension (data 0) */ |
294 | MPP45_GPIO, /* CPLD extension (data 1) */ | 299 | MPP45_GPIO, /* GPIO extension (data 1) */ |
295 | MPP46_GPIO, /* CPLD extension (data 2) */ | 300 | MPP46_GPIO, /* GPIO extension (data 2) */ |
296 | MPP47_GPIO, /* CPLD extension (addr 0) */ | 301 | MPP47_GPIO, /* GPIO extension (addr 0) */ |
297 | MPP48_GPIO, /* CPLD extension (addr 1) */ | 302 | MPP48_GPIO, /* GPIO extension (addr 1) */ |
298 | MPP49_GPIO, /* CPLD extension (addr 2) */ | 303 | MPP49_GPIO, /* GPIO extension (addr 2) */ |
299 | 0 | 304 | 0 |
300 | }; | 305 | }; |
301 | 306 | ||
@@ -324,7 +329,7 @@ static unsigned int net5big_v2_mpp_config[] __initdata = { | |||
324 | MPP26_GE1_RXD2, | 329 | MPP26_GE1_RXD2, |
325 | MPP27_GE1_RXD3, | 330 | MPP27_GE1_RXD3, |
326 | MPP28_GPIO, /* USB enable host vbus */ | 331 | MPP28_GPIO, /* USB enable host vbus */ |
327 | MPP29_GPIO, /* CPLD extension ALE */ | 332 | MPP29_GPIO, /* GPIO extension ALE */ |
328 | MPP30_GE1_RXCTL, | 333 | MPP30_GE1_RXCTL, |
329 | MPP31_GE1_RXCLK, | 334 | MPP31_GE1_RXCLK, |
330 | MPP32_GE1_TCLKOUT, | 335 | MPP32_GE1_TCLKOUT, |
@@ -339,12 +344,12 @@ static unsigned int net5big_v2_mpp_config[] __initdata = { | |||
339 | MPP41_GPIO, /* SATA HDD3 power */ | 344 | MPP41_GPIO, /* SATA HDD3 power */ |
340 | MPP42_GPIO, /* SATA HDD4 power */ | 345 | MPP42_GPIO, /* SATA HDD4 power */ |
341 | MPP43_GPIO, /* SATA HDD5 power */ | 346 | MPP43_GPIO, /* SATA HDD5 power */ |
342 | MPP44_GPIO, /* CPLD extension (data 0) */ | 347 | MPP44_GPIO, /* GPIO extension (data 0) */ |
343 | MPP45_GPIO, /* CPLD extension (data 1) */ | 348 | MPP45_GPIO, /* GPIO extension (data 1) */ |
344 | MPP46_GPIO, /* CPLD extension (data 2) */ | 349 | MPP46_GPIO, /* GPIO extension (data 2) */ |
345 | MPP47_GPIO, /* CPLD extension (addr 0) */ | 350 | MPP47_GPIO, /* GPIO extension (addr 0) */ |
346 | MPP48_GPIO, /* CPLD extension (addr 1) */ | 351 | MPP48_GPIO, /* GPIO extension (addr 1) */ |
347 | MPP49_GPIO, /* CPLD extension (addr 2) */ | 352 | MPP49_GPIO, /* GPIO extension (addr 2) */ |
348 | 0 | 353 | 0 |
349 | }; | 354 | }; |
350 | 355 | ||
@@ -366,7 +371,10 @@ static void __init netxbig_v2_init(void) | |||
366 | else | 371 | else |
367 | kirkwood_mpp_conf(net5big_v2_mpp_config); | 372 | kirkwood_mpp_conf(net5big_v2_mpp_config); |
368 | 373 | ||
369 | netxbig_v2_sata_power_init(); | 374 | if (machine_is_net2big_v2()) |
375 | lacie_v2_hdd_power_init(2); | ||
376 | else | ||
377 | lacie_v2_hdd_power_init(5); | ||
370 | 378 | ||
371 | kirkwood_ehci_init(); | 379 | kirkwood_ehci_init(); |
372 | kirkwood_ge00_init(&netxbig_v2_ge00_data); | 380 | kirkwood_ge00_init(&netxbig_v2_ge00_data); |
@@ -374,13 +382,12 @@ static void __init netxbig_v2_init(void) | |||
374 | kirkwood_ge01_init(&netxbig_v2_ge01_data); | 382 | kirkwood_ge01_init(&netxbig_v2_ge01_data); |
375 | kirkwood_sata_init(&netxbig_v2_sata_data); | 383 | kirkwood_sata_init(&netxbig_v2_sata_data); |
376 | kirkwood_uart0_init(); | 384 | kirkwood_uart0_init(); |
377 | spi_register_board_info(netxbig_v2_spi_slave_info, | 385 | lacie_v2_register_flash(); |
378 | ARRAY_SIZE(netxbig_v2_spi_slave_info)); | 386 | lacie_v2_register_i2c_devices(); |
379 | kirkwood_spi_init(); | ||
380 | kirkwood_i2c_init(); | ||
381 | i2c_register_board_info(0, netxbig_v2_i2c_info, | ||
382 | ARRAY_SIZE(netxbig_v2_i2c_info)); | ||
383 | 387 | ||
388 | if (machine_is_net5big_v2()) | ||
389 | netxbig_v2_leds.dev.platform_data = &net5big_v2_leds_data; | ||
390 | platform_device_register(&netxbig_v2_leds); | ||
384 | platform_device_register(&netxbig_v2_gpio_buttons); | 391 | platform_device_register(&netxbig_v2_gpio_buttons); |
385 | 392 | ||
386 | if (gpio_request(NETXBIG_V2_GPIO_POWER_OFF, "power-off") == 0 && | 393 | if (gpio_request(NETXBIG_V2_GPIO_POWER_OFF, "power-off") == 0 && |
@@ -398,7 +405,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2") | |||
398 | .init_machine = netxbig_v2_init, | 405 | .init_machine = netxbig_v2_init, |
399 | .map_io = kirkwood_map_io, | 406 | .map_io = kirkwood_map_io, |
400 | .init_irq = kirkwood_init_irq, | 407 | .init_irq = kirkwood_init_irq, |
401 | .timer = &netxbig_v2_timer, | 408 | .timer = &lacie_v2_timer, |
402 | MACHINE_END | 409 | MACHINE_END |
403 | #endif | 410 | #endif |
404 | 411 | ||
@@ -410,6 +417,6 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2") | |||
410 | .init_machine = netxbig_v2_init, | 417 | .init_machine = netxbig_v2_init, |
411 | .map_io = kirkwood_map_io, | 418 | .map_io = kirkwood_map_io, |
412 | .init_irq = kirkwood_init_irq, | 419 | .init_irq = kirkwood_init_irq, |
413 | .timer = &netxbig_v2_timer, | 420 | .timer = &lacie_v2_timer, |
414 | MACHINE_END | 421 | MACHINE_END |
415 | #endif | 422 | #endif |
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c index fd06be618815..38017c8ac43f 100644 --- a/arch/arm/mach-kirkwood/openrd-setup.c +++ b/arch/arm/mach-kirkwood/openrd-setup.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/ata_platform.h> | 16 | #include <linux/ata_platform.h> |
17 | #include <linux/mv643xx_eth.h> | 17 | #include <linux/mv643xx_eth.h> |
18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
19 | #include <linux/gpio.h> | ||
19 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
20 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
21 | #include <mach/kirkwood.h> | 22 | #include <mach/kirkwood.h> |
@@ -57,7 +58,22 @@ static struct mvsdio_platform_data openrd_mvsdio_data = { | |||
57 | }; | 58 | }; |
58 | 59 | ||
59 | static unsigned int openrd_mpp_config[] __initdata = { | 60 | static unsigned int openrd_mpp_config[] __initdata = { |
61 | MPP12_SD_CLK, | ||
62 | MPP13_SD_CMD, | ||
63 | MPP14_SD_D0, | ||
64 | MPP15_SD_D1, | ||
65 | MPP16_SD_D2, | ||
66 | MPP17_SD_D3, | ||
67 | MPP28_GPIO, | ||
60 | MPP29_GPIO, | 68 | MPP29_GPIO, |
69 | MPP34_GPIO, | ||
70 | 0 | ||
71 | }; | ||
72 | |||
73 | /* Configure MPP for UART1 */ | ||
74 | static unsigned int openrd_uart1_mpp_config[] __initdata = { | ||
75 | MPP13_UART1_TXD, | ||
76 | MPP14_UART1_RXD, | ||
61 | 0 | 77 | 0 |
62 | }; | 78 | }; |
63 | 79 | ||
@@ -67,6 +83,68 @@ static struct i2c_board_info i2c_board_info[] __initdata = { | |||
67 | }, | 83 | }, |
68 | }; | 84 | }; |
69 | 85 | ||
86 | static int __initdata uart1; | ||
87 | |||
88 | static int __init sd_uart_selection(char *str) | ||
89 | { | ||
90 | uart1 = -EINVAL; | ||
91 | |||
92 | /* Default is SD. Change if required, for UART */ | ||
93 | if (!str) | ||
94 | return 0; | ||
95 | |||
96 | if (!strncmp(str, "232", 3)) { | ||
97 | uart1 = 232; | ||
98 | } else if (!strncmp(str, "485", 3)) { | ||
99 | /* OpenRD-Base doesn't have RS485. Treat is as an | ||
100 | * unknown argument & just have default setting - | ||
101 | * which is SD */ | ||
102 | if (machine_is_openrd_base()) { | ||
103 | uart1 = -ENODEV; | ||
104 | return 1; | ||
105 | } | ||
106 | |||
107 | uart1 = 485; | ||
108 | } | ||
109 | return 1; | ||
110 | } | ||
111 | /* Parse boot_command_line string kw_openrd_init_uart1=232/485 */ | ||
112 | __setup("kw_openrd_init_uart1=", sd_uart_selection); | ||
113 | |||
114 | static int __init uart1_mpp_config(void) | ||
115 | { | ||
116 | kirkwood_mpp_conf(openrd_uart1_mpp_config); | ||
117 | |||
118 | if (gpio_request(34, "SD_UART1_SEL")) { | ||
119 | printk(KERN_ERR "GPIO request failed for SD/UART1 selection" | ||
120 | ", gpio: 34\n"); | ||
121 | return -EIO; | ||
122 | } | ||
123 | |||
124 | if (gpio_request(28, "RS232_RS485_SEL")) { | ||
125 | printk(KERN_ERR "GPIO request failed for RS232/RS485 selection" | ||
126 | ", gpio# 28\n"); | ||
127 | gpio_free(34); | ||
128 | return -EIO; | ||
129 | } | ||
130 | |||
131 | /* Select UART1 | ||
132 | * Pin # 34: 0 => UART1, 1 => SD */ | ||
133 | gpio_direction_output(34, 0); | ||
134 | |||
135 | /* Select RS232 OR RS485 | ||
136 | * Pin # 28: 0 => RS232, 1 => RS485 */ | ||
137 | if (uart1 == 232) | ||
138 | gpio_direction_output(28, 0); | ||
139 | else | ||
140 | gpio_direction_output(28, 1); | ||
141 | |||
142 | gpio_free(34); | ||
143 | gpio_free(28); | ||
144 | |||
145 | return 0; | ||
146 | } | ||
147 | |||
70 | static void __init openrd_init(void) | 148 | static void __init openrd_init(void) |
71 | { | 149 | { |
72 | /* | 150 | /* |
@@ -90,7 +168,6 @@ static void __init openrd_init(void) | |||
90 | kirkwood_ge01_init(&openrd_ge01_data); | 168 | kirkwood_ge01_init(&openrd_ge01_data); |
91 | 169 | ||
92 | kirkwood_sata_init(&openrd_sata_data); | 170 | kirkwood_sata_init(&openrd_sata_data); |
93 | kirkwood_sdio_init(&openrd_mvsdio_data); | ||
94 | 171 | ||
95 | kirkwood_i2c_init(); | 172 | kirkwood_i2c_init(); |
96 | 173 | ||
@@ -99,6 +176,28 @@ static void __init openrd_init(void) | |||
99 | ARRAY_SIZE(i2c_board_info)); | 176 | ARRAY_SIZE(i2c_board_info)); |
100 | kirkwood_audio_init(); | 177 | kirkwood_audio_init(); |
101 | } | 178 | } |
179 | |||
180 | if (uart1 <= 0) { | ||
181 | if (uart1 < 0) | ||
182 | printk(KERN_ERR "Invalid kernel parameter to select " | ||
183 | "UART1. Defaulting to SD. ERROR CODE: %d\n", | ||
184 | uart1); | ||
185 | |||
186 | /* Select SD | ||
187 | * Pin # 34: 0 => UART1, 1 => SD */ | ||
188 | if (gpio_request(34, "SD_UART1_SEL")) { | ||
189 | printk(KERN_ERR "GPIO request failed for SD/UART1 " | ||
190 | "selection, gpio: 34\n"); | ||
191 | } else { | ||
192 | |||
193 | gpio_direction_output(34, 1); | ||
194 | gpio_free(34); | ||
195 | kirkwood_sdio_init(&openrd_mvsdio_data); | ||
196 | } | ||
197 | } else { | ||
198 | if (!uart1_mpp_config()) | ||
199 | kirkwood_uart1_init(); | ||
200 | } | ||
102 | } | 201 | } |
103 | 202 | ||
104 | static int __init openrd_pci_init(void) | 203 | static int __init openrd_pci_init(void) |
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index 55e7f00836b7..513ad3102d7c 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c | |||
@@ -117,7 +117,7 @@ static void __init pcie0_ioresources_init(struct pcie_port *pp) | |||
117 | * IORESOURCE_IO | 117 | * IORESOURCE_IO |
118 | */ | 118 | */ |
119 | pp->res[0].name = "PCIe 0 I/O Space"; | 119 | pp->res[0].name = "PCIe 0 I/O Space"; |
120 | pp->res[0].start = KIRKWOOD_PCIE_IO_PHYS_BASE; | 120 | pp->res[0].start = KIRKWOOD_PCIE_IO_BUS_BASE; |
121 | pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1; | 121 | pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1; |
122 | pp->res[0].flags = IORESOURCE_IO; | 122 | pp->res[0].flags = IORESOURCE_IO; |
123 | 123 | ||
@@ -139,7 +139,7 @@ static void __init pcie1_ioresources_init(struct pcie_port *pp) | |||
139 | * IORESOURCE_IO | 139 | * IORESOURCE_IO |
140 | */ | 140 | */ |
141 | pp->res[0].name = "PCIe 1 I/O Space"; | 141 | pp->res[0].name = "PCIe 1 I/O Space"; |
142 | pp->res[0].start = KIRKWOOD_PCIE1_IO_PHYS_BASE; | 142 | pp->res[0].start = KIRKWOOD_PCIE1_IO_BUS_BASE; |
143 | pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE1_IO_SIZE - 1; | 143 | pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE1_IO_SIZE - 1; |
144 | pp->res[0].flags = IORESOURCE_IO; | 144 | pp->res[0].flags = IORESOURCE_IO; |
145 | 145 | ||
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig index 6ab843eaa35b..0711d3b620ad 100644 --- a/arch/arm/mach-mmp/Kconfig +++ b/arch/arm/mach-mmp/Kconfig | |||
@@ -57,6 +57,13 @@ config MACH_MARVELL_JASPER | |||
57 | PXA910-based development board. Since MMP2 is compatible to | 57 | PXA910-based development board. Since MMP2 is compatible to |
58 | ARMv6 architecture. | 58 | ARMv6 architecture. |
59 | 59 | ||
60 | config MACH_TETON_BGA | ||
61 | bool "Marvell's PXA168 Teton BGA Development Board" | ||
62 | select CPU_PXA168 | ||
63 | help | ||
64 | Say 'Y' here if you want to support the Marvell PXA168-based | ||
65 | Teton BGA Development Board. | ||
66 | |||
60 | endmenu | 67 | endmenu |
61 | 68 | ||
62 | config CPU_PXA168 | 69 | config CPU_PXA168 |
diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile index 8b66d06739c4..751cdbf733c8 100644 --- a/arch/arm/mach-mmp/Makefile +++ b/arch/arm/mach-mmp/Makefile | |||
@@ -17,3 +17,4 @@ obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o | |||
17 | obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o | 17 | obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o |
18 | obj-$(CONFIG_MACH_FLINT) += flint.o | 18 | obj-$(CONFIG_MACH_FLINT) += flint.o |
19 | obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o | 19 | obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o |
20 | obj-$(CONFIG_MACH_TETON_BGA) += teton_bga.o | ||
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c index 0629394a5fb9..4681bedbe788 100644 --- a/arch/arm/mach-mmp/aspenite.c +++ b/arch/arm/mach-mmp/aspenite.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/mtd/mtd.h> | 16 | #include <linux/mtd/mtd.h> |
17 | #include <linux/mtd/partitions.h> | 17 | #include <linux/mtd/partitions.h> |
18 | #include <linux/mtd/nand.h> | 18 | #include <linux/mtd/nand.h> |
19 | #include <linux/interrupt.h> | ||
19 | 20 | ||
20 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
21 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
@@ -23,6 +24,9 @@ | |||
23 | #include <mach/mfp-pxa168.h> | 24 | #include <mach/mfp-pxa168.h> |
24 | #include <mach/pxa168.h> | 25 | #include <mach/pxa168.h> |
25 | #include <mach/gpio.h> | 26 | #include <mach/gpio.h> |
27 | #include <video/pxa168fb.h> | ||
28 | #include <linux/input.h> | ||
29 | #include <plat/pxa27x_keypad.h> | ||
26 | 30 | ||
27 | #include "common.h" | 31 | #include "common.h" |
28 | 32 | ||
@@ -66,6 +70,43 @@ static unsigned long common_pin_config[] __initdata = { | |||
66 | GPIO115_I2S_BCLK, | 70 | GPIO115_I2S_BCLK, |
67 | GPIO116_I2S_RXD, | 71 | GPIO116_I2S_RXD, |
68 | GPIO117_I2S_TXD, | 72 | GPIO117_I2S_TXD, |
73 | |||
74 | /* LCD */ | ||
75 | GPIO56_LCD_FCLK_RD, | ||
76 | GPIO57_LCD_LCLK_A0, | ||
77 | GPIO58_LCD_PCLK_WR, | ||
78 | GPIO59_LCD_DENA_BIAS, | ||
79 | GPIO60_LCD_DD0, | ||
80 | GPIO61_LCD_DD1, | ||
81 | GPIO62_LCD_DD2, | ||
82 | GPIO63_LCD_DD3, | ||
83 | GPIO64_LCD_DD4, | ||
84 | GPIO65_LCD_DD5, | ||
85 | GPIO66_LCD_DD6, | ||
86 | GPIO67_LCD_DD7, | ||
87 | GPIO68_LCD_DD8, | ||
88 | GPIO69_LCD_DD9, | ||
89 | GPIO70_LCD_DD10, | ||
90 | GPIO71_LCD_DD11, | ||
91 | GPIO72_LCD_DD12, | ||
92 | GPIO73_LCD_DD13, | ||
93 | GPIO74_LCD_DD14, | ||
94 | GPIO75_LCD_DD15, | ||
95 | GPIO76_LCD_DD16, | ||
96 | GPIO77_LCD_DD17, | ||
97 | GPIO78_LCD_DD18, | ||
98 | GPIO79_LCD_DD19, | ||
99 | GPIO80_LCD_DD20, | ||
100 | GPIO81_LCD_DD21, | ||
101 | GPIO82_LCD_DD22, | ||
102 | GPIO83_LCD_DD23, | ||
103 | |||
104 | /* Keypad */ | ||
105 | GPIO109_KP_MKIN1, | ||
106 | GPIO110_KP_MKIN0, | ||
107 | GPIO111_KP_MKOUT7, | ||
108 | GPIO112_KP_MKOUT6, | ||
109 | GPIO121_KP_MKIN4, | ||
69 | }; | 110 | }; |
70 | 111 | ||
71 | static struct smc91x_platdata smc91x_info = { | 112 | static struct smc91x_platdata smc91x_info = { |
@@ -134,6 +175,51 @@ static struct i2c_board_info aspenite_i2c_info[] __initdata = { | |||
134 | { I2C_BOARD_INFO("wm8753", 0x1b), }, | 175 | { I2C_BOARD_INFO("wm8753", 0x1b), }, |
135 | }; | 176 | }; |
136 | 177 | ||
178 | static struct fb_videomode video_modes[] = { | ||
179 | [0] = { | ||
180 | .pixclock = 30120, | ||
181 | .refresh = 60, | ||
182 | .xres = 800, | ||
183 | .yres = 480, | ||
184 | .hsync_len = 1, | ||
185 | .left_margin = 215, | ||
186 | .right_margin = 40, | ||
187 | .vsync_len = 1, | ||
188 | .upper_margin = 34, | ||
189 | .lower_margin = 10, | ||
190 | .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT, | ||
191 | }, | ||
192 | }; | ||
193 | |||
194 | struct pxa168fb_mach_info aspenite_lcd_info = { | ||
195 | .id = "Graphic Frame", | ||
196 | .modes = video_modes, | ||
197 | .num_modes = ARRAY_SIZE(video_modes), | ||
198 | .pix_fmt = PIX_FMT_RGB565, | ||
199 | .io_pin_allocation_mode = PIN_MODE_DUMB_24, | ||
200 | .dumb_mode = DUMB_MODE_RGB888, | ||
201 | .active = 1, | ||
202 | .panel_rbswap = 0, | ||
203 | .invert_pixclock = 0, | ||
204 | }; | ||
205 | |||
206 | static unsigned int aspenite_matrix_key_map[] = { | ||
207 | KEY(0, 6, KEY_UP), /* SW 4 */ | ||
208 | KEY(0, 7, KEY_DOWN), /* SW 5 */ | ||
209 | KEY(1, 6, KEY_LEFT), /* SW 6 */ | ||
210 | KEY(1, 7, KEY_RIGHT), /* SW 7 */ | ||
211 | KEY(4, 6, KEY_ENTER), /* SW 8 */ | ||
212 | KEY(4, 7, KEY_ESC), /* SW 9 */ | ||
213 | }; | ||
214 | |||
215 | static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = { | ||
216 | .matrix_key_rows = 5, | ||
217 | .matrix_key_cols = 8, | ||
218 | .matrix_key_map = aspenite_matrix_key_map, | ||
219 | .matrix_key_map_size = ARRAY_SIZE(aspenite_matrix_key_map), | ||
220 | .debounce_interval = 30, | ||
221 | }; | ||
222 | |||
137 | static void __init common_init(void) | 223 | static void __init common_init(void) |
138 | { | 224 | { |
139 | mfp_config(ARRAY_AND_SIZE(common_pin_config)); | 225 | mfp_config(ARRAY_AND_SIZE(common_pin_config)); |
@@ -143,6 +229,8 @@ static void __init common_init(void) | |||
143 | pxa168_add_twsi(1, NULL, ARRAY_AND_SIZE(aspenite_i2c_info)); | 229 | pxa168_add_twsi(1, NULL, ARRAY_AND_SIZE(aspenite_i2c_info)); |
144 | pxa168_add_ssp(1); | 230 | pxa168_add_ssp(1); |
145 | pxa168_add_nand(&aspenite_nand_info); | 231 | pxa168_add_nand(&aspenite_nand_info); |
232 | pxa168_add_fb(&aspenite_lcd_info); | ||
233 | pxa168_add_keypad(&aspenite_keypad_info); | ||
146 | 234 | ||
147 | /* off-chip devices */ | 235 | /* off-chip devices */ |
148 | platform_device_register(&smc91x_device); | 236 | platform_device_register(&smc91x_device); |
@@ -152,6 +240,7 @@ MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform") | |||
152 | .phys_io = APB_PHYS_BASE, | 240 | .phys_io = APB_PHYS_BASE, |
153 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, | 241 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, |
154 | .map_io = mmp_map_io, | 242 | .map_io = mmp_map_io, |
243 | .nr_irqs = IRQ_BOARD_START, | ||
155 | .init_irq = pxa168_init_irq, | 244 | .init_irq = pxa168_init_irq, |
156 | .timer = &pxa168_timer, | 245 | .timer = &pxa168_timer, |
157 | .init_machine = common_init, | 246 | .init_machine = common_init, |
@@ -161,6 +250,7 @@ MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform") | |||
161 | .phys_io = APB_PHYS_BASE, | 250 | .phys_io = APB_PHYS_BASE, |
162 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, | 251 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, |
163 | .map_io = mmp_map_io, | 252 | .map_io = mmp_map_io, |
253 | .nr_irqs = IRQ_BOARD_START, | ||
164 | .init_irq = pxa168_init_irq, | 254 | .init_irq = pxa168_init_irq, |
165 | .timer = &pxa168_timer, | 255 | .timer = &pxa168_timer, |
166 | .init_machine = common_init, | 256 | .init_machine = common_init, |
diff --git a/arch/arm/mach-mmp/common.c b/arch/arm/mach-mmp/common.c index 3b29fa7e9b08..0ec0ca80bb3e 100644 --- a/arch/arm/mach-mmp/common.c +++ b/arch/arm/mach-mmp/common.c | |||
@@ -10,13 +10,20 @@ | |||
10 | 10 | ||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/module.h> | ||
13 | 14 | ||
14 | #include <asm/page.h> | 15 | #include <asm/page.h> |
15 | #include <asm/mach/map.h> | 16 | #include <asm/mach/map.h> |
16 | #include <mach/addr-map.h> | 17 | #include <mach/addr-map.h> |
18 | #include <mach/cputype.h> | ||
17 | 19 | ||
18 | #include "common.h" | 20 | #include "common.h" |
19 | 21 | ||
22 | #define MMP_CHIPID (AXI_VIRT_BASE + 0x82c00) | ||
23 | |||
24 | unsigned int mmp_chip_id; | ||
25 | EXPORT_SYMBOL(mmp_chip_id); | ||
26 | |||
20 | static struct map_desc standard_io_desc[] __initdata = { | 27 | static struct map_desc standard_io_desc[] __initdata = { |
21 | { | 28 | { |
22 | .pfn = __phys_to_pfn(APB_PHYS_BASE), | 29 | .pfn = __phys_to_pfn(APB_PHYS_BASE), |
@@ -34,4 +41,7 @@ static struct map_desc standard_io_desc[] __initdata = { | |||
34 | void __init mmp_map_io(void) | 41 | void __init mmp_map_io(void) |
35 | { | 42 | { |
36 | iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); | 43 | iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); |
44 | |||
45 | /* this is early, initialize mmp_chip_id here */ | ||
46 | mmp_chip_id = __raw_readl(MMP_CHIPID); | ||
37 | } | 47 | } |
diff --git a/arch/arm/mach-mmp/flint.c b/arch/arm/mach-mmp/flint.c index e4312d238eae..c558425c3613 100644 --- a/arch/arm/mach-mmp/flint.c +++ b/arch/arm/mach-mmp/flint.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/smc91x.h> | 16 | #include <linux/smc91x.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/interrupt.h> | ||
19 | 20 | ||
20 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
21 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
@@ -25,6 +26,8 @@ | |||
25 | 26 | ||
26 | #include "common.h" | 27 | #include "common.h" |
27 | 28 | ||
29 | #define FLINT_NR_IRQS (IRQ_BOARD_START + 48) | ||
30 | |||
28 | static unsigned long flint_pin_config[] __initdata = { | 31 | static unsigned long flint_pin_config[] __initdata = { |
29 | /* UART1 */ | 32 | /* UART1 */ |
30 | GPIO45_UART1_RXD, | 33 | GPIO45_UART1_RXD, |
@@ -116,6 +119,7 @@ MACHINE_START(FLINT, "Flint Development Platform") | |||
116 | .phys_io = APB_PHYS_BASE, | 119 | .phys_io = APB_PHYS_BASE, |
117 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, | 120 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, |
118 | .map_io = mmp_map_io, | 121 | .map_io = mmp_map_io, |
122 | .nr_irqs = FLINT_NR_IRQS, | ||
119 | .init_irq = mmp2_init_irq, | 123 | .init_irq = mmp2_init_irq, |
120 | .timer = &mmp2_timer, | 124 | .timer = &mmp2_timer, |
121 | .init_machine = flint_init, | 125 | .init_machine = flint_init, |
diff --git a/arch/arm/mach-mmp/include/mach/cputype.h b/arch/arm/mach-mmp/include/mach/cputype.h index 83b18721d933..f43a68b213f1 100644 --- a/arch/arm/mach-mmp/include/mach/cputype.h +++ b/arch/arm/mach-mmp/include/mach/cputype.h | |||
@@ -4,36 +4,51 @@ | |||
4 | #include <asm/cputype.h> | 4 | #include <asm/cputype.h> |
5 | 5 | ||
6 | /* | 6 | /* |
7 | * CPU Stepping OLD_ID CPU_ID CHIP_ID | 7 | * CPU Stepping CPU_ID CHIP_ID |
8 | * | 8 | * |
9 | * PXA168 A0 0x41159263 0x56158400 0x00A0A333 | 9 | * PXA168 S0 0x56158400 0x0000C910 |
10 | * PXA910 Y0 0x41159262 0x56158000 0x00F0C910 | 10 | * PXA168 A0 0x56158400 0x00A0A168 |
11 | * MMP2 Z0 0x560f5811 | 11 | * PXA910 Y1 0x56158400 0x00F2C920 |
12 | * PXA910 A0 0x56158400 0x00F2C910 | ||
13 | * PXA910 A1 0x56158400 0x00A0C910 | ||
14 | * PXA920 Y0 0x56158400 0x00F2C920 | ||
15 | * PXA920 A0 0x56158400 0x00A0C920 | ||
16 | * PXA920 A1 0x56158400 0x00A1C920 | ||
17 | * MMP2 Z0 0x560f5811 0x00F00410 | ||
18 | * MMP2 Z1 0x560f5811 0x00E00410 | ||
19 | * MMP2 A0 0x560f5811 0x00A0A610 | ||
12 | */ | 20 | */ |
13 | 21 | ||
22 | extern unsigned int mmp_chip_id; | ||
23 | |||
14 | #ifdef CONFIG_CPU_PXA168 | 24 | #ifdef CONFIG_CPU_PXA168 |
15 | # define __cpu_is_pxa168(id) \ | 25 | static inline int cpu_is_pxa168(void) |
16 | ({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x84; }) | 26 | { |
27 | return (((read_cpuid_id() >> 8) & 0xff) == 0x84) && | ||
28 | ((mmp_chip_id & 0xfff) == 0x168); | ||
29 | } | ||
17 | #else | 30 | #else |
18 | # define __cpu_is_pxa168(id) (0) | 31 | #define cpu_is_pxa168() (0) |
19 | #endif | 32 | #endif |
20 | 33 | ||
34 | /* cpu_is_pxa910() is shared on both pxa910 and pxa920 */ | ||
21 | #ifdef CONFIG_CPU_PXA910 | 35 | #ifdef CONFIG_CPU_PXA910 |
22 | # define __cpu_is_pxa910(id) \ | 36 | static inline int cpu_is_pxa910(void) |
23 | ({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x80; }) | 37 | { |
38 | return (((read_cpuid_id() >> 8) & 0xff) == 0x84) && | ||
39 | (((mmp_chip_id & 0xfff) == 0x910) || | ||
40 | ((mmp_chip_id & 0xfff) == 0x920)); | ||
41 | } | ||
24 | #else | 42 | #else |
25 | # define __cpu_is_pxa910(id) (0) | 43 | #define cpu_is_pxa910() (0) |
26 | #endif | 44 | #endif |
27 | 45 | ||
28 | #ifdef CONFIG_CPU_MMP2 | 46 | #ifdef CONFIG_CPU_MMP2 |
29 | # define __cpu_is_mmp2(id) \ | 47 | static inline int cpu_is_mmp2(void) |
30 | ({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x58; }) | 48 | { |
49 | return (((cpu_readid_id() >> 8) & 0xff) == 0x58); | ||
31 | #else | 50 | #else |
32 | # define __cpu_is_mmp2(id) (0) | 51 | #define cpu_is_mmp2() (0) |
33 | #endif | 52 | #endif |
34 | 53 | ||
35 | #define cpu_is_pxa168() ({ __cpu_is_pxa168(read_cpuid_id()); }) | ||
36 | #define cpu_is_pxa910() ({ __cpu_is_pxa910(read_cpuid_id()); }) | ||
37 | #define cpu_is_mmp2() ({ __cpu_is_mmp2(read_cpuid_id()); }) | ||
38 | |||
39 | #endif /* __ASM_MACH_CPUTYPE_H */ | 54 | #endif /* __ASM_MACH_CPUTYPE_H */ |
diff --git a/arch/arm/mach-mmp/include/mach/irqs.h b/arch/arm/mach-mmp/include/mach/irqs.h index b379cdec4d38..a09d328e2ddd 100644 --- a/arch/arm/mach-mmp/include/mach/irqs.h +++ b/arch/arm/mach-mmp/include/mach/irqs.h | |||
@@ -222,10 +222,8 @@ | |||
222 | #define IRQ_GPIO_NUM 192 | 222 | #define IRQ_GPIO_NUM 192 |
223 | #define IRQ_GPIO(x) (IRQ_GPIO_START + (x)) | 223 | #define IRQ_GPIO(x) (IRQ_GPIO_START + (x)) |
224 | 224 | ||
225 | /* Board IRQ - 64 by default, increase if not enough */ | ||
226 | #define IRQ_BOARD_START (IRQ_GPIO_START + IRQ_GPIO_NUM) | 225 | #define IRQ_BOARD_START (IRQ_GPIO_START + IRQ_GPIO_NUM) |
227 | #define IRQ_BOARD_END (IRQ_BOARD_START + 64) | ||
228 | 226 | ||
229 | #define NR_IRQS (IRQ_BOARD_END) | 227 | #define NR_IRQS (IRQ_BOARD_START) |
230 | 228 | ||
231 | #endif /* __ASM_MACH_IRQS_H */ | 229 | #endif /* __ASM_MACH_IRQS_H */ |
diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h index ded43c455ec3..4621067c7720 100644 --- a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h +++ b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h | |||
@@ -289,4 +289,11 @@ | |||
289 | #define GPIO86_PWM1_OUT MFP_CFG(GPIO86, AF2) | 289 | #define GPIO86_PWM1_OUT MFP_CFG(GPIO86, AF2) |
290 | #define GPIO86_PWM2_OUT MFP_CFG(GPIO86, AF3) | 290 | #define GPIO86_PWM2_OUT MFP_CFG(GPIO86, AF3) |
291 | 291 | ||
292 | /* Keypad */ | ||
293 | #define GPIO109_KP_MKIN1 MFP_CFG(GPIO109, AF7) | ||
294 | #define GPIO110_KP_MKIN0 MFP_CFG(GPIO110, AF7) | ||
295 | #define GPIO111_KP_MKOUT7 MFP_CFG(GPIO111, AF7) | ||
296 | #define GPIO112_KP_MKOUT6 MFP_CFG(GPIO112, AF7) | ||
297 | #define GPIO121_KP_MKIN4 MFP_CFG(GPIO121, AF7) | ||
298 | |||
292 | #endif /* __ASM_MACH_MFP_PXA168_H */ | 299 | #endif /* __ASM_MACH_MFP_PXA168_H */ |
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h index 27e1bc758623..1801e4206232 100644 --- a/arch/arm/mach-mmp/include/mach/pxa168.h +++ b/arch/arm/mach-mmp/include/mach/pxa168.h | |||
@@ -5,11 +5,15 @@ struct sys_timer; | |||
5 | 5 | ||
6 | extern struct sys_timer pxa168_timer; | 6 | extern struct sys_timer pxa168_timer; |
7 | extern void __init pxa168_init_irq(void); | 7 | extern void __init pxa168_init_irq(void); |
8 | extern void pxa168_clear_keypad_wakeup(void); | ||
8 | 9 | ||
9 | #include <linux/i2c.h> | 10 | #include <linux/i2c.h> |
10 | #include <mach/devices.h> | 11 | #include <mach/devices.h> |
11 | #include <plat/i2c.h> | 12 | #include <plat/i2c.h> |
12 | #include <plat/pxa3xx_nand.h> | 13 | #include <plat/pxa3xx_nand.h> |
14 | #include <video/pxa168fb.h> | ||
15 | #include <plat/pxa27x_keypad.h> | ||
16 | #include <mach/cputype.h> | ||
13 | 17 | ||
14 | extern struct pxa_device_desc pxa168_device_uart1; | 18 | extern struct pxa_device_desc pxa168_device_uart1; |
15 | extern struct pxa_device_desc pxa168_device_uart2; | 19 | extern struct pxa_device_desc pxa168_device_uart2; |
@@ -25,6 +29,8 @@ extern struct pxa_device_desc pxa168_device_ssp3; | |||
25 | extern struct pxa_device_desc pxa168_device_ssp4; | 29 | extern struct pxa_device_desc pxa168_device_ssp4; |
26 | extern struct pxa_device_desc pxa168_device_ssp5; | 30 | extern struct pxa_device_desc pxa168_device_ssp5; |
27 | extern struct pxa_device_desc pxa168_device_nand; | 31 | extern struct pxa_device_desc pxa168_device_nand; |
32 | extern struct pxa_device_desc pxa168_device_fb; | ||
33 | extern struct pxa_device_desc pxa168_device_keypad; | ||
28 | 34 | ||
29 | static inline int pxa168_add_uart(int id) | 35 | static inline int pxa168_add_uart(int id) |
30 | { | 36 | { |
@@ -97,4 +103,18 @@ static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info) | |||
97 | { | 103 | { |
98 | return pxa_register_device(&pxa168_device_nand, info, sizeof(*info)); | 104 | return pxa_register_device(&pxa168_device_nand, info, sizeof(*info)); |
99 | } | 105 | } |
106 | |||
107 | static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi) | ||
108 | { | ||
109 | return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi)); | ||
110 | } | ||
111 | |||
112 | static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data) | ||
113 | { | ||
114 | if (cpu_is_pxa168()) | ||
115 | data->clear_wakeup_event = pxa168_clear_keypad_wakeup; | ||
116 | |||
117 | return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data)); | ||
118 | } | ||
119 | |||
100 | #endif /* __ASM_MACH_PXA168_H */ | 120 | #endif /* __ASM_MACH_PXA168_H */ |
diff --git a/arch/arm/mach-mmp/include/mach/regs-apmu.h b/arch/arm/mach-mmp/include/mach/regs-apmu.h index 919030514120..ac4702357a6e 100644 --- a/arch/arm/mach-mmp/include/mach/regs-apmu.h +++ b/arch/arm/mach-mmp/include/mach/regs-apmu.h | |||
@@ -33,4 +33,16 @@ | |||
33 | #define APMU_FNRST_DIS (1 << 1) | 33 | #define APMU_FNRST_DIS (1 << 1) |
34 | #define APMU_AXIRST_DIS (1 << 0) | 34 | #define APMU_AXIRST_DIS (1 << 0) |
35 | 35 | ||
36 | /* Wake Clear Register */ | ||
37 | #define APMU_WAKE_CLR APMU_REG(0x07c) | ||
38 | |||
39 | #define APMU_PXA168_KP_WAKE_CLR (1 << 7) | ||
40 | #define APMU_PXA168_CFI_WAKE_CLR (1 << 6) | ||
41 | #define APMU_PXA168_XD_WAKE_CLR (1 << 5) | ||
42 | #define APMU_PXA168_MSP_WAKE_CLR (1 << 4) | ||
43 | #define APMU_PXA168_SD4_WAKE_CLR (1 << 3) | ||
44 | #define APMU_PXA168_SD3_WAKE_CLR (1 << 2) | ||
45 | #define APMU_PXA168_SD2_WAKE_CLR (1 << 1) | ||
46 | #define APMU_PXA168_SD1_WAKE_CLR (1 << 0) | ||
47 | |||
36 | #endif /* __ASM_MACH_REGS_APMU_H */ | 48 | #endif /* __ASM_MACH_REGS_APMU_H */ |
diff --git a/arch/arm/mach-mmp/include/mach/system.h b/arch/arm/mach-mmp/include/mach/system.h index 4f5b0e0ce6cf..1a8a25edb1b4 100644 --- a/arch/arm/mach-mmp/include/mach/system.h +++ b/arch/arm/mach-mmp/include/mach/system.h | |||
@@ -9,6 +9,8 @@ | |||
9 | #ifndef __ASM_MACH_SYSTEM_H | 9 | #ifndef __ASM_MACH_SYSTEM_H |
10 | #define __ASM_MACH_SYSTEM_H | 10 | #define __ASM_MACH_SYSTEM_H |
11 | 11 | ||
12 | #include <mach/cputype.h> | ||
13 | |||
12 | static inline void arch_idle(void) | 14 | static inline void arch_idle(void) |
13 | { | 15 | { |
14 | cpu_do_idle(); | 16 | cpu_do_idle(); |
@@ -16,6 +18,9 @@ static inline void arch_idle(void) | |||
16 | 18 | ||
17 | static inline void arch_reset(char mode, const char *cmd) | 19 | static inline void arch_reset(char mode, const char *cmd) |
18 | { | 20 | { |
19 | cpu_reset(0); | 21 | if (cpu_is_pxa168()) |
22 | cpu_reset(0xffff0000); | ||
23 | else | ||
24 | cpu_reset(0); | ||
20 | } | 25 | } |
21 | #endif /* __ASM_MACH_SYSTEM_H */ | 26 | #endif /* __ASM_MACH_SYSTEM_H */ |
diff --git a/arch/arm/mach-mmp/include/mach/teton_bga.h b/arch/arm/mach-mmp/include/mach/teton_bga.h new file mode 100644 index 000000000000..61a539b2cc98 --- /dev/null +++ b/arch/arm/mach-mmp/include/mach/teton_bga.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-mmp/include/mach/teton_bga.h | ||
3 | * | ||
4 | * Support for the Marvell PXA168 Teton BGA Development Platform. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * publishhed by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef __ASM_MACH_TETON_BGA_H | ||
11 | #define __ASM_MACH_TETON_BGA_H | ||
12 | |||
13 | /* GPIOs */ | ||
14 | #define MMC_PWENA_GPIO 27 | ||
15 | #define USBHPENB_GPIO 55 | ||
16 | #define RTC_INT_GPIO 78 | ||
17 | #define LCD_VBLK_EN_GPIO 79 | ||
18 | #define LCD_DVDD_EN_GPIO 80 | ||
19 | #define RST_WIFI_GPIO 81 | ||
20 | #define CF_PWEN_GPIO 82 | ||
21 | #define USB_OC_GPIO 83 | ||
22 | #define PWM_GPIO 84 | ||
23 | #define USBHPENA_GPIO 85 | ||
24 | #define TS_INT_GPIO 86 | ||
25 | #define CIR_GPIO 108 | ||
26 | |||
27 | #endif /* __ASM_MACH_TETON_BGA_H */ | ||
diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c index 80c3e7ab1e17..940ee03e3682 100644 --- a/arch/arm/mach-mmp/jasper.c +++ b/arch/arm/mach-mmp/jasper.c | |||
@@ -18,16 +18,18 @@ | |||
18 | #include <linux/regulator/machine.h> | 18 | #include <linux/regulator/machine.h> |
19 | #include <linux/regulator/max8649.h> | 19 | #include <linux/regulator/max8649.h> |
20 | #include <linux/mfd/max8925.h> | 20 | #include <linux/mfd/max8925.h> |
21 | #include <linux/interrupt.h> | ||
21 | 22 | ||
22 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
23 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
24 | #include <mach/addr-map.h> | 25 | #include <mach/addr-map.h> |
25 | #include <mach/mfp-mmp2.h> | 26 | #include <mach/mfp-mmp2.h> |
26 | #include <mach/mmp2.h> | 27 | #include <mach/mmp2.h> |
27 | #include <mach/irqs.h> | ||
28 | 28 | ||
29 | #include "common.h" | 29 | #include "common.h" |
30 | 30 | ||
31 | #define JASPER_NR_IRQS (IRQ_BOARD_START + 48) | ||
32 | |||
31 | static unsigned long jasper_pin_config[] __initdata = { | 33 | static unsigned long jasper_pin_config[] __initdata = { |
32 | /* UART1 */ | 34 | /* UART1 */ |
33 | GPIO29_UART1_RXD, | 35 | GPIO29_UART1_RXD, |
@@ -137,6 +139,7 @@ MACHINE_START(MARVELL_JASPER, "Jasper Development Platform") | |||
137 | .phys_io = APB_PHYS_BASE, | 139 | .phys_io = APB_PHYS_BASE, |
138 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, | 140 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, |
139 | .map_io = mmp_map_io, | 141 | .map_io = mmp_map_io, |
142 | .nr_irqs = JASPER_NR_IRQS, | ||
140 | .init_irq = mmp2_init_irq, | 143 | .init_irq = mmp2_init_irq, |
141 | .timer = &mmp2_timer, | 144 | .timer = &mmp2_timer, |
142 | .init_machine = jasper_init, | 145 | .init_machine = jasper_init, |
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index 652ae660634c..72b4e7631583 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c | |||
@@ -77,8 +77,10 @@ static APBC_CLK(ssp2, PXA168_SSP2, 4, 0); | |||
77 | static APBC_CLK(ssp3, PXA168_SSP3, 4, 0); | 77 | static APBC_CLK(ssp3, PXA168_SSP3, 4, 0); |
78 | static APBC_CLK(ssp4, PXA168_SSP4, 4, 0); | 78 | static APBC_CLK(ssp4, PXA168_SSP4, 4, 0); |
79 | static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); | 79 | static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); |
80 | static APBC_CLK(keypad, PXA168_KPC, 0, 32000); | ||
80 | 81 | ||
81 | static APMU_CLK(nand, NAND, 0x01db, 208000000); | 82 | static APMU_CLK(nand, NAND, 0x01db, 208000000); |
83 | static APMU_CLK(lcd, LCD, 0x7f, 312000000); | ||
82 | 84 | ||
83 | /* device and clock bindings */ | 85 | /* device and clock bindings */ |
84 | static struct clk_lookup pxa168_clkregs[] = { | 86 | static struct clk_lookup pxa168_clkregs[] = { |
@@ -96,6 +98,8 @@ static struct clk_lookup pxa168_clkregs[] = { | |||
96 | INIT_CLKREG(&clk_ssp4, "pxa168-ssp.3", NULL), | 98 | INIT_CLKREG(&clk_ssp4, "pxa168-ssp.3", NULL), |
97 | INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL), | 99 | INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL), |
98 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 100 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
101 | INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), | ||
102 | INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), | ||
99 | }; | 103 | }; |
100 | 104 | ||
101 | static int __init pxa168_init(void) | 105 | static int __init pxa168_init(void) |
@@ -132,6 +136,16 @@ struct sys_timer pxa168_timer = { | |||
132 | .init = pxa168_timer_init, | 136 | .init = pxa168_timer_init, |
133 | }; | 137 | }; |
134 | 138 | ||
139 | void pxa168_clear_keypad_wakeup(void) | ||
140 | { | ||
141 | uint32_t val; | ||
142 | uint32_t mask = APMU_PXA168_KP_WAKE_CLR; | ||
143 | |||
144 | /* wake event clear is needed in order to clear keypad interrupt */ | ||
145 | val = __raw_readl(APMU_WAKE_CLR); | ||
146 | __raw_writel(val | mask, APMU_WAKE_CLR); | ||
147 | } | ||
148 | |||
135 | /* on-chip devices */ | 149 | /* on-chip devices */ |
136 | PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22); | 150 | PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22); |
137 | PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24); | 151 | PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24); |
@@ -147,3 +161,5 @@ PXA168_DEVICE(ssp2, "pxa168-ssp", 1, SSP2, 0xd401c000, 0x40, 54, 55); | |||
147 | PXA168_DEVICE(ssp3, "pxa168-ssp", 2, SSP3, 0xd401f000, 0x40, 56, 57); | 161 | PXA168_DEVICE(ssp3, "pxa168-ssp", 2, SSP3, 0xd401f000, 0x40, 56, 57); |
148 | PXA168_DEVICE(ssp4, "pxa168-ssp", 3, SSP4, 0xd4020000, 0x40, 58, 59); | 162 | PXA168_DEVICE(ssp4, "pxa168-ssp", 3, SSP4, 0xd4020000, 0x40, 58, 59); |
149 | PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61); | 163 | PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61); |
164 | PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8); | ||
165 | PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c); | ||
diff --git a/arch/arm/mach-mmp/teton_bga.c b/arch/arm/mach-mmp/teton_bga.c new file mode 100644 index 000000000000..a4a375c58e0c --- /dev/null +++ b/arch/arm/mach-mmp/teton_bga.c | |||
@@ -0,0 +1,91 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-mmp/teton_bga.c | ||
3 | * | ||
4 | * Support for the Marvell PXA168 Teton BGA Development Platform. | ||
5 | * | ||
6 | * Author: Mark F. Brown <mark.brown314@gmail.com> | ||
7 | * | ||
8 | * This code is based on aspenite.c | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * publishhed by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include <linux/init.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/gpio.h> | ||
19 | #include <linux/input.h> | ||
20 | #include <plat/pxa27x_keypad.h> | ||
21 | #include <linux/i2c.h> | ||
22 | |||
23 | #include <asm/mach-types.h> | ||
24 | #include <asm/mach/arch.h> | ||
25 | #include <mach/addr-map.h> | ||
26 | #include <mach/mfp-pxa168.h> | ||
27 | #include <mach/pxa168.h> | ||
28 | #include <mach/teton_bga.h> | ||
29 | |||
30 | #include "common.h" | ||
31 | |||
32 | static unsigned long teton_bga_pin_config[] __initdata = { | ||
33 | /* UART1 */ | ||
34 | GPIO107_UART1_TXD, | ||
35 | GPIO108_UART1_RXD, | ||
36 | |||
37 | /* Keypad */ | ||
38 | GPIO109_KP_MKIN1, | ||
39 | GPIO110_KP_MKIN0, | ||
40 | GPIO111_KP_MKOUT7, | ||
41 | GPIO112_KP_MKOUT6, | ||
42 | |||
43 | /* I2C Bus */ | ||
44 | GPIO105_CI2C_SDA, | ||
45 | GPIO106_CI2C_SCL, | ||
46 | |||
47 | /* RTC */ | ||
48 | GPIO78_GPIO, | ||
49 | }; | ||
50 | |||
51 | static unsigned int teton_bga_matrix_key_map[] = { | ||
52 | KEY(0, 6, KEY_ESC), | ||
53 | KEY(0, 7, KEY_ENTER), | ||
54 | KEY(1, 6, KEY_LEFT), | ||
55 | KEY(1, 7, KEY_RIGHT), | ||
56 | }; | ||
57 | |||
58 | static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = { | ||
59 | .matrix_key_rows = 2, | ||
60 | .matrix_key_cols = 8, | ||
61 | .matrix_key_map = teton_bga_matrix_key_map, | ||
62 | .matrix_key_map_size = ARRAY_SIZE(teton_bga_matrix_key_map), | ||
63 | .debounce_interval = 30, | ||
64 | }; | ||
65 | |||
66 | static struct i2c_board_info teton_bga_i2c_info[] __initdata = { | ||
67 | { | ||
68 | I2C_BOARD_INFO("ds1337", 0x68), | ||
69 | .irq = gpio_to_irq(RTC_INT_GPIO) | ||
70 | }, | ||
71 | }; | ||
72 | |||
73 | static void __init teton_bga_init(void) | ||
74 | { | ||
75 | mfp_config(ARRAY_AND_SIZE(teton_bga_pin_config)); | ||
76 | |||
77 | /* on-chip devices */ | ||
78 | pxa168_add_uart(1); | ||
79 | pxa168_add_keypad(&teton_bga_keypad_info); | ||
80 | pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info)); | ||
81 | } | ||
82 | |||
83 | MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform") | ||
84 | .phys_io = APB_PHYS_BASE, | ||
85 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, | ||
86 | .map_io = mmp_map_io, | ||
87 | .nr_irqs = IRQ_BOARD_START, | ||
88 | .init_irq = pxa168_init_irq, | ||
89 | .timer = &pxa168_timer, | ||
90 | .init_machine = teton_bga_init, | ||
91 | MACHINE_END | ||
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c index ee65e05f0cf1..54571139dc4b 100644 --- a/arch/arm/mach-mmp/ttc_dkb.c +++ b/arch/arm/mach-mmp/ttc_dkb.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/mtd/mtd.h> | 14 | #include <linux/mtd/mtd.h> |
15 | #include <linux/mtd/partitions.h> | 15 | #include <linux/mtd/partitions.h> |
16 | #include <linux/mtd/onenand.h> | 16 | #include <linux/mtd/onenand.h> |
17 | #include <linux/interrupt.h> | ||
17 | 18 | ||
18 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
19 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
@@ -24,6 +25,8 @@ | |||
24 | 25 | ||
25 | #include "common.h" | 26 | #include "common.h" |
26 | 27 | ||
28 | #define TTCDKB_NR_IRQS (IRQ_BOARD_START + 24) | ||
29 | |||
27 | static unsigned long ttc_dkb_pin_config[] __initdata = { | 30 | static unsigned long ttc_dkb_pin_config[] __initdata = { |
28 | /* UART2 */ | 31 | /* UART2 */ |
29 | GPIO47_UART2_RXD, | 32 | GPIO47_UART2_RXD, |
@@ -125,6 +128,7 @@ MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform") | |||
125 | .phys_io = APB_PHYS_BASE, | 128 | .phys_io = APB_PHYS_BASE, |
126 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, | 129 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, |
127 | .map_io = mmp_map_io, | 130 | .map_io = mmp_map_io, |
131 | .nr_irqs = TTCDKB_NR_IRQS, | ||
128 | .init_irq = pxa910_init_irq, | 132 | .init_irq = pxa910_init_irq, |
129 | .timer = &pxa910_timer, | 133 | .timer = &pxa910_timer, |
130 | .init_machine = ttc_dkb_init, | 134 | .init_machine = ttc_dkb_init, |
diff --git a/arch/arm/mach-msm/include/mach/vmalloc.h b/arch/arm/mach-msm/include/mach/vmalloc.h index 05f81fd8623c..31a32ad062dc 100644 --- a/arch/arm/mach-msm/include/mach/vmalloc.h +++ b/arch/arm/mach-msm/include/mach/vmalloc.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #ifndef __ASM_ARCH_MSM_VMALLOC_H | 16 | #ifndef __ASM_ARCH_MSM_VMALLOC_H |
17 | #define __ASM_ARCH_MSM_VMALLOC_H | 17 | #define __ASM_ARCH_MSM_VMALLOC_H |
18 | 18 | ||
19 | #define VMALLOC_END (PAGE_OFFSET + 0x10000000) | 19 | #define VMALLOC_END 0xd0000000 |
20 | 20 | ||
21 | #endif | 21 | #endif |
22 | 22 | ||
diff --git a/arch/arm/mach-mx25/Kconfig b/arch/arm/mach-mx25/Kconfig index c71a7bc19284..aa57e35ce3cd 100644 --- a/arch/arm/mach-mx25/Kconfig +++ b/arch/arm/mach-mx25/Kconfig | |||
@@ -12,6 +12,8 @@ config MACH_EUKREA_CPUIMX25 | |||
12 | select IMX_HAVE_PLATFORM_IMX_I2C | 12 | select IMX_HAVE_PLATFORM_IMX_I2C |
13 | select IMX_HAVE_PLATFORM_IMX_UART | 13 | select IMX_HAVE_PLATFORM_IMX_UART |
14 | select IMX_HAVE_PLATFORM_MXC_NAND | 14 | select IMX_HAVE_PLATFORM_MXC_NAND |
15 | select IMX_HAVE_PLATFORM_FLEXCAN | ||
16 | select IMX_HAVE_PLATFORM_ESDHC | ||
15 | select MXC_ULPI if USB_ULPI | 17 | select MXC_ULPI if USB_ULPI |
16 | 18 | ||
17 | choice | 19 | choice |
@@ -20,8 +22,8 @@ choice | |||
20 | default MACH_EUKREA_MBIMXSD25_BASEBOARD | 22 | default MACH_EUKREA_MBIMXSD25_BASEBOARD |
21 | 23 | ||
22 | config MACH_EUKREA_MBIMXSD25_BASEBOARD | 24 | config MACH_EUKREA_MBIMXSD25_BASEBOARD |
23 | prompt "Eukrea MBIMXSD development board" | 25 | bool "Eukrea MBIMXSD development board" |
24 | bool | 26 | select IMX_HAVE_PLATFORM_IMX_SSI |
25 | help | 27 | help |
26 | This adds board specific devices that can be found on Eukrea's | 28 | This adds board specific devices that can be found on Eukrea's |
27 | MBIMXSD evaluation board. | 29 | MBIMXSD evaluation board. |
diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-mx25/clock.c index 40c7cc41cee3..2179713873c2 100644 --- a/arch/arm/mach-mx25/clock.c +++ b/arch/arm/mach-mx25/clock.c | |||
@@ -139,6 +139,16 @@ static unsigned long get_rate_lcdc(struct clk *clk) | |||
139 | return get_rate_per(7); | 139 | return get_rate_per(7); |
140 | } | 140 | } |
141 | 141 | ||
142 | static unsigned long get_rate_esdhc1(struct clk *clk) | ||
143 | { | ||
144 | return get_rate_per(3); | ||
145 | } | ||
146 | |||
147 | static unsigned long get_rate_esdhc2(struct clk *clk) | ||
148 | { | ||
149 | return get_rate_per(4); | ||
150 | } | ||
151 | |||
142 | static unsigned long get_rate_csi(struct clk *clk) | 152 | static unsigned long get_rate_csi(struct clk *clk) |
143 | { | 153 | { |
144 | return get_rate_per(0); | 154 | return get_rate_per(0); |
@@ -213,6 +223,12 @@ DEFINE_CLOCK(ssi2_per_clk, 0, CCM_CGCR0, 14, get_rate_ipg, NULL, NULL); | |||
213 | DEFINE_CLOCK(cspi1_clk, 0, CCM_CGCR1, 5, get_rate_ipg, NULL, NULL); | 223 | DEFINE_CLOCK(cspi1_clk, 0, CCM_CGCR1, 5, get_rate_ipg, NULL, NULL); |
214 | DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL, NULL); | 224 | DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL, NULL); |
215 | DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL); | 225 | DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL); |
226 | DEFINE_CLOCK(esdhc1_ahb_clk, 0, CCM_CGCR0, 21, get_rate_esdhc1, NULL, NULL); | ||
227 | DEFINE_CLOCK(esdhc1_per_clk, 0, CCM_CGCR0, 3, get_rate_esdhc1, NULL, | ||
228 | &esdhc1_ahb_clk); | ||
229 | DEFINE_CLOCK(esdhc2_ahb_clk, 0, CCM_CGCR0, 22, get_rate_esdhc2, NULL, NULL); | ||
230 | DEFINE_CLOCK(esdhc2_per_clk, 0, CCM_CGCR0, 4, get_rate_esdhc2, NULL, | ||
231 | &esdhc2_ahb_clk); | ||
216 | DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL); | 232 | DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL); |
217 | DEFINE_CLOCK(lcdc_ahb_clk, 0, CCM_CGCR0, 24, NULL, NULL, NULL); | 233 | DEFINE_CLOCK(lcdc_ahb_clk, 0, CCM_CGCR0, 24, NULL, NULL, NULL); |
218 | DEFINE_CLOCK(lcdc_per_clk, 0, CCM_CGCR0, 7, NULL, NULL, &lcdc_ahb_clk); | 234 | DEFINE_CLOCK(lcdc_per_clk, 0, CCM_CGCR0, 7, NULL, NULL, &lcdc_ahb_clk); |
@@ -238,6 +254,10 @@ DEFINE_CLOCK(lcdc_clk, 0, CCM_CGCR1, 29, get_rate_lcdc, NULL, &lcdc_per_clk); | |||
238 | DEFINE_CLOCK(wdt_clk, 0, CCM_CGCR2, 19, get_rate_ipg, NULL, NULL); | 254 | DEFINE_CLOCK(wdt_clk, 0, CCM_CGCR2, 19, get_rate_ipg, NULL, NULL); |
239 | DEFINE_CLOCK(ssi1_clk, 0, CCM_CGCR2, 11, get_rate_ssi1, NULL, &ssi1_per_clk); | 255 | DEFINE_CLOCK(ssi1_clk, 0, CCM_CGCR2, 11, get_rate_ssi1, NULL, &ssi1_per_clk); |
240 | DEFINE_CLOCK(ssi2_clk, 1, CCM_CGCR2, 12, get_rate_ssi2, NULL, &ssi2_per_clk); | 256 | DEFINE_CLOCK(ssi2_clk, 1, CCM_CGCR2, 12, get_rate_ssi2, NULL, &ssi2_per_clk); |
257 | DEFINE_CLOCK(esdhc1_clk, 0, CCM_CGCR1, 13, get_rate_esdhc1, NULL, | ||
258 | &esdhc1_per_clk); | ||
259 | DEFINE_CLOCK(esdhc2_clk, 1, CCM_CGCR1, 14, get_rate_esdhc2, NULL, | ||
260 | &esdhc2_per_clk); | ||
241 | DEFINE_CLOCK(audmux_clk, 0, CCM_CGCR1, 0, NULL, NULL, NULL); | 261 | DEFINE_CLOCK(audmux_clk, 0, CCM_CGCR1, 0, NULL, NULL, NULL); |
242 | DEFINE_CLOCK(csi_clk, 0, CCM_CGCR1, 4, get_rate_csi, NULL, &csi_per_clk); | 262 | DEFINE_CLOCK(csi_clk, 0, CCM_CGCR1, 4, get_rate_csi, NULL, &csi_per_clk); |
243 | DEFINE_CLOCK(can1_clk, 0, CCM_CGCR1, 2, get_rate_ipg, NULL, NULL); | 263 | DEFINE_CLOCK(can1_clk, 0, CCM_CGCR1, 2, get_rate_ipg, NULL, NULL); |
@@ -261,9 +281,9 @@ static struct clk_lookup lookups[] = { | |||
261 | _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk) | 281 | _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk) |
262 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk) | 282 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk) |
263 | _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) | 283 | _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) |
264 | _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk) | 284 | _REGISTER_CLOCK("imx25-cspi.0", NULL, cspi1_clk) |
265 | _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk) | 285 | _REGISTER_CLOCK("imx25-cspi.1", NULL, cspi2_clk) |
266 | _REGISTER_CLOCK("spi_imx.2", NULL, cspi3_clk) | 286 | _REGISTER_CLOCK("imx25-cspi.2", NULL, cspi3_clk) |
267 | _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk) | 287 | _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk) |
268 | _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk) | 288 | _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk) |
269 | _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk) | 289 | _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk) |
@@ -279,6 +299,8 @@ static struct clk_lookup lookups[] = { | |||
279 | _REGISTER_CLOCK("imx-wdt.0", NULL, wdt_clk) | 299 | _REGISTER_CLOCK("imx-wdt.0", NULL, wdt_clk) |
280 | _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) | 300 | _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) |
281 | _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) | 301 | _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) |
302 | _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) | ||
303 | _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) | ||
282 | _REGISTER_CLOCK("mx2-camera.0", NULL, csi_clk) | 304 | _REGISTER_CLOCK("mx2-camera.0", NULL, csi_clk) |
283 | _REGISTER_CLOCK(NULL, "audmux", audmux_clk) | 305 | _REGISTER_CLOCK(NULL, "audmux", audmux_clk) |
284 | _REGISTER_CLOCK("flexcan.0", NULL, can1_clk) | 306 | _REGISTER_CLOCK("flexcan.0", NULL, can1_clk) |
diff --git a/arch/arm/mach-mx25/devices-imx25.h b/arch/arm/mach-mx25/devices-imx25.h index d86a7c3ca8b0..733aaee5bae8 100644 --- a/arch/arm/mach-mx25/devices-imx25.h +++ b/arch/arm/mach-mx25/devices-imx25.h | |||
@@ -9,35 +9,47 @@ | |||
9 | #include <mach/mx25.h> | 9 | #include <mach/mx25.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | extern const struct imx_fec_data imx25_fec_data __initconst; | ||
13 | #define imx25_add_fec(pdata) \ | ||
14 | imx_add_fec(&imx25_fec_data, pdata) | ||
15 | |||
12 | #define imx25_add_flexcan0(pdata) \ | 16 | #define imx25_add_flexcan0(pdata) \ |
13 | imx_add_flexcan(0, MX25_CAN1_BASE_ADDR, SZ_16K, MX25_INT_CAN1, pdata) | 17 | imx_add_flexcan(0, MX25_CAN1_BASE_ADDR, SZ_16K, MX25_INT_CAN1, pdata) |
14 | #define imx25_add_flexcan1(pdata) \ | 18 | #define imx25_add_flexcan1(pdata) \ |
15 | imx_add_flexcan(1, MX25_CAN2_BASE_ADDR, SZ_16K, MX25_INT_CAN2, pdata) | 19 | imx_add_flexcan(1, MX25_CAN2_BASE_ADDR, SZ_16K, MX25_INT_CAN2, pdata) |
16 | 20 | ||
17 | #define imx25_add_imx_i2c0(pdata) \ | 21 | extern const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst; |
18 | imx_add_imx_i2c(0, MX25_I2C1_BASE_ADDR, SZ_16K, MX25_INT_I2C1, pdata) | 22 | #define imx25_add_imx_i2c(id, pdata) \ |
19 | #define imx25_add_imx_i2c1(pdata) \ | 23 | imx_add_imx_i2c(&imx25_imx_i2c_data[id], pdata) |
20 | imx_add_imx_i2c(1, MX25_I2C2_BASE_ADDR, SZ_16K, MX25_INT_I2C2, pdata) | 24 | #define imx25_add_imx_i2c0(pdata) imx25_add_imx_i2c(0, pdata) |
21 | #define imx25_add_imx_i2c2(pdata) \ | 25 | #define imx25_add_imx_i2c1(pdata) imx25_add_imx_i2c(1, pdata) |
22 | imx_add_imx_i2c(2, MX25_I2C3_BASE_ADDR, SZ_16K, MX25_INT_I2C3, pdata) | 26 | #define imx25_add_imx_i2c2(pdata) imx25_add_imx_i2c(2, pdata) |
23 | 27 | ||
24 | #define imx25_add_imx_uart0(pdata) \ | 28 | extern const struct imx_imx_ssi_data imx25_imx_ssi_data[] __initconst; |
25 | imx_add_imx_uart_1irq(0, MX25_UART1_BASE_ADDR, SZ_16K, MX25_INT_UART1, pdata) | 29 | #define imx25_add_imx_ssi(id, pdata) \ |
26 | #define imx25_add_imx_uart1(pdata) \ | 30 | imx_add_imx_ssi(&imx25_imx_ssi_data[id], pdata) |
27 | imx_add_imx_uart_1irq(1, MX25_UART2_BASE_ADDR, SZ_16K, MX25_INT_UART2, pdata) | 31 | |
28 | #define imx25_add_imx_uart2(pdata) \ | 32 | extern const struct imx_imx_uart_1irq_data imx25_imx_uart_data[] __initconst; |
29 | imx_add_imx_uart_1irq(2, MX25_UART3_BASE_ADDR, SZ_16K, MX25_INT_UART3, pdata) | 33 | #define imx25_add_imx_uart(id, pdata) \ |
30 | #define imx25_add_imx_uart3(pdata) \ | 34 | imx_add_imx_uart_1irq(&imx25_imx_uart_data[id], pdata) |
31 | imx_add_imx_uart_1irq(3, MX25_UART4_BASE_ADDR, SZ_16K, MX25_INT_UART4, pdata) | 35 | #define imx25_add_imx_uart0(pdata) imx25_add_imx_uart(0, pdata) |
32 | #define imx25_add_imx_uart4(pdata) \ | 36 | #define imx25_add_imx_uart1(pdata) imx25_add_imx_uart(1, pdata) |
33 | imx_add_imx_uart_1irq(4, MX25_UART5_BASE_ADDR, SZ_16K, MX25_INT_UART5, pdata) | 37 | #define imx25_add_imx_uart2(pdata) imx25_add_imx_uart(2, pdata) |
38 | #define imx25_add_imx_uart3(pdata) imx25_add_imx_uart(3, pdata) | ||
39 | #define imx25_add_imx_uart4(pdata) imx25_add_imx_uart(4, pdata) | ||
34 | 40 | ||
41 | extern const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst; | ||
35 | #define imx25_add_mxc_nand(pdata) \ | 42 | #define imx25_add_mxc_nand(pdata) \ |
36 | imx_add_mxc_nand_v21(MX25_NFC_BASE_ADDR, MX25_INT_NANDFC, pdata) | 43 | imx_add_mxc_nand(&imx25_mxc_nand_data, pdata) |
37 | 44 | ||
38 | #define imx25_add_spi_imx0(pdata) \ | 45 | extern const struct imx_spi_imx_data imx25_spi_imx_data[] __initconst; |
39 | imx_add_spi_imx(0, MX25_CSPI1_BASE_ADDR, SZ_16K, MX25_INT_CSPI1, pdata) | 46 | #define imx25_add_spi_imx(id, pdata) \ |
40 | #define imx25_add_spi_imx1(pdata) \ | 47 | imx_add_spi_imx(&imx25_spi_imx_data[id], pdata) |
41 | imx_add_spi_imx(1, MX25_CSPI2_BASE_ADDR, SZ_16K, MX25_INT_CSPI2, pdata) | 48 | #define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata) |
42 | #define imx25_add_spi_imx2(pdata) \ | 49 | #define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) |
43 | imx_add_spi_imx(2, MX25_CSPI3_BASE_ADDR, SZ_16K, MX25_INT_CSPI3, pdata) | 50 | #define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) |
51 | |||
52 | #define imx25_add_esdhc0(pdata) \ | ||
53 | imx_add_esdhc(0, MX25_ESDHC1_BASE_ADDR, SZ_16K, MX25_INT_MMC_SDHC1, pdata) | ||
54 | #define imx25_add_esdhc1(pdata) \ | ||
55 | imx_add_esdhc(1, MX25_ESDHC2_BASE_ADDR, SZ_16K, MX25_INT_MMC_SDHC2, pdata) | ||
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c index 3468eb15b236..1d0eb3e85941 100644 --- a/arch/arm/mach-mx25/devices.c +++ b/arch/arm/mach-mx25/devices.c | |||
@@ -208,26 +208,6 @@ int __init imx25_register_gpios(void) | |||
208 | return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); | 208 | return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); |
209 | } | 209 | } |
210 | 210 | ||
211 | static struct resource mx25_fec_resources[] = { | ||
212 | { | ||
213 | .start = MX25_FEC_BASE_ADDR, | ||
214 | .end = MX25_FEC_BASE_ADDR + 0xfff, | ||
215 | .flags = IORESOURCE_MEM, | ||
216 | }, | ||
217 | { | ||
218 | .start = MX25_INT_FEC, | ||
219 | .end = MX25_INT_FEC, | ||
220 | .flags = IORESOURCE_IRQ, | ||
221 | }, | ||
222 | }; | ||
223 | |||
224 | struct platform_device mx25_fec_device = { | ||
225 | .name = "fec", | ||
226 | .id = 0, | ||
227 | .num_resources = ARRAY_SIZE(mx25_fec_resources), | ||
228 | .resource = mx25_fec_resources, | ||
229 | }; | ||
230 | |||
231 | static struct resource mx25_rtc_resources[] = { | 211 | static struct resource mx25_rtc_resources[] = { |
232 | { | 212 | { |
233 | .start = MX25_DRYICE_BASE_ADDR, | 213 | .start = MX25_DRYICE_BASE_ADDR, |
@@ -305,44 +285,6 @@ struct platform_device mx25_kpp_device = { | |||
305 | .resource = mx25_kpp_resources, | 285 | .resource = mx25_kpp_resources, |
306 | }; | 286 | }; |
307 | 287 | ||
308 | static struct resource imx_ssi_resources0[] = { | ||
309 | { | ||
310 | .start = MX25_SSI1_BASE_ADDR, | ||
311 | .end = MX25_SSI1_BASE_ADDR + 0x3fff, | ||
312 | .flags = IORESOURCE_MEM, | ||
313 | }, { | ||
314 | .start = MX25_INT_SSI1, | ||
315 | .end = MX25_INT_SSI1, | ||
316 | .flags = IORESOURCE_IRQ, | ||
317 | }, | ||
318 | }; | ||
319 | |||
320 | static struct resource imx_ssi_resources1[] = { | ||
321 | { | ||
322 | .start = MX25_SSI2_BASE_ADDR, | ||
323 | .end = MX25_SSI2_BASE_ADDR + 0x3fff, | ||
324 | .flags = IORESOURCE_MEM | ||
325 | }, { | ||
326 | .start = MX25_INT_SSI2, | ||
327 | .end = MX25_INT_SSI2, | ||
328 | .flags = IORESOURCE_IRQ, | ||
329 | }, | ||
330 | }; | ||
331 | |||
332 | struct platform_device imx_ssi_device0 = { | ||
333 | .name = "imx-ssi", | ||
334 | .id = 0, | ||
335 | .num_resources = ARRAY_SIZE(imx_ssi_resources0), | ||
336 | .resource = imx_ssi_resources0, | ||
337 | }; | ||
338 | |||
339 | struct platform_device imx_ssi_device1 = { | ||
340 | .name = "imx-ssi", | ||
341 | .id = 1, | ||
342 | .num_resources = ARRAY_SIZE(imx_ssi_resources1), | ||
343 | .resource = imx_ssi_resources1, | ||
344 | }; | ||
345 | |||
346 | static struct resource mx25_csi_resources[] = { | 288 | static struct resource mx25_csi_resources[] = { |
347 | { | 289 | { |
348 | .start = MX25_CSI_BASE_ADDR, | 290 | .start = MX25_CSI_BASE_ADDR, |
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h index 4aceb68e35a7..7b70a43c3a4b 100644 --- a/arch/arm/mach-mx25/devices.h +++ b/arch/arm/mach-mx25/devices.h | |||
@@ -6,11 +6,8 @@ extern struct platform_device mxc_pwm_device1; | |||
6 | extern struct platform_device mxc_pwm_device2; | 6 | extern struct platform_device mxc_pwm_device2; |
7 | extern struct platform_device mxc_pwm_device3; | 7 | extern struct platform_device mxc_pwm_device3; |
8 | extern struct platform_device mxc_keypad_device; | 8 | extern struct platform_device mxc_keypad_device; |
9 | extern struct platform_device mx25_fec_device; | ||
10 | extern struct platform_device mx25_rtc_device; | 9 | extern struct platform_device mx25_rtc_device; |
11 | extern struct platform_device mx25_fb_device; | 10 | extern struct platform_device mx25_fb_device; |
12 | extern struct platform_device mxc_wdt; | 11 | extern struct platform_device mxc_wdt; |
13 | extern struct platform_device mx25_kpp_device; | 12 | extern struct platform_device mx25_kpp_device; |
14 | extern struct platform_device imx_ssi_device0; | ||
15 | extern struct platform_device imx_ssi_device1; | ||
16 | extern struct platform_device mx25_csi_device; | 13 | extern struct platform_device mx25_csi_device; |
diff --git a/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c index 4aaadc753d3e..c1fe048c445e 100644 --- a/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c +++ b/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <mach/mx25.h> | 34 | #include <mach/mx25.h> |
35 | #include <mach/imx-uart.h> | 35 | #include <mach/imx-uart.h> |
36 | #include <mach/imxfb.h> | 36 | #include <mach/imxfb.h> |
37 | #include <mach/ssi.h> | ||
38 | #include <mach/audmux.h> | 37 | #include <mach/audmux.h> |
39 | 38 | ||
40 | #include "devices-imx25.h" | 39 | #include "devices-imx25.h" |
@@ -90,6 +89,9 @@ static struct pad_desc eukrea_mbimxsd_pads[] = { | |||
90 | MX25_PAD_KPP_COL2__AUD5_TXC, | 89 | MX25_PAD_KPP_COL2__AUD5_TXC, |
91 | MX25_PAD_KPP_COL1__AUD5_RXD, | 90 | MX25_PAD_KPP_COL1__AUD5_RXD, |
92 | MX25_PAD_KPP_COL0__AUD5_TXD, | 91 | MX25_PAD_KPP_COL0__AUD5_TXD, |
92 | /* CAN */ | ||
93 | MX25_PAD_GPIO_D__CAN2_RX, | ||
94 | MX25_PAD_GPIO_C__CAN2_TX, | ||
93 | }; | 95 | }; |
94 | 96 | ||
95 | #define GPIO_LED1 83 | 97 | #define GPIO_LED1 83 |
@@ -205,7 +207,8 @@ static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = { | |||
205 | }, | 207 | }, |
206 | }; | 208 | }; |
207 | 209 | ||
208 | struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata = { | 210 | static const |
211 | struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata __initconst = { | ||
209 | .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE, | 212 | .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE, |
210 | }; | 213 | }; |
211 | 214 | ||
@@ -239,7 +242,10 @@ void __init eukrea_mbimxsd25_baseboard_init(void) | |||
239 | 242 | ||
240 | imx25_add_imx_uart1(&uart_pdata); | 243 | imx25_add_imx_uart1(&uart_pdata); |
241 | mxc_register_device(&mx25_fb_device, &eukrea_mximxsd_fb_pdata); | 244 | mxc_register_device(&mx25_fb_device, &eukrea_mximxsd_fb_pdata); |
242 | mxc_register_device(&imx_ssi_device0, &eukrea_mbimxsd_ssi_pdata); | 245 | imx25_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); |
246 | |||
247 | imx25_add_flexcan1(NULL); | ||
248 | imx25_add_esdhc0(NULL); | ||
243 | 249 | ||
244 | gpio_request(GPIO_LED1, "LED1"); | 250 | gpio_request(GPIO_LED1, "LED1"); |
245 | gpio_direction_output(GPIO_LED1, 1); | 251 | gpio_direction_output(GPIO_LED1, 1); |
diff --git a/arch/arm/mach-mx25/mach-cpuimx25.c b/arch/arm/mach-mx25/mach-cpuimx25.c index e064bb3d6919..21d9b9e9c92c 100644 --- a/arch/arm/mach-mx25/mach-cpuimx25.c +++ b/arch/arm/mach-mx25/mach-cpuimx25.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
24 | #include <linux/irq.h> | 24 | #include <linux/irq.h> |
25 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
26 | #include <linux/fec.h> | ||
27 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
28 | #include <linux/usb/otg.h> | 27 | #include <linux/usb/otg.h> |
29 | #include <linux/usb/ulpi.h> | 28 | #include <linux/usb/ulpi.h> |
@@ -67,7 +66,7 @@ static struct pad_desc eukrea_cpuimx25_pads[] = { | |||
67 | MX25_PAD_I2C1_DAT__I2C1_DAT, | 66 | MX25_PAD_I2C1_DAT__I2C1_DAT, |
68 | }; | 67 | }; |
69 | 68 | ||
70 | static struct fec_platform_data mx25_fec_pdata = { | 69 | static const struct fec_platform_data mx25_fec_pdata __initconst = { |
71 | .phy = PHY_INTERFACE_MODE_RMII, | 70 | .phy = PHY_INTERFACE_MODE_RMII, |
72 | }; | 71 | }; |
73 | 72 | ||
@@ -129,7 +128,7 @@ static void __init eukrea_cpuimx25_init(void) | |||
129 | imx25_add_imx_uart0(&uart_pdata); | 128 | imx25_add_imx_uart0(&uart_pdata); |
130 | imx25_add_mxc_nand(&eukrea_cpuimx25_nand_board_info); | 129 | imx25_add_mxc_nand(&eukrea_cpuimx25_nand_board_info); |
131 | mxc_register_device(&mx25_rtc_device, NULL); | 130 | mxc_register_device(&mx25_rtc_device, NULL); |
132 | mxc_register_device(&mx25_fec_device, &mx25_fec_pdata); | 131 | imx25_add_fec(&mx25_fec_pdata); |
133 | 132 | ||
134 | i2c_register_board_info(0, eukrea_cpuimx25_i2c_devices, | 133 | i2c_register_board_info(0, eukrea_cpuimx25_i2c_devices, |
135 | ARRAY_SIZE(eukrea_cpuimx25_i2c_devices)); | 134 | ARRAY_SIZE(eukrea_cpuimx25_i2c_devices)); |
diff --git a/arch/arm/mach-mx25/mach-mx25_3ds.c b/arch/arm/mach-mx25/mach-mx25_3ds.c index 62bc21f11a71..bd1805698631 100644 --- a/arch/arm/mach-mx25/mach-mx25_3ds.c +++ b/arch/arm/mach-mx25/mach-mx25_3ds.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
29 | #include <linux/irq.h> | 29 | #include <linux/irq.h> |
30 | #include <linux/gpio.h> | 30 | #include <linux/gpio.h> |
31 | #include <linux/fec.h> | ||
32 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
33 | #include <linux/input/matrix_keypad.h> | 32 | #include <linux/input/matrix_keypad.h> |
34 | 33 | ||
@@ -99,7 +98,7 @@ static struct pad_desc mx25pdk_pads[] = { | |||
99 | MX25_PAD_KPP_COL3__KPP_COL3, | 98 | MX25_PAD_KPP_COL3__KPP_COL3, |
100 | }; | 99 | }; |
101 | 100 | ||
102 | static struct fec_platform_data mx25_fec_pdata = { | 101 | static const struct fec_platform_data mx25_fec_pdata __initconst = { |
103 | .phy = PHY_INTERFACE_MODE_RMII, | 102 | .phy = PHY_INTERFACE_MODE_RMII, |
104 | }; | 103 | }; |
105 | 104 | ||
@@ -192,7 +191,7 @@ static void __init mx25pdk_init(void) | |||
192 | mxc_register_device(&mxc_wdt, NULL); | 191 | mxc_register_device(&mxc_wdt, NULL); |
193 | 192 | ||
194 | mx25pdk_fec_reset(); | 193 | mx25pdk_fec_reset(); |
195 | mxc_register_device(&mx25_fec_device, &mx25_fec_pdata); | 194 | imx25_add_fec(&mx25_fec_pdata); |
196 | mxc_register_device(&mx25_kpp_device, &mx25pdk_keymap_data); | 195 | mxc_register_device(&mx25_kpp_device, &mx25pdk_keymap_data); |
197 | } | 196 | } |
198 | 197 | ||
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig index 85beece802aa..096fd33f8ab9 100644 --- a/arch/arm/mach-mx3/Kconfig +++ b/arch/arm/mach-mx3/Kconfig | |||
@@ -9,6 +9,7 @@ config ARCH_MX35 | |||
9 | bool | 9 | bool |
10 | select ARCH_MXC_IOMUX_V3 | 10 | select ARCH_MXC_IOMUX_V3 |
11 | select ARCH_MXC_AUDMUX_V2 | 11 | select ARCH_MXC_AUDMUX_V2 |
12 | select HAVE_EPIT | ||
12 | 13 | ||
13 | comment "MX3 platforms:" | 14 | comment "MX3 platforms:" |
14 | 15 | ||
@@ -16,6 +17,7 @@ config MACH_MX31ADS | |||
16 | bool "Support MX31ADS platforms" | 17 | bool "Support MX31ADS platforms" |
17 | select ARCH_MX31 | 18 | select ARCH_MX31 |
18 | select IMX_HAVE_PLATFORM_IMX_I2C | 19 | select IMX_HAVE_PLATFORM_IMX_I2C |
20 | select IMX_HAVE_PLATFORM_IMX_SSI | ||
19 | select IMX_HAVE_PLATFORM_IMX_UART | 21 | select IMX_HAVE_PLATFORM_IMX_UART |
20 | default y | 22 | default y |
21 | help | 23 | help |
@@ -117,9 +119,11 @@ config MACH_PCM043 | |||
117 | bool "Support Phytec pcm043 (i.MX35) platforms" | 119 | bool "Support Phytec pcm043 (i.MX35) platforms" |
118 | select ARCH_MX35 | 120 | select ARCH_MX35 |
119 | select IMX_HAVE_PLATFORM_IMX_I2C | 121 | select IMX_HAVE_PLATFORM_IMX_I2C |
122 | select IMX_HAVE_PLATFORM_IMX_SSI | ||
120 | select IMX_HAVE_PLATFORM_IMX_UART | 123 | select IMX_HAVE_PLATFORM_IMX_UART |
121 | select IMX_HAVE_PLATFORM_MXC_NAND | 124 | select IMX_HAVE_PLATFORM_MXC_NAND |
122 | select IMX_HAVE_PLATFORM_FLEXCAN | 125 | select IMX_HAVE_PLATFORM_FLEXCAN |
126 | select IMX_HAVE_PLATFORM_ESDHC | ||
123 | select MXC_ULPI if USB_ULPI | 127 | select MXC_ULPI if USB_ULPI |
124 | help | 128 | help |
125 | Include support for Phytec pcm043 platform. This includes | 129 | Include support for Phytec pcm043 platform. This includes |
@@ -140,6 +144,7 @@ config MACH_MX35_3DS | |||
140 | bool "Support MX35PDK platform" | 144 | bool "Support MX35PDK platform" |
141 | select ARCH_MX35 | 145 | select ARCH_MX35 |
142 | select IMX_HAVE_PLATFORM_IMX_UART | 146 | select IMX_HAVE_PLATFORM_IMX_UART |
147 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
143 | default n | 148 | default n |
144 | help | 149 | help |
145 | Include support for MX35PDK platform. This includes specific | 150 | Include support for MX35PDK platform. This includes specific |
@@ -159,6 +164,8 @@ config MACH_EUKREA_CPUIMX35 | |||
159 | select IMX_HAVE_PLATFORM_IMX_UART | 164 | select IMX_HAVE_PLATFORM_IMX_UART |
160 | select IMX_HAVE_PLATFORM_IMX_I2C | 165 | select IMX_HAVE_PLATFORM_IMX_I2C |
161 | select IMX_HAVE_PLATFORM_MXC_NAND | 166 | select IMX_HAVE_PLATFORM_MXC_NAND |
167 | select IMX_HAVE_PLATFORM_FLEXCAN | ||
168 | select IMX_HAVE_PLATFORM_ESDHC | ||
162 | select MXC_ULPI if USB_ULPI | 169 | select MXC_ULPI if USB_ULPI |
163 | help | 170 | help |
164 | Include support for Eukrea CPUIMX35 platform. This includes | 171 | Include support for Eukrea CPUIMX35 platform. This includes |
@@ -170,8 +177,8 @@ choice | |||
170 | default MACH_EUKREA_MBIMXSD35_BASEBOARD | 177 | default MACH_EUKREA_MBIMXSD35_BASEBOARD |
171 | 178 | ||
172 | config MACH_EUKREA_MBIMXSD35_BASEBOARD | 179 | config MACH_EUKREA_MBIMXSD35_BASEBOARD |
173 | prompt "Eukrea MBIMXSD development board" | 180 | bool "Eukrea MBIMXSD development board" |
174 | bool | 181 | select IMX_HAVE_PLATFORM_IMX_SSI |
175 | help | 182 | help |
176 | This adds board specific devices that can be found on Eukrea's | 183 | This adds board specific devices that can be found on Eukrea's |
177 | MBIMXSD evaluation board. | 184 | MBIMXSD evaluation board. |
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile index 2bd7beceb991..8a182d0a3fcf 100644 --- a/arch/arm/mach-mx3/Makefile +++ b/arch/arm/mach-mx3/Makefile | |||
@@ -7,7 +7,6 @@ | |||
7 | obj-y := mm.o devices.o cpu.o | 7 | obj-y := mm.o devices.o cpu.o |
8 | CFLAGS_mm.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS | 8 | CFLAGS_mm.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS |
9 | CFLAGS_devices.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS | 9 | CFLAGS_devices.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS |
10 | CFLAGS_cpu.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS | ||
11 | obj-$(CONFIG_ARCH_MX31) += clock-imx31.o iomux-imx31.o | 10 | obj-$(CONFIG_ARCH_MX31) += clock-imx31.o iomux-imx31.o |
12 | obj-$(CONFIG_ARCH_MX35) += clock-imx35.o | 11 | obj-$(CONFIG_ARCH_MX35) += clock-imx35.o |
13 | obj-$(CONFIG_MACH_MX31ADS) += mach-mx31ads.o | 12 | obj-$(CONFIG_MACH_MX31ADS) += mach-mx31ads.o |
diff --git a/arch/arm/mach-mx3/clock-imx31.c b/arch/arm/mach-mx3/clock-imx31.c index 9a9eb6de6127..109e98f323e0 100644 --- a/arch/arm/mach-mx3/clock-imx31.c +++ b/arch/arm/mach-mx3/clock-imx31.c | |||
@@ -477,7 +477,7 @@ DEFINE_CLOCK(epit1_clk, 0, MXC_CCM_CGR0, 6, NULL, NULL, &perclk_clk); | |||
477 | DEFINE_CLOCK(epit2_clk, 1, MXC_CCM_CGR0, 8, NULL, NULL, &perclk_clk); | 477 | DEFINE_CLOCK(epit2_clk, 1, MXC_CCM_CGR0, 8, NULL, NULL, &perclk_clk); |
478 | DEFINE_CLOCK(iim_clk, 0, MXC_CCM_CGR0, 10, NULL, NULL, &ipg_clk); | 478 | DEFINE_CLOCK(iim_clk, 0, MXC_CCM_CGR0, 10, NULL, NULL, &ipg_clk); |
479 | DEFINE_CLOCK(ata_clk, 0, MXC_CCM_CGR0, 12, NULL, NULL, &ipg_clk); | 479 | DEFINE_CLOCK(ata_clk, 0, MXC_CCM_CGR0, 12, NULL, NULL, &ipg_clk); |
480 | DEFINE_CLOCK(sdma_clk1, 0, MXC_CCM_CGR0, 14, NULL, &sdma_clk1, &ahb_clk); | 480 | DEFINE_CLOCK(sdma_clk1, 0, MXC_CCM_CGR0, 14, NULL, NULL, &ahb_clk); |
481 | DEFINE_CLOCK(cspi3_clk, 2, MXC_CCM_CGR0, 16, NULL, NULL, &ipg_clk); | 481 | DEFINE_CLOCK(cspi3_clk, 2, MXC_CCM_CGR0, 16, NULL, NULL, &ipg_clk); |
482 | DEFINE_CLOCK(rng_clk, 0, MXC_CCM_CGR0, 18, NULL, NULL, &ipg_clk); | 482 | DEFINE_CLOCK(rng_clk, 0, MXC_CCM_CGR0, 18, NULL, NULL, &ipg_clk); |
483 | DEFINE_CLOCK(uart1_clk, 0, MXC_CCM_CGR0, 20, NULL, NULL, &perclk_clk); | 483 | DEFINE_CLOCK(uart1_clk, 0, MXC_CCM_CGR0, 20, NULL, NULL, &perclk_clk); |
@@ -525,9 +525,9 @@ DEFINE_CLOCK(ipg_clk, 0, NULL, 0, ipg_get_rate, NULL, &ahb_clk); | |||
525 | 525 | ||
526 | static struct clk_lookup lookups[] = { | 526 | static struct clk_lookup lookups[] = { |
527 | _REGISTER_CLOCK(NULL, "emi", emi_clk) | 527 | _REGISTER_CLOCK(NULL, "emi", emi_clk) |
528 | _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk) | 528 | _REGISTER_CLOCK("imx31-cspi.0", NULL, cspi1_clk) |
529 | _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk) | 529 | _REGISTER_CLOCK("imx31-cspi.1", NULL, cspi2_clk) |
530 | _REGISTER_CLOCK("spi_imx.2", NULL, cspi3_clk) | 530 | _REGISTER_CLOCK("imx31-cspi.2", NULL, cspi3_clk) |
531 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) | 531 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) |
532 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) | 532 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) |
533 | _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk) | 533 | _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk) |
@@ -564,7 +564,7 @@ static struct clk_lookup lookups[] = { | |||
564 | _REGISTER_CLOCK(NULL, "ata", ata_clk) | 564 | _REGISTER_CLOCK(NULL, "ata", ata_clk) |
565 | _REGISTER_CLOCK(NULL, "rtic", rtic_clk) | 565 | _REGISTER_CLOCK(NULL, "rtic", rtic_clk) |
566 | _REGISTER_CLOCK(NULL, "rng", rng_clk) | 566 | _REGISTER_CLOCK(NULL, "rng", rng_clk) |
567 | _REGISTER_CLOCK(NULL, "sdma_ahb", sdma_clk1) | 567 | _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk1) |
568 | _REGISTER_CLOCK(NULL, "sdma_ipg", sdma_clk2) | 568 | _REGISTER_CLOCK(NULL, "sdma_ipg", sdma_clk2) |
569 | _REGISTER_CLOCK(NULL, "mstick", mstick1_clk) | 569 | _REGISTER_CLOCK(NULL, "mstick", mstick1_clk) |
570 | _REGISTER_CLOCK(NULL, "mstick", mstick2_clk) | 570 | _REGISTER_CLOCK(NULL, "mstick", mstick2_clk) |
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c index 7a62e744a8b0..61e4a318980a 100644 --- a/arch/arm/mach-mx3/clock-imx35.c +++ b/arch/arm/mach-mx3/clock-imx35.c | |||
@@ -364,8 +364,8 @@ DEFINE_CLOCK(cspi2_clk, 1, CCM_CGR0, 12, get_rate_ipg, NULL); | |||
364 | DEFINE_CLOCK(ect_clk, 0, CCM_CGR0, 14, get_rate_ipg, NULL); | 364 | DEFINE_CLOCK(ect_clk, 0, CCM_CGR0, 14, get_rate_ipg, NULL); |
365 | DEFINE_CLOCK(edio_clk, 0, CCM_CGR0, 16, NULL, NULL); | 365 | DEFINE_CLOCK(edio_clk, 0, CCM_CGR0, 16, NULL, NULL); |
366 | DEFINE_CLOCK(emi_clk, 0, CCM_CGR0, 18, get_rate_ipg, NULL); | 366 | DEFINE_CLOCK(emi_clk, 0, CCM_CGR0, 18, get_rate_ipg, NULL); |
367 | DEFINE_CLOCK(epit1_clk, 0, CCM_CGR0, 20, get_rate_ipg_per, NULL); | 367 | DEFINE_CLOCK(epit1_clk, 0, CCM_CGR0, 20, get_rate_ipg, NULL); |
368 | DEFINE_CLOCK(epit2_clk, 1, CCM_CGR0, 22, get_rate_ipg_per, NULL); | 368 | DEFINE_CLOCK(epit2_clk, 1, CCM_CGR0, 22, get_rate_ipg, NULL); |
369 | DEFINE_CLOCK(esai_clk, 0, CCM_CGR0, 24, NULL, NULL); | 369 | DEFINE_CLOCK(esai_clk, 0, CCM_CGR0, 24, NULL, NULL); |
370 | DEFINE_CLOCK(esdhc1_clk, 0, CCM_CGR0, 26, get_rate_sdhc, NULL); | 370 | DEFINE_CLOCK(esdhc1_clk, 0, CCM_CGR0, 26, get_rate_sdhc, NULL); |
371 | DEFINE_CLOCK(esdhc2_clk, 1, CCM_CGR0, 28, get_rate_sdhc, NULL); | 371 | DEFINE_CLOCK(esdhc2_clk, 1, CCM_CGR0, 28, get_rate_sdhc, NULL); |
@@ -451,17 +451,17 @@ static struct clk_lookup lookups[] = { | |||
451 | _REGISTER_CLOCK(NULL, "ata", ata_clk) | 451 | _REGISTER_CLOCK(NULL, "ata", ata_clk) |
452 | _REGISTER_CLOCK("flexcan.0", NULL, can1_clk) | 452 | _REGISTER_CLOCK("flexcan.0", NULL, can1_clk) |
453 | _REGISTER_CLOCK("flexcan.1", NULL, can2_clk) | 453 | _REGISTER_CLOCK("flexcan.1", NULL, can2_clk) |
454 | _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk) | 454 | _REGISTER_CLOCK("imx35-cspi.0", NULL, cspi1_clk) |
455 | _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk) | 455 | _REGISTER_CLOCK("imx35-cspi.1", NULL, cspi2_clk) |
456 | _REGISTER_CLOCK(NULL, "ect", ect_clk) | 456 | _REGISTER_CLOCK(NULL, "ect", ect_clk) |
457 | _REGISTER_CLOCK(NULL, "edio", edio_clk) | 457 | _REGISTER_CLOCK(NULL, "edio", edio_clk) |
458 | _REGISTER_CLOCK(NULL, "emi", emi_clk) | 458 | _REGISTER_CLOCK(NULL, "emi", emi_clk) |
459 | _REGISTER_CLOCK(NULL, "epit", epit1_clk) | 459 | _REGISTER_CLOCK("imx-epit.0", NULL, epit1_clk) |
460 | _REGISTER_CLOCK(NULL, "epit", epit2_clk) | 460 | _REGISTER_CLOCK("imx-epit.1", NULL, epit2_clk) |
461 | _REGISTER_CLOCK(NULL, "esai", esai_clk) | 461 | _REGISTER_CLOCK(NULL, "esai", esai_clk) |
462 | _REGISTER_CLOCK(NULL, "sdhc", esdhc1_clk) | 462 | _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) |
463 | _REGISTER_CLOCK(NULL, "sdhc", esdhc2_clk) | 463 | _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) |
464 | _REGISTER_CLOCK(NULL, "sdhc", esdhc3_clk) | 464 | _REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_clk) |
465 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | 465 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) |
466 | _REGISTER_CLOCK(NULL, "gpio", gpio1_clk) | 466 | _REGISTER_CLOCK(NULL, "gpio", gpio1_clk) |
467 | _REGISTER_CLOCK(NULL, "gpio", gpio2_clk) | 467 | _REGISTER_CLOCK(NULL, "gpio", gpio2_clk) |
@@ -482,7 +482,7 @@ static struct clk_lookup lookups[] = { | |||
482 | _REGISTER_CLOCK(NULL, "rtc", rtc_clk) | 482 | _REGISTER_CLOCK(NULL, "rtc", rtc_clk) |
483 | _REGISTER_CLOCK(NULL, "rtic", rtic_clk) | 483 | _REGISTER_CLOCK(NULL, "rtic", rtic_clk) |
484 | _REGISTER_CLOCK(NULL, "scc", scc_clk) | 484 | _REGISTER_CLOCK(NULL, "scc", scc_clk) |
485 | _REGISTER_CLOCK(NULL, "sdma", sdma_clk) | 485 | _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) |
486 | _REGISTER_CLOCK(NULL, "spba", spba_clk) | 486 | _REGISTER_CLOCK(NULL, "spba", spba_clk) |
487 | _REGISTER_CLOCK(NULL, "spdif", spdif_clk) | 487 | _REGISTER_CLOCK(NULL, "spdif", spdif_clk) |
488 | _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) | 488 | _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) |
@@ -535,8 +535,16 @@ int __init mx35_clocks_init() | |||
535 | __raw_writel(cgr2, CCM_BASE + CCM_CGR2); | 535 | __raw_writel(cgr2, CCM_BASE + CCM_CGR2); |
536 | __raw_writel(cgr3, CCM_BASE + CCM_CGR3); | 536 | __raw_writel(cgr3, CCM_BASE + CCM_CGR3); |
537 | 537 | ||
538 | clk_enable(&iim_clk); | ||
539 | mx35_read_cpu_rev(); | ||
540 | |||
541 | #ifdef CONFIG_MXC_USE_EPIT | ||
542 | epit_timer_init(&epit1_clk, | ||
543 | MX35_IO_ADDRESS(MX35_EPIT1_BASE_ADDR), MX35_INT_EPIT1); | ||
544 | #else | ||
538 | mxc_timer_init(&gpt_clk, | 545 | mxc_timer_init(&gpt_clk, |
539 | MX35_IO_ADDRESS(MX35_GPT1_BASE_ADDR), MX35_INT_GPT); | 546 | MX35_IO_ADDRESS(MX35_GPT1_BASE_ADDR), MX35_INT_GPT); |
547 | #endif | ||
540 | 548 | ||
541 | return 0; | 549 | return 0; |
542 | } | 550 | } |
diff --git a/arch/arm/mach-mx3/cpu.c b/arch/arm/mach-mx3/cpu.c index 861afe0fe3ad..d00a75457812 100644 --- a/arch/arm/mach-mx3/cpu.c +++ b/arch/arm/mach-mx3/cpu.c | |||
@@ -25,15 +25,15 @@ struct mx3_cpu_type { | |||
25 | }; | 25 | }; |
26 | 26 | ||
27 | static struct mx3_cpu_type mx31_cpu_type[] __initdata = { | 27 | static struct mx3_cpu_type mx31_cpu_type[] __initdata = { |
28 | { .srev = 0x00, .name = "i.MX31(L)", .v = "1.0", .rev = CHIP_REV_1_0 }, | 28 | { .srev = 0x00, .name = "i.MX31(L)", .v = "1.0", .rev = MX3x_CHIP_REV_1_0 }, |
29 | { .srev = 0x10, .name = "i.MX31", .v = "1.1", .rev = CHIP_REV_1_1 }, | 29 | { .srev = 0x10, .name = "i.MX31", .v = "1.1", .rev = MX3x_CHIP_REV_1_1 }, |
30 | { .srev = 0x11, .name = "i.MX31L", .v = "1.1", .rev = CHIP_REV_1_1 }, | 30 | { .srev = 0x11, .name = "i.MX31L", .v = "1.1", .rev = MX3x_CHIP_REV_1_1 }, |
31 | { .srev = 0x12, .name = "i.MX31", .v = "1.15", .rev = CHIP_REV_1_1 }, | 31 | { .srev = 0x12, .name = "i.MX31", .v = "1.15", .rev = MX3x_CHIP_REV_1_1 }, |
32 | { .srev = 0x13, .name = "i.MX31L", .v = "1.15", .rev = CHIP_REV_1_1 }, | 32 | { .srev = 0x13, .name = "i.MX31L", .v = "1.15", .rev = MX3x_CHIP_REV_1_1 }, |
33 | { .srev = 0x14, .name = "i.MX31", .v = "1.2", .rev = CHIP_REV_1_2 }, | 33 | { .srev = 0x14, .name = "i.MX31", .v = "1.2", .rev = MX3x_CHIP_REV_1_2 }, |
34 | { .srev = 0x15, .name = "i.MX31L", .v = "1.2", .rev = CHIP_REV_1_2 }, | 34 | { .srev = 0x15, .name = "i.MX31L", .v = "1.2", .rev = MX3x_CHIP_REV_1_2 }, |
35 | { .srev = 0x28, .name = "i.MX31", .v = "2.0", .rev = CHIP_REV_2_0 }, | 35 | { .srev = 0x28, .name = "i.MX31", .v = "2.0", .rev = MX3x_CHIP_REV_2_0 }, |
36 | { .srev = 0x29, .name = "i.MX31L", .v = "2.0", .rev = CHIP_REV_2_0 }, | 36 | { .srev = 0x29, .name = "i.MX31L", .v = "2.0", .rev = MX3x_CHIP_REV_2_0 }, |
37 | }; | 37 | }; |
38 | 38 | ||
39 | void __init mx31_read_cpu_rev(void) | 39 | void __init mx31_read_cpu_rev(void) |
@@ -41,7 +41,7 @@ void __init mx31_read_cpu_rev(void) | |||
41 | u32 i, srev; | 41 | u32 i, srev; |
42 | 42 | ||
43 | /* read SREV register from IIM module */ | 43 | /* read SREV register from IIM module */ |
44 | srev = __raw_readl(IO_ADDRESS(IIM_BASE_ADDR + MXC_IIMSREV)); | 44 | srev = __raw_readl(MX31_IO_ADDRESS(MX31_IIM_BASE_ADDR + MXC_IIMSREV)); |
45 | 45 | ||
46 | for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++) | 46 | for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++) |
47 | if (srev == mx31_cpu_type[i].srev) { | 47 | if (srev == mx31_cpu_type[i].srev) { |
@@ -55,3 +55,30 @@ void __init mx31_read_cpu_rev(void) | |||
55 | 55 | ||
56 | printk(KERN_WARNING "Unknown CPU identifier. srev = %02x\n", srev); | 56 | printk(KERN_WARNING "Unknown CPU identifier. srev = %02x\n", srev); |
57 | } | 57 | } |
58 | |||
59 | unsigned int mx35_cpu_rev; | ||
60 | EXPORT_SYMBOL(mx35_cpu_rev); | ||
61 | |||
62 | void __init mx35_read_cpu_rev(void) | ||
63 | { | ||
64 | u32 rev; | ||
65 | char *srev = "unknown"; | ||
66 | |||
67 | rev = __raw_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV)); | ||
68 | switch (rev) { | ||
69 | case 0x00: | ||
70 | mx35_cpu_rev = MX3x_CHIP_REV_1_0; | ||
71 | srev = "1.0"; | ||
72 | break; | ||
73 | case 0x10: | ||
74 | mx35_cpu_rev = MX3x_CHIP_REV_2_0; | ||
75 | srev = "2.0"; | ||
76 | break; | ||
77 | case 0x11: | ||
78 | mx35_cpu_rev = MX3x_CHIP_REV_2_1; | ||
79 | srev = "2.1"; | ||
80 | break; | ||
81 | } | ||
82 | |||
83 | printk(KERN_INFO "CPU identified as i.MX35, silicon rev %s\n", srev); | ||
84 | } | ||
diff --git a/arch/arm/mach-mx3/devices-imx31.h b/arch/arm/mach-mx3/devices-imx31.h index 3b1a44a20585..de9598590eba 100644 --- a/arch/arm/mach-mx3/devices-imx31.h +++ b/arch/arm/mach-mx3/devices-imx31.h | |||
@@ -9,30 +9,33 @@ | |||
9 | #include <mach/mx31.h> | 9 | #include <mach/mx31.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | #define imx31_add_imx_i2c0(pdata) \ | 12 | extern const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst; |
13 | imx_add_imx_i2c(0, MX31_I2C1_BASE_ADDR, SZ_4K, MX31_INT_I2C1, pdata) | 13 | #define imx31_add_imx_i2c(id, pdata) \ |
14 | #define imx31_add_imx_i2c1(pdata) \ | 14 | imx_add_imx_i2c(&imx31_imx_i2c_data[id], pdata) |
15 | imx_add_imx_i2c(1, MX31_I2C2_BASE_ADDR, SZ_4K, MX31_INT_I2C2, pdata) | 15 | #define imx31_add_imx_i2c0(pdata) imx31_add_imx_i2c(0, pdata) |
16 | #define imx31_add_imx_i2c2(pdata) \ | 16 | #define imx31_add_imx_i2c1(pdata) imx31_add_imx_i2c(1, pdata) |
17 | imx_add_imx_i2c(2, MX31_I2C3_BASE_ADDR, SZ_4K, MX31_INT_I2C3, pdata) | 17 | #define imx31_add_imx_i2c2(pdata) imx31_add_imx_i2c(2, pdata) |
18 | 18 | ||
19 | #define imx31_add_imx_uart0(pdata) \ | 19 | extern const struct imx_imx_ssi_data imx31_imx_ssi_data[] __initconst; |
20 | imx_add_imx_uart_1irq(0, MX31_UART1_BASE_ADDR, SZ_16K, MX31_INT_UART1, pdata) | 20 | #define imx31_add_imx_ssi(id, pdata) \ |
21 | #define imx31_add_imx_uart1(pdata) \ | 21 | imx_add_imx_ssi(&imx31_imx_ssi_data[id], pdata) |
22 | imx_add_imx_uart_1irq(1, MX31_UART2_BASE_ADDR, SZ_16K, MX31_INT_UART2, pdata) | ||
23 | #define imx31_add_imx_uart2(pdata) \ | ||
24 | imx_add_imx_uart_1irq(2, MX31_UART3_BASE_ADDR, SZ_16K, MX31_INT_UART3, pdata) | ||
25 | #define imx31_add_imx_uart3(pdata) \ | ||
26 | imx_add_imx_uart_1irq(3, MX31_UART4_BASE_ADDR, SZ_16K, MX31_INT_UART4, pdata) | ||
27 | #define imx31_add_imx_uart4(pdata) \ | ||
28 | imx_add_imx_uart_1irq(4, MX31_UART5_BASE_ADDR, SZ_16K, MX31_INT_UART5, pdata) | ||
29 | 22 | ||
23 | extern const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst; | ||
24 | #define imx31_add_imx_uart(id, pdata) \ | ||
25 | imx_add_imx_uart_1irq(&imx31_imx_uart_data[id], pdata) | ||
26 | #define imx31_add_imx_uart0(pdata) imx31_add_imx_uart(0, pdata) | ||
27 | #define imx31_add_imx_uart1(pdata) imx31_add_imx_uart(1, pdata) | ||
28 | #define imx31_add_imx_uart2(pdata) imx31_add_imx_uart(2, pdata) | ||
29 | #define imx31_add_imx_uart3(pdata) imx31_add_imx_uart(3, pdata) | ||
30 | #define imx31_add_imx_uart4(pdata) imx31_add_imx_uart(4, pdata) | ||
31 | |||
32 | extern const struct imx_mxc_nand_data imx31_mxc_nand_data __initconst; | ||
30 | #define imx31_add_mxc_nand(pdata) \ | 33 | #define imx31_add_mxc_nand(pdata) \ |
31 | imx_add_mxc_nand_v1(MX31_NFC_BASE_ADDR, MX31_INT_NANDFC, pdata) | 34 | imx_add_mxc_nand(&imx31_mxc_nand_data, pdata) |
32 | 35 | ||
33 | #define imx31_add_spi_imx0(pdata) \ | 36 | extern const struct imx_spi_imx_data imx31_cspi_data[] __initconst; |
34 | imx_add_spi_imx(0, MX31_CSPI1_BASE_ADDR, SZ_4K, MX31_INT_CSPI1, pdata) | 37 | #define imx31_add_cspi(id, pdata) \ |
35 | #define imx31_add_spi_imx1(pdata) \ | 38 | imx_add_spi_imx(&imx31_cspi_data[id], pdata) |
36 | imx_add_spi_imx(1, MX31_CSPI2_BASE_ADDR, SZ_4K, MX31_INT_CSPI2, pdata) | 39 | #define imx31_add_spi_imx0(pdata) imx31_add_cspi(0, pdata) |
37 | #define imx31_add_spi_imx2(pdata) \ | 40 | #define imx31_add_spi_imx1(pdata) imx31_add_cspi(1, pdata) |
38 | imx_add_spi_imx(2, MX31_CSPI3_BASE_ADDR, SZ_4K, MX31_INT_CSPI3, pdata) | 41 | #define imx31_add_spi_imx2(pdata) imx31_add_cspi(2, pdata) |
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h index f6a431a4c3d2..509b346b7fef 100644 --- a/arch/arm/mach-mx3/devices-imx35.h +++ b/arch/arm/mach-mx3/devices-imx35.h | |||
@@ -9,29 +9,46 @@ | |||
9 | #include <mach/mx35.h> | 9 | #include <mach/mx35.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | extern const struct imx_fec_data imx35_fec_data __initconst; | ||
13 | #define imx35_add_fec(pdata) \ | ||
14 | imx_add_fec(&imx35_fec_data, pdata) | ||
15 | |||
12 | #define imx35_add_flexcan0(pdata) \ | 16 | #define imx35_add_flexcan0(pdata) \ |
13 | imx_add_flexcan(0, MX35_CAN1_BASE_ADDR, SZ_16K, MX35_INT_CAN1, pdata) | 17 | imx_add_flexcan(0, MX35_CAN1_BASE_ADDR, SZ_16K, MX35_INT_CAN1, pdata) |
14 | #define imx35_add_flexcan1(pdata) \ | 18 | #define imx35_add_flexcan1(pdata) \ |
15 | imx_add_flexcan(1, MX35_CAN2_BASE_ADDR, SZ_16K, MX35_INT_CAN2, pdata) | 19 | imx_add_flexcan(1, MX35_CAN2_BASE_ADDR, SZ_16K, MX35_INT_CAN2, pdata) |
16 | 20 | ||
17 | #define imx35_add_imx_i2c0(pdata) \ | 21 | extern const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst; |
18 | imx_add_imx_i2c(0, MX35_I2C1_BASE_ADDR, SZ_4K, MX35_INT_I2C1, pdata) | 22 | #define imx35_add_imx_i2c(id, pdata) \ |
19 | #define imx35_add_imx_i2c1(pdata) \ | 23 | imx_add_imx_i2c(&imx35_imx_i2c_data[id], pdata) |
20 | imx_add_imx_i2c(1, MX35_I2C2_BASE_ADDR, SZ_4K, MX35_INT_I2C2, pdata) | 24 | #define imx35_add_imx_i2c0(pdata) imx35_add_imx_i2c(0, pdata) |
21 | #define imx35_add_imx_i2c2(pdata) \ | 25 | #define imx35_add_imx_i2c1(pdata) imx35_add_imx_i2c(1, pdata) |
22 | imx_add_imx_i2c(2, MX35_I2C3_BASE_ADDR, SZ_4K, MX35_INT_I2C3, pdata) | 26 | #define imx35_add_imx_i2c2(pdata) imx35_add_imx_i2c(2, pdata) |
27 | |||
28 | extern const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst; | ||
29 | #define imx35_add_imx_ssi(id, pdata) \ | ||
30 | imx_add_imx_ssi(&imx35_imx_ssi_data[id], pdata) | ||
23 | 31 | ||
24 | #define imx35_add_imx_uart0(pdata) \ | 32 | extern const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst; |
25 | imx_add_imx_uart_1irq(0, MX35_UART1_BASE_ADDR, SZ_16K, MX35_INT_UART1, pdata) | 33 | #define imx35_add_imx_uart(id, pdata) \ |
26 | #define imx35_add_imx_uart1(pdata) \ | 34 | imx_add_imx_uart_1irq(&imx35_imx_uart_data[id], pdata) |
27 | imx_add_imx_uart_1irq(1, MX35_UART2_BASE_ADDR, SZ_16K, MX35_INT_UART2, pdata) | 35 | #define imx35_add_imx_uart0(pdata) imx35_add_imx_uart(0, pdata) |
28 | #define imx35_add_imx_uart2(pdata) \ | 36 | #define imx35_add_imx_uart1(pdata) imx35_add_imx_uart(1, pdata) |
29 | imx_add_imx_uart_1irq(2, MX35_UART3_BASE_ADDR, SZ_16K, MX35_INT_UART3, pdata) | 37 | #define imx35_add_imx_uart2(pdata) imx35_add_imx_uart(2, pdata) |
30 | 38 | ||
39 | extern const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst; | ||
31 | #define imx35_add_mxc_nand(pdata) \ | 40 | #define imx35_add_mxc_nand(pdata) \ |
32 | imx_add_mxc_nand_v21(MX35_NFC_BASE_ADDR, MX35_INT_NANDFC, pdata) | 41 | imx_add_mxc_nand(&imx35_mxc_nand_data, pdata) |
42 | |||
43 | extern const struct imx_spi_imx_data imx35_cspi_data[] __initconst; | ||
44 | #define imx35_add_cspi(id, pdata) \ | ||
45 | imx_add_spi_imx(&imx35_cspi_data[id], pdata) | ||
46 | #define imx35_add_spi_imx0(pdata) imx35_add_cspi(0, pdata) | ||
47 | #define imx35_add_spi_imx1(pdata) imx35_add_cspi(1, pdata) | ||
33 | 48 | ||
34 | #define imx35_add_spi_imx0(pdata) \ | 49 | #define imx35_add_esdhc0(pdata) \ |
35 | imx_add_spi_imx(0, MX35_CSPI1_BASE_ADDR, SZ_4K, MX35_INT_CSPI1, pdata) | 50 | imx_add_esdhc(0, MX35_ESDHC1_BASE_ADDR, SZ_16K, MX35_INT_MMC_SDHC1, pdata) |
36 | #define imx35_add_spi_imx1(pdata) \ | 51 | #define imx35_add_esdhc1(pdata) \ |
37 | imx_add_spi_imx(1, MX35_CSPI2_BASE_ADDR, SZ_4K, MX35_INT_CSPI2, pdata) | 52 | imx_add_esdhc(1, MX35_ESDHC2_BASE_ADDR, SZ_16K, MX35_INT_MMC_SDHC2, pdata) |
53 | #define imx35_add_esdhc2(pdata) \ | ||
54 | imx_add_esdhc(2, MX35_ESDHC3_BASE_ADDR, SZ_16K, MX35_INT_MMC_SDHC3, pdata) | ||
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c index a4fd1a26fc91..f4dff11aaee7 100644 --- a/arch/arm/mach-mx3/devices.c +++ b/arch/arm/mach-mx3/devices.c | |||
@@ -281,65 +281,6 @@ struct platform_device mxc_usbh2 = { | |||
281 | .num_resources = ARRAY_SIZE(mxc_usbh2_resources), | 281 | .num_resources = ARRAY_SIZE(mxc_usbh2_resources), |
282 | }; | 282 | }; |
283 | 283 | ||
284 | #if defined(CONFIG_ARCH_MX35) | ||
285 | static struct resource mxc_fec_resources[] = { | ||
286 | { | ||
287 | .start = MXC_FEC_BASE_ADDR, | ||
288 | .end = MXC_FEC_BASE_ADDR + 0xfff, | ||
289 | .flags = IORESOURCE_MEM, | ||
290 | }, { | ||
291 | .start = MXC_INT_FEC, | ||
292 | .end = MXC_INT_FEC, | ||
293 | .flags = IORESOURCE_IRQ, | ||
294 | }, | ||
295 | }; | ||
296 | |||
297 | struct platform_device mxc_fec_device = { | ||
298 | .name = "fec", | ||
299 | .id = 0, | ||
300 | .num_resources = ARRAY_SIZE(mxc_fec_resources), | ||
301 | .resource = mxc_fec_resources, | ||
302 | }; | ||
303 | #endif | ||
304 | |||
305 | static struct resource imx_ssi_resources0[] = { | ||
306 | { | ||
307 | .start = SSI1_BASE_ADDR, | ||
308 | .end = SSI1_BASE_ADDR + 0xfff, | ||
309 | .flags = IORESOURCE_MEM, | ||
310 | }, { | ||
311 | .start = MX31_INT_SSI1, | ||
312 | .end = MX31_INT_SSI1, | ||
313 | .flags = IORESOURCE_IRQ, | ||
314 | }, | ||
315 | }; | ||
316 | |||
317 | static struct resource imx_ssi_resources1[] = { | ||
318 | { | ||
319 | .start = SSI2_BASE_ADDR, | ||
320 | .end = SSI2_BASE_ADDR + 0xfff, | ||
321 | .flags = IORESOURCE_MEM | ||
322 | }, { | ||
323 | .start = MX31_INT_SSI2, | ||
324 | .end = MX31_INT_SSI2, | ||
325 | .flags = IORESOURCE_IRQ, | ||
326 | }, | ||
327 | }; | ||
328 | |||
329 | struct platform_device imx_ssi_device0 = { | ||
330 | .name = "imx-ssi", | ||
331 | .id = 0, | ||
332 | .num_resources = ARRAY_SIZE(imx_ssi_resources0), | ||
333 | .resource = imx_ssi_resources0, | ||
334 | }; | ||
335 | |||
336 | struct platform_device imx_ssi_device1 = { | ||
337 | .name = "imx-ssi", | ||
338 | .id = 1, | ||
339 | .num_resources = ARRAY_SIZE(imx_ssi_resources1), | ||
340 | .resource = imx_ssi_resources1, | ||
341 | }; | ||
342 | |||
343 | static struct resource imx_wdt_resources[] = { | 284 | static struct resource imx_wdt_resources[] = { |
344 | { | 285 | { |
345 | .flags = IORESOURCE_MEM, | 286 | .flags = IORESOURCE_MEM, |
@@ -410,10 +351,6 @@ static int __init mx3_devices_init(void) | |||
410 | mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff; | 351 | mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff; |
411 | mxc_usbh1_resources[1].start = MXC_INT_USBHS; | 352 | mxc_usbh1_resources[1].start = MXC_INT_USBHS; |
412 | mxc_usbh1_resources[1].end = MXC_INT_USBHS; | 353 | mxc_usbh1_resources[1].end = MXC_INT_USBHS; |
413 | imx_ssi_resources0[1].start = MX35_INT_SSI1; | ||
414 | imx_ssi_resources0[1].end = MX35_INT_SSI1; | ||
415 | imx_ssi_resources1[1].start = MX35_INT_SSI2; | ||
416 | imx_ssi_resources1[1].end = MX35_INT_SSI2; | ||
417 | imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR; | 354 | imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR; |
418 | imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff; | 355 | imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff; |
419 | } | 356 | } |
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h index e5535234839f..585f814473d5 100644 --- a/arch/arm/mach-mx3/devices.h +++ b/arch/arm/mach-mx3/devices.h | |||
@@ -2,7 +2,6 @@ extern struct platform_device mxc_w1_master_device; | |||
2 | extern struct platform_device mx3_ipu; | 2 | extern struct platform_device mx3_ipu; |
3 | extern struct platform_device mx3_fb; | 3 | extern struct platform_device mx3_fb; |
4 | extern struct platform_device mx3_camera; | 4 | extern struct platform_device mx3_camera; |
5 | extern struct platform_device mxc_fec_device; | ||
6 | extern struct platform_device mxcsdhc_device0; | 5 | extern struct platform_device mxcsdhc_device0; |
7 | extern struct platform_device mxcsdhc_device1; | 6 | extern struct platform_device mxcsdhc_device1; |
8 | extern struct platform_device mxc_otg_udc_device; | 7 | extern struct platform_device mxc_otg_udc_device; |
@@ -10,9 +9,6 @@ extern struct platform_device mxc_otg_host; | |||
10 | extern struct platform_device mxc_usbh1; | 9 | extern struct platform_device mxc_usbh1; |
11 | extern struct platform_device mxc_usbh2; | 10 | extern struct platform_device mxc_usbh2; |
12 | extern struct platform_device mxc_rnga_device; | 11 | extern struct platform_device mxc_rnga_device; |
13 | extern struct platform_device imx_ssi_device0; | ||
14 | extern struct platform_device imx_ssi_device1; | ||
15 | extern struct platform_device imx_ssi_device1; | ||
16 | extern struct platform_device imx_wdt_device0; | 12 | extern struct platform_device imx_wdt_device0; |
17 | extern struct platform_device imx_rtc_device0; | 13 | extern struct platform_device imx_rtc_device0; |
18 | extern struct platform_device imx_kpp_device; | 14 | extern struct platform_device imx_kpp_device; |
diff --git a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c index f8f15e3ac7a0..886959906fbc 100644 --- a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c +++ b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c | |||
@@ -43,7 +43,6 @@ | |||
43 | #include <mach/ipu.h> | 43 | #include <mach/ipu.h> |
44 | #include <mach/mx3fb.h> | 44 | #include <mach/mx3fb.h> |
45 | #include <mach/audmux.h> | 45 | #include <mach/audmux.h> |
46 | #include <mach/ssi.h> | ||
47 | 46 | ||
48 | #include "devices-imx35.h" | 47 | #include "devices-imx35.h" |
49 | #include "devices.h" | 48 | #include "devices.h" |
@@ -120,6 +119,16 @@ static struct pad_desc eukrea_mbimxsd_pads[] = { | |||
120 | MX35_PAD_STXD4__AUDMUX_AUD4_TXD, | 119 | MX35_PAD_STXD4__AUDMUX_AUD4_TXD, |
121 | MX35_PAD_SRXD4__AUDMUX_AUD4_RXD, | 120 | MX35_PAD_SRXD4__AUDMUX_AUD4_RXD, |
122 | MX35_PAD_SCK4__AUDMUX_AUD4_TXC, | 121 | MX35_PAD_SCK4__AUDMUX_AUD4_TXC, |
122 | /* CAN2 */ | ||
123 | MX35_PAD_TX5_RX0__CAN2_TXCAN, | ||
124 | MX35_PAD_TX4_RX1__CAN2_RXCAN, | ||
125 | /* SDCARD */ | ||
126 | MX35_PAD_SD1_CMD__ESDHC1_CMD, | ||
127 | MX35_PAD_SD1_CLK__ESDHC1_CLK, | ||
128 | MX35_PAD_SD1_DATA0__ESDHC1_DAT0, | ||
129 | MX35_PAD_SD1_DATA1__ESDHC1_DAT1, | ||
130 | MX35_PAD_SD1_DATA2__ESDHC1_DAT2, | ||
131 | MX35_PAD_SD1_DATA3__ESDHC1_DAT3, | ||
123 | }; | 132 | }; |
124 | 133 | ||
125 | #define GPIO_LED1 (2 * 32 + 29) | 134 | #define GPIO_LED1 (2 * 32 + 29) |
@@ -206,7 +215,8 @@ static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = { | |||
206 | }, | 215 | }, |
207 | }; | 216 | }; |
208 | 217 | ||
209 | struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata = { | 218 | static const |
219 | struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata __initconst = { | ||
210 | .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE, | 220 | .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE, |
211 | }; | 221 | }; |
212 | 222 | ||
@@ -242,7 +252,10 @@ void __init eukrea_mbimxsd35_baseboard_init(void) | |||
242 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); | 252 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); |
243 | mxc_register_device(&mx3_fb, &mx3fb_pdata); | 253 | mxc_register_device(&mx3_fb, &mx3fb_pdata); |
244 | 254 | ||
245 | mxc_register_device(&imx_ssi_device0, &eukrea_mbimxsd_ssi_pdata); | 255 | imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); |
256 | |||
257 | imx35_add_flexcan1(NULL); | ||
258 | imx35_add_esdhc0(NULL); | ||
246 | 259 | ||
247 | gpio_request(GPIO_LED1, "LED1"); | 260 | gpio_request(GPIO_LED1, "LED1"); |
248 | gpio_direction_output(GPIO_LED1, 1); | 261 | gpio_direction_output(GPIO_LED1, 1); |
diff --git a/arch/arm/mach-mx3/mach-cpuimx35.c b/arch/arm/mach-mx3/mach-cpuimx35.c index 2a4f8b781ba4..6024bb958eea 100644 --- a/arch/arm/mach-mx3/mach-cpuimx35.c +++ b/arch/arm/mach-mx3/mach-cpuimx35.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/usb/otg.h> | 31 | #include <linux/usb/otg.h> |
32 | #include <linux/usb/ulpi.h> | 32 | #include <linux/usb/ulpi.h> |
33 | #include <linux/fsl_devices.h> | 33 | #include <linux/fsl_devices.h> |
34 | #include <linux/i2c-gpio.h> | ||
34 | 35 | ||
35 | #include <asm/mach-types.h> | 36 | #include <asm/mach-types.h> |
36 | #include <asm/mach/arch.h> | 37 | #include <asm/mach/arch.h> |
@@ -53,39 +54,16 @@ static const struct imxuart_platform_data uart_pdata __initconst = { | |||
53 | }; | 54 | }; |
54 | 55 | ||
55 | static const struct imxi2c_platform_data | 56 | static const struct imxi2c_platform_data |
56 | eukrea_cpuimx35_i2c0_data __initconst = { | 57 | eukrea_cpuimx35_i2c0_data __initconst = { |
57 | .bitrate = 50000, | 58 | .bitrate = 100000, |
58 | }; | 59 | }; |
59 | 60 | ||
60 | #define TSC2007_IRQGPIO (2 * 32 + 2) | ||
61 | static int ts_get_pendown_state(void) | ||
62 | { | ||
63 | int val = 0; | ||
64 | gpio_free(TSC2007_IRQGPIO); | ||
65 | gpio_request(TSC2007_IRQGPIO, NULL); | ||
66 | gpio_direction_input(TSC2007_IRQGPIO); | ||
67 | |||
68 | val = gpio_get_value(TSC2007_IRQGPIO); | ||
69 | |||
70 | gpio_free(TSC2007_IRQGPIO); | ||
71 | gpio_request(TSC2007_IRQGPIO, NULL); | ||
72 | |||
73 | return val ? 0 : 1; | ||
74 | } | ||
75 | |||
76 | static int ts_init(void) | ||
77 | { | ||
78 | gpio_request(TSC2007_IRQGPIO, NULL); | ||
79 | return 0; | ||
80 | } | ||
81 | |||
82 | static struct tsc2007_platform_data tsc2007_info = { | 61 | static struct tsc2007_platform_data tsc2007_info = { |
83 | .model = 2007, | 62 | .model = 2007, |
84 | .x_plate_ohms = 180, | 63 | .x_plate_ohms = 180, |
85 | .get_pendown_state = ts_get_pendown_state, | ||
86 | .init_platform_hw = ts_init, | ||
87 | }; | 64 | }; |
88 | 65 | ||
66 | #define TSC2007_IRQGPIO (2 * 32 + 2) | ||
89 | static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { | 67 | static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { |
90 | { | 68 | { |
91 | I2C_BOARD_INFO("pcf8563", 0x51), | 69 | I2C_BOARD_INFO("pcf8563", 0x51), |
@@ -98,7 +76,6 @@ static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { | |||
98 | }; | 76 | }; |
99 | 77 | ||
100 | static struct platform_device *devices[] __initdata = { | 78 | static struct platform_device *devices[] __initdata = { |
101 | &mxc_fec_device, | ||
102 | &imx_wdt_device0, | 79 | &imx_wdt_device0, |
103 | }; | 80 | }; |
104 | 81 | ||
@@ -135,18 +112,18 @@ static struct pad_desc eukrea_cpuimx35_pads[] = { | |||
135 | }; | 112 | }; |
136 | 113 | ||
137 | static const struct mxc_nand_platform_data | 114 | static const struct mxc_nand_platform_data |
138 | eukrea_cpuimx35_nand_board_info __initconst = { | 115 | eukrea_cpuimx35_nand_board_info __initconst = { |
139 | .width = 1, | 116 | .width = 1, |
140 | .hw_ecc = 1, | 117 | .hw_ecc = 1, |
141 | .flash_bbt = 1, | 118 | .flash_bbt = 1, |
142 | }; | 119 | }; |
143 | 120 | ||
144 | static struct mxc_usbh_platform_data otg_pdata = { | 121 | static struct mxc_usbh_platform_data __maybe_unused otg_pdata = { |
145 | .portsc = MXC_EHCI_MODE_UTMI, | 122 | .portsc = MXC_EHCI_MODE_UTMI, |
146 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 123 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
147 | }; | 124 | }; |
148 | 125 | ||
149 | static struct mxc_usbh_platform_data usbh1_pdata = { | 126 | static struct mxc_usbh_platform_data __maybe_unused usbh1_pdata = { |
150 | .portsc = MXC_EHCI_MODE_SERIAL, | 127 | .portsc = MXC_EHCI_MODE_SERIAL, |
151 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | 128 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | |
152 | MXC_EHCI_IPPUE_DOWN, | 129 | MXC_EHCI_IPPUE_DOWN, |
@@ -180,6 +157,7 @@ static void __init mxc_board_init(void) | |||
180 | mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads, | 157 | mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads, |
181 | ARRAY_SIZE(eukrea_cpuimx35_pads)); | 158 | ARRAY_SIZE(eukrea_cpuimx35_pads)); |
182 | 159 | ||
160 | imx35_add_fec(NULL); | ||
183 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 161 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
184 | 162 | ||
185 | imx35_add_imx_uart0(&uart_pdata); | 163 | imx35_add_imx_uart0(&uart_pdata); |
diff --git a/arch/arm/mach-mx3/mach-mx31ads.c b/arch/arm/mach-mx3/mach-mx31ads.c index 94b3e7c42404..96cedc4a47f5 100644 --- a/arch/arm/mach-mx3/mach-mx31ads.c +++ b/arch/arm/mach-mx3/mach-mx31ads.c | |||
@@ -517,7 +517,7 @@ static unsigned int ssi_pins[] = { | |||
517 | 517 | ||
518 | static void mxc_init_audio(void) | 518 | static void mxc_init_audio(void) |
519 | { | 519 | { |
520 | mxc_register_device(&imx_ssi_device0, NULL); | 520 | imx31_add_imx_ssi(0, NULL); |
521 | mxc_iomux_setup_multiple_pins(ssi_pins, ARRAY_SIZE(ssi_pins), "ssi"); | 521 | mxc_iomux_setup_multiple_pins(ssi_pins, ARRAY_SIZE(ssi_pins), "ssi"); |
522 | } | 522 | } |
523 | 523 | ||
diff --git a/arch/arm/mach-mx3/mach-mx35_3ds.c b/arch/arm/mach-mx3/mach-mx35_3ds.c index 1c30d7212f17..91bb06552af1 100644 --- a/arch/arm/mach-mx3/mach-mx35_3ds.c +++ b/arch/arm/mach-mx3/mach-mx35_3ds.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved. | 2 | * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved. |
3 | * Copyright (C) 2009 Marc Kleine-Budde, Pengutronix | ||
3 | * | 4 | * |
4 | * Author: Fabio Estevam <fabio.estevam@freescale.com> | 5 | * Author: Fabio Estevam <fabio.estevam@freescale.com> |
5 | * | 6 | * |
@@ -27,6 +28,8 @@ | |||
27 | #include <linux/gpio.h> | 28 | #include <linux/gpio.h> |
28 | #include <linux/fsl_devices.h> | 29 | #include <linux/fsl_devices.h> |
29 | 30 | ||
31 | #include <linux/mtd/physmap.h> | ||
32 | |||
30 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
31 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
32 | #include <asm/mach/time.h> | 35 | #include <asm/mach/time.h> |
@@ -35,6 +38,7 @@ | |||
35 | #include <mach/hardware.h> | 38 | #include <mach/hardware.h> |
36 | #include <mach/common.h> | 39 | #include <mach/common.h> |
37 | #include <mach/iomux-mx35.h> | 40 | #include <mach/iomux-mx35.h> |
41 | #include <mach/mxc_ehci.h> | ||
38 | 42 | ||
39 | #include "devices-imx35.h" | 43 | #include "devices-imx35.h" |
40 | #include "devices.h" | 44 | #include "devices.h" |
@@ -43,8 +47,34 @@ static const struct imxuart_platform_data uart_pdata __initconst = { | |||
43 | .flags = IMXUART_HAVE_RTSCTS, | 47 | .flags = IMXUART_HAVE_RTSCTS, |
44 | }; | 48 | }; |
45 | 49 | ||
50 | static struct physmap_flash_data mx35pdk_flash_data = { | ||
51 | .width = 2, | ||
52 | }; | ||
53 | |||
54 | static struct resource mx35pdk_flash_resource = { | ||
55 | .start = MX35_CS0_BASE_ADDR, | ||
56 | .end = MX35_CS0_BASE_ADDR + SZ_64M - 1, | ||
57 | .flags = IORESOURCE_MEM, | ||
58 | }; | ||
59 | |||
60 | static struct platform_device mx35pdk_flash = { | ||
61 | .name = "physmap-flash", | ||
62 | .id = 0, | ||
63 | .dev = { | ||
64 | .platform_data = &mx35pdk_flash_data, | ||
65 | }, | ||
66 | .resource = &mx35pdk_flash_resource, | ||
67 | .num_resources = 1, | ||
68 | }; | ||
69 | |||
70 | static const struct mxc_nand_platform_data mx35pdk_nand_board_info __initconst = { | ||
71 | .width = 1, | ||
72 | .hw_ecc = 1, | ||
73 | .flash_bbt = 1, | ||
74 | }; | ||
75 | |||
46 | static struct platform_device *devices[] __initdata = { | 76 | static struct platform_device *devices[] __initdata = { |
47 | &mxc_fec_device, | 77 | &mx35pdk_flash, |
48 | }; | 78 | }; |
49 | 79 | ||
50 | static struct pad_desc mx35pdk_pads[] = { | 80 | static struct pad_desc mx35pdk_pads[] = { |
@@ -75,14 +105,24 @@ static struct pad_desc mx35pdk_pads[] = { | |||
75 | /* USBOTG */ | 105 | /* USBOTG */ |
76 | MX35_PAD_USBOTG_PWR__USB_TOP_USBOTG_PWR, | 106 | MX35_PAD_USBOTG_PWR__USB_TOP_USBOTG_PWR, |
77 | MX35_PAD_USBOTG_OC__USB_TOP_USBOTG_OC, | 107 | MX35_PAD_USBOTG_OC__USB_TOP_USBOTG_OC, |
108 | /* USBH1 */ | ||
109 | MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR, | ||
110 | MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC, | ||
78 | }; | 111 | }; |
79 | 112 | ||
80 | /* OTG config */ | 113 | /* OTG config */ |
81 | static struct fsl_usb2_platform_data usb_pdata = { | 114 | static struct fsl_usb2_platform_data usb_otg_pdata = { |
82 | .operating_mode = FSL_USB2_DR_DEVICE, | 115 | .operating_mode = FSL_USB2_DR_DEVICE, |
83 | .phy_mode = FSL_USB2_PHY_UTMI_WIDE, | 116 | .phy_mode = FSL_USB2_PHY_UTMI_WIDE, |
84 | }; | 117 | }; |
85 | 118 | ||
119 | /* USB HOST config */ | ||
120 | static struct mxc_usbh_platform_data usb_host_pdata = { | ||
121 | .portsc = MXC_EHCI_MODE_SERIAL, | ||
122 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | | ||
123 | MXC_EHCI_INTERNAL_PHY, | ||
124 | }; | ||
125 | |||
86 | /* | 126 | /* |
87 | * Board specific initialization. | 127 | * Board specific initialization. |
88 | */ | 128 | */ |
@@ -90,11 +130,16 @@ static void __init mxc_board_init(void) | |||
90 | { | 130 | { |
91 | mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads)); | 131 | mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads)); |
92 | 132 | ||
133 | imx35_add_fec(NULL); | ||
93 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 134 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
94 | 135 | ||
95 | imx35_add_imx_uart0(&uart_pdata); | 136 | imx35_add_imx_uart0(&uart_pdata); |
96 | 137 | ||
97 | mxc_register_device(&mxc_otg_udc_device, &usb_pdata); | 138 | mxc_register_device(&mxc_otg_udc_device, &usb_otg_pdata); |
139 | |||
140 | mxc_register_device(&mxc_usbh1, &usb_host_pdata); | ||
141 | |||
142 | imx35_add_mxc_nand(&mx35pdk_nand_board_info); | ||
98 | } | 143 | } |
99 | 144 | ||
100 | static void __init mx35pdk_timer_init(void) | 145 | static void __init mx35pdk_timer_init(void) |
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c index 28886f0e62f9..e790a00cf99f 100644 --- a/arch/arm/mach-mx3/mach-pcm043.c +++ b/arch/arm/mach-mx3/mach-pcm043.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <mach/mxc_ehci.h> | 42 | #include <mach/mxc_ehci.h> |
43 | #include <mach/ulpi.h> | 43 | #include <mach/ulpi.h> |
44 | #include <mach/audmux.h> | 44 | #include <mach/audmux.h> |
45 | #include <mach/ssi.h> | ||
46 | 45 | ||
47 | #include "devices-imx35.h" | 46 | #include "devices-imx35.h" |
48 | #include "devices.h" | 47 | #include "devices.h" |
@@ -141,7 +140,6 @@ static struct i2c_board_info pcm043_i2c_devices[] = { | |||
141 | 140 | ||
142 | static struct platform_device *devices[] __initdata = { | 141 | static struct platform_device *devices[] __initdata = { |
143 | &pcm043_flash, | 142 | &pcm043_flash, |
144 | &mxc_fec_device, | ||
145 | &imx_wdt_device0, | 143 | &imx_wdt_device0, |
146 | }; | 144 | }; |
147 | 145 | ||
@@ -217,6 +215,13 @@ static struct pad_desc pcm043_pads[] = { | |||
217 | /* CAN2 */ | 215 | /* CAN2 */ |
218 | MX35_PAD_TX5_RX0__CAN2_TXCAN, | 216 | MX35_PAD_TX5_RX0__CAN2_TXCAN, |
219 | MX35_PAD_TX4_RX1__CAN2_RXCAN, | 217 | MX35_PAD_TX4_RX1__CAN2_RXCAN, |
218 | /* esdhc */ | ||
219 | MX35_PAD_SD1_CMD__ESDHC1_CMD, | ||
220 | MX35_PAD_SD1_CLK__ESDHC1_CLK, | ||
221 | MX35_PAD_SD1_DATA0__ESDHC1_DAT0, | ||
222 | MX35_PAD_SD1_DATA1__ESDHC1_DAT1, | ||
223 | MX35_PAD_SD1_DATA2__ESDHC1_DAT2, | ||
224 | MX35_PAD_SD1_DATA3__ESDHC1_DAT3, | ||
220 | }; | 225 | }; |
221 | 226 | ||
222 | #define AC97_GPIO_TXFS (1 * 32 + 31) | 227 | #define AC97_GPIO_TXFS (1 * 32 + 31) |
@@ -293,7 +298,7 @@ err1: | |||
293 | mdelay(1); | 298 | mdelay(1); |
294 | } | 299 | } |
295 | 300 | ||
296 | static struct imx_ssi_platform_data pcm043_ssi_pdata = { | 301 | static const struct imx_ssi_platform_data pcm043_ssi_pdata __initconst = { |
297 | .ac97_reset = pcm043_ac97_cold_reset, | 302 | .ac97_reset = pcm043_ac97_cold_reset, |
298 | .ac97_warm_reset = pcm043_ac97_warm_reset, | 303 | .ac97_warm_reset = pcm043_ac97_warm_reset, |
299 | .flags = IMX_SSI_USE_AC97, | 304 | .flags = IMX_SSI_USE_AC97, |
@@ -357,11 +362,12 @@ static void __init mxc_board_init(void) | |||
357 | MXC_AUDMUX_V2_PTCR_TCLKDIR, /* clock is output */ | 362 | MXC_AUDMUX_V2_PTCR_TCLKDIR, /* clock is output */ |
358 | MXC_AUDMUX_V2_PDCR_RXDSEL(3)); | 363 | MXC_AUDMUX_V2_PDCR_RXDSEL(3)); |
359 | 364 | ||
365 | imx35_add_fec(NULL); | ||
360 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 366 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
361 | 367 | ||
362 | imx35_add_imx_uart0(&uart_pdata); | 368 | imx35_add_imx_uart0(&uart_pdata); |
363 | imx35_add_mxc_nand(&pcm037_nand_board_info); | 369 | imx35_add_mxc_nand(&pcm037_nand_board_info); |
364 | mxc_register_device(&imx_ssi_device0, &pcm043_ssi_pdata); | 370 | imx35_add_imx_ssi(0, &pcm043_ssi_pdata); |
365 | 371 | ||
366 | imx35_add_imx_uart1(&uart_pdata); | 372 | imx35_add_imx_uart1(&uart_pdata); |
367 | 373 | ||
@@ -389,6 +395,7 @@ static void __init mxc_board_init(void) | |||
389 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); | 395 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); |
390 | 396 | ||
391 | imx35_add_flexcan1(NULL); | 397 | imx35_add_flexcan1(NULL); |
398 | imx35_add_esdhc0(NULL); | ||
392 | } | 399 | } |
393 | 400 | ||
394 | static void __init pcm043_timer_init(void) | 401 | static void __init pcm043_timer_init(void) |
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c index 20e48c0195c4..b4ffc531a82c 100644 --- a/arch/arm/mach-mx3/mm.c +++ b/arch/arm/mach-mx3/mm.c | |||
@@ -110,6 +110,24 @@ void __init mx35_init_irq(void) | |||
110 | static int mxc_init_l2x0(void) | 110 | static int mxc_init_l2x0(void) |
111 | { | 111 | { |
112 | void __iomem *l2x0_base; | 112 | void __iomem *l2x0_base; |
113 | void __iomem *clkctl_base; | ||
114 | /* | ||
115 | * First of all, we must repair broken chip settings. There are some | ||
116 | * i.MX35 CPUs in the wild, comming with bogus L2 cache settings. These | ||
117 | * misconfigured CPUs will run amok immediately when the L2 cache gets enabled. | ||
118 | * Workaraound is to setup the correct register setting prior enabling the | ||
119 | * L2 cache. This should not hurt already working CPUs, as they are using the | ||
120 | * same value | ||
121 | */ | ||
122 | #define L2_MEM_VAL 0x10 | ||
123 | |||
124 | clkctl_base = ioremap(MX35_CLKCTL_BASE_ADDR, 4096); | ||
125 | if (clkctl_base != NULL) { | ||
126 | writel(0x00000515, clkctl_base + L2_MEM_VAL); | ||
127 | iounmap(clkctl_base); | ||
128 | } else { | ||
129 | pr_err("L2 cache: Cannot fix timing. Trying to continue without\n"); | ||
130 | } | ||
113 | 131 | ||
114 | l2x0_base = ioremap(L2CC_BASE_ADDR, 4096); | 132 | l2x0_base = ioremap(L2CC_BASE_ADDR, 4096); |
115 | if (IS_ERR(l2x0_base)) { | 133 | if (IS_ERR(l2x0_base)) { |
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig index 0848db5dd364..fad31cc5004b 100644 --- a/arch/arm/mach-mx5/Kconfig +++ b/arch/arm/mach-mx5/Kconfig | |||
@@ -5,11 +5,14 @@ config ARCH_MX51 | |||
5 | default y | 5 | default y |
6 | select MXC_TZIC | 6 | select MXC_TZIC |
7 | select ARCH_MXC_IOMUX_V3 | 7 | select ARCH_MXC_IOMUX_V3 |
8 | select ARCH_MXC_AUDMUX_V2 | ||
8 | 9 | ||
9 | comment "MX5 platforms:" | 10 | comment "MX5 platforms:" |
10 | 11 | ||
11 | config MACH_MX51_BABBAGE | 12 | config MACH_MX51_BABBAGE |
12 | bool "Support MX51 BABBAGE platforms" | 13 | bool "Support MX51 BABBAGE platforms" |
14 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
15 | select IMX_HAVE_PLATFORM_IMX_UART | ||
13 | help | 16 | help |
14 | Include support for MX51 Babbage platform, also known as MX51EVK in | 17 | Include support for MX51 Babbage platform, also known as MX51EVK in |
15 | u-boot. This includes specific configurations for the board and its | 18 | u-boot. This includes specific configurations for the board and its |
@@ -17,6 +20,8 @@ config MACH_MX51_BABBAGE | |||
17 | 20 | ||
18 | config MACH_MX51_3DS | 21 | config MACH_MX51_3DS |
19 | bool "Support MX51PDK (3DS)" | 22 | bool "Support MX51PDK (3DS)" |
23 | select IMX_HAVE_PLATFORM_IMX_UART | ||
24 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
20 | select MXC_DEBUG_BOARD | 25 | select MXC_DEBUG_BOARD |
21 | help | 26 | help |
22 | Include support for MX51PDK (3DS) platform. This includes specific | 27 | Include support for MX51PDK (3DS) platform. This includes specific |
@@ -24,6 +29,8 @@ config MACH_MX51_3DS | |||
24 | 29 | ||
25 | config MACH_EUKREA_CPUIMX51 | 30 | config MACH_EUKREA_CPUIMX51 |
26 | bool "Support Eukrea CPUIMX51 module" | 31 | bool "Support Eukrea CPUIMX51 module" |
32 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
33 | select IMX_HAVE_PLATFORM_IMX_UART | ||
27 | help | 34 | help |
28 | Include support for Eukrea CPUIMX51 platform. This includes | 35 | Include support for Eukrea CPUIMX51 platform. This includes |
29 | specific configurations for the module and its peripherals. | 36 | specific configurations for the module and its peripherals. |
@@ -42,4 +49,11 @@ config MACH_EUKREA_MBIMX51_BASEBOARD | |||
42 | 49 | ||
43 | endchoice | 50 | endchoice |
44 | 51 | ||
52 | config MACH_MX51_EFIKAMX | ||
53 | bool "Support MX51 Genesi Efika MX nettop" | ||
54 | select IMX_HAVE_PLATFORM_IMX_UART | ||
55 | help | ||
56 | Include support for Genesi Efika MX nettop. This includes specific | ||
57 | configurations for the board and its peripherals. | ||
58 | |||
45 | endif | 59 | endif |
diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile index 86c66e7f52f3..d1aac9c3d33c 100644 --- a/arch/arm/mach-mx5/Makefile +++ b/arch/arm/mach-mx5/Makefile | |||
@@ -9,3 +9,4 @@ obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o | |||
9 | obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o | 9 | obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o |
10 | obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o | 10 | obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o |
11 | obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o | 11 | obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o |
12 | obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o | ||
diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c index 623607a20f57..61f051043bbc 100644 --- a/arch/arm/mach-mx5/board-cpuimx51.c +++ b/arch/arm/mach-mx5/board-cpuimx51.c | |||
@@ -28,9 +28,7 @@ | |||
28 | #include <mach/eukrea-baseboards.h> | 28 | #include <mach/eukrea-baseboards.h> |
29 | #include <mach/common.h> | 29 | #include <mach/common.h> |
30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
31 | #include <mach/imx-uart.h> | ||
32 | #include <mach/iomux-mx51.h> | 31 | #include <mach/iomux-mx51.h> |
33 | #include <mach/i2c.h> | ||
34 | #include <mach/mxc_ehci.h> | 32 | #include <mach/mxc_ehci.h> |
35 | 33 | ||
36 | #include <asm/irq.h> | 34 | #include <asm/irq.h> |
@@ -39,6 +37,7 @@ | |||
39 | #include <asm/mach/arch.h> | 37 | #include <asm/mach/arch.h> |
40 | #include <asm/mach/time.h> | 38 | #include <asm/mach/time.h> |
41 | 39 | ||
40 | #include "devices-imx51.h" | ||
42 | #include "devices.h" | 41 | #include "devices.h" |
43 | 42 | ||
44 | #define CPUIMX51_USBH1_STP (0*32 + 27) | 43 | #define CPUIMX51_USBH1_STP (0*32 + 27) |
@@ -109,7 +108,6 @@ static struct platform_device serial_device = { | |||
109 | #endif | 108 | #endif |
110 | 109 | ||
111 | static struct platform_device *devices[] __initdata = { | 110 | static struct platform_device *devices[] __initdata = { |
112 | &mxc_fec_device, | ||
113 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) | 111 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) |
114 | &serial_device, | 112 | &serial_device, |
115 | #endif | 113 | #endif |
@@ -148,11 +146,12 @@ static struct pad_desc eukrea_cpuimx51_pads[] = { | |||
148 | MX51_PAD_USBH1_STP__USBH1_STP, | 146 | MX51_PAD_USBH1_STP__USBH1_STP, |
149 | }; | 147 | }; |
150 | 148 | ||
151 | static struct imxuart_platform_data uart_pdata = { | 149 | static const struct imxuart_platform_data uart_pdata __initconst = { |
152 | .flags = IMXUART_HAVE_RTSCTS, | 150 | .flags = IMXUART_HAVE_RTSCTS, |
153 | }; | 151 | }; |
154 | 152 | ||
155 | static struct imxi2c_platform_data eukrea_cpuimx51_i2c_data = { | 153 | static const |
154 | struct imxi2c_platform_data eukrea_cpuimx51_i2c_data __initconst = { | ||
156 | .bitrate = 100000, | 155 | .bitrate = 100000, |
157 | }; | 156 | }; |
158 | 157 | ||
@@ -239,7 +238,7 @@ static void __init eukrea_cpuimx51_init(void) | |||
239 | mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51_pads, | 238 | mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51_pads, |
240 | ARRAY_SIZE(eukrea_cpuimx51_pads)); | 239 | ARRAY_SIZE(eukrea_cpuimx51_pads)); |
241 | 240 | ||
242 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 241 | imx51_add_imx_uart(0, &uart_pdata); |
243 | gpio_request(CPUIMX51_QUARTA_GPIO, "quarta_irq"); | 242 | gpio_request(CPUIMX51_QUARTA_GPIO, "quarta_irq"); |
244 | gpio_direction_input(CPUIMX51_QUARTA_GPIO); | 243 | gpio_direction_input(CPUIMX51_QUARTA_GPIO); |
245 | gpio_free(CPUIMX51_QUARTA_GPIO); | 244 | gpio_free(CPUIMX51_QUARTA_GPIO); |
@@ -253,9 +252,10 @@ static void __init eukrea_cpuimx51_init(void) | |||
253 | gpio_direction_input(CPUIMX51_QUARTD_GPIO); | 252 | gpio_direction_input(CPUIMX51_QUARTD_GPIO); |
254 | gpio_free(CPUIMX51_QUARTD_GPIO); | 253 | gpio_free(CPUIMX51_QUARTD_GPIO); |
255 | 254 | ||
255 | imx51_add_fec(NULL); | ||
256 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 256 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
257 | 257 | ||
258 | mxc_register_device(&mxc_i2c_device1, &eukrea_cpuimx51_i2c_data); | 258 | imx51_add_imx_i2c(1, &eukrea_cpuimx51_i2c_data); |
259 | i2c_register_board_info(1, eukrea_cpuimx51_i2c_devices, | 259 | i2c_register_board_info(1, eukrea_cpuimx51_i2c_devices, |
260 | ARRAY_SIZE(eukrea_cpuimx51_i2c_devices)); | 260 | ARRAY_SIZE(eukrea_cpuimx51_i2c_devices)); |
261 | 261 | ||
diff --git a/arch/arm/mach-mx5/board-mx51_3ds.c b/arch/arm/mach-mx5/board-mx51_3ds.c index f95c2fd94667..ed08a2352a1a 100644 --- a/arch/arm/mach-mx5/board-mx51_3ds.c +++ b/arch/arm/mach-mx5/board-mx51_3ds.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/input/matrix_keypad.h> | 15 | #include <linux/input/matrix_keypad.h> |
16 | #include <linux/spi/spi.h> | ||
16 | 17 | ||
17 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
18 | #include <asm/mach/arch.h> | 19 | #include <asm/mach/arch.h> |
@@ -21,12 +22,13 @@ | |||
21 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
22 | #include <mach/common.h> | 23 | #include <mach/common.h> |
23 | #include <mach/iomux-mx51.h> | 24 | #include <mach/iomux-mx51.h> |
24 | #include <mach/imx-uart.h> | ||
25 | #include <mach/3ds_debugboard.h> | 25 | #include <mach/3ds_debugboard.h> |
26 | 26 | ||
27 | #include "devices-imx51.h" | ||
27 | #include "devices.h" | 28 | #include "devices.h" |
28 | 29 | ||
29 | #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6) | 30 | #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6) |
31 | #define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) | ||
30 | 32 | ||
31 | static struct pad_desc mx51_3ds_pads[] = { | 33 | static struct pad_desc mx51_3ds_pads[] = { |
32 | /* UART1 */ | 34 | /* UART1 */ |
@@ -61,19 +63,25 @@ static struct pad_desc mx51_3ds_pads[] = { | |||
61 | MX51_PAD_KEY_COL3__KEY_COL3, | 63 | MX51_PAD_KEY_COL3__KEY_COL3, |
62 | MX51_PAD_KEY_COL4__KEY_COL4, | 64 | MX51_PAD_KEY_COL4__KEY_COL4, |
63 | MX51_PAD_KEY_COL5__KEY_COL5, | 65 | MX51_PAD_KEY_COL5__KEY_COL5, |
66 | |||
67 | /* eCSPI2 */ | ||
68 | MX51_PAD_NANDF_RB2__ECSPI2_SCLK, | ||
69 | MX51_PAD_NANDF_RB3__ECSPI2_MISO, | ||
70 | MX51_PAD_NANDF_D15__ECSPI2_MOSI, | ||
71 | MX51_PAD_NANDF_D12__GPIO_3_28, | ||
64 | }; | 72 | }; |
65 | 73 | ||
66 | /* Serial ports */ | 74 | /* Serial ports */ |
67 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) | 75 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) |
68 | static struct imxuart_platform_data uart_pdata = { | 76 | static const struct imxuart_platform_data uart_pdata __initconst = { |
69 | .flags = IMXUART_HAVE_RTSCTS, | 77 | .flags = IMXUART_HAVE_RTSCTS, |
70 | }; | 78 | }; |
71 | 79 | ||
72 | static inline void mxc_init_imx_uart(void) | 80 | static inline void mxc_init_imx_uart(void) |
73 | { | 81 | { |
74 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 82 | imx51_add_imx_uart(0, &uart_pdata); |
75 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 83 | imx51_add_imx_uart(1, &uart_pdata); |
76 | mxc_register_device(&mxc_uart_device2, &uart_pdata); | 84 | imx51_add_imx_uart(2, &uart_pdata); |
77 | } | 85 | } |
78 | #else /* !SERIAL_IMX */ | 86 | #else /* !SERIAL_IMX */ |
79 | static inline void mxc_init_imx_uart(void) | 87 | static inline void mxc_init_imx_uart(void) |
@@ -127,6 +135,26 @@ static inline void mxc_init_keypad(void) | |||
127 | } | 135 | } |
128 | #endif | 136 | #endif |
129 | 137 | ||
138 | static int mx51_3ds_spi2_cs[] = { | ||
139 | MXC_SPI_CS(0), | ||
140 | MX51_3DS_ECSPI2_CS, | ||
141 | }; | ||
142 | |||
143 | static const struct spi_imx_master mx51_3ds_ecspi2_pdata __initconst = { | ||
144 | .chipselect = mx51_3ds_spi2_cs, | ||
145 | .num_chipselect = ARRAY_SIZE(mx51_3ds_spi2_cs), | ||
146 | }; | ||
147 | |||
148 | static struct spi_board_info mx51_3ds_spi_nor_device[] = { | ||
149 | { | ||
150 | .modalias = "m25p80", | ||
151 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
152 | .bus_num = 1, | ||
153 | .chip_select = 1, | ||
154 | .mode = SPI_MODE_0, | ||
155 | .platform_data = NULL,}, | ||
156 | }; | ||
157 | |||
130 | /* | 158 | /* |
131 | * Board specific initialization. | 159 | * Board specific initialization. |
132 | */ | 160 | */ |
@@ -136,6 +164,10 @@ static void __init mxc_board_init(void) | |||
136 | ARRAY_SIZE(mx51_3ds_pads)); | 164 | ARRAY_SIZE(mx51_3ds_pads)); |
137 | mxc_init_imx_uart(); | 165 | mxc_init_imx_uart(); |
138 | 166 | ||
167 | imx51_add_ecspi(1, &mx51_3ds_ecspi2_pdata); | ||
168 | spi_register_board_info(mx51_3ds_spi_nor_device, | ||
169 | ARRAY_SIZE(mx51_3ds_spi_nor_device)); | ||
170 | |||
139 | if (mxc_expio_init(MX51_CS5_BASE_ADDR, EXPIO_PARENT_INT)) | 171 | if (mxc_expio_init(MX51_CS5_BASE_ADDR, EXPIO_PARENT_INT)) |
140 | printk(KERN_WARNING "Init of the debugboard failed, all " | 172 | printk(KERN_WARNING "Init of the debugboard failed, all " |
141 | "devices on the board are unusable.\n"); | 173 | "devices on the board are unusable.\n"); |
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index 6e384d92e625..23ee4a447406 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c | |||
@@ -17,12 +17,11 @@ | |||
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <linux/fsl_devices.h> | 19 | #include <linux/fsl_devices.h> |
20 | #include <linux/fec.h> | ||
20 | 21 | ||
21 | #include <mach/common.h> | 22 | #include <mach/common.h> |
22 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
23 | #include <mach/imx-uart.h> | ||
24 | #include <mach/iomux-mx51.h> | 24 | #include <mach/iomux-mx51.h> |
25 | #include <mach/i2c.h> | ||
26 | #include <mach/mxc_ehci.h> | 25 | #include <mach/mxc_ehci.h> |
27 | 26 | ||
28 | #include <asm/irq.h> | 27 | #include <asm/irq.h> |
@@ -31,11 +30,13 @@ | |||
31 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
32 | #include <asm/mach/time.h> | 31 | #include <asm/mach/time.h> |
33 | 32 | ||
33 | #include "devices-imx51.h" | ||
34 | #include "devices.h" | 34 | #include "devices.h" |
35 | 35 | ||
36 | #define BABBAGE_USB_HUB_RESET (0*32 + 7) /* GPIO_1_7 */ | 36 | #define BABBAGE_USB_HUB_RESET (0*32 + 7) /* GPIO_1_7 */ |
37 | #define BABBAGE_USBH1_STP (0*32 + 27) /* GPIO_1_27 */ | 37 | #define BABBAGE_USBH1_STP (0*32 + 27) /* GPIO_1_27 */ |
38 | #define BABBAGE_PHY_RESET (1*32 +5) /* GPIO_2_5 */ | 38 | #define BABBAGE_PHY_RESET (1*32 + 5) /* GPIO_2_5 */ |
39 | #define BABBAGE_FEC_PHY_RESET (1*32 + 14) /* GPIO_2_14 */ | ||
39 | 40 | ||
40 | /* USB_CTRL_1 */ | 41 | /* USB_CTRL_1 */ |
41 | #define MX51_USB_CTRL_1_OFFSET 0x10 | 42 | #define MX51_USB_CTRL_1_OFFSET 0x10 |
@@ -45,10 +46,6 @@ | |||
45 | #define MX51_USB_PLL_DIV_19_2_MHZ 0x01 | 46 | #define MX51_USB_PLL_DIV_19_2_MHZ 0x01 |
46 | #define MX51_USB_PLL_DIV_24_MHZ 0x02 | 47 | #define MX51_USB_PLL_DIV_24_MHZ 0x02 |
47 | 48 | ||
48 | static struct platform_device *devices[] __initdata = { | ||
49 | &mxc_fec_device, | ||
50 | }; | ||
51 | |||
52 | static struct pad_desc mx51babbage_pads[] = { | 49 | static struct pad_desc mx51babbage_pads[] = { |
53 | /* UART1 */ | 50 | /* UART1 */ |
54 | MX51_PAD_UART1_RXD__UART1_RXD, | 51 | MX51_PAD_UART1_RXD__UART1_RXD, |
@@ -93,19 +90,41 @@ static struct pad_desc mx51babbage_pads[] = { | |||
93 | 90 | ||
94 | /* USB HUB reset line*/ | 91 | /* USB HUB reset line*/ |
95 | MX51_PAD_GPIO_1_7__GPIO_1_7, | 92 | MX51_PAD_GPIO_1_7__GPIO_1_7, |
93 | |||
94 | /* FEC */ | ||
95 | MX51_PAD_EIM_EB2__FEC_MDIO, | ||
96 | MX51_PAD_EIM_EB3__FEC_RDAT1, | ||
97 | MX51_PAD_EIM_CS2__FEC_RDAT2, | ||
98 | MX51_PAD_EIM_CS3__FEC_RDAT3, | ||
99 | MX51_PAD_EIM_CS4__FEC_RX_ER, | ||
100 | MX51_PAD_EIM_CS5__FEC_CRS, | ||
101 | MX51_PAD_NANDF_RB2__FEC_COL, | ||
102 | MX51_PAD_NANDF_RB3__FEC_RXCLK, | ||
103 | MX51_PAD_NANDF_RB6__FEC_RDAT0, | ||
104 | MX51_PAD_NANDF_RB7__FEC_TDAT0, | ||
105 | MX51_PAD_NANDF_CS2__FEC_TX_ER, | ||
106 | MX51_PAD_NANDF_CS3__FEC_MDC, | ||
107 | MX51_PAD_NANDF_CS4__FEC_TDAT1, | ||
108 | MX51_PAD_NANDF_CS5__FEC_TDAT2, | ||
109 | MX51_PAD_NANDF_CS6__FEC_TDAT3, | ||
110 | MX51_PAD_NANDF_CS7__FEC_TX_EN, | ||
111 | MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK, | ||
112 | |||
113 | /* FEC PHY reset line */ | ||
114 | MX51_PAD_EIM_A20__GPIO_2_14, | ||
96 | }; | 115 | }; |
97 | 116 | ||
98 | /* Serial ports */ | 117 | /* Serial ports */ |
99 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) | 118 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) |
100 | static struct imxuart_platform_data uart_pdata = { | 119 | static const struct imxuart_platform_data uart_pdata __initconst = { |
101 | .flags = IMXUART_HAVE_RTSCTS, | 120 | .flags = IMXUART_HAVE_RTSCTS, |
102 | }; | 121 | }; |
103 | 122 | ||
104 | static inline void mxc_init_imx_uart(void) | 123 | static inline void mxc_init_imx_uart(void) |
105 | { | 124 | { |
106 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 125 | imx51_add_imx_uart(0, &uart_pdata); |
107 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 126 | imx51_add_imx_uart(1, &uart_pdata); |
108 | mxc_register_device(&mxc_uart_device2, &uart_pdata); | 127 | imx51_add_imx_uart(2, &uart_pdata); |
109 | } | 128 | } |
110 | #else /* !SERIAL_IMX */ | 129 | #else /* !SERIAL_IMX */ |
111 | static inline void mxc_init_imx_uart(void) | 130 | static inline void mxc_init_imx_uart(void) |
@@ -113,7 +132,7 @@ static inline void mxc_init_imx_uart(void) | |||
113 | } | 132 | } |
114 | #endif /* SERIAL_IMX */ | 133 | #endif /* SERIAL_IMX */ |
115 | 134 | ||
116 | static struct imxi2c_platform_data babbage_i2c_data = { | 135 | static const struct imxi2c_platform_data babbage_i2c_data __initconst = { |
117 | .bitrate = 100000, | 136 | .bitrate = 100000, |
118 | }; | 137 | }; |
119 | 138 | ||
@@ -171,6 +190,22 @@ static inline void babbage_usbhub_reset(void) | |||
171 | gpio_set_value(BABBAGE_USB_HUB_RESET, 1); | 190 | gpio_set_value(BABBAGE_USB_HUB_RESET, 1); |
172 | } | 191 | } |
173 | 192 | ||
193 | static inline void babbage_fec_reset(void) | ||
194 | { | ||
195 | int ret; | ||
196 | |||
197 | /* reset FEC PHY */ | ||
198 | ret = gpio_request(BABBAGE_FEC_PHY_RESET, "fec-phy-reset"); | ||
199 | if (ret) { | ||
200 | printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); | ||
201 | return; | ||
202 | } | ||
203 | gpio_direction_output(BABBAGE_FEC_PHY_RESET, 0); | ||
204 | gpio_set_value(BABBAGE_FEC_PHY_RESET, 0); | ||
205 | msleep(1); | ||
206 | gpio_set_value(BABBAGE_FEC_PHY_RESET, 1); | ||
207 | } | ||
208 | |||
174 | /* This function is board specific as the bit mask for the plldiv will also | 209 | /* This function is board specific as the bit mask for the plldiv will also |
175 | be different for other Freescale SoCs, thus a common bitmask is not | 210 | be different for other Freescale SoCs, thus a common bitmask is not |
176 | possible and cannot get place in /plat-mxc/ehci.c.*/ | 211 | possible and cannot get place in /plat-mxc/ehci.c.*/ |
@@ -178,7 +213,7 @@ static int initialize_otg_port(struct platform_device *pdev) | |||
178 | { | 213 | { |
179 | u32 v; | 214 | u32 v; |
180 | void __iomem *usb_base; | 215 | void __iomem *usb_base; |
181 | u32 usbother_base; | 216 | void __iomem *usbother_base; |
182 | 217 | ||
183 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 218 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
184 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; | 219 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; |
@@ -196,7 +231,7 @@ static int initialize_usbh1_port(struct platform_device *pdev) | |||
196 | { | 231 | { |
197 | u32 v; | 232 | u32 v; |
198 | void __iomem *usb_base; | 233 | void __iomem *usb_base; |
199 | u32 usbother_base; | 234 | void __iomem *usbother_base; |
200 | 235 | ||
201 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 236 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
202 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; | 237 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; |
@@ -250,10 +285,11 @@ static void __init mxc_board_init(void) | |||
250 | mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads, | 285 | mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads, |
251 | ARRAY_SIZE(mx51babbage_pads)); | 286 | ARRAY_SIZE(mx51babbage_pads)); |
252 | mxc_init_imx_uart(); | 287 | mxc_init_imx_uart(); |
253 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 288 | babbage_fec_reset(); |
289 | imx51_add_fec(NULL); | ||
254 | 290 | ||
255 | mxc_register_device(&mxc_i2c_device0, &babbage_i2c_data); | 291 | imx51_add_imx_i2c(0, &babbage_i2c_data); |
256 | mxc_register_device(&mxc_i2c_device1, &babbage_i2c_data); | 292 | imx51_add_imx_i2c(1, &babbage_i2c_data); |
257 | mxc_register_device(&mxc_hsi2c_device, &babbage_hsi2c_data); | 293 | mxc_register_device(&mxc_hsi2c_device, &babbage_hsi2c_data); |
258 | 294 | ||
259 | if (otg_mode_host) | 295 | if (otg_mode_host) |
@@ -283,7 +319,7 @@ MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board") | |||
283 | /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */ | 319 | /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */ |
284 | .phys_io = MX51_AIPS1_BASE_ADDR, | 320 | .phys_io = MX51_AIPS1_BASE_ADDR, |
285 | .io_pg_offst = ((MX51_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, | 321 | .io_pg_offst = ((MX51_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, |
286 | .boot_params = PHYS_OFFSET + 0x100, | 322 | .boot_params = MX51_PHYS_OFFSET + 0x100, |
287 | .map_io = mx51_map_io, | 323 | .map_io = mx51_map_io, |
288 | .init_irq = mx51_init_irq, | 324 | .init_irq = mx51_init_irq, |
289 | .init_machine = mxc_board_init, | 325 | .init_machine = mxc_board_init, |
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c new file mode 100644 index 000000000000..b00502acdc15 --- /dev/null +++ b/arch/arm/mach-mx5/board-mx51_efikamx.c | |||
@@ -0,0 +1,121 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Linaro Limited | ||
3 | * | ||
4 | * based on code from the following | ||
5 | * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
6 | * Copyright 2009-2010 Pegatron Corporation. All Rights Reserved. | ||
7 | * Copyright 2009-2010 Genesi USA, Inc. All Rights Reserved. | ||
8 | * | ||
9 | * The code contained herein is licensed under the GNU General Public | ||
10 | * License. You may obtain a copy of the GNU General Public License | ||
11 | * Version 2 or later at the following locations: | ||
12 | * | ||
13 | * http://www.opensource.org/licenses/gpl-license.html | ||
14 | * http://www.gnu.org/copyleft/gpl.html | ||
15 | */ | ||
16 | |||
17 | #include <linux/init.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | #include <linux/i2c.h> | ||
20 | #include <linux/gpio.h> | ||
21 | #include <linux/delay.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/fsl_devices.h> | ||
24 | |||
25 | #include <mach/common.h> | ||
26 | #include <mach/hardware.h> | ||
27 | #include <mach/iomux-mx51.h> | ||
28 | #include <mach/i2c.h> | ||
29 | #include <mach/mxc_ehci.h> | ||
30 | |||
31 | #include <asm/irq.h> | ||
32 | #include <asm/setup.h> | ||
33 | #include <asm/mach-types.h> | ||
34 | #include <asm/mach/arch.h> | ||
35 | #include <asm/mach/time.h> | ||
36 | |||
37 | #include "devices-imx51.h" | ||
38 | #include "devices.h" | ||
39 | |||
40 | #define MX51_USB_PLL_DIV_24_MHZ 0x01 | ||
41 | |||
42 | static struct pad_desc mx51efikamx_pads[] = { | ||
43 | /* UART1 */ | ||
44 | MX51_PAD_UART1_RXD__UART1_RXD, | ||
45 | MX51_PAD_UART1_TXD__UART1_TXD, | ||
46 | MX51_PAD_UART1_RTS__UART1_RTS, | ||
47 | MX51_PAD_UART1_CTS__UART1_CTS, | ||
48 | }; | ||
49 | |||
50 | /* Serial ports */ | ||
51 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) | ||
52 | static const struct imxuart_platform_data uart_pdata = { | ||
53 | .flags = IMXUART_HAVE_RTSCTS, | ||
54 | }; | ||
55 | |||
56 | static inline void mxc_init_imx_uart(void) | ||
57 | { | ||
58 | imx51_add_imx_uart(0, &uart_pdata); | ||
59 | imx51_add_imx_uart(1, &uart_pdata); | ||
60 | imx51_add_imx_uart(2, &uart_pdata); | ||
61 | } | ||
62 | #else /* !SERIAL_IMX */ | ||
63 | static inline void mxc_init_imx_uart(void) | ||
64 | { | ||
65 | } | ||
66 | #endif /* SERIAL_IMX */ | ||
67 | |||
68 | /* This function is board specific as the bit mask for the plldiv will also | ||
69 | * be different for other Freescale SoCs, thus a common bitmask is not | ||
70 | * possible and cannot get place in /plat-mxc/ehci.c. | ||
71 | */ | ||
72 | static int initialize_otg_port(struct platform_device *pdev) | ||
73 | { | ||
74 | u32 v; | ||
75 | void __iomem *usb_base; | ||
76 | void __iomem *usbother_base; | ||
77 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | ||
78 | usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET); | ||
79 | |||
80 | /* Set the PHY clock to 19.2MHz */ | ||
81 | v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); | ||
82 | v &= ~MX5_USB_UTMI_PHYCTRL1_PLLDIV_MASK; | ||
83 | v |= MX51_USB_PLL_DIV_24_MHZ; | ||
84 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); | ||
85 | iounmap(usb_base); | ||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | static struct mxc_usbh_platform_data dr_utmi_config = { | ||
90 | .init = initialize_otg_port, | ||
91 | .portsc = MXC_EHCI_UTMI_16BIT, | ||
92 | .flags = MXC_EHCI_INTERNAL_PHY, | ||
93 | }; | ||
94 | |||
95 | static void __init mxc_board_init(void) | ||
96 | { | ||
97 | mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, | ||
98 | ARRAY_SIZE(mx51efikamx_pads)); | ||
99 | mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config); | ||
100 | mxc_init_imx_uart(); | ||
101 | } | ||
102 | |||
103 | static void __init mx51_efikamx_timer_init(void) | ||
104 | { | ||
105 | mx51_clocks_init(32768, 24000000, 22579200, 24576000); | ||
106 | } | ||
107 | |||
108 | static struct sys_timer mxc_timer = { | ||
109 | .init = mx51_efikamx_timer_init, | ||
110 | }; | ||
111 | |||
112 | MACHINE_START(MX51_EFIKAMX, "Genesi EfikaMX nettop") | ||
113 | /* Maintainer: Amit Kucheria <amit.kucheria@linaro.org> */ | ||
114 | .phys_io = MX51_AIPS1_BASE_ADDR, | ||
115 | .io_pg_offst = ((MX51_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, | ||
116 | .boot_params = MX51_PHYS_OFFSET + 0x100, | ||
117 | .map_io = mx51_map_io, | ||
118 | .init_irq = mx51_init_irq, | ||
119 | .init_machine = mxc_board_init, | ||
120 | .timer = &mxc_timer, | ||
121 | MACHINE_END | ||
diff --git a/arch/arm/mach-mx5/clock-mx51.c b/arch/arm/mach-mx5/clock-mx51.c index 57c10a9926cc..21cecc040172 100644 --- a/arch/arm/mach-mx5/clock-mx51.c +++ b/arch/arm/mach-mx5/clock-mx51.c | |||
@@ -41,34 +41,36 @@ static struct clk usboh3_clk; | |||
41 | 41 | ||
42 | #define MAX_DPLL_WAIT_TRIES 1000 /* 1000 * udelay(1) = 1ms */ | 42 | #define MAX_DPLL_WAIT_TRIES 1000 /* 1000 * udelay(1) = 1ms */ |
43 | 43 | ||
44 | static int _clk_ccgr_enable(struct clk *clk) | 44 | static void _clk_ccgr_setclk(struct clk *clk, unsigned mode) |
45 | { | 45 | { |
46 | u32 reg; | 46 | u32 reg = __raw_readl(clk->enable_reg); |
47 | |||
48 | reg &= ~(MXC_CCM_CCGRx_CG_MASK << clk->enable_shift); | ||
49 | reg |= mode << clk->enable_shift; | ||
47 | 50 | ||
48 | reg = __raw_readl(clk->enable_reg); | ||
49 | reg |= MXC_CCM_CCGRx_MOD_ON << clk->enable_shift; | ||
50 | __raw_writel(reg, clk->enable_reg); | 51 | __raw_writel(reg, clk->enable_reg); |
52 | } | ||
51 | 53 | ||
54 | static int _clk_ccgr_enable(struct clk *clk) | ||
55 | { | ||
56 | _clk_ccgr_setclk(clk, MXC_CCM_CCGRx_MOD_ON); | ||
52 | return 0; | 57 | return 0; |
53 | } | 58 | } |
54 | 59 | ||
55 | static void _clk_ccgr_disable(struct clk *clk) | 60 | static void _clk_ccgr_disable(struct clk *clk) |
56 | { | 61 | { |
57 | u32 reg; | 62 | _clk_ccgr_setclk(clk, MXC_CCM_CCGRx_MOD_OFF); |
58 | reg = __raw_readl(clk->enable_reg); | 63 | } |
59 | reg &= ~(MXC_CCM_CCGRx_CG_MASK << clk->enable_shift); | ||
60 | __raw_writel(reg, clk->enable_reg); | ||
61 | 64 | ||
65 | static int _clk_ccgr_enable_inrun(struct clk *clk) | ||
66 | { | ||
67 | _clk_ccgr_setclk(clk, MXC_CCM_CCGRx_MOD_IDLE); | ||
68 | return 0; | ||
62 | } | 69 | } |
63 | 70 | ||
64 | static void _clk_ccgr_disable_inwait(struct clk *clk) | 71 | static void _clk_ccgr_disable_inwait(struct clk *clk) |
65 | { | 72 | { |
66 | u32 reg; | 73 | _clk_ccgr_setclk(clk, MXC_CCM_CCGRx_MOD_IDLE); |
67 | |||
68 | reg = __raw_readl(clk->enable_reg); | ||
69 | reg &= ~(MXC_CCM_CCGRx_CG_MASK << clk->enable_shift); | ||
70 | reg |= MXC_CCM_CCGRx_MOD_IDLE << clk->enable_shift; | ||
71 | __raw_writel(reg, clk->enable_reg); | ||
72 | } | 74 | } |
73 | 75 | ||
74 | /* | 76 | /* |
@@ -571,6 +573,64 @@ static int _clk_uart_set_parent(struct clk *clk, struct clk *parent) | |||
571 | return 0; | 573 | return 0; |
572 | } | 574 | } |
573 | 575 | ||
576 | #define clk_nfc_set_parent NULL | ||
577 | |||
578 | static unsigned long clk_nfc_get_rate(struct clk *clk) | ||
579 | { | ||
580 | unsigned long rate; | ||
581 | u32 reg, div; | ||
582 | |||
583 | reg = __raw_readl(MXC_CCM_CBCDR); | ||
584 | div = ((reg & MXC_CCM_CBCDR_NFC_PODF_MASK) >> | ||
585 | MXC_CCM_CBCDR_NFC_PODF_OFFSET) + 1; | ||
586 | rate = clk_get_rate(clk->parent) / div; | ||
587 | WARN_ON(rate == 0); | ||
588 | return rate; | ||
589 | } | ||
590 | |||
591 | static unsigned long clk_nfc_round_rate(struct clk *clk, | ||
592 | unsigned long rate) | ||
593 | { | ||
594 | u32 div; | ||
595 | unsigned long parent_rate = clk_get_rate(clk->parent); | ||
596 | |||
597 | if (!rate) | ||
598 | return -EINVAL; | ||
599 | |||
600 | div = parent_rate / rate; | ||
601 | |||
602 | if (parent_rate % rate) | ||
603 | div++; | ||
604 | |||
605 | if (div > 8) | ||
606 | return -EINVAL; | ||
607 | |||
608 | return parent_rate / div; | ||
609 | |||
610 | } | ||
611 | |||
612 | static int clk_nfc_set_rate(struct clk *clk, unsigned long rate) | ||
613 | { | ||
614 | u32 reg, div; | ||
615 | |||
616 | div = clk_get_rate(clk->parent) / rate; | ||
617 | if (div == 0) | ||
618 | div++; | ||
619 | if (((clk_get_rate(clk->parent) / div) != rate) || (div > 8)) | ||
620 | return -EINVAL; | ||
621 | |||
622 | reg = __raw_readl(MXC_CCM_CBCDR); | ||
623 | reg &= ~MXC_CCM_CBCDR_NFC_PODF_MASK; | ||
624 | reg |= (div - 1) << MXC_CCM_CBCDR_NFC_PODF_OFFSET; | ||
625 | __raw_writel(reg, MXC_CCM_CBCDR); | ||
626 | |||
627 | while (__raw_readl(MXC_CCM_CDHIPR) & | ||
628 | MXC_CCM_CDHIPR_NFC_IPG_INT_MEM_PODF_BUSY){ | ||
629 | } | ||
630 | |||
631 | return 0; | ||
632 | } | ||
633 | |||
574 | static unsigned long clk_usboh3_get_rate(struct clk *clk) | 634 | static unsigned long clk_usboh3_get_rate(struct clk *clk) |
575 | { | 635 | { |
576 | u32 reg, prediv, podf; | 636 | u32 reg, prediv, podf; |
@@ -620,6 +680,17 @@ static unsigned long get_ckih2_reference_clock_rate(struct clk *clk) | |||
620 | return ckih2_reference; | 680 | return ckih2_reference; |
621 | } | 681 | } |
622 | 682 | ||
683 | static unsigned long clk_emi_slow_get_rate(struct clk *clk) | ||
684 | { | ||
685 | u32 reg, div; | ||
686 | |||
687 | reg = __raw_readl(MXC_CCM_CBCDR); | ||
688 | div = ((reg & MXC_CCM_CBCDR_EMI_PODF_MASK) >> | ||
689 | MXC_CCM_CBCDR_EMI_PODF_OFFSET) + 1; | ||
690 | |||
691 | return clk_get_rate(clk->parent) / div; | ||
692 | } | ||
693 | |||
623 | /* External high frequency clock */ | 694 | /* External high frequency clock */ |
624 | static struct clk ckih_clk = { | 695 | static struct clk ckih_clk = { |
625 | .get_rate = get_high_reference_clock_rate, | 696 | .get_rate = get_high_reference_clock_rate, |
@@ -762,45 +833,105 @@ static struct clk kpp_clk = { | |||
762 | .id = 0, | 833 | .id = 0, |
763 | }; | 834 | }; |
764 | 835 | ||
765 | #define DEFINE_CLOCK(name, i, er, es, gr, sr, p, s) \ | 836 | static struct clk emi_slow_clk = { |
837 | .parent = &pll2_sw_clk, | ||
838 | .enable_reg = MXC_CCM_CCGR5, | ||
839 | .enable_shift = MXC_CCM_CCGRx_CG8_OFFSET, | ||
840 | .enable = _clk_ccgr_enable, | ||
841 | .disable = _clk_ccgr_disable_inwait, | ||
842 | .get_rate = clk_emi_slow_get_rate, | ||
843 | }; | ||
844 | |||
845 | #define DEFINE_CLOCK1(name, i, er, es, pfx, p, s) \ | ||
766 | static struct clk name = { \ | 846 | static struct clk name = { \ |
767 | .id = i, \ | 847 | .id = i, \ |
768 | .enable_reg = er, \ | 848 | .enable_reg = er, \ |
769 | .enable_shift = es, \ | 849 | .enable_shift = es, \ |
770 | .get_rate = gr, \ | 850 | .get_rate = pfx##_get_rate, \ |
771 | .set_rate = sr, \ | 851 | .set_rate = pfx##_set_rate, \ |
852 | .round_rate = pfx##_round_rate, \ | ||
853 | .set_parent = pfx##_set_parent, \ | ||
772 | .enable = _clk_ccgr_enable, \ | 854 | .enable = _clk_ccgr_enable, \ |
773 | .disable = _clk_ccgr_disable, \ | 855 | .disable = _clk_ccgr_disable, \ |
774 | .parent = p, \ | 856 | .parent = p, \ |
775 | .secondary = s, \ | 857 | .secondary = s, \ |
776 | } | 858 | } |
777 | 859 | ||
778 | /* DEFINE_CLOCK(name, id, enable_reg, enable_shift, | 860 | /* eCSPI */ |
779 | get_rate, set_rate, parent, secondary); */ | 861 | static unsigned long clk_ecspi_get_rate(struct clk *clk) |
862 | { | ||
863 | u32 reg, pred, podf; | ||
864 | |||
865 | reg = __raw_readl(MXC_CCM_CSCDR2); | ||
866 | |||
867 | pred = (reg & MXC_CCM_CSCDR2_CSPI_CLK_PRED_MASK) >> | ||
868 | MXC_CCM_CSCDR2_CSPI_CLK_PRED_OFFSET; | ||
869 | podf = (reg & MXC_CCM_CSCDR2_CSPI_CLK_PODF_MASK) >> | ||
870 | MXC_CCM_CSCDR2_CSPI_CLK_PODF_OFFSET; | ||
871 | |||
872 | return DIV_ROUND_CLOSEST(clk_get_rate(clk->parent), | ||
873 | (pred + 1) * (podf + 1)); | ||
874 | } | ||
875 | |||
876 | static int clk_ecspi_set_parent(struct clk *clk, struct clk *parent) | ||
877 | { | ||
878 | u32 reg, mux; | ||
879 | |||
880 | mux = _get_mux(parent, &pll1_sw_clk, &pll2_sw_clk, &pll3_sw_clk, | ||
881 | &lp_apm_clk); | ||
882 | |||
883 | reg = __raw_readl(MXC_CCM_CSCMR1) & ~MXC_CCM_CSCMR1_CSPI_CLK_SEL_MASK; | ||
884 | reg |= mux << MXC_CCM_CSCMR1_CSPI_CLK_SEL_OFFSET; | ||
885 | __raw_writel(reg, MXC_CCM_CSCMR1); | ||
886 | |||
887 | return 0; | ||
888 | } | ||
889 | |||
890 | static struct clk ecspi_main_clk = { | ||
891 | .parent = &pll3_sw_clk, | ||
892 | .get_rate = clk_ecspi_get_rate, | ||
893 | .set_parent = clk_ecspi_set_parent, | ||
894 | }; | ||
895 | |||
896 | #define DEFINE_CLOCK_FULL(name, i, er, es, gr, sr, e, d, p, s) \ | ||
897 | static struct clk name = { \ | ||
898 | .id = i, \ | ||
899 | .enable_reg = er, \ | ||
900 | .enable_shift = es, \ | ||
901 | .get_rate = gr, \ | ||
902 | .set_rate = sr, \ | ||
903 | .enable = e, \ | ||
904 | .disable = d, \ | ||
905 | .parent = p, \ | ||
906 | .secondary = s, \ | ||
907 | } | ||
908 | |||
909 | #define DEFINE_CLOCK(name, i, er, es, gr, sr, p, s) \ | ||
910 | DEFINE_CLOCK_FULL(name, i, er, es, gr, sr, _clk_ccgr_enable, _clk_ccgr_disable, p, s) | ||
780 | 911 | ||
781 | /* Shared peripheral bus arbiter */ | 912 | /* Shared peripheral bus arbiter */ |
782 | DEFINE_CLOCK(spba_clk, 0, MXC_CCM_CCGR5, MXC_CCM_CCGRx_CG0_OFFSET, | 913 | DEFINE_CLOCK(spba_clk, 0, MXC_CCM_CCGR5, MXC_CCM_CCGRx_CG0_OFFSET, |
783 | NULL, NULL, &ipg_clk, NULL); | 914 | NULL, NULL, &ipg_clk, NULL); |
784 | 915 | ||
785 | /* UART */ | 916 | /* UART */ |
786 | DEFINE_CLOCK(uart1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG4_OFFSET, | ||
787 | NULL, NULL, &uart_root_clk, NULL); | ||
788 | DEFINE_CLOCK(uart2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG6_OFFSET, | ||
789 | NULL, NULL, &uart_root_clk, NULL); | ||
790 | DEFINE_CLOCK(uart3_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG8_OFFSET, | ||
791 | NULL, NULL, &uart_root_clk, NULL); | ||
792 | DEFINE_CLOCK(uart1_ipg_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG3_OFFSET, | 917 | DEFINE_CLOCK(uart1_ipg_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG3_OFFSET, |
793 | NULL, NULL, &ipg_clk, &aips_tz1_clk); | 918 | NULL, NULL, &ipg_clk, &aips_tz1_clk); |
794 | DEFINE_CLOCK(uart2_ipg_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG5_OFFSET, | 919 | DEFINE_CLOCK(uart2_ipg_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG5_OFFSET, |
795 | NULL, NULL, &ipg_clk, &aips_tz1_clk); | 920 | NULL, NULL, &ipg_clk, &aips_tz1_clk); |
796 | DEFINE_CLOCK(uart3_ipg_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG7_OFFSET, | 921 | DEFINE_CLOCK(uart3_ipg_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG7_OFFSET, |
797 | NULL, NULL, &ipg_clk, &spba_clk); | 922 | NULL, NULL, &ipg_clk, &spba_clk); |
923 | DEFINE_CLOCK(uart1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG4_OFFSET, | ||
924 | NULL, NULL, &uart_root_clk, &uart1_ipg_clk); | ||
925 | DEFINE_CLOCK(uart2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG6_OFFSET, | ||
926 | NULL, NULL, &uart_root_clk, &uart2_ipg_clk); | ||
927 | DEFINE_CLOCK(uart3_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG8_OFFSET, | ||
928 | NULL, NULL, &uart_root_clk, &uart3_ipg_clk); | ||
798 | 929 | ||
799 | /* GPT */ | 930 | /* GPT */ |
800 | DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET, | ||
801 | NULL, NULL, &ipg_clk, NULL); | ||
802 | DEFINE_CLOCK(gpt_ipg_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG10_OFFSET, | 931 | DEFINE_CLOCK(gpt_ipg_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG10_OFFSET, |
803 | NULL, NULL, &ipg_clk, NULL); | 932 | NULL, NULL, &ipg_clk, NULL); |
933 | DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET, | ||
934 | NULL, NULL, &ipg_clk, &gpt_ipg_clk); | ||
804 | 935 | ||
805 | /* I2C */ | 936 | /* I2C */ |
806 | DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET, | 937 | DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET, |
@@ -814,6 +945,42 @@ DEFINE_CLOCK(hsi2c_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET, | |||
814 | DEFINE_CLOCK(fec_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG12_OFFSET, | 945 | DEFINE_CLOCK(fec_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG12_OFFSET, |
815 | NULL, NULL, &ipg_clk, NULL); | 946 | NULL, NULL, &ipg_clk, NULL); |
816 | 947 | ||
948 | /* NFC */ | ||
949 | DEFINE_CLOCK1(nfc_clk, 0, MXC_CCM_CCGR5, MXC_CCM_CCGRx_CG10_OFFSET, | ||
950 | clk_nfc, &emi_slow_clk, NULL); | ||
951 | |||
952 | /* SSI */ | ||
953 | DEFINE_CLOCK(ssi1_ipg_clk, 0, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG8_OFFSET, | ||
954 | NULL, NULL, &ipg_clk, NULL); | ||
955 | DEFINE_CLOCK(ssi1_clk, 0, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG9_OFFSET, | ||
956 | NULL, NULL, &pll3_sw_clk, &ssi1_ipg_clk); | ||
957 | DEFINE_CLOCK(ssi2_ipg_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG10_OFFSET, | ||
958 | NULL, NULL, &ipg_clk, NULL); | ||
959 | DEFINE_CLOCK(ssi2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG11_OFFSET, | ||
960 | NULL, NULL, &pll3_sw_clk, &ssi2_ipg_clk); | ||
961 | |||
962 | /* eCSPI */ | ||
963 | DEFINE_CLOCK_FULL(ecspi1_ipg_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG9_OFFSET, | ||
964 | NULL, NULL, _clk_ccgr_enable_inrun, _clk_ccgr_disable, | ||
965 | &ipg_clk, &spba_clk); | ||
966 | DEFINE_CLOCK(ecspi1_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG10_OFFSET, | ||
967 | NULL, NULL, &ecspi_main_clk, &ecspi1_ipg_clk); | ||
968 | DEFINE_CLOCK_FULL(ecspi2_ipg_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG11_OFFSET, | ||
969 | NULL, NULL, _clk_ccgr_enable_inrun, _clk_ccgr_disable, | ||
970 | &ipg_clk, &aips_tz2_clk); | ||
971 | DEFINE_CLOCK(ecspi2_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG12_OFFSET, | ||
972 | NULL, NULL, &ecspi_main_clk, &ecspi2_ipg_clk); | ||
973 | |||
974 | /* CSPI */ | ||
975 | DEFINE_CLOCK(cspi_ipg_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG9_OFFSET, | ||
976 | NULL, NULL, &ipg_clk, &aips_tz2_clk); | ||
977 | DEFINE_CLOCK(cspi_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG13_OFFSET, | ||
978 | NULL, NULL, &ipg_clk, &cspi_ipg_clk); | ||
979 | |||
980 | /* SDMA */ | ||
981 | DEFINE_CLOCK(sdma_clk, 1, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG15_OFFSET, | ||
982 | NULL, NULL, &ahb_clk, NULL); | ||
983 | |||
817 | #define _REGISTER_CLOCK(d, n, c) \ | 984 | #define _REGISTER_CLOCK(d, n, c) \ |
818 | { \ | 985 | { \ |
819 | .dev_id = d, \ | 986 | .dev_id = d, \ |
@@ -837,6 +1004,16 @@ static struct clk_lookup lookups[] = { | |||
837 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk) | 1004 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk) |
838 | _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk) | 1005 | _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk) |
839 | _REGISTER_CLOCK("imx-keypad.0", NULL, kpp_clk) | 1006 | _REGISTER_CLOCK("imx-keypad.0", NULL, kpp_clk) |
1007 | _REGISTER_CLOCK("mxc_nand", NULL, nfc_clk) | ||
1008 | _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) | ||
1009 | _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) | ||
1010 | _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) | ||
1011 | _REGISTER_CLOCK(NULL, "ckih", ckih_clk) | ||
1012 | _REGISTER_CLOCK(NULL, "ckih2", ckih2_clk) | ||
1013 | _REGISTER_CLOCK(NULL, "gpt_32k", gpt_32k_clk) | ||
1014 | _REGISTER_CLOCK("imx51-ecspi.0", NULL, ecspi1_clk) | ||
1015 | _REGISTER_CLOCK("imx51-ecspi.1", NULL, ecspi2_clk) | ||
1016 | _REGISTER_CLOCK("imx51-cspi.0", NULL, cspi_clk) | ||
840 | }; | 1017 | }; |
841 | 1018 | ||
842 | static void clk_tree_init(void) | 1019 | static void clk_tree_init(void) |
diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c index 2d37785e3857..eaacb6e9b5d0 100644 --- a/arch/arm/mach-mx5/cpu.c +++ b/arch/arm/mach-mx5/cpu.c | |||
@@ -70,6 +70,25 @@ int mx51_revision(void) | |||
70 | } | 70 | } |
71 | EXPORT_SYMBOL(mx51_revision); | 71 | EXPORT_SYMBOL(mx51_revision); |
72 | 72 | ||
73 | #ifdef CONFIG_NEON | ||
74 | |||
75 | /* | ||
76 | * All versions of the silicon before Rev. 3 have broken NEON implementations. | ||
77 | * Dependent on link order - so the assumption is that vfp_init is called | ||
78 | * before us. | ||
79 | */ | ||
80 | static int __init mx51_neon_fixup(void) | ||
81 | { | ||
82 | if (mx51_revision() < MX51_CHIP_REV_3_0 && (elf_hwcap & HWCAP_NEON)) { | ||
83 | elf_hwcap &= ~HWCAP_NEON; | ||
84 | pr_info("Turning off NEON support, detected broken NEON implementation\n"); | ||
85 | } | ||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | late_initcall(mx51_neon_fixup); | ||
90 | #endif | ||
91 | |||
73 | static int __init post_cpu_init(void) | 92 | static int __init post_cpu_init(void) |
74 | { | 93 | { |
75 | unsigned int reg; | 94 | unsigned int reg; |
diff --git a/arch/arm/mach-mx5/devices-imx51.h b/arch/arm/mach-mx5/devices-imx51.h new file mode 100644 index 000000000000..c233379256b8 --- /dev/null +++ b/arch/arm/mach-mx5/devices-imx51.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/mx51.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | extern const struct imx_fec_data imx51_fec_data __initconst; | ||
13 | #define imx51_add_fec(pdata) \ | ||
14 | imx_add_fec(&imx51_fec_data, pdata) | ||
15 | |||
16 | extern const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst; | ||
17 | #define imx51_add_imx_i2c(id, pdata) \ | ||
18 | imx_add_imx_i2c(&imx51_imx_i2c_data[id], pdata) | ||
19 | |||
20 | extern const struct imx_imx_ssi_data imx51_imx_ssi_data[] __initconst; | ||
21 | #define imx51_add_imx_ssi(id, pdata) \ | ||
22 | imx_add_imx_ssi(&imx51_imx_ssi_data[id], pdata) | ||
23 | |||
24 | extern const struct imx_imx_uart_1irq_data imx51_imx_uart_data[] __initconst; | ||
25 | #define imx51_add_imx_uart(id, pdata) \ | ||
26 | imx_add_imx_uart_1irq(&imx51_imx_uart_data[id], pdata) | ||
27 | |||
28 | extern const struct imx_mxc_nand_data imx51_mxc_nand_data __initconst; | ||
29 | #define imx51_add_mxc_nand(pdata) \ | ||
30 | imx_add_mxc_nand(&imx51_mxc_nand_data, pdata) | ||
31 | |||
32 | extern const struct imx_spi_imx_data imx51_cspi_data __initconst; | ||
33 | #define imx51_add_cspi(pdata) \ | ||
34 | imx_add_spi_imx(&imx51_cspi_data, pdata) | ||
35 | |||
36 | extern const struct imx_spi_imx_data imx51_ecspi_data[] __initconst; | ||
37 | #define imx51_add_ecspi(id, pdata) \ | ||
38 | imx_add_spi_imx(&imx51_ecspi_data[id], pdata) | ||
diff --git a/arch/arm/mach-mx5/devices.c b/arch/arm/mach-mx5/devices.c index 1920ff4963b2..4c7be87a7c9d 100644 --- a/arch/arm/mach-mx5/devices.c +++ b/arch/arm/mach-mx5/devices.c | |||
@@ -17,120 +17,6 @@ | |||
17 | #include <mach/imx-uart.h> | 17 | #include <mach/imx-uart.h> |
18 | #include <mach/irqs.h> | 18 | #include <mach/irqs.h> |
19 | 19 | ||
20 | static struct resource uart0[] = { | ||
21 | { | ||
22 | .start = MX51_UART1_BASE_ADDR, | ||
23 | .end = MX51_UART1_BASE_ADDR + 0xfff, | ||
24 | .flags = IORESOURCE_MEM, | ||
25 | }, { | ||
26 | .start = MX51_MXC_INT_UART1, | ||
27 | .end = MX51_MXC_INT_UART1, | ||
28 | .flags = IORESOURCE_IRQ, | ||
29 | }, | ||
30 | }; | ||
31 | |||
32 | struct platform_device mxc_uart_device0 = { | ||
33 | .name = "imx-uart", | ||
34 | .id = 0, | ||
35 | .resource = uart0, | ||
36 | .num_resources = ARRAY_SIZE(uart0), | ||
37 | }; | ||
38 | |||
39 | static struct resource uart1[] = { | ||
40 | { | ||
41 | .start = MX51_UART2_BASE_ADDR, | ||
42 | .end = MX51_UART2_BASE_ADDR + 0xfff, | ||
43 | .flags = IORESOURCE_MEM, | ||
44 | }, { | ||
45 | .start = MX51_MXC_INT_UART2, | ||
46 | .end = MX51_MXC_INT_UART2, | ||
47 | .flags = IORESOURCE_IRQ, | ||
48 | }, | ||
49 | }; | ||
50 | |||
51 | struct platform_device mxc_uart_device1 = { | ||
52 | .name = "imx-uart", | ||
53 | .id = 1, | ||
54 | .resource = uart1, | ||
55 | .num_resources = ARRAY_SIZE(uart1), | ||
56 | }; | ||
57 | |||
58 | static struct resource uart2[] = { | ||
59 | { | ||
60 | .start = MX51_UART3_BASE_ADDR, | ||
61 | .end = MX51_UART3_BASE_ADDR + 0xfff, | ||
62 | .flags = IORESOURCE_MEM, | ||
63 | }, { | ||
64 | .start = MX51_MXC_INT_UART3, | ||
65 | .end = MX51_MXC_INT_UART3, | ||
66 | .flags = IORESOURCE_IRQ, | ||
67 | }, | ||
68 | }; | ||
69 | |||
70 | struct platform_device mxc_uart_device2 = { | ||
71 | .name = "imx-uart", | ||
72 | .id = 2, | ||
73 | .resource = uart2, | ||
74 | .num_resources = ARRAY_SIZE(uart2), | ||
75 | }; | ||
76 | |||
77 | static struct resource mxc_fec_resources[] = { | ||
78 | { | ||
79 | .start = MX51_MXC_FEC_BASE_ADDR, | ||
80 | .end = MX51_MXC_FEC_BASE_ADDR + 0xfff, | ||
81 | .flags = IORESOURCE_MEM, | ||
82 | }, { | ||
83 | .start = MX51_MXC_INT_FEC, | ||
84 | .end = MX51_MXC_INT_FEC, | ||
85 | .flags = IORESOURCE_IRQ, | ||
86 | }, | ||
87 | }; | ||
88 | |||
89 | struct platform_device mxc_fec_device = { | ||
90 | .name = "fec", | ||
91 | .id = 0, | ||
92 | .num_resources = ARRAY_SIZE(mxc_fec_resources), | ||
93 | .resource = mxc_fec_resources, | ||
94 | }; | ||
95 | |||
96 | static struct resource mxc_i2c0_resources[] = { | ||
97 | { | ||
98 | .start = MX51_I2C1_BASE_ADDR, | ||
99 | .end = MX51_I2C1_BASE_ADDR + SZ_4K - 1, | ||
100 | .flags = IORESOURCE_MEM, | ||
101 | }, { | ||
102 | .start = MX51_MXC_INT_I2C1, | ||
103 | .end = MX51_MXC_INT_I2C1, | ||
104 | .flags = IORESOURCE_IRQ, | ||
105 | }, | ||
106 | }; | ||
107 | |||
108 | struct platform_device mxc_i2c_device0 = { | ||
109 | .name = "imx-i2c", | ||
110 | .id = 0, | ||
111 | .num_resources = ARRAY_SIZE(mxc_i2c0_resources), | ||
112 | .resource = mxc_i2c0_resources, | ||
113 | }; | ||
114 | |||
115 | static struct resource mxc_i2c1_resources[] = { | ||
116 | { | ||
117 | .start = MX51_I2C2_BASE_ADDR, | ||
118 | .end = MX51_I2C2_BASE_ADDR + SZ_4K - 1, | ||
119 | .flags = IORESOURCE_MEM, | ||
120 | }, { | ||
121 | .start = MX51_MXC_INT_I2C2, | ||
122 | .end = MX51_MXC_INT_I2C2, | ||
123 | .flags = IORESOURCE_IRQ, | ||
124 | }, | ||
125 | }; | ||
126 | |||
127 | struct platform_device mxc_i2c_device1 = { | ||
128 | .name = "imx-i2c", | ||
129 | .id = 1, | ||
130 | .num_resources = ARRAY_SIZE(mxc_i2c1_resources), | ||
131 | .resource = mxc_i2c1_resources, | ||
132 | }; | ||
133 | |||
134 | static struct resource mxc_hsi2c_resources[] = { | 20 | static struct resource mxc_hsi2c_resources[] = { |
135 | { | 21 | { |
136 | .start = MX51_HSI2C_DMA_BASE_ADDR, | 22 | .start = MX51_HSI2C_DMA_BASE_ADDR, |
diff --git a/arch/arm/mach-mx5/devices.h b/arch/arm/mach-mx5/devices.h index e509cfaad1d4..af1d07c0bbc1 100644 --- a/arch/arm/mach-mx5/devices.h +++ b/arch/arm/mach-mx5/devices.h | |||
@@ -1,12 +1,6 @@ | |||
1 | extern struct platform_device mxc_uart_device0; | ||
2 | extern struct platform_device mxc_uart_device1; | ||
3 | extern struct platform_device mxc_uart_device2; | ||
4 | extern struct platform_device mxc_fec_device; | ||
5 | extern struct platform_device mxc_usbdr_host_device; | 1 | extern struct platform_device mxc_usbdr_host_device; |
6 | extern struct platform_device mxc_usbh1_device; | 2 | extern struct platform_device mxc_usbh1_device; |
7 | extern struct platform_device mxc_usbdr_udc_device; | 3 | extern struct platform_device mxc_usbdr_udc_device; |
8 | extern struct platform_device mxc_wdt; | 4 | extern struct platform_device mxc_wdt; |
9 | extern struct platform_device mxc_i2c_device0; | ||
10 | extern struct platform_device mxc_i2c_device1; | ||
11 | extern struct platform_device mxc_hsi2c_device; | 5 | extern struct platform_device mxc_hsi2c_device; |
12 | extern struct platform_device mxc_keypad_device; | 6 | extern struct platform_device mxc_keypad_device; |
diff --git a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c index ffa93d1d6ef8..d0e417ce2c08 100644 --- a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c +++ b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c | |||
@@ -30,6 +30,7 @@ | |||
30 | 30 | ||
31 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
32 | 32 | ||
33 | #include "devices-imx51.h" | ||
33 | #include "devices.h" | 34 | #include "devices.h" |
34 | 35 | ||
35 | #define MBIMX51_TSC2007_GPIO (2*32 + 30) | 36 | #define MBIMX51_TSC2007_GPIO (2*32 + 30) |
@@ -114,7 +115,7 @@ static struct pad_desc mbimx51_pads[] = { | |||
114 | MX51_PAD_KEY_COL3__KEY_COL3, | 115 | MX51_PAD_KEY_COL3__KEY_COL3, |
115 | }; | 116 | }; |
116 | 117 | ||
117 | static struct imxuart_platform_data uart_pdata = { | 118 | static const struct imxuart_platform_data uart_pdata __initconst = { |
118 | .flags = IMXUART_HAVE_RTSCTS, | 119 | .flags = IMXUART_HAVE_RTSCTS, |
119 | }; | 120 | }; |
120 | 121 | ||
@@ -172,8 +173,8 @@ void __init eukrea_mbimx51_baseboard_init(void) | |||
172 | mxc_iomux_v3_setup_multiple_pads(mbimx51_pads, | 173 | mxc_iomux_v3_setup_multiple_pads(mbimx51_pads, |
173 | ARRAY_SIZE(mbimx51_pads)); | 174 | ARRAY_SIZE(mbimx51_pads)); |
174 | 175 | ||
175 | mxc_register_device(&mxc_uart_device1, NULL); | 176 | imx51_add_imx_uart(1, NULL); |
176 | mxc_register_device(&mxc_uart_device2, &uart_pdata); | 177 | imx51_add_imx_uart(2, &uart_pdata); |
177 | 178 | ||
178 | gpio_request(MBIMX51_LED0, "LED0"); | 179 | gpio_request(MBIMX51_LED0, "LED0"); |
179 | gpio_direction_output(MBIMX51_LED0, 1); | 180 | gpio_direction_output(MBIMX51_LED0, 1); |
diff --git a/arch/arm/mach-netx/include/mach/vmalloc.h b/arch/arm/mach-netx/include/mach/vmalloc.h index 25d5cc676e0f..7cca3574308f 100644 --- a/arch/arm/mach-netx/include/mach/vmalloc.h +++ b/arch/arm/mach-netx/include/mach/vmalloc.h | |||
@@ -16,4 +16,4 @@ | |||
16 | * along with this program; if not, write to the Free Software | 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 | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 18 | */ |
19 | #define VMALLOC_END (PAGE_OFFSET + 0x10000000) | 19 | #define VMALLOC_END 0xd0000000 |
diff --git a/arch/arm/mach-omap1/include/mach/vmalloc.h b/arch/arm/mach-omap1/include/mach/vmalloc.h index 1b2af14df151..b001f67d695b 100644 --- a/arch/arm/mach-omap1/include/mach/vmalloc.h +++ b/arch/arm/mach-omap1/include/mach/vmalloc.h | |||
@@ -17,4 +17,4 @@ | |||
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ | 19 | */ |
20 | #define VMALLOC_END (PAGE_OFFSET + 0x18000000) | 20 | #define VMALLOC_END 0xd8000000 |
diff --git a/arch/arm/mach-omap2/include/mach/vmalloc.h b/arch/arm/mach-omap2/include/mach/vmalloc.h index 9ce9b6e8ad23..4da31e997efe 100644 --- a/arch/arm/mach-omap2/include/mach/vmalloc.h +++ b/arch/arm/mach-omap2/include/mach/vmalloc.h | |||
@@ -17,4 +17,4 @@ | |||
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ | 19 | */ |
20 | #define VMALLOC_END (PAGE_OFFSET + 0x38000000) | 20 | #define VMALLOC_END 0xf8000000 |
diff --git a/arch/arm/mach-pnx4008/include/mach/vmalloc.h b/arch/arm/mach-pnx4008/include/mach/vmalloc.h index 2ad398378aed..31b65ee07b0b 100644 --- a/arch/arm/mach-pnx4008/include/mach/vmalloc.h +++ b/arch/arm/mach-pnx4008/include/mach/vmalloc.h | |||
@@ -17,4 +17,4 @@ | |||
17 | * The vmalloc() routines leaves a hole of 4kB between each vmalloced | 17 | * The vmalloc() routines leaves a hole of 4kB between each vmalloced |
18 | * area for the same reason. ;) | 18 | * area for the same reason. ;) |
19 | */ | 19 | */ |
20 | #define VMALLOC_END (PAGE_OFFSET + 0x10000000) | 20 | #define VMALLOC_END 0xd0000000 |
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 7aefb9074852..dd235ecc9d6c 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -8,19 +8,16 @@ config ARCH_LUBBOCK | |||
8 | bool "Intel DBPXA250 Development Platform (aka Lubbock)" | 8 | bool "Intel DBPXA250 Development Platform (aka Lubbock)" |
9 | select PXA25x | 9 | select PXA25x |
10 | select SA1111 | 10 | select SA1111 |
11 | select PXA_HAVE_BOARD_IRQS | ||
12 | 11 | ||
13 | config MACH_MAINSTONE | 12 | config MACH_MAINSTONE |
14 | bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)" | 13 | bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)" |
15 | select PXA27x | 14 | select PXA27x |
16 | select HAVE_PWM | 15 | select HAVE_PWM |
17 | select PXA_HAVE_BOARD_IRQS | ||
18 | 16 | ||
19 | config MACH_ZYLONITE | 17 | config MACH_ZYLONITE |
20 | bool | 18 | bool |
21 | select PXA3xx | 19 | select PXA3xx |
22 | select HAVE_PWM | 20 | select HAVE_PWM |
23 | select PXA_HAVE_BOARD_IRQS | ||
24 | 21 | ||
25 | config MACH_ZYLONITE300 | 22 | config MACH_ZYLONITE300 |
26 | bool "PXA3xx Development Platform (aka Zylonite) PXA300/310" | 23 | bool "PXA3xx Development Platform (aka Zylonite) PXA300/310" |
@@ -44,6 +41,10 @@ config MACH_TAVOREVB | |||
44 | select PXA3xx | 41 | select PXA3xx |
45 | select CPU_PXA930 | 42 | select CPU_PXA930 |
46 | 43 | ||
44 | config MACH_TAVOREVB3 | ||
45 | bool "PXA95x Development Platform (aka TavorEVB III)" | ||
46 | select CPU_PXA950 | ||
47 | |||
47 | config MACH_SAAR | 48 | config MACH_SAAR |
48 | bool "PXA930 Handheld Platform (aka SAAR)" | 49 | bool "PXA930 Handheld Platform (aka SAAR)" |
49 | select PXA3xx | 50 | select PXA3xx |
@@ -61,7 +62,6 @@ config ARCH_VIPER | |||
61 | select ISA | 62 | select ISA |
62 | select I2C_GPIO | 63 | select I2C_GPIO |
63 | select HAVE_PWM | 64 | select HAVE_PWM |
64 | select PXA_HAVE_BOARD_IRQS | ||
65 | select PXA_HAVE_ISA_IRQS | 65 | select PXA_HAVE_ISA_IRQS |
66 | select ARCOM_PCMCIA | 66 | select ARCOM_PCMCIA |
67 | 67 | ||
@@ -69,7 +69,6 @@ config MACH_ARCOM_ZEUS | |||
69 | bool "Arcom/Eurotech ZEUS SBC" | 69 | bool "Arcom/Eurotech ZEUS SBC" |
70 | select PXA27x | 70 | select PXA27x |
71 | select ISA | 71 | select ISA |
72 | select PXA_HAVE_BOARD_IRQS | ||
73 | select PXA_HAVE_ISA_IRQS | 72 | select PXA_HAVE_ISA_IRQS |
74 | select ARCOM_PCMCIA | 73 | select ARCOM_PCMCIA |
75 | 74 | ||
@@ -77,7 +76,6 @@ config MACH_BALLOON3 | |||
77 | bool "Balloon 3 board" | 76 | bool "Balloon 3 board" |
78 | select PXA27x | 77 | select PXA27x |
79 | select IWMMXT | 78 | select IWMMXT |
80 | select PXA_HAVE_BOARD_IRQS | ||
81 | 79 | ||
82 | config MACH_CSB726 | 80 | config MACH_CSB726 |
83 | bool "Enable Cogent CSB726 System On a Module" | 81 | bool "Enable Cogent CSB726 System On a Module" |
@@ -140,13 +138,11 @@ config MACH_INTELMOTE2 | |||
140 | bool "Intel Mote 2 Platform" | 138 | bool "Intel Mote 2 Platform" |
141 | select PXA27x | 139 | select PXA27x |
142 | select IWMMXT | 140 | select IWMMXT |
143 | select PXA_HAVE_BOARD_IRQS | ||
144 | 141 | ||
145 | config MACH_STARGATE2 | 142 | config MACH_STARGATE2 |
146 | bool "Intel Stargate 2 Platform" | 143 | bool "Intel Stargate 2 Platform" |
147 | select PXA27x | 144 | select PXA27x |
148 | select IWMMXT | 145 | select IWMMXT |
149 | select PXA_HAVE_BOARD_IRQS | ||
150 | 146 | ||
151 | config MACH_XCEP | 147 | config MACH_XCEP |
152 | bool "Iskratel Electronics XCEP" | 148 | bool "Iskratel Electronics XCEP" |
@@ -206,13 +202,11 @@ config MACH_LOGICPD_PXA270 | |||
206 | bool "LogicPD PXA270 Card Engine Development Platform" | 202 | bool "LogicPD PXA270 Card Engine Development Platform" |
207 | select PXA27x | 203 | select PXA27x |
208 | select HAVE_PWM | 204 | select HAVE_PWM |
209 | select PXA_HAVE_BOARD_IRQS | ||
210 | 205 | ||
211 | config MACH_PCM027 | 206 | config MACH_PCM027 |
212 | bool "Phytec phyCORE-PXA270 CPU module (PCM-027)" | 207 | bool "Phytec phyCORE-PXA270 CPU module (PCM-027)" |
213 | select PXA27x | 208 | select PXA27x |
214 | select IWMMXT | 209 | select IWMMXT |
215 | select PXA_HAVE_BOARD_IRQS | ||
216 | 210 | ||
217 | config MACH_PCM990_BASEBOARD | 211 | config MACH_PCM990_BASEBOARD |
218 | bool "PHYTEC PCM-990 development board" | 212 | bool "PHYTEC PCM-990 development board" |
@@ -247,7 +241,6 @@ config MACH_COLIBRI_PXA270_INCOME | |||
247 | depends on MACH_COLIBRI | 241 | depends on MACH_COLIBRI |
248 | select PXA27x | 242 | select PXA27x |
249 | select HAVE_PWM | 243 | select HAVE_PWM |
250 | select PXA_HAVE_BOARD_IRQS | ||
251 | 244 | ||
252 | config MACH_COLIBRI300 | 245 | config MACH_COLIBRI300 |
253 | bool "Toradex Colibri PXA300/310" | 246 | bool "Toradex Colibri PXA300/310" |
@@ -274,7 +267,6 @@ config MACH_H4700 | |||
274 | select PXA27x | 267 | select PXA27x |
275 | select IWMMXT | 268 | select IWMMXT |
276 | select HAVE_PWM | 269 | select HAVE_PWM |
277 | select PXA_HAVE_BOARD_IRQS | ||
278 | 270 | ||
279 | config MACH_H5000 | 271 | config MACH_H5000 |
280 | bool "HP iPAQ h5000" | 272 | bool "HP iPAQ h5000" |
@@ -289,7 +281,6 @@ config MACH_MAGICIAN | |||
289 | select PXA27x | 281 | select PXA27x |
290 | select IWMMXT | 282 | select IWMMXT |
291 | select HAVE_PWM | 283 | select HAVE_PWM |
292 | select PXA_HAVE_BOARD_IRQS | ||
293 | 284 | ||
294 | config MACH_MIOA701 | 285 | config MACH_MIOA701 |
295 | bool "Mitac Mio A701 Support" | 286 | bool "Mitac Mio A701 Support" |
@@ -307,7 +298,6 @@ config PXA_EZX | |||
307 | select PXA27x | 298 | select PXA27x |
308 | select IWMMXT | 299 | select IWMMXT |
309 | select HAVE_PWM | 300 | select HAVE_PWM |
310 | select PXA_HAVE_BOARD_IRQS | ||
311 | 301 | ||
312 | config MACH_EZX_A780 | 302 | config MACH_EZX_A780 |
313 | bool "Motorola EZX A780" | 303 | bool "Motorola EZX A780" |
@@ -478,7 +468,6 @@ config MACH_POODLE | |||
478 | depends on PXA_SHARPSL | 468 | depends on PXA_SHARPSL |
479 | select PXA25x | 469 | select PXA25x |
480 | select SHARP_LOCOMO | 470 | select SHARP_LOCOMO |
481 | select PXA_HAVE_BOARD_IRQS | ||
482 | 471 | ||
483 | config MACH_CORGI | 472 | config MACH_CORGI |
484 | bool "Enable Sharp SL-C700 (Corgi) Support" | 473 | bool "Enable Sharp SL-C700 (Corgi) Support" |
@@ -523,7 +512,6 @@ config MACH_TOSA | |||
523 | bool "Enable Sharp SL-6000x (Tosa) Support" | 512 | bool "Enable Sharp SL-6000x (Tosa) Support" |
524 | depends on PXA_SHARPSL | 513 | depends on PXA_SHARPSL |
525 | select PXA25x | 514 | select PXA25x |
526 | select PXA_HAVE_BOARD_IRQS | ||
527 | 515 | ||
528 | config TOSA_BT | 516 | config TOSA_BT |
529 | tristate "Control the state of built-in bluetooth chip on Sharp SL-6000" | 517 | tristate "Control the state of built-in bluetooth chip on Sharp SL-6000" |
@@ -552,7 +540,6 @@ config MACH_ICONTROL | |||
552 | config ARCH_PXA_ESERIES | 540 | config ARCH_PXA_ESERIES |
553 | bool "PXA based Toshiba e-series PDAs" | 541 | bool "PXA based Toshiba e-series PDAs" |
554 | select PXA25x | 542 | select PXA25x |
555 | select PXA_HAVE_BOARD_IRQS | ||
556 | 543 | ||
557 | config MACH_E330 | 544 | config MACH_E330 |
558 | bool "Toshiba e330" | 545 | bool "Toshiba e330" |
@@ -606,7 +593,6 @@ config MACH_ZIPIT2 | |||
606 | bool "Zipit Z2 Handheld" | 593 | bool "Zipit Z2 Handheld" |
607 | select PXA27x | 594 | select PXA27x |
608 | select HAVE_PWM | 595 | select HAVE_PWM |
609 | select PXA_HAVE_BOARD_IRQS | ||
610 | 596 | ||
611 | endmenu | 597 | endmenu |
612 | 598 | ||
@@ -643,6 +629,7 @@ config CPU_PXA300 | |||
643 | config CPU_PXA310 | 629 | config CPU_PXA310 |
644 | bool | 630 | bool |
645 | select CPU_PXA300 | 631 | select CPU_PXA300 |
632 | select PXA310_ULPI if USB_ULPI | ||
646 | help | 633 | help |
647 | PXA310 (codename Monahans-LV) | 634 | PXA310 (codename Monahans-LV) |
648 | 635 | ||
@@ -692,10 +679,10 @@ config SHARPSL_PM_MAX1111 | |||
692 | select HWMON | 679 | select HWMON |
693 | select SENSORS_MAX1111 | 680 | select SENSORS_MAX1111 |
694 | 681 | ||
695 | config PXA_HAVE_BOARD_IRQS | 682 | config PXA_HAVE_ISA_IRQS |
696 | bool | 683 | bool |
697 | 684 | ||
698 | config PXA_HAVE_ISA_IRQS | 685 | config PXA310_ULPI |
699 | bool | 686 | bool |
700 | 687 | ||
701 | endif | 688 | endif |
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index 85c7fb324dbb..e2f89c2c6f49 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
@@ -18,7 +18,7 @@ endif | |||
18 | # SoC-specific code | 18 | # SoC-specific code |
19 | obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o pxa2xx.o pxa25x.o | 19 | obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o pxa2xx.o pxa25x.o |
20 | obj-$(CONFIG_PXA27x) += mfp-pxa2xx.o pxa2xx.o pxa27x.o | 20 | obj-$(CONFIG_PXA27x) += mfp-pxa2xx.o pxa2xx.o pxa27x.o |
21 | obj-$(CONFIG_PXA3xx) += mfp-pxa3xx.o pxa3xx.o smemc.o | 21 | obj-$(CONFIG_PXA3xx) += mfp-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o |
22 | obj-$(CONFIG_CPU_PXA300) += pxa300.o | 22 | obj-$(CONFIG_CPU_PXA300) += pxa300.o |
23 | obj-$(CONFIG_CPU_PXA320) += pxa320.o | 23 | obj-$(CONFIG_CPU_PXA320) += pxa320.o |
24 | obj-$(CONFIG_CPU_PXA930) += pxa930.o | 24 | obj-$(CONFIG_CPU_PXA930) += pxa930.o |
@@ -32,6 +32,7 @@ obj-$(CONFIG_MACH_ZYLONITE300) += zylonite.o zylonite_pxa300.o | |||
32 | obj-$(CONFIG_MACH_ZYLONITE320) += zylonite.o zylonite_pxa320.o | 32 | obj-$(CONFIG_MACH_ZYLONITE320) += zylonite.o zylonite_pxa320.o |
33 | obj-$(CONFIG_MACH_LITTLETON) += littleton.o | 33 | obj-$(CONFIG_MACH_LITTLETON) += littleton.o |
34 | obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o | 34 | obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o |
35 | obj-$(CONFIG_MACH_TAVOREVB3) += tavorevb3.o | ||
35 | obj-$(CONFIG_MACH_SAAR) += saar.o | 36 | obj-$(CONFIG_MACH_SAAR) += saar.o |
36 | 37 | ||
37 | # 3rd Party Dev Platforms | 38 | # 3rd Party Dev Platforms |
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c index 9041340fee1d..79d0f6cf53d7 100644 --- a/arch/arm/mach-pxa/balloon3.c +++ b/arch/arm/mach-pxa/balloon3.c | |||
@@ -68,42 +68,6 @@ static unsigned long balloon3_pin_config[] __initdata = { | |||
68 | 68 | ||
69 | /* Reset, configured as GPIO wakeup source */ | 69 | /* Reset, configured as GPIO wakeup source */ |
70 | GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, | 70 | GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, |
71 | |||
72 | /* LEDs */ | ||
73 | GPIO9_GPIO, /* NAND activity LED */ | ||
74 | GPIO10_GPIO, /* Heartbeat LED */ | ||
75 | |||
76 | /* AC97 */ | ||
77 | GPIO28_AC97_BITCLK, | ||
78 | GPIO29_AC97_SDATA_IN_0, | ||
79 | GPIO30_AC97_SDATA_OUT, | ||
80 | GPIO31_AC97_SYNC, | ||
81 | GPIO113_AC97_nRESET, | ||
82 | GPIO95_GPIO, | ||
83 | |||
84 | /* MMC */ | ||
85 | GPIO32_MMC_CLK, | ||
86 | GPIO92_MMC_DAT_0, | ||
87 | GPIO109_MMC_DAT_1, | ||
88 | GPIO110_MMC_DAT_2, | ||
89 | GPIO111_MMC_DAT_3, | ||
90 | GPIO112_MMC_CMD, | ||
91 | |||
92 | /* USB Host */ | ||
93 | GPIO88_USBH1_PWR, | ||
94 | GPIO89_USBH1_PEN, | ||
95 | |||
96 | /* PC Card */ | ||
97 | GPIO48_nPOE, | ||
98 | GPIO49_nPWE, | ||
99 | GPIO50_nPIOR, | ||
100 | GPIO51_nPIOW, | ||
101 | GPIO85_nPCE_1, | ||
102 | GPIO54_nPCE_2, | ||
103 | GPIO79_PSKTSEL, | ||
104 | GPIO55_nPREG, | ||
105 | GPIO56_nPWAIT, | ||
106 | GPIO57_nIOIS16, | ||
107 | }; | 71 | }; |
108 | 72 | ||
109 | /****************************************************************************** | 73 | /****************************************************************************** |
@@ -132,6 +96,34 @@ int __init parse_balloon3_features(char *arg) | |||
132 | early_param("balloon3_features", parse_balloon3_features); | 96 | early_param("balloon3_features", parse_balloon3_features); |
133 | 97 | ||
134 | /****************************************************************************** | 98 | /****************************************************************************** |
99 | * Compact Flash slot | ||
100 | ******************************************************************************/ | ||
101 | #if defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE) | ||
102 | static unsigned long balloon3_cf_pin_config[] __initdata = { | ||
103 | GPIO48_nPOE, | ||
104 | GPIO49_nPWE, | ||
105 | GPIO50_nPIOR, | ||
106 | GPIO51_nPIOW, | ||
107 | GPIO85_nPCE_1, | ||
108 | GPIO54_nPCE_2, | ||
109 | GPIO79_PSKTSEL, | ||
110 | GPIO55_nPREG, | ||
111 | GPIO56_nPWAIT, | ||
112 | GPIO57_nIOIS16, | ||
113 | }; | ||
114 | |||
115 | static void __init balloon3_cf_init(void) | ||
116 | { | ||
117 | if (!balloon3_has(BALLOON3_FEATURE_CF)) | ||
118 | return; | ||
119 | |||
120 | pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_cf_pin_config)); | ||
121 | } | ||
122 | #else | ||
123 | static inline void balloon3_cf_init(void) {} | ||
124 | #endif | ||
125 | |||
126 | /****************************************************************************** | ||
135 | * NOR Flash | 127 | * NOR Flash |
136 | ******************************************************************************/ | 128 | ******************************************************************************/ |
137 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | 129 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
@@ -179,6 +171,15 @@ static inline void balloon3_nor_init(void) {} | |||
179 | ******************************************************************************/ | 171 | ******************************************************************************/ |
180 | #if defined(CONFIG_TOUCHSCREEN_UCB1400) || \ | 172 | #if defined(CONFIG_TOUCHSCREEN_UCB1400) || \ |
181 | defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE) | 173 | defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE) |
174 | static unsigned long balloon3_ac97_pin_config[] __initdata = { | ||
175 | GPIO28_AC97_BITCLK, | ||
176 | GPIO29_AC97_SDATA_IN_0, | ||
177 | GPIO30_AC97_SDATA_OUT, | ||
178 | GPIO31_AC97_SYNC, | ||
179 | GPIO113_AC97_nRESET, | ||
180 | GPIO95_GPIO, | ||
181 | }; | ||
182 | |||
182 | static struct ucb1400_pdata vpac270_ucb1400_pdata = { | 183 | static struct ucb1400_pdata vpac270_ucb1400_pdata = { |
183 | .irq = IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ), | 184 | .irq = IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ), |
184 | }; | 185 | }; |
@@ -197,6 +198,7 @@ static void __init balloon3_ts_init(void) | |||
197 | if (!balloon3_has(BALLOON3_FEATURE_AUDIO)) | 198 | if (!balloon3_has(BALLOON3_FEATURE_AUDIO)) |
198 | return; | 199 | return; |
199 | 200 | ||
201 | pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_ac97_pin_config)); | ||
200 | pxa_set_ac97_info(NULL); | 202 | pxa_set_ac97_info(NULL); |
201 | platform_device_register(&balloon3_ucb1400_device); | 203 | platform_device_register(&balloon3_ucb1400_device); |
202 | } | 204 | } |
@@ -208,6 +210,11 @@ static inline void balloon3_ts_init(void) {} | |||
208 | * Framebuffer | 210 | * Framebuffer |
209 | ******************************************************************************/ | 211 | ******************************************************************************/ |
210 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 212 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
213 | static unsigned long balloon3_lcd_pin_config[] __initdata = { | ||
214 | GPIOxx_LCD_TFT_16BPP, | ||
215 | GPIO99_GPIO, | ||
216 | }; | ||
217 | |||
211 | static struct pxafb_mode_info balloon3_lcd_modes[] = { | 218 | static struct pxafb_mode_info balloon3_lcd_modes[] = { |
212 | { | 219 | { |
213 | .pixclock = 38000, | 220 | .pixclock = 38000, |
@@ -242,6 +249,8 @@ static void __init balloon3_lcd_init(void) | |||
242 | if (!balloon3_has(BALLOON3_FEATURE_TOPPOLY)) | 249 | if (!balloon3_has(BALLOON3_FEATURE_TOPPOLY)) |
243 | return; | 250 | return; |
244 | 251 | ||
252 | pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_lcd_pin_config)); | ||
253 | |||
245 | ret = gpio_request(BALLOON3_GPIO_RUN_BACKLIGHT, "BKL-ON"); | 254 | ret = gpio_request(BALLOON3_GPIO_RUN_BACKLIGHT, "BKL-ON"); |
246 | if (ret) { | 255 | if (ret) { |
247 | pr_err("Requesting BKL-ON GPIO failed!\n"); | 256 | pr_err("Requesting BKL-ON GPIO failed!\n"); |
@@ -271,6 +280,15 @@ static inline void balloon3_lcd_init(void) {} | |||
271 | * SD/MMC card controller | 280 | * SD/MMC card controller |
272 | ******************************************************************************/ | 281 | ******************************************************************************/ |
273 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | 282 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
283 | static unsigned long balloon3_mmc_pin_config[] __initdata = { | ||
284 | GPIO32_MMC_CLK, | ||
285 | GPIO92_MMC_DAT_0, | ||
286 | GPIO109_MMC_DAT_1, | ||
287 | GPIO110_MMC_DAT_2, | ||
288 | GPIO111_MMC_DAT_3, | ||
289 | GPIO112_MMC_CMD, | ||
290 | }; | ||
291 | |||
274 | static struct pxamci_platform_data balloon3_mci_platform_data = { | 292 | static struct pxamci_platform_data balloon3_mci_platform_data = { |
275 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 293 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
276 | .gpio_card_detect = -1, | 294 | .gpio_card_detect = -1, |
@@ -281,6 +299,7 @@ static struct pxamci_platform_data balloon3_mci_platform_data = { | |||
281 | 299 | ||
282 | static void __init balloon3_mmc_init(void) | 300 | static void __init balloon3_mmc_init(void) |
283 | { | 301 | { |
302 | pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_mmc_pin_config)); | ||
284 | pxa_set_mci_info(&balloon3_mci_platform_data); | 303 | pxa_set_mci_info(&balloon3_mci_platform_data); |
285 | } | 304 | } |
286 | #else | 305 | #else |
@@ -339,6 +358,11 @@ static inline void balloon3_irda_init(void) {} | |||
339 | * USB Host | 358 | * USB Host |
340 | ******************************************************************************/ | 359 | ******************************************************************************/ |
341 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 360 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
361 | static unsigned long balloon3_uhc_pin_config[] __initdata = { | ||
362 | GPIO88_USBH1_PWR, | ||
363 | GPIO89_USBH1_PEN, | ||
364 | }; | ||
365 | |||
342 | static struct pxaohci_platform_data balloon3_ohci_info = { | 366 | static struct pxaohci_platform_data balloon3_ohci_info = { |
343 | .port_mode = PMM_PERPORT_MODE, | 367 | .port_mode = PMM_PERPORT_MODE, |
344 | .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW, | 368 | .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW, |
@@ -348,6 +372,7 @@ static void __init balloon3_uhc_init(void) | |||
348 | { | 372 | { |
349 | if (!balloon3_has(BALLOON3_FEATURE_OHCI)) | 373 | if (!balloon3_has(BALLOON3_FEATURE_OHCI)) |
350 | return; | 374 | return; |
375 | pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_uhc_pin_config)); | ||
351 | pxa_set_ohci_info(&balloon3_ohci_info); | 376 | pxa_set_ohci_info(&balloon3_ohci_info); |
352 | } | 377 | } |
353 | #else | 378 | #else |
@@ -358,6 +383,11 @@ static inline void balloon3_uhc_init(void) {} | |||
358 | * LEDs | 383 | * LEDs |
359 | ******************************************************************************/ | 384 | ******************************************************************************/ |
360 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) | 385 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) |
386 | static unsigned long balloon3_led_pin_config[] __initdata = { | ||
387 | GPIO9_GPIO, /* NAND activity LED */ | ||
388 | GPIO10_GPIO, /* Heartbeat LED */ | ||
389 | }; | ||
390 | |||
361 | struct gpio_led balloon3_gpio_leds[] = { | 391 | struct gpio_led balloon3_gpio_leds[] = { |
362 | { | 392 | { |
363 | .name = "balloon3:green:idle", | 393 | .name = "balloon3:green:idle", |
@@ -436,6 +466,7 @@ static struct platform_device balloon3_pcf_leds = { | |||
436 | 466 | ||
437 | static void __init balloon3_leds_init(void) | 467 | static void __init balloon3_leds_init(void) |
438 | { | 468 | { |
469 | pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_led_pin_config)); | ||
439 | platform_device_register(&balloon3_leds); | 470 | platform_device_register(&balloon3_leds); |
440 | platform_device_register(&balloon3_pcf_leds); | 471 | platform_device_register(&balloon3_pcf_leds); |
441 | } | 472 | } |
@@ -757,6 +788,7 @@ static void __init balloon3_init(void) | |||
757 | balloon3_ts_init(); | 788 | balloon3_ts_init(); |
758 | balloon3_udc_init(); | 789 | balloon3_udc_init(); |
759 | balloon3_uhc_init(); | 790 | balloon3_uhc_init(); |
791 | balloon3_cf_init(); | ||
760 | } | 792 | } |
761 | 793 | ||
762 | static struct map_desc balloon3_io_desc[] __initdata = { | 794 | static struct map_desc balloon3_io_desc[] __initdata = { |
@@ -779,6 +811,7 @@ MACHINE_START(BALLOON3, "Balloon3") | |||
779 | .phys_io = 0x40000000, | 811 | .phys_io = 0x40000000, |
780 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 812 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
781 | .map_io = balloon3_map_io, | 813 | .map_io = balloon3_map_io, |
814 | .nr_irqs = BALLOON3_NR_IRQS, | ||
782 | .init_irq = balloon3_init_irq, | 815 | .init_irq = balloon3_init_irq, |
783 | .timer = &pxa_timer, | 816 | .timer = &pxa_timer, |
784 | .init_machine = balloon3_init, | 817 | .init_machine = balloon3_init, |
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c index bff6e78f033d..ad40e7b141e0 100644 --- a/arch/arm/mach-pxa/cm-x2xx.c +++ b/arch/arm/mach-pxa/cm-x2xx.c | |||
@@ -33,6 +33,9 @@ | |||
33 | extern void cmx255_init(void); | 33 | extern void cmx255_init(void); |
34 | extern void cmx270_init(void); | 34 | extern void cmx270_init(void); |
35 | 35 | ||
36 | /* reserve IRQs for IT8152 */ | ||
37 | #define CMX2XX_NR_IRQS (IRQ_BOARD_START + 40) | ||
38 | |||
36 | /* virtual addresses for statically mapped regions */ | 39 | /* virtual addresses for statically mapped regions */ |
37 | #define CMX2XX_VIRT_BASE (0xe8000000) | 40 | #define CMX2XX_VIRT_BASE (0xe8000000) |
38 | #define CMX2XX_IT8152_VIRT (CMX2XX_VIRT_BASE) | 41 | #define CMX2XX_IT8152_VIRT (CMX2XX_VIRT_BASE) |
@@ -514,6 +517,7 @@ MACHINE_START(ARMCORE, "Compulab CM-X2XX") | |||
514 | .phys_io = 0x40000000, | 517 | .phys_io = 0x40000000, |
515 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 518 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
516 | .map_io = cmx2xx_map_io, | 519 | .map_io = cmx2xx_map_io, |
520 | .nr_irqs = CMX2XX_NR_IRQS, | ||
517 | .init_irq = cmx2xx_init_irq, | 521 | .init_irq = cmx2xx_init_irq, |
518 | .timer = &pxa_timer, | 522 | .timer = &pxa_timer, |
519 | .init_machine = cmx2xx_init, | 523 | .init_machine = cmx2xx_init, |
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index c70e6c2f4e7c..8e0b5622b277 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/clk.h> | ||
22 | 23 | ||
23 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
24 | #include <linux/dm9000.h> | 25 | #include <linux/dm9000.h> |
@@ -50,6 +51,7 @@ | |||
50 | #include <plat/i2c.h> | 51 | #include <plat/i2c.h> |
51 | #include <plat/pxa3xx_nand.h> | 52 | #include <plat/pxa3xx_nand.h> |
52 | #include <mach/audio.h> | 53 | #include <mach/audio.h> |
54 | #include <mach/pxa3xx-u2d.h> | ||
53 | 55 | ||
54 | #include <asm/mach/map.h> | 56 | #include <asm/mach/map.h> |
55 | 57 | ||
@@ -68,6 +70,8 @@ | |||
68 | #define GPIO97_RTC_RD (97) | 70 | #define GPIO97_RTC_RD (97) |
69 | #define GPIO98_RTC_IO (98) | 71 | #define GPIO98_RTC_IO (98) |
70 | 72 | ||
73 | #define GPIO_ULPI_PHY_RST (127) | ||
74 | |||
71 | static mfp_cfg_t cm_x3xx_mfp_cfg[] __initdata = { | 75 | static mfp_cfg_t cm_x3xx_mfp_cfg[] __initdata = { |
72 | /* LCD */ | 76 | /* LCD */ |
73 | GPIO54_LCD_LDD_0, | 77 | GPIO54_LCD_LDD_0, |
@@ -472,6 +476,78 @@ static void __init cm_x300_init_mmc(void) | |||
472 | static inline void cm_x300_init_mmc(void) {} | 476 | static inline void cm_x300_init_mmc(void) {} |
473 | #endif | 477 | #endif |
474 | 478 | ||
479 | #if defined(CONFIG_PXA310_ULPI) | ||
480 | static struct clk *pout_clk; | ||
481 | |||
482 | static int cm_x300_ulpi_phy_reset(void) | ||
483 | { | ||
484 | int err; | ||
485 | |||
486 | /* reset the PHY */ | ||
487 | err = gpio_request(GPIO_ULPI_PHY_RST, "ulpi reset"); | ||
488 | if (err) { | ||
489 | pr_err("%s: failed to request ULPI reset GPIO: %d\n", | ||
490 | __func__, err); | ||
491 | return err; | ||
492 | } | ||
493 | |||
494 | gpio_direction_output(GPIO_ULPI_PHY_RST, 0); | ||
495 | msleep(10); | ||
496 | gpio_set_value(GPIO_ULPI_PHY_RST, 1); | ||
497 | msleep(10); | ||
498 | |||
499 | gpio_free(GPIO_ULPI_PHY_RST); | ||
500 | |||
501 | return 0; | ||
502 | } | ||
503 | |||
504 | static inline int cm_x300_u2d_init(struct device *dev) | ||
505 | { | ||
506 | int err = 0; | ||
507 | |||
508 | if (cpu_is_pxa310()) { | ||
509 | /* CLK_POUT is connected to the ULPI PHY */ | ||
510 | pout_clk = clk_get(NULL, "CLK_POUT"); | ||
511 | if (IS_ERR(pout_clk)) { | ||
512 | err = PTR_ERR(pout_clk); | ||
513 | pr_err("%s: failed to get CLK_POUT: %d\n", | ||
514 | __func__, err); | ||
515 | return err; | ||
516 | } | ||
517 | clk_enable(pout_clk); | ||
518 | |||
519 | err = cm_x300_ulpi_phy_reset(); | ||
520 | if (err) { | ||
521 | clk_disable(pout_clk); | ||
522 | clk_put(pout_clk); | ||
523 | } | ||
524 | } | ||
525 | |||
526 | return err; | ||
527 | } | ||
528 | |||
529 | static void cm_x300_u2d_exit(struct device *dev) | ||
530 | { | ||
531 | if (cpu_is_pxa310()) { | ||
532 | clk_disable(pout_clk); | ||
533 | clk_put(pout_clk); | ||
534 | } | ||
535 | } | ||
536 | |||
537 | static struct pxa3xx_u2d_platform_data cm_x300_u2d_platform_data = { | ||
538 | .ulpi_mode = ULPI_SER_6PIN, | ||
539 | .init = cm_x300_u2d_init, | ||
540 | .exit = cm_x300_u2d_exit, | ||
541 | }; | ||
542 | |||
543 | static void cm_x300_init_u2d(void) | ||
544 | { | ||
545 | pxa3xx_set_u2d_info(&cm_x300_u2d_platform_data); | ||
546 | } | ||
547 | #else | ||
548 | static inline void cm_x300_init_u2d(void) {} | ||
549 | #endif | ||
550 | |||
475 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 551 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
476 | static int cm_x300_ohci_init(struct device *dev) | 552 | static int cm_x300_ohci_init(struct device *dev) |
477 | { | 553 | { |
@@ -754,6 +830,7 @@ static void __init cm_x300_init(void) | |||
754 | cm_x300_init_da9030(); | 830 | cm_x300_init_da9030(); |
755 | cm_x300_init_dm9000(); | 831 | cm_x300_init_dm9000(); |
756 | cm_x300_init_lcd(); | 832 | cm_x300_init_lcd(); |
833 | cm_x300_init_u2d(); | ||
757 | cm_x300_init_ohci(); | 834 | cm_x300_init_ohci(); |
758 | cm_x300_init_mmc(); | 835 | cm_x300_init_mmc(); |
759 | cm_x300_init_nand(); | 836 | cm_x300_init_nand(); |
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c index 50d5939a78f1..58093d9e07be 100644 --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c | |||
@@ -312,8 +312,7 @@ static int pxa_set_target(struct cpufreq_policy *policy, | |||
312 | freqs.cpu = policy->cpu; | 312 | freqs.cpu = policy->cpu; |
313 | 313 | ||
314 | if (freq_debug) | 314 | if (freq_debug) |
315 | pr_debug(KERN_INFO "Changing CPU frequency to %d Mhz, " | 315 | pr_debug("Changing CPU frequency to %d Mhz, (SDRAM %d Mhz)\n", |
316 | "(SDRAM %d Mhz)\n", | ||
317 | freqs.new / 1000, (pxa_freq_settings[idx].div2) ? | 316 | freqs.new / 1000, (pxa_freq_settings[idx].div2) ? |
318 | (new_freq_mem / 2000) : (new_freq_mem / 1000)); | 317 | (new_freq_mem / 2000) : (new_freq_mem / 1000)); |
319 | 318 | ||
diff --git a/arch/arm/mach-pxa/cpufreq-pxa3xx.c b/arch/arm/mach-pxa/cpufreq-pxa3xx.c index 0a0d0fe99220..88fbec05ec50 100644 --- a/arch/arm/mach-pxa/cpufreq-pxa3xx.c +++ b/arch/arm/mach-pxa/cpufreq-pxa3xx.c | |||
@@ -159,7 +159,7 @@ static int pxa3xx_cpufreq_verify(struct cpufreq_policy *policy) | |||
159 | 159 | ||
160 | static unsigned int pxa3xx_cpufreq_get(unsigned int cpu) | 160 | static unsigned int pxa3xx_cpufreq_get(unsigned int cpu) |
161 | { | 161 | { |
162 | return get_clk_frequency_khz(0); | 162 | return pxa3xx_get_clk_frequency_khz(0); |
163 | } | 163 | } |
164 | 164 | ||
165 | static int pxa3xx_cpufreq_set(struct cpufreq_policy *policy, | 165 | static int pxa3xx_cpufreq_set(struct cpufreq_policy *policy, |
@@ -212,7 +212,8 @@ static int pxa3xx_cpufreq_init(struct cpufreq_policy *policy) | |||
212 | policy->cpuinfo.min_freq = 104000; | 212 | policy->cpuinfo.min_freq = 104000; |
213 | policy->cpuinfo.max_freq = (cpu_is_pxa320()) ? 806000 : 624000; | 213 | policy->cpuinfo.max_freq = (cpu_is_pxa320()) ? 806000 : 624000; |
214 | policy->cpuinfo.transition_latency = 1000; /* FIXME: 1 ms, assumed */ | 214 | policy->cpuinfo.transition_latency = 1000; /* FIXME: 1 ms, assumed */ |
215 | policy->cur = policy->min = policy->max = get_clk_frequency_khz(0); | 215 | policy->max = pxa3xx_get_clk_frequency_khz(0); |
216 | policy->cur = policy->min = policy->max; | ||
216 | 217 | ||
217 | if (cpu_is_pxa300() || cpu_is_pxa310()) | 218 | if (cpu_is_pxa300() || cpu_is_pxa310()) |
218 | ret = setup_freqs_table(policy, ARRAY_AND_SIZE(pxa300_freqs)); | 219 | ret = setup_freqs_table(policy, ARRAY_AND_SIZE(pxa300_freqs)); |
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index 65447dc736c2..08b410343870 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c | |||
@@ -6,11 +6,12 @@ | |||
6 | 6 | ||
7 | #include <asm/pmu.h> | 7 | #include <asm/pmu.h> |
8 | #include <mach/udc.h> | 8 | #include <mach/udc.h> |
9 | #include <mach/pxa3xx-u2d.h> | ||
9 | #include <mach/pxafb.h> | 10 | #include <mach/pxafb.h> |
10 | #include <mach/mmc.h> | 11 | #include <mach/mmc.h> |
11 | #include <mach/irda.h> | 12 | #include <mach/irda.h> |
12 | #include <mach/ohci.h> | 13 | #include <mach/ohci.h> |
13 | #include <mach/pxa27x_keypad.h> | 14 | #include <plat/pxa27x_keypad.h> |
14 | #include <mach/pxa2xx_spi.h> | 15 | #include <mach/pxa2xx_spi.h> |
15 | #include <mach/camera.h> | 16 | #include <mach/camera.h> |
16 | #include <mach/audio.h> | 17 | #include <mach/audio.h> |
@@ -134,6 +135,33 @@ struct platform_device pxa27x_device_udc = { | |||
134 | } | 135 | } |
135 | }; | 136 | }; |
136 | 137 | ||
138 | #ifdef CONFIG_PXA3xx | ||
139 | static struct resource pxa3xx_u2d_resources[] = { | ||
140 | [0] = { | ||
141 | .start = 0x54100000, | ||
142 | .end = 0x54100fff, | ||
143 | .flags = IORESOURCE_MEM, | ||
144 | }, | ||
145 | [1] = { | ||
146 | .start = IRQ_USB2, | ||
147 | .end = IRQ_USB2, | ||
148 | .flags = IORESOURCE_IRQ, | ||
149 | }, | ||
150 | }; | ||
151 | |||
152 | struct platform_device pxa3xx_device_u2d = { | ||
153 | .name = "pxa3xx-u2d", | ||
154 | .id = -1, | ||
155 | .resource = pxa3xx_u2d_resources, | ||
156 | .num_resources = ARRAY_SIZE(pxa3xx_u2d_resources), | ||
157 | }; | ||
158 | |||
159 | void __init pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info) | ||
160 | { | ||
161 | pxa_register_device(&pxa3xx_device_u2d, info); | ||
162 | } | ||
163 | #endif /* CONFIG_PXA3xx */ | ||
164 | |||
137 | static struct resource pxafb_resources[] = { | 165 | static struct resource pxafb_resources[] = { |
138 | [0] = { | 166 | [0] = { |
139 | .start = 0x44000000, | 167 | .start = 0x44000000, |
diff --git a/arch/arm/mach-pxa/devices.h b/arch/arm/mach-pxa/devices.h index 50353ea49ba4..715e8bd02e24 100644 --- a/arch/arm/mach-pxa/devices.h +++ b/arch/arm/mach-pxa/devices.h | |||
@@ -4,6 +4,7 @@ extern struct platform_device pxa3xx_device_mci2; | |||
4 | extern struct platform_device pxa3xx_device_mci3; | 4 | extern struct platform_device pxa3xx_device_mci3; |
5 | extern struct platform_device pxa25x_device_udc; | 5 | extern struct platform_device pxa25x_device_udc; |
6 | extern struct platform_device pxa27x_device_udc; | 6 | extern struct platform_device pxa27x_device_udc; |
7 | extern struct platform_device pxa3xx_device_u2d; | ||
7 | extern struct platform_device pxa_device_fb; | 8 | extern struct platform_device pxa_device_fb; |
8 | extern struct platform_device pxa_device_ffuart; | 9 | extern struct platform_device pxa_device_ffuart; |
9 | extern struct platform_device pxa_device_btuart; | 10 | extern struct platform_device pxa_device_btuart; |
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index 0517c17978f3..51286a738a3b 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #include <mach/pxafb.h> | 43 | #include <mach/pxafb.h> |
44 | #include <mach/ohci.h> | 44 | #include <mach/ohci.h> |
45 | #include <mach/mmc.h> | 45 | #include <mach/mmc.h> |
46 | #include <mach/pxa27x_keypad.h> | 46 | #include <plat/pxa27x_keypad.h> |
47 | #include <plat/i2c.h> | 47 | #include <plat/i2c.h> |
48 | #include <mach/camera.h> | 48 | #include <mach/camera.h> |
49 | #include <mach/pxa2xx_spi.h> | 49 | #include <mach/pxa2xx_spi.h> |
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c index 349212a1cbd3..4971ce119501 100644 --- a/arch/arm/mach-pxa/eseries.c +++ b/arch/arm/mach-pxa/eseries.c | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #include <mach/pxa25x.h> | 30 | #include <mach/pxa25x.h> |
31 | #include <mach/eseries-gpio.h> | 31 | #include <mach/eseries-gpio.h> |
32 | #include <mach/eseries-irq.h> | ||
32 | #include <mach/audio.h> | 33 | #include <mach/audio.h> |
33 | #include <mach/pxafb.h> | 34 | #include <mach/pxafb.h> |
34 | #include <mach/udc.h> | 35 | #include <mach/udc.h> |
@@ -183,6 +184,7 @@ MACHINE_START(E330, "Toshiba e330") | |||
183 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 184 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
184 | .boot_params = 0xa0000100, | 185 | .boot_params = 0xa0000100, |
185 | .map_io = pxa_map_io, | 186 | .map_io = pxa_map_io, |
187 | .nr_irqs = ESERIES_NR_IRQS, | ||
186 | .init_irq = pxa25x_init_irq, | 188 | .init_irq = pxa25x_init_irq, |
187 | .fixup = eseries_fixup, | 189 | .fixup = eseries_fixup, |
188 | .init_machine = e330_init, | 190 | .init_machine = e330_init, |
@@ -233,6 +235,7 @@ MACHINE_START(E350, "Toshiba e350") | |||
233 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 235 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
234 | .boot_params = 0xa0000100, | 236 | .boot_params = 0xa0000100, |
235 | .map_io = pxa_map_io, | 237 | .map_io = pxa_map_io, |
238 | .nr_irqs = ESERIES_NR_IRQS, | ||
236 | .init_irq = pxa25x_init_irq, | 239 | .init_irq = pxa25x_init_irq, |
237 | .fixup = eseries_fixup, | 240 | .fixup = eseries_fixup, |
238 | .init_machine = e350_init, | 241 | .init_machine = e350_init, |
@@ -356,6 +359,7 @@ MACHINE_START(E400, "Toshiba e400") | |||
356 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 359 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
357 | .boot_params = 0xa0000100, | 360 | .boot_params = 0xa0000100, |
358 | .map_io = pxa_map_io, | 361 | .map_io = pxa_map_io, |
362 | .nr_irqs = ESERIES_NR_IRQS, | ||
359 | .init_irq = pxa25x_init_irq, | 363 | .init_irq = pxa25x_init_irq, |
360 | .fixup = eseries_fixup, | 364 | .fixup = eseries_fixup, |
361 | .init_machine = e400_init, | 365 | .init_machine = e400_init, |
@@ -545,6 +549,7 @@ MACHINE_START(E740, "Toshiba e740") | |||
545 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 549 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
546 | .boot_params = 0xa0000100, | 550 | .boot_params = 0xa0000100, |
547 | .map_io = pxa_map_io, | 551 | .map_io = pxa_map_io, |
552 | .nr_irqs = ESERIES_NR_IRQS, | ||
548 | .init_irq = pxa25x_init_irq, | 553 | .init_irq = pxa25x_init_irq, |
549 | .fixup = eseries_fixup, | 554 | .fixup = eseries_fixup, |
550 | .init_machine = e740_init, | 555 | .init_machine = e740_init, |
@@ -737,6 +742,7 @@ MACHINE_START(E750, "Toshiba e750") | |||
737 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 742 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
738 | .boot_params = 0xa0000100, | 743 | .boot_params = 0xa0000100, |
739 | .map_io = pxa_map_io, | 744 | .map_io = pxa_map_io, |
745 | .nr_irqs = ESERIES_NR_IRQS, | ||
740 | .init_irq = pxa25x_init_irq, | 746 | .init_irq = pxa25x_init_irq, |
741 | .fixup = eseries_fixup, | 747 | .fixup = eseries_fixup, |
742 | .init_machine = e750_init, | 748 | .init_machine = e750_init, |
@@ -933,6 +939,7 @@ MACHINE_START(E800, "Toshiba e800") | |||
933 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 939 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
934 | .boot_params = 0xa0000100, | 940 | .boot_params = 0xa0000100, |
935 | .map_io = pxa_map_io, | 941 | .map_io = pxa_map_io, |
942 | .nr_irqs = ESERIES_NR_IRQS, | ||
936 | .init_irq = pxa25x_init_irq, | 943 | .init_irq = pxa25x_init_irq, |
937 | .fixup = eseries_fixup, | 944 | .fixup = eseries_fixup, |
938 | .init_machine = e800_init, | 945 | .init_machine = e800_init, |
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c index 626c82b13970..f997e8455557 100644 --- a/arch/arm/mach-pxa/ezx.c +++ b/arch/arm/mach-pxa/ezx.c | |||
@@ -32,12 +32,14 @@ | |||
32 | #include <mach/ohci.h> | 32 | #include <mach/ohci.h> |
33 | #include <plat/i2c.h> | 33 | #include <plat/i2c.h> |
34 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
35 | #include <mach/pxa27x_keypad.h> | 35 | #include <plat/pxa27x_keypad.h> |
36 | #include <mach/camera.h> | 36 | #include <mach/camera.h> |
37 | 37 | ||
38 | #include "devices.h" | 38 | #include "devices.h" |
39 | #include "generic.h" | 39 | #include "generic.h" |
40 | 40 | ||
41 | #define EZX_NR_IRQS (IRQ_BOARD_START + 24) | ||
42 | |||
41 | #define GPIO12_A780_FLIP_LID 12 | 43 | #define GPIO12_A780_FLIP_LID 12 |
42 | #define GPIO15_A1200_FLIP_LID 15 | 44 | #define GPIO15_A1200_FLIP_LID 15 |
43 | #define GPIO15_A910_FLIP_LID 15 | 45 | #define GPIO15_A910_FLIP_LID 15 |
@@ -800,6 +802,7 @@ MACHINE_START(EZX_A780, "Motorola EZX A780") | |||
800 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 802 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
801 | .boot_params = 0xa0000100, | 803 | .boot_params = 0xa0000100, |
802 | .map_io = pxa_map_io, | 804 | .map_io = pxa_map_io, |
805 | .nr_irqs = EZX_NR_IRQS, | ||
803 | .init_irq = pxa27x_init_irq, | 806 | .init_irq = pxa27x_init_irq, |
804 | .timer = &pxa_timer, | 807 | .timer = &pxa_timer, |
805 | .init_machine = a780_init, | 808 | .init_machine = a780_init, |
@@ -866,6 +869,7 @@ MACHINE_START(EZX_E680, "Motorola EZX E680") | |||
866 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 869 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
867 | .boot_params = 0xa0000100, | 870 | .boot_params = 0xa0000100, |
868 | .map_io = pxa_map_io, | 871 | .map_io = pxa_map_io, |
872 | .nr_irqs = EZX_NR_IRQS, | ||
869 | .init_irq = pxa27x_init_irq, | 873 | .init_irq = pxa27x_init_irq, |
870 | .timer = &pxa_timer, | 874 | .timer = &pxa_timer, |
871 | .init_machine = e680_init, | 875 | .init_machine = e680_init, |
@@ -932,6 +936,7 @@ MACHINE_START(EZX_A1200, "Motorola EZX A1200") | |||
932 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 936 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
933 | .boot_params = 0xa0000100, | 937 | .boot_params = 0xa0000100, |
934 | .map_io = pxa_map_io, | 938 | .map_io = pxa_map_io, |
939 | .nr_irqs = EZX_NR_IRQS, | ||
935 | .init_irq = pxa27x_init_irq, | 940 | .init_irq = pxa27x_init_irq, |
936 | .timer = &pxa_timer, | 941 | .timer = &pxa_timer, |
937 | .init_machine = a1200_init, | 942 | .init_machine = a1200_init, |
@@ -1124,6 +1129,7 @@ MACHINE_START(EZX_A910, "Motorola EZX A910") | |||
1124 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 1129 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
1125 | .boot_params = 0xa0000100, | 1130 | .boot_params = 0xa0000100, |
1126 | .map_io = pxa_map_io, | 1131 | .map_io = pxa_map_io, |
1132 | .nr_irqs = EZX_NR_IRQS, | ||
1127 | .init_irq = pxa27x_init_irq, | 1133 | .init_irq = pxa27x_init_irq, |
1128 | .timer = &pxa_timer, | 1134 | .timer = &pxa_timer, |
1129 | .init_machine = a910_init, | 1135 | .init_machine = a910_init, |
@@ -1190,6 +1196,7 @@ MACHINE_START(EZX_E6, "Motorola EZX E6") | |||
1190 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 1196 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
1191 | .boot_params = 0xa0000100, | 1197 | .boot_params = 0xa0000100, |
1192 | .map_io = pxa_map_io, | 1198 | .map_io = pxa_map_io, |
1199 | .nr_irqs = EZX_NR_IRQS, | ||
1193 | .init_irq = pxa27x_init_irq, | 1200 | .init_irq = pxa27x_init_irq, |
1194 | .timer = &pxa_timer, | 1201 | .timer = &pxa_timer, |
1195 | .init_machine = e6_init, | 1202 | .init_machine = e6_init, |
@@ -1230,6 +1237,7 @@ MACHINE_START(EZX_E2, "Motorola EZX E2") | |||
1230 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 1237 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
1231 | .boot_params = 0xa0000100, | 1238 | .boot_params = 0xa0000100, |
1232 | .map_io = pxa_map_io, | 1239 | .map_io = pxa_map_io, |
1240 | .nr_irqs = EZX_NR_IRQS, | ||
1233 | .init_irq = pxa27x_init_irq, | 1241 | .init_irq = pxa27x_init_irq, |
1234 | .timer = &pxa_timer, | 1242 | .timer = &pxa_timer, |
1235 | .init_machine = e2_init, | 1243 | .init_machine = e2_init, |
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c index baabb3ce088e..6451e9c3a93f 100644 --- a/arch/arm/mach-pxa/generic.c +++ b/arch/arm/mach-pxa/generic.c | |||
@@ -66,8 +66,7 @@ unsigned int get_clk_frequency_khz(int info) | |||
66 | return pxa25x_get_clk_frequency_khz(info); | 66 | return pxa25x_get_clk_frequency_khz(info); |
67 | else if (cpu_is_pxa27x()) | 67 | else if (cpu_is_pxa27x()) |
68 | return pxa27x_get_clk_frequency_khz(info); | 68 | return pxa27x_get_clk_frequency_khz(info); |
69 | else | 69 | return 0; |
70 | return pxa3xx_get_clk_frequency_khz(info); | ||
71 | } | 70 | } |
72 | EXPORT_SYMBOL(get_clk_frequency_khz); | 71 | EXPORT_SYMBOL(get_clk_frequency_khz); |
73 | 72 | ||
@@ -80,8 +79,7 @@ unsigned int get_memclk_frequency_10khz(void) | |||
80 | return pxa25x_get_memclk_frequency_10khz(); | 79 | return pxa25x_get_memclk_frequency_10khz(); |
81 | else if (cpu_is_pxa27x()) | 80 | else if (cpu_is_pxa27x()) |
82 | return pxa27x_get_memclk_frequency_10khz(); | 81 | return pxa27x_get_memclk_frequency_10khz(); |
83 | else | 82 | return 0; |
84 | return pxa3xx_get_memclk_frequency_10khz(); | ||
85 | } | 83 | } |
86 | EXPORT_SYMBOL(get_memclk_frequency_10khz); | 84 | EXPORT_SYMBOL(get_memclk_frequency_10khz); |
87 | 85 | ||
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h index c6305c5b8a72..4b1ad2769ed7 100644 --- a/arch/arm/mach-pxa/generic.h +++ b/arch/arm/mach-pxa/generic.h | |||
@@ -54,11 +54,9 @@ static inline void pxa2xx_clear_reset_status(unsigned int mask) {} | |||
54 | 54 | ||
55 | #ifdef CONFIG_PXA3xx | 55 | #ifdef CONFIG_PXA3xx |
56 | extern unsigned pxa3xx_get_clk_frequency_khz(int); | 56 | extern unsigned pxa3xx_get_clk_frequency_khz(int); |
57 | extern unsigned pxa3xx_get_memclk_frequency_10khz(void); | ||
58 | extern void pxa3xx_clear_reset_status(unsigned int); | 57 | extern void pxa3xx_clear_reset_status(unsigned int); |
59 | #else | 58 | #else |
60 | #define pxa3xx_get_clk_frequency_khz(x) (0) | 59 | #define pxa3xx_get_clk_frequency_khz(x) (0) |
61 | #define pxa3xx_get_memclk_frequency_10khz() (0) | ||
62 | static inline void pxa3xx_clear_reset_status(unsigned int mask) {} | 60 | static inline void pxa3xx_clear_reset_status(unsigned int mask) {} |
63 | #endif | 61 | #endif |
64 | 62 | ||
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index 848c861dd23f..10104f16e6e4 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c | |||
@@ -874,6 +874,7 @@ MACHINE_START(H4700, "HP iPAQ HX4700") | |||
874 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 874 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
875 | .boot_params = 0xa0000100, | 875 | .boot_params = 0xa0000100, |
876 | .map_io = pxa_map_io, | 876 | .map_io = pxa_map_io, |
877 | .nr_irqs = HX4700_NR_IRQS, | ||
877 | .init_irq = pxa27x_init_irq, | 878 | .init_irq = pxa27x_init_irq, |
878 | .init_machine = hx4700_init, | 879 | .init_machine = hx4700_init, |
879 | .timer = &pxa_timer, | 880 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h index eec92e6fd7cf..561562b4360b 100644 --- a/arch/arm/mach-pxa/include/mach/balloon3.h +++ b/arch/arm/mach-pxa/include/mach/balloon3.h | |||
@@ -174,6 +174,8 @@ enum balloon3_features { | |||
174 | #define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ) | 174 | #define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ) |
175 | #define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD) | 175 | #define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD) |
176 | 176 | ||
177 | #define BALLOON3_NR_IRQS (IRQ_BOARD_START + 4) | ||
178 | |||
177 | extern int balloon3_has(enum balloon3_features feature); | 179 | extern int balloon3_has(enum balloon3_features feature); |
178 | 180 | ||
179 | #endif | 181 | #endif |
diff --git a/arch/arm/mach-pxa/include/mach/eseries-irq.h b/arch/arm/mach-pxa/include/mach/eseries-irq.h index f2a93d5e31d3..de292b269c63 100644 --- a/arch/arm/mach-pxa/include/mach/eseries-irq.h +++ b/arch/arm/mach-pxa/include/mach/eseries-irq.h | |||
@@ -25,3 +25,4 @@ | |||
25 | #define TMIO_SD_IRQ IRQ_TMIO(1) | 25 | #define TMIO_SD_IRQ IRQ_TMIO(1) |
26 | #define TMIO_USB_IRQ IRQ_TMIO(2) | 26 | #define TMIO_USB_IRQ IRQ_TMIO(2) |
27 | 27 | ||
28 | #define ESERIES_NR_IRQS (IRQ_BOARD_START + 16) | ||
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h index 7f64d24cd564..814f1458a06a 100644 --- a/arch/arm/mach-pxa/include/mach/hardware.h +++ b/arch/arm/mach-pxa/include/mach/hardware.h | |||
@@ -264,23 +264,35 @@ | |||
264 | * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x | 264 | * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x |
265 | * == 0x3 for pxa300/pxa310/pxa320 | 265 | * == 0x3 for pxa300/pxa310/pxa320 |
266 | */ | 266 | */ |
267 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | ||
267 | #define __cpu_is_pxa2xx(id) \ | 268 | #define __cpu_is_pxa2xx(id) \ |
268 | ({ \ | 269 | ({ \ |
269 | unsigned int _id = (id) >> 13 & 0x7; \ | 270 | unsigned int _id = (id) >> 13 & 0x7; \ |
270 | _id <= 0x2; \ | 271 | _id <= 0x2; \ |
271 | }) | 272 | }) |
273 | #else | ||
274 | #define __cpu_is_pxa2xx(id) (0) | ||
275 | #endif | ||
272 | 276 | ||
277 | #ifdef CONFIG_PXA3xx | ||
273 | #define __cpu_is_pxa3xx(id) \ | 278 | #define __cpu_is_pxa3xx(id) \ |
274 | ({ \ | 279 | ({ \ |
275 | unsigned int _id = (id) >> 13 & 0x7; \ | 280 | unsigned int _id = (id) >> 13 & 0x7; \ |
276 | _id == 0x3; \ | 281 | _id == 0x3; \ |
277 | }) | 282 | }) |
283 | #else | ||
284 | #define __cpu_is_pxa3xx(id) (0) | ||
285 | #endif | ||
278 | 286 | ||
287 | #if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935) | ||
279 | #define __cpu_is_pxa93x(id) \ | 288 | #define __cpu_is_pxa93x(id) \ |
280 | ({ \ | 289 | ({ \ |
281 | unsigned int _id = (id) >> 4 & 0xfff; \ | 290 | unsigned int _id = (id) >> 4 & 0xfff; \ |
282 | _id == 0x683 || _id == 0x693; \ | 291 | _id == 0x683 || _id == 0x693; \ |
283 | }) | 292 | }) |
293 | #else | ||
294 | #define __cpu_is_pxa93x(id) (0) | ||
295 | #endif | ||
284 | 296 | ||
285 | #define cpu_is_pxa2xx() \ | 297 | #define cpu_is_pxa2xx() \ |
286 | ({ \ | 298 | ({ \ |
@@ -309,7 +321,7 @@ extern unsigned long get_clock_tick_rate(void); | |||
309 | #define PCIBIOS_MIN_IO 0 | 321 | #define PCIBIOS_MIN_IO 0 |
310 | #define PCIBIOS_MIN_MEM 0 | 322 | #define PCIBIOS_MIN_MEM 0 |
311 | #define pcibios_assign_all_busses() 1 | 323 | #define pcibios_assign_all_busses() 1 |
324 | #define ARCH_HAS_DMA_SET_COHERENT_MASK | ||
312 | #endif | 325 | #endif |
313 | 326 | ||
314 | |||
315 | #endif /* _ASM_ARCH_HARDWARE_H */ | 327 | #endif /* _ASM_ARCH_HARDWARE_H */ |
diff --git a/arch/arm/mach-pxa/include/mach/hx4700.h b/arch/arm/mach-pxa/include/mach/hx4700.h index 9eaeed1f87f1..37408449ec25 100644 --- a/arch/arm/mach-pxa/include/mach/hx4700.h +++ b/arch/arm/mach-pxa/include/mach/hx4700.h | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #define HX4700_ASIC3_GPIO_BASE NR_BUILTIN_GPIO | 18 | #define HX4700_ASIC3_GPIO_BASE NR_BUILTIN_GPIO |
19 | #define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS) | 19 | #define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS) |
20 | #define HX4700_NR_IRQS (IRQ_BOARD_START + 70) | ||
20 | 21 | ||
21 | /* | 22 | /* |
22 | * PXA GPIOs | 23 | * PXA GPIOs |
diff --git a/arch/arm/mach-pxa/include/mach/io.h b/arch/arm/mach-pxa/include/mach/io.h index 262691fb97d8..fdca3be47d9b 100644 --- a/arch/arm/mach-pxa/include/mach/io.h +++ b/arch/arm/mach-pxa/include/mach/io.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #ifndef __ASM_ARM_ARCH_IO_H | 6 | #ifndef __ASM_ARM_ARCH_IO_H |
7 | #define __ASM_ARM_ARCH_IO_H | 7 | #define __ASM_ARM_ARCH_IO_H |
8 | 8 | ||
9 | #include <mach/hardware.h> | ||
10 | |||
9 | #define IO_SPACE_LIMIT 0xffffffff | 11 | #define IO_SPACE_LIMIT 0xffffffff |
10 | 12 | ||
11 | /* | 13 | /* |
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h index ffc8314520f2..d372caa75dc7 100644 --- a/arch/arm/mach-pxa/include/mach/irqs.h +++ b/arch/arm/mach-pxa/include/mach/irqs.h | |||
@@ -117,48 +117,12 @@ | |||
117 | /* | 117 | /* |
118 | * The following interrupts are for board specific purposes. Since | 118 | * The following interrupts are for board specific purposes. Since |
119 | * the kernel can only run on one machine at a time, we can re-use | 119 | * the kernel can only run on one machine at a time, we can re-use |
120 | * these. There will be 16 IRQs by default. If it is not enough, | 120 | * these. |
121 | * IRQ_BOARD_END is allowed be customized for each board, but keep | 121 | * By default, no board IRQ is reserved. It should be finished in |
122 | * the numbers within sensible limits and in descending order, so | 122 | * custom board since sparse IRQ is already enabled. |
123 | * when multiple config options are selected, the maximum will be | ||
124 | * used. | ||
125 | */ | 123 | */ |
126 | #define IRQ_BOARD_START (PXA_GPIO_IRQ_BASE + PXA_GPIO_IRQ_NUM) | 124 | #define IRQ_BOARD_START (PXA_GPIO_IRQ_BASE + PXA_GPIO_IRQ_NUM) |
127 | 125 | ||
128 | #if defined(CONFIG_MACH_H4700) | ||
129 | #define IRQ_BOARD_END (IRQ_BOARD_START + 70) | ||
130 | #elif defined(CONFIG_MACH_ZYLONITE) | ||
131 | #define IRQ_BOARD_END (IRQ_BOARD_START + 32) | ||
132 | #elif defined(CONFIG_PXA_EZX) | ||
133 | #define IRQ_BOARD_END (IRQ_BOARD_START + 23) | ||
134 | #else | ||
135 | #define IRQ_BOARD_END (IRQ_BOARD_START + 16) | ||
136 | #endif | ||
137 | |||
138 | /* | ||
139 | * Figure out the MAX IRQ number. | ||
140 | * | ||
141 | * If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1. | ||
142 | * If we have an LoCoMo, the max IRQ is IRQ_LOCOMO_SPI_TEND+1 | ||
143 | * Otherwise, we have the standard IRQs only. | ||
144 | */ | ||
145 | #ifdef CONFIG_SA1111 | ||
146 | #define NR_IRQS (IRQ_BOARD_END + 55) | ||
147 | #elif defined(CONFIG_PXA_HAVE_BOARD_IRQS) | ||
148 | #define NR_IRQS (IRQ_BOARD_END) | ||
149 | #else | ||
150 | #define NR_IRQS (IRQ_BOARD_START) | 126 | #define NR_IRQS (IRQ_BOARD_START) |
151 | #endif | ||
152 | |||
153 | /* add IT8152 IRQs beyond BOARD_END */ | ||
154 | #ifdef CONFIG_PCI_HOST_ITE8152 | ||
155 | #define IT8152_LAST_IRQ (IRQ_BOARD_END + 40) | ||
156 | |||
157 | #if NR_IRQS < (IT8152_LAST_IRQ+1) | ||
158 | #undef NR_IRQS | ||
159 | #define NR_IRQS (IT8152_LAST_IRQ+1) | ||
160 | #endif | ||
161 | |||
162 | #endif /* CONFIG_PCI_HOST_ITE8152 */ | ||
163 | 127 | ||
164 | #endif /* __ASM_MACH_IRQS_H */ | 128 | #endif /* __ASM_MACH_IRQS_H */ |
diff --git a/arch/arm/mach-pxa/include/mach/littleton.h b/arch/arm/mach-pxa/include/mach/littleton.h index 6c9b21c51322..2a5726c15e0e 100644 --- a/arch/arm/mach-pxa/include/mach/littleton.h +++ b/arch/arm/mach-pxa/include/mach/littleton.h | |||
@@ -10,4 +10,6 @@ | |||
10 | #define EXT0_GPIO_BASE (NR_BUILTIN_GPIO) | 10 | #define EXT0_GPIO_BASE (NR_BUILTIN_GPIO) |
11 | #define EXT0_GPIO(x) (EXT0_GPIO_BASE + (x)) | 11 | #define EXT0_GPIO(x) (EXT0_GPIO_BASE + (x)) |
12 | 12 | ||
13 | #define LITTLETON_NR_IRQS (IRQ_BOARD_START + 8) | ||
14 | |||
13 | #endif /* __ASM_ARCH_LITTLETON_H */ | 15 | #endif /* __ASM_ARCH_LITTLETON_H */ |
diff --git a/arch/arm/mach-pxa/include/mach/lpd270.h b/arch/arm/mach-pxa/include/mach/lpd270.h index 0e6440c81683..cd070092b6eb 100644 --- a/arch/arm/mach-pxa/include/mach/lpd270.h +++ b/arch/arm/mach-pxa/include/mach/lpd270.h | |||
@@ -38,5 +38,6 @@ | |||
38 | #define LPD270_USBC_IRQ LPD270_IRQ(2) | 38 | #define LPD270_USBC_IRQ LPD270_IRQ(2) |
39 | #define LPD270_ETHERNET_IRQ LPD270_IRQ(3) | 39 | #define LPD270_ETHERNET_IRQ LPD270_IRQ(3) |
40 | #define LPD270_AC97_IRQ LPD270_IRQ(4) | 40 | #define LPD270_AC97_IRQ LPD270_IRQ(4) |
41 | #define LPD270_NR_IRQS (IRQ_BOARD_START + 5) | ||
41 | 42 | ||
42 | #endif | 43 | #endif |
diff --git a/arch/arm/mach-pxa/include/mach/lubbock.h b/arch/arm/mach-pxa/include/mach/lubbock.h index a0d4247f08fc..2a086e8373eb 100644 --- a/arch/arm/mach-pxa/include/mach/lubbock.h +++ b/arch/arm/mach-pxa/include/mach/lubbock.h | |||
@@ -45,6 +45,9 @@ | |||
45 | #define LUBBOCK_USB_DISC_IRQ LUBBOCK_IRQ(6) /* usb disconnect */ | 45 | #define LUBBOCK_USB_DISC_IRQ LUBBOCK_IRQ(6) /* usb disconnect */ |
46 | #define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6) | 46 | #define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6) |
47 | 47 | ||
48 | #define LUBBOCK_SA1111_IRQ_BASE (IRQ_BOARD_START + 16) | ||
49 | #define LUBBOCK_NR_IRQS (IRQ_BOARD_START + 16 + 55) | ||
50 | |||
48 | #ifndef __ASSEMBLY__ | 51 | #ifndef __ASSEMBLY__ |
49 | extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set); | 52 | extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set); |
50 | #endif | 53 | #endif |
diff --git a/arch/arm/mach-pxa/include/mach/magician.h b/arch/arm/mach-pxa/include/mach/magician.h index 20ef37d4a9a7..0a2efcf7947c 100644 --- a/arch/arm/mach-pxa/include/mach/magician.h +++ b/arch/arm/mach-pxa/include/mach/magician.h | |||
@@ -71,6 +71,8 @@ | |||
71 | #define IRQ_MAGICIAN_BT (IRQ_BOARD_START + 2) | 71 | #define IRQ_MAGICIAN_BT (IRQ_BOARD_START + 2) |
72 | #define IRQ_MAGICIAN_VBUS (IRQ_BOARD_START + 3) | 72 | #define IRQ_MAGICIAN_VBUS (IRQ_BOARD_START + 3) |
73 | 73 | ||
74 | #define MAGICIAN_NR_IRQS (IRQ_BOARD_START + 8) | ||
75 | |||
74 | /* | 76 | /* |
75 | * CPLD EGPIOs | 77 | * CPLD EGPIOs |
76 | */ | 78 | */ |
diff --git a/arch/arm/mach-pxa/include/mach/mainstone.h b/arch/arm/mach-pxa/include/mach/mainstone.h index 86e623abd64d..4c2d11cd824d 100644 --- a/arch/arm/mach-pxa/include/mach/mainstone.h +++ b/arch/arm/mach-pxa/include/mach/mainstone.h | |||
@@ -134,4 +134,6 @@ | |||
134 | #define MAINSTONE_S1_STSCHG_IRQ MAINSTONE_IRQ(14) | 134 | #define MAINSTONE_S1_STSCHG_IRQ MAINSTONE_IRQ(14) |
135 | #define MAINSTONE_S1_IRQ MAINSTONE_IRQ(15) | 135 | #define MAINSTONE_S1_IRQ MAINSTONE_IRQ(15) |
136 | 136 | ||
137 | #define MAINSTONE_NR_IRQS (IRQ_BOARD_START + 16) | ||
138 | |||
137 | #endif | 139 | #endif |
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa930.h b/arch/arm/mach-pxa/include/mach/mfp-pxa930.h index 0d119d3b9221..04f7c97044f3 100644 --- a/arch/arm/mach-pxa/include/mach/mfp-pxa930.h +++ b/arch/arm/mach-pxa/include/mach/mfp-pxa930.h | |||
@@ -69,6 +69,7 @@ | |||
69 | #define nBE0_GPIO_60 MFP_CFG(nBE0, AF0) | 69 | #define nBE0_GPIO_60 MFP_CFG(nBE0, AF0) |
70 | #define nBE1_GPIO_61 MFP_CFG(nBE1, AF0) | 70 | #define nBE1_GPIO_61 MFP_CFG(nBE1, AF0) |
71 | #define RDY_GPIO_62 MFP_CFG(RDY, AF0) | 71 | #define RDY_GPIO_62 MFP_CFG(RDY, AF0) |
72 | #define PMIC_INT_GPIO83 MFP_CFG_LPM(PMIC_INT, AF0, PULL_HIGH) | ||
72 | 73 | ||
73 | /* Chip Select */ | 74 | /* Chip Select */ |
74 | #define DF_nCS0_nCS2 MFP_CFG_LPM(DF_nCS0, AF3, PULL_HIGH) | 75 | #define DF_nCS0_nCS2 MFP_CFG_LPM(DF_nCS0, AF3, PULL_HIGH) |
@@ -92,6 +93,9 @@ | |||
92 | #define GPIO63_CI2C_SCL MFP_CFG_LPM(GPIO63, AF4, PULL_HIGH) | 93 | #define GPIO63_CI2C_SCL MFP_CFG_LPM(GPIO63, AF4, PULL_HIGH) |
93 | #define GPIO64_CI2C_SDA MFP_CFG_LPM(GPIO64, AF4, PULL_HIGH) | 94 | #define GPIO64_CI2C_SDA MFP_CFG_LPM(GPIO64, AF4, PULL_HIGH) |
94 | 95 | ||
96 | #define GPIO73_CI2C_SCL MFP_CFG_LPM(GPIO73, AF1, PULL_HIGH) | ||
97 | #define GPIO74_CI2C_SDA MFP_CFG_LPM(GPIO74, AF1, PULL_HIGH) | ||
98 | |||
95 | #define GPIO77_CI2C_SCL MFP_CFG_LPM(GPIO77, AF2, PULL_HIGH) | 99 | #define GPIO77_CI2C_SCL MFP_CFG_LPM(GPIO77, AF2, PULL_HIGH) |
96 | #define GPIO78_CI2C_SDA MFP_CFG_LPM(GPIO78, AF2, PULL_HIGH) | 100 | #define GPIO78_CI2C_SDA MFP_CFG_LPM(GPIO78, AF2, PULL_HIGH) |
97 | 101 | ||
@@ -345,6 +349,9 @@ | |||
345 | #define GPIO69_UART1_CTS MFP_CFG(GPIO69, AF2) | 349 | #define GPIO69_UART1_CTS MFP_CFG(GPIO69, AF2) |
346 | #define GPIO70_UART1_RTS MFP_CFG(GPIO70, AF2) | 350 | #define GPIO70_UART1_RTS MFP_CFG(GPIO70, AF2) |
347 | 351 | ||
352 | #define GPIO53_UART1_TXD MFP_CFG(GPIO53, AF2) | ||
353 | #define GPIO54_UART1_RXD MFP_CFG(GPIO54, AF2) | ||
354 | |||
348 | /* UART2 - BTUART */ | 355 | /* UART2 - BTUART */ |
349 | #define GPIO91_UART2_RXD MFP_CFG(GPIO91, AF1) | 356 | #define GPIO91_UART2_RXD MFP_CFG(GPIO91, AF1) |
350 | #define GPIO92_UART2_TXD MFP_CFG(GPIO92, AF1) | 357 | #define GPIO92_UART2_TXD MFP_CFG(GPIO92, AF1) |
diff --git a/arch/arm/mach-pxa/include/mach/pcm027.h b/arch/arm/mach-pxa/include/mach/pcm027.h index 04083263167e..4bac588478a8 100644 --- a/arch/arm/mach-pxa/include/mach/pcm027.h +++ b/arch/arm/mach-pxa/include/mach/pcm027.h | |||
@@ -30,6 +30,8 @@ | |||
30 | #define PCM027_MMCDET_IRQ PCM027_IRQ(2) | 30 | #define PCM027_MMCDET_IRQ PCM027_IRQ(2) |
31 | #define PCM027_PM_5V_IRQ PCM027_IRQ(3) | 31 | #define PCM027_PM_5V_IRQ PCM027_IRQ(3) |
32 | 32 | ||
33 | #define PCM027_NR_IRQS (IRQ_BOARD_START + 32) | ||
34 | |||
33 | /* I2C RTC */ | 35 | /* I2C RTC */ |
34 | #define PCM027_RTC_IRQ_GPIO 0 | 36 | #define PCM027_RTC_IRQ_GPIO 0 |
35 | #define PCM027_RTC_IRQ IRQ_GPIO(PCM027_RTC_IRQ_GPIO) | 37 | #define PCM027_RTC_IRQ IRQ_GPIO(PCM027_RTC_IRQ_GPIO) |
diff --git a/arch/arm/mach-pxa/include/mach/poodle.h b/arch/arm/mach-pxa/include/mach/poodle.h index 0b3e6d051c64..83d1cfd00fc9 100644 --- a/arch/arm/mach-pxa/include/mach/poodle.h +++ b/arch/arm/mach-pxa/include/mach/poodle.h | |||
@@ -85,6 +85,8 @@ | |||
85 | #define POODLE_LOCOMO_GPIO_232VCC_ON LOCOMO_GPIO(12) | 85 | #define POODLE_LOCOMO_GPIO_232VCC_ON LOCOMO_GPIO(12) |
86 | #define POODLE_LOCOMO_GPIO_JK_B LOCOMO_GPIO(13) | 86 | #define POODLE_LOCOMO_GPIO_JK_B LOCOMO_GPIO(13) |
87 | 87 | ||
88 | #define POODLE_NR_IRQS (IRQ_BOARD_START + 4) /* 4 for LoCoMo */ | ||
89 | |||
88 | extern struct platform_device poodle_locomo_device; | 90 | extern struct platform_device poodle_locomo_device; |
89 | 91 | ||
90 | #endif /* __ASM_ARCH_POODLE_H */ | 92 | #endif /* __ASM_ARCH_POODLE_H */ |
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h b/arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h new file mode 100644 index 000000000000..9d82cb65ea56 --- /dev/null +++ b/arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * PXA3xx U2D header | ||
3 | * | ||
4 | * Copyright (C) 2010 CompuLab Ltd. | ||
5 | * | ||
6 | * Igor Grinberg <grinberg@compulab.co.il> | ||
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 version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | #ifndef __PXA310_U2D__ | ||
13 | #define __PXA310_U2D__ | ||
14 | |||
15 | #include <linux/usb/ulpi.h> | ||
16 | |||
17 | struct pxa3xx_u2d_platform_data { | ||
18 | |||
19 | #define ULPI_SER_6PIN (1 << 0) | ||
20 | #define ULPI_SER_3PIN (1 << 1) | ||
21 | unsigned int ulpi_mode; | ||
22 | |||
23 | int (*init)(struct device *); | ||
24 | void (*exit)(struct device *); | ||
25 | }; | ||
26 | |||
27 | |||
28 | /* Start PXA3xx U2D host */ | ||
29 | int pxa3xx_u2d_start_hc(struct usb_bus *host); | ||
30 | /* Stop PXA3xx U2D host */ | ||
31 | void pxa3xx_u2d_stop_hc(struct usb_bus *host); | ||
32 | |||
33 | extern void pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info); | ||
34 | |||
35 | #endif /* __PXA310_U2D__ */ | ||
diff --git a/arch/arm/mach-pxa/include/mach/tosa.h b/arch/arm/mach-pxa/include/mach/tosa.h index 1bbd1f2e4beb..1272c4b56ceb 100644 --- a/arch/arm/mach-pxa/include/mach/tosa.h +++ b/arch/arm/mach-pxa/include/mach/tosa.h | |||
@@ -20,6 +20,7 @@ | |||
20 | /* Jacket Scoop */ | 20 | /* Jacket Scoop */ |
21 | #define TOSA_SCOOP_PHYS (PXA_CS5_PHYS + 0x00800000) | 21 | #define TOSA_SCOOP_PHYS (PXA_CS5_PHYS + 0x00800000) |
22 | 22 | ||
23 | #define TOSA_NR_IRQS (IRQ_BOARD_START + TC6393XB_NR_IRQS) | ||
23 | /* | 24 | /* |
24 | * SCOOP2 internal GPIOs | 25 | * SCOOP2 internal GPIOs |
25 | */ | 26 | */ |
diff --git a/arch/arm/mach-pxa/include/mach/zeus.h b/arch/arm/mach-pxa/include/mach/zeus.h index 6e119976003e..faa408ab7ad7 100644 --- a/arch/arm/mach-pxa/include/mach/zeus.h +++ b/arch/arm/mach-pxa/include/mach/zeus.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #ifndef _MACH_ZEUS_H | 15 | #ifndef _MACH_ZEUS_H |
16 | #define _MACH_ZEUS_H | 16 | #define _MACH_ZEUS_H |
17 | 17 | ||
18 | #define ZEUS_NR_IRQS (IRQ_BOARD_START + 48) | ||
19 | |||
18 | /* Physical addresses */ | 20 | /* Physical addresses */ |
19 | #define ZEUS_FLASH_PHYS PXA_CS0_PHYS | 21 | #define ZEUS_FLASH_PHYS PXA_CS0_PHYS |
20 | #define ZEUS_ETH0_PHYS PXA_CS1_PHYS | 22 | #define ZEUS_ETH0_PHYS PXA_CS1_PHYS |
diff --git a/arch/arm/mach-pxa/include/mach/zylonite.h b/arch/arm/mach-pxa/include/mach/zylonite.h index 9edf645368d6..ea24998b923c 100644 --- a/arch/arm/mach-pxa/include/mach/zylonite.h +++ b/arch/arm/mach-pxa/include/mach/zylonite.h | |||
@@ -5,6 +5,8 @@ | |||
5 | 5 | ||
6 | #define EXT_GPIO(x) (128 + (x)) | 6 | #define EXT_GPIO(x) (128 + (x)) |
7 | 7 | ||
8 | #define ZYLONITE_NR_IRQS (IRQ_BOARD_START + 32) | ||
9 | |||
8 | /* the following variables are processor specific and initialized | 10 | /* the following variables are processor specific and initialized |
9 | * by the corresponding zylonite_pxa3xx_init() | 11 | * by the corresponding zylonite_pxa3xx_init() |
10 | */ | 12 | */ |
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c index 9b9046185b00..eb5850624c1d 100644 --- a/arch/arm/mach-pxa/littleton.c +++ b/arch/arm/mach-pxa/littleton.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #include <mach/pxafb.h> | 43 | #include <mach/pxafb.h> |
44 | #include <mach/mmc.h> | 44 | #include <mach/mmc.h> |
45 | #include <mach/pxa2xx_spi.h> | 45 | #include <mach/pxa2xx_spi.h> |
46 | #include <mach/pxa27x_keypad.h> | 46 | #include <plat/pxa27x_keypad.h> |
47 | #include <mach/littleton.h> | 47 | #include <mach/littleton.h> |
48 | #include <plat/i2c.h> | 48 | #include <plat/i2c.h> |
49 | #include <plat/pxa3xx_nand.h> | 49 | #include <plat/pxa3xx_nand.h> |
@@ -441,6 +441,7 @@ MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleto | |||
441 | .boot_params = 0xa0000100, | 441 | .boot_params = 0xa0000100, |
442 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 442 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
443 | .map_io = pxa_map_io, | 443 | .map_io = pxa_map_io, |
444 | .nr_irqs = LITTLETON_NR_IRQS, | ||
444 | .init_irq = pxa3xx_init_irq, | 445 | .init_irq = pxa3xx_init_irq, |
445 | .timer = &pxa_timer, | 446 | .timer = &pxa_timer, |
446 | .init_machine = littleton_init, | 447 | .init_machine = littleton_init, |
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index d279507fc748..fc9502ef4024 100644 --- a/arch/arm/mach-pxa/lpd270.c +++ b/arch/arm/mach-pxa/lpd270.c | |||
@@ -509,6 +509,7 @@ MACHINE_START(LOGICPD_PXA270, "LogicPD PXA270 Card Engine") | |||
509 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 509 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
510 | .boot_params = 0xa0000100, | 510 | .boot_params = 0xa0000100, |
511 | .map_io = lpd270_map_io, | 511 | .map_io = lpd270_map_io, |
512 | .nr_irqs = LPD270_NR_IRQS, | ||
512 | .init_irq = lpd270_init_irq, | 513 | .init_irq = lpd270_init_irq, |
513 | .timer = &pxa_timer, | 514 | .timer = &pxa_timer, |
514 | .init_machine = lpd270_init, | 515 | .init_machine = lpd270_init, |
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 330c3282856e..1956c23093d1 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c | |||
@@ -229,7 +229,7 @@ static struct resource sa1111_resources[] = { | |||
229 | }; | 229 | }; |
230 | 230 | ||
231 | static struct sa1111_platform_data sa1111_info = { | 231 | static struct sa1111_platform_data sa1111_info = { |
232 | .irq_base = IRQ_BOARD_END, | 232 | .irq_base = LUBBOCK_SA1111_IRQ_BASE, |
233 | }; | 233 | }; |
234 | 234 | ||
235 | static struct platform_device sa1111_device = { | 235 | static struct platform_device sa1111_device = { |
@@ -560,6 +560,7 @@ MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)") | |||
560 | .phys_io = 0x40000000, | 560 | .phys_io = 0x40000000, |
561 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 561 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
562 | .map_io = lubbock_map_io, | 562 | .map_io = lubbock_map_io, |
563 | .nr_irqs = LUBBOCK_NR_IRQS, | ||
563 | .init_irq = lubbock_init_irq, | 564 | .init_irq = lubbock_init_irq, |
564 | .timer = &pxa_timer, | 565 | .timer = &pxa_timer, |
565 | .init_machine = lubbock_init, | 566 | .init_machine = lubbock_init, |
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c index e81dd0c8e40d..42a0c2b41281 100644 --- a/arch/arm/mach-pxa/magician.c +++ b/arch/arm/mach-pxa/magician.c | |||
@@ -768,6 +768,7 @@ MACHINE_START(MAGICIAN, "HTC Magician") | |||
768 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 768 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
769 | .boot_params = 0xa0000100, | 769 | .boot_params = 0xa0000100, |
770 | .map_io = pxa_map_io, | 770 | .map_io = pxa_map_io, |
771 | .nr_irqs = MAGICIAN_NR_IRQS, | ||
771 | .init_irq = pxa27x_init_irq, | 772 | .init_irq = pxa27x_init_irq, |
772 | .init_machine = magician_init, | 773 | .init_machine = magician_init, |
773 | .timer = &pxa_timer, | 774 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 5543c64da9ef..8b710024601c 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -50,7 +50,7 @@ | |||
50 | #include <mach/mmc.h> | 50 | #include <mach/mmc.h> |
51 | #include <mach/irda.h> | 51 | #include <mach/irda.h> |
52 | #include <mach/ohci.h> | 52 | #include <mach/ohci.h> |
53 | #include <mach/pxa27x_keypad.h> | 53 | #include <plat/pxa27x_keypad.h> |
54 | 54 | ||
55 | #include "generic.h" | 55 | #include "generic.h" |
56 | #include "devices.h" | 56 | #include "devices.h" |
@@ -628,6 +628,7 @@ MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") | |||
628 | .boot_params = 0xa0000100, /* BLOB boot parameter setting */ | 628 | .boot_params = 0xa0000100, /* BLOB boot parameter setting */ |
629 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 629 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
630 | .map_io = mainstone_map_io, | 630 | .map_io = mainstone_map_io, |
631 | .nr_irqs = MAINSTONE_NR_IRQS, | ||
631 | .init_irq = mainstone_init_irq, | 632 | .init_irq = mainstone_init_irq, |
632 | .timer = &pxa_timer, | 633 | .timer = &pxa_timer, |
633 | .init_machine = mainstone_init, | 634 | .init_machine = mainstone_init, |
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index dc66942ef9ab..ffb3f5a8a086 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | #include <mach/pxa27x.h> | 46 | #include <mach/pxa27x.h> |
47 | #include <mach/regs-rtc.h> | 47 | #include <mach/regs-rtc.h> |
48 | #include <mach/pxa27x_keypad.h> | 48 | #include <plat/pxa27x_keypad.h> |
49 | #include <mach/pxafb.h> | 49 | #include <mach/pxafb.h> |
50 | #include <mach/mmc.h> | 50 | #include <mach/mmc.h> |
51 | #include <mach/udc.h> | 51 | #include <mach/udc.h> |
diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c index 77ad6d34ab5b..405b92a29793 100644 --- a/arch/arm/mach-pxa/palm27x.c +++ b/arch/arm/mach-pxa/palm27x.c | |||
@@ -469,9 +469,13 @@ static struct i2c_board_info __initdata palm27x_pi2c_board_info[] = { | |||
469 | }, | 469 | }, |
470 | }; | 470 | }; |
471 | 471 | ||
472 | static struct i2c_pxa_platform_data palm27x_i2c_power_info = { | ||
473 | .use_pio = 1, | ||
474 | }; | ||
475 | |||
472 | void __init palm27x_pmic_init(void) | 476 | void __init palm27x_pmic_init(void) |
473 | { | 477 | { |
474 | i2c_register_board_info(1, ARRAY_AND_SIZE(palm27x_pi2c_board_info)); | 478 | i2c_register_board_info(1, ARRAY_AND_SIZE(palm27x_pi2c_board_info)); |
475 | pxa27x_set_i2c_power_info(NULL); | 479 | pxa27x_set_i2c_power_info(&palm27x_i2c_power_info); |
476 | } | 480 | } |
477 | #endif | 481 | #endif |
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c index 91038eeafe44..3ff0c4a1ca4c 100644 --- a/arch/arm/mach-pxa/palmld.c +++ b/arch/arm/mach-pxa/palmld.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <mach/mmc.h> | 39 | #include <mach/mmc.h> |
40 | #include <mach/pxafb.h> | 40 | #include <mach/pxafb.h> |
41 | #include <mach/irda.h> | 41 | #include <mach/irda.h> |
42 | #include <mach/pxa27x_keypad.h> | 42 | #include <plat/pxa27x_keypad.h> |
43 | #include <mach/palmasoc.h> | 43 | #include <mach/palmasoc.h> |
44 | #include <mach/palm27x.h> | 44 | #include <mach/palm27x.h> |
45 | 45 | ||
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c index 1c281995f658..5b9f766d1468 100644 --- a/arch/arm/mach-pxa/palmt5.c +++ b/arch/arm/mach-pxa/palmt5.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <mach/mmc.h> | 39 | #include <mach/mmc.h> |
40 | #include <mach/pxafb.h> | 40 | #include <mach/pxafb.h> |
41 | #include <mach/irda.h> | 41 | #include <mach/irda.h> |
42 | #include <mach/pxa27x_keypad.h> | 42 | #include <plat/pxa27x_keypad.h> |
43 | #include <mach/udc.h> | 43 | #include <mach/udc.h> |
44 | #include <mach/palmasoc.h> | 44 | #include <mach/palmasoc.h> |
45 | #include <mach/palm27x.h> | 45 | #include <mach/palm27x.h> |
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c index 52defd5e42e5..f685a600a181 100644 --- a/arch/arm/mach-pxa/palmtreo.c +++ b/arch/arm/mach-pxa/palmtreo.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <mach/mmc.h> | 39 | #include <mach/mmc.h> |
40 | #include <mach/pxafb.h> | 40 | #include <mach/pxafb.h> |
41 | #include <mach/irda.h> | 41 | #include <mach/irda.h> |
42 | #include <mach/pxa27x_keypad.h> | 42 | #include <plat/pxa27x_keypad.h> |
43 | #include <mach/udc.h> | 43 | #include <mach/udc.h> |
44 | #include <mach/ohci.h> | 44 | #include <mach/ohci.h> |
45 | #include <mach/pxa2xx-regs.h> | 45 | #include <mach/pxa2xx-regs.h> |
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c index 144dc2b6911f..89a37922b9d3 100644 --- a/arch/arm/mach-pxa/palmtx.c +++ b/arch/arm/mach-pxa/palmtx.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #include <mach/mmc.h> | 43 | #include <mach/mmc.h> |
44 | #include <mach/pxafb.h> | 44 | #include <mach/pxafb.h> |
45 | #include <mach/irda.h> | 45 | #include <mach/irda.h> |
46 | #include <mach/pxa27x_keypad.h> | 46 | #include <plat/pxa27x_keypad.h> |
47 | #include <mach/udc.h> | 47 | #include <mach/udc.h> |
48 | #include <mach/palmasoc.h> | 48 | #include <mach/palmasoc.h> |
49 | #include <mach/palm27x.h> | 49 | #include <mach/palm27x.h> |
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c index 87e4b1044e0b..38f4425bfc95 100644 --- a/arch/arm/mach-pxa/palmz72.c +++ b/arch/arm/mach-pxa/palmz72.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #include <mach/mmc.h> | 41 | #include <mach/mmc.h> |
42 | #include <mach/pxafb.h> | 42 | #include <mach/pxafb.h> |
43 | #include <mach/irda.h> | 43 | #include <mach/irda.h> |
44 | #include <mach/pxa27x_keypad.h> | 44 | #include <plat/pxa27x_keypad.h> |
45 | #include <mach/udc.h> | 45 | #include <mach/udc.h> |
46 | #include <mach/palmasoc.h> | 46 | #include <mach/palmasoc.h> |
47 | #include <mach/palm27x.h> | 47 | #include <mach/palm27x.h> |
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c index 2190af066470..90b08ba8ad1a 100644 --- a/arch/arm/mach-pxa/pcm027.c +++ b/arch/arm/mach-pxa/pcm027.c | |||
@@ -262,6 +262,7 @@ MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270") | |||
262 | .phys_io = 0x40000000, | 262 | .phys_io = 0x40000000, |
263 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 263 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
264 | .map_io = pcm027_map_io, | 264 | .map_io = pcm027_map_io, |
265 | .nr_irqs = PCM027_NR_IRQS, | ||
265 | .init_irq = pxa27x_init_irq, | 266 | .init_irq = pxa27x_init_irq, |
266 | .timer = &pxa_timer, | 267 | .timer = &pxa_timer, |
267 | .init_machine = pcm027_init, | 268 | .init_machine = pcm027_init, |
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 55e8fcde0141..c04e025cd790 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c | |||
@@ -469,6 +469,7 @@ MACHINE_START(POODLE, "SHARP Poodle") | |||
469 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 469 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
470 | .fixup = fixup_poodle, | 470 | .fixup = fixup_poodle, |
471 | .map_io = pxa_map_io, | 471 | .map_io = pxa_map_io, |
472 | .nr_irqs = POODLE_NR_IRQS, /* 4 for LoCoMo */ | ||
472 | .init_irq = pxa25x_init_irq, | 473 | .init_irq = pxa25x_init_irq, |
473 | .timer = &pxa_timer, | 474 | .timer = &pxa_timer, |
474 | .init_machine = poodle_init, | 475 | .init_machine = poodle_init, |
diff --git a/arch/arm/mach-pxa/pxa3xx-ulpi.c b/arch/arm/mach-pxa/pxa3xx-ulpi.c new file mode 100644 index 000000000000..ce7168b233e2 --- /dev/null +++ b/arch/arm/mach-pxa/pxa3xx-ulpi.c | |||
@@ -0,0 +1,400 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/pxa3xx-ulpi.c | ||
3 | * | ||
4 | * code specific to pxa3xx aka Monahans | ||
5 | * | ||
6 | * Copyright (C) 2010 CompuLab Ltd. | ||
7 | * | ||
8 | * 2010-13-07: Igor Grinberg <grinberg@compulab.co.il> | ||
9 | * initial version: pxa310 USB Host mode support | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | */ | ||
15 | |||
16 | #include <linux/module.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/slab.h> | ||
19 | #include <linux/device.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/err.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/delay.h> | ||
24 | #include <linux/clk.h> | ||
25 | #include <linux/usb.h> | ||
26 | #include <linux/usb/otg.h> | ||
27 | |||
28 | #include <mach/hardware.h> | ||
29 | #include <mach/regs-u2d.h> | ||
30 | #include <mach/pxa3xx-u2d.h> | ||
31 | |||
32 | struct pxa3xx_u2d_ulpi { | ||
33 | struct clk *clk; | ||
34 | void __iomem *mmio_base; | ||
35 | |||
36 | struct otg_transceiver *otg; | ||
37 | unsigned int ulpi_mode; | ||
38 | }; | ||
39 | |||
40 | static struct pxa3xx_u2d_ulpi *u2d; | ||
41 | |||
42 | static inline u32 u2d_readl(u32 reg) | ||
43 | { | ||
44 | return __raw_readl(u2d->mmio_base + reg); | ||
45 | } | ||
46 | |||
47 | static inline void u2d_writel(u32 reg, u32 val) | ||
48 | { | ||
49 | __raw_writel(val, u2d->mmio_base + reg); | ||
50 | } | ||
51 | |||
52 | #if defined(CONFIG_PXA310_ULPI) | ||
53 | enum u2d_ulpi_phy_mode { | ||
54 | SYNCH = 0, | ||
55 | CARKIT = (1 << 0), | ||
56 | SER_3PIN = (1 << 1), | ||
57 | SER_6PIN = (1 << 2), | ||
58 | LOWPOWER = (1 << 3), | ||
59 | }; | ||
60 | |||
61 | static inline enum u2d_ulpi_phy_mode pxa310_ulpi_get_phymode(void) | ||
62 | { | ||
63 | return (u2d_readl(U2DOTGUSR) >> 28) & 0xF; | ||
64 | } | ||
65 | |||
66 | static int pxa310_ulpi_poll(void) | ||
67 | { | ||
68 | int timeout = 50000; | ||
69 | |||
70 | while (timeout--) { | ||
71 | if (!(u2d_readl(U2DOTGUCR) & U2DOTGUCR_RUN)) | ||
72 | return 0; | ||
73 | |||
74 | cpu_relax(); | ||
75 | } | ||
76 | |||
77 | pr_warning("%s: ULPI access timed out!\n", __func__); | ||
78 | |||
79 | return -ETIMEDOUT; | ||
80 | } | ||
81 | |||
82 | static int pxa310_ulpi_read(struct otg_transceiver *otg, u32 reg) | ||
83 | { | ||
84 | int err; | ||
85 | |||
86 | if (pxa310_ulpi_get_phymode() != SYNCH) { | ||
87 | pr_warning("%s: PHY is not in SYNCH mode!\n", __func__); | ||
88 | return -EBUSY; | ||
89 | } | ||
90 | |||
91 | u2d_writel(U2DOTGUCR, U2DOTGUCR_RUN | U2DOTGUCR_RNW | (reg << 16)); | ||
92 | msleep(5); | ||
93 | |||
94 | err = pxa310_ulpi_poll(); | ||
95 | if (err) | ||
96 | return err; | ||
97 | |||
98 | return u2d_readl(U2DOTGUCR) & U2DOTGUCR_RDATA; | ||
99 | } | ||
100 | |||
101 | static int pxa310_ulpi_write(struct otg_transceiver *otg, u32 val, u32 reg) | ||
102 | { | ||
103 | if (pxa310_ulpi_get_phymode() != SYNCH) { | ||
104 | pr_warning("%s: PHY is not in SYNCH mode!\n", __func__); | ||
105 | return -EBUSY; | ||
106 | } | ||
107 | |||
108 | u2d_writel(U2DOTGUCR, U2DOTGUCR_RUN | (reg << 16) | (val << 8)); | ||
109 | msleep(5); | ||
110 | |||
111 | return pxa310_ulpi_poll(); | ||
112 | } | ||
113 | |||
114 | struct otg_io_access_ops pxa310_ulpi_access_ops = { | ||
115 | .read = pxa310_ulpi_read, | ||
116 | .write = pxa310_ulpi_write, | ||
117 | }; | ||
118 | |||
119 | static void pxa310_otg_transceiver_rtsm(void) | ||
120 | { | ||
121 | u32 u2dotgcr; | ||
122 | |||
123 | /* put PHY to sync mode */ | ||
124 | u2dotgcr = u2d_readl(U2DOTGCR); | ||
125 | u2dotgcr |= U2DOTGCR_RTSM | U2DOTGCR_UTMID; | ||
126 | u2d_writel(U2DOTGCR, u2dotgcr); | ||
127 | msleep(10); | ||
128 | |||
129 | /* setup OTG sync mode */ | ||
130 | u2dotgcr = u2d_readl(U2DOTGCR); | ||
131 | u2dotgcr |= U2DOTGCR_ULAF; | ||
132 | u2dotgcr &= ~(U2DOTGCR_SMAF | U2DOTGCR_CKAF); | ||
133 | u2d_writel(U2DOTGCR, u2dotgcr); | ||
134 | } | ||
135 | |||
136 | static int pxa310_start_otg_host_transcvr(struct usb_bus *host) | ||
137 | { | ||
138 | int err; | ||
139 | |||
140 | pxa310_otg_transceiver_rtsm(); | ||
141 | |||
142 | err = otg_init(u2d->otg); | ||
143 | if (err) { | ||
144 | pr_err("OTG transceiver init failed"); | ||
145 | return err; | ||
146 | } | ||
147 | |||
148 | err = otg_set_vbus(u2d->otg, 1); | ||
149 | if (err) { | ||
150 | pr_err("OTG transceiver VBUS set failed"); | ||
151 | return err; | ||
152 | } | ||
153 | |||
154 | err = otg_set_host(u2d->otg, host); | ||
155 | if (err) | ||
156 | pr_err("OTG transceiver Host mode set failed"); | ||
157 | |||
158 | return err; | ||
159 | } | ||
160 | |||
161 | static int pxa310_start_otg_hc(struct usb_bus *host) | ||
162 | { | ||
163 | u32 u2dotgcr; | ||
164 | int err; | ||
165 | |||
166 | /* disable USB device controller */ | ||
167 | u2d_writel(U2DCR, u2d_readl(U2DCR) & ~U2DCR_UDE); | ||
168 | u2d_writel(U2DOTGCR, u2d_readl(U2DOTGCR) | U2DOTGCR_UTMID); | ||
169 | u2d_writel(U2DOTGICR, u2d_readl(U2DOTGICR) & ~0x37F7F); | ||
170 | |||
171 | err = pxa310_start_otg_host_transcvr(host); | ||
172 | if (err) | ||
173 | return err; | ||
174 | |||
175 | /* set xceiver mode */ | ||
176 | if (u2d->ulpi_mode & ULPI_IC_6PIN_SERIAL) | ||
177 | u2d_writel(U2DP3CR, u2d_readl(U2DP3CR) & ~U2DP3CR_P2SS); | ||
178 | else if (u2d->ulpi_mode & ULPI_IC_3PIN_SERIAL) | ||
179 | u2d_writel(U2DP3CR, u2d_readl(U2DP3CR) | U2DP3CR_P2SS); | ||
180 | |||
181 | /* start OTG host controller */ | ||
182 | u2dotgcr = u2d_readl(U2DOTGCR) | U2DOTGCR_SMAF; | ||
183 | u2d_writel(U2DOTGCR, u2dotgcr & ~(U2DOTGCR_ULAF | U2DOTGCR_CKAF)); | ||
184 | |||
185 | return 0; | ||
186 | } | ||
187 | |||
188 | static void pxa310_stop_otg_hc(void) | ||
189 | { | ||
190 | pxa310_otg_transceiver_rtsm(); | ||
191 | |||
192 | otg_set_host(u2d->otg, NULL); | ||
193 | otg_set_vbus(u2d->otg, 0); | ||
194 | otg_shutdown(u2d->otg); | ||
195 | } | ||
196 | |||
197 | static void pxa310_u2d_setup_otg_hc(void) | ||
198 | { | ||
199 | u32 u2dotgcr; | ||
200 | |||
201 | u2dotgcr = u2d_readl(U2DOTGCR); | ||
202 | u2dotgcr |= U2DOTGCR_ULAF | U2DOTGCR_UTMID; | ||
203 | u2dotgcr &= ~(U2DOTGCR_SMAF | U2DOTGCR_CKAF); | ||
204 | u2d_writel(U2DOTGCR, u2dotgcr); | ||
205 | msleep(5); | ||
206 | u2d_writel(U2DOTGCR, u2dotgcr | U2DOTGCR_ULE); | ||
207 | msleep(5); | ||
208 | u2d_writel(U2DOTGICR, u2d_readl(U2DOTGICR) & ~0x37F7F); | ||
209 | } | ||
210 | |||
211 | static int pxa310_otg_init(struct pxa3xx_u2d_platform_data *pdata) | ||
212 | { | ||
213 | unsigned int ulpi_mode = ULPI_OTG_DRVVBUS; | ||
214 | |||
215 | if (pdata) { | ||
216 | if (pdata->ulpi_mode & ULPI_SER_6PIN) | ||
217 | ulpi_mode |= ULPI_IC_6PIN_SERIAL; | ||
218 | else if (pdata->ulpi_mode & ULPI_SER_3PIN) | ||
219 | ulpi_mode |= ULPI_IC_3PIN_SERIAL; | ||
220 | } | ||
221 | |||
222 | u2d->ulpi_mode = ulpi_mode; | ||
223 | |||
224 | u2d->otg = otg_ulpi_create(&pxa310_ulpi_access_ops, ulpi_mode); | ||
225 | if (!u2d->otg) | ||
226 | return -ENOMEM; | ||
227 | |||
228 | u2d->otg->io_priv = u2d->mmio_base; | ||
229 | |||
230 | return 0; | ||
231 | } | ||
232 | |||
233 | static void pxa310_otg_exit(void) | ||
234 | { | ||
235 | kfree(u2d->otg); | ||
236 | } | ||
237 | #else | ||
238 | static inline void pxa310_u2d_setup_otg_hc(void) {} | ||
239 | static inline int pxa310_start_otg_hc(struct usb_bus *host) | ||
240 | { | ||
241 | return 0; | ||
242 | } | ||
243 | static inline void pxa310_stop_otg_hc(void) {} | ||
244 | static inline int pxa310_otg_init(struct pxa3xx_u2d_platform_data *pdata) | ||
245 | { | ||
246 | return 0; | ||
247 | } | ||
248 | static inline void pxa310_otg_exit(void) {} | ||
249 | #endif /* CONFIG_PXA310_ULPI */ | ||
250 | |||
251 | int pxa3xx_u2d_start_hc(struct usb_bus *host) | ||
252 | { | ||
253 | int err = 0; | ||
254 | |||
255 | /* In case the PXA3xx ULPI isn't used, do nothing. */ | ||
256 | if (!u2d) | ||
257 | return 0; | ||
258 | |||
259 | clk_enable(u2d->clk); | ||
260 | |||
261 | if (cpu_is_pxa310()) { | ||
262 | pxa310_u2d_setup_otg_hc(); | ||
263 | err = pxa310_start_otg_hc(host); | ||
264 | } | ||
265 | |||
266 | return err; | ||
267 | } | ||
268 | |||
269 | void pxa3xx_u2d_stop_hc(struct usb_bus *host) | ||
270 | { | ||
271 | /* In case the PXA3xx ULPI isn't used, do nothing. */ | ||
272 | if (!u2d) | ||
273 | return; | ||
274 | |||
275 | if (cpu_is_pxa310()) | ||
276 | pxa310_stop_otg_hc(); | ||
277 | |||
278 | clk_disable(u2d->clk); | ||
279 | } | ||
280 | |||
281 | static int pxa3xx_u2d_probe(struct platform_device *pdev) | ||
282 | { | ||
283 | struct pxa3xx_u2d_platform_data *pdata = pdev->dev.platform_data; | ||
284 | struct resource *r; | ||
285 | int err; | ||
286 | |||
287 | u2d = kzalloc(sizeof(struct pxa3xx_u2d_ulpi), GFP_KERNEL); | ||
288 | if (!u2d) { | ||
289 | dev_err(&pdev->dev, "failed to allocate memory\n"); | ||
290 | return -ENOMEM; | ||
291 | } | ||
292 | |||
293 | u2d->clk = clk_get(&pdev->dev, NULL); | ||
294 | if (IS_ERR(u2d->clk)) { | ||
295 | dev_err(&pdev->dev, "failed to get u2d clock\n"); | ||
296 | err = PTR_ERR(u2d->clk); | ||
297 | goto err_free_mem; | ||
298 | } | ||
299 | |||
300 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
301 | if (!r) { | ||
302 | dev_err(&pdev->dev, "no IO memory resource defined\n"); | ||
303 | err = -ENODEV; | ||
304 | goto err_put_clk; | ||
305 | } | ||
306 | |||
307 | r = request_mem_region(r->start, resource_size(r), pdev->name); | ||
308 | if (!r) { | ||
309 | dev_err(&pdev->dev, "failed to request memory resource\n"); | ||
310 | err = -EBUSY; | ||
311 | goto err_put_clk; | ||
312 | } | ||
313 | |||
314 | u2d->mmio_base = ioremap(r->start, resource_size(r)); | ||
315 | if (!u2d->mmio_base) { | ||
316 | dev_err(&pdev->dev, "ioremap() failed\n"); | ||
317 | err = -ENODEV; | ||
318 | goto err_free_res; | ||
319 | } | ||
320 | |||
321 | if (pdata->init) { | ||
322 | err = pdata->init(&pdev->dev); | ||
323 | if (err) | ||
324 | goto err_free_io; | ||
325 | } | ||
326 | |||
327 | /* Only PXA310 U2D has OTG functionality */ | ||
328 | if (cpu_is_pxa310()) { | ||
329 | err = pxa310_otg_init(pdata); | ||
330 | if (err) | ||
331 | goto err_free_plat; | ||
332 | } | ||
333 | |||
334 | platform_set_drvdata(pdev, &u2d); | ||
335 | |||
336 | return 0; | ||
337 | |||
338 | err_free_plat: | ||
339 | if (pdata->exit) | ||
340 | pdata->exit(&pdev->dev); | ||
341 | err_free_io: | ||
342 | iounmap(u2d->mmio_base); | ||
343 | err_free_res: | ||
344 | release_mem_region(r->start, resource_size(r)); | ||
345 | err_put_clk: | ||
346 | clk_put(u2d->clk); | ||
347 | err_free_mem: | ||
348 | kfree(u2d); | ||
349 | return err; | ||
350 | } | ||
351 | |||
352 | static int pxa3xx_u2d_remove(struct platform_device *pdev) | ||
353 | { | ||
354 | struct pxa3xx_u2d_platform_data *pdata = pdev->dev.platform_data; | ||
355 | struct resource *r; | ||
356 | |||
357 | if (cpu_is_pxa310()) { | ||
358 | pxa310_stop_otg_hc(); | ||
359 | pxa310_otg_exit(); | ||
360 | } | ||
361 | |||
362 | if (pdata->exit) | ||
363 | pdata->exit(&pdev->dev); | ||
364 | |||
365 | platform_set_drvdata(pdev, NULL); | ||
366 | iounmap(u2d->mmio_base); | ||
367 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
368 | release_mem_region(r->start, resource_size(r)); | ||
369 | |||
370 | clk_put(u2d->clk); | ||
371 | |||
372 | kfree(u2d); | ||
373 | |||
374 | return 0; | ||
375 | } | ||
376 | |||
377 | static struct platform_driver pxa3xx_u2d_ulpi_driver = { | ||
378 | .driver = { | ||
379 | .name = "pxa3xx-u2d", | ||
380 | .owner = THIS_MODULE, | ||
381 | }, | ||
382 | .probe = pxa3xx_u2d_probe, | ||
383 | .remove = pxa3xx_u2d_remove, | ||
384 | }; | ||
385 | |||
386 | static int pxa3xx_u2d_ulpi_init(void) | ||
387 | { | ||
388 | return platform_driver_register(&pxa3xx_u2d_ulpi_driver); | ||
389 | } | ||
390 | module_init(pxa3xx_u2d_ulpi_init); | ||
391 | |||
392 | static void __exit pxa3xx_u2d_ulpi_exit(void) | ||
393 | { | ||
394 | platform_driver_unregister(&pxa3xx_u2d_ulpi_driver); | ||
395 | } | ||
396 | module_exit(pxa3xx_u2d_ulpi_exit); | ||
397 | |||
398 | MODULE_DESCRIPTION("PXA3xx U2D ULPI driver"); | ||
399 | MODULE_AUTHOR("Igor Grinberg"); | ||
400 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index fa0014847c71..c85c3a7abd31 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c | |||
@@ -98,23 +98,6 @@ unsigned int pxa3xx_get_clk_frequency_khz(int info) | |||
98 | return CLK / 1000; | 98 | return CLK / 1000; |
99 | } | 99 | } |
100 | 100 | ||
101 | /* | ||
102 | * Return the current static memory controller clock frequency | ||
103 | * in units of 10kHz | ||
104 | */ | ||
105 | unsigned int pxa3xx_get_memclk_frequency_10khz(void) | ||
106 | { | ||
107 | unsigned long acsr; | ||
108 | unsigned int smcfs, clk = 0; | ||
109 | |||
110 | acsr = ACSR; | ||
111 | |||
112 | smcfs = (acsr >> 23) & 0x7; | ||
113 | clk = (acsr & ACCR_D0CS) ? RO_CLK : smcfs_mult[smcfs] * BASE_CLK; | ||
114 | |||
115 | return (clk / 10000); | ||
116 | } | ||
117 | |||
118 | void pxa3xx_clear_reset_status(unsigned int mask) | 101 | void pxa3xx_clear_reset_status(unsigned int mask) |
119 | { | 102 | { |
120 | /* RESET_STATUS_* has a 1:1 mapping with ARSR */ | 103 | /* RESET_STATUS_* has a 1:1 mapping with ARSR */ |
@@ -265,7 +248,7 @@ static struct clk_lookup pxa3xx_clkregs[] = { | |||
265 | INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL), | 248 | INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL), |
266 | INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL), | 249 | INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL), |
267 | INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL), | 250 | INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL), |
268 | INIT_CLKREG(&clk_pxa3xx_u2d, NULL, "U2DCLK"), | 251 | INIT_CLKREG(&clk_pxa3xx_u2d, "pxa3xx-u2d", NULL), |
269 | INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL), | 252 | INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL), |
270 | INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL), | 253 | INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL), |
271 | INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL), | 254 | INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL), |
diff --git a/arch/arm/mach-pxa/pxa930.c b/arch/arm/mach-pxa/pxa930.c index 064292008288..7d29dd3af79d 100644 --- a/arch/arm/mach-pxa/pxa930.c +++ b/arch/arm/mach-pxa/pxa930.c | |||
@@ -192,7 +192,7 @@ static struct mfp_addr_map pxa935_mfp_addr_map[] __initdata = { | |||
192 | 192 | ||
193 | static int __init pxa930_init(void) | 193 | static int __init pxa930_init(void) |
194 | { | 194 | { |
195 | if (cpu_is_pxa930() || cpu_is_pxa935()) { | 195 | if (cpu_is_pxa930() || cpu_is_pxa935() || cpu_is_pxa950()) { |
196 | mfp_init_base(io_p2v(MFPR_BASE)); | 196 | mfp_init_base(io_p2v(MFPR_BASE)); |
197 | mfp_init_addr(pxa930_mfp_addr_map); | 197 | mfp_init_addr(pxa930_mfp_addr_map); |
198 | } | 198 | } |
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c index a654d1e6b38a..62de07341cc6 100644 --- a/arch/arm/mach-pxa/stargate2.c +++ b/arch/arm/mach-pxa/stargate2.c | |||
@@ -56,6 +56,8 @@ | |||
56 | #include "devices.h" | 56 | #include "devices.h" |
57 | #include "generic.h" | 57 | #include "generic.h" |
58 | 58 | ||
59 | #define STARGATE_NR_IRQS (IRQ_BOARD_START + 8) | ||
60 | |||
59 | /* Bluetooth */ | 61 | /* Bluetooth */ |
60 | #define SG2_BT_RESET 81 | 62 | #define SG2_BT_RESET 81 |
61 | 63 | ||
@@ -1011,6 +1013,7 @@ MACHINE_START(STARGATE2, "Stargate 2") | |||
1011 | .phys_io = 0x40000000, | 1013 | .phys_io = 0x40000000, |
1012 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 1014 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
1013 | .map_io = pxa_map_io, | 1015 | .map_io = pxa_map_io, |
1016 | .nr_irqs = STARGATE_NR_IRQS, | ||
1014 | .init_irq = pxa27x_init_irq, | 1017 | .init_irq = pxa27x_init_irq, |
1015 | .timer = &pxa_timer, | 1018 | .timer = &pxa_timer, |
1016 | .init_machine = stargate2_init, | 1019 | .init_machine = stargate2_init, |
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c index f02dcb5b4e97..0f440c9d7cbd 100644 --- a/arch/arm/mach-pxa/tavorevb.c +++ b/arch/arm/mach-pxa/tavorevb.c | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | #include <mach/pxa930.h> | 26 | #include <mach/pxa930.h> |
27 | #include <mach/pxafb.h> | 27 | #include <mach/pxafb.h> |
28 | #include <mach/pxa27x_keypad.h> | 28 | #include <plat/pxa27x_keypad.h> |
29 | 29 | ||
30 | #include "devices.h" | 30 | #include "devices.h" |
31 | #include "generic.h" | 31 | #include "generic.h" |
diff --git a/arch/arm/mach-pxa/tavorevb3.c b/arch/arm/mach-pxa/tavorevb3.c new file mode 100644 index 000000000000..5eeba64515e4 --- /dev/null +++ b/arch/arm/mach-pxa/tavorevb3.c | |||
@@ -0,0 +1,136 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/tavorevb3.c | ||
3 | * | ||
4 | * Support for the Marvell EVB3 Development Platform. | ||
5 | * | ||
6 | * Copyright: (C) Copyright 2008-2010 Marvell International Ltd. | ||
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 version 2 as | ||
10 | * publishhed by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/i2c.h> | ||
18 | #include <linux/gpio.h> | ||
19 | #include <linux/mfd/88pm860x.h> | ||
20 | |||
21 | #include <asm/mach-types.h> | ||
22 | #include <asm/mach/arch.h> | ||
23 | |||
24 | #include <mach/pxa930.h> | ||
25 | |||
26 | #include <plat/i2c.h> | ||
27 | |||
28 | #include "devices.h" | ||
29 | #include "generic.h" | ||
30 | |||
31 | #define TAVOREVB3_NR_IRQS (IRQ_BOARD_START + 24) | ||
32 | |||
33 | static mfp_cfg_t evb3_mfp_cfg[] __initdata = { | ||
34 | /* UART */ | ||
35 | GPIO53_UART1_TXD, | ||
36 | GPIO54_UART1_RXD, | ||
37 | |||
38 | /* PMIC */ | ||
39 | PMIC_INT_GPIO83, | ||
40 | }; | ||
41 | |||
42 | #if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE) | ||
43 | static struct pm860x_touch_pdata evb3_touch = { | ||
44 | .gpadc_prebias = 1, | ||
45 | .slot_cycle = 1, | ||
46 | .tsi_prebias = 6, | ||
47 | .pen_prebias = 16, | ||
48 | .pen_prechg = 2, | ||
49 | .res_x = 300, | ||
50 | }; | ||
51 | |||
52 | static struct pm860x_backlight_pdata evb3_backlight[] = { | ||
53 | { | ||
54 | .id = PM8606_ID_BACKLIGHT, | ||
55 | .iset = PM8606_WLED_CURRENT(24), | ||
56 | .flags = PM8606_BACKLIGHT1, | ||
57 | }, | ||
58 | {}, | ||
59 | }; | ||
60 | |||
61 | static struct pm860x_led_pdata evb3_led[] = { | ||
62 | { | ||
63 | .id = PM8606_ID_LED, | ||
64 | .iset = PM8606_LED_CURRENT(12), | ||
65 | .flags = PM8606_LED1_RED, | ||
66 | }, { | ||
67 | .id = PM8606_ID_LED, | ||
68 | .iset = PM8606_LED_CURRENT(12), | ||
69 | .flags = PM8606_LED1_GREEN, | ||
70 | }, { | ||
71 | .id = PM8606_ID_LED, | ||
72 | .iset = PM8606_LED_CURRENT(12), | ||
73 | .flags = PM8606_LED1_BLUE, | ||
74 | }, { | ||
75 | .id = PM8606_ID_LED, | ||
76 | .iset = PM8606_LED_CURRENT(12), | ||
77 | .flags = PM8606_LED2_RED, | ||
78 | }, { | ||
79 | .id = PM8606_ID_LED, | ||
80 | .iset = PM8606_LED_CURRENT(12), | ||
81 | .flags = PM8606_LED2_GREEN, | ||
82 | }, { | ||
83 | .id = PM8606_ID_LED, | ||
84 | .iset = PM8606_LED_CURRENT(12), | ||
85 | .flags = PM8606_LED2_BLUE, | ||
86 | }, | ||
87 | }; | ||
88 | |||
89 | static struct pm860x_platform_data evb3_pm8607_info = { | ||
90 | .touch = &evb3_touch, | ||
91 | .backlight = &evb3_backlight[0], | ||
92 | .led = &evb3_led[0], | ||
93 | .companion_addr = 0x10, | ||
94 | .irq_mode = 0, | ||
95 | .irq_base = IRQ_BOARD_START, | ||
96 | |||
97 | .i2c_port = GI2C_PORT, | ||
98 | }; | ||
99 | |||
100 | static struct i2c_board_info evb3_i2c_info[] = { | ||
101 | { | ||
102 | .type = "88PM860x", | ||
103 | .addr = 0x34, | ||
104 | .platform_data = &evb3_pm8607_info, | ||
105 | .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)), | ||
106 | }, | ||
107 | }; | ||
108 | |||
109 | static void __init evb3_init_i2c(void) | ||
110 | { | ||
111 | pxa_set_i2c_info(NULL); | ||
112 | i2c_register_board_info(0, ARRAY_AND_SIZE(evb3_i2c_info)); | ||
113 | } | ||
114 | #else | ||
115 | static inline void evb3_init_i2c(void) {} | ||
116 | #endif | ||
117 | |||
118 | static void __init evb3_init(void) | ||
119 | { | ||
120 | /* initialize MFP configurations */ | ||
121 | pxa3xx_mfp_config(ARRAY_AND_SIZE(evb3_mfp_cfg)); | ||
122 | |||
123 | pxa_set_ffuart_info(NULL); | ||
124 | |||
125 | evb3_init_i2c(); | ||
126 | } | ||
127 | |||
128 | MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)") | ||
129 | .phys_io = 0x40000000, | ||
130 | .boot_params = 0xa0000100, | ||
131 | .map_io = pxa_map_io, | ||
132 | .nr_irqs = TAVOREVB3_NR_IRQS, | ||
133 | .init_irq = pxa3xx_init_irq, | ||
134 | .timer = &pxa_timer, | ||
135 | .init_machine = evb3_init, | ||
136 | MACHINE_END | ||
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 83cc3a18c2e9..3a06e98b4920 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -956,6 +956,7 @@ MACHINE_START(TOSA, "SHARP Tosa") | |||
956 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 956 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
957 | .fixup = fixup_tosa, | 957 | .fixup = fixup_tosa, |
958 | .map_io = pxa_map_io, | 958 | .map_io = pxa_map_io, |
959 | .nr_irqs = TOSA_NR_IRQS, | ||
959 | .init_irq = pxa25x_init_irq, | 960 | .init_irq = pxa25x_init_irq, |
960 | .init_machine = tosa_init, | 961 | .init_machine = tosa_init, |
961 | .timer = &pxa_timer, | 962 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c index c9b747cedea8..37d6173bbb66 100644 --- a/arch/arm/mach-pxa/vpac270.c +++ b/arch/arm/mach-pxa/vpac270.c | |||
@@ -240,6 +240,7 @@ static void __init vpac270_onenand_init(void) {} | |||
240 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | 240 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
241 | static struct pxamci_platform_data vpac270_mci_platform_data = { | 241 | static struct pxamci_platform_data vpac270_mci_platform_data = { |
242 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 242 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
243 | .gpio_power = -1, | ||
243 | .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N, | 244 | .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N, |
244 | .gpio_card_ro = GPIO52_VPAC270_SD_READONLY, | 245 | .gpio_card_ro = GPIO52_VPAC270_SD_READONLY, |
245 | .detect_delay_ms = 200, | 246 | .detect_delay_ms = 200, |
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index f0d02288b4ca..8c44bc4381ba 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <mach/z2.h> | 37 | #include <mach/z2.h> |
38 | #include <mach/pxafb.h> | 38 | #include <mach/pxafb.h> |
39 | #include <mach/mmc.h> | 39 | #include <mach/mmc.h> |
40 | #include <mach/pxa27x_keypad.h> | 40 | #include <plat/pxa27x_keypad.h> |
41 | #include <mach/pxa2xx_spi.h> | 41 | #include <mach/pxa2xx_spi.h> |
42 | 42 | ||
43 | #include <plat/i2c.h> | 43 | #include <plat/i2c.h> |
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c index 03b9cb910e08..9da2b624ba20 100644 --- a/arch/arm/mach-pxa/zeus.c +++ b/arch/arm/mach-pxa/zeus.c | |||
@@ -904,6 +904,7 @@ MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS") | |||
904 | .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc), | 904 | .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc), |
905 | .boot_params = 0xa0000100, | 905 | .boot_params = 0xa0000100, |
906 | .map_io = zeus_map_io, | 906 | .map_io = zeus_map_io, |
907 | .nr_irqs = ZEUS_NR_IRQS, | ||
907 | .init_irq = zeus_init_irq, | 908 | .init_irq = zeus_init_irq, |
908 | .timer = &pxa_timer, | 909 | .timer = &pxa_timer, |
909 | .init_machine = zeus_init, | 910 | .init_machine = zeus_init, |
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index c479cbecf784..69df3edcdd98 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <mach/zylonite.h> | 30 | #include <mach/zylonite.h> |
31 | #include <mach/mmc.h> | 31 | #include <mach/mmc.h> |
32 | #include <mach/ohci.h> | 32 | #include <mach/ohci.h> |
33 | #include <mach/pxa27x_keypad.h> | 33 | #include <plat/pxa27x_keypad.h> |
34 | #include <plat/pxa3xx_nand.h> | 34 | #include <plat/pxa3xx_nand.h> |
35 | 35 | ||
36 | #include "devices.h" | 36 | #include "devices.h" |
@@ -415,6 +415,7 @@ MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") | |||
415 | .boot_params = 0xa0000100, | 415 | .boot_params = 0xa0000100, |
416 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 416 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
417 | .map_io = pxa_map_io, | 417 | .map_io = pxa_map_io, |
418 | .nr_irqs = ZYLONITE_NR_IRQS, | ||
418 | .init_irq = pxa3xx_init_irq, | 419 | .init_irq = pxa3xx_init_irq, |
419 | .timer = &pxa_timer, | 420 | .timer = &pxa_timer, |
420 | .init_machine = zylonite_init, | 421 | .init_machine = zylonite_init, |
diff --git a/arch/arm/mach-rpc/include/mach/vmalloc.h b/arch/arm/mach-rpc/include/mach/vmalloc.h index 9a96fd69e705..3bcd86fadb81 100644 --- a/arch/arm/mach-rpc/include/mach/vmalloc.h +++ b/arch/arm/mach-rpc/include/mach/vmalloc.h | |||
@@ -7,4 +7,4 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #define VMALLOC_END (PAGE_OFFSET + 0x1c000000) | 10 | #define VMALLOC_END 0xdc000000 |
diff --git a/arch/arm/mach-shark/include/mach/vmalloc.h b/arch/arm/mach-shark/include/mach/vmalloc.h index f6c6837c5451..8e845b6a7cb5 100644 --- a/arch/arm/mach-shark/include/mach/vmalloc.h +++ b/arch/arm/mach-shark/include/mach/vmalloc.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-shark/include/mach/vmalloc.h | 2 | * arch/arm/mach-shark/include/mach/vmalloc.h |
3 | */ | 3 | */ |
4 | #define VMALLOC_END (PAGE_OFFSET + 0x10000000) | 4 | #define VMALLOC_END 0xd0000000 |
diff --git a/arch/arm/mach-tcc8k/Kconfig b/arch/arm/mach-tcc8k/Kconfig new file mode 100644 index 000000000000..ad86415d1577 --- /dev/null +++ b/arch/arm/mach-tcc8k/Kconfig | |||
@@ -0,0 +1,11 @@ | |||
1 | if ARCH_TCC8K | ||
2 | |||
3 | comment "TCC8000 systems:" | ||
4 | |||
5 | config MACH_TCC8000_SDK | ||
6 | bool "Telechips TCC8000-SDK development kit" | ||
7 | default y | ||
8 | help | ||
9 | Support for the Telechips TCC8000-SDK board. | ||
10 | |||
11 | endif | ||
diff --git a/arch/arm/mach-tcc8k/Makefile b/arch/arm/mach-tcc8k/Makefile new file mode 100644 index 000000000000..9bacf31e49ba --- /dev/null +++ b/arch/arm/mach-tcc8k/Makefile | |||
@@ -0,0 +1,9 @@ | |||
1 | # | ||
2 | # Makefile for TCC8K boards and common files. | ||
3 | # | ||
4 | |||
5 | # Common support | ||
6 | obj-y += clock.o irq.o time.o io.o devices.o | ||
7 | |||
8 | # Board specific support | ||
9 | obj-$(CONFIG_MACH_TCC8000_SDK) += board-tcc8000-sdk.o | ||
diff --git a/arch/arm/mach-tcc8k/Makefile.boot b/arch/arm/mach-tcc8k/Makefile.boot new file mode 100644 index 000000000000..f135c9deae10 --- /dev/null +++ b/arch/arm/mach-tcc8k/Makefile.boot | |||
@@ -0,0 +1,3 @@ | |||
1 | zreladdr-y := 0x20008000 | ||
2 | params_phys-y := 0x20000100 | ||
3 | initrd_phys-y := 0x20800000 | ||
diff --git a/arch/arm/mach-tcc8k/board-tcc8000-sdk.c b/arch/arm/mach-tcc8k/board-tcc8000-sdk.c new file mode 100644 index 000000000000..4e42555b2009 --- /dev/null +++ b/arch/arm/mach-tcc8k/board-tcc8000-sdk.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de> | ||
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 version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/init.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/platform_device.h> | ||
12 | |||
13 | #include <asm/mach-types.h> | ||
14 | |||
15 | #include <asm/mach/arch.h> | ||
16 | #include <asm/mach/map.h> | ||
17 | #include <asm/mach/time.h> | ||
18 | |||
19 | #include <mach/clock.h> | ||
20 | |||
21 | #include "common.h" | ||
22 | |||
23 | #define XI_FREQUENCY 12000000 | ||
24 | #define XTI_FREQUENCY 32768 | ||
25 | |||
26 | #ifdef CONFIG_MTD_NAND_TCC | ||
27 | /* NAND */ | ||
28 | static struct tcc_nand_platform_data tcc8k_sdk_nand_data = { | ||
29 | .width = 1, | ||
30 | .hw_ecc = 0, | ||
31 | }; | ||
32 | #endif | ||
33 | |||
34 | static void __init tcc8k_init(void) | ||
35 | { | ||
36 | #ifdef CONFIG_MTD_NAND_TCC | ||
37 | tcc_nand_device.dev.platform_data = &tcc8k_sdk_nand_data; | ||
38 | platform_device_register(&tcc_nand_device); | ||
39 | #endif | ||
40 | } | ||
41 | |||
42 | static void __init tcc8k_init_timer(void) | ||
43 | { | ||
44 | tcc_clocks_init(XI_FREQUENCY, XTI_FREQUENCY); | ||
45 | } | ||
46 | |||
47 | static struct sys_timer tcc8k_timer = { | ||
48 | .init = tcc8k_init_timer, | ||
49 | }; | ||
50 | |||
51 | static void __init tcc8k_map_io(void) | ||
52 | { | ||
53 | tcc8k_map_common_io(); | ||
54 | } | ||
55 | |||
56 | MACHINE_START(TCC8000_SDK, "Telechips TCC8000-SDK Demo Board") | ||
57 | .phys_io = 0x90000000, | ||
58 | .io_pg_offst = ((0xf1000000) >> 18) & 0xfffc, | ||
59 | .boot_params = PHYS_OFFSET + 0x00000100, | ||
60 | .map_io = tcc8k_map_io, | ||
61 | .init_irq = tcc8k_init_irq, | ||
62 | .init_machine = tcc8k_init, | ||
63 | .timer = &tcc8k_timer, | ||
64 | MACHINE_END | ||
diff --git a/arch/arm/mach-tcc8k/clock.c b/arch/arm/mach-tcc8k/clock.c new file mode 100644 index 000000000000..ba32a15127ab --- /dev/null +++ b/arch/arm/mach-tcc8k/clock.c | |||
@@ -0,0 +1,567 @@ | |||
1 | /* | ||
2 | * Lowlevel clock handling for Telechips TCC8xxx SoCs | ||
3 | * | ||
4 | * Copyright (C) 2010 by Hans J. Koch <hjk@linutronix.de> | ||
5 | * | ||
6 | * Licensed under the terms of the GPL v2 | ||
7 | */ | ||
8 | |||
9 | #include <linux/clk.h> | ||
10 | #include <linux/delay.h> | ||
11 | #include <linux/err.h> | ||
12 | #include <linux/io.h> | ||
13 | #include <linux/module.h> | ||
14 | #include <linux/spinlock.h> | ||
15 | |||
16 | #include <asm/clkdev.h> | ||
17 | |||
18 | #include <mach/clock.h> | ||
19 | #include <mach/irqs.h> | ||
20 | #include <mach/tcc8k-regs.h> | ||
21 | |||
22 | #include "common.h" | ||
23 | |||
24 | #define BCLKCTR0 (CKC_BASE + BCLKCTR0_OFFS) | ||
25 | #define BCLKCTR1 (CKC_BASE + BCLKCTR1_OFFS) | ||
26 | |||
27 | #define ACLKREF (CKC_BASE + ACLKREF_OFFS) | ||
28 | #define ACLKUART0 (CKC_BASE + ACLKUART0_OFFS) | ||
29 | #define ACLKUART1 (CKC_BASE + ACLKUART1_OFFS) | ||
30 | #define ACLKUART2 (CKC_BASE + ACLKUART2_OFFS) | ||
31 | #define ACLKUART3 (CKC_BASE + ACLKUART3_OFFS) | ||
32 | #define ACLKUART4 (CKC_BASE + ACLKUART4_OFFS) | ||
33 | #define ACLKI2C (CKC_BASE + ACLKI2C_OFFS) | ||
34 | #define ACLKADC (CKC_BASE + ACLKADC_OFFS) | ||
35 | #define ACLKUSBH (CKC_BASE + ACLKUSBH_OFFS) | ||
36 | #define ACLKLCD (CKC_BASE + ACLKLCD_OFFS) | ||
37 | #define ACLKSDH0 (CKC_BASE + ACLKSDH0_OFFS) | ||
38 | #define ACLKSDH1 (CKC_BASE + ACLKSDH1_OFFS) | ||
39 | #define ACLKSPI0 (CKC_BASE + ACLKSPI0_OFFS) | ||
40 | #define ACLKSPI1 (CKC_BASE + ACLKSPI1_OFFS) | ||
41 | #define ACLKSPDIF (CKC_BASE + ACLKSPDIF_OFFS) | ||
42 | #define ACLKC3DEC (CKC_BASE + ACLKC3DEC_OFFS) | ||
43 | #define ACLKCAN0 (CKC_BASE + ACLKCAN0_OFFS) | ||
44 | #define ACLKCAN1 (CKC_BASE + ACLKCAN1_OFFS) | ||
45 | #define ACLKGSB0 (CKC_BASE + ACLKGSB0_OFFS) | ||
46 | #define ACLKGSB1 (CKC_BASE + ACLKGSB1_OFFS) | ||
47 | #define ACLKGSB2 (CKC_BASE + ACLKGSB2_OFFS) | ||
48 | #define ACLKGSB3 (CKC_BASE + ACLKGSB3_OFFS) | ||
49 | #define ACLKUSBH (CKC_BASE + ACLKUSBH_OFFS) | ||
50 | #define ACLKTCT (CKC_BASE + ACLKTCT_OFFS) | ||
51 | #define ACLKTCX (CKC_BASE + ACLKTCX_OFFS) | ||
52 | #define ACLKTCZ (CKC_BASE + ACLKTCZ_OFFS) | ||
53 | |||
54 | /* Crystal frequencies */ | ||
55 | static unsigned long xi_rate, xti_rate; | ||
56 | |||
57 | static void __iomem *pll_cfg_addr(int pll) | ||
58 | { | ||
59 | switch (pll) { | ||
60 | case 0: return (CKC_BASE + PLL0CFG_OFFS); | ||
61 | case 1: return (CKC_BASE + PLL1CFG_OFFS); | ||
62 | case 2: return (CKC_BASE + PLL2CFG_OFFS); | ||
63 | default: | ||
64 | BUG(); | ||
65 | } | ||
66 | } | ||
67 | |||
68 | static int pll_enable(int pll, int enable) | ||
69 | { | ||
70 | u32 reg; | ||
71 | void __iomem *addr = pll_cfg_addr(pll); | ||
72 | |||
73 | reg = __raw_readl(addr); | ||
74 | if (enable) | ||
75 | reg &= ~PLLxCFG_PD; | ||
76 | else | ||
77 | reg |= PLLxCFG_PD; | ||
78 | |||
79 | __raw_writel(reg, addr); | ||
80 | return 0; | ||
81 | } | ||
82 | |||
83 | static int xi_enable(int enable) | ||
84 | { | ||
85 | u32 reg; | ||
86 | |||
87 | reg = __raw_readl(CKC_BASE + CLKCTRL_OFFS); | ||
88 | if (enable) | ||
89 | reg |= CLKCTRL_XE; | ||
90 | else | ||
91 | reg &= ~CLKCTRL_XE; | ||
92 | |||
93 | __raw_writel(reg, CKC_BASE + CLKCTRL_OFFS); | ||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | static int root_clk_enable(enum root_clks src) | ||
98 | { | ||
99 | switch (src) { | ||
100 | case CLK_SRC_PLL0: return pll_enable(0, 1); | ||
101 | case CLK_SRC_PLL1: return pll_enable(1, 1); | ||
102 | case CLK_SRC_PLL2: return pll_enable(2, 1); | ||
103 | case CLK_SRC_XI: return xi_enable(1); | ||
104 | default: | ||
105 | BUG(); | ||
106 | } | ||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static int root_clk_disable(enum root_clks root_src) | ||
111 | { | ||
112 | switch (root_src) { | ||
113 | case CLK_SRC_PLL0: return pll_enable(0, 0); | ||
114 | case CLK_SRC_PLL1: return pll_enable(1, 0); | ||
115 | case CLK_SRC_PLL2: return pll_enable(2, 0); | ||
116 | case CLK_SRC_XI: return xi_enable(0); | ||
117 | default: | ||
118 | BUG(); | ||
119 | } | ||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | static int enable_clk(struct clk *clk) | ||
124 | { | ||
125 | u32 reg; | ||
126 | |||
127 | if (clk->root_id != CLK_SRC_NOROOT) | ||
128 | return root_clk_enable(clk->root_id); | ||
129 | |||
130 | if (clk->aclkreg) { | ||
131 | reg = __raw_readl(clk->aclkreg); | ||
132 | reg |= ACLK_EN; | ||
133 | __raw_writel(reg, clk->aclkreg); | ||
134 | } | ||
135 | if (clk->bclkctr) { | ||
136 | reg = __raw_readl(clk->bclkctr); | ||
137 | reg |= 1 << clk->bclk_shift; | ||
138 | __raw_writel(reg, clk->bclkctr); | ||
139 | } | ||
140 | return 0; | ||
141 | } | ||
142 | |||
143 | static void disable_clk(struct clk *clk) | ||
144 | { | ||
145 | u32 reg; | ||
146 | |||
147 | if (clk->root_id != CLK_SRC_NOROOT) { | ||
148 | root_clk_disable(clk->root_id); | ||
149 | return; | ||
150 | } | ||
151 | |||
152 | if (clk->bclkctr) { | ||
153 | reg = __raw_readl(clk->bclkctr); | ||
154 | reg &= ~(1 << clk->bclk_shift); | ||
155 | __raw_writel(reg, clk->bclkctr); | ||
156 | } | ||
157 | if (clk->aclkreg) { | ||
158 | reg = __raw_readl(clk->aclkreg); | ||
159 | reg &= ~ACLK_EN; | ||
160 | __raw_writel(reg, clk->aclkreg); | ||
161 | } | ||
162 | } | ||
163 | |||
164 | static unsigned long get_rate_pll(int pll) | ||
165 | { | ||
166 | u32 reg; | ||
167 | unsigned long s, m, p; | ||
168 | void __iomem *addr = pll_cfg_addr(pll); | ||
169 | |||
170 | reg = __raw_readl(addr); | ||
171 | s = (reg >> 16) & 0x07; | ||
172 | m = (reg >> 8) & 0xff; | ||
173 | p = reg & 0x3f; | ||
174 | |||
175 | return (m * xi_rate) / (p * (1 << s)); | ||
176 | } | ||
177 | |||
178 | static unsigned long get_rate_pll_div(int pll) | ||
179 | { | ||
180 | u32 reg; | ||
181 | unsigned long div = 0; | ||
182 | void __iomem *addr; | ||
183 | |||
184 | switch (pll) { | ||
185 | case 0: | ||
186 | addr = CKC_BASE + CLKDIVC0_OFFS; | ||
187 | reg = __raw_readl(addr); | ||
188 | if (reg & CLKDIVC0_P0E) | ||
189 | div = (reg >> 24) & 0x3f; | ||
190 | break; | ||
191 | case 1: | ||
192 | addr = CKC_BASE + CLKDIVC0_OFFS; | ||
193 | reg = __raw_readl(addr); | ||
194 | if (reg & CLKDIVC0_P1E) | ||
195 | div = (reg >> 16) & 0x3f; | ||
196 | break; | ||
197 | case 2: | ||
198 | addr = CKC_BASE + CLKDIVC1_OFFS; | ||
199 | reg = __raw_readl(addr); | ||
200 | if (reg & CLKDIVC1_P2E) | ||
201 | div = __raw_readl(addr) & 0x3f; | ||
202 | break; | ||
203 | } | ||
204 | return get_rate_pll(pll) / (div + 1); | ||
205 | } | ||
206 | |||
207 | static unsigned long get_rate_xi_div(void) | ||
208 | { | ||
209 | unsigned long div = 0; | ||
210 | u32 reg = __raw_readl(CKC_BASE + CLKDIVC0_OFFS); | ||
211 | |||
212 | if (reg & CLKDIVC0_XE) | ||
213 | div = (reg >> 8) & 0x3f; | ||
214 | |||
215 | return xi_rate / (div + 1); | ||
216 | } | ||
217 | |||
218 | static unsigned long get_rate_xti_div(void) | ||
219 | { | ||
220 | unsigned long div = 0; | ||
221 | u32 reg = __raw_readl(CKC_BASE + CLKDIVC0_OFFS); | ||
222 | |||
223 | if (reg & CLKDIVC0_XTE) | ||
224 | div = reg & 0x3f; | ||
225 | |||
226 | return xti_rate / (div + 1); | ||
227 | } | ||
228 | |||
229 | static unsigned long root_clk_get_rate(enum root_clks src) | ||
230 | { | ||
231 | switch (src) { | ||
232 | case CLK_SRC_PLL0: return get_rate_pll(0); | ||
233 | case CLK_SRC_PLL1: return get_rate_pll(1); | ||
234 | case CLK_SRC_PLL2: return get_rate_pll(2); | ||
235 | case CLK_SRC_PLL0DIV: return get_rate_pll_div(0); | ||
236 | case CLK_SRC_PLL1DIV: return get_rate_pll_div(1); | ||
237 | case CLK_SRC_PLL2DIV: return get_rate_pll_div(2); | ||
238 | case CLK_SRC_XI: return xi_rate; | ||
239 | case CLK_SRC_XTI: return xti_rate; | ||
240 | case CLK_SRC_XIDIV: return get_rate_xi_div(); | ||
241 | case CLK_SRC_XTIDIV: return get_rate_xti_div(); | ||
242 | default: return 0; | ||
243 | } | ||
244 | } | ||
245 | |||
246 | static unsigned long aclk_get_rate(struct clk *clk) | ||
247 | { | ||
248 | u32 reg; | ||
249 | unsigned long div; | ||
250 | unsigned int src; | ||
251 | |||
252 | reg = __raw_readl(clk->aclkreg); | ||
253 | div = reg & 0x0fff; | ||
254 | src = (reg >> ACLK_SEL_SHIFT) & CLK_SRC_MASK; | ||
255 | return root_clk_get_rate(src) / (div + 1); | ||
256 | } | ||
257 | |||
258 | static unsigned long aclk_best_div(struct clk *clk, unsigned long rate) | ||
259 | { | ||
260 | unsigned long div, src, freq, r1, r2; | ||
261 | |||
262 | src = __raw_readl(clk->aclkreg) >> ACLK_SEL_SHIFT; | ||
263 | src &= CLK_SRC_MASK; | ||
264 | freq = root_clk_get_rate(src); | ||
265 | div = freq / rate + 1; | ||
266 | r1 = freq / div; | ||
267 | r2 = freq / (div + 1); | ||
268 | if (r2 >= rate) | ||
269 | return div + 1; | ||
270 | if ((rate - r2) < (r1 - rate)) | ||
271 | return div + 1; | ||
272 | |||
273 | return div; | ||
274 | } | ||
275 | |||
276 | static unsigned long aclk_round_rate(struct clk *clk, unsigned long rate) | ||
277 | { | ||
278 | unsigned int src; | ||
279 | |||
280 | src = __raw_readl(clk->aclkreg) >> ACLK_SEL_SHIFT; | ||
281 | src &= CLK_SRC_MASK; | ||
282 | |||
283 | return root_clk_get_rate(src) / aclk_best_div(clk, rate); | ||
284 | } | ||
285 | |||
286 | static int aclk_set_rate(struct clk *clk, unsigned long rate) | ||
287 | { | ||
288 | u32 reg; | ||
289 | |||
290 | reg = __raw_readl(clk->aclkreg) & ~ACLK_DIV_MASK; | ||
291 | reg |= aclk_best_div(clk, rate); | ||
292 | return 0; | ||
293 | } | ||
294 | |||
295 | static unsigned long get_rate_sys(struct clk *clk) | ||
296 | { | ||
297 | unsigned int src; | ||
298 | |||
299 | src = __raw_readl(CKC_BASE + CLKCTRL_OFFS) & CLK_SRC_MASK; | ||
300 | return root_clk_get_rate(src); | ||
301 | } | ||
302 | |||
303 | static unsigned long get_rate_bus(struct clk *clk) | ||
304 | { | ||
305 | unsigned int div; | ||
306 | |||
307 | div = (__raw_readl(CKC_BASE + CLKCTRL_OFFS) >> 4) & 0xff; | ||
308 | return get_rate_sys(clk) / (div + 1); | ||
309 | } | ||
310 | |||
311 | static unsigned long get_rate_cpu(struct clk *clk) | ||
312 | { | ||
313 | unsigned int reg, div, fsys, fbus; | ||
314 | |||
315 | fbus = get_rate_bus(clk); | ||
316 | reg = __raw_readl(CKC_BASE + CLKCTRL_OFFS); | ||
317 | if (reg & (1 << 29)) | ||
318 | return fbus; | ||
319 | fsys = get_rate_sys(clk); | ||
320 | div = (reg >> 16) & 0x0f; | ||
321 | return fbus + ((fsys - fbus) * (div + 1)) / 16; | ||
322 | } | ||
323 | |||
324 | static unsigned long get_rate_root(struct clk *clk) | ||
325 | { | ||
326 | return root_clk_get_rate(clk->root_id); | ||
327 | } | ||
328 | |||
329 | static int aclk_set_parent(struct clk *clock, struct clk *parent) | ||
330 | { | ||
331 | u32 reg; | ||
332 | |||
333 | if (clock->parent == parent) | ||
334 | return 0; | ||
335 | |||
336 | clock->parent = parent; | ||
337 | |||
338 | if (!parent) | ||
339 | return 0; | ||
340 | |||
341 | if (parent->root_id == CLK_SRC_NOROOT) | ||
342 | return 0; | ||
343 | reg = __raw_readl(clock->aclkreg); | ||
344 | reg &= ~ACLK_SEL_MASK; | ||
345 | reg |= (parent->root_id << ACLK_SEL_SHIFT) & ACLK_SEL_MASK; | ||
346 | __raw_writel(reg, clock->aclkreg); | ||
347 | |||
348 | return 0; | ||
349 | } | ||
350 | |||
351 | #define DEFINE_ROOT_CLOCK(name, ri, p) \ | ||
352 | static struct clk name = { \ | ||
353 | .root_id = ri, \ | ||
354 | .get_rate = get_rate_root, \ | ||
355 | .enable = enable_clk, \ | ||
356 | .disable = disable_clk, \ | ||
357 | .parent = p, \ | ||
358 | }; | ||
359 | |||
360 | #define DEFINE_SPECIAL_CLOCK(name, gr, p) \ | ||
361 | static struct clk name = { \ | ||
362 | .root_id = CLK_SRC_NOROOT, \ | ||
363 | .get_rate = gr, \ | ||
364 | .parent = p, \ | ||
365 | }; | ||
366 | |||
367 | #define DEFINE_ACLOCK(name, bc, bs, ar) \ | ||
368 | static struct clk name = { \ | ||
369 | .root_id = CLK_SRC_NOROOT, \ | ||
370 | .bclkctr = bc, \ | ||
371 | .bclk_shift = bs, \ | ||
372 | .aclkreg = ar, \ | ||
373 | .get_rate = aclk_get_rate, \ | ||
374 | .set_rate = aclk_set_rate, \ | ||
375 | .round_rate = aclk_round_rate, \ | ||
376 | .enable = enable_clk, \ | ||
377 | .disable = disable_clk, \ | ||
378 | .set_parent = aclk_set_parent, \ | ||
379 | }; | ||
380 | |||
381 | #define DEFINE_BCLOCK(name, bc, bs, gr, p) \ | ||
382 | static struct clk name = { \ | ||
383 | .root_id = CLK_SRC_NOROOT, \ | ||
384 | .bclkctr = bc, \ | ||
385 | .bclk_shift = bs, \ | ||
386 | .get_rate = gr, \ | ||
387 | .enable = enable_clk, \ | ||
388 | .disable = disable_clk, \ | ||
389 | .parent = p, \ | ||
390 | }; | ||
391 | |||
392 | DEFINE_ROOT_CLOCK(xi, CLK_SRC_XI, NULL) | ||
393 | DEFINE_ROOT_CLOCK(xti, CLK_SRC_XTI, NULL) | ||
394 | DEFINE_ROOT_CLOCK(xidiv, CLK_SRC_XIDIV, &xi) | ||
395 | DEFINE_ROOT_CLOCK(xtidiv, CLK_SRC_XTIDIV, &xti) | ||
396 | DEFINE_ROOT_CLOCK(pll0, CLK_SRC_PLL0, &xi) | ||
397 | DEFINE_ROOT_CLOCK(pll1, CLK_SRC_PLL1, &xi) | ||
398 | DEFINE_ROOT_CLOCK(pll2, CLK_SRC_PLL2, &xi) | ||
399 | DEFINE_ROOT_CLOCK(pll0div, CLK_SRC_PLL0DIV, &pll0) | ||
400 | DEFINE_ROOT_CLOCK(pll1div, CLK_SRC_PLL1DIV, &pll1) | ||
401 | DEFINE_ROOT_CLOCK(pll2div, CLK_SRC_PLL2DIV, &pll2) | ||
402 | |||
403 | /* The following 3 clocks are special and are initialized explicitly later */ | ||
404 | DEFINE_SPECIAL_CLOCK(sys, get_rate_sys, NULL) | ||
405 | DEFINE_SPECIAL_CLOCK(bus, get_rate_bus, &sys) | ||
406 | DEFINE_SPECIAL_CLOCK(cpu, get_rate_cpu, &sys) | ||
407 | |||
408 | DEFINE_ACLOCK(tct, NULL, 0, ACLKTCT) | ||
409 | DEFINE_ACLOCK(tcx, NULL, 0, ACLKTCX) | ||
410 | DEFINE_ACLOCK(tcz, NULL, 0, ACLKTCZ) | ||
411 | DEFINE_ACLOCK(ref, NULL, 0, ACLKREF) | ||
412 | DEFINE_ACLOCK(uart0, BCLKCTR0, 5, ACLKUART0) | ||
413 | DEFINE_ACLOCK(uart1, BCLKCTR0, 23, ACLKUART1) | ||
414 | DEFINE_ACLOCK(uart2, BCLKCTR0, 6, ACLKUART2) | ||
415 | DEFINE_ACLOCK(uart3, BCLKCTR0, 8, ACLKUART3) | ||
416 | DEFINE_ACLOCK(uart4, BCLKCTR1, 6, ACLKUART4) | ||
417 | DEFINE_ACLOCK(i2c, BCLKCTR0, 7, ACLKI2C) | ||
418 | DEFINE_ACLOCK(adc, BCLKCTR0, 10, ACLKADC) | ||
419 | DEFINE_ACLOCK(usbh0, BCLKCTR0, 11, ACLKUSBH) | ||
420 | DEFINE_ACLOCK(lcd, BCLKCTR0, 13, ACLKLCD) | ||
421 | DEFINE_ACLOCK(sd0, BCLKCTR0, 17, ACLKSDH0) | ||
422 | DEFINE_ACLOCK(sd1, BCLKCTR1, 5, ACLKSDH1) | ||
423 | DEFINE_ACLOCK(spi0, BCLKCTR0, 24, ACLKSPI0) | ||
424 | DEFINE_ACLOCK(spi1, BCLKCTR0, 30, ACLKSPI1) | ||
425 | DEFINE_ACLOCK(spdif, BCLKCTR1, 2, ACLKSPDIF) | ||
426 | DEFINE_ACLOCK(c3dec, BCLKCTR1, 9, ACLKC3DEC) | ||
427 | DEFINE_ACLOCK(can0, BCLKCTR1, 10, ACLKCAN0) | ||
428 | DEFINE_ACLOCK(can1, BCLKCTR1, 11, ACLKCAN1) | ||
429 | DEFINE_ACLOCK(gsb0, BCLKCTR1, 13, ACLKGSB0) | ||
430 | DEFINE_ACLOCK(gsb1, BCLKCTR1, 14, ACLKGSB1) | ||
431 | DEFINE_ACLOCK(gsb2, BCLKCTR1, 15, ACLKGSB2) | ||
432 | DEFINE_ACLOCK(gsb3, BCLKCTR1, 16, ACLKGSB3) | ||
433 | DEFINE_ACLOCK(usbh1, BCLKCTR1, 20, ACLKUSBH) | ||
434 | |||
435 | DEFINE_BCLOCK(dai0, BCLKCTR0, 0, NULL, NULL) | ||
436 | DEFINE_BCLOCK(pic, BCLKCTR0, 1, NULL, NULL) | ||
437 | DEFINE_BCLOCK(tc, BCLKCTR0, 2, NULL, NULL) | ||
438 | DEFINE_BCLOCK(gpio, BCLKCTR0, 3, NULL, NULL) | ||
439 | DEFINE_BCLOCK(usbd, BCLKCTR0, 4, NULL, NULL) | ||
440 | DEFINE_BCLOCK(ecc, BCLKCTR0, 9, NULL, NULL) | ||
441 | DEFINE_BCLOCK(gdma0, BCLKCTR0, 12, NULL, NULL) | ||
442 | DEFINE_BCLOCK(rtc, BCLKCTR0, 15, NULL, NULL) | ||
443 | DEFINE_BCLOCK(nfc, BCLKCTR0, 16, NULL, NULL) | ||
444 | DEFINE_BCLOCK(g2d, BCLKCTR0, 18, NULL, NULL) | ||
445 | DEFINE_BCLOCK(gdma1, BCLKCTR0, 22, NULL, NULL) | ||
446 | DEFINE_BCLOCK(mscl, BCLKCTR0, 25, NULL, NULL) | ||
447 | DEFINE_BCLOCK(bdma, BCLKCTR1, 0, NULL, NULL) | ||
448 | DEFINE_BCLOCK(adma0, BCLKCTR1, 1, NULL, NULL) | ||
449 | DEFINE_BCLOCK(scfg, BCLKCTR1, 3, NULL, NULL) | ||
450 | DEFINE_BCLOCK(cid, BCLKCTR1, 4, NULL, NULL) | ||
451 | DEFINE_BCLOCK(dai1, BCLKCTR1, 7, NULL, NULL) | ||
452 | DEFINE_BCLOCK(adma1, BCLKCTR1, 8, NULL, NULL) | ||
453 | DEFINE_BCLOCK(gps, BCLKCTR1, 12, NULL, NULL) | ||
454 | DEFINE_BCLOCK(gdma2, BCLKCTR1, 17, NULL, NULL) | ||
455 | DEFINE_BCLOCK(gdma3, BCLKCTR1, 18, NULL, NULL) | ||
456 | DEFINE_BCLOCK(ddrc, BCLKCTR1, 19, NULL, NULL) | ||
457 | |||
458 | #define _REGISTER_CLOCK(d, n, c) \ | ||
459 | { \ | ||
460 | .dev_id = d, \ | ||
461 | .con_id = n, \ | ||
462 | .clk = &c, \ | ||
463 | }, | ||
464 | |||
465 | static struct clk_lookup lookups[] = { | ||
466 | _REGISTER_CLOCK(NULL, "bus", bus) | ||
467 | _REGISTER_CLOCK(NULL, "cpu", cpu) | ||
468 | _REGISTER_CLOCK(NULL, "tct", tct) | ||
469 | _REGISTER_CLOCK(NULL, "tcx", tcx) | ||
470 | _REGISTER_CLOCK(NULL, "tcz", tcz) | ||
471 | _REGISTER_CLOCK(NULL, "ref", ref) | ||
472 | _REGISTER_CLOCK(NULL, "dai0", dai0) | ||
473 | _REGISTER_CLOCK(NULL, "pic", pic) | ||
474 | _REGISTER_CLOCK(NULL, "tc", tc) | ||
475 | _REGISTER_CLOCK(NULL, "gpio", gpio) | ||
476 | _REGISTER_CLOCK(NULL, "usbd", usbd) | ||
477 | _REGISTER_CLOCK("tcc-uart.0", NULL, uart0) | ||
478 | _REGISTER_CLOCK("tcc-uart.2", NULL, uart2) | ||
479 | _REGISTER_CLOCK("tcc-i2c", NULL, i2c) | ||
480 | _REGISTER_CLOCK("tcc-uart.3", NULL, uart3) | ||
481 | _REGISTER_CLOCK(NULL, "ecc", ecc) | ||
482 | _REGISTER_CLOCK(NULL, "adc", adc) | ||
483 | _REGISTER_CLOCK("tcc-usbh.0", "usb", usbh0) | ||
484 | _REGISTER_CLOCK(NULL, "gdma0", gdma0) | ||
485 | _REGISTER_CLOCK(NULL, "lcd", lcd) | ||
486 | _REGISTER_CLOCK(NULL, "rtc", rtc) | ||
487 | _REGISTER_CLOCK(NULL, "nfc", nfc) | ||
488 | _REGISTER_CLOCK("tcc-mmc.0", NULL, sd0) | ||
489 | _REGISTER_CLOCK(NULL, "g2d", g2d) | ||
490 | _REGISTER_CLOCK(NULL, "gdma1", gdma1) | ||
491 | _REGISTER_CLOCK("tcc-uart.1", NULL, uart1) | ||
492 | _REGISTER_CLOCK("tcc-spi.0", NULL, spi0) | ||
493 | _REGISTER_CLOCK(NULL, "mscl", mscl) | ||
494 | _REGISTER_CLOCK("tcc-spi.1", NULL, spi1) | ||
495 | _REGISTER_CLOCK(NULL, "bdma", bdma) | ||
496 | _REGISTER_CLOCK(NULL, "adma0", adma0) | ||
497 | _REGISTER_CLOCK(NULL, "spdif", spdif) | ||
498 | _REGISTER_CLOCK(NULL, "scfg", scfg) | ||
499 | _REGISTER_CLOCK(NULL, "cid", cid) | ||
500 | _REGISTER_CLOCK("tcc-mmc.1", NULL, sd1) | ||
501 | _REGISTER_CLOCK("tcc-uart.4", NULL, uart4) | ||
502 | _REGISTER_CLOCK(NULL, "dai1", dai1) | ||
503 | _REGISTER_CLOCK(NULL, "adma1", adma1) | ||
504 | _REGISTER_CLOCK(NULL, "c3dec", c3dec) | ||
505 | _REGISTER_CLOCK("tcc-can.0", NULL, can0) | ||
506 | _REGISTER_CLOCK("tcc-can.1", NULL, can1) | ||
507 | _REGISTER_CLOCK(NULL, "gps", gps) | ||
508 | _REGISTER_CLOCK("tcc-gsb.0", NULL, gsb0) | ||
509 | _REGISTER_CLOCK("tcc-gsb.1", NULL, gsb1) | ||
510 | _REGISTER_CLOCK("tcc-gsb.2", NULL, gsb2) | ||
511 | _REGISTER_CLOCK("tcc-gsb.3", NULL, gsb3) | ||
512 | _REGISTER_CLOCK(NULL, "gdma2", gdma2) | ||
513 | _REGISTER_CLOCK(NULL, "gdma3", gdma3) | ||
514 | _REGISTER_CLOCK(NULL, "ddrc", ddrc) | ||
515 | _REGISTER_CLOCK("tcc-usbh.1", "usb", usbh1) | ||
516 | }; | ||
517 | |||
518 | static struct clk *root_clk_by_index(enum root_clks src) | ||
519 | { | ||
520 | switch (src) { | ||
521 | case CLK_SRC_PLL0: return &pll0; | ||
522 | case CLK_SRC_PLL1: return &pll1; | ||
523 | case CLK_SRC_PLL2: return &pll2; | ||
524 | case CLK_SRC_PLL0DIV: return &pll0div; | ||
525 | case CLK_SRC_PLL1DIV: return &pll1div; | ||
526 | case CLK_SRC_PLL2DIV: return &pll2div; | ||
527 | case CLK_SRC_XI: return ξ | ||
528 | case CLK_SRC_XTI: return &xti; | ||
529 | case CLK_SRC_XIDIV: return &xidiv; | ||
530 | case CLK_SRC_XTIDIV: return &xtidiv; | ||
531 | default: return NULL; | ||
532 | } | ||
533 | } | ||
534 | |||
535 | static void find_aclk_parent(struct clk *clk) | ||
536 | { | ||
537 | unsigned int src; | ||
538 | struct clk *clock; | ||
539 | |||
540 | if (!clk->aclkreg) | ||
541 | return; | ||
542 | |||
543 | src = __raw_readl(clk->aclkreg) >> ACLK_SEL_SHIFT; | ||
544 | src &= CLK_SRC_MASK; | ||
545 | |||
546 | clock = root_clk_by_index(src); | ||
547 | if (!clock) | ||
548 | return; | ||
549 | |||
550 | clk->parent = clock; | ||
551 | clk->set_parent = aclk_set_parent; | ||
552 | } | ||
553 | |||
554 | void __init tcc_clocks_init(unsigned long xi_freq, unsigned long xti_freq) | ||
555 | { | ||
556 | int i; | ||
557 | |||
558 | xi_rate = xi_freq; | ||
559 | xti_rate = xti_freq; | ||
560 | |||
561 | /* fixup parents and add the clock */ | ||
562 | for (i = 0; i < ARRAY_SIZE(lookups); i++) { | ||
563 | find_aclk_parent(lookups[i].clk); | ||
564 | clkdev_add(&lookups[i]); | ||
565 | } | ||
566 | tcc8k_timer_init(&tcz, (void __iomem *)TIMER_BASE, INT_TC32); | ||
567 | } | ||
diff --git a/arch/arm/mach-tcc8k/common.h b/arch/arm/mach-tcc8k/common.h new file mode 100644 index 000000000000..705690add395 --- /dev/null +++ b/arch/arm/mach-tcc8k/common.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef MACH_TCC8K_COMMON_H | ||
2 | #define MACH_TCC8K_COMMON_H | ||
3 | |||
4 | #include <linux/platform_device.h> | ||
5 | |||
6 | extern struct platform_device tcc_nand_device; | ||
7 | |||
8 | struct clk; | ||
9 | |||
10 | extern void tcc_clocks_init(unsigned long xi_freq, unsigned long xti_freq); | ||
11 | extern void tcc8k_timer_init(struct clk *clock, void __iomem *base, int irq); | ||
12 | extern void tcc8k_init_irq(void); | ||
13 | extern void tcc8k_map_common_io(void); | ||
14 | |||
15 | #endif | ||
diff --git a/arch/arm/mach-tcc8k/devices.c b/arch/arm/mach-tcc8k/devices.c new file mode 100644 index 000000000000..6722ad7c2836 --- /dev/null +++ b/arch/arm/mach-tcc8k/devices.c | |||
@@ -0,0 +1,239 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-tcc8k/devices.c | ||
3 | * | ||
4 | * Copyright (C) Telechips, Inc. | ||
5 | * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de> | ||
6 | * | ||
7 | * Licensed under the terms of GPL v2. | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #include <linux/dma-mapping.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/module.h> | ||
16 | |||
17 | #include <asm/mach/map.h> | ||
18 | |||
19 | #include <mach/tcc8k-regs.h> | ||
20 | #include <mach/irqs.h> | ||
21 | |||
22 | #include "common.h" | ||
23 | |||
24 | static u64 tcc8k_dmamask = DMA_BIT_MASK(32); | ||
25 | |||
26 | #ifdef CONFIG_MTD_NAND_TCC | ||
27 | /* NAND controller */ | ||
28 | static struct resource tcc_nand_resources[] = { | ||
29 | { | ||
30 | .start = (resource_size_t)NFC_BASE, | ||
31 | .end = (resource_size_t)NFC_BASE + 0x7f, | ||
32 | .flags = IORESOURCE_MEM, | ||
33 | }, { | ||
34 | .start = INT_NFC, | ||
35 | .end = INT_NFC, | ||
36 | .flags = IORESOURCE_IRQ, | ||
37 | }, | ||
38 | }; | ||
39 | |||
40 | struct platform_device tcc_nand_device = { | ||
41 | .name = "tcc_nand", | ||
42 | .id = 0, | ||
43 | .num_resources = ARRAY_SIZE(tcc_nand_resources), | ||
44 | .resource = tcc_nand_resources, | ||
45 | }; | ||
46 | #endif | ||
47 | |||
48 | #ifdef CONFIG_MMC_TCC8K | ||
49 | /* MMC controller */ | ||
50 | static struct resource tcc8k_mmc0_resource[] = { | ||
51 | { | ||
52 | .start = INT_SD0, | ||
53 | .end = INT_SD0, | ||
54 | .flags = IORESOURCE_IRQ, | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | static struct resource tcc8k_mmc1_resource[] = { | ||
59 | { | ||
60 | .start = INT_SD1, | ||
61 | .end = INT_SD1, | ||
62 | .flags = IORESOURCE_IRQ, | ||
63 | }, | ||
64 | }; | ||
65 | |||
66 | struct platform_device tcc8k_mmc0_device = { | ||
67 | .name = "tcc-mmc", | ||
68 | .id = 0, | ||
69 | .num_resources = ARRAY_SIZE(tcc8k_mmc0_resource), | ||
70 | .resource = tcc8k_mmc0_resource, | ||
71 | .dev = { | ||
72 | .dma_mask = &tcc8k_dmamask, | ||
73 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
74 | } | ||
75 | }; | ||
76 | |||
77 | struct platform_device tcc8k_mmc1_device = { | ||
78 | .name = "tcc-mmc", | ||
79 | .id = 1, | ||
80 | .num_resources = ARRAY_SIZE(tcc8k_mmc1_resource), | ||
81 | .resource = tcc8k_mmc1_resource, | ||
82 | .dev = { | ||
83 | .dma_mask = &tcc8k_dmamask, | ||
84 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
85 | } | ||
86 | }; | ||
87 | |||
88 | static inline void tcc8k_init_mmc(void) | ||
89 | { | ||
90 | u32 reg = __raw_readl(GPIOPS_BASE + GPIOPS_FS1_OFFS); | ||
91 | |||
92 | reg |= GPIOPS_FS1_SDH0_BITS | GPIOPS_FS1_SDH1_BITS; | ||
93 | __raw_writel(reg, GPIOPS_BASE + GPIOPS_FS1_OFFS); | ||
94 | |||
95 | platform_device_register(&tcc8k_mmc0_device); | ||
96 | platform_device_register(&tcc8k_mmc1_device); | ||
97 | } | ||
98 | #else | ||
99 | static inline void tcc8k_init_mmc(void) { } | ||
100 | #endif | ||
101 | |||
102 | #ifdef CONFIG_USB_OHCI_HCD | ||
103 | static int tcc8k_ohci_init(struct device *dev) | ||
104 | { | ||
105 | u32 reg; | ||
106 | |||
107 | /* Use GPIO PK19 as VBUS control output */ | ||
108 | reg = __raw_readl(GPIOPK_BASE + GPIOPK_FS0_OFFS); | ||
109 | reg &= ~(1 << 19); | ||
110 | __raw_writel(reg, GPIOPK_BASE + GPIOPK_FS0_OFFS); | ||
111 | reg = __raw_readl(GPIOPK_BASE + GPIOPK_FS1_OFFS); | ||
112 | reg &= ~(1 << 19); | ||
113 | __raw_writel(reg, GPIOPK_BASE + GPIOPK_FS1_OFFS); | ||
114 | |||
115 | reg = __raw_readl(GPIOPK_BASE + GPIOPK_DOE_OFFS); | ||
116 | reg |= (1 << 19); | ||
117 | __raw_writel(reg, GPIOPK_BASE + GPIOPK_DOE_OFFS); | ||
118 | /* Turn on VBUS */ | ||
119 | reg = __raw_readl(GPIOPK_BASE + GPIOPK_DAT_OFFS); | ||
120 | reg |= (1 << 19); | ||
121 | __raw_writel(reg, GPIOPK_BASE + GPIOPK_DAT_OFFS); | ||
122 | |||
123 | return 0; | ||
124 | } | ||
125 | |||
126 | static struct resource tcc8k_ohci0_resources[] = { | ||
127 | [0] = { | ||
128 | .start = (resource_size_t)USBH0_BASE, | ||
129 | .end = (resource_size_t)USBH0_BASE + 0x5c, | ||
130 | .flags = IORESOURCE_MEM, | ||
131 | }, | ||
132 | [1] = { | ||
133 | .start = INT_USBH0, | ||
134 | .end = INT_USBH0, | ||
135 | .flags = IORESOURCE_IRQ, | ||
136 | } | ||
137 | }; | ||
138 | |||
139 | static struct resource tcc8k_ohci1_resources[] = { | ||
140 | [0] = { | ||
141 | .start = (resource_size_t)USBH1_BASE, | ||
142 | .end = (resource_size_t)USBH1_BASE + 0x5c, | ||
143 | .flags = IORESOURCE_MEM, | ||
144 | }, | ||
145 | [1] = { | ||
146 | .start = INT_USBH1, | ||
147 | .end = INT_USBH1, | ||
148 | .flags = IORESOURCE_IRQ, | ||
149 | } | ||
150 | }; | ||
151 | |||
152 | static struct tccohci_platform_data tcc8k_ohci0_platform_data = { | ||
153 | .controller = 0, | ||
154 | .port_mode = PMM_PERPORT_MODE, | ||
155 | .init = tcc8k_ohci_init, | ||
156 | }; | ||
157 | |||
158 | static struct tccohci_platform_data tcc8k_ohci1_platform_data = { | ||
159 | .controller = 1, | ||
160 | .port_mode = PMM_PERPORT_MODE, | ||
161 | .init = tcc8k_ohci_init, | ||
162 | }; | ||
163 | |||
164 | static struct platform_device ohci0_device = { | ||
165 | .name = "tcc-ohci", | ||
166 | .id = 0, | ||
167 | .dev = { | ||
168 | .dma_mask = &tcc8k_dmamask, | ||
169 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
170 | .platform_data = &tcc8k_ohci0_platform_data, | ||
171 | }, | ||
172 | .num_resources = ARRAY_SIZE(tcc8k_ohci0_resources), | ||
173 | .resource = tcc8k_ohci0_resources, | ||
174 | }; | ||
175 | |||
176 | static struct platform_device ohci1_device = { | ||
177 | .name = "tcc-ohci", | ||
178 | .id = 1, | ||
179 | .dev = { | ||
180 | .dma_mask = &tcc8k_dmamask, | ||
181 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
182 | .platform_data = &tcc8k_ohci1_platform_data, | ||
183 | }, | ||
184 | .num_resources = ARRAY_SIZE(tcc8k_ohci1_resources), | ||
185 | .resource = tcc8k_ohci1_resources, | ||
186 | }; | ||
187 | |||
188 | static void __init tcc8k_init_usbhost(void) | ||
189 | { | ||
190 | platform_device_register(&ohci0_device); | ||
191 | platform_device_register(&ohci1_device); | ||
192 | } | ||
193 | #else | ||
194 | static void __init tcc8k_init_usbhost(void) { } | ||
195 | #endif | ||
196 | |||
197 | /* USB device controller*/ | ||
198 | #ifdef CONFIG_USB_GADGET_TCC8K | ||
199 | static struct resource udc_resources[] = { | ||
200 | [0] = { | ||
201 | .start = INT_USBD, | ||
202 | .end = INT_USBD, | ||
203 | .flags = IORESOURCE_IRQ, | ||
204 | }, | ||
205 | [1] = { | ||
206 | .start = INT_UDMA, | ||
207 | .end = INT_UDMA, | ||
208 | .flags = IORESOURCE_IRQ, | ||
209 | }, | ||
210 | }; | ||
211 | |||
212 | static struct platform_device tcc8k_udc_device = { | ||
213 | .name = "tcc-udc", | ||
214 | .id = 0, | ||
215 | .resource = udc_resources, | ||
216 | .num_resources = ARRAY_SIZE(udc_resources), | ||
217 | .dev = { | ||
218 | .dma_mask = &tcc8k_dmamask, | ||
219 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
220 | }, | ||
221 | }; | ||
222 | |||
223 | static void __init tcc8k_init_usb_gadget(void) | ||
224 | { | ||
225 | platform_device_register(&tcc8k_udc_device); | ||
226 | } | ||
227 | #else | ||
228 | static void __init tcc8k_init_usb_gadget(void) { } | ||
229 | #endif /* CONFIG_USB_GADGET_TCC83X */ | ||
230 | |||
231 | static int __init tcc8k_init_devices(void) | ||
232 | { | ||
233 | tcc8k_init_mmc(); | ||
234 | tcc8k_init_usbhost(); | ||
235 | tcc8k_init_usb_gadget(); | ||
236 | return 0; | ||
237 | } | ||
238 | |||
239 | arch_initcall(tcc8k_init_devices); | ||
diff --git a/arch/arm/mach-tcc8k/io.c b/arch/arm/mach-tcc8k/io.c new file mode 100644 index 000000000000..9b39d7fa658f --- /dev/null +++ b/arch/arm/mach-tcc8k/io.c | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-tcc8k/io.c | ||
3 | * | ||
4 | * (C) 2009 Hans J. Koch <hjk@linutronix.de> | ||
5 | * | ||
6 | * derived from TCC83xx io.c | ||
7 | * Copyright (C) Telechips, Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/kernel.h> | ||
17 | |||
18 | #include <asm/mach/map.h> | ||
19 | |||
20 | #include <mach/tcc8k-regs.h> | ||
21 | |||
22 | /* | ||
23 | * The machine specific code may provide the extra mapping besides the | ||
24 | * default mapping provided here. | ||
25 | */ | ||
26 | static struct map_desc tcc8k_io_desc[] __initdata = { | ||
27 | { | ||
28 | .virtual = (unsigned long)CS1_BASE_VIRT, | ||
29 | .pfn = __phys_to_pfn(CS1_BASE), | ||
30 | .length = CS1_SIZE, | ||
31 | .type = MT_DEVICE, | ||
32 | }, { | ||
33 | .virtual = (unsigned long)AHB_PERI_BASE_VIRT, | ||
34 | .pfn = __phys_to_pfn(AHB_PERI_BASE), | ||
35 | .length = AHB_PERI_SIZE, | ||
36 | .type = MT_DEVICE, | ||
37 | }, { | ||
38 | .virtual = (unsigned long)APB0_PERI_BASE_VIRT, | ||
39 | .pfn = __phys_to_pfn(APB0_PERI_BASE), | ||
40 | .length = APB0_PERI_SIZE, | ||
41 | .type = MT_DEVICE, | ||
42 | }, { | ||
43 | .virtual = (unsigned long)APB1_PERI_BASE_VIRT, | ||
44 | .pfn = __phys_to_pfn(APB1_PERI_BASE), | ||
45 | .length = APB1_PERI_SIZE, | ||
46 | .type = MT_DEVICE, | ||
47 | }, { | ||
48 | .virtual = (unsigned long)EXT_MEM_CTRL_BASE_VIRT, | ||
49 | .pfn = __phys_to_pfn(EXT_MEM_CTRL_BASE), | ||
50 | .length = EXT_MEM_CTRL_SIZE, | ||
51 | .type = MT_DEVICE, | ||
52 | }, | ||
53 | }; | ||
54 | |||
55 | /* | ||
56 | * Maps common IO regions for tcc8k. | ||
57 | * | ||
58 | */ | ||
59 | void __init tcc8k_map_common_io(void) | ||
60 | { | ||
61 | iotable_init(tcc8k_io_desc, ARRAY_SIZE(tcc8k_io_desc)); | ||
62 | } | ||
diff --git a/arch/arm/mach-tcc8k/irq.c b/arch/arm/mach-tcc8k/irq.c new file mode 100644 index 000000000000..34575c4963f0 --- /dev/null +++ b/arch/arm/mach-tcc8k/irq.c | |||
@@ -0,0 +1,111 @@ | |||
1 | /* | ||
2 | * Copyright (C) Telechips, Inc. | ||
3 | * Copyright (C) 2009-2010 Hans J. Koch <hjk@linutronix.de> | ||
4 | * | ||
5 | * Licensed under the terms of the GNU GPL version 2. | ||
6 | */ | ||
7 | |||
8 | #include <linux/init.h> | ||
9 | #include <linux/interrupt.h> | ||
10 | #include <linux/io.h> | ||
11 | |||
12 | #include <asm/irq.h> | ||
13 | #include <asm/mach/irq.h> | ||
14 | |||
15 | #include <mach/tcc8k-regs.h> | ||
16 | #include <mach/irqs.h> | ||
17 | |||
18 | #include "common.h" | ||
19 | |||
20 | /* Disable IRQ */ | ||
21 | static void tcc8000_mask_ack_irq0(unsigned int irq) | ||
22 | { | ||
23 | PIC0_IEN &= ~(1 << irq); | ||
24 | PIC0_CREQ |= (1 << irq); | ||
25 | } | ||
26 | |||
27 | static void tcc8000_mask_ack_irq1(unsigned int irq) | ||
28 | { | ||
29 | PIC1_IEN &= ~(1 << (irq - 32)); | ||
30 | PIC1_CREQ |= (1 << (irq - 32)); | ||
31 | } | ||
32 | |||
33 | static void tcc8000_mask_irq0(unsigned int irq) | ||
34 | { | ||
35 | PIC0_IEN &= ~(1 << irq); | ||
36 | } | ||
37 | |||
38 | static void tcc8000_mask_irq1(unsigned int irq) | ||
39 | { | ||
40 | PIC1_IEN &= ~(1 << (irq - 32)); | ||
41 | } | ||
42 | |||
43 | static void tcc8000_ack_irq0(unsigned int irq) | ||
44 | { | ||
45 | PIC0_CREQ |= (1 << irq); | ||
46 | } | ||
47 | |||
48 | static void tcc8000_ack_irq1(unsigned int irq) | ||
49 | { | ||
50 | PIC1_CREQ |= (1 << (irq - 32)); | ||
51 | } | ||
52 | |||
53 | /* Enable IRQ */ | ||
54 | static void tcc8000_unmask_irq0(unsigned int irq) | ||
55 | { | ||
56 | PIC0_IEN |= (1 << irq); | ||
57 | PIC0_INTOEN |= (1 << irq); | ||
58 | } | ||
59 | |||
60 | static void tcc8000_unmask_irq1(unsigned int irq) | ||
61 | { | ||
62 | PIC1_IEN |= (1 << (irq - 32)); | ||
63 | PIC1_INTOEN |= (1 << (irq - 32)); | ||
64 | } | ||
65 | |||
66 | static struct irq_chip tcc8000_irq_chip0 = { | ||
67 | .name = "tcc_irq0", | ||
68 | .mask = tcc8000_mask_irq0, | ||
69 | .ack = tcc8000_ack_irq0, | ||
70 | .mask_ack = tcc8000_mask_ack_irq0, | ||
71 | .unmask = tcc8000_unmask_irq0, | ||
72 | }; | ||
73 | |||
74 | static struct irq_chip tcc8000_irq_chip1 = { | ||
75 | .name = "tcc_irq1", | ||
76 | .mask = tcc8000_mask_irq1, | ||
77 | .ack = tcc8000_ack_irq1, | ||
78 | .mask_ack = tcc8000_mask_ack_irq1, | ||
79 | .unmask = tcc8000_unmask_irq1, | ||
80 | }; | ||
81 | |||
82 | void __init tcc8k_init_irq(void) | ||
83 | { | ||
84 | int irqno; | ||
85 | |||
86 | /* Mask and clear all interrupts */ | ||
87 | PIC0_IEN = 0x00000000; | ||
88 | PIC0_CREQ = 0xffffffff; | ||
89 | PIC1_IEN = 0x00000000; | ||
90 | PIC1_CREQ = 0xffffffff; | ||
91 | |||
92 | PIC0_MEN0 = 0x00000003; | ||
93 | PIC1_MEN1 = 0x00000003; | ||
94 | PIC1_MEN = 0x00000003; | ||
95 | |||
96 | /* let all IRQs be level triggered */ | ||
97 | PIC0_TMODE = 0xffffffff; | ||
98 | PIC1_TMODE = 0xffffffff; | ||
99 | /* all IRQs are IRQs (not FIQs) */ | ||
100 | PIC0_IRQSEL = 0xffffffff; | ||
101 | PIC1_IRQSEL = 0xffffffff; | ||
102 | |||
103 | for (irqno = 0; irqno < NR_IRQS; irqno++) { | ||
104 | if (irqno < 32) | ||
105 | set_irq_chip(irqno, &tcc8000_irq_chip0); | ||
106 | else | ||
107 | set_irq_chip(irqno, &tcc8000_irq_chip1); | ||
108 | set_irq_handler(irqno, handle_level_irq); | ||
109 | set_irq_flags(irqno, IRQF_VALID); | ||
110 | } | ||
111 | } | ||
diff --git a/arch/arm/mach-tcc8k/time.c b/arch/arm/mach-tcc8k/time.c new file mode 100644 index 000000000000..78d06008841d --- /dev/null +++ b/arch/arm/mach-tcc8k/time.c | |||
@@ -0,0 +1,149 @@ | |||
1 | /* | ||
2 | * TCC8000 system timer setup | ||
3 | * | ||
4 | * (C) 2009 Hans J. Koch <hjk@linutronix.de> | ||
5 | * | ||
6 | * Licensed under the terms of the GPL version 2. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #include <linux/clk.h> | ||
11 | #include <linux/clockchips.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/interrupt.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <linux/irq.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/spinlock.h> | ||
18 | |||
19 | #include <asm/mach/time.h> | ||
20 | |||
21 | #include <mach/tcc8k-regs.h> | ||
22 | #include <mach/irqs.h> | ||
23 | |||
24 | #include "common.h" | ||
25 | |||
26 | static void __iomem *timer_base; | ||
27 | |||
28 | static cycle_t tcc_get_cycles(struct clocksource *cs) | ||
29 | { | ||
30 | return __raw_readl(timer_base + TC32MCNT_OFFS); | ||
31 | } | ||
32 | |||
33 | static struct clocksource clocksource_tcc = { | ||
34 | .name = "tcc_tc32", | ||
35 | .rating = 200, | ||
36 | .read = tcc_get_cycles, | ||
37 | .mask = CLOCKSOURCE_MASK(32), | ||
38 | .shift = 28, | ||
39 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
40 | }; | ||
41 | |||
42 | static int tcc_set_next_event(unsigned long evt, | ||
43 | struct clock_event_device *unused) | ||
44 | { | ||
45 | unsigned long reg = __raw_readl(timer_base + TC32MCNT_OFFS); | ||
46 | |||
47 | __raw_writel(reg + evt, timer_base + TC32CMP0_OFFS); | ||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | static void tcc_set_mode(enum clock_event_mode mode, | ||
52 | struct clock_event_device *evt) | ||
53 | { | ||
54 | unsigned long tc32irq; | ||
55 | |||
56 | switch (mode) { | ||
57 | case CLOCK_EVT_MODE_ONESHOT: | ||
58 | tc32irq = __raw_readl(timer_base + TC32IRQ_OFFS); | ||
59 | tc32irq |= TC32IRQ_IRQEN0; | ||
60 | __raw_writel(tc32irq, timer_base + TC32IRQ_OFFS); | ||
61 | break; | ||
62 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
63 | case CLOCK_EVT_MODE_UNUSED: | ||
64 | tc32irq = __raw_readl(timer_base + TC32IRQ_OFFS); | ||
65 | tc32irq &= ~TC32IRQ_IRQEN0; | ||
66 | __raw_writel(tc32irq, timer_base + TC32IRQ_OFFS); | ||
67 | break; | ||
68 | case CLOCK_EVT_MODE_PERIODIC: | ||
69 | case CLOCK_EVT_MODE_RESUME: | ||
70 | break; | ||
71 | } | ||
72 | } | ||
73 | |||
74 | static irqreturn_t tcc8k_timer_interrupt(int irq, void *dev_id) | ||
75 | { | ||
76 | struct clock_event_device *evt = dev_id; | ||
77 | |||
78 | /* Acknowledge TC32 interrupt by reading TC32IRQ */ | ||
79 | __raw_readl(timer_base + TC32IRQ_OFFS); | ||
80 | |||
81 | evt->event_handler(evt); | ||
82 | |||
83 | return IRQ_HANDLED; | ||
84 | } | ||
85 | |||
86 | static struct clock_event_device clockevent_tcc = { | ||
87 | .name = "tcc_timer1", | ||
88 | .features = CLOCK_EVT_FEAT_ONESHOT, | ||
89 | .shift = 32, | ||
90 | .set_mode = tcc_set_mode, | ||
91 | .set_next_event = tcc_set_next_event, | ||
92 | .rating = 200, | ||
93 | }; | ||
94 | |||
95 | static struct irqaction tcc8k_timer_irq = { | ||
96 | .name = "TC32_timer", | ||
97 | .flags = IRQF_DISABLED | IRQF_TIMER, | ||
98 | .handler = tcc8k_timer_interrupt, | ||
99 | .dev_id = &clockevent_tcc, | ||
100 | }; | ||
101 | |||
102 | static int __init tcc_clockevent_init(struct clk *clock) | ||
103 | { | ||
104 | unsigned int c = clk_get_rate(clock); | ||
105 | |||
106 | clocksource_tcc.mult = clocksource_hz2mult(c, | ||
107 | clocksource_tcc.shift); | ||
108 | clocksource_register(&clocksource_tcc); | ||
109 | |||
110 | clockevent_tcc.mult = div_sc(c, NSEC_PER_SEC, | ||
111 | clockevent_tcc.shift); | ||
112 | clockevent_tcc.max_delta_ns = | ||
113 | clockevent_delta2ns(0xfffffffe, &clockevent_tcc); | ||
114 | clockevent_tcc.min_delta_ns = | ||
115 | clockevent_delta2ns(0xff, &clockevent_tcc); | ||
116 | |||
117 | clockevent_tcc.cpumask = cpumask_of(0); | ||
118 | |||
119 | clockevents_register_device(&clockevent_tcc); | ||
120 | |||
121 | return 0; | ||
122 | } | ||
123 | |||
124 | void __init tcc8k_timer_init(struct clk *clock, void __iomem *base, int irq) | ||
125 | { | ||
126 | u32 reg; | ||
127 | |||
128 | timer_base = base; | ||
129 | tcc8k_timer_irq.irq = irq; | ||
130 | |||
131 | /* Enable clocks */ | ||
132 | clk_enable(clock); | ||
133 | |||
134 | /* Initialize 32-bit timer */ | ||
135 | reg = __raw_readl(timer_base + TC32EN_OFFS); | ||
136 | reg &= ~TC32EN_ENABLE; /* Disable timer */ | ||
137 | __raw_writel(reg, timer_base + TC32EN_OFFS); | ||
138 | /* Free running timer, counting from 0 to 0xffffffff */ | ||
139 | __raw_writel(0, timer_base + TC32EN_OFFS); | ||
140 | __raw_writel(0, timer_base + TC32LDV_OFFS); | ||
141 | reg = __raw_readl(timer_base + TC32IRQ_OFFS); | ||
142 | reg |= TC32IRQ_IRQEN0; /* irq at match with CMP0 */ | ||
143 | __raw_writel(reg, timer_base + TC32IRQ_OFFS); | ||
144 | |||
145 | __raw_writel(TC32EN_ENABLE, timer_base + TC32EN_OFFS); | ||
146 | |||
147 | tcc_clockevent_init(clock); | ||
148 | setup_irq(irq, &tcc8k_timer_irq); | ||
149 | } | ||
diff --git a/arch/arm/mach-u300/include/mach/gpio.h b/arch/arm/mach-u300/include/mach/gpio.h index 7b1fc984abb6..d5a71abcbaea 100644 --- a/arch/arm/mach-u300/include/mach/gpio.h +++ b/arch/arm/mach-u300/include/mach/gpio.h | |||
@@ -273,6 +273,9 @@ extern void gpio_pullup(unsigned gpio, int value); | |||
273 | extern int gpio_get_value(unsigned gpio); | 273 | extern int gpio_get_value(unsigned gpio); |
274 | extern void gpio_set_value(unsigned gpio, int value); | 274 | extern void gpio_set_value(unsigned gpio, int value); |
275 | 275 | ||
276 | #define gpio_get_value_cansleep gpio_get_value | ||
277 | #define gpio_set_value_cansleep gpio_set_value | ||
278 | |||
276 | /* wrappers to sleep-enable the previous two functions */ | 279 | /* wrappers to sleep-enable the previous two functions */ |
277 | static inline unsigned gpio_to_irq(unsigned gpio) | 280 | static inline unsigned gpio_to_irq(unsigned gpio) |
278 | { | 281 | { |
diff --git a/arch/arm/mach-versatile/include/mach/vmalloc.h b/arch/arm/mach-versatile/include/mach/vmalloc.h index 427e3612db5d..ebd8a2543d3b 100644 --- a/arch/arm/mach-versatile/include/mach/vmalloc.h +++ b/arch/arm/mach-versatile/include/mach/vmalloc.h | |||
@@ -18,4 +18,4 @@ | |||
18 | * along with this program; if not, write to the Free Software | 18 | * along with this program; if not, write to the Free Software |
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | #define VMALLOC_END (PAGE_OFFSET + 0x18000000) | 21 | #define VMALLOC_END 0xd8000000 |
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c index 577df6cccb08..efb127022d42 100644 --- a/arch/arm/mach-vexpress/ct-ca9x4.c +++ b/arch/arm/mach-vexpress/ct-ca9x4.c | |||
@@ -227,7 +227,13 @@ static void ct_ca9x4_init(void) | |||
227 | int i; | 227 | int i; |
228 | 228 | ||
229 | #ifdef CONFIG_CACHE_L2X0 | 229 | #ifdef CONFIG_CACHE_L2X0 |
230 | l2x0_init(MMIO_P2V(CT_CA9X4_L2CC), 0x00000000, 0xfe0fffff); | 230 | void __iomem *l2x0_base = MMIO_P2V(CT_CA9X4_L2CC); |
231 | |||
232 | /* set RAM latencies to 1 cycle for this core tile. */ | ||
233 | writel(0, l2x0_base + L2X0_TAG_LATENCY_CTRL); | ||
234 | writel(0, l2x0_base + L2X0_DATA_LATENCY_CTRL); | ||
235 | |||
236 | l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff); | ||
231 | #endif | 237 | #endif |
232 | 238 | ||
233 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 239 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index d073b64ae87e..724ba3bce72c 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
@@ -885,8 +885,23 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
885 | 885 | ||
886 | if (ai_usermode & UM_SIGNAL) | 886 | if (ai_usermode & UM_SIGNAL) |
887 | force_sig(SIGBUS, current); | 887 | force_sig(SIGBUS, current); |
888 | else | 888 | else { |
889 | set_cr(cr_no_alignment); | 889 | /* |
890 | * We're about to disable the alignment trap and return to | ||
891 | * user space. But if an interrupt occurs before actually | ||
892 | * reaching user space, then the IRQ vector entry code will | ||
893 | * notice that we were still in kernel space and therefore | ||
894 | * the alignment trap won't be re-enabled in that case as it | ||
895 | * is presumed to be always on from kernel space. | ||
896 | * Let's prevent that race by disabling interrupts here (they | ||
897 | * are disabled on the way back to user space anyway in | ||
898 | * entry-common.S) and disable the alignment trap only if | ||
899 | * there is no work pending for this thread. | ||
900 | */ | ||
901 | raw_local_irq_disable(); | ||
902 | if (!(current_thread_info()->flags & _TIF_WORK_MASK)) | ||
903 | set_cr(cr_no_alignment); | ||
904 | } | ||
890 | 905 | ||
891 | return 0; | 906 | return 0; |
892 | } | 907 | } |
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index 4f5b39687df5..b0a98305055c 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c | |||
@@ -144,3 +144,25 @@ int valid_mmap_phys_addr_range(unsigned long pfn, size_t size) | |||
144 | { | 144 | { |
145 | return !(pfn + (size >> PAGE_SHIFT) > 0x00100000); | 145 | return !(pfn + (size >> PAGE_SHIFT) > 0x00100000); |
146 | } | 146 | } |
147 | |||
148 | #ifdef CONFIG_STRICT_DEVMEM | ||
149 | |||
150 | #include <linux/ioport.h> | ||
151 | |||
152 | /* | ||
153 | * devmem_is_allowed() checks to see if /dev/mem access to a certain | ||
154 | * address is valid. The argument is a physical page number. | ||
155 | * We mimic x86 here by disallowing access to system RAM as well as | ||
156 | * device-exclusive MMIO regions. This effectively disable read()/write() | ||
157 | * on /dev/mem. | ||
158 | */ | ||
159 | int devmem_is_allowed(unsigned long pfn) | ||
160 | { | ||
161 | if (iomem_is_exclusive(pfn << PAGE_SHIFT)) | ||
162 | return 0; | ||
163 | if (!page_is_ram(pfn)) | ||
164 | return 1; | ||
165 | return 0; | ||
166 | } | ||
167 | |||
168 | #endif | ||
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 6e1c4f6a2b3f..6a3a2d0cd6db 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/nodemask.h> | 15 | #include <linux/nodemask.h> |
16 | #include <linux/memblock.h> | 16 | #include <linux/memblock.h> |
17 | #include <linux/sort.h> | 17 | #include <linux/sort.h> |
18 | #include <linux/fs.h> | ||
18 | 19 | ||
19 | #include <asm/cputype.h> | 20 | #include <asm/cputype.h> |
20 | #include <asm/sections.h> | 21 | #include <asm/sections.h> |
@@ -246,6 +247,9 @@ static struct mem_type mem_types[] = { | |||
246 | .domain = DOMAIN_USER, | 247 | .domain = DOMAIN_USER, |
247 | }, | 248 | }, |
248 | [MT_MEMORY] = { | 249 | [MT_MEMORY] = { |
250 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | | ||
251 | L_PTE_USER | L_PTE_EXEC, | ||
252 | .prot_l1 = PMD_TYPE_TABLE, | ||
249 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, | 253 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, |
250 | .domain = DOMAIN_KERNEL, | 254 | .domain = DOMAIN_KERNEL, |
251 | }, | 255 | }, |
@@ -254,6 +258,9 @@ static struct mem_type mem_types[] = { | |||
254 | .domain = DOMAIN_KERNEL, | 258 | .domain = DOMAIN_KERNEL, |
255 | }, | 259 | }, |
256 | [MT_MEMORY_NONCACHED] = { | 260 | [MT_MEMORY_NONCACHED] = { |
261 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | | ||
262 | L_PTE_USER | L_PTE_EXEC | L_PTE_MT_BUFFERABLE, | ||
263 | .prot_l1 = PMD_TYPE_TABLE, | ||
257 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, | 264 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, |
258 | .domain = DOMAIN_KERNEL, | 265 | .domain = DOMAIN_KERNEL, |
259 | }, | 266 | }, |
@@ -411,9 +418,12 @@ static void __init build_mem_type_table(void) | |||
411 | * Enable CPU-specific coherency if supported. | 418 | * Enable CPU-specific coherency if supported. |
412 | * (Only available on XSC3 at the moment.) | 419 | * (Only available on XSC3 at the moment.) |
413 | */ | 420 | */ |
414 | if (arch_is_coherent() && cpu_is_xsc3()) | 421 | if (arch_is_coherent() && cpu_is_xsc3()) { |
415 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; | 422 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; |
416 | 423 | mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED; | |
424 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S; | ||
425 | mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED; | ||
426 | } | ||
417 | /* | 427 | /* |
418 | * ARMv6 and above have extended page tables. | 428 | * ARMv6 and above have extended page tables. |
419 | */ | 429 | */ |
@@ -438,7 +448,9 @@ static void __init build_mem_type_table(void) | |||
438 | mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S; | 448 | mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S; |
439 | mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED; | 449 | mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED; |
440 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; | 450 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; |
451 | mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED; | ||
441 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S; | 452 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S; |
453 | mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED; | ||
442 | #endif | 454 | #endif |
443 | } | 455 | } |
444 | 456 | ||
@@ -475,6 +487,8 @@ static void __init build_mem_type_table(void) | |||
475 | mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; | 487 | mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; |
476 | mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; | 488 | mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; |
477 | mem_types[MT_MEMORY].prot_sect |= ecc_mask | cp->pmd; | 489 | mem_types[MT_MEMORY].prot_sect |= ecc_mask | cp->pmd; |
490 | mem_types[MT_MEMORY].prot_pte |= kern_pgprot; | ||
491 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= ecc_mask; | ||
478 | mem_types[MT_ROM].prot_sect |= cp->pmd; | 492 | mem_types[MT_ROM].prot_sect |= cp->pmd; |
479 | 493 | ||
480 | switch (cp->pmd) { | 494 | switch (cp->pmd) { |
@@ -498,6 +512,19 @@ static void __init build_mem_type_table(void) | |||
498 | } | 512 | } |
499 | } | 513 | } |
500 | 514 | ||
515 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE | ||
516 | pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | ||
517 | unsigned long size, pgprot_t vma_prot) | ||
518 | { | ||
519 | if (!pfn_valid(pfn)) | ||
520 | return pgprot_noncached(vma_prot); | ||
521 | else if (file->f_flags & O_SYNC) | ||
522 | return pgprot_writecombine(vma_prot); | ||
523 | return vma_prot; | ||
524 | } | ||
525 | EXPORT_SYMBOL(phys_mem_access_prot); | ||
526 | #endif | ||
527 | |||
501 | #define vectors_base() (vectors_high() ? 0xffff0000 : 0) | 528 | #define vectors_base() (vectors_high() ? 0xffff0000 : 0) |
502 | 529 | ||
503 | static void __init *early_alloc(unsigned long sz) | 530 | static void __init *early_alloc(unsigned long sz) |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 6a8506d99ee9..7563ff0141bd 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -186,13 +186,14 @@ cpu_v7_name: | |||
186 | * It is assumed that: | 186 | * It is assumed that: |
187 | * - cache type register is implemented | 187 | * - cache type register is implemented |
188 | */ | 188 | */ |
189 | __v7_setup: | 189 | __v7_ca9mp_setup: |
190 | #ifdef CONFIG_SMP | 190 | #ifdef CONFIG_SMP |
191 | mrc p15, 0, r0, c1, c0, 1 | 191 | mrc p15, 0, r0, c1, c0, 1 |
192 | tst r0, #(1 << 6) @ SMP/nAMP mode enabled? | 192 | tst r0, #(1 << 6) @ SMP/nAMP mode enabled? |
193 | orreq r0, r0, #(1 << 6) | (1 << 0) @ Enable SMP/nAMP mode and | 193 | orreq r0, r0, #(1 << 6) | (1 << 0) @ Enable SMP/nAMP mode and |
194 | mcreq p15, 0, r0, c1, c0, 1 @ TLB ops broadcasting | 194 | mcreq p15, 0, r0, c1, c0, 1 @ TLB ops broadcasting |
195 | #endif | 195 | #endif |
196 | __v7_setup: | ||
196 | adr r12, __v7_setup_stack @ the local stack | 197 | adr r12, __v7_setup_stack @ the local stack |
197 | stmia r12, {r0-r5, r7, r9, r11, lr} | 198 | stmia r12, {r0-r5, r7, r9, r11, lr} |
198 | bl v7_flush_dcache_all | 199 | bl v7_flush_dcache_all |
@@ -201,11 +202,16 @@ __v7_setup: | |||
201 | mrc p15, 0, r0, c0, c0, 0 @ read main ID register | 202 | mrc p15, 0, r0, c0, c0, 0 @ read main ID register |
202 | and r10, r0, #0xff000000 @ ARM? | 203 | and r10, r0, #0xff000000 @ ARM? |
203 | teq r10, #0x41000000 | 204 | teq r10, #0x41000000 |
204 | bne 2f | 205 | bne 3f |
205 | and r5, r0, #0x00f00000 @ variant | 206 | and r5, r0, #0x00f00000 @ variant |
206 | and r6, r0, #0x0000000f @ revision | 207 | and r6, r0, #0x0000000f @ revision |
207 | orr r0, r6, r5, lsr #20-4 @ combine variant and revision | 208 | orr r6, r6, r5, lsr #20-4 @ combine variant and revision |
209 | ubfx r0, r0, #4, #12 @ primary part number | ||
208 | 210 | ||
211 | /* Cortex-A8 Errata */ | ||
212 | ldr r10, =0x00000c08 @ Cortex-A8 primary part number | ||
213 | teq r0, r10 | ||
214 | bne 2f | ||
209 | #ifdef CONFIG_ARM_ERRATA_430973 | 215 | #ifdef CONFIG_ARM_ERRATA_430973 |
210 | teq r5, #0x00100000 @ only present in r1p* | 216 | teq r5, #0x00100000 @ only present in r1p* |
211 | mrceq p15, 0, r10, c1, c0, 1 @ read aux control register | 217 | mrceq p15, 0, r10, c1, c0, 1 @ read aux control register |
@@ -213,21 +219,42 @@ __v7_setup: | |||
213 | mcreq p15, 0, r10, c1, c0, 1 @ write aux control register | 219 | mcreq p15, 0, r10, c1, c0, 1 @ write aux control register |
214 | #endif | 220 | #endif |
215 | #ifdef CONFIG_ARM_ERRATA_458693 | 221 | #ifdef CONFIG_ARM_ERRATA_458693 |
216 | teq r0, #0x20 @ only present in r2p0 | 222 | teq r6, #0x20 @ only present in r2p0 |
217 | mrceq p15, 0, r10, c1, c0, 1 @ read aux control register | 223 | mrceq p15, 0, r10, c1, c0, 1 @ read aux control register |
218 | orreq r10, r10, #(1 << 5) @ set L1NEON to 1 | 224 | orreq r10, r10, #(1 << 5) @ set L1NEON to 1 |
219 | orreq r10, r10, #(1 << 9) @ set PLDNOP to 1 | 225 | orreq r10, r10, #(1 << 9) @ set PLDNOP to 1 |
220 | mcreq p15, 0, r10, c1, c0, 1 @ write aux control register | 226 | mcreq p15, 0, r10, c1, c0, 1 @ write aux control register |
221 | #endif | 227 | #endif |
222 | #ifdef CONFIG_ARM_ERRATA_460075 | 228 | #ifdef CONFIG_ARM_ERRATA_460075 |
223 | teq r0, #0x20 @ only present in r2p0 | 229 | teq r6, #0x20 @ only present in r2p0 |
224 | mrceq p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register | 230 | mrceq p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register |
225 | tsteq r10, #1 << 22 | 231 | tsteq r10, #1 << 22 |
226 | orreq r10, r10, #(1 << 22) @ set the Write Allocate disable bit | 232 | orreq r10, r10, #(1 << 22) @ set the Write Allocate disable bit |
227 | mcreq p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register | 233 | mcreq p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register |
228 | #endif | 234 | #endif |
235 | b 3f | ||
236 | |||
237 | /* Cortex-A9 Errata */ | ||
238 | 2: ldr r10, =0x00000c09 @ Cortex-A9 primary part number | ||
239 | teq r0, r10 | ||
240 | bne 3f | ||
241 | #ifdef CONFIG_ARM_ERRATA_742230 | ||
242 | cmp r6, #0x22 @ only present up to r2p2 | ||
243 | mrcle p15, 0, r10, c15, c0, 1 @ read diagnostic register | ||
244 | orrle r10, r10, #1 << 4 @ set bit #4 | ||
245 | mcrle p15, 0, r10, c15, c0, 1 @ write diagnostic register | ||
246 | #endif | ||
247 | #ifdef CONFIG_ARM_ERRATA_742231 | ||
248 | teq r6, #0x20 @ present in r2p0 | ||
249 | teqne r6, #0x21 @ present in r2p1 | ||
250 | teqne r6, #0x22 @ present in r2p2 | ||
251 | mrceq p15, 0, r10, c15, c0, 1 @ read diagnostic register | ||
252 | orreq r10, r10, #1 << 12 @ set bit #12 | ||
253 | orreq r10, r10, #1 << 22 @ set bit #22 | ||
254 | mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register | ||
255 | #endif | ||
229 | 256 | ||
230 | 2: mov r10, #0 | 257 | 3: mov r10, #0 |
231 | #ifdef HARVARD_CACHE | 258 | #ifdef HARVARD_CACHE |
232 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate | 259 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate |
233 | #endif | 260 | #endif |
@@ -323,6 +350,29 @@ cpu_elf_name: | |||
323 | 350 | ||
324 | .section ".proc.info.init", #alloc, #execinstr | 351 | .section ".proc.info.init", #alloc, #execinstr |
325 | 352 | ||
353 | .type __v7_ca9mp_proc_info, #object | ||
354 | __v7_ca9mp_proc_info: | ||
355 | .long 0x410fc090 @ Required ID value | ||
356 | .long 0xff0ffff0 @ Mask for ID | ||
357 | .long PMD_TYPE_SECT | \ | ||
358 | PMD_SECT_AP_WRITE | \ | ||
359 | PMD_SECT_AP_READ | \ | ||
360 | PMD_FLAGS | ||
361 | .long PMD_TYPE_SECT | \ | ||
362 | PMD_SECT_XN | \ | ||
363 | PMD_SECT_AP_WRITE | \ | ||
364 | PMD_SECT_AP_READ | ||
365 | b __v7_ca9mp_setup | ||
366 | .long cpu_arch_name | ||
367 | .long cpu_elf_name | ||
368 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP | ||
369 | .long cpu_v7_name | ||
370 | .long v7_processor_functions | ||
371 | .long v7wbi_tlb_fns | ||
372 | .long v6_user_fns | ||
373 | .long v7_cache_fns | ||
374 | .size __v7_ca9mp_proc_info, . - __v7_ca9mp_proc_info | ||
375 | |||
326 | /* | 376 | /* |
327 | * Match any ARMv7 processor core. | 377 | * Match any ARMv7 processor core. |
328 | */ | 378 | */ |
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c index 0691176899ff..72e09eb642dd 100644 --- a/arch/arm/oprofile/common.c +++ b/arch/arm/oprofile/common.c | |||
@@ -102,6 +102,7 @@ static int op_create_counter(int cpu, int event) | |||
102 | if (IS_ERR(pevent)) { | 102 | if (IS_ERR(pevent)) { |
103 | ret = PTR_ERR(pevent); | 103 | ret = PTR_ERR(pevent); |
104 | } else if (pevent->state != PERF_EVENT_STATE_ACTIVE) { | 104 | } else if (pevent->state != PERF_EVENT_STATE_ACTIVE) { |
105 | perf_event_release_kernel(pevent); | ||
105 | pr_warning("oprofile: failed to enable event %d " | 106 | pr_warning("oprofile: failed to enable event %d " |
106 | "on CPU %d\n", event, cpu); | 107 | "on CPU %d\n", event, cpu); |
107 | ret = -EBUSY; | 108 | ret = -EBUSY; |
@@ -365,6 +366,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
365 | ret = init_driverfs(); | 366 | ret = init_driverfs(); |
366 | if (ret) { | 367 | if (ret) { |
367 | kfree(counter_config); | 368 | kfree(counter_config); |
369 | counter_config = NULL; | ||
368 | return ret; | 370 | return ret; |
369 | } | 371 | } |
370 | 372 | ||
@@ -402,7 +404,6 @@ void oprofile_arch_exit(void) | |||
402 | struct perf_event *event; | 404 | struct perf_event *event; |
403 | 405 | ||
404 | if (*perf_events) { | 406 | if (*perf_events) { |
405 | exit_driverfs(); | ||
406 | for_each_possible_cpu(cpu) { | 407 | for_each_possible_cpu(cpu) { |
407 | for (id = 0; id < perf_num_counters; ++id) { | 408 | for (id = 0; id < perf_num_counters; ++id) { |
408 | event = perf_events[cpu][id]; | 409 | event = perf_events[cpu][id]; |
@@ -413,8 +414,10 @@ void oprofile_arch_exit(void) | |||
413 | } | 414 | } |
414 | } | 415 | } |
415 | 416 | ||
416 | if (counter_config) | 417 | if (counter_config) { |
417 | kfree(counter_config); | 418 | kfree(counter_config); |
419 | exit_driverfs(); | ||
420 | } | ||
418 | } | 421 | } |
419 | #else | 422 | #else |
420 | int __init oprofile_arch_init(struct oprofile_operations *ops) | 423 | int __init oprofile_arch_init(struct oprofile_operations *ops) |
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig index 6785db4179b8..95f8d614d4fc 100644 --- a/arch/arm/plat-mxc/Kconfig +++ b/arch/arm/plat-mxc/Kconfig | |||
@@ -92,6 +92,18 @@ config MXC_DEBUG_BOARD | |||
92 | data/address de-multiplexing and decode, signal level shift, | 92 | data/address de-multiplexing and decode, signal level shift, |
93 | interrupt control and various board functions. | 93 | interrupt control and various board functions. |
94 | 94 | ||
95 | config HAVE_EPIT | ||
96 | bool | ||
97 | |||
98 | config MXC_USE_EPIT | ||
99 | bool "Use EPIT instead of GPT" | ||
100 | depends on HAVE_EPIT | ||
101 | help | ||
102 | Use EPIT as the system timer on systems that have it. Normally you | ||
103 | don't have a reason to do so as the EPIT has the same features and | ||
104 | uses the same clocks as the GPT. Anyway, on some systems the GPT | ||
105 | may be in use for other purposes. | ||
106 | |||
95 | config MXC_ULPI | 107 | config MXC_ULPI |
96 | bool | 108 | bool |
97 | 109 | ||
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile index 78d405ed8616..bb3443f9751a 100644 --- a/arch/arm/plat-mxc/Makefile +++ b/arch/arm/plat-mxc/Makefile | |||
@@ -13,6 +13,7 @@ obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o | |||
13 | obj-$(CONFIG_MXC_PWM) += pwm.o | 13 | obj-$(CONFIG_MXC_PWM) += pwm.o |
14 | obj-$(CONFIG_USB_EHCI_MXC) += ehci.o | 14 | obj-$(CONFIG_USB_EHCI_MXC) += ehci.o |
15 | obj-$(CONFIG_MXC_ULPI) += ulpi.o | 15 | obj-$(CONFIG_MXC_ULPI) += ulpi.o |
16 | obj-$(CONFIG_MXC_USE_EPIT) += epit.o | ||
16 | obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o | 17 | obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o |
17 | obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o | 18 | obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o |
18 | obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o | 19 | obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o |
diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c index f9e7cdbd0005..62920490c0d6 100644 --- a/arch/arm/plat-mxc/audmux-v2.c +++ b/arch/arm/plat-mxc/audmux-v2.c | |||
@@ -186,7 +186,13 @@ EXPORT_SYMBOL_GPL(mxc_audmux_v2_configure_port); | |||
186 | static int mxc_audmux_v2_init(void) | 186 | static int mxc_audmux_v2_init(void) |
187 | { | 187 | { |
188 | int ret; | 188 | int ret; |
189 | 189 | #if defined(CONFIG_ARCH_MX5) | |
190 | if (cpu_is_mx51()) { | ||
191 | audmux_base = MX51_IO_ADDRESS(MX51_AUDMUX_BASE_ADDR); | ||
192 | ret = 0; | ||
193 | return ret; | ||
194 | } | ||
195 | #endif | ||
190 | #if defined(CONFIG_ARCH_MX3) | 196 | #if defined(CONFIG_ARCH_MX3) |
191 | if (cpu_is_mx31()) | 197 | if (cpu_is_mx31()) |
192 | audmux_base = MX31_IO_ADDRESS(MX31_AUDMUX_BASE_ADDR); | 198 | audmux_base = MX31_IO_ADDRESS(MX31_AUDMUX_BASE_ADDR); |
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index 9ab784b776f9..404799487f17 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig | |||
@@ -1,3 +1,10 @@ | |||
1 | config IMX_HAVE_PLATFORM_ESDHC | ||
2 | bool | ||
3 | |||
4 | config IMX_HAVE_PLATFORM_FEC | ||
5 | bool | ||
6 | default y if ARCH_MX25 || SOC_IMX27 || ARCH_MX35 || ARCH_MX51 | ||
7 | |||
1 | config IMX_HAVE_PLATFORM_FLEXCAN | 8 | config IMX_HAVE_PLATFORM_FLEXCAN |
2 | select HAVE_CAN_FLEXCAN | 9 | select HAVE_CAN_FLEXCAN |
3 | bool | 10 | bool |
@@ -5,6 +12,9 @@ config IMX_HAVE_PLATFORM_FLEXCAN | |||
5 | config IMX_HAVE_PLATFORM_IMX_I2C | 12 | config IMX_HAVE_PLATFORM_IMX_I2C |
6 | bool | 13 | bool |
7 | 14 | ||
15 | config IMX_HAVE_PLATFORM_IMX_SSI | ||
16 | bool | ||
17 | |||
8 | config IMX_HAVE_PLATFORM_IMX_UART | 18 | config IMX_HAVE_PLATFORM_IMX_UART |
9 | bool | 19 | bool |
10 | 20 | ||
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index 347da5161f7e..0a3c1f089413 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile | |||
@@ -1,8 +1,9 @@ | |||
1 | ifdef CONFIG_CAN_FLEXCAN | 1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_ESDHC) += platform-esdhc.o |
2 | # the ifdef can be removed once the flexcan driver has been merged | 2 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o |
3 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o | 3 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o |
4 | endif | 4 | obj-y += platform-imx-dma.o |
5 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o | 5 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o |
6 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o | ||
6 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o | 7 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o |
7 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o | 8 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o |
8 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o | 9 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o |
diff --git a/arch/arm/plat-mxc/devices/platform-esdhc.c b/arch/arm/plat-mxc/devices/platform-esdhc.c new file mode 100644 index 000000000000..68db2a22d2cd --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-esdhc.c | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix, Wolfram Sang <w.sang@pengutronix.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it under | ||
5 | * the terms of the GNU General Public License version 2 as published by the | ||
6 | * Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <mach/devices-common.h> | ||
10 | #include <mach/esdhc.h> | ||
11 | |||
12 | struct platform_device *__init imx_add_esdhc(int id, | ||
13 | resource_size_t iobase, resource_size_t iosize, | ||
14 | resource_size_t irq, | ||
15 | const struct esdhc_platform_data *pdata) | ||
16 | { | ||
17 | struct resource res[] = { | ||
18 | { | ||
19 | .start = iobase, | ||
20 | .end = iobase + iosize - 1, | ||
21 | .flags = IORESOURCE_MEM, | ||
22 | }, { | ||
23 | .start = irq, | ||
24 | .end = irq, | ||
25 | .flags = IORESOURCE_IRQ, | ||
26 | }, | ||
27 | }; | ||
28 | |||
29 | return imx_add_platform_device("sdhci-esdhc-imx", id, res, | ||
30 | ARRAY_SIZE(res), pdata, sizeof(*pdata)); | ||
31 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/plat-mxc/devices/platform-fec.c new file mode 100644 index 000000000000..11d087f4e219 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-fec.c | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <asm/sizes.h> | ||
10 | #include <mach/hardware.h> | ||
11 | #include <mach/devices-common.h> | ||
12 | |||
13 | #define imx_fec_data_entry_single(soc) \ | ||
14 | { \ | ||
15 | .iobase = soc ## _FEC_BASE_ADDR, \ | ||
16 | .irq = soc ## _INT_FEC, \ | ||
17 | } | ||
18 | |||
19 | #ifdef CONFIG_ARCH_MX25 | ||
20 | const struct imx_fec_data imx25_fec_data __initconst = | ||
21 | imx_fec_data_entry_single(MX25); | ||
22 | #endif /* ifdef CONFIG_ARCH_MX25 */ | ||
23 | |||
24 | #ifdef CONFIG_SOC_IMX27 | ||
25 | const struct imx_fec_data imx27_fec_data __initconst = | ||
26 | imx_fec_data_entry_single(MX27); | ||
27 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
28 | |||
29 | #ifdef CONFIG_ARCH_MX35 | ||
30 | const struct imx_fec_data imx35_fec_data __initconst = | ||
31 | imx_fec_data_entry_single(MX35); | ||
32 | #endif | ||
33 | |||
34 | #ifdef CONFIG_ARCH_MX51 | ||
35 | const struct imx_fec_data imx51_fec_data __initconst = | ||
36 | imx_fec_data_entry_single(MX51); | ||
37 | #endif | ||
38 | |||
39 | struct platform_device *__init imx_add_fec( | ||
40 | const struct imx_fec_data *data, | ||
41 | const struct fec_platform_data *pdata) | ||
42 | { | ||
43 | struct resource res[] = { | ||
44 | { | ||
45 | .start = data->iobase, | ||
46 | .end = data->iobase + SZ_4K, | ||
47 | .flags = IORESOURCE_MEM, | ||
48 | }, { | ||
49 | .start = data->irq, | ||
50 | .end = data->irq, | ||
51 | .flags = IORESOURCE_IRQ, | ||
52 | }, | ||
53 | }; | ||
54 | |||
55 | return imx_add_platform_device("fec", 0 /* -1? */, | ||
56 | res, ARRAY_SIZE(res), | ||
57 | pdata, sizeof(*pdata)); | ||
58 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/plat-mxc/devices/platform-imx-dma.c new file mode 100644 index 000000000000..02d989018059 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx-dma.c | |||
@@ -0,0 +1,129 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <linux/compiler.h> | ||
10 | #include <linux/err.h> | ||
11 | #include <linux/init.h> | ||
12 | |||
13 | #include <mach/hardware.h> | ||
14 | #include <mach/devices-common.h> | ||
15 | #ifdef SDMA_IS_MERGED | ||
16 | #include <mach/sdma.h> | ||
17 | #else | ||
18 | struct sdma_platform_data { | ||
19 | int sdma_version; | ||
20 | char *cpu_name; | ||
21 | int to_version; | ||
22 | }; | ||
23 | #endif | ||
24 | |||
25 | struct imx_imx_sdma_data { | ||
26 | resource_size_t iobase; | ||
27 | resource_size_t irq; | ||
28 | struct sdma_platform_data pdata; | ||
29 | }; | ||
30 | |||
31 | #define imx_imx_sdma_data_entry_single(soc, _sdma_version, _cpu_name, _to_version)\ | ||
32 | { \ | ||
33 | .iobase = soc ## _SDMA ## _BASE_ADDR, \ | ||
34 | .irq = soc ## _INT_SDMA, \ | ||
35 | .pdata = { \ | ||
36 | .sdma_version = _sdma_version, \ | ||
37 | .cpu_name = _cpu_name, \ | ||
38 | .to_version = _to_version, \ | ||
39 | }, \ | ||
40 | } | ||
41 | |||
42 | #ifdef CONFIG_ARCH_MX25 | ||
43 | const struct imx_imx_sdma_data imx25_imx_sdma_data __initconst = | ||
44 | imx_imx_sdma_data_entry_single(MX25, 1, "imx25", 0); | ||
45 | #endif /* ifdef CONFIG_ARCH_MX25 */ | ||
46 | |||
47 | #ifdef CONFIG_ARCH_MX31 | ||
48 | struct imx_imx_sdma_data imx31_imx_sdma_data __initdata = | ||
49 | imx_imx_sdma_data_entry_single(MX31, 1, "imx31", 0); | ||
50 | #endif /* ifdef CONFIG_ARCH_MX31 */ | ||
51 | |||
52 | #ifdef CONFIG_ARCH_MX35 | ||
53 | struct imx_imx_sdma_data imx35_imx_sdma_data __initdata = | ||
54 | imx_imx_sdma_data_entry_single(MX35, 2, "imx35", 0); | ||
55 | #endif /* ifdef CONFIG_ARCH_MX35 */ | ||
56 | |||
57 | #ifdef CONFIG_ARCH_MX51 | ||
58 | const struct imx_imx_sdma_data imx51_imx_sdma_data __initconst = | ||
59 | imx_imx_sdma_data_entry_single(MX51, 2, "imx51", 0); | ||
60 | #endif /* ifdef CONFIG_ARCH_MX51 */ | ||
61 | |||
62 | static struct platform_device __init __maybe_unused *imx_add_imx_sdma( | ||
63 | const struct imx_imx_sdma_data *data) | ||
64 | { | ||
65 | struct resource res[] = { | ||
66 | { | ||
67 | .start = data->iobase, | ||
68 | .end = data->iobase + SZ_4K - 1, | ||
69 | .flags = IORESOURCE_MEM, | ||
70 | }, { | ||
71 | .start = data->irq, | ||
72 | .end = data->irq, | ||
73 | .flags = IORESOURCE_IRQ, | ||
74 | }, | ||
75 | }; | ||
76 | |||
77 | return imx_add_platform_device("imx-sdma", -1, | ||
78 | res, ARRAY_SIZE(res), | ||
79 | &data->pdata, sizeof(data->pdata)); | ||
80 | } | ||
81 | |||
82 | static struct platform_device __init __maybe_unused *imx_add_imx_dma(void) | ||
83 | { | ||
84 | return imx_add_platform_device("imx-dma", -1, NULL, 0, NULL, 0); | ||
85 | } | ||
86 | |||
87 | static int __init imxXX_add_imx_dma(void) | ||
88 | { | ||
89 | struct platform_device *ret; | ||
90 | |||
91 | #if defined(CONFIG_SOC_IMX21) || defined(CONFIG_SOC_IMX27) | ||
92 | if (cpu_is_mx21() || cpu_is_mx27()) | ||
93 | ret = imx_add_imx_dma(); | ||
94 | else | ||
95 | #endif | ||
96 | |||
97 | #if defined(CONFIG_ARCH_MX25) | ||
98 | if (cpu_is_mx25()) | ||
99 | ret = imx_add_imx_sdma(&imx25_imx_sdma_data); | ||
100 | else | ||
101 | #endif | ||
102 | |||
103 | #if defined(CONFIG_ARCH_MX31) | ||
104 | if (cpu_is_mx31()) { | ||
105 | imx31_imx_sdma_data.pdata.to_version = mx31_revision() >> 4; | ||
106 | ret = imx_add_imx_sdma(&imx31_imx_sdma_data); | ||
107 | } else | ||
108 | #endif | ||
109 | |||
110 | #if defined(CONFIG_ARCH_MX35) | ||
111 | if (cpu_is_mx35()) { | ||
112 | imx35_imx_sdma_data.pdata.to_version = mx35_revision() >> 4; | ||
113 | ret = imx_add_imx_sdma(&imx35_imx_sdma_data); | ||
114 | } else | ||
115 | #endif | ||
116 | |||
117 | #if defined(CONFIG_ARCH_MX51) | ||
118 | if (cpu_is_mx51()) | ||
119 | ret = imx_add_imx_sdma(&imx51_imx_sdma_data); | ||
120 | else | ||
121 | #endif | ||
122 | ret = ERR_PTR(-ENODEV); | ||
123 | |||
124 | if (IS_ERR(ret)) | ||
125 | return PTR_ERR(ret); | ||
126 | |||
127 | return 0; | ||
128 | } | ||
129 | arch_initcall(imxXX_add_imx_dma); | ||
diff --git a/arch/arm/plat-mxc/devices/platform-imx-i2c.c b/arch/arm/plat-mxc/devices/platform-imx-i2c.c index d0af9f7d8aed..ca988d40a3d7 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-i2c.c +++ b/arch/arm/plat-mxc/devices/platform-imx-i2c.c | |||
@@ -6,24 +6,94 @@ | |||
6 | * the terms of the GNU General Public License version 2 as published by the | 6 | * the terms of the GNU General Public License version 2 as published by the |
7 | * Free Software Foundation. | 7 | * Free Software Foundation. |
8 | */ | 8 | */ |
9 | #include <mach/hardware.h> | ||
9 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
10 | 11 | ||
11 | struct platform_device *__init imx_add_imx_i2c(int id, | 12 | #define imx_imx_i2c_data_entry_single(soc, _id, _hwid, _size) \ |
12 | resource_size_t iobase, resource_size_t iosize, int irq, | 13 | { \ |
14 | .id = _id, \ | ||
15 | .iobase = soc ## _I2C ## _hwid ## _BASE_ADDR, \ | ||
16 | .iosize = _size, \ | ||
17 | .irq = soc ## _INT_I2C ## _hwid, \ | ||
18 | } | ||
19 | |||
20 | #define imx_imx_i2c_data_entry(soc, _id, _hwid, _size) \ | ||
21 | [_id] = imx_imx_i2c_data_entry_single(soc, _id, _hwid, _size) | ||
22 | |||
23 | #ifdef CONFIG_SOC_IMX1 | ||
24 | const struct imx_imx_i2c_data imx1_imx_i2c_data __initconst = | ||
25 | imx_imx_i2c_data_entry_single(MX1, 0, , SZ_4K); | ||
26 | #endif /* ifdef CONFIG_SOC_IMX1 */ | ||
27 | |||
28 | #ifdef CONFIG_SOC_IMX21 | ||
29 | const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst = | ||
30 | imx_imx_i2c_data_entry_single(MX21, 0, , SZ_4K); | ||
31 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
32 | |||
33 | #ifdef CONFIG_ARCH_MX25 | ||
34 | const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst = { | ||
35 | #define imx25_imx_i2c_data_entry(_id, _hwid) \ | ||
36 | imx_imx_i2c_data_entry(MX25, _id, _hwid, SZ_16K) | ||
37 | imx25_imx_i2c_data_entry(0, 1), | ||
38 | imx25_imx_i2c_data_entry(1, 2), | ||
39 | imx25_imx_i2c_data_entry(2, 3), | ||
40 | }; | ||
41 | #endif /* ifdef CONFIG_ARCH_MX25 */ | ||
42 | |||
43 | #ifdef CONFIG_SOC_IMX27 | ||
44 | const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst = { | ||
45 | #define imx27_imx_i2c_data_entry(_id, _hwid) \ | ||
46 | imx_imx_i2c_data_entry(MX27, _id, _hwid, SZ_4K) | ||
47 | imx27_imx_i2c_data_entry(0, 1), | ||
48 | imx27_imx_i2c_data_entry(1, 2), | ||
49 | }; | ||
50 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
51 | |||
52 | #ifdef CONFIG_ARCH_MX31 | ||
53 | const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst = { | ||
54 | #define imx31_imx_i2c_data_entry(_id, _hwid) \ | ||
55 | imx_imx_i2c_data_entry(MX31, _id, _hwid, SZ_4K) | ||
56 | imx31_imx_i2c_data_entry(0, 1), | ||
57 | imx31_imx_i2c_data_entry(1, 2), | ||
58 | imx31_imx_i2c_data_entry(2, 3), | ||
59 | }; | ||
60 | #endif /* ifdef CONFIG_ARCH_MX31 */ | ||
61 | |||
62 | #ifdef CONFIG_ARCH_MX35 | ||
63 | const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = { | ||
64 | #define imx35_imx_i2c_data_entry(_id, _hwid) \ | ||
65 | imx_imx_i2c_data_entry(MX35, _id, _hwid, SZ_4K) | ||
66 | imx35_imx_i2c_data_entry(0, 1), | ||
67 | imx35_imx_i2c_data_entry(1, 2), | ||
68 | }; | ||
69 | #endif /* ifdef CONFIG_ARCH_MX35 */ | ||
70 | |||
71 | #ifdef CONFIG_ARCH_MX51 | ||
72 | const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = { | ||
73 | #define imx51_imx_i2c_data_entry(_id, _hwid) \ | ||
74 | imx_imx_i2c_data_entry(MX51, _id, _hwid, SZ_4K) | ||
75 | imx51_imx_i2c_data_entry(0, 1), | ||
76 | imx51_imx_i2c_data_entry(1, 2), | ||
77 | }; | ||
78 | #endif /* ifdef CONFIG_ARCH_MX51 */ | ||
79 | |||
80 | struct platform_device *__init imx_add_imx_i2c( | ||
81 | const struct imx_imx_i2c_data *data, | ||
13 | const struct imxi2c_platform_data *pdata) | 82 | const struct imxi2c_platform_data *pdata) |
14 | { | 83 | { |
15 | struct resource res[] = { | 84 | struct resource res[] = { |
16 | { | 85 | { |
17 | .start = iobase, | 86 | .start = data->iobase, |
18 | .end = iobase + iosize - 1, | 87 | .end = data->iobase + data->iosize - 1, |
19 | .flags = IORESOURCE_MEM, | 88 | .flags = IORESOURCE_MEM, |
20 | }, { | 89 | }, { |
21 | .start = irq, | 90 | .start = data->irq, |
22 | .end = irq, | 91 | .end = data->irq, |
23 | .flags = IORESOURCE_IRQ, | 92 | .flags = IORESOURCE_IRQ, |
24 | }, | 93 | }, |
25 | }; | 94 | }; |
26 | 95 | ||
27 | return imx_add_platform_device("imx-i2c", id, res, ARRAY_SIZE(res), | 96 | return imx_add_platform_device("imx-i2c", data->id, |
97 | res, ARRAY_SIZE(res), | ||
28 | pdata, sizeof(*pdata)); | 98 | pdata, sizeof(*pdata)); |
29 | } | 99 | } |
diff --git a/arch/arm/plat-mxc/devices/platform-imx-ssi.c b/arch/arm/plat-mxc/devices/platform-imx-ssi.c new file mode 100644 index 000000000000..38a7a0b8f2f1 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx-ssi.c | |||
@@ -0,0 +1,107 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_imx_ssi_data_entry(soc, _id, _hwid, _size) \ | ||
13 | [_id] = { \ | ||
14 | .id = _id, \ | ||
15 | .iobase = soc ## _SSI ## _hwid ## _BASE_ADDR, \ | ||
16 | .iosize = _size, \ | ||
17 | .irq = soc ## _INT_SSI ## _hwid, \ | ||
18 | .dmatx0 = soc ## _DMA_REQ_SSI ## _hwid ## _TX0, \ | ||
19 | .dmarx0 = soc ## _DMA_REQ_SSI ## _hwid ## _RX0, \ | ||
20 | .dmatx1 = soc ## _DMA_REQ_SSI ## _hwid ## _TX1, \ | ||
21 | .dmarx1 = soc ## _DMA_REQ_SSI ## _hwid ## _RX1, \ | ||
22 | } | ||
23 | |||
24 | #ifdef CONFIG_SOC_IMX21 | ||
25 | const struct imx_imx_ssi_data imx21_imx_ssi_data[] __initconst = { | ||
26 | #define imx21_imx_ssi_data_entry(_id, _hwid) \ | ||
27 | imx_imx_ssi_data_entry(MX21, _id, _hwid, SZ_4K) | ||
28 | imx21_imx_ssi_data_entry(0, 1), | ||
29 | imx21_imx_ssi_data_entry(1, 2), | ||
30 | }; | ||
31 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
32 | |||
33 | #ifdef CONFIG_ARCH_MX25 | ||
34 | const struct imx_imx_ssi_data imx25_imx_ssi_data[] __initconst = { | ||
35 | #define imx25_imx_ssi_data_entry(_id, _hwid) \ | ||
36 | imx_imx_ssi_data_entry(MX25, _id, _hwid, SZ_4K) | ||
37 | imx25_imx_ssi_data_entry(0, 1), | ||
38 | imx25_imx_ssi_data_entry(1, 2), | ||
39 | }; | ||
40 | #endif /* ifdef CONFIG_ARCH_MX25 */ | ||
41 | |||
42 | #ifdef CONFIG_SOC_IMX27 | ||
43 | const struct imx_imx_ssi_data imx27_imx_ssi_data[] __initconst = { | ||
44 | #define imx27_imx_ssi_data_entry(_id, _hwid) \ | ||
45 | imx_imx_ssi_data_entry(MX27, _id, _hwid, SZ_4K) | ||
46 | imx27_imx_ssi_data_entry(0, 1), | ||
47 | imx27_imx_ssi_data_entry(1, 2), | ||
48 | }; | ||
49 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
50 | |||
51 | #ifdef CONFIG_ARCH_MX31 | ||
52 | const struct imx_imx_ssi_data imx31_imx_ssi_data[] __initconst = { | ||
53 | #define imx31_imx_ssi_data_entry(_id, _hwid) \ | ||
54 | imx_imx_ssi_data_entry(MX31, _id, _hwid, SZ_4K) | ||
55 | imx31_imx_ssi_data_entry(0, 1), | ||
56 | imx31_imx_ssi_data_entry(1, 2), | ||
57 | }; | ||
58 | #endif /* ifdef CONFIG_ARCH_MX31 */ | ||
59 | |||
60 | #ifdef CONFIG_ARCH_MX35 | ||
61 | const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst = { | ||
62 | #define imx35_imx_ssi_data_entry(_id, _hwid) \ | ||
63 | imx_imx_ssi_data_entry(MX35, _id, _hwid, SZ_4K) | ||
64 | imx35_imx_ssi_data_entry(0, 1), | ||
65 | imx35_imx_ssi_data_entry(1, 2), | ||
66 | }; | ||
67 | #endif /* ifdef CONFIG_ARCH_MX35 */ | ||
68 | |||
69 | #ifdef CONFIG_ARCH_MX51 | ||
70 | const struct imx_imx_ssi_data imx51_imx_ssi_data[] __initconst = { | ||
71 | #define imx51_imx_ssi_data_entry(_id, _hwid) \ | ||
72 | imx_imx_ssi_data_entry(MX51, _id, _hwid, SZ_4K) | ||
73 | imx51_imx_ssi_data_entry(0, 1), | ||
74 | imx51_imx_ssi_data_entry(1, 2), | ||
75 | }; | ||
76 | #endif /* ifdef CONFIG_ARCH_MX51 */ | ||
77 | |||
78 | struct platform_device *__init imx_add_imx_ssi( | ||
79 | const struct imx_imx_ssi_data *data, | ||
80 | const struct imx_ssi_platform_data *pdata) | ||
81 | { | ||
82 | struct resource res[] = { | ||
83 | { | ||
84 | .start = data->iobase, | ||
85 | .end = data->iobase + data->iosize - 1, | ||
86 | .flags = IORESOURCE_MEM, | ||
87 | }, { | ||
88 | .start = data->irq, | ||
89 | .end = data->irq, | ||
90 | .flags = IORESOURCE_IRQ, | ||
91 | }, | ||
92 | #define DMARES(_name) { \ | ||
93 | .name = #_name, \ | ||
94 | .start = data->dma ## _name, \ | ||
95 | .end = data->dma ## _name, \ | ||
96 | .flags = IORESOURCE_DMA, \ | ||
97 | } | ||
98 | DMARES(tx0), | ||
99 | DMARES(rx0), | ||
100 | DMARES(tx1), | ||
101 | DMARES(rx1), | ||
102 | }; | ||
103 | |||
104 | return imx_add_platform_device("imx-ssi", data->id, | ||
105 | res, ARRAY_SIZE(res), | ||
106 | pdata, sizeof(*pdata)); | ||
107 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-imx-uart.c b/arch/arm/plat-mxc/devices/platform-imx-uart.c index fa3dff1433e8..2039640adf27 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-uart.c +++ b/arch/arm/plat-mxc/devices/platform-imx-uart.c | |||
@@ -6,55 +6,148 @@ | |||
6 | * the terms of the GNU General Public License version 2 as published by the | 6 | * the terms of the GNU General Public License version 2 as published by the |
7 | * Free Software Foundation. | 7 | * Free Software Foundation. |
8 | */ | 8 | */ |
9 | #include <mach/hardware.h> | ||
9 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
10 | 11 | ||
11 | struct platform_device *__init imx_add_imx_uart_3irq(int id, | 12 | #define imx_imx_uart_3irq_data_entry(soc, _id, _hwid, _size) \ |
12 | resource_size_t iobase, resource_size_t iosize, | 13 | [_id] = { \ |
13 | resource_size_t irqrx, resource_size_t irqtx, | 14 | .id = _id, \ |
14 | resource_size_t irqrts, | 15 | .iobase = soc ## _UART ## _hwid ## _BASE_ADDR, \ |
16 | .iosize = _size, \ | ||
17 | .irqrx = soc ## _INT_UART ## _hwid ## RX, \ | ||
18 | .irqtx = soc ## _INT_UART ## _hwid ## TX, \ | ||
19 | .irqrts = soc ## _INT_UART ## _hwid ## RTS, \ | ||
20 | } | ||
21 | |||
22 | #define imx_imx_uart_1irq_data_entry(soc, _id, _hwid, _size) \ | ||
23 | [_id] = { \ | ||
24 | .id = _id, \ | ||
25 | .iobase = soc ## _UART ## _hwid ## _BASE_ADDR, \ | ||
26 | .iosize = _size, \ | ||
27 | .irq = soc ## _INT_UART ## _hwid, \ | ||
28 | } | ||
29 | |||
30 | #ifdef CONFIG_SOC_IMX1 | ||
31 | const struct imx_imx_uart_3irq_data imx1_imx_uart_data[] __initconst = { | ||
32 | #define imx1_imx_uart_data_entry(_id, _hwid) \ | ||
33 | imx_imx_uart_3irq_data_entry(MX1, _id, _hwid, 0xd0) | ||
34 | imx1_imx_uart_data_entry(0, 1), | ||
35 | imx1_imx_uart_data_entry(1, 2), | ||
36 | }; | ||
37 | #endif /* ifdef CONFIG_SOC_IMX1 */ | ||
38 | |||
39 | #ifdef CONFIG_SOC_IMX21 | ||
40 | const struct imx_imx_uart_1irq_data imx21_imx_uart_data[] __initconst = { | ||
41 | #define imx21_imx_uart_data_entry(_id, _hwid) \ | ||
42 | imx_imx_uart_1irq_data_entry(MX21, _id, _hwid, SZ_4K) | ||
43 | imx21_imx_uart_data_entry(0, 1), | ||
44 | imx21_imx_uart_data_entry(1, 2), | ||
45 | imx21_imx_uart_data_entry(2, 3), | ||
46 | imx21_imx_uart_data_entry(3, 4), | ||
47 | }; | ||
48 | #endif | ||
49 | |||
50 | #ifdef CONFIG_ARCH_MX25 | ||
51 | const struct imx_imx_uart_1irq_data imx25_imx_uart_data[] __initconst = { | ||
52 | #define imx25_imx_uart_data_entry(_id, _hwid) \ | ||
53 | imx_imx_uart_1irq_data_entry(MX25, _id, _hwid, SZ_16K) | ||
54 | imx25_imx_uart_data_entry(0, 1), | ||
55 | imx25_imx_uart_data_entry(1, 2), | ||
56 | imx25_imx_uart_data_entry(2, 3), | ||
57 | imx25_imx_uart_data_entry(3, 4), | ||
58 | imx25_imx_uart_data_entry(4, 5), | ||
59 | }; | ||
60 | #endif /* ifdef CONFIG_ARCH_MX25 */ | ||
61 | |||
62 | #ifdef CONFIG_SOC_IMX27 | ||
63 | const struct imx_imx_uart_1irq_data imx27_imx_uart_data[] __initconst = { | ||
64 | #define imx27_imx_uart_data_entry(_id, _hwid) \ | ||
65 | imx_imx_uart_1irq_data_entry(MX27, _id, _hwid, SZ_4K) | ||
66 | imx27_imx_uart_data_entry(0, 1), | ||
67 | imx27_imx_uart_data_entry(1, 2), | ||
68 | imx27_imx_uart_data_entry(2, 3), | ||
69 | imx27_imx_uart_data_entry(3, 4), | ||
70 | imx27_imx_uart_data_entry(4, 5), | ||
71 | imx27_imx_uart_data_entry(5, 6), | ||
72 | }; | ||
73 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
74 | |||
75 | #ifdef CONFIG_ARCH_MX31 | ||
76 | const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst = { | ||
77 | #define imx31_imx_uart_data_entry(_id, _hwid) \ | ||
78 | imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_4K) | ||
79 | imx31_imx_uart_data_entry(0, 1), | ||
80 | imx31_imx_uart_data_entry(1, 2), | ||
81 | imx31_imx_uart_data_entry(2, 3), | ||
82 | imx31_imx_uart_data_entry(3, 4), | ||
83 | imx31_imx_uart_data_entry(4, 5), | ||
84 | }; | ||
85 | #endif /* ifdef CONFIG_ARCH_MX31 */ | ||
86 | |||
87 | #ifdef CONFIG_ARCH_MX35 | ||
88 | const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = { | ||
89 | #define imx35_imx_uart_data_entry(_id, _hwid) \ | ||
90 | imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_16K) | ||
91 | imx35_imx_uart_data_entry(0, 1), | ||
92 | imx35_imx_uart_data_entry(1, 2), | ||
93 | imx35_imx_uart_data_entry(2, 3), | ||
94 | }; | ||
95 | #endif /* ifdef CONFIG_ARCH_MX35 */ | ||
96 | |||
97 | #ifdef CONFIG_ARCH_MX51 | ||
98 | const struct imx_imx_uart_1irq_data imx51_imx_uart_data[] __initconst = { | ||
99 | #define imx51_imx_uart_data_entry(_id, _hwid) \ | ||
100 | imx_imx_uart_1irq_data_entry(MX51, _id, _hwid, SZ_4K) | ||
101 | imx51_imx_uart_data_entry(0, 1), | ||
102 | imx51_imx_uart_data_entry(1, 2), | ||
103 | imx51_imx_uart_data_entry(2, 3), | ||
104 | }; | ||
105 | #endif /* ifdef CONFIG_ARCH_MX51 */ | ||
106 | |||
107 | struct platform_device *__init imx_add_imx_uart_3irq( | ||
108 | const struct imx_imx_uart_3irq_data *data, | ||
15 | const struct imxuart_platform_data *pdata) | 109 | const struct imxuart_platform_data *pdata) |
16 | { | 110 | { |
17 | struct resource res[] = { | 111 | struct resource res[] = { |
18 | { | 112 | { |
19 | .start = iobase, | 113 | .start = data->iobase, |
20 | .end = iobase + iosize - 1, | 114 | .end = data->iobase + data->iosize - 1, |
21 | .flags = IORESOURCE_MEM, | 115 | .flags = IORESOURCE_MEM, |
22 | }, { | 116 | }, { |
23 | .start = irqrx, | 117 | .start = data->irqrx, |
24 | .end = irqrx, | 118 | .end = data->irqrx, |
25 | .flags = IORESOURCE_IRQ, | 119 | .flags = IORESOURCE_IRQ, |
26 | }, { | 120 | }, { |
27 | .start = irqtx, | 121 | .start = data->irqtx, |
28 | .end = irqtx, | 122 | .end = data->irqtx, |
29 | .flags = IORESOURCE_IRQ, | 123 | .flags = IORESOURCE_IRQ, |
30 | }, { | 124 | }, { |
31 | .start = irqrts, | 125 | .start = data->irqrts, |
32 | .end = irqrx, | 126 | .end = data->irqrx, |
33 | .flags = IORESOURCE_IRQ, | 127 | .flags = IORESOURCE_IRQ, |
34 | }, | 128 | }, |
35 | }; | 129 | }; |
36 | 130 | ||
37 | return imx_add_platform_device("imx-uart", id, res, ARRAY_SIZE(res), | 131 | return imx_add_platform_device("imx-uart", data->id, res, |
38 | pdata, sizeof(*pdata)); | 132 | ARRAY_SIZE(res), pdata, sizeof(*pdata)); |
39 | } | 133 | } |
40 | 134 | ||
41 | struct platform_device *__init imx_add_imx_uart_1irq(int id, | 135 | struct platform_device *__init imx_add_imx_uart_1irq( |
42 | resource_size_t iobase, resource_size_t iosize, | 136 | const struct imx_imx_uart_1irq_data *data, |
43 | resource_size_t irq, | ||
44 | const struct imxuart_platform_data *pdata) | 137 | const struct imxuart_platform_data *pdata) |
45 | { | 138 | { |
46 | struct resource res[] = { | 139 | struct resource res[] = { |
47 | { | 140 | { |
48 | .start = iobase, | 141 | .start = data->iobase, |
49 | .end = iobase + iosize - 1, | 142 | .end = data->iobase + data->iosize - 1, |
50 | .flags = IORESOURCE_MEM, | 143 | .flags = IORESOURCE_MEM, |
51 | }, { | 144 | }, { |
52 | .start = irq, | 145 | .start = data->irq, |
53 | .end = irq, | 146 | .end = data->irq, |
54 | .flags = IORESOURCE_IRQ, | 147 | .flags = IORESOURCE_IRQ, |
55 | }, | 148 | }, |
56 | }; | 149 | }; |
57 | 150 | ||
58 | return imx_add_platform_device("imx-uart", id, res, ARRAY_SIZE(res), | 151 | return imx_add_platform_device("imx-uart", data->id, res, ARRAY_SIZE(res), |
59 | pdata, sizeof(*pdata)); | 152 | pdata, sizeof(*pdata)); |
60 | } | 153 | } |
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_nand.c b/arch/arm/plat-mxc/devices/platform-mxc_nand.c index 1c286418d123..3fdcc32e3d67 100644 --- a/arch/arm/plat-mxc/devices/platform-mxc_nand.c +++ b/arch/arm/plat-mxc/devices/platform-mxc_nand.c | |||
@@ -7,38 +7,77 @@ | |||
7 | * Free Software Foundation. | 7 | * Free Software Foundation. |
8 | */ | 8 | */ |
9 | #include <asm/sizes.h> | 9 | #include <asm/sizes.h> |
10 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | 11 | #include <mach/devices-common.h> |
11 | 12 | ||
12 | static struct platform_device *__init imx_add_mxc_nand(resource_size_t iobase, | 13 | #define imx_mxc_nand_data_entry_single(soc, _size) \ |
13 | int irq, const struct mxc_nand_platform_data *pdata, | 14 | { \ |
14 | resource_size_t iosize) | 15 | .iobase = soc ## _NFC_BASE_ADDR, \ |
16 | .iosize = _size, \ | ||
17 | .irq = soc ## _INT_NFC \ | ||
18 | } | ||
19 | |||
20 | #define imx_mxc_nandv3_data_entry_single(soc, _size) \ | ||
21 | { \ | ||
22 | .id = -1, \ | ||
23 | .iobase = soc ## _NFC_BASE_ADDR, \ | ||
24 | .iosize = _size, \ | ||
25 | .axibase = soc ## _NFC_AXI_BASE_ADDR, \ | ||
26 | .irq = soc ## _INT_NFC \ | ||
27 | } | ||
28 | |||
29 | #ifdef CONFIG_SOC_IMX21 | ||
30 | const struct imx_mxc_nand_data imx21_mxc_nand_data __initconst = | ||
31 | imx_mxc_nand_data_entry_single(MX21, SZ_4K); | ||
32 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
33 | |||
34 | #ifdef CONFIG_ARCH_MX25 | ||
35 | const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst = | ||
36 | imx_mxc_nand_data_entry_single(MX25, SZ_8K); | ||
37 | #endif /* ifdef CONFIG_ARCH_MX25 */ | ||
38 | |||
39 | #ifdef CONFIG_SOC_IMX27 | ||
40 | const struct imx_mxc_nand_data imx27_mxc_nand_data __initconst = | ||
41 | imx_mxc_nand_data_entry_single(MX27, SZ_4K); | ||
42 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
43 | |||
44 | #ifdef CONFIG_ARCH_MX31 | ||
45 | const struct imx_mxc_nand_data imx31_mxc_nand_data __initconst = | ||
46 | imx_mxc_nand_data_entry_single(MX31, SZ_4K); | ||
47 | #endif | ||
48 | |||
49 | #ifdef CONFIG_ARCH_MX35 | ||
50 | const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst = | ||
51 | imx_mxc_nand_data_entry_single(MX35, SZ_8K); | ||
52 | #endif | ||
53 | |||
54 | #ifdef CONFIG_ARCH_MX51 | ||
55 | const struct imx_mxc_nand_data imx51_mxc_nand_data __initconst = | ||
56 | imx_mxc_nandv3_data_entry_single(MX51, SZ_16K); | ||
57 | #endif | ||
58 | |||
59 | struct platform_device *__init imx_add_mxc_nand( | ||
60 | const struct imx_mxc_nand_data *data, | ||
61 | const struct mxc_nand_platform_data *pdata) | ||
15 | { | 62 | { |
16 | static int id = 0; | 63 | /* AXI has to come first, that's how the mxc_nand driver expect it */ |
17 | |||
18 | struct resource res[] = { | 64 | struct resource res[] = { |
19 | { | 65 | { |
20 | .start = iobase, | 66 | .start = data->axibase, |
21 | .end = iobase + iosize - 1, | 67 | .end = data->axibase + SZ_16K - 1, |
22 | .flags = IORESOURCE_MEM, | 68 | .flags = IORESOURCE_MEM, |
23 | }, { | 69 | }, { |
24 | .start = irq, | 70 | .start = data->iobase, |
25 | .end = irq, | 71 | .end = data->iobase + data->iosize - 1, |
72 | .flags = IORESOURCE_MEM, | ||
73 | }, { | ||
74 | .start = data->irq, | ||
75 | .end = data->irq, | ||
26 | .flags = IORESOURCE_IRQ, | 76 | .flags = IORESOURCE_IRQ, |
27 | }, | 77 | }, |
28 | }; | 78 | }; |
29 | 79 | return imx_add_platform_device("mxc_nand", data->id, | |
30 | return imx_add_platform_device("mxc_nand", id++, res, ARRAY_SIZE(res), | 80 | res + !data->axibase, |
81 | ARRAY_SIZE(res) - !data->axibase, | ||
31 | pdata, sizeof(*pdata)); | 82 | pdata, sizeof(*pdata)); |
32 | } | 83 | } |
33 | |||
34 | struct platform_device *__init imx_add_mxc_nand_v1(resource_size_t iobase, | ||
35 | int irq, const struct mxc_nand_platform_data *pdata) | ||
36 | { | ||
37 | return imx_add_mxc_nand(iobase, irq, pdata, SZ_4K); | ||
38 | } | ||
39 | |||
40 | struct platform_device *__init imx_add_mxc_nand_v21(resource_size_t iobase, | ||
41 | int irq, const struct mxc_nand_platform_data *pdata) | ||
42 | { | ||
43 | return imx_add_mxc_nand(iobase, irq, pdata, SZ_8K); | ||
44 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/plat-mxc/devices/platform-spi_imx.c index 2831a6d3eb4b..e48340ec331e 100644 --- a/arch/arm/plat-mxc/devices/platform-spi_imx.c +++ b/arch/arm/plat-mxc/devices/platform-spi_imx.c | |||
@@ -6,25 +6,96 @@ | |||
6 | * the terms of the GNU General Public License version 2 as published by the | 6 | * the terms of the GNU General Public License version 2 as published by the |
7 | * Free Software Foundation. | 7 | * Free Software Foundation. |
8 | */ | 8 | */ |
9 | #include <asm/sizes.h> | 9 | #include <mach/hardware.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | struct platform_device *__init imx_add_spi_imx(int id, | 12 | #define imx_spi_imx_data_entry_single(soc, type, _devid, _id, hwid, _size) \ |
13 | resource_size_t iobase, resource_size_t iosize, int irq, | 13 | { \ |
14 | .devid = _devid, \ | ||
15 | .id = _id, \ | ||
16 | .iobase = soc ## _ ## type ## hwid ## _BASE_ADDR, \ | ||
17 | .iosize = _size, \ | ||
18 | .irq = soc ## _INT_ ## type ## hwid, \ | ||
19 | } | ||
20 | |||
21 | #define imx_spi_imx_data_entry(soc, type, devid, id, hwid, size) \ | ||
22 | [id] = imx_spi_imx_data_entry_single(soc, type, devid, id, hwid, size) | ||
23 | |||
24 | #ifdef CONFIG_SOC_IMX21 | ||
25 | const struct imx_spi_imx_data imx21_cspi_data[] __initconst = { | ||
26 | #define imx21_cspi_data_entry(_id, _hwid) \ | ||
27 | imx_spi_imx_data_entry(MX21, CSPI, "imx21-cspi", _id, _hwid, SZ_4K) | ||
28 | imx21_cspi_data_entry(0, 1), | ||
29 | imx21_cspi_data_entry(1, 2), | ||
30 | #endif | ||
31 | |||
32 | #ifdef CONFIG_ARCH_MX25 | ||
33 | const struct imx_spi_imx_data imx25_cspi_data[] __initconst = { | ||
34 | #define imx25_cspi_data_entry(_id, _hwid) \ | ||
35 | imx_spi_imx_data_entry(MX25, CSPI, "imx25-cspi", _id, _hwid, SZ_16K) | ||
36 | imx25_cspi_data_entry(0, 1), | ||
37 | imx25_cspi_data_entry(1, 2), | ||
38 | imx25_cspi_data_entry(2, 3), | ||
39 | }; | ||
40 | #endif /* ifdef CONFIG_ARCH_MX25 */ | ||
41 | |||
42 | #ifdef CONFIG_SOC_IMX27 | ||
43 | const struct imx_spi_imx_data imx27_cspi_data[] __initconst = { | ||
44 | #define imx27_cspi_data_entry(_id, _hwid) \ | ||
45 | imx_spi_imx_data_entry(MX27, CSPI, "imx27-cspi", _id, _hwid, SZ_4K) | ||
46 | imx27_cspi_data_entry(0, 1), | ||
47 | imx27_cspi_data_entry(1, 2), | ||
48 | imx27_cspi_data_entry(2, 3), | ||
49 | }; | ||
50 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
51 | |||
52 | #ifdef CONFIG_ARCH_MX31 | ||
53 | const struct imx_spi_imx_data imx31_cspi_data[] __initconst = { | ||
54 | #define imx31_cspi_data_entry(_id, _hwid) \ | ||
55 | imx_spi_imx_data_entry(MX31, CSPI, "imx31-cspi", _id, _hwid, SZ_4K) | ||
56 | imx31_cspi_data_entry(0, 1), | ||
57 | imx31_cspi_data_entry(1, 2), | ||
58 | imx31_cspi_data_entry(2, 3), | ||
59 | }; | ||
60 | #endif /* ifdef CONFIG_ARCH_MX31 */ | ||
61 | |||
62 | #ifdef CONFIG_ARCH_MX35 | ||
63 | const struct imx_spi_imx_data imx35_cspi_data[] __initconst = { | ||
64 | #define imx35_cspi_data_entry(_id, _hwid) \ | ||
65 | imx_spi_imx_data_entry(MX35, CSPI, "imx35-cspi", _id, _hwid, SZ_4K) | ||
66 | imx35_cspi_data_entry(0, 1), | ||
67 | imx35_cspi_data_entry(1, 2), | ||
68 | }; | ||
69 | #endif /* ifdef CONFIG_ARCH_MX35 */ | ||
70 | |||
71 | #ifdef CONFIG_ARCH_MX51 | ||
72 | const struct imx_spi_imx_data imx51_cspi_data __initconst = | ||
73 | imx_spi_imx_data_entry_single(MX51, CSPI, "imx51-cspi", 0, , SZ_4K); | ||
74 | |||
75 | const struct imx_spi_imx_data imx51_ecspi_data[] __initconst = { | ||
76 | #define imx51_ecspi_data_entry(_id, _hwid) \ | ||
77 | imx_spi_imx_data_entry(MX51, ECSPI, "imx51-ecspi", _id, _hwid, SZ_4K) | ||
78 | imx51_ecspi_data_entry(0, 1), | ||
79 | imx51_ecspi_data_entry(1, 2), | ||
80 | }; | ||
81 | #endif /* ifdef CONFIG_ARCH_MX51 */ | ||
82 | |||
83 | struct platform_device *__init imx_add_spi_imx( | ||
84 | const struct imx_spi_imx_data *data, | ||
14 | const struct spi_imx_master *pdata) | 85 | const struct spi_imx_master *pdata) |
15 | { | 86 | { |
16 | struct resource res[] = { | 87 | struct resource res[] = { |
17 | { | 88 | { |
18 | .start = iobase, | 89 | .start = data->iobase, |
19 | .end = iobase + iosize - 1, | 90 | .end = data->iobase + data->iosize - 1, |
20 | .flags = IORESOURCE_MEM, | 91 | .flags = IORESOURCE_MEM, |
21 | }, { | 92 | }, { |
22 | .start = irq, | 93 | .start = data->irq, |
23 | .end = irq, | 94 | .end = data->irq, |
24 | .flags = IORESOURCE_IRQ, | 95 | .flags = IORESOURCE_IRQ, |
25 | }, | 96 | }, |
26 | }; | 97 | }; |
27 | 98 | ||
28 | return imx_add_platform_device("spi_imx", id, res, ARRAY_SIZE(res), | 99 | return imx_add_platform_device(data->devid, data->id, |
29 | pdata, sizeof(*pdata)); | 100 | res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); |
30 | } | 101 | } |
diff --git a/arch/arm/plat-mxc/ehci.c b/arch/arm/plat-mxc/ehci.c index 35a064ff02ba..9915607683de 100644 --- a/arch/arm/plat-mxc/ehci.c +++ b/arch/arm/plat-mxc/ehci.c | |||
@@ -249,8 +249,8 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) | |||
249 | #ifdef CONFIG_ARCH_MX51 | 249 | #ifdef CONFIG_ARCH_MX51 |
250 | if (cpu_is_mx51()) { | 250 | if (cpu_is_mx51()) { |
251 | void __iomem *usb_base; | 251 | void __iomem *usb_base; |
252 | u32 usbotg_base; | 252 | void __iomem *usbotg_base; |
253 | u32 usbother_base; | 253 | void __iomem *usbother_base; |
254 | int ret = 0; | 254 | int ret = 0; |
255 | 255 | ||
256 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 256 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
diff --git a/arch/arm/plat-mxc/epit.c b/arch/arm/plat-mxc/epit.c new file mode 100644 index 000000000000..ee9582f4972e --- /dev/null +++ b/arch/arm/plat-mxc/epit.c | |||
@@ -0,0 +1,242 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-mxc/epit.c | ||
3 | * | ||
4 | * Copyright (C) 2010 Sascha Hauer <s.hauer@pengutronix.de> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version 2 | ||
9 | * of the License, or (at your option) any later version. | ||
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., 51 Franklin Street, Fifth Floor, Boston, | ||
18 | * MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #define EPITCR 0x00 | ||
22 | #define EPITSR 0x04 | ||
23 | #define EPITLR 0x08 | ||
24 | #define EPITCMPR 0x0c | ||
25 | #define EPITCNR 0x10 | ||
26 | |||
27 | #define EPITCR_EN (1 << 0) | ||
28 | #define EPITCR_ENMOD (1 << 1) | ||
29 | #define EPITCR_OCIEN (1 << 2) | ||
30 | #define EPITCR_RLD (1 << 3) | ||
31 | #define EPITCR_PRESC(x) (((x) & 0xfff) << 4) | ||
32 | #define EPITCR_SWR (1 << 16) | ||
33 | #define EPITCR_IOVW (1 << 17) | ||
34 | #define EPITCR_DBGEN (1 << 18) | ||
35 | #define EPITCR_WAITEN (1 << 19) | ||
36 | #define EPITCR_RES (1 << 20) | ||
37 | #define EPITCR_STOPEN (1 << 21) | ||
38 | #define EPITCR_OM_DISCON (0 << 22) | ||
39 | #define EPITCR_OM_TOGGLE (1 << 22) | ||
40 | #define EPITCR_OM_CLEAR (2 << 22) | ||
41 | #define EPITCR_OM_SET (3 << 22) | ||
42 | #define EPITCR_CLKSRC_OFF (0 << 24) | ||
43 | #define EPITCR_CLKSRC_PERIPHERAL (1 << 24) | ||
44 | #define EPITCR_CLKSRC_REF_HIGH (1 << 24) | ||
45 | #define EPITCR_CLKSRC_REF_LOW (3 << 24) | ||
46 | |||
47 | #define EPITSR_OCIF (1 << 0) | ||
48 | |||
49 | #include <linux/interrupt.h> | ||
50 | #include <linux/irq.h> | ||
51 | #include <linux/clockchips.h> | ||
52 | #include <linux/clk.h> | ||
53 | |||
54 | #include <mach/hardware.h> | ||
55 | #include <asm/mach/time.h> | ||
56 | #include <mach/common.h> | ||
57 | |||
58 | static struct clock_event_device clockevent_epit; | ||
59 | static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED; | ||
60 | |||
61 | static void __iomem *timer_base; | ||
62 | |||
63 | static inline void epit_irq_disable(void) | ||
64 | { | ||
65 | u32 val; | ||
66 | |||
67 | val = __raw_readl(timer_base + EPITCR); | ||
68 | val &= ~EPITCR_OCIEN; | ||
69 | __raw_writel(val, timer_base + EPITCR); | ||
70 | } | ||
71 | |||
72 | static inline void epit_irq_enable(void) | ||
73 | { | ||
74 | u32 val; | ||
75 | |||
76 | val = __raw_readl(timer_base + EPITCR); | ||
77 | val |= EPITCR_OCIEN; | ||
78 | __raw_writel(val, timer_base + EPITCR); | ||
79 | } | ||
80 | |||
81 | static void epit_irq_acknowledge(void) | ||
82 | { | ||
83 | __raw_writel(EPITSR_OCIF, timer_base + EPITSR); | ||
84 | } | ||
85 | |||
86 | static cycle_t epit_read(struct clocksource *cs) | ||
87 | { | ||
88 | return 0 - __raw_readl(timer_base + EPITCNR); | ||
89 | } | ||
90 | |||
91 | static struct clocksource clocksource_epit = { | ||
92 | .name = "epit", | ||
93 | .rating = 200, | ||
94 | .read = epit_read, | ||
95 | .mask = CLOCKSOURCE_MASK(32), | ||
96 | .shift = 20, | ||
97 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
98 | }; | ||
99 | |||
100 | static int __init epit_clocksource_init(struct clk *timer_clk) | ||
101 | { | ||
102 | unsigned int c = clk_get_rate(timer_clk); | ||
103 | |||
104 | clocksource_epit.mult = clocksource_hz2mult(c, | ||
105 | clocksource_epit.shift); | ||
106 | clocksource_register(&clocksource_epit); | ||
107 | |||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | /* clock event */ | ||
112 | |||
113 | static int epit_set_next_event(unsigned long evt, | ||
114 | struct clock_event_device *unused) | ||
115 | { | ||
116 | unsigned long tcmp; | ||
117 | |||
118 | tcmp = __raw_readl(timer_base + EPITCNR); | ||
119 | |||
120 | __raw_writel(tcmp - evt, timer_base + EPITCMPR); | ||
121 | |||
122 | return 0; | ||
123 | } | ||
124 | |||
125 | static void epit_set_mode(enum clock_event_mode mode, | ||
126 | struct clock_event_device *evt) | ||
127 | { | ||
128 | unsigned long flags; | ||
129 | |||
130 | /* | ||
131 | * The timer interrupt generation is disabled at least | ||
132 | * for enough time to call epit_set_next_event() | ||
133 | */ | ||
134 | local_irq_save(flags); | ||
135 | |||
136 | /* Disable interrupt in GPT module */ | ||
137 | epit_irq_disable(); | ||
138 | |||
139 | if (mode != clockevent_mode) { | ||
140 | /* Set event time into far-far future */ | ||
141 | |||
142 | /* Clear pending interrupt */ | ||
143 | epit_irq_acknowledge(); | ||
144 | } | ||
145 | |||
146 | /* Remember timer mode */ | ||
147 | clockevent_mode = mode; | ||
148 | local_irq_restore(flags); | ||
149 | |||
150 | switch (mode) { | ||
151 | case CLOCK_EVT_MODE_PERIODIC: | ||
152 | printk(KERN_ERR "epit_set_mode: Periodic mode is not " | ||
153 | "supported for i.MX EPIT\n"); | ||
154 | break; | ||
155 | case CLOCK_EVT_MODE_ONESHOT: | ||
156 | /* | ||
157 | * Do not put overhead of interrupt enable/disable into | ||
158 | * epit_set_next_event(), the core has about 4 minutes | ||
159 | * to call epit_set_next_event() or shutdown clock after | ||
160 | * mode switching | ||
161 | */ | ||
162 | local_irq_save(flags); | ||
163 | epit_irq_enable(); | ||
164 | local_irq_restore(flags); | ||
165 | break; | ||
166 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
167 | case CLOCK_EVT_MODE_UNUSED: | ||
168 | case CLOCK_EVT_MODE_RESUME: | ||
169 | /* Left event sources disabled, no more interrupts appear */ | ||
170 | break; | ||
171 | } | ||
172 | } | ||
173 | |||
174 | /* | ||
175 | * IRQ handler for the timer | ||
176 | */ | ||
177 | static irqreturn_t epit_timer_interrupt(int irq, void *dev_id) | ||
178 | { | ||
179 | struct clock_event_device *evt = &clockevent_epit; | ||
180 | |||
181 | epit_irq_acknowledge(); | ||
182 | |||
183 | evt->event_handler(evt); | ||
184 | |||
185 | return IRQ_HANDLED; | ||
186 | } | ||
187 | |||
188 | static struct irqaction epit_timer_irq = { | ||
189 | .name = "i.MX EPIT Timer Tick", | ||
190 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
191 | .handler = epit_timer_interrupt, | ||
192 | }; | ||
193 | |||
194 | static struct clock_event_device clockevent_epit = { | ||
195 | .name = "epit", | ||
196 | .features = CLOCK_EVT_FEAT_ONESHOT, | ||
197 | .shift = 32, | ||
198 | .set_mode = epit_set_mode, | ||
199 | .set_next_event = epit_set_next_event, | ||
200 | .rating = 200, | ||
201 | }; | ||
202 | |||
203 | static int __init epit_clockevent_init(struct clk *timer_clk) | ||
204 | { | ||
205 | unsigned int c = clk_get_rate(timer_clk); | ||
206 | |||
207 | clockevent_epit.mult = div_sc(c, NSEC_PER_SEC, | ||
208 | clockevent_epit.shift); | ||
209 | clockevent_epit.max_delta_ns = | ||
210 | clockevent_delta2ns(0xfffffffe, &clockevent_epit); | ||
211 | clockevent_epit.min_delta_ns = | ||
212 | clockevent_delta2ns(0x800, &clockevent_epit); | ||
213 | |||
214 | clockevent_epit.cpumask = cpumask_of(0); | ||
215 | |||
216 | clockevents_register_device(&clockevent_epit); | ||
217 | |||
218 | return 0; | ||
219 | } | ||
220 | |||
221 | void __init epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq) | ||
222 | { | ||
223 | clk_enable(timer_clk); | ||
224 | |||
225 | timer_base = base; | ||
226 | |||
227 | /* | ||
228 | * Initialise to a known state (all timers off, and timing reset) | ||
229 | */ | ||
230 | __raw_writel(0x0, timer_base + EPITCR); | ||
231 | |||
232 | __raw_writel(0xffffffff, timer_base + EPITLR); | ||
233 | __raw_writel(EPITCR_EN | EPITCR_CLKSRC_REF_HIGH | EPITCR_WAITEN, | ||
234 | timer_base + EPITCR); | ||
235 | |||
236 | /* init and register the timer to the framework */ | ||
237 | epit_clocksource_init(timer_clk); | ||
238 | epit_clockevent_init(timer_clk); | ||
239 | |||
240 | /* Make irqs happen */ | ||
241 | setup_irq(irq, &epit_timer_irq); | ||
242 | } | ||
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c index 57ec4a896a5d..9d38da077edb 100644 --- a/arch/arm/plat-mxc/gpio.c +++ b/arch/arm/plat-mxc/gpio.c | |||
@@ -235,7 +235,7 @@ static void mxc_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | |||
235 | unsigned long flags; | 235 | unsigned long flags; |
236 | 236 | ||
237 | spin_lock_irqsave(&port->lock, flags); | 237 | spin_lock_irqsave(&port->lock, flags); |
238 | l = (__raw_readl(reg) & (~(1 << offset))) | (value << offset); | 238 | l = (__raw_readl(reg) & (~(1 << offset))) | (!!value << offset); |
239 | __raw_writel(l, reg); | 239 | __raw_writel(l, reg); |
240 | spin_unlock_irqrestore(&port->lock, flags); | 240 | spin_unlock_irqrestore(&port->lock, flags); |
241 | } | 241 | } |
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h index 2941472582d2..7a1e1f89ff09 100644 --- a/arch/arm/plat-mxc/include/mach/common.h +++ b/arch/arm/plat-mxc/include/mach/common.h | |||
@@ -32,6 +32,7 @@ extern void mx31_init_irq(void); | |||
32 | extern void mx35_init_irq(void); | 32 | extern void mx35_init_irq(void); |
33 | extern void mx51_init_irq(void); | 33 | extern void mx51_init_irq(void); |
34 | extern void mxc91231_init_irq(void); | 34 | extern void mxc91231_init_irq(void); |
35 | extern void epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq); | ||
35 | extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int); | 36 | extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int); |
36 | extern int mx1_clocks_init(unsigned long fref); | 37 | extern int mx1_clocks_init(unsigned long fref); |
37 | extern int mx21_clocks_init(unsigned long lref, unsigned long fref); | 38 | extern int mx21_clocks_init(unsigned long lref, unsigned long fref); |
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index c5f68c587309..049897880403 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h | |||
@@ -14,47 +14,101 @@ struct platform_device *imx_add_platform_device(const char *name, int id, | |||
14 | const struct resource *res, unsigned int num_resources, | 14 | const struct resource *res, unsigned int num_resources, |
15 | const void *data, size_t size_data); | 15 | const void *data, size_t size_data); |
16 | 16 | ||
17 | #if defined (CONFIG_CAN_FLEXCAN) || defined (CONFIG_CAN_FLEXCAN_MODULE) | 17 | #include <linux/fec.h> |
18 | struct imx_fec_data { | ||
19 | resource_size_t iobase; | ||
20 | resource_size_t irq; | ||
21 | }; | ||
22 | struct platform_device *__init imx_add_fec( | ||
23 | const struct imx_fec_data *data, | ||
24 | const struct fec_platform_data *pdata); | ||
25 | |||
18 | #include <linux/can/platform/flexcan.h> | 26 | #include <linux/can/platform/flexcan.h> |
19 | struct platform_device *__init imx_add_flexcan(int id, | 27 | struct platform_device *__init imx_add_flexcan(int id, |
20 | resource_size_t iobase, resource_size_t iosize, | 28 | resource_size_t iobase, resource_size_t iosize, |
21 | resource_size_t irq, | 29 | resource_size_t irq, |
22 | const struct flexcan_platform_data *pdata); | 30 | const struct flexcan_platform_data *pdata); |
23 | #else | ||
24 | /* the ifdef can be removed once the flexcan driver has been merged */ | ||
25 | struct flexcan_platform_data; | ||
26 | static inline struct platform_device *__init imx_add_flexcan(int id, | ||
27 | resource_size_t iobase, resource_size_t iosize, | ||
28 | resource_size_t irq, | ||
29 | const struct flexcan_platform_data *pdata) | ||
30 | { | ||
31 | return NULL; | ||
32 | } | ||
33 | #endif | ||
34 | 31 | ||
35 | #include <mach/i2c.h> | 32 | #include <mach/i2c.h> |
36 | struct platform_device *__init imx_add_imx_i2c(int id, | 33 | struct imx_imx_i2c_data { |
37 | resource_size_t iobase, resource_size_t iosize, int irq, | 34 | int id; |
35 | resource_size_t iobase; | ||
36 | resource_size_t iosize; | ||
37 | resource_size_t irq; | ||
38 | }; | ||
39 | struct platform_device *__init imx_add_imx_i2c( | ||
40 | const struct imx_imx_i2c_data *data, | ||
38 | const struct imxi2c_platform_data *pdata); | 41 | const struct imxi2c_platform_data *pdata); |
39 | 42 | ||
43 | #include <mach/ssi.h> | ||
44 | struct imx_imx_ssi_data { | ||
45 | int id; | ||
46 | resource_size_t iobase; | ||
47 | resource_size_t iosize; | ||
48 | resource_size_t irq; | ||
49 | resource_size_t dmatx0; | ||
50 | resource_size_t dmarx0; | ||
51 | resource_size_t dmatx1; | ||
52 | resource_size_t dmarx1; | ||
53 | }; | ||
54 | struct platform_device *__init imx_add_imx_ssi( | ||
55 | const struct imx_imx_ssi_data *data, | ||
56 | const struct imx_ssi_platform_data *pdata); | ||
57 | |||
40 | #include <mach/imx-uart.h> | 58 | #include <mach/imx-uart.h> |
41 | struct platform_device *__init imx_add_imx_uart_3irq(int id, | 59 | struct imx_imx_uart_3irq_data { |
42 | resource_size_t iobase, resource_size_t iosize, | 60 | int id; |
43 | resource_size_t irqrx, resource_size_t irqtx, | 61 | resource_size_t iobase; |
44 | resource_size_t irqrts, | 62 | resource_size_t iosize; |
63 | resource_size_t irqrx; | ||
64 | resource_size_t irqtx; | ||
65 | resource_size_t irqrts; | ||
66 | }; | ||
67 | struct platform_device *__init imx_add_imx_uart_3irq( | ||
68 | const struct imx_imx_uart_3irq_data *data, | ||
45 | const struct imxuart_platform_data *pdata); | 69 | const struct imxuart_platform_data *pdata); |
46 | struct platform_device *__init imx_add_imx_uart_1irq(int id, | 70 | |
47 | resource_size_t iobase, resource_size_t iosize, | 71 | struct imx_imx_uart_1irq_data { |
48 | resource_size_t irq, | 72 | int id; |
73 | resource_size_t iobase; | ||
74 | resource_size_t iosize; | ||
75 | resource_size_t irq; | ||
76 | }; | ||
77 | struct platform_device *__init imx_add_imx_uart_1irq( | ||
78 | const struct imx_imx_uart_1irq_data *data, | ||
49 | const struct imxuart_platform_data *pdata); | 79 | const struct imxuart_platform_data *pdata); |
50 | 80 | ||
51 | #include <mach/mxc_nand.h> | 81 | #include <mach/mxc_nand.h> |
52 | struct platform_device *__init imx_add_mxc_nand_v1(resource_size_t iobase, | 82 | struct imx_mxc_nand_data { |
53 | int irq, const struct mxc_nand_platform_data *pdata); | 83 | /* |
54 | struct platform_device *__init imx_add_mxc_nand_v21(resource_size_t iobase, | 84 | * id is traditionally 0, but -1 is more appropriate. We use -1 for new |
55 | int irq, const struct mxc_nand_platform_data *pdata); | 85 | * machines but don't change existing devices as the nand device usually |
86 | * appears in the kernel command line to pass its partitioning. | ||
87 | */ | ||
88 | int id; | ||
89 | resource_size_t iobase; | ||
90 | resource_size_t iosize; | ||
91 | resource_size_t axibase; | ||
92 | resource_size_t irq; | ||
93 | }; | ||
94 | struct platform_device *__init imx_add_mxc_nand( | ||
95 | const struct imx_mxc_nand_data *data, | ||
96 | const struct mxc_nand_platform_data *pdata); | ||
56 | 97 | ||
57 | #include <mach/spi.h> | 98 | #include <mach/spi.h> |
58 | struct platform_device *__init imx_add_spi_imx(int id, | 99 | struct imx_spi_imx_data { |
59 | resource_size_t iobase, resource_size_t iosize, int irq, | 100 | const char *devid; |
101 | int id; | ||
102 | resource_size_t iobase; | ||
103 | resource_size_t iosize; | ||
104 | int irq; | ||
105 | }; | ||
106 | struct platform_device *__init imx_add_spi_imx( | ||
107 | const struct imx_spi_imx_data *data, | ||
60 | const struct spi_imx_master *pdata); | 108 | const struct spi_imx_master *pdata); |
109 | |||
110 | #include <mach/esdhc.h> | ||
111 | struct platform_device *__init imx_add_esdhc(int id, | ||
112 | resource_size_t iobase, resource_size_t iosize, | ||
113 | resource_size_t irq, | ||
114 | const struct esdhc_platform_data *pdata); | ||
diff --git a/arch/arm/plat-mxc/include/mach/esdhc.h b/arch/arm/plat-mxc/include/mach/esdhc.h new file mode 100644 index 000000000000..a48a9aaa56b1 --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/esdhc.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Wolfram Sang <w.sang@pengutronix.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; version 2 | ||
7 | * of the License. | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASM_ARCH_IMX_ESDHC_H | ||
11 | #define __ASM_ARCH_IMX_ESDHC_H | ||
12 | |||
13 | struct esdhc_platform_data { | ||
14 | unsigned int wp_gpio; /* write protect pin */ | ||
15 | }; | ||
16 | #endif /* __ASM_ARCH_IMX_ESDHC_H */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/plat-mxc/include/mach/iomux-mx51.h index 21bfa46785bb..5160f1073ec9 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-mx51.h +++ b/arch/arm/plat-mxc/include/mach/iomux-mx51.h | |||
@@ -45,6 +45,15 @@ typedef enum iomux_config { | |||
45 | PAD_CTL_PKE | PAD_CTL_HYS) | 45 | PAD_CTL_PKE | PAD_CTL_HYS) |
46 | #define MX51_GPIO_PAD_CTRL (PAD_CTL_DSE_HIGH | PAD_CTL_PKE | \ | 46 | #define MX51_GPIO_PAD_CTRL (PAD_CTL_DSE_HIGH | PAD_CTL_PKE | \ |
47 | PAD_CTL_SRE_FAST) | 47 | PAD_CTL_SRE_FAST) |
48 | #define MX51_ECSPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_DSE_HIGH | \ | ||
49 | PAD_CTL_SRE_FAST) | ||
50 | |||
51 | #define MX51_PAD_CTRL_1 (PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | \ | ||
52 | PAD_CTL_PUE | PAD_CTL_PKE | PAD_CTL_HYS) | ||
53 | #define MX51_PAD_CTRL_2 (PAD_CTL_HYS | PAD_CTL_PKE) | ||
54 | #define MX51_PAD_CTRL_3 (PAD_CTL_PKE | PAD_CTL_PUS_100K_UP) | ||
55 | #define MX51_PAD_CTRL_4 (PAD_CTL_DVS | PAD_CTL_HYS | PAD_CTL_PKE) | ||
56 | #define MX51_PAD_CTRL_5 (PAD_CTL_DVS | PAD_CTL_DSE_HIGH) | ||
48 | 57 | ||
49 | /* | 58 | /* |
50 | * The naming convention for the pad modes is MX51_PAD_<padname>__<padmode> | 59 | * The naming convention for the pad modes is MX51_PAD_<padname>__<padmode> |
@@ -106,14 +115,20 @@ typedef enum iomux_config { | |||
106 | #define MX51_PAD_EIM_EB0__EIM_EB0 IOMUX_PAD(0x460, 0x0cc, 0, 0x0, 0, NO_PAD_CTRL) | 115 | #define MX51_PAD_EIM_EB0__EIM_EB0 IOMUX_PAD(0x460, 0x0cc, 0, 0x0, 0, NO_PAD_CTRL) |
107 | #define MX51_PAD_EIM_EB1__EIM_EB1 IOMUX_PAD(0x464, 0x0d0, 0, 0x0, 0, NO_PAD_CTRL) | 116 | #define MX51_PAD_EIM_EB1__EIM_EB1 IOMUX_PAD(0x464, 0x0d0, 0, 0x0, 0, NO_PAD_CTRL) |
108 | #define MX51_PAD_EIM_EB2__GPIO_2_22 IOMUX_PAD(0x468, 0x0d4, 1, 0x0, 0, NO_PAD_CTRL) | 117 | #define MX51_PAD_EIM_EB2__GPIO_2_22 IOMUX_PAD(0x468, 0x0d4, 1, 0x0, 0, NO_PAD_CTRL) |
118 | #define MX51_PAD_EIM_EB2__FEC_MDIO IOMUX_PAD(0x468, 0x0d4, 3, 0x0, 0, MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP) | ||
109 | #define MX51_PAD_EIM_EB3__GPIO_2_23 IOMUX_PAD(0x46c, 0x0d8, 1, 0x0, 0, NO_PAD_CTRL) | 119 | #define MX51_PAD_EIM_EB3__GPIO_2_23 IOMUX_PAD(0x46c, 0x0d8, 1, 0x0, 0, NO_PAD_CTRL) |
120 | #define MX51_PAD_EIM_EB3__FEC_RDAT1 IOMUX_PAD(0x46c, 0x0d8, 3, 0x0, 0, MX51_PAD_CTRL_2) | ||
110 | #define MX51_PAD_EIM_OE__GPIO_2_24 IOMUX_PAD(0x470, 0x0dc, 1, 0x0, 0, NO_PAD_CTRL) | 121 | #define MX51_PAD_EIM_OE__GPIO_2_24 IOMUX_PAD(0x470, 0x0dc, 1, 0x0, 0, NO_PAD_CTRL) |
111 | #define MX51_PAD_EIM_CS0__GPIO_2_25 IOMUX_PAD(0x474, 0x0e0, 1, 0x0, 0, NO_PAD_CTRL) | 122 | #define MX51_PAD_EIM_CS0__GPIO_2_25 IOMUX_PAD(0x474, 0x0e0, 1, 0x0, 0, NO_PAD_CTRL) |
112 | #define MX51_PAD_EIM_CS1__GPIO_2_26 IOMUX_PAD(0x478, 0x0e4, 1, 0x0, 0, NO_PAD_CTRL) | 123 | #define MX51_PAD_EIM_CS1__GPIO_2_26 IOMUX_PAD(0x478, 0x0e4, 1, 0x0, 0, NO_PAD_CTRL) |
113 | #define MX51_PAD_EIM_CS2__GPIO_2_27 IOMUX_PAD(0x47c, 0x0e8, 1, 0x0, 0, NO_PAD_CTRL) | 124 | #define MX51_PAD_EIM_CS2__GPIO_2_27 IOMUX_PAD(0x47c, 0x0e8, 1, 0x0, 0, NO_PAD_CTRL) |
125 | #define MX51_PAD_EIM_CS2__FEC_RDAT2 IOMUX_PAD(0x47c, 0x0e8, 3, 0x0, 0, MX51_PAD_CTRL_2) | ||
114 | #define MX51_PAD_EIM_CS3__GPIO_2_28 IOMUX_PAD(0x480, 0x0ec, 1, 0x0, 0, NO_PAD_CTRL) | 126 | #define MX51_PAD_EIM_CS3__GPIO_2_28 IOMUX_PAD(0x480, 0x0ec, 1, 0x0, 0, NO_PAD_CTRL) |
127 | #define MX51_PAD_EIM_CS3__FEC_RDAT3 IOMUX_PAD(0x480, 0x0ec, 3, 0x0, 0, MX51_PAD_CTRL_2) | ||
115 | #define MX51_PAD_EIM_CS4__GPIO_2_29 IOMUX_PAD(0x484, 0x0f0, 1, 0x0, 0, NO_PAD_CTRL) | 128 | #define MX51_PAD_EIM_CS4__GPIO_2_29 IOMUX_PAD(0x484, 0x0f0, 1, 0x0, 0, NO_PAD_CTRL) |
129 | #define MX51_PAD_EIM_CS4__FEC_RX_ER IOMUX_PAD(0x484, 0x0f0, 3, 0x0, 0, MX51_PAD_CTRL_2) | ||
116 | #define MX51_PAD_EIM_CS5__GPIO_2_30 IOMUX_PAD(0x488, 0x0f4, 1, 0x0, 0, NO_PAD_CTRL) | 130 | #define MX51_PAD_EIM_CS5__GPIO_2_30 IOMUX_PAD(0x488, 0x0f4, 1, 0x0, 0, NO_PAD_CTRL) |
131 | #define MX51_PAD_EIM_CS5__FEC_CRS IOMUX_PAD(0x488, 0x0f4, 3, 0x0, 0, MX51_PAD_CTRL_2) | ||
117 | #define MX51_PAD_EIM_DTACK__GPIO_2_31 IOMUX_PAD(0x48c, 0x0f8, 1, 0x0, 0, NO_PAD_CTRL) | 132 | #define MX51_PAD_EIM_DTACK__GPIO_2_31 IOMUX_PAD(0x48c, 0x0f8, 1, 0x0, 0, NO_PAD_CTRL) |
118 | #define MX51_PAD_EIM_LBA__GPIO_3_1 IOMUX_PAD(0x494, 0x0FC, 1, 0x0, 0, NO_PAD_CTRL) | 133 | #define MX51_PAD_EIM_LBA__GPIO_3_1 IOMUX_PAD(0x494, 0x0FC, 1, 0x0, 0, NO_PAD_CTRL) |
119 | #define MX51_PAD_EIM_CRE__GPIO_3_2 IOMUX_PAD(0x4A0, 0x100, 1, 0x0, 0, NO_PAD_CTRL) | 134 | #define MX51_PAD_EIM_CRE__GPIO_3_2 IOMUX_PAD(0x4A0, 0x100, 1, 0x0, 0, NO_PAD_CTRL) |
@@ -126,18 +141,32 @@ typedef enum iomux_config { | |||
126 | #define MX51_PAD_NANDF_RB0__GPIO_3_8 IOMUX_PAD(0x4F8, 0x11C, 3, 0x0, 0, NO_PAD_CTRL) | 141 | #define MX51_PAD_NANDF_RB0__GPIO_3_8 IOMUX_PAD(0x4F8, 0x11C, 3, 0x0, 0, NO_PAD_CTRL) |
127 | #define MX51_PAD_NANDF_RB1__GPIO_3_9 IOMUX_PAD(0x4FC, 0x120, 3, 0x0, 0, NO_PAD_CTRL) | 142 | #define MX51_PAD_NANDF_RB1__GPIO_3_9 IOMUX_PAD(0x4FC, 0x120, 3, 0x0, 0, NO_PAD_CTRL) |
128 | #define MX51_PAD_NANDF_RB2__GPIO_3_10 IOMUX_PAD(0x500, 0x124, 3, 0x0, 0, NO_PAD_CTRL) | 143 | #define MX51_PAD_NANDF_RB2__GPIO_3_10 IOMUX_PAD(0x500, 0x124, 3, 0x0, 0, NO_PAD_CTRL) |
144 | #define MX51_PAD_NANDF_RB2__ECSPI2_SCLK IOMUX_PAD(0x500, 0x124, 2, 0x0, 0, MX51_ECSPI_PAD_CTRL) | ||
145 | #define MX51_PAD_NANDF_RB2__FEC_COL IOMUX_PAD(0x500, 0x124, 1, 0x0, 0, MX51_PAD_CTRL_2) | ||
129 | #define MX51_PAD_NANDF_RB3__GPIO_3_11 IOMUX_PAD(0x504, 0x128, 3, 0x0, 0, NO_PAD_CTRL) | 146 | #define MX51_PAD_NANDF_RB3__GPIO_3_11 IOMUX_PAD(0x504, 0x128, 3, 0x0, 0, NO_PAD_CTRL) |
147 | #define MX51_PAD_NANDF_RB3__ECSPI2_MISO IOMUX_PAD(0x504, 0x128, 2, 0x0, 0, MX51_ECSPI_PAD_CTRL) | ||
148 | #define MX51_PAD_NANDF_RB3__FEC_RXCLK IOMUX_PAD(0x504, 0x128, 1, 0x0, 0, MX51_PAD_CTRL_2) | ||
149 | #define MX51_PAD_NANDF_RB6__FEC_RDAT0 IOMUX_PAD(0x5DC, 0x134, 1, 0x0, 0, MX51_PAD_CTRL_4) | ||
150 | #define MX51_PAD_NANDF_RB7__FEC_TDAT0 IOMUX_PAD(0x5E0, 0x138, 1, 0x0, 0, MX51_PAD_CTRL_5) | ||
130 | #define MX51_PAD_GPIO_NAND__GPIO_3_12 IOMUX_PAD(0x514, 0x12C, 3, 0x0, 0, NO_PAD_CTRL) | 151 | #define MX51_PAD_GPIO_NAND__GPIO_3_12 IOMUX_PAD(0x514, 0x12C, 3, 0x0, 0, NO_PAD_CTRL) |
131 | #define MX51_PAD_NANDF_CS0__GPIO_3_16 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, NO_PAD_CTRL) | 152 | #define MX51_PAD_NANDF_CS0__GPIO_3_16 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, NO_PAD_CTRL) |
132 | #define MX51_PAD_NANDF_CS1__GPIO_3_17 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, NO_PAD_CTRL) | 153 | #define MX51_PAD_NANDF_CS1__GPIO_3_17 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, NO_PAD_CTRL) |
133 | #define MX51_PAD_NANDF_CS2__GPIO_3_18 IOMUX_PAD(0x520, 0x138, 3, 0x0, 0, NO_PAD_CTRL) | 154 | #define MX51_PAD_NANDF_CS2__GPIO_3_18 IOMUX_PAD(0x520, 0x138, 3, 0x0, 0, NO_PAD_CTRL) |
155 | #define MX51_PAD_NANDF_CS2__FEC_TX_ER IOMUX_PAD(0x520, 0x138, 2, 0x0, 0, MX51_PAD_CTRL_5) | ||
134 | #define MX51_PAD_NANDF_CS3__GPIO_3_19 IOMUX_PAD(0x524, 0x13C, 3, 0x0, 0, NO_PAD_CTRL) | 156 | #define MX51_PAD_NANDF_CS3__GPIO_3_19 IOMUX_PAD(0x524, 0x13C, 3, 0x0, 0, NO_PAD_CTRL) |
157 | #define MX51_PAD_NANDF_CS3__FEC_MDC IOMUX_PAD(0x524, 0x13C, 2, 0x0, 0, MX51_PAD_CTRL_5) | ||
135 | #define MX51_PAD_NANDF_CS4__GPIO_3_20 IOMUX_PAD(0x528, 0x140, 3, 0x0, 0, NO_PAD_CTRL) | 158 | #define MX51_PAD_NANDF_CS4__GPIO_3_20 IOMUX_PAD(0x528, 0x140, 3, 0x0, 0, NO_PAD_CTRL) |
159 | #define MX51_PAD_NANDF_CS4__FEC_TDAT1 IOMUX_PAD(0x528, 0x140, 2, 0x0, 0, MX51_PAD_CTRL_5) | ||
136 | #define MX51_PAD_NANDF_CS5__GPIO_3_21 IOMUX_PAD(0x52C, 0x144, 3, 0x0, 0, NO_PAD_CTRL) | 160 | #define MX51_PAD_NANDF_CS5__GPIO_3_21 IOMUX_PAD(0x52C, 0x144, 3, 0x0, 0, NO_PAD_CTRL) |
161 | #define MX51_PAD_NANDF_CS5__FEC_TDAT2 IOMUX_PAD(0x52C, 0x144, 2, 0x0, 0, MX51_PAD_CTRL_5) | ||
137 | #define MX51_PAD_NANDF_CS6__GPIO_3_22 IOMUX_PAD(0x530, 0x148, 3, 0x0, 0, NO_PAD_CTRL) | 162 | #define MX51_PAD_NANDF_CS6__GPIO_3_22 IOMUX_PAD(0x530, 0x148, 3, 0x0, 0, NO_PAD_CTRL) |
163 | #define MX51_PAD_NANDF_CS6__FEC_TDAT3 IOMUX_PAD(0x530, 0x148, 2, 0x0, 0, MX51_PAD_CTRL_5) | ||
138 | #define MX51_PAD_NANDF_CS7__GPIO_3_23 IOMUX_PAD(0x534, 0x14C, 3, 0x0, 0, NO_PAD_CTRL) | 164 | #define MX51_PAD_NANDF_CS7__GPIO_3_23 IOMUX_PAD(0x534, 0x14C, 3, 0x0, 0, NO_PAD_CTRL) |
165 | #define MX51_PAD_NANDF_CS7__FEC_TX_EN IOMUX_PAD(0x534, 0x14C, 1, 0x0, 0, MX51_PAD_CTRL_5) | ||
139 | #define MX51_PAD_NANDF_RDY_INT__GPIO_3_24 IOMUX_PAD(0x538, 0x150, 3, 0x0, 0, NO_PAD_CTRL) | 166 | #define MX51_PAD_NANDF_RDY_INT__GPIO_3_24 IOMUX_PAD(0x538, 0x150, 3, 0x0, 0, NO_PAD_CTRL) |
167 | #define MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK IOMUX_PAD(0x538, 0x150, 1, 0x0, 0, MX51_PAD_CTRL_4) | ||
140 | #define MX51_PAD_NANDF_D15__GPIO_3_25 IOMUX_PAD(0x53C, 0x154, 3, 0x0, 0, NO_PAD_CTRL) | 168 | #define MX51_PAD_NANDF_D15__GPIO_3_25 IOMUX_PAD(0x53C, 0x154, 3, 0x0, 0, NO_PAD_CTRL) |
169 | #define MX51_PAD_NANDF_D15__ECSPI2_MOSI IOMUX_PAD(0x53C, 0x154, 2, 0x0, 0, MX51_ECSPI_PAD_CTRL) | ||
141 | #define MX51_PAD_NANDF_D14__GPIO_3_26 IOMUX_PAD(0x540, 0x158, 3, 0x0, 0, NO_PAD_CTRL) | 170 | #define MX51_PAD_NANDF_D14__GPIO_3_26 IOMUX_PAD(0x540, 0x158, 3, 0x0, 0, NO_PAD_CTRL) |
142 | #define MX51_PAD_NANDF_D13__GPIO_3_27 IOMUX_PAD(0x544, 0x15C, 3, 0x0, 0, NO_PAD_CTRL) | 171 | #define MX51_PAD_NANDF_D13__GPIO_3_27 IOMUX_PAD(0x544, 0x15C, 3, 0x0, 0, NO_PAD_CTRL) |
143 | #define MX51_PAD_NANDF_D12__GPIO_3_28 IOMUX_PAD(0x548, 0x160, 3, 0x0, 0, NO_PAD_CTRL) | 172 | #define MX51_PAD_NANDF_D12__GPIO_3_28 IOMUX_PAD(0x548, 0x160, 3, 0x0, 0, NO_PAD_CTRL) |
@@ -185,15 +214,25 @@ typedef enum iomux_config { | |||
185 | #define MX51_PAD_I2C1_CLK__HSI2C_CLK IOMUX_PAD(0x5E8, 0x1F8, 0, 0x0, 0, NO_PAD_CTRL) | 214 | #define MX51_PAD_I2C1_CLK__HSI2C_CLK IOMUX_PAD(0x5E8, 0x1F8, 0, 0x0, 0, NO_PAD_CTRL) |
186 | #define MX51_PAD_I2C1_DAT__GPIO_4_17 IOMUX_PAD(0x5EC, 0x1FC, 3, 0x0, 0, NO_PAD_CTRL) | 215 | #define MX51_PAD_I2C1_DAT__GPIO_4_17 IOMUX_PAD(0x5EC, 0x1FC, 3, 0x0, 0, NO_PAD_CTRL) |
187 | #define MX51_PAD_I2C1_DAT__HSI2C_DAT IOMUX_PAD(0x5EC, 0x1FC, 0, 0x0, 0, NO_PAD_CTRL) | 216 | #define MX51_PAD_I2C1_DAT__HSI2C_DAT IOMUX_PAD(0x5EC, 0x1FC, 0, 0x0, 0, NO_PAD_CTRL) |
217 | #define MX51_PAD_AUD3_BB_TXD__AUD3_BB_TXD IOMUX_PAD(0x5F0, 0x200, IOMUX_CONFIG_SION, 0x0, 0, NO_PAD_CTRL) | ||
188 | #define MX51_PAD_AUD3_BB_TXD__GPIO_4_18 IOMUX_PAD(0x5F0, 0x200, 3, 0x0, 0, NO_PAD_CTRL) | 218 | #define MX51_PAD_AUD3_BB_TXD__GPIO_4_18 IOMUX_PAD(0x5F0, 0x200, 3, 0x0, 0, NO_PAD_CTRL) |
219 | #define MX51_PAD_AUD3_BB_RXD__AUD3_BB_RXD IOMUX_PAD(0x5F4, 0x204, IOMUX_CONFIG_SION, 0x0, 0, NO_PAD_CTRL) | ||
189 | #define MX51_PAD_AUD3_BB_RXD__GPIO_4_19 IOMUX_PAD(0x5F4, 0x204, 3, 0x0, 0, NO_PAD_CTRL) | 220 | #define MX51_PAD_AUD3_BB_RXD__GPIO_4_19 IOMUX_PAD(0x5F4, 0x204, 3, 0x0, 0, NO_PAD_CTRL) |
221 | #define MX51_PAD_AUD3_BB_CK__AUD3_BB_CK IOMUX_PAD(0x5F8, 0x208, IOMUX_CONFIG_SION, 0x0, 0, NO_PAD_CTRL) | ||
190 | #define MX51_PAD_AUD3_BB_CK__GPIO_4_20 IOMUX_PAD(0x5F8, 0x208, 3, 0x0, 0, NO_PAD_CTRL) | 222 | #define MX51_PAD_AUD3_BB_CK__GPIO_4_20 IOMUX_PAD(0x5F8, 0x208, 3, 0x0, 0, NO_PAD_CTRL) |
223 | #define MX51_PAD_AUD3_BB_FS__AUD3_BB_FS IOMUX_PAD(0x5FC, 0x20C, IOMUX_CONFIG_SION, 0x0, 0, NO_PAD_CTRL) | ||
191 | #define MX51_PAD_AUD3_BB_FS__GPIO_4_21 IOMUX_PAD(0x5FC, 0x20C, 3, 0x0, 0, NO_PAD_CTRL) | 224 | #define MX51_PAD_AUD3_BB_FS__GPIO_4_21 IOMUX_PAD(0x5FC, 0x20C, 3, 0x0, 0, NO_PAD_CTRL) |
225 | #define MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI IOMUX_PAD(0x600, 0x210, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | ||
192 | #define MX51_PAD_CSPI1_MOSI__GPIO_4_22 IOMUX_PAD(0x600, 0x210, 3, 0x0, 0, NO_PAD_CTRL) | 226 | #define MX51_PAD_CSPI1_MOSI__GPIO_4_22 IOMUX_PAD(0x600, 0x210, 3, 0x0, 0, NO_PAD_CTRL) |
227 | #define MX51_PAD_CSPI1_MISO__ECSPI1_MISO IOMUX_PAD(0x604, 0x214, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | ||
193 | #define MX51_PAD_CSPI1_MISO__GPIO_4_23 IOMUX_PAD(0x604, 0x214, 3, 0x0, 0, NO_PAD_CTRL) | 228 | #define MX51_PAD_CSPI1_MISO__GPIO_4_23 IOMUX_PAD(0x604, 0x214, 3, 0x0, 0, NO_PAD_CTRL) |
229 | #define MX51_PAD_CSPI1_SS0__ECSPI1_SS0 IOMUX_PAD(0x608, 0x218, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | ||
194 | #define MX51_PAD_CSPI1_SS0__GPIO_4_24 IOMUX_PAD(0x608, 0x218, 3, 0x0, 0, NO_PAD_CTRL) | 230 | #define MX51_PAD_CSPI1_SS0__GPIO_4_24 IOMUX_PAD(0x608, 0x218, 3, 0x0, 0, NO_PAD_CTRL) |
231 | #define MX51_PAD_CSPI1_SS1__ECSPI1_SS1 IOMUX_PAD(0x60C, 0x21C, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | ||
195 | #define MX51_PAD_CSPI1_SS1__GPIO_4_25 IOMUX_PAD(0x60C, 0x21C, 3, 0x0, 0, NO_PAD_CTRL) | 232 | #define MX51_PAD_CSPI1_SS1__GPIO_4_25 IOMUX_PAD(0x60C, 0x21C, 3, 0x0, 0, NO_PAD_CTRL) |
233 | #define MX51_PAD_CSPI1_RDY__ECSPI1_RDY IOMUX_PAD(0x610, 0x220, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | ||
196 | #define MX51_PAD_CSPI1_RDY__GPIO_4_26 IOMUX_PAD(0x610, 0x220, 3, 0x0, 0, NO_PAD_CTRL) | 234 | #define MX51_PAD_CSPI1_RDY__GPIO_4_26 IOMUX_PAD(0x610, 0x220, 3, 0x0, 0, NO_PAD_CTRL) |
235 | #define MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK IOMUX_PAD(0x614, 0x224, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | ||
197 | #define MX51_PAD_CSPI1_SCLK__GPIO_4_27 IOMUX_PAD(0x614, 0x224, 3, 0x0, 0, NO_PAD_CTRL) | 236 | #define MX51_PAD_CSPI1_SCLK__GPIO_4_27 IOMUX_PAD(0x614, 0x224, 3, 0x0, 0, NO_PAD_CTRL) |
198 | #define MX51_PAD_UART1_RXD__UART1_RXD IOMUX_PAD(0x618, 0x228, 0, 0x9e4, 0, MX51_UART1_PAD_CTRL | PAD_CTL_SRE_FAST) | 237 | #define MX51_PAD_UART1_RXD__UART1_RXD IOMUX_PAD(0x618, 0x228, 0, 0x9e4, 0, MX51_UART1_PAD_CTRL | PAD_CTL_SRE_FAST) |
199 | #define MX51_PAD_UART1_TXD__UART1_TXD IOMUX_PAD(0x61C, 0x22C, 0, 0x0, 0, MX51_UART1_PAD_CTRL | PAD_CTL_SRE_FAST) | 238 | #define MX51_PAD_UART1_TXD__UART1_TXD IOMUX_PAD(0x61C, 0x22C, 0, 0x0, 0, MX51_UART1_PAD_CTRL | PAD_CTL_SRE_FAST) |
@@ -236,14 +275,14 @@ typedef enum iomux_config { | |||
236 | #define MX51_PAD_USBH1_DATA6__USBH1_DATA6 IOMUX_PAD(0x6A0, 0x2A0, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 275 | #define MX51_PAD_USBH1_DATA6__USBH1_DATA6 IOMUX_PAD(0x6A0, 0x2A0, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) |
237 | #define MX51_PAD_USBH1_DATA7__USBH1_DATA7 IOMUX_PAD(0x6A4, 0x2A4, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 276 | #define MX51_PAD_USBH1_DATA7__USBH1_DATA7 IOMUX_PAD(0x6A4, 0x2A4, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) |
238 | #define MX51_PAD_DI1_PIN11__GPIO_3_0 IOMUX_PAD(0x6A8, 0x2A8, 4, 0x0, 0, NO_PAD_CTRL) | 277 | #define MX51_PAD_DI1_PIN11__GPIO_3_0 IOMUX_PAD(0x6A8, 0x2A8, 4, 0x0, 0, NO_PAD_CTRL) |
239 | #define MX51_PAD_DI1_PIN12__GPIO_3_1 IOMUX_PAD(0x6AC, 0x2AC, 4, 0x0, 0, NO_PAD_CTRL) | 278 | #define MX51_PAD_DI1_PIN12__GPIO_3_1 IOMUX_PAD(0x6AC, 0x2AC, 4, 0x978, 1, NO_PAD_CTRL) |
240 | #define MX51_PAD_DI1_PIN13__GPIO_3_2 IOMUX_PAD(0x6B0, 0x2B0, 4, 0x0, 0, NO_PAD_CTRL) | 279 | #define MX51_PAD_DI1_PIN13__GPIO_3_2 IOMUX_PAD(0x6B0, 0x2B0, 4, 0x97c, 1, NO_PAD_CTRL) |
241 | #define MX51_PAD_DI1_D0_CS__GPIO_3_3 IOMUX_PAD(0x6B4, 0x2B4, 4, 0x0, 0, NO_PAD_CTRL) | 280 | #define MX51_PAD_DI1_D0_CS__GPIO_3_3 IOMUX_PAD(0x6B4, 0x2B4, 4, 0x980, 1, NO_PAD_CTRL) |
242 | #define MX51_PAD_DI1_D1_CS__GPIO_3_4 IOMUX_PAD(0x6B8, 0x2B8, 4, 0x0, 0, NO_PAD_CTRL) | 281 | #define MX51_PAD_DI1_D1_CS__GPIO_3_4 IOMUX_PAD(0x6B8, 0x2B8, 4, 0x984, 1, NO_PAD_CTRL) |
243 | #define MX51_PAD_DISPB2_SER_DIN__GPIO_3_5 IOMUX_PAD(0x6BC, 0x2BC, 4, 0x0, 0, NO_PAD_CTRL) | 282 | #define MX51_PAD_DISPB2_SER_DIN__GPIO_3_5 IOMUX_PAD(0x6BC, 0x2BC, 4, 0x988, 1, NO_PAD_CTRL) |
244 | #define MX51_PAD_DISPB2_SER_DIO__GPIO_3_6 IOMUX_PAD(0x6C0, 0x2C0, 4, 0x0, 0, NO_PAD_CTRL) | 283 | #define MX51_PAD_DISPB2_SER_DIO__GPIO_3_6 IOMUX_PAD(0x6C0, 0x2C0, 4, 0x98c, 1, NO_PAD_CTRL) |
245 | #define MX51_PAD_DISPB2_SER_CLK__GPIO_3_7 IOMUX_PAD(0x6C4, 0x2C4, 4, 0x0, 0, NO_PAD_CTRL) | 284 | #define MX51_PAD_DISPB2_SER_CLK__GPIO_3_7 IOMUX_PAD(0x6C4, 0x2C4, 4, 0x990, 1, NO_PAD_CTRL) |
246 | #define MX51_PAD_DISPB2_SER_RS__GPIO_3_8 IOMUX_PAD(0x6C8, 0x2C8, 4, 0x0, 0, NO_PAD_CTRL) | 285 | #define MX51_PAD_DISPB2_SER_RS__GPIO_3_8 IOMUX_PAD(0x6C8, 0x2C8, 4, 0x994, 1, NO_PAD_CTRL) |
247 | #define MX51_PAD_DISP1_DAT0__DISP1_DAT0 IOMUX_PAD(0x6CC, 0x2CC, 0, 0x0, 0, NO_PAD_CTRL) | 286 | #define MX51_PAD_DISP1_DAT0__DISP1_DAT0 IOMUX_PAD(0x6CC, 0x2CC, 0, 0x0, 0, NO_PAD_CTRL) |
248 | #define MX51_PAD_DISP1_DAT1__DISP1_DAT1 IOMUX_PAD(0x6D0, 0x2D0, 0, 0x0, 0, NO_PAD_CTRL) | 287 | #define MX51_PAD_DISP1_DAT1__DISP1_DAT1 IOMUX_PAD(0x6D0, 0x2D0, 0, 0x0, 0, NO_PAD_CTRL) |
249 | #define MX51_PAD_DISP1_DAT2__DISP1_DAT2 IOMUX_PAD(0x6D4, 0x2D4, 0, 0x0, 0, NO_PAD_CTRL) | 288 | #define MX51_PAD_DISP1_DAT2__DISP1_DAT2 IOMUX_PAD(0x6D4, 0x2D4, 0, 0x0, 0, NO_PAD_CTRL) |
@@ -295,11 +334,17 @@ typedef enum iomux_config { | |||
295 | #define MX51_PAD_DISP2_DAT14__DISP2_DAT14 IOMUX_PAD(0x794, 0x38C, 0, 0x0, 0, NO_PAD_CTRL) | 334 | #define MX51_PAD_DISP2_DAT14__DISP2_DAT14 IOMUX_PAD(0x794, 0x38C, 0, 0x0, 0, NO_PAD_CTRL) |
296 | #define MX51_PAD_DISP2_DAT15__DISP2_DAT15 IOMUX_PAD(0x798, 0x390, 0, 0x0, 0, NO_PAD_CTRL) | 335 | #define MX51_PAD_DISP2_DAT15__DISP2_DAT15 IOMUX_PAD(0x798, 0x390, 0, 0x0, 0, NO_PAD_CTRL) |
297 | #define MX51_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(0x79C, 0x394, 0, 0x0, 0, NO_PAD_CTRL) | 336 | #define MX51_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(0x79C, 0x394, 0, 0x0, 0, NO_PAD_CTRL) |
337 | #define MX51_PAD_SD1_CMD__AUD5_RXFS IOMUX_PAD(0x79C, 0x394, 1, 0x8e0, 1, NO_PAD_CTRL) | ||
298 | #define MX51_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(0x7A0, 0x398, 0, 0x0, 0, NO_PAD_CTRL) | 338 | #define MX51_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(0x7A0, 0x398, 0, 0x0, 0, NO_PAD_CTRL) |
339 | #define MX51_PAD_SD1_CLK__AUD5_RXC IOMUX_PAD(0x7A0, 0x398, 1, 0x8dc, 1, NO_PAD_CTRL) | ||
299 | #define MX51_PAD_SD1_DATA0__SD1_DATA0 IOMUX_PAD(0x7A4, 0x39C, 0, 0x0, 0, NO_PAD_CTRL) | 340 | #define MX51_PAD_SD1_DATA0__SD1_DATA0 IOMUX_PAD(0x7A4, 0x39C, 0, 0x0, 0, NO_PAD_CTRL) |
341 | #define MX51_PAD_SD1_DATA0__AUD5_TXD IOMUX_PAD(0x7A4, 0x39C, 1, 0x8d8, 2, NO_PAD_CTRL) | ||
300 | #define MX51_PAD_SD1_DATA1__SD1_DATA1 IOMUX_PAD(0x7A8, 0x3A0, 0, 0x0, 0, NO_PAD_CTRL) | 342 | #define MX51_PAD_SD1_DATA1__SD1_DATA1 IOMUX_PAD(0x7A8, 0x3A0, 0, 0x0, 0, NO_PAD_CTRL) |
343 | #define MX51_PAD_SD1_DATA1__AUD5_RXD IOMUX_PAD(0x7A8, 0x3A0, 1, 0x8d4, 2, NO_PAD_CTRL) | ||
301 | #define MX51_PAD_SD1_DATA2__SD1_DATA2 IOMUX_PAD(0x7AC, 0x3A4, 0, 0x0, 0, NO_PAD_CTRL) | 344 | #define MX51_PAD_SD1_DATA2__SD1_DATA2 IOMUX_PAD(0x7AC, 0x3A4, 0, 0x0, 0, NO_PAD_CTRL) |
345 | #define MX51_PAD_SD1_DATA2__AUD5_TXC IOMUX_PAD(0x7AC, 0x3A4, 1, 0x8e4, 2, NO_PAD_CTRL) | ||
302 | #define MX51_PAD_SD1_DATA3__SD1_DATA3 IOMUX_PAD(0x7B0, 0x3A8, 0, 0x0, 0, NO_PAD_CTRL) | 346 | #define MX51_PAD_SD1_DATA3__SD1_DATA3 IOMUX_PAD(0x7B0, 0x3A8, 0, 0x0, 0, NO_PAD_CTRL) |
347 | #define MX51_PAD_SD1_DATA3__AUD5_TXFS IOMUX_PAD(0x7B0, 0x3A8, 1, 0x8e8, 2, NO_PAD_CTRL) | ||
303 | #define MX51_PAD_GPIO_1_0__GPIO_1_0 IOMUX_PAD(0x7B4, 0x3AC, 1, 0x0, 0, NO_PAD_CTRL) | 348 | #define MX51_PAD_GPIO_1_0__GPIO_1_0 IOMUX_PAD(0x7B4, 0x3AC, 1, 0x0, 0, NO_PAD_CTRL) |
304 | #define MX51_PAD_GPIO_1_1__GPIO_1_1 IOMUX_PAD(0x7B8, 0x3B0, 1, 0x0, 0, NO_PAD_CTRL) | 349 | #define MX51_PAD_GPIO_1_1__GPIO_1_1 IOMUX_PAD(0x7B8, 0x3B0, 1, 0x0, 0, NO_PAD_CTRL) |
305 | #define MX51_PAD_SD2_CMD__SD2_CMD IOMUX_PAD(0x7BC, 0x3B4, 0, 0x0, 0, NO_PAD_CTRL) | 350 | #define MX51_PAD_SD2_CMD__SD2_CMD IOMUX_PAD(0x7BC, 0x3B4, 0, 0x0, 0, NO_PAD_CTRL) |
diff --git a/arch/arm/plat-mxc/include/mach/mx21.h b/arch/arm/plat-mxc/include/mach/mx21.h index ed98b9c9f389..8bc59720b6e4 100644 --- a/arch/arm/plat-mxc/include/mach/mx21.h +++ b/arch/arm/plat-mxc/include/mach/mx21.h | |||
@@ -120,7 +120,7 @@ | |||
120 | #define MX21_INT_GPT1 26 | 120 | #define MX21_INT_GPT1 26 |
121 | #define MX21_INT_WDOG 27 | 121 | #define MX21_INT_WDOG 27 |
122 | #define MX21_INT_PCMCIA 28 | 122 | #define MX21_INT_PCMCIA 28 |
123 | #define MX21_INT_NANDFC 29 | 123 | #define MX21_INT_NFC 29 |
124 | #define MX21_INT_BMI 30 | 124 | #define MX21_INT_BMI 30 |
125 | #define MX21_INT_CSI 31 | 125 | #define MX21_INT_CSI 31 |
126 | #define MX21_INT_DMACH0 32 | 126 | #define MX21_INT_DMACH0 32 |
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h index 4a6f800990f8..153dd1b2a473 100644 --- a/arch/arm/plat-mxc/include/mach/mx25.h +++ b/arch/arm/plat-mxc/include/mach/mx25.h | |||
@@ -50,6 +50,8 @@ | |||
50 | #define MX25_SSI1_BASE_ADDR 0x50034000 | 50 | #define MX25_SSI1_BASE_ADDR 0x50034000 |
51 | #define MX25_NFC_BASE_ADDR 0xbb000000 | 51 | #define MX25_NFC_BASE_ADDR 0xbb000000 |
52 | #define MX25_DRYICE_BASE_ADDR 0x53ffc000 | 52 | #define MX25_DRYICE_BASE_ADDR 0x53ffc000 |
53 | #define MX25_ESDHC1_BASE_ADDR 0x53fb4000 | ||
54 | #define MX25_ESDHC2_BASE_ADDR 0x53fb8000 | ||
53 | #define MX25_LCDC_BASE_ADDR 0x53fbc000 | 55 | #define MX25_LCDC_BASE_ADDR 0x53fbc000 |
54 | #define MX25_KPP_BASE_ADDR 0x43fa8000 | 56 | #define MX25_KPP_BASE_ADDR 0x43fa8000 |
55 | #define MX25_OTG_BASE_ADDR 0x53ff4000 | 57 | #define MX25_OTG_BASE_ADDR 0x53ff4000 |
@@ -59,6 +61,8 @@ | |||
59 | #define MX25_INT_I2C1 3 | 61 | #define MX25_INT_I2C1 3 |
60 | #define MX25_INT_I2C2 4 | 62 | #define MX25_INT_I2C2 4 |
61 | #define MX25_INT_UART4 5 | 63 | #define MX25_INT_UART4 5 |
64 | #define MX25_INT_MMC_SDHC2 8 | ||
65 | #define MX25_INT_MMC_SDHC1 9 | ||
62 | #define MX25_INT_I2C3 10 | 66 | #define MX25_INT_I2C3 10 |
63 | #define MX25_INT_SSI2 11 | 67 | #define MX25_INT_SSI2 11 |
64 | #define MX25_INT_SSI1 12 | 68 | #define MX25_INT_SSI1 12 |
@@ -69,7 +73,7 @@ | |||
69 | #define MX25_INT_KPP 24 | 73 | #define MX25_INT_KPP 24 |
70 | #define MX25_INT_DRYICE 25 | 74 | #define MX25_INT_DRYICE 25 |
71 | #define MX25_INT_UART2 32 | 75 | #define MX25_INT_UART2 32 |
72 | #define MX25_INT_NANDFC 33 | 76 | #define MX25_INT_NFC 33 |
73 | #define MX25_INT_LCDC 39 | 77 | #define MX25_INT_LCDC 39 |
74 | #define MX25_INT_UART5 40 | 78 | #define MX25_INT_UART5 40 |
75 | #define MX25_INT_CAN1 43 | 79 | #define MX25_INT_CAN1 43 |
@@ -77,4 +81,13 @@ | |||
77 | #define MX25_INT_UART1 45 | 81 | #define MX25_INT_UART1 45 |
78 | #define MX25_INT_FEC 57 | 82 | #define MX25_INT_FEC 57 |
79 | 83 | ||
84 | #define MX25_DMA_REQ_SSI2_RX1 22 | ||
85 | #define MX25_DMA_REQ_SSI2_TX1 23 | ||
86 | #define MX25_DMA_REQ_SSI2_RX0 24 | ||
87 | #define MX25_DMA_REQ_SSI2_TX0 25 | ||
88 | #define MX25_DMA_REQ_SSI1_RX1 26 | ||
89 | #define MX25_DMA_REQ_SSI1_TX1 27 | ||
90 | #define MX25_DMA_REQ_SSI1_RX0 28 | ||
91 | #define MX25_DMA_REQ_SSI1_TX0 29 | ||
92 | |||
80 | #endif /* ifndef __MACH_MX25_H__ */ | 93 | #endif /* ifndef __MACH_MX25_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h index a8ab2e02a8ca..2237ba2e5351 100644 --- a/arch/arm/plat-mxc/include/mach/mx27.h +++ b/arch/arm/plat-mxc/include/mach/mx27.h | |||
@@ -167,7 +167,7 @@ static inline void mx27_setup_weimcs(size_t cs, | |||
167 | #define MX27_INT_GPT1 26 | 167 | #define MX27_INT_GPT1 26 |
168 | #define MX27_INT_WDOG 27 | 168 | #define MX27_INT_WDOG 27 |
169 | #define MX27_INT_PCMCIA 28 | 169 | #define MX27_INT_PCMCIA 28 |
170 | #define MX27_INT_NANDFC 29 | 170 | #define MX27_INT_NFC 29 |
171 | #define MX27_INT_ATA 30 | 171 | #define MX27_INT_ATA 30 |
172 | #define MX27_INT_CSI 31 | 172 | #define MX27_INT_CSI 31 |
173 | #define MX27_INT_DMACH0 32 | 173 | #define MX27_INT_DMACH0 32 |
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h index afee3ab9d62e..03e2afabc9fc 100644 --- a/arch/arm/plat-mxc/include/mach/mx31.h +++ b/arch/arm/plat-mxc/include/mach/mx31.h | |||
@@ -168,7 +168,7 @@ static inline void mx31_setup_weimcs(size_t cs, | |||
168 | #define MX31_INT_POWER_FAIL 30 | 168 | #define MX31_INT_POWER_FAIL 30 |
169 | #define MX31_INT_CCM_DVFS 31 | 169 | #define MX31_INT_CCM_DVFS 31 |
170 | #define MX31_INT_UART2 32 | 170 | #define MX31_INT_UART2 32 |
171 | #define MX31_INT_NANDFC 33 | 171 | #define MX31_INT_NFC 33 |
172 | #define MX31_INT_SDMA 34 | 172 | #define MX31_INT_SDMA 34 |
173 | #define MX31_INT_USB1 35 | 173 | #define MX31_INT_USB1 35 |
174 | #define MX31_INT_USB2 36 | 174 | #define MX31_INT_USB2 36 |
@@ -197,6 +197,15 @@ static inline void mx31_setup_weimcs(size_t cs, | |||
197 | #define MX31_INT_EXT_WDOG 62 | 197 | #define MX31_INT_EXT_WDOG 62 |
198 | #define MX31_INT_EXT_TV 63 | 198 | #define MX31_INT_EXT_TV 63 |
199 | 199 | ||
200 | #define MX31_DMA_REQ_SSI2_RX1 22 | ||
201 | #define MX31_DMA_REQ_SSI2_TX1 23 | ||
202 | #define MX31_DMA_REQ_SSI2_RX0 24 | ||
203 | #define MX31_DMA_REQ_SSI2_TX0 25 | ||
204 | #define MX31_DMA_REQ_SSI1_RX1 26 | ||
205 | #define MX31_DMA_REQ_SSI1_TX1 27 | ||
206 | #define MX31_DMA_REQ_SSI1_RX0 28 | ||
207 | #define MX31_DMA_REQ_SSI1_TX0 29 | ||
208 | |||
200 | #define MX31_PROD_SIGNATURE 0x1 /* For MX31 */ | 209 | #define MX31_PROD_SIGNATURE 0x1 /* For MX31 */ |
201 | 210 | ||
202 | /* silicon revisions specific to i.MX31 */ | 211 | /* silicon revisions specific to i.MX31 */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h index af3038c12e39..cb071b7b17e5 100644 --- a/arch/arm/plat-mxc/include/mach/mx35.h +++ b/arch/arm/plat-mxc/include/mach/mx35.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #ifndef __MACH_MX35_H__ | 1 | #ifndef __MACH_MX35_H__ |
2 | #define __MACH_MX35_H__ | 2 | #define __MACH_MX35_H__ |
3 | |||
3 | /* | 4 | /* |
4 | * IRAM | 5 | * IRAM |
5 | */ | 6 | */ |
@@ -52,6 +53,9 @@ | |||
52 | #define MX35_GPIO3_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xa4000) | 53 | #define MX35_GPIO3_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xa4000) |
53 | #define MX35_SCC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xac000) | 54 | #define MX35_SCC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xac000) |
54 | #define MX35_RNGA_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xb0000) | 55 | #define MX35_RNGA_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xb0000) |
56 | #define MX35_ESDHC1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xb4000) | ||
57 | #define MX35_ESDHC2_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xb8000) | ||
58 | #define MX35_ESDHC3_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xbc000) | ||
55 | #define MX35_IPU_CTRL_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xc0000) | 59 | #define MX35_IPU_CTRL_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xc0000) |
56 | #define MX35_AUDMUX_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xc4000) | 60 | #define MX35_AUDMUX_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xc4000) |
57 | #define MX35_GPIO1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xcc000) | 61 | #define MX35_GPIO1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xcc000) |
@@ -63,6 +67,8 @@ | |||
63 | #define MX35_CAN1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xe4000) | 67 | #define MX35_CAN1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xe4000) |
64 | #define MX35_CAN2_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xe8000) | 68 | #define MX35_CAN2_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xe8000) |
65 | #define MX35_RTIC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xec000) | 69 | #define MX35_RTIC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xec000) |
70 | #define MX35_IIM_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xf0000) | ||
71 | |||
66 | #define MX35_OTG_BASE_ADDR 0x53ff4000 | 72 | #define MX35_OTG_BASE_ADDR 0x53ff4000 |
67 | 73 | ||
68 | #define MX35_ROMP_BASE_ADDR 0x60000000 | 74 | #define MX35_ROMP_BASE_ADDR 0x60000000 |
@@ -145,7 +151,7 @@ | |||
145 | #define MX35_INT_GPT 29 | 151 | #define MX35_INT_GPT 29 |
146 | #define MX35_INT_POWER_FAIL 30 | 152 | #define MX35_INT_POWER_FAIL 30 |
147 | #define MX35_INT_UART2 32 | 153 | #define MX35_INT_UART2 32 |
148 | #define MX35_INT_NANDFC 33 | 154 | #define MX35_INT_NFC 33 |
149 | #define MX35_INT_SDMA 34 | 155 | #define MX35_INT_SDMA 34 |
150 | #define MX35_INT_USBHS 35 | 156 | #define MX35_INT_USBHS 35 |
151 | #define MX35_INT_USBOTG 37 | 157 | #define MX35_INT_USBOTG 37 |
@@ -173,22 +179,18 @@ | |||
173 | #define MX35_INT_EXT_WDOG 62 | 179 | #define MX35_INT_EXT_WDOG 62 |
174 | #define MX35_INT_EXT_TV 63 | 180 | #define MX35_INT_EXT_TV 63 |
175 | 181 | ||
182 | #define MX35_DMA_REQ_SSI2_RX1 22 | ||
183 | #define MX35_DMA_REQ_SSI2_TX1 23 | ||
184 | #define MX35_DMA_REQ_SSI2_RX0 24 | ||
185 | #define MX35_DMA_REQ_SSI2_TX0 25 | ||
186 | #define MX35_DMA_REQ_SSI1_RX1 26 | ||
187 | #define MX35_DMA_REQ_SSI1_TX1 27 | ||
188 | #define MX35_DMA_REQ_SSI1_RX0 28 | ||
189 | #define MX35_DMA_REQ_SSI1_TX0 29 | ||
190 | |||
176 | #define MX35_PROD_SIGNATURE 0x1 /* For MX31 */ | 191 | #define MX35_PROD_SIGNATURE 0x1 /* For MX31 */ |
177 | 192 | ||
178 | /* silicon revisions specific to i.MX31 */ | 193 | #define MX35_SYSTEM_REV_MIN MX3x_CHIP_REV_1_0 |
179 | #define MX35_CHIP_REV_1_0 0x10 | ||
180 | #define MX35_CHIP_REV_1_1 0x11 | ||
181 | #define MX35_CHIP_REV_1_2 0x12 | ||
182 | #define MX35_CHIP_REV_1_3 0x13 | ||
183 | #define MX35_CHIP_REV_2_0 0x20 | ||
184 | #define MX35_CHIP_REV_2_1 0x21 | ||
185 | #define MX35_CHIP_REV_2_2 0x22 | ||
186 | #define MX35_CHIP_REV_2_3 0x23 | ||
187 | #define MX35_CHIP_REV_3_0 0x30 | ||
188 | #define MX35_CHIP_REV_3_1 0x31 | ||
189 | #define MX35_CHIP_REV_3_2 0x32 | ||
190 | |||
191 | #define MX35_SYSTEM_REV_MIN MX35_CHIP_REV_1_0 | ||
192 | #define MX35_SYSTEM_REV_NUM 3 | 194 | #define MX35_SYSTEM_REV_NUM 3 |
193 | 195 | ||
194 | #ifdef IMX_NEEDS_DEPRECATED_SYMBOLS | 196 | #ifdef IMX_NEEDS_DEPRECATED_SYMBOLS |
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/plat-mxc/include/mach/mx3x.h index 7a356de385f5..d1bd26d7b8a6 100644 --- a/arch/arm/plat-mxc/include/mach/mx3x.h +++ b/arch/arm/plat-mxc/include/mach/mx3x.h | |||
@@ -240,7 +240,7 @@ | |||
240 | 240 | ||
241 | #define MX3x_PROD_SIGNATURE 0x1 /* For MX31 */ | 241 | #define MX3x_PROD_SIGNATURE 0x1 /* For MX31 */ |
242 | 242 | ||
243 | /* silicon revisions specific to i.MX31 */ | 243 | /* silicon revisions specific to i.MX31 and i.MX35 */ |
244 | #define MX3x_CHIP_REV_1_0 0x10 | 244 | #define MX3x_CHIP_REV_1_0 0x10 |
245 | #define MX3x_CHIP_REV_1_1 0x11 | 245 | #define MX3x_CHIP_REV_1_1 0x11 |
246 | #define MX3x_CHIP_REV_1_2 0x12 | 246 | #define MX3x_CHIP_REV_1_2 0x12 |
@@ -267,6 +267,14 @@ static inline int mx31_revision(void) | |||
267 | { | 267 | { |
268 | return mx31_cpu_rev; | 268 | return mx31_cpu_rev; |
269 | } | 269 | } |
270 | |||
271 | extern unsigned int mx35_cpu_rev; | ||
272 | extern void mx35_read_cpu_rev(void); | ||
273 | |||
274 | static inline int mx35_revision(void) | ||
275 | { | ||
276 | return mx35_cpu_rev; | ||
277 | } | ||
270 | #endif | 278 | #endif |
271 | 279 | ||
272 | #ifdef IMX_NEEDS_DEPRECATED_SYMBOLS | 280 | #ifdef IMX_NEEDS_DEPRECATED_SYMBOLS |
@@ -389,19 +397,6 @@ static inline int mx31_revision(void) | |||
389 | #define MXC_INT_EXT_WDOG MX3x_INT_EXT_WDOG | 397 | #define MXC_INT_EXT_WDOG MX3x_INT_EXT_WDOG |
390 | #define MXC_INT_EXT_TV MX3x_INT_EXT_TV | 398 | #define MXC_INT_EXT_TV MX3x_INT_EXT_TV |
391 | #define PROD_SIGNATURE MX3x_PROD_SIGNATURE | 399 | #define PROD_SIGNATURE MX3x_PROD_SIGNATURE |
392 | #define CHIP_REV_1_0 MX3x_CHIP_REV_1_0 | ||
393 | #define CHIP_REV_1_1 MX3x_CHIP_REV_1_1 | ||
394 | #define CHIP_REV_1_2 MX3x_CHIP_REV_1_2 | ||
395 | #define CHIP_REV_1_3 MX3x_CHIP_REV_1_3 | ||
396 | #define CHIP_REV_2_0 MX3x_CHIP_REV_2_0 | ||
397 | #define CHIP_REV_2_1 MX3x_CHIP_REV_2_1 | ||
398 | #define CHIP_REV_2_2 MX3x_CHIP_REV_2_2 | ||
399 | #define CHIP_REV_2_3 MX3x_CHIP_REV_2_3 | ||
400 | #define CHIP_REV_3_0 MX3x_CHIP_REV_3_0 | ||
401 | #define CHIP_REV_3_1 MX3x_CHIP_REV_3_1 | ||
402 | #define CHIP_REV_3_2 MX3x_CHIP_REV_3_2 | ||
403 | #define SYSTEM_REV_MIN MX3x_SYSTEM_REV_MIN | ||
404 | #define SYSTEM_REV_NUM MX3x_SYSTEM_REV_NUM | ||
405 | #endif | 400 | #endif |
406 | 401 | ||
407 | #endif /* ifndef __MACH_MX3x_H__ */ | 402 | #endif /* ifndef __MACH_MX3x_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h index 5aad344d5651..c54b5c32d82e 100644 --- a/arch/arm/plat-mxc/include/mach/mx51.h +++ b/arch/arm/plat-mxc/include/mach/mx51.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __ASM_ARCH_MXC_MX51_H__ | 1 | #ifndef __MACH_MX51_H__ |
2 | #define __ASM_ARCH_MXC_MX51_H__ | 2 | #define __MACH_MX51_H__ |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * MX51 memory map: | 5 | * MX51 memory map: |
@@ -7,24 +7,23 @@ | |||
7 | * | 7 | * |
8 | * Virt Phys Size What | 8 | * Virt Phys Size What |
9 | * --------------------------------------------------------------------------- | 9 | * --------------------------------------------------------------------------- |
10 | * FA3E0000 1FFE0000 128K IRAM (SCCv2 RAM) | 10 | * fa3e0000 1ffe0000 128K IRAM (SCCv2 RAM) |
11 | * 30000000 256M GPU | 11 | * 30000000 256M GPU |
12 | * 40000000 512M IPU | 12 | * 40000000 512M IPU |
13 | * FA200000 60000000 1M DEBUG | 13 | * fa200000 60000000 1M DEBUG |
14 | * FB100000 70000000 1M SPBA 0 | 14 | * fb100000 70000000 1M SPBA 0 |
15 | * FB000000 73F00000 1M AIPS 1 | 15 | * fb000000 73f00000 1M AIPS 1 |
16 | * FB200000 83F00000 1M AIPS 2 | 16 | * fb200000 83f00000 1M AIPS 2 |
17 | * 8FFFC000 16K TZIC (interrupt controller) | 17 | * 8fffc000 16K TZIC (interrupt controller) |
18 | * 90000000 256M CSD0 SDRAM/DDR | 18 | * 90000000 256M CSD0 SDRAM/DDR |
19 | * A0000000 256M CSD1 SDRAM/DDR | 19 | * a0000000 256M CSD1 SDRAM/DDR |
20 | * B0000000 128M CS0 Flash | 20 | * b0000000 128M CS0 Flash |
21 | * B8000000 128M CS1 Flash | 21 | * b8000000 128M CS1 Flash |
22 | * C0000000 128M CS2 Flash | 22 | * c0000000 128M CS2 Flash |
23 | * C8000000 64M CS3 Flash | 23 | * c8000000 64M CS3 Flash |
24 | * CC000000 32M CS4 SRAM | 24 | * cc000000 32M CS4 SRAM |
25 | * CE000000 32M CS5 SRAM | 25 | * ce000000 32M CS5 SRAM |
26 | * CFFF0000 64K NFC (NAND Flash AXI) | 26 | * cfff0000 64K NFC (NAND Flash AXI) |
27 | * | ||
28 | */ | 27 | */ |
29 | 28 | ||
30 | /* | 29 | /* |
@@ -36,65 +35,151 @@ | |||
36 | /* | 35 | /* |
37 | * IRAM | 36 | * IRAM |
38 | */ | 37 | */ |
39 | #define MX51_IRAM_BASE_ADDR 0x1FFE0000 /* internal ram */ | 38 | #define MX51_IRAM_BASE_ADDR 0x1ffe0000 /* internal ram */ |
40 | #define MX51_IRAM_BASE_ADDR_VIRT 0xFA3E0000 | 39 | #define MX51_IRAM_BASE_ADDR_VIRT 0xfa3e0000 |
41 | #define MX51_IRAM_PARTITIONS 16 | 40 | #define MX51_IRAM_PARTITIONS 16 |
42 | #define MX51_IRAM_PARTITIONS_TO1 12 | ||
43 | #define MX51_IRAM_SIZE (MX51_IRAM_PARTITIONS * SZ_8K) /* 128KB */ | 41 | #define MX51_IRAM_SIZE (MX51_IRAM_PARTITIONS * SZ_8K) /* 128KB */ |
44 | 42 | ||
43 | #define MX51_GPU_BASE_ADDR 0x20000000 | ||
44 | #define MX51_GPU_CTRL_BASE_ADDR 0x30000000 | ||
45 | #define MX51_IPU_CTRL_BASE_ADDR 0x40000000 | ||
46 | |||
47 | #define MX51_DEBUG_BASE_ADDR 0x60000000 | ||
48 | #define MX51_DEBUG_BASE_ADDR_VIRT 0xfa200000 | ||
49 | #define MX51_DEBUG_SIZE SZ_1M | ||
50 | |||
51 | #define MX51_ETB_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x01000) | ||
52 | #define MX51_ETM_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x02000) | ||
53 | #define MX51_TPIU_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x03000) | ||
54 | #define MX51_CTI0_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x04000) | ||
55 | #define MX51_CTI1_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x05000) | ||
56 | #define MX51_CTI2_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x06000) | ||
57 | #define MX51_CTI3_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x07000) | ||
58 | #define MX51_CORTEX_DBG_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x08000) | ||
59 | |||
45 | /* | 60 | /* |
46 | * NFC | 61 | * SPBA global module enabled #0 |
47 | */ | 62 | */ |
48 | #define MX51_NFC_AXI_BASE_ADDR 0xCFFF0000 /* NAND flash AXI */ | 63 | #define MX51_SPBA0_BASE_ADDR 0x70000000 |
49 | #define MX51_NFC_AXI_SIZE SZ_64K | 64 | #define MX51_SPBA0_BASE_ADDR_VIRT 0xfb100000 |
65 | #define MX51_SPBA0_SIZE SZ_1M | ||
66 | |||
67 | #define MX51_MMC_SDHC1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x04000) | ||
68 | #define MX51_MMC_SDHC2_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x08000) | ||
69 | #define MX51_UART3_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x0c000) | ||
70 | #define MX51_ECSPI1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x10000) | ||
71 | #define MX51_SSI2_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x14000) | ||
72 | #define MX51_MMC_SDHC3_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x20000) | ||
73 | #define MX51_MMC_SDHC4_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x24000) | ||
74 | #define MX51_SPDIF_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x28000) | ||
75 | #define MX51_ATA_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x30000) | ||
76 | #define MX51_SLIM_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x34000) | ||
77 | #define MX51_HSI2C_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x38000) | ||
78 | #define MX51_SPBA_CTRL_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x3c000) | ||
50 | 79 | ||
51 | /* | 80 | /* |
52 | * Graphics Memory of GPU | 81 | * AIPS 1 |
53 | */ | 82 | */ |
54 | #define MX51_GPU_BASE_ADDR 0x20000000 | 83 | #define MX51_AIPS1_BASE_ADDR 0x73f00000 |
55 | #define MX51_GPU2D_BASE_ADDR 0xD0000000 | 84 | #define MX51_AIPS1_BASE_ADDR_VIRT 0xfb000000 |
85 | #define MX51_AIPS1_SIZE SZ_1M | ||
86 | |||
87 | #define MX51_OTG_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x80000) | ||
88 | #define MX51_GPIO1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x84000) | ||
89 | #define MX51_GPIO2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x88000) | ||
90 | #define MX51_GPIO3_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x8c000) | ||
91 | #define MX51_GPIO4_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x90000) | ||
92 | #define MX51_KPP_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x94000) | ||
93 | #define MX51_WDOG_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x98000) | ||
94 | #define MX51_WDOG2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x9c000) | ||
95 | #define MX51_GPT1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xa0000) | ||
96 | #define MX51_SRTC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xa4000) | ||
97 | #define MX51_IOMUXC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xa8000) | ||
98 | #define MX51_EPIT1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xac000) | ||
99 | #define MX51_EPIT2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xb0000) | ||
100 | #define MX51_PWM1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xb4000) | ||
101 | #define MX51_PWM2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xb8000) | ||
102 | #define MX51_UART1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xbc000) | ||
103 | #define MX51_UART2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xc0000) | ||
104 | #define MX51_SRC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xd0000) | ||
105 | #define MX51_CCM_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xd4000) | ||
106 | #define MX51_GPC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xd8000) | ||
56 | 107 | ||
57 | #define MX51_TZIC_BASE_ADDR_TO1 0x8FFFC000 | 108 | /* |
58 | #define MX51_TZIC_BASE_ADDR 0xE0000000 | 109 | * AIPS 2 |
110 | */ | ||
111 | #define MX51_AIPS2_BASE_ADDR 0x83f00000 | ||
112 | #define MX51_AIPS2_BASE_ADDR_VIRT 0xfb200000 | ||
113 | #define MX51_AIPS2_SIZE SZ_1M | ||
59 | 114 | ||
60 | #define MX51_DEBUG_BASE_ADDR 0x60000000 | 115 | #define MX51_PLL1_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x80000) |
61 | #define MX51_DEBUG_BASE_ADDR_VIRT 0xFA200000 | 116 | #define MX51_PLL2_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x84000) |
62 | #define MX51_DEBUG_SIZE SZ_1M | 117 | #define MX51_PLL3_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x88000) |
63 | #define MX51_ETB_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00001000) | 118 | #define MX51_AHBMAX_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x94000) |
64 | #define MX51_ETM_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00002000) | 119 | #define MX51_IIM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x98000) |
65 | #define MX51_TPIU_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00003000) | 120 | #define MX51_CSU_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x9c000) |
66 | #define MX51_CTI0_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00004000) | 121 | #define MX51_ARM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xa0000) |
67 | #define MX51_CTI1_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00005000) | 122 | #define MX51_OWIRE_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xa4000) |
68 | #define MX51_CTI2_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00006000) | 123 | #define MX51_FIRI_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xa8000) |
69 | #define MX51_CTI3_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00007000) | 124 | #define MX51_ECSPI2_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xac000) |
70 | #define MX51_CORTEX_DBG_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00008000) | 125 | #define MX51_SDMA_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xb0000) |
126 | #define MX51_SCC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xb4000) | ||
127 | #define MX51_ROMCP_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xb8000) | ||
128 | #define MX51_RTIC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xbc000) | ||
129 | #define MX51_CSPI_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xc0000) | ||
130 | #define MX51_I2C2_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xc4000) | ||
131 | #define MX51_I2C1_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xc8000) | ||
132 | #define MX51_SSI1_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xcc000) | ||
133 | #define MX51_AUDMUX_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xd0000) | ||
134 | #define MX51_M4IF_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xd8000) | ||
135 | #define MX51_ESDCTL_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xd9000) | ||
136 | #define MX51_WEIM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xda000) | ||
137 | #define MX51_NFC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xdb000) | ||
138 | #define MX51_EMI_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xdbf00) | ||
139 | #define MX51_MIPI_HSC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xdc000) | ||
140 | #define MX51_ATA_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xe0000) | ||
141 | #define MX51_SIM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xe4000) | ||
142 | #define MX51_SSI3BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xe8000) | ||
143 | #define MX51_FEC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xec000) | ||
144 | #define MX51_TVE_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xf0000) | ||
145 | #define MX51_VPU_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xf4000) | ||
146 | #define MX51_SAHARA_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xf8000) | ||
147 | |||
148 | #define MX51_CSD0_BASE_ADDR 0x90000000 | ||
149 | #define MX51_CSD1_BASE_ADDR 0xa0000000 | ||
150 | #define MX51_CS0_BASE_ADDR 0xb0000000 | ||
151 | #define MX51_CS1_BASE_ADDR 0xb8000000 | ||
152 | #define MX51_CS2_BASE_ADDR 0xc0000000 | ||
153 | #define MX51_CS3_BASE_ADDR 0xc8000000 | ||
154 | #define MX51_CS4_BASE_ADDR 0xcc000000 | ||
155 | #define MX51_CS5_BASE_ADDR 0xce000000 | ||
71 | 156 | ||
72 | /* | 157 | /* |
73 | * SPBA global module enabled #0 | 158 | * NFC |
74 | */ | 159 | */ |
75 | #define MX51_SPBA0_BASE_ADDR 0x70000000 | 160 | #define MX51_NFC_AXI_BASE_ADDR 0xcfff0000 /* NAND flash AXI */ |
76 | #define MX51_SPBA0_BASE_ADDR_VIRT 0xFB100000 | 161 | #define MX51_NFC_AXI_SIZE SZ_64K |
77 | #define MX51_SPBA0_SIZE SZ_1M | 162 | |
163 | #define MX51_GPU2D_BASE_ADDR 0xd0000000 | ||
164 | #define MX51_TZIC_BASE_ADDR 0xe0000000 | ||
78 | 165 | ||
79 | #define MX51_MMC_SDHC1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00004000) | 166 | #define MX51_IO_ADDRESS(x) ( \ |
80 | #define MX51_MMC_SDHC2_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00008000) | 167 | IMX_IO_ADDRESS(x, MX51_IRAM) ?: \ |
81 | #define MX51_UART3_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x0000C000) | 168 | IMX_IO_ADDRESS(x, MX51_DEBUG) ?: \ |
82 | #define MX51_CSPI1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00010000) | 169 | IMX_IO_ADDRESS(x, MX51_SPBA0) ?: \ |
83 | #define MX51_SSI2_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00014000) | 170 | IMX_IO_ADDRESS(x, MX51_AIPS1) ?: \ |
84 | #define MX51_MMC_SDHC3_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00020000) | 171 | IMX_IO_ADDRESS(x, MX51_AIPS2)) |
85 | #define MX51_MMC_SDHC4_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00024000) | 172 | |
86 | #define MX51_SPDIF_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00028000) | 173 | /* This is currently used in <mach/debug-macro.S>, but should go away */ |
87 | #define MX51_ATA_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00030000) | 174 | #define MX51_AIPS1_IO_ADDRESS(x) \ |
88 | #define MX51_SLIM_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00034000) | 175 | (((x) - MX51_AIPS1_BASE_ADDR) + MX51_AIPS1_BASE_ADDR_VIRT) |
89 | #define MX51_HSI2C_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00038000) | ||
90 | #define MX51_SPBA_CTRL_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x0003C000) | ||
91 | 176 | ||
92 | /* | 177 | /* |
93 | * defines for SPBA modules | 178 | * defines for SPBA modules |
94 | */ | 179 | */ |
95 | #define MX51_SPBA_SDHC1 0x04 | 180 | #define MX51_SPBA_SDHC1 0x04 |
96 | #define MX51_SPBA_SDHC2 0x08 | 181 | #define MX51_SPBA_SDHC2 0x08 |
97 | #define MX51_SPBA_UART3 0x0C | 182 | #define MX51_SPBA_UART3 0x0c |
98 | #define MX51_SPBA_CSPI1 0x10 | 183 | #define MX51_SPBA_CSPI1 0x10 |
99 | #define MX51_SPBA_SSI2 0x14 | 184 | #define MX51_SPBA_SSI2 0x14 |
100 | #define MX51_SPBA_SDHC3 0x20 | 185 | #define MX51_SPBA_SDHC3 0x20 |
@@ -103,35 +188,7 @@ | |||
103 | #define MX51_SPBA_ATA 0x30 | 188 | #define MX51_SPBA_ATA 0x30 |
104 | #define MX51_SPBA_SLIM 0x34 | 189 | #define MX51_SPBA_SLIM 0x34 |
105 | #define MX51_SPBA_HSI2C 0x38 | 190 | #define MX51_SPBA_HSI2C 0x38 |
106 | #define MX51_SPBA_CTRL 0x3C | 191 | #define MX51_SPBA_CTRL 0x3c |
107 | |||
108 | /* | ||
109 | * AIPS 1 | ||
110 | */ | ||
111 | #define MX51_AIPS1_BASE_ADDR 0x73F00000 | ||
112 | #define MX51_AIPS1_BASE_ADDR_VIRT 0xFB000000 | ||
113 | #define MX51_AIPS1_SIZE SZ_1M | ||
114 | |||
115 | #define MX51_OTG_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00080000) | ||
116 | #define MX51_GPIO1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00084000) | ||
117 | #define MX51_GPIO2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00088000) | ||
118 | #define MX51_GPIO3_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x0008C000) | ||
119 | #define MX51_GPIO4_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00090000) | ||
120 | #define MX51_KPP_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00094000) | ||
121 | #define MX51_WDOG_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00098000) | ||
122 | #define MX51_WDOG2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x0009C000) | ||
123 | #define MX51_GPT1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000A0000) | ||
124 | #define MX51_SRTC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000A4000) | ||
125 | #define MX51_IOMUXC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000A8000) | ||
126 | #define MX51_EPIT1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000AC000) | ||
127 | #define MX51_EPIT2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000B0000) | ||
128 | #define MX51_PWM1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000B4000) | ||
129 | #define MX51_PWM2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000B8000) | ||
130 | #define MX51_UART1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000BC000) | ||
131 | #define MX51_UART2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000C0000) | ||
132 | #define MX51_SRC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000D0000) | ||
133 | #define MX51_CCM_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000D4000) | ||
134 | #define MX51_GPC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000D8000) | ||
135 | 192 | ||
136 | /* | 193 | /* |
137 | * Defines for modules using static and dynamic DMA channels | 194 | * Defines for modules using static and dynamic DMA channels |
@@ -164,282 +221,186 @@ | |||
164 | #define MX51_MXC_DMA_CHANNEL_ATA_TX MXC_DMA_DYNAMIC_CHANNEL | 221 | #define MX51_MXC_DMA_CHANNEL_ATA_TX MXC_DMA_DYNAMIC_CHANNEL |
165 | #define MX51_MXC_DMA_CHANNEL_MEMORY MXC_DMA_DYNAMIC_CHANNEL | 222 | #define MX51_MXC_DMA_CHANNEL_MEMORY MXC_DMA_DYNAMIC_CHANNEL |
166 | 223 | ||
167 | /* | ||
168 | * AIPS 2 | ||
169 | */ | ||
170 | #define MX51_AIPS2_BASE_ADDR 0x83F00000 | ||
171 | #define MX51_AIPS2_BASE_ADDR_VIRT 0xFB200000 | ||
172 | #define MX51_AIPS2_SIZE SZ_1M | ||
173 | |||
174 | #define MX51_PLL1_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x00080000) | ||
175 | #define MX51_PLL2_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x00084000) | ||
176 | #define MX51_PLL3_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x00088000) | ||
177 | #define MX51_AHBMAX_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x00094000) | ||
178 | #define MX51_IIM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x00098000) | ||
179 | #define MX51_CSU_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x0009C000) | ||
180 | #define MX51_ARM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000A0000) | ||
181 | #define MX51_OWIRE_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000A4000) | ||
182 | #define MX51_FIRI_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000A8000) | ||
183 | #define MX51_CSPI2_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000AC000) | ||
184 | #define MX51_SDMA_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000B0000) | ||
185 | #define MX51_SCC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000B4000) | ||
186 | #define MX51_ROMCP_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000B8000) | ||
187 | #define MX51_RTIC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000BC000) | ||
188 | #define MX51_CSPI3_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000C0000) | ||
189 | #define MX51_I2C2_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000C4000) | ||
190 | #define MX51_I2C1_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000C8000) | ||
191 | #define MX51_SSI1_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000CC000) | ||
192 | #define MX51_AUDMUX_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000D0000) | ||
193 | #define MX51_M4IF_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000D8000) | ||
194 | #define MX51_ESDCTL_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000D9000) | ||
195 | #define MX51_WEIM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000DA000) | ||
196 | #define MX51_NFC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000DB000) | ||
197 | #define MX51_EMI_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000DBF00) | ||
198 | #define MX51_MIPI_HSC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000DC000) | ||
199 | #define MX51_ATA_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000E0000) | ||
200 | #define MX51_SIM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000E4000) | ||
201 | #define MX51_SSI3BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000E8000) | ||
202 | #define MX51_MXC_FEC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000EC000) | ||
203 | #define MX51_TVE_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000F0000) | ||
204 | #define MX51_VPU_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000F4000) | ||
205 | #define MX51_SAHARA_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000F8000) | ||
206 | |||
207 | /* | ||
208 | * Memory regions and CS | ||
209 | */ | ||
210 | #define MX51_GPU_CTRL_BASE_ADDR 0x30000000 | ||
211 | #define MX51_IPU_CTRL_BASE_ADDR 0x40000000 | ||
212 | #define MX51_CSD0_BASE_ADDR 0x90000000 | ||
213 | #define MX51_CSD1_BASE_ADDR 0xA0000000 | ||
214 | #define MX51_CS0_BASE_ADDR 0xB0000000 | ||
215 | #define MX51_CS1_BASE_ADDR 0xB8000000 | ||
216 | #define MX51_CS2_BASE_ADDR 0xC0000000 | ||
217 | #define MX51_CS3_BASE_ADDR 0xC8000000 | ||
218 | #define MX51_CS4_BASE_ADDR 0xCC000000 | ||
219 | #define MX51_CS5_BASE_ADDR 0xCE000000 | ||
220 | |||
221 | /* Does given address belongs to the specified memory region? */ | ||
222 | #define ADDRESS_IN_REGION(addr, start, size) \ | ||
223 | (((addr) >= (start)) && ((addr) < (start)+(size))) | ||
224 | |||
225 | /* Does given address belongs to the specified named `module'? */ | ||
226 | #define MX51_IS_MODULE(addr, module) \ | ||
227 | ADDRESS_IN_REGION(addr, MX51_ ## module ## _BASE_ADDR, \ | ||
228 | MX51_ ## module ## _SIZE) | ||
229 | /* | ||
230 | * This macro defines the physical to virtual address mapping for all the | ||
231 | * peripheral modules. It is used by passing in the physical address as x | ||
232 | * and returning the virtual address. If the physical address is not mapped, | ||
233 | * it returns 0xDEADBEEF | ||
234 | */ | ||
235 | |||
236 | #define MX51_IO_ADDRESS(x) \ | ||
237 | (void __iomem *) \ | ||
238 | (MX51_IS_MODULE(x, IRAM) ? MX51_IRAM_IO_ADDRESS(x) : \ | ||
239 | MX51_IS_MODULE(x, DEBUG) ? MX51_DEBUG_IO_ADDRESS(x) : \ | ||
240 | MX51_IS_MODULE(x, SPBA0) ? MX51_SPBA0_IO_ADDRESS(x) : \ | ||
241 | MX51_IS_MODULE(x, AIPS1) ? MX51_AIPS1_IO_ADDRESS(x) : \ | ||
242 | MX51_IS_MODULE(x, AIPS2) ? MX51_AIPS2_IO_ADDRESS(x) : \ | ||
243 | 0xDEADBEEF) | ||
244 | |||
245 | /* | ||
246 | * define the address mapping macros: in physical address order | ||
247 | */ | ||
248 | #define MX51_IRAM_IO_ADDRESS(x) \ | ||
249 | (((x) - MX51_IRAM_BASE_ADDR) + MX51_IRAM_BASE_ADDR_VIRT) | ||
250 | |||
251 | #define MX51_DEBUG_IO_ADDRESS(x) \ | ||
252 | (((x) - MX51_DEBUG_BASE_ADDR) + MX51_DEBUG_BASE_ADDR_VIRT) | ||
253 | |||
254 | #define MX51_SPBA0_IO_ADDRESS(x) \ | ||
255 | (((x) - MX51_SPBA0_BASE_ADDR) + MX51_SPBA0_BASE_ADDR_VIRT) | ||
256 | |||
257 | #define MX51_AIPS1_IO_ADDRESS(x) \ | ||
258 | (((x) - MX51_AIPS1_BASE_ADDR) + MX51_AIPS1_BASE_ADDR_VIRT) | ||
259 | |||
260 | #define MX51_AIPS2_IO_ADDRESS(x) \ | ||
261 | (((x) - MX51_AIPS2_BASE_ADDR) + MX51_AIPS2_BASE_ADDR_VIRT) | ||
262 | |||
263 | #define MX51_IS_MEM_DEVICE_NONSHARED(x) 0 | 224 | #define MX51_IS_MEM_DEVICE_NONSHARED(x) 0 |
264 | 225 | ||
265 | /* | 226 | /* |
266 | * DMA request assignments | 227 | * DMA request assignments |
267 | */ | 228 | */ |
268 | #define MX51_DMA_REQ_SSI3_TX1 47 | 229 | #define MX51_DMA_REQ_VPU 0 |
269 | #define MX51_DMA_REQ_SSI3_RX1 46 | 230 | #define MX51_DMA_REQ_GPC 1 |
270 | #define MX51_DMA_REQ_SPDIF 45 | 231 | #define MX51_DMA_REQ_ATA_RX 2 |
271 | #define MX51_DMA_REQ_UART3_TX 44 | 232 | #define MX51_DMA_REQ_ATA_TX 3 |
272 | #define MX51_DMA_REQ_UART3_RX 43 | 233 | #define MX51_DMA_REQ_ATA_TX_END 4 |
273 | #define MX51_DMA_REQ_SLIM_B_TX 42 | 234 | #define MX51_DMA_REQ_SLIM_B 5 |
274 | #define MX51_DMA_REQ_SDHC4 41 | 235 | #define MX51_DMA_REQ_CSPI1_RX 6 |
275 | #define MX51_DMA_REQ_SDHC3 40 | 236 | #define MX51_DMA_REQ_CSPI1_TX 7 |
276 | #define MX51_DMA_REQ_CSPI_TX 39 | 237 | #define MX51_DMA_REQ_CSPI2_RX 8 |
277 | #define MX51_DMA_REQ_CSPI_RX 38 | 238 | #define MX51_DMA_REQ_CSPI2_TX 9 |
278 | #define MX51_DMA_REQ_SSI3_TX2 37 | 239 | #define MX51_DMA_REQ_HS_I2C_TX 10 |
279 | #define MX51_DMA_REQ_IPU 36 | 240 | #define MX51_DMA_REQ_HS_I2C_RX 11 |
280 | #define MX51_DMA_REQ_SSI3_RX2 35 | 241 | #define MX51_DMA_REQ_FIRI_RX 12 |
281 | #define MX51_DMA_REQ_EPIT2 34 | 242 | #define MX51_DMA_REQ_FIRI_TX 13 |
282 | #define MX51_DMA_REQ_CTI2_1 33 | 243 | #define MX51_DMA_REQ_EXTREQ1 14 |
283 | #define MX51_DMA_REQ_EMI_WR 32 | 244 | #define MX51_DMA_REQ_GPU 15 |
284 | #define MX51_DMA_REQ_CTI2_0 31 | 245 | #define MX51_DMA_REQ_UART2_RX 16 |
285 | #define MX51_DMA_REQ_EMI_RD 30 | 246 | #define MX51_DMA_REQ_UART2_TX 17 |
286 | #define MX51_DMA_REQ_SSI1_TX1 29 | 247 | #define MX51_DMA_REQ_UART1_RX 18 |
287 | #define MX51_DMA_REQ_SSI1_RX1 28 | 248 | #define MX51_DMA_REQ_UART1_TX 19 |
288 | #define MX51_DMA_REQ_SSI1_TX2 27 | 249 | #define MX51_DMA_REQ_SDHC1 20 |
289 | #define MX51_DMA_REQ_SSI1_RX2 26 | 250 | #define MX51_DMA_REQ_SDHC2 21 |
290 | #define MX51_DMA_REQ_SSI2_TX1 25 | 251 | #define MX51_DMA_REQ_SSI2_RX1 22 |
291 | #define MX51_DMA_REQ_SSI2_RX1 24 | 252 | #define MX51_DMA_REQ_SSI2_TX1 23 |
292 | #define MX51_DMA_REQ_SSI2_TX2 23 | 253 | #define MX51_DMA_REQ_SSI2_RX0 24 |
293 | #define MX51_DMA_REQ_SSI2_RX2 22 | 254 | #define MX51_DMA_REQ_SSI2_TX0 25 |
294 | #define MX51_DMA_REQ_SDHC2 21 | 255 | #define MX51_DMA_REQ_SSI1_RX1 26 |
295 | #define MX51_DMA_REQ_SDHC1 20 | 256 | #define MX51_DMA_REQ_SSI1_TX1 27 |
296 | #define MX51_DMA_REQ_UART1_TX 19 | 257 | #define MX51_DMA_REQ_SSI1_RX0 28 |
297 | #define MX51_DMA_REQ_UART1_RX 18 | 258 | #define MX51_DMA_REQ_SSI1_TX0 29 |
298 | #define MX51_DMA_REQ_UART2_TX 17 | 259 | #define MX51_DMA_REQ_EMI_RD 30 |
299 | #define MX51_DMA_REQ_UART2_RX 16 | 260 | #define MX51_DMA_REQ_CTI2_0 31 |
300 | #define MX51_DMA_REQ_GPU 15 | 261 | #define MX51_DMA_REQ_EMI_WR 32 |
301 | #define MX51_DMA_REQ_EXTREQ1 14 | 262 | #define MX51_DMA_REQ_CTI2_1 33 |
302 | #define MX51_DMA_REQ_FIRI_TX 13 | 263 | #define MX51_DMA_REQ_EPIT2 34 |
303 | #define MX51_DMA_REQ_FIRI_RX 12 | 264 | #define MX51_DMA_REQ_SSI3_RX2 35 |
304 | #define MX51_DMA_REQ_HS_I2C_RX 11 | 265 | #define MX51_DMA_REQ_IPU 36 |
305 | #define MX51_DMA_REQ_HS_I2C_TX 10 | 266 | #define MX51_DMA_REQ_SSI3_TX2 37 |
306 | #define MX51_DMA_REQ_CSPI2_TX 9 | 267 | #define MX51_DMA_REQ_CSPI_RX 38 |
307 | #define MX51_DMA_REQ_CSPI2_RX 8 | 268 | #define MX51_DMA_REQ_CSPI_TX 39 |
308 | #define MX51_DMA_REQ_CSPI1_TX 7 | 269 | #define MX51_DMA_REQ_SDHC3 40 |
309 | #define MX51_DMA_REQ_CSPI1_RX 6 | 270 | #define MX51_DMA_REQ_SDHC4 41 |
310 | #define MX51_DMA_REQ_SLIM_B 5 | 271 | #define MX51_DMA_REQ_SLIM_B_TX 42 |
311 | #define MX51_DMA_REQ_ATA_TX_END 4 | 272 | #define MX51_DMA_REQ_UART3_RX 43 |
312 | #define MX51_DMA_REQ_ATA_TX 3 | 273 | #define MX51_DMA_REQ_UART3_TX 44 |
313 | #define MX51_DMA_REQ_ATA_RX 2 | 274 | #define MX51_DMA_REQ_SPDIF 45 |
314 | #define MX51_DMA_REQ_GPC 1 | 275 | #define MX51_DMA_REQ_SSI3_RX1 46 |
315 | #define MX51_DMA_REQ_VPU 0 | 276 | #define MX51_DMA_REQ_SSI3_TX1 47 |
316 | 277 | ||
317 | /* | 278 | /* |
318 | * Interrupt numbers | 279 | * Interrupt numbers |
319 | */ | 280 | */ |
320 | #define MX51_MXC_INT_BASE 0 | 281 | #define MX51_MXC_INT_BASE 0 |
321 | #define MX51_MXC_INT_RESV0 0 | 282 | #define MX51_MXC_INT_RESV0 0 |
322 | #define MX51_MXC_INT_MMC_SDHC1 1 | 283 | #define MX51_MXC_INT_MMC_SDHC1 1 |
323 | #define MX51_MXC_INT_MMC_SDHC2 2 | 284 | #define MX51_MXC_INT_MMC_SDHC2 2 |
324 | #define MX51_MXC_INT_MMC_SDHC3 3 | 285 | #define MX51_MXC_INT_MMC_SDHC3 3 |
325 | #define MX51_MXC_INT_MMC_SDHC4 4 | 286 | #define MX51_MXC_INT_MMC_SDHC4 4 |
326 | #define MX51_MXC_INT_RESV5 5 | 287 | #define MX51_MXC_INT_RESV5 5 |
327 | #define MX51_MXC_INT_SDMA 6 | 288 | #define MX51_INT_SDMA 6 |
328 | #define MX51_MXC_INT_IOMUX 7 | 289 | #define MX51_MXC_INT_IOMUX 7 |
329 | #define MX51_MXC_INT_NFC 8 | 290 | #define MX51_INT_NFC 8 |
330 | #define MX51_MXC_INT_VPU 9 | 291 | #define MX51_MXC_INT_VPU 9 |
331 | #define MX51_MXC_INT_IPU_ERR 10 | 292 | #define MX51_MXC_INT_IPU_ERR 10 |
332 | #define MX51_MXC_INT_IPU_SYN 11 | 293 | #define MX51_MXC_INT_IPU_SYN 11 |
333 | #define MX51_MXC_INT_GPU 12 | 294 | #define MX51_MXC_INT_GPU 12 |
334 | #define MX51_MXC_INT_RESV13 13 | 295 | #define MX51_MXC_INT_RESV13 13 |
335 | #define MX51_MXC_INT_USB_H1 14 | 296 | #define MX51_MXC_INT_USB_H1 14 |
336 | #define MX51_MXC_INT_EMI 15 | 297 | #define MX51_MXC_INT_EMI 15 |
337 | #define MX51_MXC_INT_USB_H2 16 | 298 | #define MX51_MXC_INT_USB_H2 16 |
338 | #define MX51_MXC_INT_USB_H3 17 | 299 | #define MX51_MXC_INT_USB_H3 17 |
339 | #define MX51_MXC_INT_USB_OTG 18 | 300 | #define MX51_MXC_INT_USB_OTG 18 |
340 | #define MX51_MXC_INT_SAHARA_H0 19 | 301 | #define MX51_MXC_INT_SAHARA_H0 19 |
341 | #define MX51_MXC_INT_SAHARA_H1 20 | 302 | #define MX51_MXC_INT_SAHARA_H1 20 |
342 | #define MX51_MXC_INT_SCC_SMN 21 | 303 | #define MX51_MXC_INT_SCC_SMN 21 |
343 | #define MX51_MXC_INT_SCC_STZ 22 | 304 | #define MX51_MXC_INT_SCC_STZ 22 |
344 | #define MX51_MXC_INT_SCC_SCM 23 | 305 | #define MX51_MXC_INT_SCC_SCM 23 |
345 | #define MX51_MXC_INT_SRTC_NTZ 24 | 306 | #define MX51_MXC_INT_SRTC_NTZ 24 |
346 | #define MX51_MXC_INT_SRTC_TZ 25 | 307 | #define MX51_MXC_INT_SRTC_TZ 25 |
347 | #define MX51_MXC_INT_RTIC 26 | 308 | #define MX51_MXC_INT_RTIC 26 |
348 | #define MX51_MXC_INT_CSU 27 | 309 | #define MX51_MXC_INT_CSU 27 |
349 | #define MX51_MXC_INT_SLIM_B 28 | 310 | #define MX51_MXC_INT_SLIM_B 28 |
350 | #define MX51_MXC_INT_SSI1 29 | 311 | #define MX51_INT_SSI1 29 |
351 | #define MX51_MXC_INT_SSI2 30 | 312 | #define MX51_INT_SSI2 30 |
352 | #define MX51_MXC_INT_UART1 31 | 313 | #define MX51_INT_UART1 31 |
353 | #define MX51_MXC_INT_UART2 32 | 314 | #define MX51_INT_UART2 32 |
354 | #define MX51_MXC_INT_UART3 33 | 315 | #define MX51_INT_UART3 33 |
355 | #define MX51_MXC_INT_RESV34 34 | 316 | #define MX51_MXC_INT_RESV34 34 |
356 | #define MX51_MXC_INT_RESV35 35 | 317 | #define MX51_MXC_INT_RESV35 35 |
357 | #define MX51_MXC_INT_CSPI1 36 | 318 | #define MX51_INT_ECSPI1 36 |
358 | #define MX51_MXC_INT_CSPI2 37 | 319 | #define MX51_INT_ECSPI2 37 |
359 | #define MX51_MXC_INT_CSPI 38 | 320 | #define MX51_INT_CSPI 38 |
360 | #define MX51_MXC_INT_GPT 39 | 321 | #define MX51_MXC_INT_GPT 39 |
361 | #define MX51_MXC_INT_EPIT1 40 | 322 | #define MX51_MXC_INT_EPIT1 40 |
362 | #define MX51_MXC_INT_EPIT2 41 | 323 | #define MX51_MXC_INT_EPIT2 41 |
363 | #define MX51_MXC_INT_GPIO1_INT7 42 | 324 | #define MX51_MXC_INT_GPIO1_INT7 42 |
364 | #define MX51_MXC_INT_GPIO1_INT6 43 | 325 | #define MX51_MXC_INT_GPIO1_INT6 43 |
365 | #define MX51_MXC_INT_GPIO1_INT5 44 | 326 | #define MX51_MXC_INT_GPIO1_INT5 44 |
366 | #define MX51_MXC_INT_GPIO1_INT4 45 | 327 | #define MX51_MXC_INT_GPIO1_INT4 45 |
367 | #define MX51_MXC_INT_GPIO1_INT3 46 | 328 | #define MX51_MXC_INT_GPIO1_INT3 46 |
368 | #define MX51_MXC_INT_GPIO1_INT2 47 | 329 | #define MX51_MXC_INT_GPIO1_INT2 47 |
369 | #define MX51_MXC_INT_GPIO1_INT1 48 | 330 | #define MX51_MXC_INT_GPIO1_INT1 48 |
370 | #define MX51_MXC_INT_GPIO1_INT0 49 | 331 | #define MX51_MXC_INT_GPIO1_INT0 49 |
371 | #define MX51_MXC_INT_GPIO1_LOW 50 | 332 | #define MX51_MXC_INT_GPIO1_LOW 50 |
372 | #define MX51_MXC_INT_GPIO1_HIGH 51 | 333 | #define MX51_MXC_INT_GPIO1_HIGH 51 |
373 | #define MX51_MXC_INT_GPIO2_LOW 52 | 334 | #define MX51_MXC_INT_GPIO2_LOW 52 |
374 | #define MX51_MXC_INT_GPIO2_HIGH 53 | 335 | #define MX51_MXC_INT_GPIO2_HIGH 53 |
375 | #define MX51_MXC_INT_GPIO3_LOW 54 | 336 | #define MX51_MXC_INT_GPIO3_LOW 54 |
376 | #define MX51_MXC_INT_GPIO3_HIGH 55 | 337 | #define MX51_MXC_INT_GPIO3_HIGH 55 |
377 | #define MX51_MXC_INT_GPIO4_LOW 56 | 338 | #define MX51_MXC_INT_GPIO4_LOW 56 |
378 | #define MX51_MXC_INT_GPIO4_HIGH 57 | 339 | #define MX51_MXC_INT_GPIO4_HIGH 57 |
379 | #define MX51_MXC_INT_WDOG1 58 | 340 | #define MX51_MXC_INT_WDOG1 58 |
380 | #define MX51_MXC_INT_WDOG2 59 | 341 | #define MX51_MXC_INT_WDOG2 59 |
381 | #define MX51_MXC_INT_KPP 60 | 342 | #define MX51_MXC_INT_KPP 60 |
382 | #define MX51_MXC_INT_PWM1 61 | 343 | #define MX51_MXC_INT_PWM1 61 |
383 | #define MX51_MXC_INT_I2C1 62 | 344 | #define MX51_INT_I2C1 62 |
384 | #define MX51_MXC_INT_I2C2 63 | 345 | #define MX51_INT_I2C2 63 |
385 | #define MX51_MXC_INT_HS_I2C 64 | 346 | #define MX51_MXC_INT_HS_I2C 64 |
386 | #define MX51_MXC_INT_RESV65 65 | 347 | #define MX51_MXC_INT_RESV65 65 |
387 | #define MX51_MXC_INT_RESV66 66 | 348 | #define MX51_MXC_INT_RESV66 66 |
388 | #define MX51_MXC_INT_SIM_IPB 67 | 349 | #define MX51_MXC_INT_SIM_IPB 67 |
389 | #define MX51_MXC_INT_SIM_DAT 68 | 350 | #define MX51_MXC_INT_SIM_DAT 68 |
390 | #define MX51_MXC_INT_IIM 69 | 351 | #define MX51_MXC_INT_IIM 69 |
391 | #define MX51_MXC_INT_ATA 70 | 352 | #define MX51_MXC_INT_ATA 70 |
392 | #define MX51_MXC_INT_CCM1 71 | 353 | #define MX51_MXC_INT_CCM1 71 |
393 | #define MX51_MXC_INT_CCM2 72 | 354 | #define MX51_MXC_INT_CCM2 72 |
394 | #define MX51_MXC_INT_GPC1 73 | 355 | #define MX51_MXC_INT_GPC1 73 |
395 | #define MX51_MXC_INT_GPC2 74 | 356 | #define MX51_MXC_INT_GPC2 74 |
396 | #define MX51_MXC_INT_SRC 75 | 357 | #define MX51_MXC_INT_SRC 75 |
397 | #define MX51_MXC_INT_NM 76 | 358 | #define MX51_MXC_INT_NM 76 |
398 | #define MX51_MXC_INT_PMU 77 | 359 | #define MX51_MXC_INT_PMU 77 |
399 | #define MX51_MXC_INT_CTI_IRQ 78 | 360 | #define MX51_MXC_INT_CTI_IRQ 78 |
400 | #define MX51_MXC_INT_CTI1_TG0 79 | 361 | #define MX51_MXC_INT_CTI1_TG0 79 |
401 | #define MX51_MXC_INT_CTI1_TG1 80 | 362 | #define MX51_MXC_INT_CTI1_TG1 80 |
402 | #define MX51_MXC_INT_MCG_ERR 81 | 363 | #define MX51_MXC_INT_MCG_ERR 81 |
403 | #define MX51_MXC_INT_MCG_TMR 82 | 364 | #define MX51_MXC_INT_MCG_TMR 82 |
404 | #define MX51_MXC_INT_MCG_FUNC 83 | 365 | #define MX51_MXC_INT_MCG_FUNC 83 |
405 | #define MX51_MXC_INT_GPU2_IRQ 84 | 366 | #define MX51_MXC_INT_GPU2_IRQ 84 |
406 | #define MX51_MXC_INT_GPU2_BUSY 85 | 367 | #define MX51_MXC_INT_GPU2_BUSY 85 |
407 | #define MX51_MXC_INT_RESV86 86 | 368 | #define MX51_MXC_INT_RESV86 86 |
408 | #define MX51_MXC_INT_FEC 87 | 369 | #define MX51_INT_FEC 87 |
409 | #define MX51_MXC_INT_OWIRE 88 | 370 | #define MX51_MXC_INT_OWIRE 88 |
410 | #define MX51_MXC_INT_CTI1_TG2 89 | 371 | #define MX51_MXC_INT_CTI1_TG2 89 |
411 | #define MX51_MXC_INT_SJC 90 | 372 | #define MX51_MXC_INT_SJC 90 |
412 | #define MX51_MXC_INT_SPDIF 91 | 373 | #define MX51_MXC_INT_SPDIF 91 |
413 | #define MX51_MXC_INT_TVE 92 | 374 | #define MX51_MXC_INT_TVE 92 |
414 | #define MX51_MXC_INT_FIRI 93 | 375 | #define MX51_MXC_INT_FIRI 93 |
415 | #define MX51_MXC_INT_PWM2 94 | 376 | #define MX51_MXC_INT_PWM2 94 |
416 | #define MX51_MXC_INT_SLIM_EXP 95 | 377 | #define MX51_MXC_INT_SLIM_EXP 95 |
417 | #define MX51_MXC_INT_SSI3 96 | 378 | #define MX51_MXC_INT_SSI3 96 |
418 | #define MX51_MXC_INT_EMI_BOOT 97 | 379 | #define MX51_MXC_INT_EMI_BOOT 97 |
419 | #define MX51_MXC_INT_CTI1_TG3 98 | 380 | #define MX51_MXC_INT_CTI1_TG3 98 |
420 | #define MX51_MXC_INT_SMC_RX 99 | 381 | #define MX51_MXC_INT_SMC_RX 99 |
421 | #define MX51_MXC_INT_VPU_IDLE 100 | 382 | #define MX51_MXC_INT_VPU_IDLE 100 |
422 | #define MX51_MXC_INT_EMI_NFC 101 | 383 | #define MX51_MXC_INT_EMI_NFC 101 |
423 | #define MX51_MXC_INT_GPU_IDLE 102 | 384 | #define MX51_MXC_INT_GPU_IDLE 102 |
424 | 385 | ||
425 | /* silicon revisions specific to i.MX51 */ | 386 | /* silicon revisions specific to i.MX51 */ |
426 | #define MX51_CHIP_REV_1_0 0x10 | 387 | #define MX51_CHIP_REV_1_0 0x10 |
427 | #define MX51_CHIP_REV_1_1 0x11 | 388 | #define MX51_CHIP_REV_1_1 0x11 |
428 | #define MX51_CHIP_REV_1_2 0x12 | 389 | #define MX51_CHIP_REV_1_2 0x12 |
429 | #define MX51_CHIP_REV_1_3 0x13 | 390 | #define MX51_CHIP_REV_1_3 0x13 |
430 | #define MX51_CHIP_REV_2_0 0x20 | 391 | #define MX51_CHIP_REV_2_0 0x20 |
431 | #define MX51_CHIP_REV_2_1 0x21 | 392 | #define MX51_CHIP_REV_2_1 0x21 |
432 | #define MX51_CHIP_REV_2_2 0x22 | 393 | #define MX51_CHIP_REV_2_2 0x22 |
433 | #define MX51_CHIP_REV_2_3 0x23 | 394 | #define MX51_CHIP_REV_2_3 0x23 |
434 | #define MX51_CHIP_REV_3_0 0x30 | 395 | #define MX51_CHIP_REV_3_0 0x30 |
435 | #define MX51_CHIP_REV_3_1 0x31 | 396 | #define MX51_CHIP_REV_3_1 0x31 |
436 | #define MX51_CHIP_REV_3_2 0x32 | 397 | #define MX51_CHIP_REV_3_2 0x32 |
437 | |||
438 | /* Mandatory defines used globally */ | ||
439 | 398 | ||
440 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) | 399 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) |
441 | |||
442 | extern int mx51_revision(void); | 400 | extern int mx51_revision(void); |
443 | #endif | 401 | #endif |
444 | 402 | ||
445 | #endif /* __ASM_ARCH_MXC_MX51_H__ */ | 403 | /* tape-out 1 defines */ |
404 | #define MX51_TZIC_BASE_ADDR_TO1 0x8fffc000 | ||
405 | |||
406 | #endif /* ifndef __MACH_MX51_H__ */ | ||
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index ea3ca86c5283..aedf9c1d645e 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-nomadik/timer.c | 2 | * linux/arch/arm/plat-nomadik/timer.c |
3 | * | 3 | * |
4 | * Copyright (C) 2008 STMicroelectronics | 4 | * Copyright (C) 2008 STMicroelectronics |
5 | * Copyright (C) 2010 Alessandro Rubini | 5 | * Copyright (C) 2010 Alessandro Rubini |
@@ -75,7 +75,7 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode, | |||
75 | cr = readl(mtu_base + MTU_CR(1)); | 75 | cr = readl(mtu_base + MTU_CR(1)); |
76 | writel(0, mtu_base + MTU_LR(1)); | 76 | writel(0, mtu_base + MTU_LR(1)); |
77 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1)); | 77 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1)); |
78 | writel(0x2, mtu_base + MTU_IMSC); | 78 | writel(1 << 1, mtu_base + MTU_IMSC); |
79 | break; | 79 | break; |
80 | case CLOCK_EVT_MODE_SHUTDOWN: | 80 | case CLOCK_EVT_MODE_SHUTDOWN: |
81 | case CLOCK_EVT_MODE_UNUSED: | 81 | case CLOCK_EVT_MODE_UNUSED: |
@@ -131,25 +131,23 @@ void __init nmdk_timer_init(void) | |||
131 | { | 131 | { |
132 | unsigned long rate; | 132 | unsigned long rate; |
133 | struct clk *clk0; | 133 | struct clk *clk0; |
134 | struct clk *clk1; | 134 | u32 cr = MTU_CRn_32BITS; |
135 | u32 cr; | ||
136 | 135 | ||
137 | clk0 = clk_get_sys("mtu0", NULL); | 136 | clk0 = clk_get_sys("mtu0", NULL); |
138 | BUG_ON(IS_ERR(clk0)); | 137 | BUG_ON(IS_ERR(clk0)); |
139 | 138 | ||
140 | clk1 = clk_get_sys("mtu1", NULL); | ||
141 | BUG_ON(IS_ERR(clk1)); | ||
142 | |||
143 | clk_enable(clk0); | 139 | clk_enable(clk0); |
144 | clk_enable(clk1); | ||
145 | 140 | ||
146 | /* | 141 | /* |
147 | * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500: | 142 | * Tick rate is 2.4MHz for Nomadik and 2.4Mhz, 100MHz or 133 MHz |
148 | * use a divide-by-16 counter if it's more than 16MHz | 143 | * for ux500. |
144 | * Use a divide-by-16 counter if the tick rate is more than 32MHz. | ||
145 | * At 32 MHz, the timer (with 32 bit counter) can be programmed | ||
146 | * to wake-up at a max 127s a head in time. Dividing a 2.4 MHz timer | ||
147 | * with 16 gives too low timer resolution. | ||
149 | */ | 148 | */ |
150 | cr = MTU_CRn_32BITS;; | ||
151 | rate = clk_get_rate(clk0); | 149 | rate = clk_get_rate(clk0); |
152 | if (rate > 16 << 20) { | 150 | if (rate > 32000000) { |
153 | rate /= 16; | 151 | rate /= 16; |
154 | cr |= MTU_CRn_PRESCALE_16; | 152 | cr |= MTU_CRn_PRESCALE_16; |
155 | } else { | 153 | } else { |
@@ -170,15 +168,8 @@ void __init nmdk_timer_init(void) | |||
170 | pr_err("timer: failed to initialize clock source %s\n", | 168 | pr_err("timer: failed to initialize clock source %s\n", |
171 | nmdk_clksrc.name); | 169 | nmdk_clksrc.name); |
172 | 170 | ||
173 | /* Timer 1 is used for events, fix according to rate */ | 171 | /* Timer 1 is used for events */ |
174 | cr = MTU_CRn_32BITS; | 172 | |
175 | rate = clk_get_rate(clk1); | ||
176 | if (rate > 16 << 20) { | ||
177 | rate /= 16; | ||
178 | cr |= MTU_CRn_PRESCALE_16; | ||
179 | } else { | ||
180 | cr |= MTU_CRn_PRESCALE_1; | ||
181 | } | ||
182 | clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE); | 173 | clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE); |
183 | 174 | ||
184 | writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */ | 175 | writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */ |
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index e39a417a368d..a92cb499313f 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
@@ -33,7 +33,7 @@ config OMAP_DEBUG_DEVICES | |||
33 | config OMAP_DEBUG_LEDS | 33 | config OMAP_DEBUG_LEDS |
34 | bool | 34 | bool |
35 | depends on OMAP_DEBUG_DEVICES | 35 | depends on OMAP_DEBUG_DEVICES |
36 | default y if LEDS | 36 | default y if LEDS_CLASS |
37 | 37 | ||
38 | config OMAP_RESET_CLOCKS | 38 | config OMAP_RESET_CLOCKS |
39 | bool "Reset unused clocks during boot" | 39 | bool "Reset unused clocks during boot" |
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index e31496e35b0f..0c8612fd8312 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -156,7 +156,7 @@ static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id) | |||
156 | /* Writing zero to RSYNC_ERR clears the IRQ */ | 156 | /* Writing zero to RSYNC_ERR clears the IRQ */ |
157 | MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1)); | 157 | MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1)); |
158 | } else { | 158 | } else { |
159 | complete(&mcbsp_rx->tx_irq_completion); | 159 | complete(&mcbsp_rx->rx_irq_completion); |
160 | } | 160 | } |
161 | 161 | ||
162 | return IRQ_HANDLED; | 162 | return IRQ_HANDLED; |
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 226b2e858d6c..10b3b4c63372 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
@@ -220,20 +220,7 @@ void __init omap_map_sram(void) | |||
220 | if (omap_sram_size == 0) | 220 | if (omap_sram_size == 0) |
221 | return; | 221 | return; |
222 | 222 | ||
223 | if (cpu_is_omap24xx()) { | ||
224 | omap_sram_io_desc[0].virtual = OMAP2_SRAM_VA; | ||
225 | |||
226 | base = OMAP2_SRAM_PA; | ||
227 | base = ROUND_DOWN(base, PAGE_SIZE); | ||
228 | omap_sram_io_desc[0].pfn = __phys_to_pfn(base); | ||
229 | } | ||
230 | |||
231 | if (cpu_is_omap34xx()) { | 223 | if (cpu_is_omap34xx()) { |
232 | omap_sram_io_desc[0].virtual = OMAP3_SRAM_VA; | ||
233 | base = OMAP3_SRAM_PA; | ||
234 | base = ROUND_DOWN(base, PAGE_SIZE); | ||
235 | omap_sram_io_desc[0].pfn = __phys_to_pfn(base); | ||
236 | |||
237 | /* | 224 | /* |
238 | * SRAM must be marked as non-cached on OMAP3 since the | 225 | * SRAM must be marked as non-cached on OMAP3 since the |
239 | * CORE DPLL M2 divider change code (in SRAM) runs with the | 226 | * CORE DPLL M2 divider change code (in SRAM) runs with the |
@@ -244,13 +231,11 @@ void __init omap_map_sram(void) | |||
244 | omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED; | 231 | omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED; |
245 | } | 232 | } |
246 | 233 | ||
247 | if (cpu_is_omap44xx()) { | 234 | omap_sram_io_desc[0].virtual = omap_sram_base; |
248 | omap_sram_io_desc[0].virtual = OMAP4_SRAM_VA; | 235 | base = omap_sram_start; |
249 | base = OMAP4_SRAM_PA; | 236 | base = ROUND_DOWN(base, PAGE_SIZE); |
250 | base = ROUND_DOWN(base, PAGE_SIZE); | 237 | omap_sram_io_desc[0].pfn = __phys_to_pfn(base); |
251 | omap_sram_io_desc[0].pfn = __phys_to_pfn(base); | 238 | omap_sram_io_desc[0].length = ROUND_DOWN(omap_sram_size, PAGE_SIZE); |
252 | } | ||
253 | omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */ | ||
254 | iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc)); | 239 | iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc)); |
255 | 240 | ||
256 | printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n", | 241 | printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n", |
diff --git a/arch/arm/mach-pxa/include/mach/pxa27x_keypad.h b/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h index 7b4eadc6df3a..abcc36eb1242 100644 --- a/arch/arm/mach-pxa/include/mach/pxa27x_keypad.h +++ b/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h | |||
@@ -25,6 +25,13 @@ | |||
25 | * | 25 | * |
26 | * 4. matrix key and direct key will use the same debounce_interval by | 26 | * 4. matrix key and direct key will use the same debounce_interval by |
27 | * default, which should be sufficient in most cases | 27 | * default, which should be sufficient in most cases |
28 | * | ||
29 | * pxa168 keypad platform specific parameter | ||
30 | * | ||
31 | * NOTE: | ||
32 | * clear_wakeup_event callback is a workaround required to clear the | ||
33 | * keypad interrupt. The keypad wake must be cleared in addition to | ||
34 | * reading the MI/DI bits in the KPC register. | ||
28 | */ | 35 | */ |
29 | struct pxa27x_keypad_platform_data { | 36 | struct pxa27x_keypad_platform_data { |
30 | 37 | ||
@@ -52,6 +59,9 @@ struct pxa27x_keypad_platform_data { | |||
52 | 59 | ||
53 | /* key debounce interval */ | 60 | /* key debounce interval */ |
54 | unsigned int debounce_interval; | 61 | unsigned int debounce_interval; |
62 | |||
63 | /* clear wakeup event requirement for pxa168 */ | ||
64 | void (*clear_wakeup_event)(void); | ||
55 | }; | 65 | }; |
56 | 66 | ||
57 | extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info); | 67 | extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info); |
diff --git a/arch/arm/plat-tcc/Kconfig b/arch/arm/plat-tcc/Kconfig new file mode 100644 index 000000000000..1bf499570f42 --- /dev/null +++ b/arch/arm/plat-tcc/Kconfig | |||
@@ -0,0 +1,20 @@ | |||
1 | if ARCH_TCC_926 | ||
2 | |||
3 | menu "Telechips ARM926-based CPUs" | ||
4 | |||
5 | choice | ||
6 | prompt "Telechips CPU type:" | ||
7 | default ARCH_TCC8K | ||
8 | |||
9 | config ARCH_TCC8K | ||
10 | bool TCC8000 | ||
11 | select USB_ARCH_HAS_OHCI | ||
12 | help | ||
13 | Support for Telechips TCC8000 systems | ||
14 | |||
15 | endchoice | ||
16 | |||
17 | source "arch/arm/mach-tcc8k/Kconfig" | ||
18 | |||
19 | endmenu | ||
20 | endif | ||
diff --git a/arch/arm/plat-tcc/Makefile b/arch/arm/plat-tcc/Makefile new file mode 100644 index 000000000000..eceabc869b8f --- /dev/null +++ b/arch/arm/plat-tcc/Makefile | |||
@@ -0,0 +1,3 @@ | |||
1 | # "Telechips Platform Common Modules" | ||
2 | |||
3 | obj-y := clock.o system.o | ||
diff --git a/arch/arm/plat-tcc/clock.c b/arch/arm/plat-tcc/clock.c new file mode 100644 index 000000000000..f3ced10d5271 --- /dev/null +++ b/arch/arm/plat-tcc/clock.c | |||
@@ -0,0 +1,179 @@ | |||
1 | /* | ||
2 | * Clock framework for Telechips SoCs | ||
3 | * Based on arch/arm/plat-mxc/clock.c | ||
4 | * | ||
5 | * Copyright (C) 2004 - 2005 Nokia corporation | ||
6 | * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> | ||
7 | * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com> | ||
8 | * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
9 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
10 | * Copyright 2010 Hans J. Koch, hjk@linutronix.de | ||
11 | * | ||
12 | * Licensed under the terms of the GPL v2. | ||
13 | */ | ||
14 | |||
15 | #include <linux/clk.h> | ||
16 | #include <linux/err.h> | ||
17 | #include <linux/errno.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/mutex.h> | ||
20 | #include <linux/string.h> | ||
21 | |||
22 | #include <mach/clock.h> | ||
23 | #include <mach/hardware.h> | ||
24 | |||
25 | static DEFINE_MUTEX(clocks_mutex); | ||
26 | |||
27 | /*------------------------------------------------------------------------- | ||
28 | * Standard clock functions defined in include/linux/clk.h | ||
29 | *-------------------------------------------------------------------------*/ | ||
30 | |||
31 | static void __clk_disable(struct clk *clk) | ||
32 | { | ||
33 | BUG_ON(clk->refcount == 0); | ||
34 | |||
35 | if (!(--clk->refcount) && clk->disable) { | ||
36 | /* Unconditionally disable the clock in hardware */ | ||
37 | clk->disable(clk); | ||
38 | /* recursively disable parents */ | ||
39 | if (clk->parent) | ||
40 | __clk_disable(clk->parent); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | static int __clk_enable(struct clk *clk) | ||
45 | { | ||
46 | int ret = 0; | ||
47 | |||
48 | if (clk->refcount++ == 0 && clk->enable) { | ||
49 | if (clk->parent) | ||
50 | ret = __clk_enable(clk->parent); | ||
51 | if (ret) | ||
52 | return ret; | ||
53 | else | ||
54 | return clk->enable(clk); | ||
55 | } | ||
56 | |||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | /* This function increments the reference count on the clock and enables the | ||
61 | * clock if not already enabled. The parent clock tree is recursively enabled | ||
62 | */ | ||
63 | int clk_enable(struct clk *clk) | ||
64 | { | ||
65 | int ret = 0; | ||
66 | |||
67 | if (!clk) | ||
68 | return -EINVAL; | ||
69 | |||
70 | mutex_lock(&clocks_mutex); | ||
71 | ret = __clk_enable(clk); | ||
72 | mutex_unlock(&clocks_mutex); | ||
73 | |||
74 | return ret; | ||
75 | } | ||
76 | EXPORT_SYMBOL_GPL(clk_enable); | ||
77 | |||
78 | /* This function decrements the reference count on the clock and disables | ||
79 | * the clock when reference count is 0. The parent clock tree is | ||
80 | * recursively disabled | ||
81 | */ | ||
82 | void clk_disable(struct clk *clk) | ||
83 | { | ||
84 | if (!clk) | ||
85 | return; | ||
86 | |||
87 | mutex_lock(&clocks_mutex); | ||
88 | __clk_disable(clk); | ||
89 | mutex_unlock(&clocks_mutex); | ||
90 | } | ||
91 | EXPORT_SYMBOL_GPL(clk_disable); | ||
92 | |||
93 | /* Retrieve the *current* clock rate. If the clock itself | ||
94 | * does not provide a special calculation routine, ask | ||
95 | * its parent and so on, until one is able to return | ||
96 | * a valid clock rate | ||
97 | */ | ||
98 | unsigned long clk_get_rate(struct clk *clk) | ||
99 | { | ||
100 | if (!clk) | ||
101 | return 0UL; | ||
102 | |||
103 | if (clk->get_rate) | ||
104 | return clk->get_rate(clk); | ||
105 | |||
106 | return clk_get_rate(clk->parent); | ||
107 | } | ||
108 | EXPORT_SYMBOL_GPL(clk_get_rate); | ||
109 | |||
110 | /* Round the requested clock rate to the nearest supported | ||
111 | * rate that is less than or equal to the requested rate. | ||
112 | * This is dependent on the clock's current parent. | ||
113 | */ | ||
114 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
115 | { | ||
116 | if (!clk) | ||
117 | return 0; | ||
118 | if (!clk->round_rate) | ||
119 | return 0; | ||
120 | |||
121 | return clk->round_rate(clk, rate); | ||
122 | } | ||
123 | EXPORT_SYMBOL_GPL(clk_round_rate); | ||
124 | |||
125 | /* Set the clock to the requested clock rate. The rate must | ||
126 | * match a supported rate exactly based on what clk_round_rate returns | ||
127 | */ | ||
128 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
129 | { | ||
130 | int ret = -EINVAL; | ||
131 | |||
132 | if (!clk) | ||
133 | return ret; | ||
134 | if (!clk->set_rate || !rate) | ||
135 | return ret; | ||
136 | |||
137 | mutex_lock(&clocks_mutex); | ||
138 | ret = clk->set_rate(clk, rate); | ||
139 | mutex_unlock(&clocks_mutex); | ||
140 | |||
141 | return ret; | ||
142 | } | ||
143 | EXPORT_SYMBOL_GPL(clk_set_rate); | ||
144 | |||
145 | /* Set the clock's parent to another clock source */ | ||
146 | int clk_set_parent(struct clk *clk, struct clk *parent) | ||
147 | { | ||
148 | struct clk *old; | ||
149 | int ret = -EINVAL; | ||
150 | |||
151 | if (!clk) | ||
152 | return ret; | ||
153 | if (!clk->set_parent || !parent) | ||
154 | return ret; | ||
155 | |||
156 | mutex_lock(&clocks_mutex); | ||
157 | old = clk->parent; | ||
158 | if (clk->refcount) | ||
159 | __clk_enable(parent); | ||
160 | ret = clk->set_parent(clk, parent); | ||
161 | if (ret) | ||
162 | old = parent; | ||
163 | if (clk->refcount) | ||
164 | __clk_disable(old); | ||
165 | mutex_unlock(&clocks_mutex); | ||
166 | |||
167 | return ret; | ||
168 | } | ||
169 | EXPORT_SYMBOL_GPL(clk_set_parent); | ||
170 | |||
171 | /* Retrieve the clock's parent clock source */ | ||
172 | struct clk *clk_get_parent(struct clk *clk) | ||
173 | { | ||
174 | if (!clk) | ||
175 | return NULL; | ||
176 | |||
177 | return clk->parent; | ||
178 | } | ||
179 | EXPORT_SYMBOL_GPL(clk_get_parent); | ||
diff --git a/arch/arm/plat-tcc/include/mach/clkdev.h b/arch/arm/plat-tcc/include/mach/clkdev.h new file mode 100644 index 000000000000..04b37a89801c --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/clkdev.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef __ASM_MACH_CLKDEV_H | ||
2 | #define __ASM_MACH_CLKDEV_H | ||
3 | |||
4 | #define __clk_get(clk) ({ 1; }) | ||
5 | #define __clk_put(clk) do { } while (0) | ||
6 | |||
7 | #endif | ||
diff --git a/arch/arm/plat-tcc/include/mach/clock.h b/arch/arm/plat-tcc/include/mach/clock.h new file mode 100644 index 000000000000..a12f58ad71a8 --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/clock.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Low level clock header file for Telechips TCC architecture | ||
3 | * (C) 2010 Hans J. Koch <hjk@linutronix.de> | ||
4 | * | ||
5 | * Licensed under the GPL v2. | ||
6 | */ | ||
7 | |||
8 | #ifndef __ASM_ARCH_TCC_CLOCK_H__ | ||
9 | #define __ASM_ARCH_TCC_CLOCK_H__ | ||
10 | |||
11 | #ifndef __ASSEMBLY__ | ||
12 | |||
13 | struct clk { | ||
14 | struct clk *parent; | ||
15 | /* id number of a root clock, 0 for normal clocks */ | ||
16 | int root_id; | ||
17 | /* Reference count of clock enable/disable */ | ||
18 | int refcount; | ||
19 | /* Address of associated BCLKCTRx register. Must be set. */ | ||
20 | void __iomem *bclkctr; | ||
21 | /* Bit position for BCLKCTRx. Must be set. */ | ||
22 | int bclk_shift; | ||
23 | /* Address of ACLKxxx register, if any. */ | ||
24 | void __iomem *aclkreg; | ||
25 | /* get the current clock rate (always a fresh value) */ | ||
26 | unsigned long (*get_rate) (struct clk *); | ||
27 | /* Function ptr to set the clock to a new rate. The rate must match a | ||
28 | supported rate returned from round_rate. Leave blank if clock is not | ||
29 | programmable */ | ||
30 | int (*set_rate) (struct clk *, unsigned long); | ||
31 | /* Function ptr to round the requested clock rate to the nearest | ||
32 | supported rate that is less than or equal to the requested rate. */ | ||
33 | unsigned long (*round_rate) (struct clk *, unsigned long); | ||
34 | /* Function ptr to enable the clock. Leave blank if clock can not | ||
35 | be gated. */ | ||
36 | int (*enable) (struct clk *); | ||
37 | /* Function ptr to disable the clock. Leave blank if clock can not | ||
38 | be gated. */ | ||
39 | void (*disable) (struct clk *); | ||
40 | /* Function ptr to set the parent clock of the clock. */ | ||
41 | int (*set_parent) (struct clk *, struct clk *); | ||
42 | }; | ||
43 | |||
44 | int clk_register(struct clk *clk); | ||
45 | void clk_unregister(struct clk *clk); | ||
46 | |||
47 | #endif /* __ASSEMBLY__ */ | ||
48 | #endif /* __ASM_ARCH_MXC_CLOCK_H__ */ | ||
diff --git a/arch/arm/plat-tcc/include/mach/debug-macro.S b/arch/arm/plat-tcc/include/mach/debug-macro.S new file mode 100644 index 000000000000..97537845df64 --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/debug-macro.S | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1994-1999 Russell King | ||
3 | * Copyright (C) 2008-2009 Telechips | ||
4 | * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | .macro addruart,rx,tmp | ||
13 | mrc p15, 0, \rx, c1, c0 | ||
14 | tst \rx, #1 @ MMU enabled? | ||
15 | moveq \rx, #0x90000000 @ physical base address | ||
16 | movne \rx, #0xF1000000 @ virtual base | ||
17 | orr \rx, \rx, #0x00007000 @ UART0 | ||
18 | .endm | ||
19 | |||
20 | .macro senduart,rd,rx | ||
21 | strb \rd, [\rx, #0x44] | ||
22 | .endm | ||
23 | |||
24 | .macro waituart,rd,rx | ||
25 | .endm | ||
26 | |||
27 | .macro busyuart,rd,rx | ||
28 | 1001: | ||
29 | ldr \rd, [\rx, #0x14] | ||
30 | tst \rd, #0x20 | ||
31 | |||
32 | beq 1001b | ||
33 | .endm | ||
diff --git a/arch/arm/plat-tcc/include/mach/entry-macro.S b/arch/arm/plat-tcc/include/mach/entry-macro.S new file mode 100644 index 000000000000..748f401e4b6d --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/entry-macro.S | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-tcc83x/entry-macro.S | ||
3 | * | ||
4 | * Author : <linux@telechips.com> | ||
5 | * Created: June 10, 2008 | ||
6 | * Description: Low-level IRQ helper macros for Telechips-based platforms | ||
7 | * | ||
8 | * Copyright (C) 2008-2009 Telechips | ||
9 | * | ||
10 | * This file is licensed under the terms of the GNU General Public | ||
11 | * License version 2. This program is licensed "as is" without any | ||
12 | * warranty of any kind, whether express or implied. | ||
13 | */ | ||
14 | |||
15 | #include <mach/hardware.h> | ||
16 | #include <mach/irqs.h> | ||
17 | |||
18 | .macro disable_fiq | ||
19 | .endm | ||
20 | |||
21 | .macro get_irqnr_preamble, base, tmp | ||
22 | .endm | ||
23 | |||
24 | .macro arch_ret_to_user, tmp1, tmp2 | ||
25 | .endm | ||
26 | |||
27 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
28 | |||
29 | ldr \base, =0xF2003000 @ base address of PIC registers | ||
30 | |||
31 | @@ read MREQ register of PIC0 | ||
32 | |||
33 | mov \irqnr, #0 | ||
34 | ldr \irqstat, [\base, #0x00000014 ] @ lower 32 interrupts | ||
35 | cmp \irqstat, #0 | ||
36 | bne 1001f | ||
37 | |||
38 | @@ read MREQ register of PIC1 | ||
39 | |||
40 | ldr \irqstat, [\base, #0x00000094] @ upper 32 interrupts | ||
41 | cmp \irqstat, #0 | ||
42 | beq 1002f | ||
43 | mov \irqnr, #0x20 | ||
44 | |||
45 | 1001: | ||
46 | movs \tmp, \irqstat, lsl #16 | ||
47 | movne \irqstat, \tmp | ||
48 | addeq \irqnr, \irqnr, #16 | ||
49 | |||
50 | movs \tmp, \irqstat, lsl #8 | ||
51 | movne \irqstat, \tmp | ||
52 | addeq \irqnr, \irqnr, #8 | ||
53 | |||
54 | movs \tmp, \irqstat, lsl #4 | ||
55 | movne \irqstat, \tmp | ||
56 | addeq \irqnr, \irqnr, #4 | ||
57 | |||
58 | movs \tmp, \irqstat, lsl #2 | ||
59 | movne \irqstat, \tmp | ||
60 | addeq \irqnr, \irqnr, #2 | ||
61 | |||
62 | movs \tmp, \irqstat, lsl #1 | ||
63 | addeq \irqnr, \irqnr, #1 | ||
64 | orrs \base, \base, #1 | ||
65 | 1002: | ||
66 | @@ exit here, Z flag unset if IRQ | ||
67 | |||
68 | .endm | ||
diff --git a/arch/arm/plat-tcc/include/mach/hardware.h b/arch/arm/plat-tcc/include/mach/hardware.h new file mode 100644 index 000000000000..e70d126ccaf3 --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/hardware.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Author: RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com> | ||
3 | * Reorganized for Linux-2.6 by Tony Lindgren <tony@atomide.com> | ||
4 | * and Dirk Behme <dirk.behme@de.bosch.com> | ||
5 | * Rewritten by: <linux@telechips.com> | ||
6 | * Description: Hardware definitions for TCC8300 processors and boards | ||
7 | * | ||
8 | * Copyright (C) 2001 RidgeRun, Inc. | ||
9 | * Copyright (C) 2008-2009 Telechips | ||
10 | * | ||
11 | * Modifications for mainline (C) 2009 Hans J. Koch <hjk@linutronix.de> | ||
12 | * | ||
13 | * Licensed under the terms of the GNU Pulic License version 2. | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_TCC_HARDWARE_H | ||
17 | #define __ASM_ARCH_TCC_HARDWARE_H | ||
18 | |||
19 | #include <asm/sizes.h> | ||
20 | #ifndef __ASSEMBLER__ | ||
21 | #include <asm/types.h> | ||
22 | #endif | ||
23 | #include <mach/io.h> | ||
24 | |||
25 | /* | ||
26 | * ---------------------------------------------------------------------------- | ||
27 | * Clocks | ||
28 | * ---------------------------------------------------------------------------- | ||
29 | */ | ||
30 | #define CLKGEN_REG_BASE 0xfffece00 | ||
31 | #define ARM_CKCTL (CLKGEN_REG_BASE + 0x0) | ||
32 | #define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4) | ||
33 | #define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8) | ||
34 | #define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC) | ||
35 | #define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10) | ||
36 | #define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14) | ||
37 | #define ARM_SYSST (CLKGEN_REG_BASE + 0x18) | ||
38 | #define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24) | ||
39 | |||
40 | /* DPLL control registers */ | ||
41 | #define DPLL_CTL 0xfffecf00 | ||
42 | |||
43 | #endif /* __ASM_ARCH_TCC_HARDWARE_H */ | ||
diff --git a/arch/arm/plat-tcc/include/mach/io.h b/arch/arm/plat-tcc/include/mach/io.h new file mode 100644 index 000000000000..3e911d3ea0f1 --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/io.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * IO definitions for TCC8000 processors and boards | ||
3 | * | ||
4 | * Copyright (C) 1997-1999 Russell King | ||
5 | * Copyright (C) 2008-2009 Telechips | ||
6 | * Copyright (C) 2010 Hans J. Koch <hjk@linutronix.de> | ||
7 | * | ||
8 | * Licensed under the terms of the GNU Public License version 2. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARM_ARCH_IO_H | ||
12 | #define __ASM_ARM_ARCH_IO_H | ||
13 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | ||
15 | |||
16 | /* | ||
17 | * We don't actually have real ISA nor PCI buses, but there is so many | ||
18 | * drivers out there that might just work if we fake them... | ||
19 | */ | ||
20 | #define __io(a) __typesafe_io(a) | ||
21 | #define __mem_pci(a) (a) | ||
22 | |||
23 | #endif | ||
diff --git a/arch/arm/plat-tcc/include/mach/irqs.h b/arch/arm/plat-tcc/include/mach/irqs.h new file mode 100644 index 000000000000..da863894d498 --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/irqs.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * IRQ definitions for TCC8xxx | ||
3 | * | ||
4 | * Copyright (C) 2008-2009 Telechips | ||
5 | * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de> | ||
6 | * | ||
7 | * Licensed under the terms of the GPL v2. | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_TCC_IRQS_H | ||
12 | #define __ASM_ARCH_TCC_IRQS_H | ||
13 | |||
14 | #define NR_IRQS 64 | ||
15 | |||
16 | /* PIC0 interrupts */ | ||
17 | #define INT_ADMA1 0 | ||
18 | #define INT_BDMA 1 | ||
19 | #define INT_ADMA0 2 | ||
20 | #define INT_GDMA1 3 | ||
21 | #define INT_I2S0RX 4 | ||
22 | #define INT_I2S0TX 5 | ||
23 | #define INT_TC 6 | ||
24 | #define INT_UART0 7 | ||
25 | #define INT_USBD 8 | ||
26 | #define INT_SPI0TX 9 | ||
27 | #define INT_UDMA 10 | ||
28 | #define INT_LIRQ 11 | ||
29 | #define INT_GDMA2 12 | ||
30 | #define INT_GDMA0 13 | ||
31 | #define INT_TC32 14 | ||
32 | #define INT_LCD 15 | ||
33 | #define INT_ADC 16 | ||
34 | #define INT_I2C 17 | ||
35 | #define INT_RTCP 18 | ||
36 | #define INT_RTCA 19 | ||
37 | #define INT_NFC 20 | ||
38 | #define INT_SD0 21 | ||
39 | #define INT_GSB0 22 | ||
40 | #define INT_PK 23 | ||
41 | #define INT_USBH0 24 | ||
42 | #define INT_USBH1 25 | ||
43 | #define INT_G2D 26 | ||
44 | #define INT_ECC 27 | ||
45 | #define INT_SPI0RX 28 | ||
46 | #define INT_UART1 29 | ||
47 | #define INT_MSCL 30 | ||
48 | #define INT_GSB1 31 | ||
49 | /* PIC1 interrupts */ | ||
50 | #define INT_E0 32 | ||
51 | #define INT_E1 33 | ||
52 | #define INT_E2 34 | ||
53 | #define INT_E3 35 | ||
54 | #define INT_E4 36 | ||
55 | #define INT_E5 37 | ||
56 | #define INT_E6 38 | ||
57 | #define INT_E7 39 | ||
58 | #define INT_UART2 40 | ||
59 | #define INT_UART3 41 | ||
60 | #define INT_SPI1TX 42 | ||
61 | #define INT_SPI1RX 43 | ||
62 | #define INT_GSB2 44 | ||
63 | #define INT_SPDIF 45 | ||
64 | #define INT_CDIF 46 | ||
65 | #define INT_VBON 47 | ||
66 | #define INT_VBOFF 48 | ||
67 | #define INT_SD1 49 | ||
68 | #define INT_UART4 50 | ||
69 | #define INT_GDMA3 51 | ||
70 | #define INT_I2S1RX 52 | ||
71 | #define INT_I2S1TX 53 | ||
72 | #define INT_CAN0 54 | ||
73 | #define INT_CAN1 55 | ||
74 | #define INT_GSB3 56 | ||
75 | #define INT_KRST 57 | ||
76 | #define INT_UNUSED 58 | ||
77 | #define INT_SD0D3 59 | ||
78 | #define INT_SD1D3 60 | ||
79 | #define INT_GPS0 61 | ||
80 | #define INT_GPS1 62 | ||
81 | #define INT_GPS2 63 | ||
82 | |||
83 | #endif /* ASM_ARCH_TCC_IRQS_H */ | ||
diff --git a/arch/arm/plat-tcc/include/mach/memory.h b/arch/arm/plat-tcc/include/mach/memory.h new file mode 100644 index 000000000000..cd91ba8a670b --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/memory.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999 ARM Limited | ||
3 | * Copyright (C) 2000 RidgeRun, Inc. | ||
4 | * Copyright (C) 2008-2009 Telechips | ||
5 | * Copyright (C) 2010 Hans J. Koch <hjk@linutronix.de> | ||
6 | * | ||
7 | * Licensed under the terms of the GPL v2. | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASM_ARCH_MEMORY_H | ||
11 | #define __ASM_ARCH_MEMORY_H | ||
12 | |||
13 | /* | ||
14 | * Physical DRAM offset. | ||
15 | */ | ||
16 | #define PHYS_OFFSET UL(0x20000000) | ||
17 | |||
18 | #endif | ||
diff --git a/arch/arm/plat-tcc/include/mach/system.h b/arch/arm/plat-tcc/include/mach/system.h new file mode 100644 index 000000000000..909e6035d843 --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/system.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Author: <linux@telechips.com> | ||
3 | * Created: June 10, 2008 | ||
4 | * Description: LINUX SYSTEM FUNCTIONS for TCC83x | ||
5 | * | ||
6 | * Copyright (C) 2008-2009 Telechips | ||
7 | * | ||
8 | * Licensed under the terms of the GPL v2. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #ifndef __ASM_ARCH_SYSTEM_H | ||
13 | #define __ASM_ARCH_SYSTEM_H | ||
14 | #include <linux/clk.h> | ||
15 | |||
16 | #include <asm/mach-types.h> | ||
17 | #include <mach/hardware.h> | ||
18 | |||
19 | extern void plat_tcc_reboot(void); | ||
20 | |||
21 | static inline void arch_idle(void) | ||
22 | { | ||
23 | cpu_do_idle(); | ||
24 | } | ||
25 | |||
26 | static inline void arch_reset(char mode, const char *cmd) | ||
27 | { | ||
28 | plat_tcc_reboot(); | ||
29 | } | ||
30 | |||
31 | #endif | ||
diff --git a/arch/arm/plat-tcc/include/mach/tcc8k-regs.h b/arch/arm/plat-tcc/include/mach/tcc8k-regs.h new file mode 100644 index 000000000000..1d9428295332 --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/tcc8k-regs.h | |||
@@ -0,0 +1,807 @@ | |||
1 | /* | ||
2 | * Telechips TCC8000 register definitions | ||
3 | * | ||
4 | * (C) 2009 Hans J. Koch <hjk@linutronix.de> | ||
5 | * | ||
6 | * Licensed under the terms of the GPLv2. | ||
7 | */ | ||
8 | |||
9 | #ifndef TCC8K_REGS_H | ||
10 | #define TCC8K_REGS_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | #define EXT_SDRAM_BASE 0x20000000 | ||
15 | #define INT_SRAM_BASE 0x30000000 | ||
16 | #define INT_SRAM_SIZE SZ_32K | ||
17 | #define CS0_BASE 0x40000000 | ||
18 | #define CS1_BASE 0x50000000 | ||
19 | #define CS1_SIZE SZ_64K | ||
20 | #define CS2_BASE 0x60000000 | ||
21 | #define CS3_BASE 0x70000000 | ||
22 | #define AHB_PERI_BASE 0x80000000 | ||
23 | #define AHB_PERI_SIZE SZ_64K | ||
24 | #define APB0_PERI_BASE 0x90000000 | ||
25 | #define APB0_PERI_SIZE SZ_128K | ||
26 | #define APB1_PERI_BASE 0x98000000 | ||
27 | #define APB1_PERI_SIZE SZ_128K | ||
28 | #define DATA_TCM_BASE 0xa0000000 | ||
29 | #define DATA_TCM_SIZE SZ_8K | ||
30 | #define EXT_MEM_CTRL_BASE 0xf0000000 | ||
31 | #define EXT_MEM_CTRL_SIZE SZ_4K | ||
32 | |||
33 | #define CS1_BASE_VIRT (void __iomem *)0xf7000000 | ||
34 | #define AHB_PERI_BASE_VIRT (void __iomem *)0xf4000000 | ||
35 | #define APB0_PERI_BASE_VIRT (void __iomem *)0xf1000000 | ||
36 | #define APB1_PERI_BASE_VIRT (void __iomem *)0xf2000000 | ||
37 | #define EXT_MEM_CTRL_BASE_VIRT (void __iomem *)0xf3000000 | ||
38 | #define INT_SRAM_BASE_VIRT (void __iomem *)0xf5000000 | ||
39 | #define DATA_TCM_BASE_VIRT (void __iomem *)0xf6000000 | ||
40 | |||
41 | #define __REG(x) (*((volatile u32 *)(x))) | ||
42 | |||
43 | /* USB Device Controller Registers */ | ||
44 | #define UDC_BASE (AHB_PERI_BASE_VIRT + 0x8000) | ||
45 | #define UDC_BASE_PHYS (AHB_PERI_BASE + 0x8000) | ||
46 | |||
47 | #define UDC_IR_OFFS 0x00 | ||
48 | #define UDC_EIR_OFFS 0x04 | ||
49 | #define UDC_EIER_OFFS 0x08 | ||
50 | #define UDC_FAR_OFFS 0x0c | ||
51 | #define UDC_FNR_OFFS 0x10 | ||
52 | #define UDC_EDR_OFFS 0x14 | ||
53 | #define UDC_RT_OFFS 0x18 | ||
54 | #define UDC_SSR_OFFS 0x1c | ||
55 | #define UDC_SCR_OFFS 0x20 | ||
56 | #define UDC_EP0SR_OFFS 0x24 | ||
57 | #define UDC_EP0CR_OFFS 0x28 | ||
58 | |||
59 | #define UDC_ESR_OFFS 0x2c | ||
60 | #define UDC_ECR_OFFS 0x30 | ||
61 | #define UDC_BRCR_OFFS 0x34 | ||
62 | #define UDC_BWCR_OFFS 0x38 | ||
63 | #define UDC_MPR_OFFS 0x3c | ||
64 | #define UDC_DCR_OFFS 0x40 | ||
65 | #define UDC_DTCR_OFFS 0x44 | ||
66 | #define UDC_DFCR_OFFS 0x48 | ||
67 | #define UDC_DTTCR1_OFFS 0x4c | ||
68 | #define UDC_DTTCR2_OFFS 0x50 | ||
69 | #define UDC_ESR2_OFFS 0x54 | ||
70 | |||
71 | #define UDC_SCR2_OFFS 0x58 | ||
72 | #define UDC_EP0BUF_OFFS 0x60 | ||
73 | #define UDC_EP1BUF_OFFS 0x64 | ||
74 | #define UDC_EP2BUF_OFFS 0x68 | ||
75 | #define UDC_EP3BUF_OFFS 0x6c | ||
76 | #define UDC_PLICR_OFFS 0xa0 | ||
77 | #define UDC_PCR_OFFS 0xa4 | ||
78 | |||
79 | #define UDC_UPCR0_OFFS 0xc8 | ||
80 | #define UDC_UPCR1_OFFS 0xcc | ||
81 | #define UDC_UPCR2_OFFS 0xd0 | ||
82 | #define UDC_UPCR3_OFFS 0xd4 | ||
83 | |||
84 | /* Bits in UDC_EIR */ | ||
85 | #define UDC_EIR_EP0I (1 << 0) | ||
86 | #define UDC_EIR_EP1I (1 << 1) | ||
87 | #define UDC_EIR_EP2I (1 << 2) | ||
88 | #define UDC_EIR_EP3I (1 << 3) | ||
89 | #define UDC_EIR_EPI_MASK 0x0f | ||
90 | |||
91 | /* Bits in UDC_EIER */ | ||
92 | #define UDC_EIER_EP0IE (1 << 0) | ||
93 | #define UDC_EIER_EP1IE (1 << 1) | ||
94 | #define UDC_EIER_EP2IE (1 << 2) | ||
95 | #define UDC_EIER_EP3IE (1 << 3) | ||
96 | |||
97 | /* Bits in UDC_FNR */ | ||
98 | #define UDC_FNR_FN_MASK 0x7ff | ||
99 | #define UDC_FNR_SM (1 << 13) | ||
100 | #define UDC_FNR_FTL (1 << 14) | ||
101 | |||
102 | /* Bits in UDC_SSR */ | ||
103 | #define UDC_SSR_HFRES (1 << 0) | ||
104 | #define UDC_SSR_HFSUSP (1 << 1) | ||
105 | #define UDC_SSR_HFRM (1 << 2) | ||
106 | #define UDC_SSR_SDE (1 << 3) | ||
107 | #define UDC_SSR_HSP (1 << 4) | ||
108 | #define UDC_SSR_DM (1 << 5) | ||
109 | #define UDC_SSR_DP (1 << 6) | ||
110 | #define UDC_SSR_TBM (1 << 7) | ||
111 | #define UDC_SSR_VBON (1 << 8) | ||
112 | #define UDC_SSR_VBOFF (1 << 9) | ||
113 | #define UDC_SSR_EOERR (1 << 10) | ||
114 | #define UDC_SSR_DCERR (1 << 11) | ||
115 | #define UDC_SSR_TCERR (1 << 12) | ||
116 | #define UDC_SSR_BSERR (1 << 13) | ||
117 | #define UDC_SSR_TMERR (1 << 14) | ||
118 | #define UDC_SSR_BAERR (1 << 15) | ||
119 | |||
120 | /* Bits in UDC_SCR */ | ||
121 | #define UDC_SCR_HRESE (1 << 0) | ||
122 | #define UDC_SCR_HSSPE (1 << 1) | ||
123 | #define UDC_SCR_RRDE (1 << 5) | ||
124 | #define UDC_SCR_SPDEN (1 << 6) | ||
125 | #define UDC_SCR_DIEN (1 << 12) | ||
126 | |||
127 | /* Bits in UDC_EP0SR */ | ||
128 | #define UDC_EP0SR_RSR (1 << 0) | ||
129 | #define UDC_EP0SR_TST (1 << 1) | ||
130 | #define UDC_EP0SR_SHT (1 << 4) | ||
131 | #define UDC_EP0SR_LWO (1 << 6) | ||
132 | |||
133 | /* Bits in UDC_EP0CR */ | ||
134 | #define UDC_EP0CR_ESS (1 << 1) | ||
135 | |||
136 | /* Bits in UDC_ESR */ | ||
137 | #define UDC_ESR_RPS (1 << 0) | ||
138 | #define UDC_ESR_TPS (1 << 1) | ||
139 | #define UDC_ESR_LWO (1 << 4) | ||
140 | #define UDC_ESR_FFS (1 << 6) | ||
141 | |||
142 | /* Bits in UDC_ECR */ | ||
143 | #define UDC_ECR_ESS (1 << 1) | ||
144 | #define UDC_ECR_CDP (1 << 2) | ||
145 | |||
146 | #define UDC_ECR_FLUSH (1 << 6) | ||
147 | #define UDC_ECR_DUEN (1 << 7) | ||
148 | |||
149 | /* Bits in UDC_UPCR0 */ | ||
150 | #define UDC_UPCR0_VBD (1 << 1) | ||
151 | #define UDC_UPCR0_VBDS (1 << 6) | ||
152 | #define UDC_UPCR0_RCD_12 (0x0 << 9) | ||
153 | #define UDC_UPCR0_RCD_24 (0x1 << 9) | ||
154 | #define UDC_UPCR0_RCD_48 (0x2 << 9) | ||
155 | #define UDC_UPCR0_RCS_EXT (0x1 << 11) | ||
156 | #define UDC_UPCR0_RCS_XTAL (0x0 << 11) | ||
157 | |||
158 | /* Bits in UDC_UPCR1 */ | ||
159 | #define UDC_UPCR1_CDT(x) ((x) << 0) | ||
160 | #define UDC_UPCR1_OTGT(x) ((x) << 3) | ||
161 | #define UDC_UPCR1_SQRXT(x) ((x) << 8) | ||
162 | #define UDC_UPCR1_TXFSLST(x) ((x) << 12) | ||
163 | |||
164 | /* Bits in UDC_UPCR2 */ | ||
165 | #define UDC_UPCR2_TP (1 << 0) | ||
166 | #define UDC_UPCR2_TXRT(x) ((x) << 2) | ||
167 | #define UDC_UPCR2_TXVRT(x) ((x) << 5) | ||
168 | #define UDC_UPCR2_OPMODE(x) ((x) << 9) | ||
169 | #define UDC_UPCR2_XCVRSEL(x) ((x) << 12) | ||
170 | #define UDC_UPCR2_TM (1 << 14) | ||
171 | |||
172 | /* USB Host Controller registers */ | ||
173 | #define USBH0_BASE (AHB_PERI_BASE_VIRT + 0xb000) | ||
174 | #define USBH1_BASE (AHB_PERI_BASE_VIRT + 0xb800) | ||
175 | |||
176 | #define OHCI_INT_ENABLE_OFFS 0x10 | ||
177 | |||
178 | #define RH_DESCRIPTOR_A_OFFS 0x48 | ||
179 | #define RH_DESCRIPTOR_B_OFFS 0x4c | ||
180 | |||
181 | #define USBHTCFG0_OFFS 0x100 | ||
182 | #define USBHHCFG0_OFFS 0x104 | ||
183 | #define USBHHCFG1_OFFS 0x104 | ||
184 | |||
185 | /* DMA controller registers */ | ||
186 | #define DMAC0_BASE (AHB_PERI_BASE + 0x4000) | ||
187 | #define DMAC1_BASE (AHB_PERI_BASE + 0xa000) | ||
188 | #define DMAC2_BASE (AHB_PERI_BASE + 0x4800) | ||
189 | #define DMAC3_BASE (AHB_PERI_BASE + 0xa800) | ||
190 | |||
191 | #define DMAC_CH_OFFSET(ch) (ch * 0x30) | ||
192 | |||
193 | #define ST_SADR_OFFS 0x00 | ||
194 | #define SPARAM_OFFS 0x04 | ||
195 | #define C_SADR_OFFS 0x0c | ||
196 | #define ST_DADR_OFFS 0x10 | ||
197 | #define DPARAM_OFFS 0x14 | ||
198 | #define C_DADR_OFFS 0x1c | ||
199 | #define HCOUNT_OFFS 0x20 | ||
200 | #define CHCTRL_OFFS 0x24 | ||
201 | #define RPTCTRL_OFFS 0x28 | ||
202 | #define EXTREQ_A_OFFS 0x2c | ||
203 | |||
204 | /* Bits in CHCTRL register */ | ||
205 | #define CHCTRL_EN (1 << 0) | ||
206 | |||
207 | #define CHCTRL_IEN (1 << 2) | ||
208 | #define CHCTRL_FLAG (1 << 3) | ||
209 | #define CHCTRL_WSIZE8 (0 << 4) | ||
210 | #define CHCTRL_WSIZE16 (1 << 4) | ||
211 | #define CHCTRL_WSIZE32 (2 << 4) | ||
212 | |||
213 | #define CHCTRL_BSIZE1 (0 << 6) | ||
214 | #define CHCTRL_BSIZE2 (1 << 6) | ||
215 | #define CHCTRL_BSIZE4 (2 << 6) | ||
216 | #define CHCTRL_BSIZE8 (3 << 6) | ||
217 | |||
218 | #define CHCTRL_TYPE_SINGLE_E (0 << 8) | ||
219 | #define CHCTRL_TYPE_HW (1 << 8) | ||
220 | #define CHCTRL_TYPE_SW (2 << 8) | ||
221 | #define CHCTRL_TYPE_SINGLE_L (3 << 8) | ||
222 | |||
223 | #define CHCTRL_BST (1 << 10) | ||
224 | |||
225 | /* Use DMA controller 0, channel 2 for USB */ | ||
226 | #define USB_DMA_BASE (DMAC0_BASE + DMAC_CH_OFFSET(2)) | ||
227 | |||
228 | /* NAND flash controller registers */ | ||
229 | #define NFC_BASE (AHB_PERI_BASE_VIRT + 0xd000) | ||
230 | #define NFC_BASE_PHYS (AHB_PERI_BASE + 0xd000) | ||
231 | |||
232 | #define NFC_CMD_OFFS 0x00 | ||
233 | #define NFC_LADDR_OFFS 0x04 | ||
234 | #define NFC_BADDR_OFFS 0x08 | ||
235 | #define NFC_SADDR_OFFS 0x0c | ||
236 | #define NFC_WDATA_OFFS 0x10 | ||
237 | #define NFC_LDATA_OFFS 0x20 | ||
238 | #define NFC_SDATA_OFFS 0x40 | ||
239 | #define NFC_CTRL_OFFS 0x50 | ||
240 | #define NFC_PSTART_OFFS 0x54 | ||
241 | #define NFC_RSTART_OFFS 0x58 | ||
242 | #define NFC_DSIZE_OFFS 0x5c | ||
243 | #define NFC_IREQ_OFFS 0x60 | ||
244 | #define NFC_RST_OFFS 0x64 | ||
245 | #define NFC_CTRL1_OFFS 0x68 | ||
246 | #define NFC_MDATA_OFFS 0x70 | ||
247 | |||
248 | #define NFC_WDATA_PHYS_ADDR (NFC_BASE_PHYS + NFC_WDATA_OFFS) | ||
249 | |||
250 | /* Bits in NFC_CTRL */ | ||
251 | #define NFC_CTRL_BHLD_MASK (0xf << 0) | ||
252 | #define NFC_CTRL_BPW_MASK (0xf << 4) | ||
253 | #define NFC_CTRL_BSTP_MASK (0xf << 8) | ||
254 | #define NFC_CTRL_CADDR_MASK (0x7 << 12) | ||
255 | #define NFC_CTRL_CADDR_1 (0x0 << 12) | ||
256 | #define NFC_CTRL_CADDR_2 (0x1 << 12) | ||
257 | #define NFC_CTRL_CADDR_3 (0x2 << 12) | ||
258 | #define NFC_CTRL_CADDR_4 (0x3 << 12) | ||
259 | #define NFC_CTRL_CADDR_5 (0x4 << 12) | ||
260 | #define NFC_CTRL_MSK (1 << 15) | ||
261 | #define NFC_CTRL_PSIZE256 (0 << 16) | ||
262 | #define NFC_CTRL_PSIZE512 (1 << 16) | ||
263 | #define NFC_CTRL_PSIZE1024 (2 << 16) | ||
264 | #define NFC_CTRL_PSIZE2048 (3 << 16) | ||
265 | #define NFC_CTRL_PSIZE4096 (4 << 16) | ||
266 | #define NFC_CTRL_PSIZE_MASK (7 << 16) | ||
267 | #define NFC_CTRL_BSIZE1 (0 << 19) | ||
268 | #define NFC_CTRL_BSIZE2 (1 << 19) | ||
269 | #define NFC_CTRL_BSIZE4 (2 << 19) | ||
270 | #define NFC_CTRL_BSIZE8 (3 << 19) | ||
271 | #define NFC_CTRL_BSIZE_MASK (3 << 19) | ||
272 | #define NFC_CTRL_RDY (1 << 21) | ||
273 | #define NFC_CTRL_CS0SEL (1 << 22) | ||
274 | #define NFC_CTRL_CS1SEL (1 << 23) | ||
275 | #define NFC_CTRL_CS2SEL (1 << 24) | ||
276 | #define NFC_CTRL_CS3SEL (1 << 25) | ||
277 | #define NFC_CTRL_CSMASK (0xf << 22) | ||
278 | #define NFC_CTRL_BW (1 << 26) | ||
279 | #define NFC_CTRL_FS (1 << 27) | ||
280 | #define NFC_CTRL_DEN (1 << 28) | ||
281 | #define NFC_CTRL_READ_IEN (1 << 29) | ||
282 | #define NFC_CTRL_PROG_IEN (1 << 30) | ||
283 | #define NFC_CTRL_RDY_IEN (1 << 31) | ||
284 | |||
285 | /* Bits in NFC_IREQ */ | ||
286 | #define NFC_IREQ_IRQ0 (1 << 0) | ||
287 | #define NFC_IREQ_IRQ1 (1 << 1) | ||
288 | #define NFC_IREQ_IRQ2 (1 << 2) | ||
289 | |||
290 | #define NFC_IREQ_FLAG0 (1 << 4) | ||
291 | #define NFC_IREQ_FLAG1 (1 << 5) | ||
292 | #define NFC_IREQ_FLAG2 (1 << 6) | ||
293 | |||
294 | /* MMC controller registers */ | ||
295 | #define MMC0_BASE (AHB_PERI_BASE_VIRT + 0xe000) | ||
296 | #define MMC1_BASE (AHB_PERI_BASE_VIRT + 0xe800) | ||
297 | |||
298 | /* UART base addresses */ | ||
299 | |||
300 | #define UART0_BASE (APB0_PERI_BASE_VIRT + 0x07000) | ||
301 | #define UART0_BASE_PHYS (APB0_PERI_BASE + 0x07000) | ||
302 | #define UART1_BASE (APB0_PERI_BASE_VIRT + 0x08000) | ||
303 | #define UART1_BASE_PHYS (APB0_PERI_BASE + 0x08000) | ||
304 | #define UART2_BASE (APB0_PERI_BASE_VIRT + 0x09000) | ||
305 | #define UART2_BASE_PHYS (APB0_PERI_BASE + 0x09000) | ||
306 | #define UART3_BASE (APB0_PERI_BASE_VIRT + 0x0a000) | ||
307 | #define UART3_BASE_PHYS (APB0_PERI_BASE + 0x0a000) | ||
308 | #define UART4_BASE (APB0_PERI_BASE_VIRT + 0x15000) | ||
309 | #define UART4_BASE_PHYS (APB0_PERI_BASE + 0x15000) | ||
310 | |||
311 | #define UART_BASE UART0_BASE | ||
312 | #define UART_BASE_PHYS UART0_BASE_PHYS | ||
313 | |||
314 | /* ECC controller */ | ||
315 | #define ECC_CTR_BASE (APB0_PERI_BASE_VIRT + 0xd000) | ||
316 | |||
317 | #define ECC_CTRL_OFFS 0x00 | ||
318 | #define ECC_BASE_OFFS 0x04 | ||
319 | #define ECC_MASK_OFFS 0x08 | ||
320 | #define ECC_CLEAR_OFFS 0x0c | ||
321 | #define ECC4_0_OFFS 0x10 | ||
322 | #define ECC4_1_OFFS 0x14 | ||
323 | |||
324 | #define ECC_EADDR0_OFFS 0x50 | ||
325 | |||
326 | #define ECC_ERRNUM_OFFS 0x90 | ||
327 | #define ECC_IREQ_OFFS 0x94 | ||
328 | |||
329 | /* Bits in ECC_CTRL */ | ||
330 | #define ECC_CTRL_ECC4_DIEN (1 << 28) | ||
331 | #define ECC_CTRL_ECC8_DIEN (1 << 29) | ||
332 | #define ECC_CTRL_ECC12_DIEN (1 << 30) | ||
333 | #define ECC_CTRL_ECC_DISABLE 0x0 | ||
334 | #define ECC_CTRL_ECC_SLC_ENC 0x8 | ||
335 | #define ECC_CTRL_ECC_SLC_DEC 0x9 | ||
336 | #define ECC_CTRL_ECC4_ENC 0xa | ||
337 | #define ECC_CTRL_ECC4_DEC 0xb | ||
338 | #define ECC_CTRL_ECC8_ENC 0xc | ||
339 | #define ECC_CTRL_ECC8_DEC 0xd | ||
340 | #define ECC_CTRL_ECC12_ENC 0xe | ||
341 | #define ECC_CTRL_ECC12_DEC 0xf | ||
342 | |||
343 | /* Bits in ECC_IREQ */ | ||
344 | #define ECC_IREQ_E4DI (1 << 4) | ||
345 | |||
346 | #define ECC_IREQ_E4DF (1 << 20) | ||
347 | #define ECC_IREQ_E4EF (1 << 21) | ||
348 | |||
349 | /* Interrupt controller */ | ||
350 | |||
351 | #define PIC0_BASE (APB1_PERI_BASE_VIRT + 0x3000) | ||
352 | #define PIC0_BASE_PHYS (APB1_PERI_BASE + 0x3000) | ||
353 | |||
354 | #define PIC0_IEN_OFFS 0x00 | ||
355 | #define PIC0_CREQ_OFFS 0x04 | ||
356 | #define PIC0_IREQ_OFFS 0x08 | ||
357 | #define PIC0_IRQSEL_OFFS 0x0c | ||
358 | #define PIC0_SRC_OFFS 0x10 | ||
359 | #define PIC0_MREQ_OFFS 0x14 | ||
360 | #define PIC0_TSTREQ_OFFS 0x18 | ||
361 | #define PIC0_POL_OFFS 0x1c | ||
362 | #define PIC0_IRQ_OFFS 0x20 | ||
363 | #define PIC0_FIQ_OFFS 0x24 | ||
364 | #define PIC0_MIRQ_OFFS 0x28 | ||
365 | #define PIC0_MFIQ_OFFS 0x2c | ||
366 | #define PIC0_TMODE_OFFS 0x30 | ||
367 | #define PIC0_SYNC_OFFS 0x34 | ||
368 | #define PIC0_WKUP_OFFS 0x38 | ||
369 | #define PIC0_TMODEA_OFFS 0x3c | ||
370 | #define PIC0_INTOEN_OFFS 0x40 | ||
371 | #define PIC0_MEN0_OFFS 0x44 | ||
372 | #define PIC0_MEN_OFFS 0x48 | ||
373 | |||
374 | #define PIC0_IEN __REG(PIC0_BASE + PIC0_IEN_OFFS) | ||
375 | #define PIC0_IEN_PHYS __REG(PIC0_BASE_PHYS + PIC0_IEN_OFFS) | ||
376 | #define PIC0_CREQ __REG(PIC0_BASE + PIC0_CREQ_OFFS) | ||
377 | #define PIC0_CREQ_PHYS __REG(PIC0_BASE_PHYS + PIC0_CREQ_OFFS) | ||
378 | #define PIC0_IREQ __REG(PIC0_BASE + PIC0_IREQ_OFFS) | ||
379 | #define PIC0_IRQSEL __REG(PIC0_BASE + PIC0_IRQSEL_OFFS) | ||
380 | #define PIC0_IRQSEL_PHYS __REG(PIC0_BASE_PHYS + PIC0_IRQSEL_OFFS) | ||
381 | #define PIC0_SRC __REG(PIC0_BASE + PIC0_SRC_OFFS) | ||
382 | #define PIC0_MREQ __REG(PIC0_BASE + PIC0_MREQ_OFFS) | ||
383 | #define PIC0_TSTREQ __REG(PIC0_BASE + PIC0_TSTREQ_OFFS) | ||
384 | #define PIC0_POL __REG(PIC0_BASE + PIC0_POL_OFFS) | ||
385 | #define PIC0_IRQ __REG(PIC0_BASE + PIC0_IRQ_OFFS) | ||
386 | #define PIC0_FIQ __REG(PIC0_BASE + PIC0_FIQ_OFFS) | ||
387 | #define PIC0_MIRQ __REG(PIC0_BASE + PIC0_MIRQ_OFFS) | ||
388 | #define PIC0_MFIQ __REG(PIC0_BASE + PIC0_MFIQ_OFFS) | ||
389 | #define PIC0_TMODE __REG(PIC0_BASE + PIC0_TMODE_OFFS) | ||
390 | #define PIC0_TMODE_PHYS __REG(PIC0_BASE_PHYS + PIC0_TMODE_OFFS) | ||
391 | #define PIC0_SYNC __REG(PIC0_BASE + PIC0_SYNC_OFFS) | ||
392 | #define PIC0_WKUP __REG(PIC0_BASE + PIC0_WKUP_OFFS) | ||
393 | #define PIC0_TMODEA __REG(PIC0_BASE + PIC0_TMODEA_OFFS) | ||
394 | #define PIC0_INTOEN __REG(PIC0_BASE + PIC0_INTOEN_OFFS) | ||
395 | #define PIC0_MEN0 __REG(PIC0_BASE + PIC0_MEN0_OFFS) | ||
396 | #define PIC0_MEN __REG(PIC0_BASE + PIC0_MEN_OFFS) | ||
397 | |||
398 | #define PIC1_BASE (APB1_PERI_BASE_VIRT + 0x3080) | ||
399 | |||
400 | #define PIC1_IEN_OFFS 0x00 | ||
401 | #define PIC1_CREQ_OFFS 0x04 | ||
402 | #define PIC1_IREQ_OFFS 0x08 | ||
403 | #define PIC1_IRQSEL_OFFS 0x0c | ||
404 | #define PIC1_SRC_OFFS 0x10 | ||
405 | #define PIC1_MREQ_OFFS 0x14 | ||
406 | #define PIC1_TSTREQ_OFFS 0x18 | ||
407 | #define PIC1_POL_OFFS 0x1c | ||
408 | #define PIC1_IRQ_OFFS 0x20 | ||
409 | #define PIC1_FIQ_OFFS 0x24 | ||
410 | #define PIC1_MIRQ_OFFS 0x28 | ||
411 | #define PIC1_MFIQ_OFFS 0x2c | ||
412 | #define PIC1_TMODE_OFFS 0x30 | ||
413 | #define PIC1_SYNC_OFFS 0x34 | ||
414 | #define PIC1_WKUP_OFFS 0x38 | ||
415 | #define PIC1_TMODEA_OFFS 0x3c | ||
416 | #define PIC1_INTOEN_OFFS 0x40 | ||
417 | #define PIC1_MEN1_OFFS 0x44 | ||
418 | #define PIC1_MEN_OFFS 0x48 | ||
419 | |||
420 | #define PIC1_IEN __REG(PIC1_BASE + PIC1_IEN_OFFS) | ||
421 | #define PIC1_CREQ __REG(PIC1_BASE + PIC1_CREQ_OFFS) | ||
422 | #define PIC1_IREQ __REG(PIC1_BASE + PIC1_IREQ_OFFS) | ||
423 | #define PIC1_IRQSEL __REG(PIC1_BASE + PIC1_IRQSEL_OFFS) | ||
424 | #define PIC1_SRC __REG(PIC1_BASE + PIC1_SRC_OFFS) | ||
425 | #define PIC1_MREQ __REG(PIC1_BASE + PIC1_MREQ_OFFS) | ||
426 | #define PIC1_TSTREQ __REG(PIC1_BASE + PIC1_TSTREQ_OFFS) | ||
427 | #define PIC1_POL __REG(PIC1_BASE + PIC1_POL_OFFS) | ||
428 | #define PIC1_IRQ __REG(PIC1_BASE + PIC1_IRQ_OFFS) | ||
429 | #define PIC1_FIQ __REG(PIC1_BASE + PIC1_FIQ_OFFS) | ||
430 | #define PIC1_MIRQ __REG(PIC1_BASE + PIC1_MIRQ_OFFS) | ||
431 | #define PIC1_MFIQ __REG(PIC1_BASE + PIC1_MFIQ_OFFS) | ||
432 | #define PIC1_TMODE __REG(PIC1_BASE + PIC1_TMODE_OFFS) | ||
433 | #define PIC1_SYNC __REG(PIC1_BASE + PIC1_SYNC_OFFS) | ||
434 | #define PIC1_WKUP __REG(PIC1_BASE + PIC1_WKUP_OFFS) | ||
435 | #define PIC1_TMODEA __REG(PIC1_BASE + PIC1_TMODEA_OFFS) | ||
436 | #define PIC1_INTOEN __REG(PIC1_BASE + PIC1_INTOEN_OFFS) | ||
437 | #define PIC1_MEN1 __REG(PIC1_BASE + PIC1_MEN1_OFFS) | ||
438 | #define PIC1_MEN __REG(PIC1_BASE + PIC1_MEN_OFFS) | ||
439 | |||
440 | /* Timer registers */ | ||
441 | #define TIMER_BASE (APB1_PERI_BASE_VIRT + 0x4000) | ||
442 | #define TIMER_BASE_PHYS (APB1_PERI_BASE + 0x4000) | ||
443 | |||
444 | #define TWDCFG_OFFS 0x70 | ||
445 | |||
446 | #define TC32EN_OFFS 0x80 | ||
447 | #define TC32LDV_OFFS 0x84 | ||
448 | #define TC32CMP0_OFFS 0x88 | ||
449 | #define TC32CMP1_OFFS 0x8c | ||
450 | #define TC32PCNT_OFFS 0x90 | ||
451 | #define TC32MCNT_OFFS 0x94 | ||
452 | #define TC32IRQ_OFFS 0x98 | ||
453 | |||
454 | /* Bits in TC32EN */ | ||
455 | #define TC32EN_PRESCALE_MASK 0x00ffffff | ||
456 | #define TC32EN_ENABLE (1 << 24) | ||
457 | #define TC32EN_LOADZERO (1 << 25) | ||
458 | #define TC32EN_STOPMODE (1 << 26) | ||
459 | #define TC32EN_LDM0 (1 << 28) | ||
460 | #define TC32EN_LDM1 (1 << 29) | ||
461 | |||
462 | /* Bits in TC32IRQ */ | ||
463 | #define TC32IRQ_MSTAT_MASK 0x0000001f | ||
464 | #define TC32IRQ_RSTAT_MASK (0x1f << 8) | ||
465 | #define TC32IRQ_IRQEN0 (1 << 16) | ||
466 | #define TC32IRQ_IRQEN1 (1 << 17) | ||
467 | #define TC32IRQ_IRQEN2 (1 << 18) | ||
468 | #define TC32IRQ_IRQEN3 (1 << 19) | ||
469 | #define TC32IRQ_IRQEN4 (1 << 20) | ||
470 | #define TC32IRQ_RSYNC (1 << 30) | ||
471 | #define TC32IRQ_IRQCLR (1 << 31) | ||
472 | |||
473 | /* GPIO registers */ | ||
474 | #define GPIOPD_BASE (APB1_PERI_BASE_VIRT + 0x5000) | ||
475 | |||
476 | #define GPIOPD_DAT_OFFS 0x00 | ||
477 | #define GPIOPD_DOE_OFFS 0x04 | ||
478 | #define GPIOPD_FS0_OFFS 0x08 | ||
479 | #define GPIOPD_FS1_OFFS 0x0c | ||
480 | #define GPIOPD_FS2_OFFS 0x10 | ||
481 | #define GPIOPD_RPU_OFFS 0x30 | ||
482 | #define GPIOPD_RPD_OFFS 0x34 | ||
483 | #define GPIOPD_DV0_OFFS 0x38 | ||
484 | #define GPIOPD_DV1_OFFS 0x3c | ||
485 | |||
486 | #define GPIOPS_BASE (APB1_PERI_BASE_VIRT + 0x5000) | ||
487 | |||
488 | #define GPIOPS_DAT_OFFS 0x40 | ||
489 | #define GPIOPS_DOE_OFFS 0x44 | ||
490 | #define GPIOPS_FS0_OFFS 0x48 | ||
491 | #define GPIOPS_FS1_OFFS 0x4c | ||
492 | #define GPIOPS_FS2_OFFS 0x50 | ||
493 | #define GPIOPS_FS3_OFFS 0x54 | ||
494 | #define GPIOPS_RPU_OFFS 0x70 | ||
495 | #define GPIOPS_RPD_OFFS 0x74 | ||
496 | #define GPIOPS_DV0_OFFS 0x78 | ||
497 | #define GPIOPS_DV1_OFFS 0x7c | ||
498 | |||
499 | #define GPIOPS_FS1_SDH0_BITS 0x000000ff | ||
500 | #define GPIOPS_FS1_SDH1_BITS 0x0000ff00 | ||
501 | |||
502 | #define GPIOPU_BASE (APB1_PERI_BASE_VIRT + 0x5000) | ||
503 | |||
504 | #define GPIOPU_DAT_OFFS 0x80 | ||
505 | #define GPIOPU_DOE_OFFS 0x84 | ||
506 | #define GPIOPU_FS0_OFFS 0x88 | ||
507 | #define GPIOPU_FS1_OFFS 0x8c | ||
508 | #define GPIOPU_FS2_OFFS 0x90 | ||
509 | #define GPIOPU_RPU_OFFS 0xb0 | ||
510 | #define GPIOPU_RPD_OFFS 0xb4 | ||
511 | #define GPIOPU_DV0_OFFS 0xb8 | ||
512 | #define GPIOPU_DV1_OFFS 0xbc | ||
513 | |||
514 | #define GPIOPU_FS0_TXD0 (1 << 0) | ||
515 | #define GPIOPU_FS0_RXD0 (1 << 1) | ||
516 | #define GPIOPU_FS0_CTS0 (1 << 2) | ||
517 | #define GPIOPU_FS0_RTS0 (1 << 3) | ||
518 | #define GPIOPU_FS0_TXD1 (1 << 4) | ||
519 | #define GPIOPU_FS0_RXD1 (1 << 5) | ||
520 | #define GPIOPU_FS0_CTS1 (1 << 6) | ||
521 | #define GPIOPU_FS0_RTS1 (1 << 7) | ||
522 | #define GPIOPU_FS0_TXD2 (1 << 8) | ||
523 | #define GPIOPU_FS0_RXD2 (1 << 9) | ||
524 | #define GPIOPU_FS0_CTS2 (1 << 10) | ||
525 | #define GPIOPU_FS0_RTS2 (1 << 11) | ||
526 | #define GPIOPU_FS0_TXD3 (1 << 12) | ||
527 | #define GPIOPU_FS0_RXD3 (1 << 13) | ||
528 | #define GPIOPU_FS0_CTS3 (1 << 14) | ||
529 | #define GPIOPU_FS0_RTS3 (1 << 15) | ||
530 | #define GPIOPU_FS0_TXD4 (1 << 16) | ||
531 | #define GPIOPU_FS0_RXD4 (1 << 17) | ||
532 | #define GPIOPU_FS0_CTS4 (1 << 18) | ||
533 | #define GPIOPU_FS0_RTS4 (1 << 19) | ||
534 | |||
535 | #define GPIOFC_BASE (APB1_PERI_BASE_VIRT + 0x5000) | ||
536 | |||
537 | #define GPIOFC_DAT_OFFS 0xc0 | ||
538 | #define GPIOFC_DOE_OFFS 0xc4 | ||
539 | #define GPIOFC_FS0_OFFS 0xc8 | ||
540 | #define GPIOFC_FS1_OFFS 0xcc | ||
541 | #define GPIOFC_FS2_OFFS 0xd0 | ||
542 | #define GPIOFC_FS3_OFFS 0xd4 | ||
543 | #define GPIOFC_RPU_OFFS 0xf0 | ||
544 | #define GPIOFC_RPD_OFFS 0xf4 | ||
545 | #define GPIOFC_DV0_OFFS 0xf8 | ||
546 | #define GPIOFC_DV1_OFFS 0xfc | ||
547 | |||
548 | #define GPIOFD_BASE (APB1_PERI_BASE_VIRT + 0x5000) | ||
549 | |||
550 | #define GPIOFD_DAT_OFFS 0x100 | ||
551 | #define GPIOFD_DOE_OFFS 0x104 | ||
552 | #define GPIOFD_FS0_OFFS 0x108 | ||
553 | #define GPIOFD_FS1_OFFS 0x10c | ||
554 | #define GPIOFD_FS2_OFFS 0x110 | ||
555 | #define GPIOFD_RPU_OFFS 0x130 | ||
556 | #define GPIOFD_RPD_OFFS 0x134 | ||
557 | #define GPIOFD_DV0_OFFS 0x138 | ||
558 | #define GPIOFD_DV1_OFFS 0x13c | ||
559 | |||
560 | #define GPIOLC_BASE (APB1_PERI_BASE_VIRT + 0x5000) | ||
561 | |||
562 | #define GPIOLC_DAT_OFFS 0x140 | ||
563 | #define GPIOLC_DOE_OFFS 0x144 | ||
564 | #define GPIOLC_FS0_OFFS 0x148 | ||
565 | #define GPIOLC_FS1_OFFS 0x14c | ||
566 | #define GPIOLC_RPU_OFFS 0x170 | ||
567 | #define GPIOLC_RPD_OFFS 0x174 | ||
568 | #define GPIOLC_DV0_OFFS 0x178 | ||
569 | #define GPIOLC_DV1_OFFS 0x17c | ||
570 | |||
571 | #define GPIOLD_BASE (APB1_PERI_BASE_VIRT + 0x5000) | ||
572 | |||
573 | #define GPIOLD_DAT_OFFS 0x180 | ||
574 | #define GPIOLD_DOE_OFFS 0x184 | ||
575 | #define GPIOLD_FS0_OFFS 0x188 | ||
576 | #define GPIOLD_FS1_OFFS 0x18c | ||
577 | #define GPIOLD_FS2_OFFS 0x190 | ||
578 | #define GPIOLD_RPU_OFFS 0x1b0 | ||
579 | #define GPIOLD_RPD_OFFS 0x1b4 | ||
580 | #define GPIOLD_DV0_OFFS 0x1b8 | ||
581 | #define GPIOLD_DV1_OFFS 0x1bc | ||
582 | |||
583 | #define GPIOAD_BASE (APB1_PERI_BASE_VIRT + 0x5000) | ||
584 | |||
585 | #define GPIOAD_DAT_OFFS 0x1c0 | ||
586 | #define GPIOAD_DOE_OFFS 0x1c4 | ||
587 | #define GPIOAD_FS0_OFFS 0x1c8 | ||
588 | #define GPIOAD_RPU_OFFS 0x1f0 | ||
589 | #define GPIOAD_RPD_OFFS 0x1f4 | ||
590 | #define GPIOAD_DV0_OFFS 0x1f8 | ||
591 | #define GPIOAD_DV1_OFFS 0x1fc | ||
592 | |||
593 | #define GPIOXC_BASE (APB1_PERI_BASE_VIRT + 0x5000) | ||
594 | |||
595 | #define GPIOXC_DAT_OFFS 0x200 | ||
596 | #define GPIOXC_DOE_OFFS 0x204 | ||
597 | #define GPIOXC_FS0_OFFS 0x208 | ||
598 | #define GPIOXC_RPU_OFFS 0x230 | ||
599 | #define GPIOXC_RPD_OFFS 0x234 | ||
600 | #define GPIOXC_DV0_OFFS 0x238 | ||
601 | #define GPIOXC_DV1_OFFS 0x23c | ||
602 | |||
603 | #define GPIOXC_FS0 __REG(GPIOXC_BASE + GPIOXC_FS0_OFFS) | ||
604 | |||
605 | #define GPIOXC_FS0_CS0 (1 << 26) | ||
606 | #define GPIOXC_FS0_CS1 (1 << 27) | ||
607 | |||
608 | #define GPIOXD_BASE (APB1_PERI_BASE_VIRT + 0x5000) | ||
609 | |||
610 | #define GPIOXD_DAT_OFFS 0x240 | ||
611 | #define GPIOXD_FS0_OFFS 0x248 | ||
612 | #define GPIOXD_RPU_OFFS 0x270 | ||
613 | #define GPIOXD_RPD_OFFS 0x274 | ||
614 | #define GPIOXD_DV0_OFFS 0x278 | ||
615 | #define GPIOXD_DV1_OFFS 0x27c | ||
616 | |||
617 | #define GPIOPK_BASE (APB1_PERI_BASE_VIRT + 0x1c000) | ||
618 | |||
619 | #define GPIOPK_RST_OFFS 0x008 | ||
620 | #define GPIOPK_DAT_OFFS 0x100 | ||
621 | #define GPIOPK_DOE_OFFS 0x104 | ||
622 | #define GPIOPK_FS0_OFFS 0x108 | ||
623 | #define GPIOPK_FS1_OFFS 0x10c | ||
624 | #define GPIOPK_FS2_OFFS 0x110 | ||
625 | #define GPIOPK_IRQST_OFFS 0x210 | ||
626 | #define GPIOPK_IRQEN_OFFS 0x214 | ||
627 | #define GPIOPK_IRQPOL_OFFS 0x218 | ||
628 | #define GPIOPK_IRQTM0_OFFS 0x21c | ||
629 | #define GPIOPK_IRQTM1_OFFS 0x220 | ||
630 | #define GPIOPK_CTL_OFFS 0x22c | ||
631 | |||
632 | #define PMGPIO_BASE (APB1_PERI_BASE_VIRT + 0x10000) | ||
633 | #define BACKUP_RAM_BASE PMGPIO_BASE | ||
634 | |||
635 | #define PMGPIO_DAT_OFFS 0x800 | ||
636 | #define PMGPIO_DOE_OFFS 0x804 | ||
637 | #define PMGPIO_FS0_OFFS 0x808 | ||
638 | #define PMGPIO_RPU_OFFS 0x810 | ||
639 | #define PMGPIO_RPD_OFFS 0x814 | ||
640 | #define PMGPIO_DV0_OFFS 0x818 | ||
641 | #define PMGPIO_DV1_OFFS 0x81c | ||
642 | #define PMGPIO_EE0_OFFS 0x820 | ||
643 | #define PMGPIO_EE1_OFFS 0x824 | ||
644 | #define PMGPIO_CTL_OFFS 0x828 | ||
645 | #define PMGPIO_DI_OFFS 0x82c | ||
646 | #define PMGPIO_STR_OFFS 0x830 | ||
647 | #define PMGPIO_STF_OFFS 0x834 | ||
648 | #define PMGPIO_POL_OFFS 0x838 | ||
649 | #define PMGPIO_APB_OFFS 0x800 | ||
650 | |||
651 | /* Clock controller registers */ | ||
652 | #define CKC_BASE ((void __iomem *)(APB1_PERI_BASE_VIRT + 0x6000)) | ||
653 | |||
654 | #define CLKCTRL_OFFS 0x00 | ||
655 | #define PLL0CFG_OFFS 0x04 | ||
656 | #define PLL1CFG_OFFS 0x08 | ||
657 | #define CLKDIVC0_OFFS 0x0c | ||
658 | |||
659 | #define BCLKCTR0_OFFS 0x14 | ||
660 | #define SWRESET0_OFFS 0x18 | ||
661 | |||
662 | #define BCLKCTR1_OFFS 0x60 | ||
663 | #define SWRESET1_OFFS 0x64 | ||
664 | #define PWDCTL_OFFS 0x68 | ||
665 | #define PLL2CFG_OFFS 0x6c | ||
666 | #define CLKDIVC1_OFFS 0x70 | ||
667 | |||
668 | #define ACLKREF_OFFS 0x80 | ||
669 | #define ACLKI2C_OFFS 0x84 | ||
670 | #define ACLKSPI0_OFFS 0x88 | ||
671 | #define ACLKSPI1_OFFS 0x8c | ||
672 | #define ACLKUART0_OFFS 0x90 | ||
673 | #define ACLKUART1_OFFS 0x94 | ||
674 | #define ACLKUART2_OFFS 0x98 | ||
675 | #define ACLKUART3_OFFS 0x9c | ||
676 | #define ACLKUART4_OFFS 0xa0 | ||
677 | #define ACLKTCT_OFFS 0xa4 | ||
678 | #define ACLKTCX_OFFS 0xa8 | ||
679 | #define ACLKTCZ_OFFS 0xac | ||
680 | #define ACLKADC_OFFS 0xb0 | ||
681 | #define ACLKDAI0_OFFS 0xb4 | ||
682 | #define ACLKDAI1_OFFS 0xb8 | ||
683 | #define ACLKLCD_OFFS 0xbc | ||
684 | #define ACLKSPDIF_OFFS 0xc0 | ||
685 | #define ACLKUSBH_OFFS 0xc4 | ||
686 | #define ACLKSDH0_OFFS 0xc8 | ||
687 | #define ACLKSDH1_OFFS 0xcc | ||
688 | #define ACLKC3DEC_OFFS 0xd0 | ||
689 | #define ACLKEXT_OFFS 0xd4 | ||
690 | #define ACLKCAN0_OFFS 0xd8 | ||
691 | #define ACLKCAN1_OFFS 0xdc | ||
692 | #define ACLKGSB0_OFFS 0xe0 | ||
693 | #define ACLKGSB1_OFFS 0xe4 | ||
694 | #define ACLKGSB2_OFFS 0xe8 | ||
695 | #define ACLKGSB3_OFFS 0xec | ||
696 | |||
697 | #define PLLxCFG_PD (1 << 31) | ||
698 | |||
699 | /* CLKCTRL bits */ | ||
700 | #define CLKCTRL_XE (1 << 31) | ||
701 | |||
702 | /* CLKDIVCx bits */ | ||
703 | #define CLKDIVC0_XTE (1 << 7) | ||
704 | #define CLKDIVC0_XE (1 << 15) | ||
705 | #define CLKDIVC0_P1E (1 << 23) | ||
706 | #define CLKDIVC0_P0E (1 << 31) | ||
707 | |||
708 | #define CLKDIVC1_P2E (1 << 7) | ||
709 | |||
710 | /* BCLKCTR0 clock bits */ | ||
711 | #define BCLKCTR0_USBD (1 << 4) | ||
712 | #define BCLKCTR0_ECC (1 << 9) | ||
713 | #define BCLKCTR0_USBH0 (1 << 11) | ||
714 | #define BCLKCTR0_NFC (1 << 16) | ||
715 | |||
716 | /* BCLKCTR1 clock bits */ | ||
717 | #define BCLKCTR1_USBH1 (1 << 20) | ||
718 | |||
719 | /* SWRESET0 bits */ | ||
720 | #define SWRESET0_USBD (1 << 4) | ||
721 | #define SWRESET0_USBH0 (1 << 11) | ||
722 | |||
723 | /* SWRESET1 bits */ | ||
724 | #define SWRESET1_USBH1 (1 << 20) | ||
725 | |||
726 | /* System clock sources. | ||
727 | * Note: These are the clock sources that serve as parents for | ||
728 | * all other clocks. They have no parents themselves. | ||
729 | * | ||
730 | * These values are used for struct clk->root_id. All clocks | ||
731 | * that are not system clock sources have this value set to | ||
732 | * CLK_SRC_NOROOT. | ||
733 | * The values for system clocks start with CLK_SRC_PLL0 == 0 | ||
734 | * because this gives us exactly the values needed for the lower | ||
735 | * 4 bits of ACLK_* registers. Therefore, CLK_SRC_NOROOT is | ||
736 | * defined as -1 to not disturb the order. | ||
737 | */ | ||
738 | enum root_clks { | ||
739 | CLK_SRC_NOROOT = -1, | ||
740 | CLK_SRC_PLL0 = 0, | ||
741 | CLK_SRC_PLL1, | ||
742 | CLK_SRC_PLL0DIV, | ||
743 | CLK_SRC_PLL1DIV, | ||
744 | CLK_SRC_XI, | ||
745 | CLK_SRC_XIDIV, | ||
746 | CLK_SRC_XTI, | ||
747 | CLK_SRC_XTIDIV, | ||
748 | CLK_SRC_PLL2, | ||
749 | CLK_SRC_PLL2DIV, | ||
750 | CLK_SRC_PK0, | ||
751 | CLK_SRC_PK1, | ||
752 | CLK_SRC_PK2, | ||
753 | CLK_SRC_PK3, | ||
754 | CLK_SRC_PK4, | ||
755 | CLK_SRC_48MHZ | ||
756 | }; | ||
757 | |||
758 | #define CLK_SRC_MASK 0xf | ||
759 | |||
760 | /* Bits in ACLK* registers */ | ||
761 | #define ACLK_EN (1 << 28) | ||
762 | #define ACLK_SEL_SHIFT 24 | ||
763 | #define ACLK_SEL_MASK 0x0f000000 | ||
764 | #define ACLK_DIV_MASK 0x00000fff | ||
765 | |||
766 | /* System configuration registers */ | ||
767 | |||
768 | #define SCFG_BASE (APB1_PERI_BASE_VIRT + 0x13000) | ||
769 | |||
770 | #define BMI_OFFS 0x00 | ||
771 | #define AHBCON0_OFFS 0x04 | ||
772 | #define APBPWE_OFFS 0x08 | ||
773 | #define DTCMWAIT_OFFS 0x0c | ||
774 | #define ECCSEL_OFFS 0x10 | ||
775 | #define AHBCON1_OFFS 0x14 | ||
776 | #define SDHCFG_OFFS 0x18 | ||
777 | #define REMAP_OFFS 0x20 | ||
778 | #define LCDSIAE_OFFS 0x24 | ||
779 | #define XMCCFG_OFFS 0xe0 | ||
780 | #define IMCCFG_OFFS 0xe4 | ||
781 | |||
782 | /* Values for ECCSEL */ | ||
783 | #define ECCSEL_EXTMEM 0x0 | ||
784 | #define ECCSEL_DTCM 0x1 | ||
785 | #define ECCSEL_INT_SRAM 0x2 | ||
786 | #define ECCSEL_AHB 0x3 | ||
787 | |||
788 | /* Bits in XMCCFG */ | ||
789 | #define XMCCFG_NFCE (1 << 1) | ||
790 | #define XMCCFG_FDXD (1 << 2) | ||
791 | |||
792 | /* External memory controller registers */ | ||
793 | |||
794 | #define EMC_BASE EXT_MEM_CTRL_BASE | ||
795 | |||
796 | #define SDCFG_OFFS 0x00 | ||
797 | #define SDFSM_OFFS 0x04 | ||
798 | #define MCFG_OFFS 0x08 | ||
799 | |||
800 | #define CSCFG0_OFFS 0x10 | ||
801 | #define CSCFG1_OFFS 0x14 | ||
802 | #define CSCFG2_OFFS 0x18 | ||
803 | #define CSCFG3_OFFS 0x1c | ||
804 | |||
805 | #define MCFG_SDEN (1 << 4) | ||
806 | |||
807 | #endif /* TCC8K_REGS_H */ | ||
diff --git a/arch/arm/plat-tcc/include/mach/timex.h b/arch/arm/plat-tcc/include/mach/timex.h new file mode 100644 index 000000000000..057acbe651d9 --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/timex.h | |||
@@ -0,0 +1,5 @@ | |||
1 | /* | ||
2 | * A definition needed by arch core code. | ||
3 | * | ||
4 | */ | ||
5 | #define CLOCK_TICK_RATE (HZ * 100000UL) | ||
diff --git a/arch/arm/plat-tcc/include/mach/uncompress.h b/arch/arm/plat-tcc/include/mach/uncompress.h new file mode 100644 index 000000000000..7a3e33a27a30 --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/uncompress.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de> | ||
3 | * | ||
4 | * This file is licensed under the terms of the GPL version 2. | ||
5 | */ | ||
6 | |||
7 | #include <linux/serial_reg.h> | ||
8 | #include <linux/types.h> | ||
9 | |||
10 | #include <mach/tcc8k-regs.h> | ||
11 | |||
12 | unsigned int system_rev; | ||
13 | |||
14 | #define ID_MASK 0x7fff | ||
15 | |||
16 | static void putc(int c) | ||
17 | { | ||
18 | u32 *uart_lsr = (u32 *)(UART_BASE_PHYS + (UART_LSR << 2)); | ||
19 | u32 *uart_tx = (u32 *)(UART_BASE_PHYS + (UART_TX << 2)); | ||
20 | |||
21 | while (!(*uart_lsr & UART_LSR_THRE)) | ||
22 | barrier(); | ||
23 | *uart_tx = c; | ||
24 | } | ||
25 | |||
26 | static inline void flush(void) | ||
27 | { | ||
28 | } | ||
29 | |||
30 | /* | ||
31 | * nothing to do | ||
32 | */ | ||
33 | #define arch_decomp_setup() | ||
34 | #define arch_decomp_wdog() | ||
diff --git a/arch/arm/plat-tcc/include/mach/vmalloc.h b/arch/arm/plat-tcc/include/mach/vmalloc.h new file mode 100644 index 000000000000..99414d9c2b94 --- /dev/null +++ b/arch/arm/plat-tcc/include/mach/vmalloc.h | |||
@@ -0,0 +1,10 @@ | |||
1 | /* | ||
2 | * Author: <linux@telechips.com> | ||
3 | * Created: June 10, 2008 | ||
4 | * | ||
5 | * Copyright (C) 2000 Russell King. | ||
6 | * Copyright (C) 2008-2009 Telechips | ||
7 | * | ||
8 | * Licensed under the terms of the GPL v2. | ||
9 | */ | ||
10 | #define VMALLOC_END 0xf0000000UL | ||
diff --git a/arch/arm/plat-tcc/system.c b/arch/arm/plat-tcc/system.c new file mode 100644 index 000000000000..cc208fae3e7a --- /dev/null +++ b/arch/arm/plat-tcc/system.c | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * System functions for Telechips TCCxxxx SoCs | ||
3 | * | ||
4 | * Copyright (C) Hans J. Koch <hjk@linutronix.de> | ||
5 | * | ||
6 | * Licensed under the terms of the GPL v2. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #include <linux/io.h> | ||
11 | |||
12 | #include <mach/tcc8k-regs.h> | ||
13 | |||
14 | /* System reboot */ | ||
15 | void plat_tcc_reboot(void) | ||
16 | { | ||
17 | /* Make sure clocks are on */ | ||
18 | __raw_writel(0xffffffff, CKC_BASE + BCLKCTR0_OFFS); | ||
19 | |||
20 | /* Enable watchdog reset */ | ||
21 | __raw_writel(0x49, TIMER_BASE + TWDCFG_OFFS); | ||
22 | /* Wait for reset */ | ||
23 | while(1) | ||
24 | ; | ||
25 | } | ||
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index f51572772e21..9ac87255a03a 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig | |||
@@ -90,6 +90,7 @@ config PLATFORM_AT32AP | |||
90 | select ARCH_REQUIRE_GPIOLIB | 90 | select ARCH_REQUIRE_GPIOLIB |
91 | select GENERIC_ALLOCATOR | 91 | select GENERIC_ALLOCATOR |
92 | select HAVE_FB_ATMEL | 92 | select HAVE_FB_ATMEL |
93 | select HAVE_NET_MACB | ||
93 | 94 | ||
94 | # | 95 | # |
95 | # CPU types | 96 | # CPU types |
diff --git a/arch/avr32/kernel/module.c b/arch/avr32/kernel/module.c index 98f94d041d9c..a727f54d64d6 100644 --- a/arch/avr32/kernel/module.c +++ b/arch/avr32/kernel/module.c | |||
@@ -314,10 +314,9 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, | |||
314 | vfree(module->arch.syminfo); | 314 | vfree(module->arch.syminfo); |
315 | module->arch.syminfo = NULL; | 315 | module->arch.syminfo = NULL; |
316 | 316 | ||
317 | return module_bug_finalize(hdr, sechdrs, module); | 317 | return 0; |
318 | } | 318 | } |
319 | 319 | ||
320 | void module_arch_cleanup(struct module *module) | 320 | void module_arch_cleanup(struct module *module) |
321 | { | 321 | { |
322 | module_bug_cleanup(module); | ||
323 | } | 322 | } |
diff --git a/arch/h8300/kernel/module.c b/arch/h8300/kernel/module.c index 0865e291c20d..db4953dc4e1b 100644 --- a/arch/h8300/kernel/module.c +++ b/arch/h8300/kernel/module.c | |||
@@ -112,10 +112,9 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
112 | const Elf_Shdr *sechdrs, | 112 | const Elf_Shdr *sechdrs, |
113 | struct module *me) | 113 | struct module *me) |
114 | { | 114 | { |
115 | return module_bug_finalize(hdr, sechdrs, me); | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | void module_arch_cleanup(struct module *mod) | 118 | void module_arch_cleanup(struct module *mod) |
119 | { | 119 | { |
120 | module_bug_cleanup(mod); | ||
121 | } | 120 | } |
diff --git a/arch/m32r/include/asm/signal.h b/arch/m32r/include/asm/signal.h index 9c1acb2b1a92..b2eeb0de1c8d 100644 --- a/arch/m32r/include/asm/signal.h +++ b/arch/m32r/include/asm/signal.h | |||
@@ -157,7 +157,6 @@ typedef struct sigaltstack { | |||
157 | #undef __HAVE_ARCH_SIG_BITOPS | 157 | #undef __HAVE_ARCH_SIG_BITOPS |
158 | 158 | ||
159 | struct pt_regs; | 159 | struct pt_regs; |
160 | extern int do_signal(struct pt_regs *regs, sigset_t *oldset); | ||
161 | 160 | ||
162 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | 161 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) |
163 | 162 | ||
diff --git a/arch/m32r/include/asm/unistd.h b/arch/m32r/include/asm/unistd.h index 76125777483c..c70545689da8 100644 --- a/arch/m32r/include/asm/unistd.h +++ b/arch/m32r/include/asm/unistd.h | |||
@@ -351,6 +351,7 @@ | |||
351 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/ | 351 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/ |
352 | #define __ARCH_WANT_SYS_OLDUMOUNT | 352 | #define __ARCH_WANT_SYS_OLDUMOUNT |
353 | #define __ARCH_WANT_SYS_RT_SIGACTION | 353 | #define __ARCH_WANT_SYS_RT_SIGACTION |
354 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | ||
354 | 355 | ||
355 | #define __IGNORE_lchown | 356 | #define __IGNORE_lchown |
356 | #define __IGNORE_setuid | 357 | #define __IGNORE_setuid |
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S index 403869833b98..225412bc227e 100644 --- a/arch/m32r/kernel/entry.S +++ b/arch/m32r/kernel/entry.S | |||
@@ -235,10 +235,9 @@ work_resched: | |||
235 | work_notifysig: ; deal with pending signals and | 235 | work_notifysig: ; deal with pending signals and |
236 | ; notify-resume requests | 236 | ; notify-resume requests |
237 | mv r0, sp ; arg1 : struct pt_regs *regs | 237 | mv r0, sp ; arg1 : struct pt_regs *regs |
238 | ldi r1, #0 ; arg2 : sigset_t *oldset | 238 | mv r1, r9 ; arg2 : __u32 thread_info_flags |
239 | mv r2, r9 ; arg3 : __u32 thread_info_flags | ||
240 | bl do_notify_resume | 239 | bl do_notify_resume |
241 | bra restore_all | 240 | bra resume_userspace |
242 | 241 | ||
243 | ; perform syscall exit tracing | 242 | ; perform syscall exit tracing |
244 | ALIGN | 243 | ALIGN |
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c index e555091eb97c..0021ade4cba8 100644 --- a/arch/m32r/kernel/ptrace.c +++ b/arch/m32r/kernel/ptrace.c | |||
@@ -592,16 +592,17 @@ void user_enable_single_step(struct task_struct *child) | |||
592 | 592 | ||
593 | if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0) | 593 | if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0) |
594 | != sizeof(insn)) | 594 | != sizeof(insn)) |
595 | break; | 595 | return -EIO; |
596 | 596 | ||
597 | compute_next_pc(insn, pc, &next_pc, child); | 597 | compute_next_pc(insn, pc, &next_pc, child); |
598 | if (next_pc & 0x80000000) | 598 | if (next_pc & 0x80000000) |
599 | break; | 599 | return -EIO; |
600 | 600 | ||
601 | if (embed_debug_trap(child, next_pc)) | 601 | if (embed_debug_trap(child, next_pc)) |
602 | break; | 602 | return -EIO; |
603 | 603 | ||
604 | invalidate_cache(); | 604 | invalidate_cache(); |
605 | return 0; | ||
605 | } | 606 | } |
606 | 607 | ||
607 | void user_disable_single_step(struct task_struct *child) | 608 | void user_disable_single_step(struct task_struct *child) |
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c index 144b0f124fc7..7bbe38645ed5 100644 --- a/arch/m32r/kernel/signal.c +++ b/arch/m32r/kernel/signal.c | |||
@@ -28,37 +28,6 @@ | |||
28 | 28 | ||
29 | #define DEBUG_SIG 0 | 29 | #define DEBUG_SIG 0 |
30 | 30 | ||
31 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
32 | |||
33 | int do_signal(struct pt_regs *, sigset_t *); | ||
34 | |||
35 | asmlinkage int | ||
36 | sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, | ||
37 | unsigned long r2, unsigned long r3, unsigned long r4, | ||
38 | unsigned long r5, unsigned long r6, struct pt_regs *regs) | ||
39 | { | ||
40 | sigset_t newset; | ||
41 | |||
42 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
43 | if (sigsetsize != sizeof(sigset_t)) | ||
44 | return -EINVAL; | ||
45 | |||
46 | if (copy_from_user(&newset, unewset, sizeof(newset))) | ||
47 | return -EFAULT; | ||
48 | sigdelsetmask(&newset, sigmask(SIGKILL)|sigmask(SIGSTOP)); | ||
49 | |||
50 | spin_lock_irq(¤t->sighand->siglock); | ||
51 | current->saved_sigmask = current->blocked; | ||
52 | current->blocked = newset; | ||
53 | recalc_sigpending(); | ||
54 | spin_unlock_irq(¤t->sighand->siglock); | ||
55 | |||
56 | current->state = TASK_INTERRUPTIBLE; | ||
57 | schedule(); | ||
58 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
59 | return -ERESTARTNOHAND; | ||
60 | } | ||
61 | |||
62 | asmlinkage int | 31 | asmlinkage int |
63 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | 32 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, |
64 | unsigned long r2, unsigned long r3, unsigned long r4, | 33 | unsigned long r2, unsigned long r3, unsigned long r4, |
@@ -218,7 +187,7 @@ get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size) | |||
218 | return (void __user *)((sp - frame_size) & -8ul); | 187 | return (void __user *)((sp - frame_size) & -8ul); |
219 | } | 188 | } |
220 | 189 | ||
221 | static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | 190 | static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, |
222 | sigset_t *set, struct pt_regs *regs) | 191 | sigset_t *set, struct pt_regs *regs) |
223 | { | 192 | { |
224 | struct rt_sigframe __user *frame; | 193 | struct rt_sigframe __user *frame; |
@@ -275,22 +244,34 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
275 | current->comm, current->pid, frame, regs->pc); | 244 | current->comm, current->pid, frame, regs->pc); |
276 | #endif | 245 | #endif |
277 | 246 | ||
278 | return; | 247 | return 0; |
279 | 248 | ||
280 | give_sigsegv: | 249 | give_sigsegv: |
281 | force_sigsegv(sig, current); | 250 | force_sigsegv(sig, current); |
251 | return -EFAULT; | ||
252 | } | ||
253 | |||
254 | static int prev_insn(struct pt_regs *regs) | ||
255 | { | ||
256 | u16 inst; | ||
257 | if (get_user(&inst, (u16 __user *)(regs->bpc - 2))) | ||
258 | return -EFAULT; | ||
259 | if ((inst & 0xfff0) == 0x10f0) /* trap ? */ | ||
260 | regs->bpc -= 2; | ||
261 | else | ||
262 | regs->bpc -= 4; | ||
263 | regs->syscall_nr = -1; | ||
264 | return 0; | ||
282 | } | 265 | } |
283 | 266 | ||
284 | /* | 267 | /* |
285 | * OK, we're invoking a handler | 268 | * OK, we're invoking a handler |
286 | */ | 269 | */ |
287 | 270 | ||
288 | static void | 271 | static int |
289 | handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | 272 | handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, |
290 | sigset_t *oldset, struct pt_regs *regs) | 273 | sigset_t *oldset, struct pt_regs *regs) |
291 | { | 274 | { |
292 | unsigned short inst; | ||
293 | |||
294 | /* Are we from a system call? */ | 275 | /* Are we from a system call? */ |
295 | if (regs->syscall_nr >= 0) { | 276 | if (regs->syscall_nr >= 0) { |
296 | /* If so, check system call restarting.. */ | 277 | /* If so, check system call restarting.. */ |
@@ -308,16 +289,14 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
308 | /* fallthrough */ | 289 | /* fallthrough */ |
309 | case -ERESTARTNOINTR: | 290 | case -ERESTARTNOINTR: |
310 | regs->r0 = regs->orig_r0; | 291 | regs->r0 = regs->orig_r0; |
311 | inst = *(unsigned short *)(regs->bpc - 2); | 292 | if (prev_insn(regs) < 0) |
312 | if ((inst & 0xfff0) == 0x10f0) /* trap ? */ | 293 | return -EFAULT; |
313 | regs->bpc -= 2; | ||
314 | else | ||
315 | regs->bpc -= 4; | ||
316 | } | 294 | } |
317 | } | 295 | } |
318 | 296 | ||
319 | /* Set up the stack frame */ | 297 | /* Set up the stack frame */ |
320 | setup_rt_frame(sig, ka, info, oldset, regs); | 298 | if (setup_rt_frame(sig, ka, info, oldset, regs)) |
299 | return -EFAULT; | ||
321 | 300 | ||
322 | spin_lock_irq(¤t->sighand->siglock); | 301 | spin_lock_irq(¤t->sighand->siglock); |
323 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); | 302 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); |
@@ -325,6 +304,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
325 | sigaddset(¤t->blocked,sig); | 304 | sigaddset(¤t->blocked,sig); |
326 | recalc_sigpending(); | 305 | recalc_sigpending(); |
327 | spin_unlock_irq(¤t->sighand->siglock); | 306 | spin_unlock_irq(¤t->sighand->siglock); |
307 | return 0; | ||
328 | } | 308 | } |
329 | 309 | ||
330 | /* | 310 | /* |
@@ -332,12 +312,12 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
332 | * want to handle. Thus you cannot kill init even with a SIGKILL even by | 312 | * want to handle. Thus you cannot kill init even with a SIGKILL even by |
333 | * mistake. | 313 | * mistake. |
334 | */ | 314 | */ |
335 | int do_signal(struct pt_regs *regs, sigset_t *oldset) | 315 | static void do_signal(struct pt_regs *regs) |
336 | { | 316 | { |
337 | siginfo_t info; | 317 | siginfo_t info; |
338 | int signr; | 318 | int signr; |
339 | struct k_sigaction ka; | 319 | struct k_sigaction ka; |
340 | unsigned short inst; | 320 | sigset_t *oldset; |
341 | 321 | ||
342 | /* | 322 | /* |
343 | * We want the common case to go fast, which | 323 | * We want the common case to go fast, which |
@@ -346,12 +326,14 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) | |||
346 | * if so. | 326 | * if so. |
347 | */ | 327 | */ |
348 | if (!user_mode(regs)) | 328 | if (!user_mode(regs)) |
349 | return 1; | 329 | return; |
350 | 330 | ||
351 | if (try_to_freeze()) | 331 | if (try_to_freeze()) |
352 | goto no_signal; | 332 | goto no_signal; |
353 | 333 | ||
354 | if (!oldset) | 334 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) |
335 | oldset = ¤t->saved_sigmask; | ||
336 | else | ||
355 | oldset = ¤t->blocked; | 337 | oldset = ¤t->blocked; |
356 | 338 | ||
357 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 339 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
@@ -363,8 +345,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) | |||
363 | */ | 345 | */ |
364 | 346 | ||
365 | /* Whee! Actually deliver the signal. */ | 347 | /* Whee! Actually deliver the signal. */ |
366 | handle_signal(signr, &ka, &info, oldset, regs); | 348 | if (handle_signal(signr, &ka, &info, oldset, regs) == 0) |
367 | return 1; | 349 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
350 | |||
351 | return; | ||
368 | } | 352 | } |
369 | 353 | ||
370 | no_signal: | 354 | no_signal: |
@@ -375,31 +359,24 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) | |||
375 | regs->r0 == -ERESTARTSYS || | 359 | regs->r0 == -ERESTARTSYS || |
376 | regs->r0 == -ERESTARTNOINTR) { | 360 | regs->r0 == -ERESTARTNOINTR) { |
377 | regs->r0 = regs->orig_r0; | 361 | regs->r0 = regs->orig_r0; |
378 | inst = *(unsigned short *)(regs->bpc - 2); | 362 | prev_insn(regs); |
379 | if ((inst & 0xfff0) == 0x10f0) /* trap ? */ | 363 | } else if (regs->r0 == -ERESTART_RESTARTBLOCK){ |
380 | regs->bpc -= 2; | ||
381 | else | ||
382 | regs->bpc -= 4; | ||
383 | } | ||
384 | if (regs->r0 == -ERESTART_RESTARTBLOCK){ | ||
385 | regs->r0 = regs->orig_r0; | 364 | regs->r0 = regs->orig_r0; |
386 | regs->r7 = __NR_restart_syscall; | 365 | regs->r7 = __NR_restart_syscall; |
387 | inst = *(unsigned short *)(regs->bpc - 2); | 366 | prev_insn(regs); |
388 | if ((inst & 0xfff0) == 0x10f0) /* trap ? */ | ||
389 | regs->bpc -= 2; | ||
390 | else | ||
391 | regs->bpc -= 4; | ||
392 | } | 367 | } |
393 | } | 368 | } |
394 | return 0; | 369 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { |
370 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
371 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
372 | } | ||
395 | } | 373 | } |
396 | 374 | ||
397 | /* | 375 | /* |
398 | * notification of userspace execution resumption | 376 | * notification of userspace execution resumption |
399 | * - triggered by current->work.notify_resume | 377 | * - triggered by current->work.notify_resume |
400 | */ | 378 | */ |
401 | void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, | 379 | void do_notify_resume(struct pt_regs *regs, __u32 thread_info_flags) |
402 | __u32 thread_info_flags) | ||
403 | { | 380 | { |
404 | /* Pending single-step? */ | 381 | /* Pending single-step? */ |
405 | if (thread_info_flags & _TIF_SINGLESTEP) | 382 | if (thread_info_flags & _TIF_SINGLESTEP) |
@@ -407,7 +384,7 @@ void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, | |||
407 | 384 | ||
408 | /* deal with pending signal delivery */ | 385 | /* deal with pending signal delivery */ |
409 | if (thread_info_flags & _TIF_SIGPENDING) | 386 | if (thread_info_flags & _TIF_SIGPENDING) |
410 | do_signal(regs,oldset); | 387 | do_signal(regs); |
411 | 388 | ||
412 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { | 389 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { |
413 | clear_thread_flag(TIF_NOTIFY_RESUME); | 390 | clear_thread_flag(TIF_NOTIFY_RESUME); |
diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c index 8f0640847ad2..05285d08e547 100644 --- a/arch/m68k/mac/macboing.c +++ b/arch/m68k/mac/macboing.c | |||
@@ -162,7 +162,7 @@ static void mac_init_asc( void ) | |||
162 | void mac_mksound( unsigned int freq, unsigned int length ) | 162 | void mac_mksound( unsigned int freq, unsigned int length ) |
163 | { | 163 | { |
164 | __u32 cfreq = ( freq << 5 ) / 468; | 164 | __u32 cfreq = ( freq << 5 ) / 468; |
165 | __u32 flags; | 165 | unsigned long flags; |
166 | int i; | 166 | int i; |
167 | 167 | ||
168 | if ( mac_special_bell == NULL ) | 168 | if ( mac_special_bell == NULL ) |
@@ -224,7 +224,7 @@ static void mac_nosound( unsigned long ignored ) | |||
224 | */ | 224 | */ |
225 | static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsigned int volume ) | 225 | static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsigned int volume ) |
226 | { | 226 | { |
227 | __u32 flags; | 227 | unsigned long flags; |
228 | 228 | ||
229 | /* if the bell is already ringing, ring longer */ | 229 | /* if the bell is already ringing, ring longer */ |
230 | if ( mac_bell_duration > 0 ) | 230 | if ( mac_bell_duration > 0 ) |
@@ -271,7 +271,7 @@ static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsig | |||
271 | static void mac_quadra_ring_bell( unsigned long ignored ) | 271 | static void mac_quadra_ring_bell( unsigned long ignored ) |
272 | { | 272 | { |
273 | int i, count = mac_asc_samplespersec / HZ; | 273 | int i, count = mac_asc_samplespersec / HZ; |
274 | __u32 flags; | 274 | unsigned long flags; |
275 | 275 | ||
276 | /* | 276 | /* |
277 | * we neither want a sound buffer overflow nor underflow, so we need to match | 277 | * we neither want a sound buffer overflow nor underflow, so we need to match |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 3ad59dde4852..5526faabfc21 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -13,6 +13,7 @@ config MIPS | |||
13 | select HAVE_KPROBES | 13 | select HAVE_KPROBES |
14 | select HAVE_KRETPROBES | 14 | select HAVE_KRETPROBES |
15 | select RTC_LIB if !MACH_LOONGSON | 15 | select RTC_LIB if !MACH_LOONGSON |
16 | select GENERIC_ATOMIC64 if !64BIT | ||
16 | 17 | ||
17 | mainmenu "Linux/MIPS Kernel Configuration" | 18 | mainmenu "Linux/MIPS Kernel Configuration" |
18 | 19 | ||
@@ -1646,8 +1647,16 @@ config MIPS_MT_SMP | |||
1646 | select SYS_SUPPORTS_SMP | 1647 | select SYS_SUPPORTS_SMP |
1647 | select SMP_UP | 1648 | select SMP_UP |
1648 | help | 1649 | help |
1649 | This is a kernel model which is also known a VSMP or lately | 1650 | This is a kernel model which is known a VSMP but lately has been |
1650 | has been marketesed into SMVP. | 1651 | marketesed into SMVP. |
1652 | Virtual SMP uses the processor's VPEs to implement virtual | ||
1653 | processors. In currently available configuration of the 34K processor | ||
1654 | this allows for a dual processor. Both processors will share the same | ||
1655 | primary caches; each will obtain the half of the TLB for it's own | ||
1656 | exclusive use. For a layman this model can be described as similar to | ||
1657 | what Intel calls Hyperthreading. | ||
1658 | |||
1659 | For further information see http://www.linux-mips.org/wiki/34K#VSMP | ||
1651 | 1660 | ||
1652 | config MIPS_MT_SMTC | 1661 | config MIPS_MT_SMTC |
1653 | bool "SMTC: Use all TCs on all VPEs for SMP" | 1662 | bool "SMTC: Use all TCs on all VPEs for SMP" |
@@ -1664,6 +1673,14 @@ config MIPS_MT_SMTC | |||
1664 | help | 1673 | help |
1665 | This is a kernel model which is known a SMTC or lately has been | 1674 | This is a kernel model which is known a SMTC or lately has been |
1666 | marketesed into SMVP. | 1675 | marketesed into SMVP. |
1676 | is presenting the available TC's of the core as processors to Linux. | ||
1677 | On currently available 34K processors this means a Linux system will | ||
1678 | see up to 5 processors. The implementation of the SMTC kernel differs | ||
1679 | significantly from VSMP and cannot efficiently coexist in the same | ||
1680 | kernel binary so the choice between VSMP and SMTC is a compile time | ||
1681 | decision. | ||
1682 | |||
1683 | For further information see http://www.linux-mips.org/wiki/34K#SMTC | ||
1667 | 1684 | ||
1668 | endchoice | 1685 | endchoice |
1669 | 1686 | ||
diff --git a/arch/mips/alchemy/common/prom.c b/arch/mips/alchemy/common/prom.c index c29511b11d44..534021059629 100644 --- a/arch/mips/alchemy/common/prom.c +++ b/arch/mips/alchemy/common/prom.c | |||
@@ -43,7 +43,7 @@ int prom_argc; | |||
43 | char **prom_argv; | 43 | char **prom_argv; |
44 | char **prom_envp; | 44 | char **prom_envp; |
45 | 45 | ||
46 | void prom_init_cmdline(void) | 46 | void __init prom_init_cmdline(void) |
47 | { | 47 | { |
48 | int i; | 48 | int i; |
49 | 49 | ||
@@ -104,7 +104,7 @@ static inline void str2eaddr(unsigned char *ea, unsigned char *str) | |||
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | int prom_get_ethernet_addr(char *ethernet_addr) | 107 | int __init prom_get_ethernet_addr(char *ethernet_addr) |
108 | { | 108 | { |
109 | char *ethaddr_str; | 109 | char *ethaddr_str; |
110 | 110 | ||
@@ -123,7 +123,6 @@ int prom_get_ethernet_addr(char *ethernet_addr) | |||
123 | 123 | ||
124 | return 0; | 124 | return 0; |
125 | } | 125 | } |
126 | EXPORT_SYMBOL(prom_get_ethernet_addr); | ||
127 | 126 | ||
128 | void __init prom_free_prom_memory(void) | 127 | void __init prom_free_prom_memory(void) |
129 | { | 128 | { |
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index ed9bb709c9a3..5fd7f7a58b7e 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile | |||
@@ -59,7 +59,7 @@ $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE | |||
59 | hostprogs-y := calc_vmlinuz_load_addr | 59 | hostprogs-y := calc_vmlinuz_load_addr |
60 | 60 | ||
61 | VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \ | 61 | VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \ |
62 | $(objtree)/$(KBUILD_IMAGE) $(VMLINUX_LOAD_ADDRESS)) | 62 | $(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS)) |
63 | 63 | ||
64 | vmlinuzobjs-y += $(obj)/piggy.o | 64 | vmlinuzobjs-y += $(obj)/piggy.o |
65 | 65 | ||
diff --git a/arch/mips/cavium-octeon/Kconfig b/arch/mips/cavium-octeon/Kconfig index 094c17e38e16..47323ca452dc 100644 --- a/arch/mips/cavium-octeon/Kconfig +++ b/arch/mips/cavium-octeon/Kconfig | |||
@@ -83,3 +83,7 @@ config ARCH_SPARSEMEM_ENABLE | |||
83 | def_bool y | 83 | def_bool y |
84 | select SPARSEMEM_STATIC | 84 | select SPARSEMEM_STATIC |
85 | depends on CPU_CAVIUM_OCTEON | 85 | depends on CPU_CAVIUM_OCTEON |
86 | |||
87 | config CAVIUM_OCTEON_HELPER | ||
88 | def_bool y | ||
89 | depends on OCTEON_ETHERNET || PCI | ||
diff --git a/arch/mips/cavium-octeon/cpu.c b/arch/mips/cavium-octeon/cpu.c index c664c8cc2b42..a5b427909b5c 100644 --- a/arch/mips/cavium-octeon/cpu.c +++ b/arch/mips/cavium-octeon/cpu.c | |||
@@ -41,7 +41,7 @@ static int cnmips_cu2_call(struct notifier_block *nfb, unsigned long action, | |||
41 | return NOTIFY_OK; /* Let default notifier send signals */ | 41 | return NOTIFY_OK; /* Let default notifier send signals */ |
42 | } | 42 | } |
43 | 43 | ||
44 | static int cnmips_cu2_setup(void) | 44 | static int __init cnmips_cu2_setup(void) |
45 | { | 45 | { |
46 | return cu2_notifier(cnmips_cu2_call, 0); | 46 | return cu2_notifier(cnmips_cu2_call, 0); |
47 | } | 47 | } |
diff --git a/arch/mips/cavium-octeon/executive/Makefile b/arch/mips/cavium-octeon/executive/Makefile index 2fd66db6939e..7f41c5be2190 100644 --- a/arch/mips/cavium-octeon/executive/Makefile +++ b/arch/mips/cavium-octeon/executive/Makefile | |||
@@ -11,4 +11,4 @@ | |||
11 | 11 | ||
12 | obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o | 12 | obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o |
13 | 13 | ||
14 | obj-$(CONFIG_PCI) += cvmx-helper-errata.o cvmx-helper-jtag.o | 14 | obj-$(CONFIG_CAVIUM_OCTEON_HELPER) += cvmx-helper-errata.o cvmx-helper-jtag.o |
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h index c63c56bfd184..47d87da379f9 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h | |||
@@ -782,6 +782,10 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | |||
782 | */ | 782 | */ |
783 | #define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0) | 783 | #define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0) |
784 | 784 | ||
785 | #else /* !CONFIG_64BIT */ | ||
786 | |||
787 | #include <asm-generic/atomic64.h> | ||
788 | |||
785 | #endif /* CONFIG_64BIT */ | 789 | #endif /* CONFIG_64BIT */ |
786 | 790 | ||
787 | /* | 791 | /* |
diff --git a/arch/mips/include/asm/cop2.h b/arch/mips/include/asm/cop2.h index 2cb2f0c2c4f8..3532e2c5f098 100644 --- a/arch/mips/include/asm/cop2.h +++ b/arch/mips/include/asm/cop2.h | |||
@@ -24,7 +24,7 @@ extern int cu2_notifier_call_chain(unsigned long val, void *v); | |||
24 | 24 | ||
25 | #define cu2_notifier(fn, pri) \ | 25 | #define cu2_notifier(fn, pri) \ |
26 | ({ \ | 26 | ({ \ |
27 | static struct notifier_block fn##_nb __cpuinitdata = { \ | 27 | static struct notifier_block fn##_nb = { \ |
28 | .notifier_call = fn, \ | 28 | .notifier_call = fn, \ |
29 | .priority = pri \ | 29 | .priority = pri \ |
30 | }; \ | 30 | }; \ |
diff --git a/arch/mips/include/asm/gic.h b/arch/mips/include/asm/gic.h index 9b9436a4d816..86548da650e7 100644 --- a/arch/mips/include/asm/gic.h +++ b/arch/mips/include/asm/gic.h | |||
@@ -321,6 +321,7 @@ struct gic_intrmask_regs { | |||
321 | */ | 321 | */ |
322 | struct gic_intr_map { | 322 | struct gic_intr_map { |
323 | unsigned int cpunum; /* Directed to this CPU */ | 323 | unsigned int cpunum; /* Directed to this CPU */ |
324 | #define GIC_UNUSED 0xdead /* Dummy data */ | ||
324 | unsigned int pin; /* Directed to this Pin */ | 325 | unsigned int pin; /* Directed to this Pin */ |
325 | unsigned int polarity; /* Polarity : +/- */ | 326 | unsigned int polarity; /* Polarity : +/- */ |
326 | unsigned int trigtype; /* Trigger : Edge/Levl */ | 327 | unsigned int trigtype; /* Trigger : Edge/Levl */ |
diff --git a/arch/mips/include/asm/mach-tx49xx/kmalloc.h b/arch/mips/include/asm/mach-tx49xx/kmalloc.h index b74caf65482b..ff9a8b86cb93 100644 --- a/arch/mips/include/asm/mach-tx49xx/kmalloc.h +++ b/arch/mips/include/asm/mach-tx49xx/kmalloc.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #ifndef __ASM_MACH_TX49XX_KMALLOC_H | 1 | #ifndef __ASM_MACH_TX49XX_KMALLOC_H |
2 | #define __ASM_MACH_TX49XX_KMALLOC_H | 2 | #define __ASM_MACH_TX49XX_KMALLOC_H |
3 | 3 | ||
4 | #define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES | 4 | #define ARCH_DMA_MINALIGN L1_CACHE_BYTES |
5 | 5 | ||
6 | #endif /* __ASM_MACH_TX49XX_KMALLOC_H */ | 6 | #endif /* __ASM_MACH_TX49XX_KMALLOC_H */ |
diff --git a/arch/mips/include/asm/mips-boards/maltaint.h b/arch/mips/include/asm/mips-boards/maltaint.h index cea872fc6f5c..d11aa02a956a 100644 --- a/arch/mips/include/asm/mips-boards/maltaint.h +++ b/arch/mips/include/asm/mips-boards/maltaint.h | |||
@@ -88,9 +88,6 @@ | |||
88 | 88 | ||
89 | #define GIC_EXT_INTR(x) x | 89 | #define GIC_EXT_INTR(x) x |
90 | 90 | ||
91 | /* Dummy data */ | ||
92 | #define X 0xdead | ||
93 | |||
94 | /* External Interrupts used for IPI */ | 91 | /* External Interrupts used for IPI */ |
95 | #define GIC_IPI_EXT_INTR_RESCHED_VPE0 16 | 92 | #define GIC_IPI_EXT_INTR_RESCHED_VPE0 16 |
96 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE0 17 | 93 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE0 17 |
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h index a16beafcea91..e59cd1ac09c2 100644 --- a/arch/mips/include/asm/page.h +++ b/arch/mips/include/asm/page.h | |||
@@ -150,6 +150,20 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
150 | ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) | 150 | ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) |
151 | #endif | 151 | #endif |
152 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) | 152 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET)) |
153 | |||
154 | /* | ||
155 | * RELOC_HIDE was originally added by 6007b903dfe5f1d13e0c711ac2894bdd4a61b1ad | ||
156 | * (lmo) rsp. 8431fd094d625b94d364fe393076ccef88e6ce18 (kernel.org). The | ||
157 | * discussion can be found in lkml posting | ||
158 | * <a2ebde260608230500o3407b108hc03debb9da6e62c@mail.gmail.com> which is | ||
159 | * archived at http://lists.linuxcoding.com/kernel/2006-q3/msg17360.html | ||
160 | * | ||
161 | * It is unclear if the misscompilations mentioned in | ||
162 | * http://lkml.org/lkml/2010/8/8/138 also affect MIPS so we keep this one | ||
163 | * until GCC 3.x has been retired before we can apply | ||
164 | * https://patchwork.linux-mips.org/patch/1541/ | ||
165 | */ | ||
166 | |||
153 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) | 167 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) |
154 | 168 | ||
155 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 169 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h index 2376f2e06e47..70df9c0d3c5b 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h | |||
@@ -146,7 +146,8 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
146 | #define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH) | 146 | #define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH) |
147 | 147 | ||
148 | /* work to do on interrupt/exception return */ | 148 | /* work to do on interrupt/exception return */ |
149 | #define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP) | 149 | #define _TIF_WORK_MASK (0x0000ffef & \ |
150 | ~(_TIF_SECCOMP | _TIF_SYSCALL_AUDIT)) | ||
150 | /* work to do on any return to u-space */ | 151 | /* work to do on any return to u-space */ |
151 | #define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP) | 152 | #define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP) |
152 | 153 | ||
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index baa318a59c97..550725b881d5 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h | |||
@@ -356,16 +356,19 @@ | |||
356 | #define __NR_perf_event_open (__NR_Linux + 333) | 356 | #define __NR_perf_event_open (__NR_Linux + 333) |
357 | #define __NR_accept4 (__NR_Linux + 334) | 357 | #define __NR_accept4 (__NR_Linux + 334) |
358 | #define __NR_recvmmsg (__NR_Linux + 335) | 358 | #define __NR_recvmmsg (__NR_Linux + 335) |
359 | #define __NR_fanotify_init (__NR_Linux + 336) | ||
360 | #define __NR_fanotify_mark (__NR_Linux + 337) | ||
361 | #define __NR_prlimit64 (__NR_Linux + 338) | ||
359 | 362 | ||
360 | /* | 363 | /* |
361 | * Offset of the last Linux o32 flavoured syscall | 364 | * Offset of the last Linux o32 flavoured syscall |
362 | */ | 365 | */ |
363 | #define __NR_Linux_syscalls 335 | 366 | #define __NR_Linux_syscalls 338 |
364 | 367 | ||
365 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 368 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
366 | 369 | ||
367 | #define __NR_O32_Linux 4000 | 370 | #define __NR_O32_Linux 4000 |
368 | #define __NR_O32_Linux_syscalls 335 | 371 | #define __NR_O32_Linux_syscalls 338 |
369 | 372 | ||
370 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 373 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
371 | 374 | ||
@@ -668,16 +671,19 @@ | |||
668 | #define __NR_perf_event_open (__NR_Linux + 292) | 671 | #define __NR_perf_event_open (__NR_Linux + 292) |
669 | #define __NR_accept4 (__NR_Linux + 293) | 672 | #define __NR_accept4 (__NR_Linux + 293) |
670 | #define __NR_recvmmsg (__NR_Linux + 294) | 673 | #define __NR_recvmmsg (__NR_Linux + 294) |
674 | #define __NR_fanotify_init (__NR_Linux + 295) | ||
675 | #define __NR_fanotify_mark (__NR_Linux + 296) | ||
676 | #define __NR_prlimit64 (__NR_Linux + 297) | ||
671 | 677 | ||
672 | /* | 678 | /* |
673 | * Offset of the last Linux 64-bit flavoured syscall | 679 | * Offset of the last Linux 64-bit flavoured syscall |
674 | */ | 680 | */ |
675 | #define __NR_Linux_syscalls 294 | 681 | #define __NR_Linux_syscalls 297 |
676 | 682 | ||
677 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 683 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
678 | 684 | ||
679 | #define __NR_64_Linux 5000 | 685 | #define __NR_64_Linux 5000 |
680 | #define __NR_64_Linux_syscalls 294 | 686 | #define __NR_64_Linux_syscalls 297 |
681 | 687 | ||
682 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 688 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
683 | 689 | ||
@@ -985,16 +991,19 @@ | |||
985 | #define __NR_accept4 (__NR_Linux + 297) | 991 | #define __NR_accept4 (__NR_Linux + 297) |
986 | #define __NR_recvmmsg (__NR_Linux + 298) | 992 | #define __NR_recvmmsg (__NR_Linux + 298) |
987 | #define __NR_getdents64 (__NR_Linux + 299) | 993 | #define __NR_getdents64 (__NR_Linux + 299) |
994 | #define __NR_fanotify_init (__NR_Linux + 300) | ||
995 | #define __NR_fanotify_mark (__NR_Linux + 301) | ||
996 | #define __NR_prlimit64 (__NR_Linux + 302) | ||
988 | 997 | ||
989 | /* | 998 | /* |
990 | * Offset of the last N32 flavoured syscall | 999 | * Offset of the last N32 flavoured syscall |
991 | */ | 1000 | */ |
992 | #define __NR_Linux_syscalls 299 | 1001 | #define __NR_Linux_syscalls 302 |
993 | 1002 | ||
994 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 1003 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
995 | 1004 | ||
996 | #define __NR_N32_Linux 6000 | 1005 | #define __NR_N32_Linux 6000 |
997 | #define __NR_N32_Linux_syscalls 299 | 1006 | #define __NR_N32_Linux_syscalls 302 |
998 | 1007 | ||
999 | #ifdef __KERNEL__ | 1008 | #ifdef __KERNEL__ |
1000 | 1009 | ||
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c index b181f2f0ea8e..82ba9f62f49e 100644 --- a/arch/mips/kernel/irq-gic.c +++ b/arch/mips/kernel/irq-gic.c | |||
@@ -7,7 +7,6 @@ | |||
7 | #include <asm/io.h> | 7 | #include <asm/io.h> |
8 | #include <asm/gic.h> | 8 | #include <asm/gic.h> |
9 | #include <asm/gcmpregs.h> | 9 | #include <asm/gcmpregs.h> |
10 | #include <asm/mips-boards/maltaint.h> | ||
11 | #include <asm/irq.h> | 10 | #include <asm/irq.h> |
12 | #include <linux/hardirq.h> | 11 | #include <linux/hardirq.h> |
13 | #include <asm-generic/bitops/find.h> | 12 | #include <asm-generic/bitops/find.h> |
@@ -131,7 +130,7 @@ static int gic_set_affinity(unsigned int irq, const struct cpumask *cpumask) | |||
131 | int i; | 130 | int i; |
132 | 131 | ||
133 | irq -= _irqbase; | 132 | irq -= _irqbase; |
134 | pr_debug(KERN_DEBUG "%s(%d) called\n", __func__, irq); | 133 | pr_debug("%s(%d) called\n", __func__, irq); |
135 | cpumask_and(&tmp, cpumask, cpu_online_mask); | 134 | cpumask_and(&tmp, cpumask, cpu_online_mask); |
136 | if (cpus_empty(tmp)) | 135 | if (cpus_empty(tmp)) |
137 | return -1; | 136 | return -1; |
@@ -222,7 +221,7 @@ static void __init gic_basic_init(int numintrs, int numvpes, | |||
222 | /* Setup specifics */ | 221 | /* Setup specifics */ |
223 | for (i = 0; i < mapsize; i++) { | 222 | for (i = 0; i < mapsize; i++) { |
224 | cpu = intrmap[i].cpunum; | 223 | cpu = intrmap[i].cpunum; |
225 | if (cpu == X) | 224 | if (cpu == GIC_UNUSED) |
226 | continue; | 225 | continue; |
227 | if (cpu == 0 && i != 0 && intrmap[i].flags == 0) | 226 | if (cpu == 0 && i != 0 && intrmap[i].flags == 0) |
228 | continue; | 227 | continue; |
diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c index 1f4e2fa64140..f4546e97c60d 100644 --- a/arch/mips/kernel/kgdb.c +++ b/arch/mips/kernel/kgdb.c | |||
@@ -283,7 +283,7 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd, | |||
283 | struct pt_regs *regs = args->regs; | 283 | struct pt_regs *regs = args->regs; |
284 | int trap = (regs->cp0_cause & 0x7c) >> 2; | 284 | int trap = (regs->cp0_cause & 0x7c) >> 2; |
285 | 285 | ||
286 | /* Userpace events, ignore. */ | 286 | /* Userspace events, ignore. */ |
287 | if (user_mode(regs)) | 287 | if (user_mode(regs)) |
288 | return NOTIFY_DONE; | 288 | return NOTIFY_DONE; |
289 | 289 | ||
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c index 80e2ba694bab..29811f043399 100644 --- a/arch/mips/kernel/kspd.c +++ b/arch/mips/kernel/kspd.c | |||
@@ -251,7 +251,7 @@ void sp_work_handle_request(void) | |||
251 | memset(&tz, 0, sizeof(tz)); | 251 | memset(&tz, 0, sizeof(tz)); |
252 | if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv, | 252 | if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv, |
253 | (int)&tz, 0, 0)) == 0) | 253 | (int)&tz, 0, 0)) == 0) |
254 | ret.retval = tv.tv_sec; | 254 | ret.retval = tv.tv_sec; |
255 | break; | 255 | break; |
256 | 256 | ||
257 | case MTSP_SYSCALL_EXIT: | 257 | case MTSP_SYSCALL_EXIT: |
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index c2dab140dc98..6343b4a5b835 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -341,3 +341,10 @@ asmlinkage long sys32_lookup_dcookie(u32 a0, u32 a1, char __user *buf, | |||
341 | { | 341 | { |
342 | return sys_lookup_dcookie(merge_64(a0, a1), buf, len); | 342 | return sys_lookup_dcookie(merge_64(a0, a1), buf, len); |
343 | } | 343 | } |
344 | |||
345 | SYSCALL_DEFINE6(32_fanotify_mark, int, fanotify_fd, unsigned int, flags, | ||
346 | u64, a3, u64, a4, int, dfd, const char __user *, pathname) | ||
347 | { | ||
348 | return sys_fanotify_mark(fanotify_fd, flags, merge_64(a3, a4), | ||
349 | dfd, pathname); | ||
350 | } | ||
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 17202bbe843f..584415eef8c9 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -583,7 +583,10 @@ einval: li v0, -ENOSYS | |||
583 | sys sys_rt_tgsigqueueinfo 4 | 583 | sys sys_rt_tgsigqueueinfo 4 |
584 | sys sys_perf_event_open 5 | 584 | sys sys_perf_event_open 5 |
585 | sys sys_accept4 4 | 585 | sys sys_accept4 4 |
586 | sys sys_recvmmsg 5 | 586 | sys sys_recvmmsg 5 /* 4335 */ |
587 | sys sys_fanotify_init 2 | ||
588 | sys sys_fanotify_mark 6 | ||
589 | sys sys_prlimit64 4 | ||
587 | .endm | 590 | .endm |
588 | 591 | ||
589 | /* We pre-compute the number of _instruction_ bytes needed to | 592 | /* We pre-compute the number of _instruction_ bytes needed to |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index a8a6c596eb04..5573f8e4e326 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -416,9 +416,12 @@ sys_call_table: | |||
416 | PTR sys_pipe2 | 416 | PTR sys_pipe2 |
417 | PTR sys_inotify_init1 | 417 | PTR sys_inotify_init1 |
418 | PTR sys_preadv | 418 | PTR sys_preadv |
419 | PTR sys_pwritev /* 5390 */ | 419 | PTR sys_pwritev /* 5290 */ |
420 | PTR sys_rt_tgsigqueueinfo | 420 | PTR sys_rt_tgsigqueueinfo |
421 | PTR sys_perf_event_open | 421 | PTR sys_perf_event_open |
422 | PTR sys_accept4 | 422 | PTR sys_accept4 |
423 | PTR sys_recvmmsg | 423 | PTR sys_recvmmsg |
424 | PTR sys_fanotify_init /* 5295 */ | ||
425 | PTR sys_fanotify_mark | ||
426 | PTR sys_prlimit64 | ||
424 | .size sys_call_table,.-sys_call_table | 427 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index a3d66137731a..1e38ec97672e 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -419,5 +419,8 @@ EXPORT(sysn32_call_table) | |||
419 | PTR sys_perf_event_open | 419 | PTR sys_perf_event_open |
420 | PTR sys_accept4 | 420 | PTR sys_accept4 |
421 | PTR compat_sys_recvmmsg | 421 | PTR compat_sys_recvmmsg |
422 | PTR sys_getdents | 422 | PTR sys_getdents64 |
423 | PTR sys_fanotify_init /* 6300 */ | ||
424 | PTR sys_fanotify_mark | ||
425 | PTR sys_prlimit64 | ||
423 | .size sysn32_call_table,.-sysn32_call_table | 426 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 813689ef2384..171979fc98e5 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -538,5 +538,8 @@ sys_call_table: | |||
538 | PTR compat_sys_rt_tgsigqueueinfo | 538 | PTR compat_sys_rt_tgsigqueueinfo |
539 | PTR sys_perf_event_open | 539 | PTR sys_perf_event_open |
540 | PTR sys_accept4 | 540 | PTR sys_accept4 |
541 | PTR compat_sys_recvmmsg | 541 | PTR compat_sys_recvmmsg /* 4335 */ |
542 | PTR sys_fanotify_init | ||
543 | PTR sys_32_fanotify_mark | ||
544 | PTR sys_prlimit64 | ||
542 | .size sys_call_table,.-sys_call_table | 545 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index 7ba890860d98..469d4019f795 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c | |||
@@ -44,27 +44,39 @@ static inline int cpu_is_noncoherent_r10000(struct device *dev) | |||
44 | 44 | ||
45 | static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp) | 45 | static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp) |
46 | { | 46 | { |
47 | gfp_t dma_flag; | ||
48 | |||
47 | /* ignore region specifiers */ | 49 | /* ignore region specifiers */ |
48 | gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); | 50 | gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); |
49 | 51 | ||
50 | #ifdef CONFIG_ZONE_DMA | 52 | #ifdef CONFIG_ISA |
51 | if (dev == NULL) | 53 | if (dev == NULL) |
52 | gfp |= __GFP_DMA; | 54 | dma_flag = __GFP_DMA; |
53 | else if (dev->coherent_dma_mask < DMA_BIT_MASK(24)) | ||
54 | gfp |= __GFP_DMA; | ||
55 | else | 55 | else |
56 | #endif | 56 | #endif |
57 | #ifdef CONFIG_ZONE_DMA32 | 57 | #if defined(CONFIG_ZONE_DMA32) && defined(CONFIG_ZONE_DMA) |
58 | if (dev->coherent_dma_mask < DMA_BIT_MASK(32)) | 58 | if (dev->coherent_dma_mask < DMA_BIT_MASK(32)) |
59 | gfp |= __GFP_DMA32; | 59 | dma_flag = __GFP_DMA; |
60 | else if (dev->coherent_dma_mask < DMA_BIT_MASK(64)) | ||
61 | dma_flag = __GFP_DMA32; | ||
62 | else | ||
63 | #endif | ||
64 | #if defined(CONFIG_ZONE_DMA32) && !defined(CONFIG_ZONE_DMA) | ||
65 | if (dev->coherent_dma_mask < DMA_BIT_MASK(64)) | ||
66 | dma_flag = __GFP_DMA32; | ||
67 | else | ||
68 | #endif | ||
69 | #if defined(CONFIG_ZONE_DMA) && !defined(CONFIG_ZONE_DMA32) | ||
70 | if (dev->coherent_dma_mask < DMA_BIT_MASK(64)) | ||
71 | dma_flag = __GFP_DMA; | ||
60 | else | 72 | else |
61 | #endif | 73 | #endif |
62 | ; | 74 | dma_flag = 0; |
63 | 75 | ||
64 | /* Don't invoke OOM killer */ | 76 | /* Don't invoke OOM killer */ |
65 | gfp |= __GFP_NORETRY; | 77 | gfp |= __GFP_NORETRY; |
66 | 78 | ||
67 | return gfp; | 79 | return gfp | dma_flag; |
68 | } | 80 | } |
69 | 81 | ||
70 | void *dma_alloc_noncoherent(struct device *dev, size_t size, | 82 | void *dma_alloc_noncoherent(struct device *dev, size_t size, |
diff --git a/arch/mips/mm/sc-rm7k.c b/arch/mips/mm/sc-rm7k.c index 1ef75cd80a0d..274af3be1442 100644 --- a/arch/mips/mm/sc-rm7k.c +++ b/arch/mips/mm/sc-rm7k.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #define tc_lsize 32 | 30 | #define tc_lsize 32 |
31 | 31 | ||
32 | extern unsigned long icache_way_size, dcache_way_size; | 32 | extern unsigned long icache_way_size, dcache_way_size; |
33 | unsigned long tcache_size; | 33 | static unsigned long tcache_size; |
34 | 34 | ||
35 | #include <asm/r4kcache.h> | 35 | #include <asm/r4kcache.h> |
36 | 36 | ||
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c index 15949b0be811..b79b24afe3a2 100644 --- a/arch/mips/mti-malta/malta-int.c +++ b/arch/mips/mti-malta/malta-int.c | |||
@@ -385,6 +385,8 @@ static int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap); | |||
385 | */ | 385 | */ |
386 | 386 | ||
387 | #define GIC_CPU_NMI GIC_MAP_TO_NMI_MSK | 387 | #define GIC_CPU_NMI GIC_MAP_TO_NMI_MSK |
388 | #define X GIC_UNUSED | ||
389 | |||
388 | static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = { | 390 | static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = { |
389 | { X, X, X, X, 0 }, | 391 | { X, X, X, X, 0 }, |
390 | { X, X, X, X, 0 }, | 392 | { X, X, X, X, 0 }, |
@@ -404,6 +406,7 @@ static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = { | |||
404 | { X, X, X, X, 0 }, | 406 | { X, X, X, X, 0 }, |
405 | /* The remainder of this table is initialised by fill_ipi_map */ | 407 | /* The remainder of this table is initialised by fill_ipi_map */ |
406 | }; | 408 | }; |
409 | #undef X | ||
407 | 410 | ||
408 | /* | 411 | /* |
409 | * GCMP needs to be detected before any SMP initialisation | 412 | * GCMP needs to be detected before any SMP initialisation |
diff --git a/arch/mips/pci/pci-rc32434.c b/arch/mips/pci/pci-rc32434.c index 71f7d27b0d4c..f31218e17d3c 100644 --- a/arch/mips/pci/pci-rc32434.c +++ b/arch/mips/pci/pci-rc32434.c | |||
@@ -118,7 +118,7 @@ static int __init rc32434_pcibridge_init(void) | |||
118 | if (!((pcicvalue == PCIM_H_EA) || | 118 | if (!((pcicvalue == PCIM_H_EA) || |
119 | (pcicvalue == PCIM_H_IA_FIX) || | 119 | (pcicvalue == PCIM_H_IA_FIX) || |
120 | (pcicvalue == PCIM_H_IA_RR))) { | 120 | (pcicvalue == PCIM_H_IA_RR))) { |
121 | pr_err(KERN_ERR "PCI init error!!!\n"); | 121 | pr_err("PCI init error!!!\n"); |
122 | /* Not in Host Mode, return ERROR */ | 122 | /* Not in Host Mode, return ERROR */ |
123 | return -1; | 123 | return -1; |
124 | } | 124 | } |
diff --git a/arch/mips/pnx8550/common/reset.c b/arch/mips/pnx8550/common/reset.c index fadd8744a6bc..e7a12ff304b9 100644 --- a/arch/mips/pnx8550/common/reset.c +++ b/arch/mips/pnx8550/common/reset.c | |||
@@ -22,29 +22,19 @@ | |||
22 | */ | 22 | */ |
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | 24 | ||
25 | #include <asm/processor.h> | ||
25 | #include <asm/reboot.h> | 26 | #include <asm/reboot.h> |
26 | #include <glb.h> | 27 | #include <glb.h> |
27 | 28 | ||
28 | void pnx8550_machine_restart(char *command) | 29 | void pnx8550_machine_restart(char *command) |
29 | { | 30 | { |
30 | char head[] = "************* Machine restart *************"; | ||
31 | char foot[] = "*******************************************"; | ||
32 | |||
33 | printk("\n\n"); | ||
34 | printk("%s\n", head); | ||
35 | if (command != NULL) | ||
36 | printk("* %s\n", command); | ||
37 | printk("%s\n", foot); | ||
38 | |||
39 | PNX8550_RST_CTL = PNX8550_RST_DO_SW_RST; | 31 | PNX8550_RST_CTL = PNX8550_RST_DO_SW_RST; |
40 | } | 32 | } |
41 | 33 | ||
42 | void pnx8550_machine_halt(void) | 34 | void pnx8550_machine_halt(void) |
43 | { | 35 | { |
44 | printk("*** Machine halt. (Not implemented) ***\n"); | 36 | while (1) { |
45 | } | 37 | if (cpu_wait) |
46 | 38 | cpu_wait(); | |
47 | void pnx8550_machine_power_off(void) | 39 | } |
48 | { | ||
49 | printk("*** Machine power off. (Not implemented) ***\n"); | ||
50 | } | 40 | } |
diff --git a/arch/mips/pnx8550/common/setup.c b/arch/mips/pnx8550/common/setup.c index 64246c9c875c..43cb3945fdbf 100644 --- a/arch/mips/pnx8550/common/setup.c +++ b/arch/mips/pnx8550/common/setup.c | |||
@@ -44,7 +44,6 @@ | |||
44 | extern void __init board_setup(void); | 44 | extern void __init board_setup(void); |
45 | extern void pnx8550_machine_restart(char *); | 45 | extern void pnx8550_machine_restart(char *); |
46 | extern void pnx8550_machine_halt(void); | 46 | extern void pnx8550_machine_halt(void); |
47 | extern void pnx8550_machine_power_off(void); | ||
48 | extern struct resource ioport_resource; | 47 | extern struct resource ioport_resource; |
49 | extern struct resource iomem_resource; | 48 | extern struct resource iomem_resource; |
50 | extern char *prom_getcmdline(void); | 49 | extern char *prom_getcmdline(void); |
@@ -100,7 +99,7 @@ void __init plat_mem_setup(void) | |||
100 | 99 | ||
101 | _machine_restart = pnx8550_machine_restart; | 100 | _machine_restart = pnx8550_machine_restart; |
102 | _machine_halt = pnx8550_machine_halt; | 101 | _machine_halt = pnx8550_machine_halt; |
103 | pm_power_off = pnx8550_machine_power_off; | 102 | pm_power_off = pnx8550_machine_halt; |
104 | 103 | ||
105 | /* Clear the Global 2 Register, PCI Inta Output Enable Registers | 104 | /* Clear the Global 2 Register, PCI Inta Output Enable Registers |
106 | Bit 1:Enable DAC Powerdown | 105 | Bit 1:Enable DAC Powerdown |
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index 444b9f918fdf..7c2a2f7f8dc1 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig | |||
@@ -8,7 +8,6 @@ mainmenu "Linux Kernel Configuration" | |||
8 | config MN10300 | 8 | config MN10300 |
9 | def_bool y | 9 | def_bool y |
10 | select HAVE_OPROFILE | 10 | select HAVE_OPROFILE |
11 | select HAVE_ARCH_TRACEHOOK | ||
12 | 11 | ||
13 | config AM33 | 12 | config AM33 |
14 | def_bool y | 13 | def_bool y |
diff --git a/arch/mn10300/Kconfig.debug b/arch/mn10300/Kconfig.debug index ff80e86b9bd2..ce83c74b3fd7 100644 --- a/arch/mn10300/Kconfig.debug +++ b/arch/mn10300/Kconfig.debug | |||
@@ -101,7 +101,7 @@ config GDBSTUB_DEBUG_BREAKPOINT | |||
101 | 101 | ||
102 | choice | 102 | choice |
103 | prompt "GDB stub port" | 103 | prompt "GDB stub port" |
104 | default GDBSTUB_TTYSM0 | 104 | default GDBSTUB_ON_TTYSM0 |
105 | depends on GDBSTUB | 105 | depends on GDBSTUB |
106 | help | 106 | help |
107 | Select the serial port used for GDB-stub. | 107 | Select the serial port used for GDB-stub. |
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h index f49ac49e09ad..3f50e9661076 100644 --- a/arch/mn10300/include/asm/bitops.h +++ b/arch/mn10300/include/asm/bitops.h | |||
@@ -229,9 +229,9 @@ int ffs(int x) | |||
229 | #include <asm-generic/bitops/hweight.h> | 229 | #include <asm-generic/bitops/hweight.h> |
230 | 230 | ||
231 | #define ext2_set_bit_atomic(lock, nr, addr) \ | 231 | #define ext2_set_bit_atomic(lock, nr, addr) \ |
232 | test_and_set_bit((nr) ^ 0x18, (addr)) | 232 | test_and_set_bit((nr), (addr)) |
233 | #define ext2_clear_bit_atomic(lock, nr, addr) \ | 233 | #define ext2_clear_bit_atomic(lock, nr, addr) \ |
234 | test_and_clear_bit((nr) ^ 0x18, (addr)) | 234 | test_and_clear_bit((nr), (addr)) |
235 | 235 | ||
236 | #include <asm-generic/bitops/ext2-non-atomic.h> | 236 | #include <asm-generic/bitops/ext2-non-atomic.h> |
237 | #include <asm-generic/bitops/minix-le.h> | 237 | #include <asm-generic/bitops/minix-le.h> |
diff --git a/arch/mn10300/include/asm/signal.h b/arch/mn10300/include/asm/signal.h index 7e891fce2370..1865d72a86ff 100644 --- a/arch/mn10300/include/asm/signal.h +++ b/arch/mn10300/include/asm/signal.h | |||
@@ -78,7 +78,7 @@ typedef unsigned long sigset_t; | |||
78 | 78 | ||
79 | /* These should not be considered constants from userland. */ | 79 | /* These should not be considered constants from userland. */ |
80 | #define SIGRTMIN 32 | 80 | #define SIGRTMIN 32 |
81 | #define SIGRTMAX (_NSIG-1) | 81 | #define SIGRTMAX _NSIG |
82 | 82 | ||
83 | /* | 83 | /* |
84 | * SA_FLAGS values: | 84 | * SA_FLAGS values: |
diff --git a/arch/mn10300/kernel/module.c b/arch/mn10300/kernel/module.c index 6aea7fd76993..196a111e2e29 100644 --- a/arch/mn10300/kernel/module.c +++ b/arch/mn10300/kernel/module.c | |||
@@ -206,7 +206,7 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
206 | const Elf_Shdr *sechdrs, | 206 | const Elf_Shdr *sechdrs, |
207 | struct module *me) | 207 | struct module *me) |
208 | { | 208 | { |
209 | return module_bug_finalize(hdr, sechdrs, me); | 209 | return 0; |
210 | } | 210 | } |
211 | 211 | ||
212 | /* | 212 | /* |
@@ -214,5 +214,4 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
214 | */ | 214 | */ |
215 | void module_arch_cleanup(struct module *mod) | 215 | void module_arch_cleanup(struct module *mod) |
216 | { | 216 | { |
217 | module_bug_cleanup(mod); | ||
218 | } | 217 | } |
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c index 717db14c2cc3..d4de05ab7864 100644 --- a/arch/mn10300/kernel/signal.c +++ b/arch/mn10300/kernel/signal.c | |||
@@ -65,10 +65,10 @@ asmlinkage long sys_sigaction(int sig, | |||
65 | old_sigset_t mask; | 65 | old_sigset_t mask; |
66 | if (verify_area(VERIFY_READ, act, sizeof(*act)) || | 66 | if (verify_area(VERIFY_READ, act, sizeof(*act)) || |
67 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | 67 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || |
68 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) | 68 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || |
69 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
70 | __get_user(mask, &act->sa_mask)) | ||
69 | return -EFAULT; | 71 | return -EFAULT; |
70 | __get_user(new_ka.sa.sa_flags, &act->sa_flags); | ||
71 | __get_user(mask, &act->sa_mask); | ||
72 | siginitset(&new_ka.sa.sa_mask, mask); | 72 | siginitset(&new_ka.sa.sa_mask, mask); |
73 | } | 73 | } |
74 | 74 | ||
@@ -77,10 +77,10 @@ asmlinkage long sys_sigaction(int sig, | |||
77 | if (!ret && oact) { | 77 | if (!ret && oact) { |
78 | if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || | 78 | if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || |
79 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | 79 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || |
80 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) | 80 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || |
81 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
82 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
81 | return -EFAULT; | 83 | return -EFAULT; |
82 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags); | ||
83 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); | ||
84 | } | 84 | } |
85 | 85 | ||
86 | return ret; | 86 | return ret; |
@@ -102,6 +102,9 @@ static int restore_sigcontext(struct pt_regs *regs, | |||
102 | { | 102 | { |
103 | unsigned int err = 0; | 103 | unsigned int err = 0; |
104 | 104 | ||
105 | /* Always make any pending restarted system calls return -EINTR */ | ||
106 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | ||
107 | |||
105 | if (is_using_fpu(current)) | 108 | if (is_using_fpu(current)) |
106 | fpu_kill_state(current); | 109 | fpu_kill_state(current); |
107 | 110 | ||
@@ -330,8 +333,6 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, | |||
330 | regs->d0 = sig; | 333 | regs->d0 = sig; |
331 | regs->d1 = (unsigned long) &frame->sc; | 334 | regs->d1 = (unsigned long) &frame->sc; |
332 | 335 | ||
333 | set_fs(USER_DS); | ||
334 | |||
335 | /* the tracer may want to single-step inside the handler */ | 336 | /* the tracer may want to single-step inside the handler */ |
336 | if (test_thread_flag(TIF_SINGLESTEP)) | 337 | if (test_thread_flag(TIF_SINGLESTEP)) |
337 | ptrace_notify(SIGTRAP); | 338 | ptrace_notify(SIGTRAP); |
@@ -345,7 +346,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, | |||
345 | return 0; | 346 | return 0; |
346 | 347 | ||
347 | give_sigsegv: | 348 | give_sigsegv: |
348 | force_sig(SIGSEGV, current); | 349 | force_sigsegv(sig, current); |
349 | return -EFAULT; | 350 | return -EFAULT; |
350 | } | 351 | } |
351 | 352 | ||
@@ -413,8 +414,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
413 | regs->d0 = sig; | 414 | regs->d0 = sig; |
414 | regs->d1 = (long) &frame->info; | 415 | regs->d1 = (long) &frame->info; |
415 | 416 | ||
416 | set_fs(USER_DS); | ||
417 | |||
418 | /* the tracer may want to single-step inside the handler */ | 417 | /* the tracer may want to single-step inside the handler */ |
419 | if (test_thread_flag(TIF_SINGLESTEP)) | 418 | if (test_thread_flag(TIF_SINGLESTEP)) |
420 | ptrace_notify(SIGTRAP); | 419 | ptrace_notify(SIGTRAP); |
@@ -428,10 +427,16 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
428 | return 0; | 427 | return 0; |
429 | 428 | ||
430 | give_sigsegv: | 429 | give_sigsegv: |
431 | force_sig(SIGSEGV, current); | 430 | force_sigsegv(sig, current); |
432 | return -EFAULT; | 431 | return -EFAULT; |
433 | } | 432 | } |
434 | 433 | ||
434 | static inline void stepback(struct pt_regs *regs) | ||
435 | { | ||
436 | regs->pc -= 2; | ||
437 | regs->orig_d0 = -1; | ||
438 | } | ||
439 | |||
435 | /* | 440 | /* |
436 | * handle the actual delivery of a signal to userspace | 441 | * handle the actual delivery of a signal to userspace |
437 | */ | 442 | */ |
@@ -459,7 +464,7 @@ static int handle_signal(int sig, | |||
459 | /* fallthrough */ | 464 | /* fallthrough */ |
460 | case -ERESTARTNOINTR: | 465 | case -ERESTARTNOINTR: |
461 | regs->d0 = regs->orig_d0; | 466 | regs->d0 = regs->orig_d0; |
462 | regs->pc -= 2; | 467 | stepback(regs); |
463 | } | 468 | } |
464 | } | 469 | } |
465 | 470 | ||
@@ -527,12 +532,12 @@ static void do_signal(struct pt_regs *regs) | |||
527 | case -ERESTARTSYS: | 532 | case -ERESTARTSYS: |
528 | case -ERESTARTNOINTR: | 533 | case -ERESTARTNOINTR: |
529 | regs->d0 = regs->orig_d0; | 534 | regs->d0 = regs->orig_d0; |
530 | regs->pc -= 2; | 535 | stepback(regs); |
531 | break; | 536 | break; |
532 | 537 | ||
533 | case -ERESTART_RESTARTBLOCK: | 538 | case -ERESTART_RESTARTBLOCK: |
534 | regs->d0 = __NR_restart_syscall; | 539 | regs->d0 = __NR_restart_syscall; |
535 | regs->pc -= 2; | 540 | stepback(regs); |
536 | break; | 541 | break; |
537 | } | 542 | } |
538 | } | 543 | } |
diff --git a/arch/mn10300/mm/Makefile b/arch/mn10300/mm/Makefile index 28b9d983db0c..1557277fbc5c 100644 --- a/arch/mn10300/mm/Makefile +++ b/arch/mn10300/mm/Makefile | |||
@@ -2,13 +2,11 @@ | |||
2 | # Makefile for the MN10300-specific memory management code | 2 | # Makefile for the MN10300-specific memory management code |
3 | # | 3 | # |
4 | 4 | ||
5 | cacheflush-y := cache.o cache-mn10300.o | ||
6 | cacheflush-$(CONFIG_MN10300_CACHE_WBACK) += cache-flush-mn10300.o | ||
7 | |||
8 | cacheflush-$(CONFIG_MN10300_CACHE_DISABLED) := cache-disabled.o | ||
9 | |||
5 | obj-y := \ | 10 | obj-y := \ |
6 | init.o fault.o pgtable.o extable.o tlb-mn10300.o mmu-context.o \ | 11 | init.o fault.o pgtable.o extable.o tlb-mn10300.o mmu-context.o \ |
7 | misalignment.o dma-alloc.o | 12 | misalignment.o dma-alloc.o $(cacheflush-y) |
8 | |||
9 | ifneq ($(CONFIG_MN10300_CACHE_DISABLED),y) | ||
10 | obj-y += cache.o cache-mn10300.o | ||
11 | ifeq ($(CONFIG_MN10300_CACHE_WBACK),y) | ||
12 | obj-y += cache-flush-mn10300.o | ||
13 | endif | ||
14 | endif | ||
diff --git a/arch/mn10300/mm/cache-disabled.c b/arch/mn10300/mm/cache-disabled.c new file mode 100644 index 000000000000..f669ea42aba6 --- /dev/null +++ b/arch/mn10300/mm/cache-disabled.c | |||
@@ -0,0 +1,21 @@ | |||
1 | /* Handle the cache being disabled | ||
2 | * | ||
3 | * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public Licence | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the Licence, or (at your option) any later version. | ||
10 | */ | ||
11 | #include <linux/mm.h> | ||
12 | |||
13 | /* | ||
14 | * allow userspace to flush the instruction cache | ||
15 | */ | ||
16 | asmlinkage long sys_cacheflush(unsigned long start, unsigned long end) | ||
17 | { | ||
18 | if (end < start) | ||
19 | return -EINVAL; | ||
20 | return 0; | ||
21 | } | ||
diff --git a/arch/mn10300/mm/cache.c b/arch/mn10300/mm/cache.c index 1b76719ec1c3..9261217e8d2c 100644 --- a/arch/mn10300/mm/cache.c +++ b/arch/mn10300/mm/cache.c | |||
@@ -54,13 +54,30 @@ EXPORT_SYMBOL(flush_icache_page); | |||
54 | void flush_icache_range(unsigned long start, unsigned long end) | 54 | void flush_icache_range(unsigned long start, unsigned long end) |
55 | { | 55 | { |
56 | #ifdef CONFIG_MN10300_CACHE_WBACK | 56 | #ifdef CONFIG_MN10300_CACHE_WBACK |
57 | unsigned long addr, size, off; | 57 | unsigned long addr, size, base, off; |
58 | struct page *page; | 58 | struct page *page; |
59 | pgd_t *pgd; | 59 | pgd_t *pgd; |
60 | pud_t *pud; | 60 | pud_t *pud; |
61 | pmd_t *pmd; | 61 | pmd_t *pmd; |
62 | pte_t *ppte, pte; | 62 | pte_t *ppte, pte; |
63 | 63 | ||
64 | if (end > 0x80000000UL) { | ||
65 | /* addresses above 0xa0000000 do not go through the cache */ | ||
66 | if (end > 0xa0000000UL) { | ||
67 | end = 0xa0000000UL; | ||
68 | if (start >= end) | ||
69 | return; | ||
70 | } | ||
71 | |||
72 | /* kernel addresses between 0x80000000 and 0x9fffffff do not | ||
73 | * require page tables, so we just map such addresses directly */ | ||
74 | base = (start >= 0x80000000UL) ? start : 0x80000000UL; | ||
75 | mn10300_dcache_flush_range(base, end); | ||
76 | if (base == start) | ||
77 | goto invalidate; | ||
78 | end = base; | ||
79 | } | ||
80 | |||
64 | for (; start < end; start += size) { | 81 | for (; start < end; start += size) { |
65 | /* work out how much of the page to flush */ | 82 | /* work out how much of the page to flush */ |
66 | off = start & (PAGE_SIZE - 1); | 83 | off = start & (PAGE_SIZE - 1); |
@@ -104,6 +121,7 @@ void flush_icache_range(unsigned long start, unsigned long end) | |||
104 | } | 121 | } |
105 | #endif | 122 | #endif |
106 | 123 | ||
124 | invalidate: | ||
107 | mn10300_icache_inv(); | 125 | mn10300_icache_inv(); |
108 | } | 126 | } |
109 | EXPORT_SYMBOL(flush_icache_range); | 127 | EXPORT_SYMBOL(flush_icache_range); |
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index 159a2b81e90c..6e81bb596e5b 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c | |||
@@ -941,11 +941,10 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
941 | nsyms = newptr - (Elf_Sym *)symhdr->sh_addr; | 941 | nsyms = newptr - (Elf_Sym *)symhdr->sh_addr; |
942 | DEBUGP("NEW num_symtab %lu\n", nsyms); | 942 | DEBUGP("NEW num_symtab %lu\n", nsyms); |
943 | symhdr->sh_size = nsyms * sizeof(Elf_Sym); | 943 | symhdr->sh_size = nsyms * sizeof(Elf_Sym); |
944 | return module_bug_finalize(hdr, sechdrs, me); | 944 | return 0; |
945 | } | 945 | } |
946 | 946 | ||
947 | void module_arch_cleanup(struct module *mod) | 947 | void module_arch_cleanup(struct module *mod) |
948 | { | 948 | { |
949 | deregister_unwind_table(mod); | 949 | deregister_unwind_table(mod); |
950 | module_bug_cleanup(mod); | ||
951 | } | 950 | } |
diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c index 477c663e0140..49cee9df225b 100644 --- a/arch/powerpc/kernel/module.c +++ b/arch/powerpc/kernel/module.c | |||
@@ -63,11 +63,6 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
63 | const Elf_Shdr *sechdrs, struct module *me) | 63 | const Elf_Shdr *sechdrs, struct module *me) |
64 | { | 64 | { |
65 | const Elf_Shdr *sect; | 65 | const Elf_Shdr *sect; |
66 | int err; | ||
67 | |||
68 | err = module_bug_finalize(hdr, sechdrs, me); | ||
69 | if (err) | ||
70 | return err; | ||
71 | 66 | ||
72 | /* Apply feature fixups */ | 67 | /* Apply feature fixups */ |
73 | sect = find_section(hdr, sechdrs, "__ftr_fixup"); | 68 | sect = find_section(hdr, sechdrs, "__ftr_fixup"); |
@@ -101,5 +96,4 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
101 | 96 | ||
102 | void module_arch_cleanup(struct module *mod) | 97 | void module_arch_cleanup(struct module *mod) |
103 | { | 98 | { |
104 | module_bug_cleanup(mod); | ||
105 | } | 99 | } |
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c index 7109f5b1baa8..2300426e531a 100644 --- a/arch/powerpc/kernel/signal.c +++ b/arch/powerpc/kernel/signal.c | |||
@@ -138,6 +138,7 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs) | |||
138 | ti->local_flags &= ~_TLF_RESTORE_SIGMASK; | 138 | ti->local_flags &= ~_TLF_RESTORE_SIGMASK; |
139 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | 139 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); |
140 | } | 140 | } |
141 | regs->trap = 0; | ||
141 | return 0; /* no signals delivered */ | 142 | return 0; /* no signals delivered */ |
142 | } | 143 | } |
143 | 144 | ||
@@ -164,6 +165,7 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs) | |||
164 | ret = handle_rt_signal64(signr, &ka, &info, oldset, regs); | 165 | ret = handle_rt_signal64(signr, &ka, &info, oldset, regs); |
165 | } | 166 | } |
166 | 167 | ||
168 | regs->trap = 0; | ||
167 | if (ret) { | 169 | if (ret) { |
168 | spin_lock_irq(¤t->sighand->siglock); | 170 | spin_lock_irq(¤t->sighand->siglock); |
169 | sigorsets(¤t->blocked, ¤t->blocked, | 171 | sigorsets(¤t->blocked, ¤t->blocked, |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 266610119f66..b96a3a010c26 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
@@ -511,6 +511,7 @@ static long restore_user_regs(struct pt_regs *regs, | |||
511 | if (!sig) | 511 | if (!sig) |
512 | save_r2 = (unsigned int)regs->gpr[2]; | 512 | save_r2 = (unsigned int)regs->gpr[2]; |
513 | err = restore_general_regs(regs, sr); | 513 | err = restore_general_regs(regs, sr); |
514 | regs->trap = 0; | ||
514 | err |= __get_user(msr, &sr->mc_gregs[PT_MSR]); | 515 | err |= __get_user(msr, &sr->mc_gregs[PT_MSR]); |
515 | if (!sig) | 516 | if (!sig) |
516 | regs->gpr[2] = (unsigned long) save_r2; | 517 | regs->gpr[2] = (unsigned long) save_r2; |
@@ -884,7 +885,6 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, | |||
884 | regs->nip = (unsigned long) ka->sa.sa_handler; | 885 | regs->nip = (unsigned long) ka->sa.sa_handler; |
885 | /* enter the signal handler in big-endian mode */ | 886 | /* enter the signal handler in big-endian mode */ |
886 | regs->msr &= ~MSR_LE; | 887 | regs->msr &= ~MSR_LE; |
887 | regs->trap = 0; | ||
888 | return 1; | 888 | return 1; |
889 | 889 | ||
890 | badframe: | 890 | badframe: |
@@ -1228,7 +1228,6 @@ int handle_signal32(unsigned long sig, struct k_sigaction *ka, | |||
1228 | regs->nip = (unsigned long) ka->sa.sa_handler; | 1228 | regs->nip = (unsigned long) ka->sa.sa_handler; |
1229 | /* enter the signal handler in big-endian mode */ | 1229 | /* enter the signal handler in big-endian mode */ |
1230 | regs->msr &= ~MSR_LE; | 1230 | regs->msr &= ~MSR_LE; |
1231 | regs->trap = 0; | ||
1232 | 1231 | ||
1233 | return 1; | 1232 | return 1; |
1234 | 1233 | ||
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 2fe6fc64b614..27c4a4584f80 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -178,7 +178,7 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, | |||
178 | err |= __get_user(regs->xer, &sc->gp_regs[PT_XER]); | 178 | err |= __get_user(regs->xer, &sc->gp_regs[PT_XER]); |
179 | err |= __get_user(regs->ccr, &sc->gp_regs[PT_CCR]); | 179 | err |= __get_user(regs->ccr, &sc->gp_regs[PT_CCR]); |
180 | /* skip SOFTE */ | 180 | /* skip SOFTE */ |
181 | err |= __get_user(regs->trap, &sc->gp_regs[PT_TRAP]); | 181 | regs->trap = 0; |
182 | err |= __get_user(regs->dar, &sc->gp_regs[PT_DAR]); | 182 | err |= __get_user(regs->dar, &sc->gp_regs[PT_DAR]); |
183 | err |= __get_user(regs->dsisr, &sc->gp_regs[PT_DSISR]); | 183 | err |= __get_user(regs->dsisr, &sc->gp_regs[PT_DSISR]); |
184 | err |= __get_user(regs->result, &sc->gp_regs[PT_RESULT]); | 184 | err |= __get_user(regs->result, &sc->gp_regs[PT_RESULT]); |
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c index 5b243bd3eb3b..3dc2a8d262b8 100644 --- a/arch/powerpc/platforms/512x/clock.c +++ b/arch/powerpc/platforms/512x/clock.c | |||
@@ -57,7 +57,7 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id) | |||
57 | int id_match = 0; | 57 | int id_match = 0; |
58 | 58 | ||
59 | if (dev == NULL || id == NULL) | 59 | if (dev == NULL || id == NULL) |
60 | return NULL; | 60 | return clk; |
61 | 61 | ||
62 | mutex_lock(&clocks_mutex); | 62 | mutex_lock(&clocks_mutex); |
63 | list_for_each_entry(p, &clocks, node) { | 63 | list_for_each_entry(p, &clocks, node) { |
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c index 45c0cb9b67e6..18c104820198 100644 --- a/arch/powerpc/platforms/52xx/efika.c +++ b/arch/powerpc/platforms/52xx/efika.c | |||
@@ -99,7 +99,7 @@ static void __init efika_pcisetup(void) | |||
99 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 99 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
100 | printk(KERN_WARNING EFIKA_PLATFORM_NAME | 100 | printk(KERN_WARNING EFIKA_PLATFORM_NAME |
101 | ": Can't get bus-range for %s\n", pcictrl->full_name); | 101 | ": Can't get bus-range for %s\n", pcictrl->full_name); |
102 | return; | 102 | goto out_put; |
103 | } | 103 | } |
104 | 104 | ||
105 | if (bus_range[1] == bus_range[0]) | 105 | if (bus_range[1] == bus_range[0]) |
@@ -111,12 +111,12 @@ static void __init efika_pcisetup(void) | |||
111 | printk(" controlled by %s\n", pcictrl->full_name); | 111 | printk(" controlled by %s\n", pcictrl->full_name); |
112 | printk("\n"); | 112 | printk("\n"); |
113 | 113 | ||
114 | hose = pcibios_alloc_controller(of_node_get(pcictrl)); | 114 | hose = pcibios_alloc_controller(pcictrl); |
115 | if (!hose) { | 115 | if (!hose) { |
116 | printk(KERN_WARNING EFIKA_PLATFORM_NAME | 116 | printk(KERN_WARNING EFIKA_PLATFORM_NAME |
117 | ": Can't allocate PCI controller structure for %s\n", | 117 | ": Can't allocate PCI controller structure for %s\n", |
118 | pcictrl->full_name); | 118 | pcictrl->full_name); |
119 | return; | 119 | goto out_put; |
120 | } | 120 | } |
121 | 121 | ||
122 | hose->first_busno = bus_range[0]; | 122 | hose->first_busno = bus_range[0]; |
@@ -124,6 +124,9 @@ static void __init efika_pcisetup(void) | |||
124 | hose->ops = &rtas_pci_ops; | 124 | hose->ops = &rtas_pci_ops; |
125 | 125 | ||
126 | pci_process_bridge_OF_ranges(hose, pcictrl, 0); | 126 | pci_process_bridge_OF_ranges(hose, pcictrl, 0); |
127 | return; | ||
128 | out_put: | ||
129 | of_node_put(pcictrl); | ||
127 | } | 130 | } |
128 | 131 | ||
129 | #else | 132 | #else |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c index 6e905314ad5d..41f3a7eda1de 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_common.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c | |||
@@ -325,12 +325,16 @@ int mpc5200_psc_ac97_gpio_reset(int psc_number) | |||
325 | clrbits32(&simple_gpio->simple_dvo, sync | out); | 325 | clrbits32(&simple_gpio->simple_dvo, sync | out); |
326 | clrbits8(&wkup_gpio->wkup_dvo, reset); | 326 | clrbits8(&wkup_gpio->wkup_dvo, reset); |
327 | 327 | ||
328 | /* wait at lease 1 us */ | 328 | /* wait for 1 us */ |
329 | udelay(2); | 329 | udelay(1); |
330 | 330 | ||
331 | /* Deassert reset */ | 331 | /* Deassert reset */ |
332 | setbits8(&wkup_gpio->wkup_dvo, reset); | 332 | setbits8(&wkup_gpio->wkup_dvo, reset); |
333 | 333 | ||
334 | /* wait at least 200ns */ | ||
335 | /* 7 ~= (200ns * timebase) / ns2sec */ | ||
336 | __delay(7); | ||
337 | |||
334 | /* Restore pin-muxing */ | 338 | /* Restore pin-muxing */ |
335 | out_be32(&simple_gpio->port_config, mux); | 339 | out_be32(&simple_gpio->port_config, mux); |
336 | 340 | ||
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c index 22cfd634c355..f7167ee4604c 100644 --- a/arch/s390/kernel/module.c +++ b/arch/s390/kernel/module.c | |||
@@ -407,10 +407,9 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
407 | { | 407 | { |
408 | vfree(me->arch.syminfo); | 408 | vfree(me->arch.syminfo); |
409 | me->arch.syminfo = NULL; | 409 | me->arch.syminfo = NULL; |
410 | return module_bug_finalize(hdr, sechdrs, me); | 410 | return 0; |
411 | } | 411 | } |
412 | 412 | ||
413 | void module_arch_cleanup(struct module *mod) | 413 | void module_arch_cleanup(struct module *mod) |
414 | { | 414 | { |
415 | module_bug_cleanup(mod); | ||
416 | } | 415 | } |
diff --git a/arch/sh/kernel/module.c b/arch/sh/kernel/module.c index 43adddfe4c04..ae0be697a89e 100644 --- a/arch/sh/kernel/module.c +++ b/arch/sh/kernel/module.c | |||
@@ -149,13 +149,11 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
149 | int ret = 0; | 149 | int ret = 0; |
150 | 150 | ||
151 | ret |= module_dwarf_finalize(hdr, sechdrs, me); | 151 | ret |= module_dwarf_finalize(hdr, sechdrs, me); |
152 | ret |= module_bug_finalize(hdr, sechdrs, me); | ||
153 | 152 | ||
154 | return ret; | 153 | return ret; |
155 | } | 154 | } |
156 | 155 | ||
157 | void module_arch_cleanup(struct module *mod) | 156 | void module_arch_cleanup(struct module *mod) |
158 | { | 157 | { |
159 | module_bug_cleanup(mod); | ||
160 | module_dwarf_cleanup(mod); | 158 | module_dwarf_cleanup(mod); |
161 | } | 159 | } |
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 357ced3c33ff..6318e622cfb0 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
@@ -1038,6 +1038,7 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
1038 | if (atomic_read(&nmi_active) < 0) | 1038 | if (atomic_read(&nmi_active) < 0) |
1039 | return -ENODEV; | 1039 | return -ENODEV; |
1040 | 1040 | ||
1041 | pmap = NULL; | ||
1041 | if (attr->type == PERF_TYPE_HARDWARE) { | 1042 | if (attr->type == PERF_TYPE_HARDWARE) { |
1042 | if (attr->config >= sparc_pmu->max_events) | 1043 | if (attr->config >= sparc_pmu->max_events) |
1043 | return -EINVAL; | 1044 | return -EINVAL; |
@@ -1046,9 +1047,18 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
1046 | pmap = sparc_map_cache_event(attr->config); | 1047 | pmap = sparc_map_cache_event(attr->config); |
1047 | if (IS_ERR(pmap)) | 1048 | if (IS_ERR(pmap)) |
1048 | return PTR_ERR(pmap); | 1049 | return PTR_ERR(pmap); |
1049 | } else | 1050 | } else if (attr->type != PERF_TYPE_RAW) |
1050 | return -EOPNOTSUPP; | 1051 | return -EOPNOTSUPP; |
1051 | 1052 | ||
1053 | if (pmap) { | ||
1054 | hwc->event_base = perf_event_encode(pmap); | ||
1055 | } else { | ||
1056 | /* User gives us "(encoding << 16) | pic_mask" for | ||
1057 | * PERF_TYPE_RAW events. | ||
1058 | */ | ||
1059 | hwc->event_base = attr->config; | ||
1060 | } | ||
1061 | |||
1052 | /* We save the enable bits in the config_base. */ | 1062 | /* We save the enable bits in the config_base. */ |
1053 | hwc->config_base = sparc_pmu->irq_bit; | 1063 | hwc->config_base = sparc_pmu->irq_bit; |
1054 | if (!attr->exclude_user) | 1064 | if (!attr->exclude_user) |
@@ -1058,8 +1068,6 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
1058 | if (!attr->exclude_hv) | 1068 | if (!attr->exclude_hv) |
1059 | hwc->config_base |= sparc_pmu->hv_bit; | 1069 | hwc->config_base |= sparc_pmu->hv_bit; |
1060 | 1070 | ||
1061 | hwc->event_base = perf_event_encode(pmap); | ||
1062 | |||
1063 | n = 0; | 1071 | n = 0; |
1064 | if (event->group_leader != event) { | 1072 | if (event->group_leader != event) { |
1065 | n = collect_events(event->group_leader, | 1073 | n = collect_events(event->group_leader, |
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index ea22cd373c64..75fad425e249 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c | |||
@@ -453,8 +453,66 @@ static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | |||
453 | return err; | 453 | return err; |
454 | } | 454 | } |
455 | 455 | ||
456 | static void setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | 456 | /* The I-cache flush instruction only works in the primary ASI, which |
457 | int signo, sigset_t *oldset) | 457 | * right now is the nucleus, aka. kernel space. |
458 | * | ||
459 | * Therefore we have to kick the instructions out using the kernel | ||
460 | * side linear mapping of the physical address backing the user | ||
461 | * instructions. | ||
462 | */ | ||
463 | static void flush_signal_insns(unsigned long address) | ||
464 | { | ||
465 | unsigned long pstate, paddr; | ||
466 | pte_t *ptep, pte; | ||
467 | pgd_t *pgdp; | ||
468 | pud_t *pudp; | ||
469 | pmd_t *pmdp; | ||
470 | |||
471 | /* Commit all stores of the instructions we are about to flush. */ | ||
472 | wmb(); | ||
473 | |||
474 | /* Disable cross-call reception. In this way even a very wide | ||
475 | * munmap() on another cpu can't tear down the page table | ||
476 | * hierarchy from underneath us, since that can't complete | ||
477 | * until the IPI tlb flush returns. | ||
478 | */ | ||
479 | |||
480 | __asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate)); | ||
481 | __asm__ __volatile__("wrpr %0, %1, %%pstate" | ||
482 | : : "r" (pstate), "i" (PSTATE_IE)); | ||
483 | |||
484 | pgdp = pgd_offset(current->mm, address); | ||
485 | if (pgd_none(*pgdp)) | ||
486 | goto out_irqs_on; | ||
487 | pudp = pud_offset(pgdp, address); | ||
488 | if (pud_none(*pudp)) | ||
489 | goto out_irqs_on; | ||
490 | pmdp = pmd_offset(pudp, address); | ||
491 | if (pmd_none(*pmdp)) | ||
492 | goto out_irqs_on; | ||
493 | |||
494 | ptep = pte_offset_map(pmdp, address); | ||
495 | pte = *ptep; | ||
496 | if (!pte_present(pte)) | ||
497 | goto out_unmap; | ||
498 | |||
499 | paddr = (unsigned long) page_address(pte_page(pte)); | ||
500 | |||
501 | __asm__ __volatile__("flush %0 + %1" | ||
502 | : /* no outputs */ | ||
503 | : "r" (paddr), | ||
504 | "r" (address & (PAGE_SIZE - 1)) | ||
505 | : "memory"); | ||
506 | |||
507 | out_unmap: | ||
508 | pte_unmap(ptep); | ||
509 | out_irqs_on: | ||
510 | __asm__ __volatile__("wrpr %0, 0x0, %%pstate" : : "r" (pstate)); | ||
511 | |||
512 | } | ||
513 | |||
514 | static int setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | ||
515 | int signo, sigset_t *oldset) | ||
458 | { | 516 | { |
459 | struct signal_frame32 __user *sf; | 517 | struct signal_frame32 __user *sf; |
460 | int sigframe_size; | 518 | int sigframe_size; |
@@ -547,13 +605,7 @@ static void setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
547 | if (ka->ka_restorer) { | 605 | if (ka->ka_restorer) { |
548 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; | 606 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; |
549 | } else { | 607 | } else { |
550 | /* Flush instruction space. */ | ||
551 | unsigned long address = ((unsigned long)&(sf->insns[0])); | 608 | unsigned long address = ((unsigned long)&(sf->insns[0])); |
552 | pgd_t *pgdp = pgd_offset(current->mm, address); | ||
553 | pud_t *pudp = pud_offset(pgdp, address); | ||
554 | pmd_t *pmdp = pmd_offset(pudp, address); | ||
555 | pte_t *ptep; | ||
556 | pte_t pte; | ||
557 | 609 | ||
558 | regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); | 610 | regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); |
559 | 611 | ||
@@ -562,34 +614,22 @@ static void setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
562 | if (err) | 614 | if (err) |
563 | goto sigsegv; | 615 | goto sigsegv; |
564 | 616 | ||
565 | preempt_disable(); | 617 | flush_signal_insns(address); |
566 | ptep = pte_offset_map(pmdp, address); | ||
567 | pte = *ptep; | ||
568 | if (pte_present(pte)) { | ||
569 | unsigned long page = (unsigned long) | ||
570 | page_address(pte_page(pte)); | ||
571 | |||
572 | wmb(); | ||
573 | __asm__ __volatile__("flush %0 + %1" | ||
574 | : /* no outputs */ | ||
575 | : "r" (page), | ||
576 | "r" (address & (PAGE_SIZE - 1)) | ||
577 | : "memory"); | ||
578 | } | ||
579 | pte_unmap(ptep); | ||
580 | preempt_enable(); | ||
581 | } | 618 | } |
582 | return; | 619 | return 0; |
583 | 620 | ||
584 | sigill: | 621 | sigill: |
585 | do_exit(SIGILL); | 622 | do_exit(SIGILL); |
623 | return -EINVAL; | ||
624 | |||
586 | sigsegv: | 625 | sigsegv: |
587 | force_sigsegv(signo, current); | 626 | force_sigsegv(signo, current); |
627 | return -EFAULT; | ||
588 | } | 628 | } |
589 | 629 | ||
590 | static void setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, | 630 | static int setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, |
591 | unsigned long signr, sigset_t *oldset, | 631 | unsigned long signr, sigset_t *oldset, |
592 | siginfo_t *info) | 632 | siginfo_t *info) |
593 | { | 633 | { |
594 | struct rt_signal_frame32 __user *sf; | 634 | struct rt_signal_frame32 __user *sf; |
595 | int sigframe_size; | 635 | int sigframe_size; |
@@ -687,12 +727,7 @@ static void setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
687 | if (ka->ka_restorer) | 727 | if (ka->ka_restorer) |
688 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; | 728 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; |
689 | else { | 729 | else { |
690 | /* Flush instruction space. */ | ||
691 | unsigned long address = ((unsigned long)&(sf->insns[0])); | 730 | unsigned long address = ((unsigned long)&(sf->insns[0])); |
692 | pgd_t *pgdp = pgd_offset(current->mm, address); | ||
693 | pud_t *pudp = pud_offset(pgdp, address); | ||
694 | pmd_t *pmdp = pmd_offset(pudp, address); | ||
695 | pte_t *ptep; | ||
696 | 731 | ||
697 | regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); | 732 | regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); |
698 | 733 | ||
@@ -704,38 +739,32 @@ static void setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
704 | if (err) | 739 | if (err) |
705 | goto sigsegv; | 740 | goto sigsegv; |
706 | 741 | ||
707 | preempt_disable(); | 742 | flush_signal_insns(address); |
708 | ptep = pte_offset_map(pmdp, address); | ||
709 | if (pte_present(*ptep)) { | ||
710 | unsigned long page = (unsigned long) | ||
711 | page_address(pte_page(*ptep)); | ||
712 | |||
713 | wmb(); | ||
714 | __asm__ __volatile__("flush %0 + %1" | ||
715 | : /* no outputs */ | ||
716 | : "r" (page), | ||
717 | "r" (address & (PAGE_SIZE - 1)) | ||
718 | : "memory"); | ||
719 | } | ||
720 | pte_unmap(ptep); | ||
721 | preempt_enable(); | ||
722 | } | 743 | } |
723 | return; | 744 | return 0; |
724 | 745 | ||
725 | sigill: | 746 | sigill: |
726 | do_exit(SIGILL); | 747 | do_exit(SIGILL); |
748 | return -EINVAL; | ||
749 | |||
727 | sigsegv: | 750 | sigsegv: |
728 | force_sigsegv(signr, current); | 751 | force_sigsegv(signr, current); |
752 | return -EFAULT; | ||
729 | } | 753 | } |
730 | 754 | ||
731 | static inline void handle_signal32(unsigned long signr, struct k_sigaction *ka, | 755 | static inline int handle_signal32(unsigned long signr, struct k_sigaction *ka, |
732 | siginfo_t *info, | 756 | siginfo_t *info, |
733 | sigset_t *oldset, struct pt_regs *regs) | 757 | sigset_t *oldset, struct pt_regs *regs) |
734 | { | 758 | { |
759 | int err; | ||
760 | |||
735 | if (ka->sa.sa_flags & SA_SIGINFO) | 761 | if (ka->sa.sa_flags & SA_SIGINFO) |
736 | setup_rt_frame32(ka, regs, signr, oldset, info); | 762 | err = setup_rt_frame32(ka, regs, signr, oldset, info); |
737 | else | 763 | else |
738 | setup_frame32(ka, regs, signr, oldset); | 764 | err = setup_frame32(ka, regs, signr, oldset); |
765 | |||
766 | if (err) | ||
767 | return err; | ||
739 | 768 | ||
740 | spin_lock_irq(¤t->sighand->siglock); | 769 | spin_lock_irq(¤t->sighand->siglock); |
741 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); | 770 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); |
@@ -743,6 +772,10 @@ static inline void handle_signal32(unsigned long signr, struct k_sigaction *ka, | |||
743 | sigaddset(¤t->blocked,signr); | 772 | sigaddset(¤t->blocked,signr); |
744 | recalc_sigpending(); | 773 | recalc_sigpending(); |
745 | spin_unlock_irq(¤t->sighand->siglock); | 774 | spin_unlock_irq(¤t->sighand->siglock); |
775 | |||
776 | tracehook_signal_handler(signr, info, ka, regs, 0); | ||
777 | |||
778 | return 0; | ||
746 | } | 779 | } |
747 | 780 | ||
748 | static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs, | 781 | static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs, |
@@ -789,16 +822,14 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, | |||
789 | if (signr > 0) { | 822 | if (signr > 0) { |
790 | if (restart_syscall) | 823 | if (restart_syscall) |
791 | syscall_restart32(orig_i0, regs, &ka.sa); | 824 | syscall_restart32(orig_i0, regs, &ka.sa); |
792 | handle_signal32(signr, &ka, &info, oldset, regs); | 825 | if (handle_signal32(signr, &ka, &info, oldset, regs) == 0) { |
793 | 826 | /* A signal was successfully delivered; the saved | |
794 | /* A signal was successfully delivered; the saved | 827 | * sigmask will have been stored in the signal frame, |
795 | * sigmask will have been stored in the signal frame, | 828 | * and will be restored by sigreturn, so we can simply |
796 | * and will be restored by sigreturn, so we can simply | 829 | * clear the TS_RESTORE_SIGMASK flag. |
797 | * clear the TS_RESTORE_SIGMASK flag. | 830 | */ |
798 | */ | 831 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
799 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | 832 | } |
800 | |||
801 | tracehook_signal_handler(signr, &info, &ka, regs, 0); | ||
802 | return; | 833 | return; |
803 | } | 834 | } |
804 | if (restart_syscall && | 835 | if (restart_syscall && |
@@ -809,12 +840,14 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, | |||
809 | regs->u_regs[UREG_I0] = orig_i0; | 840 | regs->u_regs[UREG_I0] = orig_i0; |
810 | regs->tpc -= 4; | 841 | regs->tpc -= 4; |
811 | regs->tnpc -= 4; | 842 | regs->tnpc -= 4; |
843 | pt_regs_clear_syscall(regs); | ||
812 | } | 844 | } |
813 | if (restart_syscall && | 845 | if (restart_syscall && |
814 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { | 846 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { |
815 | regs->u_regs[UREG_G1] = __NR_restart_syscall; | 847 | regs->u_regs[UREG_G1] = __NR_restart_syscall; |
816 | regs->tpc -= 4; | 848 | regs->tpc -= 4; |
817 | regs->tnpc -= 4; | 849 | regs->tnpc -= 4; |
850 | pt_regs_clear_syscall(regs); | ||
818 | } | 851 | } |
819 | 852 | ||
820 | /* If there's no signal to deliver, we just put the saved sigmask | 853 | /* If there's no signal to deliver, we just put the saved sigmask |
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index 9882df92ba0a..5e5c5fd03783 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -315,8 +315,8 @@ save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | |||
315 | return err; | 315 | return err; |
316 | } | 316 | } |
317 | 317 | ||
318 | static void setup_frame(struct k_sigaction *ka, struct pt_regs *regs, | 318 | static int setup_frame(struct k_sigaction *ka, struct pt_regs *regs, |
319 | int signo, sigset_t *oldset) | 319 | int signo, sigset_t *oldset) |
320 | { | 320 | { |
321 | struct signal_frame __user *sf; | 321 | struct signal_frame __user *sf; |
322 | int sigframe_size, err; | 322 | int sigframe_size, err; |
@@ -384,16 +384,19 @@ static void setup_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
384 | /* Flush instruction space. */ | 384 | /* Flush instruction space. */ |
385 | flush_sig_insns(current->mm, (unsigned long) &(sf->insns[0])); | 385 | flush_sig_insns(current->mm, (unsigned long) &(sf->insns[0])); |
386 | } | 386 | } |
387 | return; | 387 | return 0; |
388 | 388 | ||
389 | sigill_and_return: | 389 | sigill_and_return: |
390 | do_exit(SIGILL); | 390 | do_exit(SIGILL); |
391 | return -EINVAL; | ||
392 | |||
391 | sigsegv: | 393 | sigsegv: |
392 | force_sigsegv(signo, current); | 394 | force_sigsegv(signo, current); |
395 | return -EFAULT; | ||
393 | } | 396 | } |
394 | 397 | ||
395 | static void setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | 398 | static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, |
396 | int signo, sigset_t *oldset, siginfo_t *info) | 399 | int signo, sigset_t *oldset, siginfo_t *info) |
397 | { | 400 | { |
398 | struct rt_signal_frame __user *sf; | 401 | struct rt_signal_frame __user *sf; |
399 | int sigframe_size; | 402 | int sigframe_size; |
@@ -466,22 +469,30 @@ static void setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
466 | /* Flush instruction space. */ | 469 | /* Flush instruction space. */ |
467 | flush_sig_insns(current->mm, (unsigned long) &(sf->insns[0])); | 470 | flush_sig_insns(current->mm, (unsigned long) &(sf->insns[0])); |
468 | } | 471 | } |
469 | return; | 472 | return 0; |
470 | 473 | ||
471 | sigill: | 474 | sigill: |
472 | do_exit(SIGILL); | 475 | do_exit(SIGILL); |
476 | return -EINVAL; | ||
477 | |||
473 | sigsegv: | 478 | sigsegv: |
474 | force_sigsegv(signo, current); | 479 | force_sigsegv(signo, current); |
480 | return -EFAULT; | ||
475 | } | 481 | } |
476 | 482 | ||
477 | static inline void | 483 | static inline int |
478 | handle_signal(unsigned long signr, struct k_sigaction *ka, | 484 | handle_signal(unsigned long signr, struct k_sigaction *ka, |
479 | siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) | 485 | siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) |
480 | { | 486 | { |
487 | int err; | ||
488 | |||
481 | if (ka->sa.sa_flags & SA_SIGINFO) | 489 | if (ka->sa.sa_flags & SA_SIGINFO) |
482 | setup_rt_frame(ka, regs, signr, oldset, info); | 490 | err = setup_rt_frame(ka, regs, signr, oldset, info); |
483 | else | 491 | else |
484 | setup_frame(ka, regs, signr, oldset); | 492 | err = setup_frame(ka, regs, signr, oldset); |
493 | |||
494 | if (err) | ||
495 | return err; | ||
485 | 496 | ||
486 | spin_lock_irq(¤t->sighand->siglock); | 497 | spin_lock_irq(¤t->sighand->siglock); |
487 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); | 498 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); |
@@ -489,6 +500,10 @@ handle_signal(unsigned long signr, struct k_sigaction *ka, | |||
489 | sigaddset(¤t->blocked, signr); | 500 | sigaddset(¤t->blocked, signr); |
490 | recalc_sigpending(); | 501 | recalc_sigpending(); |
491 | spin_unlock_irq(¤t->sighand->siglock); | 502 | spin_unlock_irq(¤t->sighand->siglock); |
503 | |||
504 | tracehook_signal_handler(signr, info, ka, regs, 0); | ||
505 | |||
506 | return 0; | ||
492 | } | 507 | } |
493 | 508 | ||
494 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, | 509 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, |
@@ -546,17 +561,15 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
546 | if (signr > 0) { | 561 | if (signr > 0) { |
547 | if (restart_syscall) | 562 | if (restart_syscall) |
548 | syscall_restart(orig_i0, regs, &ka.sa); | 563 | syscall_restart(orig_i0, regs, &ka.sa); |
549 | handle_signal(signr, &ka, &info, oldset, regs); | 564 | if (handle_signal(signr, &ka, &info, oldset, regs) == 0) { |
550 | 565 | /* a signal was successfully delivered; the saved | |
551 | /* a signal was successfully delivered; the saved | 566 | * sigmask will have been stored in the signal frame, |
552 | * sigmask will have been stored in the signal frame, | 567 | * and will be restored by sigreturn, so we can simply |
553 | * and will be restored by sigreturn, so we can simply | 568 | * clear the TIF_RESTORE_SIGMASK flag. |
554 | * clear the TIF_RESTORE_SIGMASK flag. | 569 | */ |
555 | */ | 570 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) |
556 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | 571 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
557 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 572 | } |
558 | |||
559 | tracehook_signal_handler(signr, &info, &ka, regs, 0); | ||
560 | return; | 573 | return; |
561 | } | 574 | } |
562 | if (restart_syscall && | 575 | if (restart_syscall && |
@@ -567,12 +580,14 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
567 | regs->u_regs[UREG_I0] = orig_i0; | 580 | regs->u_regs[UREG_I0] = orig_i0; |
568 | regs->pc -= 4; | 581 | regs->pc -= 4; |
569 | regs->npc -= 4; | 582 | regs->npc -= 4; |
583 | pt_regs_clear_syscall(regs); | ||
570 | } | 584 | } |
571 | if (restart_syscall && | 585 | if (restart_syscall && |
572 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { | 586 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { |
573 | regs->u_regs[UREG_G1] = __NR_restart_syscall; | 587 | regs->u_regs[UREG_G1] = __NR_restart_syscall; |
574 | regs->pc -= 4; | 588 | regs->pc -= 4; |
575 | regs->npc -= 4; | 589 | regs->npc -= 4; |
590 | pt_regs_clear_syscall(regs); | ||
576 | } | 591 | } |
577 | 592 | ||
578 | /* if there's no signal to deliver, we just put the saved sigmask | 593 | /* if there's no signal to deliver, we just put the saved sigmask |
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index 9fa48c30037e..006fe4515886 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c | |||
@@ -409,7 +409,7 @@ static inline void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs * | |||
409 | return (void __user *) sp; | 409 | return (void __user *) sp; |
410 | } | 410 | } |
411 | 411 | ||
412 | static inline void | 412 | static inline int |
413 | setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | 413 | setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, |
414 | int signo, sigset_t *oldset, siginfo_t *info) | 414 | int signo, sigset_t *oldset, siginfo_t *info) |
415 | { | 415 | { |
@@ -483,26 +483,37 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
483 | } | 483 | } |
484 | /* 4. return to kernel instructions */ | 484 | /* 4. return to kernel instructions */ |
485 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; | 485 | regs->u_regs[UREG_I7] = (unsigned long)ka->ka_restorer; |
486 | return; | 486 | return 0; |
487 | 487 | ||
488 | sigill: | 488 | sigill: |
489 | do_exit(SIGILL); | 489 | do_exit(SIGILL); |
490 | return -EINVAL; | ||
491 | |||
490 | sigsegv: | 492 | sigsegv: |
491 | force_sigsegv(signo, current); | 493 | force_sigsegv(signo, current); |
494 | return -EFAULT; | ||
492 | } | 495 | } |
493 | 496 | ||
494 | static inline void handle_signal(unsigned long signr, struct k_sigaction *ka, | 497 | static inline int handle_signal(unsigned long signr, struct k_sigaction *ka, |
495 | siginfo_t *info, | 498 | siginfo_t *info, |
496 | sigset_t *oldset, struct pt_regs *regs) | 499 | sigset_t *oldset, struct pt_regs *regs) |
497 | { | 500 | { |
498 | setup_rt_frame(ka, regs, signr, oldset, | 501 | int err; |
499 | (ka->sa.sa_flags & SA_SIGINFO) ? info : NULL); | 502 | |
503 | err = setup_rt_frame(ka, regs, signr, oldset, | ||
504 | (ka->sa.sa_flags & SA_SIGINFO) ? info : NULL); | ||
505 | if (err) | ||
506 | return err; | ||
500 | spin_lock_irq(¤t->sighand->siglock); | 507 | spin_lock_irq(¤t->sighand->siglock); |
501 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); | 508 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); |
502 | if (!(ka->sa.sa_flags & SA_NOMASK)) | 509 | if (!(ka->sa.sa_flags & SA_NOMASK)) |
503 | sigaddset(¤t->blocked,signr); | 510 | sigaddset(¤t->blocked,signr); |
504 | recalc_sigpending(); | 511 | recalc_sigpending(); |
505 | spin_unlock_irq(¤t->sighand->siglock); | 512 | spin_unlock_irq(¤t->sighand->siglock); |
513 | |||
514 | tracehook_signal_handler(signr, info, ka, regs, 0); | ||
515 | |||
516 | return 0; | ||
506 | } | 517 | } |
507 | 518 | ||
508 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, | 519 | static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, |
@@ -571,16 +582,14 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
571 | if (signr > 0) { | 582 | if (signr > 0) { |
572 | if (restart_syscall) | 583 | if (restart_syscall) |
573 | syscall_restart(orig_i0, regs, &ka.sa); | 584 | syscall_restart(orig_i0, regs, &ka.sa); |
574 | handle_signal(signr, &ka, &info, oldset, regs); | 585 | if (handle_signal(signr, &ka, &info, oldset, regs) == 0) { |
575 | 586 | /* A signal was successfully delivered; the saved | |
576 | /* A signal was successfully delivered; the saved | 587 | * sigmask will have been stored in the signal frame, |
577 | * sigmask will have been stored in the signal frame, | 588 | * and will be restored by sigreturn, so we can simply |
578 | * and will be restored by sigreturn, so we can simply | 589 | * clear the TS_RESTORE_SIGMASK flag. |
579 | * clear the TS_RESTORE_SIGMASK flag. | 590 | */ |
580 | */ | 591 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
581 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | 592 | } |
582 | |||
583 | tracehook_signal_handler(signr, &info, &ka, regs, 0); | ||
584 | return; | 593 | return; |
585 | } | 594 | } |
586 | if (restart_syscall && | 595 | if (restart_syscall && |
@@ -591,12 +600,14 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
591 | regs->u_regs[UREG_I0] = orig_i0; | 600 | regs->u_regs[UREG_I0] = orig_i0; |
592 | regs->tpc -= 4; | 601 | regs->tpc -= 4; |
593 | regs->tnpc -= 4; | 602 | regs->tnpc -= 4; |
603 | pt_regs_clear_syscall(regs); | ||
594 | } | 604 | } |
595 | if (restart_syscall && | 605 | if (restart_syscall && |
596 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { | 606 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { |
597 | regs->u_regs[UREG_G1] = __NR_restart_syscall; | 607 | regs->u_regs[UREG_G1] = __NR_restart_syscall; |
598 | regs->tpc -= 4; | 608 | regs->tpc -= 4; |
599 | regs->tnpc -= 4; | 609 | regs->tnpc -= 4; |
610 | pt_regs_clear_syscall(regs); | ||
600 | } | 611 | } |
601 | 612 | ||
602 | /* If there's no signal to deliver, we just put the saved sigmask | 613 | /* If there's no signal to deliver, we just put the saved sigmask |
diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S index 84f296ca9e63..8f58bdff20d7 100644 --- a/arch/tile/kernel/intvec_32.S +++ b/arch/tile/kernel/intvec_32.S | |||
@@ -1506,13 +1506,6 @@ handle_ill: | |||
1506 | } | 1506 | } |
1507 | STD_ENDPROC(handle_ill) | 1507 | STD_ENDPROC(handle_ill) |
1508 | 1508 | ||
1509 | .pushsection .rodata, "a" | ||
1510 | .align 8 | ||
1511 | bpt_code: | ||
1512 | bpt | ||
1513 | ENDPROC(bpt_code) | ||
1514 | .popsection | ||
1515 | |||
1516 | /* Various stub interrupt handlers and syscall handlers */ | 1509 | /* Various stub interrupt handlers and syscall handlers */ |
1517 | 1510 | ||
1518 | STD_ENTRY_LOCAL(_kernel_double_fault) | 1511 | STD_ENTRY_LOCAL(_kernel_double_fault) |
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 2ab233ba32c1..47d0c37897d5 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
@@ -255,18 +255,6 @@ static void uml_net_tx_timeout(struct net_device *dev) | |||
255 | netif_wake_queue(dev); | 255 | netif_wake_queue(dev); |
256 | } | 256 | } |
257 | 257 | ||
258 | static int uml_net_set_mac(struct net_device *dev, void *addr) | ||
259 | { | ||
260 | struct uml_net_private *lp = netdev_priv(dev); | ||
261 | struct sockaddr *hwaddr = addr; | ||
262 | |||
263 | spin_lock_irq(&lp->lock); | ||
264 | eth_mac_addr(dev, hwaddr->sa_data); | ||
265 | spin_unlock_irq(&lp->lock); | ||
266 | |||
267 | return 0; | ||
268 | } | ||
269 | |||
270 | static int uml_net_change_mtu(struct net_device *dev, int new_mtu) | 258 | static int uml_net_change_mtu(struct net_device *dev, int new_mtu) |
271 | { | 259 | { |
272 | dev->mtu = new_mtu; | 260 | dev->mtu = new_mtu; |
@@ -373,7 +361,7 @@ static const struct net_device_ops uml_netdev_ops = { | |||
373 | .ndo_start_xmit = uml_net_start_xmit, | 361 | .ndo_start_xmit = uml_net_start_xmit, |
374 | .ndo_set_multicast_list = uml_net_set_multicast_list, | 362 | .ndo_set_multicast_list = uml_net_set_multicast_list, |
375 | .ndo_tx_timeout = uml_net_tx_timeout, | 363 | .ndo_tx_timeout = uml_net_tx_timeout, |
376 | .ndo_set_mac_address = uml_net_set_mac, | 364 | .ndo_set_mac_address = eth_mac_addr, |
377 | .ndo_change_mtu = uml_net_change_mtu, | 365 | .ndo_change_mtu = uml_net_change_mtu, |
378 | .ndo_validate_addr = eth_validate_addr, | 366 | .ndo_validate_addr = eth_validate_addr, |
379 | }; | 367 | }; |
@@ -472,7 +460,8 @@ static void eth_configure(int n, void *init, char *mac, | |||
472 | ((*transport->user->init)(&lp->user, dev) != 0)) | 460 | ((*transport->user->init)(&lp->user, dev) != 0)) |
473 | goto out_unregister; | 461 | goto out_unregister; |
474 | 462 | ||
475 | eth_mac_addr(dev, device->mac); | 463 | /* don't use eth_mac_addr, it will not work here */ |
464 | memcpy(dev->dev_addr, device->mac, ETH_ALEN); | ||
476 | dev->mtu = transport->user->mtu; | 465 | dev->mtu = transport->user->mtu; |
477 | dev->netdev_ops = ¨_netdev_ops; | 466 | dev->netdev_ops = ¨_netdev_ops; |
478 | dev->ethtool_ops = ¨_net_ethtool_ops; | 467 | dev->ethtool_ops = ¨_net_ethtool_ops; |
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index cd145eda3579..49b5e1eb3262 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c | |||
@@ -62,7 +62,7 @@ static long execve1(const char *file, | |||
62 | return error; | 62 | return error; |
63 | } | 63 | } |
64 | 64 | ||
65 | long um_execve(const char *file, char __user *__user *argv, char __user *__user *env) | 65 | long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env) |
66 | { | 66 | { |
67 | long err; | 67 | long err; |
68 | 68 | ||
@@ -72,8 +72,8 @@ long um_execve(const char *file, char __user *__user *argv, char __user *__user | |||
72 | return err; | 72 | return err; |
73 | } | 73 | } |
74 | 74 | ||
75 | long sys_execve(const char __user *file, char __user *__user *argv, | 75 | long sys_execve(const char __user *file, const char __user *const __user *argv, |
76 | char __user *__user *env) | 76 | const char __user *const __user *env) |
77 | { | 77 | { |
78 | long error; | 78 | long error; |
79 | char *filename; | 79 | char *filename; |
diff --git a/arch/um/kernel/internal.h b/arch/um/kernel/internal.h index 1303a105fe91..5bf97db24a04 100644 --- a/arch/um/kernel/internal.h +++ b/arch/um/kernel/internal.h | |||
@@ -1 +1 @@ | |||
extern long um_execve(const char *file, char __user *__user *argv, char __user *__user *env); | extern long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env); | ||
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index 5ddb246626db..f958cb876ee3 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c | |||
@@ -60,8 +60,8 @@ int kernel_execve(const char *filename, | |||
60 | 60 | ||
61 | fs = get_fs(); | 61 | fs = get_fs(); |
62 | set_fs(KERNEL_DS); | 62 | set_fs(KERNEL_DS); |
63 | ret = um_execve(filename, (char __user *__user *)argv, | 63 | ret = um_execve(filename, (const char __user *const __user *)argv, |
64 | (char __user *__user *) envp); | 64 | (const char __user *const __user *) envp); |
65 | set_fs(fs); | 65 | set_fs(fs); |
66 | 66 | ||
67 | return ret; | 67 | return ret; |
diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c index 030f4b93e255..5df2869c874b 100644 --- a/arch/x86/boot/early_serial_console.c +++ b/arch/x86/boot/early_serial_console.c | |||
@@ -58,7 +58,19 @@ static void parse_earlyprintk(void) | |||
58 | if (arg[pos] == ',') | 58 | if (arg[pos] == ',') |
59 | pos++; | 59 | pos++; |
60 | 60 | ||
61 | if (!strncmp(arg, "ttyS", 4)) { | 61 | /* |
62 | * make sure we have | ||
63 | * "serial,0x3f8,115200" | ||
64 | * "serial,ttyS0,115200" | ||
65 | * "ttyS0,115200" | ||
66 | */ | ||
67 | if (pos == 7 && !strncmp(arg + pos, "0x", 2)) { | ||
68 | port = simple_strtoull(arg + pos, &e, 16); | ||
69 | if (port == 0 || arg + pos == e) | ||
70 | port = DEFAULT_SERIAL_PORT; | ||
71 | else | ||
72 | pos = e - arg; | ||
73 | } else if (!strncmp(arg + pos, "ttyS", 4)) { | ||
62 | static const int bases[] = { 0x3f8, 0x2f8 }; | 74 | static const int bases[] = { 0x3f8, 0x2f8 }; |
63 | int idx = 0; | 75 | int idx = 0; |
64 | 76 | ||
diff --git a/arch/x86/include/asm/amd_iommu_proto.h b/arch/x86/include/asm/amd_iommu_proto.h index d2544f1d705d..cb030374b90a 100644 --- a/arch/x86/include/asm/amd_iommu_proto.h +++ b/arch/x86/include/asm/amd_iommu_proto.h | |||
@@ -38,4 +38,10 @@ static inline void amd_iommu_stats_init(void) { } | |||
38 | 38 | ||
39 | #endif /* !CONFIG_AMD_IOMMU_STATS */ | 39 | #endif /* !CONFIG_AMD_IOMMU_STATS */ |
40 | 40 | ||
41 | static inline bool is_rd890_iommu(struct pci_dev *pdev) | ||
42 | { | ||
43 | return (pdev->vendor == PCI_VENDOR_ID_ATI) && | ||
44 | (pdev->device == PCI_DEVICE_ID_RD890_IOMMU); | ||
45 | } | ||
46 | |||
41 | #endif /* _ASM_X86_AMD_IOMMU_PROTO_H */ | 47 | #endif /* _ASM_X86_AMD_IOMMU_PROTO_H */ |
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h index 7014e88bc779..08616180deaf 100644 --- a/arch/x86/include/asm/amd_iommu_types.h +++ b/arch/x86/include/asm/amd_iommu_types.h | |||
@@ -368,6 +368,9 @@ struct amd_iommu { | |||
368 | /* capabilities of that IOMMU read from ACPI */ | 368 | /* capabilities of that IOMMU read from ACPI */ |
369 | u32 cap; | 369 | u32 cap; |
370 | 370 | ||
371 | /* flags read from acpi table */ | ||
372 | u8 acpi_flags; | ||
373 | |||
371 | /* | 374 | /* |
372 | * Capability pointer. There could be more than one IOMMU per PCI | 375 | * Capability pointer. There could be more than one IOMMU per PCI |
373 | * device function if there are more than one AMD IOMMU capability | 376 | * device function if there are more than one AMD IOMMU capability |
@@ -411,6 +414,15 @@ struct amd_iommu { | |||
411 | 414 | ||
412 | /* default dma_ops domain for that IOMMU */ | 415 | /* default dma_ops domain for that IOMMU */ |
413 | struct dma_ops_domain *default_dom; | 416 | struct dma_ops_domain *default_dom; |
417 | |||
418 | /* | ||
419 | * This array is required to work around a potential BIOS bug. | ||
420 | * The BIOS may miss to restore parts of the PCI configuration | ||
421 | * space when the system resumes from S3. The result is that the | ||
422 | * IOMMU does not execute commands anymore which leads to system | ||
423 | * failure. | ||
424 | */ | ||
425 | u32 cache_cfg[4]; | ||
414 | }; | 426 | }; |
415 | 427 | ||
416 | /* | 428 | /* |
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index 545776efeb16..bafd80defa43 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h | |||
@@ -309,7 +309,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr) | |||
309 | static __always_inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr) | 309 | static __always_inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr) |
310 | { | 310 | { |
311 | return ((1UL << (nr % BITS_PER_LONG)) & | 311 | return ((1UL << (nr % BITS_PER_LONG)) & |
312 | (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0; | 312 | (addr[nr / BITS_PER_LONG])) != 0; |
313 | } | 313 | } |
314 | 314 | ||
315 | static inline int variable_test_bit(int nr, volatile const unsigned long *addr) | 315 | static inline int variable_test_bit(int nr, volatile const unsigned long *addr) |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index c6fbb7b430d1..3f76523589af 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -168,6 +168,7 @@ | |||
168 | #define X86_FEATURE_XSAVEOPT (7*32+ 4) /* Optimized Xsave */ | 168 | #define X86_FEATURE_XSAVEOPT (7*32+ 4) /* Optimized Xsave */ |
169 | #define X86_FEATURE_PLN (7*32+ 5) /* Intel Power Limit Notification */ | 169 | #define X86_FEATURE_PLN (7*32+ 5) /* Intel Power Limit Notification */ |
170 | #define X86_FEATURE_PTS (7*32+ 6) /* Intel Package Thermal Status */ | 170 | #define X86_FEATURE_PTS (7*32+ 6) /* Intel Package Thermal Status */ |
171 | #define X86_FEATURE_DTS (7*32+ 7) /* Digital Thermal Sensor */ | ||
171 | 172 | ||
172 | /* Virtualization flags: Linux defined, word 8 */ | 173 | /* Virtualization flags: Linux defined, word 8 */ |
173 | #define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */ | 174 | #define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */ |
diff --git a/arch/x86/include/asm/hw_breakpoint.h b/arch/x86/include/asm/hw_breakpoint.h index 528a11e8d3e3..824ca07860d0 100644 --- a/arch/x86/include/asm/hw_breakpoint.h +++ b/arch/x86/include/asm/hw_breakpoint.h | |||
@@ -20,7 +20,7 @@ struct arch_hw_breakpoint { | |||
20 | #include <linux/list.h> | 20 | #include <linux/list.h> |
21 | 21 | ||
22 | /* Available HW breakpoint length encodings */ | 22 | /* Available HW breakpoint length encodings */ |
23 | #define X86_BREAKPOINT_LEN_X 0x00 | 23 | #define X86_BREAKPOINT_LEN_X 0x40 |
24 | #define X86_BREAKPOINT_LEN_1 0x40 | 24 | #define X86_BREAKPOINT_LEN_1 0x40 |
25 | #define X86_BREAKPOINT_LEN_2 0x44 | 25 | #define X86_BREAKPOINT_LEN_2 0x44 |
26 | #define X86_BREAKPOINT_LEN_4 0x4c | 26 | #define X86_BREAKPOINT_LEN_4 0x4c |
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 0925676266bd..fedf32a8c3ec 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
@@ -11,6 +11,8 @@ ifdef CONFIG_FUNCTION_TRACER | |||
11 | CFLAGS_REMOVE_tsc.o = -pg | 11 | CFLAGS_REMOVE_tsc.o = -pg |
12 | CFLAGS_REMOVE_rtc.o = -pg | 12 | CFLAGS_REMOVE_rtc.o = -pg |
13 | CFLAGS_REMOVE_paravirt-spinlocks.o = -pg | 13 | CFLAGS_REMOVE_paravirt-spinlocks.o = -pg |
14 | CFLAGS_REMOVE_pvclock.o = -pg | ||
15 | CFLAGS_REMOVE_kvmclock.o = -pg | ||
14 | CFLAGS_REMOVE_ftrace.o = -pg | 16 | CFLAGS_REMOVE_ftrace.o = -pg |
15 | CFLAGS_REMOVE_early_printk.o = -pg | 17 | CFLAGS_REMOVE_early_printk.o = -pg |
16 | endif | 18 | endif |
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index fb7a5f052e2b..fb16f17e59be 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c | |||
@@ -61,7 +61,7 @@ struct cstate_entry { | |||
61 | unsigned int ecx; | 61 | unsigned int ecx; |
62 | } states[ACPI_PROCESSOR_MAX_POWER]; | 62 | } states[ACPI_PROCESSOR_MAX_POWER]; |
63 | }; | 63 | }; |
64 | static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */ | 64 | static struct cstate_entry __percpu *cpu_cstate_entry; /* per CPU ptr */ |
65 | 65 | ||
66 | static short mwait_supported[ACPI_PROCESSOR_MAX_POWER]; | 66 | static short mwait_supported[ACPI_PROCESSOR_MAX_POWER]; |
67 | 67 | ||
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index fa044e1e30a2..679b6450382b 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -1953,6 +1953,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom, | |||
1953 | size_t size, | 1953 | size_t size, |
1954 | int dir) | 1954 | int dir) |
1955 | { | 1955 | { |
1956 | dma_addr_t flush_addr; | ||
1956 | dma_addr_t i, start; | 1957 | dma_addr_t i, start; |
1957 | unsigned int pages; | 1958 | unsigned int pages; |
1958 | 1959 | ||
@@ -1960,6 +1961,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom, | |||
1960 | (dma_addr + size > dma_dom->aperture_size)) | 1961 | (dma_addr + size > dma_dom->aperture_size)) |
1961 | return; | 1962 | return; |
1962 | 1963 | ||
1964 | flush_addr = dma_addr; | ||
1963 | pages = iommu_num_pages(dma_addr, size, PAGE_SIZE); | 1965 | pages = iommu_num_pages(dma_addr, size, PAGE_SIZE); |
1964 | dma_addr &= PAGE_MASK; | 1966 | dma_addr &= PAGE_MASK; |
1965 | start = dma_addr; | 1967 | start = dma_addr; |
@@ -1974,7 +1976,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom, | |||
1974 | dma_ops_free_addresses(dma_dom, dma_addr, pages); | 1976 | dma_ops_free_addresses(dma_dom, dma_addr, pages); |
1975 | 1977 | ||
1976 | if (amd_iommu_unmap_flush || dma_dom->need_flush) { | 1978 | if (amd_iommu_unmap_flush || dma_dom->need_flush) { |
1977 | iommu_flush_pages(&dma_dom->domain, dma_addr, size); | 1979 | iommu_flush_pages(&dma_dom->domain, flush_addr, size); |
1978 | dma_dom->need_flush = false; | 1980 | dma_dom->need_flush = false; |
1979 | } | 1981 | } |
1980 | } | 1982 | } |
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 3cc63e2b8dd4..5a170cbbbed8 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -632,6 +632,13 @@ static void __init init_iommu_from_pci(struct amd_iommu *iommu) | |||
632 | iommu->last_device = calc_devid(MMIO_GET_BUS(range), | 632 | iommu->last_device = calc_devid(MMIO_GET_BUS(range), |
633 | MMIO_GET_LD(range)); | 633 | MMIO_GET_LD(range)); |
634 | iommu->evt_msi_num = MMIO_MSI_NUM(misc); | 634 | iommu->evt_msi_num = MMIO_MSI_NUM(misc); |
635 | |||
636 | if (is_rd890_iommu(iommu->dev)) { | ||
637 | pci_read_config_dword(iommu->dev, 0xf0, &iommu->cache_cfg[0]); | ||
638 | pci_read_config_dword(iommu->dev, 0xf4, &iommu->cache_cfg[1]); | ||
639 | pci_read_config_dword(iommu->dev, 0xf8, &iommu->cache_cfg[2]); | ||
640 | pci_read_config_dword(iommu->dev, 0xfc, &iommu->cache_cfg[3]); | ||
641 | } | ||
635 | } | 642 | } |
636 | 643 | ||
637 | /* | 644 | /* |
@@ -649,29 +656,9 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu, | |||
649 | struct ivhd_entry *e; | 656 | struct ivhd_entry *e; |
650 | 657 | ||
651 | /* | 658 | /* |
652 | * First set the recommended feature enable bits from ACPI | 659 | * First save the recommended feature enable bits from ACPI |
653 | * into the IOMMU control registers | ||
654 | */ | 660 | */ |
655 | h->flags & IVHD_FLAG_HT_TUN_EN_MASK ? | 661 | iommu->acpi_flags = h->flags; |
656 | iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) : | ||
657 | iommu_feature_disable(iommu, CONTROL_HT_TUN_EN); | ||
658 | |||
659 | h->flags & IVHD_FLAG_PASSPW_EN_MASK ? | ||
660 | iommu_feature_enable(iommu, CONTROL_PASSPW_EN) : | ||
661 | iommu_feature_disable(iommu, CONTROL_PASSPW_EN); | ||
662 | |||
663 | h->flags & IVHD_FLAG_RESPASSPW_EN_MASK ? | ||
664 | iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) : | ||
665 | iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN); | ||
666 | |||
667 | h->flags & IVHD_FLAG_ISOC_EN_MASK ? | ||
668 | iommu_feature_enable(iommu, CONTROL_ISOC_EN) : | ||
669 | iommu_feature_disable(iommu, CONTROL_ISOC_EN); | ||
670 | |||
671 | /* | ||
672 | * make IOMMU memory accesses cache coherent | ||
673 | */ | ||
674 | iommu_feature_enable(iommu, CONTROL_COHERENT_EN); | ||
675 | 662 | ||
676 | /* | 663 | /* |
677 | * Done. Now parse the device entries | 664 | * Done. Now parse the device entries |
@@ -1116,6 +1103,40 @@ static void init_device_table(void) | |||
1116 | } | 1103 | } |
1117 | } | 1104 | } |
1118 | 1105 | ||
1106 | static void iommu_init_flags(struct amd_iommu *iommu) | ||
1107 | { | ||
1108 | iommu->acpi_flags & IVHD_FLAG_HT_TUN_EN_MASK ? | ||
1109 | iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) : | ||
1110 | iommu_feature_disable(iommu, CONTROL_HT_TUN_EN); | ||
1111 | |||
1112 | iommu->acpi_flags & IVHD_FLAG_PASSPW_EN_MASK ? | ||
1113 | iommu_feature_enable(iommu, CONTROL_PASSPW_EN) : | ||
1114 | iommu_feature_disable(iommu, CONTROL_PASSPW_EN); | ||
1115 | |||
1116 | iommu->acpi_flags & IVHD_FLAG_RESPASSPW_EN_MASK ? | ||
1117 | iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) : | ||
1118 | iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN); | ||
1119 | |||
1120 | iommu->acpi_flags & IVHD_FLAG_ISOC_EN_MASK ? | ||
1121 | iommu_feature_enable(iommu, CONTROL_ISOC_EN) : | ||
1122 | iommu_feature_disable(iommu, CONTROL_ISOC_EN); | ||
1123 | |||
1124 | /* | ||
1125 | * make IOMMU memory accesses cache coherent | ||
1126 | */ | ||
1127 | iommu_feature_enable(iommu, CONTROL_COHERENT_EN); | ||
1128 | } | ||
1129 | |||
1130 | static void iommu_apply_quirks(struct amd_iommu *iommu) | ||
1131 | { | ||
1132 | if (is_rd890_iommu(iommu->dev)) { | ||
1133 | pci_write_config_dword(iommu->dev, 0xf0, iommu->cache_cfg[0]); | ||
1134 | pci_write_config_dword(iommu->dev, 0xf4, iommu->cache_cfg[1]); | ||
1135 | pci_write_config_dword(iommu->dev, 0xf8, iommu->cache_cfg[2]); | ||
1136 | pci_write_config_dword(iommu->dev, 0xfc, iommu->cache_cfg[3]); | ||
1137 | } | ||
1138 | } | ||
1139 | |||
1119 | /* | 1140 | /* |
1120 | * This function finally enables all IOMMUs found in the system after | 1141 | * This function finally enables all IOMMUs found in the system after |
1121 | * they have been initialized | 1142 | * they have been initialized |
@@ -1126,6 +1147,8 @@ static void enable_iommus(void) | |||
1126 | 1147 | ||
1127 | for_each_iommu(iommu) { | 1148 | for_each_iommu(iommu) { |
1128 | iommu_disable(iommu); | 1149 | iommu_disable(iommu); |
1150 | iommu_apply_quirks(iommu); | ||
1151 | iommu_init_flags(iommu); | ||
1129 | iommu_set_device_table(iommu); | 1152 | iommu_set_device_table(iommu); |
1130 | iommu_enable_command_buffer(iommu); | 1153 | iommu_enable_command_buffer(iommu); |
1131 | iommu_enable_event_buffer(iommu); | 1154 | iommu_enable_event_buffer(iommu); |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index f1efebaf5510..5c5b8f3dddb5 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -306,14 +306,19 @@ void arch_init_copy_chip_data(struct irq_desc *old_desc, | |||
306 | 306 | ||
307 | old_cfg = old_desc->chip_data; | 307 | old_cfg = old_desc->chip_data; |
308 | 308 | ||
309 | memcpy(cfg, old_cfg, sizeof(struct irq_cfg)); | 309 | cfg->vector = old_cfg->vector; |
310 | cfg->move_in_progress = old_cfg->move_in_progress; | ||
311 | cpumask_copy(cfg->domain, old_cfg->domain); | ||
312 | cpumask_copy(cfg->old_domain, old_cfg->old_domain); | ||
310 | 313 | ||
311 | init_copy_irq_2_pin(old_cfg, cfg, node); | 314 | init_copy_irq_2_pin(old_cfg, cfg, node); |
312 | } | 315 | } |
313 | 316 | ||
314 | static void free_irq_cfg(struct irq_cfg *old_cfg) | 317 | static void free_irq_cfg(struct irq_cfg *cfg) |
315 | { | 318 | { |
316 | kfree(old_cfg); | 319 | free_cpumask_var(cfg->domain); |
320 | free_cpumask_var(cfg->old_domain); | ||
321 | kfree(cfg); | ||
317 | } | 322 | } |
318 | 323 | ||
319 | void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc) | 324 | void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc) |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 490dac63c2d2..f2f9ac7da25c 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -545,7 +545,7 @@ void __cpuinit cpu_detect(struct cpuinfo_x86 *c) | |||
545 | } | 545 | } |
546 | } | 546 | } |
547 | 547 | ||
548 | static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) | 548 | void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) |
549 | { | 549 | { |
550 | u32 tfms, xlvl; | 550 | u32 tfms, xlvl; |
551 | u32 ebx; | 551 | u32 ebx; |
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h index 3624e8a0f71b..f668bb1f7d43 100644 --- a/arch/x86/kernel/cpu/cpu.h +++ b/arch/x86/kernel/cpu/cpu.h | |||
@@ -33,5 +33,6 @@ extern const struct cpu_dev *const __x86_cpu_dev_start[], | |||
33 | *const __x86_cpu_dev_end[]; | 33 | *const __x86_cpu_dev_end[]; |
34 | 34 | ||
35 | extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); | 35 | extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); |
36 | extern void get_cpu_cap(struct cpuinfo_x86 *c); | ||
36 | 37 | ||
37 | #endif | 38 | #endif |
diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index 994230d4dc4e..4f6f679f2799 100644 --- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | |||
@@ -368,16 +368,22 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle) | |||
368 | return -ENODEV; | 368 | return -ENODEV; |
369 | 369 | ||
370 | out_obj = output.pointer; | 370 | out_obj = output.pointer; |
371 | if (out_obj->type != ACPI_TYPE_BUFFER) | 371 | if (out_obj->type != ACPI_TYPE_BUFFER) { |
372 | return -ENODEV; | 372 | ret = -ENODEV; |
373 | goto out_free; | ||
374 | } | ||
373 | 375 | ||
374 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); | 376 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
375 | if (errors) | 377 | if (errors) { |
376 | return -ENODEV; | 378 | ret = -ENODEV; |
379 | goto out_free; | ||
380 | } | ||
377 | 381 | ||
378 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); | 382 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); |
379 | if (!(supported & 0x1)) | 383 | if (!(supported & 0x1)) { |
380 | return -ENODEV; | 384 | ret = -ENODEV; |
385 | goto out_free; | ||
386 | } | ||
381 | 387 | ||
382 | out_free: | 388 | out_free: |
383 | kfree(output.pointer); | 389 | kfree(output.pointer); |
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 85f69cdeae10..b4389441efbb 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -39,6 +39,7 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) | |||
39 | misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID; | 39 | misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID; |
40 | wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable); | 40 | wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable); |
41 | c->cpuid_level = cpuid_eax(0); | 41 | c->cpuid_level = cpuid_eax(0); |
42 | get_cpu_cap(c); | ||
42 | } | 43 | } |
43 | } | 44 | } |
44 | 45 | ||
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 3efdf2870a35..03a5b0385ad6 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -102,6 +102,7 @@ struct cpu_hw_events { | |||
102 | */ | 102 | */ |
103 | struct perf_event *events[X86_PMC_IDX_MAX]; /* in counter order */ | 103 | struct perf_event *events[X86_PMC_IDX_MAX]; /* in counter order */ |
104 | unsigned long active_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; | 104 | unsigned long active_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; |
105 | unsigned long running[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; | ||
105 | int enabled; | 106 | int enabled; |
106 | 107 | ||
107 | int n_events; | 108 | int n_events; |
@@ -1010,6 +1011,7 @@ static int x86_pmu_start(struct perf_event *event) | |||
1010 | x86_perf_event_set_period(event); | 1011 | x86_perf_event_set_period(event); |
1011 | cpuc->events[idx] = event; | 1012 | cpuc->events[idx] = event; |
1012 | __set_bit(idx, cpuc->active_mask); | 1013 | __set_bit(idx, cpuc->active_mask); |
1014 | __set_bit(idx, cpuc->running); | ||
1013 | x86_pmu.enable(event); | 1015 | x86_pmu.enable(event); |
1014 | perf_event_update_userpage(event); | 1016 | perf_event_update_userpage(event); |
1015 | 1017 | ||
@@ -1141,8 +1143,16 @@ static int x86_pmu_handle_irq(struct pt_regs *regs) | |||
1141 | cpuc = &__get_cpu_var(cpu_hw_events); | 1143 | cpuc = &__get_cpu_var(cpu_hw_events); |
1142 | 1144 | ||
1143 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { | 1145 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { |
1144 | if (!test_bit(idx, cpuc->active_mask)) | 1146 | if (!test_bit(idx, cpuc->active_mask)) { |
1147 | /* | ||
1148 | * Though we deactivated the counter some cpus | ||
1149 | * might still deliver spurious interrupts still | ||
1150 | * in flight. Catch them: | ||
1151 | */ | ||
1152 | if (__test_and_clear_bit(idx, cpuc->running)) | ||
1153 | handled++; | ||
1145 | continue; | 1154 | continue; |
1155 | } | ||
1146 | 1156 | ||
1147 | event = cpuc->events[idx]; | 1157 | event = cpuc->events[idx]; |
1148 | hwc = &event->hw; | 1158 | hwc = &event->hw; |
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index b560db3305be..249015173992 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
@@ -660,8 +660,12 @@ static int p4_pmu_handle_irq(struct pt_regs *regs) | |||
660 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { | 660 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { |
661 | int overflow; | 661 | int overflow; |
662 | 662 | ||
663 | if (!test_bit(idx, cpuc->active_mask)) | 663 | if (!test_bit(idx, cpuc->active_mask)) { |
664 | /* catch in-flight IRQs */ | ||
665 | if (__test_and_clear_bit(idx, cpuc->running)) | ||
666 | handled++; | ||
664 | continue; | 667 | continue; |
668 | } | ||
665 | 669 | ||
666 | event = cpuc->events[idx]; | 670 | event = cpuc->events[idx]; |
667 | hwc = &event->hw; | 671 | hwc = &event->hw; |
diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c index 34b4dad6f0b8..d49079515122 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c | |||
@@ -31,6 +31,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c) | |||
31 | const struct cpuid_bit *cb; | 31 | const struct cpuid_bit *cb; |
32 | 32 | ||
33 | static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { | 33 | static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { |
34 | { X86_FEATURE_DTS, CR_EAX, 0, 0x00000006, 0 }, | ||
34 | { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006, 0 }, | 35 | { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006, 0 }, |
35 | { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006, 0 }, | 36 | { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006, 0 }, |
36 | { X86_FEATURE_PLN, CR_EAX, 4, 0x00000006, 0 }, | 37 | { X86_FEATURE_PLN, CR_EAX, 4, 0x00000006, 0 }, |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 410fdb3f1939..7494999141b3 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -506,7 +506,7 @@ static int hpet_assign_irq(struct hpet_dev *dev) | |||
506 | { | 506 | { |
507 | unsigned int irq; | 507 | unsigned int irq; |
508 | 508 | ||
509 | irq = create_irq(); | 509 | irq = create_irq_nr(0, -1); |
510 | if (!irq) | 510 | if (!irq) |
511 | return -EINVAL; | 511 | return -EINVAL; |
512 | 512 | ||
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c index a474ec37c32f..ff15c9dcc25d 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c | |||
@@ -206,11 +206,27 @@ int arch_check_bp_in_kernelspace(struct perf_event *bp) | |||
206 | int arch_bp_generic_fields(int x86_len, int x86_type, | 206 | int arch_bp_generic_fields(int x86_len, int x86_type, |
207 | int *gen_len, int *gen_type) | 207 | int *gen_len, int *gen_type) |
208 | { | 208 | { |
209 | /* Len */ | 209 | /* Type */ |
210 | switch (x86_len) { | 210 | switch (x86_type) { |
211 | case X86_BREAKPOINT_LEN_X: | 211 | case X86_BREAKPOINT_EXECUTE: |
212 | if (x86_len != X86_BREAKPOINT_LEN_X) | ||
213 | return -EINVAL; | ||
214 | |||
215 | *gen_type = HW_BREAKPOINT_X; | ||
212 | *gen_len = sizeof(long); | 216 | *gen_len = sizeof(long); |
217 | return 0; | ||
218 | case X86_BREAKPOINT_WRITE: | ||
219 | *gen_type = HW_BREAKPOINT_W; | ||
213 | break; | 220 | break; |
221 | case X86_BREAKPOINT_RW: | ||
222 | *gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R; | ||
223 | break; | ||
224 | default: | ||
225 | return -EINVAL; | ||
226 | } | ||
227 | |||
228 | /* Len */ | ||
229 | switch (x86_len) { | ||
214 | case X86_BREAKPOINT_LEN_1: | 230 | case X86_BREAKPOINT_LEN_1: |
215 | *gen_len = HW_BREAKPOINT_LEN_1; | 231 | *gen_len = HW_BREAKPOINT_LEN_1; |
216 | break; | 232 | break; |
@@ -229,21 +245,6 @@ int arch_bp_generic_fields(int x86_len, int x86_type, | |||
229 | return -EINVAL; | 245 | return -EINVAL; |
230 | } | 246 | } |
231 | 247 | ||
232 | /* Type */ | ||
233 | switch (x86_type) { | ||
234 | case X86_BREAKPOINT_EXECUTE: | ||
235 | *gen_type = HW_BREAKPOINT_X; | ||
236 | break; | ||
237 | case X86_BREAKPOINT_WRITE: | ||
238 | *gen_type = HW_BREAKPOINT_W; | ||
239 | break; | ||
240 | case X86_BREAKPOINT_RW: | ||
241 | *gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R; | ||
242 | break; | ||
243 | default: | ||
244 | return -EINVAL; | ||
245 | } | ||
246 | |||
247 | return 0; | 248 | return 0; |
248 | } | 249 | } |
249 | 250 | ||
@@ -316,9 +317,6 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) | |||
316 | ret = -EINVAL; | 317 | ret = -EINVAL; |
317 | 318 | ||
318 | switch (info->len) { | 319 | switch (info->len) { |
319 | case X86_BREAKPOINT_LEN_X: | ||
320 | align = sizeof(long) -1; | ||
321 | break; | ||
322 | case X86_BREAKPOINT_LEN_1: | 320 | case X86_BREAKPOINT_LEN_1: |
323 | align = 0; | 321 | align = 0; |
324 | break; | 322 | break; |
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c index e0bc186d7501..1c355c550960 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c | |||
@@ -239,11 +239,10 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
239 | apply_paravirt(pseg, pseg + para->sh_size); | 239 | apply_paravirt(pseg, pseg + para->sh_size); |
240 | } | 240 | } |
241 | 241 | ||
242 | return module_bug_finalize(hdr, sechdrs, me); | 242 | return 0; |
243 | } | 243 | } |
244 | 244 | ||
245 | void module_arch_cleanup(struct module *mod) | 245 | void module_arch_cleanup(struct module *mod) |
246 | { | 246 | { |
247 | alternatives_smp_module_del(mod); | 247 | alternatives_smp_module_del(mod); |
248 | module_bug_cleanup(mod); | ||
249 | } | 248 | } |
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index 9257510b4836..9d5f55848455 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -324,9 +324,8 @@ static void lguest_load_gdt(const struct desc_ptr *desc) | |||
324 | } | 324 | } |
325 | 325 | ||
326 | /* | 326 | /* |
327 | * For a single GDT entry which changes, we do the lazy thing: alter our GDT, | 327 | * For a single GDT entry which changes, we simply change our copy and |
328 | * then tell the Host to reload the entire thing. This operation is so rare | 328 | * then tell the host about it. |
329 | * that this naive implementation is reasonable. | ||
330 | */ | 329 | */ |
331 | static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum, | 330 | static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum, |
332 | const void *desc, int type) | 331 | const void *desc, int type) |
@@ -338,9 +337,13 @@ static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum, | |||
338 | } | 337 | } |
339 | 338 | ||
340 | /* | 339 | /* |
341 | * OK, I lied. There are three "thread local storage" GDT entries which change | 340 | * There are three "thread local storage" GDT entries which change |
342 | * on every context switch (these three entries are how glibc implements | 341 | * on every context switch (these three entries are how glibc implements |
343 | * __thread variables). So we have a hypercall specifically for this case. | 342 | * __thread variables). As an optimization, we have a hypercall |
343 | * specifically for this case. | ||
344 | * | ||
345 | * Wouldn't it be nicer to have a general LOAD_GDT_ENTRIES hypercall | ||
346 | * which took a range of entries? | ||
344 | */ | 347 | */ |
345 | static void lguest_load_tls(struct thread_struct *t, unsigned int cpu) | 348 | static void lguest_load_tls(struct thread_struct *t, unsigned int cpu) |
346 | { | 349 | { |
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index cfe4faabb0f6..f1575c9a2572 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -671,7 +671,10 @@ static int __init ppro_init(char **cpu_type) | |||
671 | case 14: | 671 | case 14: |
672 | *cpu_type = "i386/core"; | 672 | *cpu_type = "i386/core"; |
673 | break; | 673 | break; |
674 | case 15: case 23: | 674 | case 0x0f: |
675 | case 0x16: | ||
676 | case 0x17: | ||
677 | case 0x1d: | ||
675 | *cpu_type = "i386/core_2"; | 678 | *cpu_type = "i386/core_2"; |
676 | break; | 679 | break; |
677 | case 0x1a: | 680 | case 0x1a: |
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 1a5353a753fc..b2bb5aa3b054 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
@@ -489,8 +489,9 @@ static void xen_hvm_setup_cpu_clockevents(void) | |||
489 | __init void xen_hvm_init_time_ops(void) | 489 | __init void xen_hvm_init_time_ops(void) |
490 | { | 490 | { |
491 | /* vector callback is needed otherwise we cannot receive interrupts | 491 | /* vector callback is needed otherwise we cannot receive interrupts |
492 | * on cpu > 0 */ | 492 | * on cpu > 0 and at this point we don't know how many cpus are |
493 | if (!xen_have_vector_callback && num_present_cpus() > 1) | 493 | * available */ |
494 | if (!xen_have_vector_callback) | ||
494 | return; | 495 | return; |
495 | if (!xen_feature(XENFEAT_hvm_safe_pvclock)) { | 496 | if (!xen_feature(XENFEAT_hvm_safe_pvclock)) { |
496 | printk(KERN_INFO "Xen doesn't support pvclock on HVM," | 497 | printk(KERN_INFO "Xen doesn't support pvclock on HVM," |