diff options
Diffstat (limited to 'arch')
525 files changed, 14884 insertions, 9483 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index f238370c907d..8d0097f10208 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -93,8 +93,8 @@ common_shutdown_1(void *generic_ptr) | |||
93 | if (cpuid != boot_cpuid) { | 93 | if (cpuid != boot_cpuid) { |
94 | flags |= 0x00040000UL; /* "remain halted" */ | 94 | flags |= 0x00040000UL; /* "remain halted" */ |
95 | *pflags = flags; | 95 | *pflags = flags; |
96 | cpu_clear(cpuid, cpu_present_map); | 96 | set_cpu_present(cpuid, false); |
97 | cpu_clear(cpuid, cpu_possible_map); | 97 | set_cpu_possible(cpuid, false); |
98 | halt(); | 98 | halt(); |
99 | } | 99 | } |
100 | #endif | 100 | #endif |
@@ -120,8 +120,8 @@ common_shutdown_1(void *generic_ptr) | |||
120 | 120 | ||
121 | #ifdef CONFIG_SMP | 121 | #ifdef CONFIG_SMP |
122 | /* Wait for the secondaries to halt. */ | 122 | /* Wait for the secondaries to halt. */ |
123 | cpu_clear(boot_cpuid, cpu_present_map); | 123 | set_cpu_present(boot_cpuid, false); |
124 | cpu_clear(boot_cpuid, cpu_possible_map); | 124 | set_cpu_possible(boot_cpuid, false); |
125 | while (cpus_weight(cpu_present_map)) | 125 | while (cpus_weight(cpu_present_map)) |
126 | barrier(); | 126 | barrier(); |
127 | #endif | 127 | #endif |
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 00f1dc3dfd5f..b1fe5674c3a1 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c | |||
@@ -120,12 +120,12 @@ void __cpuinit | |||
120 | smp_callin(void) | 120 | smp_callin(void) |
121 | { | 121 | { |
122 | int cpuid = hard_smp_processor_id(); | 122 | int cpuid = hard_smp_processor_id(); |
123 | cpumask_t mask = cpu_online_map; | ||
124 | 123 | ||
125 | if (cpu_test_and_set(cpuid, mask)) { | 124 | if (cpu_online(cpuid)) { |
126 | printk("??, cpu 0x%x already present??\n", cpuid); | 125 | printk("??, cpu 0x%x already present??\n", cpuid); |
127 | BUG(); | 126 | BUG(); |
128 | } | 127 | } |
128 | set_cpu_online(cpuid, true); | ||
129 | 129 | ||
130 | /* Turn on machine checks. */ | 130 | /* Turn on machine checks. */ |
131 | wrmces(7); | 131 | wrmces(7); |
@@ -436,8 +436,8 @@ setup_smp(void) | |||
436 | ((char *)cpubase + i*hwrpb->processor_size); | 436 | ((char *)cpubase + i*hwrpb->processor_size); |
437 | if ((cpu->flags & 0x1cc) == 0x1cc) { | 437 | if ((cpu->flags & 0x1cc) == 0x1cc) { |
438 | smp_num_probed++; | 438 | smp_num_probed++; |
439 | cpu_set(i, cpu_possible_map); | 439 | set_cpu_possible(i, true); |
440 | cpu_set(i, cpu_present_map); | 440 | set_cpu_present(i, true); |
441 | cpu->pal_revision = boot_cpu_palrev; | 441 | cpu->pal_revision = boot_cpu_palrev; |
442 | } | 442 | } |
443 | 443 | ||
@@ -470,8 +470,8 @@ smp_prepare_cpus(unsigned int max_cpus) | |||
470 | 470 | ||
471 | /* Nothing to do on a UP box, or when told not to. */ | 471 | /* Nothing to do on a UP box, or when told not to. */ |
472 | if (smp_num_probed == 1 || max_cpus == 0) { | 472 | if (smp_num_probed == 1 || max_cpus == 0) { |
473 | cpu_possible_map = cpumask_of_cpu(boot_cpuid); | 473 | init_cpu_possible(cpumask_of(boot_cpuid)); |
474 | cpu_present_map = cpumask_of_cpu(boot_cpuid); | 474 | init_cpu_present(cpumask_of(boot_cpuid)); |
475 | printk(KERN_INFO "SMP mode deactivated.\n"); | 475 | printk(KERN_INFO "SMP mode deactivated.\n"); |
476 | return; | 476 | return; |
477 | } | 477 | } |
diff --git a/arch/arm/configs/at91sam9260ek_defconfig b/arch/arm/configs/at91sam9260ek_defconfig index e0ee7060f9aa..98e2f3de4bc5 100644 --- a/arch/arm/configs/at91sam9260ek_defconfig +++ b/arch/arm/configs/at91sam9260ek_defconfig | |||
@@ -608,7 +608,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y | |||
608 | # Watchdog Device Drivers | 608 | # Watchdog Device Drivers |
609 | # | 609 | # |
610 | # CONFIG_SOFT_WATCHDOG is not set | 610 | # CONFIG_SOFT_WATCHDOG is not set |
611 | CONFIG_AT91SAM9_WATCHDOG=y | 611 | CONFIG_AT91SAM9X_WATCHDOG=y |
612 | 612 | ||
613 | # | 613 | # |
614 | # USB-based Watchdog Cards | 614 | # USB-based Watchdog Cards |
diff --git a/arch/arm/configs/at91sam9261ek_defconfig b/arch/arm/configs/at91sam9261ek_defconfig index 01d1ef97d8be..149456142392 100644 --- a/arch/arm/configs/at91sam9261ek_defconfig +++ b/arch/arm/configs/at91sam9261ek_defconfig | |||
@@ -700,7 +700,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y | |||
700 | # Watchdog Device Drivers | 700 | # Watchdog Device Drivers |
701 | # | 701 | # |
702 | # CONFIG_SOFT_WATCHDOG is not set | 702 | # CONFIG_SOFT_WATCHDOG is not set |
703 | CONFIG_AT91SAM9_WATCHDOG=y | 703 | CONFIG_AT91SAM9X_WATCHDOG=y |
704 | 704 | ||
705 | # | 705 | # |
706 | # USB-based Watchdog Cards | 706 | # USB-based Watchdog Cards |
diff --git a/arch/arm/configs/at91sam9263ek_defconfig b/arch/arm/configs/at91sam9263ek_defconfig index 036a126725c1..21599f3c6275 100644 --- a/arch/arm/configs/at91sam9263ek_defconfig +++ b/arch/arm/configs/at91sam9263ek_defconfig | |||
@@ -710,7 +710,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y | |||
710 | # Watchdog Device Drivers | 710 | # Watchdog Device Drivers |
711 | # | 711 | # |
712 | # CONFIG_SOFT_WATCHDOG is not set | 712 | # CONFIG_SOFT_WATCHDOG is not set |
713 | CONFIG_AT91SAM9_WATCHDOG=y | 713 | CONFIG_AT91SAM9X_WATCHDOG=y |
714 | 714 | ||
715 | # | 715 | # |
716 | # USB-based Watchdog Cards | 716 | # USB-based Watchdog Cards |
diff --git a/arch/arm/configs/at91sam9rlek_defconfig b/arch/arm/configs/at91sam9rlek_defconfig index 237a2a6a8517..e2df81a3e804 100644 --- a/arch/arm/configs/at91sam9rlek_defconfig +++ b/arch/arm/configs/at91sam9rlek_defconfig | |||
@@ -606,7 +606,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y | |||
606 | # Watchdog Device Drivers | 606 | # Watchdog Device Drivers |
607 | # | 607 | # |
608 | # CONFIG_SOFT_WATCHDOG is not set | 608 | # CONFIG_SOFT_WATCHDOG is not set |
609 | CONFIG_AT91SAM9_WATCHDOG=y | 609 | CONFIG_AT91SAM9X_WATCHDOG=y |
610 | 610 | ||
611 | # | 611 | # |
612 | # Sonics Silicon Backplane | 612 | # Sonics Silicon Backplane |
diff --git a/arch/arm/configs/h3600_defconfig b/arch/arm/configs/h3600_defconfig index f2e16fd0a6bb..1502957db2c3 100644 --- a/arch/arm/configs/h3600_defconfig +++ b/arch/arm/configs/h3600_defconfig | |||
@@ -99,7 +99,6 @@ CONFIG_SA1100_H3XXX=y | |||
99 | # CONFIG_SA1100_SHANNON is not set | 99 | # CONFIG_SA1100_SHANNON is not set |
100 | # CONFIG_SA1100_SIMPAD is not set | 100 | # CONFIG_SA1100_SIMPAD is not set |
101 | # CONFIG_SA1100_SSP is not set | 101 | # CONFIG_SA1100_SSP is not set |
102 | # CONFIG_H3600_SLEEVE is not set | ||
103 | 102 | ||
104 | # | 103 | # |
105 | # Processor Type | 104 | # Processor Type |
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig index 4bc38078d580..9ed4e1b86674 100644 --- a/arch/arm/configs/kirkwood_defconfig +++ b/arch/arm/configs/kirkwood_defconfig | |||
@@ -1,11 +1,11 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.28-rc7 | 3 | # Linux kernel version: 2.6.29-rc5 |
4 | # Thu Dec 4 15:27:39 2008 | 4 | # Tue Mar 3 21:45:57 2009 |
5 | # | 5 | # |
6 | CONFIG_ARM=y | 6 | CONFIG_ARM=y |
7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | 7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y |
8 | # CONFIG_GENERIC_GPIO is not set | 8 | CONFIG_GENERIC_GPIO=y |
9 | CONFIG_GENERIC_TIME=y | 9 | CONFIG_GENERIC_TIME=y |
10 | CONFIG_GENERIC_CLOCKEVENTS=y | 10 | CONFIG_GENERIC_CLOCKEVENTS=y |
11 | CONFIG_MMU=y | 11 | CONFIG_MMU=y |
@@ -42,10 +42,19 @@ CONFIG_SYSVIPC_SYSCTL=y | |||
42 | # CONFIG_BSD_PROCESS_ACCT is not set | 42 | # CONFIG_BSD_PROCESS_ACCT is not set |
43 | # CONFIG_TASKSTATS is not set | 43 | # CONFIG_TASKSTATS is not set |
44 | # CONFIG_AUDIT is not set | 44 | # CONFIG_AUDIT is not set |
45 | |||
46 | # | ||
47 | # RCU Subsystem | ||
48 | # | ||
49 | CONFIG_CLASSIC_RCU=y | ||
50 | # CONFIG_TREE_RCU is not set | ||
51 | # CONFIG_PREEMPT_RCU is not set | ||
52 | # CONFIG_TREE_RCU_TRACE is not set | ||
53 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
45 | # CONFIG_IKCONFIG is not set | 54 | # CONFIG_IKCONFIG is not set |
46 | CONFIG_LOG_BUF_SHIFT=14 | 55 | CONFIG_LOG_BUF_SHIFT=19 |
47 | # CONFIG_CGROUPS is not set | ||
48 | # CONFIG_GROUP_SCHED is not set | 56 | # CONFIG_GROUP_SCHED is not set |
57 | # CONFIG_CGROUPS is not set | ||
49 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | 58 | # CONFIG_SYSFS_DEPRECATED_V2 is not set |
50 | # CONFIG_RELAY is not set | 59 | # CONFIG_RELAY is not set |
51 | CONFIG_NAMESPACES=y | 60 | CONFIG_NAMESPACES=y |
@@ -53,6 +62,7 @@ CONFIG_NAMESPACES=y | |||
53 | # CONFIG_IPC_NS is not set | 62 | # CONFIG_IPC_NS is not set |
54 | # CONFIG_USER_NS is not set | 63 | # CONFIG_USER_NS is not set |
55 | # CONFIG_PID_NS is not set | 64 | # CONFIG_PID_NS is not set |
65 | # CONFIG_NET_NS is not set | ||
56 | # CONFIG_BLK_DEV_INITRD is not set | 66 | # CONFIG_BLK_DEV_INITRD is not set |
57 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | 67 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y |
58 | CONFIG_SYSCTL=y | 68 | CONFIG_SYSCTL=y |
@@ -83,6 +93,7 @@ CONFIG_SLUB_DEBUG=y | |||
83 | CONFIG_SLUB=y | 93 | CONFIG_SLUB=y |
84 | # CONFIG_SLOB is not set | 94 | # CONFIG_SLOB is not set |
85 | CONFIG_PROFILING=y | 95 | CONFIG_PROFILING=y |
96 | CONFIG_TRACEPOINTS=y | ||
86 | # CONFIG_MARKERS is not set | 97 | # CONFIG_MARKERS is not set |
87 | CONFIG_OPROFILE=y | 98 | CONFIG_OPROFILE=y |
88 | CONFIG_HAVE_OPROFILE=y | 99 | CONFIG_HAVE_OPROFILE=y |
@@ -93,7 +104,6 @@ CONFIG_HAVE_KRETPROBES=y | |||
93 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | 104 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y |
94 | CONFIG_SLABINFO=y | 105 | CONFIG_SLABINFO=y |
95 | CONFIG_RT_MUTEXES=y | 106 | CONFIG_RT_MUTEXES=y |
96 | # CONFIG_TINY_SHMEM is not set | ||
97 | CONFIG_BASE_SMALL=0 | 107 | CONFIG_BASE_SMALL=0 |
98 | CONFIG_MODULES=y | 108 | CONFIG_MODULES=y |
99 | # CONFIG_MODULE_FORCE_LOAD is not set | 109 | # CONFIG_MODULE_FORCE_LOAD is not set |
@@ -101,11 +111,9 @@ CONFIG_MODULE_UNLOAD=y | |||
101 | # CONFIG_MODULE_FORCE_UNLOAD is not set | 111 | # CONFIG_MODULE_FORCE_UNLOAD is not set |
102 | # CONFIG_MODVERSIONS is not set | 112 | # CONFIG_MODVERSIONS is not set |
103 | # CONFIG_MODULE_SRCVERSION_ALL is not set | 113 | # CONFIG_MODULE_SRCVERSION_ALL is not set |
104 | CONFIG_KMOD=y | ||
105 | CONFIG_BLOCK=y | 114 | CONFIG_BLOCK=y |
106 | # CONFIG_LBD is not set | 115 | # CONFIG_LBD is not set |
107 | # CONFIG_BLK_DEV_IO_TRACE is not set | 116 | # CONFIG_BLK_DEV_IO_TRACE is not set |
108 | # CONFIG_LSF is not set | ||
109 | # CONFIG_BLK_DEV_BSG is not set | 117 | # CONFIG_BLK_DEV_BSG is not set |
110 | # CONFIG_BLK_DEV_INTEGRITY is not set | 118 | # CONFIG_BLK_DEV_INTEGRITY is not set |
111 | 119 | ||
@@ -121,7 +129,6 @@ CONFIG_IOSCHED_CFQ=y | |||
121 | CONFIG_DEFAULT_CFQ=y | 129 | CONFIG_DEFAULT_CFQ=y |
122 | # CONFIG_DEFAULT_NOOP is not set | 130 | # CONFIG_DEFAULT_NOOP is not set |
123 | CONFIG_DEFAULT_IOSCHED="cfq" | 131 | CONFIG_DEFAULT_IOSCHED="cfq" |
124 | CONFIG_CLASSIC_RCU=y | ||
125 | # CONFIG_FREEZER is not set | 132 | # CONFIG_FREEZER is not set |
126 | 133 | ||
127 | # | 134 | # |
@@ -132,7 +139,6 @@ CONFIG_CLASSIC_RCU=y | |||
132 | # CONFIG_ARCH_REALVIEW is not set | 139 | # CONFIG_ARCH_REALVIEW is not set |
133 | # CONFIG_ARCH_VERSATILE is not set | 140 | # CONFIG_ARCH_VERSATILE is not set |
134 | # CONFIG_ARCH_AT91 is not set | 141 | # CONFIG_ARCH_AT91 is not set |
135 | # CONFIG_ARCH_CLPS7500 is not set | ||
136 | # CONFIG_ARCH_CLPS711X is not set | 142 | # CONFIG_ARCH_CLPS711X is not set |
137 | # CONFIG_ARCH_EBSA110 is not set | 143 | # CONFIG_ARCH_EBSA110 is not set |
138 | # CONFIG_ARCH_EP93XX is not set | 144 | # CONFIG_ARCH_EP93XX is not set |
@@ -159,11 +165,13 @@ CONFIG_ARCH_KIRKWOOD=y | |||
159 | # CONFIG_ARCH_RPC is not set | 165 | # CONFIG_ARCH_RPC is not set |
160 | # CONFIG_ARCH_SA1100 is not set | 166 | # CONFIG_ARCH_SA1100 is not set |
161 | # CONFIG_ARCH_S3C2410 is not set | 167 | # CONFIG_ARCH_S3C2410 is not set |
168 | # CONFIG_ARCH_S3C64XX is not set | ||
162 | # CONFIG_ARCH_SHARK is not set | 169 | # CONFIG_ARCH_SHARK is not set |
163 | # CONFIG_ARCH_LH7A40X is not set | 170 | # CONFIG_ARCH_LH7A40X is not set |
164 | # CONFIG_ARCH_DAVINCI is not set | 171 | # CONFIG_ARCH_DAVINCI is not set |
165 | # CONFIG_ARCH_OMAP is not set | 172 | # CONFIG_ARCH_OMAP is not set |
166 | # CONFIG_ARCH_MSM is not set | 173 | # CONFIG_ARCH_MSM is not set |
174 | # CONFIG_ARCH_W90X900 is not set | ||
167 | 175 | ||
168 | # | 176 | # |
169 | # Marvell Kirkwood Implementations | 177 | # Marvell Kirkwood Implementations |
@@ -171,14 +179,7 @@ CONFIG_ARCH_KIRKWOOD=y | |||
171 | CONFIG_MACH_DB88F6281_BP=y | 179 | CONFIG_MACH_DB88F6281_BP=y |
172 | CONFIG_MACH_RD88F6192_NAS=y | 180 | CONFIG_MACH_RD88F6192_NAS=y |
173 | CONFIG_MACH_RD88F6281=y | 181 | CONFIG_MACH_RD88F6281=y |
174 | 182 | CONFIG_MACH_SHEEVAPLUG=y | |
175 | # | ||
176 | # Boot options | ||
177 | # | ||
178 | |||
179 | # | ||
180 | # Power management | ||
181 | # | ||
182 | CONFIG_PLAT_ORION=y | 183 | CONFIG_PLAT_ORION=y |
183 | 184 | ||
184 | # | 185 | # |
@@ -214,6 +215,7 @@ CONFIG_PCI_SYSCALL=y | |||
214 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 215 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
215 | CONFIG_PCI_LEGACY=y | 216 | CONFIG_PCI_LEGACY=y |
216 | # CONFIG_PCI_DEBUG is not set | 217 | # CONFIG_PCI_DEBUG is not set |
218 | # CONFIG_PCI_STUB is not set | ||
217 | # CONFIG_PCCARD is not set | 219 | # CONFIG_PCCARD is not set |
218 | 220 | ||
219 | # | 221 | # |
@@ -242,7 +244,6 @@ CONFIG_FLATMEM=y | |||
242 | CONFIG_FLAT_NODE_MEM_MAP=y | 244 | CONFIG_FLAT_NODE_MEM_MAP=y |
243 | CONFIG_PAGEFLAGS_EXTENDED=y | 245 | CONFIG_PAGEFLAGS_EXTENDED=y |
244 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | 246 | CONFIG_SPLIT_PTLOCK_CPUS=4096 |
245 | # CONFIG_RESOURCES_64BIT is not set | ||
246 | # CONFIG_PHYS_ADDR_T_64BIT is not set | 247 | # CONFIG_PHYS_ADDR_T_64BIT is not set |
247 | CONFIG_ZONE_DMA_FLAG=0 | 248 | CONFIG_ZONE_DMA_FLAG=0 |
248 | CONFIG_VIRT_TO_BUS=y | 249 | CONFIG_VIRT_TO_BUS=y |
@@ -291,6 +292,7 @@ CONFIG_NET=y | |||
291 | # | 292 | # |
292 | # Networking options | 293 | # Networking options |
293 | # | 294 | # |
295 | CONFIG_COMPAT_NET_DEV_OPS=y | ||
294 | CONFIG_PACKET=y | 296 | CONFIG_PACKET=y |
295 | CONFIG_PACKET_MMAP=y | 297 | CONFIG_PACKET_MMAP=y |
296 | CONFIG_UNIX=y | 298 | CONFIG_UNIX=y |
@@ -355,6 +357,7 @@ CONFIG_NET_DSA_MV88E6123_61_65=y | |||
355 | # CONFIG_ECONET is not set | 357 | # CONFIG_ECONET is not set |
356 | # CONFIG_WAN_ROUTER is not set | 358 | # CONFIG_WAN_ROUTER is not set |
357 | # CONFIG_NET_SCHED is not set | 359 | # CONFIG_NET_SCHED is not set |
360 | # CONFIG_DCB is not set | ||
358 | 361 | ||
359 | # | 362 | # |
360 | # Network testing | 363 | # Network testing |
@@ -368,12 +371,27 @@ CONFIG_NET_PKTGEN=m | |||
368 | # CONFIG_AF_RXRPC is not set | 371 | # CONFIG_AF_RXRPC is not set |
369 | # CONFIG_PHONET is not set | 372 | # CONFIG_PHONET is not set |
370 | CONFIG_WIRELESS=y | 373 | CONFIG_WIRELESS=y |
371 | # CONFIG_CFG80211 is not set | 374 | CONFIG_CFG80211=y |
375 | # CONFIG_CFG80211_REG_DEBUG is not set | ||
376 | # CONFIG_NL80211 is not set | ||
372 | CONFIG_WIRELESS_OLD_REGULATORY=y | 377 | CONFIG_WIRELESS_OLD_REGULATORY=y |
373 | CONFIG_WIRELESS_EXT=y | 378 | CONFIG_WIRELESS_EXT=y |
374 | CONFIG_WIRELESS_EXT_SYSFS=y | 379 | CONFIG_WIRELESS_EXT_SYSFS=y |
375 | # CONFIG_MAC80211 is not set | 380 | CONFIG_LIB80211=y |
376 | # CONFIG_IEEE80211 is not set | 381 | CONFIG_MAC80211=y |
382 | |||
383 | # | ||
384 | # Rate control algorithm selection | ||
385 | # | ||
386 | CONFIG_MAC80211_RC_MINSTREL=y | ||
387 | # CONFIG_MAC80211_RC_DEFAULT_PID is not set | ||
388 | CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y | ||
389 | CONFIG_MAC80211_RC_DEFAULT="minstrel" | ||
390 | # CONFIG_MAC80211_MESH is not set | ||
391 | # CONFIG_MAC80211_LEDS is not set | ||
392 | # CONFIG_MAC80211_DEBUGFS is not set | ||
393 | # CONFIG_MAC80211_DEBUG_MENU is not set | ||
394 | # CONFIG_WIMAX is not set | ||
377 | # CONFIG_RFKILL is not set | 395 | # CONFIG_RFKILL is not set |
378 | # CONFIG_NET_9P is not set | 396 | # CONFIG_NET_9P is not set |
379 | 397 | ||
@@ -398,6 +416,7 @@ CONFIG_MTD=y | |||
398 | # CONFIG_MTD_DEBUG is not set | 416 | # CONFIG_MTD_DEBUG is not set |
399 | # CONFIG_MTD_CONCAT is not set | 417 | # CONFIG_MTD_CONCAT is not set |
400 | CONFIG_MTD_PARTITIONS=y | 418 | CONFIG_MTD_PARTITIONS=y |
419 | # CONFIG_MTD_TESTS is not set | ||
401 | # CONFIG_MTD_REDBOOT_PARTS is not set | 420 | # CONFIG_MTD_REDBOOT_PARTS is not set |
402 | CONFIG_MTD_CMDLINE_PARTS=y | 421 | CONFIG_MTD_CMDLINE_PARTS=y |
403 | # CONFIG_MTD_AFS_PARTS is not set | 422 | # CONFIG_MTD_AFS_PARTS is not set |
@@ -451,9 +470,7 @@ CONFIG_MTD_CFI_UTIL=y | |||
451 | # | 470 | # |
452 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | 471 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set |
453 | CONFIG_MTD_PHYSMAP=y | 472 | CONFIG_MTD_PHYSMAP=y |
454 | CONFIG_MTD_PHYSMAP_START=0x0 | 473 | # CONFIG_MTD_PHYSMAP_COMPAT is not set |
455 | CONFIG_MTD_PHYSMAP_LEN=0x0 | ||
456 | CONFIG_MTD_PHYSMAP_BANKWIDTH=0 | ||
457 | # CONFIG_MTD_ARM_INTEGRATOR is not set | 474 | # CONFIG_MTD_ARM_INTEGRATOR is not set |
458 | # CONFIG_MTD_IMPA7 is not set | 475 | # CONFIG_MTD_IMPA7 is not set |
459 | # CONFIG_MTD_INTEL_VR_NOR is not set | 476 | # CONFIG_MTD_INTEL_VR_NOR is not set |
@@ -481,6 +498,7 @@ CONFIG_MTD_NAND=y | |||
481 | # CONFIG_MTD_NAND_VERIFY_WRITE is not set | 498 | # CONFIG_MTD_NAND_VERIFY_WRITE is not set |
482 | # CONFIG_MTD_NAND_ECC_SMC is not set | 499 | # CONFIG_MTD_NAND_ECC_SMC is not set |
483 | # CONFIG_MTD_NAND_MUSEUM_IDS is not set | 500 | # CONFIG_MTD_NAND_MUSEUM_IDS is not set |
501 | # CONFIG_MTD_NAND_GPIO is not set | ||
484 | CONFIG_MTD_NAND_IDS=y | 502 | CONFIG_MTD_NAND_IDS=y |
485 | # CONFIG_MTD_NAND_DISKONCHIP is not set | 503 | # CONFIG_MTD_NAND_DISKONCHIP is not set |
486 | # CONFIG_MTD_NAND_CAFE is not set | 504 | # CONFIG_MTD_NAND_CAFE is not set |
@@ -491,6 +509,12 @@ CONFIG_MTD_NAND_ORION=y | |||
491 | # CONFIG_MTD_ONENAND is not set | 509 | # CONFIG_MTD_ONENAND is not set |
492 | 510 | ||
493 | # | 511 | # |
512 | # LPDDR flash memory drivers | ||
513 | # | ||
514 | # CONFIG_MTD_LPDDR is not set | ||
515 | # CONFIG_MTD_QINFO_PROBE is not set | ||
516 | |||
517 | # | ||
494 | # UBI - Unsorted block images | 518 | # UBI - Unsorted block images |
495 | # | 519 | # |
496 | # CONFIG_MTD_UBI is not set | 520 | # CONFIG_MTD_UBI is not set |
@@ -568,6 +592,8 @@ CONFIG_SCSI_LOWLEVEL=y | |||
568 | # CONFIG_MEGARAID_LEGACY is not set | 592 | # CONFIG_MEGARAID_LEGACY is not set |
569 | # CONFIG_MEGARAID_SAS is not set | 593 | # CONFIG_MEGARAID_SAS is not set |
570 | # CONFIG_SCSI_HPTIOP is not set | 594 | # CONFIG_SCSI_HPTIOP is not set |
595 | # CONFIG_LIBFC is not set | ||
596 | # CONFIG_FCOE is not set | ||
571 | # CONFIG_SCSI_DMX3191D is not set | 597 | # CONFIG_SCSI_DMX3191D is not set |
572 | # CONFIG_SCSI_FUTURE_DOMAIN is not set | 598 | # CONFIG_SCSI_FUTURE_DOMAIN is not set |
573 | # CONFIG_SCSI_IPS is not set | 599 | # CONFIG_SCSI_IPS is not set |
@@ -682,6 +708,9 @@ CONFIG_MARVELL_PHY=y | |||
682 | # CONFIG_BROADCOM_PHY is not set | 708 | # CONFIG_BROADCOM_PHY is not set |
683 | # CONFIG_ICPLUS_PHY is not set | 709 | # CONFIG_ICPLUS_PHY is not set |
684 | # CONFIG_REALTEK_PHY is not set | 710 | # CONFIG_REALTEK_PHY is not set |
711 | # CONFIG_NATIONAL_PHY is not set | ||
712 | # CONFIG_STE10XP is not set | ||
713 | # CONFIG_LSI_ET1011C_PHY is not set | ||
685 | # CONFIG_FIXED_PHY is not set | 714 | # CONFIG_FIXED_PHY is not set |
686 | # CONFIG_MDIO_BITBANG is not set | 715 | # CONFIG_MDIO_BITBANG is not set |
687 | CONFIG_NET_ETHERNET=y | 716 | CONFIG_NET_ETHERNET=y |
@@ -695,6 +724,7 @@ CONFIG_MII=y | |||
695 | # CONFIG_DM9000 is not set | 724 | # CONFIG_DM9000 is not set |
696 | # CONFIG_ENC28J60 is not set | 725 | # CONFIG_ENC28J60 is not set |
697 | # CONFIG_SMC911X is not set | 726 | # CONFIG_SMC911X is not set |
727 | # CONFIG_SMSC911X is not set | ||
698 | # CONFIG_NET_TULIP is not set | 728 | # CONFIG_NET_TULIP is not set |
699 | # CONFIG_HP100 is not set | 729 | # CONFIG_HP100 is not set |
700 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | 730 | # CONFIG_IBM_NEW_EMAC_ZMII is not set |
@@ -710,7 +740,6 @@ CONFIG_NET_PCI=y | |||
710 | # CONFIG_ADAPTEC_STARFIRE is not set | 740 | # CONFIG_ADAPTEC_STARFIRE is not set |
711 | # CONFIG_B44 is not set | 741 | # CONFIG_B44 is not set |
712 | # CONFIG_FORCEDETH is not set | 742 | # CONFIG_FORCEDETH is not set |
713 | # CONFIG_EEPRO100 is not set | ||
714 | # CONFIG_E100 is not set | 743 | # CONFIG_E100 is not set |
715 | # CONFIG_FEALNX is not set | 744 | # CONFIG_FEALNX is not set |
716 | # CONFIG_NATSEMI is not set | 745 | # CONFIG_NATSEMI is not set |
@@ -720,6 +749,7 @@ CONFIG_NET_PCI=y | |||
720 | # CONFIG_R6040 is not set | 749 | # CONFIG_R6040 is not set |
721 | # CONFIG_SIS900 is not set | 750 | # CONFIG_SIS900 is not set |
722 | # CONFIG_EPIC100 is not set | 751 | # CONFIG_EPIC100 is not set |
752 | # CONFIG_SMSC9420 is not set | ||
723 | # CONFIG_SUNDANCE is not set | 753 | # CONFIG_SUNDANCE is not set |
724 | # CONFIG_TLAN is not set | 754 | # CONFIG_TLAN is not set |
725 | # CONFIG_VIA_RHINE is not set | 755 | # CONFIG_VIA_RHINE is not set |
@@ -754,8 +784,39 @@ CONFIG_MV643XX_ETH=y | |||
754 | # Wireless LAN | 784 | # Wireless LAN |
755 | # | 785 | # |
756 | # CONFIG_WLAN_PRE80211 is not set | 786 | # CONFIG_WLAN_PRE80211 is not set |
757 | # CONFIG_WLAN_80211 is not set | 787 | CONFIG_WLAN_80211=y |
788 | CONFIG_LIBERTAS=y | ||
789 | # CONFIG_LIBERTAS_USB is not set | ||
790 | CONFIG_LIBERTAS_SDIO=y | ||
791 | # CONFIG_LIBERTAS_DEBUG is not set | ||
792 | # CONFIG_LIBERTAS_THINFIRM is not set | ||
793 | # CONFIG_HERMES is not set | ||
794 | # CONFIG_ATMEL is not set | ||
795 | # CONFIG_PRISM54 is not set | ||
796 | # CONFIG_USB_ZD1201 is not set | ||
797 | # CONFIG_USB_NET_RNDIS_WLAN is not set | ||
798 | # CONFIG_RTL8180 is not set | ||
799 | # CONFIG_RTL8187 is not set | ||
800 | # CONFIG_ADM8211 is not set | ||
801 | # CONFIG_MAC80211_HWSIM is not set | ||
802 | # CONFIG_P54_COMMON is not set | ||
803 | # CONFIG_ATH5K is not set | ||
804 | # CONFIG_ATH9K is not set | ||
805 | # CONFIG_IPW2100 is not set | ||
806 | # CONFIG_IPW2200 is not set | ||
807 | # CONFIG_IWLCORE is not set | ||
758 | # CONFIG_IWLWIFI_LEDS is not set | 808 | # CONFIG_IWLWIFI_LEDS is not set |
809 | # CONFIG_IWLAGN is not set | ||
810 | # CONFIG_IWL3945 is not set | ||
811 | # CONFIG_HOSTAP is not set | ||
812 | # CONFIG_B43 is not set | ||
813 | # CONFIG_B43LEGACY is not set | ||
814 | # CONFIG_ZD1211RW is not set | ||
815 | # CONFIG_RT2X00 is not set | ||
816 | |||
817 | # | ||
818 | # Enable WiMAX (Networking options) to see the WiMAX drivers | ||
819 | # | ||
759 | 820 | ||
760 | # | 821 | # |
761 | # USB Network Adapters | 822 | # USB Network Adapters |
@@ -839,11 +900,11 @@ CONFIG_SERIAL_CORE=y | |||
839 | CONFIG_SERIAL_CORE_CONSOLE=y | 900 | CONFIG_SERIAL_CORE_CONSOLE=y |
840 | # CONFIG_SERIAL_JSM is not set | 901 | # CONFIG_SERIAL_JSM is not set |
841 | CONFIG_UNIX98_PTYS=y | 902 | CONFIG_UNIX98_PTYS=y |
903 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
842 | CONFIG_LEGACY_PTYS=y | 904 | CONFIG_LEGACY_PTYS=y |
843 | CONFIG_LEGACY_PTY_COUNT=16 | 905 | CONFIG_LEGACY_PTY_COUNT=16 |
844 | # CONFIG_IPMI_HANDLER is not set | 906 | # CONFIG_IPMI_HANDLER is not set |
845 | # CONFIG_HW_RANDOM is not set | 907 | # CONFIG_HW_RANDOM is not set |
846 | # CONFIG_NVRAM is not set | ||
847 | # CONFIG_R3964 is not set | 908 | # CONFIG_R3964 is not set |
848 | # CONFIG_APPLICOM is not set | 909 | # CONFIG_APPLICOM is not set |
849 | # CONFIG_RAW_DRIVER is not set | 910 | # CONFIG_RAW_DRIVER is not set |
@@ -879,6 +940,7 @@ CONFIG_I2C_HELPER_AUTO=y | |||
879 | # | 940 | # |
880 | # I2C system bus drivers (mostly embedded / system-on-chip) | 941 | # I2C system bus drivers (mostly embedded / system-on-chip) |
881 | # | 942 | # |
943 | # CONFIG_I2C_GPIO is not set | ||
882 | CONFIG_I2C_MV64XXX=y | 944 | CONFIG_I2C_MV64XXX=y |
883 | # CONFIG_I2C_OCORES is not set | 945 | # CONFIG_I2C_OCORES is not set |
884 | # CONFIG_I2C_SIMTEC is not set | 946 | # CONFIG_I2C_SIMTEC is not set |
@@ -905,8 +967,6 @@ CONFIG_I2C_MV64XXX=y | |||
905 | # Miscellaneous I2C Chip support | 967 | # Miscellaneous I2C Chip support |
906 | # | 968 | # |
907 | # CONFIG_DS1682 is not set | 969 | # CONFIG_DS1682 is not set |
908 | # CONFIG_EEPROM_AT24 is not set | ||
909 | # CONFIG_EEPROM_LEGACY is not set | ||
910 | # CONFIG_SENSORS_PCF8574 is not set | 970 | # CONFIG_SENSORS_PCF8574 is not set |
911 | # CONFIG_PCF8575 is not set | 971 | # CONFIG_PCF8575 is not set |
912 | # CONFIG_SENSORS_PCA9539 is not set | 972 | # CONFIG_SENSORS_PCA9539 is not set |
@@ -925,12 +985,12 @@ CONFIG_SPI_MASTER=y | |||
925 | # SPI Master Controller Drivers | 985 | # SPI Master Controller Drivers |
926 | # | 986 | # |
927 | # CONFIG_SPI_BITBANG is not set | 987 | # CONFIG_SPI_BITBANG is not set |
988 | # CONFIG_SPI_GPIO is not set | ||
928 | CONFIG_SPI_ORION=y | 989 | CONFIG_SPI_ORION=y |
929 | 990 | ||
930 | # | 991 | # |
931 | # SPI Protocol Masters | 992 | # SPI Protocol Masters |
932 | # | 993 | # |
933 | # CONFIG_EEPROM_AT25 is not set | ||
934 | # CONFIG_SPI_SPIDEV is not set | 994 | # CONFIG_SPI_SPIDEV is not set |
935 | # CONFIG_SPI_TLE62X0 is not set | 995 | # CONFIG_SPI_TLE62X0 is not set |
936 | # CONFIG_W1 is not set | 996 | # CONFIG_W1 is not set |
@@ -952,10 +1012,12 @@ CONFIG_SSB_POSSIBLE=y | |||
952 | # CONFIG_MFD_CORE is not set | 1012 | # CONFIG_MFD_CORE is not set |
953 | # CONFIG_MFD_SM501 is not set | 1013 | # CONFIG_MFD_SM501 is not set |
954 | # CONFIG_HTC_PASIC3 is not set | 1014 | # CONFIG_HTC_PASIC3 is not set |
1015 | # CONFIG_TWL4030_CORE is not set | ||
955 | # CONFIG_MFD_TMIO is not set | 1016 | # CONFIG_MFD_TMIO is not set |
956 | # CONFIG_PMIC_DA903X is not set | 1017 | # CONFIG_PMIC_DA903X is not set |
957 | # CONFIG_MFD_WM8400 is not set | 1018 | # CONFIG_MFD_WM8400 is not set |
958 | # CONFIG_MFD_WM8350_I2C is not set | 1019 | # CONFIG_MFD_WM8350_I2C is not set |
1020 | # CONFIG_MFD_PCF50633 is not set | ||
959 | 1021 | ||
960 | # | 1022 | # |
961 | # Multimedia devices | 1023 | # Multimedia devices |
@@ -1012,11 +1074,9 @@ CONFIG_HID_COMPAT=y | |||
1012 | CONFIG_HID_A4TECH=y | 1074 | CONFIG_HID_A4TECH=y |
1013 | CONFIG_HID_APPLE=y | 1075 | CONFIG_HID_APPLE=y |
1014 | CONFIG_HID_BELKIN=y | 1076 | CONFIG_HID_BELKIN=y |
1015 | CONFIG_HID_BRIGHT=y | ||
1016 | CONFIG_HID_CHERRY=y | 1077 | CONFIG_HID_CHERRY=y |
1017 | CONFIG_HID_CHICONY=y | 1078 | CONFIG_HID_CHICONY=y |
1018 | CONFIG_HID_CYPRESS=y | 1079 | CONFIG_HID_CYPRESS=y |
1019 | CONFIG_HID_DELL=y | ||
1020 | CONFIG_HID_EZKEY=y | 1080 | CONFIG_HID_EZKEY=y |
1021 | CONFIG_HID_GYRATION=y | 1081 | CONFIG_HID_GYRATION=y |
1022 | CONFIG_HID_LOGITECH=y | 1082 | CONFIG_HID_LOGITECH=y |
@@ -1024,12 +1084,15 @@ CONFIG_HID_LOGITECH=y | |||
1024 | # CONFIG_LOGIRUMBLEPAD2_FF is not set | 1084 | # CONFIG_LOGIRUMBLEPAD2_FF is not set |
1025 | CONFIG_HID_MICROSOFT=y | 1085 | CONFIG_HID_MICROSOFT=y |
1026 | CONFIG_HID_MONTEREY=y | 1086 | CONFIG_HID_MONTEREY=y |
1087 | CONFIG_HID_NTRIG=y | ||
1027 | CONFIG_HID_PANTHERLORD=y | 1088 | CONFIG_HID_PANTHERLORD=y |
1028 | # CONFIG_PANTHERLORD_FF is not set | 1089 | # CONFIG_PANTHERLORD_FF is not set |
1029 | CONFIG_HID_PETALYNX=y | 1090 | CONFIG_HID_PETALYNX=y |
1030 | CONFIG_HID_SAMSUNG=y | 1091 | CONFIG_HID_SAMSUNG=y |
1031 | CONFIG_HID_SONY=y | 1092 | CONFIG_HID_SONY=y |
1032 | CONFIG_HID_SUNPLUS=y | 1093 | CONFIG_HID_SUNPLUS=y |
1094 | # CONFIG_GREENASIA_FF is not set | ||
1095 | CONFIG_HID_TOPSEED=y | ||
1033 | # CONFIG_THRUSTMASTER_FF is not set | 1096 | # CONFIG_THRUSTMASTER_FF is not set |
1034 | # CONFIG_ZEROPLUS_FF is not set | 1097 | # CONFIG_ZEROPLUS_FF is not set |
1035 | CONFIG_USB_SUPPORT=y | 1098 | CONFIG_USB_SUPPORT=y |
@@ -1058,6 +1121,7 @@ CONFIG_USB_DEVICE_CLASS=y | |||
1058 | CONFIG_USB_EHCI_HCD=y | 1121 | CONFIG_USB_EHCI_HCD=y |
1059 | CONFIG_USB_EHCI_ROOT_HUB_TT=y | 1122 | CONFIG_USB_EHCI_ROOT_HUB_TT=y |
1060 | CONFIG_USB_EHCI_TT_NEWSCHED=y | 1123 | CONFIG_USB_EHCI_TT_NEWSCHED=y |
1124 | # CONFIG_USB_OXU210HP_HCD is not set | ||
1061 | # CONFIG_USB_ISP116X_HCD is not set | 1125 | # CONFIG_USB_ISP116X_HCD is not set |
1062 | # CONFIG_USB_ISP1760_HCD is not set | 1126 | # CONFIG_USB_ISP1760_HCD is not set |
1063 | # CONFIG_USB_OHCI_HCD is not set | 1127 | # CONFIG_USB_OHCI_HCD is not set |
@@ -1087,7 +1151,6 @@ CONFIG_USB_STORAGE=y | |||
1087 | CONFIG_USB_STORAGE_DATAFAB=y | 1151 | CONFIG_USB_STORAGE_DATAFAB=y |
1088 | CONFIG_USB_STORAGE_FREECOM=y | 1152 | CONFIG_USB_STORAGE_FREECOM=y |
1089 | # CONFIG_USB_STORAGE_ISD200 is not set | 1153 | # CONFIG_USB_STORAGE_ISD200 is not set |
1090 | CONFIG_USB_STORAGE_DPCM=y | ||
1091 | # CONFIG_USB_STORAGE_USBAT is not set | 1154 | # CONFIG_USB_STORAGE_USBAT is not set |
1092 | CONFIG_USB_STORAGE_SDDR09=y | 1155 | CONFIG_USB_STORAGE_SDDR09=y |
1093 | CONFIG_USB_STORAGE_SDDR55=y | 1156 | CONFIG_USB_STORAGE_SDDR55=y |
@@ -1135,21 +1198,51 @@ CONFIG_USB_STORAGE_JUMPSHOT=y | |||
1135 | # CONFIG_USB_ISIGHTFW is not set | 1198 | # CONFIG_USB_ISIGHTFW is not set |
1136 | # CONFIG_USB_VST is not set | 1199 | # CONFIG_USB_VST is not set |
1137 | # CONFIG_USB_GADGET is not set | 1200 | # CONFIG_USB_GADGET is not set |
1201 | |||
1202 | # | ||
1203 | # OTG and related infrastructure | ||
1204 | # | ||
1205 | # CONFIG_USB_GPIO_VBUS is not set | ||
1138 | # CONFIG_UWB is not set | 1206 | # CONFIG_UWB is not set |
1139 | # CONFIG_MMC is not set | 1207 | CONFIG_MMC=y |
1208 | # CONFIG_MMC_DEBUG is not set | ||
1209 | # CONFIG_MMC_UNSAFE_RESUME is not set | ||
1210 | |||
1211 | # | ||
1212 | # MMC/SD/SDIO Card Drivers | ||
1213 | # | ||
1214 | CONFIG_MMC_BLOCK=y | ||
1215 | CONFIG_MMC_BLOCK_BOUNCE=y | ||
1216 | CONFIG_SDIO_UART=y | ||
1217 | # CONFIG_MMC_TEST is not set | ||
1218 | |||
1219 | # | ||
1220 | # MMC/SD/SDIO Host Controller Drivers | ||
1221 | # | ||
1222 | # CONFIG_MMC_SDHCI is not set | ||
1223 | # CONFIG_MMC_TIFM_SD is not set | ||
1224 | CONFIG_MMC_MVSDIO=y | ||
1225 | # CONFIG_MMC_SPI is not set | ||
1140 | # CONFIG_MEMSTICK is not set | 1226 | # CONFIG_MEMSTICK is not set |
1141 | # CONFIG_ACCESSIBILITY is not set | 1227 | # CONFIG_ACCESSIBILITY is not set |
1142 | CONFIG_NEW_LEDS=y | 1228 | CONFIG_NEW_LEDS=y |
1143 | # CONFIG_LEDS_CLASS is not set | 1229 | CONFIG_LEDS_CLASS=y |
1144 | 1230 | ||
1145 | # | 1231 | # |
1146 | # LED drivers | 1232 | # LED drivers |
1147 | # | 1233 | # |
1234 | # CONFIG_LEDS_PCA9532 is not set | ||
1235 | CONFIG_LEDS_GPIO=y | ||
1236 | # CONFIG_LEDS_PCA955X is not set | ||
1148 | 1237 | ||
1149 | # | 1238 | # |
1150 | # LED Triggers | 1239 | # LED Triggers |
1151 | # | 1240 | # |
1152 | # CONFIG_LEDS_TRIGGERS is not set | 1241 | CONFIG_LEDS_TRIGGERS=y |
1242 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
1243 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
1244 | # CONFIG_LEDS_TRIGGER_BACKLIGHT is not set | ||
1245 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | ||
1153 | CONFIG_RTC_LIB=y | 1246 | CONFIG_RTC_LIB=y |
1154 | CONFIG_RTC_CLASS=y | 1247 | CONFIG_RTC_CLASS=y |
1155 | CONFIG_RTC_HCTOSYS=y | 1248 | CONFIG_RTC_HCTOSYS=y |
@@ -1227,6 +1320,7 @@ CONFIG_DMA_ENGINE=y | |||
1227 | # CONFIG_DMATEST is not set | 1320 | # CONFIG_DMATEST is not set |
1228 | # CONFIG_REGULATOR is not set | 1321 | # CONFIG_REGULATOR is not set |
1229 | # CONFIG_UIO is not set | 1322 | # CONFIG_UIO is not set |
1323 | # CONFIG_STAGING is not set | ||
1230 | 1324 | ||
1231 | # | 1325 | # |
1232 | # File systems | 1326 | # File systems |
@@ -1238,16 +1332,14 @@ CONFIG_EXT3_FS=y | |||
1238 | # CONFIG_EXT3_FS_XATTR is not set | 1332 | # CONFIG_EXT3_FS_XATTR is not set |
1239 | # CONFIG_EXT4_FS is not set | 1333 | # CONFIG_EXT4_FS is not set |
1240 | CONFIG_JBD=y | 1334 | CONFIG_JBD=y |
1335 | # CONFIG_JBD_DEBUG is not set | ||
1241 | # CONFIG_REISERFS_FS is not set | 1336 | # CONFIG_REISERFS_FS is not set |
1242 | # CONFIG_JFS_FS is not set | 1337 | # CONFIG_JFS_FS is not set |
1243 | # CONFIG_FS_POSIX_ACL is not set | 1338 | # CONFIG_FS_POSIX_ACL is not set |
1244 | CONFIG_FILE_LOCKING=y | 1339 | CONFIG_FILE_LOCKING=y |
1245 | CONFIG_XFS_FS=y | 1340 | # CONFIG_XFS_FS is not set |
1246 | # CONFIG_XFS_QUOTA is not set | ||
1247 | # CONFIG_XFS_POSIX_ACL is not set | ||
1248 | # CONFIG_XFS_RT is not set | ||
1249 | # CONFIG_XFS_DEBUG is not set | ||
1250 | # CONFIG_OCFS2_FS is not set | 1341 | # CONFIG_OCFS2_FS is not set |
1342 | # CONFIG_BTRFS_FS is not set | ||
1251 | CONFIG_DNOTIFY=y | 1343 | CONFIG_DNOTIFY=y |
1252 | CONFIG_INOTIFY=y | 1344 | CONFIG_INOTIFY=y |
1253 | CONFIG_INOTIFY_USER=y | 1345 | CONFIG_INOTIFY_USER=y |
@@ -1268,9 +1360,9 @@ CONFIG_UDF_NLS=y | |||
1268 | # | 1360 | # |
1269 | # DOS/FAT/NT Filesystems | 1361 | # DOS/FAT/NT Filesystems |
1270 | # | 1362 | # |
1271 | CONFIG_FAT_FS=m | 1363 | CONFIG_FAT_FS=y |
1272 | CONFIG_MSDOS_FS=m | 1364 | CONFIG_MSDOS_FS=y |
1273 | CONFIG_VFAT_FS=m | 1365 | CONFIG_VFAT_FS=y |
1274 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | 1366 | CONFIG_FAT_DEFAULT_CODEPAGE=437 |
1275 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | 1367 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" |
1276 | # CONFIG_NTFS_FS is not set | 1368 | # CONFIG_NTFS_FS is not set |
@@ -1286,10 +1378,7 @@ CONFIG_TMPFS=y | |||
1286 | # CONFIG_TMPFS_POSIX_ACL is not set | 1378 | # CONFIG_TMPFS_POSIX_ACL is not set |
1287 | # CONFIG_HUGETLB_PAGE is not set | 1379 | # CONFIG_HUGETLB_PAGE is not set |
1288 | # CONFIG_CONFIGFS_FS is not set | 1380 | # CONFIG_CONFIGFS_FS is not set |
1289 | 1381 | CONFIG_MISC_FILESYSTEMS=y | |
1290 | # | ||
1291 | # Miscellaneous filesystems | ||
1292 | # | ||
1293 | # CONFIG_ADFS_FS is not set | 1382 | # CONFIG_ADFS_FS is not set |
1294 | # CONFIG_AFFS_FS is not set | 1383 | # CONFIG_AFFS_FS is not set |
1295 | # CONFIG_HFS_FS is not set | 1384 | # CONFIG_HFS_FS is not set |
@@ -1309,6 +1398,7 @@ CONFIG_JFFS2_ZLIB=y | |||
1309 | CONFIG_JFFS2_RTIME=y | 1398 | CONFIG_JFFS2_RTIME=y |
1310 | # CONFIG_JFFS2_RUBIN is not set | 1399 | # CONFIG_JFFS2_RUBIN is not set |
1311 | CONFIG_CRAMFS=y | 1400 | CONFIG_CRAMFS=y |
1401 | # CONFIG_SQUASHFS is not set | ||
1312 | # CONFIG_VXFS_FS is not set | 1402 | # CONFIG_VXFS_FS is not set |
1313 | # CONFIG_MINIX_FS is not set | 1403 | # CONFIG_MINIX_FS is not set |
1314 | # CONFIG_OMFS_FS is not set | 1404 | # CONFIG_OMFS_FS is not set |
@@ -1393,7 +1483,7 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
1393 | CONFIG_FRAME_WARN=1024 | 1483 | CONFIG_FRAME_WARN=1024 |
1394 | CONFIG_MAGIC_SYSRQ=y | 1484 | CONFIG_MAGIC_SYSRQ=y |
1395 | # CONFIG_UNUSED_SYMBOLS is not set | 1485 | # CONFIG_UNUSED_SYMBOLS is not set |
1396 | # CONFIG_DEBUG_FS is not set | 1486 | CONFIG_DEBUG_FS=y |
1397 | # CONFIG_HEADERS_CHECK is not set | 1487 | # CONFIG_HEADERS_CHECK is not set |
1398 | CONFIG_DEBUG_KERNEL=y | 1488 | CONFIG_DEBUG_KERNEL=y |
1399 | # CONFIG_DEBUG_SHIRQ is not set | 1489 | # CONFIG_DEBUG_SHIRQ is not set |
@@ -1416,6 +1506,7 @@ CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | |||
1416 | # CONFIG_LOCK_STAT is not set | 1506 | # CONFIG_LOCK_STAT is not set |
1417 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | 1507 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set |
1418 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | 1508 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set |
1509 | CONFIG_STACKTRACE=y | ||
1419 | # CONFIG_DEBUG_KOBJECT is not set | 1510 | # CONFIG_DEBUG_KOBJECT is not set |
1420 | CONFIG_DEBUG_BUGVERBOSE=y | 1511 | CONFIG_DEBUG_BUGVERBOSE=y |
1421 | CONFIG_DEBUG_INFO=y | 1512 | CONFIG_DEBUG_INFO=y |
@@ -1424,7 +1515,7 @@ CONFIG_DEBUG_INFO=y | |||
1424 | CONFIG_DEBUG_MEMORY_INIT=y | 1515 | CONFIG_DEBUG_MEMORY_INIT=y |
1425 | # CONFIG_DEBUG_LIST is not set | 1516 | # CONFIG_DEBUG_LIST is not set |
1426 | # CONFIG_DEBUG_SG is not set | 1517 | # CONFIG_DEBUG_SG is not set |
1427 | CONFIG_FRAME_POINTER=y | 1518 | # CONFIG_DEBUG_NOTIFIERS is not set |
1428 | # CONFIG_BOOT_PRINTK_DELAY is not set | 1519 | # CONFIG_BOOT_PRINTK_DELAY is not set |
1429 | # CONFIG_RCU_TORTURE_TEST is not set | 1520 | # CONFIG_RCU_TORTURE_TEST is not set |
1430 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | 1521 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set |
@@ -1435,7 +1526,10 @@ CONFIG_FRAME_POINTER=y | |||
1435 | # CONFIG_FAULT_INJECTION is not set | 1526 | # CONFIG_FAULT_INJECTION is not set |
1436 | # CONFIG_LATENCYTOP is not set | 1527 | # CONFIG_LATENCYTOP is not set |
1437 | CONFIG_SYSCTL_SYSCALL_CHECK=y | 1528 | CONFIG_SYSCTL_SYSCALL_CHECK=y |
1529 | CONFIG_NOP_TRACER=y | ||
1438 | CONFIG_HAVE_FUNCTION_TRACER=y | 1530 | CONFIG_HAVE_FUNCTION_TRACER=y |
1531 | CONFIG_RING_BUFFER=y | ||
1532 | CONFIG_TRACING=y | ||
1439 | 1533 | ||
1440 | # | 1534 | # |
1441 | # Tracers | 1535 | # Tracers |
@@ -1446,11 +1540,14 @@ CONFIG_HAVE_FUNCTION_TRACER=y | |||
1446 | # CONFIG_SCHED_TRACER is not set | 1540 | # CONFIG_SCHED_TRACER is not set |
1447 | # CONFIG_CONTEXT_SWITCH_TRACER is not set | 1541 | # CONFIG_CONTEXT_SWITCH_TRACER is not set |
1448 | # CONFIG_BOOT_TRACER is not set | 1542 | # CONFIG_BOOT_TRACER is not set |
1543 | # CONFIG_TRACE_BRANCH_PROFILING is not set | ||
1449 | # CONFIG_STACK_TRACER is not set | 1544 | # CONFIG_STACK_TRACER is not set |
1545 | # CONFIG_FTRACE_STARTUP_TEST is not set | ||
1450 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set | 1546 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set |
1451 | # CONFIG_SAMPLES is not set | 1547 | # CONFIG_SAMPLES is not set |
1452 | CONFIG_HAVE_ARCH_KGDB=y | 1548 | CONFIG_HAVE_ARCH_KGDB=y |
1453 | # CONFIG_KGDB is not set | 1549 | # CONFIG_KGDB is not set |
1550 | CONFIG_ARM_UNWIND=y | ||
1454 | CONFIG_DEBUG_USER=y | 1551 | CONFIG_DEBUG_USER=y |
1455 | CONFIG_DEBUG_ERRORS=y | 1552 | CONFIG_DEBUG_ERRORS=y |
1456 | # CONFIG_DEBUG_STACK_USAGE is not set | 1553 | # CONFIG_DEBUG_STACK_USAGE is not set |
@@ -1464,19 +1561,22 @@ CONFIG_DEBUG_LL=y | |||
1464 | # CONFIG_SECURITY is not set | 1561 | # CONFIG_SECURITY is not set |
1465 | # CONFIG_SECURITYFS is not set | 1562 | # CONFIG_SECURITYFS is not set |
1466 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | 1563 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set |
1467 | CONFIG_ASYNC_CORE=y | ||
1468 | CONFIG_CRYPTO=y | 1564 | CONFIG_CRYPTO=y |
1469 | 1565 | ||
1470 | # | 1566 | # |
1471 | # Crypto core or helper | 1567 | # Crypto core or helper |
1472 | # | 1568 | # |
1473 | # CONFIG_CRYPTO_FIPS is not set | 1569 | # CONFIG_CRYPTO_FIPS is not set |
1474 | CONFIG_CRYPTO_ALGAPI=m | 1570 | CONFIG_CRYPTO_ALGAPI=y |
1475 | CONFIG_CRYPTO_AEAD=m | 1571 | CONFIG_CRYPTO_ALGAPI2=y |
1476 | CONFIG_CRYPTO_BLKCIPHER=m | 1572 | CONFIG_CRYPTO_AEAD2=y |
1477 | CONFIG_CRYPTO_HASH=m | 1573 | CONFIG_CRYPTO_BLKCIPHER=y |
1478 | CONFIG_CRYPTO_RNG=m | 1574 | CONFIG_CRYPTO_BLKCIPHER2=y |
1479 | CONFIG_CRYPTO_MANAGER=m | 1575 | CONFIG_CRYPTO_HASH=y |
1576 | CONFIG_CRYPTO_HASH2=y | ||
1577 | CONFIG_CRYPTO_RNG2=y | ||
1578 | CONFIG_CRYPTO_MANAGER=y | ||
1579 | CONFIG_CRYPTO_MANAGER2=y | ||
1480 | # CONFIG_CRYPTO_GF128MUL is not set | 1580 | # CONFIG_CRYPTO_GF128MUL is not set |
1481 | # CONFIG_CRYPTO_NULL is not set | 1581 | # CONFIG_CRYPTO_NULL is not set |
1482 | # CONFIG_CRYPTO_CRYPTD is not set | 1582 | # CONFIG_CRYPTO_CRYPTD is not set |
@@ -1496,7 +1596,7 @@ CONFIG_CRYPTO_MANAGER=m | |||
1496 | CONFIG_CRYPTO_CBC=m | 1596 | CONFIG_CRYPTO_CBC=m |
1497 | # CONFIG_CRYPTO_CTR is not set | 1597 | # CONFIG_CRYPTO_CTR is not set |
1498 | # CONFIG_CRYPTO_CTS is not set | 1598 | # CONFIG_CRYPTO_CTS is not set |
1499 | CONFIG_CRYPTO_ECB=m | 1599 | CONFIG_CRYPTO_ECB=y |
1500 | # CONFIG_CRYPTO_LRW is not set | 1600 | # CONFIG_CRYPTO_LRW is not set |
1501 | CONFIG_CRYPTO_PCBC=m | 1601 | CONFIG_CRYPTO_PCBC=m |
1502 | # CONFIG_CRYPTO_XTS is not set | 1602 | # CONFIG_CRYPTO_XTS is not set |
@@ -1510,7 +1610,7 @@ CONFIG_CRYPTO_PCBC=m | |||
1510 | # | 1610 | # |
1511 | # Digest | 1611 | # Digest |
1512 | # | 1612 | # |
1513 | # CONFIG_CRYPTO_CRC32C is not set | 1613 | CONFIG_CRYPTO_CRC32C=y |
1514 | # CONFIG_CRYPTO_MD4 is not set | 1614 | # CONFIG_CRYPTO_MD4 is not set |
1515 | # CONFIG_CRYPTO_MD5 is not set | 1615 | # CONFIG_CRYPTO_MD5 is not set |
1516 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | 1616 | # CONFIG_CRYPTO_MICHAEL_MIC is not set |
@@ -1527,9 +1627,9 @@ CONFIG_CRYPTO_PCBC=m | |||
1527 | # | 1627 | # |
1528 | # Ciphers | 1628 | # Ciphers |
1529 | # | 1629 | # |
1530 | # CONFIG_CRYPTO_AES is not set | 1630 | CONFIG_CRYPTO_AES=y |
1531 | # CONFIG_CRYPTO_ANUBIS is not set | 1631 | # CONFIG_CRYPTO_ANUBIS is not set |
1532 | # CONFIG_CRYPTO_ARC4 is not set | 1632 | CONFIG_CRYPTO_ARC4=y |
1533 | # CONFIG_CRYPTO_BLOWFISH is not set | 1633 | # CONFIG_CRYPTO_BLOWFISH is not set |
1534 | # CONFIG_CRYPTO_CAMELLIA is not set | 1634 | # CONFIG_CRYPTO_CAMELLIA is not set |
1535 | # CONFIG_CRYPTO_CAST5 is not set | 1635 | # CONFIG_CRYPTO_CAST5 is not set |
@@ -1560,6 +1660,7 @@ CONFIG_CRYPTO_HW=y | |||
1560 | # Library routines | 1660 | # Library routines |
1561 | # | 1661 | # |
1562 | CONFIG_BITREVERSE=y | 1662 | CONFIG_BITREVERSE=y |
1663 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
1563 | CONFIG_CRC_CCITT=y | 1664 | CONFIG_CRC_CCITT=y |
1564 | CONFIG_CRC16=y | 1665 | CONFIG_CRC16=y |
1565 | # CONFIG_CRC_T10DIF is not set | 1666 | # CONFIG_CRC_T10DIF is not set |
diff --git a/arch/arm/configs/mv78xx0_defconfig b/arch/arm/configs/mv78xx0_defconfig index 83c817f31bcc..b0698722e0cb 100644 --- a/arch/arm/configs/mv78xx0_defconfig +++ b/arch/arm/configs/mv78xx0_defconfig | |||
@@ -165,6 +165,7 @@ CONFIG_ARCH_MV78XX0=y | |||
165 | # Marvell MV78xx0 Implementations | 165 | # Marvell MV78xx0 Implementations |
166 | # | 166 | # |
167 | CONFIG_MACH_DB78X00_BP=y | 167 | CONFIG_MACH_DB78X00_BP=y |
168 | CONFIG_MACH_RD78X00_MASA=y | ||
168 | 169 | ||
169 | # | 170 | # |
170 | # Boot options | 171 | # Boot options |
diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig index a8ee6984a09e..020e6a8a9e5c 100644 --- a/arch/arm/configs/orion5x_defconfig +++ b/arch/arm/configs/orion5x_defconfig | |||
@@ -481,7 +481,7 @@ CONFIG_MTD_NAND_IDS=y | |||
481 | # CONFIG_MTD_NAND_DISKONCHIP is not set | 481 | # CONFIG_MTD_NAND_DISKONCHIP is not set |
482 | # CONFIG_MTD_NAND_CAFE is not set | 482 | # CONFIG_MTD_NAND_CAFE is not set |
483 | # CONFIG_MTD_NAND_NANDSIM is not set | 483 | # CONFIG_MTD_NAND_NANDSIM is not set |
484 | # CONFIG_MTD_NAND_PLATFORM is not set | 484 | CONFIG_MTD_NAND_PLATFORM=y |
485 | # CONFIG_MTD_ALAUDA is not set | 485 | # CONFIG_MTD_ALAUDA is not set |
486 | CONFIG_MTD_NAND_ORION=y | 486 | CONFIG_MTD_NAND_ORION=y |
487 | # CONFIG_MTD_ONENAND is not set | 487 | # CONFIG_MTD_ONENAND is not set |
@@ -1177,7 +1177,7 @@ CONFIG_RTC_DRV_S35390A=y | |||
1177 | # CONFIG_RTC_DRV_DS1553 is not set | 1177 | # CONFIG_RTC_DRV_DS1553 is not set |
1178 | # CONFIG_RTC_DRV_DS1742 is not set | 1178 | # CONFIG_RTC_DRV_DS1742 is not set |
1179 | # CONFIG_RTC_DRV_STK17TA8 is not set | 1179 | # CONFIG_RTC_DRV_STK17TA8 is not set |
1180 | # CONFIG_RTC_DRV_M48T86 is not set | 1180 | CONFIG_RTC_DRV_M48T86=y |
1181 | # CONFIG_RTC_DRV_M48T59 is not set | 1181 | # CONFIG_RTC_DRV_M48T59 is not set |
1182 | # CONFIG_RTC_DRV_V3020 is not set | 1182 | # CONFIG_RTC_DRV_V3020 is not set |
1183 | 1183 | ||
diff --git a/arch/arm/configs/qil-a9260_defconfig b/arch/arm/configs/qil-a9260_defconfig index cd1d717903ac..9b32d0eb89ba 100644 --- a/arch/arm/configs/qil-a9260_defconfig +++ b/arch/arm/configs/qil-a9260_defconfig | |||
@@ -727,7 +727,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y | |||
727 | # Watchdog Device Drivers | 727 | # Watchdog Device Drivers |
728 | # | 728 | # |
729 | # CONFIG_SOFT_WATCHDOG is not set | 729 | # CONFIG_SOFT_WATCHDOG is not set |
730 | # CONFIG_AT91SAM9_WATCHDOG is not set | 730 | # CONFIG_AT91SAM9X_WATCHDOG is not set |
731 | 731 | ||
732 | # | 732 | # |
733 | # USB-based Watchdog Cards | 733 | # USB-based Watchdog Cards |
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h index 39d949b63e80..58cf91f38e6f 100644 --- a/arch/arm/include/asm/mach/map.h +++ b/arch/arm/include/asm/mach/map.h | |||
@@ -26,6 +26,7 @@ struct map_desc { | |||
26 | #define MT_HIGH_VECTORS 8 | 26 | #define MT_HIGH_VECTORS 8 |
27 | #define MT_MEMORY 9 | 27 | #define MT_MEMORY 9 |
28 | #define MT_ROM 10 | 28 | #define MT_ROM 10 |
29 | #define MT_MEMORY_NONCACHED 11 | ||
29 | 30 | ||
30 | #ifdef CONFIG_MMU | 31 | #ifdef CONFIG_MMU |
31 | extern void iotable_init(struct map_desc *, int); | 32 | extern void iotable_init(struct map_desc *, int); |
diff --git a/arch/arm/include/asm/sizes.h b/arch/arm/include/asm/sizes.h index 503843db1565..c10d1aa4b487 100644 --- a/arch/arm/include/asm/sizes.h +++ b/arch/arm/include/asm/sizes.h | |||
@@ -43,6 +43,7 @@ | |||
43 | #define SZ_8M 0x00800000 | 43 | #define SZ_8M 0x00800000 |
44 | #define SZ_16M 0x01000000 | 44 | #define SZ_16M 0x01000000 |
45 | #define SZ_32M 0x02000000 | 45 | #define SZ_32M 0x02000000 |
46 | #define SZ_48M 0x03000000 | ||
46 | #define SZ_64M 0x04000000 | 47 | #define SZ_64M 0x04000000 |
47 | #define SZ_128M 0x08000000 | 48 | #define SZ_128M 0x08000000 |
48 | #define SZ_256M 0x10000000 | 49 | #define SZ_256M 0x10000000 |
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 811be55f338e..0a0d49ae1e6d 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h | |||
@@ -97,8 +97,8 @@ extern void __show_regs(struct pt_regs *); | |||
97 | extern int cpu_architecture(void); | 97 | extern int cpu_architecture(void); |
98 | extern void cpu_init(void); | 98 | extern void cpu_init(void); |
99 | 99 | ||
100 | void arm_machine_restart(char mode); | 100 | void arm_machine_restart(char mode, const char *cmd); |
101 | extern void (*arm_pm_restart)(char str); | 101 | extern void (*arm_pm_restart)(char str, const char *cmd); |
102 | 102 | ||
103 | #define UDBG_UNDEFINED (1 << 0) | 103 | #define UDBG_UNDEFINED (1 << 0) |
104 | #define UDBG_SYSCALL (1 << 1) | 104 | #define UDBG_SYSCALL (1 << 1) |
diff --git a/arch/arm/kernel/elf.c b/arch/arm/kernel/elf.c index 84849098c8e8..d4a0da1e48f4 100644 --- a/arch/arm/kernel/elf.c +++ b/arch/arm/kernel/elf.c | |||
@@ -74,9 +74,9 @@ EXPORT_SYMBOL(elf_set_personality); | |||
74 | */ | 74 | */ |
75 | int arm_elf_read_implies_exec(const struct elf32_hdr *x, int executable_stack) | 75 | int arm_elf_read_implies_exec(const struct elf32_hdr *x, int executable_stack) |
76 | { | 76 | { |
77 | if (executable_stack != EXSTACK_ENABLE_X) | 77 | if (executable_stack != EXSTACK_DISABLE_X) |
78 | return 1; | 78 | return 1; |
79 | if (cpu_architecture() <= CPU_ARCH_ARMv6) | 79 | if (cpu_architecture() < CPU_ARCH_ARMv6) |
80 | return 1; | 80 | return 1; |
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index b8c1f1411440..b55cb0331809 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -115,6 +115,7 @@ ENTRY(mcount) | |||
115 | .globl mcount_call | 115 | .globl mcount_call |
116 | mcount_call: | 116 | mcount_call: |
117 | bl ftrace_stub | 117 | bl ftrace_stub |
118 | ldr lr, [fp, #-4] @ restore lr | ||
118 | ldmia sp!, {r0-r3, pc} | 119 | ldmia sp!, {r0-r3, pc} |
119 | 120 | ||
120 | ENTRY(ftrace_caller) | 121 | ENTRY(ftrace_caller) |
@@ -126,6 +127,7 @@ ENTRY(ftrace_caller) | |||
126 | .globl ftrace_call | 127 | .globl ftrace_call |
127 | ftrace_call: | 128 | ftrace_call: |
128 | bl ftrace_stub | 129 | bl ftrace_stub |
130 | ldr lr, [fp, #-4] @ restore lr | ||
129 | ldmia sp!, {r0-r3, pc} | 131 | ldmia sp!, {r0-r3, pc} |
130 | 132 | ||
131 | #else | 133 | #else |
@@ -137,6 +139,7 @@ ENTRY(mcount) | |||
137 | adr r0, ftrace_stub | 139 | adr r0, ftrace_stub |
138 | cmp r0, r2 | 140 | cmp r0, r2 |
139 | bne trace | 141 | bne trace |
142 | ldr lr, [fp, #-4] @ restore lr | ||
140 | ldmia sp!, {r0-r3, pc} | 143 | ldmia sp!, {r0-r3, pc} |
141 | 144 | ||
142 | trace: | 145 | trace: |
@@ -145,6 +148,7 @@ trace: | |||
145 | sub r0, r0, #MCOUNT_INSN_SIZE | 148 | sub r0, r0, #MCOUNT_INSN_SIZE |
146 | mov lr, pc | 149 | mov lr, pc |
147 | mov pc, r2 | 150 | mov pc, r2 |
151 | mov lr, r1 @ restore lr | ||
148 | ldmia sp!, {r0-r3, pc} | 152 | ldmia sp!, {r0-r3, pc} |
149 | 153 | ||
150 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 154 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c index 36f81d967979..6ff7919613d7 100644 --- a/arch/arm/kernel/fiq.c +++ b/arch/arm/kernel/fiq.c | |||
@@ -88,7 +88,7 @@ void set_fiq_handler(void *start, unsigned int length) | |||
88 | * disable irqs for the duration. Note - these functions are almost | 88 | * disable irqs for the duration. Note - these functions are almost |
89 | * entirely coded in assembly. | 89 | * entirely coded in assembly. |
90 | */ | 90 | */ |
91 | void __attribute__((naked)) set_fiq_regs(struct pt_regs *regs) | 91 | void __naked set_fiq_regs(struct pt_regs *regs) |
92 | { | 92 | { |
93 | register unsigned long tmp; | 93 | register unsigned long tmp; |
94 | asm volatile ( | 94 | asm volatile ( |
@@ -106,7 +106,7 @@ void __attribute__((naked)) set_fiq_regs(struct pt_regs *regs) | |||
106 | : "r" (®s->ARM_r8), "I" (PSR_I_BIT | PSR_F_BIT | FIQ_MODE)); | 106 | : "r" (®s->ARM_r8), "I" (PSR_I_BIT | PSR_F_BIT | FIQ_MODE)); |
107 | } | 107 | } |
108 | 108 | ||
109 | void __attribute__((naked)) get_fiq_regs(struct pt_regs *regs) | 109 | void __naked get_fiq_regs(struct pt_regs *regs) |
110 | { | 110 | { |
111 | register unsigned long tmp; | 111 | register unsigned long tmp; |
112 | asm volatile ( | 112 | asm volatile ( |
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index 440dc62cdc3a..598ca61e7bca 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c | |||
@@ -13,8 +13,8 @@ | |||
13 | #include <asm/cacheflush.h> | 13 | #include <asm/cacheflush.h> |
14 | #include <asm/mach-types.h> | 14 | #include <asm/mach-types.h> |
15 | 15 | ||
16 | const extern unsigned char relocate_new_kernel[]; | 16 | extern const unsigned char relocate_new_kernel[]; |
17 | const extern unsigned int relocate_new_kernel_size; | 17 | extern const unsigned int relocate_new_kernel_size; |
18 | 18 | ||
19 | extern void setup_mm_for_reboot(char mode); | 19 | extern void setup_mm_for_reboot(char mode); |
20 | 20 | ||
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index af377c73d90b..2de14e2afdc5 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -83,7 +83,7 @@ static int __init hlt_setup(char *__unused) | |||
83 | __setup("nohlt", nohlt_setup); | 83 | __setup("nohlt", nohlt_setup); |
84 | __setup("hlt", hlt_setup); | 84 | __setup("hlt", hlt_setup); |
85 | 85 | ||
86 | void arm_machine_restart(char mode) | 86 | void arm_machine_restart(char mode, const char *cmd) |
87 | { | 87 | { |
88 | /* | 88 | /* |
89 | * Clean and disable cache, and turn off interrupts | 89 | * Clean and disable cache, and turn off interrupts |
@@ -100,7 +100,7 @@ void arm_machine_restart(char mode) | |||
100 | /* | 100 | /* |
101 | * Now call the architecture specific reboot code. | 101 | * Now call the architecture specific reboot code. |
102 | */ | 102 | */ |
103 | arch_reset(mode); | 103 | arch_reset(mode, cmd); |
104 | 104 | ||
105 | /* | 105 | /* |
106 | * Whoops - the architecture was unable to reboot. | 106 | * Whoops - the architecture was unable to reboot. |
@@ -120,7 +120,7 @@ EXPORT_SYMBOL(pm_idle); | |||
120 | void (*pm_power_off)(void); | 120 | void (*pm_power_off)(void); |
121 | EXPORT_SYMBOL(pm_power_off); | 121 | EXPORT_SYMBOL(pm_power_off); |
122 | 122 | ||
123 | void (*arm_pm_restart)(char str) = arm_machine_restart; | 123 | void (*arm_pm_restart)(char str, const char *cmd) = arm_machine_restart; |
124 | EXPORT_SYMBOL_GPL(arm_pm_restart); | 124 | EXPORT_SYMBOL_GPL(arm_pm_restart); |
125 | 125 | ||
126 | 126 | ||
@@ -195,9 +195,9 @@ void machine_power_off(void) | |||
195 | pm_power_off(); | 195 | pm_power_off(); |
196 | } | 196 | } |
197 | 197 | ||
198 | void machine_restart(char * __unused) | 198 | void machine_restart(char *cmd) |
199 | { | 199 | { |
200 | arm_pm_restart(reboot_mode); | 200 | arm_pm_restart(reboot_mode, cmd); |
201 | } | 201 | } |
202 | 202 | ||
203 | void __show_regs(struct pt_regs *regs) | 203 | void __show_regs(struct pt_regs *regs) |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 8d21427bb679..bc5e4128f9f3 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -234,12 +234,13 @@ static void __init cacheid_init(void) | |||
234 | unsigned int cachetype = read_cpuid_cachetype(); | 234 | unsigned int cachetype = read_cpuid_cachetype(); |
235 | unsigned int arch = cpu_architecture(); | 235 | unsigned int arch = cpu_architecture(); |
236 | 236 | ||
237 | if (arch >= CPU_ARCH_ARMv7) { | 237 | if (arch >= CPU_ARCH_ARMv6) { |
238 | cacheid = CACHEID_VIPT_NONALIASING; | 238 | if ((cachetype & (7 << 29)) == 4 << 29) { |
239 | if ((cachetype & (3 << 14)) == 1 << 14) | 239 | /* ARMv7 register format */ |
240 | cacheid |= CACHEID_ASID_TAGGED; | 240 | cacheid = CACHEID_VIPT_NONALIASING; |
241 | } else if (arch >= CPU_ARCH_ARMv6) { | 241 | if ((cachetype & (3 << 14)) == 1 << 14) |
242 | if (cachetype & (1 << 23)) | 242 | cacheid |= CACHEID_ASID_TAGGED; |
243 | } else if (cachetype & (1 << 23)) | ||
243 | cacheid = CACHEID_VIPT_ALIASING; | 244 | cacheid = CACHEID_VIPT_ALIASING; |
244 | else | 245 | else |
245 | cacheid = CACHEID_VIPT_NONALIASING; | 246 | cacheid = CACHEID_VIPT_NONALIASING; |
diff --git a/arch/arm/mach-aaec2000/include/mach/system.h b/arch/arm/mach-aaec2000/include/mach/system.h index 8f4115d734ce..fe08ca1add6f 100644 --- a/arch/arm/mach-aaec2000/include/mach/system.h +++ b/arch/arm/mach-aaec2000/include/mach/system.h | |||
@@ -16,7 +16,7 @@ static inline void arch_idle(void) | |||
16 | cpu_do_idle(); | 16 | cpu_do_idle(); |
17 | } | 17 | } |
18 | 18 | ||
19 | static inline void arch_reset(char mode) | 19 | static inline void arch_reset(char mode, const char *cmd) |
20 | { | 20 | { |
21 | cpu_reset(0); | 21 | cpu_reset(0); |
22 | } | 22 | } |
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c index 9eca2209cde6..412aa49ad2fb 100644 --- a/arch/arm/mach-at91/at91cap9_devices.c +++ b/arch/arm/mach-at91/at91cap9_devices.c | |||
@@ -697,7 +697,7 @@ static void __init at91_add_device_rtt(void) | |||
697 | * Watchdog | 697 | * Watchdog |
698 | * -------------------------------------------------------------------- */ | 698 | * -------------------------------------------------------------------- */ |
699 | 699 | ||
700 | #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) | 700 | #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) |
701 | static struct platform_device at91cap9_wdt_device = { | 701 | static struct platform_device at91cap9_wdt_device = { |
702 | .name = "at91_wdt", | 702 | .name = "at91_wdt", |
703 | .id = -1, | 703 | .id = -1, |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index fdde1ea21b07..d74c9ac007e7 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -643,7 +643,7 @@ static void __init at91_add_device_rtt(void) | |||
643 | * Watchdog | 643 | * Watchdog |
644 | * -------------------------------------------------------------------- */ | 644 | * -------------------------------------------------------------------- */ |
645 | 645 | ||
646 | #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) | 646 | #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) |
647 | static struct platform_device at91sam9260_wdt_device = { | 647 | static struct platform_device at91sam9260_wdt_device = { |
648 | .name = "at91_wdt", | 648 | .name = "at91_wdt", |
649 | .id = -1, | 649 | .id = -1, |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 17289756f80f..59fc48311fb0 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -621,7 +621,7 @@ static void __init at91_add_device_rtt(void) | |||
621 | * Watchdog | 621 | * Watchdog |
622 | * -------------------------------------------------------------------- */ | 622 | * -------------------------------------------------------------------- */ |
623 | 623 | ||
624 | #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) | 624 | #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) |
625 | static struct platform_device at91sam9261_wdt_device = { | 625 | static struct platform_device at91sam9261_wdt_device = { |
626 | .name = "at91_wdt", | 626 | .name = "at91_wdt", |
627 | .id = -1, | 627 | .id = -1, |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index b753cb879d8e..b7f233242315 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -347,6 +347,111 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) | |||
347 | void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} | 347 | void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} |
348 | #endif | 348 | #endif |
349 | 349 | ||
350 | /* -------------------------------------------------------------------- | ||
351 | * Compact Flash (PCMCIA or IDE) | ||
352 | * -------------------------------------------------------------------- */ | ||
353 | |||
354 | #if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE) || \ | ||
355 | defined(CONFIG_BLK_DEV_IDE_AT91) || defined(CONFIG_BLK_DEV_IDE_AT91_MODULE) | ||
356 | |||
357 | static struct at91_cf_data cf0_data; | ||
358 | |||
359 | static struct resource cf0_resources[] = { | ||
360 | [0] = { | ||
361 | .start = AT91_CHIPSELECT_4, | ||
362 | .end = AT91_CHIPSELECT_4 + SZ_256M - 1, | ||
363 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT, | ||
364 | } | ||
365 | }; | ||
366 | |||
367 | static struct platform_device cf0_device = { | ||
368 | .id = 0, | ||
369 | .dev = { | ||
370 | .platform_data = &cf0_data, | ||
371 | }, | ||
372 | .resource = cf0_resources, | ||
373 | .num_resources = ARRAY_SIZE(cf0_resources), | ||
374 | }; | ||
375 | |||
376 | static struct at91_cf_data cf1_data; | ||
377 | |||
378 | static struct resource cf1_resources[] = { | ||
379 | [0] = { | ||
380 | .start = AT91_CHIPSELECT_5, | ||
381 | .end = AT91_CHIPSELECT_5 + SZ_256M - 1, | ||
382 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT, | ||
383 | } | ||
384 | }; | ||
385 | |||
386 | static struct platform_device cf1_device = { | ||
387 | .id = 1, | ||
388 | .dev = { | ||
389 | .platform_data = &cf1_data, | ||
390 | }, | ||
391 | .resource = cf1_resources, | ||
392 | .num_resources = ARRAY_SIZE(cf1_resources), | ||
393 | }; | ||
394 | |||
395 | void __init at91_add_device_cf(struct at91_cf_data *data) | ||
396 | { | ||
397 | unsigned long ebi0_csa; | ||
398 | struct platform_device *pdev; | ||
399 | |||
400 | if (!data) | ||
401 | return; | ||
402 | |||
403 | /* | ||
404 | * assign CS4 or CS5 to SMC with Compact Flash logic support, | ||
405 | * we assume SMC timings are configured by board code, | ||
406 | * except True IDE where timings are controlled by driver | ||
407 | */ | ||
408 | ebi0_csa = at91_sys_read(AT91_MATRIX_EBI0CSA); | ||
409 | switch (data->chipselect) { | ||
410 | case 4: | ||
411 | at91_set_A_periph(AT91_PIN_PD6, 0); /* EBI0_NCS4/CFCS0 */ | ||
412 | ebi0_csa |= AT91_MATRIX_EBI0_CS4A_SMC_CF1; | ||
413 | cf0_data = *data; | ||
414 | pdev = &cf0_device; | ||
415 | break; | ||
416 | case 5: | ||
417 | at91_set_A_periph(AT91_PIN_PD7, 0); /* EBI0_NCS5/CFCS1 */ | ||
418 | ebi0_csa |= AT91_MATRIX_EBI0_CS5A_SMC_CF2; | ||
419 | cf1_data = *data; | ||
420 | pdev = &cf1_device; | ||
421 | break; | ||
422 | default: | ||
423 | printk(KERN_ERR "AT91 CF: bad chip-select requested (%u)\n", | ||
424 | data->chipselect); | ||
425 | return; | ||
426 | } | ||
427 | at91_sys_write(AT91_MATRIX_EBI0CSA, ebi0_csa); | ||
428 | |||
429 | if (data->det_pin) { | ||
430 | at91_set_gpio_input(data->det_pin, 1); | ||
431 | at91_set_deglitch(data->det_pin, 1); | ||
432 | } | ||
433 | |||
434 | if (data->irq_pin) { | ||
435 | at91_set_gpio_input(data->irq_pin, 1); | ||
436 | at91_set_deglitch(data->irq_pin, 1); | ||
437 | } | ||
438 | |||
439 | if (data->vcc_pin) | ||
440 | /* initially off */ | ||
441 | at91_set_gpio_output(data->vcc_pin, 0); | ||
442 | |||
443 | /* enable EBI controlled pins */ | ||
444 | at91_set_A_periph(AT91_PIN_PD5, 1); /* NWAIT */ | ||
445 | at91_set_A_periph(AT91_PIN_PD8, 0); /* CFCE1 */ | ||
446 | at91_set_A_periph(AT91_PIN_PD9, 0); /* CFCE2 */ | ||
447 | at91_set_A_periph(AT91_PIN_PD14, 0); /* CFNRW */ | ||
448 | |||
449 | pdev->name = (data->flags & AT91_CF_TRUE_IDE) ? "at91_ide" : "at91_cf"; | ||
450 | platform_device_register(pdev); | ||
451 | } | ||
452 | #else | ||
453 | void __init at91_add_device_cf(struct at91_cf_data *data) {} | ||
454 | #endif | ||
350 | 455 | ||
351 | /* -------------------------------------------------------------------- | 456 | /* -------------------------------------------------------------------- |
352 | * NAND / SmartMedia | 457 | * NAND / SmartMedia |
@@ -854,7 +959,7 @@ static void __init at91_add_device_rtt(void) | |||
854 | * Watchdog | 959 | * Watchdog |
855 | * -------------------------------------------------------------------- */ | 960 | * -------------------------------------------------------------------- */ |
856 | 961 | ||
857 | #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) | 962 | #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) |
858 | static struct platform_device at91sam9263_wdt_device = { | 963 | static struct platform_device at91sam9263_wdt_device = { |
859 | .name = "at91_wdt", | 964 | .name = "at91_wdt", |
860 | .id = -1, | 965 | .id = -1, |
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 145324f4ec56..728186515cdf 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -609,7 +609,7 @@ static void __init at91_add_device_rtt(void) | |||
609 | * Watchdog | 609 | * Watchdog |
610 | * -------------------------------------------------------------------- */ | 610 | * -------------------------------------------------------------------- */ |
611 | 611 | ||
612 | #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) | 612 | #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) |
613 | static struct platform_device at91sam9rl_wdt_device = { | 613 | static struct platform_device at91sam9rl_wdt_device = { |
614 | .name = "at91_wdt", | 614 | .name = "at91_wdt", |
615 | .id = -1, | 615 | .id = -1, |
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c index 028e4f7a88be..f2236f0e101f 100644 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c | |||
@@ -437,7 +437,68 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
437 | 437 | ||
438 | /*--------------------------------------------------------------------------*/ | 438 | /*--------------------------------------------------------------------------*/ |
439 | 439 | ||
440 | /* This lock class tells lockdep that GPIO irqs are in a different | 440 | #ifdef CONFIG_DEBUG_FS |
441 | |||
442 | static int at91_gpio_show(struct seq_file *s, void *unused) | ||
443 | { | ||
444 | int bank, j; | ||
445 | |||
446 | /* print heading */ | ||
447 | seq_printf(s, "Pin\t"); | ||
448 | for (bank = 0; bank < gpio_banks; bank++) { | ||
449 | seq_printf(s, "PIO%c\t", 'A' + bank); | ||
450 | }; | ||
451 | seq_printf(s, "\n\n"); | ||
452 | |||
453 | /* print pin status */ | ||
454 | for (j = 0; j < 32; j++) { | ||
455 | seq_printf(s, "%i:\t", j); | ||
456 | |||
457 | for (bank = 0; bank < gpio_banks; bank++) { | ||
458 | unsigned pin = PIN_BASE + (32 * bank) + j; | ||
459 | void __iomem *pio = pin_to_controller(pin); | ||
460 | unsigned mask = pin_to_mask(pin); | ||
461 | |||
462 | if (__raw_readl(pio + PIO_PSR) & mask) | ||
463 | seq_printf(s, "GPIO:%s", __raw_readl(pio + PIO_PDSR) & mask ? "1" : "0"); | ||
464 | else | ||
465 | seq_printf(s, "%s", __raw_readl(pio + PIO_ABSR) & mask ? "B" : "A"); | ||
466 | |||
467 | seq_printf(s, "\t"); | ||
468 | } | ||
469 | |||
470 | seq_printf(s, "\n"); | ||
471 | } | ||
472 | |||
473 | return 0; | ||
474 | } | ||
475 | |||
476 | static int at91_gpio_open(struct inode *inode, struct file *file) | ||
477 | { | ||
478 | return single_open(file, at91_gpio_show, NULL); | ||
479 | } | ||
480 | |||
481 | static const struct file_operations at91_gpio_operations = { | ||
482 | .open = at91_gpio_open, | ||
483 | .read = seq_read, | ||
484 | .llseek = seq_lseek, | ||
485 | .release = single_release, | ||
486 | }; | ||
487 | |||
488 | static int __init at91_gpio_debugfs_init(void) | ||
489 | { | ||
490 | /* /sys/kernel/debug/at91_gpio */ | ||
491 | (void) debugfs_create_file("at91_gpio", S_IFREG | S_IRUGO, NULL, NULL, &at91_gpio_operations); | ||
492 | return 0; | ||
493 | } | ||
494 | postcore_initcall(at91_gpio_debugfs_init); | ||
495 | |||
496 | #endif | ||
497 | |||
498 | /*--------------------------------------------------------------------------*/ | ||
499 | |||
500 | /* | ||
501 | * This lock class tells lockdep that GPIO irqs are in a different | ||
441 | * category than their parents, so it won't report false recursion. | 502 | * category than their parents, so it won't report false recursion. |
442 | */ | 503 | */ |
443 | static struct lock_class_key gpio_lock_class; | 504 | static struct lock_class_key gpio_lock_class; |
@@ -456,9 +517,6 @@ void __init at91_gpio_irq_setup(void) | |||
456 | unsigned id = this->bank->id; | 517 | unsigned id = this->bank->id; |
457 | unsigned i; | 518 | unsigned i; |
458 | 519 | ||
459 | /* enable PIO controller's clock */ | ||
460 | clk_enable(this->bank->clock); | ||
461 | |||
462 | __raw_writel(~0, this->regbase + PIO_IDR); | 520 | __raw_writel(~0, this->regbase + PIO_IDR); |
463 | 521 | ||
464 | for (i = 0, pin = this->chip.base; i < 32; i++, pin++) { | 522 | for (i = 0, pin = this->chip.base; i < 32; i++, pin++) { |
@@ -589,6 +647,9 @@ void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks) | |||
589 | at91_gpio->regbase = at91_gpio->bank->offset + | 647 | at91_gpio->regbase = at91_gpio->bank->offset + |
590 | (void __iomem *)AT91_VA_BASE_SYS; | 648 | (void __iomem *)AT91_VA_BASE_SYS; |
591 | 649 | ||
650 | /* enable PIO controller's clock */ | ||
651 | clk_enable(at91_gpio->bank->clock); | ||
652 | |||
592 | /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */ | 653 | /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */ |
593 | if (last && last->bank->id == at91_gpio->bank->id) | 654 | if (last && last->bank->id == at91_gpio->bank->id) |
594 | last->next = at91_gpio; | 655 | last->next = at91_gpio; |
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index fb51f0e0a83f..793fe7b25f36 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h | |||
@@ -56,6 +56,9 @@ struct at91_cf_data { | |||
56 | u8 vcc_pin; /* power switching */ | 56 | u8 vcc_pin; /* power switching */ |
57 | u8 rst_pin; /* card reset */ | 57 | u8 rst_pin; /* card reset */ |
58 | u8 chipselect; /* EBI Chip Select number */ | 58 | u8 chipselect; /* EBI Chip Select number */ |
59 | u8 flags; | ||
60 | #define AT91_CF_TRUE_IDE 0x01 | ||
61 | #define AT91_IDE_SWAP_A0_A2 0x02 | ||
59 | }; | 62 | }; |
60 | extern void __init at91_add_device_cf(struct at91_cf_data *data); | 63 | extern void __init at91_add_device_cf(struct at91_cf_data *data); |
61 | 64 | ||
@@ -93,6 +96,7 @@ struct atmel_nand_data { | |||
93 | u8 enable_pin; /* chip enable */ | 96 | u8 enable_pin; /* chip enable */ |
94 | u8 det_pin; /* card detect */ | 97 | u8 det_pin; /* card detect */ |
95 | u8 rdy_pin; /* ready/busy */ | 98 | u8 rdy_pin; /* ready/busy */ |
99 | u8 rdy_pin_active_low; /* rdy_pin value is inverted */ | ||
96 | u8 ale; /* address line number connected to ALE */ | 100 | u8 ale; /* address line number connected to ALE */ |
97 | u8 cle; /* address line number connected to CLE */ | 101 | u8 cle; /* address line number connected to CLE */ |
98 | u8 bus_width_16; /* buswidth is 16 bit */ | 102 | u8 bus_width_16; /* buswidth is 16 bit */ |
diff --git a/arch/arm/mach-at91/include/mach/system.h b/arch/arm/mach-at91/include/mach/system.h index e712658d966c..5268af3933c2 100644 --- a/arch/arm/mach-at91/include/mach/system.h +++ b/arch/arm/mach-at91/include/mach/system.h | |||
@@ -43,7 +43,7 @@ static inline void arch_idle(void) | |||
43 | 43 | ||
44 | void (*at91_arch_reset)(void); | 44 | void (*at91_arch_reset)(void); |
45 | 45 | ||
46 | static inline void arch_reset(char mode) | 46 | static inline void arch_reset(char mode, const char *cmd) |
47 | { | 47 | { |
48 | /* call the CPU-specific reset function */ | 48 | /* call the CPU-specific reset function */ |
49 | if (at91_arch_reset) | 49 | if (at91_arch_reset) |
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 9bb4f043aa22..7ac812dc055a 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c | |||
@@ -332,7 +332,6 @@ static int at91_pm_enter(suspend_state_t state) | |||
332 | at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR)); | 332 | at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR)); |
333 | 333 | ||
334 | error: | 334 | error: |
335 | sdram_selfrefresh_disable(); | ||
336 | target_state = PM_SUSPEND_ON; | 335 | target_state = PM_SUSPEND_ON; |
337 | at91_irq_resume(); | 336 | at91_irq_resume(); |
338 | at91_gpio_resume(); | 337 | at91_gpio_resume(); |
diff --git a/arch/arm/mach-clps711x/include/mach/system.h b/arch/arm/mach-clps711x/include/mach/system.h index 24e96159e3e7..f916cd7a477d 100644 --- a/arch/arm/mach-clps711x/include/mach/system.h +++ b/arch/arm/mach-clps711x/include/mach/system.h | |||
@@ -32,7 +32,7 @@ static inline void arch_idle(void) | |||
32 | mov r0, r0"); | 32 | mov r0, r0"); |
33 | } | 33 | } |
34 | 34 | ||
35 | static inline void arch_reset(char mode) | 35 | static inline void arch_reset(char mode, const char *cmd) |
36 | { | 36 | { |
37 | cpu_reset(0); | 37 | cpu_reset(0); |
38 | } | 38 | } |
diff --git a/arch/arm/mach-davinci/board-evm.c b/arch/arm/mach-davinci/board-evm.c index a957d239a683..38b6a9ce2a93 100644 --- a/arch/arm/mach-davinci/board-evm.c +++ b/arch/arm/mach-davinci/board-evm.c | |||
@@ -311,6 +311,9 @@ evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c) | |||
311 | gpio_request(gpio + 7, "nCF_SEL"); | 311 | gpio_request(gpio + 7, "nCF_SEL"); |
312 | gpio_direction_output(gpio + 7, 1); | 312 | gpio_direction_output(gpio + 7, 1); |
313 | 313 | ||
314 | /* irlml6401 sustains over 3A, switches 5V in under 8 msec */ | ||
315 | setup_usb(500, 8); | ||
316 | |||
314 | return 0; | 317 | return 0; |
315 | } | 318 | } |
316 | 319 | ||
@@ -417,9 +420,6 @@ static __init void davinci_evm_init(void) | |||
417 | platform_add_devices(davinci_evm_devices, | 420 | platform_add_devices(davinci_evm_devices, |
418 | ARRAY_SIZE(davinci_evm_devices)); | 421 | ARRAY_SIZE(davinci_evm_devices)); |
419 | evm_init_i2c(); | 422 | evm_init_i2c(); |
420 | |||
421 | /* irlml6401 sustains over 3A, switches 5V in under 8 msec */ | ||
422 | setup_usb(500, 8); | ||
423 | } | 423 | } |
424 | 424 | ||
425 | static __init void davinci_evm_irq_init(void) | 425 | static __init void davinci_evm_irq_init(void) |
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c index 28f6dbc95bd7..abb92b7eca0c 100644 --- a/arch/arm/mach-davinci/clock.c +++ b/arch/arm/mach-davinci/clock.c | |||
@@ -231,6 +231,11 @@ static struct clk davinci_clks[] = { | |||
231 | .lpsc = DAVINCI_LPSC_GPIO, | 231 | .lpsc = DAVINCI_LPSC_GPIO, |
232 | }, | 232 | }, |
233 | { | 233 | { |
234 | .name = "usb", | ||
235 | .rate = &commonrate, | ||
236 | .lpsc = DAVINCI_LPSC_USB, | ||
237 | }, | ||
238 | { | ||
234 | .name = "AEMIFCLK", | 239 | .name = "AEMIFCLK", |
235 | .rate = &commonrate, | 240 | .rate = &commonrate, |
236 | .lpsc = DAVINCI_LPSC_AEMIF, | 241 | .lpsc = DAVINCI_LPSC_AEMIF, |
diff --git a/arch/arm/mach-davinci/include/mach/system.h b/arch/arm/mach-davinci/include/mach/system.h index 17ca41dc2c53..b7e7036674fa 100644 --- a/arch/arm/mach-davinci/include/mach/system.h +++ b/arch/arm/mach-davinci/include/mach/system.h | |||
@@ -21,7 +21,7 @@ static void arch_idle(void) | |||
21 | cpu_do_idle(); | 21 | cpu_do_idle(); |
22 | } | 22 | } |
23 | 23 | ||
24 | static void arch_reset(char mode) | 24 | static void arch_reset(char mode, const char *cmd) |
25 | { | 25 | { |
26 | davinci_watchdog_reset(); | 26 | davinci_watchdog_reset(); |
27 | } | 27 | } |
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c index 867ead2559ad..69680784448a 100644 --- a/arch/arm/mach-davinci/usb.c +++ b/arch/arm/mach-davinci/usb.c | |||
@@ -47,6 +47,7 @@ static struct musb_hdrc_platform_data usb_data = { | |||
47 | #elif defined(CONFIG_USB_MUSB_HOST) | 47 | #elif defined(CONFIG_USB_MUSB_HOST) |
48 | .mode = MUSB_HOST, | 48 | .mode = MUSB_HOST, |
49 | #endif | 49 | #endif |
50 | .clock = "usb", | ||
50 | .config = &musb_config, | 51 | .config = &musb_config, |
51 | }; | 52 | }; |
52 | 53 | ||
diff --git a/arch/arm/mach-ebsa110/include/mach/system.h b/arch/arm/mach-ebsa110/include/mach/system.h index 350a028997ef..9a26245bf1fc 100644 --- a/arch/arm/mach-ebsa110/include/mach/system.h +++ b/arch/arm/mach-ebsa110/include/mach/system.h | |||
@@ -34,6 +34,6 @@ static inline void arch_idle(void) | |||
34 | asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc"); | 34 | asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc"); |
35 | } | 35 | } |
36 | 36 | ||
37 | #define arch_reset(mode) cpu_reset(0x80000000) | 37 | #define arch_reset(mode, cmd) cpu_reset(0x80000000) |
38 | 38 | ||
39 | #endif | 39 | #endif |
diff --git a/arch/arm/mach-ep93xx/include/mach/gesbc9312.h b/arch/arm/mach-ep93xx/include/mach/gesbc9312.h deleted file mode 100644 index 21fe2b922aa5..000000000000 --- a/arch/arm/mach-ep93xx/include/mach/gesbc9312.h +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ep93xx/include/mach/gesbc9312.h | ||
3 | */ | ||
diff --git a/arch/arm/mach-ep93xx/include/mach/hardware.h b/arch/arm/mach-ep93xx/include/mach/hardware.h index 529807d182bf..2866297310b7 100644 --- a/arch/arm/mach-ep93xx/include/mach/hardware.h +++ b/arch/arm/mach-ep93xx/include/mach/hardware.h | |||
@@ -10,7 +10,6 @@ | |||
10 | 10 | ||
11 | #include "platform.h" | 11 | #include "platform.h" |
12 | 12 | ||
13 | #include "gesbc9312.h" | ||
14 | #include "ts72xx.h" | 13 | #include "ts72xx.h" |
15 | 14 | ||
16 | #endif | 15 | #endif |
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index 88f7e88f152f..05f0f4f2f3ce 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h | |||
@@ -4,6 +4,8 @@ | |||
4 | 4 | ||
5 | #ifndef __ASSEMBLY__ | 5 | #ifndef __ASSEMBLY__ |
6 | 6 | ||
7 | struct i2c_board_info; | ||
8 | |||
7 | struct ep93xx_eth_data | 9 | struct ep93xx_eth_data |
8 | { | 10 | { |
9 | unsigned char dev_addr[6]; | 11 | unsigned char dev_addr[6]; |
diff --git a/arch/arm/mach-ep93xx/include/mach/system.h b/arch/arm/mach-ep93xx/include/mach/system.h index 67789d0f329e..ed8f35e4f068 100644 --- a/arch/arm/mach-ep93xx/include/mach/system.h +++ b/arch/arm/mach-ep93xx/include/mach/system.h | |||
@@ -9,7 +9,7 @@ static inline void arch_idle(void) | |||
9 | cpu_do_idle(); | 9 | cpu_do_idle(); |
10 | } | 10 | } |
11 | 11 | ||
12 | static inline void arch_reset(char mode) | 12 | static inline void arch_reset(char mode, const char *cmd) |
13 | { | 13 | { |
14 | u32 devicecfg; | 14 | u32 devicecfg; |
15 | 15 | ||
diff --git a/arch/arm/mach-footbridge/include/mach/system.h b/arch/arm/mach-footbridge/include/mach/system.h index 2db7f36bd6ca..0b2931566209 100644 --- a/arch/arm/mach-footbridge/include/mach/system.h +++ b/arch/arm/mach-footbridge/include/mach/system.h | |||
@@ -18,7 +18,7 @@ static inline void arch_idle(void) | |||
18 | cpu_do_idle(); | 18 | cpu_do_idle(); |
19 | } | 19 | } |
20 | 20 | ||
21 | static inline void arch_reset(char mode) | 21 | static inline void arch_reset(char mode, const char *cmd) |
22 | { | 22 | { |
23 | if (mode == 's') { | 23 | if (mode == 's') { |
24 | /* | 24 | /* |
diff --git a/arch/arm/mach-h720x/include/mach/system.h b/arch/arm/mach-h720x/include/mach/system.h index e4a7c760d52a..a708d24ee46d 100644 --- a/arch/arm/mach-h720x/include/mach/system.h +++ b/arch/arm/mach-h720x/include/mach/system.h | |||
@@ -25,7 +25,7 @@ static void arch_idle(void) | |||
25 | } | 25 | } |
26 | 26 | ||
27 | 27 | ||
28 | static __inline__ void arch_reset(char mode) | 28 | static __inline__ void arch_reset(char mode, const char *cmd) |
29 | { | 29 | { |
30 | CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET; | 30 | CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET; |
31 | } | 31 | } |
diff --git a/arch/arm/mach-imx/include/mach/system.h b/arch/arm/mach-imx/include/mach/system.h index adee7e51bab2..46d4ca91af79 100644 --- a/arch/arm/mach-imx/include/mach/system.h +++ b/arch/arm/mach-imx/include/mach/system.h | |||
@@ -32,7 +32,7 @@ arch_idle(void) | |||
32 | } | 32 | } |
33 | 33 | ||
34 | static inline void | 34 | static inline void |
35 | arch_reset(char mode) | 35 | arch_reset(char mode, const char *cmd) |
36 | { | 36 | { |
37 | cpu_reset(0); | 37 | cpu_reset(0); |
38 | } | 38 | } |
diff --git a/arch/arm/mach-integrator/include/mach/system.h b/arch/arm/mach-integrator/include/mach/system.h index c485345c8c77..e1551b8dab77 100644 --- a/arch/arm/mach-integrator/include/mach/system.h +++ b/arch/arm/mach-integrator/include/mach/system.h | |||
@@ -32,7 +32,7 @@ static inline void arch_idle(void) | |||
32 | cpu_do_idle(); | 32 | cpu_do_idle(); |
33 | } | 33 | } |
34 | 34 | ||
35 | static inline void arch_reset(char mode) | 35 | static inline void arch_reset(char mode, const char *cmd) |
36 | { | 36 | { |
37 | /* | 37 | /* |
38 | * To reset, we hit the on-board reset register | 38 | * To reset, we hit the on-board reset register |
diff --git a/arch/arm/mach-iop13xx/include/mach/system.h b/arch/arm/mach-iop13xx/include/mach/system.h index c7127f416e1f..d0c66ef450a7 100644 --- a/arch/arm/mach-iop13xx/include/mach/system.h +++ b/arch/arm/mach-iop13xx/include/mach/system.h | |||
@@ -13,7 +13,7 @@ static inline void arch_idle(void) | |||
13 | cpu_do_idle(); | 13 | cpu_do_idle(); |
14 | } | 14 | } |
15 | 15 | ||
16 | static inline void arch_reset(char mode) | 16 | static inline void arch_reset(char mode, const char *cmd) |
17 | { | 17 | { |
18 | /* | 18 | /* |
19 | * Reset the internal bus (warning both cores are reset) | 19 | * Reset the internal bus (warning both cores are reset) |
diff --git a/arch/arm/mach-iop32x/include/mach/system.h b/arch/arm/mach-iop32x/include/mach/system.h index 32d9e5b0a28d..a4b808fe0d81 100644 --- a/arch/arm/mach-iop32x/include/mach/system.h +++ b/arch/arm/mach-iop32x/include/mach/system.h | |||
@@ -16,7 +16,7 @@ static inline void arch_idle(void) | |||
16 | cpu_do_idle(); | 16 | cpu_do_idle(); |
17 | } | 17 | } |
18 | 18 | ||
19 | static inline void arch_reset(char mode) | 19 | static inline void arch_reset(char mode, const char *cmd) |
20 | { | 20 | { |
21 | local_irq_disable(); | 21 | local_irq_disable(); |
22 | 22 | ||
diff --git a/arch/arm/mach-iop33x/include/mach/system.h b/arch/arm/mach-iop33x/include/mach/system.h index 0cb3ad862acd..f192a34be073 100644 --- a/arch/arm/mach-iop33x/include/mach/system.h +++ b/arch/arm/mach-iop33x/include/mach/system.h | |||
@@ -14,7 +14,7 @@ static inline void arch_idle(void) | |||
14 | cpu_do_idle(); | 14 | cpu_do_idle(); |
15 | } | 15 | } |
16 | 16 | ||
17 | static inline void arch_reset(char mode) | 17 | static inline void arch_reset(char mode, const char *cmd) |
18 | { | 18 | { |
19 | *IOP3XX_PCSR = 0x30; | 19 | *IOP3XX_PCSR = 0x30; |
20 | 20 | ||
diff --git a/arch/arm/mach-ixp2000/include/mach/system.h b/arch/arm/mach-ixp2000/include/mach/system.h index 2e9c68f95a24..de370992c848 100644 --- a/arch/arm/mach-ixp2000/include/mach/system.h +++ b/arch/arm/mach-ixp2000/include/mach/system.h | |||
@@ -17,7 +17,7 @@ static inline void arch_idle(void) | |||
17 | cpu_do_idle(); | 17 | cpu_do_idle(); |
18 | } | 18 | } |
19 | 19 | ||
20 | static inline void arch_reset(char mode) | 20 | static inline void arch_reset(char mode, const char *cmd) |
21 | { | 21 | { |
22 | local_irq_disable(); | 22 | local_irq_disable(); |
23 | 23 | ||
diff --git a/arch/arm/mach-ixp23xx/include/mach/system.h b/arch/arm/mach-ixp23xx/include/mach/system.h index d57c3fc10f1f..8920ff2dff1f 100644 --- a/arch/arm/mach-ixp23xx/include/mach/system.h +++ b/arch/arm/mach-ixp23xx/include/mach/system.h | |||
@@ -19,7 +19,7 @@ static inline void arch_idle(void) | |||
19 | #endif | 19 | #endif |
20 | } | 20 | } |
21 | 21 | ||
22 | static inline void arch_reset(char mode) | 22 | static inline void arch_reset(char mode, const char *cmd) |
23 | { | 23 | { |
24 | /* First try machine specific support */ | 24 | /* First try machine specific support */ |
25 | if (machine_is_ixdp2351()) { | 25 | if (machine_is_ixdp2351()) { |
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c index d816c51320c7..70afcfe5b881 100644 --- a/arch/arm/mach-ixp4xx/common-pci.c +++ b/arch/arm/mach-ixp4xx/common-pci.c | |||
@@ -366,7 +366,7 @@ void __init ixp4xx_adjust_zones(int node, unsigned long *zone_size, | |||
366 | } | 366 | } |
367 | 367 | ||
368 | void __init ixp4xx_pci_preinit(void) | 368 | void __init ixp4xx_pci_preinit(void) |
369 | { | 369 | { |
370 | unsigned long cpuid = read_cpuid_id(); | 370 | unsigned long cpuid = read_cpuid_id(); |
371 | 371 | ||
372 | /* | 372 | /* |
@@ -386,17 +386,17 @@ void __init ixp4xx_pci_preinit(void) | |||
386 | 386 | ||
387 | pr_debug("setup PCI-AHB(inbound) and AHB-PCI(outbound) address mappings\n"); | 387 | pr_debug("setup PCI-AHB(inbound) and AHB-PCI(outbound) address mappings\n"); |
388 | 388 | ||
389 | /* | 389 | /* |
390 | * We use identity AHB->PCI address translation | 390 | * We use identity AHB->PCI address translation |
391 | * in the 0x48000000 to 0x4bffffff address space | 391 | * in the 0x48000000 to 0x4bffffff address space |
392 | */ | 392 | */ |
393 | *PCI_PCIMEMBASE = 0x48494A4B; | 393 | *PCI_PCIMEMBASE = 0x48494A4B; |
394 | 394 | ||
395 | /* | 395 | /* |
396 | * We also use identity PCI->AHB address translation | 396 | * We also use identity PCI->AHB address translation |
397 | * in 4 16MB BARs that begin at the physical memory start | 397 | * in 4 16MB BARs that begin at the physical memory start |
398 | */ | 398 | */ |
399 | *PCI_AHBMEMBASE = (PHYS_OFFSET & 0xFF000000) + | 399 | *PCI_AHBMEMBASE = (PHYS_OFFSET & 0xFF000000) + |
400 | ((PHYS_OFFSET & 0xFF000000) >> 8) + | 400 | ((PHYS_OFFSET & 0xFF000000) >> 8) + |
401 | ((PHYS_OFFSET & 0xFF000000) >> 16) + | 401 | ((PHYS_OFFSET & 0xFF000000) >> 16) + |
402 | ((PHYS_OFFSET & 0xFF000000) >> 24) + | 402 | ((PHYS_OFFSET & 0xFF000000) >> 24) + |
@@ -408,18 +408,19 @@ void __init ixp4xx_pci_preinit(void) | |||
408 | pr_debug("setup BARs in controller\n"); | 408 | pr_debug("setup BARs in controller\n"); |
409 | 409 | ||
410 | /* | 410 | /* |
411 | * We configure the PCI inbound memory windows to be | 411 | * We configure the PCI inbound memory windows to be |
412 | * 1:1 mapped to SDRAM | 412 | * 1:1 mapped to SDRAM |
413 | */ | 413 | */ |
414 | local_write_config(PCI_BASE_ADDRESS_0, 4, PHYS_OFFSET + 0x00000000); | 414 | local_write_config(PCI_BASE_ADDRESS_0, 4, PHYS_OFFSET); |
415 | local_write_config(PCI_BASE_ADDRESS_1, 4, PHYS_OFFSET + 0x01000000); | 415 | local_write_config(PCI_BASE_ADDRESS_1, 4, PHYS_OFFSET + SZ_16M); |
416 | local_write_config(PCI_BASE_ADDRESS_2, 4, PHYS_OFFSET + 0x02000000); | 416 | local_write_config(PCI_BASE_ADDRESS_2, 4, PHYS_OFFSET + SZ_32M); |
417 | local_write_config(PCI_BASE_ADDRESS_3, 4, PHYS_OFFSET + 0x03000000); | 417 | local_write_config(PCI_BASE_ADDRESS_3, 4, PHYS_OFFSET + SZ_48M); |
418 | 418 | ||
419 | /* | 419 | /* |
420 | * Enable CSR window at 0xff000000. | 420 | * Enable CSR window at 64 MiB to allow PCI masters |
421 | * to continue prefetching past 64 MiB boundary. | ||
421 | */ | 422 | */ |
422 | local_write_config(PCI_BASE_ADDRESS_4, 4, 0xff000008); | 423 | local_write_config(PCI_BASE_ADDRESS_4, 4, PHYS_OFFSET + SZ_64M); |
423 | 424 | ||
424 | /* | 425 | /* |
425 | * Enable the IO window to be way up high, at 0xfffffc00 | 426 | * Enable the IO window to be way up high, at 0xfffffc00 |
@@ -500,7 +501,7 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys) | |||
500 | return 1; | 501 | return 1; |
501 | } | 502 | } |
502 | 503 | ||
503 | struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys) | 504 | struct pci_bus * __devinit ixp4xx_scan_bus(int nr, struct pci_sys_data *sys) |
504 | { | 505 | { |
505 | return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys); | 506 | return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys); |
506 | } | 507 | } |
diff --git a/arch/arm/mach-ixp4xx/include/mach/cpu.h b/arch/arm/mach-ixp4xx/include/mach/cpu.h index 51bd69c46d94..def7773be67c 100644 --- a/arch/arm/mach-ixp4xx/include/mach/cpu.h +++ b/arch/arm/mach-ixp4xx/include/mach/cpu.h | |||
@@ -17,26 +17,31 @@ | |||
17 | #include <asm/cputype.h> | 17 | #include <asm/cputype.h> |
18 | 18 | ||
19 | /* Processor id value in CP15 Register 0 */ | 19 | /* Processor id value in CP15 Register 0 */ |
20 | #define IXP425_PROCESSOR_ID_VALUE 0x690541c0 | 20 | #define IXP42X_PROCESSOR_ID_VALUE 0x690541c0 /* including unused 0x690541Ex */ |
21 | #define IXP435_PROCESSOR_ID_VALUE 0x69054040 | 21 | #define IXP42X_PROCESSOR_ID_MASK 0xffffffc0 |
22 | #define IXP465_PROCESSOR_ID_VALUE 0x69054200 | 22 | |
23 | #define IXP4XX_PROCESSOR_ID_MASK 0xfffffff0 | 23 | #define IXP43X_PROCESSOR_ID_VALUE 0x69054040 |
24 | 24 | #define IXP43X_PROCESSOR_ID_MASK 0xfffffff0 | |
25 | #define cpu_is_ixp42x() ((read_cpuid_id() & IXP4XX_PROCESSOR_ID_MASK) == \ | 25 | |
26 | IXP425_PROCESSOR_ID_VALUE) | 26 | #define IXP46X_PROCESSOR_ID_VALUE 0x69054200 /* including IXP455 */ |
27 | #define cpu_is_ixp43x() ((read_cpuid_id() & IXP4XX_PROCESSOR_ID_MASK) == \ | 27 | #define IXP46X_PROCESSOR_ID_MASK 0xfffffff0 |
28 | IXP435_PROCESSOR_ID_VALUE) | 28 | |
29 | #define cpu_is_ixp46x() ((read_cpuid_id() & IXP4XX_PROCESSOR_ID_MASK) == \ | 29 | #define cpu_is_ixp42x() ((read_cpuid_id() & IXP42X_PROCESSOR_ID_MASK) == \ |
30 | IXP465_PROCESSOR_ID_VALUE) | 30 | IXP42X_PROCESSOR_ID_VALUE) |
31 | #define cpu_is_ixp43x() ((read_cpuid_id() & IXP43X_PROCESSOR_ID_MASK) == \ | ||
32 | IXP43X_PROCESSOR_ID_VALUE) | ||
33 | #define cpu_is_ixp46x() ((read_cpuid_id() & IXP46X_PROCESSOR_ID_MASK) == \ | ||
34 | IXP46X_PROCESSOR_ID_VALUE) | ||
31 | 35 | ||
32 | static inline u32 ixp4xx_read_feature_bits(void) | 36 | static inline u32 ixp4xx_read_feature_bits(void) |
33 | { | 37 | { |
34 | unsigned int val = ~*IXP4XX_EXP_CFG2; | 38 | unsigned int val = ~*IXP4XX_EXP_CFG2; |
35 | val &= ~IXP4XX_FEATURE_RESERVED; | ||
36 | if (!cpu_is_ixp46x()) | ||
37 | val &= ~IXP4XX_FEATURE_IXP46X_ONLY; | ||
38 | 39 | ||
39 | return val; | 40 | if (cpu_is_ixp42x()) |
41 | return val & IXP42X_FEATURE_MASK; | ||
42 | if (cpu_is_ixp43x()) | ||
43 | return val & IXP43X_FEATURE_MASK; | ||
44 | return val & IXP46X_FEATURE_MASK; | ||
40 | } | 45 | } |
41 | 46 | ||
42 | static inline void ixp4xx_write_feature_bits(u32 value) | 47 | static inline void ixp4xx_write_feature_bits(u32 value) |
diff --git a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h index ad9c888dd850..97c530f66e78 100644 --- a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h +++ b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h | |||
@@ -604,6 +604,7 @@ | |||
604 | #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ | 604 | #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ |
605 | 605 | ||
606 | /* "fuse" bits of IXP_EXP_CFG2 */ | 606 | /* "fuse" bits of IXP_EXP_CFG2 */ |
607 | /* All IXP4xx CPUs */ | ||
607 | #define IXP4XX_FEATURE_RCOMP (1 << 0) | 608 | #define IXP4XX_FEATURE_RCOMP (1 << 0) |
608 | #define IXP4XX_FEATURE_USB_DEVICE (1 << 1) | 609 | #define IXP4XX_FEATURE_USB_DEVICE (1 << 1) |
609 | #define IXP4XX_FEATURE_HASH (1 << 2) | 610 | #define IXP4XX_FEATURE_HASH (1 << 2) |
@@ -619,20 +620,41 @@ | |||
619 | #define IXP4XX_FEATURE_RESET_NPEB (1 << 12) | 620 | #define IXP4XX_FEATURE_RESET_NPEB (1 << 12) |
620 | #define IXP4XX_FEATURE_RESET_NPEC (1 << 13) | 621 | #define IXP4XX_FEATURE_RESET_NPEC (1 << 13) |
621 | #define IXP4XX_FEATURE_PCI (1 << 14) | 622 | #define IXP4XX_FEATURE_PCI (1 << 14) |
622 | #define IXP4XX_FEATURE_ECC_TIMESYNC (1 << 15) | ||
623 | #define IXP4XX_FEATURE_UTOPIA_PHY_LIMIT (3 << 16) | 623 | #define IXP4XX_FEATURE_UTOPIA_PHY_LIMIT (3 << 16) |
624 | #define IXP4XX_FEATURE_XSCALE_MAX_FREQ (3 << 22) | ||
625 | #define IXP42X_FEATURE_MASK (IXP4XX_FEATURE_RCOMP | \ | ||
626 | IXP4XX_FEATURE_USB_DEVICE | \ | ||
627 | IXP4XX_FEATURE_HASH | \ | ||
628 | IXP4XX_FEATURE_AES | \ | ||
629 | IXP4XX_FEATURE_DES | \ | ||
630 | IXP4XX_FEATURE_HDLC | \ | ||
631 | IXP4XX_FEATURE_AAL | \ | ||
632 | IXP4XX_FEATURE_HSS | \ | ||
633 | IXP4XX_FEATURE_UTOPIA | \ | ||
634 | IXP4XX_FEATURE_NPEB_ETH0 | \ | ||
635 | IXP4XX_FEATURE_NPEC_ETH | \ | ||
636 | IXP4XX_FEATURE_RESET_NPEA | \ | ||
637 | IXP4XX_FEATURE_RESET_NPEB | \ | ||
638 | IXP4XX_FEATURE_RESET_NPEC | \ | ||
639 | IXP4XX_FEATURE_PCI | \ | ||
640 | IXP4XX_FEATURE_UTOPIA_PHY_LIMIT | \ | ||
641 | IXP4XX_FEATURE_XSCALE_MAX_FREQ) | ||
642 | |||
643 | |||
644 | /* IXP43x/46x CPUs */ | ||
645 | #define IXP4XX_FEATURE_ECC_TIMESYNC (1 << 15) | ||
624 | #define IXP4XX_FEATURE_USB_HOST (1 << 18) | 646 | #define IXP4XX_FEATURE_USB_HOST (1 << 18) |
625 | #define IXP4XX_FEATURE_NPEA_ETH (1 << 19) | 647 | #define IXP4XX_FEATURE_NPEA_ETH (1 << 19) |
648 | #define IXP43X_FEATURE_MASK (IXP42X_FEATURE_MASK | \ | ||
649 | IXP4XX_FEATURE_ECC_TIMESYNC | \ | ||
650 | IXP4XX_FEATURE_USB_HOST | \ | ||
651 | IXP4XX_FEATURE_NPEA_ETH) | ||
652 | |||
653 | /* IXP46x CPU (including IXP455) only */ | ||
626 | #define IXP4XX_FEATURE_NPEB_ETH_1_TO_3 (1 << 20) | 654 | #define IXP4XX_FEATURE_NPEB_ETH_1_TO_3 (1 << 20) |
627 | #define IXP4XX_FEATURE_RSA (1 << 21) | 655 | #define IXP4XX_FEATURE_RSA (1 << 21) |
628 | #define IXP4XX_FEATURE_XSCALE_MAX_FREQ (3 << 22) | 656 | #define IXP46X_FEATURE_MASK (IXP43X_FEATURE_MASK | \ |
629 | #define IXP4XX_FEATURE_RESERVED (0xFF << 24) | 657 | IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \ |
630 | 658 | IXP4XX_FEATURE_RSA) | |
631 | #define IXP4XX_FEATURE_IXP46X_ONLY (IXP4XX_FEATURE_ECC_TIMESYNC | \ | ||
632 | IXP4XX_FEATURE_USB_HOST | \ | ||
633 | IXP4XX_FEATURE_NPEA_ETH | \ | ||
634 | IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \ | ||
635 | IXP4XX_FEATURE_RSA | \ | ||
636 | IXP4XX_FEATURE_XSCALE_MAX_FREQ) | ||
637 | 659 | ||
638 | #endif | 660 | #endif |
diff --git a/arch/arm/mach-ixp4xx/include/mach/system.h b/arch/arm/mach-ixp4xx/include/mach/system.h index 92a7e8ddf69a..d2aa26f5acd7 100644 --- a/arch/arm/mach-ixp4xx/include/mach/system.h +++ b/arch/arm/mach-ixp4xx/include/mach/system.h | |||
@@ -20,7 +20,7 @@ static inline void arch_idle(void) | |||
20 | } | 20 | } |
21 | 21 | ||
22 | 22 | ||
23 | static inline void arch_reset(char mode) | 23 | static inline void arch_reset(char mode, const char *cmd) |
24 | { | 24 | { |
25 | if ( 1 && mode == 's') { | 25 | if ( 1 && mode == 's') { |
26 | /* Jump into ROM at address 0 */ | 26 | /* Jump into ROM at address 0 */ |
diff --git a/arch/arm/mach-ixp4xx/ixp4xx_npe.c b/arch/arm/mach-ixp4xx/ixp4xx_npe.c index c73a94d0ca2b..252310234903 100644 --- a/arch/arm/mach-ixp4xx/ixp4xx_npe.c +++ b/arch/arm/mach-ixp4xx/ixp4xx_npe.c | |||
@@ -575,8 +575,8 @@ int npe_load_firmware(struct npe *npe, const char *name, struct device *dev) | |||
575 | for (i = 0; i < image->size; i++) | 575 | for (i = 0; i < image->size; i++) |
576 | image->data[i] = swab32(image->data[i]); | 576 | image->data[i] = swab32(image->data[i]); |
577 | 577 | ||
578 | if (!cpu_is_ixp46x() && ((image->id >> 28) & 0xF /* device ID */)) { | 578 | if (cpu_is_ixp42x() && ((image->id >> 28) & 0xF /* device ID */)) { |
579 | print_npe(KERN_INFO, npe, "IXP46x firmware ignored on " | 579 | print_npe(KERN_INFO, npe, "IXP43x/IXP46x firmware ignored on " |
580 | "IXP42x\n"); | 580 | "IXP42x\n"); |
581 | goto err; | 581 | goto err; |
582 | } | 582 | } |
@@ -596,7 +596,7 @@ int npe_load_firmware(struct npe *npe, const char *name, struct device *dev) | |||
596 | "revision 0x%X:%X\n", (image->id >> 16) & 0xFF, | 596 | "revision 0x%X:%X\n", (image->id >> 16) & 0xFF, |
597 | (image->id >> 8) & 0xFF, image->id & 0xFF); | 597 | (image->id >> 8) & 0xFF, image->id & 0xFF); |
598 | 598 | ||
599 | if (!cpu_is_ixp46x()) { | 599 | if (cpu_is_ixp42x()) { |
600 | if (!npe->id) | 600 | if (!npe->id) |
601 | instr_size = NPE_A_42X_INSTR_SIZE; | 601 | instr_size = NPE_A_42X_INSTR_SIZE; |
602 | else | 602 | else |
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 3600cd9f0519..532443622a17 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig | |||
@@ -20,6 +20,12 @@ config MACH_RD88F6281 | |||
20 | Say 'Y' here if you want your kernel to support the | 20 | Say 'Y' here if you want your kernel to support the |
21 | Marvell RD-88F6281 Reference Board. | 21 | Marvell RD-88F6281 Reference Board. |
22 | 22 | ||
23 | config MACH_SHEEVAPLUG | ||
24 | bool "Marvell SheevaPlug Reference Board" | ||
25 | help | ||
26 | Say 'Y' here if you want your kernel to support the | ||
27 | Marvell SheevaPlug Reference Board. | ||
28 | |||
23 | endmenu | 29 | endmenu |
24 | 30 | ||
25 | endif | 31 | endif |
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index b96c55dad343..de81b4b5bd33 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
@@ -1,5 +1,6 @@ | |||
1 | obj-y += common.o addr-map.o irq.o pcie.o | 1 | obj-y += common.o addr-map.o irq.o pcie.o mpp.o |
2 | 2 | ||
3 | obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o | 3 | obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o |
4 | obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o | 4 | obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o |
5 | obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o | 5 | obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o |
6 | obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o | ||
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index b3404b7775b3..9f012551794d 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <mach/kirkwood.h> | 24 | #include <mach/kirkwood.h> |
25 | #include <plat/cache-feroceon-l2.h> | 25 | #include <plat/cache-feroceon-l2.h> |
26 | #include <plat/ehci-orion.h> | 26 | #include <plat/ehci-orion.h> |
27 | #include <plat/mvsdio.h> | ||
27 | #include <plat/mv_xor.h> | 28 | #include <plat/mv_xor.h> |
28 | #include <plat/orion_nand.h> | 29 | #include <plat/orion_nand.h> |
29 | #include <plat/time.h> | 30 | #include <plat/time.h> |
@@ -254,7 +255,7 @@ static struct resource kirkwood_rtc_resource = { | |||
254 | .flags = IORESOURCE_MEM, | 255 | .flags = IORESOURCE_MEM, |
255 | }; | 256 | }; |
256 | 257 | ||
257 | void __init kirkwood_rtc_init(void) | 258 | static void __init kirkwood_rtc_init(void) |
258 | { | 259 | { |
259 | platform_device_register_simple("rtc-mv", -1, &kirkwood_rtc_resource, 1); | 260 | platform_device_register_simple("rtc-mv", -1, &kirkwood_rtc_resource, 1); |
260 | } | 261 | } |
@@ -296,6 +297,50 @@ void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data) | |||
296 | 297 | ||
297 | 298 | ||
298 | /***************************************************************************** | 299 | /***************************************************************************** |
300 | * SD/SDIO/MMC | ||
301 | ****************************************************************************/ | ||
302 | static struct resource mvsdio_resources[] = { | ||
303 | [0] = { | ||
304 | .start = SDIO_PHYS_BASE, | ||
305 | .end = SDIO_PHYS_BASE + SZ_1K - 1, | ||
306 | .flags = IORESOURCE_MEM, | ||
307 | }, | ||
308 | [1] = { | ||
309 | .start = IRQ_KIRKWOOD_SDIO, | ||
310 | .end = IRQ_KIRKWOOD_SDIO, | ||
311 | .flags = IORESOURCE_IRQ, | ||
312 | }, | ||
313 | }; | ||
314 | |||
315 | static u64 mvsdio_dmamask = 0xffffffffUL; | ||
316 | |||
317 | static struct platform_device kirkwood_sdio = { | ||
318 | .name = "mvsdio", | ||
319 | .id = -1, | ||
320 | .dev = { | ||
321 | .dma_mask = &mvsdio_dmamask, | ||
322 | .coherent_dma_mask = 0xffffffff, | ||
323 | }, | ||
324 | .num_resources = ARRAY_SIZE(mvsdio_resources), | ||
325 | .resource = mvsdio_resources, | ||
326 | }; | ||
327 | |||
328 | void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data) | ||
329 | { | ||
330 | u32 dev, rev; | ||
331 | |||
332 | kirkwood_pcie_id(&dev, &rev); | ||
333 | if (rev == 0) /* catch all Kirkwood Z0's */ | ||
334 | mvsdio_data->clock = 100000000; | ||
335 | else | ||
336 | mvsdio_data->clock = 200000000; | ||
337 | mvsdio_data->dram = &kirkwood_mbus_dram_info; | ||
338 | kirkwood_sdio.dev.platform_data = mvsdio_data; | ||
339 | platform_device_register(&kirkwood_sdio); | ||
340 | } | ||
341 | |||
342 | |||
343 | /***************************************************************************** | ||
299 | * SPI | 344 | * SPI |
300 | ****************************************************************************/ | 345 | ****************************************************************************/ |
301 | static struct orion_spi_info kirkwood_spi_plat_data = { | 346 | static struct orion_spi_info kirkwood_spi_plat_data = { |
@@ -502,7 +547,7 @@ static struct platform_device kirkwood_xor01_channel = { | |||
502 | }, | 547 | }, |
503 | }; | 548 | }; |
504 | 549 | ||
505 | void __init kirkwood_xor0_init(void) | 550 | static void __init kirkwood_xor0_init(void) |
506 | { | 551 | { |
507 | platform_device_register(&kirkwood_xor0_shared); | 552 | platform_device_register(&kirkwood_xor0_shared); |
508 | 553 | ||
@@ -600,7 +645,7 @@ static struct platform_device kirkwood_xor11_channel = { | |||
600 | }, | 645 | }, |
601 | }; | 646 | }; |
602 | 647 | ||
603 | void __init kirkwood_xor1_init(void) | 648 | static void __init kirkwood_xor1_init(void) |
604 | { | 649 | { |
605 | platform_device_register(&kirkwood_xor1_shared); | 650 | platform_device_register(&kirkwood_xor1_shared); |
606 | 651 | ||
@@ -708,4 +753,9 @@ void __init kirkwood_init(void) | |||
708 | #ifdef CONFIG_CACHE_FEROCEON_L2 | 753 | #ifdef CONFIG_CACHE_FEROCEON_L2 |
709 | kirkwood_l2_init(); | 754 | kirkwood_l2_init(); |
710 | #endif | 755 | #endif |
756 | |||
757 | /* internal devices that every board has */ | ||
758 | kirkwood_rtc_init(); | ||
759 | kirkwood_xor0_init(); | ||
760 | kirkwood_xor1_init(); | ||
711 | } | 761 | } |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index fe367c18e722..9e5282684d58 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -14,6 +14,7 @@ | |||
14 | struct dsa_platform_data; | 14 | struct dsa_platform_data; |
15 | struct mv643xx_eth_platform_data; | 15 | struct mv643xx_eth_platform_data; |
16 | struct mv_sata_platform_data; | 16 | struct mv_sata_platform_data; |
17 | struct mvsdio_platform_data; | ||
17 | 18 | ||
18 | /* | 19 | /* |
19 | * Basic Kirkwood init functions used early by machine-setup. | 20 | * Basic Kirkwood init functions used early by machine-setup. |
@@ -33,13 +34,11 @@ void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data); | |||
33 | void kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data); | 34 | void kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data); |
34 | void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq); | 35 | void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq); |
35 | void kirkwood_pcie_init(void); | 36 | void kirkwood_pcie_init(void); |
36 | void kirkwood_rtc_init(void); | ||
37 | void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); | 37 | void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); |
38 | void kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data); | ||
38 | void kirkwood_spi_init(void); | 39 | void kirkwood_spi_init(void); |
39 | void kirkwood_uart0_init(void); | 40 | void kirkwood_uart0_init(void); |
40 | void kirkwood_uart1_init(void); | 41 | void kirkwood_uart1_init(void); |
41 | void kirkwood_xor0_init(void); | ||
42 | void kirkwood_xor1_init(void); | ||
43 | 42 | ||
44 | extern struct sys_timer kirkwood_timer; | 43 | extern struct sys_timer kirkwood_timer; |
45 | 44 | ||
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c index a14c2948c62a..5505d5837752 100644 --- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c +++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c | |||
@@ -11,18 +11,59 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/pci.h> | ||
15 | #include <linux/irq.h> | ||
16 | #include <linux/mtd/physmap.h> | ||
17 | #include <linux/mtd/nand.h> | 14 | #include <linux/mtd/nand.h> |
18 | #include <linux/timer.h> | 15 | #include <linux/mtd/partitions.h> |
19 | #include <linux/ata_platform.h> | 16 | #include <linux/ata_platform.h> |
20 | #include <linux/mv643xx_eth.h> | 17 | #include <linux/mv643xx_eth.h> |
21 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
22 | #include <asm/mach/arch.h> | 19 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/pci.h> | ||
24 | #include <mach/kirkwood.h> | 20 | #include <mach/kirkwood.h> |
21 | #include <plat/orion_nand.h> | ||
22 | #include <plat/mvsdio.h> | ||
25 | #include "common.h" | 23 | #include "common.h" |
24 | #include "mpp.h" | ||
25 | |||
26 | static struct mtd_partition db88f6281_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 resource db88f6281_nand_resource = { | ||
43 | .flags = IORESOURCE_MEM, | ||
44 | .start = KIRKWOOD_NAND_MEM_PHYS_BASE, | ||
45 | .end = KIRKWOOD_NAND_MEM_PHYS_BASE + | ||
46 | KIRKWOOD_NAND_MEM_SIZE - 1, | ||
47 | }; | ||
48 | |||
49 | static struct orion_nand_data db88f6281_nand_data = { | ||
50 | .parts = db88f6281_nand_parts, | ||
51 | .nr_parts = ARRAY_SIZE(db88f6281_nand_parts), | ||
52 | .cle = 0, | ||
53 | .ale = 1, | ||
54 | .width = 8, | ||
55 | .chip_delay = 25, | ||
56 | }; | ||
57 | |||
58 | static struct platform_device db88f6281_nand_flash = { | ||
59 | .name = "orion_nand", | ||
60 | .id = -1, | ||
61 | .dev = { | ||
62 | .platform_data = &db88f6281_nand_data, | ||
63 | }, | ||
64 | .resource = &db88f6281_nand_resource, | ||
65 | .num_resources = 1, | ||
66 | }; | ||
26 | 67 | ||
27 | static struct mv643xx_eth_platform_data db88f6281_ge00_data = { | 68 | static struct mv643xx_eth_platform_data db88f6281_ge00_data = { |
28 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | 69 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), |
@@ -32,18 +73,32 @@ static struct mv_sata_platform_data db88f6281_sata_data = { | |||
32 | .n_ports = 2, | 73 | .n_ports = 2, |
33 | }; | 74 | }; |
34 | 75 | ||
76 | static struct mvsdio_platform_data db88f6281_mvsdio_data = { | ||
77 | .gpio_write_protect = 37, | ||
78 | .gpio_card_detect = 38, | ||
79 | }; | ||
80 | |||
81 | static unsigned int db88f6281_mpp_config[] __initdata = { | ||
82 | MPP37_GPIO, | ||
83 | MPP38_GPIO, | ||
84 | 0 | ||
85 | }; | ||
86 | |||
35 | static void __init db88f6281_init(void) | 87 | static void __init db88f6281_init(void) |
36 | { | 88 | { |
37 | /* | 89 | /* |
38 | * Basic setup. Needs to be called early. | 90 | * Basic setup. Needs to be called early. |
39 | */ | 91 | */ |
40 | kirkwood_init(); | 92 | kirkwood_init(); |
93 | kirkwood_mpp_conf(db88f6281_mpp_config); | ||
41 | 94 | ||
42 | kirkwood_ehci_init(); | 95 | kirkwood_ehci_init(); |
43 | kirkwood_ge00_init(&db88f6281_ge00_data); | 96 | kirkwood_ge00_init(&db88f6281_ge00_data); |
44 | kirkwood_rtc_init(); | ||
45 | kirkwood_sata_init(&db88f6281_sata_data); | 97 | kirkwood_sata_init(&db88f6281_sata_data); |
46 | kirkwood_uart0_init(); | 98 | kirkwood_uart0_init(); |
99 | kirkwood_sdio_init(&db88f6281_mvsdio_data); | ||
100 | |||
101 | platform_device_register(&db88f6281_nand_flash); | ||
47 | } | 102 | } |
48 | 103 | ||
49 | static int __init db88f6281_pci_init(void) | 104 | static int __init db88f6281_pci_init(void) |
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index ada480c0e197..d3db30fe763b 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h | |||
@@ -116,5 +116,7 @@ | |||
116 | 116 | ||
117 | #define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000) | 117 | #define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000) |
118 | 118 | ||
119 | #define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x90000) | ||
120 | |||
119 | 121 | ||
120 | #endif | 122 | #endif |
diff --git a/arch/arm/mach-kirkwood/include/mach/system.h b/arch/arm/mach-kirkwood/include/mach/system.h index 8510f6cfdabf..23a1914c1da8 100644 --- a/arch/arm/mach-kirkwood/include/mach/system.h +++ b/arch/arm/mach-kirkwood/include/mach/system.h | |||
@@ -17,7 +17,7 @@ static inline void arch_idle(void) | |||
17 | cpu_do_idle(); | 17 | cpu_do_idle(); |
18 | } | 18 | } |
19 | 19 | ||
20 | static inline void arch_reset(char mode) | 20 | static inline void arch_reset(char mode, const char *cmd) |
21 | { | 21 | { |
22 | /* | 22 | /* |
23 | * Enable soft reset to assert RSTOUTn. | 23 | * Enable soft reset to assert RSTOUTn. |
diff --git a/arch/arm/mach-kirkwood/irq.c b/arch/arm/mach-kirkwood/irq.c index efb86b700276..06083b23bb44 100644 --- a/arch/arm/mach-kirkwood/irq.c +++ b/arch/arm/mach-kirkwood/irq.c | |||
@@ -42,7 +42,7 @@ void __init kirkwood_init_irq(void) | |||
42 | writel(0, GPIO_EDGE_CAUSE(32)); | 42 | writel(0, GPIO_EDGE_CAUSE(32)); |
43 | 43 | ||
44 | for (i = IRQ_KIRKWOOD_GPIO_START; i < NR_IRQS; i++) { | 44 | for (i = IRQ_KIRKWOOD_GPIO_START; i < NR_IRQS; i++) { |
45 | set_irq_chip(i, &orion_gpio_irq_level_chip); | 45 | set_irq_chip(i, &orion_gpio_irq_chip); |
46 | set_irq_handler(i, handle_level_irq); | 46 | set_irq_handler(i, handle_level_irq); |
47 | irq_desc[i].status |= IRQ_LEVEL; | 47 | irq_desc[i].status |= IRQ_LEVEL; |
48 | set_irq_flags(i, IRQF_VALID); | 48 | set_irq_flags(i, IRQF_VALID); |
diff --git a/arch/arm/mach-kirkwood/mpp.c b/arch/arm/mach-kirkwood/mpp.c new file mode 100644 index 000000000000..63c44934391a --- /dev/null +++ b/arch/arm/mach-kirkwood/mpp.c | |||
@@ -0,0 +1,97 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/mpp.c | ||
3 | * | ||
4 | * MPP functions for Marvell Kirkwood SoCs | ||
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/mbus.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <asm/gpio.h> | ||
16 | #include <mach/hardware.h> | ||
17 | #include "common.h" | ||
18 | #include "mpp.h" | ||
19 | |||
20 | static unsigned int __init kirkwood_variant(void) | ||
21 | { | ||
22 | u32 dev, rev; | ||
23 | |||
24 | kirkwood_pcie_id(&dev, &rev); | ||
25 | |||
26 | if (dev == MV88F6281_DEV_ID && rev >= MV88F6281_REV_A0) | ||
27 | return MPP_F6281_MASK; | ||
28 | if (dev == MV88F6192_DEV_ID && rev >= MV88F6192_REV_A0) | ||
29 | return MPP_F6192_MASK; | ||
30 | if (dev == MV88F6180_DEV_ID) | ||
31 | return MPP_F6180_MASK; | ||
32 | |||
33 | printk(KERN_ERR "MPP setup: unknown kirkwood variant " | ||
34 | "(dev %#x rev %#x)\n", dev, rev); | ||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | #define MPP_CTRL(i) (DEV_BUS_VIRT_BASE + (i) * 4) | ||
39 | #define MPP_NR_REGS (1 + MPP_MAX/8) | ||
40 | |||
41 | void __init kirkwood_mpp_conf(unsigned int *mpp_list) | ||
42 | { | ||
43 | u32 mpp_ctrl[MPP_NR_REGS]; | ||
44 | unsigned int variant_mask; | ||
45 | int i; | ||
46 | |||
47 | variant_mask = kirkwood_variant(); | ||
48 | if (!variant_mask) | ||
49 | return; | ||
50 | |||
51 | printk(KERN_DEBUG "initial MPP regs:"); | ||
52 | for (i = 0; i < MPP_NR_REGS; i++) { | ||
53 | mpp_ctrl[i] = readl(MPP_CTRL(i)); | ||
54 | printk(" %08x", mpp_ctrl[i]); | ||
55 | } | ||
56 | printk("\n"); | ||
57 | |||
58 | while (*mpp_list) { | ||
59 | unsigned int num = MPP_NUM(*mpp_list); | ||
60 | unsigned int sel = MPP_SEL(*mpp_list); | ||
61 | int shift, gpio_mode; | ||
62 | |||
63 | if (num > MPP_MAX) { | ||
64 | printk(KERN_ERR "kirkwood_mpp_conf: invalid MPP " | ||
65 | "number (%u)\n", num); | ||
66 | continue; | ||
67 | } | ||
68 | if (!(*mpp_list & variant_mask)) { | ||
69 | printk(KERN_WARNING | ||
70 | "kirkwood_mpp_conf: requested MPP%u config " | ||
71 | "unavailable on this hardware\n", num); | ||
72 | continue; | ||
73 | } | ||
74 | |||
75 | shift = (num & 7) << 2; | ||
76 | mpp_ctrl[num / 8] &= ~(0xf << shift); | ||
77 | mpp_ctrl[num / 8] |= sel << shift; | ||
78 | |||
79 | gpio_mode = 0; | ||
80 | if (*mpp_list & MPP_INPUT_MASK) | ||
81 | gpio_mode |= GPIO_INPUT_OK; | ||
82 | if (*mpp_list & MPP_OUTPUT_MASK) | ||
83 | gpio_mode |= GPIO_OUTPUT_OK; | ||
84 | if (sel != 0) | ||
85 | gpio_mode = 0; | ||
86 | orion_gpio_set_valid(num, gpio_mode); | ||
87 | |||
88 | mpp_list++; | ||
89 | } | ||
90 | |||
91 | printk(KERN_DEBUG " final MPP regs:"); | ||
92 | for (i = 0; i < MPP_NR_REGS; i++) { | ||
93 | writel(mpp_ctrl[i], MPP_CTRL(i)); | ||
94 | printk(" %08x", mpp_ctrl[i]); | ||
95 | } | ||
96 | printk("\n"); | ||
97 | } | ||
diff --git a/arch/arm/mach-kirkwood/mpp.h b/arch/arm/mach-kirkwood/mpp.h new file mode 100644 index 000000000000..45cccb743107 --- /dev/null +++ b/arch/arm/mach-kirkwood/mpp.h | |||
@@ -0,0 +1,303 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-kirkwood/mpp.h -- Multi Purpose Pins | ||
3 | * | ||
4 | * Copyright 2009: Marvell Technology Group Ltd. | ||
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 __KIRKWOOD_MPP_H | ||
12 | #define __KIRKWOOD_MPP_H | ||
13 | |||
14 | #define MPP(_num, _sel, _in, _out, _F6180, _F6190, _F6192, _F6281) ( \ | ||
15 | /* MPP number */ ((_num) & 0xff) | \ | ||
16 | /* MPP select value */ (((_sel) & 0xf) << 8) | \ | ||
17 | /* may be input signal */ ((!!(_in)) << 12) | \ | ||
18 | /* may be output signal */ ((!!(_out)) << 13) | \ | ||
19 | /* available on F6180 */ ((!!(_F6180)) << 14) | \ | ||
20 | /* available on F6190 */ ((!!(_F6190)) << 15) | \ | ||
21 | /* available on F6192 */ ((!!(_F6192)) << 16) | \ | ||
22 | /* available on F6281 */ ((!!(_F6281)) << 17)) | ||
23 | |||
24 | #define MPP_NUM(x) ((x) & 0xff) | ||
25 | #define MPP_SEL(x) (((x) >> 8) & 0xf) | ||
26 | |||
27 | /* num sel i o 6180 6190 6192 6281 */ | ||
28 | |||
29 | #define MPP_INPUT_MASK MPP( 0, 0x0, 1, 0, 0, 0, 0, 0 ) | ||
30 | #define MPP_OUTPUT_MASK MPP( 0, 0x0, 0, 1, 0, 0, 0, 0 ) | ||
31 | |||
32 | #define MPP_F6180_MASK MPP( 0, 0x0, 0, 0, 1, 0, 0, 0 ) | ||
33 | #define MPP_F6190_MASK MPP( 0, 0x0, 0, 0, 0, 1, 0, 0 ) | ||
34 | #define MPP_F6192_MASK MPP( 0, 0x0, 0, 0, 0, 0, 1, 0 ) | ||
35 | #define MPP_F6281_MASK MPP( 0, 0x0, 0, 0, 0, 0, 0, 1 ) | ||
36 | |||
37 | #define MPP0_GPIO MPP( 0, 0x0, 1, 1, 1, 1, 1, 1 ) | ||
38 | #define MPP0_NF_IO2 MPP( 0, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
39 | #define MPP0_SPI_SCn MPP( 0, 0x2, 0, 1, 1, 1, 1, 1 ) | ||
40 | |||
41 | #define MPP1_GPO MPP( 1, 0x0, 0, 1, 1, 1, 1, 1 ) | ||
42 | #define MPP1_NF_IO3 MPP( 1, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
43 | #define MPP1_SPI_MOSI MPP( 1, 0x2, 0, 1, 1, 1, 1, 1 ) | ||
44 | |||
45 | #define MPP2_GPO MPP( 2, 0x0, 0, 1, 1, 1, 1, 1 ) | ||
46 | #define MPP2_NF_IO4 MPP( 2, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
47 | #define MPP2_SPI_SCK MPP( 2, 0x2, 0, 1, 1, 1, 1, 1 ) | ||
48 | |||
49 | #define MPP3_GPO MPP( 3, 0x0, 0, 1, 1, 1, 1, 1 ) | ||
50 | #define MPP3_NF_IO5 MPP( 3, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
51 | #define MPP3_SPI_MISO MPP( 3, 0x2, 1, 0, 1, 1, 1, 1 ) | ||
52 | |||
53 | #define MPP4_GPIO MPP( 4, 0x0, 1, 1, 1, 1, 1, 1 ) | ||
54 | #define MPP4_NF_IO6 MPP( 4, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
55 | #define MPP4_UART0_RXD MPP( 4, 0x2, 1, 0, 1, 1, 1, 1 ) | ||
56 | #define MPP4_SATA1_ACTn MPP( 4, 0x5, 0, 1, 0, 0, 1, 1 ) | ||
57 | #define MPP4_PTP_CLK MPP( 4, 0xd, 1, 0, 1, 1, 1, 1 ) | ||
58 | |||
59 | #define MPP5_GPO MPP( 5, 0x0, 0, 1, 1, 1, 1, 1 ) | ||
60 | #define MPP5_NF_IO7 MPP( 5, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
61 | #define MPP5_UART0_TXD MPP( 5, 0x2, 0, 1, 1, 1, 1, 1 ) | ||
62 | #define MPP5_PTP_TRIG_GEN MPP( 5, 0x4, 0, 1, 1, 1, 1, 1 ) | ||
63 | #define MPP5_SATA0_ACTn MPP( 5, 0x5, 0, 1, 0, 1, 1, 1 ) | ||
64 | |||
65 | #define MPP6_SYSRST_OUTn MPP( 6, 0x1, 0, 1, 1, 1, 1, 1 ) | ||
66 | #define MPP6_SPI_MOSI MPP( 6, 0x2, 0, 1, 1, 1, 1, 1 ) | ||
67 | #define MPP6_PTP_TRIG_GEN MPP( 6, 0x3, 0, 1, 1, 1, 1, 1 ) | ||
68 | |||
69 | #define MPP7_GPO MPP( 7, 0x0, 0, 1, 1, 1, 1, 1 ) | ||
70 | #define MPP7_PEX_RST_OUTn MPP( 7, 0x1, 0, 1, 1, 1, 1, 1 ) | ||
71 | #define MPP7_SPI_SCn MPP( 7, 0x2, 0, 1, 1, 1, 1, 1 ) | ||
72 | #define MPP7_PTP_TRIG_GEN MPP( 7, 0x3, 0, 1, 1, 1, 1, 1 ) | ||
73 | |||
74 | #define MPP8_GPIO MPP( 8, 0x0, 1, 1, 1, 1, 1, 1 ) | ||
75 | #define MPP8_TW_SDA MPP( 8, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
76 | #define MPP8_UART0_RTS MPP( 8, 0x2, 0, 1, 1, 1, 1, 1 ) | ||
77 | #define MPP8_UART1_RTS MPP( 8, 0x3, 0, 1, 1, 1, 1, 1 ) | ||
78 | #define MPP8_MII0_RXERR MPP( 8, 0x4, 1, 0, 0, 1, 1, 1 ) | ||
79 | #define MPP8_SATA1_PRESENTn MPP( 8, 0x5, 0, 1, 0, 0, 1, 1 ) | ||
80 | #define MPP8_PTP_CLK MPP( 8, 0xc, 1, 0, 1, 1, 1, 1 ) | ||
81 | #define MPP8_MII0_COL MPP( 8, 0xd, 1, 0, 1, 1, 1, 1 ) | ||
82 | |||
83 | #define MPP9_GPIO MPP( 9, 0x0, 1, 1, 1, 1, 1, 1 ) | ||
84 | #define MPP9_TW_SCK MPP( 9, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
85 | #define MPP9_UART0_CTS MPP( 9, 0x2, 1, 0, 1, 1, 1, 1 ) | ||
86 | #define MPP9_UART1_CTS MPP( 9, 0x3, 1, 0, 1, 1, 1, 1 ) | ||
87 | #define MPP9_SATA0_PRESENTn MPP( 9, 0x5, 0, 1, 0, 1, 1, 1 ) | ||
88 | #define MPP9_PTP_EVENT_REQ MPP( 9, 0xc, 1, 0, 1, 1, 1, 1 ) | ||
89 | #define MPP9_MII0_CRS MPP( 9, 0xd, 1, 0, 1, 1, 1, 1 ) | ||
90 | |||
91 | #define MPP10_GPO MPP( 10, 0x0, 0, 1, 1, 1, 1, 1 ) | ||
92 | #define MPP10_SPI_SCK MPP( 10, 0x2, 0, 1, 1, 1, 1, 1 ) | ||
93 | #define MPP10_UArt0_TXD MPP( 10, 0X3, 0, 1, 1, 1, 1, 1 ) | ||
94 | #define MPP10_SATA1_ACTn MPP( 10, 0x5, 0, 1, 0, 0, 1, 1 ) | ||
95 | #define MPP10_PTP_TRIG_GEN MPP( 10, 0xc, 0, 1, 1, 1, 1, 1 ) | ||
96 | |||
97 | #define MPP11_GPIO MPP( 11, 0x0, 1, 1, 1, 1, 1, 1 ) | ||
98 | #define MPP11_SPI_MISO MPP( 11, 0x2, 1, 0, 1, 1, 1, 1 ) | ||
99 | #define MPP11_UArt0_RXD MPP( 11, 0x3, 1, 0, 1, 1, 1, 1 ) | ||
100 | #define MPP11_PTP_EVENT_REQ MPP( 11, 0x4, 1, 0, 1, 1, 1, 1 ) | ||
101 | #define MPP11_PTP_TRIG_GEN MPP( 11, 0xc, 0, 1, 1, 1, 1, 1 ) | ||
102 | #define MPP11_PTP_CLK MPP( 11, 0xd, 1, 0, 1, 1, 1, 1 ) | ||
103 | #define MPP11_SATA0_ACTn MPP( 11, 0x5, 0, 1, 0, 1, 1, 1 ) | ||
104 | |||
105 | #define MPP12_GPO MPP( 12, 0x0, 0, 1, 1, 1, 1, 1 ) | ||
106 | #define MPP12_SD_CLK MPP( 12, 0x1, 0, 1, 1, 1, 1, 1 ) | ||
107 | |||
108 | #define MPP13_GPIO MPP( 13, 0x0, 1, 1, 1, 1, 1, 1 ) | ||
109 | #define MPP13_SD_CMD MPP( 13, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
110 | #define MPP13_UART1_TXD MPP( 13, 0x3, 0, 1, 1, 1, 1, 1 ) | ||
111 | |||
112 | #define MPP14_GPIO MPP( 14, 0x0, 1, 1, 1, 1, 1, 1 ) | ||
113 | #define MPP14_SD_D0 MPP( 14, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
114 | #define MPP14_UART1_RXD MPP( 14, 0x3, 1, 0, 1, 1, 1, 1 ) | ||
115 | #define MPP14_SATA1_PRESENTn MPP( 14, 0x4, 0, 1, 0, 0, 1, 1 ) | ||
116 | #define MPP14_MII0_COL MPP( 14, 0xd, 1, 0, 1, 1, 1, 1 ) | ||
117 | |||
118 | #define MPP15_GPIO MPP( 15, 0x0, 1, 1, 1, 1, 1, 1 ) | ||
119 | #define MPP15_SD_D1 MPP( 15, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
120 | #define MPP15_UART0_RTS MPP( 15, 0x2, 0, 1, 1, 1, 1, 1 ) | ||
121 | #define MPP15_UART1_TXD MPP( 15, 0x3, 0, 1, 1, 1, 1, 1 ) | ||
122 | #define MPP15_SATA0_ACTn MPP( 15, 0x4, 0, 1, 0, 1, 1, 1 ) | ||
123 | |||
124 | #define MPP16_GPIO MPP( 16, 0x0, 1, 1, 1, 1, 1, 1 ) | ||
125 | #define MPP16_SD_D2 MPP( 16, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
126 | #define MPP16_UART0_CTS MPP( 16, 0x2, 1, 0, 1, 1, 1, 1 ) | ||
127 | #define MPP16_UART1_RXD MPP( 16, 0x3, 1, 0, 1, 1, 1, 1 ) | ||
128 | #define MPP16_SATA1_ACTn MPP( 16, 0x4, 0, 1, 0, 0, 1, 1 ) | ||
129 | #define MPP16_MII0_CRS MPP( 16, 0xd, 1, 0, 1, 1, 1, 1 ) | ||
130 | |||
131 | #define MPP17_GPIO MPP( 17, 0x0, 1, 1, 1, 1, 1, 1 ) | ||
132 | #define MPP17_SD_D3 MPP( 17, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
133 | #define MPP17_SATA0_PRESENTn MPP( 17, 0x4, 0, 1, 0, 1, 1, 1 ) | ||
134 | |||
135 | #define MPP18_GPO MPP( 18, 0x0, 0, 1, 1, 1, 1, 1 ) | ||
136 | #define MPP18_NF_IO0 MPP( 18, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
137 | |||
138 | #define MPP19_GPO MPP( 19, 0x0, 0, 1, 1, 1, 1, 1 ) | ||
139 | #define MPP19_NF_IO1 MPP( 19, 0x1, 1, 1, 1, 1, 1, 1 ) | ||
140 | |||
141 | #define MPP20_GPIO MPP( 20, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
142 | #define MPP20_TSMP0 MPP( 20, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
143 | #define MPP20_TDM_CH0_TX_QL MPP( 20, 0x2, 0, 1, 0, 0, 1, 1 ) | ||
144 | #define MPP20_GE1_0 MPP( 20, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
145 | #define MPP20_AUDIO_SPDIFI MPP( 20, 0x4, 1, 0, 0, 0, 1, 1 ) | ||
146 | #define MPP20_SATA1_ACTn MPP( 20, 0x5, 0, 1, 0, 0, 1, 1 ) | ||
147 | |||
148 | #define MPP21_GPIO MPP( 21, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
149 | #define MPP21_TSMP1 MPP( 21, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
150 | #define MPP21_TDM_CH0_RX_QL MPP( 21, 0x2, 0, 1, 0, 0, 1, 1 ) | ||
151 | #define MPP21_GE1_1 MPP( 21, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
152 | #define MPP21_AUDIO_SPDIFO MPP( 21, 0x4, 0, 1, 0, 0, 1, 1 ) | ||
153 | #define MPP21_SATA0_ACTn MPP( 21, 0x5, 0, 1, 0, 1, 1, 1 ) | ||
154 | |||
155 | #define MPP22_GPIO MPP( 22, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
156 | #define MPP22_TSMP2 MPP( 22, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
157 | #define MPP22_TDM_CH2_TX_QL MPP( 22, 0x2, 0, 1, 0, 0, 1, 1 ) | ||
158 | #define MPP22_GE1_2 MPP( 22, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
159 | #define MPP22_AUDIO_SPDIFRMKCLK MPP( 22, 0x4, 0, 1, 0, 0, 1, 1 ) | ||
160 | #define MPP22_SATA1_PRESENTn MPP( 22, 0x5, 0, 1, 0, 0, 1, 1 ) | ||
161 | |||
162 | #define MPP23_GPIO MPP( 23, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
163 | #define MPP23_TSMP3 MPP( 23, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
164 | #define MPP23_TDM_CH2_RX_QL MPP( 23, 0x2, 1, 0, 0, 0, 1, 1 ) | ||
165 | #define MPP23_GE1_3 MPP( 23, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
166 | #define MPP23_AUDIO_I2SBCLK MPP( 23, 0x4, 0, 1, 0, 0, 1, 1 ) | ||
167 | #define MPP23_SATA0_PRESENTn MPP( 23, 0x5, 0, 1, 0, 1, 1, 1 ) | ||
168 | |||
169 | #define MPP24_GPIO MPP( 24, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
170 | #define MPP24_TSMP4 MPP( 24, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
171 | #define MPP24_TDM_SPI_CS0 DEV( 24, 0x2, 0, 1, 0, 0, 1, 1 ) | ||
172 | #define MPP24_GE1_4 MPP( 24, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
173 | #define MPP24_AUDIO_I2SDO MPP( 24, 0x4, 0, 1, 0, 0, 1, 1 ) | ||
174 | |||
175 | #define MPP25_GPIO MPP( 25, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
176 | #define MPP25_TSMP5 MPP( 25, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
177 | #define MPP25_TDM_SPI_SCK MPP( 25, 0x2, 0, 1, 0, 0, 1, 1 ) | ||
178 | #define MPP25_GE1_5 MPP( 25, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
179 | #define MPP25_AUDIO_I2SLRCLK MPP( 25, 0x4, 0, 1, 0, 0, 1, 1 ) | ||
180 | |||
181 | #define MPP26_GPIO MPP( 26, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
182 | #define MPP26_TSMP6 MPP( 26, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
183 | #define MPP26_TDM_SPI_MISO MPP( 26, 0x2, 1, 0, 0, 0, 1, 1 ) | ||
184 | #define MPP26_GE1_6 MPP( 26, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
185 | #define MPP26_AUDIO_I2SMCLK MPP( 26, 0x4, 0, 1, 0, 0, 1, 1 ) | ||
186 | |||
187 | #define MPP27_GPIO MPP( 27, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
188 | #define MPP27_TSMP7 MPP( 27, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
189 | #define MPP27_TDM_SPI_MOSI MPP( 27, 0x2, 0, 1, 0, 0, 1, 1 ) | ||
190 | #define MPP27_GE1_7 MPP( 27, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
191 | #define MPP27_AUDIO_I2SDI MPP( 27, 0x4, 1, 0, 0, 0, 1, 1 ) | ||
192 | |||
193 | #define MPP28_GPIO MPP( 28, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
194 | #define MPP28_TSMP8 MPP( 28, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
195 | #define MPP28_TDM_CODEC_INTn MPP( 28, 0x2, 0, 0, 0, 0, 1, 1 ) | ||
196 | #define MPP28_GE1_8 MPP( 28, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
197 | #define MPP28_AUDIO_EXTCLK MPP( 28, 0x4, 1, 0, 0, 0, 1, 1 ) | ||
198 | |||
199 | #define MPP29_GPIO MPP( 29, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
200 | #define MPP29_TSMP9 MPP( 29, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
201 | #define MPP29_TDM_CODEC_RSTn MPP( 29, 0x2, 0, 0, 0, 0, 1, 1 ) | ||
202 | #define MPP29_GE1_9 MPP( 29, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
203 | |||
204 | #define MPP30_GPIO MPP( 30, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
205 | #define MPP30_TSMP10 MPP( 30, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
206 | #define MPP30_TDM_PCLK MPP( 30, 0x2, 1, 1, 0, 0, 1, 1 ) | ||
207 | #define MPP30_GE1_10 MPP( 30, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
208 | |||
209 | #define MPP31_GPIO MPP( 31, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
210 | #define MPP31_TSMP11 MPP( 31, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
211 | #define MPP31_TDM_FS MPP( 31, 0x2, 1, 1, 0, 0, 1, 1 ) | ||
212 | #define MPP31_GE1_11 MPP( 31, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
213 | |||
214 | #define MPP32_GPIO MPP( 32, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
215 | #define MPP32_TSMP12 MPP( 32, 0x1, 1, 1, 0, 0, 1, 1 ) | ||
216 | #define MPP32_TDM_DRX MPP( 32, 0x2, 1, 0, 0, 0, 1, 1 ) | ||
217 | #define MPP32_GE1_12 MPP( 32, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
218 | |||
219 | #define MPP33_GPIO MPP( 33, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
220 | #define MPP33_TDM_DTX MPP( 33, 0x2, 0, 1, 0, 0, 1, 1 ) | ||
221 | #define MPP33_GE1_13 MPP( 33, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
222 | |||
223 | #define MPP34_GPIO MPP( 34, 0x0, 1, 1, 0, 1, 1, 1 ) | ||
224 | #define MPP34_TDM_SPI_CS1 MPP( 34, 0x2, 0, 1, 0, 0, 1, 1 ) | ||
225 | #define MPP34_GE1_14 MPP( 34, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
226 | |||
227 | #define MPP35_GPIO MPP( 35, 0x0, 1, 1, 1, 1, 1, 1 ) | ||
228 | #define MPP35_TDM_CH0_TX_QL MPP( 35, 0x2, 0, 1, 0, 0, 1, 1 ) | ||
229 | #define MPP35_GE1_15 MPP( 35, 0x3, 0, 0, 0, 1, 1, 1 ) | ||
230 | #define MPP35_SATA0_ACTn MPP( 35, 0x5, 0, 1, 0, 1, 1, 1 ) | ||
231 | #define MPP35_MII0_RXERR MPP( 35, 0xc, 1, 0, 1, 1, 1, 1 ) | ||
232 | |||
233 | #define MPP36_GPIO MPP( 36, 0x0, 1, 1, 1, 0, 0, 1 ) | ||
234 | #define MPP36_TSMP0 MPP( 36, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
235 | #define MPP36_TDM_SPI_CS1 MPP( 36, 0x2, 0, 1, 0, 0, 0, 1 ) | ||
236 | #define MPP36_AUDIO_SPDIFI MPP( 36, 0x4, 1, 0, 1, 0, 0, 1 ) | ||
237 | |||
238 | #define MPP37_GPIO MPP( 37, 0x0, 1, 1, 1, 0, 0, 1 ) | ||
239 | #define MPP37_TSMP1 MPP( 37, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
240 | #define MPP37_TDM_CH2_TX_QL MPP( 37, 0x2, 0, 1, 0, 0, 0, 1 ) | ||
241 | #define MPP37_AUDIO_SPDIFO MPP( 37, 0x4, 0, 1, 1, 0, 0, 1 ) | ||
242 | |||
243 | #define MPP38_GPIO MPP( 38, 0x0, 1, 1, 1, 0, 0, 1 ) | ||
244 | #define MPP38_TSMP2 MPP( 38, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
245 | #define MPP38_TDM_CH2_RX_QL MPP( 38, 0x2, 0, 1, 0, 0, 0, 1 ) | ||
246 | #define MPP38_AUDIO_SPDIFRMLCLK MPP( 38, 0x4, 0, 1, 1, 0, 0, 1 ) | ||
247 | |||
248 | #define MPP39_GPIO MPP( 39, 0x0, 1, 1, 1, 0, 0, 1 ) | ||
249 | #define MPP39_TSMP3 MPP( 39, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
250 | #define MPP39_TDM_SPI_CS0 MPP( 39, 0x2, 0, 1, 0, 0, 0, 1 ) | ||
251 | #define MPP39_AUDIO_I2SBCLK MPP( 39, 0x4, 0, 1, 1, 0, 0, 1 ) | ||
252 | |||
253 | #define MPP40_GPIO MPP( 40, 0x0, 1, 1, 1, 0, 0, 1 ) | ||
254 | #define MPP40_TSMP4 MPP( 40, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
255 | #define MPP40_TDM_SPI_SCK MPP( 40, 0x2, 0, 1, 0, 0, 0, 1 ) | ||
256 | #define MPP40_AUDIO_I2SDO MPP( 40, 0x4, 0, 1, 1, 0, 0, 1 ) | ||
257 | |||
258 | #define MPP41_GPIO MPP( 41, 0x0, 1, 1, 1, 0, 0, 1 ) | ||
259 | #define MPP41_TSMP5 MPP( 41, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
260 | #define MPP41_TDM_SPI_MISO MPP( 41, 0x2, 1, 0, 0, 0, 0, 1 ) | ||
261 | #define MPP41_AUDIO_I2SLRC MPP( 41, 0x4, 0, 1, 1, 0, 0, 1 ) | ||
262 | |||
263 | #define MPP42_GPIO MPP( 42, 0x0, 1, 1, 1, 0, 0, 1 ) | ||
264 | #define MPP42_TSMP6 MPP( 42, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
265 | #define MPP42_TDM_SPI_MOSI MPP( 42, 0x2, 0, 1, 0, 0, 0, 1 ) | ||
266 | #define MPP42_AUDIO_I2SMCLK MPP( 42, 0x4, 0, 1, 1, 0, 0, 1 ) | ||
267 | |||
268 | #define MPP43_GPIO MPP( 43, 0x0, 1, 1, 1, 0, 0, 1 ) | ||
269 | #define MPP43_TSMP7 MPP( 43, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
270 | #define MPP43_TDM_CODEC_INTn MPP( 43, 0x2, 0, 0, 0, 0, 0, 1 ) | ||
271 | #define MPP43_AUDIO_I2SDI MPP( 43, 0x4, 1, 0, 1, 0, 0, 1 ) | ||
272 | |||
273 | #define MPP44_GPIO MPP( 44, 0x0, 1, 1, 1, 0, 0, 1 ) | ||
274 | #define MPP44_TSMP8 MPP( 44, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
275 | #define MPP44_TDM_CODEC_RSTn MPP( 44, 0x2, 0, 0, 0, 0, 0, 1 ) | ||
276 | #define MPP44_AUDIO_EXTCLK MPP( 44, 0x4, 1, 0, 1, 0, 0, 1 ) | ||
277 | |||
278 | #define MPP45_GPIO MPP( 45, 0x0, 1, 1, 0, 0, 0, 1 ) | ||
279 | #define MPP45_TSMP9 MPP( 45, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
280 | #define MPP45_TDM_PCLK MPP( 45, 0x2, 1, 1, 0, 0, 0, 1 ) | ||
281 | |||
282 | #define MPP46_GPIO MPP( 46, 0x0, 1, 1, 0, 0, 0, 1 ) | ||
283 | #define MPP46_TSMP10 MPP( 46, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
284 | #define MPP46_TDM_FS MPP( 46, 0x2, 1, 1, 0, 0, 0, 1 ) | ||
285 | |||
286 | #define MPP47_GPIO MPP( 47, 0x0, 1, 1, 0, 0, 0, 1 ) | ||
287 | #define MPP47_TSMP11 MPP( 47, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
288 | #define MPP47_TDM_DRX MPP( 47, 0x2, 1, 0, 0, 0, 0, 1 ) | ||
289 | |||
290 | #define MPP48_GPIO MPP( 48, 0x0, 1, 1, 0, 0, 0, 1 ) | ||
291 | #define MPP48_TSMP12 MPP( 48, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
292 | #define MPP48_TDM_DTX MPP( 48. 0x2, 0, 1, 0, 0, 0, 1 ) | ||
293 | |||
294 | #define MPP49_GPIO MPP( 49, 0x0, 1, 1, 0, 0, 0, 1 ) | ||
295 | #define MPP49_TSMP9 MPP( 49, 0x1, 1, 1, 0, 0, 0, 1 ) | ||
296 | #define MPP49_TDM_CH0_RX_QL MPP( 49, 0x2, 0, 1, 0, 0, 0, 1 ) | ||
297 | #define MPP49_PTP_CLK MPP( 49, 0x5, 1, 0, 0, 0, 0, 1 ) | ||
298 | |||
299 | #define MPP_MAX 49 | ||
300 | |||
301 | void kirkwood_mpp_conf(unsigned int *mpp_list); | ||
302 | |||
303 | #endif | ||
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c index b1d1a87a6821..2f0e4ef3db0f 100644 --- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c +++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c | |||
@@ -11,11 +11,8 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/pci.h> | ||
15 | #include <linux/irq.h> | ||
16 | #include <linux/mtd/physmap.h> | ||
17 | #include <linux/mtd/nand.h> | 14 | #include <linux/mtd/nand.h> |
18 | #include <linux/timer.h> | 15 | #include <linux/mtd/partitions.h> |
19 | #include <linux/ata_platform.h> | 16 | #include <linux/ata_platform.h> |
20 | #include <linux/mv643xx_eth.h> | 17 | #include <linux/mv643xx_eth.h> |
21 | #include <linux/spi/flash.h> | 18 | #include <linux/spi/flash.h> |
@@ -23,7 +20,6 @@ | |||
23 | #include <linux/spi/orion_spi.h> | 20 | #include <linux/spi/orion_spi.h> |
24 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
25 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
26 | #include <asm/mach/pci.h> | ||
27 | #include <mach/kirkwood.h> | 23 | #include <mach/kirkwood.h> |
28 | #include "common.h" | 24 | #include "common.h" |
29 | 25 | ||
@@ -61,14 +57,11 @@ static void __init rd88f6192_init(void) | |||
61 | 57 | ||
62 | kirkwood_ehci_init(); | 58 | kirkwood_ehci_init(); |
63 | kirkwood_ge00_init(&rd88f6192_ge00_data); | 59 | kirkwood_ge00_init(&rd88f6192_ge00_data); |
64 | kirkwood_rtc_init(); | ||
65 | kirkwood_sata_init(&rd88f6192_sata_data); | 60 | kirkwood_sata_init(&rd88f6192_sata_data); |
66 | spi_register_board_info(rd88F6192_spi_slave_info, | 61 | spi_register_board_info(rd88F6192_spi_slave_info, |
67 | ARRAY_SIZE(rd88F6192_spi_slave_info)); | 62 | ARRAY_SIZE(rd88F6192_spi_slave_info)); |
68 | kirkwood_spi_init(); | 63 | kirkwood_spi_init(); |
69 | kirkwood_uart0_init(); | 64 | kirkwood_uart0_init(); |
70 | kirkwood_xor0_init(); | ||
71 | kirkwood_xor1_init(); | ||
72 | } | 65 | } |
73 | 66 | ||
74 | static int __init rd88f6192_pci_init(void) | 67 | static int __init rd88f6192_pci_init(void) |
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c index 9a0e905d10cd..c3deea5e3cad 100644 --- a/arch/arm/mach-kirkwood/rd88f6281-setup.c +++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c | |||
@@ -11,21 +11,20 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/pci.h> | ||
15 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
16 | #include <linux/mtd/physmap.h> | ||
17 | #include <linux/mtd/nand.h> | 15 | #include <linux/mtd/nand.h> |
18 | #include <linux/timer.h> | 16 | #include <linux/mtd/partitions.h> |
19 | #include <linux/ata_platform.h> | 17 | #include <linux/ata_platform.h> |
20 | #include <linux/mv643xx_eth.h> | 18 | #include <linux/mv643xx_eth.h> |
21 | #include <linux/ethtool.h> | 19 | #include <linux/ethtool.h> |
22 | #include <net/dsa.h> | 20 | #include <net/dsa.h> |
23 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
24 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
25 | #include <asm/mach/pci.h> | ||
26 | #include <mach/kirkwood.h> | 23 | #include <mach/kirkwood.h> |
24 | #include <plat/mvsdio.h> | ||
27 | #include <plat/orion_nand.h> | 25 | #include <plat/orion_nand.h> |
28 | #include "common.h" | 26 | #include "common.h" |
27 | #include "mpp.h" | ||
29 | 28 | ||
30 | static struct mtd_partition rd88f6281_nand_parts[] = { | 29 | static struct mtd_partition rd88f6281_nand_parts[] = { |
31 | { | 30 | { |
@@ -91,6 +90,15 @@ static struct mv_sata_platform_data rd88f6281_sata_data = { | |||
91 | .n_ports = 2, | 90 | .n_ports = 2, |
92 | }; | 91 | }; |
93 | 92 | ||
93 | static struct mvsdio_platform_data rd88f6281_mvsdio_data = { | ||
94 | .gpio_card_detect = 28, | ||
95 | }; | ||
96 | |||
97 | static unsigned int rd88f6281_mpp_config[] __initdata = { | ||
98 | MPP28_GPIO, | ||
99 | 0 | ||
100 | }; | ||
101 | |||
94 | static void __init rd88f6281_init(void) | 102 | static void __init rd88f6281_init(void) |
95 | { | 103 | { |
96 | u32 dev, rev; | 104 | u32 dev, rev; |
@@ -99,6 +107,7 @@ static void __init rd88f6281_init(void) | |||
99 | * Basic setup. Needs to be called early. | 107 | * Basic setup. Needs to be called early. |
100 | */ | 108 | */ |
101 | kirkwood_init(); | 109 | kirkwood_init(); |
110 | kirkwood_mpp_conf(rd88f6281_mpp_config); | ||
102 | 111 | ||
103 | kirkwood_ehci_init(); | 112 | kirkwood_ehci_init(); |
104 | 113 | ||
@@ -112,8 +121,8 @@ static void __init rd88f6281_init(void) | |||
112 | } | 121 | } |
113 | kirkwood_ge00_switch_init(&rd88f6281_switch_data, NO_IRQ); | 122 | kirkwood_ge00_switch_init(&rd88f6281_switch_data, NO_IRQ); |
114 | 123 | ||
115 | kirkwood_rtc_init(); | ||
116 | kirkwood_sata_init(&rd88f6281_sata_data); | 124 | kirkwood_sata_init(&rd88f6281_sata_data); |
125 | kirkwood_sdio_init(&rd88f6281_mvsdio_data); | ||
117 | kirkwood_uart0_init(); | 126 | kirkwood_uart0_init(); |
118 | 127 | ||
119 | platform_device_register(&rd88f6281_nand_flash); | 128 | platform_device_register(&rd88f6281_nand_flash); |
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c new file mode 100644 index 000000000000..831e4a56cae1 --- /dev/null +++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c | |||
@@ -0,0 +1,136 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/sheevaplug-setup.c | ||
3 | * | ||
4 | * Marvell SheevaPlug Reference Board 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/mtd/nand.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 <plat/orion_nand.h> | ||
24 | #include "common.h" | ||
25 | #include "mpp.h" | ||
26 | |||
27 | static struct mtd_partition sheevaplug_nand_parts[] = { | ||
28 | { | ||
29 | .name = "u-boot", | ||
30 | .offset = 0, | ||
31 | .size = SZ_1M | ||
32 | }, { | ||
33 | .name = "uImage", | ||
34 | .offset = MTDPART_OFS_NXTBLK, | ||
35 | .size = SZ_4M | ||
36 | }, { | ||
37 | .name = "root", | ||
38 | .offset = MTDPART_OFS_NXTBLK, | ||
39 | .size = MTDPART_SIZ_FULL | ||
40 | }, | ||
41 | }; | ||
42 | |||
43 | static struct resource sheevaplug_nand_resource = { | ||
44 | .flags = IORESOURCE_MEM, | ||
45 | .start = KIRKWOOD_NAND_MEM_PHYS_BASE, | ||
46 | .end = KIRKWOOD_NAND_MEM_PHYS_BASE + | ||
47 | KIRKWOOD_NAND_MEM_SIZE - 1, | ||
48 | }; | ||
49 | |||
50 | static struct orion_nand_data sheevaplug_nand_data = { | ||
51 | .parts = sheevaplug_nand_parts, | ||
52 | .nr_parts = ARRAY_SIZE(sheevaplug_nand_parts), | ||
53 | .cle = 0, | ||
54 | .ale = 1, | ||
55 | .width = 8, | ||
56 | .chip_delay = 25, | ||
57 | }; | ||
58 | |||
59 | static struct platform_device sheevaplug_nand_flash = { | ||
60 | .name = "orion_nand", | ||
61 | .id = -1, | ||
62 | .dev = { | ||
63 | .platform_data = &sheevaplug_nand_data, | ||
64 | }, | ||
65 | .resource = &sheevaplug_nand_resource, | ||
66 | .num_resources = 1, | ||
67 | }; | ||
68 | |||
69 | static struct mv643xx_eth_platform_data sheevaplug_ge00_data = { | ||
70 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | ||
71 | }; | ||
72 | |||
73 | static struct mvsdio_platform_data sheevaplug_mvsdio_data = { | ||
74 | // unfortunately the CD signal has not been connected */ | ||
75 | }; | ||
76 | |||
77 | static struct gpio_led sheevaplug_led_pins[] = { | ||
78 | { | ||
79 | .name = "plug:green:health", | ||
80 | .default_trigger = "default-on", | ||
81 | .gpio = 49, | ||
82 | .active_low = 1, | ||
83 | }, | ||
84 | }; | ||
85 | |||
86 | static struct gpio_led_platform_data sheevaplug_led_data = { | ||
87 | .leds = sheevaplug_led_pins, | ||
88 | .num_leds = ARRAY_SIZE(sheevaplug_led_pins), | ||
89 | }; | ||
90 | |||
91 | static struct platform_device sheevaplug_leds = { | ||
92 | .name = "leds-gpio", | ||
93 | .id = -1, | ||
94 | .dev = { | ||
95 | .platform_data = &sheevaplug_led_data, | ||
96 | } | ||
97 | }; | ||
98 | |||
99 | static unsigned int sheevaplug_mpp_config[] __initdata = { | ||
100 | MPP29_GPIO, /* USB Power Enable */ | ||
101 | MPP49_GPIO, /* LED */ | ||
102 | 0 | ||
103 | }; | ||
104 | |||
105 | static void __init sheevaplug_init(void) | ||
106 | { | ||
107 | /* | ||
108 | * Basic setup. Needs to be called early. | ||
109 | */ | ||
110 | kirkwood_init(); | ||
111 | kirkwood_mpp_conf(sheevaplug_mpp_config); | ||
112 | |||
113 | kirkwood_uart0_init(); | ||
114 | |||
115 | if (gpio_request(29, "USB Power Enable") != 0 || | ||
116 | gpio_direction_output(29, 1) != 0) | ||
117 | printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n"); | ||
118 | kirkwood_ehci_init(); | ||
119 | |||
120 | kirkwood_ge00_init(&sheevaplug_ge00_data); | ||
121 | kirkwood_sdio_init(&sheevaplug_mvsdio_data); | ||
122 | |||
123 | platform_device_register(&sheevaplug_nand_flash); | ||
124 | platform_device_register(&sheevaplug_leds); | ||
125 | } | ||
126 | |||
127 | MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board") | ||
128 | /* Maintainer: shadi Ammouri <shadi@marvell.com> */ | ||
129 | .phys_io = KIRKWOOD_REGS_PHYS_BASE, | ||
130 | .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, | ||
131 | .boot_params = 0x00000100, | ||
132 | .init_machine = sheevaplug_init, | ||
133 | .map_io = kirkwood_map_io, | ||
134 | .init_irq = kirkwood_init_irq, | ||
135 | .timer = &kirkwood_timer, | ||
136 | MACHINE_END | ||
diff --git a/arch/arm/mach-ks8695/include/mach/system.h b/arch/arm/mach-ks8695/include/mach/system.h index 5a9b032bdbeb..fb1dda9be2d0 100644 --- a/arch/arm/mach-ks8695/include/mach/system.h +++ b/arch/arm/mach-ks8695/include/mach/system.h | |||
@@ -27,7 +27,7 @@ static void arch_idle(void) | |||
27 | 27 | ||
28 | } | 28 | } |
29 | 29 | ||
30 | static void arch_reset(char mode) | 30 | static void arch_reset(char mode, const char *cmd) |
31 | { | 31 | { |
32 | unsigned int reg; | 32 | unsigned int reg; |
33 | 33 | ||
diff --git a/arch/arm/mach-l7200/include/mach/system.h b/arch/arm/mach-l7200/include/mach/system.h index 5272abee0d0e..e0dd3b6ae4aa 100644 --- a/arch/arm/mach-l7200/include/mach/system.h +++ b/arch/arm/mach-l7200/include/mach/system.h | |||
@@ -19,7 +19,7 @@ static inline void arch_idle(void) | |||
19 | *(unsigned long *)(IO_BASE + 0x50004) = 1; /* idle mode */ | 19 | *(unsigned long *)(IO_BASE + 0x50004) = 1; /* idle mode */ |
20 | } | 20 | } |
21 | 21 | ||
22 | static inline void arch_reset(char mode) | 22 | static inline void arch_reset(char mode, const char *cmd) |
23 | { | 23 | { |
24 | if (mode == 's') { | 24 | if (mode == 's') { |
25 | cpu_reset(0); | 25 | cpu_reset(0); |
diff --git a/arch/arm/mach-lh7a40x/include/mach/system.h b/arch/arm/mach-lh7a40x/include/mach/system.h index fa46bb1ef07b..45a56d3b93d7 100644 --- a/arch/arm/mach-lh7a40x/include/mach/system.h +++ b/arch/arm/mach-lh7a40x/include/mach/system.h | |||
@@ -13,7 +13,7 @@ static inline void arch_idle(void) | |||
13 | cpu_do_idle (); | 13 | cpu_do_idle (); |
14 | } | 14 | } |
15 | 15 | ||
16 | static inline void arch_reset(char mode) | 16 | static inline void arch_reset(char mode, const char *cmd) |
17 | { | 17 | { |
18 | cpu_reset (0); | 18 | cpu_reset (0); |
19 | } | 19 | } |
diff --git a/arch/arm/mach-loki/include/mach/system.h b/arch/arm/mach-loki/include/mach/system.h index 8db1147d4ec5..c1de36fe9b37 100644 --- a/arch/arm/mach-loki/include/mach/system.h +++ b/arch/arm/mach-loki/include/mach/system.h | |||
@@ -17,7 +17,7 @@ static inline void arch_idle(void) | |||
17 | cpu_do_idle(); | 17 | cpu_do_idle(); |
18 | } | 18 | } |
19 | 19 | ||
20 | static inline void arch_reset(char mode) | 20 | static inline void arch_reset(char mode, const char *cmd) |
21 | { | 21 | { |
22 | /* | 22 | /* |
23 | * Enable soft reset to assert RSTOUTn. | 23 | * Enable soft reset to assert RSTOUTn. |
diff --git a/arch/arm/mach-msm/include/mach/system.h b/arch/arm/mach-msm/include/mach/system.h index f05ad2e0f235..574ccc493daf 100644 --- a/arch/arm/mach-msm/include/mach/system.h +++ b/arch/arm/mach-msm/include/mach/system.h | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | void arch_idle(void); | 18 | void arch_idle(void); |
19 | 19 | ||
20 | static inline void arch_reset(char mode) | 20 | static inline void arch_reset(char mode, const char *cmd) |
21 | { | 21 | { |
22 | for (;;) ; /* depends on IPC w/ other core */ | 22 | for (;;) ; /* depends on IPC w/ other core */ |
23 | } | 23 | } |
diff --git a/arch/arm/mach-mv78xx0/Kconfig b/arch/arm/mach-mv78xx0/Kconfig index d83cb86837db..6fbe68fe4412 100644 --- a/arch/arm/mach-mv78xx0/Kconfig +++ b/arch/arm/mach-mv78xx0/Kconfig | |||
@@ -8,6 +8,12 @@ config MACH_DB78X00_BP | |||
8 | Say 'Y' here if you want your kernel to support the | 8 | Say 'Y' here if you want your kernel to support the |
9 | Marvell DB-78x00-BP Development Board. | 9 | Marvell DB-78x00-BP Development Board. |
10 | 10 | ||
11 | config MACH_RD78X00_MASA | ||
12 | bool "Marvell RD-78x00-mASA Reference Design" | ||
13 | help | ||
14 | Say 'Y' here if you want your kernel to support the | ||
15 | Marvell RD-78x00-mASA Reference Design. | ||
16 | |||
11 | endmenu | 17 | endmenu |
12 | 18 | ||
13 | endif | 19 | endif |
diff --git a/arch/arm/mach-mv78xx0/Makefile b/arch/arm/mach-mv78xx0/Makefile index ec16c05c3b1b..da628b7f3bb6 100644 --- a/arch/arm/mach-mv78xx0/Makefile +++ b/arch/arm/mach-mv78xx0/Makefile | |||
@@ -1,2 +1,3 @@ | |||
1 | obj-y += common.o addr-map.o irq.o pcie.o | 1 | obj-y += common.o addr-map.o irq.o pcie.o |
2 | obj-$(CONFIG_MACH_DB78X00_BP) += db78x00-bp-setup.o | 2 | obj-$(CONFIG_MACH_DB78X00_BP) += db78x00-bp-setup.o |
3 | obj-$(CONFIG_MACH_RD78X00_MASA) += rd78x00-masa-setup.o | ||
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index b0e4e0d8f506..a575daaa62d1 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c | |||
@@ -14,7 +14,9 @@ | |||
14 | #include <linux/serial_8250.h> | 14 | #include <linux/serial_8250.h> |
15 | #include <linux/mbus.h> | 15 | #include <linux/mbus.h> |
16 | #include <linux/mv643xx_eth.h> | 16 | #include <linux/mv643xx_eth.h> |
17 | #include <linux/mv643xx_i2c.h> | ||
17 | #include <linux/ata_platform.h> | 18 | #include <linux/ata_platform.h> |
19 | #include <linux/ethtool.h> | ||
18 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
19 | #include <asm/mach/time.h> | 21 | #include <asm/mach/time.h> |
20 | #include <mach/mv78xx0.h> | 22 | #include <mach/mv78xx0.h> |
@@ -430,9 +432,22 @@ static struct platform_device mv78xx0_ge10 = { | |||
430 | 432 | ||
431 | void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data) | 433 | void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data) |
432 | { | 434 | { |
435 | u32 dev, rev; | ||
436 | |||
433 | eth_data->shared = &mv78xx0_ge10_shared; | 437 | eth_data->shared = &mv78xx0_ge10_shared; |
434 | mv78xx0_ge10.dev.platform_data = eth_data; | 438 | mv78xx0_ge10.dev.platform_data = eth_data; |
435 | 439 | ||
440 | /* | ||
441 | * On the Z0, ge10 and ge11 are internally connected back | ||
442 | * to back, and not brought out. | ||
443 | */ | ||
444 | mv78xx0_pcie_id(&dev, &rev); | ||
445 | if (dev == MV78X00_Z0_DEV_ID) { | ||
446 | eth_data->phy_addr = MV643XX_ETH_PHY_NONE; | ||
447 | eth_data->speed = SPEED_1000; | ||
448 | eth_data->duplex = DUPLEX_FULL; | ||
449 | } | ||
450 | |||
436 | platform_device_register(&mv78xx0_ge10_shared); | 451 | platform_device_register(&mv78xx0_ge10_shared); |
437 | platform_device_register(&mv78xx0_ge10); | 452 | platform_device_register(&mv78xx0_ge10); |
438 | } | 453 | } |
@@ -484,13 +499,101 @@ static struct platform_device mv78xx0_ge11 = { | |||
484 | 499 | ||
485 | void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data) | 500 | void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data) |
486 | { | 501 | { |
502 | u32 dev, rev; | ||
503 | |||
487 | eth_data->shared = &mv78xx0_ge11_shared; | 504 | eth_data->shared = &mv78xx0_ge11_shared; |
488 | mv78xx0_ge11.dev.platform_data = eth_data; | 505 | mv78xx0_ge11.dev.platform_data = eth_data; |
489 | 506 | ||
507 | /* | ||
508 | * On the Z0, ge10 and ge11 are internally connected back | ||
509 | * to back, and not brought out. | ||
510 | */ | ||
511 | mv78xx0_pcie_id(&dev, &rev); | ||
512 | if (dev == MV78X00_Z0_DEV_ID) { | ||
513 | eth_data->phy_addr = MV643XX_ETH_PHY_NONE; | ||
514 | eth_data->speed = SPEED_1000; | ||
515 | eth_data->duplex = DUPLEX_FULL; | ||
516 | } | ||
517 | |||
490 | platform_device_register(&mv78xx0_ge11_shared); | 518 | platform_device_register(&mv78xx0_ge11_shared); |
491 | platform_device_register(&mv78xx0_ge11); | 519 | platform_device_register(&mv78xx0_ge11); |
492 | } | 520 | } |
493 | 521 | ||
522 | /***************************************************************************** | ||
523 | * I2C bus 0 | ||
524 | ****************************************************************************/ | ||
525 | |||
526 | static struct mv64xxx_i2c_pdata mv78xx0_i2c_0_pdata = { | ||
527 | .freq_m = 8, /* assumes 166 MHz TCLK */ | ||
528 | .freq_n = 3, | ||
529 | .timeout = 1000, /* Default timeout of 1 second */ | ||
530 | }; | ||
531 | |||
532 | static struct resource mv78xx0_i2c_0_resources[] = { | ||
533 | { | ||
534 | .name = "i2c 0 base", | ||
535 | .start = I2C_0_PHYS_BASE, | ||
536 | .end = I2C_0_PHYS_BASE + 0x1f, | ||
537 | .flags = IORESOURCE_MEM, | ||
538 | }, { | ||
539 | .name = "i2c 0 irq", | ||
540 | .start = IRQ_MV78XX0_I2C_0, | ||
541 | .end = IRQ_MV78XX0_I2C_0, | ||
542 | .flags = IORESOURCE_IRQ, | ||
543 | }, | ||
544 | }; | ||
545 | |||
546 | |||
547 | static struct platform_device mv78xx0_i2c_0 = { | ||
548 | .name = MV64XXX_I2C_CTLR_NAME, | ||
549 | .id = 0, | ||
550 | .num_resources = ARRAY_SIZE(mv78xx0_i2c_0_resources), | ||
551 | .resource = mv78xx0_i2c_0_resources, | ||
552 | .dev = { | ||
553 | .platform_data = &mv78xx0_i2c_0_pdata, | ||
554 | }, | ||
555 | }; | ||
556 | |||
557 | /***************************************************************************** | ||
558 | * I2C bus 1 | ||
559 | ****************************************************************************/ | ||
560 | |||
561 | static struct mv64xxx_i2c_pdata mv78xx0_i2c_1_pdata = { | ||
562 | .freq_m = 8, /* assumes 166 MHz TCLK */ | ||
563 | .freq_n = 3, | ||
564 | .timeout = 1000, /* Default timeout of 1 second */ | ||
565 | }; | ||
566 | |||
567 | static struct resource mv78xx0_i2c_1_resources[] = { | ||
568 | { | ||
569 | .name = "i2c 1 base", | ||
570 | .start = I2C_1_PHYS_BASE, | ||
571 | .end = I2C_1_PHYS_BASE + 0x1f, | ||
572 | .flags = IORESOURCE_MEM, | ||
573 | }, { | ||
574 | .name = "i2c 1 irq", | ||
575 | .start = IRQ_MV78XX0_I2C_1, | ||
576 | .end = IRQ_MV78XX0_I2C_1, | ||
577 | .flags = IORESOURCE_IRQ, | ||
578 | }, | ||
579 | }; | ||
580 | |||
581 | |||
582 | static struct platform_device mv78xx0_i2c_1 = { | ||
583 | .name = MV64XXX_I2C_CTLR_NAME, | ||
584 | .id = 1, | ||
585 | .num_resources = ARRAY_SIZE(mv78xx0_i2c_1_resources), | ||
586 | .resource = mv78xx0_i2c_1_resources, | ||
587 | .dev = { | ||
588 | .platform_data = &mv78xx0_i2c_1_pdata, | ||
589 | }, | ||
590 | }; | ||
591 | |||
592 | void __init mv78xx0_i2c_init(void) | ||
593 | { | ||
594 | platform_device_register(&mv78xx0_i2c_0); | ||
595 | platform_device_register(&mv78xx0_i2c_1); | ||
596 | } | ||
494 | 597 | ||
495 | /***************************************************************************** | 598 | /***************************************************************************** |
496 | * SATA | 599 | * SATA |
@@ -719,6 +822,32 @@ struct sys_timer mv78xx0_timer = { | |||
719 | /***************************************************************************** | 822 | /***************************************************************************** |
720 | * General | 823 | * General |
721 | ****************************************************************************/ | 824 | ****************************************************************************/ |
825 | static char * __init mv78xx0_id(void) | ||
826 | { | ||
827 | u32 dev, rev; | ||
828 | |||
829 | mv78xx0_pcie_id(&dev, &rev); | ||
830 | |||
831 | if (dev == MV78X00_Z0_DEV_ID) { | ||
832 | if (rev == MV78X00_REV_Z0) | ||
833 | return "MV78X00-Z0"; | ||
834 | else | ||
835 | return "MV78X00-Rev-Unsupported"; | ||
836 | } else if (dev == MV78100_DEV_ID) { | ||
837 | if (rev == MV78100_REV_A0) | ||
838 | return "MV78100-A0"; | ||
839 | else | ||
840 | return "MV78100-Rev-Unsupported"; | ||
841 | } else if (dev == MV78200_DEV_ID) { | ||
842 | if (rev == MV78100_REV_A0) | ||
843 | return "MV78200-A0"; | ||
844 | else | ||
845 | return "MV78200-Rev-Unsupported"; | ||
846 | } else { | ||
847 | return "Device-Unknown"; | ||
848 | } | ||
849 | } | ||
850 | |||
722 | static int __init is_l2_writethrough(void) | 851 | static int __init is_l2_writethrough(void) |
723 | { | 852 | { |
724 | return !!(readl(CPU_CONTROL) & L2_WRITETHROUGH); | 853 | return !!(readl(CPU_CONTROL) & L2_WRITETHROUGH); |
@@ -737,7 +866,8 @@ void __init mv78xx0_init(void) | |||
737 | get_pclk_l2clk(hclk, core_index, &pclk, &l2clk); | 866 | get_pclk_l2clk(hclk, core_index, &pclk, &l2clk); |
738 | tclk = get_tclk(); | 867 | tclk = get_tclk(); |
739 | 868 | ||
740 | printk(KERN_INFO "MV78xx0 core #%d, ", core_index); | 869 | printk(KERN_INFO "%s ", mv78xx0_id()); |
870 | printk("core #%d, ", core_index); | ||
741 | printk("PCLK = %dMHz, ", (pclk + 499999) / 1000000); | 871 | printk("PCLK = %dMHz, ", (pclk + 499999) / 1000000); |
742 | printk("L2 = %dMHz, ", (l2clk + 499999) / 1000000); | 872 | printk("L2 = %dMHz, ", (l2clk + 499999) / 1000000); |
743 | printk("HCLK = %dMHz, ", (hclk + 499999) / 1000000); | 873 | printk("HCLK = %dMHz, ", (hclk + 499999) / 1000000); |
diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h index 78af5de319dd..befc22475469 100644 --- a/arch/arm/mach-mv78xx0/common.h +++ b/arch/arm/mach-mv78xx0/common.h | |||
@@ -29,6 +29,8 @@ void mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size, | |||
29 | void mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size, | 29 | void mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size, |
30 | int maj, int min); | 30 | int maj, int min); |
31 | 31 | ||
32 | void mv78xx0_pcie_id(u32 *dev, u32 *rev); | ||
33 | |||
32 | void mv78xx0_ehci0_init(void); | 34 | void mv78xx0_ehci0_init(void); |
33 | void mv78xx0_ehci1_init(void); | 35 | void mv78xx0_ehci1_init(void); |
34 | void mv78xx0_ehci2_init(void); | 36 | void mv78xx0_ehci2_init(void); |
@@ -42,6 +44,7 @@ void mv78xx0_uart0_init(void); | |||
42 | void mv78xx0_uart1_init(void); | 44 | void mv78xx0_uart1_init(void); |
43 | void mv78xx0_uart2_init(void); | 45 | void mv78xx0_uart2_init(void); |
44 | void mv78xx0_uart3_init(void); | 46 | void mv78xx0_uart3_init(void); |
47 | void mv78xx0_i2c_init(void); | ||
45 | 48 | ||
46 | extern struct sys_timer mv78xx0_timer; | 49 | extern struct sys_timer mv78xx0_timer; |
47 | 50 | ||
diff --git a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c index 2e285bbb7bbd..efdabe04c69e 100644 --- a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c +++ b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/ata_platform.h> | 14 | #include <linux/ata_platform.h> |
15 | #include <linux/mv643xx_eth.h> | 15 | #include <linux/mv643xx_eth.h> |
16 | #include <linux/ethtool.h> | 16 | #include <linux/ethtool.h> |
17 | #include <linux/i2c.h> | ||
17 | #include <mach/mv78xx0.h> | 18 | #include <mach/mv78xx0.h> |
18 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
19 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
@@ -28,21 +29,22 @@ static struct mv643xx_eth_platform_data db78x00_ge01_data = { | |||
28 | }; | 29 | }; |
29 | 30 | ||
30 | static struct mv643xx_eth_platform_data db78x00_ge10_data = { | 31 | static struct mv643xx_eth_platform_data db78x00_ge10_data = { |
31 | .phy_addr = MV643XX_ETH_PHY_NONE, | 32 | .phy_addr = MV643XX_ETH_PHY_ADDR(10), |
32 | .speed = SPEED_1000, | ||
33 | .duplex = DUPLEX_FULL, | ||
34 | }; | 33 | }; |
35 | 34 | ||
36 | static struct mv643xx_eth_platform_data db78x00_ge11_data = { | 35 | static struct mv643xx_eth_platform_data db78x00_ge11_data = { |
37 | .phy_addr = MV643XX_ETH_PHY_NONE, | 36 | .phy_addr = MV643XX_ETH_PHY_ADDR(11), |
38 | .speed = SPEED_1000, | ||
39 | .duplex = DUPLEX_FULL, | ||
40 | }; | 37 | }; |
41 | 38 | ||
42 | static struct mv_sata_platform_data db78x00_sata_data = { | 39 | static struct mv_sata_platform_data db78x00_sata_data = { |
43 | .n_ports = 2, | 40 | .n_ports = 2, |
44 | }; | 41 | }; |
45 | 42 | ||
43 | static struct i2c_board_info __initdata db78x00_i2c_rtc = { | ||
44 | I2C_BOARD_INFO("ds1338", 0x68), | ||
45 | }; | ||
46 | |||
47 | |||
46 | static void __init db78x00_init(void) | 48 | static void __init db78x00_init(void) |
47 | { | 49 | { |
48 | /* | 50 | /* |
@@ -64,6 +66,8 @@ static void __init db78x00_init(void) | |||
64 | mv78xx0_sata_init(&db78x00_sata_data); | 66 | mv78xx0_sata_init(&db78x00_sata_data); |
65 | mv78xx0_uart0_init(); | 67 | mv78xx0_uart0_init(); |
66 | mv78xx0_uart2_init(); | 68 | mv78xx0_uart2_init(); |
69 | mv78xx0_i2c_init(); | ||
70 | i2c_register_board_info(0, &db78x00_i2c_rtc, 1); | ||
67 | } else { | 71 | } else { |
68 | mv78xx0_uart1_init(); | 72 | mv78xx0_uart1_init(); |
69 | mv78xx0_uart3_init(); | 73 | mv78xx0_uart3_init(); |
diff --git a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h index e930ea5330a2..582cffc733ad 100644 --- a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h +++ b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h | |||
@@ -80,6 +80,18 @@ | |||
80 | #define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0300) | 80 | #define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0300) |
81 | 81 | ||
82 | /* | 82 | /* |
83 | * Supported devices and revisions. | ||
84 | */ | ||
85 | #define MV78X00_Z0_DEV_ID 0x6381 | ||
86 | #define MV78X00_REV_Z0 1 | ||
87 | |||
88 | #define MV78100_DEV_ID 0x7810 | ||
89 | #define MV78100_REV_A0 1 | ||
90 | |||
91 | #define MV78200_DEV_ID 0x7820 | ||
92 | #define MV78200_REV_A0 1 | ||
93 | |||
94 | /* | ||
83 | * Register Map | 95 | * Register Map |
84 | */ | 96 | */ |
85 | #define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x00000) | 97 | #define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x00000) |
@@ -90,6 +102,8 @@ | |||
90 | #define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x10000) | 102 | #define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x10000) |
91 | #define SAMPLE_AT_RESET_LOW (DEV_BUS_VIRT_BASE | 0x0030) | 103 | #define SAMPLE_AT_RESET_LOW (DEV_BUS_VIRT_BASE | 0x0030) |
92 | #define SAMPLE_AT_RESET_HIGH (DEV_BUS_VIRT_BASE | 0x0034) | 104 | #define SAMPLE_AT_RESET_HIGH (DEV_BUS_VIRT_BASE | 0x0034) |
105 | #define I2C_0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1000) | ||
106 | #define I2C_1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1100) | ||
93 | #define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000) | 107 | #define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000) |
94 | #define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2000) | 108 | #define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2000) |
95 | #define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2100) | 109 | #define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2100) |
diff --git a/arch/arm/mach-mv78xx0/include/mach/system.h b/arch/arm/mach-mv78xx0/include/mach/system.h index 7d5179408832..1d6350b22d0b 100644 --- a/arch/arm/mach-mv78xx0/include/mach/system.h +++ b/arch/arm/mach-mv78xx0/include/mach/system.h | |||
@@ -17,7 +17,7 @@ static inline void arch_idle(void) | |||
17 | cpu_do_idle(); | 17 | cpu_do_idle(); |
18 | } | 18 | } |
19 | 19 | ||
20 | static inline void arch_reset(char mode) | 20 | static inline void arch_reset(char mode, const char *cmd) |
21 | { | 21 | { |
22 | /* | 22 | /* |
23 | * Enable soft reset to assert RSTOUTn. | 23 | * Enable soft reset to assert RSTOUTn. |
diff --git a/arch/arm/mach-mv78xx0/irq.c b/arch/arm/mach-mv78xx0/irq.c index e273418797b4..30b7e4bcdbc7 100644 --- a/arch/arm/mach-mv78xx0/irq.c +++ b/arch/arm/mach-mv78xx0/irq.c | |||
@@ -40,7 +40,7 @@ void __init mv78xx0_init_irq(void) | |||
40 | writel(0, GPIO_EDGE_CAUSE(0)); | 40 | writel(0, GPIO_EDGE_CAUSE(0)); |
41 | 41 | ||
42 | for (i = IRQ_MV78XX0_GPIO_START; i < NR_IRQS; i++) { | 42 | for (i = IRQ_MV78XX0_GPIO_START; i < NR_IRQS; i++) { |
43 | set_irq_chip(i, &orion_gpio_irq_level_chip); | 43 | set_irq_chip(i, &orion_gpio_irq_chip); |
44 | set_irq_handler(i, handle_level_irq); | 44 | set_irq_handler(i, handle_level_irq); |
45 | irq_desc[i].status |= IRQ_LEVEL; | 45 | irq_desc[i].status |= IRQ_LEVEL; |
46 | set_irq_flags(i, IRQF_VALID); | 46 | set_irq_flags(i, IRQF_VALID); |
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c index aad3a7a2f830..a560439dcc3c 100644 --- a/arch/arm/mach-mv78xx0/pcie.c +++ b/arch/arm/mach-mv78xx0/pcie.c | |||
@@ -33,6 +33,12 @@ static struct resource pcie_io_space; | |||
33 | static struct resource pcie_mem_space; | 33 | static struct resource pcie_mem_space; |
34 | 34 | ||
35 | 35 | ||
36 | void __init mv78xx0_pcie_id(u32 *dev, u32 *rev) | ||
37 | { | ||
38 | *dev = orion_pcie_dev_id((void __iomem *)PCIE00_VIRT_BASE); | ||
39 | *rev = orion_pcie_rev((void __iomem *)PCIE00_VIRT_BASE); | ||
40 | } | ||
41 | |||
36 | static void __init mv78xx0_pcie_preinit(void) | 42 | static void __init mv78xx0_pcie_preinit(void) |
37 | { | 43 | { |
38 | int i; | 44 | int i; |
diff --git a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c new file mode 100644 index 000000000000..e136b7a03355 --- /dev/null +++ b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-mv78x00/rd78x00-masa-setup.c | ||
3 | * | ||
4 | * Marvell RD-78x00-mASA Development Board 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/mv643xx_eth.h> | ||
16 | #include <linux/ethtool.h> | ||
17 | #include <mach/mv78xx0.h> | ||
18 | #include <asm/mach-types.h> | ||
19 | #include <asm/mach/arch.h> | ||
20 | #include "common.h" | ||
21 | |||
22 | static struct mv643xx_eth_platform_data rd78x00_masa_ge00_data = { | ||
23 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | ||
24 | }; | ||
25 | |||
26 | static struct mv643xx_eth_platform_data rd78x00_masa_ge01_data = { | ||
27 | .phy_addr = MV643XX_ETH_PHY_ADDR(9), | ||
28 | }; | ||
29 | |||
30 | static struct mv643xx_eth_platform_data rd78x00_masa_ge10_data = { | ||
31 | }; | ||
32 | |||
33 | static struct mv643xx_eth_platform_data rd78x00_masa_ge11_data = { | ||
34 | }; | ||
35 | |||
36 | static struct mv_sata_platform_data rd78x00_masa_sata_data = { | ||
37 | .n_ports = 2, | ||
38 | }; | ||
39 | |||
40 | static void __init rd78x00_masa_init(void) | ||
41 | { | ||
42 | /* | ||
43 | * Basic MV78x00 setup. Needs to be called early. | ||
44 | */ | ||
45 | mv78xx0_init(); | ||
46 | |||
47 | /* | ||
48 | * Partition on-chip peripherals between the two CPU cores. | ||
49 | */ | ||
50 | if (mv78xx0_core_index() == 0) { | ||
51 | mv78xx0_ehci0_init(); | ||
52 | mv78xx0_ehci1_init(); | ||
53 | mv78xx0_ge00_init(&rd78x00_masa_ge00_data); | ||
54 | mv78xx0_ge10_init(&rd78x00_masa_ge10_data); | ||
55 | mv78xx0_sata_init(&rd78x00_masa_sata_data); | ||
56 | mv78xx0_uart0_init(); | ||
57 | mv78xx0_uart2_init(); | ||
58 | } else { | ||
59 | mv78xx0_ehci2_init(); | ||
60 | mv78xx0_ge01_init(&rd78x00_masa_ge01_data); | ||
61 | mv78xx0_ge11_init(&rd78x00_masa_ge11_data); | ||
62 | mv78xx0_uart1_init(); | ||
63 | mv78xx0_uart3_init(); | ||
64 | } | ||
65 | } | ||
66 | |||
67 | static int __init rd78x00_pci_init(void) | ||
68 | { | ||
69 | /* | ||
70 | * Assign all PCIe devices to CPU core #0. | ||
71 | */ | ||
72 | if (machine_is_rd78x00_masa() && mv78xx0_core_index() == 0) | ||
73 | mv78xx0_pcie_init(1, 1); | ||
74 | |||
75 | return 0; | ||
76 | } | ||
77 | subsys_initcall(rd78x00_pci_init); | ||
78 | |||
79 | MACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board") | ||
80 | /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */ | ||
81 | .phys_io = MV78XX0_REGS_PHYS_BASE, | ||
82 | .io_pg_offst = ((MV78XX0_REGS_VIRT_BASE) >> 18) & 0xfffc, | ||
83 | .boot_params = 0x00000100, | ||
84 | .init_machine = rd78x00_masa_init, | ||
85 | .map_io = mv78xx0_map_io, | ||
86 | .init_irq = mv78xx0_init_irq, | ||
87 | .timer = &mv78xx0_timer, | ||
88 | MACHINE_END | ||
diff --git a/arch/arm/mach-mx1/Kconfig b/arch/arm/mach-mx1/Kconfig index 2b59fc74784f..eb7660f5d4b7 100644 --- a/arch/arm/mach-mx1/Kconfig +++ b/arch/arm/mach-mx1/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | if ARCH_MX1 | 1 | if ARCH_MX1 |
2 | 2 | ||
3 | comment "MX1 Platforms" | 3 | comment "MX1 platforms:" |
4 | 4 | ||
5 | config MACH_MXLADS | 5 | config MACH_MXLADS |
6 | bool | 6 | bool |
@@ -11,4 +11,9 @@ config ARCH_MX1ADS | |||
11 | help | 11 | help |
12 | Say Y here if you are using Motorola MX1ADS/MXLADS boards | 12 | Say Y here if you are using Motorola MX1ADS/MXLADS boards |
13 | 13 | ||
14 | config MACH_SCB9328 | ||
15 | bool "Synertronixx scb9328" | ||
16 | help | ||
17 | Say Y here if you are using a Synertronixx scb9328 board | ||
18 | |||
14 | endif | 19 | endif |
diff --git a/arch/arm/mach-mx1/Makefile b/arch/arm/mach-mx1/Makefile index b969719011fa..82f1309568ef 100644 --- a/arch/arm/mach-mx1/Makefile +++ b/arch/arm/mach-mx1/Makefile | |||
@@ -8,3 +8,4 @@ obj-y += generic.o clock.o devices.o | |||
8 | 8 | ||
9 | # Specific board support | 9 | # Specific board support |
10 | obj-$(CONFIG_ARCH_MX1ADS) += mx1ads.o | 10 | obj-$(CONFIG_ARCH_MX1ADS) += mx1ads.o |
11 | obj-$(CONFIG_MACH_SCB9328) += scb9328.o \ No newline at end of file | ||
diff --git a/arch/arm/mach-mx1/clock.c b/arch/arm/mach-mx1/clock.c index 4bcd1ece55f5..0d0f306851d0 100644 --- a/arch/arm/mach-mx1/clock.c +++ b/arch/arm/mach-mx1/clock.c | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include <mach/clock.h> | 26 | #include <mach/clock.h> |
27 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
28 | #include <mach/common.h> | ||
28 | #include "crm_regs.h" | 29 | #include "crm_regs.h" |
29 | 30 | ||
30 | static int _clk_enable(struct clk *clk) | 31 | static int _clk_enable(struct clk *clk) |
@@ -87,33 +88,6 @@ static int _clk_parent_set_rate(struct clk *clk, unsigned long rate) | |||
87 | return clk->parent->set_rate(clk->parent, rate); | 88 | return clk->parent->set_rate(clk->parent, rate); |
88 | } | 89 | } |
89 | 90 | ||
90 | /* | ||
91 | * get the system pll clock in Hz | ||
92 | * | ||
93 | * mfi + mfn / (mfd +1) | ||
94 | * f = 2 * f_ref * -------------------- | ||
95 | * pd + 1 | ||
96 | */ | ||
97 | static unsigned long mx1_decode_pll(unsigned int pll, u32 f_ref) | ||
98 | { | ||
99 | unsigned long long ll; | ||
100 | unsigned long quot; | ||
101 | |||
102 | u32 mfi = (pll >> 10) & 0xf; | ||
103 | u32 mfn = pll & 0x3ff; | ||
104 | u32 mfd = (pll >> 16) & 0x3ff; | ||
105 | u32 pd = (pll >> 26) & 0xf; | ||
106 | |||
107 | mfi = mfi <= 5 ? 5 : mfi; | ||
108 | |||
109 | ll = 2 * (unsigned long long)f_ref * | ||
110 | ((mfi << 16) + (mfn << 16) / (mfd + 1)); | ||
111 | quot = (pd + 1) * (1 << 16); | ||
112 | ll += quot / 2; | ||
113 | do_div(ll, quot); | ||
114 | return (unsigned long)ll; | ||
115 | } | ||
116 | |||
117 | static unsigned long clk16m_get_rate(struct clk *clk) | 91 | static unsigned long clk16m_get_rate(struct clk *clk) |
118 | { | 92 | { |
119 | return 16000000; | 93 | return 16000000; |
@@ -188,7 +162,7 @@ static struct clk prem_clk = { | |||
188 | 162 | ||
189 | static unsigned long system_clk_get_rate(struct clk *clk) | 163 | static unsigned long system_clk_get_rate(struct clk *clk) |
190 | { | 164 | { |
191 | return mx1_decode_pll(__raw_readl(CCM_SPCTL0), | 165 | return mxc_decode_pll(__raw_readl(CCM_SPCTL0), |
192 | clk_get_rate(clk->parent)); | 166 | clk_get_rate(clk->parent)); |
193 | } | 167 | } |
194 | 168 | ||
@@ -200,7 +174,7 @@ static struct clk system_clk = { | |||
200 | 174 | ||
201 | static unsigned long mcu_clk_get_rate(struct clk *clk) | 175 | static unsigned long mcu_clk_get_rate(struct clk *clk) |
202 | { | 176 | { |
203 | return mx1_decode_pll(__raw_readl(CCM_MPCTL0), | 177 | return mxc_decode_pll(__raw_readl(CCM_MPCTL0), |
204 | clk_get_rate(clk->parent)); | 178 | clk_get_rate(clk->parent)); |
205 | } | 179 | } |
206 | 180 | ||
@@ -488,7 +462,7 @@ static struct clk clko_clk = { | |||
488 | }; | 462 | }; |
489 | 463 | ||
490 | static struct clk dma_clk = { | 464 | static struct clk dma_clk = { |
491 | .name = "dma_clk", | 465 | .name = "dma", |
492 | .parent = &hclk, | 466 | .parent = &hclk, |
493 | .round_rate = _clk_parent_round_rate, | 467 | .round_rate = _clk_parent_round_rate, |
494 | .set_rate = _clk_parent_set_rate, | 468 | .set_rate = _clk_parent_set_rate, |
@@ -539,7 +513,7 @@ static struct clk gpt_clk = { | |||
539 | }; | 513 | }; |
540 | 514 | ||
541 | static struct clk uart_clk = { | 515 | static struct clk uart_clk = { |
542 | .name = "uart_clk", | 516 | .name = "uart", |
543 | .parent = &perclk[0], | 517 | .parent = &perclk[0], |
544 | .round_rate = _clk_parent_round_rate, | 518 | .round_rate = _clk_parent_round_rate, |
545 | .set_rate = _clk_parent_set_rate, | 519 | .set_rate = _clk_parent_set_rate, |
@@ -621,7 +595,7 @@ static struct clk *mxc_clks[] = { | |||
621 | &rtc_clk, | 595 | &rtc_clk, |
622 | }; | 596 | }; |
623 | 597 | ||
624 | int __init mxc_clocks_init(unsigned long fref) | 598 | int __init mx1_clocks_init(unsigned long fref) |
625 | { | 599 | { |
626 | struct clk **clkp; | 600 | struct clk **clkp; |
627 | unsigned int reg; | 601 | unsigned int reg; |
@@ -652,5 +626,7 @@ int __init mxc_clocks_init(unsigned long fref) | |||
652 | clk_enable(&hclk); | 626 | clk_enable(&hclk); |
653 | clk_enable(&fclk); | 627 | clk_enable(&fclk); |
654 | 628 | ||
629 | mxc_timer_init(&gpt_clk); | ||
630 | |||
655 | return 0; | 631 | return 0; |
656 | } | 632 | } |
diff --git a/arch/arm/mach-mx1/devices.c b/arch/arm/mach-mx1/devices.c index 686d8d2dbb24..97f42d96d7a1 100644 --- a/arch/arm/mach-mx1/devices.c +++ b/arch/arm/mach-mx1/devices.c | |||
@@ -23,8 +23,11 @@ | |||
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
26 | #include <mach/irqs.h> | ||
26 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
27 | 28 | ||
29 | #include "devices.h" | ||
30 | |||
28 | static struct resource imx_csi_resources[] = { | 31 | static struct resource imx_csi_resources[] = { |
29 | [0] = { | 32 | [0] = { |
30 | .start = 0x00224000, | 33 | .start = 0x00224000, |
diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mx1ads.c index 2e4b185fe4a9..7ae229bc1b79 100644 --- a/arch/arm/mach-mx1/mx1ads.c +++ b/arch/arm/mach-mx1/mx1ads.c | |||
@@ -16,15 +16,22 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/mtd/physmap.h> | 18 | #include <linux/mtd/physmap.h> |
19 | #include <linux/i2c.h> | ||
20 | #include <linux/i2c/pcf857x.h> | ||
19 | 21 | ||
20 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
21 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
22 | #include <asm/mach/time.h> | 24 | #include <asm/mach/time.h> |
23 | 25 | ||
26 | #include <mach/irqs.h> | ||
24 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
25 | #include <mach/common.h> | 28 | #include <mach/common.h> |
26 | #include <mach/imx-uart.h> | 29 | #include <mach/imx-uart.h> |
27 | #include <mach/iomux-mx1-mx2.h> | 30 | #include <mach/irqs.h> |
31 | #ifdef CONFIG_I2C_IMX | ||
32 | #include <mach/i2c.h> | ||
33 | #endif | ||
34 | #include <mach/iomux.h> | ||
28 | #include "devices.h" | 35 | #include "devices.h" |
29 | 36 | ||
30 | /* | 37 | /* |
@@ -104,6 +111,55 @@ static struct platform_device flash_device = { | |||
104 | }; | 111 | }; |
105 | 112 | ||
106 | /* | 113 | /* |
114 | * I2C | ||
115 | */ | ||
116 | |||
117 | #ifdef CONFIG_I2C_IMX | ||
118 | static int i2c_pins[] = { | ||
119 | PA15_PF_I2C_SDA, | ||
120 | PA16_PF_I2C_SCL, | ||
121 | }; | ||
122 | |||
123 | static int i2c_init(struct device *dev) | ||
124 | { | ||
125 | return mxc_gpio_setup_multiple_pins(i2c_pins, | ||
126 | ARRAY_SIZE(i2c_pins), "I2C"); | ||
127 | } | ||
128 | |||
129 | static void i2c_exit(struct device *dev) | ||
130 | { | ||
131 | mxc_gpio_release_multiple_pins(i2c_pins, | ||
132 | ARRAY_SIZE(i2c_pins)); | ||
133 | } | ||
134 | |||
135 | static struct pcf857x_platform_data pcf857x_data[] = { | ||
136 | { | ||
137 | .gpio_base = 4 * 32, | ||
138 | }, { | ||
139 | .gpio_base = 4 * 32 + 16, | ||
140 | } | ||
141 | }; | ||
142 | |||
143 | static struct imxi2c_platform_data mx1ads_i2c_data = { | ||
144 | .bitrate = 100000, | ||
145 | .init = i2c_init, | ||
146 | .exit = i2c_exit, | ||
147 | }; | ||
148 | |||
149 | static struct i2c_board_info mx1ads_i2c_devices[] = { | ||
150 | { | ||
151 | I2C_BOARD_INFO("pcf857x", 0x22), | ||
152 | .type = "pcf8575", | ||
153 | .platform_data = &pcf857x_data[0], | ||
154 | }, { | ||
155 | I2C_BOARD_INFO("pcf857x", 0x24), | ||
156 | .type = "pcf8575", | ||
157 | .platform_data = &pcf857x_data[1], | ||
158 | }, | ||
159 | }; | ||
160 | #endif | ||
161 | |||
162 | /* | ||
107 | * Board init | 163 | * Board init |
108 | */ | 164 | */ |
109 | static void __init mx1ads_init(void) | 165 | static void __init mx1ads_init(void) |
@@ -114,12 +170,19 @@ static void __init mx1ads_init(void) | |||
114 | 170 | ||
115 | /* Physmap flash */ | 171 | /* Physmap flash */ |
116 | mxc_register_device(&flash_device, &mx1ads_flash_data); | 172 | mxc_register_device(&flash_device, &mx1ads_flash_data); |
173 | |||
174 | /* I2C */ | ||
175 | #ifdef CONFIG_I2C_IMX | ||
176 | i2c_register_board_info(0, mx1ads_i2c_devices, | ||
177 | ARRAY_SIZE(mx1ads_i2c_devices)); | ||
178 | |||
179 | mxc_register_device(&imx_i2c_device, &mx1ads_i2c_data); | ||
180 | #endif | ||
117 | } | 181 | } |
118 | 182 | ||
119 | static void __init mx1ads_timer_init(void) | 183 | static void __init mx1ads_timer_init(void) |
120 | { | 184 | { |
121 | mxc_clocks_init(32000); | 185 | mx1_clocks_init(32000); |
122 | mxc_timer_init("gpt_clk"); | ||
123 | } | 186 | } |
124 | 187 | ||
125 | struct sys_timer mx1ads_timer = { | 188 | struct sys_timer mx1ads_timer = { |
diff --git a/arch/arm/mach-mx1/scb9328.c b/arch/arm/mach-mx1/scb9328.c new file mode 100644 index 000000000000..0e71f3fa28bf --- /dev/null +++ b/arch/arm/mach-mx1/scb9328.c | |||
@@ -0,0 +1,160 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-mx1/scb9328.c | ||
3 | * | ||
4 | * Copyright (c) 2004 Sascha Hauer <saschahauer@web.de> | ||
5 | * Copyright (c) 2006-2008 Juergen Beisert <jbeisert@netscape.net> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/mtd/physmap.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <linux/dm9000.h> | ||
17 | |||
18 | #include <asm/mach-types.h> | ||
19 | #include <asm/mach/arch.h> | ||
20 | #include <asm/mach/time.h> | ||
21 | |||
22 | #include <mach/common.h> | ||
23 | #include <mach/hardware.h> | ||
24 | #include <mach/irqs.h> | ||
25 | #include <mach/imx-uart.h> | ||
26 | #include <mach/iomux.h> | ||
27 | |||
28 | #include "devices.h" | ||
29 | |||
30 | /* | ||
31 | * This scb9328 has a 32MiB flash | ||
32 | */ | ||
33 | static struct resource flash_resource = { | ||
34 | .start = IMX_CS0_PHYS, | ||
35 | .end = IMX_CS0_PHYS + (32 * 1024 * 1024) - 1, | ||
36 | .flags = IORESOURCE_MEM, | ||
37 | }; | ||
38 | |||
39 | static struct physmap_flash_data scb_flash_data = { | ||
40 | .width = 2, | ||
41 | }; | ||
42 | |||
43 | static struct platform_device scb_flash_device = { | ||
44 | .name = "physmap-flash", | ||
45 | .id = 0, | ||
46 | .dev = { | ||
47 | .platform_data = &scb_flash_data, | ||
48 | }, | ||
49 | .resource = &flash_resource, | ||
50 | .num_resources = 1, | ||
51 | }; | ||
52 | |||
53 | /* | ||
54 | * scb9328 has a DM9000 network controller | ||
55 | * connected to CS5, with 16 bit data path | ||
56 | * and interrupt connected to GPIO 3 | ||
57 | */ | ||
58 | |||
59 | /* | ||
60 | * internal datapath is fixed 16 bit | ||
61 | */ | ||
62 | static struct dm9000_plat_data dm9000_platdata = { | ||
63 | .flags = DM9000_PLATF_16BITONLY, | ||
64 | }; | ||
65 | |||
66 | /* | ||
67 | * the DM9000 drivers wants two defined address spaces | ||
68 | * to gain access to address latch registers and the data path. | ||
69 | */ | ||
70 | static struct resource dm9000x_resources[] = { | ||
71 | [0] = { | ||
72 | .name = "address area", | ||
73 | .start = IMX_CS5_PHYS, | ||
74 | .end = IMX_CS5_PHYS + 1, | ||
75 | .flags = IORESOURCE_MEM /* address access */ | ||
76 | }, | ||
77 | [1] = { | ||
78 | .name = "data area", | ||
79 | .start = IMX_CS5_PHYS + 4, | ||
80 | .end = IMX_CS5_PHYS + 5, | ||
81 | .flags = IORESOURCE_MEM /* data access */ | ||
82 | }, | ||
83 | [2] = { | ||
84 | .start = IRQ_GPIOC(3), | ||
85 | .end = IRQ_GPIOC(3), | ||
86 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL | ||
87 | }, | ||
88 | }; | ||
89 | |||
90 | static struct platform_device dm9000x_device = { | ||
91 | .name = "dm9000", | ||
92 | .id = 0, | ||
93 | .num_resources = ARRAY_SIZE(dm9000x_resources), | ||
94 | .resource = dm9000x_resources, | ||
95 | .dev = { | ||
96 | .platform_data = &dm9000_platdata, | ||
97 | } | ||
98 | }; | ||
99 | |||
100 | static int mxc_uart1_pins[] = { | ||
101 | PC9_PF_UART1_CTS, | ||
102 | PC10_PF_UART1_RTS, | ||
103 | PC11_PF_UART1_TXD, | ||
104 | PC12_PF_UART1_RXD, | ||
105 | }; | ||
106 | |||
107 | static int uart1_mxc_init(struct platform_device *pdev) | ||
108 | { | ||
109 | return mxc_gpio_setup_multiple_pins(mxc_uart1_pins, | ||
110 | ARRAY_SIZE(mxc_uart1_pins), "UART1"); | ||
111 | } | ||
112 | |||
113 | static int uart1_mxc_exit(struct platform_device *pdev) | ||
114 | { | ||
115 | mxc_gpio_release_multiple_pins(mxc_uart1_pins, | ||
116 | ARRAY_SIZE(mxc_uart1_pins)); | ||
117 | return 0; | ||
118 | } | ||
119 | |||
120 | static struct imxuart_platform_data uart_pdata = { | ||
121 | .init = uart1_mxc_init, | ||
122 | .exit = uart1_mxc_exit, | ||
123 | .flags = IMXUART_HAVE_RTSCTS, | ||
124 | }; | ||
125 | |||
126 | static struct platform_device *devices[] __initdata = { | ||
127 | &scb_flash_device, | ||
128 | &dm9000x_device, | ||
129 | }; | ||
130 | |||
131 | /* | ||
132 | * scb9328_init - Init the CPU card itself | ||
133 | */ | ||
134 | static void __init scb9328_init(void) | ||
135 | { | ||
136 | mxc_register_device(&imx_uart1_device, &uart_pdata); | ||
137 | |||
138 | printk(KERN_INFO"Scb9328: Adding devices\n"); | ||
139 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
140 | } | ||
141 | |||
142 | static void __init scb9328_timer_init(void) | ||
143 | { | ||
144 | mx1_clocks_init(32000); | ||
145 | } | ||
146 | |||
147 | static struct sys_timer scb9328_timer = { | ||
148 | .init = scb9328_timer_init, | ||
149 | }; | ||
150 | |||
151 | MACHINE_START(SCB9328, "Synertronixx scb9328") | ||
152 | /* Sascha Hauer */ | ||
153 | .phys_io = 0x00200000, | ||
154 | .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc, | ||
155 | .boot_params = 0x08000100, | ||
156 | .map_io = mxc_map_io, | ||
157 | .init_irq = mxc_init_irq, | ||
158 | .timer = &scb9328_timer, | ||
159 | .init_machine = scb9328_init, | ||
160 | MACHINE_END | ||
diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig index 1eaa97cb716d..42a788842f49 100644 --- a/arch/arm/mach-mx2/Kconfig +++ b/arch/arm/mach-mx2/Kconfig | |||
@@ -1,14 +1,22 @@ | |||
1 | comment "MX2 family CPU support" | 1 | if ARCH_MX2 |
2 | depends on ARCH_MX2 | 2 | |
3 | choice | ||
4 | prompt "CPUs:" | ||
5 | default MACH_MX21 | ||
6 | |||
7 | config MACH_MX21 | ||
8 | bool "i.MX21 support" | ||
9 | help | ||
10 | This enables support for Freescale's MX2 based i.MX21 processor. | ||
3 | 11 | ||
4 | config MACH_MX27 | 12 | config MACH_MX27 |
5 | bool "i.MX27 support" | 13 | bool "i.MX27 support" |
6 | depends on ARCH_MX2 | ||
7 | help | 14 | help |
8 | This enables support for Freescale's MX2 based i.MX27 processor. | 15 | This enables support for Freescale's MX2 based i.MX27 processor. |
9 | 16 | ||
10 | comment "MX2 Platforms" | 17 | endchoice |
11 | depends on ARCH_MX2 | 18 | |
19 | comment "MX2 platforms:" | ||
12 | 20 | ||
13 | config MACH_MX27ADS | 21 | config MACH_MX27ADS |
14 | bool "MX27ADS platform" | 22 | bool "MX27ADS platform" |
@@ -37,3 +45,5 @@ config MACH_PCM970_BASEBOARD | |||
37 | PCM970 evaluation board. | 45 | PCM970 evaluation board. |
38 | 46 | ||
39 | endchoice | 47 | endchoice |
48 | |||
49 | endif | ||
diff --git a/arch/arm/mach-mx2/Makefile b/arch/arm/mach-mx2/Makefile index 382d86080e86..6e1a2bffc812 100644 --- a/arch/arm/mach-mx2/Makefile +++ b/arch/arm/mach-mx2/Makefile | |||
@@ -6,6 +6,8 @@ | |||
6 | 6 | ||
7 | obj-y := system.o generic.o devices.o serial.o | 7 | obj-y := system.o generic.o devices.o serial.o |
8 | 8 | ||
9 | obj-$(CONFIG_MACH_MX21) += clock_imx21.o | ||
10 | |||
9 | obj-$(CONFIG_MACH_MX27) += cpu_imx27.o | 11 | obj-$(CONFIG_MACH_MX27) += cpu_imx27.o |
10 | obj-$(CONFIG_MACH_MX27) += clock_imx27.o | 12 | obj-$(CONFIG_MACH_MX27) += clock_imx27.o |
11 | 13 | ||
diff --git a/arch/arm/mach-mx2/Makefile.boot b/arch/arm/mach-mx2/Makefile.boot index 696831dcd485..e867398a8fdb 100644 --- a/arch/arm/mach-mx2/Makefile.boot +++ b/arch/arm/mach-mx2/Makefile.boot | |||
@@ -1,3 +1,7 @@ | |||
1 | zreladdr-y := 0xA0008000 | 1 | zreladdr-$(CONFIG_MACH_MX21) := 0xC0008000 |
2 | params_phys-y := 0xA0000100 | 2 | params_phys-$(CONFIG_MACH_MX21) := 0xC0000100 |
3 | initrd_phys-y := 0xA0800000 | 3 | initrd_phys-$(CONFIG_MACH_MX21) := 0xC0800000 |
4 | |||
5 | zreladdr-$(CONFIG_MACH_MX27) := 0xA0008000 | ||
6 | params_phys-$(CONFIG_MACH_MX27) := 0xA0000100 | ||
7 | initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000 | ||
diff --git a/arch/arm/mach-mx2/clock_imx21.c b/arch/arm/mach-mx2/clock_imx21.c new file mode 100644 index 000000000000..2dee5c87614c --- /dev/null +++ b/arch/arm/mach-mx2/clock_imx21.c | |||
@@ -0,0 +1,984 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
4 | * Copyright 2008 Martin Fuzzey, mfuzzey@gmail.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 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 | #include <linux/clk.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/module.h> | ||
24 | |||
25 | #include <mach/clock.h> | ||
26 | #include <mach/common.h> | ||
27 | #include <asm/clkdev.h> | ||
28 | #include <asm/div64.h> | ||
29 | |||
30 | #include "crm_regs.h" | ||
31 | |||
32 | static int _clk_enable(struct clk *clk) | ||
33 | { | ||
34 | u32 reg; | ||
35 | |||
36 | reg = __raw_readl(clk->enable_reg); | ||
37 | reg |= 1 << clk->enable_shift; | ||
38 | __raw_writel(reg, clk->enable_reg); | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | static void _clk_disable(struct clk *clk) | ||
43 | { | ||
44 | u32 reg; | ||
45 | |||
46 | reg = __raw_readl(clk->enable_reg); | ||
47 | reg &= ~(1 << clk->enable_shift); | ||
48 | __raw_writel(reg, clk->enable_reg); | ||
49 | } | ||
50 | |||
51 | static int _clk_spll_enable(struct clk *clk) | ||
52 | { | ||
53 | u32 reg; | ||
54 | |||
55 | reg = __raw_readl(CCM_CSCR); | ||
56 | reg |= CCM_CSCR_SPEN; | ||
57 | __raw_writel(reg, CCM_CSCR); | ||
58 | |||
59 | while ((__raw_readl(CCM_SPCTL1) & CCM_SPCTL1_LF) == 0) | ||
60 | ; | ||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | static void _clk_spll_disable(struct clk *clk) | ||
65 | { | ||
66 | u32 reg; | ||
67 | |||
68 | reg = __raw_readl(CCM_CSCR); | ||
69 | reg &= ~CCM_CSCR_SPEN; | ||
70 | __raw_writel(reg, CCM_CSCR); | ||
71 | } | ||
72 | |||
73 | |||
74 | #define CSCR() (__raw_readl(CCM_CSCR)) | ||
75 | #define PCDR0() (__raw_readl(CCM_PCDR0)) | ||
76 | #define PCDR1() (__raw_readl(CCM_PCDR1)) | ||
77 | |||
78 | static unsigned long _clk_perclkx_round_rate(struct clk *clk, | ||
79 | unsigned long rate) | ||
80 | { | ||
81 | u32 div; | ||
82 | unsigned long parent_rate; | ||
83 | |||
84 | parent_rate = clk_get_rate(clk->parent); | ||
85 | |||
86 | div = parent_rate / rate; | ||
87 | if (parent_rate % rate) | ||
88 | div++; | ||
89 | |||
90 | if (div > 64) | ||
91 | div = 64; | ||
92 | |||
93 | return parent_rate / div; | ||
94 | } | ||
95 | |||
96 | static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) | ||
97 | { | ||
98 | u32 reg; | ||
99 | u32 div; | ||
100 | unsigned long parent_rate; | ||
101 | |||
102 | parent_rate = clk_get_rate(clk->parent); | ||
103 | |||
104 | if (clk->id < 0 || clk->id > 3) | ||
105 | return -EINVAL; | ||
106 | |||
107 | div = parent_rate / rate; | ||
108 | if (div > 64 || div < 1 || ((parent_rate / div) != rate)) | ||
109 | return -EINVAL; | ||
110 | div--; | ||
111 | |||
112 | reg = | ||
113 | __raw_readl(CCM_PCDR1) & ~(CCM_PCDR1_PERDIV1_MASK << | ||
114 | (clk->id << 3)); | ||
115 | reg |= div << (clk->id << 3); | ||
116 | __raw_writel(reg, CCM_PCDR1); | ||
117 | |||
118 | return 0; | ||
119 | } | ||
120 | |||
121 | static unsigned long _clk_usb_recalc(struct clk *clk) | ||
122 | { | ||
123 | unsigned long usb_pdf; | ||
124 | unsigned long parent_rate; | ||
125 | |||
126 | parent_rate = clk_get_rate(clk->parent); | ||
127 | |||
128 | usb_pdf = (CSCR() & CCM_CSCR_USB_MASK) >> CCM_CSCR_USB_OFFSET; | ||
129 | |||
130 | return parent_rate / (usb_pdf + 1U); | ||
131 | } | ||
132 | |||
133 | static unsigned long _clk_ssix_recalc(struct clk *clk, unsigned long pdf) | ||
134 | { | ||
135 | unsigned long parent_rate; | ||
136 | |||
137 | parent_rate = clk_get_rate(clk->parent); | ||
138 | |||
139 | pdf = (pdf < 2) ? 124UL : pdf; /* MX21 & MX27 TO1 */ | ||
140 | |||
141 | return 2UL * parent_rate / pdf; | ||
142 | } | ||
143 | |||
144 | static unsigned long _clk_ssi1_recalc(struct clk *clk) | ||
145 | { | ||
146 | return _clk_ssix_recalc(clk, | ||
147 | (PCDR0() & CCM_PCDR0_SSI1BAUDDIV_MASK) | ||
148 | >> CCM_PCDR0_SSI1BAUDDIV_OFFSET); | ||
149 | } | ||
150 | |||
151 | static unsigned long _clk_ssi2_recalc(struct clk *clk) | ||
152 | { | ||
153 | return _clk_ssix_recalc(clk, | ||
154 | (PCDR0() & CCM_PCDR0_SSI2BAUDDIV_MASK) >> | ||
155 | CCM_PCDR0_SSI2BAUDDIV_OFFSET); | ||
156 | } | ||
157 | |||
158 | static unsigned long _clk_nfc_recalc(struct clk *clk) | ||
159 | { | ||
160 | unsigned long nfc_pdf; | ||
161 | unsigned long parent_rate; | ||
162 | |||
163 | parent_rate = clk_get_rate(clk->parent); | ||
164 | |||
165 | nfc_pdf = (PCDR0() & CCM_PCDR0_NFCDIV_MASK) | ||
166 | >> CCM_PCDR0_NFCDIV_OFFSET; | ||
167 | |||
168 | return parent_rate / (nfc_pdf + 1); | ||
169 | } | ||
170 | |||
171 | static unsigned long _clk_parent_round_rate(struct clk *clk, unsigned long rate) | ||
172 | { | ||
173 | return clk->parent->round_rate(clk->parent, rate); | ||
174 | } | ||
175 | |||
176 | static int _clk_parent_set_rate(struct clk *clk, unsigned long rate) | ||
177 | { | ||
178 | return clk->parent->set_rate(clk->parent, rate); | ||
179 | } | ||
180 | |||
181 | static unsigned long external_high_reference; /* in Hz */ | ||
182 | |||
183 | static unsigned long get_high_reference_clock_rate(struct clk *clk) | ||
184 | { | ||
185 | return external_high_reference; | ||
186 | } | ||
187 | |||
188 | /* | ||
189 | * the high frequency external clock reference | ||
190 | * Default case is 26MHz. | ||
191 | */ | ||
192 | static struct clk ckih_clk = { | ||
193 | .get_rate = get_high_reference_clock_rate, | ||
194 | }; | ||
195 | |||
196 | static unsigned long external_low_reference; /* in Hz */ | ||
197 | |||
198 | static unsigned long get_low_reference_clock_rate(struct clk *clk) | ||
199 | { | ||
200 | return external_low_reference; | ||
201 | } | ||
202 | |||
203 | /* | ||
204 | * the low frequency external clock reference | ||
205 | * Default case is 32.768kHz. | ||
206 | */ | ||
207 | static struct clk ckil_clk = { | ||
208 | .get_rate = get_low_reference_clock_rate, | ||
209 | }; | ||
210 | |||
211 | |||
212 | static unsigned long _clk_fpm_recalc(struct clk *clk) | ||
213 | { | ||
214 | return clk_get_rate(clk->parent) * 512; | ||
215 | } | ||
216 | |||
217 | /* Output of frequency pre multiplier */ | ||
218 | static struct clk fpm_clk = { | ||
219 | .parent = &ckil_clk, | ||
220 | .get_rate = _clk_fpm_recalc, | ||
221 | }; | ||
222 | |||
223 | static unsigned long get_mpll_clk(struct clk *clk) | ||
224 | { | ||
225 | uint32_t reg; | ||
226 | unsigned long ref_clk; | ||
227 | unsigned long mfi = 0, mfn = 0, mfd = 0, pdf = 0; | ||
228 | unsigned long long temp; | ||
229 | |||
230 | ref_clk = clk_get_rate(clk->parent); | ||
231 | |||
232 | reg = __raw_readl(CCM_MPCTL0); | ||
233 | pdf = (reg & CCM_MPCTL0_PD_MASK) >> CCM_MPCTL0_PD_OFFSET; | ||
234 | mfd = (reg & CCM_MPCTL0_MFD_MASK) >> CCM_MPCTL0_MFD_OFFSET; | ||
235 | mfi = (reg & CCM_MPCTL0_MFI_MASK) >> CCM_MPCTL0_MFI_OFFSET; | ||
236 | mfn = (reg & CCM_MPCTL0_MFN_MASK) >> CCM_MPCTL0_MFN_OFFSET; | ||
237 | |||
238 | mfi = (mfi <= 5) ? 5 : mfi; | ||
239 | temp = 2LL * ref_clk * mfn; | ||
240 | do_div(temp, mfd + 1); | ||
241 | temp = 2LL * ref_clk * mfi + temp; | ||
242 | do_div(temp, pdf + 1); | ||
243 | |||
244 | return (unsigned long)temp; | ||
245 | } | ||
246 | |||
247 | static struct clk mpll_clk = { | ||
248 | .parent = &ckih_clk, | ||
249 | .get_rate = get_mpll_clk, | ||
250 | }; | ||
251 | |||
252 | static unsigned long _clk_fclk_get_rate(struct clk *clk) | ||
253 | { | ||
254 | unsigned long parent_rate; | ||
255 | u32 div; | ||
256 | |||
257 | div = (CSCR() & CCM_CSCR_PRESC_MASK) >> CCM_CSCR_PRESC_OFFSET; | ||
258 | parent_rate = clk_get_rate(clk->parent); | ||
259 | |||
260 | return parent_rate / (div+1); | ||
261 | } | ||
262 | |||
263 | static struct clk fclk_clk = { | ||
264 | .parent = &mpll_clk, | ||
265 | .get_rate = _clk_fclk_get_rate | ||
266 | }; | ||
267 | |||
268 | static unsigned long get_spll_clk(struct clk *clk) | ||
269 | { | ||
270 | uint32_t reg; | ||
271 | unsigned long ref_clk; | ||
272 | unsigned long mfi = 0, mfn = 0, mfd = 0, pdf = 0; | ||
273 | unsigned long long temp; | ||
274 | |||
275 | ref_clk = clk_get_rate(clk->parent); | ||
276 | |||
277 | reg = __raw_readl(CCM_SPCTL0); | ||
278 | pdf = (reg & CCM_SPCTL0_PD_MASK) >> CCM_SPCTL0_PD_OFFSET; | ||
279 | mfd = (reg & CCM_SPCTL0_MFD_MASK) >> CCM_SPCTL0_MFD_OFFSET; | ||
280 | mfi = (reg & CCM_SPCTL0_MFI_MASK) >> CCM_SPCTL0_MFI_OFFSET; | ||
281 | mfn = (reg & CCM_SPCTL0_MFN_MASK) >> CCM_SPCTL0_MFN_OFFSET; | ||
282 | |||
283 | mfi = (mfi <= 5) ? 5 : mfi; | ||
284 | temp = 2LL * ref_clk * mfn; | ||
285 | do_div(temp, mfd + 1); | ||
286 | temp = 2LL * ref_clk * mfi + temp; | ||
287 | do_div(temp, pdf + 1); | ||
288 | |||
289 | return (unsigned long)temp; | ||
290 | } | ||
291 | |||
292 | static struct clk spll_clk = { | ||
293 | .parent = &ckih_clk, | ||
294 | .get_rate = get_spll_clk, | ||
295 | .enable = _clk_spll_enable, | ||
296 | .disable = _clk_spll_disable, | ||
297 | }; | ||
298 | |||
299 | static unsigned long get_hclk_clk(struct clk *clk) | ||
300 | { | ||
301 | unsigned long rate; | ||
302 | unsigned long bclk_pdf; | ||
303 | |||
304 | bclk_pdf = (CSCR() & CCM_CSCR_BCLK_MASK) | ||
305 | >> CCM_CSCR_BCLK_OFFSET; | ||
306 | |||
307 | rate = clk_get_rate(clk->parent); | ||
308 | return rate / (bclk_pdf + 1); | ||
309 | } | ||
310 | |||
311 | static struct clk hclk_clk = { | ||
312 | .parent = &fclk_clk, | ||
313 | .get_rate = get_hclk_clk, | ||
314 | }; | ||
315 | |||
316 | static unsigned long get_ipg_clk(struct clk *clk) | ||
317 | { | ||
318 | unsigned long rate; | ||
319 | unsigned long ipg_pdf; | ||
320 | |||
321 | ipg_pdf = (CSCR() & CCM_CSCR_IPDIV) >> CCM_CSCR_IPDIV_OFFSET; | ||
322 | |||
323 | rate = clk_get_rate(clk->parent); | ||
324 | return rate / (ipg_pdf + 1); | ||
325 | } | ||
326 | |||
327 | static struct clk ipg_clk = { | ||
328 | .parent = &hclk_clk, | ||
329 | .get_rate = get_ipg_clk, | ||
330 | }; | ||
331 | |||
332 | static unsigned long _clk_perclkx_recalc(struct clk *clk) | ||
333 | { | ||
334 | unsigned long perclk_pdf; | ||
335 | unsigned long parent_rate; | ||
336 | |||
337 | parent_rate = clk_get_rate(clk->parent); | ||
338 | |||
339 | if (clk->id < 0 || clk->id > 3) | ||
340 | return 0; | ||
341 | |||
342 | perclk_pdf = (PCDR1() >> (clk->id << 3)) & CCM_PCDR1_PERDIV1_MASK; | ||
343 | |||
344 | return parent_rate / (perclk_pdf + 1); | ||
345 | } | ||
346 | |||
347 | static struct clk per_clk[] = { | ||
348 | { | ||
349 | .id = 0, | ||
350 | .parent = &mpll_clk, | ||
351 | .get_rate = _clk_perclkx_recalc, | ||
352 | }, { | ||
353 | .id = 1, | ||
354 | .parent = &mpll_clk, | ||
355 | .get_rate = _clk_perclkx_recalc, | ||
356 | }, { | ||
357 | .id = 2, | ||
358 | .parent = &mpll_clk, | ||
359 | .round_rate = _clk_perclkx_round_rate, | ||
360 | .set_rate = _clk_perclkx_set_rate, | ||
361 | .get_rate = _clk_perclkx_recalc, | ||
362 | /* Enable/Disable done via lcd_clkc[1] */ | ||
363 | }, { | ||
364 | .id = 3, | ||
365 | .parent = &mpll_clk, | ||
366 | .round_rate = _clk_perclkx_round_rate, | ||
367 | .set_rate = _clk_perclkx_set_rate, | ||
368 | .get_rate = _clk_perclkx_recalc, | ||
369 | /* Enable/Disable done via csi_clk[1] */ | ||
370 | }, | ||
371 | }; | ||
372 | |||
373 | static struct clk uart_ipg_clk[]; | ||
374 | |||
375 | static struct clk uart_clk[] = { | ||
376 | { | ||
377 | .id = 0, | ||
378 | .parent = &per_clk[0], | ||
379 | .secondary = &uart_ipg_clk[0], | ||
380 | }, { | ||
381 | .id = 1, | ||
382 | .parent = &per_clk[0], | ||
383 | .secondary = &uart_ipg_clk[1], | ||
384 | }, { | ||
385 | .id = 2, | ||
386 | .parent = &per_clk[0], | ||
387 | .secondary = &uart_ipg_clk[2], | ||
388 | }, { | ||
389 | .id = 3, | ||
390 | .parent = &per_clk[0], | ||
391 | .secondary = &uart_ipg_clk[3], | ||
392 | }, | ||
393 | }; | ||
394 | |||
395 | static struct clk uart_ipg_clk[] = { | ||
396 | { | ||
397 | .id = 0, | ||
398 | .parent = &ipg_clk, | ||
399 | .enable = _clk_enable, | ||
400 | .enable_reg = CCM_PCCR_UART1_REG, | ||
401 | .enable_shift = CCM_PCCR_UART1_OFFSET, | ||
402 | .disable = _clk_disable, | ||
403 | }, { | ||
404 | .id = 1, | ||
405 | .parent = &ipg_clk, | ||
406 | .enable = _clk_enable, | ||
407 | .enable_reg = CCM_PCCR_UART2_REG, | ||
408 | .enable_shift = CCM_PCCR_UART2_OFFSET, | ||
409 | .disable = _clk_disable, | ||
410 | }, { | ||
411 | .id = 2, | ||
412 | .parent = &ipg_clk, | ||
413 | .enable = _clk_enable, | ||
414 | .enable_reg = CCM_PCCR_UART3_REG, | ||
415 | .enable_shift = CCM_PCCR_UART3_OFFSET, | ||
416 | .disable = _clk_disable, | ||
417 | }, { | ||
418 | .id = 3, | ||
419 | .parent = &ipg_clk, | ||
420 | .enable = _clk_enable, | ||
421 | .enable_reg = CCM_PCCR_UART4_REG, | ||
422 | .enable_shift = CCM_PCCR_UART4_OFFSET, | ||
423 | .disable = _clk_disable, | ||
424 | }, | ||
425 | }; | ||
426 | |||
427 | static struct clk gpt_ipg_clk[]; | ||
428 | |||
429 | static struct clk gpt_clk[] = { | ||
430 | { | ||
431 | .id = 0, | ||
432 | .parent = &per_clk[0], | ||
433 | .secondary = &gpt_ipg_clk[0], | ||
434 | }, { | ||
435 | .id = 1, | ||
436 | .parent = &per_clk[0], | ||
437 | .secondary = &gpt_ipg_clk[1], | ||
438 | }, { | ||
439 | .id = 2, | ||
440 | .parent = &per_clk[0], | ||
441 | .secondary = &gpt_ipg_clk[2], | ||
442 | }, | ||
443 | }; | ||
444 | |||
445 | static struct clk gpt_ipg_clk[] = { | ||
446 | { | ||
447 | .id = 0, | ||
448 | .parent = &ipg_clk, | ||
449 | .enable = _clk_enable, | ||
450 | .enable_reg = CCM_PCCR_GPT1_REG, | ||
451 | .enable_shift = CCM_PCCR_GPT1_OFFSET, | ||
452 | .disable = _clk_disable, | ||
453 | }, { | ||
454 | .id = 1, | ||
455 | .parent = &ipg_clk, | ||
456 | .enable = _clk_enable, | ||
457 | .enable_reg = CCM_PCCR_GPT2_REG, | ||
458 | .enable_shift = CCM_PCCR_GPT2_OFFSET, | ||
459 | .disable = _clk_disable, | ||
460 | }, { | ||
461 | .id = 2, | ||
462 | .parent = &ipg_clk, | ||
463 | .enable = _clk_enable, | ||
464 | .enable_reg = CCM_PCCR_GPT3_REG, | ||
465 | .enable_shift = CCM_PCCR_GPT3_OFFSET, | ||
466 | .disable = _clk_disable, | ||
467 | }, | ||
468 | }; | ||
469 | |||
470 | static struct clk pwm_clk[] = { | ||
471 | { | ||
472 | .parent = &per_clk[0], | ||
473 | .secondary = &pwm_clk[1], | ||
474 | }, { | ||
475 | .parent = &ipg_clk, | ||
476 | .enable = _clk_enable, | ||
477 | .enable_reg = CCM_PCCR_PWM_REG, | ||
478 | .enable_shift = CCM_PCCR_PWM_OFFSET, | ||
479 | .disable = _clk_disable, | ||
480 | }, | ||
481 | }; | ||
482 | |||
483 | static struct clk sdhc_ipg_clk[]; | ||
484 | |||
485 | static struct clk sdhc_clk[] = { | ||
486 | { | ||
487 | .id = 0, | ||
488 | .parent = &per_clk[1], | ||
489 | .secondary = &sdhc_ipg_clk[0], | ||
490 | }, { | ||
491 | .id = 1, | ||
492 | .parent = &per_clk[1], | ||
493 | .secondary = &sdhc_ipg_clk[1], | ||
494 | }, | ||
495 | }; | ||
496 | |||
497 | static struct clk sdhc_ipg_clk[] = { | ||
498 | { | ||
499 | .id = 0, | ||
500 | .parent = &ipg_clk, | ||
501 | .enable = _clk_enable, | ||
502 | .enable_reg = CCM_PCCR_SDHC1_REG, | ||
503 | .enable_shift = CCM_PCCR_SDHC1_OFFSET, | ||
504 | .disable = _clk_disable, | ||
505 | }, { | ||
506 | .id = 1, | ||
507 | .parent = &ipg_clk, | ||
508 | .enable = _clk_enable, | ||
509 | .enable_reg = CCM_PCCR_SDHC2_REG, | ||
510 | .enable_shift = CCM_PCCR_SDHC2_OFFSET, | ||
511 | .disable = _clk_disable, | ||
512 | }, | ||
513 | }; | ||
514 | |||
515 | static struct clk cspi_ipg_clk[]; | ||
516 | |||
517 | static struct clk cspi_clk[] = { | ||
518 | { | ||
519 | .id = 0, | ||
520 | .parent = &per_clk[1], | ||
521 | .secondary = &cspi_ipg_clk[0], | ||
522 | }, { | ||
523 | .id = 1, | ||
524 | .parent = &per_clk[1], | ||
525 | .secondary = &cspi_ipg_clk[1], | ||
526 | }, { | ||
527 | .id = 2, | ||
528 | .parent = &per_clk[1], | ||
529 | .secondary = &cspi_ipg_clk[2], | ||
530 | }, | ||
531 | }; | ||
532 | |||
533 | static struct clk cspi_ipg_clk[] = { | ||
534 | { | ||
535 | .id = 0, | ||
536 | .parent = &ipg_clk, | ||
537 | .enable = _clk_enable, | ||
538 | .enable_reg = CCM_PCCR_CSPI1_REG, | ||
539 | .enable_shift = CCM_PCCR_CSPI1_OFFSET, | ||
540 | .disable = _clk_disable, | ||
541 | }, { | ||
542 | .id = 1, | ||
543 | .parent = &ipg_clk, | ||
544 | .enable = _clk_enable, | ||
545 | .enable_reg = CCM_PCCR_CSPI2_REG, | ||
546 | .enable_shift = CCM_PCCR_CSPI2_OFFSET, | ||
547 | .disable = _clk_disable, | ||
548 | }, { | ||
549 | .id = 3, | ||
550 | .parent = &ipg_clk, | ||
551 | .enable = _clk_enable, | ||
552 | .enable_reg = CCM_PCCR_CSPI3_REG, | ||
553 | .enable_shift = CCM_PCCR_CSPI3_OFFSET, | ||
554 | .disable = _clk_disable, | ||
555 | }, | ||
556 | }; | ||
557 | |||
558 | static struct clk lcdc_clk[] = { | ||
559 | { | ||
560 | .parent = &per_clk[2], | ||
561 | .secondary = &lcdc_clk[1], | ||
562 | .round_rate = _clk_parent_round_rate, | ||
563 | .set_rate = _clk_parent_set_rate, | ||
564 | }, { | ||
565 | .parent = &ipg_clk, | ||
566 | .secondary = &lcdc_clk[2], | ||
567 | .enable = _clk_enable, | ||
568 | .enable_reg = CCM_PCCR_LCDC_REG, | ||
569 | .enable_shift = CCM_PCCR_LCDC_OFFSET, | ||
570 | .disable = _clk_disable, | ||
571 | }, { | ||
572 | .parent = &hclk_clk, | ||
573 | .enable = _clk_enable, | ||
574 | .enable_reg = CCM_PCCR_HCLK_LCDC_REG, | ||
575 | .enable_shift = CCM_PCCR_HCLK_LCDC_OFFSET, | ||
576 | .disable = _clk_disable, | ||
577 | }, | ||
578 | }; | ||
579 | |||
580 | static struct clk csi_clk[] = { | ||
581 | { | ||
582 | .parent = &per_clk[3], | ||
583 | .secondary = &csi_clk[1], | ||
584 | .round_rate = _clk_parent_round_rate, | ||
585 | .set_rate = _clk_parent_set_rate, | ||
586 | }, { | ||
587 | .parent = &hclk_clk, | ||
588 | .enable = _clk_enable, | ||
589 | .enable_reg = CCM_PCCR_HCLK_CSI_REG, | ||
590 | .enable_shift = CCM_PCCR_HCLK_CSI_OFFSET, | ||
591 | .disable = _clk_disable, | ||
592 | }, | ||
593 | }; | ||
594 | |||
595 | static struct clk usb_clk[] = { | ||
596 | { | ||
597 | .parent = &spll_clk, | ||
598 | .get_rate = _clk_usb_recalc, | ||
599 | .enable = _clk_enable, | ||
600 | .enable_reg = CCM_PCCR_USBOTG_REG, | ||
601 | .enable_shift = CCM_PCCR_USBOTG_OFFSET, | ||
602 | .disable = _clk_disable, | ||
603 | }, { | ||
604 | .parent = &hclk_clk, | ||
605 | .enable = _clk_enable, | ||
606 | .enable_reg = CCM_PCCR_HCLK_USBOTG_REG, | ||
607 | .enable_shift = CCM_PCCR_HCLK_USBOTG_OFFSET, | ||
608 | .disable = _clk_disable, | ||
609 | } | ||
610 | }; | ||
611 | |||
612 | static struct clk ssi_ipg_clk[]; | ||
613 | |||
614 | static struct clk ssi_clk[] = { | ||
615 | { | ||
616 | .id = 0, | ||
617 | .parent = &mpll_clk, | ||
618 | .secondary = &ssi_ipg_clk[0], | ||
619 | .get_rate = _clk_ssi1_recalc, | ||
620 | .enable = _clk_enable, | ||
621 | .enable_reg = CCM_PCCR_SSI1_BAUD_REG, | ||
622 | .enable_shift = CCM_PCCR_SSI1_BAUD_OFFSET, | ||
623 | .disable = _clk_disable, | ||
624 | }, { | ||
625 | .id = 1, | ||
626 | .parent = &mpll_clk, | ||
627 | .secondary = &ssi_ipg_clk[1], | ||
628 | .get_rate = _clk_ssi2_recalc, | ||
629 | .enable = _clk_enable, | ||
630 | .enable_reg = CCM_PCCR_SSI2_BAUD_REG, | ||
631 | .enable_shift = CCM_PCCR_SSI2_BAUD_OFFSET, | ||
632 | .disable = _clk_disable, | ||
633 | }, | ||
634 | }; | ||
635 | |||
636 | static struct clk ssi_ipg_clk[] = { | ||
637 | { | ||
638 | .id = 0, | ||
639 | .parent = &ipg_clk, | ||
640 | .enable = _clk_enable, | ||
641 | .enable_reg = CCM_PCCR_SSI1_REG, | ||
642 | .enable_shift = CCM_PCCR_SSI1_IPG_OFFSET, | ||
643 | .disable = _clk_disable, | ||
644 | }, { | ||
645 | .id = 1, | ||
646 | .parent = &ipg_clk, | ||
647 | .enable = _clk_enable, | ||
648 | .enable_reg = CCM_PCCR_SSI2_REG, | ||
649 | .enable_shift = CCM_PCCR_SSI2_IPG_OFFSET, | ||
650 | .disable = _clk_disable, | ||
651 | }, | ||
652 | }; | ||
653 | |||
654 | |||
655 | static struct clk nfc_clk = { | ||
656 | .parent = &fclk_clk, | ||
657 | .get_rate = _clk_nfc_recalc, | ||
658 | .enable = _clk_enable, | ||
659 | .enable_reg = CCM_PCCR_NFC_REG, | ||
660 | .enable_shift = CCM_PCCR_NFC_OFFSET, | ||
661 | .disable = _clk_disable, | ||
662 | }; | ||
663 | |||
664 | static struct clk dma_clk[] = { | ||
665 | { | ||
666 | .parent = &hclk_clk, | ||
667 | .enable = _clk_enable, | ||
668 | .enable_reg = CCM_PCCR_DMA_REG, | ||
669 | .enable_shift = CCM_PCCR_DMA_OFFSET, | ||
670 | .disable = _clk_disable, | ||
671 | .secondary = &dma_clk[1], | ||
672 | }, { | ||
673 | .enable = _clk_enable, | ||
674 | .enable_reg = CCM_PCCR_HCLK_DMA_REG, | ||
675 | .enable_shift = CCM_PCCR_HCLK_DMA_OFFSET, | ||
676 | .disable = _clk_disable, | ||
677 | }, | ||
678 | }; | ||
679 | |||
680 | static struct clk brom_clk = { | ||
681 | .parent = &hclk_clk, | ||
682 | .enable = _clk_enable, | ||
683 | .enable_reg = CCM_PCCR_HCLK_BROM_REG, | ||
684 | .enable_shift = CCM_PCCR_HCLK_BROM_OFFSET, | ||
685 | .disable = _clk_disable, | ||
686 | }; | ||
687 | |||
688 | static struct clk emma_clk[] = { | ||
689 | { | ||
690 | .parent = &hclk_clk, | ||
691 | .enable = _clk_enable, | ||
692 | .enable_reg = CCM_PCCR_EMMA_REG, | ||
693 | .enable_shift = CCM_PCCR_EMMA_OFFSET, | ||
694 | .disable = _clk_disable, | ||
695 | .secondary = &emma_clk[1], | ||
696 | }, { | ||
697 | .enable = _clk_enable, | ||
698 | .enable_reg = CCM_PCCR_HCLK_EMMA_REG, | ||
699 | .enable_shift = CCM_PCCR_HCLK_EMMA_OFFSET, | ||
700 | .disable = _clk_disable, | ||
701 | } | ||
702 | }; | ||
703 | |||
704 | static struct clk slcdc_clk[] = { | ||
705 | { | ||
706 | .parent = &hclk_clk, | ||
707 | .enable = _clk_enable, | ||
708 | .enable_reg = CCM_PCCR_SLCDC_REG, | ||
709 | .enable_shift = CCM_PCCR_SLCDC_OFFSET, | ||
710 | .disable = _clk_disable, | ||
711 | .secondary = &slcdc_clk[1], | ||
712 | }, { | ||
713 | .enable = _clk_enable, | ||
714 | .enable_reg = CCM_PCCR_HCLK_SLCDC_REG, | ||
715 | .enable_shift = CCM_PCCR_HCLK_SLCDC_OFFSET, | ||
716 | .disable = _clk_disable, | ||
717 | } | ||
718 | }; | ||
719 | |||
720 | static struct clk wdog_clk = { | ||
721 | .parent = &ipg_clk, | ||
722 | .enable = _clk_enable, | ||
723 | .enable_reg = CCM_PCCR_WDT_REG, | ||
724 | .enable_shift = CCM_PCCR_WDT_OFFSET, | ||
725 | .disable = _clk_disable, | ||
726 | }; | ||
727 | |||
728 | static struct clk gpio_clk = { | ||
729 | .parent = &ipg_clk, | ||
730 | .enable = _clk_enable, | ||
731 | .enable_reg = CCM_PCCR_GPIO_REG, | ||
732 | .enable_shift = CCM_PCCR_GPIO_OFFSET, | ||
733 | .disable = _clk_disable, | ||
734 | }; | ||
735 | |||
736 | static struct clk i2c_clk = { | ||
737 | .id = 0, | ||
738 | .parent = &ipg_clk, | ||
739 | .enable = _clk_enable, | ||
740 | .enable_reg = CCM_PCCR_I2C1_REG, | ||
741 | .enable_shift = CCM_PCCR_I2C1_OFFSET, | ||
742 | .disable = _clk_disable, | ||
743 | }; | ||
744 | |||
745 | static struct clk kpp_clk = { | ||
746 | .parent = &ipg_clk, | ||
747 | .enable = _clk_enable, | ||
748 | .enable_reg = CCM_PCCR_KPP_REG, | ||
749 | .enable_shift = CCM_PCCR_KPP_OFFSET, | ||
750 | .disable = _clk_disable, | ||
751 | }; | ||
752 | |||
753 | static struct clk owire_clk = { | ||
754 | .parent = &ipg_clk, | ||
755 | .enable = _clk_enable, | ||
756 | .enable_reg = CCM_PCCR_OWIRE_REG, | ||
757 | .enable_shift = CCM_PCCR_OWIRE_OFFSET, | ||
758 | .disable = _clk_disable, | ||
759 | }; | ||
760 | |||
761 | static struct clk rtc_clk = { | ||
762 | .parent = &ipg_clk, | ||
763 | .enable = _clk_enable, | ||
764 | .enable_reg = CCM_PCCR_RTC_REG, | ||
765 | .enable_shift = CCM_PCCR_RTC_OFFSET, | ||
766 | .disable = _clk_disable, | ||
767 | }; | ||
768 | |||
769 | static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate) | ||
770 | { | ||
771 | u32 div; | ||
772 | unsigned long parent_rate; | ||
773 | |||
774 | parent_rate = clk_get_rate(clk->parent); | ||
775 | div = parent_rate / rate; | ||
776 | if (parent_rate % rate) | ||
777 | div++; | ||
778 | |||
779 | if (div > 8) | ||
780 | div = 8; | ||
781 | |||
782 | return parent_rate / div; | ||
783 | } | ||
784 | |||
785 | static int _clk_clko_set_rate(struct clk *clk, unsigned long rate) | ||
786 | { | ||
787 | u32 reg; | ||
788 | u32 div; | ||
789 | unsigned long parent_rate; | ||
790 | |||
791 | parent_rate = clk_get_rate(clk->parent); | ||
792 | |||
793 | div = parent_rate / rate; | ||
794 | |||
795 | if (div > 8 || div < 1 || ((parent_rate / div) != rate)) | ||
796 | return -EINVAL; | ||
797 | div--; | ||
798 | |||
799 | reg = __raw_readl(CCM_PCDR0); | ||
800 | |||
801 | if (clk->parent == &usb_clk[0]) { | ||
802 | reg &= ~CCM_PCDR0_48MDIV_MASK; | ||
803 | reg |= div << CCM_PCDR0_48MDIV_OFFSET; | ||
804 | } | ||
805 | __raw_writel(reg, CCM_PCDR0); | ||
806 | |||
807 | return 0; | ||
808 | } | ||
809 | |||
810 | static unsigned long _clk_clko_recalc(struct clk *clk) | ||
811 | { | ||
812 | u32 div = 0; | ||
813 | unsigned long parent_rate; | ||
814 | |||
815 | parent_rate = clk_get_rate(clk->parent); | ||
816 | |||
817 | if (clk->parent == &usb_clk[0]) /* 48M */ | ||
818 | div = __raw_readl(CCM_PCDR0) & CCM_PCDR0_48MDIV_MASK | ||
819 | >> CCM_PCDR0_48MDIV_OFFSET; | ||
820 | div++; | ||
821 | |||
822 | return parent_rate / div; | ||
823 | } | ||
824 | |||
825 | static struct clk clko_clk; | ||
826 | |||
827 | static int _clk_clko_set_parent(struct clk *clk, struct clk *parent) | ||
828 | { | ||
829 | u32 reg; | ||
830 | |||
831 | reg = __raw_readl(CCM_CCSR) & ~CCM_CCSR_CLKOSEL_MASK; | ||
832 | |||
833 | if (parent == &ckil_clk) | ||
834 | reg |= 0 << CCM_CCSR_CLKOSEL_OFFSET; | ||
835 | else if (parent == &fpm_clk) | ||
836 | reg |= 1 << CCM_CCSR_CLKOSEL_OFFSET; | ||
837 | else if (parent == &ckih_clk) | ||
838 | reg |= 2 << CCM_CCSR_CLKOSEL_OFFSET; | ||
839 | else if (parent == mpll_clk.parent) | ||
840 | reg |= 3 << CCM_CCSR_CLKOSEL_OFFSET; | ||
841 | else if (parent == spll_clk.parent) | ||
842 | reg |= 4 << CCM_CCSR_CLKOSEL_OFFSET; | ||
843 | else if (parent == &mpll_clk) | ||
844 | reg |= 5 << CCM_CCSR_CLKOSEL_OFFSET; | ||
845 | else if (parent == &spll_clk) | ||
846 | reg |= 6 << CCM_CCSR_CLKOSEL_OFFSET; | ||
847 | else if (parent == &fclk_clk) | ||
848 | reg |= 7 << CCM_CCSR_CLKOSEL_OFFSET; | ||
849 | else if (parent == &hclk_clk) | ||
850 | reg |= 8 << CCM_CCSR_CLKOSEL_OFFSET; | ||
851 | else if (parent == &ipg_clk) | ||
852 | reg |= 9 << CCM_CCSR_CLKOSEL_OFFSET; | ||
853 | else if (parent == &per_clk[0]) | ||
854 | reg |= 0xA << CCM_CCSR_CLKOSEL_OFFSET; | ||
855 | else if (parent == &per_clk[1]) | ||
856 | reg |= 0xB << CCM_CCSR_CLKOSEL_OFFSET; | ||
857 | else if (parent == &per_clk[2]) | ||
858 | reg |= 0xC << CCM_CCSR_CLKOSEL_OFFSET; | ||
859 | else if (parent == &per_clk[3]) | ||
860 | reg |= 0xD << CCM_CCSR_CLKOSEL_OFFSET; | ||
861 | else if (parent == &ssi_clk[0]) | ||
862 | reg |= 0xE << CCM_CCSR_CLKOSEL_OFFSET; | ||
863 | else if (parent == &ssi_clk[1]) | ||
864 | reg |= 0xF << CCM_CCSR_CLKOSEL_OFFSET; | ||
865 | else if (parent == &nfc_clk) | ||
866 | reg |= 0x10 << CCM_CCSR_CLKOSEL_OFFSET; | ||
867 | else if (parent == &usb_clk[0]) | ||
868 | reg |= 0x14 << CCM_CCSR_CLKOSEL_OFFSET; | ||
869 | else if (parent == &clko_clk) | ||
870 | reg |= 0x15 << CCM_CCSR_CLKOSEL_OFFSET; | ||
871 | else | ||
872 | return -EINVAL; | ||
873 | |||
874 | __raw_writel(reg, CCM_CCSR); | ||
875 | |||
876 | return 0; | ||
877 | } | ||
878 | |||
879 | static struct clk clko_clk = { | ||
880 | .get_rate = _clk_clko_recalc, | ||
881 | .set_rate = _clk_clko_set_rate, | ||
882 | .round_rate = _clk_clko_round_rate, | ||
883 | .set_parent = _clk_clko_set_parent, | ||
884 | }; | ||
885 | |||
886 | |||
887 | #define _REGISTER_CLOCK(d, n, c) \ | ||
888 | { \ | ||
889 | .dev_id = d, \ | ||
890 | .con_id = n, \ | ||
891 | .clk = &c, \ | ||
892 | }, | ||
893 | static struct clk_lookup lookups[] __initdata = { | ||
894 | /* It's unlikely that any driver wants one of them directly: | ||
895 | _REGISTER_CLOCK(NULL, "ckih", ckih_clk) | ||
896 | _REGISTER_CLOCK(NULL, "ckil", ckil_clk) | ||
897 | _REGISTER_CLOCK(NULL, "fpm", fpm_clk) | ||
898 | _REGISTER_CLOCK(NULL, "mpll", mpll_clk) | ||
899 | _REGISTER_CLOCK(NULL, "spll", spll_clk) | ||
900 | _REGISTER_CLOCK(NULL, "fclk", fclk_clk) | ||
901 | _REGISTER_CLOCK(NULL, "hclk", hclk_clk) | ||
902 | _REGISTER_CLOCK(NULL, "ipg", ipg_clk) | ||
903 | */ | ||
904 | _REGISTER_CLOCK(NULL, "perclk1", per_clk[0]) | ||
905 | _REGISTER_CLOCK(NULL, "perclk2", per_clk[1]) | ||
906 | _REGISTER_CLOCK(NULL, "perclk3", per_clk[2]) | ||
907 | _REGISTER_CLOCK(NULL, "perclk4", per_clk[3]) | ||
908 | _REGISTER_CLOCK(NULL, "clko", clko_clk) | ||
909 | _REGISTER_CLOCK("imx-uart.0", NULL, uart_clk[0]) | ||
910 | _REGISTER_CLOCK("imx-uart.1", NULL, uart_clk[1]) | ||
911 | _REGISTER_CLOCK("imx-uart.2", NULL, uart_clk[2]) | ||
912 | _REGISTER_CLOCK("imx-uart.3", NULL, uart_clk[3]) | ||
913 | _REGISTER_CLOCK(NULL, "gpt1", gpt_clk[0]) | ||
914 | _REGISTER_CLOCK(NULL, "gpt1", gpt_clk[1]) | ||
915 | _REGISTER_CLOCK(NULL, "gpt1", gpt_clk[2]) | ||
916 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk[0]) | ||
917 | _REGISTER_CLOCK(NULL, "sdhc1", sdhc_clk[0]) | ||
918 | _REGISTER_CLOCK(NULL, "sdhc2", sdhc_clk[1]) | ||
919 | _REGISTER_CLOCK(NULL, "cspi1", cspi_clk[0]) | ||
920 | _REGISTER_CLOCK(NULL, "cspi2", cspi_clk[1]) | ||
921 | _REGISTER_CLOCK(NULL, "cspi3", cspi_clk[2]) | ||
922 | _REGISTER_CLOCK(NULL, "lcdc", lcdc_clk[0]) | ||
923 | _REGISTER_CLOCK(NULL, "csi", csi_clk[0]) | ||
924 | _REGISTER_CLOCK(NULL, "usb", usb_clk[0]) | ||
925 | _REGISTER_CLOCK(NULL, "ssi1", ssi_clk[0]) | ||
926 | _REGISTER_CLOCK(NULL, "ssi2", ssi_clk[1]) | ||
927 | _REGISTER_CLOCK(NULL, "nfc", nfc_clk) | ||
928 | _REGISTER_CLOCK(NULL, "dma", dma_clk[0]) | ||
929 | _REGISTER_CLOCK(NULL, "brom", brom_clk) | ||
930 | _REGISTER_CLOCK(NULL, "emma", emma_clk[0]) | ||
931 | _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk[0]) | ||
932 | _REGISTER_CLOCK(NULL, "wdog", wdog_clk) | ||
933 | _REGISTER_CLOCK(NULL, "gpio", gpio_clk) | ||
934 | _REGISTER_CLOCK(NULL, "i2c", i2c_clk) | ||
935 | _REGISTER_CLOCK("mxc-keypad", NULL, kpp_clk) | ||
936 | _REGISTER_CLOCK(NULL, "owire", owire_clk) | ||
937 | _REGISTER_CLOCK(NULL, "rtc", rtc_clk) | ||
938 | }; | ||
939 | |||
940 | /* | ||
941 | * must be called very early to get information about the | ||
942 | * available clock rate when the timer framework starts | ||
943 | */ | ||
944 | int __init mx21_clocks_init(unsigned long lref, unsigned long href) | ||
945 | { | ||
946 | int i; | ||
947 | u32 cscr; | ||
948 | |||
949 | external_low_reference = lref; | ||
950 | external_high_reference = href; | ||
951 | |||
952 | /* detect clock reference for both system PLL */ | ||
953 | cscr = CSCR(); | ||
954 | if (cscr & CCM_CSCR_MCU) | ||
955 | mpll_clk.parent = &ckih_clk; | ||
956 | else | ||
957 | mpll_clk.parent = &fpm_clk; | ||
958 | |||
959 | if (cscr & CCM_CSCR_SP) | ||
960 | spll_clk.parent = &ckih_clk; | ||
961 | else | ||
962 | spll_clk.parent = &fpm_clk; | ||
963 | |||
964 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | ||
965 | clkdev_add(&lookups[i]); | ||
966 | |||
967 | /* Turn off all clock gates */ | ||
968 | __raw_writel(0, CCM_PCCR0); | ||
969 | __raw_writel(CCM_PCCR_GPT1_MASK, CCM_PCCR1); | ||
970 | |||
971 | /* This turns of the serial PLL as well */ | ||
972 | spll_clk.disable(&spll_clk); | ||
973 | |||
974 | /* This will propagate to all children and init all the clock rates. */ | ||
975 | clk_enable(&per_clk[0]); | ||
976 | clk_enable(&gpio_clk); | ||
977 | |||
978 | #ifdef CONFIG_DEBUG_LL_CONSOLE | ||
979 | clk_enable(&uart_clk[0]); | ||
980 | #endif | ||
981 | |||
982 | mxc_timer_init(&gpt_clk[0]); | ||
983 | return 0; | ||
984 | } | ||
diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c index c69896d011a1..3f7280c490f0 100644 --- a/arch/arm/mach-mx2/clock_imx27.c +++ b/arch/arm/mach-mx2/clock_imx27.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | 2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. |
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | 3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de |
4 | * Copyright 2008 Martin Fuzzey, mfuzzey@gmail.com | ||
4 | * | 5 | * |
5 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License | 7 | * modify it under the terms of the GNU General Public License |
@@ -20,23 +21,60 @@ | |||
20 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
21 | #include <linux/io.h> | 22 | #include <linux/io.h> |
22 | #include <linux/module.h> | 23 | #include <linux/module.h> |
23 | #include <linux/spinlock.h> | ||
24 | 24 | ||
25 | #include <mach/clock.h> | 25 | #include <asm/clkdev.h> |
26 | #include <mach/common.h> | ||
27 | #include <asm/div64.h> | 26 | #include <asm/div64.h> |
28 | 27 | ||
29 | #include "crm_regs.h" | 28 | #include <mach/clock.h> |
30 | 29 | #include <mach/common.h> | |
31 | static struct clk ckil_clk; | 30 | #include <mach/hardware.h> |
32 | static struct clk mpll_clk; | 31 | |
33 | static struct clk mpll_main_clk[]; | 32 | /* Register offsets */ |
34 | static struct clk spll_clk; | 33 | #define CCM_CSCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x0) |
35 | 34 | #define CCM_MPCTL0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4) | |
36 | static int _clk_enable(struct clk *clk) | 35 | #define CCM_MPCTL1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x8) |
36 | #define CCM_SPCTL0 (IO_ADDRESS(CCM_BASE_ADDR) + 0xC) | ||
37 | #define CCM_SPCTL1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) | ||
38 | #define CCM_OSC26MCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) | ||
39 | #define CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) | ||
40 | #define CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1c) | ||
41 | #define CCM_PCCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) | ||
42 | #define CCM_PCCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) | ||
43 | #define CCM_CCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) | ||
44 | #define CCM_PMCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x2c) | ||
45 | #define CCM_PMCOUNT (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) | ||
46 | #define CCM_WKGDCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) | ||
47 | |||
48 | #define CCM_CSCR_UPDATE_DIS (1 << 31) | ||
49 | #define CCM_CSCR_SSI2 (1 << 23) | ||
50 | #define CCM_CSCR_SSI1 (1 << 22) | ||
51 | #define CCM_CSCR_VPU (1 << 21) | ||
52 | #define CCM_CSCR_MSHC (1 << 20) | ||
53 | #define CCM_CSCR_SPLLRES (1 << 19) | ||
54 | #define CCM_CSCR_MPLLRES (1 << 18) | ||
55 | #define CCM_CSCR_SP (1 << 17) | ||
56 | #define CCM_CSCR_MCU (1 << 16) | ||
57 | #define CCM_CSCR_OSC26MDIV (1 << 4) | ||
58 | #define CCM_CSCR_OSC26M (1 << 3) | ||
59 | #define CCM_CSCR_FPM (1 << 2) | ||
60 | #define CCM_CSCR_SPEN (1 << 1) | ||
61 | #define CCM_CSCR_MPEN (1 << 0) | ||
62 | |||
63 | /* i.MX27 TO 2+ */ | ||
64 | #define CCM_CSCR_ARM_SRC (1 << 15) | ||
65 | |||
66 | #define CCM_SPCTL1_LF (1 << 15) | ||
67 | #define CCM_SPCTL1_BRMO (1 << 6) | ||
68 | |||
69 | static struct clk mpll_main1_clk, mpll_main2_clk; | ||
70 | |||
71 | static int clk_pccr_enable(struct clk *clk) | ||
37 | { | 72 | { |
38 | unsigned long reg; | 73 | unsigned long reg; |
39 | 74 | ||
75 | if (!clk->enable_reg) | ||
76 | return 0; | ||
77 | |||
40 | reg = __raw_readl(clk->enable_reg); | 78 | reg = __raw_readl(clk->enable_reg); |
41 | reg |= 1 << clk->enable_shift; | 79 | reg |= 1 << clk->enable_shift; |
42 | __raw_writel(reg, clk->enable_reg); | 80 | __raw_writel(reg, clk->enable_reg); |
@@ -44,16 +82,19 @@ static int _clk_enable(struct clk *clk) | |||
44 | return 0; | 82 | return 0; |
45 | } | 83 | } |
46 | 84 | ||
47 | static void _clk_disable(struct clk *clk) | 85 | static void clk_pccr_disable(struct clk *clk) |
48 | { | 86 | { |
49 | unsigned long reg; | 87 | unsigned long reg; |
50 | 88 | ||
89 | if (!clk->enable_reg) | ||
90 | return; | ||
91 | |||
51 | reg = __raw_readl(clk->enable_reg); | 92 | reg = __raw_readl(clk->enable_reg); |
52 | reg &= ~(1 << clk->enable_shift); | 93 | reg &= ~(1 << clk->enable_shift); |
53 | __raw_writel(reg, clk->enable_reg); | 94 | __raw_writel(reg, clk->enable_reg); |
54 | } | 95 | } |
55 | 96 | ||
56 | static int _clk_spll_enable(struct clk *clk) | 97 | static int clk_spll_enable(struct clk *clk) |
57 | { | 98 | { |
58 | unsigned long reg; | 99 | unsigned long reg; |
59 | 100 | ||
@@ -61,13 +102,12 @@ static int _clk_spll_enable(struct clk *clk) | |||
61 | reg |= CCM_CSCR_SPEN; | 102 | reg |= CCM_CSCR_SPEN; |
62 | __raw_writel(reg, CCM_CSCR); | 103 | __raw_writel(reg, CCM_CSCR); |
63 | 104 | ||
64 | while ((__raw_readl(CCM_SPCTL1) & CCM_SPCTL1_LF) == 0) | 105 | while (!(__raw_readl(CCM_SPCTL1) & CCM_SPCTL1_LF)); |
65 | ; | ||
66 | 106 | ||
67 | return 0; | 107 | return 0; |
68 | } | 108 | } |
69 | 109 | ||
70 | static void _clk_spll_disable(struct clk *clk) | 110 | static void clk_spll_disable(struct clk *clk) |
71 | { | 111 | { |
72 | unsigned long reg; | 112 | unsigned long reg; |
73 | 113 | ||
@@ -76,192 +116,30 @@ static void _clk_spll_disable(struct clk *clk) | |||
76 | __raw_writel(reg, CCM_CSCR); | 116 | __raw_writel(reg, CCM_CSCR); |
77 | } | 117 | } |
78 | 118 | ||
79 | static void _clk_pccr01_enable(unsigned long mask0, unsigned long mask1) | 119 | static int clk_cpu_set_parent(struct clk *clk, struct clk *parent) |
80 | { | ||
81 | unsigned long reg; | ||
82 | |||
83 | reg = __raw_readl(CCM_PCCR0); | ||
84 | reg |= mask0; | ||
85 | __raw_writel(reg, CCM_PCCR0); | ||
86 | |||
87 | reg = __raw_readl(CCM_PCCR1); | ||
88 | reg |= mask1; | ||
89 | __raw_writel(reg, CCM_PCCR1); | ||
90 | |||
91 | } | ||
92 | |||
93 | static void _clk_pccr01_disable(unsigned long mask0, unsigned long mask1) | ||
94 | { | ||
95 | unsigned long reg; | ||
96 | |||
97 | reg = __raw_readl(CCM_PCCR0); | ||
98 | reg &= ~mask0; | ||
99 | __raw_writel(reg, CCM_PCCR0); | ||
100 | |||
101 | reg = __raw_readl(CCM_PCCR1); | ||
102 | reg &= ~mask1; | ||
103 | __raw_writel(reg, CCM_PCCR1); | ||
104 | } | ||
105 | |||
106 | static void _clk_pccr10_enable(unsigned long mask1, unsigned long mask0) | ||
107 | { | ||
108 | unsigned long reg; | ||
109 | |||
110 | reg = __raw_readl(CCM_PCCR1); | ||
111 | reg |= mask1; | ||
112 | __raw_writel(reg, CCM_PCCR1); | ||
113 | |||
114 | reg = __raw_readl(CCM_PCCR0); | ||
115 | reg |= mask0; | ||
116 | __raw_writel(reg, CCM_PCCR0); | ||
117 | } | ||
118 | |||
119 | static void _clk_pccr10_disable(unsigned long mask1, unsigned long mask0) | ||
120 | { | ||
121 | unsigned long reg; | ||
122 | |||
123 | reg = __raw_readl(CCM_PCCR1); | ||
124 | reg &= ~mask1; | ||
125 | __raw_writel(reg, CCM_PCCR1); | ||
126 | |||
127 | reg = __raw_readl(CCM_PCCR0); | ||
128 | reg &= ~mask0; | ||
129 | __raw_writel(reg, CCM_PCCR0); | ||
130 | } | ||
131 | |||
132 | static int _clk_dma_enable(struct clk *clk) | ||
133 | { | ||
134 | _clk_pccr01_enable(CCM_PCCR0_DMA_MASK, CCM_PCCR1_HCLK_DMA_MASK); | ||
135 | |||
136 | return 0; | ||
137 | } | ||
138 | |||
139 | static void _clk_dma_disable(struct clk *clk) | ||
140 | { | ||
141 | _clk_pccr01_disable(CCM_PCCR0_DMA_MASK, CCM_PCCR1_HCLK_DMA_MASK); | ||
142 | } | ||
143 | |||
144 | static int _clk_rtic_enable(struct clk *clk) | ||
145 | { | ||
146 | _clk_pccr01_enable(CCM_PCCR0_RTIC_MASK, CCM_PCCR1_HCLK_RTIC_MASK); | ||
147 | |||
148 | return 0; | ||
149 | } | ||
150 | |||
151 | static void _clk_rtic_disable(struct clk *clk) | ||
152 | { | ||
153 | _clk_pccr01_disable(CCM_PCCR0_RTIC_MASK, CCM_PCCR1_HCLK_RTIC_MASK); | ||
154 | } | ||
155 | |||
156 | static int _clk_emma_enable(struct clk *clk) | ||
157 | { | ||
158 | _clk_pccr01_enable(CCM_PCCR0_EMMA_MASK, CCM_PCCR1_HCLK_EMMA_MASK); | ||
159 | |||
160 | return 0; | ||
161 | } | ||
162 | |||
163 | static void _clk_emma_disable(struct clk *clk) | ||
164 | { | ||
165 | _clk_pccr01_disable(CCM_PCCR0_EMMA_MASK, CCM_PCCR1_HCLK_EMMA_MASK); | ||
166 | } | ||
167 | |||
168 | static int _clk_slcdc_enable(struct clk *clk) | ||
169 | { | ||
170 | _clk_pccr01_enable(CCM_PCCR0_SLCDC_MASK, CCM_PCCR1_HCLK_SLCDC_MASK); | ||
171 | |||
172 | return 0; | ||
173 | } | ||
174 | |||
175 | static void _clk_slcdc_disable(struct clk *clk) | ||
176 | { | ||
177 | _clk_pccr01_disable(CCM_PCCR0_SLCDC_MASK, CCM_PCCR1_HCLK_SLCDC_MASK); | ||
178 | } | ||
179 | |||
180 | static int _clk_fec_enable(struct clk *clk) | ||
181 | { | ||
182 | _clk_pccr01_enable(CCM_PCCR0_FEC_MASK, CCM_PCCR1_HCLK_FEC_MASK); | ||
183 | |||
184 | return 0; | ||
185 | } | ||
186 | |||
187 | static void _clk_fec_disable(struct clk *clk) | ||
188 | { | ||
189 | _clk_pccr01_disable(CCM_PCCR0_FEC_MASK, CCM_PCCR1_HCLK_FEC_MASK); | ||
190 | } | ||
191 | |||
192 | static int _clk_vpu_enable(struct clk *clk) | ||
193 | { | ||
194 | unsigned long reg; | ||
195 | |||
196 | reg = __raw_readl(CCM_PCCR1); | ||
197 | reg |= CCM_PCCR1_VPU_BAUD_MASK | CCM_PCCR1_HCLK_VPU_MASK; | ||
198 | __raw_writel(reg, CCM_PCCR1); | ||
199 | |||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | static void _clk_vpu_disable(struct clk *clk) | ||
204 | { | 120 | { |
205 | unsigned long reg; | 121 | int cscr = __raw_readl(CCM_CSCR); |
206 | |||
207 | reg = __raw_readl(CCM_PCCR1); | ||
208 | reg &= ~(CCM_PCCR1_VPU_BAUD_MASK | CCM_PCCR1_HCLK_VPU_MASK); | ||
209 | __raw_writel(reg, CCM_PCCR1); | ||
210 | } | ||
211 | |||
212 | static int _clk_sahara2_enable(struct clk *clk) | ||
213 | { | ||
214 | _clk_pccr01_enable(CCM_PCCR0_SAHARA_MASK, CCM_PCCR1_HCLK_SAHARA_MASK); | ||
215 | |||
216 | return 0; | ||
217 | } | ||
218 | |||
219 | static void _clk_sahara2_disable(struct clk *clk) | ||
220 | { | ||
221 | _clk_pccr01_disable(CCM_PCCR0_SAHARA_MASK, CCM_PCCR1_HCLK_SAHARA_MASK); | ||
222 | } | ||
223 | |||
224 | static int _clk_mstick1_enable(struct clk *clk) | ||
225 | { | ||
226 | _clk_pccr10_enable(CCM_PCCR1_MSHC_BAUD_MASK, CCM_PCCR0_MSHC_MASK); | ||
227 | |||
228 | return 0; | ||
229 | } | ||
230 | |||
231 | static void _clk_mstick1_disable(struct clk *clk) | ||
232 | { | ||
233 | _clk_pccr10_disable(CCM_PCCR1_MSHC_BAUD_MASK, CCM_PCCR0_MSHC_MASK); | ||
234 | } | ||
235 | |||
236 | #define CSCR() (__raw_readl(CCM_CSCR)) | ||
237 | #define PCDR0() (__raw_readl(CCM_PCDR0)) | ||
238 | #define PCDR1() (__raw_readl(CCM_PCDR1)) | ||
239 | |||
240 | static int _clk_cpu_set_parent(struct clk *clk, struct clk *parent) | ||
241 | { | ||
242 | int cscr = CSCR(); | ||
243 | 122 | ||
244 | if (clk->parent == parent) | 123 | if (clk->parent == parent) |
245 | return 0; | 124 | return 0; |
246 | 125 | ||
247 | if (mx27_revision() >= CHIP_REV_2_0) { | 126 | if (mx27_revision() >= CHIP_REV_2_0) { |
248 | if (parent == &mpll_main_clk[0]) { | 127 | if (parent == &mpll_main1_clk) { |
249 | cscr |= CCM_CSCR_ARM_SRC; | 128 | cscr |= CCM_CSCR_ARM_SRC; |
250 | } else { | 129 | } else { |
251 | if (parent == &mpll_main_clk[1]) | 130 | if (parent == &mpll_main2_clk) |
252 | cscr &= ~CCM_CSCR_ARM_SRC; | 131 | cscr &= ~CCM_CSCR_ARM_SRC; |
253 | else | 132 | else |
254 | return -EINVAL; | 133 | return -EINVAL; |
255 | } | 134 | } |
256 | __raw_writel(cscr, CCM_CSCR); | 135 | __raw_writel(cscr, CCM_CSCR); |
257 | } else | 136 | clk->parent = parent; |
258 | return -ENODEV; | 137 | return 0; |
259 | 138 | } | |
260 | clk->parent = parent; | 139 | return -ENODEV; |
261 | return 0; | ||
262 | } | 140 | } |
263 | 141 | ||
264 | static unsigned long _clk_cpu_round_rate(struct clk *clk, unsigned long rate) | 142 | static unsigned long round_rate_cpu(struct clk *clk, unsigned long rate) |
265 | { | 143 | { |
266 | int div; | 144 | int div; |
267 | unsigned long parent_rate; | 145 | unsigned long parent_rate; |
@@ -278,7 +156,7 @@ static unsigned long _clk_cpu_round_rate(struct clk *clk, unsigned long rate) | |||
278 | return parent_rate / div; | 156 | return parent_rate / div; |
279 | } | 157 | } |
280 | 158 | ||
281 | static int _clk_cpu_set_rate(struct clk *clk, unsigned long rate) | 159 | static int set_rate_cpu(struct clk *clk, unsigned long rate) |
282 | { | 160 | { |
283 | unsigned int div; | 161 | unsigned int div; |
284 | uint32_t reg; | 162 | uint32_t reg; |
@@ -295,19 +173,18 @@ static int _clk_cpu_set_rate(struct clk *clk, unsigned long rate) | |||
295 | 173 | ||
296 | reg = __raw_readl(CCM_CSCR); | 174 | reg = __raw_readl(CCM_CSCR); |
297 | if (mx27_revision() >= CHIP_REV_2_0) { | 175 | if (mx27_revision() >= CHIP_REV_2_0) { |
298 | reg &= ~CCM_CSCR_ARM_MASK; | 176 | reg &= ~(3 << 12); |
299 | reg |= div << CCM_CSCR_ARM_OFFSET; | 177 | reg |= div << 12; |
300 | reg &= ~0x06; | 178 | reg &= ~(CCM_CSCR_FPM | CCM_CSCR_SPEN); |
301 | __raw_writel(reg | 0x80000000, CCM_CSCR); | 179 | __raw_writel(reg | CCM_CSCR_UPDATE_DIS, CCM_CSCR); |
302 | } else { | 180 | } else { |
303 | printk(KERN_ERR "Cant set CPU frequency!\n"); | 181 | printk(KERN_ERR "Can't set CPU frequency!\n"); |
304 | } | 182 | } |
305 | 183 | ||
306 | return 0; | 184 | return 0; |
307 | } | 185 | } |
308 | 186 | ||
309 | static unsigned long _clk_perclkx_round_rate(struct clk *clk, | 187 | static unsigned long round_rate_per(struct clk *clk, unsigned long rate) |
310 | unsigned long rate) | ||
311 | { | 188 | { |
312 | u32 div; | 189 | u32 div; |
313 | unsigned long parent_rate; | 190 | unsigned long parent_rate; |
@@ -324,7 +201,7 @@ static unsigned long _clk_perclkx_round_rate(struct clk *clk, | |||
324 | return parent_rate / div; | 201 | return parent_rate / div; |
325 | } | 202 | } |
326 | 203 | ||
327 | static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) | 204 | static int set_rate_per(struct clk *clk, unsigned long rate) |
328 | { | 205 | { |
329 | u32 reg; | 206 | u32 reg; |
330 | u32 div; | 207 | u32 div; |
@@ -340,84 +217,65 @@ static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) | |||
340 | return -EINVAL; | 217 | return -EINVAL; |
341 | div--; | 218 | div--; |
342 | 219 | ||
343 | reg = | 220 | reg = __raw_readl(CCM_PCDR1) & ~(0x3f << (clk->id << 3)); |
344 | __raw_readl(CCM_PCDR1) & ~(CCM_PCDR1_PERDIV1_MASK << | ||
345 | (clk->id << 3)); | ||
346 | reg |= div << (clk->id << 3); | 221 | reg |= div << (clk->id << 3); |
347 | __raw_writel(reg, CCM_PCDR1); | 222 | __raw_writel(reg, CCM_PCDR1); |
348 | 223 | ||
349 | return 0; | 224 | return 0; |
350 | } | 225 | } |
351 | 226 | ||
352 | static unsigned long _clk_usb_recalc(struct clk *clk) | 227 | static unsigned long get_rate_usb(struct clk *clk) |
353 | { | 228 | { |
354 | unsigned long usb_pdf; | 229 | unsigned long usb_pdf; |
355 | unsigned long parent_rate; | 230 | unsigned long parent_rate; |
356 | 231 | ||
357 | parent_rate = clk_get_rate(clk->parent); | 232 | parent_rate = clk_get_rate(clk->parent); |
358 | 233 | ||
359 | usb_pdf = (CSCR() & CCM_CSCR_USB_MASK) >> CCM_CSCR_USB_OFFSET; | 234 | usb_pdf = (__raw_readl(CCM_CSCR) >> 28) & 0x7; |
360 | 235 | ||
361 | return parent_rate / (usb_pdf + 1U); | 236 | return parent_rate / (usb_pdf + 1U); |
362 | } | 237 | } |
363 | 238 | ||
364 | static unsigned long _clk_ssi1_recalc(struct clk *clk) | 239 | static unsigned long get_rate_ssix(struct clk *clk, unsigned long pdf) |
365 | { | 240 | { |
366 | unsigned long ssi1_pdf; | ||
367 | unsigned long parent_rate; | 241 | unsigned long parent_rate; |
368 | 242 | ||
369 | parent_rate = clk_get_rate(clk->parent); | 243 | parent_rate = clk_get_rate(clk->parent); |
370 | 244 | ||
371 | ssi1_pdf = (PCDR0() & CCM_PCDR0_SSI1BAUDDIV_MASK) >> | ||
372 | CCM_PCDR0_SSI1BAUDDIV_OFFSET; | ||
373 | |||
374 | if (mx27_revision() >= CHIP_REV_2_0) | 245 | if (mx27_revision() >= CHIP_REV_2_0) |
375 | ssi1_pdf += 4; | 246 | pdf += 4; /* MX27 TO2+ */ |
376 | else | 247 | else |
377 | ssi1_pdf = (ssi1_pdf < 2) ? 124UL : ssi1_pdf; | 248 | pdf = (pdf < 2) ? 124UL : pdf; /* MX21 & MX27 TO1 */ |
378 | 249 | ||
379 | return 2UL * parent_rate / ssi1_pdf; | 250 | return 2UL * parent_rate / pdf; |
380 | } | 251 | } |
381 | 252 | ||
382 | static unsigned long _clk_ssi2_recalc(struct clk *clk) | 253 | static unsigned long get_rate_ssi1(struct clk *clk) |
383 | { | 254 | { |
384 | unsigned long ssi2_pdf; | 255 | return get_rate_ssix(clk, (__raw_readl(CCM_PCDR0) >> 16) & 0x3f); |
385 | unsigned long parent_rate; | 256 | } |
386 | |||
387 | parent_rate = clk_get_rate(clk->parent); | ||
388 | |||
389 | ssi2_pdf = (PCDR0() & CCM_PCDR0_SSI2BAUDDIV_MASK) >> | ||
390 | CCM_PCDR0_SSI2BAUDDIV_OFFSET; | ||
391 | |||
392 | if (mx27_revision() >= CHIP_REV_2_0) | ||
393 | ssi2_pdf += 4; | ||
394 | else | ||
395 | ssi2_pdf = (ssi2_pdf < 2) ? 124UL : ssi2_pdf; | ||
396 | 257 | ||
397 | return 2UL * parent_rate / ssi2_pdf; | 258 | static unsigned long get_rate_ssi2(struct clk *clk) |
259 | { | ||
260 | return get_rate_ssix(clk, (__raw_readl(CCM_PCDR0) >> 26) & 0x3f); | ||
398 | } | 261 | } |
399 | 262 | ||
400 | static unsigned long _clk_nfc_recalc(struct clk *clk) | 263 | static unsigned long get_rate_nfc(struct clk *clk) |
401 | { | 264 | { |
402 | unsigned long nfc_pdf; | 265 | unsigned long nfc_pdf; |
403 | unsigned long parent_rate; | 266 | unsigned long parent_rate; |
404 | 267 | ||
405 | parent_rate = clk_get_rate(clk->parent); | 268 | parent_rate = clk_get_rate(clk->parent); |
406 | 269 | ||
407 | if (mx27_revision() >= CHIP_REV_2_0) { | 270 | if (mx27_revision() >= CHIP_REV_2_0) |
408 | nfc_pdf = | 271 | nfc_pdf = (__raw_readl(CCM_PCDR0) >> 6) & 0xf; |
409 | (PCDR0() & CCM_PCDR0_NFCDIV2_MASK) >> | 272 | else |
410 | CCM_PCDR0_NFCDIV2_OFFSET; | 273 | nfc_pdf = (__raw_readl(CCM_PCDR0) >> 12) & 0xf; |
411 | } else { | ||
412 | nfc_pdf = | ||
413 | (PCDR0() & CCM_PCDR0_NFCDIV_MASK) >> | ||
414 | CCM_PCDR0_NFCDIV_OFFSET; | ||
415 | } | ||
416 | 274 | ||
417 | return parent_rate / (nfc_pdf + 1); | 275 | return parent_rate / (nfc_pdf + 1); |
418 | } | 276 | } |
419 | 277 | ||
420 | static unsigned long _clk_vpu_recalc(struct clk *clk) | 278 | static unsigned long get_rate_vpu(struct clk *clk) |
421 | { | 279 | { |
422 | unsigned long vpu_pdf; | 280 | unsigned long vpu_pdf; |
423 | unsigned long parent_rate; | 281 | unsigned long parent_rate; |
@@ -425,25 +283,27 @@ static unsigned long _clk_vpu_recalc(struct clk *clk) | |||
425 | parent_rate = clk_get_rate(clk->parent); | 283 | parent_rate = clk_get_rate(clk->parent); |
426 | 284 | ||
427 | if (mx27_revision() >= CHIP_REV_2_0) { | 285 | if (mx27_revision() >= CHIP_REV_2_0) { |
428 | vpu_pdf = | 286 | vpu_pdf = (__raw_readl(CCM_PCDR0) >> 10) & 0x3f; |
429 | (PCDR0() & CCM_PCDR0_VPUDIV2_MASK) >> | ||
430 | CCM_PCDR0_VPUDIV2_OFFSET; | ||
431 | vpu_pdf += 4; | 287 | vpu_pdf += 4; |
432 | } else { | 288 | } else { |
433 | vpu_pdf = | 289 | vpu_pdf = (__raw_readl(CCM_PCDR0) >> 8) & 0xf; |
434 | (PCDR0() & CCM_PCDR0_VPUDIV_MASK) >> | ||
435 | CCM_PCDR0_VPUDIV_OFFSET; | ||
436 | vpu_pdf = (vpu_pdf < 2) ? 124 : vpu_pdf; | 290 | vpu_pdf = (vpu_pdf < 2) ? 124 : vpu_pdf; |
437 | } | 291 | } |
292 | |||
438 | return 2UL * parent_rate / vpu_pdf; | 293 | return 2UL * parent_rate / vpu_pdf; |
439 | } | 294 | } |
440 | 295 | ||
441 | static unsigned long _clk_parent_round_rate(struct clk *clk, unsigned long rate) | 296 | static unsigned long round_rate_parent(struct clk *clk, unsigned long rate) |
442 | { | 297 | { |
443 | return clk->parent->round_rate(clk->parent, rate); | 298 | return clk->parent->round_rate(clk->parent, rate); |
444 | } | 299 | } |
445 | 300 | ||
446 | static int _clk_parent_set_rate(struct clk *clk, unsigned long rate) | 301 | static unsigned long get_rate_parent(struct clk *clk) |
302 | { | ||
303 | return clk_get_rate(clk->parent); | ||
304 | } | ||
305 | |||
306 | static int set_rate_parent(struct clk *clk, unsigned long rate) | ||
447 | { | 307 | { |
448 | return clk->parent->set_rate(clk->parent, rate); | 308 | return clk->parent->set_rate(clk->parent, rate); |
449 | } | 309 | } |
@@ -451,1112 +311,380 @@ static int _clk_parent_set_rate(struct clk *clk, unsigned long rate) | |||
451 | /* in Hz */ | 311 | /* in Hz */ |
452 | static unsigned long external_high_reference = 26000000; | 312 | static unsigned long external_high_reference = 26000000; |
453 | 313 | ||
454 | static unsigned long get_high_reference_clock_rate(struct clk *clk) | 314 | static unsigned long get_rate_high_reference(struct clk *clk) |
455 | { | 315 | { |
456 | return external_high_reference; | 316 | return external_high_reference; |
457 | } | 317 | } |
458 | 318 | ||
459 | /* | ||
460 | * the high frequency external clock reference | ||
461 | * Default case is 26MHz. Could be changed at runtime | ||
462 | * with a call to change_external_high_reference() | ||
463 | */ | ||
464 | static struct clk ckih_clk = { | ||
465 | .name = "ckih", | ||
466 | .get_rate = get_high_reference_clock_rate, | ||
467 | }; | ||
468 | |||
469 | /* in Hz */ | 319 | /* in Hz */ |
470 | static unsigned long external_low_reference = 32768; | 320 | static unsigned long external_low_reference = 32768; |
471 | 321 | ||
472 | static unsigned long get_low_reference_clock_rate(struct clk *clk) | 322 | static unsigned long get_rate_low_reference(struct clk *clk) |
473 | { | 323 | { |
474 | return external_low_reference; | 324 | return external_low_reference; |
475 | } | 325 | } |
476 | 326 | ||
477 | /* | 327 | static unsigned long get_rate_fpm(struct clk *clk) |
478 | * the low frequency external clock reference | ||
479 | * Default case is 32.768kHz Could be changed at runtime | ||
480 | * with a call to change_external_low_reference() | ||
481 | */ | ||
482 | static struct clk ckil_clk = { | ||
483 | .name = "ckil", | ||
484 | .get_rate = get_low_reference_clock_rate, | ||
485 | }; | ||
486 | |||
487 | static unsigned long get_mpll_clk(struct clk *clk) | ||
488 | { | 328 | { |
489 | uint32_t reg; | 329 | return clk_get_rate(clk->parent) * 1024; |
490 | unsigned long ref_clk; | ||
491 | unsigned long mfi = 0, mfn = 0, mfd = 0, pdf = 0; | ||
492 | unsigned long long temp; | ||
493 | |||
494 | ref_clk = clk_get_rate(clk->parent); | ||
495 | |||
496 | reg = __raw_readl(CCM_MPCTL0); | ||
497 | pdf = (reg & CCM_MPCTL0_PD_MASK) >> CCM_MPCTL0_PD_OFFSET; | ||
498 | mfd = (reg & CCM_MPCTL0_MFD_MASK) >> CCM_MPCTL0_MFD_OFFSET; | ||
499 | mfi = (reg & CCM_MPCTL0_MFI_MASK) >> CCM_MPCTL0_MFI_OFFSET; | ||
500 | mfn = (reg & CCM_MPCTL0_MFN_MASK) >> CCM_MPCTL0_MFN_OFFSET; | ||
501 | |||
502 | mfi = (mfi <= 5) ? 5 : mfi; | ||
503 | temp = 2LL * ref_clk * mfn; | ||
504 | do_div(temp, mfd + 1); | ||
505 | temp = 2LL * ref_clk * mfi + temp; | ||
506 | do_div(temp, pdf + 1); | ||
507 | |||
508 | return (unsigned long)temp; | ||
509 | } | 330 | } |
510 | 331 | ||
511 | static struct clk mpll_clk = { | 332 | static unsigned long get_rate_mpll(struct clk *clk) |
512 | .name = "mpll", | 333 | { |
513 | .parent = &ckih_clk, | 334 | return mxc_decode_pll(__raw_readl(CCM_MPCTL0), |
514 | .get_rate = get_mpll_clk, | 335 | clk_get_rate(clk->parent)); |
515 | }; | 336 | } |
516 | 337 | ||
517 | static unsigned long _clk_mpll_main_get_rate(struct clk *clk) | 338 | static unsigned long get_rate_mpll_main(struct clk *clk) |
518 | { | 339 | { |
519 | unsigned long parent_rate; | 340 | unsigned long parent_rate; |
520 | 341 | ||
521 | parent_rate = clk_get_rate(clk->parent); | 342 | parent_rate = clk_get_rate(clk->parent); |
522 | 343 | ||
523 | /* i.MX27 TO2: | 344 | /* i.MX27 TO2: |
524 | * clk->id == 0: arm clock source path 1 which is from 2*MPLL/DIV_2 | 345 | * clk->id == 0: arm clock source path 1 which is from 2 * MPLL / 2 |
525 | * clk->id == 1: arm clock source path 2 which is from 2*MPLL/DIV_3 | 346 | * clk->id == 1: arm clock source path 2 which is from 2 * MPLL / 3 |
526 | */ | 347 | */ |
527 | |||
528 | if (mx27_revision() >= CHIP_REV_2_0 && clk->id == 1) | 348 | if (mx27_revision() >= CHIP_REV_2_0 && clk->id == 1) |
529 | return 2UL * parent_rate / 3UL; | 349 | return 2UL * parent_rate / 3UL; |
530 | 350 | ||
531 | return parent_rate; | 351 | return parent_rate; |
532 | } | 352 | } |
533 | 353 | ||
534 | static struct clk mpll_main_clk[] = { | 354 | static unsigned long get_rate_spll(struct clk *clk) |
535 | { | ||
536 | /* For i.MX27 TO2, it is the MPLL path 1 of ARM core | ||
537 | * It provide the clock source whose rate is same as MPLL | ||
538 | */ | ||
539 | .name = "mpll_main", | ||
540 | .id = 0, | ||
541 | .parent = &mpll_clk, | ||
542 | .get_rate = _clk_mpll_main_get_rate | ||
543 | }, { | ||
544 | /* For i.MX27 TO2, it is the MPLL path 2 of ARM core | ||
545 | * It provide the clock source whose rate is same MPLL * 2/3 | ||
546 | */ | ||
547 | .name = "mpll_main", | ||
548 | .id = 1, | ||
549 | .parent = &mpll_clk, | ||
550 | .get_rate = _clk_mpll_main_get_rate | ||
551 | } | ||
552 | }; | ||
553 | |||
554 | static unsigned long get_spll_clk(struct clk *clk) | ||
555 | { | 355 | { |
556 | uint32_t reg; | 356 | uint32_t reg; |
557 | unsigned long ref_clk; | 357 | unsigned long rate; |
558 | unsigned long mfi = 0, mfn = 0, mfd = 0, pdf = 0; | ||
559 | unsigned long long temp; | ||
560 | 358 | ||
561 | ref_clk = clk_get_rate(clk->parent); | 359 | rate = clk_get_rate(clk->parent); |
562 | 360 | ||
563 | reg = __raw_readl(CCM_SPCTL0); | 361 | reg = __raw_readl(CCM_SPCTL0); |
564 | /*TODO: This is TO2 Bug */ | 362 | |
363 | /* On TO2 we have to write the value back. Otherwise we | ||
364 | * read 0 from this register the next time. | ||
365 | */ | ||
565 | if (mx27_revision() >= CHIP_REV_2_0) | 366 | if (mx27_revision() >= CHIP_REV_2_0) |
566 | __raw_writel(reg, CCM_SPCTL0); | 367 | __raw_writel(reg, CCM_SPCTL0); |
567 | 368 | ||
568 | pdf = (reg & CCM_SPCTL0_PD_MASK) >> CCM_SPCTL0_PD_OFFSET; | 369 | return mxc_decode_pll(reg, rate); |
569 | mfd = (reg & CCM_SPCTL0_MFD_MASK) >> CCM_SPCTL0_MFD_OFFSET; | ||
570 | mfi = (reg & CCM_SPCTL0_MFI_MASK) >> CCM_SPCTL0_MFI_OFFSET; | ||
571 | mfn = (reg & CCM_SPCTL0_MFN_MASK) >> CCM_SPCTL0_MFN_OFFSET; | ||
572 | |||
573 | mfi = (mfi <= 5) ? 5 : mfi; | ||
574 | temp = 2LL * ref_clk * mfn; | ||
575 | do_div(temp, mfd + 1); | ||
576 | temp = 2LL * ref_clk * mfi + temp; | ||
577 | do_div(temp, pdf + 1); | ||
578 | |||
579 | return (unsigned long)temp; | ||
580 | } | 370 | } |
581 | 371 | ||
582 | static struct clk spll_clk = { | 372 | static unsigned long get_rate_cpu(struct clk *clk) |
583 | .name = "spll", | ||
584 | .parent = &ckih_clk, | ||
585 | .get_rate = get_spll_clk, | ||
586 | .enable = _clk_spll_enable, | ||
587 | .disable = _clk_spll_disable, | ||
588 | }; | ||
589 | |||
590 | static unsigned long get_cpu_clk(struct clk *clk) | ||
591 | { | 373 | { |
592 | u32 div; | 374 | u32 div; |
593 | unsigned long rate; | 375 | unsigned long rate; |
594 | 376 | ||
595 | if (mx27_revision() >= CHIP_REV_2_0) | 377 | if (mx27_revision() >= CHIP_REV_2_0) |
596 | div = (CSCR() & CCM_CSCR_ARM_MASK) >> CCM_CSCR_ARM_OFFSET; | 378 | div = (__raw_readl(CCM_CSCR) >> 12) & 0x3; |
597 | else | 379 | else |
598 | div = (CSCR() & CCM_CSCR_PRESC_MASK) >> CCM_CSCR_PRESC_OFFSET; | 380 | div = (__raw_readl(CCM_CSCR) >> 13) & 0x7; |
599 | 381 | ||
600 | rate = clk_get_rate(clk->parent); | 382 | rate = clk_get_rate(clk->parent); |
601 | return rate / (div + 1); | 383 | return rate / (div + 1); |
602 | } | 384 | } |
603 | 385 | ||
604 | static struct clk cpu_clk = { | 386 | static unsigned long get_rate_ahb(struct clk *clk) |
605 | .name = "cpu_clk", | ||
606 | .parent = &mpll_main_clk[1], | ||
607 | .set_parent = _clk_cpu_set_parent, | ||
608 | .round_rate = _clk_cpu_round_rate, | ||
609 | .get_rate = get_cpu_clk, | ||
610 | .set_rate = _clk_cpu_set_rate, | ||
611 | }; | ||
612 | |||
613 | static unsigned long get_ahb_clk(struct clk *clk) | ||
614 | { | 387 | { |
615 | unsigned long rate; | 388 | unsigned long rate, bclk_pdf; |
616 | unsigned long bclk_pdf; | ||
617 | 389 | ||
618 | if (mx27_revision() >= CHIP_REV_2_0) | 390 | if (mx27_revision() >= CHIP_REV_2_0) |
619 | bclk_pdf = (CSCR() & CCM_CSCR_AHB_MASK) | 391 | bclk_pdf = (__raw_readl(CCM_CSCR) >> 8) & 0x3; |
620 | >> CCM_CSCR_AHB_OFFSET; | ||
621 | else | 392 | else |
622 | bclk_pdf = (CSCR() & CCM_CSCR_BCLK_MASK) | 393 | bclk_pdf = (__raw_readl(CCM_CSCR) >> 9) & 0xf; |
623 | >> CCM_CSCR_BCLK_OFFSET; | ||
624 | 394 | ||
625 | rate = clk_get_rate(clk->parent); | 395 | rate = clk_get_rate(clk->parent); |
626 | return rate / (bclk_pdf + 1); | 396 | return rate / (bclk_pdf + 1); |
627 | } | 397 | } |
628 | 398 | ||
629 | static struct clk ahb_clk = { | 399 | static unsigned long get_rate_ipg(struct clk *clk) |
630 | .name = "ahb_clk", | ||
631 | .parent = &mpll_main_clk[1], | ||
632 | .get_rate = get_ahb_clk, | ||
633 | }; | ||
634 | |||
635 | static unsigned long get_ipg_clk(struct clk *clk) | ||
636 | { | 400 | { |
637 | unsigned long rate; | 401 | unsigned long rate, ipg_pdf; |
638 | unsigned long ipg_pdf; | ||
639 | 402 | ||
640 | if (mx27_revision() >= CHIP_REV_2_0) | 403 | if (mx27_revision() >= CHIP_REV_2_0) |
641 | return clk_get_rate(clk->parent); | 404 | return clk_get_rate(clk->parent); |
642 | else | 405 | else |
643 | ipg_pdf = (CSCR() & CCM_CSCR_IPDIV) >> CCM_CSCR_IPDIV_OFFSET; | 406 | ipg_pdf = (__raw_readl(CCM_CSCR) >> 8) & 1; |
644 | 407 | ||
645 | rate = clk_get_rate(clk->parent); | 408 | rate = clk_get_rate(clk->parent); |
646 | return rate / (ipg_pdf + 1); | 409 | return rate / (ipg_pdf + 1); |
647 | } | 410 | } |
648 | 411 | ||
649 | static struct clk ipg_clk = { | 412 | static unsigned long get_rate_per(struct clk *clk) |
650 | .name = "ipg_clk", | ||
651 | .parent = &ahb_clk, | ||
652 | .get_rate = get_ipg_clk, | ||
653 | }; | ||
654 | |||
655 | static unsigned long _clk_perclkx_recalc(struct clk *clk) | ||
656 | { | 413 | { |
657 | unsigned long perclk_pdf; | 414 | unsigned long perclk_pdf, parent_rate; |
658 | unsigned long parent_rate; | ||
659 | 415 | ||
660 | parent_rate = clk_get_rate(clk->parent); | 416 | parent_rate = clk_get_rate(clk->parent); |
661 | 417 | ||
662 | if (clk->id < 0 || clk->id > 3) | 418 | if (clk->id < 0 || clk->id > 3) |
663 | return 0; | 419 | return 0; |
664 | 420 | ||
665 | perclk_pdf = (PCDR1() >> (clk->id << 3)) & CCM_PCDR1_PERDIV1_MASK; | 421 | perclk_pdf = (__raw_readl(CCM_PCDR1) >> (clk->id << 3)) & 0x3f; |
666 | 422 | ||
667 | return parent_rate / (perclk_pdf + 1); | 423 | return parent_rate / (perclk_pdf + 1); |
668 | } | 424 | } |
669 | 425 | ||
670 | static struct clk per_clk[] = { | 426 | /* |
671 | { | 427 | * the high frequency external clock reference |
672 | .name = "per_clk", | 428 | * Default case is 26MHz. Could be changed at runtime |
673 | .id = 0, | 429 | * with a call to change_external_high_reference() |
674 | .parent = &mpll_main_clk[1], | 430 | */ |
675 | .get_rate = _clk_perclkx_recalc, | 431 | static struct clk ckih_clk = { |
676 | .enable = _clk_enable, | 432 | .get_rate = get_rate_high_reference, |
677 | .enable_reg = CCM_PCCR1, | ||
678 | .enable_shift = CCM_PCCR1_PERCLK1_OFFSET, | ||
679 | .disable = _clk_disable, | ||
680 | }, { | ||
681 | .name = "per_clk", | ||
682 | .id = 1, | ||
683 | .parent = &mpll_main_clk[1], | ||
684 | .get_rate = _clk_perclkx_recalc, | ||
685 | .enable = _clk_enable, | ||
686 | .enable_reg = CCM_PCCR1, | ||
687 | .enable_shift = CCM_PCCR1_PERCLK2_OFFSET, | ||
688 | .disable = _clk_disable, | ||
689 | }, { | ||
690 | .name = "per_clk", | ||
691 | .id = 2, | ||
692 | .parent = &mpll_main_clk[1], | ||
693 | .round_rate = _clk_perclkx_round_rate, | ||
694 | .set_rate = _clk_perclkx_set_rate, | ||
695 | .get_rate = _clk_perclkx_recalc, | ||
696 | .enable = _clk_enable, | ||
697 | .enable_reg = CCM_PCCR1, | ||
698 | .enable_shift = CCM_PCCR1_PERCLK3_OFFSET, | ||
699 | .disable = _clk_disable, | ||
700 | }, { | ||
701 | .name = "per_clk", | ||
702 | .id = 3, | ||
703 | .parent = &mpll_main_clk[1], | ||
704 | .round_rate = _clk_perclkx_round_rate, | ||
705 | .set_rate = _clk_perclkx_set_rate, | ||
706 | .get_rate = _clk_perclkx_recalc, | ||
707 | .enable = _clk_enable, | ||
708 | .enable_reg = CCM_PCCR1, | ||
709 | .enable_shift = CCM_PCCR1_PERCLK4_OFFSET, | ||
710 | .disable = _clk_disable, | ||
711 | }, | ||
712 | }; | ||
713 | |||
714 | struct clk uart1_clk[] = { | ||
715 | { | ||
716 | .name = "uart_clk", | ||
717 | .id = 0, | ||
718 | .parent = &per_clk[0], | ||
719 | .secondary = &uart1_clk[1], | ||
720 | }, { | ||
721 | .name = "uart_ipg_clk", | ||
722 | .id = 0, | ||
723 | .parent = &ipg_clk, | ||
724 | .enable = _clk_enable, | ||
725 | .enable_reg = CCM_PCCR1, | ||
726 | .enable_shift = CCM_PCCR1_UART1_OFFSET, | ||
727 | .disable = _clk_disable, | ||
728 | }, | ||
729 | }; | ||
730 | |||
731 | struct clk uart2_clk[] = { | ||
732 | { | ||
733 | .name = "uart_clk", | ||
734 | .id = 1, | ||
735 | .parent = &per_clk[0], | ||
736 | .secondary = &uart2_clk[1], | ||
737 | }, { | ||
738 | .name = "uart_ipg_clk", | ||
739 | .id = 1, | ||
740 | .parent = &ipg_clk, | ||
741 | .enable = _clk_enable, | ||
742 | .enable_reg = CCM_PCCR1, | ||
743 | .enable_shift = CCM_PCCR1_UART2_OFFSET, | ||
744 | .disable = _clk_disable, | ||
745 | }, | ||
746 | }; | ||
747 | |||
748 | struct clk uart3_clk[] = { | ||
749 | { | ||
750 | .name = "uart_clk", | ||
751 | .id = 2, | ||
752 | .parent = &per_clk[0], | ||
753 | .secondary = &uart3_clk[1], | ||
754 | }, { | ||
755 | .name = "uart_ipg_clk", | ||
756 | .id = 2, | ||
757 | .parent = &ipg_clk, | ||
758 | .enable = _clk_enable, | ||
759 | .enable_reg = CCM_PCCR1, | ||
760 | .enable_shift = CCM_PCCR1_UART3_OFFSET, | ||
761 | .disable = _clk_disable, | ||
762 | }, | ||
763 | }; | ||
764 | |||
765 | struct clk uart4_clk[] = { | ||
766 | { | ||
767 | .name = "uart_clk", | ||
768 | .id = 3, | ||
769 | .parent = &per_clk[0], | ||
770 | .secondary = &uart4_clk[1], | ||
771 | }, { | ||
772 | .name = "uart_ipg_clk", | ||
773 | .id = 3, | ||
774 | .parent = &ipg_clk, | ||
775 | .enable = _clk_enable, | ||
776 | .enable_reg = CCM_PCCR1, | ||
777 | .enable_shift = CCM_PCCR1_UART4_OFFSET, | ||
778 | .disable = _clk_disable, | ||
779 | }, | ||
780 | }; | ||
781 | |||
782 | struct clk uart5_clk[] = { | ||
783 | { | ||
784 | .name = "uart_clk", | ||
785 | .id = 4, | ||
786 | .parent = &per_clk[0], | ||
787 | .secondary = &uart5_clk[1], | ||
788 | }, { | ||
789 | .name = "uart_ipg_clk", | ||
790 | .id = 4, | ||
791 | .parent = &ipg_clk, | ||
792 | .enable = _clk_enable, | ||
793 | .enable_reg = CCM_PCCR1, | ||
794 | .enable_shift = CCM_PCCR1_UART5_OFFSET, | ||
795 | .disable = _clk_disable, | ||
796 | }, | ||
797 | }; | ||
798 | |||
799 | struct clk uart6_clk[] = { | ||
800 | { | ||
801 | .name = "uart_clk", | ||
802 | .id = 5, | ||
803 | .parent = &per_clk[0], | ||
804 | .secondary = &uart6_clk[1], | ||
805 | }, { | ||
806 | .name = "uart_ipg_clk", | ||
807 | .id = 5, | ||
808 | .parent = &ipg_clk, | ||
809 | .enable = _clk_enable, | ||
810 | .enable_reg = CCM_PCCR1, | ||
811 | .enable_shift = CCM_PCCR1_UART6_OFFSET, | ||
812 | .disable = _clk_disable, | ||
813 | }, | ||
814 | }; | ||
815 | |||
816 | static struct clk gpt1_clk[] = { | ||
817 | { | ||
818 | .name = "gpt_clk", | ||
819 | .id = 0, | ||
820 | .parent = &per_clk[0], | ||
821 | .secondary = &gpt1_clk[1], | ||
822 | }, { | ||
823 | .name = "gpt_ipg_clk", | ||
824 | .id = 0, | ||
825 | .parent = &ipg_clk, | ||
826 | .enable = _clk_enable, | ||
827 | .enable_reg = CCM_PCCR0, | ||
828 | .enable_shift = CCM_PCCR0_GPT1_OFFSET, | ||
829 | .disable = _clk_disable, | ||
830 | }, | ||
831 | }; | ||
832 | |||
833 | static struct clk gpt2_clk[] = { | ||
834 | { | ||
835 | .name = "gpt_clk", | ||
836 | .id = 1, | ||
837 | .parent = &per_clk[0], | ||
838 | .secondary = &gpt2_clk[1], | ||
839 | }, { | ||
840 | .name = "gpt_ipg_clk", | ||
841 | .id = 1, | ||
842 | .parent = &ipg_clk, | ||
843 | .enable = _clk_enable, | ||
844 | .enable_reg = CCM_PCCR0, | ||
845 | .enable_shift = CCM_PCCR0_GPT2_OFFSET, | ||
846 | .disable = _clk_disable, | ||
847 | }, | ||
848 | }; | ||
849 | |||
850 | static struct clk gpt3_clk[] = { | ||
851 | { | ||
852 | .name = "gpt_clk", | ||
853 | .id = 2, | ||
854 | .parent = &per_clk[0], | ||
855 | .secondary = &gpt3_clk[1], | ||
856 | }, { | ||
857 | .name = "gpt_ipg_clk", | ||
858 | .id = 2, | ||
859 | .parent = &ipg_clk, | ||
860 | .enable = _clk_enable, | ||
861 | .enable_reg = CCM_PCCR0, | ||
862 | .enable_shift = CCM_PCCR0_GPT3_OFFSET, | ||
863 | .disable = _clk_disable, | ||
864 | }, | ||
865 | }; | ||
866 | |||
867 | static struct clk gpt4_clk[] = { | ||
868 | { | ||
869 | .name = "gpt_clk", | ||
870 | .id = 3, | ||
871 | .parent = &per_clk[0], | ||
872 | .secondary = &gpt4_clk[1], | ||
873 | }, { | ||
874 | .name = "gpt_ipg_clk", | ||
875 | .id = 3, | ||
876 | .parent = &ipg_clk, | ||
877 | .enable = _clk_enable, | ||
878 | .enable_reg = CCM_PCCR0, | ||
879 | .enable_shift = CCM_PCCR0_GPT4_OFFSET, | ||
880 | .disable = _clk_disable, | ||
881 | }, | ||
882 | }; | ||
883 | |||
884 | static struct clk gpt5_clk[] = { | ||
885 | { | ||
886 | .name = "gpt_clk", | ||
887 | .id = 4, | ||
888 | .parent = &per_clk[0], | ||
889 | .secondary = &gpt5_clk[1], | ||
890 | }, { | ||
891 | .name = "gpt_ipg_clk", | ||
892 | .id = 4, | ||
893 | .parent = &ipg_clk, | ||
894 | .enable = _clk_enable, | ||
895 | .enable_reg = CCM_PCCR0, | ||
896 | .enable_shift = CCM_PCCR0_GPT5_OFFSET, | ||
897 | .disable = _clk_disable, | ||
898 | }, | ||
899 | }; | 433 | }; |
900 | 434 | ||
901 | static struct clk gpt6_clk[] = { | 435 | static struct clk mpll_clk = { |
902 | { | 436 | .parent = &ckih_clk, |
903 | .name = "gpt_clk", | 437 | .get_rate = get_rate_mpll, |
904 | .id = 5, | ||
905 | .parent = &per_clk[0], | ||
906 | .secondary = &gpt6_clk[1], | ||
907 | }, { | ||
908 | .name = "gpt_ipg_clk", | ||
909 | .id = 5, | ||
910 | .parent = &ipg_clk, | ||
911 | .enable = _clk_enable, | ||
912 | .enable_reg = CCM_PCCR0, | ||
913 | .enable_shift = CCM_PCCR0_GPT6_OFFSET, | ||
914 | .disable = _clk_disable, | ||
915 | }, | ||
916 | }; | 438 | }; |
917 | 439 | ||
918 | static struct clk pwm_clk[] = { | 440 | /* For i.MX27 TO2, it is the MPLL path 1 of ARM core |
919 | { | 441 | * It provides the clock source whose rate is same as MPLL |
920 | .name = "pwm_clk", | 442 | */ |
921 | .parent = &per_clk[0], | 443 | static struct clk mpll_main1_clk = { |
922 | .secondary = &pwm_clk[1], | 444 | .id = 0, |
923 | }, { | 445 | .parent = &mpll_clk, |
924 | .name = "pwm_clk", | 446 | .get_rate = get_rate_mpll_main, |
925 | .parent = &ipg_clk, | ||
926 | .enable = _clk_enable, | ||
927 | .enable_reg = CCM_PCCR0, | ||
928 | .enable_shift = CCM_PCCR0_PWM_OFFSET, | ||
929 | .disable = _clk_disable, | ||
930 | }, | ||
931 | }; | 447 | }; |
932 | 448 | ||
933 | static struct clk sdhc1_clk[] = { | 449 | /* For i.MX27 TO2, it is the MPLL path 2 of ARM core |
934 | { | 450 | * It provides the clock source whose rate is same MPLL * 2 / 3 |
935 | .name = "sdhc_clk", | 451 | */ |
936 | .id = 0, | 452 | static struct clk mpll_main2_clk = { |
937 | .parent = &per_clk[1], | 453 | .id = 1, |
938 | .secondary = &sdhc1_clk[1], | 454 | .parent = &mpll_clk, |
939 | }, { | 455 | .get_rate = get_rate_mpll_main, |
940 | .name = "sdhc_ipg_clk", | ||
941 | .id = 0, | ||
942 | .parent = &ipg_clk, | ||
943 | .enable = _clk_enable, | ||
944 | .enable_reg = CCM_PCCR0, | ||
945 | .enable_shift = CCM_PCCR0_SDHC1_OFFSET, | ||
946 | .disable = _clk_disable, | ||
947 | }, | ||
948 | }; | 456 | }; |
949 | 457 | ||
950 | static struct clk sdhc2_clk[] = { | 458 | static struct clk ahb_clk = { |
951 | { | 459 | .parent = &mpll_main2_clk, |
952 | .name = "sdhc_clk", | 460 | .get_rate = get_rate_ahb, |
953 | .id = 1, | ||
954 | .parent = &per_clk[1], | ||
955 | .secondary = &sdhc2_clk[1], | ||
956 | }, { | ||
957 | .name = "sdhc_ipg_clk", | ||
958 | .id = 1, | ||
959 | .parent = &ipg_clk, | ||
960 | .enable = _clk_enable, | ||
961 | .enable_reg = CCM_PCCR0, | ||
962 | .enable_shift = CCM_PCCR0_SDHC2_OFFSET, | ||
963 | .disable = _clk_disable, | ||
964 | }, | ||
965 | }; | 461 | }; |
966 | 462 | ||
967 | static struct clk sdhc3_clk[] = { | 463 | static struct clk ipg_clk = { |
968 | { | 464 | .parent = &ahb_clk, |
969 | .name = "sdhc_clk", | 465 | .get_rate = get_rate_ipg, |
970 | .id = 2, | ||
971 | .parent = &per_clk[1], | ||
972 | .secondary = &sdhc3_clk[1], | ||
973 | }, { | ||
974 | .name = "sdhc_ipg_clk", | ||
975 | .id = 2, | ||
976 | .parent = &ipg_clk, | ||
977 | .enable = _clk_enable, | ||
978 | .enable_reg = CCM_PCCR0, | ||
979 | .enable_shift = CCM_PCCR0_SDHC3_OFFSET, | ||
980 | .disable = _clk_disable, | ||
981 | }, | ||
982 | }; | 466 | }; |
983 | 467 | ||
984 | static struct clk cspi1_clk[] = { | 468 | static struct clk cpu_clk = { |
985 | { | 469 | .parent = &mpll_main2_clk, |
986 | .name = "cspi_clk", | 470 | .set_parent = clk_cpu_set_parent, |
987 | .id = 0, | 471 | .round_rate = round_rate_cpu, |
988 | .parent = &per_clk[1], | 472 | .get_rate = get_rate_cpu, |
989 | .secondary = &cspi1_clk[1], | 473 | .set_rate = set_rate_cpu, |
990 | }, { | ||
991 | .name = "cspi_ipg_clk", | ||
992 | .id = 0, | ||
993 | .parent = &ipg_clk, | ||
994 | .enable = _clk_enable, | ||
995 | .enable_reg = CCM_PCCR0, | ||
996 | .enable_shift = CCM_PCCR0_CSPI1_OFFSET, | ||
997 | .disable = _clk_disable, | ||
998 | }, | ||
999 | }; | 474 | }; |
1000 | 475 | ||
1001 | static struct clk cspi2_clk[] = { | 476 | static struct clk spll_clk = { |
1002 | { | 477 | .parent = &ckih_clk, |
1003 | .name = "cspi_clk", | 478 | .get_rate = get_rate_spll, |
1004 | .id = 1, | 479 | .enable = clk_spll_enable, |
1005 | .parent = &per_clk[1], | 480 | .disable = clk_spll_disable, |
1006 | .secondary = &cspi2_clk[1], | ||
1007 | }, { | ||
1008 | .name = "cspi_ipg_clk", | ||
1009 | .id = 1, | ||
1010 | .parent = &ipg_clk, | ||
1011 | .enable = _clk_enable, | ||
1012 | .enable_reg = CCM_PCCR0, | ||
1013 | .enable_shift = CCM_PCCR0_CSPI2_OFFSET, | ||
1014 | .disable = _clk_disable, | ||
1015 | }, | ||
1016 | }; | 481 | }; |
1017 | 482 | ||
1018 | static struct clk cspi3_clk[] = { | 483 | /* |
1019 | { | 484 | * the low frequency external clock reference |
1020 | .name = "cspi_clk", | 485 | * Default case is 32.768kHz. |
1021 | .id = 2, | 486 | */ |
1022 | .parent = &per_clk[1], | 487 | static struct clk ckil_clk = { |
1023 | .secondary = &cspi3_clk[1], | 488 | .get_rate = get_rate_low_reference, |
1024 | }, { | ||
1025 | .name = "cspi_ipg_clk", | ||
1026 | .id = 2, | ||
1027 | .parent = &ipg_clk, | ||
1028 | .enable = _clk_enable, | ||
1029 | .enable_reg = CCM_PCCR0, | ||
1030 | .enable_shift = CCM_PCCR0_CSPI3_OFFSET, | ||
1031 | .disable = _clk_disable, | ||
1032 | }, | ||
1033 | }; | 489 | }; |
1034 | 490 | ||
1035 | static struct clk lcdc_clk[] = { | 491 | /* Output of frequency pre multiplier */ |
1036 | { | 492 | static struct clk fpm_clk = { |
1037 | .name = "lcdc_clk", | 493 | .parent = &ckil_clk, |
1038 | .parent = &per_clk[2], | 494 | .get_rate = get_rate_fpm, |
1039 | .secondary = &lcdc_clk[1], | ||
1040 | .round_rate = _clk_parent_round_rate, | ||
1041 | .set_rate = _clk_parent_set_rate, | ||
1042 | }, { | ||
1043 | .name = "lcdc_ipg_clk", | ||
1044 | .parent = &ipg_clk, | ||
1045 | .secondary = &lcdc_clk[2], | ||
1046 | .enable = _clk_enable, | ||
1047 | .enable_reg = CCM_PCCR0, | ||
1048 | .enable_shift = CCM_PCCR0_LCDC_OFFSET, | ||
1049 | .disable = _clk_disable, | ||
1050 | }, { | ||
1051 | .name = "lcdc_ahb_clk", | ||
1052 | .parent = &ahb_clk, | ||
1053 | .enable = _clk_enable, | ||
1054 | .enable_reg = CCM_PCCR1, | ||
1055 | .enable_shift = CCM_PCCR1_HCLK_LCDC_OFFSET, | ||
1056 | .disable = _clk_disable, | ||
1057 | }, | ||
1058 | }; | 495 | }; |
1059 | 496 | ||
1060 | static struct clk csi_clk[] = { | 497 | #define PCCR0 CCM_PCCR0 |
1061 | { | 498 | #define PCCR1 CCM_PCCR1 |
1062 | .name = "csi_perclk", | ||
1063 | .parent = &per_clk[3], | ||
1064 | .secondary = &csi_clk[1], | ||
1065 | .round_rate = _clk_parent_round_rate, | ||
1066 | .set_rate = _clk_parent_set_rate, | ||
1067 | }, { | ||
1068 | .name = "csi_ahb_clk", | ||
1069 | .parent = &ahb_clk, | ||
1070 | .enable = _clk_enable, | ||
1071 | .enable_reg = CCM_PCCR1, | ||
1072 | .enable_shift = CCM_PCCR1_HCLK_CSI_OFFSET, | ||
1073 | .disable = _clk_disable, | ||
1074 | }, | ||
1075 | }; | ||
1076 | 499 | ||
1077 | static struct clk usb_clk[] = { | 500 | #define DEFINE_CLOCK(name, i, er, es, gr, s, p) \ |
1078 | { | 501 | static struct clk name = { \ |
1079 | .name = "usb_clk", | 502 | .id = i, \ |
1080 | .parent = &spll_clk, | 503 | .enable_reg = er, \ |
1081 | .get_rate = _clk_usb_recalc, | 504 | .enable_shift = es, \ |
1082 | .enable = _clk_enable, | 505 | .get_rate = gr, \ |
1083 | .enable_reg = CCM_PCCR1, | 506 | .enable = clk_pccr_enable, \ |
1084 | .enable_shift = CCM_PCCR1_USBOTG_OFFSET, | 507 | .disable = clk_pccr_disable, \ |
1085 | .disable = _clk_disable, | 508 | .secondary = s, \ |
1086 | }, { | 509 | .parent = p, \ |
1087 | .name = "usb_ahb_clk", | ||
1088 | .parent = &ahb_clk, | ||
1089 | .enable = _clk_enable, | ||
1090 | .enable_reg = CCM_PCCR1, | ||
1091 | .enable_shift = CCM_PCCR1_HCLK_USBOTG_OFFSET, | ||
1092 | .disable = _clk_disable, | ||
1093 | } | 510 | } |
1094 | }; | ||
1095 | 511 | ||
1096 | static struct clk ssi1_clk[] = { | 512 | #define DEFINE_CLOCK1(name, i, er, es, getsetround, s, p) \ |
1097 | { | 513 | static struct clk name = { \ |
1098 | .name = "ssi_clk", | 514 | .id = i, \ |
1099 | .id = 0, | 515 | .enable_reg = er, \ |
1100 | .parent = &mpll_main_clk[1], | 516 | .enable_shift = es, \ |
1101 | .secondary = &ssi1_clk[1], | 517 | .get_rate = get_rate_##getsetround, \ |
1102 | .get_rate = _clk_ssi1_recalc, | 518 | .set_rate = set_rate_##getsetround, \ |
1103 | .enable = _clk_enable, | 519 | .round_rate = round_rate_##getsetround, \ |
1104 | .enable_reg = CCM_PCCR1, | 520 | .enable = clk_pccr_enable, \ |
1105 | .enable_shift = CCM_PCCR1_SSI1_BAUD_OFFSET, | 521 | .disable = clk_pccr_disable, \ |
1106 | .disable = _clk_disable, | 522 | .secondary = s, \ |
1107 | }, { | 523 | .parent = p, \ |
1108 | .name = "ssi_ipg_clk", | 524 | } |
1109 | .id = 0, | ||
1110 | .parent = &ipg_clk, | ||
1111 | .enable = _clk_enable, | ||
1112 | .enable_reg = CCM_PCCR0, | ||
1113 | .enable_shift = CCM_PCCR0_SSI1_IPG_OFFSET, | ||
1114 | .disable = _clk_disable, | ||
1115 | }, | ||
1116 | }; | ||
1117 | 525 | ||
1118 | static struct clk ssi2_clk[] = { | 526 | /* Forward declaration to keep the following list in order */ |
1119 | { | 527 | static struct clk slcdc_clk1, sahara2_clk1, rtic_clk1, fec_clk1, emma_clk1, |
1120 | .name = "ssi_clk", | 528 | dma_clk1, lcdc_clk2, vpu_clk1; |
1121 | .id = 1, | 529 | |
1122 | .parent = &mpll_main_clk[1], | 530 | /* All clocks we can gate through PCCRx in the order of PCCRx bits */ |
1123 | .secondary = &ssi2_clk[1], | 531 | DEFINE_CLOCK(ssi2_clk1, 1, PCCR0, 0, NULL, NULL, &ipg_clk); |
1124 | .get_rate = _clk_ssi2_recalc, | 532 | DEFINE_CLOCK(ssi1_clk1, 0, PCCR0, 1, NULL, NULL, &ipg_clk); |
1125 | .enable = _clk_enable, | 533 | DEFINE_CLOCK(slcdc_clk, 0, PCCR0, 2, NULL, &slcdc_clk1, &ahb_clk); |
1126 | .enable_reg = CCM_PCCR1, | 534 | DEFINE_CLOCK(sdhc3_clk1, 0, PCCR0, 3, NULL, NULL, &ipg_clk); |
1127 | .enable_shift = CCM_PCCR1_SSI2_BAUD_OFFSET, | 535 | DEFINE_CLOCK(sdhc2_clk1, 0, PCCR0, 4, NULL, NULL, &ipg_clk); |
1128 | .disable = _clk_disable, | 536 | DEFINE_CLOCK(sdhc1_clk1, 0, PCCR0, 5, NULL, NULL, &ipg_clk); |
1129 | }, { | 537 | DEFINE_CLOCK(scc_clk, 0, PCCR0, 6, NULL, NULL, &ipg_clk); |
1130 | .name = "ssi_ipg_clk", | 538 | DEFINE_CLOCK(sahara2_clk, 0, PCCR0, 7, NULL, &sahara2_clk1, &ahb_clk); |
1131 | .id = 1, | 539 | DEFINE_CLOCK(rtic_clk, 0, PCCR0, 8, NULL, &rtic_clk1, &ahb_clk); |
1132 | .parent = &ipg_clk, | 540 | DEFINE_CLOCK(rtc_clk, 0, PCCR0, 9, NULL, NULL, &ipg_clk); |
1133 | .enable = _clk_enable, | 541 | DEFINE_CLOCK(pwm_clk1, 0, PCCR0, 11, NULL, NULL, &ipg_clk); |
1134 | .enable_reg = CCM_PCCR0, | 542 | DEFINE_CLOCK(owire_clk, 0, PCCR0, 12, NULL, NULL, &ipg_clk); |
1135 | .enable_shift = CCM_PCCR0_SSI2_IPG_OFFSET, | 543 | DEFINE_CLOCK(mstick_clk1, 0, PCCR0, 13, NULL, NULL, &ipg_clk); |
1136 | .disable = _clk_disable, | 544 | DEFINE_CLOCK(lcdc_clk1, 0, PCCR0, 14, NULL, &lcdc_clk2, &ipg_clk); |
545 | DEFINE_CLOCK(kpp_clk, 0, PCCR0, 15, NULL, NULL, &ipg_clk); | ||
546 | DEFINE_CLOCK(iim_clk, 0, PCCR0, 16, NULL, NULL, &ipg_clk); | ||
547 | DEFINE_CLOCK(i2c2_clk, 1, PCCR0, 17, NULL, NULL, &ipg_clk); | ||
548 | DEFINE_CLOCK(i2c1_clk, 0, PCCR0, 18, NULL, NULL, &ipg_clk); | ||
549 | DEFINE_CLOCK(gpt6_clk1, 0, PCCR0, 29, NULL, NULL, &ipg_clk); | ||
550 | DEFINE_CLOCK(gpt5_clk1, 0, PCCR0, 20, NULL, NULL, &ipg_clk); | ||
551 | DEFINE_CLOCK(gpt4_clk1, 0, PCCR0, 21, NULL, NULL, &ipg_clk); | ||
552 | DEFINE_CLOCK(gpt3_clk1, 0, PCCR0, 22, NULL, NULL, &ipg_clk); | ||
553 | DEFINE_CLOCK(gpt2_clk1, 0, PCCR0, 23, NULL, NULL, &ipg_clk); | ||
554 | DEFINE_CLOCK(gpt1_clk1, 0, PCCR0, 24, NULL, NULL, &ipg_clk); | ||
555 | DEFINE_CLOCK(gpio_clk, 0, PCCR0, 25, NULL, NULL, &ipg_clk); | ||
556 | DEFINE_CLOCK(fec_clk, 0, PCCR0, 26, NULL, &fec_clk1, &ahb_clk); | ||
557 | DEFINE_CLOCK(emma_clk, 0, PCCR0, 27, NULL, &emma_clk1, &ahb_clk); | ||
558 | DEFINE_CLOCK(dma_clk, 0, PCCR0, 28, NULL, &dma_clk1, &ahb_clk); | ||
559 | DEFINE_CLOCK(cspi13_clk1, 0, PCCR0, 29, NULL, NULL, &ipg_clk); | ||
560 | DEFINE_CLOCK(cspi2_clk1, 0, PCCR0, 30, NULL, NULL, &ipg_clk); | ||
561 | DEFINE_CLOCK(cspi1_clk1, 0, PCCR0, 31, NULL, NULL, &ipg_clk); | ||
562 | |||
563 | DEFINE_CLOCK(mstick_clk, 0, PCCR1, 2, NULL, &mstick_clk1, &ipg_clk); | ||
564 | DEFINE_CLOCK(nfc_clk, 0, PCCR1, 3, get_rate_nfc, NULL, &cpu_clk); | ||
565 | DEFINE_CLOCK(ssi2_clk, 1, PCCR1, 4, get_rate_ssi2, &ssi2_clk1, &mpll_main2_clk); | ||
566 | DEFINE_CLOCK(ssi1_clk, 0, PCCR1, 5, get_rate_ssi1, &ssi1_clk1, &mpll_main2_clk); | ||
567 | DEFINE_CLOCK(vpu_clk, 0, PCCR1, 6, get_rate_vpu, &vpu_clk1, &mpll_main2_clk); | ||
568 | DEFINE_CLOCK1(per4_clk, 3, PCCR1, 7, per, NULL, &mpll_main2_clk); | ||
569 | DEFINE_CLOCK1(per3_clk, 2, PCCR1, 8, per, NULL, &mpll_main2_clk); | ||
570 | DEFINE_CLOCK1(per2_clk, 1, PCCR1, 9, per, NULL, &mpll_main2_clk); | ||
571 | DEFINE_CLOCK1(per1_clk, 0, PCCR1, 10, per, NULL, &mpll_main2_clk); | ||
572 | DEFINE_CLOCK(usb_clk1, 0, PCCR1, 11, NULL, NULL, &ahb_clk); | ||
573 | DEFINE_CLOCK(slcdc_clk1, 0, PCCR1, 12, NULL, NULL, &ahb_clk); | ||
574 | DEFINE_CLOCK(sahara2_clk1, 0, PCCR1, 13, NULL, NULL, &ahb_clk); | ||
575 | DEFINE_CLOCK(rtic_clk1, 0, PCCR1, 14, NULL, NULL, &ahb_clk); | ||
576 | DEFINE_CLOCK(lcdc_clk2, 0, PCCR1, 15, NULL, NULL, &ahb_clk); | ||
577 | DEFINE_CLOCK(vpu_clk1, 0, PCCR1, 16, NULL, NULL, &ahb_clk); | ||
578 | DEFINE_CLOCK(fec_clk1, 0, PCCR1, 17, NULL, NULL, &ahb_clk); | ||
579 | DEFINE_CLOCK(emma_clk1, 0, PCCR1, 18, NULL, NULL, &ahb_clk); | ||
580 | DEFINE_CLOCK(emi_clk, 0, PCCR1, 19, NULL, NULL, &ahb_clk); | ||
581 | DEFINE_CLOCK(dma_clk1, 0, PCCR1, 20, NULL, NULL, &ahb_clk); | ||
582 | DEFINE_CLOCK(csi_clk1, 0, PCCR1, 21, NULL, NULL, &ahb_clk); | ||
583 | DEFINE_CLOCK(brom_clk, 0, PCCR1, 22, NULL, NULL, &ahb_clk); | ||
584 | DEFINE_CLOCK(ata_clk, 0, PCCR1, 23, NULL, NULL, &ahb_clk); | ||
585 | DEFINE_CLOCK(wdog_clk, 0, PCCR1, 24, NULL, NULL, &ipg_clk); | ||
586 | DEFINE_CLOCK(usb_clk, 0, PCCR1, 25, get_rate_usb, &usb_clk1, &spll_clk); | ||
587 | DEFINE_CLOCK(uart6_clk1, 0, PCCR1, 26, NULL, NULL, &ipg_clk); | ||
588 | DEFINE_CLOCK(uart5_clk1, 0, PCCR1, 27, NULL, NULL, &ipg_clk); | ||
589 | DEFINE_CLOCK(uart4_clk1, 0, PCCR1, 28, NULL, NULL, &ipg_clk); | ||
590 | DEFINE_CLOCK(uart3_clk1, 0, PCCR1, 29, NULL, NULL, &ipg_clk); | ||
591 | DEFINE_CLOCK(uart2_clk1, 0, PCCR1, 30, NULL, NULL, &ipg_clk); | ||
592 | DEFINE_CLOCK(uart1_clk1, 0, PCCR1, 31, NULL, NULL, &ipg_clk); | ||
593 | |||
594 | /* Clocks we cannot directly gate, but drivers need their rates */ | ||
595 | DEFINE_CLOCK(cspi1_clk, 0, 0, 0, NULL, &cspi1_clk1, &per2_clk); | ||
596 | DEFINE_CLOCK(cspi2_clk, 1, 0, 0, NULL, &cspi2_clk1, &per2_clk); | ||
597 | DEFINE_CLOCK(cspi3_clk, 2, 0, 0, NULL, &cspi13_clk1, &per2_clk); | ||
598 | DEFINE_CLOCK(sdhc1_clk, 0, 0, 0, NULL, &sdhc1_clk1, &per2_clk); | ||
599 | DEFINE_CLOCK(sdhc2_clk, 1, 0, 0, NULL, &sdhc2_clk1, &per2_clk); | ||
600 | DEFINE_CLOCK(sdhc3_clk, 2, 0, 0, NULL, &sdhc3_clk1, &per2_clk); | ||
601 | DEFINE_CLOCK(pwm_clk, 0, 0, 0, NULL, &pwm_clk1, &per1_clk); | ||
602 | DEFINE_CLOCK(gpt1_clk, 0, 0, 0, NULL, &gpt1_clk1, &per1_clk); | ||
603 | DEFINE_CLOCK(gpt2_clk, 1, 0, 0, NULL, &gpt2_clk1, &per1_clk); | ||
604 | DEFINE_CLOCK(gpt3_clk, 2, 0, 0, NULL, &gpt3_clk1, &per1_clk); | ||
605 | DEFINE_CLOCK(gpt4_clk, 3, 0, 0, NULL, &gpt4_clk1, &per1_clk); | ||
606 | DEFINE_CLOCK(gpt5_clk, 4, 0, 0, NULL, &gpt5_clk1, &per1_clk); | ||
607 | DEFINE_CLOCK(gpt6_clk, 5, 0, 0, NULL, &gpt6_clk1, &per1_clk); | ||
608 | DEFINE_CLOCK(uart1_clk, 0, 0, 0, NULL, &uart1_clk1, &per1_clk); | ||
609 | DEFINE_CLOCK(uart2_clk, 1, 0, 0, NULL, &uart2_clk1, &per1_clk); | ||
610 | DEFINE_CLOCK(uart3_clk, 2, 0, 0, NULL, &uart3_clk1, &per1_clk); | ||
611 | DEFINE_CLOCK(uart4_clk, 3, 0, 0, NULL, &uart4_clk1, &per1_clk); | ||
612 | DEFINE_CLOCK(uart5_clk, 4, 0, 0, NULL, &uart5_clk1, &per1_clk); | ||
613 | DEFINE_CLOCK(uart6_clk, 5, 0, 0, NULL, &uart6_clk1, &per1_clk); | ||
614 | DEFINE_CLOCK1(lcdc_clk, 0, 0, 0, parent, &lcdc_clk1, &per3_clk); | ||
615 | DEFINE_CLOCK1(csi_clk, 0, 0, 0, parent, &csi_clk1, &per4_clk); | ||
616 | |||
617 | #define _REGISTER_CLOCK(d, n, c) \ | ||
618 | { \ | ||
619 | .dev_id = d, \ | ||
620 | .con_id = n, \ | ||
621 | .clk = &c, \ | ||
1137 | }, | 622 | }, |
1138 | }; | ||
1139 | |||
1140 | static struct clk nfc_clk = { | ||
1141 | .name = "nfc_clk", | ||
1142 | .parent = &cpu_clk, | ||
1143 | .get_rate = _clk_nfc_recalc, | ||
1144 | .enable = _clk_enable, | ||
1145 | .enable_reg = CCM_PCCR1, | ||
1146 | .enable_shift = CCM_PCCR1_NFC_BAUD_OFFSET, | ||
1147 | .disable = _clk_disable, | ||
1148 | }; | ||
1149 | |||
1150 | static struct clk vpu_clk = { | ||
1151 | .name = "vpu_clk", | ||
1152 | .parent = &mpll_main_clk[1], | ||
1153 | .get_rate = _clk_vpu_recalc, | ||
1154 | .enable = _clk_vpu_enable, | ||
1155 | .disable = _clk_vpu_disable, | ||
1156 | }; | ||
1157 | |||
1158 | static struct clk dma_clk = { | ||
1159 | .name = "dma_clk", | ||
1160 | .parent = &ahb_clk, | ||
1161 | .enable = _clk_dma_enable, | ||
1162 | .disable = _clk_dma_disable, | ||
1163 | }; | ||
1164 | |||
1165 | static struct clk rtic_clk = { | ||
1166 | .name = "rtic_clk", | ||
1167 | .parent = &ahb_clk, | ||
1168 | .enable = _clk_rtic_enable, | ||
1169 | .disable = _clk_rtic_disable, | ||
1170 | }; | ||
1171 | 623 | ||
1172 | static struct clk brom_clk = { | 624 | static struct clk_lookup lookups[] __initdata = { |
1173 | .name = "brom_clk", | 625 | _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) |
1174 | .parent = &ahb_clk, | 626 | _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) |
1175 | .enable = _clk_enable, | 627 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) |
1176 | .enable_reg = CCM_PCCR1, | 628 | _REGISTER_CLOCK("imx-uart.3", NULL, uart4_clk) |
1177 | .enable_shift = CCM_PCCR1_HCLK_BROM_OFFSET, | 629 | _REGISTER_CLOCK("imx-uart.4", NULL, uart5_clk) |
1178 | .disable = _clk_disable, | 630 | _REGISTER_CLOCK("imx-uart.5", NULL, uart6_clk) |
1179 | }; | 631 | _REGISTER_CLOCK(NULL, "gpt1", gpt1_clk) |
1180 | 632 | _REGISTER_CLOCK(NULL, "gpt2", gpt2_clk) | |
1181 | static struct clk emma_clk = { | 633 | _REGISTER_CLOCK(NULL, "gpt3", gpt3_clk) |
1182 | .name = "emma_clk", | 634 | _REGISTER_CLOCK(NULL, "gpt4", gpt4_clk) |
1183 | .parent = &ahb_clk, | 635 | _REGISTER_CLOCK(NULL, "gpt5", gpt5_clk) |
1184 | .enable = _clk_emma_enable, | 636 | _REGISTER_CLOCK(NULL, "gpt6", gpt6_clk) |
1185 | .disable = _clk_emma_disable, | 637 | _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm_clk) |
1186 | }; | 638 | _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk) |
1187 | 639 | _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk) | |
1188 | static struct clk slcdc_clk = { | 640 | _REGISTER_CLOCK("mxc-mmc.2", NULL, sdhc3_clk) |
1189 | .name = "slcdc_clk", | 641 | _REGISTER_CLOCK(NULL, "cspi1", cspi1_clk) |
1190 | .parent = &ahb_clk, | 642 | _REGISTER_CLOCK(NULL, "cspi2", cspi2_clk) |
1191 | .enable = _clk_slcdc_enable, | 643 | _REGISTER_CLOCK(NULL, "cspi3", cspi3_clk) |
1192 | .disable = _clk_slcdc_disable, | 644 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) |
1193 | }; | 645 | _REGISTER_CLOCK(NULL, "csi", csi_clk) |
1194 | 646 | _REGISTER_CLOCK(NULL, "usb", usb_clk) | |
1195 | static struct clk fec_clk = { | 647 | _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk) |
1196 | .name = "fec_clk", | 648 | _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk) |
1197 | .parent = &ahb_clk, | 649 | _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) |
1198 | .enable = _clk_fec_enable, | 650 | _REGISTER_CLOCK(NULL, "vpu", vpu_clk) |
1199 | .disable = _clk_fec_disable, | 651 | _REGISTER_CLOCK(NULL, "dma", dma_clk) |
1200 | }; | 652 | _REGISTER_CLOCK(NULL, "rtic", rtic_clk) |
1201 | 653 | _REGISTER_CLOCK(NULL, "brom", brom_clk) | |
1202 | static struct clk emi_clk = { | 654 | _REGISTER_CLOCK(NULL, "emma", emma_clk) |
1203 | .name = "emi_clk", | 655 | _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk) |
1204 | .parent = &ahb_clk, | 656 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) |
1205 | .enable = _clk_enable, | 657 | _REGISTER_CLOCK(NULL, "emi", emi_clk) |
1206 | .enable_reg = CCM_PCCR1, | 658 | _REGISTER_CLOCK(NULL, "sahara2", sahara2_clk) |
1207 | .enable_shift = CCM_PCCR1_HCLK_EMI_OFFSET, | 659 | _REGISTER_CLOCK(NULL, "ata", ata_clk) |
1208 | .disable = _clk_disable, | 660 | _REGISTER_CLOCK(NULL, "mstick", mstick_clk) |
1209 | }; | 661 | _REGISTER_CLOCK(NULL, "wdog", wdog_clk) |
1210 | 662 | _REGISTER_CLOCK(NULL, "gpio", gpio_clk) | |
1211 | static struct clk sahara2_clk = { | 663 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) |
1212 | .name = "sahara_clk", | 664 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) |
1213 | .parent = &ahb_clk, | 665 | _REGISTER_CLOCK(NULL, "iim", iim_clk) |
1214 | .enable = _clk_sahara2_enable, | 666 | _REGISTER_CLOCK(NULL, "kpp", kpp_clk) |
1215 | .disable = _clk_sahara2_disable, | 667 | _REGISTER_CLOCK("mxc_w1.0", NULL, owire_clk) |
1216 | }; | 668 | _REGISTER_CLOCK(NULL, "rtc", rtc_clk) |
1217 | 669 | _REGISTER_CLOCK(NULL, "scc", scc_clk) | |
1218 | static struct clk ata_clk = { | 670 | }; |
1219 | .name = "ata_clk", | 671 | |
1220 | .parent = &ahb_clk, | 672 | /* Adjust the clock path for TO2 and later */ |
1221 | .enable = _clk_enable, | 673 | static void __init to2_adjust_clocks(void) |
1222 | .enable_reg = CCM_PCCR1, | 674 | { |
1223 | .enable_shift = CCM_PCCR1_HCLK_ATA_OFFSET, | 675 | unsigned long cscr = __raw_readl(CCM_CSCR); |
1224 | .disable = _clk_disable, | ||
1225 | }; | ||
1226 | |||
1227 | static struct clk mstick1_clk = { | ||
1228 | .name = "mstick1_clk", | ||
1229 | .parent = &ipg_clk, | ||
1230 | .enable = _clk_mstick1_enable, | ||
1231 | .disable = _clk_mstick1_disable, | ||
1232 | }; | ||
1233 | |||
1234 | static struct clk wdog_clk = { | ||
1235 | .name = "wdog_clk", | ||
1236 | .parent = &ipg_clk, | ||
1237 | .enable = _clk_enable, | ||
1238 | .enable_reg = CCM_PCCR1, | ||
1239 | .enable_shift = CCM_PCCR1_WDT_OFFSET, | ||
1240 | .disable = _clk_disable, | ||
1241 | }; | ||
1242 | |||
1243 | static struct clk gpio_clk = { | ||
1244 | .name = "gpio_clk", | ||
1245 | .parent = &ipg_clk, | ||
1246 | .enable = _clk_enable, | ||
1247 | .enable_reg = CCM_PCCR1, | ||
1248 | .enable_shift = CCM_PCCR0_GPIO_OFFSET, | ||
1249 | .disable = _clk_disable, | ||
1250 | }; | ||
1251 | |||
1252 | static struct clk i2c_clk[] = { | ||
1253 | { | ||
1254 | .name = "i2c_clk", | ||
1255 | .id = 0, | ||
1256 | .parent = &ipg_clk, | ||
1257 | .enable = _clk_enable, | ||
1258 | .enable_reg = CCM_PCCR0, | ||
1259 | .enable_shift = CCM_PCCR0_I2C1_OFFSET, | ||
1260 | .disable = _clk_disable, | ||
1261 | }, { | ||
1262 | .name = "i2c_clk", | ||
1263 | .id = 1, | ||
1264 | .parent = &ipg_clk, | ||
1265 | .enable = _clk_enable, | ||
1266 | .enable_reg = CCM_PCCR0, | ||
1267 | .enable_shift = CCM_PCCR0_I2C2_OFFSET, | ||
1268 | .disable = _clk_disable, | ||
1269 | }, | ||
1270 | }; | ||
1271 | |||
1272 | static struct clk iim_clk = { | ||
1273 | .name = "iim_clk", | ||
1274 | .parent = &ipg_clk, | ||
1275 | .enable = _clk_enable, | ||
1276 | .enable_reg = CCM_PCCR0, | ||
1277 | .enable_shift = CCM_PCCR0_IIM_OFFSET, | ||
1278 | .disable = _clk_disable, | ||
1279 | }; | ||
1280 | |||
1281 | static struct clk kpp_clk = { | ||
1282 | .name = "kpp_clk", | ||
1283 | .parent = &ipg_clk, | ||
1284 | .enable = _clk_enable, | ||
1285 | .enable_reg = CCM_PCCR0, | ||
1286 | .enable_shift = CCM_PCCR0_KPP_OFFSET, | ||
1287 | .disable = _clk_disable, | ||
1288 | }; | ||
1289 | |||
1290 | static struct clk owire_clk = { | ||
1291 | .name = "owire_clk", | ||
1292 | .parent = &ipg_clk, | ||
1293 | .enable = _clk_enable, | ||
1294 | .enable_reg = CCM_PCCR0, | ||
1295 | .enable_shift = CCM_PCCR0_OWIRE_OFFSET, | ||
1296 | .disable = _clk_disable, | ||
1297 | }; | ||
1298 | |||
1299 | static struct clk rtc_clk = { | ||
1300 | .name = "rtc_clk", | ||
1301 | .parent = &ipg_clk, | ||
1302 | .enable = _clk_enable, | ||
1303 | .enable_reg = CCM_PCCR0, | ||
1304 | .enable_shift = CCM_PCCR0_RTC_OFFSET, | ||
1305 | .disable = _clk_disable, | ||
1306 | }; | ||
1307 | |||
1308 | static struct clk scc_clk = { | ||
1309 | .name = "scc_clk", | ||
1310 | .parent = &ipg_clk, | ||
1311 | .enable = _clk_enable, | ||
1312 | .enable_reg = CCM_PCCR0, | ||
1313 | .enable_shift = CCM_PCCR0_SCC_OFFSET, | ||
1314 | .disable = _clk_disable, | ||
1315 | }; | ||
1316 | |||
1317 | static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate) | ||
1318 | { | ||
1319 | u32 div; | ||
1320 | unsigned long parent_rate; | ||
1321 | |||
1322 | parent_rate = clk_get_rate(clk->parent); | ||
1323 | div = parent_rate / rate; | ||
1324 | if (parent_rate % rate) | ||
1325 | div++; | ||
1326 | |||
1327 | if (div > 8) | ||
1328 | div = 8; | ||
1329 | |||
1330 | return parent_rate / div; | ||
1331 | } | ||
1332 | |||
1333 | static int _clk_clko_set_rate(struct clk *clk, unsigned long rate) | ||
1334 | { | ||
1335 | u32 reg; | ||
1336 | u32 div; | ||
1337 | unsigned long parent_rate; | ||
1338 | |||
1339 | parent_rate = clk_get_rate(clk->parent); | ||
1340 | |||
1341 | div = parent_rate / rate; | ||
1342 | |||
1343 | if (div > 8 || div < 1 || ((parent_rate / div) != rate)) | ||
1344 | return -EINVAL; | ||
1345 | div--; | ||
1346 | |||
1347 | reg = __raw_readl(CCM_PCDR0) & ~CCM_PCDR0_CLKODIV_MASK; | ||
1348 | reg |= div << CCM_PCDR0_CLKODIV_OFFSET; | ||
1349 | __raw_writel(reg, CCM_PCDR0); | ||
1350 | |||
1351 | return 0; | ||
1352 | } | ||
1353 | |||
1354 | static unsigned long _clk_clko_recalc(struct clk *clk) | ||
1355 | { | ||
1356 | u32 div; | ||
1357 | unsigned long parent_rate; | ||
1358 | |||
1359 | parent_rate = clk_get_rate(clk->parent); | ||
1360 | |||
1361 | div = __raw_readl(CCM_PCDR0) & CCM_PCDR0_CLKODIV_MASK >> | ||
1362 | CCM_PCDR0_CLKODIV_OFFSET; | ||
1363 | div++; | ||
1364 | |||
1365 | return parent_rate / div; | ||
1366 | } | ||
1367 | |||
1368 | static int _clk_clko_set_parent(struct clk *clk, struct clk *parent) | ||
1369 | { | ||
1370 | u32 reg; | ||
1371 | |||
1372 | reg = __raw_readl(CCM_CCSR) & ~CCM_CCSR_CLKOSEL_MASK; | ||
1373 | |||
1374 | if (parent == &ckil_clk) | ||
1375 | reg |= 0 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1376 | else if (parent == &ckih_clk) | ||
1377 | reg |= 2 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1378 | else if (parent == mpll_clk.parent) | ||
1379 | reg |= 3 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1380 | else if (parent == spll_clk.parent) | ||
1381 | reg |= 4 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1382 | else if (parent == &mpll_clk) | ||
1383 | reg |= 5 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1384 | else if (parent == &spll_clk) | ||
1385 | reg |= 6 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1386 | else if (parent == &cpu_clk) | ||
1387 | reg |= 7 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1388 | else if (parent == &ahb_clk) | ||
1389 | reg |= 8 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1390 | else if (parent == &ipg_clk) | ||
1391 | reg |= 9 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1392 | else if (parent == &per_clk[0]) | ||
1393 | reg |= 0xA << CCM_CCSR_CLKOSEL_OFFSET; | ||
1394 | else if (parent == &per_clk[1]) | ||
1395 | reg |= 0xB << CCM_CCSR_CLKOSEL_OFFSET; | ||
1396 | else if (parent == &per_clk[2]) | ||
1397 | reg |= 0xC << CCM_CCSR_CLKOSEL_OFFSET; | ||
1398 | else if (parent == &per_clk[3]) | ||
1399 | reg |= 0xD << CCM_CCSR_CLKOSEL_OFFSET; | ||
1400 | else if (parent == &ssi1_clk[0]) | ||
1401 | reg |= 0xE << CCM_CCSR_CLKOSEL_OFFSET; | ||
1402 | else if (parent == &ssi2_clk[0]) | ||
1403 | reg |= 0xF << CCM_CCSR_CLKOSEL_OFFSET; | ||
1404 | else if (parent == &nfc_clk) | ||
1405 | reg |= 0x10 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1406 | else if (parent == &mstick1_clk) | ||
1407 | reg |= 0x11 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1408 | else if (parent == &vpu_clk) | ||
1409 | reg |= 0x12 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1410 | else if (parent == &usb_clk[0]) | ||
1411 | reg |= 0x15 << CCM_CCSR_CLKOSEL_OFFSET; | ||
1412 | else | ||
1413 | return -EINVAL; | ||
1414 | |||
1415 | __raw_writel(reg, CCM_CCSR); | ||
1416 | |||
1417 | return 0; | ||
1418 | } | ||
1419 | |||
1420 | static int _clk_clko_enable(struct clk *clk) | ||
1421 | { | ||
1422 | u32 reg; | ||
1423 | |||
1424 | reg = __raw_readl(CCM_PCDR0) | CCM_PCDR0_CLKO_EN; | ||
1425 | __raw_writel(reg, CCM_PCDR0); | ||
1426 | |||
1427 | return 0; | ||
1428 | } | ||
1429 | |||
1430 | static void _clk_clko_disable(struct clk *clk) | ||
1431 | { | ||
1432 | u32 reg; | ||
1433 | |||
1434 | reg = __raw_readl(CCM_PCDR0) & ~CCM_PCDR0_CLKO_EN; | ||
1435 | __raw_writel(reg, CCM_PCDR0); | ||
1436 | } | ||
1437 | |||
1438 | static struct clk clko_clk = { | ||
1439 | .name = "clko_clk", | ||
1440 | .get_rate = _clk_clko_recalc, | ||
1441 | .set_rate = _clk_clko_set_rate, | ||
1442 | .round_rate = _clk_clko_round_rate, | ||
1443 | .set_parent = _clk_clko_set_parent, | ||
1444 | .enable = _clk_clko_enable, | ||
1445 | .disable = _clk_clko_disable, | ||
1446 | }; | ||
1447 | |||
1448 | static struct clk *mxc_clks[] = { | ||
1449 | &ckih_clk, | ||
1450 | &ckil_clk, | ||
1451 | &mpll_clk, | ||
1452 | &mpll_main_clk[0], | ||
1453 | &mpll_main_clk[1], | ||
1454 | &spll_clk, | ||
1455 | &cpu_clk, | ||
1456 | &ahb_clk, | ||
1457 | &ipg_clk, | ||
1458 | &per_clk[0], | ||
1459 | &per_clk[1], | ||
1460 | &per_clk[2], | ||
1461 | &per_clk[3], | ||
1462 | &clko_clk, | ||
1463 | &uart1_clk[0], | ||
1464 | &uart1_clk[1], | ||
1465 | &uart2_clk[0], | ||
1466 | &uart2_clk[1], | ||
1467 | &uart3_clk[0], | ||
1468 | &uart3_clk[1], | ||
1469 | &uart4_clk[0], | ||
1470 | &uart4_clk[1], | ||
1471 | &uart5_clk[0], | ||
1472 | &uart5_clk[1], | ||
1473 | &uart6_clk[0], | ||
1474 | &uart6_clk[1], | ||
1475 | &gpt1_clk[0], | ||
1476 | &gpt1_clk[1], | ||
1477 | &gpt2_clk[0], | ||
1478 | &gpt2_clk[1], | ||
1479 | &gpt3_clk[0], | ||
1480 | &gpt3_clk[1], | ||
1481 | &gpt4_clk[0], | ||
1482 | &gpt4_clk[1], | ||
1483 | &gpt5_clk[0], | ||
1484 | &gpt5_clk[1], | ||
1485 | &gpt6_clk[0], | ||
1486 | &gpt6_clk[1], | ||
1487 | &pwm_clk[0], | ||
1488 | &pwm_clk[1], | ||
1489 | &sdhc1_clk[0], | ||
1490 | &sdhc1_clk[1], | ||
1491 | &sdhc2_clk[0], | ||
1492 | &sdhc2_clk[1], | ||
1493 | &sdhc3_clk[0], | ||
1494 | &sdhc3_clk[1], | ||
1495 | &cspi1_clk[0], | ||
1496 | &cspi1_clk[1], | ||
1497 | &cspi2_clk[0], | ||
1498 | &cspi2_clk[1], | ||
1499 | &cspi3_clk[0], | ||
1500 | &cspi3_clk[1], | ||
1501 | &lcdc_clk[0], | ||
1502 | &lcdc_clk[1], | ||
1503 | &lcdc_clk[2], | ||
1504 | &csi_clk[0], | ||
1505 | &csi_clk[1], | ||
1506 | &usb_clk[0], | ||
1507 | &usb_clk[1], | ||
1508 | &ssi1_clk[0], | ||
1509 | &ssi1_clk[1], | ||
1510 | &ssi2_clk[0], | ||
1511 | &ssi2_clk[1], | ||
1512 | &nfc_clk, | ||
1513 | &vpu_clk, | ||
1514 | &dma_clk, | ||
1515 | &rtic_clk, | ||
1516 | &brom_clk, | ||
1517 | &emma_clk, | ||
1518 | &slcdc_clk, | ||
1519 | &fec_clk, | ||
1520 | &emi_clk, | ||
1521 | &sahara2_clk, | ||
1522 | &ata_clk, | ||
1523 | &mstick1_clk, | ||
1524 | &wdog_clk, | ||
1525 | &gpio_clk, | ||
1526 | &i2c_clk[0], | ||
1527 | &i2c_clk[1], | ||
1528 | &iim_clk, | ||
1529 | &kpp_clk, | ||
1530 | &owire_clk, | ||
1531 | &rtc_clk, | ||
1532 | &scc_clk, | ||
1533 | }; | ||
1534 | |||
1535 | void __init change_external_low_reference(unsigned long new_ref) | ||
1536 | { | ||
1537 | external_low_reference = new_ref; | ||
1538 | } | ||
1539 | |||
1540 | unsigned long __init clk_early_get_timer_rate(void) | ||
1541 | { | ||
1542 | return clk_get_rate(&per_clk[0]); | ||
1543 | } | ||
1544 | |||
1545 | static void __init probe_mxc_clocks(void) | ||
1546 | { | ||
1547 | int i; | ||
1548 | 676 | ||
1549 | if (mx27_revision() >= CHIP_REV_2_0) { | 677 | if (mx27_revision() >= CHIP_REV_2_0) { |
1550 | if (CSCR() & 0x8000) | 678 | if (cscr & CCM_CSCR_ARM_SRC) |
1551 | cpu_clk.parent = &mpll_main_clk[0]; | 679 | cpu_clk.parent = &mpll_main1_clk; |
1552 | 680 | ||
1553 | if (!(CSCR() & 0x00800000)) | 681 | if (!(cscr & CCM_CSCR_SSI2)) |
1554 | ssi2_clk[0].parent = &spll_clk; | 682 | ssi1_clk.parent = &spll_clk; |
1555 | 683 | ||
1556 | if (!(CSCR() & 0x00400000)) | 684 | if (!(cscr & CCM_CSCR_SSI1)) |
1557 | ssi1_clk[0].parent = &spll_clk; | 685 | ssi1_clk.parent = &spll_clk; |
1558 | 686 | ||
1559 | if (!(CSCR() & 0x00200000)) | 687 | if (!(cscr & CCM_CSCR_VPU)) |
1560 | vpu_clk.parent = &spll_clk; | 688 | vpu_clk.parent = &spll_clk; |
1561 | } else { | 689 | } else { |
1562 | cpu_clk.parent = &mpll_clk; | 690 | cpu_clk.parent = &mpll_clk; |
@@ -1565,11 +693,13 @@ static void __init probe_mxc_clocks(void) | |||
1565 | cpu_clk.set_rate = NULL; | 693 | cpu_clk.set_rate = NULL; |
1566 | ahb_clk.parent = &mpll_clk; | 694 | ahb_clk.parent = &mpll_clk; |
1567 | 695 | ||
1568 | for (i = 0; i < sizeof(per_clk) / sizeof(per_clk[0]); i++) | 696 | per1_clk.parent = &mpll_clk; |
1569 | per_clk[i].parent = &mpll_clk; | 697 | per2_clk.parent = &mpll_clk; |
698 | per3_clk.parent = &mpll_clk; | ||
699 | per4_clk.parent = &mpll_clk; | ||
1570 | 700 | ||
1571 | ssi1_clk[0].parent = &mpll_clk; | 701 | ssi1_clk.parent = &mpll_clk; |
1572 | ssi2_clk[0].parent = &mpll_clk; | 702 | ssi2_clk.parent = &mpll_clk; |
1573 | 703 | ||
1574 | vpu_clk.parent = &mpll_clk; | 704 | vpu_clk.parent = &mpll_clk; |
1575 | } | 705 | } |
@@ -1579,47 +709,47 @@ static void __init probe_mxc_clocks(void) | |||
1579 | * must be called very early to get information about the | 709 | * must be called very early to get information about the |
1580 | * available clock rate when the timer framework starts | 710 | * available clock rate when the timer framework starts |
1581 | */ | 711 | */ |
1582 | int __init mxc_clocks_init(unsigned long fref) | 712 | int __init mx27_clocks_init(unsigned long fref) |
1583 | { | 713 | { |
1584 | u32 cscr; | 714 | u32 cscr = __raw_readl(CCM_CSCR); |
1585 | struct clk **clkp; | 715 | int i; |
1586 | 716 | ||
1587 | external_high_reference = fref; | 717 | external_high_reference = fref; |
1588 | 718 | ||
1589 | /* detect clock reference for both system PLL */ | 719 | /* detect clock reference for both system PLLs */ |
1590 | cscr = CSCR(); | ||
1591 | if (cscr & CCM_CSCR_MCU) | 720 | if (cscr & CCM_CSCR_MCU) |
1592 | mpll_clk.parent = &ckih_clk; | 721 | mpll_clk.parent = &ckih_clk; |
1593 | else | 722 | else |
1594 | mpll_clk.parent = &ckil_clk; | 723 | mpll_clk.parent = &fpm_clk; |
1595 | 724 | ||
1596 | if (cscr & CCM_CSCR_SP) | 725 | if (cscr & CCM_CSCR_SP) |
1597 | spll_clk.parent = &ckih_clk; | 726 | spll_clk.parent = &ckih_clk; |
1598 | else | 727 | else |
1599 | spll_clk.parent = &ckil_clk; | 728 | spll_clk.parent = &fpm_clk; |
1600 | 729 | ||
1601 | probe_mxc_clocks(); | 730 | to2_adjust_clocks(); |
1602 | 731 | ||
1603 | per_clk[0].enable(&per_clk[0]); | 732 | for (i = 0; i < ARRAY_SIZE(lookups); i++) |
1604 | gpt1_clk[1].enable(&gpt1_clk[1]); | 733 | clkdev_add(&lookups[i]); |
1605 | 734 | ||
1606 | for (clkp = mxc_clks; clkp < mxc_clks + ARRAY_SIZE(mxc_clks); clkp++) | 735 | /* Turn off all clocks we do not need */ |
1607 | clk_register(*clkp); | 736 | __raw_writel(0, CCM_PCCR0); |
737 | __raw_writel((1 << 10) | (1 << 19), CCM_PCCR1); | ||
1608 | 738 | ||
1609 | /* Turn off all possible clocks */ | ||
1610 | __raw_writel(CCM_PCCR0_GPT1_MASK, CCM_PCCR0); | ||
1611 | __raw_writel(CCM_PCCR1_PERCLK1_MASK | CCM_PCCR1_HCLK_EMI_MASK, | ||
1612 | CCM_PCCR1); | ||
1613 | spll_clk.disable(&spll_clk); | 739 | spll_clk.disable(&spll_clk); |
1614 | 740 | ||
1615 | /* This will propagate to all children and init all the clock rates */ | 741 | /* enable basic clocks */ |
1616 | 742 | clk_enable(&per1_clk); | |
1617 | clk_enable(&emi_clk); | ||
1618 | clk_enable(&gpio_clk); | 743 | clk_enable(&gpio_clk); |
744 | clk_enable(&emi_clk); | ||
1619 | clk_enable(&iim_clk); | 745 | clk_enable(&iim_clk); |
1620 | clk_enable(&gpt1_clk[0]); | 746 | |
1621 | #ifdef CONFIG_DEBUG_LL_CONSOLE | 747 | #ifdef CONFIG_DEBUG_LL_CONSOLE |
1622 | clk_enable(&uart1_clk[0]); | 748 | clk_enable(&uart1_clk); |
1623 | #endif | 749 | #endif |
750 | |||
751 | mxc_timer_init(&gpt1_clk); | ||
752 | |||
1624 | return 0; | 753 | return 0; |
1625 | } | 754 | } |
755 | |||
diff --git a/arch/arm/mach-mx2/cpu_imx27.c b/arch/arm/mach-mx2/cpu_imx27.c index 239308fe6652..d9e3bf9644c9 100644 --- a/arch/arm/mach-mx2/cpu_imx27.c +++ b/arch/arm/mach-mx2/cpu_imx27.c | |||
@@ -26,11 +26,11 @@ | |||
26 | 26 | ||
27 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
28 | 28 | ||
29 | #include "crm_regs.h" | ||
30 | |||
31 | static int cpu_silicon_rev = -1; | 29 | static int cpu_silicon_rev = -1; |
32 | static int cpu_partnumber; | 30 | static int cpu_partnumber; |
33 | 31 | ||
32 | #define SYS_CHIP_ID 0x00 /* The offset of CHIP ID register */ | ||
33 | |||
34 | static void query_silicon_parameter(void) | 34 | static void query_silicon_parameter(void) |
35 | { | 35 | { |
36 | u32 val; | 36 | u32 val; |
diff --git a/arch/arm/mach-mx2/crm_regs.h b/arch/arm/mach-mx2/crm_regs.h index 94644cd0a0fc..749de76b3f95 100644 --- a/arch/arm/mach-mx2/crm_regs.h +++ b/arch/arm/mach-mx2/crm_regs.h | |||
@@ -38,42 +38,36 @@ | |||
38 | #define CCM_PMCOUNT (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) | 38 | #define CCM_PMCOUNT (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) |
39 | #define CCM_WKGDCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) | 39 | #define CCM_WKGDCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) |
40 | 40 | ||
41 | #define CCM_CSCR_USB_OFFSET 28 | 41 | #define CCM_CSCR_PRESC_OFFSET 29 |
42 | #define CCM_CSCR_USB_MASK (0x7 << 28) | 42 | #define CCM_CSCR_PRESC_MASK (0x7 << CCM_CSCR_PRESC_OFFSET) |
43 | |||
44 | #define CCM_CSCR_USB_OFFSET 26 | ||
45 | #define CCM_CSCR_USB_MASK (0x7 << CCM_CSCR_USB_OFFSET) | ||
43 | #define CCM_CSCR_SD_OFFSET 24 | 46 | #define CCM_CSCR_SD_OFFSET 24 |
44 | #define CCM_CSCR_SD_MASK (0x3 << 24) | 47 | #define CCM_CSCR_SD_MASK (0x3 << CCM_CSCR_SD_OFFSET) |
45 | #define CCM_CSCR_SSI2 (1 << 23) | 48 | #define CCM_CSCR_SPLLRES (1 << 22) |
46 | #define CCM_CSCR_SSI2_OFFSET 23 | 49 | #define CCM_CSCR_MPLLRES (1 << 21) |
47 | #define CCM_CSCR_SSI1 (1 << 22) | 50 | #define CCM_CSCR_SSI2_OFFSET 20 |
48 | #define CCM_CSCR_SSI1_OFFSET 22 | 51 | #define CCM_CSCR_SSI2 (1 << CCM_CSCR_SSI2_OFFSET) |
49 | #define CCM_CSCR_VPU (1 << 21) | 52 | #define CCM_CSCR_SSI1_OFFSET 19 |
50 | #define CCM_CSCR_VPU_OFFSET 21 | 53 | #define CCM_CSCR_SSI1 (1 << CCM_CSCR_SSI1_OFFSET) |
51 | #define CCM_CSCR_MSHC (1 << 20) | 54 | #define CCM_CSCR_FIR_OFFSET 18 |
52 | #define CCM_CSCR_SPLLRES (1 << 19) | 55 | #define CCM_CSCR_FIR (1 << CCM_CSCR_FIR_OFFSET) |
53 | #define CCM_CSCR_MPLLRES (1 << 18) | ||
54 | #define CCM_CSCR_SP (1 << 17) | 56 | #define CCM_CSCR_SP (1 << 17) |
55 | #define CCM_CSCR_MCU (1 << 16) | 57 | #define CCM_CSCR_MCU (1 << 16) |
56 | /* CCM_CSCR_ARM_xxx just be avaliable on i.MX27 TO2*/ | 58 | #define CCM_CSCR_BCLK_OFFSET 10 |
57 | #define CCM_CSCR_ARM_SRC (1 << 15) | 59 | #define CCM_CSCR_BCLK_MASK (0xf << CCM_CSCR_BCLK_OFFSET) |
58 | #define CCM_CSCR_ARM_OFFSET 12 | 60 | #define CCM_CSCR_IPDIV_OFFSET 9 |
59 | #define CCM_CSCR_ARM_MASK (0x3 << 12) | 61 | #define CCM_CSCR_IPDIV (1 << CCM_CSCR_IPDIV_OFFSET) |
60 | /* CCM_CSCR_ARM_xxx just be avaliable on i.MX27 TO2*/ | 62 | |
61 | #define CCM_CSCR_PRESC_OFFSET 13 | ||
62 | #define CCM_CSCR_PRESC_MASK (0x7 << 13) | ||
63 | #define CCM_CSCR_BCLK_OFFSET 9 | ||
64 | #define CCM_CSCR_BCLK_MASK (0xf << 9) | ||
65 | #define CCM_CSCR_IPDIV_OFFSET 8 | ||
66 | #define CCM_CSCR_IPDIV (1 << 8) | ||
67 | /* CCM_CSCR_AHB_xxx just be avaliable on i.MX27 TO2*/ | ||
68 | #define CCM_CSCR_AHB_OFFSET 8 | ||
69 | #define CCM_CSCR_AHB_MASK (0x3 << 8) | ||
70 | /* CCM_CSCR_AHB_xxx just be avaliable on i.MX27 TO2*/ | ||
71 | #define CCM_CSCR_OSC26MDIV (1 << 4) | 63 | #define CCM_CSCR_OSC26MDIV (1 << 4) |
72 | #define CCM_CSCR_OSC26M (1 << 3) | 64 | #define CCM_CSCR_OSC26M (1 << 3) |
73 | #define CCM_CSCR_FPM (1 << 2) | 65 | #define CCM_CSCR_FPM (1 << 2) |
74 | #define CCM_CSCR_SPEN (1 << 1) | 66 | #define CCM_CSCR_SPEN (1 << 1) |
75 | #define CCM_CSCR_MPEN 1 | 67 | #define CCM_CSCR_MPEN 1 |
76 | 68 | ||
69 | |||
70 | |||
77 | #define CCM_MPCTL0_CPLM (1 << 31) | 71 | #define CCM_MPCTL0_CPLM (1 << 31) |
78 | #define CCM_MPCTL0_PD_OFFSET 26 | 72 | #define CCM_MPCTL0_PD_OFFSET 26 |
79 | #define CCM_MPCTL0_PD_MASK (0xf << 26) | 73 | #define CCM_MPCTL0_PD_MASK (0xf << 26) |
@@ -109,25 +103,14 @@ | |||
109 | 103 | ||
110 | #define CCM_PCDR0_SSI2BAUDDIV_OFFSET 26 | 104 | #define CCM_PCDR0_SSI2BAUDDIV_OFFSET 26 |
111 | #define CCM_PCDR0_SSI2BAUDDIV_MASK (0x3f << 26) | 105 | #define CCM_PCDR0_SSI2BAUDDIV_MASK (0x3f << 26) |
112 | #define CCM_PCDR0_CLKO_EN 25 | ||
113 | #define CCM_PCDR0_CLKODIV_OFFSET 22 | ||
114 | #define CCM_PCDR0_CLKODIV_MASK (0x7 << 22) | ||
115 | #define CCM_PCDR0_SSI1BAUDDIV_OFFSET 16 | 106 | #define CCM_PCDR0_SSI1BAUDDIV_OFFSET 16 |
116 | #define CCM_PCDR0_SSI1BAUDDIV_MASK (0x3f << 16) | 107 | #define CCM_PCDR0_SSI1BAUDDIV_MASK (0x3f << 16) |
117 | /*The difinition for i.MX27 TO2*/ | ||
118 | #define CCM_PCDR0_VPUDIV2_OFFSET 10 | ||
119 | #define CCM_PCDR0_VPUDIV2_MASK (0x3f << 10) | ||
120 | #define CCM_PCDR0_NFCDIV2_OFFSET 6 | ||
121 | #define CCM_PCDR0_NFCDIV2_MASK (0xf << 6) | ||
122 | #define CCM_PCDR0_MSHCDIV2_MASK 0x3f | ||
123 | /*The difinition for i.MX27 TO2*/ | ||
124 | #define CCM_PCDR0_NFCDIV_OFFSET 12 | 108 | #define CCM_PCDR0_NFCDIV_OFFSET 12 |
125 | #define CCM_PCDR0_NFCDIV_MASK (0xf << 12) | 109 | #define CCM_PCDR0_NFCDIV_MASK (0xf << 12) |
126 | #define CCM_PCDR0_VPUDIV_OFFSET 8 | 110 | #define CCM_PCDR0_48MDIV_OFFSET 5 |
127 | #define CCM_PCDR0_VPUDIV_MASK (0xf << 8) | 111 | #define CCM_PCDR0_48MDIV_MASK (0x7 << CCM_PCDR0_48MDIV_OFFSET) |
128 | #define CCM_PCDR0_MSHCDIV_OFFSET 0 | 112 | #define CCM_PCDR0_FIRIDIV_OFFSET 0 |
129 | #define CCM_PCDR0_MSHCDIV_MASK 0x1f | 113 | #define CCM_PCDR0_FIRIDIV_MASK 0x1f |
130 | |||
131 | #define CCM_PCDR1_PERDIV4_OFFSET 24 | 114 | #define CCM_PCDR1_PERDIV4_OFFSET 24 |
132 | #define CCM_PCDR1_PERDIV4_MASK (0x3f << 24) | 115 | #define CCM_PCDR1_PERDIV4_MASK (0x3f << 24) |
133 | #define CCM_PCDR1_PERDIV3_OFFSET 16 | 116 | #define CCM_PCDR1_PERDIV3_OFFSET 16 |
@@ -137,133 +120,135 @@ | |||
137 | #define CCM_PCDR1_PERDIV1_OFFSET 0 | 120 | #define CCM_PCDR1_PERDIV1_OFFSET 0 |
138 | #define CCM_PCDR1_PERDIV1_MASK 0x3f | 121 | #define CCM_PCDR1_PERDIV1_MASK 0x3f |
139 | 122 | ||
140 | #define CCM_PCCR0_CSPI1_OFFSET 31 | 123 | #define CCM_PCCR_HCLK_CSI_OFFSET 31 |
141 | #define CCM_PCCR0_CSPI1_MASK (1 << 31) | 124 | #define CCM_PCCR_HCLK_CSI_REG CCM_PCCR0 |
142 | #define CCM_PCCR0_CSPI2_OFFSET 30 | 125 | #define CCM_PCCR_HCLK_DMA_OFFSET 30 |
143 | #define CCM_PCCR0_CSPI2_MASK (1 << 30) | 126 | #define CCM_PCCR_HCLK_DMA_REG CCM_PCCR0 |
144 | #define CCM_PCCR0_CSPI3_OFFSET 29 | 127 | #define CCM_PCCR_HCLK_BROM_OFFSET 28 |
145 | #define CCM_PCCR0_CSPI3_MASK (1 << 29) | 128 | #define CCM_PCCR_HCLK_BROM_REG CCM_PCCR0 |
146 | #define CCM_PCCR0_DMA_OFFSET 28 | 129 | #define CCM_PCCR_HCLK_EMMA_OFFSET 27 |
147 | #define CCM_PCCR0_DMA_MASK (1 << 28) | 130 | #define CCM_PCCR_HCLK_EMMA_REG CCM_PCCR0 |
148 | #define CCM_PCCR0_EMMA_OFFSET 27 | 131 | #define CCM_PCCR_HCLK_LCDC_OFFSET 26 |
149 | #define CCM_PCCR0_EMMA_MASK (1 << 27) | 132 | #define CCM_PCCR_HCLK_LCDC_REG CCM_PCCR0 |
150 | #define CCM_PCCR0_FEC_OFFSET 26 | 133 | #define CCM_PCCR_HCLK_SLCDC_OFFSET 25 |
151 | #define CCM_PCCR0_FEC_MASK (1 << 26) | 134 | #define CCM_PCCR_HCLK_SLCDC_REG CCM_PCCR0 |
152 | #define CCM_PCCR0_GPIO_OFFSET 25 | 135 | #define CCM_PCCR_HCLK_USBOTG_OFFSET 24 |
153 | #define CCM_PCCR0_GPIO_MASK (1 << 25) | 136 | #define CCM_PCCR_HCLK_USBOTG_REG CCM_PCCR0 |
154 | #define CCM_PCCR0_GPT1_OFFSET 24 | 137 | #define CCM_PCCR_HCLK_BMI_OFFSET 23 |
155 | #define CCM_PCCR0_GPT1_MASK (1 << 24) | 138 | #define CCM_PCCR_BMI_MASK (1 << CCM_PCCR_BMI_MASK) |
156 | #define CCM_PCCR0_GPT2_OFFSET 23 | 139 | #define CCM_PCCR_HCLK_BMI_REG CCM_PCCR0 |
157 | #define CCM_PCCR0_GPT2_MASK (1 << 23) | 140 | #define CCM_PCCR_PERCLK4_OFFSET 22 |
158 | #define CCM_PCCR0_GPT3_OFFSET 22 | 141 | #define CCM_PCCR_PERCLK4_REG CCM_PCCR0 |
159 | #define CCM_PCCR0_GPT3_MASK (1 << 22) | 142 | #define CCM_PCCR_SLCDC_OFFSET 21 |
160 | #define CCM_PCCR0_GPT4_OFFSET 21 | 143 | #define CCM_PCCR_SLCDC_REG CCM_PCCR0 |
161 | #define CCM_PCCR0_GPT4_MASK (1 << 21) | 144 | #define CCM_PCCR_FIRI_BAUD_OFFSET 20 |
162 | #define CCM_PCCR0_GPT5_OFFSET 20 | 145 | #define CCM_PCCR_FIRI_BAUD_MASK (1 << CCM_PCCR_FIRI_BAUD_MASK) |
163 | #define CCM_PCCR0_GPT5_MASK (1 << 20) | 146 | #define CCM_PCCR_FIRI_BAUD_REG CCM_PCCR0 |
164 | #define CCM_PCCR0_GPT6_OFFSET 19 | 147 | #define CCM_PCCR_NFC_OFFSET 19 |
165 | #define CCM_PCCR0_GPT6_MASK (1 << 19) | 148 | #define CCM_PCCR_NFC_REG CCM_PCCR0 |
166 | #define CCM_PCCR0_I2C1_OFFSET 18 | 149 | #define CCM_PCCR_LCDC_OFFSET 18 |
167 | #define CCM_PCCR0_I2C1_MASK (1 << 18) | 150 | #define CCM_PCCR_LCDC_REG CCM_PCCR0 |
168 | #define CCM_PCCR0_I2C2_OFFSET 17 | 151 | #define CCM_PCCR_SSI1_BAUD_OFFSET 17 |
169 | #define CCM_PCCR0_I2C2_MASK (1 << 17) | 152 | #define CCM_PCCR_SSI1_BAUD_REG CCM_PCCR0 |
170 | #define CCM_PCCR0_IIM_OFFSET 16 | 153 | #define CCM_PCCR_SSI2_BAUD_OFFSET 16 |
171 | #define CCM_PCCR0_IIM_MASK (1 << 16) | 154 | #define CCM_PCCR_SSI2_BAUD_REG CCM_PCCR0 |
172 | #define CCM_PCCR0_KPP_OFFSET 15 | 155 | #define CCM_PCCR_EMMA_OFFSET 15 |
173 | #define CCM_PCCR0_KPP_MASK (1 << 15) | 156 | #define CCM_PCCR_EMMA_REG CCM_PCCR0 |
174 | #define CCM_PCCR0_LCDC_OFFSET 14 | 157 | #define CCM_PCCR_USBOTG_OFFSET 14 |
175 | #define CCM_PCCR0_LCDC_MASK (1 << 14) | 158 | #define CCM_PCCR_USBOTG_REG CCM_PCCR0 |
176 | #define CCM_PCCR0_MSHC_OFFSET 13 | 159 | #define CCM_PCCR_DMA_OFFSET 13 |
177 | #define CCM_PCCR0_MSHC_MASK (1 << 13) | 160 | #define CCM_PCCR_DMA_REG CCM_PCCR0 |
178 | #define CCM_PCCR0_OWIRE_OFFSET 12 | 161 | #define CCM_PCCR_I2C1_OFFSET 12 |
179 | #define CCM_PCCR0_OWIRE_MASK (1 << 12) | 162 | #define CCM_PCCR_I2C1_REG CCM_PCCR0 |
180 | #define CCM_PCCR0_PWM_OFFSET 11 | 163 | #define CCM_PCCR_GPIO_OFFSET 11 |
181 | #define CCM_PCCR0_PWM_MASK (1 << 11) | 164 | #define CCM_PCCR_GPIO_REG CCM_PCCR0 |
182 | #define CCM_PCCR0_RTC_OFFSET 9 | 165 | #define CCM_PCCR_SDHC2_OFFSET 10 |
183 | #define CCM_PCCR0_RTC_MASK (1 << 9) | 166 | #define CCM_PCCR_SDHC2_REG CCM_PCCR0 |
184 | #define CCM_PCCR0_RTIC_OFFSET 8 | 167 | #define CCM_PCCR_SDHC1_OFFSET 9 |
185 | #define CCM_PCCR0_RTIC_MASK (1 << 8) | 168 | #define CCM_PCCR_SDHC1_REG CCM_PCCR0 |
186 | #define CCM_PCCR0_SAHARA_OFFSET 7 | 169 | #define CCM_PCCR_FIRI_OFFSET 8 |
187 | #define CCM_PCCR0_SAHARA_MASK (1 << 7) | 170 | #define CCM_PCCR_FIRI_MASK (1 << CCM_PCCR_BAUD_MASK) |
188 | #define CCM_PCCR0_SCC_OFFSET 6 | 171 | #define CCM_PCCR_FIRI_REG CCM_PCCR0 |
189 | #define CCM_PCCR0_SCC_MASK (1 << 6) | 172 | #define CCM_PCCR_SSI2_IPG_OFFSET 7 |
190 | #define CCM_PCCR0_SDHC1_OFFSET 5 | 173 | #define CCM_PCCR_SSI2_REG CCM_PCCR0 |
191 | #define CCM_PCCR0_SDHC1_MASK (1 << 5) | 174 | #define CCM_PCCR_SSI1_IPG_OFFSET 6 |
192 | #define CCM_PCCR0_SDHC2_OFFSET 4 | 175 | #define CCM_PCCR_SSI1_REG CCM_PCCR0 |
193 | #define CCM_PCCR0_SDHC2_MASK (1 << 4) | 176 | #define CCM_PCCR_CSPI2_OFFSET 5 |
194 | #define CCM_PCCR0_SDHC3_OFFSET 3 | 177 | #define CCM_PCCR_CSPI2_REG CCM_PCCR0 |
195 | #define CCM_PCCR0_SDHC3_MASK (1 << 3) | 178 | #define CCM_PCCR_CSPI1_OFFSET 4 |
196 | #define CCM_PCCR0_SLCDC_OFFSET 2 | 179 | #define CCM_PCCR_CSPI1_REG CCM_PCCR0 |
197 | #define CCM_PCCR0_SLCDC_MASK (1 << 2) | 180 | #define CCM_PCCR_UART4_OFFSET 3 |
198 | #define CCM_PCCR0_SSI1_IPG_OFFSET 1 | 181 | #define CCM_PCCR_UART4_REG CCM_PCCR0 |
199 | #define CCM_PCCR0_SSI1_IPG_MASK (1 << 1) | 182 | #define CCM_PCCR_UART3_OFFSET 2 |
200 | #define CCM_PCCR0_SSI2_IPG_OFFSET 0 | 183 | #define CCM_PCCR_UART3_REG CCM_PCCR0 |
201 | #define CCM_PCCR0_SSI2_IPG_MASK (1 << 0) | 184 | #define CCM_PCCR_UART2_OFFSET 1 |
185 | #define CCM_PCCR_UART2_REG CCM_PCCR0 | ||
186 | #define CCM_PCCR_UART1_OFFSET 0 | ||
187 | #define CCM_PCCR_UART1_REG CCM_PCCR0 | ||
188 | |||
189 | #define CCM_PCCR_OWIRE_OFFSET 31 | ||
190 | #define CCM_PCCR_OWIRE_REG CCM_PCCR1 | ||
191 | #define CCM_PCCR_KPP_OFFSET 30 | ||
192 | #define CCM_PCCR_KPP_REG CCM_PCCR1 | ||
193 | #define CCM_PCCR_RTC_OFFSET 29 | ||
194 | #define CCM_PCCR_RTC_REG CCM_PCCR1 | ||
195 | #define CCM_PCCR_PWM_OFFSET 28 | ||
196 | #define CCM_PCCR_PWM_REG CCM_PCCR1 | ||
197 | #define CCM_PCCR_GPT3_OFFSET 27 | ||
198 | #define CCM_PCCR_GPT3_REG CCM_PCCR1 | ||
199 | #define CCM_PCCR_GPT2_OFFSET 26 | ||
200 | #define CCM_PCCR_GPT2_REG CCM_PCCR1 | ||
201 | #define CCM_PCCR_GPT1_OFFSET 25 | ||
202 | #define CCM_PCCR_GPT1_REG CCM_PCCR1 | ||
203 | #define CCM_PCCR_WDT_OFFSET 24 | ||
204 | #define CCM_PCCR_WDT_REG CCM_PCCR1 | ||
205 | #define CCM_PCCR_CSPI3_OFFSET 23 | ||
206 | #define CCM_PCCR_CSPI3_REG CCM_PCCR1 | ||
207 | |||
208 | #define CCM_PCCR_CSPI1_MASK (1 << CCM_PCCR_CSPI1_OFFSET) | ||
209 | #define CCM_PCCR_CSPI2_MASK (1 << CCM_PCCR_CSPI2_OFFSET) | ||
210 | #define CCM_PCCR_CSPI3_MASK (1 << CCM_PCCR_CSPI3_OFFSET) | ||
211 | #define CCM_PCCR_DMA_MASK (1 << CCM_PCCR_DMA_OFFSET) | ||
212 | #define CCM_PCCR_EMMA_MASK (1 << CCM_PCCR_EMMA_OFFSET) | ||
213 | #define CCM_PCCR_GPIO_MASK (1 << CCM_PCCR_GPIO_OFFSET) | ||
214 | #define CCM_PCCR_GPT1_MASK (1 << CCM_PCCR_GPT1_OFFSET) | ||
215 | #define CCM_PCCR_GPT2_MASK (1 << CCM_PCCR_GPT2_OFFSET) | ||
216 | #define CCM_PCCR_GPT3_MASK (1 << CCM_PCCR_GPT3_OFFSET) | ||
217 | #define CCM_PCCR_HCLK_BROM_MASK (1 << CCM_PCCR_HCLK_BROM_OFFSET) | ||
218 | #define CCM_PCCR_HCLK_CSI_MASK (1 << CCM_PCCR_HCLK_CSI_OFFSET) | ||
219 | #define CCM_PCCR_HCLK_DMA_MASK (1 << CCM_PCCR_HCLK_DMA_OFFSET) | ||
220 | #define CCM_PCCR_HCLK_EMMA_MASK (1 << CCM_PCCR_HCLK_EMMA_OFFSET) | ||
221 | #define CCM_PCCR_HCLK_LCDC_MASK (1 << CCM_PCCR_HCLK_LCDC_OFFSET) | ||
222 | #define CCM_PCCR_HCLK_SLCDC_MASK (1 << CCM_PCCR_HCLK_SLCDC_OFFSET) | ||
223 | #define CCM_PCCR_HCLK_USBOTG_MASK (1 << CCM_PCCR_HCLK_USBOTG_OFFSET) | ||
224 | #define CCM_PCCR_I2C1_MASK (1 << CCM_PCCR_I2C1_OFFSET) | ||
225 | #define CCM_PCCR_KPP_MASK (1 << CCM_PCCR_KPP_OFFSET) | ||
226 | #define CCM_PCCR_LCDC_MASK (1 << CCM_PCCR_LCDC_OFFSET) | ||
227 | #define CCM_PCCR_NFC_MASK (1 << CCM_PCCR_NFC_OFFSET) | ||
228 | #define CCM_PCCR_OWIRE_MASK (1 << CCM_PCCR_OWIRE_OFFSET) | ||
229 | #define CCM_PCCR_PERCLK4_MASK (1 << CCM_PCCR_PERCLK4_OFFSET) | ||
230 | #define CCM_PCCR_PWM_MASK (1 << CCM_PCCR_PWM_OFFSET) | ||
231 | #define CCM_PCCR_RTC_MASK (1 << CCM_PCCR_RTC_OFFSET) | ||
232 | #define CCM_PCCR_SDHC1_MASK (1 << CCM_PCCR_SDHC1_OFFSET) | ||
233 | #define CCM_PCCR_SDHC2_MASK (1 << CCM_PCCR_SDHC2_OFFSET) | ||
234 | #define CCM_PCCR_SLCDC_MASK (1 << CCM_PCCR_SLCDC_OFFSET) | ||
235 | #define CCM_PCCR_SSI1_BAUD_MASK (1 << CCM_PCCR_SSI1_BAUD_OFFSET) | ||
236 | #define CCM_PCCR_SSI1_IPG_MASK (1 << CCM_PCCR_SSI1_IPG_OFFSET) | ||
237 | #define CCM_PCCR_SSI2_BAUD_MASK (1 << CCM_PCCR_SSI2_BAUD_OFFSET) | ||
238 | #define CCM_PCCR_SSI2_IPG_MASK (1 << CCM_PCCR_SSI2_IPG_OFFSET) | ||
239 | #define CCM_PCCR_UART1_MASK (1 << CCM_PCCR_UART1_OFFSET) | ||
240 | #define CCM_PCCR_UART2_MASK (1 << CCM_PCCR_UART2_OFFSET) | ||
241 | #define CCM_PCCR_UART3_MASK (1 << CCM_PCCR_UART3_OFFSET) | ||
242 | #define CCM_PCCR_UART4_MASK (1 << CCM_PCCR_UART4_OFFSET) | ||
243 | #define CCM_PCCR_USBOTG_MASK (1 << CCM_PCCR_USBOTG_OFFSET) | ||
244 | #define CCM_PCCR_WDT_MASK (1 << CCM_PCCR_WDT_OFFSET) | ||
202 | 245 | ||
203 | #define CCM_PCCR1_UART1_OFFSET 31 | ||
204 | #define CCM_PCCR1_UART1_MASK (1 << 31) | ||
205 | #define CCM_PCCR1_UART2_OFFSET 30 | ||
206 | #define CCM_PCCR1_UART2_MASK (1 << 30) | ||
207 | #define CCM_PCCR1_UART3_OFFSET 29 | ||
208 | #define CCM_PCCR1_UART3_MASK (1 << 29) | ||
209 | #define CCM_PCCR1_UART4_OFFSET 28 | ||
210 | #define CCM_PCCR1_UART4_MASK (1 << 28) | ||
211 | #define CCM_PCCR1_UART5_OFFSET 27 | ||
212 | #define CCM_PCCR1_UART5_MASK (1 << 27) | ||
213 | #define CCM_PCCR1_UART6_OFFSET 26 | ||
214 | #define CCM_PCCR1_UART6_MASK (1 << 26) | ||
215 | #define CCM_PCCR1_USBOTG_OFFSET 25 | ||
216 | #define CCM_PCCR1_USBOTG_MASK (1 << 25) | ||
217 | #define CCM_PCCR1_WDT_OFFSET 24 | ||
218 | #define CCM_PCCR1_WDT_MASK (1 << 24) | ||
219 | #define CCM_PCCR1_HCLK_ATA_OFFSET 23 | ||
220 | #define CCM_PCCR1_HCLK_ATA_MASK (1 << 23) | ||
221 | #define CCM_PCCR1_HCLK_BROM_OFFSET 22 | ||
222 | #define CCM_PCCR1_HCLK_BROM_MASK (1 << 22) | ||
223 | #define CCM_PCCR1_HCLK_CSI_OFFSET 21 | ||
224 | #define CCM_PCCR1_HCLK_CSI_MASK (1 << 21) | ||
225 | #define CCM_PCCR1_HCLK_DMA_OFFSET 20 | ||
226 | #define CCM_PCCR1_HCLK_DMA_MASK (1 << 20) | ||
227 | #define CCM_PCCR1_HCLK_EMI_OFFSET 19 | ||
228 | #define CCM_PCCR1_HCLK_EMI_MASK (1 << 19) | ||
229 | #define CCM_PCCR1_HCLK_EMMA_OFFSET 18 | ||
230 | #define CCM_PCCR1_HCLK_EMMA_MASK (1 << 18) | ||
231 | #define CCM_PCCR1_HCLK_FEC_OFFSET 17 | ||
232 | #define CCM_PCCR1_HCLK_FEC_MASK (1 << 17) | ||
233 | #define CCM_PCCR1_HCLK_VPU_OFFSET 16 | ||
234 | #define CCM_PCCR1_HCLK_VPU_MASK (1 << 16) | ||
235 | #define CCM_PCCR1_HCLK_LCDC_OFFSET 15 | ||
236 | #define CCM_PCCR1_HCLK_LCDC_MASK (1 << 15) | ||
237 | #define CCM_PCCR1_HCLK_RTIC_OFFSET 14 | ||
238 | #define CCM_PCCR1_HCLK_RTIC_MASK (1 << 14) | ||
239 | #define CCM_PCCR1_HCLK_SAHARA_OFFSET 13 | ||
240 | #define CCM_PCCR1_HCLK_SAHARA_MASK (1 << 13) | ||
241 | #define CCM_PCCR1_HCLK_SLCDC_OFFSET 12 | ||
242 | #define CCM_PCCR1_HCLK_SLCDC_MASK (1 << 12) | ||
243 | #define CCM_PCCR1_HCLK_USBOTG_OFFSET 11 | ||
244 | #define CCM_PCCR1_HCLK_USBOTG_MASK (1 << 11) | ||
245 | #define CCM_PCCR1_PERCLK1_OFFSET 10 | ||
246 | #define CCM_PCCR1_PERCLK1_MASK (1 << 10) | ||
247 | #define CCM_PCCR1_PERCLK2_OFFSET 9 | ||
248 | #define CCM_PCCR1_PERCLK2_MASK (1 << 9) | ||
249 | #define CCM_PCCR1_PERCLK3_OFFSET 8 | ||
250 | #define CCM_PCCR1_PERCLK3_MASK (1 << 8) | ||
251 | #define CCM_PCCR1_PERCLK4_OFFSET 7 | ||
252 | #define CCM_PCCR1_PERCLK4_MASK (1 << 7) | ||
253 | #define CCM_PCCR1_VPU_BAUD_OFFSET 6 | ||
254 | #define CCM_PCCR1_VPU_BAUD_MASK (1 << 6) | ||
255 | #define CCM_PCCR1_SSI1_BAUD_OFFSET 5 | ||
256 | #define CCM_PCCR1_SSI1_BAUD_MASK (1 << 5) | ||
257 | #define CCM_PCCR1_SSI2_BAUD_OFFSET 4 | ||
258 | #define CCM_PCCR1_SSI2_BAUD_MASK (1 << 4) | ||
259 | #define CCM_PCCR1_NFC_BAUD_OFFSET 3 | ||
260 | #define CCM_PCCR1_NFC_BAUD_MASK (1 << 3) | ||
261 | #define CCM_PCCR1_MSHC_BAUD_OFFSET 2 | ||
262 | #define CCM_PCCR1_MSHC_BAUD_MASK (1 << 2) | ||
263 | 246 | ||
264 | #define CCM_CCSR_32KSR (1 << 15) | 247 | #define CCM_CCSR_32KSR (1 << 15) |
248 | |||
265 | #define CCM_CCSR_CLKMODE1 (1 << 9) | 249 | #define CCM_CCSR_CLKMODE1 (1 << 9) |
266 | #define CCM_CCSR_CLKMODE0 (1 << 8) | 250 | #define CCM_CCSR_CLKMODE0 (1 << 8) |
251 | |||
267 | #define CCM_CCSR_CLKOSEL_OFFSET 0 | 252 | #define CCM_CCSR_CLKOSEL_OFFSET 0 |
268 | #define CCM_CCSR_CLKOSEL_MASK 0x1f | 253 | #define CCM_CCSR_CLKOSEL_MASK 0x1f |
269 | 254 | ||
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c index 2f9240be1c76..f81aa8a8fbb4 100644 --- a/arch/arm/mach-mx2/devices.c +++ b/arch/arm/mach-mx2/devices.c | |||
@@ -34,6 +34,10 @@ | |||
34 | 34 | ||
35 | #include <mach/irqs.h> | 35 | #include <mach/irqs.h> |
36 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
37 | #include <mach/common.h> | ||
38 | #include <mach/mmc.h> | ||
39 | |||
40 | #include "devices.h" | ||
37 | 41 | ||
38 | /* | 42 | /* |
39 | * Resource definition for the MXC IrDA | 43 | * Resource definition for the MXC IrDA |
@@ -225,37 +229,217 @@ struct platform_device mxc_nand_device = { | |||
225 | .resource = mxc_nand_resources, | 229 | .resource = mxc_nand_resources, |
226 | }; | 230 | }; |
227 | 231 | ||
232 | #ifdef CONFIG_FB_IMX | ||
233 | /* | ||
234 | * lcdc: | ||
235 | * - i.MX1: the basic controller | ||
236 | * - i.MX21: to be checked | ||
237 | * - i.MX27: like i.MX1, with slightly variations | ||
238 | */ | ||
239 | static struct resource mxc_fb[] = { | ||
240 | { | ||
241 | .start = LCDC_BASE_ADDR, | ||
242 | .end = LCDC_BASE_ADDR + 0xFFF, | ||
243 | .flags = IORESOURCE_MEM, | ||
244 | }, | ||
245 | { | ||
246 | .start = MXC_INT_LCDC, | ||
247 | .end = MXC_INT_LCDC, | ||
248 | .flags = IORESOURCE_IRQ, | ||
249 | } | ||
250 | }; | ||
251 | |||
252 | /* mxc lcd driver */ | ||
253 | struct platform_device mxc_fb_device = { | ||
254 | .name = "imx-fb", | ||
255 | .id = 0, | ||
256 | .num_resources = ARRAY_SIZE(mxc_fb), | ||
257 | .resource = mxc_fb, | ||
258 | .dev = { | ||
259 | .coherent_dma_mask = 0xFFFFFFFF, | ||
260 | }, | ||
261 | }; | ||
262 | #endif | ||
263 | |||
264 | #ifdef CONFIG_MACH_MX27 | ||
265 | static struct resource mxc_fec_resources[] = { | ||
266 | { | ||
267 | .start = FEC_BASE_ADDR, | ||
268 | .end = FEC_BASE_ADDR + 0xfff, | ||
269 | .flags = IORESOURCE_MEM | ||
270 | }, { | ||
271 | .start = MXC_INT_FEC, | ||
272 | .end = MXC_INT_FEC, | ||
273 | .flags = IORESOURCE_IRQ | ||
274 | }, | ||
275 | }; | ||
276 | |||
277 | struct platform_device mxc_fec_device = { | ||
278 | .name = "fec", | ||
279 | .id = 0, | ||
280 | .num_resources = ARRAY_SIZE(mxc_fec_resources), | ||
281 | .resource = mxc_fec_resources, | ||
282 | }; | ||
283 | #endif | ||
284 | |||
285 | static struct resource mxc_i2c_1_resources[] = { | ||
286 | [0] = { | ||
287 | .start = I2C_BASE_ADDR, | ||
288 | .end = I2C_BASE_ADDR + 0x0fff, | ||
289 | .flags = IORESOURCE_MEM | ||
290 | }, | ||
291 | [1] = { | ||
292 | .start = MXC_INT_I2C, | ||
293 | .end = MXC_INT_I2C, | ||
294 | .flags = IORESOURCE_IRQ | ||
295 | } | ||
296 | }; | ||
297 | |||
298 | struct platform_device mxc_i2c_device0 = { | ||
299 | .name = "imx-i2c", | ||
300 | .id = 0, | ||
301 | .num_resources = ARRAY_SIZE(mxc_i2c_1_resources), | ||
302 | .resource = mxc_i2c_1_resources | ||
303 | }; | ||
304 | |||
305 | #ifdef CONFIG_MACH_MX27 | ||
306 | static struct resource mxc_i2c_2_resources[] = { | ||
307 | [0] = { | ||
308 | .start = I2C2_BASE_ADDR, | ||
309 | .end = I2C2_BASE_ADDR + 0x0fff, | ||
310 | .flags = IORESOURCE_MEM | ||
311 | }, | ||
312 | [1] = { | ||
313 | .start = MXC_INT_I2C2, | ||
314 | .end = MXC_INT_I2C2, | ||
315 | .flags = IORESOURCE_IRQ | ||
316 | } | ||
317 | }; | ||
318 | |||
319 | struct platform_device mxc_i2c_device1 = { | ||
320 | .name = "imx-i2c", | ||
321 | .id = 1, | ||
322 | .num_resources = ARRAY_SIZE(mxc_i2c_2_resources), | ||
323 | .resource = mxc_i2c_2_resources | ||
324 | }; | ||
325 | #endif | ||
326 | |||
327 | static struct resource mxc_pwm_resources[] = { | ||
328 | [0] = { | ||
329 | .start = PWM_BASE_ADDR, | ||
330 | .end = PWM_BASE_ADDR + 0x0fff, | ||
331 | .flags = IORESOURCE_MEM | ||
332 | }, | ||
333 | [1] = { | ||
334 | .start = MXC_INT_PWM, | ||
335 | .end = MXC_INT_PWM, | ||
336 | .flags = IORESOURCE_IRQ, | ||
337 | } | ||
338 | }; | ||
339 | |||
340 | struct platform_device mxc_pwm_device = { | ||
341 | .name = "mxc_pwm", | ||
342 | .id = 0, | ||
343 | .num_resources = ARRAY_SIZE(mxc_pwm_resources), | ||
344 | .resource = mxc_pwm_resources | ||
345 | }; | ||
346 | |||
347 | /* | ||
348 | * Resource definition for the MXC SDHC | ||
349 | */ | ||
350 | static struct resource mxc_sdhc1_resources[] = { | ||
351 | [0] = { | ||
352 | .start = SDHC1_BASE_ADDR, | ||
353 | .end = SDHC1_BASE_ADDR + SZ_4K - 1, | ||
354 | .flags = IORESOURCE_MEM, | ||
355 | }, | ||
356 | [1] = { | ||
357 | .start = MXC_INT_SDHC1, | ||
358 | .end = MXC_INT_SDHC1, | ||
359 | .flags = IORESOURCE_IRQ, | ||
360 | }, | ||
361 | [2] = { | ||
362 | .start = DMA_REQ_SDHC1, | ||
363 | .end = DMA_REQ_SDHC1, | ||
364 | .flags = IORESOURCE_DMA | ||
365 | }, | ||
366 | }; | ||
367 | |||
368 | static u64 mxc_sdhc1_dmamask = 0xffffffffUL; | ||
369 | |||
370 | struct platform_device mxc_sdhc_device0 = { | ||
371 | .name = "mxc-mmc", | ||
372 | .id = 0, | ||
373 | .dev = { | ||
374 | .dma_mask = &mxc_sdhc1_dmamask, | ||
375 | .coherent_dma_mask = 0xffffffff, | ||
376 | }, | ||
377 | .num_resources = ARRAY_SIZE(mxc_sdhc1_resources), | ||
378 | .resource = mxc_sdhc1_resources, | ||
379 | }; | ||
380 | |||
381 | static struct resource mxc_sdhc2_resources[] = { | ||
382 | [0] = { | ||
383 | .start = SDHC2_BASE_ADDR, | ||
384 | .end = SDHC2_BASE_ADDR + SZ_4K - 1, | ||
385 | .flags = IORESOURCE_MEM, | ||
386 | }, | ||
387 | [1] = { | ||
388 | .start = MXC_INT_SDHC2, | ||
389 | .end = MXC_INT_SDHC2, | ||
390 | .flags = IORESOURCE_IRQ, | ||
391 | }, | ||
392 | [2] = { | ||
393 | .start = DMA_REQ_SDHC2, | ||
394 | .end = DMA_REQ_SDHC2, | ||
395 | .flags = IORESOURCE_DMA | ||
396 | }, | ||
397 | }; | ||
398 | |||
399 | static u64 mxc_sdhc2_dmamask = 0xffffffffUL; | ||
400 | |||
401 | struct platform_device mxc_sdhc_device1 = { | ||
402 | .name = "mxc-mmc", | ||
403 | .id = 1, | ||
404 | .dev = { | ||
405 | .dma_mask = &mxc_sdhc2_dmamask, | ||
406 | .coherent_dma_mask = 0xffffffff, | ||
407 | }, | ||
408 | .num_resources = ARRAY_SIZE(mxc_sdhc2_resources), | ||
409 | .resource = mxc_sdhc2_resources, | ||
410 | }; | ||
411 | |||
228 | /* GPIO port description */ | 412 | /* GPIO port description */ |
229 | static struct mxc_gpio_port imx_gpio_ports[] = { | 413 | static struct mxc_gpio_port imx_gpio_ports[] = { |
230 | [0] = { | 414 | [0] = { |
231 | .chip.label = "gpio-0", | 415 | .chip.label = "gpio-0", |
232 | .irq = MXC_INT_GPIO, | 416 | .irq = MXC_INT_GPIO, |
233 | .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 0), | 417 | .base = IO_ADDRESS(GPIO_BASE_ADDR), |
234 | .virtual_irq_start = MXC_GPIO_IRQ_START, | 418 | .virtual_irq_start = MXC_GPIO_IRQ_START, |
235 | }, | 419 | }, |
236 | [1] = { | 420 | [1] = { |
237 | .chip.label = "gpio-1", | 421 | .chip.label = "gpio-1", |
238 | .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 1), | 422 | .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x100), |
239 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32, | 423 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32, |
240 | }, | 424 | }, |
241 | [2] = { | 425 | [2] = { |
242 | .chip.label = "gpio-2", | 426 | .chip.label = "gpio-2", |
243 | .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 2), | 427 | .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x200), |
244 | .virtual_irq_start = MXC_GPIO_IRQ_START + 64, | 428 | .virtual_irq_start = MXC_GPIO_IRQ_START + 64, |
245 | }, | 429 | }, |
246 | [3] = { | 430 | [3] = { |
247 | .chip.label = "gpio-3", | 431 | .chip.label = "gpio-3", |
248 | .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 3), | 432 | .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x300), |
249 | .virtual_irq_start = MXC_GPIO_IRQ_START + 96, | 433 | .virtual_irq_start = MXC_GPIO_IRQ_START + 96, |
250 | }, | 434 | }, |
251 | [4] = { | 435 | [4] = { |
252 | .chip.label = "gpio-4", | 436 | .chip.label = "gpio-4", |
253 | .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 4), | 437 | .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x400), |
254 | .virtual_irq_start = MXC_GPIO_IRQ_START + 128, | 438 | .virtual_irq_start = MXC_GPIO_IRQ_START + 128, |
255 | }, | 439 | }, |
256 | [5] = { | 440 | [5] = { |
257 | .chip.label = "gpio-5", | 441 | .chip.label = "gpio-5", |
258 | .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 5), | 442 | .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x500), |
259 | .virtual_irq_start = MXC_GPIO_IRQ_START + 160, | 443 | .virtual_irq_start = MXC_GPIO_IRQ_START + 160, |
260 | } | 444 | } |
261 | }; | 445 | }; |
diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h index 1e8cb577a642..049005bb6aa9 100644 --- a/arch/arm/mach-mx2/devices.h +++ b/arch/arm/mach-mx2/devices.h | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | extern struct platform_device mxc_gpt1; | 1 | extern struct platform_device mxc_gpt1; |
3 | extern struct platform_device mxc_gpt2; | 2 | extern struct platform_device mxc_gpt2; |
4 | extern struct platform_device mxc_gpt3; | 3 | extern struct platform_device mxc_gpt3; |
@@ -14,3 +13,10 @@ extern struct platform_device mxc_uart_device4; | |||
14 | extern struct platform_device mxc_uart_device5; | 13 | extern struct platform_device mxc_uart_device5; |
15 | extern struct platform_device mxc_w1_master_device; | 14 | extern struct platform_device mxc_w1_master_device; |
16 | extern struct platform_device mxc_nand_device; | 15 | extern struct platform_device mxc_nand_device; |
16 | extern struct platform_device mxc_fb_device; | ||
17 | extern struct platform_device mxc_fec_device; | ||
18 | extern struct platform_device mxc_pwm_device; | ||
19 | extern struct platform_device mxc_i2c_device0; | ||
20 | extern struct platform_device mxc_i2c_device1; | ||
21 | extern struct platform_device mxc_sdhc_device0; | ||
22 | extern struct platform_device mxc_sdhc_device1; | ||
diff --git a/arch/arm/mach-mx2/generic.c b/arch/arm/mach-mx2/generic.c index dea6521d4d5c..bd51dd04948e 100644 --- a/arch/arm/mach-mx2/generic.c +++ b/arch/arm/mach-mx2/generic.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
24 | #include <mach/common.h> | ||
24 | #include <asm/pgtable.h> | 25 | #include <asm/pgtable.h> |
25 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
26 | 27 | ||
diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c index 2b5c67f54571..4a3b097adc12 100644 --- a/arch/arm/mach-mx2/mx27ads.c +++ b/arch/arm/mach-mx2/mx27ads.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <asm/mach/map.h> | 31 | #include <asm/mach/map.h> |
32 | #include <mach/gpio.h> | 32 | #include <mach/gpio.h> |
33 | #include <mach/imx-uart.h> | 33 | #include <mach/imx-uart.h> |
34 | #include <mach/iomux-mx1-mx2.h> | 34 | #include <mach/iomux.h> |
35 | #include <mach/board-mx27ads.h> | 35 | #include <mach/board-mx27ads.h> |
36 | 36 | ||
37 | #include "devices.h" | 37 | #include "devices.h" |
@@ -135,6 +135,7 @@ static int uart_mxc_port3_exit(struct platform_device *pdev) | |||
135 | { | 135 | { |
136 | mxc_gpio_release_multiple_pins(mxc_uart3_pins, | 136 | mxc_gpio_release_multiple_pins(mxc_uart3_pins, |
137 | ARRAY_SIZE(mxc_uart3_pins)); | 137 | ARRAY_SIZE(mxc_uart3_pins)); |
138 | return 0; | ||
138 | } | 139 | } |
139 | 140 | ||
140 | static int mxc_uart4_pins[] = { | 141 | static int mxc_uart4_pins[] = { |
@@ -179,6 +180,7 @@ static int uart_mxc_port5_exit(struct platform_device *pdev) | |||
179 | 180 | ||
180 | static struct platform_device *platform_devices[] __initdata = { | 181 | static struct platform_device *platform_devices[] __initdata = { |
181 | &mx27ads_nor_mtd_device, | 182 | &mx27ads_nor_mtd_device, |
183 | &mxc_fec_device, | ||
182 | }; | 184 | }; |
183 | 185 | ||
184 | static int mxc_fec_pins[] = { | 186 | static int mxc_fec_pins[] = { |
@@ -196,7 +198,7 @@ static int mxc_fec_pins[] = { | |||
196 | PD11_AOUT_FEC_TX_CLK, | 198 | PD11_AOUT_FEC_TX_CLK, |
197 | PD12_AOUT_FEC_RXD0, | 199 | PD12_AOUT_FEC_RXD0, |
198 | PD13_AOUT_FEC_RX_DV, | 200 | PD13_AOUT_FEC_RX_DV, |
199 | PD14_AOUT_FEC_CLR, | 201 | PD14_AOUT_FEC_RX_CLK, |
200 | PD15_AOUT_FEC_COL, | 202 | PD15_AOUT_FEC_COL, |
201 | PD16_AIN_FEC_TX_ER, | 203 | PD16_AIN_FEC_TX_ER, |
202 | PF23_AIN_FEC_TX_EN | 204 | PF23_AIN_FEC_TX_EN |
@@ -208,12 +210,6 @@ static void gpio_fec_active(void) | |||
208 | ARRAY_SIZE(mxc_fec_pins), "FEC"); | 210 | ARRAY_SIZE(mxc_fec_pins), "FEC"); |
209 | } | 211 | } |
210 | 212 | ||
211 | static void gpio_fec_inactive(void) | ||
212 | { | ||
213 | mxc_gpio_release_multiple_pins(mxc_fec_pins, | ||
214 | ARRAY_SIZE(mxc_fec_pins)); | ||
215 | } | ||
216 | |||
217 | static struct imxuart_platform_data uart_pdata[] = { | 213 | static struct imxuart_platform_data uart_pdata[] = { |
218 | { | 214 | { |
219 | .init = uart_mxc_port0_init, | 215 | .init = uart_mxc_port0_init, |
@@ -263,11 +259,10 @@ static void __init mx27ads_timer_init(void) | |||
263 | if ((__raw_readw(PBC_VERSION_REG) & CKIH_27MHZ_BIT_SET) == 0) | 259 | if ((__raw_readw(PBC_VERSION_REG) & CKIH_27MHZ_BIT_SET) == 0) |
264 | fref = 27000000; | 260 | fref = 27000000; |
265 | 261 | ||
266 | mxc_clocks_init(fref); | 262 | mx27_clocks_init(fref); |
267 | mxc_timer_init("gpt_clk.0"); | ||
268 | } | 263 | } |
269 | 264 | ||
270 | struct sys_timer mx27ads_timer = { | 265 | static struct sys_timer mx27ads_timer = { |
271 | .init = mx27ads_timer_init, | 266 | .init = mx27ads_timer_init, |
272 | }; | 267 | }; |
273 | 268 | ||
@@ -280,7 +275,7 @@ static struct map_desc mx27ads_io_desc[] __initdata = { | |||
280 | }, | 275 | }, |
281 | }; | 276 | }; |
282 | 277 | ||
283 | void __init mx27ads_map_io(void) | 278 | static void __init mx27ads_map_io(void) |
284 | { | 279 | { |
285 | mxc_map_io(); | 280 | mxc_map_io(); |
286 | iotable_init(mx27ads_io_desc, ARRAY_SIZE(mx27ads_io_desc)); | 281 | iotable_init(mx27ads_io_desc, ARRAY_SIZE(mx27ads_io_desc)); |
diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c index dfd4156da7d5..aa4eaa61d1b5 100644 --- a/arch/arm/mach-mx2/pcm038.c +++ b/arch/arm/mach-mx2/pcm038.c | |||
@@ -20,11 +20,18 @@ | |||
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/mtd/physmap.h> | 21 | #include <linux/mtd/physmap.h> |
22 | #include <linux/mtd/plat-ram.h> | 22 | #include <linux/mtd/plat-ram.h> |
23 | #include <linux/io.h> | ||
24 | #include <linux/i2c.h> | ||
25 | #include <linux/i2c/at24.h> | ||
26 | |||
23 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
24 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
25 | #include <mach/common.h> | 29 | #include <mach/common.h> |
26 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
27 | #include <mach/iomux-mx1-mx2.h> | 31 | #include <mach/iomux.h> |
32 | #ifdef CONFIG_I2C_IMX | ||
33 | #include <mach/i2c.h> | ||
34 | #endif | ||
28 | #include <asm/mach/time.h> | 35 | #include <asm/mach/time.h> |
29 | #include <mach/imx-uart.h> | 36 | #include <mach/imx-uart.h> |
30 | #include <mach/board-pcm038.h> | 37 | #include <mach/board-pcm038.h> |
@@ -121,10 +128,10 @@ static int uart_mxc_port1_exit(struct platform_device *pdev) | |||
121 | return 0; | 128 | return 0; |
122 | } | 129 | } |
123 | 130 | ||
124 | static int mxc_uart2_pins[] = { PE10_PF_UART3_CTS, | 131 | static int mxc_uart2_pins[] = { PE8_PF_UART3_TXD, |
125 | PE9_PF_UART3_RXD, | 132 | PE9_PF_UART3_RXD, |
126 | PE10_PF_UART3_CTS, | 133 | PE10_PF_UART3_CTS, |
127 | PE9_PF_UART3_RXD }; | 134 | PE11_PF_UART3_RTS }; |
128 | 135 | ||
129 | static int uart_mxc_port2_init(struct platform_device *pdev) | 136 | static int uart_mxc_port2_init(struct platform_device *pdev) |
130 | { | 137 | { |
@@ -170,7 +177,7 @@ static int mxc_fec_pins[] = { | |||
170 | PD11_AOUT_FEC_TX_CLK, | 177 | PD11_AOUT_FEC_TX_CLK, |
171 | PD12_AOUT_FEC_RXD0, | 178 | PD12_AOUT_FEC_RXD0, |
172 | PD13_AOUT_FEC_RX_DV, | 179 | PD13_AOUT_FEC_RX_DV, |
173 | PD14_AOUT_FEC_CLR, | 180 | PD14_AOUT_FEC_RX_CLK, |
174 | PD15_AOUT_FEC_COL, | 181 | PD15_AOUT_FEC_COL, |
175 | PD16_AIN_FEC_TX_ER, | 182 | PD16_AIN_FEC_TX_ER, |
176 | PF23_AIN_FEC_TX_EN | 183 | PF23_AIN_FEC_TX_EN |
@@ -182,12 +189,6 @@ static void gpio_fec_active(void) | |||
182 | ARRAY_SIZE(mxc_fec_pins), "FEC"); | 189 | ARRAY_SIZE(mxc_fec_pins), "FEC"); |
183 | } | 190 | } |
184 | 191 | ||
185 | static void gpio_fec_inactive(void) | ||
186 | { | ||
187 | mxc_gpio_release_multiple_pins(mxc_fec_pins, | ||
188 | ARRAY_SIZE(mxc_fec_pins)); | ||
189 | } | ||
190 | |||
191 | static struct mxc_nand_platform_data pcm038_nand_board_info = { | 192 | static struct mxc_nand_platform_data pcm038_nand_board_info = { |
192 | .width = 1, | 193 | .width = 1, |
193 | .hw_ecc = 1, | 194 | .hw_ecc = 1, |
@@ -196,6 +197,7 @@ static struct mxc_nand_platform_data pcm038_nand_board_info = { | |||
196 | static struct platform_device *platform_devices[] __initdata = { | 197 | static struct platform_device *platform_devices[] __initdata = { |
197 | &pcm038_nor_mtd_device, | 198 | &pcm038_nor_mtd_device, |
198 | &mxc_w1_master_device, | 199 | &mxc_w1_master_device, |
200 | &mxc_fec_device, | ||
199 | &pcm038_sram_mtd_device, | 201 | &pcm038_sram_mtd_device, |
200 | }; | 202 | }; |
201 | 203 | ||
@@ -208,6 +210,51 @@ static void __init pcm038_init_sram(void) | |||
208 | __raw_writel(0x22220a00, CSCR_A(1)); | 210 | __raw_writel(0x22220a00, CSCR_A(1)); |
209 | } | 211 | } |
210 | 212 | ||
213 | #ifdef CONFIG_I2C_IMX | ||
214 | static int mxc_i2c1_pins[] = { | ||
215 | PC5_PF_I2C2_SDA, | ||
216 | PC6_PF_I2C2_SCL | ||
217 | }; | ||
218 | |||
219 | static int pcm038_i2c_1_init(struct device *dev) | ||
220 | { | ||
221 | return mxc_gpio_setup_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins), | ||
222 | "I2C1"); | ||
223 | } | ||
224 | |||
225 | static void pcm038_i2c_1_exit(struct device *dev) | ||
226 | { | ||
227 | mxc_gpio_release_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins)); | ||
228 | } | ||
229 | |||
230 | static struct imxi2c_platform_data pcm038_i2c_1_data = { | ||
231 | .bitrate = 100000, | ||
232 | .init = pcm038_i2c_1_init, | ||
233 | .exit = pcm038_i2c_1_exit, | ||
234 | }; | ||
235 | |||
236 | static struct at24_platform_data board_eeprom = { | ||
237 | .byte_len = 4096, | ||
238 | .page_size = 32, | ||
239 | .flags = AT24_FLAG_ADDR16, | ||
240 | }; | ||
241 | |||
242 | static struct i2c_board_info pcm038_i2c_devices[] = { | ||
243 | [0] = { | ||
244 | I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ | ||
245 | .platform_data = &board_eeprom, | ||
246 | }, | ||
247 | [1] = { | ||
248 | I2C_BOARD_INFO("rtc-pcf8563", 0x51), | ||
249 | .type = "pcf8563" | ||
250 | }, | ||
251 | [2] = { | ||
252 | I2C_BOARD_INFO("lm75", 0x4a), | ||
253 | .type = "lm75" | ||
254 | } | ||
255 | }; | ||
256 | #endif | ||
257 | |||
211 | static void __init pcm038_init(void) | 258 | static void __init pcm038_init(void) |
212 | { | 259 | { |
213 | gpio_fec_active(); | 260 | gpio_fec_active(); |
@@ -217,9 +264,17 @@ static void __init pcm038_init(void) | |||
217 | mxc_register_device(&mxc_uart_device1, &uart_pdata[1]); | 264 | mxc_register_device(&mxc_uart_device1, &uart_pdata[1]); |
218 | mxc_register_device(&mxc_uart_device2, &uart_pdata[2]); | 265 | mxc_register_device(&mxc_uart_device2, &uart_pdata[2]); |
219 | 266 | ||
220 | mxc_gpio_mode(PE16_AF_RTCK); /* OWIRE */ | 267 | mxc_gpio_mode(PE16_AF_OWIRE); |
221 | mxc_register_device(&mxc_nand_device, &pcm038_nand_board_info); | 268 | mxc_register_device(&mxc_nand_device, &pcm038_nand_board_info); |
222 | 269 | ||
270 | #ifdef CONFIG_I2C_IMX | ||
271 | /* only the i2c master 1 is used on this CPU card */ | ||
272 | i2c_register_board_info(1, pcm038_i2c_devices, | ||
273 | ARRAY_SIZE(pcm038_i2c_devices)); | ||
274 | |||
275 | mxc_register_device(&mxc_i2c_device1, &pcm038_i2c_1_data); | ||
276 | #endif | ||
277 | |||
223 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 278 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
224 | 279 | ||
225 | #ifdef CONFIG_MACH_PCM970_BASEBOARD | 280 | #ifdef CONFIG_MACH_PCM970_BASEBOARD |
@@ -229,11 +284,10 @@ static void __init pcm038_init(void) | |||
229 | 284 | ||
230 | static void __init pcm038_timer_init(void) | 285 | static void __init pcm038_timer_init(void) |
231 | { | 286 | { |
232 | mxc_clocks_init(26000000); | 287 | mx27_clocks_init(26000000); |
233 | mxc_timer_init("gpt_clk.0"); | ||
234 | } | 288 | } |
235 | 289 | ||
236 | struct sys_timer pcm038_timer = { | 290 | static struct sys_timer pcm038_timer = { |
237 | .init = pcm038_timer_init, | 291 | .init = pcm038_timer_init, |
238 | }; | 292 | }; |
239 | 293 | ||
diff --git a/arch/arm/mach-mx2/pcm970-baseboard.c b/arch/arm/mach-mx2/pcm970-baseboard.c index a560cd6ad23d..bf4e520bc1bc 100644 --- a/arch/arm/mach-mx2/pcm970-baseboard.c +++ b/arch/arm/mach-mx2/pcm970-baseboard.c | |||
@@ -17,9 +17,138 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <mach/hardware.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/irq.h> | ||
22 | |||
21 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
22 | 24 | ||
25 | #include <mach/hardware.h> | ||
26 | #include <mach/common.h> | ||
27 | #include <mach/mmc.h> | ||
28 | #include <mach/imxfb.h> | ||
29 | #include <mach/iomux.h> | ||
30 | |||
31 | #include "devices.h" | ||
32 | |||
33 | static int pcm970_sdhc2_get_ro(struct device *dev) | ||
34 | { | ||
35 | return gpio_get_value(GPIO_PORTC + 28); | ||
36 | } | ||
37 | |||
38 | static int pcm970_sdhc2_pins[] = { | ||
39 | PB4_PF_SD2_D0, | ||
40 | PB5_PF_SD2_D1, | ||
41 | PB6_PF_SD2_D2, | ||
42 | PB7_PF_SD2_D3, | ||
43 | PB8_PF_SD2_CMD, | ||
44 | PB9_PF_SD2_CLK, | ||
45 | }; | ||
46 | |||
47 | static int pcm970_sdhc2_init(struct device *dev, irq_handler_t detect_irq, void *data) | ||
48 | { | ||
49 | int ret; | ||
50 | |||
51 | ret = mxc_gpio_setup_multiple_pins(pcm970_sdhc2_pins, | ||
52 | ARRAY_SIZE(pcm970_sdhc2_pins), "sdhc2"); | ||
53 | if(ret) | ||
54 | return ret; | ||
55 | |||
56 | ret = request_irq(IRQ_GPIOC(29), detect_irq, 0, | ||
57 | "imx-mmc-detect", data); | ||
58 | if (ret) | ||
59 | goto out_release_gpio; | ||
60 | |||
61 | set_irq_type(IRQ_GPIOC(29), IRQF_TRIGGER_FALLING); | ||
62 | |||
63 | ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro"); | ||
64 | if (ret) | ||
65 | goto out_release_gpio; | ||
66 | |||
67 | mxc_gpio_mode((GPIO_PORTC | 28) | GPIO_GPIO | GPIO_IN); | ||
68 | gpio_direction_input(GPIO_PORTC + 28); | ||
69 | |||
70 | return 0; | ||
71 | |||
72 | out_release_gpio: | ||
73 | mxc_gpio_release_multiple_pins(pcm970_sdhc2_pins, | ||
74 | ARRAY_SIZE(pcm970_sdhc2_pins)); | ||
75 | return ret; | ||
76 | } | ||
77 | |||
78 | static void pcm970_sdhc2_exit(struct device *dev, void *data) | ||
79 | { | ||
80 | free_irq(IRQ_GPIOC(29), data); | ||
81 | gpio_free(GPIO_PORTC + 28); | ||
82 | mxc_gpio_release_multiple_pins(pcm970_sdhc2_pins, | ||
83 | ARRAY_SIZE(pcm970_sdhc2_pins)); | ||
84 | } | ||
85 | |||
86 | static struct imxmmc_platform_data sdhc_pdata = { | ||
87 | .get_ro = pcm970_sdhc2_get_ro, | ||
88 | .init = pcm970_sdhc2_init, | ||
89 | .exit = pcm970_sdhc2_exit, | ||
90 | }; | ||
91 | |||
92 | static int mxc_fb_pins[] = { | ||
93 | PA5_PF_LSCLK, PA6_PF_LD0, PA7_PF_LD1, PA8_PF_LD2, | ||
94 | PA9_PF_LD3, PA10_PF_LD4, PA11_PF_LD5, PA12_PF_LD6, | ||
95 | PA13_PF_LD7, PA14_PF_LD8, PA15_PF_LD9, PA16_PF_LD10, | ||
96 | PA17_PF_LD11, PA18_PF_LD12, PA19_PF_LD13, PA20_PF_LD14, | ||
97 | PA21_PF_LD15, PA22_PF_LD16, PA23_PF_LD17, PA24_PF_REV, | ||
98 | PA25_PF_CLS, PA26_PF_PS, PA27_PF_SPL_SPR, PA28_PF_HSYNC, | ||
99 | PA29_PF_VSYNC, PA30_PF_CONTRAST, PA31_PF_OE_ACD | ||
100 | }; | ||
101 | |||
102 | static int pcm038_fb_init(struct platform_device *pdev) | ||
103 | { | ||
104 | return mxc_gpio_setup_multiple_pins(mxc_fb_pins, | ||
105 | ARRAY_SIZE(mxc_fb_pins), "FB"); | ||
106 | } | ||
107 | |||
108 | static int pcm038_fb_exit(struct platform_device *pdev) | ||
109 | { | ||
110 | mxc_gpio_release_multiple_pins(mxc_fb_pins, ARRAY_SIZE(mxc_fb_pins)); | ||
111 | |||
112 | return 0; | ||
113 | } | ||
114 | |||
115 | /* | ||
116 | * Connected is a portrait Sharp-QVGA display | ||
117 | * of type: LQ035Q7DH06 | ||
118 | */ | ||
119 | static struct imx_fb_platform_data pcm038_fb_data = { | ||
120 | .pixclock = 188679, /* in ps (5.3MHz) */ | ||
121 | .xres = 240, | ||
122 | .yres = 320, | ||
123 | |||
124 | .bpp = 16, | ||
125 | .hsync_len = 7, | ||
126 | .left_margin = 5, | ||
127 | .right_margin = 16, | ||
128 | |||
129 | .vsync_len = 1, | ||
130 | .upper_margin = 7, | ||
131 | .lower_margin = 9, | ||
132 | .fixed_screen_cpu = 0, | ||
133 | |||
134 | /* | ||
135 | * - HSYNC active high | ||
136 | * - VSYNC active high | ||
137 | * - clk notenabled while idle | ||
138 | * - clock not inverted | ||
139 | * - data not inverted | ||
140 | * - data enable low active | ||
141 | * - enable sharp mode | ||
142 | */ | ||
143 | .pcr = 0xFA0080C0, | ||
144 | .pwmr = 0x00A903FF, | ||
145 | .lscr1 = 0x00120300, | ||
146 | .dmacr = 0x00020010, | ||
147 | |||
148 | .init = pcm038_fb_init, | ||
149 | .exit = pcm038_fb_exit, | ||
150 | }; | ||
151 | |||
23 | /* | 152 | /* |
24 | * system init for baseboard usage. Will be called by pcm038 init. | 153 | * system init for baseboard usage. Will be called by pcm038 init. |
25 | * | 154 | * |
@@ -28,4 +157,6 @@ | |||
28 | */ | 157 | */ |
29 | void __init pcm970_baseboard_init(void) | 158 | void __init pcm970_baseboard_init(void) |
30 | { | 159 | { |
160 | mxc_register_device(&mxc_fb_device, &pcm038_fb_data); | ||
161 | mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata); | ||
31 | } | 162 | } |
diff --git a/arch/arm/mach-mx2/serial.c b/arch/arm/mach-mx2/serial.c index 16debc296dad..40a485cdc10e 100644 --- a/arch/arm/mach-mx2/serial.c +++ b/arch/arm/mach-mx2/serial.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/serial.h> | 22 | #include <linux/serial.h> |
23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
24 | #include <mach/imx-uart.h> | 24 | #include <mach/imx-uart.h> |
25 | #include "devices.h" | ||
25 | 26 | ||
26 | static struct resource uart0[] = { | 27 | static struct resource uart0[] = { |
27 | { | 28 | { |
@@ -99,6 +100,7 @@ struct platform_device mxc_uart_device3 = { | |||
99 | .num_resources = ARRAY_SIZE(uart3), | 100 | .num_resources = ARRAY_SIZE(uart3), |
100 | }; | 101 | }; |
101 | 102 | ||
103 | #ifdef CONFIG_MACH_MX27 | ||
102 | static struct resource uart4[] = { | 104 | static struct resource uart4[] = { |
103 | { | 105 | { |
104 | .start = UART5_BASE_ADDR, | 106 | .start = UART5_BASE_ADDR, |
@@ -136,3 +138,4 @@ struct platform_device mxc_uart_device5 = { | |||
136 | .resource = uart5, | 138 | .resource = uart5, |
137 | .num_resources = ARRAY_SIZE(uart5), | 139 | .num_resources = ARRAY_SIZE(uart5), |
138 | }; | 140 | }; |
141 | #endif | ||
diff --git a/arch/arm/mach-mx2/system.c b/arch/arm/mach-mx2/system.c index 7b8269719d11..92c79d4bd162 100644 --- a/arch/arm/mach-mx2/system.c +++ b/arch/arm/mach-mx2/system.c | |||
@@ -46,7 +46,7 @@ void arch_idle(void) | |||
46 | /* | 46 | /* |
47 | * Reset the system. It is called by machine_restart(). | 47 | * Reset the system. It is called by machine_restart(). |
48 | */ | 48 | */ |
49 | void arch_reset(char mode) | 49 | void arch_reset(char mode, const char *cmd) |
50 | { | 50 | { |
51 | struct clk *clk; | 51 | struct clk *clk; |
52 | 52 | ||
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig index e79659e8176e..d6235583e979 100644 --- a/arch/arm/mach-mx3/Kconfig +++ b/arch/arm/mach-mx3/Kconfig | |||
@@ -1,21 +1,40 @@ | |||
1 | menu "MX3 Options" | 1 | if ARCH_MX3 |
2 | depends on ARCH_MX3 | 2 | |
3 | config ARCH_MX31 | ||
4 | bool | ||
5 | |||
6 | config ARCH_MX35 | ||
7 | bool | ||
8 | |||
9 | comment "MX3 platforms:" | ||
3 | 10 | ||
4 | config MACH_MX31ADS | 11 | config MACH_MX31ADS |
5 | bool "Support MX31ADS platforms" | 12 | bool "Support MX31ADS platforms" |
13 | select ARCH_MX31 | ||
6 | default y | 14 | default y |
7 | help | 15 | help |
8 | Include support for MX31ADS platform. This includes specific | 16 | Include support for MX31ADS platform. This includes specific |
9 | configurations for the board and its peripherals. | 17 | configurations for the board and its peripherals. |
10 | 18 | ||
19 | config MACH_MX31ADS_WM1133_EV1 | ||
20 | bool "Support Wolfson Microelectronics 1133-EV1 module" | ||
21 | depends on MACH_MX31ADS | ||
22 | select MFD_WM8350_CONFIG_MODE_0 | ||
23 | select MFD_WM8352_CONFIG_MODE_0 | ||
24 | help | ||
25 | Include support for the Wolfson Microelectronics 1133-EV1 PMU | ||
26 | and audio module for the MX31ADS platform. | ||
27 | |||
11 | config MACH_PCM037 | 28 | config MACH_PCM037 |
12 | bool "Support Phytec pcm037 platforms" | 29 | bool "Support Phytec pcm037 (i.MX31) platforms" |
30 | select ARCH_MX31 | ||
13 | help | 31 | help |
14 | Include support for Phytec pcm037 platform. This includes | 32 | Include support for Phytec pcm037 platform. This includes |
15 | specific configurations for the board and its peripherals. | 33 | specific configurations for the board and its peripherals. |
16 | 34 | ||
17 | config MACH_MX31LITE | 35 | config MACH_MX31LITE |
18 | bool "Support MX31 LITEKIT (LogicPD)" | 36 | bool "Support MX31 LITEKIT (LogicPD)" |
37 | select ARCH_MX31 | ||
19 | default n | 38 | default n |
20 | help | 39 | help |
21 | Include support for MX31 LITEKIT platform. This includes specific | 40 | Include support for MX31 LITEKIT platform. This includes specific |
@@ -23,6 +42,7 @@ config MACH_MX31LITE | |||
23 | 42 | ||
24 | config MACH_MX31_3DS | 43 | config MACH_MX31_3DS |
25 | bool "Support MX31PDK (3DS)" | 44 | bool "Support MX31PDK (3DS)" |
45 | select ARCH_MX31 | ||
26 | default n | 46 | default n |
27 | help | 47 | help |
28 | Include support for MX31PDK (3DS) platform. This includes specific | 48 | Include support for MX31PDK (3DS) platform. This includes specific |
@@ -30,10 +50,18 @@ config MACH_MX31_3DS | |||
30 | 50 | ||
31 | config MACH_MX31MOBOARD | 51 | config MACH_MX31MOBOARD |
32 | bool "Support mx31moboard platforms (EPFL Mobots group)" | 52 | bool "Support mx31moboard platforms (EPFL Mobots group)" |
53 | select ARCH_MX31 | ||
33 | default n | 54 | default n |
34 | help | 55 | help |
35 | Include support for mx31moboard platform. This includes specific | 56 | Include support for mx31moboard platform. This includes specific |
36 | configurations for the board and its peripherals. | 57 | configurations for the board and its peripherals. |
37 | 58 | ||
38 | endmenu | 59 | config MACH_QONG |
60 | bool "Support Dave/DENX QongEVB-LITE platform" | ||
61 | select ARCH_MX31 | ||
62 | default n | ||
63 | help | ||
64 | Include support for Dave/DENX QongEVB-LITE platform. This includes | ||
65 | specific configurations for the board and its peripherals. | ||
39 | 66 | ||
67 | endif | ||
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile index 5a151540fe83..272c8a953b30 100644 --- a/arch/arm/mach-mx3/Makefile +++ b/arch/arm/mach-mx3/Makefile | |||
@@ -4,9 +4,13 @@ | |||
4 | 4 | ||
5 | # Object file lists. | 5 | # Object file lists. |
6 | 6 | ||
7 | obj-y := mm.o clock.o devices.o iomux.o | 7 | obj-y := mm.o devices.o |
8 | obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o | ||
9 | obj-$(CONFIG_ARCH_MX35) += clock-imx35.o | ||
8 | obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o | 10 | obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o |
9 | obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o | 11 | obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o |
10 | obj-$(CONFIG_MACH_PCM037) += pcm037.o | 12 | obj-$(CONFIG_MACH_PCM037) += pcm037.o |
11 | obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o | 13 | obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o |
12 | obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o | 14 | obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \ |
15 | mx31moboard-marxbot.o | ||
16 | obj-$(CONFIG_MACH_QONG) += qong.o | ||
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c new file mode 100644 index 000000000000..53a112d4e04a --- /dev/null +++ b/arch/arm/mach-mx3/clock-imx35.c | |||
@@ -0,0 +1,487 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 by Sascha Hauer, Pengutronix | ||
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; either version 2 | ||
7 | * of the License, or (at your option) any later version. | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
16 | * MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/list.h> | ||
22 | #include <linux/clk.h> | ||
23 | #include <linux/io.h> | ||
24 | |||
25 | #include <asm/clkdev.h> | ||
26 | |||
27 | #include <mach/clock.h> | ||
28 | #include <mach/hardware.h> | ||
29 | #include <mach/common.h> | ||
30 | |||
31 | #define CCM_BASE IO_ADDRESS(CCM_BASE_ADDR) | ||
32 | |||
33 | #define CCM_CCMR 0x00 | ||
34 | #define CCM_PDR0 0x04 | ||
35 | #define CCM_PDR1 0x08 | ||
36 | #define CCM_PDR2 0x0C | ||
37 | #define CCM_PDR3 0x10 | ||
38 | #define CCM_PDR4 0x14 | ||
39 | #define CCM_RCSR 0x18 | ||
40 | #define CCM_MPCTL 0x1C | ||
41 | #define CCM_PPCTL 0x20 | ||
42 | #define CCM_ACMR 0x24 | ||
43 | #define CCM_COSR 0x28 | ||
44 | #define CCM_CGR0 0x2C | ||
45 | #define CCM_CGR1 0x30 | ||
46 | #define CCM_CGR2 0x34 | ||
47 | #define CCM_CGR3 0x38 | ||
48 | |||
49 | #ifdef HAVE_SET_RATE_SUPPORT | ||
50 | static void calc_dividers(u32 div, u32 *pre, u32 *post, u32 maxpost) | ||
51 | { | ||
52 | u32 min_pre, temp_pre, old_err, err; | ||
53 | |||
54 | min_pre = (div - 1) / maxpost + 1; | ||
55 | old_err = 8; | ||
56 | |||
57 | for (temp_pre = 8; temp_pre >= min_pre; temp_pre--) { | ||
58 | if (div > (temp_pre * maxpost)) | ||
59 | break; | ||
60 | |||
61 | if (div < (temp_pre * temp_pre)) | ||
62 | continue; | ||
63 | |||
64 | err = div % temp_pre; | ||
65 | |||
66 | if (err == 0) { | ||
67 | *pre = temp_pre; | ||
68 | break; | ||
69 | } | ||
70 | |||
71 | err = temp_pre - err; | ||
72 | |||
73 | if (err < old_err) { | ||
74 | old_err = err; | ||
75 | *pre = temp_pre; | ||
76 | } | ||
77 | } | ||
78 | |||
79 | *post = (div + *pre - 1) / *pre; | ||
80 | } | ||
81 | |||
82 | /* get the best values for a 3-bit divider combined with a 6-bit divider */ | ||
83 | static void calc_dividers_3_6(u32 div, u32 *pre, u32 *post) | ||
84 | { | ||
85 | if (div >= 512) { | ||
86 | *pre = 8; | ||
87 | *post = 64; | ||
88 | } else if (div >= 64) { | ||
89 | calc_dividers(div, pre, post, 64); | ||
90 | } else if (div <= 8) { | ||
91 | *pre = div; | ||
92 | *post = 1; | ||
93 | } else { | ||
94 | *pre = 1; | ||
95 | *post = div; | ||
96 | } | ||
97 | } | ||
98 | |||
99 | /* get the best values for two cascaded 3-bit dividers */ | ||
100 | static void calc_dividers_3_3(u32 div, u32 *pre, u32 *post) | ||
101 | { | ||
102 | if (div >= 64) { | ||
103 | *pre = *post = 8; | ||
104 | } else if (div > 8) { | ||
105 | calc_dividers(div, pre, post, 8); | ||
106 | } else { | ||
107 | *pre = 1; | ||
108 | *post = div; | ||
109 | } | ||
110 | } | ||
111 | #endif | ||
112 | |||
113 | static unsigned long get_rate_mpll(void) | ||
114 | { | ||
115 | ulong mpctl = __raw_readl(CCM_BASE + CCM_MPCTL); | ||
116 | |||
117 | return mxc_decode_pll(mpctl, 24000000); | ||
118 | } | ||
119 | |||
120 | static unsigned long get_rate_ppll(void) | ||
121 | { | ||
122 | ulong ppctl = __raw_readl(CCM_BASE + CCM_PPCTL); | ||
123 | |||
124 | return mxc_decode_pll(ppctl, 24000000); | ||
125 | } | ||
126 | |||
127 | struct arm_ahb_div { | ||
128 | unsigned char arm, ahb, sel; | ||
129 | }; | ||
130 | |||
131 | static struct arm_ahb_div clk_consumer[] = { | ||
132 | { .arm = 1, .ahb = 4, .sel = 0}, | ||
133 | { .arm = 1, .ahb = 3, .sel = 1}, | ||
134 | { .arm = 2, .ahb = 2, .sel = 0}, | ||
135 | { .arm = 0, .ahb = 0, .sel = 0}, | ||
136 | { .arm = 0, .ahb = 0, .sel = 0}, | ||
137 | { .arm = 0, .ahb = 0, .sel = 0}, | ||
138 | { .arm = 4, .ahb = 1, .sel = 0}, | ||
139 | { .arm = 1, .ahb = 5, .sel = 0}, | ||
140 | { .arm = 1, .ahb = 8, .sel = 0}, | ||
141 | { .arm = 1, .ahb = 6, .sel = 1}, | ||
142 | { .arm = 2, .ahb = 4, .sel = 0}, | ||
143 | { .arm = 0, .ahb = 0, .sel = 0}, | ||
144 | { .arm = 0, .ahb = 0, .sel = 0}, | ||
145 | { .arm = 0, .ahb = 0, .sel = 0}, | ||
146 | { .arm = 4, .ahb = 2, .sel = 0}, | ||
147 | { .arm = 0, .ahb = 0, .sel = 0}, | ||
148 | }; | ||
149 | |||
150 | static struct arm_ahb_div clk_automotive[] = { | ||
151 | { .arm = 1, .ahb = 3, .sel = 0}, | ||
152 | { .arm = 1, .ahb = 2, .sel = 1}, | ||
153 | { .arm = 2, .ahb = 1, .sel = 1}, | ||
154 | { .arm = 0, .ahb = 0, .sel = 0}, | ||
155 | { .arm = 1, .ahb = 6, .sel = 0}, | ||
156 | { .arm = 1, .ahb = 4, .sel = 1}, | ||
157 | { .arm = 2, .ahb = 2, .sel = 1}, | ||
158 | { .arm = 0, .ahb = 0, .sel = 0}, | ||
159 | }; | ||
160 | |||
161 | static unsigned long get_rate_arm(void) | ||
162 | { | ||
163 | unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); | ||
164 | struct arm_ahb_div *aad; | ||
165 | unsigned long fref = get_rate_mpll(); | ||
166 | |||
167 | if (pdr0 & 1) { | ||
168 | /* consumer path */ | ||
169 | aad = &clk_consumer[(pdr0 >> 16) & 0xf]; | ||
170 | if (aad->sel) | ||
171 | fref = fref * 2 / 3; | ||
172 | } else { | ||
173 | /* auto path */ | ||
174 | aad = &clk_automotive[(pdr0 >> 9) & 0x7]; | ||
175 | if (aad->sel) | ||
176 | fref = fref * 3 / 4; | ||
177 | } | ||
178 | return fref / aad->arm; | ||
179 | } | ||
180 | |||
181 | static unsigned long get_rate_ahb(struct clk *clk) | ||
182 | { | ||
183 | unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); | ||
184 | struct arm_ahb_div *aad; | ||
185 | unsigned long fref = get_rate_mpll(); | ||
186 | |||
187 | if (pdr0 & 1) | ||
188 | /* consumer path */ | ||
189 | aad = &clk_consumer[(pdr0 >> 16) & 0xf]; | ||
190 | else | ||
191 | /* auto path */ | ||
192 | aad = &clk_automotive[(pdr0 >> 9) & 0x7]; | ||
193 | |||
194 | return fref / aad->ahb; | ||
195 | } | ||
196 | |||
197 | static unsigned long get_rate_ipg(struct clk *clk) | ||
198 | { | ||
199 | return get_rate_ahb(NULL) >> 1; | ||
200 | } | ||
201 | |||
202 | static unsigned long get_3_3_div(unsigned long in) | ||
203 | { | ||
204 | return (((in >> 3) & 0x7) + 1) * ((in & 0x7) + 1); | ||
205 | } | ||
206 | |||
207 | static unsigned long get_rate_uart(struct clk *clk) | ||
208 | { | ||
209 | unsigned long pdr3 = __raw_readl(CCM_BASE + CCM_PDR3); | ||
210 | unsigned long pdr4 = __raw_readl(CCM_BASE + CCM_PDR4); | ||
211 | unsigned long div = get_3_3_div(pdr4 >> 10); | ||
212 | |||
213 | if (pdr3 & (1 << 14)) | ||
214 | return get_rate_arm() / div; | ||
215 | else | ||
216 | return get_rate_ppll() / div; | ||
217 | } | ||
218 | |||
219 | static unsigned long get_rate_sdhc(struct clk *clk) | ||
220 | { | ||
221 | unsigned long pdr3 = __raw_readl(CCM_BASE + CCM_PDR3); | ||
222 | unsigned long div, rate; | ||
223 | |||
224 | if (pdr3 & (1 << 6)) | ||
225 | rate = get_rate_arm(); | ||
226 | else | ||
227 | rate = get_rate_ppll(); | ||
228 | |||
229 | switch (clk->id) { | ||
230 | default: | ||
231 | case 0: | ||
232 | div = pdr3 & 0x3f; | ||
233 | break; | ||
234 | case 1: | ||
235 | div = (pdr3 >> 8) & 0x3f; | ||
236 | break; | ||
237 | case 2: | ||
238 | div = (pdr3 >> 16) & 0x3f; | ||
239 | break; | ||
240 | } | ||
241 | |||
242 | return rate / get_3_3_div(div); | ||
243 | } | ||
244 | |||
245 | static unsigned long get_rate_mshc(struct clk *clk) | ||
246 | { | ||
247 | unsigned long pdr1 = __raw_readl(CCM_BASE + CCM_PDR1); | ||
248 | unsigned long div1, div2, rate; | ||
249 | |||
250 | if (pdr1 & (1 << 7)) | ||
251 | rate = get_rate_arm(); | ||
252 | else | ||
253 | rate = get_rate_ppll(); | ||
254 | |||
255 | div1 = (pdr1 >> 29) & 0x7; | ||
256 | div2 = (pdr1 >> 22) & 0x3f; | ||
257 | |||
258 | return rate / ((div1 + 1) * (div2 + 1)); | ||
259 | } | ||
260 | |||
261 | static unsigned long get_rate_ssi(struct clk *clk) | ||
262 | { | ||
263 | unsigned long pdr2 = __raw_readl(CCM_BASE + CCM_PDR2); | ||
264 | unsigned long div1, div2, rate; | ||
265 | |||
266 | if (pdr2 & (1 << 6)) | ||
267 | rate = get_rate_arm(); | ||
268 | else | ||
269 | rate = get_rate_ppll(); | ||
270 | |||
271 | switch (clk->id) { | ||
272 | default: | ||
273 | case 0: | ||
274 | div1 = pdr2 & 0x3f; | ||
275 | div2 = (pdr2 >> 24) & 0x7; | ||
276 | break; | ||
277 | case 1: | ||
278 | div1 = (pdr2 >> 8) & 0x3f; | ||
279 | div2 = (pdr2 >> 27) & 0x7; | ||
280 | break; | ||
281 | } | ||
282 | |||
283 | return rate / ((div1 + 1) * (div2 + 1)); | ||
284 | } | ||
285 | |||
286 | static unsigned long get_rate_csi(struct clk *clk) | ||
287 | { | ||
288 | unsigned long pdr2 = __raw_readl(CCM_BASE + CCM_PDR2); | ||
289 | unsigned long rate; | ||
290 | |||
291 | if (pdr2 & (1 << 7)) | ||
292 | rate = get_rate_arm(); | ||
293 | else | ||
294 | rate = get_rate_ppll(); | ||
295 | |||
296 | return rate / get_3_3_div((pdr2 >> 16) & 0x3f); | ||
297 | } | ||
298 | |||
299 | static unsigned long get_rate_ipg_per(struct clk *clk) | ||
300 | { | ||
301 | unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); | ||
302 | unsigned long pdr4 = __raw_readl(CCM_BASE + CCM_PDR4); | ||
303 | unsigned long div1, div2; | ||
304 | |||
305 | if (pdr0 & (1 << 26)) { | ||
306 | div1 = (pdr4 >> 19) & 0x7; | ||
307 | div2 = (pdr4 >> 16) & 0x7; | ||
308 | return get_rate_arm() / ((div1 + 1) * (div2 + 1)); | ||
309 | } else { | ||
310 | div1 = (pdr0 >> 12) & 0x7; | ||
311 | return get_rate_ahb(NULL) / div1; | ||
312 | } | ||
313 | } | ||
314 | |||
315 | static int clk_cgr_enable(struct clk *clk) | ||
316 | { | ||
317 | u32 reg; | ||
318 | |||
319 | reg = __raw_readl(clk->enable_reg); | ||
320 | reg |= 3 << clk->enable_shift; | ||
321 | __raw_writel(reg, clk->enable_reg); | ||
322 | |||
323 | return 0; | ||
324 | } | ||
325 | |||
326 | static void clk_cgr_disable(struct clk *clk) | ||
327 | { | ||
328 | u32 reg; | ||
329 | |||
330 | reg = __raw_readl(clk->enable_reg); | ||
331 | reg &= ~(3 << clk->enable_shift); | ||
332 | __raw_writel(reg, clk->enable_reg); | ||
333 | } | ||
334 | |||
335 | #define DEFINE_CLOCK(name, i, er, es, gr, sr) \ | ||
336 | static struct clk name = { \ | ||
337 | .id = i, \ | ||
338 | .enable_reg = CCM_BASE + er, \ | ||
339 | .enable_shift = es, \ | ||
340 | .get_rate = gr, \ | ||
341 | .set_rate = sr, \ | ||
342 | .enable = clk_cgr_enable, \ | ||
343 | .disable = clk_cgr_disable, \ | ||
344 | } | ||
345 | |||
346 | DEFINE_CLOCK(asrc_clk, 0, CCM_CGR0, 0, NULL, NULL); | ||
347 | DEFINE_CLOCK(ata_clk, 0, CCM_CGR0, 2, get_rate_ipg, NULL); | ||
348 | DEFINE_CLOCK(audmux_clk, 0, CCM_CGR0, 4, NULL, NULL); | ||
349 | DEFINE_CLOCK(can1_clk, 0, CCM_CGR0, 6, get_rate_ipg, NULL); | ||
350 | DEFINE_CLOCK(can2_clk, 1, CCM_CGR0, 8, get_rate_ipg, NULL); | ||
351 | DEFINE_CLOCK(cspi1_clk, 0, CCM_CGR0, 10, get_rate_ipg, NULL); | ||
352 | DEFINE_CLOCK(cspi2_clk, 1, CCM_CGR0, 12, get_rate_ipg, NULL); | ||
353 | DEFINE_CLOCK(ect_clk, 0, CCM_CGR0, 14, get_rate_ipg, NULL); | ||
354 | DEFINE_CLOCK(edio_clk, 0, CCM_CGR0, 16, NULL, NULL); | ||
355 | DEFINE_CLOCK(emi_clk, 0, CCM_CGR0, 18, get_rate_ipg, NULL); | ||
356 | DEFINE_CLOCK(epit1_clk, 0, CCM_CGR0, 20, get_rate_ipg_per, NULL); | ||
357 | DEFINE_CLOCK(epit2_clk, 1, CCM_CGR0, 22, get_rate_ipg_per, NULL); | ||
358 | DEFINE_CLOCK(esai_clk, 0, CCM_CGR0, 24, NULL, NULL); | ||
359 | DEFINE_CLOCK(esdhc1_clk, 0, CCM_CGR0, 26, get_rate_sdhc, NULL); | ||
360 | DEFINE_CLOCK(esdhc2_clk, 1, CCM_CGR0, 28, get_rate_sdhc, NULL); | ||
361 | DEFINE_CLOCK(esdhc3_clk, 2, CCM_CGR0, 30, get_rate_sdhc, NULL); | ||
362 | |||
363 | DEFINE_CLOCK(fec_clk, 0, CCM_CGR1, 0, get_rate_ipg, NULL); | ||
364 | DEFINE_CLOCK(gpio1_clk, 0, CCM_CGR1, 2, NULL, NULL); | ||
365 | DEFINE_CLOCK(gpio2_clk, 1, CCM_CGR1, 4, NULL, NULL); | ||
366 | DEFINE_CLOCK(gpio3_clk, 2, CCM_CGR1, 6, NULL, NULL); | ||
367 | DEFINE_CLOCK(gpt_clk, 0, CCM_CGR1, 8, get_rate_ipg, NULL); | ||
368 | DEFINE_CLOCK(i2c1_clk, 0, CCM_CGR1, 10, get_rate_ipg_per, NULL); | ||
369 | DEFINE_CLOCK(i2c2_clk, 1, CCM_CGR1, 12, get_rate_ipg_per, NULL); | ||
370 | DEFINE_CLOCK(i2c3_clk, 2, CCM_CGR1, 14, get_rate_ipg_per, NULL); | ||
371 | DEFINE_CLOCK(iomuxc_clk, 0, CCM_CGR1, 16, NULL, NULL); | ||
372 | DEFINE_CLOCK(ipu_clk, 0, CCM_CGR1, 18, NULL, NULL); | ||
373 | DEFINE_CLOCK(kpp_clk, 0, CCM_CGR1, 20, get_rate_ipg, NULL); | ||
374 | DEFINE_CLOCK(mlb_clk, 0, CCM_CGR1, 22, get_rate_ahb, NULL); | ||
375 | DEFINE_CLOCK(mshc_clk, 0, CCM_CGR1, 24, get_rate_mshc, NULL); | ||
376 | DEFINE_CLOCK(owire_clk, 0, CCM_CGR1, 26, get_rate_ipg_per, NULL); | ||
377 | DEFINE_CLOCK(pwm_clk, 0, CCM_CGR1, 28, get_rate_ipg_per, NULL); | ||
378 | DEFINE_CLOCK(rngc_clk, 0, CCM_CGR1, 30, get_rate_ipg, NULL); | ||
379 | |||
380 | DEFINE_CLOCK(rtc_clk, 0, CCM_CGR2, 0, get_rate_ipg, NULL); | ||
381 | DEFINE_CLOCK(rtic_clk, 0, CCM_CGR2, 2, get_rate_ahb, NULL); | ||
382 | DEFINE_CLOCK(scc_clk, 0, CCM_CGR2, 4, get_rate_ipg, NULL); | ||
383 | DEFINE_CLOCK(sdma_clk, 0, CCM_CGR2, 6, NULL, NULL); | ||
384 | DEFINE_CLOCK(spba_clk, 0, CCM_CGR2, 8, get_rate_ipg, NULL); | ||
385 | DEFINE_CLOCK(spdif_clk, 0, CCM_CGR2, 10, NULL, NULL); | ||
386 | DEFINE_CLOCK(ssi1_clk, 0, CCM_CGR2, 12, get_rate_ssi, NULL); | ||
387 | DEFINE_CLOCK(ssi2_clk, 1, CCM_CGR2, 14, get_rate_ssi, NULL); | ||
388 | DEFINE_CLOCK(uart1_clk, 0, CCM_CGR2, 16, get_rate_uart, NULL); | ||
389 | DEFINE_CLOCK(uart2_clk, 1, CCM_CGR2, 18, get_rate_uart, NULL); | ||
390 | DEFINE_CLOCK(uart3_clk, 2, CCM_CGR2, 20, get_rate_uart, NULL); | ||
391 | DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, NULL, NULL); | ||
392 | DEFINE_CLOCK(wdog_clk, 0, CCM_CGR2, 24, NULL, NULL); | ||
393 | DEFINE_CLOCK(max_clk, 0, CCM_CGR2, 26, NULL, NULL); | ||
394 | DEFINE_CLOCK(admux_clk, 0, CCM_CGR2, 30, NULL, NULL); | ||
395 | |||
396 | DEFINE_CLOCK(csi_clk, 0, CCM_CGR3, 0, get_rate_csi, NULL); | ||
397 | DEFINE_CLOCK(iim_clk, 0, CCM_CGR3, 2, NULL, NULL); | ||
398 | DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4, NULL, NULL); | ||
399 | |||
400 | #define _REGISTER_CLOCK(d, n, c) \ | ||
401 | { \ | ||
402 | .dev_id = d, \ | ||
403 | .con_id = n, \ | ||
404 | .clk = &c, \ | ||
405 | }, | ||
406 | |||
407 | static struct clk_lookup lookups[] __initdata = { | ||
408 | _REGISTER_CLOCK(NULL, "asrc", asrc_clk) | ||
409 | _REGISTER_CLOCK(NULL, "ata", ata_clk) | ||
410 | _REGISTER_CLOCK(NULL, "audmux", audmux_clk) | ||
411 | _REGISTER_CLOCK(NULL, "can", can1_clk) | ||
412 | _REGISTER_CLOCK(NULL, "can", can2_clk) | ||
413 | _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk) | ||
414 | _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk) | ||
415 | _REGISTER_CLOCK(NULL, "ect", ect_clk) | ||
416 | _REGISTER_CLOCK(NULL, "edio", edio_clk) | ||
417 | _REGISTER_CLOCK(NULL, "emi", emi_clk) | ||
418 | _REGISTER_CLOCK(NULL, "epit", epit1_clk) | ||
419 | _REGISTER_CLOCK(NULL, "epit", epit2_clk) | ||
420 | _REGISTER_CLOCK(NULL, "esai", esai_clk) | ||
421 | _REGISTER_CLOCK(NULL, "sdhc", esdhc1_clk) | ||
422 | _REGISTER_CLOCK(NULL, "sdhc", esdhc2_clk) | ||
423 | _REGISTER_CLOCK(NULL, "sdhc", esdhc3_clk) | ||
424 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | ||
425 | _REGISTER_CLOCK(NULL, "gpio", gpio1_clk) | ||
426 | _REGISTER_CLOCK(NULL, "gpio", gpio2_clk) | ||
427 | _REGISTER_CLOCK(NULL, "gpio", gpio3_clk) | ||
428 | _REGISTER_CLOCK("gpt.0", NULL, gpt_clk) | ||
429 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) | ||
430 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) | ||
431 | _REGISTER_CLOCK("imx-i2c.2", NULL, i2c3_clk) | ||
432 | _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk) | ||
433 | _REGISTER_CLOCK(NULL, "ipu", ipu_clk) | ||
434 | _REGISTER_CLOCK(NULL, "kpp", kpp_clk) | ||
435 | _REGISTER_CLOCK(NULL, "mlb", mlb_clk) | ||
436 | _REGISTER_CLOCK(NULL, "mshc", mshc_clk) | ||
437 | _REGISTER_CLOCK("mxc_w1", NULL, owire_clk) | ||
438 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) | ||
439 | _REGISTER_CLOCK(NULL, "rngc", rngc_clk) | ||
440 | _REGISTER_CLOCK(NULL, "rtc", rtc_clk) | ||
441 | _REGISTER_CLOCK(NULL, "rtic", rtic_clk) | ||
442 | _REGISTER_CLOCK(NULL, "scc", scc_clk) | ||
443 | _REGISTER_CLOCK(NULL, "sdma", sdma_clk) | ||
444 | _REGISTER_CLOCK(NULL, "spba", spba_clk) | ||
445 | _REGISTER_CLOCK(NULL, "spdif", spdif_clk) | ||
446 | _REGISTER_CLOCK(NULL, "ssi", ssi1_clk) | ||
447 | _REGISTER_CLOCK(NULL, "ssi", ssi2_clk) | ||
448 | _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) | ||
449 | _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) | ||
450 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) | ||
451 | _REGISTER_CLOCK(NULL, "usbotg", usbotg_clk) | ||
452 | _REGISTER_CLOCK("mxc_wdt.0", NULL, wdog_clk) | ||
453 | _REGISTER_CLOCK(NULL, "max", max_clk) | ||
454 | _REGISTER_CLOCK(NULL, "admux", admux_clk) | ||
455 | _REGISTER_CLOCK(NULL, "csi", csi_clk) | ||
456 | _REGISTER_CLOCK(NULL, "iim", iim_clk) | ||
457 | _REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk) | ||
458 | }; | ||
459 | |||
460 | int __init mx35_clocks_init() | ||
461 | { | ||
462 | int i; | ||
463 | unsigned int ll = 0; | ||
464 | |||
465 | mxc_set_cpu_type(MXC_CPU_MX35); | ||
466 | |||
467 | #ifdef CONFIG_DEBUG_LL_CONSOLE | ||
468 | ll = (3 << 16); | ||
469 | #endif | ||
470 | |||
471 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | ||
472 | clkdev_add(&lookups[i]); | ||
473 | |||
474 | /* Turn off all clocks except the ones we need to survive, namely: | ||
475 | * EMI, GPIO1/2/3, GPT, IOMUX, MAX and eventually uart | ||
476 | */ | ||
477 | __raw_writel((3 << 18), CCM_BASE + CCM_CGR0); | ||
478 | __raw_writel((3 << 2) | (3 << 4) | (3 << 6) | (3 << 8) | (3 << 16), | ||
479 | CCM_BASE + CCM_CGR1); | ||
480 | __raw_writel((3 << 26) | ll, CCM_BASE + CCM_CGR2); | ||
481 | __raw_writel(0, CCM_BASE + CCM_CGR3); | ||
482 | |||
483 | mxc_timer_init(&gpt_clk); | ||
484 | |||
485 | return 0; | ||
486 | } | ||
487 | |||
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c index b1746aae1f89..ca46f4801c3d 100644 --- a/arch/arm/mach-mx3/clock.c +++ b/arch/arm/mach-mx3/clock.c | |||
@@ -23,9 +23,13 @@ | |||
23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
24 | #include <linux/err.h> | 24 | #include <linux/err.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | |||
27 | #include <asm/clkdev.h> | ||
28 | #include <asm/div64.h> | ||
29 | |||
26 | #include <mach/clock.h> | 30 | #include <mach/clock.h> |
27 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
28 | #include <asm/div64.h> | 32 | #include <mach/common.h> |
29 | 33 | ||
30 | #include "crm_regs.h" | 34 | #include "crm_regs.h" |
31 | 35 | ||
@@ -64,17 +68,17 @@ static void __calc_pre_post_dividers(u32 div, u32 *pre, u32 *post) | |||
64 | } | 68 | } |
65 | 69 | ||
66 | static struct clk mcu_pll_clk; | 70 | static struct clk mcu_pll_clk; |
67 | static struct clk mcu_main_clk; | ||
68 | static struct clk usb_pll_clk; | ||
69 | static struct clk serial_pll_clk; | 71 | static struct clk serial_pll_clk; |
70 | static struct clk ipg_clk; | 72 | static struct clk ipg_clk; |
71 | static struct clk ckih_clk; | 73 | static struct clk ckih_clk; |
72 | static struct clk ahb_clk; | ||
73 | 74 | ||
74 | static int _clk_enable(struct clk *clk) | 75 | static int cgr_enable(struct clk *clk) |
75 | { | 76 | { |
76 | u32 reg; | 77 | u32 reg; |
77 | 78 | ||
79 | if (!clk->enable_reg) | ||
80 | return 0; | ||
81 | |||
78 | reg = __raw_readl(clk->enable_reg); | 82 | reg = __raw_readl(clk->enable_reg); |
79 | reg |= 3 << clk->enable_shift; | 83 | reg |= 3 << clk->enable_shift; |
80 | __raw_writel(reg, clk->enable_reg); | 84 | __raw_writel(reg, clk->enable_reg); |
@@ -82,133 +86,69 @@ static int _clk_enable(struct clk *clk) | |||
82 | return 0; | 86 | return 0; |
83 | } | 87 | } |
84 | 88 | ||
85 | static void _clk_disable(struct clk *clk) | 89 | static void cgr_disable(struct clk *clk) |
86 | { | 90 | { |
87 | u32 reg; | 91 | u32 reg; |
88 | 92 | ||
93 | if (!clk->enable_reg) | ||
94 | return; | ||
95 | |||
89 | reg = __raw_readl(clk->enable_reg); | 96 | reg = __raw_readl(clk->enable_reg); |
90 | reg &= ~(3 << clk->enable_shift); | 97 | reg &= ~(3 << clk->enable_shift); |
98 | |||
99 | /* special case for EMI clock */ | ||
100 | if (clk->enable_reg == MXC_CCM_CGR2 && clk->enable_shift == 8) | ||
101 | reg |= (1 << clk->enable_shift); | ||
102 | |||
91 | __raw_writel(reg, clk->enable_reg); | 103 | __raw_writel(reg, clk->enable_reg); |
92 | } | 104 | } |
93 | 105 | ||
94 | static void _clk_emi_disable(struct clk *clk) | 106 | static unsigned long pll_ref_get_rate(void) |
95 | { | 107 | { |
96 | u32 reg; | 108 | unsigned long ccmr; |
109 | unsigned int prcs; | ||
97 | 110 | ||
98 | reg = __raw_readl(clk->enable_reg); | 111 | ccmr = __raw_readl(MXC_CCM_CCMR); |
99 | reg &= ~(3 << clk->enable_shift); | 112 | prcs = (ccmr & MXC_CCM_CCMR_PRCS_MASK) >> MXC_CCM_CCMR_PRCS_OFFSET; |
100 | reg |= (1 << clk->enable_shift); | 113 | if (prcs == 0x1) |
101 | __raw_writel(reg, clk->enable_reg); | 114 | return CKIL_CLK_FREQ * 1024; |
115 | else | ||
116 | return clk_get_rate(&ckih_clk); | ||
102 | } | 117 | } |
103 | 118 | ||
104 | static int _clk_pll_set_rate(struct clk *clk, unsigned long rate) | 119 | static unsigned long usb_pll_get_rate(struct clk *clk) |
105 | { | 120 | { |
106 | u32 reg; | 121 | unsigned long reg; |
107 | signed long pd = 1; /* Pre-divider */ | ||
108 | signed long mfi; /* Multiplication Factor (Integer part) */ | ||
109 | signed long mfn; /* Multiplication Factor (Integer part) */ | ||
110 | signed long mfd; /* Multiplication Factor (Denominator Part) */ | ||
111 | signed long tmp; | ||
112 | u32 ref_freq = clk_get_rate(clk->parent); | ||
113 | 122 | ||
114 | while (((ref_freq / pd) * 10) > rate) | 123 | reg = __raw_readl(MXC_CCM_UPCTL); |
115 | pd++; | ||
116 | 124 | ||
117 | if ((ref_freq / pd) < PRE_DIV_MIN_FREQ) | 125 | return mxc_decode_pll(reg, pll_ref_get_rate()); |
118 | return -EINVAL; | 126 | } |
119 | 127 | ||
120 | /* the ref_freq/2 in the following is to round up */ | 128 | static unsigned long serial_pll_get_rate(struct clk *clk) |
121 | mfi = (((rate / 2) * pd) + (ref_freq / 2)) / ref_freq; | 129 | { |
122 | if (mfi < 5 || mfi > 15) | 130 | unsigned long reg; |
123 | return -EINVAL; | ||
124 | 131 | ||
125 | /* pick a mfd value that will work | 132 | reg = __raw_readl(MXC_CCM_SRPCTL); |
126 | * then solve for mfn */ | ||
127 | mfd = ref_freq / 50000; | ||
128 | |||
129 | /* | ||
130 | * pll_freq * pd * mfd | ||
131 | * mfn = -------------------- - (mfi * mfd) | ||
132 | * 2 * ref_freq | ||
133 | */ | ||
134 | /* the tmp/2 is for rounding */ | ||
135 | tmp = ref_freq / 10000; | ||
136 | mfn = | ||
137 | ((((((rate / 2) + (tmp / 2)) / tmp) * pd) * mfd) / 10000) - | ||
138 | (mfi * mfd); | ||
139 | |||
140 | mfn = mfn & 0x3ff; | ||
141 | pd--; | ||
142 | mfd--; | ||
143 | |||
144 | /* Change the Pll value */ | ||
145 | reg = (mfi << MXC_CCM_PCTL_MFI_OFFSET) | | ||
146 | (mfn << MXC_CCM_PCTL_MFN_OFFSET) | | ||
147 | (mfd << MXC_CCM_PCTL_MFD_OFFSET) | (pd << MXC_CCM_PCTL_PD_OFFSET); | ||
148 | |||
149 | if (clk == &mcu_pll_clk) | ||
150 | __raw_writel(reg, MXC_CCM_MPCTL); | ||
151 | else if (clk == &usb_pll_clk) | ||
152 | __raw_writel(reg, MXC_CCM_UPCTL); | ||
153 | else if (clk == &serial_pll_clk) | ||
154 | __raw_writel(reg, MXC_CCM_SRPCTL); | ||
155 | 133 | ||
156 | return 0; | 134 | return mxc_decode_pll(reg, pll_ref_get_rate()); |
157 | } | 135 | } |
158 | 136 | ||
159 | static unsigned long _clk_pll_get_rate(struct clk *clk) | 137 | static unsigned long mcu_pll_get_rate(struct clk *clk) |
160 | { | 138 | { |
161 | long mfi, mfn, mfd, pdf, ref_clk, mfn_abs; | ||
162 | unsigned long reg, ccmr; | 139 | unsigned long reg, ccmr; |
163 | s64 temp; | ||
164 | unsigned int prcs; | ||
165 | 140 | ||
166 | ccmr = __raw_readl(MXC_CCM_CCMR); | 141 | ccmr = __raw_readl(MXC_CCM_CCMR); |
167 | prcs = (ccmr & MXC_CCM_CCMR_PRCS_MASK) >> MXC_CCM_CCMR_PRCS_OFFSET; | ||
168 | if (prcs == 0x1) | ||
169 | ref_clk = CKIL_CLK_FREQ * 1024; | ||
170 | else | ||
171 | ref_clk = clk_get_rate(&ckih_clk); | ||
172 | |||
173 | if (clk == &mcu_pll_clk) { | ||
174 | if ((ccmr & MXC_CCM_CCMR_MPE) == 0) | ||
175 | return ref_clk; | ||
176 | if ((ccmr & MXC_CCM_CCMR_MDS) != 0) | ||
177 | return ref_clk; | ||
178 | reg = __raw_readl(MXC_CCM_MPCTL); | ||
179 | } else if (clk == &usb_pll_clk) | ||
180 | reg = __raw_readl(MXC_CCM_UPCTL); | ||
181 | else if (clk == &serial_pll_clk) | ||
182 | reg = __raw_readl(MXC_CCM_SRPCTL); | ||
183 | else { | ||
184 | BUG(); | ||
185 | return 0; | ||
186 | } | ||
187 | |||
188 | pdf = (reg & MXC_CCM_PCTL_PD_MASK) >> MXC_CCM_PCTL_PD_OFFSET; | ||
189 | mfd = (reg & MXC_CCM_PCTL_MFD_MASK) >> MXC_CCM_PCTL_MFD_OFFSET; | ||
190 | mfi = (reg & MXC_CCM_PCTL_MFI_MASK) >> MXC_CCM_PCTL_MFI_OFFSET; | ||
191 | mfi = (mfi <= 5) ? 5 : mfi; | ||
192 | mfn = mfn_abs = reg & MXC_CCM_PCTL_MFN_MASK; | ||
193 | 142 | ||
194 | if (mfn >= 0x200) { | 143 | if (!(ccmr & MXC_CCM_CCMR_MPE) || (ccmr & MXC_CCM_CCMR_MDS)) |
195 | mfn |= 0xFFFFFE00; | 144 | return clk_get_rate(&ckih_clk); |
196 | mfn_abs = -mfn; | ||
197 | } | ||
198 | |||
199 | ref_clk *= 2; | ||
200 | ref_clk /= pdf + 1; | ||
201 | 145 | ||
202 | temp = (u64) ref_clk * mfn_abs; | 146 | reg = __raw_readl(MXC_CCM_MPCTL); |
203 | do_div(temp, mfd + 1); | ||
204 | if (mfn < 0) | ||
205 | temp = -temp; | ||
206 | temp = (ref_clk * mfi) + temp; | ||
207 | 147 | ||
208 | return temp; | 148 | return mxc_decode_pll(reg, pll_ref_get_rate()); |
209 | } | 149 | } |
210 | 150 | ||
211 | static int _clk_usb_pll_enable(struct clk *clk) | 151 | static int usb_pll_enable(struct clk *clk) |
212 | { | 152 | { |
213 | u32 reg; | 153 | u32 reg; |
214 | 154 | ||
@@ -222,7 +162,7 @@ static int _clk_usb_pll_enable(struct clk *clk) | |||
222 | return 0; | 162 | return 0; |
223 | } | 163 | } |
224 | 164 | ||
225 | static void _clk_usb_pll_disable(struct clk *clk) | 165 | static void usb_pll_disable(struct clk *clk) |
226 | { | 166 | { |
227 | u32 reg; | 167 | u32 reg; |
228 | 168 | ||
@@ -231,7 +171,7 @@ static void _clk_usb_pll_disable(struct clk *clk) | |||
231 | __raw_writel(reg, MXC_CCM_CCMR); | 171 | __raw_writel(reg, MXC_CCM_CCMR); |
232 | } | 172 | } |
233 | 173 | ||
234 | static int _clk_serial_pll_enable(struct clk *clk) | 174 | static int serial_pll_enable(struct clk *clk) |
235 | { | 175 | { |
236 | u32 reg; | 176 | u32 reg; |
237 | 177 | ||
@@ -245,7 +185,7 @@ static int _clk_serial_pll_enable(struct clk *clk) | |||
245 | return 0; | 185 | return 0; |
246 | } | 186 | } |
247 | 187 | ||
248 | static void _clk_serial_pll_disable(struct clk *clk) | 188 | static void serial_pll_disable(struct clk *clk) |
249 | { | 189 | { |
250 | u32 reg; | 190 | u32 reg; |
251 | 191 | ||
@@ -258,7 +198,7 @@ static void _clk_serial_pll_disable(struct clk *clk) | |||
258 | #define PDR1(mask, off) ((__raw_readl(MXC_CCM_PDR1) & mask) >> off) | 198 | #define PDR1(mask, off) ((__raw_readl(MXC_CCM_PDR1) & mask) >> off) |
259 | #define PDR2(mask, off) ((__raw_readl(MXC_CCM_PDR2) & mask) >> off) | 199 | #define PDR2(mask, off) ((__raw_readl(MXC_CCM_PDR2) & mask) >> off) |
260 | 200 | ||
261 | static unsigned long _clk_mcu_main_get_rate(struct clk *clk) | 201 | static unsigned long mcu_main_get_rate(struct clk *clk) |
262 | { | 202 | { |
263 | u32 pmcr0 = __raw_readl(MXC_CCM_PMCR0); | 203 | u32 pmcr0 = __raw_readl(MXC_CCM_PMCR0); |
264 | 204 | ||
@@ -268,7 +208,7 @@ static unsigned long _clk_mcu_main_get_rate(struct clk *clk) | |||
268 | return clk_get_rate(&mcu_pll_clk); | 208 | return clk_get_rate(&mcu_pll_clk); |
269 | } | 209 | } |
270 | 210 | ||
271 | static unsigned long _clk_hclk_get_rate(struct clk *clk) | 211 | static unsigned long ahb_get_rate(struct clk *clk) |
272 | { | 212 | { |
273 | unsigned long max_pdf; | 213 | unsigned long max_pdf; |
274 | 214 | ||
@@ -277,7 +217,7 @@ static unsigned long _clk_hclk_get_rate(struct clk *clk) | |||
277 | return clk_get_rate(clk->parent) / (max_pdf + 1); | 217 | return clk_get_rate(clk->parent) / (max_pdf + 1); |
278 | } | 218 | } |
279 | 219 | ||
280 | static unsigned long _clk_ipg_get_rate(struct clk *clk) | 220 | static unsigned long ipg_get_rate(struct clk *clk) |
281 | { | 221 | { |
282 | unsigned long ipg_pdf; | 222 | unsigned long ipg_pdf; |
283 | 223 | ||
@@ -286,7 +226,7 @@ static unsigned long _clk_ipg_get_rate(struct clk *clk) | |||
286 | return clk_get_rate(clk->parent) / (ipg_pdf + 1); | 226 | return clk_get_rate(clk->parent) / (ipg_pdf + 1); |
287 | } | 227 | } |
288 | 228 | ||
289 | static unsigned long _clk_nfc_get_rate(struct clk *clk) | 229 | static unsigned long nfc_get_rate(struct clk *clk) |
290 | { | 230 | { |
291 | unsigned long nfc_pdf; | 231 | unsigned long nfc_pdf; |
292 | 232 | ||
@@ -295,7 +235,7 @@ static unsigned long _clk_nfc_get_rate(struct clk *clk) | |||
295 | return clk_get_rate(clk->parent) / (nfc_pdf + 1); | 235 | return clk_get_rate(clk->parent) / (nfc_pdf + 1); |
296 | } | 236 | } |
297 | 237 | ||
298 | static unsigned long _clk_hsp_get_rate(struct clk *clk) | 238 | static unsigned long hsp_get_rate(struct clk *clk) |
299 | { | 239 | { |
300 | unsigned long hsp_pdf; | 240 | unsigned long hsp_pdf; |
301 | 241 | ||
@@ -304,7 +244,7 @@ static unsigned long _clk_hsp_get_rate(struct clk *clk) | |||
304 | return clk_get_rate(clk->parent) / (hsp_pdf + 1); | 244 | return clk_get_rate(clk->parent) / (hsp_pdf + 1); |
305 | } | 245 | } |
306 | 246 | ||
307 | static unsigned long _clk_usb_get_rate(struct clk *clk) | 247 | static unsigned long usb_get_rate(struct clk *clk) |
308 | { | 248 | { |
309 | unsigned long usb_pdf, usb_prepdf; | 249 | unsigned long usb_pdf, usb_prepdf; |
310 | 250 | ||
@@ -315,7 +255,7 @@ static unsigned long _clk_usb_get_rate(struct clk *clk) | |||
315 | return clk_get_rate(clk->parent) / (usb_prepdf + 1) / (usb_pdf + 1); | 255 | return clk_get_rate(clk->parent) / (usb_prepdf + 1) / (usb_pdf + 1); |
316 | } | 256 | } |
317 | 257 | ||
318 | static unsigned long _clk_csi_get_rate(struct clk *clk) | 258 | static unsigned long csi_get_rate(struct clk *clk) |
319 | { | 259 | { |
320 | u32 reg, pre, post; | 260 | u32 reg, pre, post; |
321 | 261 | ||
@@ -329,7 +269,7 @@ static unsigned long _clk_csi_get_rate(struct clk *clk) | |||
329 | return clk_get_rate(clk->parent) / (pre * post); | 269 | return clk_get_rate(clk->parent) / (pre * post); |
330 | } | 270 | } |
331 | 271 | ||
332 | static unsigned long _clk_csi_round_rate(struct clk *clk, unsigned long rate) | 272 | static unsigned long csi_round_rate(struct clk *clk, unsigned long rate) |
333 | { | 273 | { |
334 | u32 pre, post, parent = clk_get_rate(clk->parent); | 274 | u32 pre, post, parent = clk_get_rate(clk->parent); |
335 | u32 div = parent / rate; | 275 | u32 div = parent / rate; |
@@ -342,7 +282,7 @@ static unsigned long _clk_csi_round_rate(struct clk *clk, unsigned long rate) | |||
342 | return parent / (pre * post); | 282 | return parent / (pre * post); |
343 | } | 283 | } |
344 | 284 | ||
345 | static int _clk_csi_set_rate(struct clk *clk, unsigned long rate) | 285 | static int csi_set_rate(struct clk *clk, unsigned long rate) |
346 | { | 286 | { |
347 | u32 reg, div, pre, post, parent = clk_get_rate(clk->parent); | 287 | u32 reg, div, pre, post, parent = clk_get_rate(clk->parent); |
348 | 288 | ||
@@ -363,16 +303,7 @@ static int _clk_csi_set_rate(struct clk *clk, unsigned long rate) | |||
363 | return 0; | 303 | return 0; |
364 | } | 304 | } |
365 | 305 | ||
366 | static unsigned long _clk_per_get_rate(struct clk *clk) | 306 | static unsigned long ssi1_get_rate(struct clk *clk) |
367 | { | ||
368 | unsigned long per_pdf; | ||
369 | |||
370 | per_pdf = PDR0(MXC_CCM_PDR0_PER_PODF_MASK, | ||
371 | MXC_CCM_PDR0_PER_PODF_OFFSET); | ||
372 | return clk_get_rate(clk->parent) / (per_pdf + 1); | ||
373 | } | ||
374 | |||
375 | static unsigned long _clk_ssi1_get_rate(struct clk *clk) | ||
376 | { | 307 | { |
377 | unsigned long ssi1_pdf, ssi1_prepdf; | 308 | unsigned long ssi1_pdf, ssi1_prepdf; |
378 | 309 | ||
@@ -383,7 +314,7 @@ static unsigned long _clk_ssi1_get_rate(struct clk *clk) | |||
383 | return clk_get_rate(clk->parent) / (ssi1_prepdf + 1) / (ssi1_pdf + 1); | 314 | return clk_get_rate(clk->parent) / (ssi1_prepdf + 1) / (ssi1_pdf + 1); |
384 | } | 315 | } |
385 | 316 | ||
386 | static unsigned long _clk_ssi2_get_rate(struct clk *clk) | 317 | static unsigned long ssi2_get_rate(struct clk *clk) |
387 | { | 318 | { |
388 | unsigned long ssi2_pdf, ssi2_prepdf; | 319 | unsigned long ssi2_pdf, ssi2_prepdf; |
389 | 320 | ||
@@ -394,7 +325,7 @@ static unsigned long _clk_ssi2_get_rate(struct clk *clk) | |||
394 | return clk_get_rate(clk->parent) / (ssi2_prepdf + 1) / (ssi2_pdf + 1); | 325 | return clk_get_rate(clk->parent) / (ssi2_prepdf + 1) / (ssi2_pdf + 1); |
395 | } | 326 | } |
396 | 327 | ||
397 | static unsigned long _clk_firi_get_rate(struct clk *clk) | 328 | static unsigned long firi_get_rate(struct clk *clk) |
398 | { | 329 | { |
399 | unsigned long firi_pdf, firi_prepdf; | 330 | unsigned long firi_pdf, firi_prepdf; |
400 | 331 | ||
@@ -405,7 +336,7 @@ static unsigned long _clk_firi_get_rate(struct clk *clk) | |||
405 | return clk_get_rate(clk->parent) / (firi_prepdf + 1) / (firi_pdf + 1); | 336 | return clk_get_rate(clk->parent) / (firi_prepdf + 1) / (firi_pdf + 1); |
406 | } | 337 | } |
407 | 338 | ||
408 | static unsigned long _clk_firi_round_rate(struct clk *clk, unsigned long rate) | 339 | static unsigned long firi_round_rate(struct clk *clk, unsigned long rate) |
409 | { | 340 | { |
410 | u32 pre, post; | 341 | u32 pre, post; |
411 | u32 parent = clk_get_rate(clk->parent); | 342 | u32 parent = clk_get_rate(clk->parent); |
@@ -420,7 +351,7 @@ static unsigned long _clk_firi_round_rate(struct clk *clk, unsigned long rate) | |||
420 | 351 | ||
421 | } | 352 | } |
422 | 353 | ||
423 | static int _clk_firi_set_rate(struct clk *clk, unsigned long rate) | 354 | static int firi_set_rate(struct clk *clk, unsigned long rate) |
424 | { | 355 | { |
425 | u32 reg, div, pre, post, parent = clk_get_rate(clk->parent); | 356 | u32 reg, div, pre, post, parent = clk_get_rate(clk->parent); |
426 | 357 | ||
@@ -441,12 +372,12 @@ static int _clk_firi_set_rate(struct clk *clk, unsigned long rate) | |||
441 | return 0; | 372 | return 0; |
442 | } | 373 | } |
443 | 374 | ||
444 | static unsigned long _clk_mbx_get_rate(struct clk *clk) | 375 | static unsigned long mbx_get_rate(struct clk *clk) |
445 | { | 376 | { |
446 | return clk_get_rate(clk->parent) / 2; | 377 | return clk_get_rate(clk->parent) / 2; |
447 | } | 378 | } |
448 | 379 | ||
449 | static unsigned long _clk_mstick1_get_rate(struct clk *clk) | 380 | static unsigned long mstick1_get_rate(struct clk *clk) |
450 | { | 381 | { |
451 | unsigned long msti_pdf; | 382 | unsigned long msti_pdf; |
452 | 383 | ||
@@ -455,7 +386,7 @@ static unsigned long _clk_mstick1_get_rate(struct clk *clk) | |||
455 | return clk_get_rate(clk->parent) / (msti_pdf + 1); | 386 | return clk_get_rate(clk->parent) / (msti_pdf + 1); |
456 | } | 387 | } |
457 | 388 | ||
458 | static unsigned long _clk_mstick2_get_rate(struct clk *clk) | 389 | static unsigned long mstick2_get_rate(struct clk *clk) |
459 | { | 390 | { |
460 | unsigned long msti_pdf; | 391 | unsigned long msti_pdf; |
461 | 392 | ||
@@ -472,661 +403,185 @@ static unsigned long clk_ckih_get_rate(struct clk *clk) | |||
472 | } | 403 | } |
473 | 404 | ||
474 | static struct clk ckih_clk = { | 405 | static struct clk ckih_clk = { |
475 | .name = "ckih", | ||
476 | .get_rate = clk_ckih_get_rate, | 406 | .get_rate = clk_ckih_get_rate, |
477 | }; | 407 | }; |
478 | 408 | ||
479 | static unsigned long clk_ckil_get_rate(struct clk *clk) | ||
480 | { | ||
481 | return CKIL_CLK_FREQ; | ||
482 | } | ||
483 | |||
484 | static struct clk ckil_clk = { | ||
485 | .name = "ckil", | ||
486 | .get_rate = clk_ckil_get_rate, | ||
487 | }; | ||
488 | |||
489 | static struct clk mcu_pll_clk = { | 409 | static struct clk mcu_pll_clk = { |
490 | .name = "mcu_pll", | ||
491 | .parent = &ckih_clk, | 410 | .parent = &ckih_clk, |
492 | .set_rate = _clk_pll_set_rate, | 411 | .get_rate = mcu_pll_get_rate, |
493 | .get_rate = _clk_pll_get_rate, | ||
494 | }; | 412 | }; |
495 | 413 | ||
496 | static struct clk mcu_main_clk = { | 414 | static struct clk mcu_main_clk = { |
497 | .name = "mcu_main_clk", | ||
498 | .parent = &mcu_pll_clk, | 415 | .parent = &mcu_pll_clk, |
499 | .get_rate = _clk_mcu_main_get_rate, | 416 | .get_rate = mcu_main_get_rate, |
500 | }; | 417 | }; |
501 | 418 | ||
502 | static struct clk serial_pll_clk = { | 419 | static struct clk serial_pll_clk = { |
503 | .name = "serial_pll", | ||
504 | .parent = &ckih_clk, | 420 | .parent = &ckih_clk, |
505 | .set_rate = _clk_pll_set_rate, | 421 | .get_rate = serial_pll_get_rate, |
506 | .get_rate = _clk_pll_get_rate, | 422 | .enable = serial_pll_enable, |
507 | .enable = _clk_serial_pll_enable, | 423 | .disable = serial_pll_disable, |
508 | .disable = _clk_serial_pll_disable, | ||
509 | }; | 424 | }; |
510 | 425 | ||
511 | static struct clk usb_pll_clk = { | 426 | static struct clk usb_pll_clk = { |
512 | .name = "usb_pll", | ||
513 | .parent = &ckih_clk, | 427 | .parent = &ckih_clk, |
514 | .set_rate = _clk_pll_set_rate, | 428 | .get_rate = usb_pll_get_rate, |
515 | .get_rate = _clk_pll_get_rate, | 429 | .enable = usb_pll_enable, |
516 | .enable = _clk_usb_pll_enable, | 430 | .disable = usb_pll_disable, |
517 | .disable = _clk_usb_pll_disable, | ||
518 | }; | 431 | }; |
519 | 432 | ||
520 | static struct clk ahb_clk = { | 433 | static struct clk ahb_clk = { |
521 | .name = "ahb_clk", | ||
522 | .parent = &mcu_main_clk, | 434 | .parent = &mcu_main_clk, |
523 | .get_rate = _clk_hclk_get_rate, | 435 | .get_rate = ahb_get_rate, |
524 | }; | 436 | }; |
525 | 437 | ||
526 | static struct clk per_clk = { | 438 | #define DEFINE_CLOCK(name, i, er, es, gr, s, p) \ |
527 | .name = "per_clk", | 439 | static struct clk name = { \ |
528 | .parent = &usb_pll_clk, | 440 | .id = i, \ |
529 | .get_rate = _clk_per_get_rate, | 441 | .enable_reg = er, \ |
530 | }; | 442 | .enable_shift = es, \ |
531 | 443 | .get_rate = gr, \ | |
532 | static struct clk perclk_clk = { | 444 | .enable = cgr_enable, \ |
533 | .name = "perclk_clk", | 445 | .disable = cgr_disable, \ |
534 | .parent = &ipg_clk, | 446 | .secondary = s, \ |
535 | }; | 447 | .parent = p, \ |
536 | 448 | } | |
537 | static struct clk cspi_clk[] = { | ||
538 | { | ||
539 | .name = "cspi_clk", | ||
540 | .id = 0, | ||
541 | .parent = &ipg_clk, | ||
542 | .enable = _clk_enable, | ||
543 | .enable_reg = MXC_CCM_CGR2, | ||
544 | .enable_shift = MXC_CCM_CGR2_CSPI1_OFFSET, | ||
545 | .disable = _clk_disable,}, | ||
546 | { | ||
547 | .name = "cspi_clk", | ||
548 | .id = 1, | ||
549 | .parent = &ipg_clk, | ||
550 | .enable = _clk_enable, | ||
551 | .enable_reg = MXC_CCM_CGR2, | ||
552 | .enable_shift = MXC_CCM_CGR2_CSPI2_OFFSET, | ||
553 | .disable = _clk_disable,}, | ||
554 | { | ||
555 | .name = "cspi_clk", | ||
556 | .id = 2, | ||
557 | .parent = &ipg_clk, | ||
558 | .enable = _clk_enable, | ||
559 | .enable_reg = MXC_CCM_CGR0, | ||
560 | .enable_shift = MXC_CCM_CGR0_CSPI3_OFFSET, | ||
561 | .disable = _clk_disable,}, | ||
562 | }; | ||
563 | |||
564 | static struct clk ipg_clk = { | ||
565 | .name = "ipg_clk", | ||
566 | .parent = &ahb_clk, | ||
567 | .get_rate = _clk_ipg_get_rate, | ||
568 | }; | ||
569 | |||
570 | static struct clk emi_clk = { | ||
571 | .name = "emi_clk", | ||
572 | .parent = &ahb_clk, | ||
573 | .enable = _clk_enable, | ||
574 | .enable_reg = MXC_CCM_CGR2, | ||
575 | .enable_shift = MXC_CCM_CGR2_EMI_OFFSET, | ||
576 | .disable = _clk_emi_disable, | ||
577 | }; | ||
578 | |||
579 | static struct clk gpt_clk = { | ||
580 | .name = "gpt_clk", | ||
581 | .parent = &perclk_clk, | ||
582 | .enable = _clk_enable, | ||
583 | .enable_reg = MXC_CCM_CGR0, | ||
584 | .enable_shift = MXC_CCM_CGR0_GPT_OFFSET, | ||
585 | .disable = _clk_disable, | ||
586 | }; | ||
587 | |||
588 | static struct clk pwm_clk = { | ||
589 | .name = "pwm_clk", | ||
590 | .parent = &perclk_clk, | ||
591 | .enable = _clk_enable, | ||
592 | .enable_reg = MXC_CCM_CGR0, | ||
593 | .enable_shift = MXC_CCM_CGR1_PWM_OFFSET, | ||
594 | .disable = _clk_disable, | ||
595 | }; | ||
596 | |||
597 | static struct clk epit_clk[] = { | ||
598 | { | ||
599 | .name = "epit_clk", | ||
600 | .id = 0, | ||
601 | .parent = &perclk_clk, | ||
602 | .enable = _clk_enable, | ||
603 | .enable_reg = MXC_CCM_CGR0, | ||
604 | .enable_shift = MXC_CCM_CGR0_EPIT1_OFFSET, | ||
605 | .disable = _clk_disable,}, | ||
606 | { | ||
607 | .name = "epit_clk", | ||
608 | .id = 1, | ||
609 | .parent = &perclk_clk, | ||
610 | .enable = _clk_enable, | ||
611 | .enable_reg = MXC_CCM_CGR0, | ||
612 | .enable_shift = MXC_CCM_CGR0_EPIT2_OFFSET, | ||
613 | .disable = _clk_disable,}, | ||
614 | }; | ||
615 | |||
616 | static struct clk nfc_clk = { | ||
617 | .name = "nfc_clk", | ||
618 | .parent = &ahb_clk, | ||
619 | .get_rate = _clk_nfc_get_rate, | ||
620 | }; | ||
621 | |||
622 | static struct clk scc_clk = { | ||
623 | .name = "scc_clk", | ||
624 | .parent = &ipg_clk, | ||
625 | }; | ||
626 | |||
627 | static struct clk ipu_clk = { | ||
628 | .name = "ipu_clk", | ||
629 | .parent = &mcu_main_clk, | ||
630 | .get_rate = _clk_hsp_get_rate, | ||
631 | .enable = _clk_enable, | ||
632 | .enable_reg = MXC_CCM_CGR1, | ||
633 | .enable_shift = MXC_CCM_CGR1_IPU_OFFSET, | ||
634 | .disable = _clk_disable, | ||
635 | }; | ||
636 | |||
637 | static struct clk kpp_clk = { | ||
638 | .name = "kpp_clk", | ||
639 | .parent = &ipg_clk, | ||
640 | .enable = _clk_enable, | ||
641 | .enable_reg = MXC_CCM_CGR1, | ||
642 | .enable_shift = MXC_CCM_CGR1_KPP_OFFSET, | ||
643 | .disable = _clk_disable, | ||
644 | }; | ||
645 | |||
646 | static struct clk wdog_clk = { | ||
647 | .name = "wdog_clk", | ||
648 | .parent = &ipg_clk, | ||
649 | .enable = _clk_enable, | ||
650 | .enable_reg = MXC_CCM_CGR1, | ||
651 | .enable_shift = MXC_CCM_CGR1_WDOG_OFFSET, | ||
652 | .disable = _clk_disable, | ||
653 | }; | ||
654 | static struct clk rtc_clk = { | ||
655 | .name = "rtc_clk", | ||
656 | .parent = &ipg_clk, | ||
657 | .enable = _clk_enable, | ||
658 | .enable_reg = MXC_CCM_CGR1, | ||
659 | .enable_shift = MXC_CCM_CGR1_RTC_OFFSET, | ||
660 | .disable = _clk_disable, | ||
661 | }; | ||
662 | |||
663 | static struct clk usb_clk[] = { | ||
664 | { | ||
665 | .name = "usb_clk", | ||
666 | .parent = &usb_pll_clk, | ||
667 | .get_rate = _clk_usb_get_rate,}, | ||
668 | { | ||
669 | .name = "usb_ahb_clk", | ||
670 | .parent = &ahb_clk, | ||
671 | .enable = _clk_enable, | ||
672 | .enable_reg = MXC_CCM_CGR1, | ||
673 | .enable_shift = MXC_CCM_CGR1_USBOTG_OFFSET, | ||
674 | .disable = _clk_disable,}, | ||
675 | }; | ||
676 | |||
677 | static struct clk csi_clk = { | ||
678 | .name = "csi_clk", | ||
679 | .parent = &serial_pll_clk, | ||
680 | .get_rate = _clk_csi_get_rate, | ||
681 | .round_rate = _clk_csi_round_rate, | ||
682 | .set_rate = _clk_csi_set_rate, | ||
683 | .enable = _clk_enable, | ||
684 | .enable_reg = MXC_CCM_CGR1, | ||
685 | .enable_shift = MXC_CCM_CGR1_CSI_OFFSET, | ||
686 | .disable = _clk_disable, | ||
687 | }; | ||
688 | |||
689 | static struct clk uart_clk[] = { | ||
690 | { | ||
691 | .name = "uart_clk", | ||
692 | .id = 0, | ||
693 | .parent = &perclk_clk, | ||
694 | .enable = _clk_enable, | ||
695 | .enable_reg = MXC_CCM_CGR0, | ||
696 | .enable_shift = MXC_CCM_CGR0_UART1_OFFSET, | ||
697 | .disable = _clk_disable,}, | ||
698 | { | ||
699 | .name = "uart_clk", | ||
700 | .id = 1, | ||
701 | .parent = &perclk_clk, | ||
702 | .enable = _clk_enable, | ||
703 | .enable_reg = MXC_CCM_CGR0, | ||
704 | .enable_shift = MXC_CCM_CGR0_UART2_OFFSET, | ||
705 | .disable = _clk_disable,}, | ||
706 | { | ||
707 | .name = "uart_clk", | ||
708 | .id = 2, | ||
709 | .parent = &perclk_clk, | ||
710 | .enable = _clk_enable, | ||
711 | .enable_reg = MXC_CCM_CGR1, | ||
712 | .enable_shift = MXC_CCM_CGR1_UART3_OFFSET, | ||
713 | .disable = _clk_disable,}, | ||
714 | { | ||
715 | .name = "uart_clk", | ||
716 | .id = 3, | ||
717 | .parent = &perclk_clk, | ||
718 | .enable = _clk_enable, | ||
719 | .enable_reg = MXC_CCM_CGR1, | ||
720 | .enable_shift = MXC_CCM_CGR1_UART4_OFFSET, | ||
721 | .disable = _clk_disable,}, | ||
722 | { | ||
723 | .name = "uart_clk", | ||
724 | .id = 4, | ||
725 | .parent = &perclk_clk, | ||
726 | .enable = _clk_enable, | ||
727 | .enable_reg = MXC_CCM_CGR1, | ||
728 | .enable_shift = MXC_CCM_CGR1_UART5_OFFSET, | ||
729 | .disable = _clk_disable,}, | ||
730 | }; | ||
731 | |||
732 | static struct clk i2c_clk[] = { | ||
733 | { | ||
734 | .name = "i2c_clk", | ||
735 | .id = 0, | ||
736 | .parent = &perclk_clk, | ||
737 | .enable = _clk_enable, | ||
738 | .enable_reg = MXC_CCM_CGR0, | ||
739 | .enable_shift = MXC_CCM_CGR0_I2C1_OFFSET, | ||
740 | .disable = _clk_disable,}, | ||
741 | { | ||
742 | .name = "i2c_clk", | ||
743 | .id = 1, | ||
744 | .parent = &perclk_clk, | ||
745 | .enable = _clk_enable, | ||
746 | .enable_reg = MXC_CCM_CGR0, | ||
747 | .enable_shift = MXC_CCM_CGR0_I2C2_OFFSET, | ||
748 | .disable = _clk_disable,}, | ||
749 | { | ||
750 | .name = "i2c_clk", | ||
751 | .id = 2, | ||
752 | .parent = &perclk_clk, | ||
753 | .enable = _clk_enable, | ||
754 | .enable_reg = MXC_CCM_CGR0, | ||
755 | .enable_shift = MXC_CCM_CGR0_I2C3_OFFSET, | ||
756 | .disable = _clk_disable,}, | ||
757 | }; | ||
758 | |||
759 | static struct clk owire_clk = { | ||
760 | .name = "owire_clk", | ||
761 | .parent = &perclk_clk, | ||
762 | .enable_reg = MXC_CCM_CGR1, | ||
763 | .enable_shift = MXC_CCM_CGR1_OWIRE_OFFSET, | ||
764 | .enable = _clk_enable, | ||
765 | .disable = _clk_disable, | ||
766 | }; | ||
767 | |||
768 | static struct clk sdhc_clk[] = { | ||
769 | { | ||
770 | .name = "sdhc_clk", | ||
771 | .id = 0, | ||
772 | .parent = &perclk_clk, | ||
773 | .enable = _clk_enable, | ||
774 | .enable_reg = MXC_CCM_CGR0, | ||
775 | .enable_shift = MXC_CCM_CGR0_SD_MMC1_OFFSET, | ||
776 | .disable = _clk_disable,}, | ||
777 | { | ||
778 | .name = "sdhc_clk", | ||
779 | .id = 1, | ||
780 | .parent = &perclk_clk, | ||
781 | .enable = _clk_enable, | ||
782 | .enable_reg = MXC_CCM_CGR0, | ||
783 | .enable_shift = MXC_CCM_CGR0_SD_MMC2_OFFSET, | ||
784 | .disable = _clk_disable,}, | ||
785 | }; | ||
786 | |||
787 | static struct clk ssi_clk[] = { | ||
788 | { | ||
789 | .name = "ssi_clk", | ||
790 | .parent = &serial_pll_clk, | ||
791 | .get_rate = _clk_ssi1_get_rate, | ||
792 | .enable = _clk_enable, | ||
793 | .enable_reg = MXC_CCM_CGR0, | ||
794 | .enable_shift = MXC_CCM_CGR0_SSI1_OFFSET, | ||
795 | .disable = _clk_disable,}, | ||
796 | { | ||
797 | .name = "ssi_clk", | ||
798 | .id = 1, | ||
799 | .parent = &serial_pll_clk, | ||
800 | .get_rate = _clk_ssi2_get_rate, | ||
801 | .enable = _clk_enable, | ||
802 | .enable_reg = MXC_CCM_CGR2, | ||
803 | .enable_shift = MXC_CCM_CGR2_SSI2_OFFSET, | ||
804 | .disable = _clk_disable,}, | ||
805 | }; | ||
806 | |||
807 | static struct clk firi_clk = { | ||
808 | .name = "firi_clk", | ||
809 | .parent = &usb_pll_clk, | ||
810 | .round_rate = _clk_firi_round_rate, | ||
811 | .set_rate = _clk_firi_set_rate, | ||
812 | .get_rate = _clk_firi_get_rate, | ||
813 | .enable = _clk_enable, | ||
814 | .enable_reg = MXC_CCM_CGR2, | ||
815 | .enable_shift = MXC_CCM_CGR2_FIRI_OFFSET, | ||
816 | .disable = _clk_disable, | ||
817 | }; | ||
818 | |||
819 | static struct clk ata_clk = { | ||
820 | .name = "ata_clk", | ||
821 | .parent = &ipg_clk, | ||
822 | .enable = _clk_enable, | ||
823 | .enable_reg = MXC_CCM_CGR0, | ||
824 | .enable_shift = MXC_CCM_CGR0_ATA_OFFSET, | ||
825 | .disable = _clk_disable, | ||
826 | }; | ||
827 | |||
828 | static struct clk mbx_clk = { | ||
829 | .name = "mbx_clk", | ||
830 | .parent = &ahb_clk, | ||
831 | .enable = _clk_enable, | ||
832 | .enable_reg = MXC_CCM_CGR2, | ||
833 | .enable_shift = MXC_CCM_CGR2_GACC_OFFSET, | ||
834 | .get_rate = _clk_mbx_get_rate, | ||
835 | }; | ||
836 | |||
837 | static struct clk vpu_clk = { | ||
838 | .name = "vpu_clk", | ||
839 | .parent = &ahb_clk, | ||
840 | .enable = _clk_enable, | ||
841 | .enable_reg = MXC_CCM_CGR2, | ||
842 | .enable_shift = MXC_CCM_CGR2_GACC_OFFSET, | ||
843 | .get_rate = _clk_mbx_get_rate, | ||
844 | }; | ||
845 | |||
846 | static struct clk rtic_clk = { | ||
847 | .name = "rtic_clk", | ||
848 | .parent = &ahb_clk, | ||
849 | .enable = _clk_enable, | ||
850 | .enable_reg = MXC_CCM_CGR2, | ||
851 | .enable_shift = MXC_CCM_CGR2_RTIC_OFFSET, | ||
852 | .disable = _clk_disable, | ||
853 | }; | ||
854 | |||
855 | static struct clk rng_clk = { | ||
856 | .name = "rng_clk", | ||
857 | .parent = &ipg_clk, | ||
858 | .enable = _clk_enable, | ||
859 | .enable_reg = MXC_CCM_CGR0, | ||
860 | .enable_shift = MXC_CCM_CGR0_RNG_OFFSET, | ||
861 | .disable = _clk_disable, | ||
862 | }; | ||
863 | |||
864 | static struct clk sdma_clk[] = { | ||
865 | { | ||
866 | .name = "sdma_ahb_clk", | ||
867 | .parent = &ahb_clk, | ||
868 | .enable = _clk_enable, | ||
869 | .enable_reg = MXC_CCM_CGR0, | ||
870 | .enable_shift = MXC_CCM_CGR0_SDMA_OFFSET, | ||
871 | .disable = _clk_disable,}, | ||
872 | { | ||
873 | .name = "sdma_ipg_clk", | ||
874 | .parent = &ipg_clk,} | ||
875 | }; | ||
876 | |||
877 | static struct clk mpeg4_clk = { | ||
878 | .name = "mpeg4_clk", | ||
879 | .parent = &ahb_clk, | ||
880 | .enable = _clk_enable, | ||
881 | .enable_reg = MXC_CCM_CGR1, | ||
882 | .enable_shift = MXC_CCM_CGR1_HANTRO_OFFSET, | ||
883 | .disable = _clk_disable, | ||
884 | }; | ||
885 | |||
886 | static struct clk vl2cc_clk = { | ||
887 | .name = "vl2cc_clk", | ||
888 | .parent = &ahb_clk, | ||
889 | .enable = _clk_enable, | ||
890 | .enable_reg = MXC_CCM_CGR1, | ||
891 | .enable_shift = MXC_CCM_CGR1_HANTRO_OFFSET, | ||
892 | .disable = _clk_disable, | ||
893 | }; | ||
894 | |||
895 | static struct clk mstick_clk[] = { | ||
896 | { | ||
897 | .name = "mstick_clk", | ||
898 | .id = 0, | ||
899 | .parent = &usb_pll_clk, | ||
900 | .get_rate = _clk_mstick1_get_rate, | ||
901 | .enable = _clk_enable, | ||
902 | .enable_reg = MXC_CCM_CGR1, | ||
903 | .enable_shift = MXC_CCM_CGR1_MEMSTICK1_OFFSET, | ||
904 | .disable = _clk_disable,}, | ||
905 | { | ||
906 | .name = "mstick_clk", | ||
907 | .id = 1, | ||
908 | .parent = &usb_pll_clk, | ||
909 | .get_rate = _clk_mstick2_get_rate, | ||
910 | .enable = _clk_enable, | ||
911 | .enable_reg = MXC_CCM_CGR1, | ||
912 | .enable_shift = MXC_CCM_CGR1_MEMSTICK2_OFFSET, | ||
913 | .disable = _clk_disable,}, | ||
914 | }; | ||
915 | |||
916 | static struct clk iim_clk = { | ||
917 | .name = "iim_clk", | ||
918 | .parent = &ipg_clk, | ||
919 | .enable = _clk_enable, | ||
920 | .enable_reg = MXC_CCM_CGR0, | ||
921 | .enable_shift = MXC_CCM_CGR0_IIM_OFFSET, | ||
922 | .disable = _clk_disable, | ||
923 | }; | ||
924 | |||
925 | static unsigned long _clk_cko1_round_rate(struct clk *clk, unsigned long rate) | ||
926 | { | ||
927 | u32 div, parent = clk_get_rate(clk->parent); | ||
928 | |||
929 | div = parent / rate; | ||
930 | if (parent % rate) | ||
931 | div++; | ||
932 | |||
933 | if (div > 8) | ||
934 | div = 16; | ||
935 | else if (div > 4) | ||
936 | div = 8; | ||
937 | else if (div > 2) | ||
938 | div = 4; | ||
939 | |||
940 | return parent / div; | ||
941 | } | ||
942 | |||
943 | static int _clk_cko1_set_rate(struct clk *clk, unsigned long rate) | ||
944 | { | ||
945 | u32 reg, div, parent = clk_get_rate(clk->parent); | ||
946 | |||
947 | div = parent / rate; | ||
948 | |||
949 | if (div == 16) | ||
950 | div = 4; | ||
951 | else if (div == 8) | ||
952 | div = 3; | ||
953 | else if (div == 4) | ||
954 | div = 2; | ||
955 | else if (div == 2) | ||
956 | div = 1; | ||
957 | else if (div == 1) | ||
958 | div = 0; | ||
959 | else | ||
960 | return -EINVAL; | ||
961 | |||
962 | reg = __raw_readl(MXC_CCM_COSR) & ~MXC_CCM_COSR_CLKOUTDIV_MASK; | ||
963 | reg |= div << MXC_CCM_COSR_CLKOUTDIV_OFFSET; | ||
964 | __raw_writel(reg, MXC_CCM_COSR); | ||
965 | |||
966 | return 0; | ||
967 | } | ||
968 | |||
969 | static unsigned long _clk_cko1_get_rate(struct clk *clk) | ||
970 | { | ||
971 | u32 div; | ||
972 | |||
973 | div = __raw_readl(MXC_CCM_COSR) & MXC_CCM_COSR_CLKOUTDIV_MASK >> | ||
974 | MXC_CCM_COSR_CLKOUTDIV_OFFSET; | ||
975 | |||
976 | return clk_get_rate(clk->parent) / (1 << div); | ||
977 | } | ||
978 | |||
979 | static int _clk_cko1_set_parent(struct clk *clk, struct clk *parent) | ||
980 | { | ||
981 | u32 reg; | ||
982 | |||
983 | reg = __raw_readl(MXC_CCM_COSR) & ~MXC_CCM_COSR_CLKOSEL_MASK; | ||
984 | |||
985 | if (parent == &mcu_main_clk) | ||
986 | reg |= 0 << MXC_CCM_COSR_CLKOSEL_OFFSET; | ||
987 | else if (parent == &ipg_clk) | ||
988 | reg |= 1 << MXC_CCM_COSR_CLKOSEL_OFFSET; | ||
989 | else if (parent == &usb_pll_clk) | ||
990 | reg |= 2 << MXC_CCM_COSR_CLKOSEL_OFFSET; | ||
991 | else if (parent == mcu_main_clk.parent) | ||
992 | reg |= 3 << MXC_CCM_COSR_CLKOSEL_OFFSET; | ||
993 | else if (parent == &ahb_clk) | ||
994 | reg |= 5 << MXC_CCM_COSR_CLKOSEL_OFFSET; | ||
995 | else if (parent == &serial_pll_clk) | ||
996 | reg |= 7 << MXC_CCM_COSR_CLKOSEL_OFFSET; | ||
997 | else if (parent == &ckih_clk) | ||
998 | reg |= 8 << MXC_CCM_COSR_CLKOSEL_OFFSET; | ||
999 | else if (parent == &emi_clk) | ||
1000 | reg |= 9 << MXC_CCM_COSR_CLKOSEL_OFFSET; | ||
1001 | else if (parent == &ipu_clk) | ||
1002 | reg |= 0xA << MXC_CCM_COSR_CLKOSEL_OFFSET; | ||
1003 | else if (parent == &nfc_clk) | ||
1004 | reg |= 0xB << MXC_CCM_COSR_CLKOSEL_OFFSET; | ||
1005 | else if (parent == &uart_clk[0]) | ||
1006 | reg |= 0xC << MXC_CCM_COSR_CLKOSEL_OFFSET; | ||
1007 | else | ||
1008 | return -EINVAL; | ||
1009 | |||
1010 | __raw_writel(reg, MXC_CCM_COSR); | ||
1011 | |||
1012 | return 0; | ||
1013 | } | ||
1014 | |||
1015 | static int _clk_cko1_enable(struct clk *clk) | ||
1016 | { | ||
1017 | u32 reg; | ||
1018 | |||
1019 | reg = __raw_readl(MXC_CCM_COSR) | MXC_CCM_COSR_CLKOEN; | ||
1020 | __raw_writel(reg, MXC_CCM_COSR); | ||
1021 | 449 | ||
1022 | return 0; | 450 | #define DEFINE_CLOCK1(name, i, er, es, getsetround, s, p) \ |
1023 | } | 451 | static struct clk name = { \ |
452 | .id = i, \ | ||
453 | .enable_reg = er, \ | ||
454 | .enable_shift = es, \ | ||
455 | .get_rate = getsetround##_get_rate, \ | ||
456 | .set_rate = getsetround##_set_rate, \ | ||
457 | .round_rate = getsetround##_round_rate, \ | ||
458 | .enable = cgr_enable, \ | ||
459 | .disable = cgr_disable, \ | ||
460 | .secondary = s, \ | ||
461 | .parent = p, \ | ||
462 | } | ||
1024 | 463 | ||
1025 | static void _clk_cko1_disable(struct clk *clk) | 464 | DEFINE_CLOCK(perclk_clk, 0, NULL, 0, NULL, NULL, &ipg_clk); |
465 | |||
466 | DEFINE_CLOCK(sdhc1_clk, 0, MXC_CCM_CGR0, 0, NULL, NULL, &perclk_clk); | ||
467 | DEFINE_CLOCK(sdhc2_clk, 1, MXC_CCM_CGR0, 2, NULL, NULL, &perclk_clk); | ||
468 | DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CGR0, 4, NULL, NULL, &perclk_clk); | ||
469 | DEFINE_CLOCK(epit1_clk, 0, MXC_CCM_CGR0, 6, NULL, NULL, &perclk_clk); | ||
470 | DEFINE_CLOCK(epit2_clk, 1, MXC_CCM_CGR0, 8, NULL, NULL, &perclk_clk); | ||
471 | DEFINE_CLOCK(iim_clk, 0, MXC_CCM_CGR0, 10, NULL, NULL, &ipg_clk); | ||
472 | DEFINE_CLOCK(ata_clk, 0, MXC_CCM_CGR0, 12, NULL, NULL, &ipg_clk); | ||
473 | DEFINE_CLOCK(sdma_clk1, 0, MXC_CCM_CGR0, 14, NULL, &sdma_clk1, &ahb_clk); | ||
474 | DEFINE_CLOCK(cspi3_clk, 2, MXC_CCM_CGR0, 16, NULL, NULL, &ipg_clk); | ||
475 | DEFINE_CLOCK(rng_clk, 0, MXC_CCM_CGR0, 18, NULL, NULL, &ipg_clk); | ||
476 | DEFINE_CLOCK(uart1_clk, 0, MXC_CCM_CGR0, 20, NULL, NULL, &perclk_clk); | ||
477 | DEFINE_CLOCK(uart2_clk, 1, MXC_CCM_CGR0, 22, NULL, NULL, &perclk_clk); | ||
478 | DEFINE_CLOCK(ssi1_clk, 0, MXC_CCM_CGR0, 24, ssi1_get_rate, NULL, &serial_pll_clk); | ||
479 | DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CGR0, 26, NULL, NULL, &perclk_clk); | ||
480 | DEFINE_CLOCK(i2c2_clk, 1, MXC_CCM_CGR0, 28, NULL, NULL, &perclk_clk); | ||
481 | DEFINE_CLOCK(i2c3_clk, 2, MXC_CCM_CGR0, 30, NULL, NULL, &perclk_clk); | ||
482 | |||
483 | DEFINE_CLOCK(mpeg4_clk, 0, MXC_CCM_CGR1, 0, NULL, NULL, &ahb_clk); | ||
484 | DEFINE_CLOCK(mstick1_clk, 0, MXC_CCM_CGR1, 2, mstick1_get_rate, NULL, &usb_pll_clk); | ||
485 | DEFINE_CLOCK(mstick2_clk, 1, MXC_CCM_CGR1, 4, mstick2_get_rate, NULL, &usb_pll_clk); | ||
486 | DEFINE_CLOCK1(csi_clk, 0, MXC_CCM_CGR1, 6, csi, NULL, &ahb_clk); | ||
487 | DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ipg_clk); | ||
488 | DEFINE_CLOCK(wdog_clk, 0, MXC_CCM_CGR1, 10, NULL, NULL, &ipg_clk); | ||
489 | DEFINE_CLOCK(pwm_clk, 0, MXC_CCM_CGR1, 12, NULL, NULL, &perclk_clk); | ||
490 | DEFINE_CLOCK(usb_clk2, 0, MXC_CCM_CGR1, 18, usb_get_rate, NULL, &ahb_clk); | ||
491 | DEFINE_CLOCK(kpp_clk, 0, MXC_CCM_CGR1, 20, NULL, NULL, &ipg_clk); | ||
492 | DEFINE_CLOCK(ipu_clk, 0, MXC_CCM_CGR1, 22, hsp_get_rate, NULL, &mcu_main_clk); | ||
493 | DEFINE_CLOCK(uart3_clk, 2, MXC_CCM_CGR1, 24, NULL, NULL, &perclk_clk); | ||
494 | DEFINE_CLOCK(uart4_clk, 3, MXC_CCM_CGR1, 26, NULL, NULL, &perclk_clk); | ||
495 | DEFINE_CLOCK(uart5_clk, 4, MXC_CCM_CGR1, 28, NULL, NULL, &perclk_clk); | ||
496 | DEFINE_CLOCK(owire_clk, 0, MXC_CCM_CGR1, 30, NULL, NULL, &perclk_clk); | ||
497 | |||
498 | DEFINE_CLOCK(ssi2_clk, 1, MXC_CCM_CGR2, 0, ssi2_get_rate, NULL, &serial_pll_clk); | ||
499 | DEFINE_CLOCK(cspi1_clk, 0, MXC_CCM_CGR2, 2, NULL, NULL, &ipg_clk); | ||
500 | DEFINE_CLOCK(cspi2_clk, 1, MXC_CCM_CGR2, 4, NULL, NULL, &ipg_clk); | ||
501 | DEFINE_CLOCK(mbx_clk, 0, MXC_CCM_CGR2, 6, mbx_get_rate, NULL, &ahb_clk); | ||
502 | DEFINE_CLOCK(emi_clk, 0, MXC_CCM_CGR2, 8, NULL, NULL, &ahb_clk); | ||
503 | DEFINE_CLOCK(rtic_clk, 0, MXC_CCM_CGR2, 10, NULL, NULL, &ahb_clk); | ||
504 | DEFINE_CLOCK1(firi_clk, 0, MXC_CCM_CGR2, 12, firi, NULL, &usb_pll_clk); | ||
505 | |||
506 | DEFINE_CLOCK(sdma_clk2, 0, NULL, 0, NULL, NULL, &ipg_clk); | ||
507 | DEFINE_CLOCK(usb_clk1, 0, NULL, 0, usb_get_rate, NULL, &usb_pll_clk); | ||
508 | DEFINE_CLOCK(nfc_clk, 0, NULL, 0, nfc_get_rate, NULL, &ahb_clk); | ||
509 | DEFINE_CLOCK(scc_clk, 0, NULL, 0, NULL, NULL, &ipg_clk); | ||
510 | DEFINE_CLOCK(ipg_clk, 0, NULL, 0, ipg_get_rate, NULL, &ahb_clk); | ||
511 | |||
512 | #define _REGISTER_CLOCK(d, n, c) \ | ||
513 | { \ | ||
514 | .dev_id = d, \ | ||
515 | .con_id = n, \ | ||
516 | .clk = &c, \ | ||
517 | }, | ||
518 | |||
519 | static struct clk_lookup lookups[] __initdata = { | ||
520 | _REGISTER_CLOCK(NULL, "emi", emi_clk) | ||
521 | _REGISTER_CLOCK(NULL, "cspi", cspi1_clk) | ||
522 | _REGISTER_CLOCK(NULL, "cspi", cspi2_clk) | ||
523 | _REGISTER_CLOCK(NULL, "cspi", cspi3_clk) | ||
524 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) | ||
525 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) | ||
526 | _REGISTER_CLOCK(NULL, "wdog", wdog_clk) | ||
527 | _REGISTER_CLOCK(NULL, "rtc", rtc_clk) | ||
528 | _REGISTER_CLOCK(NULL, "epit", epit1_clk) | ||
529 | _REGISTER_CLOCK(NULL, "epit", epit2_clk) | ||
530 | _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) | ||
531 | _REGISTER_CLOCK("ipu-core", NULL, ipu_clk) | ||
532 | _REGISTER_CLOCK("mx3_sdc_fb", NULL, ipu_clk) | ||
533 | _REGISTER_CLOCK(NULL, "kpp", kpp_clk) | ||
534 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk1) | ||
535 | _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usb_clk2) | ||
536 | _REGISTER_CLOCK("mx3-camera.0", "csi", csi_clk) | ||
537 | _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) | ||
538 | _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) | ||
539 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) | ||
540 | _REGISTER_CLOCK("imx-uart.3", NULL, uart4_clk) | ||
541 | _REGISTER_CLOCK("imx-uart.4", NULL, uart5_clk) | ||
542 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) | ||
543 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) | ||
544 | _REGISTER_CLOCK("imx-i2c.2", NULL, i2c3_clk) | ||
545 | _REGISTER_CLOCK("mxc_w1.0", NULL, owire_clk) | ||
546 | _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk) | ||
547 | _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk) | ||
548 | _REGISTER_CLOCK(NULL, "ssi", ssi1_clk) | ||
549 | _REGISTER_CLOCK(NULL, "ssi", ssi2_clk) | ||
550 | _REGISTER_CLOCK(NULL, "firi", firi_clk) | ||
551 | _REGISTER_CLOCK(NULL, "ata", ata_clk) | ||
552 | _REGISTER_CLOCK(NULL, "rtic", rtic_clk) | ||
553 | _REGISTER_CLOCK(NULL, "rng", rng_clk) | ||
554 | _REGISTER_CLOCK(NULL, "sdma_ahb", sdma_clk1) | ||
555 | _REGISTER_CLOCK(NULL, "sdma_ipg", sdma_clk2) | ||
556 | _REGISTER_CLOCK(NULL, "mstick", mstick1_clk) | ||
557 | _REGISTER_CLOCK(NULL, "mstick", mstick2_clk) | ||
558 | _REGISTER_CLOCK(NULL, "scc", scc_clk) | ||
559 | _REGISTER_CLOCK(NULL, "iim", iim_clk) | ||
560 | _REGISTER_CLOCK(NULL, "mpeg4", mpeg4_clk) | ||
561 | _REGISTER_CLOCK(NULL, "mbx", mbx_clk) | ||
562 | }; | ||
563 | |||
564 | int __init mx31_clocks_init(unsigned long fref) | ||
1026 | { | 565 | { |
1027 | u32 reg; | 566 | u32 reg; |
567 | int i; | ||
1028 | 568 | ||
1029 | reg = __raw_readl(MXC_CCM_COSR) & ~MXC_CCM_COSR_CLKOEN; | 569 | mxc_set_cpu_type(MXC_CPU_MX31); |
1030 | __raw_writel(reg, MXC_CCM_COSR); | ||
1031 | } | ||
1032 | |||
1033 | static struct clk cko1_clk = { | ||
1034 | .name = "cko1_clk", | ||
1035 | .get_rate = _clk_cko1_get_rate, | ||
1036 | .set_rate = _clk_cko1_set_rate, | ||
1037 | .round_rate = _clk_cko1_round_rate, | ||
1038 | .set_parent = _clk_cko1_set_parent, | ||
1039 | .enable = _clk_cko1_enable, | ||
1040 | .disable = _clk_cko1_disable, | ||
1041 | }; | ||
1042 | |||
1043 | static struct clk *mxc_clks[] = { | ||
1044 | &ckih_clk, | ||
1045 | &ckil_clk, | ||
1046 | &mcu_pll_clk, | ||
1047 | &usb_pll_clk, | ||
1048 | &serial_pll_clk, | ||
1049 | &mcu_main_clk, | ||
1050 | &ahb_clk, | ||
1051 | &per_clk, | ||
1052 | &perclk_clk, | ||
1053 | &cko1_clk, | ||
1054 | &emi_clk, | ||
1055 | &cspi_clk[0], | ||
1056 | &cspi_clk[1], | ||
1057 | &cspi_clk[2], | ||
1058 | &ipg_clk, | ||
1059 | &gpt_clk, | ||
1060 | &pwm_clk, | ||
1061 | &wdog_clk, | ||
1062 | &rtc_clk, | ||
1063 | &epit_clk[0], | ||
1064 | &epit_clk[1], | ||
1065 | &nfc_clk, | ||
1066 | &ipu_clk, | ||
1067 | &kpp_clk, | ||
1068 | &usb_clk[0], | ||
1069 | &usb_clk[1], | ||
1070 | &csi_clk, | ||
1071 | &uart_clk[0], | ||
1072 | &uart_clk[1], | ||
1073 | &uart_clk[2], | ||
1074 | &uart_clk[3], | ||
1075 | &uart_clk[4], | ||
1076 | &i2c_clk[0], | ||
1077 | &i2c_clk[1], | ||
1078 | &i2c_clk[2], | ||
1079 | &owire_clk, | ||
1080 | &sdhc_clk[0], | ||
1081 | &sdhc_clk[1], | ||
1082 | &ssi_clk[0], | ||
1083 | &ssi_clk[1], | ||
1084 | &firi_clk, | ||
1085 | &ata_clk, | ||
1086 | &rtic_clk, | ||
1087 | &rng_clk, | ||
1088 | &sdma_clk[0], | ||
1089 | &sdma_clk[1], | ||
1090 | &mstick_clk[0], | ||
1091 | &mstick_clk[1], | ||
1092 | &scc_clk, | ||
1093 | &iim_clk, | ||
1094 | }; | ||
1095 | |||
1096 | int __init mxc_clocks_init(unsigned long fref) | ||
1097 | { | ||
1098 | u32 reg; | ||
1099 | struct clk **clkp; | ||
1100 | 570 | ||
1101 | ckih_rate = fref; | 571 | ckih_rate = fref; |
1102 | 572 | ||
1103 | for (clkp = mxc_clks; clkp < mxc_clks + ARRAY_SIZE(mxc_clks); clkp++) | 573 | for (i = 0; i < ARRAY_SIZE(lookups); i++) |
1104 | clk_register(*clkp); | 574 | clkdev_add(&lookups[i]); |
1105 | |||
1106 | if (cpu_is_mx31()) { | ||
1107 | clk_register(&mpeg4_clk); | ||
1108 | clk_register(&mbx_clk); | ||
1109 | } else { | ||
1110 | clk_register(&vpu_clk); | ||
1111 | clk_register(&vl2cc_clk); | ||
1112 | } | ||
1113 | 575 | ||
1114 | /* Turn off all possible clocks */ | 576 | /* Turn off all possible clocks */ |
1115 | __raw_writel(MXC_CCM_CGR0_GPT_MASK, MXC_CCM_CGR0); | 577 | __raw_writel((3 << 4), MXC_CCM_CGR0); |
1116 | __raw_writel(0, MXC_CCM_CGR1); | 578 | __raw_writel(0, MXC_CCM_CGR1); |
1117 | 579 | __raw_writel((3 << 8) | (3 << 14) | (3 << 16)| | |
1118 | __raw_writel(MXC_CCM_CGR2_EMI_MASK | | ||
1119 | MXC_CCM_CGR2_IPMUX1_MASK | | ||
1120 | MXC_CCM_CGR2_IPMUX2_MASK | | ||
1121 | MXC_CCM_CGR2_MXCCLKENSEL_MASK | /* for MX32 */ | ||
1122 | MXC_CCM_CGR2_CHIKCAMPEN_MASK | /* for MX32 */ | ||
1123 | MXC_CCM_CGR2_OVRVPUBUSY_MASK | /* for MX32 */ | ||
1124 | 1 << 27 | 1 << 28, /* Bit 27 and 28 are not defined for | 580 | 1 << 27 | 1 << 28, /* Bit 27 and 28 are not defined for |
1125 | MX32, but still required to be set */ | 581 | MX32, but still required to be set */ |
1126 | MXC_CCM_CGR2); | 582 | MXC_CCM_CGR2); |
1127 | 583 | ||
1128 | clk_disable(&cko1_clk); | 584 | usb_pll_disable(&usb_pll_clk); |
1129 | clk_disable(&usb_pll_clk); | ||
1130 | 585 | ||
1131 | pr_info("Clock input source is %ld\n", clk_get_rate(&ckih_clk)); | 586 | pr_info("Clock input source is %ld\n", clk_get_rate(&ckih_clk)); |
1132 | 587 | ||
@@ -1143,6 +598,8 @@ int __init mxc_clocks_init(unsigned long fref) | |||
1143 | __raw_writel(reg, MXC_CCM_PMCR1); | 598 | __raw_writel(reg, MXC_CCM_PMCR1); |
1144 | } | 599 | } |
1145 | 600 | ||
601 | mxc_timer_init(&ipg_clk); | ||
602 | |||
1146 | return 0; | 603 | return 0; |
1147 | } | 604 | } |
1148 | 605 | ||
diff --git a/arch/arm/mach-mx3/crm_regs.h b/arch/arm/mach-mx3/crm_regs.h index 4a0e0ede23bb..adfa3627ad84 100644 --- a/arch/arm/mach-mx3/crm_regs.h +++ b/arch/arm/mach-mx3/crm_regs.h | |||
@@ -91,47 +91,6 @@ | |||
91 | #define MXC_CCM_PDR0_MCU_PODF_OFFSET 0 | 91 | #define MXC_CCM_PDR0_MCU_PODF_OFFSET 0 |
92 | #define MXC_CCM_PDR0_MCU_PODF_MASK 0x7 | 92 | #define MXC_CCM_PDR0_MCU_PODF_MASK 0x7 |
93 | 93 | ||
94 | #define MXC_CCM_PDR0_HSP_DIV_1 (0x0 << 11) | ||
95 | #define MXC_CCM_PDR0_HSP_DIV_2 (0x1 << 11) | ||
96 | #define MXC_CCM_PDR0_HSP_DIV_3 (0x2 << 11) | ||
97 | #define MXC_CCM_PDR0_HSP_DIV_4 (0x3 << 11) | ||
98 | #define MXC_CCM_PDR0_HSP_DIV_5 (0x4 << 11) | ||
99 | #define MXC_CCM_PDR0_HSP_DIV_6 (0x5 << 11) | ||
100 | #define MXC_CCM_PDR0_HSP_DIV_7 (0x6 << 11) | ||
101 | #define MXC_CCM_PDR0_HSP_DIV_8 (0x7 << 11) | ||
102 | |||
103 | #define MXC_CCM_PDR0_IPG_DIV_1 (0x0 << 6) | ||
104 | #define MXC_CCM_PDR0_IPG_DIV_2 (0x1 << 6) | ||
105 | #define MXC_CCM_PDR0_IPG_DIV_3 (0x2 << 6) | ||
106 | #define MXC_CCM_PDR0_IPG_DIV_4 (0x3 << 6) | ||
107 | |||
108 | #define MXC_CCM_PDR0_MAX_DIV_1 (0x0 << 3) | ||
109 | #define MXC_CCM_PDR0_MAX_DIV_2 (0x1 << 3) | ||
110 | #define MXC_CCM_PDR0_MAX_DIV_3 (0x2 << 3) | ||
111 | #define MXC_CCM_PDR0_MAX_DIV_4 (0x3 << 3) | ||
112 | #define MXC_CCM_PDR0_MAX_DIV_5 (0x4 << 3) | ||
113 | #define MXC_CCM_PDR0_MAX_DIV_6 (0x5 << 3) | ||
114 | #define MXC_CCM_PDR0_MAX_DIV_7 (0x6 << 3) | ||
115 | #define MXC_CCM_PDR0_MAX_DIV_8 (0x7 << 3) | ||
116 | |||
117 | #define MXC_CCM_PDR0_NFC_DIV_1 (0x0 << 8) | ||
118 | #define MXC_CCM_PDR0_NFC_DIV_2 (0x1 << 8) | ||
119 | #define MXC_CCM_PDR0_NFC_DIV_3 (0x2 << 8) | ||
120 | #define MXC_CCM_PDR0_NFC_DIV_4 (0x3 << 8) | ||
121 | #define MXC_CCM_PDR0_NFC_DIV_5 (0x4 << 8) | ||
122 | #define MXC_CCM_PDR0_NFC_DIV_6 (0x5 << 8) | ||
123 | #define MXC_CCM_PDR0_NFC_DIV_7 (0x6 << 8) | ||
124 | #define MXC_CCM_PDR0_NFC_DIV_8 (0x7 << 8) | ||
125 | |||
126 | #define MXC_CCM_PDR0_MCU_DIV_1 0x0 | ||
127 | #define MXC_CCM_PDR0_MCU_DIV_2 0x1 | ||
128 | #define MXC_CCM_PDR0_MCU_DIV_3 0x2 | ||
129 | #define MXC_CCM_PDR0_MCU_DIV_4 0x3 | ||
130 | #define MXC_CCM_PDR0_MCU_DIV_5 0x4 | ||
131 | #define MXC_CCM_PDR0_MCU_DIV_6 0x5 | ||
132 | #define MXC_CCM_PDR0_MCU_DIV_7 0x6 | ||
133 | #define MXC_CCM_PDR0_MCU_DIV_8 0x7 | ||
134 | |||
135 | #define MXC_CCM_PDR1_USB_PRDF_OFFSET 30 | 94 | #define MXC_CCM_PDR1_USB_PRDF_OFFSET 30 |
136 | #define MXC_CCM_PDR1_USB_PRDF_MASK (0x3 << 30) | 95 | #define MXC_CCM_PDR1_USB_PRDF_MASK (0x3 << 30) |
137 | #define MXC_CCM_PDR1_USB_PODF_OFFSET 27 | 96 | #define MXC_CCM_PDR1_USB_PODF_OFFSET 27 |
@@ -152,118 +111,6 @@ | |||
152 | /* Bit definitions for RCSR */ | 111 | /* Bit definitions for RCSR */ |
153 | #define MXC_CCM_RCSR_NF16B 0x80000000 | 112 | #define MXC_CCM_RCSR_NF16B 0x80000000 |
154 | 113 | ||
155 | /* Bit definitions for both MCU, USB and SR PLL control registers */ | ||
156 | #define MXC_CCM_PCTL_BRM 0x80000000 | ||
157 | #define MXC_CCM_PCTL_PD_OFFSET 26 | ||
158 | #define MXC_CCM_PCTL_PD_MASK (0xF << 26) | ||
159 | #define MXC_CCM_PCTL_MFD_OFFSET 16 | ||
160 | #define MXC_CCM_PCTL_MFD_MASK (0x3FF << 16) | ||
161 | #define MXC_CCM_PCTL_MFI_OFFSET 10 | ||
162 | #define MXC_CCM_PCTL_MFI_MASK (0xF << 10) | ||
163 | #define MXC_CCM_PCTL_MFN_OFFSET 0 | ||
164 | #define MXC_CCM_PCTL_MFN_MASK 0x3FF | ||
165 | |||
166 | #define MXC_CCM_CGR0_SD_MMC1_OFFSET 0 | ||
167 | #define MXC_CCM_CGR0_SD_MMC1_MASK (0x3 << 0) | ||
168 | #define MXC_CCM_CGR0_SD_MMC2_OFFSET 2 | ||
169 | #define MXC_CCM_CGR0_SD_MMC2_MASK (0x3 << 2) | ||
170 | #define MXC_CCM_CGR0_GPT_OFFSET 4 | ||
171 | #define MXC_CCM_CGR0_GPT_MASK (0x3 << 4) | ||
172 | #define MXC_CCM_CGR0_EPIT1_OFFSET 6 | ||
173 | #define MXC_CCM_CGR0_EPIT1_MASK (0x3 << 6) | ||
174 | #define MXC_CCM_CGR0_EPIT2_OFFSET 8 | ||
175 | #define MXC_CCM_CGR0_EPIT2_MASK (0x3 << 8) | ||
176 | #define MXC_CCM_CGR0_IIM_OFFSET 10 | ||
177 | #define MXC_CCM_CGR0_IIM_MASK (0x3 << 10) | ||
178 | #define MXC_CCM_CGR0_ATA_OFFSET 12 | ||
179 | #define MXC_CCM_CGR0_ATA_MASK (0x3 << 12) | ||
180 | #define MXC_CCM_CGR0_SDMA_OFFSET 14 | ||
181 | #define MXC_CCM_CGR0_SDMA_MASK (0x3 << 14) | ||
182 | #define MXC_CCM_CGR0_CSPI3_OFFSET 16 | ||
183 | #define MXC_CCM_CGR0_CSPI3_MASK (0x3 << 16) | ||
184 | #define MXC_CCM_CGR0_RNG_OFFSET 18 | ||
185 | #define MXC_CCM_CGR0_RNG_MASK (0x3 << 18) | ||
186 | #define MXC_CCM_CGR0_UART1_OFFSET 20 | ||
187 | #define MXC_CCM_CGR0_UART1_MASK (0x3 << 20) | ||
188 | #define MXC_CCM_CGR0_UART2_OFFSET 22 | ||
189 | #define MXC_CCM_CGR0_UART2_MASK (0x3 << 22) | ||
190 | #define MXC_CCM_CGR0_SSI1_OFFSET 24 | ||
191 | #define MXC_CCM_CGR0_SSI1_MASK (0x3 << 24) | ||
192 | #define MXC_CCM_CGR0_I2C1_OFFSET 26 | ||
193 | #define MXC_CCM_CGR0_I2C1_MASK (0x3 << 26) | ||
194 | #define MXC_CCM_CGR0_I2C2_OFFSET 28 | ||
195 | #define MXC_CCM_CGR0_I2C2_MASK (0x3 << 28) | ||
196 | #define MXC_CCM_CGR0_I2C3_OFFSET 30 | ||
197 | #define MXC_CCM_CGR0_I2C3_MASK (0x3 << 30) | ||
198 | |||
199 | #define MXC_CCM_CGR1_HANTRO_OFFSET 0 | ||
200 | #define MXC_CCM_CGR1_HANTRO_MASK (0x3 << 0) | ||
201 | #define MXC_CCM_CGR1_MEMSTICK1_OFFSET 2 | ||
202 | #define MXC_CCM_CGR1_MEMSTICK1_MASK (0x3 << 2) | ||
203 | #define MXC_CCM_CGR1_MEMSTICK2_OFFSET 4 | ||
204 | #define MXC_CCM_CGR1_MEMSTICK2_MASK (0x3 << 4) | ||
205 | #define MXC_CCM_CGR1_CSI_OFFSET 6 | ||
206 | #define MXC_CCM_CGR1_CSI_MASK (0x3 << 6) | ||
207 | #define MXC_CCM_CGR1_RTC_OFFSET 8 | ||
208 | #define MXC_CCM_CGR1_RTC_MASK (0x3 << 8) | ||
209 | #define MXC_CCM_CGR1_WDOG_OFFSET 10 | ||
210 | #define MXC_CCM_CGR1_WDOG_MASK (0x3 << 10) | ||
211 | #define MXC_CCM_CGR1_PWM_OFFSET 12 | ||
212 | #define MXC_CCM_CGR1_PWM_MASK (0x3 << 12) | ||
213 | #define MXC_CCM_CGR1_SIM_OFFSET 14 | ||
214 | #define MXC_CCM_CGR1_SIM_MASK (0x3 << 14) | ||
215 | #define MXC_CCM_CGR1_ECT_OFFSET 16 | ||
216 | #define MXC_CCM_CGR1_ECT_MASK (0x3 << 16) | ||
217 | #define MXC_CCM_CGR1_USBOTG_OFFSET 18 | ||
218 | #define MXC_CCM_CGR1_USBOTG_MASK (0x3 << 18) | ||
219 | #define MXC_CCM_CGR1_KPP_OFFSET 20 | ||
220 | #define MXC_CCM_CGR1_KPP_MASK (0x3 << 20) | ||
221 | #define MXC_CCM_CGR1_IPU_OFFSET 22 | ||
222 | #define MXC_CCM_CGR1_IPU_MASK (0x3 << 22) | ||
223 | #define MXC_CCM_CGR1_UART3_OFFSET 24 | ||
224 | #define MXC_CCM_CGR1_UART3_MASK (0x3 << 24) | ||
225 | #define MXC_CCM_CGR1_UART4_OFFSET 26 | ||
226 | #define MXC_CCM_CGR1_UART4_MASK (0x3 << 26) | ||
227 | #define MXC_CCM_CGR1_UART5_OFFSET 28 | ||
228 | #define MXC_CCM_CGR1_UART5_MASK (0x3 << 28) | ||
229 | #define MXC_CCM_CGR1_OWIRE_OFFSET 30 | ||
230 | #define MXC_CCM_CGR1_OWIRE_MASK (0x3 << 30) | ||
231 | |||
232 | #define MXC_CCM_CGR2_SSI2_OFFSET 0 | ||
233 | #define MXC_CCM_CGR2_SSI2_MASK (0x3 << 0) | ||
234 | #define MXC_CCM_CGR2_CSPI1_OFFSET 2 | ||
235 | #define MXC_CCM_CGR2_CSPI1_MASK (0x3 << 2) | ||
236 | #define MXC_CCM_CGR2_CSPI2_OFFSET 4 | ||
237 | #define MXC_CCM_CGR2_CSPI2_MASK (0x3 << 4) | ||
238 | #define MXC_CCM_CGR2_GACC_OFFSET 6 | ||
239 | #define MXC_CCM_CGR2_GACC_MASK (0x3 << 6) | ||
240 | #define MXC_CCM_CGR2_EMI_OFFSET 8 | ||
241 | #define MXC_CCM_CGR2_EMI_MASK (0x3 << 8) | ||
242 | #define MXC_CCM_CGR2_RTIC_OFFSET 10 | ||
243 | #define MXC_CCM_CGR2_RTIC_MASK (0x3 << 10) | ||
244 | #define MXC_CCM_CGR2_FIRI_OFFSET 12 | ||
245 | #define MXC_CCM_CGR2_FIRI_MASK (0x3 << 12) | ||
246 | #define MXC_CCM_CGR2_IPMUX1_OFFSET 14 | ||
247 | #define MXC_CCM_CGR2_IPMUX1_MASK (0x3 << 14) | ||
248 | #define MXC_CCM_CGR2_IPMUX2_OFFSET 16 | ||
249 | #define MXC_CCM_CGR2_IPMUX2_MASK (0x3 << 16) | ||
250 | |||
251 | /* These new CGR2 bits are added in MX32 */ | ||
252 | #define MXC_CCM_CGR2_APMSYSCLKSEL_OFFSET 18 | ||
253 | #define MXC_CCM_CGR2_APMSYSCLKSEL_MASK (0x3 << 18) | ||
254 | #define MXC_CCM_CGR2_APMSSICLKSEL_OFFSET 20 | ||
255 | #define MXC_CCM_CGR2_APMSSICLKSEL_MASK (0x3 << 20) | ||
256 | #define MXC_CCM_CGR2_APMPERCLKSEL_OFFSET 22 | ||
257 | #define MXC_CCM_CGR2_APMPERCLKSEL_MASK (0x3 << 22) | ||
258 | #define MXC_CCM_CGR2_MXCCLKENSEL_OFFSET 24 | ||
259 | #define MXC_CCM_CGR2_MXCCLKENSEL_MASK (0x1 << 24) | ||
260 | #define MXC_CCM_CGR2_CHIKCAMPEN_OFFSET 25 | ||
261 | #define MXC_CCM_CGR2_CHIKCAMPEN_MASK (0x1 << 25) | ||
262 | #define MXC_CCM_CGR2_OVRVPUBUSY_OFFSET 26 | ||
263 | #define MXC_CCM_CGR2_OVRVPUBUSY_MASK (0x1 << 26) | ||
264 | #define MXC_CCM_CGR2_APMENA_OFFSET 30 | ||
265 | #define MXC_CCM_CGR2_AOMENA_MASK (0x1 << 30) | ||
266 | |||
267 | /* | 114 | /* |
268 | * LTR0 register offsets | 115 | * LTR0 register offsets |
269 | */ | 116 | */ |
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c index f8428800f286..380be0c9b213 100644 --- a/arch/arm/mach-mx3/devices.c +++ b/arch/arm/mach-mx3/devices.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <mach/irqs.h> | 25 | #include <mach/irqs.h> |
26 | #include <mach/imx-uart.h> | 26 | #include <mach/imx-uart.h> |
27 | 27 | ||
28 | #include "devices.h" | ||
29 | |||
28 | static struct resource uart0[] = { | 30 | static struct resource uart0[] = { |
29 | { | 31 | { |
30 | .start = UART1_BASE_ADDR, | 32 | .start = UART1_BASE_ADDR, |
@@ -82,6 +84,7 @@ struct platform_device mxc_uart_device2 = { | |||
82 | .num_resources = ARRAY_SIZE(uart2), | 84 | .num_resources = ARRAY_SIZE(uart2), |
83 | }; | 85 | }; |
84 | 86 | ||
87 | #ifdef CONFIG_ARCH_MX31 | ||
85 | static struct resource uart3[] = { | 88 | static struct resource uart3[] = { |
86 | { | 89 | { |
87 | .start = UART4_BASE_ADDR, | 90 | .start = UART4_BASE_ADDR, |
@@ -119,6 +122,7 @@ struct platform_device mxc_uart_device4 = { | |||
119 | .resource = uart4, | 122 | .resource = uart4, |
120 | .num_resources = ARRAY_SIZE(uart4), | 123 | .num_resources = ARRAY_SIZE(uart4), |
121 | }; | 124 | }; |
125 | #endif /* CONFIG_ARCH_MX31 */ | ||
122 | 126 | ||
123 | /* GPIO port description */ | 127 | /* GPIO port description */ |
124 | static struct mxc_gpio_port imx_gpio_ports[] = { | 128 | static struct mxc_gpio_port imx_gpio_ports[] = { |
@@ -164,8 +168,8 @@ struct platform_device mxc_w1_master_device = { | |||
164 | 168 | ||
165 | static struct resource mxc_nand_resources[] = { | 169 | static struct resource mxc_nand_resources[] = { |
166 | { | 170 | { |
167 | .start = NFC_BASE_ADDR, | 171 | .start = 0, /* runtime dependent */ |
168 | .end = NFC_BASE_ADDR + 0xfff, | 172 | .end = 0, |
169 | .flags = IORESOURCE_MEM | 173 | .flags = IORESOURCE_MEM |
170 | }, { | 174 | }, { |
171 | .start = MXC_INT_NANDFC, | 175 | .start = MXC_INT_NANDFC, |
@@ -180,3 +184,188 @@ struct platform_device mxc_nand_device = { | |||
180 | .num_resources = ARRAY_SIZE(mxc_nand_resources), | 184 | .num_resources = ARRAY_SIZE(mxc_nand_resources), |
181 | .resource = mxc_nand_resources, | 185 | .resource = mxc_nand_resources, |
182 | }; | 186 | }; |
187 | |||
188 | static struct resource mxc_i2c0_resources[] = { | ||
189 | { | ||
190 | .start = I2C_BASE_ADDR, | ||
191 | .end = I2C_BASE_ADDR + SZ_4K - 1, | ||
192 | .flags = IORESOURCE_MEM, | ||
193 | }, | ||
194 | { | ||
195 | .start = MXC_INT_I2C, | ||
196 | .end = MXC_INT_I2C, | ||
197 | .flags = IORESOURCE_IRQ, | ||
198 | }, | ||
199 | }; | ||
200 | |||
201 | struct platform_device mxc_i2c_device0 = { | ||
202 | .name = "imx-i2c", | ||
203 | .id = 0, | ||
204 | .num_resources = ARRAY_SIZE(mxc_i2c0_resources), | ||
205 | .resource = mxc_i2c0_resources, | ||
206 | }; | ||
207 | |||
208 | static struct resource mxc_i2c1_resources[] = { | ||
209 | { | ||
210 | .start = I2C2_BASE_ADDR, | ||
211 | .end = I2C2_BASE_ADDR + SZ_4K - 1, | ||
212 | .flags = IORESOURCE_MEM, | ||
213 | }, | ||
214 | { | ||
215 | .start = MXC_INT_I2C2, | ||
216 | .end = MXC_INT_I2C2, | ||
217 | .flags = IORESOURCE_IRQ, | ||
218 | }, | ||
219 | }; | ||
220 | |||
221 | struct platform_device mxc_i2c_device1 = { | ||
222 | .name = "imx-i2c", | ||
223 | .id = 1, | ||
224 | .num_resources = ARRAY_SIZE(mxc_i2c1_resources), | ||
225 | .resource = mxc_i2c1_resources, | ||
226 | }; | ||
227 | |||
228 | static struct resource mxc_i2c2_resources[] = { | ||
229 | { | ||
230 | .start = I2C3_BASE_ADDR, | ||
231 | .end = I2C3_BASE_ADDR + SZ_4K - 1, | ||
232 | .flags = IORESOURCE_MEM, | ||
233 | }, | ||
234 | { | ||
235 | .start = MXC_INT_I2C3, | ||
236 | .end = MXC_INT_I2C3, | ||
237 | .flags = IORESOURCE_IRQ, | ||
238 | }, | ||
239 | }; | ||
240 | |||
241 | struct platform_device mxc_i2c_device2 = { | ||
242 | .name = "imx-i2c", | ||
243 | .id = 2, | ||
244 | .num_resources = ARRAY_SIZE(mxc_i2c2_resources), | ||
245 | .resource = mxc_i2c2_resources, | ||
246 | }; | ||
247 | |||
248 | #ifdef CONFIG_ARCH_MX31 | ||
249 | static struct resource mxcsdhc0_resources[] = { | ||
250 | { | ||
251 | .start = MMC_SDHC1_BASE_ADDR, | ||
252 | .end = MMC_SDHC1_BASE_ADDR + SZ_16K - 1, | ||
253 | .flags = IORESOURCE_MEM, | ||
254 | }, { | ||
255 | .start = MXC_INT_MMC_SDHC1, | ||
256 | .end = MXC_INT_MMC_SDHC1, | ||
257 | .flags = IORESOURCE_IRQ, | ||
258 | }, | ||
259 | }; | ||
260 | |||
261 | static struct resource mxcsdhc1_resources[] = { | ||
262 | { | ||
263 | .start = MMC_SDHC2_BASE_ADDR, | ||
264 | .end = MMC_SDHC2_BASE_ADDR + SZ_16K - 1, | ||
265 | .flags = IORESOURCE_MEM, | ||
266 | }, { | ||
267 | .start = MXC_INT_MMC_SDHC2, | ||
268 | .end = MXC_INT_MMC_SDHC2, | ||
269 | .flags = IORESOURCE_IRQ, | ||
270 | }, | ||
271 | }; | ||
272 | |||
273 | struct platform_device mxcsdhc_device0 = { | ||
274 | .name = "mxc-mmc", | ||
275 | .id = 0, | ||
276 | .num_resources = ARRAY_SIZE(mxcsdhc0_resources), | ||
277 | .resource = mxcsdhc0_resources, | ||
278 | }; | ||
279 | |||
280 | struct platform_device mxcsdhc_device1 = { | ||
281 | .name = "mxc-mmc", | ||
282 | .id = 1, | ||
283 | .num_resources = ARRAY_SIZE(mxcsdhc1_resources), | ||
284 | .resource = mxcsdhc1_resources, | ||
285 | }; | ||
286 | #endif /* CONFIG_ARCH_MX31 */ | ||
287 | |||
288 | /* i.MX31 Image Processing Unit */ | ||
289 | |||
290 | /* The resource order is important! */ | ||
291 | static struct resource mx3_ipu_rsrc[] = { | ||
292 | { | ||
293 | .start = IPU_CTRL_BASE_ADDR, | ||
294 | .end = IPU_CTRL_BASE_ADDR + 0x5F, | ||
295 | .flags = IORESOURCE_MEM, | ||
296 | }, { | ||
297 | .start = IPU_CTRL_BASE_ADDR + 0x88, | ||
298 | .end = IPU_CTRL_BASE_ADDR + 0xB3, | ||
299 | .flags = IORESOURCE_MEM, | ||
300 | }, { | ||
301 | .start = MXC_INT_IPU_SYN, | ||
302 | .end = MXC_INT_IPU_SYN, | ||
303 | .flags = IORESOURCE_IRQ, | ||
304 | }, { | ||
305 | .start = MXC_INT_IPU_ERR, | ||
306 | .end = MXC_INT_IPU_ERR, | ||
307 | .flags = IORESOURCE_IRQ, | ||
308 | }, | ||
309 | }; | ||
310 | |||
311 | struct platform_device mx3_ipu = { | ||
312 | .name = "ipu-core", | ||
313 | .id = -1, | ||
314 | .num_resources = ARRAY_SIZE(mx3_ipu_rsrc), | ||
315 | .resource = mx3_ipu_rsrc, | ||
316 | }; | ||
317 | |||
318 | static struct resource fb_resources[] = { | ||
319 | { | ||
320 | .start = IPU_CTRL_BASE_ADDR + 0xB4, | ||
321 | .end = IPU_CTRL_BASE_ADDR + 0x1BF, | ||
322 | .flags = IORESOURCE_MEM, | ||
323 | }, | ||
324 | }; | ||
325 | |||
326 | struct platform_device mx3_fb = { | ||
327 | .name = "mx3_sdc_fb", | ||
328 | .id = -1, | ||
329 | .num_resources = ARRAY_SIZE(fb_resources), | ||
330 | .resource = fb_resources, | ||
331 | .dev = { | ||
332 | .coherent_dma_mask = 0xffffffff, | ||
333 | }, | ||
334 | }; | ||
335 | |||
336 | #ifdef CONFIG_ARCH_MX35 | ||
337 | static struct resource mxc_fec_resources[] = { | ||
338 | { | ||
339 | .start = MXC_FEC_BASE_ADDR, | ||
340 | .end = MXC_FEC_BASE_ADDR + 0xfff, | ||
341 | .flags = IORESOURCE_MEM | ||
342 | }, { | ||
343 | .start = MXC_INT_FEC, | ||
344 | .end = MXC_INT_FEC, | ||
345 | .flags = IORESOURCE_IRQ | ||
346 | }, | ||
347 | }; | ||
348 | |||
349 | struct platform_device mxc_fec_device = { | ||
350 | .name = "fec", | ||
351 | .id = 0, | ||
352 | .num_resources = ARRAY_SIZE(mxc_fec_resources), | ||
353 | .resource = mxc_fec_resources, | ||
354 | }; | ||
355 | #endif | ||
356 | |||
357 | static int mx3_devices_init(void) | ||
358 | { | ||
359 | if (cpu_is_mx31()) { | ||
360 | mxc_nand_resources[0].start = MX31_NFC_BASE_ADDR; | ||
361 | mxc_nand_resources[0].end = MX31_NFC_BASE_ADDR + 0xfff; | ||
362 | } | ||
363 | if (cpu_is_mx35()) { | ||
364 | mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR; | ||
365 | mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0xfff; | ||
366 | } | ||
367 | |||
368 | return 0; | ||
369 | } | ||
370 | |||
371 | subsys_initcall(mx3_devices_init); | ||
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h index 9949ef4e0694..88c04b296fab 100644 --- a/arch/arm/mach-mx3/devices.h +++ b/arch/arm/mach-mx3/devices.h | |||
@@ -6,3 +6,11 @@ extern struct platform_device mxc_uart_device3; | |||
6 | extern struct platform_device mxc_uart_device4; | 6 | extern struct platform_device mxc_uart_device4; |
7 | extern struct platform_device mxc_w1_master_device; | 7 | extern struct platform_device mxc_w1_master_device; |
8 | extern struct platform_device mxc_nand_device; | 8 | extern struct platform_device mxc_nand_device; |
9 | extern struct platform_device mxc_i2c_device0; | ||
10 | extern struct platform_device mxc_i2c_device1; | ||
11 | extern struct platform_device mxc_i2c_device2; | ||
12 | extern struct platform_device mx3_ipu; | ||
13 | extern struct platform_device mx3_fb; | ||
14 | extern struct platform_device mxc_fec_device; | ||
15 | extern struct platform_device mxcsdhc_device0; | ||
16 | extern struct platform_device mxcsdhc_device1; | ||
diff --git a/arch/arm/mach-mx3/iomux.c b/arch/arm/mach-mx3/iomux.c index 7a5088b519a8..40ffc5a664d9 100644 --- a/arch/arm/mach-mx3/iomux.c +++ b/arch/arm/mach-mx3/iomux.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved. | 2 | * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved. |
3 | * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> | 3 | * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> |
4 | * Copyright (C) 2009 by Valentin Longchamp <valentin.longchamp@epfl.ch> | ||
4 | * | 5 | * |
5 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License | 7 | * modify it under the terms of the GNU General Public License |
@@ -21,6 +22,7 @@ | |||
21 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
22 | #include <linux/io.h> | 23 | #include <linux/io.h> |
23 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/kernel.h> | ||
24 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
25 | #include <mach/gpio.h> | 27 | #include <mach/gpio.h> |
26 | #include <mach/iomux-mx3.h> | 28 | #include <mach/iomux-mx3.h> |
@@ -38,6 +40,8 @@ | |||
38 | static DEFINE_SPINLOCK(gpio_mux_lock); | 40 | static DEFINE_SPINLOCK(gpio_mux_lock); |
39 | 41 | ||
40 | #define IOMUX_REG_MASK (IOMUX_PADNUM_MASK & ~0x3) | 42 | #define IOMUX_REG_MASK (IOMUX_PADNUM_MASK & ~0x3) |
43 | |||
44 | unsigned long mxc_pin_alloc_map[NB_PORTS * 32 / BITS_PER_LONG]; | ||
41 | /* | 45 | /* |
42 | * set the mode for a IOMUX pin. | 46 | * set the mode for a IOMUX pin. |
43 | */ | 47 | */ |
@@ -50,9 +54,6 @@ int mxc_iomux_mode(unsigned int pin_mode) | |||
50 | field = pin_mode & 0x3; | 54 | field = pin_mode & 0x3; |
51 | mode = (pin_mode & IOMUX_MODE_MASK) >> IOMUX_MODE_SHIFT; | 55 | mode = (pin_mode & IOMUX_MODE_MASK) >> IOMUX_MODE_SHIFT; |
52 | 56 | ||
53 | pr_debug("%s: reg offset = 0x%x field = %d mode = 0x%02x\n", | ||
54 | __func__, (pin_mode & IOMUX_REG_MASK), field, mode); | ||
55 | |||
56 | spin_lock(&gpio_mux_lock); | 57 | spin_lock(&gpio_mux_lock); |
57 | 58 | ||
58 | l = __raw_readl(reg); | 59 | l = __raw_readl(reg); |
@@ -93,6 +94,86 @@ void mxc_iomux_set_pad(enum iomux_pins pin, u32 config) | |||
93 | EXPORT_SYMBOL(mxc_iomux_set_pad); | 94 | EXPORT_SYMBOL(mxc_iomux_set_pad); |
94 | 95 | ||
95 | /* | 96 | /* |
97 | * setups a single pin: | ||
98 | * - reserves the pin so that it is not claimed by another driver | ||
99 | * - setups the iomux according to the configuration | ||
100 | * - if the pin is configured as a GPIO, we claim it through kernel gpiolib | ||
101 | */ | ||
102 | int mxc_iomux_setup_pin(const unsigned int pin, const char *label) | ||
103 | { | ||
104 | unsigned pad = pin & IOMUX_PADNUM_MASK; | ||
105 | unsigned gpio; | ||
106 | |||
107 | if (pad >= (PIN_MAX + 1)) { | ||
108 | printk(KERN_ERR "mxc_iomux: Attempt to request nonexistant pin %u for \"%s\"\n", | ||
109 | pad, label ? label : "?"); | ||
110 | return -EINVAL; | ||
111 | } | ||
112 | |||
113 | if (test_and_set_bit(pad, mxc_pin_alloc_map)) { | ||
114 | printk(KERN_ERR "mxc_iomux: pin %u already used. Allocation for \"%s\" failed\n", | ||
115 | pad, label ? label : "?"); | ||
116 | return -EINVAL; | ||
117 | } | ||
118 | mxc_iomux_mode(pin); | ||
119 | |||
120 | /* if we have a gpio, we can allocate it */ | ||
121 | gpio = (pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT; | ||
122 | if (gpio < (GPIO_PORT_MAX + 1) * 32) | ||
123 | if (gpio_request(gpio, label)) | ||
124 | return -EINVAL; | ||
125 | |||
126 | return 0; | ||
127 | } | ||
128 | EXPORT_SYMBOL(mxc_iomux_setup_pin); | ||
129 | |||
130 | int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count, | ||
131 | const char *label) | ||
132 | { | ||
133 | unsigned int *p = pin_list; | ||
134 | int i; | ||
135 | int ret = -EINVAL; | ||
136 | |||
137 | for (i = 0; i < count; i++) { | ||
138 | if (mxc_iomux_setup_pin(*p, label)) | ||
139 | goto setup_error; | ||
140 | p++; | ||
141 | } | ||
142 | return 0; | ||
143 | |||
144 | setup_error: | ||
145 | mxc_iomux_release_multiple_pins(pin_list, i); | ||
146 | return ret; | ||
147 | } | ||
148 | EXPORT_SYMBOL(mxc_iomux_setup_multiple_pins); | ||
149 | |||
150 | void mxc_iomux_release_pin(const unsigned int pin) | ||
151 | { | ||
152 | unsigned pad = pin & IOMUX_PADNUM_MASK; | ||
153 | unsigned gpio; | ||
154 | |||
155 | if (pad < (PIN_MAX + 1)) | ||
156 | clear_bit(pad, mxc_pin_alloc_map); | ||
157 | |||
158 | gpio = (pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT; | ||
159 | if (gpio < (GPIO_PORT_MAX + 1) * 32) | ||
160 | gpio_free(gpio); | ||
161 | } | ||
162 | EXPORT_SYMBOL(mxc_iomux_release_pin); | ||
163 | |||
164 | void mxc_iomux_release_multiple_pins(unsigned int *pin_list, int count) | ||
165 | { | ||
166 | unsigned int *p = pin_list; | ||
167 | int i; | ||
168 | |||
169 | for (i = 0; i < count; i++) { | ||
170 | mxc_iomux_release_pin(*p); | ||
171 | p++; | ||
172 | } | ||
173 | } | ||
174 | EXPORT_SYMBOL(mxc_iomux_release_multiple_pins); | ||
175 | |||
176 | /* | ||
96 | * This function enables/disables the general purpose function for a particular | 177 | * This function enables/disables the general purpose function for a particular |
97 | * signal. | 178 | * signal. |
98 | */ | 179 | */ |
@@ -111,4 +192,3 @@ void mxc_iomux_set_gpr(enum iomux_gp_func gp, bool en) | |||
111 | spin_unlock(&gpio_mux_lock); | 192 | spin_unlock(&gpio_mux_lock); |
112 | } | 193 | } |
113 | EXPORT_SYMBOL(mxc_iomux_set_gpr); | 194 | EXPORT_SYMBOL(mxc_iomux_set_gpr); |
114 | |||
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c index 0589b5cd33c7..9e1459cb4b74 100644 --- a/arch/arm/mach-mx3/mm.c +++ b/arch/arm/mach-mx3/mm.c | |||
@@ -22,10 +22,14 @@ | |||
22 | 22 | ||
23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <mach/hardware.h> | 25 | #include <linux/err.h> |
26 | |||
26 | #include <asm/pgtable.h> | 27 | #include <asm/pgtable.h> |
27 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
29 | #include <asm/hardware/cache-l2x0.h> | ||
30 | |||
28 | #include <mach/common.h> | 31 | #include <mach/common.h> |
32 | #include <mach/hardware.h> | ||
29 | 33 | ||
30 | /*! | 34 | /*! |
31 | * @file mm.c | 35 | * @file mm.c |
@@ -50,6 +54,16 @@ static struct map_desc mxc_io_desc[] __initdata = { | |||
50 | .pfn = __phys_to_pfn(AVIC_BASE_ADDR), | 54 | .pfn = __phys_to_pfn(AVIC_BASE_ADDR), |
51 | .length = AVIC_SIZE, | 55 | .length = AVIC_SIZE, |
52 | .type = MT_DEVICE_NONSHARED | 56 | .type = MT_DEVICE_NONSHARED |
57 | }, { | ||
58 | .virtual = AIPS1_BASE_ADDR_VIRT, | ||
59 | .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), | ||
60 | .length = AIPS1_SIZE, | ||
61 | .type = MT_DEVICE_NONSHARED | ||
62 | }, { | ||
63 | .virtual = AIPS2_BASE_ADDR_VIRT, | ||
64 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), | ||
65 | .length = AIPS2_SIZE, | ||
66 | .type = MT_DEVICE_NONSHARED | ||
53 | }, | 67 | }, |
54 | }; | 68 | }; |
55 | 69 | ||
@@ -62,3 +76,24 @@ void __init mxc_map_io(void) | |||
62 | { | 76 | { |
63 | iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); | 77 | iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); |
64 | } | 78 | } |
79 | |||
80 | #ifdef CONFIG_CACHE_L2X0 | ||
81 | static int mxc_init_l2x0(void) | ||
82 | { | ||
83 | void __iomem *l2x0_base; | ||
84 | |||
85 | l2x0_base = ioremap(L2CC_BASE_ADDR, 4096); | ||
86 | if (IS_ERR(l2x0_base)) { | ||
87 | printk(KERN_ERR "remapping L2 cache area failed with %ld\n", | ||
88 | PTR_ERR(l2x0_base)); | ||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | l2x0_init(l2x0_base, 0x00030024, 0x00000000); | ||
93 | |||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | arch_initcall(mxc_init_l2x0); | ||
98 | #endif | ||
99 | |||
diff --git a/arch/arm/mach-mx3/mx31ads.c b/arch/arm/mach-mx3/mx31ads.c index f902a7c37c31..83e5e8e1276f 100644 --- a/arch/arm/mach-mx3/mx31ads.c +++ b/arch/arm/mach-mx3/mx31ads.c | |||
@@ -22,6 +22,8 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
24 | #include <linux/serial_8250.h> | 24 | #include <linux/serial_8250.h> |
25 | #include <linux/gpio.h> | ||
26 | #include <linux/i2c.h> | ||
25 | #include <linux/irq.h> | 27 | #include <linux/irq.h> |
26 | 28 | ||
27 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
@@ -35,6 +37,12 @@ | |||
35 | #include <mach/imx-uart.h> | 37 | #include <mach/imx-uart.h> |
36 | #include <mach/iomux-mx3.h> | 38 | #include <mach/iomux-mx3.h> |
37 | 39 | ||
40 | #ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 | ||
41 | #include <linux/mfd/wm8350/audio.h> | ||
42 | #include <linux/mfd/wm8350/core.h> | ||
43 | #include <linux/mfd/wm8350/pmic.h> | ||
44 | #endif | ||
45 | |||
38 | #include "devices.h" | 46 | #include "devices.h" |
39 | 47 | ||
40 | /*! | 48 | /*! |
@@ -94,13 +102,16 @@ static struct imxuart_platform_data uart_pdata = { | |||
94 | .flags = IMXUART_HAVE_RTSCTS, | 102 | .flags = IMXUART_HAVE_RTSCTS, |
95 | }; | 103 | }; |
96 | 104 | ||
105 | static int uart_pins[] = { | ||
106 | MX31_PIN_CTS1__CTS1, | ||
107 | MX31_PIN_RTS1__RTS1, | ||
108 | MX31_PIN_TXD1__TXD1, | ||
109 | MX31_PIN_RXD1__RXD1 | ||
110 | }; | ||
111 | |||
97 | static inline void mxc_init_imx_uart(void) | 112 | static inline void mxc_init_imx_uart(void) |
98 | { | 113 | { |
99 | mxc_iomux_mode(MX31_PIN_CTS1__CTS1); | 114 | mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), "uart-0"); |
100 | mxc_iomux_mode(MX31_PIN_RTS1__RTS1); | ||
101 | mxc_iomux_mode(MX31_PIN_TXD1__TXD1); | ||
102 | mxc_iomux_mode(MX31_PIN_RXD1__RXD1); | ||
103 | |||
104 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 115 | mxc_register_device(&mxc_uart_device0, &uart_pdata); |
105 | } | 116 | } |
106 | #else /* !SERIAL_IMX */ | 117 | #else /* !SERIAL_IMX */ |
@@ -176,7 +187,7 @@ static void __init mx31ads_init_expio(void) | |||
176 | /* | 187 | /* |
177 | * Configure INT line as GPIO input | 188 | * Configure INT line as GPIO input |
178 | */ | 189 | */ |
179 | mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_4, IOMUX_CONFIG_GPIO)); | 190 | mxc_iomux_setup_pin(IOMUX_MODE(MX31_PIN_GPIO1_4, IOMUX_CONFIG_GPIO), "expio"); |
180 | 191 | ||
181 | /* disable the interrupt and clear the status */ | 192 | /* disable the interrupt and clear the status */ |
182 | __raw_writew(0xFFFF, PBC_INTMASK_CLEAR_REG); | 193 | __raw_writew(0xFFFF, PBC_INTMASK_CLEAR_REG); |
@@ -191,26 +202,301 @@ static void __init mx31ads_init_expio(void) | |||
191 | set_irq_chained_handler(EXPIO_PARENT_INT, mx31ads_expio_irq_handler); | 202 | set_irq_chained_handler(EXPIO_PARENT_INT, mx31ads_expio_irq_handler); |
192 | } | 203 | } |
193 | 204 | ||
205 | #ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 | ||
206 | /* This section defines setup for the Wolfson Microelectronics | ||
207 | * 1133-EV1 PMU/audio board. When other PMU boards are supported the | ||
208 | * regulator definitions may be shared with them, but for now they can | ||
209 | * only be used with this board so would generate warnings about | ||
210 | * unused statics and some of the configuration is specific to this | ||
211 | * module. | ||
212 | */ | ||
213 | |||
214 | /* CPU */ | ||
215 | static struct regulator_consumer_supply sw1a_consumers[] = { | ||
216 | { | ||
217 | .supply = "cpu_vcc", | ||
218 | } | ||
219 | }; | ||
220 | |||
221 | static struct regulator_init_data sw1a_data = { | ||
222 | .constraints = { | ||
223 | .name = "SW1A", | ||
224 | .min_uV = 1275000, | ||
225 | .max_uV = 1600000, | ||
226 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | | ||
227 | REGULATOR_CHANGE_MODE, | ||
228 | .valid_modes_mask = REGULATOR_MODE_NORMAL | | ||
229 | REGULATOR_MODE_FAST, | ||
230 | .state_mem = { | ||
231 | .uV = 1400000, | ||
232 | .mode = REGULATOR_MODE_NORMAL, | ||
233 | .enabled = 1, | ||
234 | }, | ||
235 | .initial_state = PM_SUSPEND_MEM, | ||
236 | .always_on = 1, | ||
237 | .boot_on = 1, | ||
238 | }, | ||
239 | .num_consumer_supplies = ARRAY_SIZE(sw1a_consumers), | ||
240 | .consumer_supplies = sw1a_consumers, | ||
241 | }; | ||
242 | |||
243 | /* System IO - High */ | ||
244 | static struct regulator_init_data viohi_data = { | ||
245 | .constraints = { | ||
246 | .name = "VIOHO", | ||
247 | .min_uV = 2800000, | ||
248 | .max_uV = 2800000, | ||
249 | .state_mem = { | ||
250 | .uV = 2800000, | ||
251 | .mode = REGULATOR_MODE_NORMAL, | ||
252 | .enabled = 1, | ||
253 | }, | ||
254 | .initial_state = PM_SUSPEND_MEM, | ||
255 | .always_on = 1, | ||
256 | .boot_on = 1, | ||
257 | }, | ||
258 | }; | ||
259 | |||
260 | /* System IO - Low */ | ||
261 | static struct regulator_init_data violo_data = { | ||
262 | .constraints = { | ||
263 | .name = "VIOLO", | ||
264 | .min_uV = 1800000, | ||
265 | .max_uV = 1800000, | ||
266 | .state_mem = { | ||
267 | .uV = 1800000, | ||
268 | .mode = REGULATOR_MODE_NORMAL, | ||
269 | .enabled = 1, | ||
270 | }, | ||
271 | .initial_state = PM_SUSPEND_MEM, | ||
272 | .always_on = 1, | ||
273 | .boot_on = 1, | ||
274 | }, | ||
275 | }; | ||
276 | |||
277 | /* DDR RAM */ | ||
278 | static struct regulator_init_data sw2a_data = { | ||
279 | .constraints = { | ||
280 | .name = "SW2A", | ||
281 | .min_uV = 1800000, | ||
282 | .max_uV = 1800000, | ||
283 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
284 | .state_mem = { | ||
285 | .uV = 1800000, | ||
286 | .mode = REGULATOR_MODE_NORMAL, | ||
287 | .enabled = 1, | ||
288 | }, | ||
289 | .state_disk = { | ||
290 | .mode = REGULATOR_MODE_NORMAL, | ||
291 | .enabled = 0, | ||
292 | }, | ||
293 | .always_on = 1, | ||
294 | .boot_on = 1, | ||
295 | .initial_state = PM_SUSPEND_MEM, | ||
296 | }, | ||
297 | }; | ||
298 | |||
299 | static struct regulator_init_data ldo1_data = { | ||
300 | .constraints = { | ||
301 | .name = "VCAM/VMMC1/VMMC2", | ||
302 | .min_uV = 2800000, | ||
303 | .max_uV = 2800000, | ||
304 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
305 | .apply_uV = 1, | ||
306 | }, | ||
307 | }; | ||
308 | |||
309 | static struct regulator_consumer_supply ldo2_consumers[] = { | ||
310 | { | ||
311 | .supply = "AVDD", | ||
312 | }, | ||
313 | { | ||
314 | .supply = "HPVDD", | ||
315 | }, | ||
316 | }; | ||
317 | |||
318 | /* CODEC and SIM */ | ||
319 | static struct regulator_init_data ldo2_data = { | ||
320 | .constraints = { | ||
321 | .name = "VESIM/VSIM/AVDD", | ||
322 | .min_uV = 3300000, | ||
323 | .max_uV = 3300000, | ||
324 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
325 | .apply_uV = 1, | ||
326 | }, | ||
327 | .num_consumer_supplies = ARRAY_SIZE(ldo2_consumers), | ||
328 | .consumer_supplies = ldo2_consumers, | ||
329 | }; | ||
330 | |||
331 | /* General */ | ||
332 | static struct regulator_init_data vdig_data = { | ||
333 | .constraints = { | ||
334 | .name = "VDIG", | ||
335 | .min_uV = 1500000, | ||
336 | .max_uV = 1500000, | ||
337 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
338 | .apply_uV = 1, | ||
339 | .always_on = 1, | ||
340 | .boot_on = 1, | ||
341 | }, | ||
342 | }; | ||
343 | |||
344 | /* Tranceivers */ | ||
345 | static struct regulator_init_data ldo4_data = { | ||
346 | .constraints = { | ||
347 | .name = "VRF1/CVDD_2.775", | ||
348 | .min_uV = 2500000, | ||
349 | .max_uV = 2500000, | ||
350 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
351 | .apply_uV = 1, | ||
352 | .always_on = 1, | ||
353 | .boot_on = 1, | ||
354 | }, | ||
355 | }; | ||
356 | |||
357 | static struct wm8350_led_platform_data wm8350_led_data = { | ||
358 | .name = "wm8350:white", | ||
359 | .default_trigger = "heartbeat", | ||
360 | .max_uA = 27899, | ||
361 | }; | ||
362 | |||
363 | static struct wm8350_audio_platform_data imx32ads_wm8350_setup = { | ||
364 | .vmid_discharge_msecs = 1000, | ||
365 | .drain_msecs = 30, | ||
366 | .cap_discharge_msecs = 700, | ||
367 | .vmid_charge_msecs = 700, | ||
368 | .vmid_s_curve = WM8350_S_CURVE_SLOW, | ||
369 | .dis_out4 = WM8350_DISCHARGE_SLOW, | ||
370 | .dis_out3 = WM8350_DISCHARGE_SLOW, | ||
371 | .dis_out2 = WM8350_DISCHARGE_SLOW, | ||
372 | .dis_out1 = WM8350_DISCHARGE_SLOW, | ||
373 | .vroi_out4 = WM8350_TIE_OFF_500R, | ||
374 | .vroi_out3 = WM8350_TIE_OFF_500R, | ||
375 | .vroi_out2 = WM8350_TIE_OFF_500R, | ||
376 | .vroi_out1 = WM8350_TIE_OFF_500R, | ||
377 | .vroi_enable = 0, | ||
378 | .codec_current_on = WM8350_CODEC_ISEL_1_0, | ||
379 | .codec_current_standby = WM8350_CODEC_ISEL_0_5, | ||
380 | .codec_current_charge = WM8350_CODEC_ISEL_1_5, | ||
381 | }; | ||
382 | |||
383 | static int mx31_wm8350_init(struct wm8350 *wm8350) | ||
384 | { | ||
385 | int i; | ||
386 | |||
387 | wm8350_gpio_config(wm8350, 0, WM8350_GPIO_DIR_IN, | ||
388 | WM8350_GPIO0_PWR_ON_IN, WM8350_GPIO_ACTIVE_LOW, | ||
389 | WM8350_GPIO_PULL_UP, WM8350_GPIO_INVERT_OFF, | ||
390 | WM8350_GPIO_DEBOUNCE_ON); | ||
391 | |||
392 | wm8350_gpio_config(wm8350, 3, WM8350_GPIO_DIR_IN, | ||
393 | WM8350_GPIO3_PWR_OFF_IN, WM8350_GPIO_ACTIVE_HIGH, | ||
394 | WM8350_GPIO_PULL_DOWN, WM8350_GPIO_INVERT_OFF, | ||
395 | WM8350_GPIO_DEBOUNCE_ON); | ||
396 | |||
397 | wm8350_gpio_config(wm8350, 4, WM8350_GPIO_DIR_IN, | ||
398 | WM8350_GPIO4_MR_IN, WM8350_GPIO_ACTIVE_HIGH, | ||
399 | WM8350_GPIO_PULL_DOWN, WM8350_GPIO_INVERT_OFF, | ||
400 | WM8350_GPIO_DEBOUNCE_OFF); | ||
401 | |||
402 | wm8350_gpio_config(wm8350, 7, WM8350_GPIO_DIR_IN, | ||
403 | WM8350_GPIO7_HIBERNATE_IN, WM8350_GPIO_ACTIVE_HIGH, | ||
404 | WM8350_GPIO_PULL_DOWN, WM8350_GPIO_INVERT_OFF, | ||
405 | WM8350_GPIO_DEBOUNCE_OFF); | ||
406 | |||
407 | wm8350_gpio_config(wm8350, 6, WM8350_GPIO_DIR_OUT, | ||
408 | WM8350_GPIO6_SDOUT_OUT, WM8350_GPIO_ACTIVE_HIGH, | ||
409 | WM8350_GPIO_PULL_NONE, WM8350_GPIO_INVERT_OFF, | ||
410 | WM8350_GPIO_DEBOUNCE_OFF); | ||
411 | |||
412 | wm8350_gpio_config(wm8350, 8, WM8350_GPIO_DIR_OUT, | ||
413 | WM8350_GPIO8_VCC_FAULT_OUT, WM8350_GPIO_ACTIVE_LOW, | ||
414 | WM8350_GPIO_PULL_NONE, WM8350_GPIO_INVERT_OFF, | ||
415 | WM8350_GPIO_DEBOUNCE_OFF); | ||
416 | |||
417 | wm8350_gpio_config(wm8350, 9, WM8350_GPIO_DIR_OUT, | ||
418 | WM8350_GPIO9_BATT_FAULT_OUT, WM8350_GPIO_ACTIVE_LOW, | ||
419 | WM8350_GPIO_PULL_NONE, WM8350_GPIO_INVERT_OFF, | ||
420 | WM8350_GPIO_DEBOUNCE_OFF); | ||
421 | |||
422 | /* Fix up for our own supplies. */ | ||
423 | for (i = 0; i < ARRAY_SIZE(ldo2_consumers); i++) | ||
424 | ldo2_consumers[i].dev = wm8350->dev; | ||
425 | |||
426 | wm8350_register_regulator(wm8350, WM8350_DCDC_1, &sw1a_data); | ||
427 | wm8350_register_regulator(wm8350, WM8350_DCDC_3, &viohi_data); | ||
428 | wm8350_register_regulator(wm8350, WM8350_DCDC_4, &violo_data); | ||
429 | wm8350_register_regulator(wm8350, WM8350_DCDC_6, &sw2a_data); | ||
430 | wm8350_register_regulator(wm8350, WM8350_LDO_1, &ldo1_data); | ||
431 | wm8350_register_regulator(wm8350, WM8350_LDO_2, &ldo2_data); | ||
432 | wm8350_register_regulator(wm8350, WM8350_LDO_3, &vdig_data); | ||
433 | wm8350_register_regulator(wm8350, WM8350_LDO_4, &ldo4_data); | ||
434 | |||
435 | /* LEDs */ | ||
436 | wm8350_dcdc_set_slot(wm8350, WM8350_DCDC_5, 1, 1, | ||
437 | WM8350_DC5_ERRACT_SHUTDOWN_CONV); | ||
438 | wm8350_isink_set_flash(wm8350, WM8350_ISINK_A, | ||
439 | WM8350_ISINK_FLASH_DISABLE, | ||
440 | WM8350_ISINK_FLASH_TRIG_BIT, | ||
441 | WM8350_ISINK_FLASH_DUR_32MS, | ||
442 | WM8350_ISINK_FLASH_ON_INSTANT, | ||
443 | WM8350_ISINK_FLASH_OFF_INSTANT, | ||
444 | WM8350_ISINK_FLASH_MODE_EN); | ||
445 | wm8350_dcdc25_set_mode(wm8350, WM8350_DCDC_5, | ||
446 | WM8350_ISINK_MODE_BOOST, | ||
447 | WM8350_ISINK_ILIM_NORMAL, | ||
448 | WM8350_DC5_RMP_20V, | ||
449 | WM8350_DC5_FBSRC_ISINKA); | ||
450 | wm8350_register_led(wm8350, 0, WM8350_DCDC_5, WM8350_ISINK_A, | ||
451 | &wm8350_led_data); | ||
452 | |||
453 | wm8350->codec.platform_data = &imx32ads_wm8350_setup; | ||
454 | |||
455 | return 0; | ||
456 | } | ||
457 | |||
458 | static struct wm8350_platform_data __initdata mx31_wm8350_pdata = { | ||
459 | .init = mx31_wm8350_init, | ||
460 | }; | ||
461 | #endif | ||
462 | |||
463 | #if defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE) | ||
464 | static struct i2c_board_info __initdata mx31ads_i2c1_devices[] = { | ||
465 | #ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 | ||
466 | { | ||
467 | I2C_BOARD_INFO("wm8350", 0x1a), | ||
468 | .platform_data = &mx31_wm8350_pdata, | ||
469 | .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), | ||
470 | }, | ||
471 | #endif | ||
472 | }; | ||
473 | |||
474 | static void mxc_init_i2c(void) | ||
475 | { | ||
476 | i2c_register_board_info(1, mx31ads_i2c1_devices, | ||
477 | ARRAY_SIZE(mx31ads_i2c1_devices)); | ||
478 | |||
479 | mxc_iomux_mode(IOMUX_MODE(MX31_PIN_CSPI2_MOSI, IOMUX_CONFIG_ALT1)); | ||
480 | mxc_iomux_mode(IOMUX_MODE(MX31_PIN_CSPI2_MISO, IOMUX_CONFIG_ALT1)); | ||
481 | |||
482 | mxc_register_device(&mxc_i2c_device1, NULL); | ||
483 | } | ||
484 | #else | ||
485 | static void mxc_init_i2c(void) | ||
486 | { | ||
487 | } | ||
488 | #endif | ||
489 | |||
194 | /*! | 490 | /*! |
195 | * This structure defines static mappings for the i.MX31ADS board. | 491 | * This structure defines static mappings for the i.MX31ADS board. |
196 | */ | 492 | */ |
197 | static struct map_desc mx31ads_io_desc[] __initdata = { | 493 | static struct map_desc mx31ads_io_desc[] __initdata = { |
198 | { | 494 | { |
199 | .virtual = AIPS1_BASE_ADDR_VIRT, | ||
200 | .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), | ||
201 | .length = AIPS1_SIZE, | ||
202 | .type = MT_DEVICE_NONSHARED | ||
203 | }, { | ||
204 | .virtual = SPBA0_BASE_ADDR_VIRT, | 495 | .virtual = SPBA0_BASE_ADDR_VIRT, |
205 | .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), | 496 | .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), |
206 | .length = SPBA0_SIZE, | 497 | .length = SPBA0_SIZE, |
207 | .type = MT_DEVICE_NONSHARED | 498 | .type = MT_DEVICE_NONSHARED |
208 | }, { | 499 | }, { |
209 | .virtual = AIPS2_BASE_ADDR_VIRT, | ||
210 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), | ||
211 | .length = AIPS2_SIZE, | ||
212 | .type = MT_DEVICE_NONSHARED | ||
213 | }, { | ||
214 | .virtual = CS4_BASE_ADDR_VIRT, | 500 | .virtual = CS4_BASE_ADDR_VIRT, |
215 | .pfn = __phys_to_pfn(CS4_BASE_ADDR), | 501 | .pfn = __phys_to_pfn(CS4_BASE_ADDR), |
216 | .length = CS4_SIZE / 2, | 502 | .length = CS4_SIZE / 2, |
@@ -221,13 +507,13 @@ static struct map_desc mx31ads_io_desc[] __initdata = { | |||
221 | /*! | 507 | /*! |
222 | * Set up static virtual mappings. | 508 | * Set up static virtual mappings. |
223 | */ | 509 | */ |
224 | void __init mx31ads_map_io(void) | 510 | static void __init mx31ads_map_io(void) |
225 | { | 511 | { |
226 | mxc_map_io(); | 512 | mxc_map_io(); |
227 | iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc)); | 513 | iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc)); |
228 | } | 514 | } |
229 | 515 | ||
230 | void __init mx31ads_init_irq(void) | 516 | static void __init mx31ads_init_irq(void) |
231 | { | 517 | { |
232 | mxc_init_irq(); | 518 | mxc_init_irq(); |
233 | mx31ads_init_expio(); | 519 | mx31ads_init_expio(); |
@@ -240,15 +526,15 @@ static void __init mxc_board_init(void) | |||
240 | { | 526 | { |
241 | mxc_init_extuart(); | 527 | mxc_init_extuart(); |
242 | mxc_init_imx_uart(); | 528 | mxc_init_imx_uart(); |
529 | mxc_init_i2c(); | ||
243 | } | 530 | } |
244 | 531 | ||
245 | static void __init mx31ads_timer_init(void) | 532 | static void __init mx31ads_timer_init(void) |
246 | { | 533 | { |
247 | mxc_clocks_init(26000000); | 534 | mx31_clocks_init(26000000); |
248 | mxc_timer_init("ipg_clk.0"); | ||
249 | } | 535 | } |
250 | 536 | ||
251 | struct sys_timer mx31ads_timer = { | 537 | static struct sys_timer mx31ads_timer = { |
252 | .init = mx31ads_timer_init, | 538 | .init = mx31ads_timer_init, |
253 | }; | 539 | }; |
254 | 540 | ||
diff --git a/arch/arm/mach-mx3/mx31lite.c b/arch/arm/mach-mx3/mx31lite.c index c43440070143..894d98cd9941 100644 --- a/arch/arm/mach-mx3/mx31lite.c +++ b/arch/arm/mach-mx3/mx31lite.c | |||
@@ -42,21 +42,11 @@ | |||
42 | */ | 42 | */ |
43 | static struct map_desc mx31lite_io_desc[] __initdata = { | 43 | static struct map_desc mx31lite_io_desc[] __initdata = { |
44 | { | 44 | { |
45 | .virtual = AIPS1_BASE_ADDR_VIRT, | ||
46 | .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), | ||
47 | .length = AIPS1_SIZE, | ||
48 | .type = MT_DEVICE_NONSHARED | ||
49 | }, { | ||
50 | .virtual = SPBA0_BASE_ADDR_VIRT, | 45 | .virtual = SPBA0_BASE_ADDR_VIRT, |
51 | .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), | 46 | .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), |
52 | .length = SPBA0_SIZE, | 47 | .length = SPBA0_SIZE, |
53 | .type = MT_DEVICE_NONSHARED | 48 | .type = MT_DEVICE_NONSHARED |
54 | }, { | 49 | }, { |
55 | .virtual = AIPS2_BASE_ADDR_VIRT, | ||
56 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), | ||
57 | .length = AIPS2_SIZE, | ||
58 | .type = MT_DEVICE_NONSHARED | ||
59 | }, { | ||
60 | .virtual = CS4_BASE_ADDR_VIRT, | 50 | .virtual = CS4_BASE_ADDR_VIRT, |
61 | .pfn = __phys_to_pfn(CS4_BASE_ADDR), | 51 | .pfn = __phys_to_pfn(CS4_BASE_ADDR), |
62 | .length = CS4_SIZE, | 52 | .length = CS4_SIZE, |
@@ -82,8 +72,7 @@ static void __init mxc_board_init(void) | |||
82 | 72 | ||
83 | static void __init mx31lite_timer_init(void) | 73 | static void __init mx31lite_timer_init(void) |
84 | { | 74 | { |
85 | mxc_clocks_init(26000000); | 75 | mx31_clocks_init(26000000); |
86 | mxc_timer_init("ipg_clk.0"); | ||
87 | } | 76 | } |
88 | 77 | ||
89 | struct sys_timer mx31lite_timer = { | 78 | struct sys_timer mx31lite_timer = { |
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c new file mode 100644 index 000000000000..d080b4add79c --- /dev/null +++ b/arch/arm/mach-mx3/mx31moboard-devboard.c | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | #include <linux/init.h> | ||
21 | |||
22 | #include <linux/platform_device.h> | ||
23 | |||
24 | #include <mach/hardware.h> | ||
25 | #include <mach/common.h> | ||
26 | #include <mach/imx-uart.h> | ||
27 | #include <mach/iomux-mx3.h> | ||
28 | |||
29 | #include "devices.h" | ||
30 | |||
31 | static struct imxuart_platform_data uart_pdata = { | ||
32 | .flags = IMXUART_HAVE_RTSCTS, | ||
33 | }; | ||
34 | |||
35 | static int mxc_uart1_pins[] = { | ||
36 | MX31_PIN_CTS2__CTS2, MX31_PIN_RTS2__RTS2, | ||
37 | MX31_PIN_TXD2__TXD2, MX31_PIN_RXD2__RXD2, | ||
38 | }; | ||
39 | |||
40 | /* | ||
41 | * system init for baseboard usage. Will be called by mx31moboard init. | ||
42 | */ | ||
43 | void __init mx31moboard_devboard_init(void) | ||
44 | { | ||
45 | printk(KERN_INFO "Initializing mx31devboard peripherals\n"); | ||
46 | mxc_iomux_setup_multiple_pins(mxc_uart1_pins, ARRAY_SIZE(mxc_uart1_pins), "uart1"); | ||
47 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | ||
48 | } | ||
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c new file mode 100644 index 000000000000..9ef9566823fb --- /dev/null +++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | #include <linux/init.h> | ||
21 | |||
22 | #include <linux/platform_device.h> | ||
23 | |||
24 | #include <mach/hardware.h> | ||
25 | #include <mach/common.h> | ||
26 | #include <mach/imx-uart.h> | ||
27 | #include <mach/iomux-mx3.h> | ||
28 | |||
29 | #include "devices.h" | ||
30 | |||
31 | /* | ||
32 | * system init for baseboard usage. Will be called by mx31moboard init. | ||
33 | */ | ||
34 | void __init mx31moboard_marxbot_init(void) | ||
35 | { | ||
36 | printk(KERN_INFO "Initializing mx31marxbot peripherals\n"); | ||
37 | } | ||
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c index c29098af7394..34c2a1b99d4f 100644 --- a/arch/arm/mach-mx3/mx31moboard.c +++ b/arch/arm/mach-mx3/mx31moboard.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <mach/common.h> | 32 | #include <mach/common.h> |
33 | #include <mach/imx-uart.h> | 33 | #include <mach/imx-uart.h> |
34 | #include <mach/iomux-mx3.h> | 34 | #include <mach/iomux-mx3.h> |
35 | #include <mach/board-mx31moboard.h> | ||
35 | 36 | ||
36 | #include "devices.h" | 37 | #include "devices.h" |
37 | 38 | ||
@@ -63,6 +64,18 @@ static struct platform_device *devices[] __initdata = { | |||
63 | &mx31moboard_flash, | 64 | &mx31moboard_flash, |
64 | }; | 65 | }; |
65 | 66 | ||
67 | static int mxc_uart0_pins[] = { | ||
68 | MX31_PIN_CTS1__CTS1, MX31_PIN_RTS1__RTS1, | ||
69 | MX31_PIN_TXD1__TXD1, MX31_PIN_RXD1__RXD1, | ||
70 | }; | ||
71 | static int mxc_uart4_pins[] = { | ||
72 | MX31_PIN_PC_RST__CTS5, MX31_PIN_PC_VS2__RTS5, | ||
73 | MX31_PIN_PC_BVD2__TXD5, MX31_PIN_PC_BVD1__RXD5, | ||
74 | }; | ||
75 | |||
76 | static int mx31moboard_baseboard; | ||
77 | core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444); | ||
78 | |||
66 | /* | 79 | /* |
67 | * Board specific initialization. | 80 | * Board specific initialization. |
68 | */ | 81 | */ |
@@ -70,58 +83,29 @@ static void __init mxc_board_init(void) | |||
70 | { | 83 | { |
71 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 84 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
72 | 85 | ||
73 | mxc_iomux_mode(MX31_PIN_CTS1__CTS1); | 86 | mxc_iomux_setup_multiple_pins(mxc_uart0_pins, ARRAY_SIZE(mxc_uart0_pins), "uart0"); |
74 | mxc_iomux_mode(MX31_PIN_RTS1__RTS1); | ||
75 | mxc_iomux_mode(MX31_PIN_TXD1__TXD1); | ||
76 | mxc_iomux_mode(MX31_PIN_RXD1__RXD1); | ||
77 | |||
78 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 87 | mxc_register_device(&mxc_uart_device0, &uart_pdata); |
79 | 88 | ||
80 | mxc_iomux_mode(MX31_PIN_CTS2__CTS2); | 89 | mxc_iomux_setup_multiple_pins(mxc_uart4_pins, ARRAY_SIZE(mxc_uart4_pins), "uart4"); |
81 | mxc_iomux_mode(MX31_PIN_RTS2__RTS2); | ||
82 | mxc_iomux_mode(MX31_PIN_TXD2__TXD2); | ||
83 | mxc_iomux_mode(MX31_PIN_RXD2__RXD2); | ||
84 | |||
85 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | ||
86 | |||
87 | mxc_iomux_mode(MX31_PIN_PC_RST__CTS5); | ||
88 | mxc_iomux_mode(MX31_PIN_PC_VS2__RTS5); | ||
89 | mxc_iomux_mode(MX31_PIN_PC_BVD2__TXD5); | ||
90 | mxc_iomux_mode(MX31_PIN_PC_BVD1__RXD5); | ||
91 | |||
92 | mxc_register_device(&mxc_uart_device4, &uart_pdata); | 90 | mxc_register_device(&mxc_uart_device4, &uart_pdata); |
93 | } | ||
94 | 91 | ||
95 | /* | 92 | switch (mx31moboard_baseboard) { |
96 | * This structure defines static mappings for the mx31moboard. | 93 | case MX31NOBOARD: |
97 | */ | 94 | break; |
98 | static struct map_desc mx31moboard_io_desc[] __initdata = { | 95 | case MX31DEVBOARD: |
99 | { | 96 | mx31moboard_devboard_init(); |
100 | .virtual = AIPS1_BASE_ADDR_VIRT, | 97 | break; |
101 | .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), | 98 | case MX31MARXBOT: |
102 | .length = AIPS1_SIZE, | 99 | mx31moboard_marxbot_init(); |
103 | .type = MT_DEVICE_NONSHARED | 100 | break; |
104 | }, { | 101 | default: |
105 | .virtual = AIPS2_BASE_ADDR_VIRT, | 102 | printk(KERN_ERR "Illegal mx31moboard_baseboard type %d\n", mx31moboard_baseboard); |
106 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), | 103 | } |
107 | .length = AIPS2_SIZE, | ||
108 | .type = MT_DEVICE_NONSHARED | ||
109 | }, | ||
110 | }; | ||
111 | |||
112 | /* | ||
113 | * Set up static virtual mappings. | ||
114 | */ | ||
115 | void __init mx31moboard_map_io(void) | ||
116 | { | ||
117 | mxc_map_io(); | ||
118 | iotable_init(mx31moboard_io_desc, ARRAY_SIZE(mx31moboard_io_desc)); | ||
119 | } | 104 | } |
120 | 105 | ||
121 | static void __init mx31moboard_timer_init(void) | 106 | static void __init mx31moboard_timer_init(void) |
122 | { | 107 | { |
123 | mxc_clocks_init(26000000); | 108 | mx31_clocks_init(26000000); |
124 | mxc_timer_init("ipg_clk.0"); | ||
125 | } | 109 | } |
126 | 110 | ||
127 | struct sys_timer mx31moboard_timer = { | 111 | struct sys_timer mx31moboard_timer = { |
@@ -133,7 +117,7 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard") | |||
133 | .phys_io = AIPS1_BASE_ADDR, | 117 | .phys_io = AIPS1_BASE_ADDR, |
134 | .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, | 118 | .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, |
135 | .boot_params = PHYS_OFFSET + 0x100, | 119 | .boot_params = PHYS_OFFSET + 0x100, |
136 | .map_io = mx31moboard_map_io, | 120 | .map_io = mxc_map_io, |
137 | .init_irq = mxc_init_irq, | 121 | .init_irq = mxc_init_irq, |
138 | .init_machine = mxc_board_init, | 122 | .init_machine = mxc_board_init, |
139 | .timer = &mx31moboard_timer, | 123 | .timer = &mx31moboard_timer, |
diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mx31pdk.c index d464d068a4a6..bc63f1785691 100644 --- a/arch/arm/mach-mx3/mx31pdk.c +++ b/arch/arm/mach-mx3/mx31pdk.c | |||
@@ -45,40 +45,17 @@ static struct imxuart_platform_data uart_pdata = { | |||
45 | .flags = IMXUART_HAVE_RTSCTS, | 45 | .flags = IMXUART_HAVE_RTSCTS, |
46 | }; | 46 | }; |
47 | 47 | ||
48 | static inline void mxc_init_imx_uart(void) | 48 | static int uart_pins[] = { |
49 | { | 49 | MX31_PIN_CTS1__CTS1, |
50 | mxc_iomux_mode(MX31_PIN_CTS1__CTS1); | 50 | MX31_PIN_RTS1__RTS1, |
51 | mxc_iomux_mode(MX31_PIN_RTS1__RTS1); | 51 | MX31_PIN_TXD1__TXD1, |
52 | mxc_iomux_mode(MX31_PIN_TXD1__TXD1); | 52 | MX31_PIN_RXD1__RXD1 |
53 | mxc_iomux_mode(MX31_PIN_RXD1__RXD1); | ||
54 | |||
55 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | ||
56 | } | ||
57 | |||
58 | /*! | ||
59 | * This structure defines static mappings for the i.MX31PDK board. | ||
60 | */ | ||
61 | static struct map_desc mx31pdk_io_desc[] __initdata = { | ||
62 | { | ||
63 | .virtual = AIPS1_BASE_ADDR_VIRT, | ||
64 | .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), | ||
65 | .length = AIPS1_SIZE, | ||
66 | .type = MT_DEVICE_NONSHARED | ||
67 | }, { | ||
68 | .virtual = AIPS2_BASE_ADDR_VIRT, | ||
69 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), | ||
70 | .length = AIPS2_SIZE, | ||
71 | .type = MT_DEVICE_NONSHARED | ||
72 | }, | ||
73 | }; | 53 | }; |
74 | 54 | ||
75 | /*! | 55 | static inline void mxc_init_imx_uart(void) |
76 | * Set up static virtual mappings. | ||
77 | */ | ||
78 | static void __init mx31pdk_map_io(void) | ||
79 | { | 56 | { |
80 | mxc_map_io(); | 57 | mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), "uart-0"); |
81 | iotable_init(mx31pdk_io_desc, ARRAY_SIZE(mx31pdk_io_desc)); | 58 | mxc_register_device(&mxc_uart_device0, &uart_pdata); |
82 | } | 59 | } |
83 | 60 | ||
84 | /*! | 61 | /*! |
@@ -91,8 +68,7 @@ static void __init mxc_board_init(void) | |||
91 | 68 | ||
92 | static void __init mx31pdk_timer_init(void) | 69 | static void __init mx31pdk_timer_init(void) |
93 | { | 70 | { |
94 | mxc_clocks_init(26000000); | 71 | mx31_clocks_init(26000000); |
95 | mxc_timer_init("ipg_clk.0"); | ||
96 | } | 72 | } |
97 | 73 | ||
98 | static struct sys_timer mx31pdk_timer = { | 74 | static struct sys_timer mx31pdk_timer = { |
@@ -108,7 +84,7 @@ MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)") | |||
108 | .phys_io = AIPS1_BASE_ADDR, | 84 | .phys_io = AIPS1_BASE_ADDR, |
109 | .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, | 85 | .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, |
110 | .boot_params = PHYS_OFFSET + 0x100, | 86 | .boot_params = PHYS_OFFSET + 0x100, |
111 | .map_io = mx31pdk_map_io, | 87 | .map_io = mxc_map_io, |
112 | .init_irq = mxc_init_irq, | 88 | .init_irq = mxc_init_irq, |
113 | .init_machine = mxc_board_init, | 89 | .init_machine = mxc_board_init, |
114 | .timer = &mx31pdk_timer, | 90 | .timer = &mx31pdk_timer, |
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c index 8cea82587222..5fce022114de 100644 --- a/arch/arm/mach-mx3/pcm037.c +++ b/arch/arm/mach-mx3/pcm037.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <linux/gpio.h> | 26 | #include <linux/gpio.h> |
27 | #include <linux/smc911x.h> | 27 | #include <linux/smc911x.h> |
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | #include <linux/i2c.h> | ||
30 | #include <linux/i2c/at24.h> | ||
29 | 31 | ||
30 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
31 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
@@ -37,6 +39,10 @@ | |||
37 | #include <mach/iomux-mx3.h> | 39 | #include <mach/iomux-mx3.h> |
38 | #include <mach/board-pcm037.h> | 40 | #include <mach/board-pcm037.h> |
39 | #include <mach/mxc_nand.h> | 41 | #include <mach/mxc_nand.h> |
42 | #include <mach/mmc.h> | ||
43 | #ifdef CONFIG_I2C_IMX | ||
44 | #include <mach/i2c.h> | ||
45 | #endif | ||
40 | 46 | ||
41 | #include "devices.h" | 47 | #include "devices.h" |
42 | 48 | ||
@@ -117,12 +123,90 @@ static struct mxc_nand_platform_data pcm037_nand_board_info = { | |||
117 | .hw_ecc = 1, | 123 | .hw_ecc = 1, |
118 | }; | 124 | }; |
119 | 125 | ||
126 | #ifdef CONFIG_I2C_IMX | ||
127 | static int i2c_1_pins[] = { | ||
128 | MX31_PIN_CSPI2_MOSI__SCL, | ||
129 | MX31_PIN_CSPI2_MISO__SDA, | ||
130 | }; | ||
131 | |||
132 | static int pcm037_i2c_1_init(struct device *dev) | ||
133 | { | ||
134 | return mxc_iomux_setup_multiple_pins(i2c_1_pins, ARRAY_SIZE(i2c_1_pins), | ||
135 | "i2c-1"); | ||
136 | } | ||
137 | |||
138 | static void pcm037_i2c_1_exit(struct device *dev) | ||
139 | { | ||
140 | mxc_iomux_release_multiple_pins(i2c_1_pins, ARRAY_SIZE(i2c_1_pins)); | ||
141 | } | ||
142 | |||
143 | static struct imxi2c_platform_data pcm037_i2c_1_data = { | ||
144 | .bitrate = 100000, | ||
145 | .init = pcm037_i2c_1_init, | ||
146 | .exit = pcm037_i2c_1_exit, | ||
147 | }; | ||
148 | |||
149 | static struct at24_platform_data board_eeprom = { | ||
150 | .byte_len = 4096, | ||
151 | .page_size = 32, | ||
152 | .flags = AT24_FLAG_ADDR16, | ||
153 | }; | ||
154 | |||
155 | static struct i2c_board_info pcm037_i2c_devices[] = { | ||
156 | { | ||
157 | I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ | ||
158 | .platform_data = &board_eeprom, | ||
159 | }, { | ||
160 | I2C_BOARD_INFO("rtc-pcf8563", 0x51), | ||
161 | .type = "pcf8563", | ||
162 | } | ||
163 | }; | ||
164 | #endif | ||
165 | |||
166 | static int sdhc1_pins[] = { | ||
167 | MX31_PIN_SD1_DATA3__SD1_DATA3, | ||
168 | MX31_PIN_SD1_DATA2__SD1_DATA2, | ||
169 | MX31_PIN_SD1_DATA1__SD1_DATA1, | ||
170 | MX31_PIN_SD1_DATA0__SD1_DATA0, | ||
171 | MX31_PIN_SD1_CLK__SD1_CLK, | ||
172 | MX31_PIN_SD1_CMD__SD1_CMD, | ||
173 | }; | ||
174 | |||
175 | static int pcm970_sdhc1_init(struct device *dev, irq_handler_t h, void *data) | ||
176 | { | ||
177 | return mxc_iomux_setup_multiple_pins(sdhc1_pins, ARRAY_SIZE(sdhc1_pins), | ||
178 | "sdhc-1"); | ||
179 | } | ||
180 | |||
181 | static void pcm970_sdhc1_exit(struct device *dev, void *data) | ||
182 | { | ||
183 | mxc_iomux_release_multiple_pins(sdhc1_pins, ARRAY_SIZE(sdhc1_pins)); | ||
184 | } | ||
185 | |||
186 | /* No card and rw detection at the moment */ | ||
187 | static struct imxmmc_platform_data sdhc_pdata = { | ||
188 | .init = pcm970_sdhc1_init, | ||
189 | .exit = pcm970_sdhc1_exit, | ||
190 | }; | ||
191 | |||
120 | static struct platform_device *devices[] __initdata = { | 192 | static struct platform_device *devices[] __initdata = { |
121 | &pcm037_flash, | 193 | &pcm037_flash, |
122 | &pcm037_eth, | 194 | &pcm037_eth, |
123 | &pcm037_sram_device, | 195 | &pcm037_sram_device, |
124 | }; | 196 | }; |
125 | 197 | ||
198 | static int uart0_pins[] = { | ||
199 | MX31_PIN_CTS1__CTS1, | ||
200 | MX31_PIN_RTS1__RTS1, | ||
201 | MX31_PIN_TXD1__TXD1, | ||
202 | MX31_PIN_RXD1__RXD1 | ||
203 | }; | ||
204 | |||
205 | static int uart2_pins[] = { | ||
206 | MX31_PIN_CSPI3_MOSI__RXD3, | ||
207 | MX31_PIN_CSPI3_MISO__TXD3 | ||
208 | }; | ||
209 | |||
126 | /* | 210 | /* |
127 | * Board specific initialization. | 211 | * Board specific initialization. |
128 | */ | 212 | */ |
@@ -130,59 +214,33 @@ static void __init mxc_board_init(void) | |||
130 | { | 214 | { |
131 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 215 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
132 | 216 | ||
133 | mxc_iomux_mode(MX31_PIN_CTS1__CTS1); | 217 | mxc_iomux_setup_multiple_pins(uart0_pins, ARRAY_SIZE(uart0_pins), "uart-0"); |
134 | mxc_iomux_mode(MX31_PIN_RTS1__RTS1); | ||
135 | mxc_iomux_mode(MX31_PIN_TXD1__TXD1); | ||
136 | mxc_iomux_mode(MX31_PIN_RXD1__RXD1); | ||
137 | |||
138 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 218 | mxc_register_device(&mxc_uart_device0, &uart_pdata); |
139 | 219 | ||
140 | mxc_iomux_mode(MX31_PIN_CSPI3_MOSI__RXD3); | 220 | mxc_iomux_setup_multiple_pins(uart2_pins, ARRAY_SIZE(uart2_pins), "uart-2"); |
141 | mxc_iomux_mode(MX31_PIN_CSPI3_MISO__TXD3); | ||
142 | |||
143 | mxc_register_device(&mxc_uart_device2, &uart_pdata); | 221 | mxc_register_device(&mxc_uart_device2, &uart_pdata); |
144 | 222 | ||
145 | mxc_iomux_mode(MX31_PIN_BATT_LINE__OWIRE); | 223 | mxc_iomux_setup_pin(MX31_PIN_BATT_LINE__OWIRE, "batt-0wire"); |
146 | mxc_register_device(&mxc_w1_master_device, NULL); | 224 | mxc_register_device(&mxc_w1_master_device, NULL); |
147 | 225 | ||
148 | /* SMSC9215 IRQ pin */ | 226 | /* SMSC9215 IRQ pin */ |
149 | mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO)); | 227 | if (!mxc_iomux_setup_pin(IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO), |
150 | if (!gpio_request(MX31_PIN_GPIO3_1, "pcm037-eth")) | 228 | "pcm037-eth")) |
151 | gpio_direction_input(MX31_PIN_GPIO3_1); | 229 | gpio_direction_input(MX31_PIN_GPIO3_1); |
152 | 230 | ||
153 | mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); | 231 | #ifdef CONFIG_I2C_IMX |
154 | } | 232 | i2c_register_board_info(1, pcm037_i2c_devices, |
233 | ARRAY_SIZE(pcm037_i2c_devices)); | ||
155 | 234 | ||
156 | /* | 235 | mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data); |
157 | * This structure defines static mappings for the pcm037 board. | 236 | #endif |
158 | */ | 237 | mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); |
159 | static struct map_desc pcm037_io_desc[] __initdata = { | 238 | mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); |
160 | { | ||
161 | .virtual = AIPS1_BASE_ADDR_VIRT, | ||
162 | .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), | ||
163 | .length = AIPS1_SIZE, | ||
164 | .type = MT_DEVICE_NONSHARED | ||
165 | }, { | ||
166 | .virtual = AIPS2_BASE_ADDR_VIRT, | ||
167 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), | ||
168 | .length = AIPS2_SIZE, | ||
169 | .type = MT_DEVICE_NONSHARED | ||
170 | }, | ||
171 | }; | ||
172 | |||
173 | /* | ||
174 | * Set up static virtual mappings. | ||
175 | */ | ||
176 | void __init pcm037_map_io(void) | ||
177 | { | ||
178 | mxc_map_io(); | ||
179 | iotable_init(pcm037_io_desc, ARRAY_SIZE(pcm037_io_desc)); | ||
180 | } | 239 | } |
181 | 240 | ||
182 | static void __init pcm037_timer_init(void) | 241 | static void __init pcm037_timer_init(void) |
183 | { | 242 | { |
184 | mxc_clocks_init(26000000); | 243 | mx31_clocks_init(26000000); |
185 | mxc_timer_init("ipg_clk.0"); | ||
186 | } | 244 | } |
187 | 245 | ||
188 | struct sys_timer pcm037_timer = { | 246 | struct sys_timer pcm037_timer = { |
@@ -194,7 +252,7 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037") | |||
194 | .phys_io = AIPS1_BASE_ADDR, | 252 | .phys_io = AIPS1_BASE_ADDR, |
195 | .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, | 253 | .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, |
196 | .boot_params = PHYS_OFFSET + 0x100, | 254 | .boot_params = PHYS_OFFSET + 0x100, |
197 | .map_io = pcm037_map_io, | 255 | .map_io = mxc_map_io, |
198 | .init_irq = mxc_init_irq, | 256 | .init_irq = mxc_init_irq, |
199 | .init_machine = mxc_board_init, | 257 | .init_machine = mxc_board_init, |
200 | .timer = &pcm037_timer, | 258 | .timer = &pcm037_timer, |
diff --git a/arch/arm/mach-mx3/qong.c b/arch/arm/mach-mx3/qong.c new file mode 100644 index 000000000000..6c4283cec6f4 --- /dev/null +++ b/arch/arm/mach-mx3/qong.c | |||
@@ -0,0 +1,312 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/memory.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/mtd/physmap.h> | ||
25 | #include <linux/mtd/nand.h> | ||
26 | #include <linux/gpio.h> | ||
27 | |||
28 | #include <mach/hardware.h> | ||
29 | #include <mach/irqs.h> | ||
30 | #include <asm/mach-types.h> | ||
31 | #include <asm/mach/arch.h> | ||
32 | #include <asm/mach/time.h> | ||
33 | #include <asm/mach/map.h> | ||
34 | #include <mach/common.h> | ||
35 | #include <asm/page.h> | ||
36 | #include <asm/setup.h> | ||
37 | #include <mach/board-qong.h> | ||
38 | #include <mach/imx-uart.h> | ||
39 | #include <mach/iomux-mx3.h> | ||
40 | #include "devices.h" | ||
41 | |||
42 | /* FPGA defines */ | ||
43 | #define QONG_FPGA_VERSION(major, minor, rev) \ | ||
44 | (((major & 0xF) << 12) | ((minor & 0xF) << 8) | (rev & 0xFF)) | ||
45 | |||
46 | #define QONG_FPGA_BASEADDR CS1_BASE_ADDR | ||
47 | #define QONG_FPGA_PERIPH_SIZE (1 << 24) | ||
48 | |||
49 | #define QONG_FPGA_CTRL_BASEADDR QONG_FPGA_BASEADDR | ||
50 | #define QONG_FPGA_CTRL_SIZE 0x10 | ||
51 | /* FPGA control registers */ | ||
52 | #define QONG_FPGA_CTRL_VERSION 0x00 | ||
53 | |||
54 | #define QONG_DNET_ID 1 | ||
55 | #define QONG_DNET_BASEADDR \ | ||
56 | (QONG_FPGA_BASEADDR + QONG_DNET_ID * QONG_FPGA_PERIPH_SIZE) | ||
57 | #define QONG_DNET_SIZE 0x00001000 | ||
58 | |||
59 | #define QONG_FPGA_IRQ IOMUX_TO_IRQ(MX31_PIN_DTR_DCE1) | ||
60 | |||
61 | /* | ||
62 | * This file contains the board-specific initialization routines. | ||
63 | */ | ||
64 | |||
65 | static struct imxuart_platform_data uart_pdata = { | ||
66 | .flags = IMXUART_HAVE_RTSCTS, | ||
67 | }; | ||
68 | |||
69 | static int uart_pins[] = { | ||
70 | MX31_PIN_CTS1__CTS1, | ||
71 | MX31_PIN_RTS1__RTS1, | ||
72 | MX31_PIN_TXD1__TXD1, | ||
73 | MX31_PIN_RXD1__RXD1 | ||
74 | }; | ||
75 | |||
76 | static inline void mxc_init_imx_uart(void) | ||
77 | { | ||
78 | mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), | ||
79 | "uart-0"); | ||
80 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | ||
81 | } | ||
82 | |||
83 | static struct resource dnet_resources[] = { | ||
84 | [0] = { | ||
85 | .name = "dnet-memory", | ||
86 | .start = QONG_DNET_BASEADDR, | ||
87 | .end = QONG_DNET_BASEADDR + QONG_DNET_SIZE - 1, | ||
88 | .flags = IORESOURCE_MEM, | ||
89 | }, | ||
90 | [1] = { | ||
91 | .start = QONG_FPGA_IRQ, | ||
92 | .end = QONG_FPGA_IRQ, | ||
93 | .flags = IORESOURCE_IRQ, | ||
94 | }, | ||
95 | }; | ||
96 | |||
97 | static struct platform_device dnet_device = { | ||
98 | .name = "dnet", | ||
99 | .id = -1, | ||
100 | .num_resources = ARRAY_SIZE(dnet_resources), | ||
101 | .resource = dnet_resources, | ||
102 | }; | ||
103 | |||
104 | static int __init qong_init_dnet(void) | ||
105 | { | ||
106 | int ret; | ||
107 | |||
108 | ret = platform_device_register(&dnet_device); | ||
109 | return ret; | ||
110 | } | ||
111 | |||
112 | /* MTD NOR flash */ | ||
113 | |||
114 | static struct physmap_flash_data qong_flash_data = { | ||
115 | .width = 2, | ||
116 | }; | ||
117 | |||
118 | static struct resource qong_flash_resource = { | ||
119 | .start = CS0_BASE_ADDR, | ||
120 | .end = CS0_BASE_ADDR + QONG_NOR_SIZE - 1, | ||
121 | .flags = IORESOURCE_MEM, | ||
122 | }; | ||
123 | |||
124 | static struct platform_device qong_nor_mtd_device = { | ||
125 | .name = "physmap-flash", | ||
126 | .id = 0, | ||
127 | .dev = { | ||
128 | .platform_data = &qong_flash_data, | ||
129 | }, | ||
130 | .resource = &qong_flash_resource, | ||
131 | .num_resources = 1, | ||
132 | }; | ||
133 | |||
134 | static void qong_init_nor_mtd(void) | ||
135 | { | ||
136 | (void)platform_device_register(&qong_nor_mtd_device); | ||
137 | } | ||
138 | |||
139 | /* | ||
140 | * Hardware specific access to control-lines | ||
141 | */ | ||
142 | static void qong_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) | ||
143 | { | ||
144 | struct nand_chip *nand_chip = mtd->priv; | ||
145 | |||
146 | if (cmd == NAND_CMD_NONE) | ||
147 | return; | ||
148 | |||
149 | if (ctrl & NAND_CLE) | ||
150 | writeb(cmd, nand_chip->IO_ADDR_W + (1 << 24)); | ||
151 | else | ||
152 | writeb(cmd, nand_chip->IO_ADDR_W + (1 << 23)); | ||
153 | } | ||
154 | |||
155 | /* | ||
156 | * Read the Device Ready pin. | ||
157 | */ | ||
158 | static int qong_nand_device_ready(struct mtd_info *mtd) | ||
159 | { | ||
160 | return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_NFRB)); | ||
161 | } | ||
162 | |||
163 | static void qong_nand_select_chip(struct mtd_info *mtd, int chip) | ||
164 | { | ||
165 | if (chip >= 0) | ||
166 | gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), 0); | ||
167 | else | ||
168 | gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), 1); | ||
169 | } | ||
170 | |||
171 | static struct platform_nand_data qong_nand_data = { | ||
172 | .chip = { | ||
173 | .chip_delay = 20, | ||
174 | .options = 0, | ||
175 | }, | ||
176 | .ctrl = { | ||
177 | .cmd_ctrl = qong_nand_cmd_ctrl, | ||
178 | .dev_ready = qong_nand_device_ready, | ||
179 | .select_chip = qong_nand_select_chip, | ||
180 | } | ||
181 | }; | ||
182 | |||
183 | static struct resource qong_nand_resource = { | ||
184 | .start = CS3_BASE_ADDR, | ||
185 | .end = CS3_BASE_ADDR + SZ_32M - 1, | ||
186 | .flags = IORESOURCE_MEM, | ||
187 | }; | ||
188 | |||
189 | static struct platform_device qong_nand_device = { | ||
190 | .name = "gen_nand", | ||
191 | .id = -1, | ||
192 | .dev = { | ||
193 | .platform_data = &qong_nand_data, | ||
194 | }, | ||
195 | .num_resources = 1, | ||
196 | .resource = &qong_nand_resource, | ||
197 | }; | ||
198 | |||
199 | static void __init qong_init_nand_mtd(void) | ||
200 | { | ||
201 | /* init CS */ | ||
202 | __raw_writel(0x00004f00, CSCR_U(3)); | ||
203 | __raw_writel(0x20013b31, CSCR_L(3)); | ||
204 | __raw_writel(0x00020800, CSCR_A(3)); | ||
205 | mxc_iomux_set_gpr(MUX_SDCTL_CSD1_SEL, true); | ||
206 | |||
207 | /* enable pin */ | ||
208 | mxc_iomux_mode(IOMUX_MODE(MX31_PIN_NFCE_B, IOMUX_CONFIG_GPIO)); | ||
209 | if (!gpio_request(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), "nand_enable")) | ||
210 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), 0); | ||
211 | |||
212 | /* ready/busy pin */ | ||
213 | mxc_iomux_mode(IOMUX_MODE(MX31_PIN_NFRB, IOMUX_CONFIG_GPIO)); | ||
214 | if (!gpio_request(IOMUX_TO_GPIO(MX31_PIN_NFRB), "nand_rdy")) | ||
215 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_NFRB)); | ||
216 | |||
217 | /* write protect pin */ | ||
218 | mxc_iomux_mode(IOMUX_MODE(MX31_PIN_NFWP_B, IOMUX_CONFIG_GPIO)); | ||
219 | if (!gpio_request(IOMUX_TO_GPIO(MX31_PIN_NFWP_B), "nand_wp")) | ||
220 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_NFWP_B)); | ||
221 | |||
222 | platform_device_register(&qong_nand_device); | ||
223 | } | ||
224 | |||
225 | static void __init qong_init_fpga(void) | ||
226 | { | ||
227 | void __iomem *regs; | ||
228 | u32 fpga_ver; | ||
229 | |||
230 | regs = ioremap(QONG_FPGA_CTRL_BASEADDR, QONG_FPGA_CTRL_SIZE); | ||
231 | if (!regs) { | ||
232 | printk(KERN_ERR "%s: failed to map registers, aborting.\n", | ||
233 | __func__); | ||
234 | return; | ||
235 | } | ||
236 | |||
237 | fpga_ver = readl(regs + QONG_FPGA_CTRL_VERSION); | ||
238 | iounmap(regs); | ||
239 | printk(KERN_INFO "Qong FPGA version %d.%d.%d\n", | ||
240 | (fpga_ver & 0xF000) >> 12, | ||
241 | (fpga_ver & 0x0F00) >> 8, fpga_ver & 0x00FF); | ||
242 | if (fpga_ver < QONG_FPGA_VERSION(0, 8, 7)) { | ||
243 | printk(KERN_ERR "qong: Unexpected FPGA version, FPGA-based " | ||
244 | "devices won't be registered!\n"); | ||
245 | return; | ||
246 | } | ||
247 | |||
248 | /* register FPGA-based devices */ | ||
249 | qong_init_nand_mtd(); | ||
250 | qong_init_dnet(); | ||
251 | } | ||
252 | |||
253 | /* | ||
254 | * This structure defines the MX31 memory map. | ||
255 | */ | ||
256 | static struct map_desc qong_io_desc[] __initdata = { | ||
257 | { | ||
258 | .virtual = AIPS1_BASE_ADDR_VIRT, | ||
259 | .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), | ||
260 | .length = AIPS1_SIZE, | ||
261 | .type = MT_DEVICE_NONSHARED | ||
262 | }, { | ||
263 | .virtual = AIPS2_BASE_ADDR_VIRT, | ||
264 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), | ||
265 | .length = AIPS2_SIZE, | ||
266 | .type = MT_DEVICE_NONSHARED | ||
267 | } | ||
268 | }; | ||
269 | |||
270 | /* | ||
271 | * Set up static virtual mappings. | ||
272 | */ | ||
273 | static void __init qong_map_io(void) | ||
274 | { | ||
275 | mxc_map_io(); | ||
276 | iotable_init(qong_io_desc, ARRAY_SIZE(qong_io_desc)); | ||
277 | } | ||
278 | |||
279 | /* | ||
280 | * Board specific initialization. | ||
281 | */ | ||
282 | static void __init mxc_board_init(void) | ||
283 | { | ||
284 | mxc_init_imx_uart(); | ||
285 | qong_init_nor_mtd(); | ||
286 | qong_init_fpga(); | ||
287 | } | ||
288 | |||
289 | static void __init qong_timer_init(void) | ||
290 | { | ||
291 | mx31_clocks_init(26000000); | ||
292 | } | ||
293 | |||
294 | static struct sys_timer qong_timer = { | ||
295 | .init = qong_timer_init, | ||
296 | }; | ||
297 | |||
298 | /* | ||
299 | * The following uses standard kernel macros defined in arch.h in order to | ||
300 | * initialize __mach_desc_QONG data structure. | ||
301 | */ | ||
302 | |||
303 | MACHINE_START(QONG, "Dave/DENX QongEVB-LITE") | ||
304 | /* Maintainer: DENX Software Engineering GmbH */ | ||
305 | .phys_io = AIPS1_BASE_ADDR, | ||
306 | .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, | ||
307 | .boot_params = PHYS_OFFSET + 0x100, | ||
308 | .map_io = qong_map_io, | ||
309 | .init_irq = mxc_init_irq, | ||
310 | .init_machine = mxc_board_init, | ||
311 | .timer = &qong_timer, | ||
312 | MACHINE_END | ||
diff --git a/arch/arm/mach-netx/include/mach/system.h b/arch/arm/mach-netx/include/mach/system.h index 6c1023b8a9ab..dc7b4bc003c5 100644 --- a/arch/arm/mach-netx/include/mach/system.h +++ b/arch/arm/mach-netx/include/mach/system.h | |||
@@ -28,7 +28,7 @@ static inline void arch_idle(void) | |||
28 | cpu_do_idle(); | 28 | cpu_do_idle(); |
29 | } | 29 | } |
30 | 30 | ||
31 | static inline void arch_reset(char mode) | 31 | static inline void arch_reset(char mode, const char *cmd) |
32 | { | 32 | { |
33 | writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES, | 33 | writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES, |
34 | NETX_SYSTEM_RES_CR); | 34 | NETX_SYSTEM_RES_CR); |
diff --git a/arch/arm/mach-ns9xxx/include/mach/system.h b/arch/arm/mach-ns9xxx/include/mach/system.h index e2068c57415f..1561588ca364 100644 --- a/arch/arm/mach-ns9xxx/include/mach/system.h +++ b/arch/arm/mach-ns9xxx/include/mach/system.h | |||
@@ -20,7 +20,7 @@ static inline void arch_idle(void) | |||
20 | cpu_do_idle(); | 20 | cpu_do_idle(); |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline void arch_reset(char mode) | 23 | static inline void arch_reset(char mode, const char *cmd) |
24 | { | 24 | { |
25 | #ifdef CONFIG_PROCESSOR_NS9360 | 25 | #ifdef CONFIG_PROCESSOR_NS9360 |
26 | if (processor_is_ns9360()) | 26 | if (processor_is_ns9360()) |
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index 5fba20731710..dafe4f71d15f 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c | |||
@@ -20,41 +20,161 @@ | |||
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | 21 | ||
22 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
23 | #include <asm/clkdev.h> | ||
23 | 24 | ||
24 | #include <mach/cpu.h> | 25 | #include <mach/cpu.h> |
25 | #include <mach/usb.h> | 26 | #include <mach/usb.h> |
26 | #include <mach/clock.h> | 27 | #include <mach/clock.h> |
27 | #include <mach/sram.h> | 28 | #include <mach/sram.h> |
28 | 29 | ||
30 | static const struct clkops clkops_generic; | ||
31 | static const struct clkops clkops_uart; | ||
32 | static const struct clkops clkops_dspck; | ||
33 | |||
29 | #include "clock.h" | 34 | #include "clock.h" |
30 | 35 | ||
36 | static int clk_omap1_dummy_enable(struct clk *clk) | ||
37 | { | ||
38 | return 0; | ||
39 | } | ||
40 | |||
41 | static void clk_omap1_dummy_disable(struct clk *clk) | ||
42 | { | ||
43 | } | ||
44 | |||
45 | static const struct clkops clkops_dummy = { | ||
46 | .enable = clk_omap1_dummy_enable, | ||
47 | .disable = clk_omap1_dummy_disable, | ||
48 | }; | ||
49 | |||
50 | static struct clk dummy_ck = { | ||
51 | .name = "dummy", | ||
52 | .ops = &clkops_dummy, | ||
53 | .flags = RATE_FIXED, | ||
54 | }; | ||
55 | |||
56 | struct omap_clk { | ||
57 | u32 cpu; | ||
58 | struct clk_lookup lk; | ||
59 | }; | ||
60 | |||
61 | #define CLK(dev, con, ck, cp) \ | ||
62 | { \ | ||
63 | .cpu = cp, \ | ||
64 | .lk = { \ | ||
65 | .dev_id = dev, \ | ||
66 | .con_id = con, \ | ||
67 | .clk = ck, \ | ||
68 | }, \ | ||
69 | } | ||
70 | |||
71 | #define CK_310 (1 << 0) | ||
72 | #define CK_730 (1 << 1) | ||
73 | #define CK_1510 (1 << 2) | ||
74 | #define CK_16XX (1 << 3) | ||
75 | |||
76 | static struct omap_clk omap_clks[] = { | ||
77 | /* non-ULPD clocks */ | ||
78 | CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310), | ||
79 | CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310), | ||
80 | /* CK_GEN1 clocks */ | ||
81 | CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX), | ||
82 | CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX), | ||
83 | CLK(NULL, "arm_ck", &arm_ck, CK_16XX | CK_1510 | CK_310), | ||
84 | CLK(NULL, "armper_ck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310), | ||
85 | CLK(NULL, "arm_gpio_ck", &arm_gpio_ck, CK_1510 | CK_310), | ||
86 | CLK(NULL, "armxor_ck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310), | ||
87 | CLK(NULL, "armtim_ck", &armtim_ck.clk, CK_16XX | CK_1510 | CK_310), | ||
88 | CLK("omap_wdt", "fck", &armwdt_ck.clk, CK_16XX | CK_1510 | CK_310), | ||
89 | CLK("omap_wdt", "ick", &armper_ck.clk, CK_16XX), | ||
90 | CLK("omap_wdt", "ick", &dummy_ck, CK_1510 | CK_310), | ||
91 | CLK(NULL, "arminth_ck", &arminth_ck1510, CK_1510 | CK_310), | ||
92 | CLK(NULL, "arminth_ck", &arminth_ck16xx, CK_16XX), | ||
93 | /* CK_GEN2 clocks */ | ||
94 | CLK(NULL, "dsp_ck", &dsp_ck, CK_16XX | CK_1510 | CK_310), | ||
95 | CLK(NULL, "dspmmu_ck", &dspmmu_ck, CK_16XX | CK_1510 | CK_310), | ||
96 | CLK(NULL, "dspper_ck", &dspper_ck, CK_16XX | CK_1510 | CK_310), | ||
97 | CLK(NULL, "dspxor_ck", &dspxor_ck, CK_16XX | CK_1510 | CK_310), | ||
98 | CLK(NULL, "dsptim_ck", &dsptim_ck, CK_16XX | CK_1510 | CK_310), | ||
99 | /* CK_GEN3 clocks */ | ||
100 | CLK(NULL, "tc_ck", &tc_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_730), | ||
101 | CLK(NULL, "tipb_ck", &tipb_ck, CK_1510 | CK_310), | ||
102 | CLK(NULL, "l3_ocpi_ck", &l3_ocpi_ck, CK_16XX), | ||
103 | CLK(NULL, "tc1_ck", &tc1_ck, CK_16XX), | ||
104 | CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX), | ||
105 | CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310), | ||
106 | CLK(NULL, "dma_lcdfree_ck", &dma_lcdfree_ck, CK_16XX), | ||
107 | CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | CK_1510 | CK_310), | ||
108 | CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310), | ||
109 | CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX), | ||
110 | CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX), | ||
111 | CLK(NULL, "lcd_ck", &lcd_ck_16xx, CK_16XX | CK_730), | ||
112 | CLK(NULL, "lcd_ck", &lcd_ck_1510.clk, CK_1510 | CK_310), | ||
113 | /* ULPD clocks */ | ||
114 | CLK(NULL, "uart1_ck", &uart1_1510, CK_1510 | CK_310), | ||
115 | CLK(NULL, "uart1_ck", &uart1_16xx.clk, CK_16XX), | ||
116 | CLK(NULL, "uart2_ck", &uart2_ck, CK_16XX | CK_1510 | CK_310), | ||
117 | CLK(NULL, "uart3_ck", &uart3_1510, CK_1510 | CK_310), | ||
118 | CLK(NULL, "uart3_ck", &uart3_16xx.clk, CK_16XX), | ||
119 | CLK(NULL, "usb_clko", &usb_clko, CK_16XX | CK_1510 | CK_310), | ||
120 | CLK(NULL, "usb_hhc_ck", &usb_hhc_ck1510, CK_1510 | CK_310), | ||
121 | CLK(NULL, "usb_hhc_ck", &usb_hhc_ck16xx, CK_16XX), | ||
122 | CLK(NULL, "usb_dc_ck", &usb_dc_ck, CK_16XX), | ||
123 | CLK(NULL, "mclk", &mclk_1510, CK_1510 | CK_310), | ||
124 | CLK(NULL, "mclk", &mclk_16xx, CK_16XX), | ||
125 | CLK(NULL, "bclk", &bclk_1510, CK_1510 | CK_310), | ||
126 | CLK(NULL, "bclk", &bclk_16xx, CK_16XX), | ||
127 | CLK("mmci-omap.0", "fck", &mmc1_ck, CK_16XX | CK_1510 | CK_310), | ||
128 | CLK("mmci-omap.0", "ick", &armper_ck.clk, CK_16XX | CK_1510 | CK_310), | ||
129 | CLK("mmci-omap.1", "fck", &mmc2_ck, CK_16XX), | ||
130 | CLK("mmci-omap.1", "ick", &armper_ck.clk, CK_16XX), | ||
131 | /* Virtual clocks */ | ||
132 | CLK(NULL, "mpu", &virtual_ck_mpu, CK_16XX | CK_1510 | CK_310), | ||
133 | CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310), | ||
134 | CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX), | ||
135 | CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310), | ||
136 | CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310), | ||
137 | CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX), | ||
138 | CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310), | ||
139 | CLK("omap-mcbsp.2", "ick", &armper_ck.clk, CK_16XX), | ||
140 | CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_1510 | CK_310), | ||
141 | CLK("omap-mcbsp.3", "ick", &dspper_ck, CK_16XX), | ||
142 | CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_1510 | CK_310), | ||
143 | CLK("omap-mcbsp.1", "fck", &dspxor_ck, CK_16XX | CK_1510 | CK_310), | ||
144 | CLK("omap-mcbsp.2", "fck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310), | ||
145 | CLK("omap-mcbsp.3", "fck", &dspxor_ck, CK_16XX | CK_1510 | CK_310), | ||
146 | }; | ||
147 | |||
148 | static int omap1_clk_enable_generic(struct clk * clk); | ||
149 | static int omap1_clk_enable(struct clk *clk); | ||
150 | static void omap1_clk_disable_generic(struct clk * clk); | ||
151 | static void omap1_clk_disable(struct clk *clk); | ||
152 | |||
31 | __u32 arm_idlect1_mask; | 153 | __u32 arm_idlect1_mask; |
32 | 154 | ||
33 | /*------------------------------------------------------------------------- | 155 | /*------------------------------------------------------------------------- |
34 | * Omap1 specific clock functions | 156 | * Omap1 specific clock functions |
35 | *-------------------------------------------------------------------------*/ | 157 | *-------------------------------------------------------------------------*/ |
36 | 158 | ||
37 | static void omap1_watchdog_recalc(struct clk * clk) | 159 | static unsigned long omap1_watchdog_recalc(struct clk *clk) |
38 | { | 160 | { |
39 | clk->rate = clk->parent->rate / 14; | 161 | return clk->parent->rate / 14; |
40 | } | 162 | } |
41 | 163 | ||
42 | static void omap1_uart_recalc(struct clk * clk) | 164 | static unsigned long omap1_uart_recalc(struct clk *clk) |
43 | { | 165 | { |
44 | unsigned int val = omap_readl(clk->enable_reg); | 166 | unsigned int val = __raw_readl(clk->enable_reg); |
45 | if (val & clk->enable_bit) | 167 | return val & clk->enable_bit ? 48000000 : 12000000; |
46 | clk->rate = 48000000; | ||
47 | else | ||
48 | clk->rate = 12000000; | ||
49 | } | 168 | } |
50 | 169 | ||
51 | static void omap1_sossi_recalc(struct clk *clk) | 170 | static unsigned long omap1_sossi_recalc(struct clk *clk) |
52 | { | 171 | { |
53 | u32 div = omap_readl(MOD_CONF_CTRL_1); | 172 | u32 div = omap_readl(MOD_CONF_CTRL_1); |
54 | 173 | ||
55 | div = (div >> 17) & 0x7; | 174 | div = (div >> 17) & 0x7; |
56 | div++; | 175 | div++; |
57 | clk->rate = clk->parent->rate / div; | 176 | |
177 | return clk->parent->rate / div; | ||
58 | } | 178 | } |
59 | 179 | ||
60 | static int omap1_clk_enable_dsp_domain(struct clk *clk) | 180 | static int omap1_clk_enable_dsp_domain(struct clk *clk) |
@@ -78,6 +198,11 @@ static void omap1_clk_disable_dsp_domain(struct clk *clk) | |||
78 | } | 198 | } |
79 | } | 199 | } |
80 | 200 | ||
201 | static const struct clkops clkops_dspck = { | ||
202 | .enable = &omap1_clk_enable_dsp_domain, | ||
203 | .disable = &omap1_clk_disable_dsp_domain, | ||
204 | }; | ||
205 | |||
81 | static int omap1_clk_enable_uart_functional(struct clk *clk) | 206 | static int omap1_clk_enable_uart_functional(struct clk *clk) |
82 | { | 207 | { |
83 | int ret; | 208 | int ret; |
@@ -105,6 +230,11 @@ static void omap1_clk_disable_uart_functional(struct clk *clk) | |||
105 | omap1_clk_disable_generic(clk); | 230 | omap1_clk_disable_generic(clk); |
106 | } | 231 | } |
107 | 232 | ||
233 | static const struct clkops clkops_uart = { | ||
234 | .enable = &omap1_clk_enable_uart_functional, | ||
235 | .disable = &omap1_clk_disable_uart_functional, | ||
236 | }; | ||
237 | |||
108 | static void omap1_clk_allow_idle(struct clk *clk) | 238 | static void omap1_clk_allow_idle(struct clk *clk) |
109 | { | 239 | { |
110 | struct arm_idlect1_clk * iclk = (struct arm_idlect1_clk *)clk; | 240 | struct arm_idlect1_clk * iclk = (struct arm_idlect1_clk *)clk; |
@@ -197,9 +327,6 @@ static int calc_dsor_exp(struct clk *clk, unsigned long rate) | |||
197 | struct clk * parent; | 327 | struct clk * parent; |
198 | unsigned dsor_exp; | 328 | unsigned dsor_exp; |
199 | 329 | ||
200 | if (unlikely(!(clk->flags & RATE_CKCTL))) | ||
201 | return -EINVAL; | ||
202 | |||
203 | parent = clk->parent; | 330 | parent = clk->parent; |
204 | if (unlikely(parent == NULL)) | 331 | if (unlikely(parent == NULL)) |
205 | return -EIO; | 332 | return -EIO; |
@@ -215,22 +342,15 @@ static int calc_dsor_exp(struct clk *clk, unsigned long rate) | |||
215 | return dsor_exp; | 342 | return dsor_exp; |
216 | } | 343 | } |
217 | 344 | ||
218 | static void omap1_ckctl_recalc(struct clk * clk) | 345 | static unsigned long omap1_ckctl_recalc(struct clk *clk) |
219 | { | 346 | { |
220 | int dsor; | ||
221 | |||
222 | /* Calculate divisor encoded as 2-bit exponent */ | 347 | /* Calculate divisor encoded as 2-bit exponent */ |
223 | dsor = 1 << (3 & (omap_readw(ARM_CKCTL) >> clk->rate_offset)); | 348 | int dsor = 1 << (3 & (omap_readw(ARM_CKCTL) >> clk->rate_offset)); |
224 | 349 | ||
225 | if (unlikely(clk->rate == clk->parent->rate / dsor)) | 350 | return clk->parent->rate / dsor; |
226 | return; /* No change, quick exit */ | ||
227 | clk->rate = clk->parent->rate / dsor; | ||
228 | |||
229 | if (unlikely(clk->flags & RATE_PROPAGATES)) | ||
230 | propagate_rate(clk); | ||
231 | } | 351 | } |
232 | 352 | ||
233 | static void omap1_ckctl_recalc_dsp_domain(struct clk * clk) | 353 | static unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk) |
234 | { | 354 | { |
235 | int dsor; | 355 | int dsor; |
236 | 356 | ||
@@ -245,12 +365,7 @@ static void omap1_ckctl_recalc_dsp_domain(struct clk * clk) | |||
245 | dsor = 1 << (3 & (__raw_readw(DSP_CKCTL) >> clk->rate_offset)); | 365 | dsor = 1 << (3 & (__raw_readw(DSP_CKCTL) >> clk->rate_offset)); |
246 | omap1_clk_disable(&api_ck.clk); | 366 | omap1_clk_disable(&api_ck.clk); |
247 | 367 | ||
248 | if (unlikely(clk->rate == clk->parent->rate / dsor)) | 368 | return clk->parent->rate / dsor; |
249 | return; /* No change, quick exit */ | ||
250 | clk->rate = clk->parent->rate / dsor; | ||
251 | |||
252 | if (unlikely(clk->flags & RATE_PROPAGATES)) | ||
253 | propagate_rate(clk); | ||
254 | } | 369 | } |
255 | 370 | ||
256 | /* MPU virtual clock functions */ | 371 | /* MPU virtual clock functions */ |
@@ -289,35 +404,57 @@ static int omap1_select_table_rate(struct clk * clk, unsigned long rate) | |||
289 | omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val); | 404 | omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val); |
290 | 405 | ||
291 | ck_dpll1.rate = ptr->pll_rate; | 406 | ck_dpll1.rate = ptr->pll_rate; |
292 | propagate_rate(&ck_dpll1); | ||
293 | return 0; | 407 | return 0; |
294 | } | 408 | } |
295 | 409 | ||
296 | static int omap1_clk_set_rate_dsp_domain(struct clk *clk, unsigned long rate) | 410 | static int omap1_clk_set_rate_dsp_domain(struct clk *clk, unsigned long rate) |
297 | { | 411 | { |
298 | int ret = -EINVAL; | 412 | int dsor_exp; |
299 | int dsor_exp; | 413 | u16 regval; |
300 | __u16 regval; | ||
301 | |||
302 | if (clk->flags & RATE_CKCTL) { | ||
303 | dsor_exp = calc_dsor_exp(clk, rate); | ||
304 | if (dsor_exp > 3) | ||
305 | dsor_exp = -EINVAL; | ||
306 | if (dsor_exp < 0) | ||
307 | return dsor_exp; | ||
308 | |||
309 | regval = __raw_readw(DSP_CKCTL); | ||
310 | regval &= ~(3 << clk->rate_offset); | ||
311 | regval |= dsor_exp << clk->rate_offset; | ||
312 | __raw_writew(regval, DSP_CKCTL); | ||
313 | clk->rate = clk->parent->rate / (1 << dsor_exp); | ||
314 | ret = 0; | ||
315 | } | ||
316 | 414 | ||
317 | if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES))) | 415 | dsor_exp = calc_dsor_exp(clk, rate); |
318 | propagate_rate(clk); | 416 | if (dsor_exp > 3) |
417 | dsor_exp = -EINVAL; | ||
418 | if (dsor_exp < 0) | ||
419 | return dsor_exp; | ||
319 | 420 | ||
320 | return ret; | 421 | regval = __raw_readw(DSP_CKCTL); |
422 | regval &= ~(3 << clk->rate_offset); | ||
423 | regval |= dsor_exp << clk->rate_offset; | ||
424 | __raw_writew(regval, DSP_CKCTL); | ||
425 | clk->rate = clk->parent->rate / (1 << dsor_exp); | ||
426 | |||
427 | return 0; | ||
428 | } | ||
429 | |||
430 | static long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate) | ||
431 | { | ||
432 | int dsor_exp = calc_dsor_exp(clk, rate); | ||
433 | if (dsor_exp < 0) | ||
434 | return dsor_exp; | ||
435 | if (dsor_exp > 3) | ||
436 | dsor_exp = 3; | ||
437 | return clk->parent->rate / (1 << dsor_exp); | ||
438 | } | ||
439 | |||
440 | static int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate) | ||
441 | { | ||
442 | int dsor_exp; | ||
443 | u16 regval; | ||
444 | |||
445 | dsor_exp = calc_dsor_exp(clk, rate); | ||
446 | if (dsor_exp > 3) | ||
447 | dsor_exp = -EINVAL; | ||
448 | if (dsor_exp < 0) | ||
449 | return dsor_exp; | ||
450 | |||
451 | regval = omap_readw(ARM_CKCTL); | ||
452 | regval &= ~(3 << clk->rate_offset); | ||
453 | regval |= dsor_exp << clk->rate_offset; | ||
454 | regval = verify_ckctl_value(regval); | ||
455 | omap_writew(regval, ARM_CKCTL); | ||
456 | clk->rate = clk->parent->rate / (1 << dsor_exp); | ||
457 | return 0; | ||
321 | } | 458 | } |
322 | 459 | ||
323 | static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate) | 460 | static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate) |
@@ -372,14 +509,14 @@ static int omap1_set_uart_rate(struct clk * clk, unsigned long rate) | |||
372 | { | 509 | { |
373 | unsigned int val; | 510 | unsigned int val; |
374 | 511 | ||
375 | val = omap_readl(clk->enable_reg); | 512 | val = __raw_readl(clk->enable_reg); |
376 | if (rate == 12000000) | 513 | if (rate == 12000000) |
377 | val &= ~(1 << clk->enable_bit); | 514 | val &= ~(1 << clk->enable_bit); |
378 | else if (rate == 48000000) | 515 | else if (rate == 48000000) |
379 | val |= (1 << clk->enable_bit); | 516 | val |= (1 << clk->enable_bit); |
380 | else | 517 | else |
381 | return -EINVAL; | 518 | return -EINVAL; |
382 | omap_writel(val, clk->enable_reg); | 519 | __raw_writel(val, clk->enable_reg); |
383 | clk->rate = rate; | 520 | clk->rate = rate; |
384 | 521 | ||
385 | return 0; | 522 | return 0; |
@@ -398,8 +535,8 @@ static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate) | |||
398 | else | 535 | else |
399 | ratio_bits = (dsor - 2) << 2; | 536 | ratio_bits = (dsor - 2) << 2; |
400 | 537 | ||
401 | ratio_bits |= omap_readw(clk->enable_reg) & ~0xfd; | 538 | ratio_bits |= __raw_readw(clk->enable_reg) & ~0xfd; |
402 | omap_writew(ratio_bits, clk->enable_reg); | 539 | __raw_writew(ratio_bits, clk->enable_reg); |
403 | 540 | ||
404 | return 0; | 541 | return 0; |
405 | } | 542 | } |
@@ -423,8 +560,6 @@ static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate) | |||
423 | omap_writel(l, MOD_CONF_CTRL_1); | 560 | omap_writel(l, MOD_CONF_CTRL_1); |
424 | 561 | ||
425 | clk->rate = p_rate / (div + 1); | 562 | clk->rate = p_rate / (div + 1); |
426 | if (unlikely(clk->flags & RATE_PROPAGATES)) | ||
427 | propagate_rate(clk); | ||
428 | 563 | ||
429 | return 0; | 564 | return 0; |
430 | } | 565 | } |
@@ -440,8 +575,8 @@ static void omap1_init_ext_clk(struct clk * clk) | |||
440 | __u16 ratio_bits; | 575 | __u16 ratio_bits; |
441 | 576 | ||
442 | /* Determine current rate and ensure clock is based on 96MHz APLL */ | 577 | /* Determine current rate and ensure clock is based on 96MHz APLL */ |
443 | ratio_bits = omap_readw(clk->enable_reg) & ~1; | 578 | ratio_bits = __raw_readw(clk->enable_reg) & ~1; |
444 | omap_writew(ratio_bits, clk->enable_reg); | 579 | __raw_writew(ratio_bits, clk->enable_reg); |
445 | 580 | ||
446 | ratio_bits = (ratio_bits & 0xfc) >> 2; | 581 | ratio_bits = (ratio_bits & 0xfc) >> 2; |
447 | if (ratio_bits > 6) | 582 | if (ratio_bits > 6) |
@@ -468,7 +603,7 @@ static int omap1_clk_enable(struct clk *clk) | |||
468 | omap1_clk_deny_idle(clk->parent); | 603 | omap1_clk_deny_idle(clk->parent); |
469 | } | 604 | } |
470 | 605 | ||
471 | ret = clk->enable(clk); | 606 | ret = clk->ops->enable(clk); |
472 | 607 | ||
473 | if (unlikely(ret != 0) && clk->parent) { | 608 | if (unlikely(ret != 0) && clk->parent) { |
474 | omap1_clk_disable(clk->parent); | 609 | omap1_clk_disable(clk->parent); |
@@ -482,7 +617,7 @@ static int omap1_clk_enable(struct clk *clk) | |||
482 | static void omap1_clk_disable(struct clk *clk) | 617 | static void omap1_clk_disable(struct clk *clk) |
483 | { | 618 | { |
484 | if (clk->usecount > 0 && !(--clk->usecount)) { | 619 | if (clk->usecount > 0 && !(--clk->usecount)) { |
485 | clk->disable(clk); | 620 | clk->ops->disable(clk); |
486 | if (likely(clk->parent)) { | 621 | if (likely(clk->parent)) { |
487 | omap1_clk_disable(clk->parent); | 622 | omap1_clk_disable(clk->parent); |
488 | if (clk->flags & CLOCK_NO_IDLE_PARENT) | 623 | if (clk->flags & CLOCK_NO_IDLE_PARENT) |
@@ -496,9 +631,6 @@ static int omap1_clk_enable_generic(struct clk *clk) | |||
496 | __u16 regval16; | 631 | __u16 regval16; |
497 | __u32 regval32; | 632 | __u32 regval32; |
498 | 633 | ||
499 | if (clk->flags & ALWAYS_ENABLED) | ||
500 | return 0; | ||
501 | |||
502 | if (unlikely(clk->enable_reg == NULL)) { | 634 | if (unlikely(clk->enable_reg == NULL)) { |
503 | printk(KERN_ERR "clock.c: Enable for %s without enable code\n", | 635 | printk(KERN_ERR "clock.c: Enable for %s without enable code\n", |
504 | clk->name); | 636 | clk->name); |
@@ -506,25 +638,13 @@ static int omap1_clk_enable_generic(struct clk *clk) | |||
506 | } | 638 | } |
507 | 639 | ||
508 | if (clk->flags & ENABLE_REG_32BIT) { | 640 | if (clk->flags & ENABLE_REG_32BIT) { |
509 | if (clk->flags & VIRTUAL_IO_ADDRESS) { | 641 | regval32 = __raw_readl(clk->enable_reg); |
510 | regval32 = __raw_readl(clk->enable_reg); | 642 | regval32 |= (1 << clk->enable_bit); |
511 | regval32 |= (1 << clk->enable_bit); | 643 | __raw_writel(regval32, clk->enable_reg); |
512 | __raw_writel(regval32, clk->enable_reg); | ||
513 | } else { | ||
514 | regval32 = omap_readl(clk->enable_reg); | ||
515 | regval32 |= (1 << clk->enable_bit); | ||
516 | omap_writel(regval32, clk->enable_reg); | ||
517 | } | ||
518 | } else { | 644 | } else { |
519 | if (clk->flags & VIRTUAL_IO_ADDRESS) { | 645 | regval16 = __raw_readw(clk->enable_reg); |
520 | regval16 = __raw_readw(clk->enable_reg); | 646 | regval16 |= (1 << clk->enable_bit); |
521 | regval16 |= (1 << clk->enable_bit); | 647 | __raw_writew(regval16, clk->enable_reg); |
522 | __raw_writew(regval16, clk->enable_reg); | ||
523 | } else { | ||
524 | regval16 = omap_readw(clk->enable_reg); | ||
525 | regval16 |= (1 << clk->enable_bit); | ||
526 | omap_writew(regval16, clk->enable_reg); | ||
527 | } | ||
528 | } | 648 | } |
529 | 649 | ||
530 | return 0; | 650 | return 0; |
@@ -539,44 +659,26 @@ static void omap1_clk_disable_generic(struct clk *clk) | |||
539 | return; | 659 | return; |
540 | 660 | ||
541 | if (clk->flags & ENABLE_REG_32BIT) { | 661 | if (clk->flags & ENABLE_REG_32BIT) { |
542 | if (clk->flags & VIRTUAL_IO_ADDRESS) { | 662 | regval32 = __raw_readl(clk->enable_reg); |
543 | regval32 = __raw_readl(clk->enable_reg); | 663 | regval32 &= ~(1 << clk->enable_bit); |
544 | regval32 &= ~(1 << clk->enable_bit); | 664 | __raw_writel(regval32, clk->enable_reg); |
545 | __raw_writel(regval32, clk->enable_reg); | ||
546 | } else { | ||
547 | regval32 = omap_readl(clk->enable_reg); | ||
548 | regval32 &= ~(1 << clk->enable_bit); | ||
549 | omap_writel(regval32, clk->enable_reg); | ||
550 | } | ||
551 | } else { | 665 | } else { |
552 | if (clk->flags & VIRTUAL_IO_ADDRESS) { | 666 | regval16 = __raw_readw(clk->enable_reg); |
553 | regval16 = __raw_readw(clk->enable_reg); | 667 | regval16 &= ~(1 << clk->enable_bit); |
554 | regval16 &= ~(1 << clk->enable_bit); | 668 | __raw_writew(regval16, clk->enable_reg); |
555 | __raw_writew(regval16, clk->enable_reg); | ||
556 | } else { | ||
557 | regval16 = omap_readw(clk->enable_reg); | ||
558 | regval16 &= ~(1 << clk->enable_bit); | ||
559 | omap_writew(regval16, clk->enable_reg); | ||
560 | } | ||
561 | } | 669 | } |
562 | } | 670 | } |
563 | 671 | ||
672 | static const struct clkops clkops_generic = { | ||
673 | .enable = &omap1_clk_enable_generic, | ||
674 | .disable = &omap1_clk_disable_generic, | ||
675 | }; | ||
676 | |||
564 | static long omap1_clk_round_rate(struct clk *clk, unsigned long rate) | 677 | static long omap1_clk_round_rate(struct clk *clk, unsigned long rate) |
565 | { | 678 | { |
566 | int dsor_exp; | ||
567 | |||
568 | if (clk->flags & RATE_FIXED) | 679 | if (clk->flags & RATE_FIXED) |
569 | return clk->rate; | 680 | return clk->rate; |
570 | 681 | ||
571 | if (clk->flags & RATE_CKCTL) { | ||
572 | dsor_exp = calc_dsor_exp(clk, rate); | ||
573 | if (dsor_exp < 0) | ||
574 | return dsor_exp; | ||
575 | if (dsor_exp > 3) | ||
576 | dsor_exp = 3; | ||
577 | return clk->parent->rate / (1 << dsor_exp); | ||
578 | } | ||
579 | |||
580 | if (clk->round_rate != NULL) | 682 | if (clk->round_rate != NULL) |
581 | return clk->round_rate(clk, rate); | 683 | return clk->round_rate(clk, rate); |
582 | 684 | ||
@@ -586,30 +688,9 @@ static long omap1_clk_round_rate(struct clk *clk, unsigned long rate) | |||
586 | static int omap1_clk_set_rate(struct clk *clk, unsigned long rate) | 688 | static int omap1_clk_set_rate(struct clk *clk, unsigned long rate) |
587 | { | 689 | { |
588 | int ret = -EINVAL; | 690 | int ret = -EINVAL; |
589 | int dsor_exp; | ||
590 | __u16 regval; | ||
591 | 691 | ||
592 | if (clk->set_rate) | 692 | if (clk->set_rate) |
593 | ret = clk->set_rate(clk, rate); | 693 | ret = clk->set_rate(clk, rate); |
594 | else if (clk->flags & RATE_CKCTL) { | ||
595 | dsor_exp = calc_dsor_exp(clk, rate); | ||
596 | if (dsor_exp > 3) | ||
597 | dsor_exp = -EINVAL; | ||
598 | if (dsor_exp < 0) | ||
599 | return dsor_exp; | ||
600 | |||
601 | regval = omap_readw(ARM_CKCTL); | ||
602 | regval &= ~(3 << clk->rate_offset); | ||
603 | regval |= dsor_exp << clk->rate_offset; | ||
604 | regval = verify_ckctl_value(regval); | ||
605 | omap_writew(regval, ARM_CKCTL); | ||
606 | clk->rate = clk->parent->rate / (1 << dsor_exp); | ||
607 | ret = 0; | ||
608 | } | ||
609 | |||
610 | if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES))) | ||
611 | propagate_rate(clk); | ||
612 | |||
613 | return ret; | 694 | return ret; |
614 | } | 695 | } |
615 | 696 | ||
@@ -632,17 +713,10 @@ static void __init omap1_clk_disable_unused(struct clk *clk) | |||
632 | } | 713 | } |
633 | 714 | ||
634 | /* Is the clock already disabled? */ | 715 | /* Is the clock already disabled? */ |
635 | if (clk->flags & ENABLE_REG_32BIT) { | 716 | if (clk->flags & ENABLE_REG_32BIT) |
636 | if (clk->flags & VIRTUAL_IO_ADDRESS) | 717 | regval32 = __raw_readl(clk->enable_reg); |
637 | regval32 = __raw_readl(clk->enable_reg); | 718 | else |
638 | else | 719 | regval32 = __raw_readw(clk->enable_reg); |
639 | regval32 = omap_readl(clk->enable_reg); | ||
640 | } else { | ||
641 | if (clk->flags & VIRTUAL_IO_ADDRESS) | ||
642 | regval32 = __raw_readw(clk->enable_reg); | ||
643 | else | ||
644 | regval32 = omap_readw(clk->enable_reg); | ||
645 | } | ||
646 | 720 | ||
647 | if ((regval32 & (1 << clk->enable_bit)) == 0) | 721 | if ((regval32 & (1 << clk->enable_bit)) == 0) |
648 | return; | 722 | return; |
@@ -659,7 +733,7 @@ static void __init omap1_clk_disable_unused(struct clk *clk) | |||
659 | } | 733 | } |
660 | 734 | ||
661 | printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name); | 735 | printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name); |
662 | clk->disable(clk); | 736 | clk->ops->disable(clk); |
663 | printk(" done\n"); | 737 | printk(" done\n"); |
664 | } | 738 | } |
665 | 739 | ||
@@ -677,10 +751,10 @@ static struct clk_functions omap1_clk_functions = { | |||
677 | 751 | ||
678 | int __init omap1_clk_init(void) | 752 | int __init omap1_clk_init(void) |
679 | { | 753 | { |
680 | struct clk ** clkp; | 754 | struct omap_clk *c; |
681 | const struct omap_clock_config *info; | 755 | const struct omap_clock_config *info; |
682 | int crystal_type = 0; /* Default 12 MHz */ | 756 | int crystal_type = 0; /* Default 12 MHz */ |
683 | u32 reg; | 757 | u32 reg, cpu_mask; |
684 | 758 | ||
685 | #ifdef CONFIG_DEBUG_LL | 759 | #ifdef CONFIG_DEBUG_LL |
686 | /* Resets some clocks that may be left on from bootloader, | 760 | /* Resets some clocks that may be left on from bootloader, |
@@ -700,27 +774,24 @@ int __init omap1_clk_init(void) | |||
700 | /* By default all idlect1 clocks are allowed to idle */ | 774 | /* By default all idlect1 clocks are allowed to idle */ |
701 | arm_idlect1_mask = ~0; | 775 | arm_idlect1_mask = ~0; |
702 | 776 | ||
703 | for (clkp = onchip_clks; clkp < onchip_clks+ARRAY_SIZE(onchip_clks); clkp++) { | 777 | for (c = omap_clks; c < omap_clks + ARRAY_SIZE(omap_clks); c++) |
704 | if (((*clkp)->flags &CLOCK_IN_OMAP1510) && cpu_is_omap1510()) { | 778 | clk_init_one(c->lk.clk); |
705 | clk_register(*clkp); | ||
706 | continue; | ||
707 | } | ||
708 | |||
709 | if (((*clkp)->flags &CLOCK_IN_OMAP16XX) && cpu_is_omap16xx()) { | ||
710 | clk_register(*clkp); | ||
711 | continue; | ||
712 | } | ||
713 | |||
714 | if (((*clkp)->flags &CLOCK_IN_OMAP730) && cpu_is_omap730()) { | ||
715 | clk_register(*clkp); | ||
716 | continue; | ||
717 | } | ||
718 | 779 | ||
719 | if (((*clkp)->flags &CLOCK_IN_OMAP310) && cpu_is_omap310()) { | 780 | cpu_mask = 0; |
720 | clk_register(*clkp); | 781 | if (cpu_is_omap16xx()) |
721 | continue; | 782 | cpu_mask |= CK_16XX; |
783 | if (cpu_is_omap1510()) | ||
784 | cpu_mask |= CK_1510; | ||
785 | if (cpu_is_omap730()) | ||
786 | cpu_mask |= CK_730; | ||
787 | if (cpu_is_omap310()) | ||
788 | cpu_mask |= CK_310; | ||
789 | |||
790 | for (c = omap_clks; c < omap_clks + ARRAY_SIZE(omap_clks); c++) | ||
791 | if (c->cpu & cpu_mask) { | ||
792 | clkdev_add(&c->lk); | ||
793 | clk_register(c->lk.clk); | ||
722 | } | 794 | } |
723 | } | ||
724 | 795 | ||
725 | info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config); | 796 | info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config); |
726 | if (info != NULL) { | 797 | if (info != NULL) { |
@@ -769,7 +840,6 @@ int __init omap1_clk_init(void) | |||
769 | } | 840 | } |
770 | } | 841 | } |
771 | } | 842 | } |
772 | propagate_rate(&ck_dpll1); | ||
773 | #else | 843 | #else |
774 | /* Find the highest supported frequency and enable it */ | 844 | /* Find the highest supported frequency and enable it */ |
775 | if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) { | 845 | if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) { |
@@ -778,9 +848,9 @@ int __init omap1_clk_init(void) | |||
778 | omap_writew(0x2290, DPLL_CTL); | 848 | omap_writew(0x2290, DPLL_CTL); |
779 | omap_writew(cpu_is_omap730() ? 0x3005 : 0x1005, ARM_CKCTL); | 849 | omap_writew(cpu_is_omap730() ? 0x3005 : 0x1005, ARM_CKCTL); |
780 | ck_dpll1.rate = 60000000; | 850 | ck_dpll1.rate = 60000000; |
781 | propagate_rate(&ck_dpll1); | ||
782 | } | 851 | } |
783 | #endif | 852 | #endif |
853 | propagate_rate(&ck_dpll1); | ||
784 | /* Cache rates for clocks connected to ck_ref (not dpll1) */ | 854 | /* Cache rates for clocks connected to ck_ref (not dpll1) */ |
785 | propagate_rate(&ck_ref); | 855 | propagate_rate(&ck_ref); |
786 | printk(KERN_INFO "Clocking rate (xtal/DPLL1/MPU): " | 856 | printk(KERN_INFO "Clocking rate (xtal/DPLL1/MPU): " |
@@ -832,4 +902,3 @@ int __init omap1_clk_init(void) | |||
832 | 902 | ||
833 | return 0; | 903 | return 0; |
834 | } | 904 | } |
835 | |||
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h index c1dcdf18d8dd..17f874271255 100644 --- a/arch/arm/mach-omap1/clock.h +++ b/arch/arm/mach-omap1/clock.h | |||
@@ -13,27 +13,22 @@ | |||
13 | #ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H | 13 | #ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H |
14 | #define __ARCH_ARM_MACH_OMAP1_CLOCK_H | 14 | #define __ARCH_ARM_MACH_OMAP1_CLOCK_H |
15 | 15 | ||
16 | static int omap1_clk_enable_generic(struct clk * clk); | 16 | static unsigned long omap1_ckctl_recalc(struct clk *clk); |
17 | static void omap1_clk_disable_generic(struct clk * clk); | 17 | static unsigned long omap1_watchdog_recalc(struct clk *clk); |
18 | static void omap1_ckctl_recalc(struct clk * clk); | ||
19 | static void omap1_watchdog_recalc(struct clk * clk); | ||
20 | static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate); | 18 | static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate); |
21 | static void omap1_sossi_recalc(struct clk *clk); | 19 | static unsigned long omap1_sossi_recalc(struct clk *clk); |
22 | static void omap1_ckctl_recalc_dsp_domain(struct clk * clk); | 20 | static unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk); |
23 | static int omap1_clk_enable_dsp_domain(struct clk * clk); | ||
24 | static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate); | 21 | static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate); |
25 | static void omap1_clk_disable_dsp_domain(struct clk * clk); | ||
26 | static int omap1_set_uart_rate(struct clk * clk, unsigned long rate); | 22 | static int omap1_set_uart_rate(struct clk * clk, unsigned long rate); |
27 | static void omap1_uart_recalc(struct clk * clk); | 23 | static unsigned long omap1_uart_recalc(struct clk *clk); |
28 | static int omap1_clk_enable_uart_functional(struct clk * clk); | ||
29 | static void omap1_clk_disable_uart_functional(struct clk * clk); | ||
30 | static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate); | 24 | static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate); |
31 | static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate); | 25 | static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate); |
32 | static void omap1_init_ext_clk(struct clk * clk); | 26 | static void omap1_init_ext_clk(struct clk * clk); |
33 | static int omap1_select_table_rate(struct clk * clk, unsigned long rate); | 27 | static int omap1_select_table_rate(struct clk * clk, unsigned long rate); |
34 | static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate); | 28 | static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate); |
35 | static int omap1_clk_enable(struct clk *clk); | 29 | |
36 | static void omap1_clk_disable(struct clk *clk); | 30 | static int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate); |
31 | static long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate); | ||
37 | 32 | ||
38 | struct mpu_rate { | 33 | struct mpu_rate { |
39 | unsigned long rate; | 34 | unsigned long rate; |
@@ -152,101 +147,84 @@ static struct mpu_rate rate_table[] = { | |||
152 | 147 | ||
153 | static struct clk ck_ref = { | 148 | static struct clk ck_ref = { |
154 | .name = "ck_ref", | 149 | .name = "ck_ref", |
150 | .ops = &clkops_null, | ||
155 | .rate = 12000000, | 151 | .rate = 12000000, |
156 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | ||
157 | CLOCK_IN_OMAP310 | ALWAYS_ENABLED, | ||
158 | .enable = &omap1_clk_enable_generic, | ||
159 | .disable = &omap1_clk_disable_generic, | ||
160 | }; | 152 | }; |
161 | 153 | ||
162 | static struct clk ck_dpll1 = { | 154 | static struct clk ck_dpll1 = { |
163 | .name = "ck_dpll1", | 155 | .name = "ck_dpll1", |
156 | .ops = &clkops_null, | ||
164 | .parent = &ck_ref, | 157 | .parent = &ck_ref, |
165 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | ||
166 | CLOCK_IN_OMAP310 | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
167 | .enable = &omap1_clk_enable_generic, | ||
168 | .disable = &omap1_clk_disable_generic, | ||
169 | }; | 158 | }; |
170 | 159 | ||
171 | static struct arm_idlect1_clk ck_dpll1out = { | 160 | static struct arm_idlect1_clk ck_dpll1out = { |
172 | .clk = { | 161 | .clk = { |
173 | .name = "ck_dpll1out", | 162 | .name = "ck_dpll1out", |
163 | .ops = &clkops_generic, | ||
174 | .parent = &ck_dpll1, | 164 | .parent = &ck_dpll1, |
175 | .flags = CLOCK_IN_OMAP16XX | CLOCK_IDLE_CONTROL | | 165 | .flags = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT, |
176 | ENABLE_REG_32BIT | RATE_PROPAGATES, | 166 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), |
177 | .enable_reg = (void __iomem *)ARM_IDLECT2, | ||
178 | .enable_bit = EN_CKOUT_ARM, | 167 | .enable_bit = EN_CKOUT_ARM, |
179 | .recalc = &followparent_recalc, | 168 | .recalc = &followparent_recalc, |
180 | .enable = &omap1_clk_enable_generic, | ||
181 | .disable = &omap1_clk_disable_generic, | ||
182 | }, | 169 | }, |
183 | .idlect_shift = 12, | 170 | .idlect_shift = 12, |
184 | }; | 171 | }; |
185 | 172 | ||
186 | static struct clk sossi_ck = { | 173 | static struct clk sossi_ck = { |
187 | .name = "ck_sossi", | 174 | .name = "ck_sossi", |
175 | .ops = &clkops_generic, | ||
188 | .parent = &ck_dpll1out.clk, | 176 | .parent = &ck_dpll1out.clk, |
189 | .flags = CLOCK_IN_OMAP16XX | CLOCK_NO_IDLE_PARENT | | 177 | .flags = CLOCK_NO_IDLE_PARENT | ENABLE_REG_32BIT, |
190 | ENABLE_REG_32BIT, | 178 | .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_1), |
191 | .enable_reg = (void __iomem *)MOD_CONF_CTRL_1, | ||
192 | .enable_bit = 16, | 179 | .enable_bit = 16, |
193 | .recalc = &omap1_sossi_recalc, | 180 | .recalc = &omap1_sossi_recalc, |
194 | .set_rate = &omap1_set_sossi_rate, | 181 | .set_rate = &omap1_set_sossi_rate, |
195 | .enable = &omap1_clk_enable_generic, | ||
196 | .disable = &omap1_clk_disable_generic, | ||
197 | }; | 182 | }; |
198 | 183 | ||
199 | static struct clk arm_ck = { | 184 | static struct clk arm_ck = { |
200 | .name = "arm_ck", | 185 | .name = "arm_ck", |
186 | .ops = &clkops_null, | ||
201 | .parent = &ck_dpll1, | 187 | .parent = &ck_dpll1, |
202 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | ||
203 | CLOCK_IN_OMAP310 | RATE_CKCTL | RATE_PROPAGATES | | ||
204 | ALWAYS_ENABLED, | ||
205 | .rate_offset = CKCTL_ARMDIV_OFFSET, | 188 | .rate_offset = CKCTL_ARMDIV_OFFSET, |
206 | .recalc = &omap1_ckctl_recalc, | 189 | .recalc = &omap1_ckctl_recalc, |
207 | .enable = &omap1_clk_enable_generic, | 190 | .round_rate = omap1_clk_round_rate_ckctl_arm, |
208 | .disable = &omap1_clk_disable_generic, | 191 | .set_rate = omap1_clk_set_rate_ckctl_arm, |
209 | }; | 192 | }; |
210 | 193 | ||
211 | static struct arm_idlect1_clk armper_ck = { | 194 | static struct arm_idlect1_clk armper_ck = { |
212 | .clk = { | 195 | .clk = { |
213 | .name = "armper_ck", | 196 | .name = "armper_ck", |
197 | .ops = &clkops_generic, | ||
214 | .parent = &ck_dpll1, | 198 | .parent = &ck_dpll1, |
215 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 199 | .flags = CLOCK_IDLE_CONTROL, |
216 | CLOCK_IN_OMAP310 | RATE_CKCTL | | 200 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), |
217 | CLOCK_IDLE_CONTROL, | ||
218 | .enable_reg = (void __iomem *)ARM_IDLECT2, | ||
219 | .enable_bit = EN_PERCK, | 201 | .enable_bit = EN_PERCK, |
220 | .rate_offset = CKCTL_PERDIV_OFFSET, | 202 | .rate_offset = CKCTL_PERDIV_OFFSET, |
221 | .recalc = &omap1_ckctl_recalc, | 203 | .recalc = &omap1_ckctl_recalc, |
222 | .enable = &omap1_clk_enable_generic, | 204 | .round_rate = omap1_clk_round_rate_ckctl_arm, |
223 | .disable = &omap1_clk_disable_generic, | 205 | .set_rate = omap1_clk_set_rate_ckctl_arm, |
224 | }, | 206 | }, |
225 | .idlect_shift = 2, | 207 | .idlect_shift = 2, |
226 | }; | 208 | }; |
227 | 209 | ||
228 | static struct clk arm_gpio_ck = { | 210 | static struct clk arm_gpio_ck = { |
229 | .name = "arm_gpio_ck", | 211 | .name = "arm_gpio_ck", |
212 | .ops = &clkops_generic, | ||
230 | .parent = &ck_dpll1, | 213 | .parent = &ck_dpll1, |
231 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310, | 214 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), |
232 | .enable_reg = (void __iomem *)ARM_IDLECT2, | ||
233 | .enable_bit = EN_GPIOCK, | 215 | .enable_bit = EN_GPIOCK, |
234 | .recalc = &followparent_recalc, | 216 | .recalc = &followparent_recalc, |
235 | .enable = &omap1_clk_enable_generic, | ||
236 | .disable = &omap1_clk_disable_generic, | ||
237 | }; | 217 | }; |
238 | 218 | ||
239 | static struct arm_idlect1_clk armxor_ck = { | 219 | static struct arm_idlect1_clk armxor_ck = { |
240 | .clk = { | 220 | .clk = { |
241 | .name = "armxor_ck", | 221 | .name = "armxor_ck", |
222 | .ops = &clkops_generic, | ||
242 | .parent = &ck_ref, | 223 | .parent = &ck_ref, |
243 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 224 | .flags = CLOCK_IDLE_CONTROL, |
244 | CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, | 225 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), |
245 | .enable_reg = (void __iomem *)ARM_IDLECT2, | ||
246 | .enable_bit = EN_XORPCK, | 226 | .enable_bit = EN_XORPCK, |
247 | .recalc = &followparent_recalc, | 227 | .recalc = &followparent_recalc, |
248 | .enable = &omap1_clk_enable_generic, | ||
249 | .disable = &omap1_clk_disable_generic, | ||
250 | }, | 228 | }, |
251 | .idlect_shift = 1, | 229 | .idlect_shift = 1, |
252 | }; | 230 | }; |
@@ -254,14 +232,12 @@ static struct arm_idlect1_clk armxor_ck = { | |||
254 | static struct arm_idlect1_clk armtim_ck = { | 232 | static struct arm_idlect1_clk armtim_ck = { |
255 | .clk = { | 233 | .clk = { |
256 | .name = "armtim_ck", | 234 | .name = "armtim_ck", |
235 | .ops = &clkops_generic, | ||
257 | .parent = &ck_ref, | 236 | .parent = &ck_ref, |
258 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 237 | .flags = CLOCK_IDLE_CONTROL, |
259 | CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, | 238 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), |
260 | .enable_reg = (void __iomem *)ARM_IDLECT2, | ||
261 | .enable_bit = EN_TIMCK, | 239 | .enable_bit = EN_TIMCK, |
262 | .recalc = &followparent_recalc, | 240 | .recalc = &followparent_recalc, |
263 | .enable = &omap1_clk_enable_generic, | ||
264 | .disable = &omap1_clk_disable_generic, | ||
265 | }, | 241 | }, |
266 | .idlect_shift = 9, | 242 | .idlect_shift = 9, |
267 | }; | 243 | }; |
@@ -269,201 +245,166 @@ static struct arm_idlect1_clk armtim_ck = { | |||
269 | static struct arm_idlect1_clk armwdt_ck = { | 245 | static struct arm_idlect1_clk armwdt_ck = { |
270 | .clk = { | 246 | .clk = { |
271 | .name = "armwdt_ck", | 247 | .name = "armwdt_ck", |
248 | .ops = &clkops_generic, | ||
272 | .parent = &ck_ref, | 249 | .parent = &ck_ref, |
273 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 250 | .flags = CLOCK_IDLE_CONTROL, |
274 | CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, | 251 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), |
275 | .enable_reg = (void __iomem *)ARM_IDLECT2, | ||
276 | .enable_bit = EN_WDTCK, | 252 | .enable_bit = EN_WDTCK, |
277 | .recalc = &omap1_watchdog_recalc, | 253 | .recalc = &omap1_watchdog_recalc, |
278 | .enable = &omap1_clk_enable_generic, | ||
279 | .disable = &omap1_clk_disable_generic, | ||
280 | }, | 254 | }, |
281 | .idlect_shift = 0, | 255 | .idlect_shift = 0, |
282 | }; | 256 | }; |
283 | 257 | ||
284 | static struct clk arminth_ck16xx = { | 258 | static struct clk arminth_ck16xx = { |
285 | .name = "arminth_ck", | 259 | .name = "arminth_ck", |
260 | .ops = &clkops_null, | ||
286 | .parent = &arm_ck, | 261 | .parent = &arm_ck, |
287 | .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, | ||
288 | .recalc = &followparent_recalc, | 262 | .recalc = &followparent_recalc, |
289 | /* Note: On 16xx the frequency can be divided by 2 by programming | 263 | /* Note: On 16xx the frequency can be divided by 2 by programming |
290 | * ARM_CKCTL:ARM_INTHCK_SEL(14) to 1 | 264 | * ARM_CKCTL:ARM_INTHCK_SEL(14) to 1 |
291 | * | 265 | * |
292 | * 1510 version is in TC clocks. | 266 | * 1510 version is in TC clocks. |
293 | */ | 267 | */ |
294 | .enable = &omap1_clk_enable_generic, | ||
295 | .disable = &omap1_clk_disable_generic, | ||
296 | }; | 268 | }; |
297 | 269 | ||
298 | static struct clk dsp_ck = { | 270 | static struct clk dsp_ck = { |
299 | .name = "dsp_ck", | 271 | .name = "dsp_ck", |
272 | .ops = &clkops_generic, | ||
300 | .parent = &ck_dpll1, | 273 | .parent = &ck_dpll1, |
301 | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 274 | .enable_reg = OMAP1_IO_ADDRESS(ARM_CKCTL), |
302 | RATE_CKCTL, | ||
303 | .enable_reg = (void __iomem *)ARM_CKCTL, | ||
304 | .enable_bit = EN_DSPCK, | 275 | .enable_bit = EN_DSPCK, |
305 | .rate_offset = CKCTL_DSPDIV_OFFSET, | 276 | .rate_offset = CKCTL_DSPDIV_OFFSET, |
306 | .recalc = &omap1_ckctl_recalc, | 277 | .recalc = &omap1_ckctl_recalc, |
307 | .enable = &omap1_clk_enable_generic, | 278 | .round_rate = omap1_clk_round_rate_ckctl_arm, |
308 | .disable = &omap1_clk_disable_generic, | 279 | .set_rate = omap1_clk_set_rate_ckctl_arm, |
309 | }; | 280 | }; |
310 | 281 | ||
311 | static struct clk dspmmu_ck = { | 282 | static struct clk dspmmu_ck = { |
312 | .name = "dspmmu_ck", | 283 | .name = "dspmmu_ck", |
284 | .ops = &clkops_null, | ||
313 | .parent = &ck_dpll1, | 285 | .parent = &ck_dpll1, |
314 | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | ||
315 | RATE_CKCTL | ALWAYS_ENABLED, | ||
316 | .rate_offset = CKCTL_DSPMMUDIV_OFFSET, | 286 | .rate_offset = CKCTL_DSPMMUDIV_OFFSET, |
317 | .recalc = &omap1_ckctl_recalc, | 287 | .recalc = &omap1_ckctl_recalc, |
318 | .enable = &omap1_clk_enable_generic, | 288 | .round_rate = omap1_clk_round_rate_ckctl_arm, |
319 | .disable = &omap1_clk_disable_generic, | 289 | .set_rate = omap1_clk_set_rate_ckctl_arm, |
320 | }; | 290 | }; |
321 | 291 | ||
322 | static struct clk dspper_ck = { | 292 | static struct clk dspper_ck = { |
323 | .name = "dspper_ck", | 293 | .name = "dspper_ck", |
294 | .ops = &clkops_dspck, | ||
324 | .parent = &ck_dpll1, | 295 | .parent = &ck_dpll1, |
325 | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | ||
326 | RATE_CKCTL | VIRTUAL_IO_ADDRESS, | ||
327 | .enable_reg = DSP_IDLECT2, | 296 | .enable_reg = DSP_IDLECT2, |
328 | .enable_bit = EN_PERCK, | 297 | .enable_bit = EN_PERCK, |
329 | .rate_offset = CKCTL_PERDIV_OFFSET, | 298 | .rate_offset = CKCTL_PERDIV_OFFSET, |
330 | .recalc = &omap1_ckctl_recalc_dsp_domain, | 299 | .recalc = &omap1_ckctl_recalc_dsp_domain, |
300 | .round_rate = omap1_clk_round_rate_ckctl_arm, | ||
331 | .set_rate = &omap1_clk_set_rate_dsp_domain, | 301 | .set_rate = &omap1_clk_set_rate_dsp_domain, |
332 | .enable = &omap1_clk_enable_dsp_domain, | ||
333 | .disable = &omap1_clk_disable_dsp_domain, | ||
334 | }; | 302 | }; |
335 | 303 | ||
336 | static struct clk dspxor_ck = { | 304 | static struct clk dspxor_ck = { |
337 | .name = "dspxor_ck", | 305 | .name = "dspxor_ck", |
306 | .ops = &clkops_dspck, | ||
338 | .parent = &ck_ref, | 307 | .parent = &ck_ref, |
339 | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | ||
340 | VIRTUAL_IO_ADDRESS, | ||
341 | .enable_reg = DSP_IDLECT2, | 308 | .enable_reg = DSP_IDLECT2, |
342 | .enable_bit = EN_XORPCK, | 309 | .enable_bit = EN_XORPCK, |
343 | .recalc = &followparent_recalc, | 310 | .recalc = &followparent_recalc, |
344 | .enable = &omap1_clk_enable_dsp_domain, | ||
345 | .disable = &omap1_clk_disable_dsp_domain, | ||
346 | }; | 311 | }; |
347 | 312 | ||
348 | static struct clk dsptim_ck = { | 313 | static struct clk dsptim_ck = { |
349 | .name = "dsptim_ck", | 314 | .name = "dsptim_ck", |
315 | .ops = &clkops_dspck, | ||
350 | .parent = &ck_ref, | 316 | .parent = &ck_ref, |
351 | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | ||
352 | VIRTUAL_IO_ADDRESS, | ||
353 | .enable_reg = DSP_IDLECT2, | 317 | .enable_reg = DSP_IDLECT2, |
354 | .enable_bit = EN_DSPTIMCK, | 318 | .enable_bit = EN_DSPTIMCK, |
355 | .recalc = &followparent_recalc, | 319 | .recalc = &followparent_recalc, |
356 | .enable = &omap1_clk_enable_dsp_domain, | ||
357 | .disable = &omap1_clk_disable_dsp_domain, | ||
358 | }; | 320 | }; |
359 | 321 | ||
360 | /* Tie ARM_IDLECT1:IDLIF_ARM to this logical clock structure */ | 322 | /* Tie ARM_IDLECT1:IDLIF_ARM to this logical clock structure */ |
361 | static struct arm_idlect1_clk tc_ck = { | 323 | static struct arm_idlect1_clk tc_ck = { |
362 | .clk = { | 324 | .clk = { |
363 | .name = "tc_ck", | 325 | .name = "tc_ck", |
326 | .ops = &clkops_null, | ||
364 | .parent = &ck_dpll1, | 327 | .parent = &ck_dpll1, |
365 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 328 | .flags = CLOCK_IDLE_CONTROL, |
366 | CLOCK_IN_OMAP730 | CLOCK_IN_OMAP310 | | ||
367 | RATE_CKCTL | RATE_PROPAGATES | | ||
368 | ALWAYS_ENABLED | CLOCK_IDLE_CONTROL, | ||
369 | .rate_offset = CKCTL_TCDIV_OFFSET, | 329 | .rate_offset = CKCTL_TCDIV_OFFSET, |
370 | .recalc = &omap1_ckctl_recalc, | 330 | .recalc = &omap1_ckctl_recalc, |
371 | .enable = &omap1_clk_enable_generic, | 331 | .round_rate = omap1_clk_round_rate_ckctl_arm, |
372 | .disable = &omap1_clk_disable_generic, | 332 | .set_rate = omap1_clk_set_rate_ckctl_arm, |
373 | }, | 333 | }, |
374 | .idlect_shift = 6, | 334 | .idlect_shift = 6, |
375 | }; | 335 | }; |
376 | 336 | ||
377 | static struct clk arminth_ck1510 = { | 337 | static struct clk arminth_ck1510 = { |
378 | .name = "arminth_ck", | 338 | .name = "arminth_ck", |
339 | .ops = &clkops_null, | ||
379 | .parent = &tc_ck.clk, | 340 | .parent = &tc_ck.clk, |
380 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | | ||
381 | ALWAYS_ENABLED, | ||
382 | .recalc = &followparent_recalc, | 341 | .recalc = &followparent_recalc, |
383 | /* Note: On 1510 the frequency follows TC_CK | 342 | /* Note: On 1510 the frequency follows TC_CK |
384 | * | 343 | * |
385 | * 16xx version is in MPU clocks. | 344 | * 16xx version is in MPU clocks. |
386 | */ | 345 | */ |
387 | .enable = &omap1_clk_enable_generic, | ||
388 | .disable = &omap1_clk_disable_generic, | ||
389 | }; | 346 | }; |
390 | 347 | ||
391 | static struct clk tipb_ck = { | 348 | static struct clk tipb_ck = { |
392 | /* No-idle controlled by "tc_ck" */ | 349 | /* No-idle controlled by "tc_ck" */ |
393 | .name = "tipb_ck", | 350 | .name = "tipb_ck", |
351 | .ops = &clkops_null, | ||
394 | .parent = &tc_ck.clk, | 352 | .parent = &tc_ck.clk, |
395 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | | ||
396 | ALWAYS_ENABLED, | ||
397 | .recalc = &followparent_recalc, | 353 | .recalc = &followparent_recalc, |
398 | .enable = &omap1_clk_enable_generic, | ||
399 | .disable = &omap1_clk_disable_generic, | ||
400 | }; | 354 | }; |
401 | 355 | ||
402 | static struct clk l3_ocpi_ck = { | 356 | static struct clk l3_ocpi_ck = { |
403 | /* No-idle controlled by "tc_ck" */ | 357 | /* No-idle controlled by "tc_ck" */ |
404 | .name = "l3_ocpi_ck", | 358 | .name = "l3_ocpi_ck", |
359 | .ops = &clkops_generic, | ||
405 | .parent = &tc_ck.clk, | 360 | .parent = &tc_ck.clk, |
406 | .flags = CLOCK_IN_OMAP16XX, | 361 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3), |
407 | .enable_reg = (void __iomem *)ARM_IDLECT3, | ||
408 | .enable_bit = EN_OCPI_CK, | 362 | .enable_bit = EN_OCPI_CK, |
409 | .recalc = &followparent_recalc, | 363 | .recalc = &followparent_recalc, |
410 | .enable = &omap1_clk_enable_generic, | ||
411 | .disable = &omap1_clk_disable_generic, | ||
412 | }; | 364 | }; |
413 | 365 | ||
414 | static struct clk tc1_ck = { | 366 | static struct clk tc1_ck = { |
415 | .name = "tc1_ck", | 367 | .name = "tc1_ck", |
368 | .ops = &clkops_generic, | ||
416 | .parent = &tc_ck.clk, | 369 | .parent = &tc_ck.clk, |
417 | .flags = CLOCK_IN_OMAP16XX, | 370 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3), |
418 | .enable_reg = (void __iomem *)ARM_IDLECT3, | ||
419 | .enable_bit = EN_TC1_CK, | 371 | .enable_bit = EN_TC1_CK, |
420 | .recalc = &followparent_recalc, | 372 | .recalc = &followparent_recalc, |
421 | .enable = &omap1_clk_enable_generic, | ||
422 | .disable = &omap1_clk_disable_generic, | ||
423 | }; | 373 | }; |
424 | 374 | ||
425 | static struct clk tc2_ck = { | 375 | static struct clk tc2_ck = { |
426 | .name = "tc2_ck", | 376 | .name = "tc2_ck", |
377 | .ops = &clkops_generic, | ||
427 | .parent = &tc_ck.clk, | 378 | .parent = &tc_ck.clk, |
428 | .flags = CLOCK_IN_OMAP16XX, | 379 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3), |
429 | .enable_reg = (void __iomem *)ARM_IDLECT3, | ||
430 | .enable_bit = EN_TC2_CK, | 380 | .enable_bit = EN_TC2_CK, |
431 | .recalc = &followparent_recalc, | 381 | .recalc = &followparent_recalc, |
432 | .enable = &omap1_clk_enable_generic, | ||
433 | .disable = &omap1_clk_disable_generic, | ||
434 | }; | 382 | }; |
435 | 383 | ||
436 | static struct clk dma_ck = { | 384 | static struct clk dma_ck = { |
437 | /* No-idle controlled by "tc_ck" */ | 385 | /* No-idle controlled by "tc_ck" */ |
438 | .name = "dma_ck", | 386 | .name = "dma_ck", |
387 | .ops = &clkops_null, | ||
439 | .parent = &tc_ck.clk, | 388 | .parent = &tc_ck.clk, |
440 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | ||
441 | CLOCK_IN_OMAP310 | ALWAYS_ENABLED, | ||
442 | .recalc = &followparent_recalc, | 389 | .recalc = &followparent_recalc, |
443 | .enable = &omap1_clk_enable_generic, | ||
444 | .disable = &omap1_clk_disable_generic, | ||
445 | }; | 390 | }; |
446 | 391 | ||
447 | static struct clk dma_lcdfree_ck = { | 392 | static struct clk dma_lcdfree_ck = { |
448 | .name = "dma_lcdfree_ck", | 393 | .name = "dma_lcdfree_ck", |
394 | .ops = &clkops_null, | ||
449 | .parent = &tc_ck.clk, | 395 | .parent = &tc_ck.clk, |
450 | .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, | ||
451 | .recalc = &followparent_recalc, | 396 | .recalc = &followparent_recalc, |
452 | .enable = &omap1_clk_enable_generic, | ||
453 | .disable = &omap1_clk_disable_generic, | ||
454 | }; | 397 | }; |
455 | 398 | ||
456 | static struct arm_idlect1_clk api_ck = { | 399 | static struct arm_idlect1_clk api_ck = { |
457 | .clk = { | 400 | .clk = { |
458 | .name = "api_ck", | 401 | .name = "api_ck", |
402 | .ops = &clkops_generic, | ||
459 | .parent = &tc_ck.clk, | 403 | .parent = &tc_ck.clk, |
460 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 404 | .flags = CLOCK_IDLE_CONTROL, |
461 | CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, | 405 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), |
462 | .enable_reg = (void __iomem *)ARM_IDLECT2, | ||
463 | .enable_bit = EN_APICK, | 406 | .enable_bit = EN_APICK, |
464 | .recalc = &followparent_recalc, | 407 | .recalc = &followparent_recalc, |
465 | .enable = &omap1_clk_enable_generic, | ||
466 | .disable = &omap1_clk_disable_generic, | ||
467 | }, | 408 | }, |
468 | .idlect_shift = 8, | 409 | .idlect_shift = 8, |
469 | }; | 410 | }; |
@@ -471,276 +412,238 @@ static struct arm_idlect1_clk api_ck = { | |||
471 | static struct arm_idlect1_clk lb_ck = { | 412 | static struct arm_idlect1_clk lb_ck = { |
472 | .clk = { | 413 | .clk = { |
473 | .name = "lb_ck", | 414 | .name = "lb_ck", |
415 | .ops = &clkops_generic, | ||
474 | .parent = &tc_ck.clk, | 416 | .parent = &tc_ck.clk, |
475 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | | 417 | .flags = CLOCK_IDLE_CONTROL, |
476 | CLOCK_IDLE_CONTROL, | 418 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), |
477 | .enable_reg = (void __iomem *)ARM_IDLECT2, | ||
478 | .enable_bit = EN_LBCK, | 419 | .enable_bit = EN_LBCK, |
479 | .recalc = &followparent_recalc, | 420 | .recalc = &followparent_recalc, |
480 | .enable = &omap1_clk_enable_generic, | ||
481 | .disable = &omap1_clk_disable_generic, | ||
482 | }, | 421 | }, |
483 | .idlect_shift = 4, | 422 | .idlect_shift = 4, |
484 | }; | 423 | }; |
485 | 424 | ||
486 | static struct clk rhea1_ck = { | 425 | static struct clk rhea1_ck = { |
487 | .name = "rhea1_ck", | 426 | .name = "rhea1_ck", |
427 | .ops = &clkops_null, | ||
488 | .parent = &tc_ck.clk, | 428 | .parent = &tc_ck.clk, |
489 | .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, | ||
490 | .recalc = &followparent_recalc, | 429 | .recalc = &followparent_recalc, |
491 | .enable = &omap1_clk_enable_generic, | ||
492 | .disable = &omap1_clk_disable_generic, | ||
493 | }; | 430 | }; |
494 | 431 | ||
495 | static struct clk rhea2_ck = { | 432 | static struct clk rhea2_ck = { |
496 | .name = "rhea2_ck", | 433 | .name = "rhea2_ck", |
434 | .ops = &clkops_null, | ||
497 | .parent = &tc_ck.clk, | 435 | .parent = &tc_ck.clk, |
498 | .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, | ||
499 | .recalc = &followparent_recalc, | 436 | .recalc = &followparent_recalc, |
500 | .enable = &omap1_clk_enable_generic, | ||
501 | .disable = &omap1_clk_disable_generic, | ||
502 | }; | 437 | }; |
503 | 438 | ||
504 | static struct clk lcd_ck_16xx = { | 439 | static struct clk lcd_ck_16xx = { |
505 | .name = "lcd_ck", | 440 | .name = "lcd_ck", |
441 | .ops = &clkops_generic, | ||
506 | .parent = &ck_dpll1, | 442 | .parent = &ck_dpll1, |
507 | .flags = CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP730 | RATE_CKCTL, | 443 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), |
508 | .enable_reg = (void __iomem *)ARM_IDLECT2, | ||
509 | .enable_bit = EN_LCDCK, | 444 | .enable_bit = EN_LCDCK, |
510 | .rate_offset = CKCTL_LCDDIV_OFFSET, | 445 | .rate_offset = CKCTL_LCDDIV_OFFSET, |
511 | .recalc = &omap1_ckctl_recalc, | 446 | .recalc = &omap1_ckctl_recalc, |
512 | .enable = &omap1_clk_enable_generic, | 447 | .round_rate = omap1_clk_round_rate_ckctl_arm, |
513 | .disable = &omap1_clk_disable_generic, | 448 | .set_rate = omap1_clk_set_rate_ckctl_arm, |
514 | }; | 449 | }; |
515 | 450 | ||
516 | static struct arm_idlect1_clk lcd_ck_1510 = { | 451 | static struct arm_idlect1_clk lcd_ck_1510 = { |
517 | .clk = { | 452 | .clk = { |
518 | .name = "lcd_ck", | 453 | .name = "lcd_ck", |
454 | .ops = &clkops_generic, | ||
519 | .parent = &ck_dpll1, | 455 | .parent = &ck_dpll1, |
520 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | | 456 | .flags = CLOCK_IDLE_CONTROL, |
521 | RATE_CKCTL | CLOCK_IDLE_CONTROL, | 457 | .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), |
522 | .enable_reg = (void __iomem *)ARM_IDLECT2, | ||
523 | .enable_bit = EN_LCDCK, | 458 | .enable_bit = EN_LCDCK, |
524 | .rate_offset = CKCTL_LCDDIV_OFFSET, | 459 | .rate_offset = CKCTL_LCDDIV_OFFSET, |
525 | .recalc = &omap1_ckctl_recalc, | 460 | .recalc = &omap1_ckctl_recalc, |
526 | .enable = &omap1_clk_enable_generic, | 461 | .round_rate = omap1_clk_round_rate_ckctl_arm, |
527 | .disable = &omap1_clk_disable_generic, | 462 | .set_rate = omap1_clk_set_rate_ckctl_arm, |
528 | }, | 463 | }, |
529 | .idlect_shift = 3, | 464 | .idlect_shift = 3, |
530 | }; | 465 | }; |
531 | 466 | ||
532 | static struct clk uart1_1510 = { | 467 | static struct clk uart1_1510 = { |
533 | .name = "uart1_ck", | 468 | .name = "uart1_ck", |
469 | .ops = &clkops_null, | ||
534 | /* Direct from ULPD, no real parent */ | 470 | /* Direct from ULPD, no real parent */ |
535 | .parent = &armper_ck.clk, | 471 | .parent = &armper_ck.clk, |
536 | .rate = 12000000, | 472 | .rate = 12000000, |
537 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | | 473 | .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, |
538 | ENABLE_REG_32BIT | ALWAYS_ENABLED | | 474 | .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0), |
539 | CLOCK_NO_IDLE_PARENT, | ||
540 | .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, | ||
541 | .enable_bit = 29, /* Chooses between 12MHz and 48MHz */ | 475 | .enable_bit = 29, /* Chooses between 12MHz and 48MHz */ |
542 | .set_rate = &omap1_set_uart_rate, | 476 | .set_rate = &omap1_set_uart_rate, |
543 | .recalc = &omap1_uart_recalc, | 477 | .recalc = &omap1_uart_recalc, |
544 | .enable = &omap1_clk_enable_generic, | ||
545 | .disable = &omap1_clk_disable_generic, | ||
546 | }; | 478 | }; |
547 | 479 | ||
548 | static struct uart_clk uart1_16xx = { | 480 | static struct uart_clk uart1_16xx = { |
549 | .clk = { | 481 | .clk = { |
550 | .name = "uart1_ck", | 482 | .name = "uart1_ck", |
483 | .ops = &clkops_uart, | ||
551 | /* Direct from ULPD, no real parent */ | 484 | /* Direct from ULPD, no real parent */ |
552 | .parent = &armper_ck.clk, | 485 | .parent = &armper_ck.clk, |
553 | .rate = 48000000, | 486 | .rate = 48000000, |
554 | .flags = CLOCK_IN_OMAP16XX | RATE_FIXED | | 487 | .flags = RATE_FIXED | ENABLE_REG_32BIT | |
555 | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, | 488 | CLOCK_NO_IDLE_PARENT, |
556 | .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, | 489 | .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0), |
557 | .enable_bit = 29, | 490 | .enable_bit = 29, |
558 | .enable = &omap1_clk_enable_uart_functional, | ||
559 | .disable = &omap1_clk_disable_uart_functional, | ||
560 | }, | 491 | }, |
561 | .sysc_addr = 0xfffb0054, | 492 | .sysc_addr = 0xfffb0054, |
562 | }; | 493 | }; |
563 | 494 | ||
564 | static struct clk uart2_ck = { | 495 | static struct clk uart2_ck = { |
565 | .name = "uart2_ck", | 496 | .name = "uart2_ck", |
497 | .ops = &clkops_null, | ||
566 | /* Direct from ULPD, no real parent */ | 498 | /* Direct from ULPD, no real parent */ |
567 | .parent = &armper_ck.clk, | 499 | .parent = &armper_ck.clk, |
568 | .rate = 12000000, | 500 | .rate = 12000000, |
569 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 501 | .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, |
570 | CLOCK_IN_OMAP310 | ENABLE_REG_32BIT | | 502 | .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0), |
571 | ALWAYS_ENABLED | CLOCK_NO_IDLE_PARENT, | ||
572 | .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, | ||
573 | .enable_bit = 30, /* Chooses between 12MHz and 48MHz */ | 503 | .enable_bit = 30, /* Chooses between 12MHz and 48MHz */ |
574 | .set_rate = &omap1_set_uart_rate, | 504 | .set_rate = &omap1_set_uart_rate, |
575 | .recalc = &omap1_uart_recalc, | 505 | .recalc = &omap1_uart_recalc, |
576 | .enable = &omap1_clk_enable_generic, | ||
577 | .disable = &omap1_clk_disable_generic, | ||
578 | }; | 506 | }; |
579 | 507 | ||
580 | static struct clk uart3_1510 = { | 508 | static struct clk uart3_1510 = { |
581 | .name = "uart3_ck", | 509 | .name = "uart3_ck", |
510 | .ops = &clkops_null, | ||
582 | /* Direct from ULPD, no real parent */ | 511 | /* Direct from ULPD, no real parent */ |
583 | .parent = &armper_ck.clk, | 512 | .parent = &armper_ck.clk, |
584 | .rate = 12000000, | 513 | .rate = 12000000, |
585 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | | 514 | .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, |
586 | ENABLE_REG_32BIT | ALWAYS_ENABLED | | 515 | .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0), |
587 | CLOCK_NO_IDLE_PARENT, | ||
588 | .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, | ||
589 | .enable_bit = 31, /* Chooses between 12MHz and 48MHz */ | 516 | .enable_bit = 31, /* Chooses between 12MHz and 48MHz */ |
590 | .set_rate = &omap1_set_uart_rate, | 517 | .set_rate = &omap1_set_uart_rate, |
591 | .recalc = &omap1_uart_recalc, | 518 | .recalc = &omap1_uart_recalc, |
592 | .enable = &omap1_clk_enable_generic, | ||
593 | .disable = &omap1_clk_disable_generic, | ||
594 | }; | 519 | }; |
595 | 520 | ||
596 | static struct uart_clk uart3_16xx = { | 521 | static struct uart_clk uart3_16xx = { |
597 | .clk = { | 522 | .clk = { |
598 | .name = "uart3_ck", | 523 | .name = "uart3_ck", |
524 | .ops = &clkops_uart, | ||
599 | /* Direct from ULPD, no real parent */ | 525 | /* Direct from ULPD, no real parent */ |
600 | .parent = &armper_ck.clk, | 526 | .parent = &armper_ck.clk, |
601 | .rate = 48000000, | 527 | .rate = 48000000, |
602 | .flags = CLOCK_IN_OMAP16XX | RATE_FIXED | | 528 | .flags = RATE_FIXED | ENABLE_REG_32BIT | |
603 | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, | 529 | CLOCK_NO_IDLE_PARENT, |
604 | .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, | 530 | .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0), |
605 | .enable_bit = 31, | 531 | .enable_bit = 31, |
606 | .enable = &omap1_clk_enable_uart_functional, | ||
607 | .disable = &omap1_clk_disable_uart_functional, | ||
608 | }, | 532 | }, |
609 | .sysc_addr = 0xfffb9854, | 533 | .sysc_addr = 0xfffb9854, |
610 | }; | 534 | }; |
611 | 535 | ||
612 | static struct clk usb_clko = { /* 6 MHz output on W4_USB_CLKO */ | 536 | static struct clk usb_clko = { /* 6 MHz output on W4_USB_CLKO */ |
613 | .name = "usb_clko", | 537 | .name = "usb_clko", |
538 | .ops = &clkops_generic, | ||
614 | /* Direct from ULPD, no parent */ | 539 | /* Direct from ULPD, no parent */ |
615 | .rate = 6000000, | 540 | .rate = 6000000, |
616 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 541 | .flags = RATE_FIXED | ENABLE_REG_32BIT, |
617 | CLOCK_IN_OMAP310 | RATE_FIXED | ENABLE_REG_32BIT, | 542 | .enable_reg = OMAP1_IO_ADDRESS(ULPD_CLOCK_CTRL), |
618 | .enable_reg = (void __iomem *)ULPD_CLOCK_CTRL, | ||
619 | .enable_bit = USB_MCLK_EN_BIT, | 543 | .enable_bit = USB_MCLK_EN_BIT, |
620 | .enable = &omap1_clk_enable_generic, | ||
621 | .disable = &omap1_clk_disable_generic, | ||
622 | }; | 544 | }; |
623 | 545 | ||
624 | static struct clk usb_hhc_ck1510 = { | 546 | static struct clk usb_hhc_ck1510 = { |
625 | .name = "usb_hhc_ck", | 547 | .name = "usb_hhc_ck", |
548 | .ops = &clkops_generic, | ||
626 | /* Direct from ULPD, no parent */ | 549 | /* Direct from ULPD, no parent */ |
627 | .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */ | 550 | .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */ |
628 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | | 551 | .flags = RATE_FIXED | ENABLE_REG_32BIT, |
629 | RATE_FIXED | ENABLE_REG_32BIT, | 552 | .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0), |
630 | .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, | ||
631 | .enable_bit = USB_HOST_HHC_UHOST_EN, | 553 | .enable_bit = USB_HOST_HHC_UHOST_EN, |
632 | .enable = &omap1_clk_enable_generic, | ||
633 | .disable = &omap1_clk_disable_generic, | ||
634 | }; | 554 | }; |
635 | 555 | ||
636 | static struct clk usb_hhc_ck16xx = { | 556 | static struct clk usb_hhc_ck16xx = { |
637 | .name = "usb_hhc_ck", | 557 | .name = "usb_hhc_ck", |
558 | .ops = &clkops_generic, | ||
638 | /* Direct from ULPD, no parent */ | 559 | /* Direct from ULPD, no parent */ |
639 | .rate = 48000000, | 560 | .rate = 48000000, |
640 | /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */ | 561 | /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */ |
641 | .flags = CLOCK_IN_OMAP16XX | | 562 | .flags = RATE_FIXED | ENABLE_REG_32BIT, |
642 | RATE_FIXED | ENABLE_REG_32BIT, | 563 | .enable_reg = OMAP1_IO_ADDRESS(OTG_BASE + 0x08), /* OTG_SYSCON_2 */ |
643 | .enable_reg = (void __iomem *)OTG_BASE + 0x08 /* OTG_SYSCON_2 */, | ||
644 | .enable_bit = 8 /* UHOST_EN */, | 564 | .enable_bit = 8 /* UHOST_EN */, |
645 | .enable = &omap1_clk_enable_generic, | ||
646 | .disable = &omap1_clk_disable_generic, | ||
647 | }; | 565 | }; |
648 | 566 | ||
649 | static struct clk usb_dc_ck = { | 567 | static struct clk usb_dc_ck = { |
650 | .name = "usb_dc_ck", | 568 | .name = "usb_dc_ck", |
569 | .ops = &clkops_generic, | ||
651 | /* Direct from ULPD, no parent */ | 570 | /* Direct from ULPD, no parent */ |
652 | .rate = 48000000, | 571 | .rate = 48000000, |
653 | .flags = CLOCK_IN_OMAP16XX | RATE_FIXED, | 572 | .flags = RATE_FIXED, |
654 | .enable_reg = (void __iomem *)SOFT_REQ_REG, | 573 | .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG), |
655 | .enable_bit = 4, | 574 | .enable_bit = 4, |
656 | .enable = &omap1_clk_enable_generic, | ||
657 | .disable = &omap1_clk_disable_generic, | ||
658 | }; | 575 | }; |
659 | 576 | ||
660 | static struct clk mclk_1510 = { | 577 | static struct clk mclk_1510 = { |
661 | .name = "mclk", | 578 | .name = "mclk", |
579 | .ops = &clkops_generic, | ||
662 | /* Direct from ULPD, no parent. May be enabled by ext hardware. */ | 580 | /* Direct from ULPD, no parent. May be enabled by ext hardware. */ |
663 | .rate = 12000000, | 581 | .rate = 12000000, |
664 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | RATE_FIXED, | 582 | .flags = RATE_FIXED, |
665 | .enable_reg = (void __iomem *)SOFT_REQ_REG, | 583 | .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG), |
666 | .enable_bit = 6, | 584 | .enable_bit = 6, |
667 | .enable = &omap1_clk_enable_generic, | ||
668 | .disable = &omap1_clk_disable_generic, | ||
669 | }; | 585 | }; |
670 | 586 | ||
671 | static struct clk mclk_16xx = { | 587 | static struct clk mclk_16xx = { |
672 | .name = "mclk", | 588 | .name = "mclk", |
589 | .ops = &clkops_generic, | ||
673 | /* Direct from ULPD, no parent. May be enabled by ext hardware. */ | 590 | /* Direct from ULPD, no parent. May be enabled by ext hardware. */ |
674 | .flags = CLOCK_IN_OMAP16XX, | 591 | .enable_reg = OMAP1_IO_ADDRESS(COM_CLK_DIV_CTRL_SEL), |
675 | .enable_reg = (void __iomem *)COM_CLK_DIV_CTRL_SEL, | ||
676 | .enable_bit = COM_ULPD_PLL_CLK_REQ, | 592 | .enable_bit = COM_ULPD_PLL_CLK_REQ, |
677 | .set_rate = &omap1_set_ext_clk_rate, | 593 | .set_rate = &omap1_set_ext_clk_rate, |
678 | .round_rate = &omap1_round_ext_clk_rate, | 594 | .round_rate = &omap1_round_ext_clk_rate, |
679 | .init = &omap1_init_ext_clk, | 595 | .init = &omap1_init_ext_clk, |
680 | .enable = &omap1_clk_enable_generic, | ||
681 | .disable = &omap1_clk_disable_generic, | ||
682 | }; | 596 | }; |
683 | 597 | ||
684 | static struct clk bclk_1510 = { | 598 | static struct clk bclk_1510 = { |
685 | .name = "bclk", | 599 | .name = "bclk", |
600 | .ops = &clkops_generic, | ||
686 | /* Direct from ULPD, no parent. May be enabled by ext hardware. */ | 601 | /* Direct from ULPD, no parent. May be enabled by ext hardware. */ |
687 | .rate = 12000000, | 602 | .rate = 12000000, |
688 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | RATE_FIXED, | 603 | .flags = RATE_FIXED, |
689 | .enable = &omap1_clk_enable_generic, | ||
690 | .disable = &omap1_clk_disable_generic, | ||
691 | }; | 604 | }; |
692 | 605 | ||
693 | static struct clk bclk_16xx = { | 606 | static struct clk bclk_16xx = { |
694 | .name = "bclk", | 607 | .name = "bclk", |
608 | .ops = &clkops_generic, | ||
695 | /* Direct from ULPD, no parent. May be enabled by ext hardware. */ | 609 | /* Direct from ULPD, no parent. May be enabled by ext hardware. */ |
696 | .flags = CLOCK_IN_OMAP16XX, | 610 | .enable_reg = OMAP1_IO_ADDRESS(SWD_CLK_DIV_CTRL_SEL), |
697 | .enable_reg = (void __iomem *)SWD_CLK_DIV_CTRL_SEL, | ||
698 | .enable_bit = SWD_ULPD_PLL_CLK_REQ, | 611 | .enable_bit = SWD_ULPD_PLL_CLK_REQ, |
699 | .set_rate = &omap1_set_ext_clk_rate, | 612 | .set_rate = &omap1_set_ext_clk_rate, |
700 | .round_rate = &omap1_round_ext_clk_rate, | 613 | .round_rate = &omap1_round_ext_clk_rate, |
701 | .init = &omap1_init_ext_clk, | 614 | .init = &omap1_init_ext_clk, |
702 | .enable = &omap1_clk_enable_generic, | ||
703 | .disable = &omap1_clk_disable_generic, | ||
704 | }; | 615 | }; |
705 | 616 | ||
706 | static struct clk mmc1_ck = { | 617 | static struct clk mmc1_ck = { |
707 | .name = "mmc_ck", | 618 | .name = "mmc_ck", |
619 | .ops = &clkops_generic, | ||
708 | /* Functional clock is direct from ULPD, interface clock is ARMPER */ | 620 | /* Functional clock is direct from ULPD, interface clock is ARMPER */ |
709 | .parent = &armper_ck.clk, | 621 | .parent = &armper_ck.clk, |
710 | .rate = 48000000, | 622 | .rate = 48000000, |
711 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 623 | .flags = RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, |
712 | CLOCK_IN_OMAP310 | RATE_FIXED | ENABLE_REG_32BIT | | 624 | .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0), |
713 | CLOCK_NO_IDLE_PARENT, | ||
714 | .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, | ||
715 | .enable_bit = 23, | 625 | .enable_bit = 23, |
716 | .enable = &omap1_clk_enable_generic, | ||
717 | .disable = &omap1_clk_disable_generic, | ||
718 | }; | 626 | }; |
719 | 627 | ||
720 | static struct clk mmc2_ck = { | 628 | static struct clk mmc2_ck = { |
721 | .name = "mmc_ck", | 629 | .name = "mmc_ck", |
722 | .id = 1, | 630 | .id = 1, |
631 | .ops = &clkops_generic, | ||
723 | /* Functional clock is direct from ULPD, interface clock is ARMPER */ | 632 | /* Functional clock is direct from ULPD, interface clock is ARMPER */ |
724 | .parent = &armper_ck.clk, | 633 | .parent = &armper_ck.clk, |
725 | .rate = 48000000, | 634 | .rate = 48000000, |
726 | .flags = CLOCK_IN_OMAP16XX | | 635 | .flags = RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, |
727 | RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, | 636 | .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0), |
728 | .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, | ||
729 | .enable_bit = 20, | 637 | .enable_bit = 20, |
730 | .enable = &omap1_clk_enable_generic, | ||
731 | .disable = &omap1_clk_disable_generic, | ||
732 | }; | 638 | }; |
733 | 639 | ||
734 | static struct clk virtual_ck_mpu = { | 640 | static struct clk virtual_ck_mpu = { |
735 | .name = "mpu", | 641 | .name = "mpu", |
736 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 642 | .ops = &clkops_null, |
737 | CLOCK_IN_OMAP310 | VIRTUAL_CLOCK | ALWAYS_ENABLED, | ||
738 | .parent = &arm_ck, /* Is smarter alias for */ | 643 | .parent = &arm_ck, /* Is smarter alias for */ |
739 | .recalc = &followparent_recalc, | 644 | .recalc = &followparent_recalc, |
740 | .set_rate = &omap1_select_table_rate, | 645 | .set_rate = &omap1_select_table_rate, |
741 | .round_rate = &omap1_round_to_table_rate, | 646 | .round_rate = &omap1_round_to_table_rate, |
742 | .enable = &omap1_clk_enable_generic, | ||
743 | .disable = &omap1_clk_disable_generic, | ||
744 | }; | 647 | }; |
745 | 648 | ||
746 | /* virtual functional clock domain for I2C. Just for making sure that ARMXOR_CK | 649 | /* virtual functional clock domain for I2C. Just for making sure that ARMXOR_CK |
@@ -748,78 +651,19 @@ remains active during MPU idle whenever this is enabled */ | |||
748 | static struct clk i2c_fck = { | 651 | static struct clk i2c_fck = { |
749 | .name = "i2c_fck", | 652 | .name = "i2c_fck", |
750 | .id = 1, | 653 | .id = 1, |
751 | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | | 654 | .ops = &clkops_null, |
752 | VIRTUAL_CLOCK | CLOCK_NO_IDLE_PARENT | | 655 | .flags = CLOCK_NO_IDLE_PARENT, |
753 | ALWAYS_ENABLED, | ||
754 | .parent = &armxor_ck.clk, | 656 | .parent = &armxor_ck.clk, |
755 | .recalc = &followparent_recalc, | 657 | .recalc = &followparent_recalc, |
756 | .enable = &omap1_clk_enable_generic, | ||
757 | .disable = &omap1_clk_disable_generic, | ||
758 | }; | 658 | }; |
759 | 659 | ||
760 | static struct clk i2c_ick = { | 660 | static struct clk i2c_ick = { |
761 | .name = "i2c_ick", | 661 | .name = "i2c_ick", |
762 | .id = 1, | 662 | .id = 1, |
763 | .flags = CLOCK_IN_OMAP16XX | | 663 | .ops = &clkops_null, |
764 | VIRTUAL_CLOCK | CLOCK_NO_IDLE_PARENT | | 664 | .flags = CLOCK_NO_IDLE_PARENT, |
765 | ALWAYS_ENABLED, | ||
766 | .parent = &armper_ck.clk, | 665 | .parent = &armper_ck.clk, |
767 | .recalc = &followparent_recalc, | 666 | .recalc = &followparent_recalc, |
768 | .enable = &omap1_clk_enable_generic, | ||
769 | .disable = &omap1_clk_disable_generic, | ||
770 | }; | ||
771 | |||
772 | static struct clk * onchip_clks[] = { | ||
773 | /* non-ULPD clocks */ | ||
774 | &ck_ref, | ||
775 | &ck_dpll1, | ||
776 | /* CK_GEN1 clocks */ | ||
777 | &ck_dpll1out.clk, | ||
778 | &sossi_ck, | ||
779 | &arm_ck, | ||
780 | &armper_ck.clk, | ||
781 | &arm_gpio_ck, | ||
782 | &armxor_ck.clk, | ||
783 | &armtim_ck.clk, | ||
784 | &armwdt_ck.clk, | ||
785 | &arminth_ck1510, &arminth_ck16xx, | ||
786 | /* CK_GEN2 clocks */ | ||
787 | &dsp_ck, | ||
788 | &dspmmu_ck, | ||
789 | &dspper_ck, | ||
790 | &dspxor_ck, | ||
791 | &dsptim_ck, | ||
792 | /* CK_GEN3 clocks */ | ||
793 | &tc_ck.clk, | ||
794 | &tipb_ck, | ||
795 | &l3_ocpi_ck, | ||
796 | &tc1_ck, | ||
797 | &tc2_ck, | ||
798 | &dma_ck, | ||
799 | &dma_lcdfree_ck, | ||
800 | &api_ck.clk, | ||
801 | &lb_ck.clk, | ||
802 | &rhea1_ck, | ||
803 | &rhea2_ck, | ||
804 | &lcd_ck_16xx, | ||
805 | &lcd_ck_1510.clk, | ||
806 | /* ULPD clocks */ | ||
807 | &uart1_1510, | ||
808 | &uart1_16xx.clk, | ||
809 | &uart2_ck, | ||
810 | &uart3_1510, | ||
811 | &uart3_16xx.clk, | ||
812 | &usb_clko, | ||
813 | &usb_hhc_ck1510, &usb_hhc_ck16xx, | ||
814 | &usb_dc_ck, | ||
815 | &mclk_1510, &mclk_16xx, | ||
816 | &bclk_1510, &bclk_16xx, | ||
817 | &mmc1_ck, | ||
818 | &mmc2_ck, | ||
819 | /* Virtual clocks */ | ||
820 | &virtual_ck_mpu, | ||
821 | &i2c_fck, | ||
822 | &i2c_ick, | ||
823 | }; | 667 | }; |
824 | 668 | ||
825 | #endif | 669 | #endif |
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c index 575ba31295cf..d040c3f1027f 100644 --- a/arch/arm/mach-omap1/mcbsp.c +++ b/arch/arm/mach-omap1/mcbsp.c | |||
@@ -28,9 +28,9 @@ | |||
28 | #define DPS_RSTCT2_PER_EN (1 << 0) | 28 | #define DPS_RSTCT2_PER_EN (1 << 0) |
29 | #define DSP_RSTCT2_WD_PER_EN (1 << 1) | 29 | #define DSP_RSTCT2_WD_PER_EN (1 << 1) |
30 | 30 | ||
31 | #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) | 31 | static int dsp_use; |
32 | const char *clk_names[] = { "dsp_ck", "api_ck", "dspxor_ck" }; | 32 | static struct clk *api_clk; |
33 | #endif | 33 | static struct clk *dsp_clk; |
34 | 34 | ||
35 | static void omap1_mcbsp_request(unsigned int id) | 35 | static void omap1_mcbsp_request(unsigned int id) |
36 | { | 36 | { |
@@ -39,20 +39,40 @@ static void omap1_mcbsp_request(unsigned int id) | |||
39 | * are DSP public peripherals. | 39 | * are DSP public peripherals. |
40 | */ | 40 | */ |
41 | if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) { | 41 | if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) { |
42 | omap_dsp_request_mem(); | 42 | if (dsp_use++ == 0) { |
43 | /* | 43 | api_clk = clk_get(NULL, "api_clk"); |
44 | * DSP external peripheral reset | 44 | dsp_clk = clk_get(NULL, "dsp_clk"); |
45 | * FIXME: This should be moved to dsp code | 45 | if (!IS_ERR(api_clk) && !IS_ERR(dsp_clk)) { |
46 | */ | 46 | clk_enable(api_clk); |
47 | __raw_writew(__raw_readw(DSP_RSTCT2) | DPS_RSTCT2_PER_EN | | 47 | clk_enable(dsp_clk); |
48 | DSP_RSTCT2_WD_PER_EN, DSP_RSTCT2); | 48 | |
49 | omap_dsp_request_mem(); | ||
50 | /* | ||
51 | * DSP external peripheral reset | ||
52 | * FIXME: This should be moved to dsp code | ||
53 | */ | ||
54 | __raw_writew(__raw_readw(DSP_RSTCT2) | DPS_RSTCT2_PER_EN | | ||
55 | DSP_RSTCT2_WD_PER_EN, DSP_RSTCT2); | ||
56 | } | ||
57 | } | ||
49 | } | 58 | } |
50 | } | 59 | } |
51 | 60 | ||
52 | static void omap1_mcbsp_free(unsigned int id) | 61 | static void omap1_mcbsp_free(unsigned int id) |
53 | { | 62 | { |
54 | if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) | 63 | if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) { |
55 | omap_dsp_release_mem(); | 64 | if (--dsp_use == 0) { |
65 | omap_dsp_release_mem(); | ||
66 | if (!IS_ERR(api_clk)) { | ||
67 | clk_disable(api_clk); | ||
68 | clk_put(api_clk); | ||
69 | } | ||
70 | if (!IS_ERR(dsp_clk)) { | ||
71 | clk_disable(dsp_clk); | ||
72 | clk_put(dsp_clk); | ||
73 | } | ||
74 | } | ||
75 | } | ||
56 | } | 76 | } |
57 | 77 | ||
58 | static struct omap_mcbsp_ops omap1_mcbsp_ops = { | 78 | static struct omap_mcbsp_ops omap1_mcbsp_ops = { |
@@ -94,8 +114,6 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { | |||
94 | .rx_irq = INT_McBSP1RX, | 114 | .rx_irq = INT_McBSP1RX, |
95 | .tx_irq = INT_McBSP1TX, | 115 | .tx_irq = INT_McBSP1TX, |
96 | .ops = &omap1_mcbsp_ops, | 116 | .ops = &omap1_mcbsp_ops, |
97 | .clk_names = clk_names, | ||
98 | .num_clks = 3, | ||
99 | }, | 117 | }, |
100 | { | 118 | { |
101 | .phys_base = OMAP1510_MCBSP2_BASE, | 119 | .phys_base = OMAP1510_MCBSP2_BASE, |
@@ -112,8 +130,6 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { | |||
112 | .rx_irq = INT_McBSP3RX, | 130 | .rx_irq = INT_McBSP3RX, |
113 | .tx_irq = INT_McBSP3TX, | 131 | .tx_irq = INT_McBSP3TX, |
114 | .ops = &omap1_mcbsp_ops, | 132 | .ops = &omap1_mcbsp_ops, |
115 | .clk_names = clk_names, | ||
116 | .num_clks = 3, | ||
117 | }, | 133 | }, |
118 | }; | 134 | }; |
119 | #define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata) | 135 | #define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata) |
@@ -131,8 +147,6 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { | |||
131 | .rx_irq = INT_McBSP1RX, | 147 | .rx_irq = INT_McBSP1RX, |
132 | .tx_irq = INT_McBSP1TX, | 148 | .tx_irq = INT_McBSP1TX, |
133 | .ops = &omap1_mcbsp_ops, | 149 | .ops = &omap1_mcbsp_ops, |
134 | .clk_names = clk_names, | ||
135 | .num_clks = 3, | ||
136 | }, | 150 | }, |
137 | { | 151 | { |
138 | .phys_base = OMAP1610_MCBSP2_BASE, | 152 | .phys_base = OMAP1610_MCBSP2_BASE, |
@@ -149,8 +163,6 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { | |||
149 | .rx_irq = INT_McBSP3RX, | 163 | .rx_irq = INT_McBSP3RX, |
150 | .tx_irq = INT_McBSP3TX, | 164 | .tx_irq = INT_McBSP3TX, |
151 | .ops = &omap1_mcbsp_ops, | 165 | .ops = &omap1_mcbsp_ops, |
152 | .clk_names = clk_names, | ||
153 | .num_clks = 3, | ||
154 | }, | 166 | }, |
155 | }; | 167 | }; |
156 | #define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata) | 168 | #define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata) |
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index bbd12bc10fdc..9717afcdbda7 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | # Common support | 5 | # Common support |
6 | obj-y := irq.o id.o io.o memory.o control.o prcm.o clock.o mux.o \ | 6 | obj-y := irq.o id.o io.o sdrc.o control.o prcm.o clock.o mux.o \ |
7 | devices.o serial.o gpmc.o timer-gp.o powerdomain.o \ | 7 | devices.o serial.o gpmc.o timer-gp.o powerdomain.o \ |
8 | clockdomain.o | 8 | clockdomain.o |
9 | 9 | ||
@@ -14,6 +14,10 @@ obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o | |||
14 | obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o | 14 | obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o |
15 | obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o | 15 | obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o |
16 | 16 | ||
17 | # SMS/SDRC | ||
18 | obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o | ||
19 | # obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o | ||
20 | |||
17 | # Power Management | 21 | # Power Management |
18 | ifeq ($(CONFIG_PM),y) | 22 | ifeq ($(CONFIG_PM),y) |
19 | obj-y += pm.o | 23 | obj-y += pm.o |
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 83fa37211d77..7b29e1d00f23 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c | |||
@@ -185,7 +185,7 @@ out: | |||
185 | 185 | ||
186 | static void __init omap_2430sdp_init_irq(void) | 186 | static void __init omap_2430sdp_init_irq(void) |
187 | { | 187 | { |
188 | omap2_init_common_hw(); | 188 | omap2_init_common_hw(NULL); |
189 | omap_init_irq(); | 189 | omap_init_irq(); |
190 | omap_gpio_init(); | 190 | omap_gpio_init(); |
191 | sdp2430_init_smc91x(); | 191 | sdp2430_init_smc91x(); |
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 0a7b24ba1652..0c911f414d8d 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c | |||
@@ -249,7 +249,7 @@ out: | |||
249 | 249 | ||
250 | static void __init omap_apollon_init_irq(void) | 250 | static void __init omap_apollon_init_irq(void) |
251 | { | 251 | { |
252 | omap2_init_common_hw(); | 252 | omap2_init_common_hw(NULL); |
253 | omap_init_irq(); | 253 | omap_init_irq(); |
254 | omap_gpio_init(); | 254 | omap_gpio_init(); |
255 | apollon_init_smc91x(); | 255 | apollon_init_smc91x(); |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 3b34c20d1df4..3492162a65c3 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -33,7 +33,7 @@ | |||
33 | 33 | ||
34 | static void __init omap_generic_init_irq(void) | 34 | static void __init omap_generic_init_irq(void) |
35 | { | 35 | { |
36 | omap2_init_common_hw(); | 36 | omap2_init_common_hw(NULL); |
37 | omap_init_irq(); | 37 | omap_init_irq(); |
38 | } | 38 | } |
39 | 39 | ||
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 5e9b14675b1e..ef55b45ab769 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
@@ -363,7 +363,7 @@ static void __init h4_init_flash(void) | |||
363 | 363 | ||
364 | static void __init omap_h4_init_irq(void) | 364 | static void __init omap_h4_init_irq(void) |
365 | { | 365 | { |
366 | omap2_init_common_hw(); | 366 | omap2_init_common_hw(NULL); |
367 | omap_init_irq(); | 367 | omap_init_irq(); |
368 | omap_gpio_init(); | 368 | omap_gpio_init(); |
369 | h4_init_flash(); | 369 | h4_init_flash(); |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index f6a13451d1fd..73e3fdb2d20a 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -81,7 +81,7 @@ static inline void __init ldp_init_smc911x(void) | |||
81 | } | 81 | } |
82 | 82 | ||
83 | ldp_smc911x_resources[0].start = cs_mem_base + 0x0; | 83 | ldp_smc911x_resources[0].start = cs_mem_base + 0x0; |
84 | ldp_smc911x_resources[0].end = cs_mem_base + 0xf; | 84 | ldp_smc911x_resources[0].end = cs_mem_base + 0xff; |
85 | udelay(100); | 85 | udelay(100); |
86 | 86 | ||
87 | eth_gpio = LDP_SMC911X_GPIO; | 87 | eth_gpio = LDP_SMC911X_GPIO; |
@@ -98,7 +98,7 @@ static inline void __init ldp_init_smc911x(void) | |||
98 | 98 | ||
99 | static void __init omap_ldp_init_irq(void) | 99 | static void __init omap_ldp_init_irq(void) |
100 | { | 100 | { |
101 | omap2_init_common_hw(); | 101 | omap2_init_common_hw(NULL); |
102 | omap_init_irq(); | 102 | omap_init_irq(); |
103 | omap_gpio_init(); | 103 | omap_gpio_init(); |
104 | ldp_init_smc911x(); | 104 | ldp_init_smc911x(); |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 38c88fbe658d..b70b1e65034b 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -178,13 +178,15 @@ static int __init omap3_beagle_i2c_init(void) | |||
178 | #ifdef CONFIG_I2C2_OMAP_BEAGLE | 178 | #ifdef CONFIG_I2C2_OMAP_BEAGLE |
179 | omap_register_i2c_bus(2, 400, NULL, 0); | 179 | omap_register_i2c_bus(2, 400, NULL, 0); |
180 | #endif | 180 | #endif |
181 | omap_register_i2c_bus(3, 400, NULL, 0); | 181 | /* Bus 3 is attached to the DVI port where devices like the pico DLP |
182 | * projector don't work reliably with 400kHz */ | ||
183 | omap_register_i2c_bus(3, 100, NULL, 0); | ||
182 | return 0; | 184 | return 0; |
183 | } | 185 | } |
184 | 186 | ||
185 | static void __init omap3_beagle_init_irq(void) | 187 | static void __init omap3_beagle_init_irq(void) |
186 | { | 188 | { |
187 | omap2_init_common_hw(); | 189 | omap2_init_common_hw(NULL); |
188 | omap_init_irq(); | 190 | omap_init_irq(); |
189 | omap_gpio_init(); | 191 | omap_gpio_init(); |
190 | } | 192 | } |
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index ad721e0cbf7a..4247a1534411 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -26,11 +26,10 @@ | |||
26 | 26 | ||
27 | #include <mach/clock.h> | 27 | #include <mach/clock.h> |
28 | #include <mach/clockdomain.h> | 28 | #include <mach/clockdomain.h> |
29 | #include <mach/sram.h> | ||
30 | #include <mach/cpu.h> | 29 | #include <mach/cpu.h> |
31 | #include <asm/div64.h> | 30 | #include <asm/div64.h> |
32 | 31 | ||
33 | #include "memory.h" | 32 | #include <mach/sdrc.h> |
34 | #include "sdrc.h" | 33 | #include "sdrc.h" |
35 | #include "clock.h" | 34 | #include "clock.h" |
36 | #include "prm.h" | 35 | #include "prm.h" |
@@ -46,7 +45,7 @@ | |||
46 | #define DPLL_MIN_DIVIDER 1 | 45 | #define DPLL_MIN_DIVIDER 1 |
47 | 46 | ||
48 | /* Possible error results from _dpll_test_mult */ | 47 | /* Possible error results from _dpll_test_mult */ |
49 | #define DPLL_MULT_UNDERFLOW (1 << 0) | 48 | #define DPLL_MULT_UNDERFLOW -1 |
50 | 49 | ||
51 | /* | 50 | /* |
52 | * Scale factor to mitigate roundoff errors in DPLL rate rounding. | 51 | * Scale factor to mitigate roundoff errors in DPLL rate rounding. |
@@ -59,6 +58,16 @@ | |||
59 | #define DPLL_ROUNDING_VAL ((DPLL_SCALE_BASE / 2) * \ | 58 | #define DPLL_ROUNDING_VAL ((DPLL_SCALE_BASE / 2) * \ |
60 | (DPLL_SCALE_FACTOR / DPLL_SCALE_BASE)) | 59 | (DPLL_SCALE_FACTOR / DPLL_SCALE_BASE)) |
61 | 60 | ||
61 | /* DPLL valid Fint frequency band limits - from 34xx TRM Section 4.7.6.2 */ | ||
62 | #define DPLL_FINT_BAND1_MIN 750000 | ||
63 | #define DPLL_FINT_BAND1_MAX 2100000 | ||
64 | #define DPLL_FINT_BAND2_MIN 7500000 | ||
65 | #define DPLL_FINT_BAND2_MAX 21000000 | ||
66 | |||
67 | /* _dpll_test_fint() return codes */ | ||
68 | #define DPLL_FINT_UNDERFLOW -1 | ||
69 | #define DPLL_FINT_INVALID -2 | ||
70 | |||
62 | u8 cpu_mask; | 71 | u8 cpu_mask; |
63 | 72 | ||
64 | /*------------------------------------------------------------------------- | 73 | /*------------------------------------------------------------------------- |
@@ -66,6 +75,74 @@ u8 cpu_mask; | |||
66 | *-------------------------------------------------------------------------*/ | 75 | *-------------------------------------------------------------------------*/ |
67 | 76 | ||
68 | /** | 77 | /** |
78 | * _omap2xxx_clk_commit - commit clock parent/rate changes in hardware | ||
79 | * @clk: struct clk * | ||
80 | * | ||
81 | * If @clk has the DELAYED_APP flag set, meaning that parent/rate changes | ||
82 | * don't take effect until the VALID_CONFIG bit is written, write the | ||
83 | * VALID_CONFIG bit and wait for the write to complete. No return value. | ||
84 | */ | ||
85 | static void _omap2xxx_clk_commit(struct clk *clk) | ||
86 | { | ||
87 | if (!cpu_is_omap24xx()) | ||
88 | return; | ||
89 | |||
90 | if (!(clk->flags & DELAYED_APP)) | ||
91 | return; | ||
92 | |||
93 | prm_write_mod_reg(OMAP24XX_VALID_CONFIG, OMAP24XX_GR_MOD, | ||
94 | OMAP24XX_PRCM_CLKCFG_CTRL_OFFSET); | ||
95 | /* OCP barrier */ | ||
96 | prm_read_mod_reg(OMAP24XX_GR_MOD, OMAP24XX_PRCM_CLKCFG_CTRL_OFFSET); | ||
97 | } | ||
98 | |||
99 | /* | ||
100 | * _dpll_test_fint - test whether an Fint value is valid for the DPLL | ||
101 | * @clk: DPLL struct clk to test | ||
102 | * @n: divider value (N) to test | ||
103 | * | ||
104 | * Tests whether a particular divider @n will result in a valid DPLL | ||
105 | * internal clock frequency Fint. See the 34xx TRM 4.7.6.2 "DPLL Jitter | ||
106 | * Correction". Returns 0 if OK, -1 if the enclosing loop can terminate | ||
107 | * (assuming that it is counting N upwards), or -2 if the enclosing loop | ||
108 | * should skip to the next iteration (again assuming N is increasing). | ||
109 | */ | ||
110 | static int _dpll_test_fint(struct clk *clk, u8 n) | ||
111 | { | ||
112 | struct dpll_data *dd; | ||
113 | long fint; | ||
114 | int ret = 0; | ||
115 | |||
116 | dd = clk->dpll_data; | ||
117 | |||
118 | /* DPLL divider must result in a valid jitter correction val */ | ||
119 | fint = clk->parent->rate / (n + 1); | ||
120 | if (fint < DPLL_FINT_BAND1_MIN) { | ||
121 | |||
122 | pr_debug("rejecting n=%d due to Fint failure, " | ||
123 | "lowering max_divider\n", n); | ||
124 | dd->max_divider = n; | ||
125 | ret = DPLL_FINT_UNDERFLOW; | ||
126 | |||
127 | } else if (fint > DPLL_FINT_BAND1_MAX && | ||
128 | fint < DPLL_FINT_BAND2_MIN) { | ||
129 | |||
130 | pr_debug("rejecting n=%d due to Fint failure\n", n); | ||
131 | ret = DPLL_FINT_INVALID; | ||
132 | |||
133 | } else if (fint > DPLL_FINT_BAND2_MAX) { | ||
134 | |||
135 | pr_debug("rejecting n=%d due to Fint failure, " | ||
136 | "boosting min_divider\n", n); | ||
137 | dd->min_divider = n; | ||
138 | ret = DPLL_FINT_INVALID; | ||
139 | |||
140 | } | ||
141 | |||
142 | return ret; | ||
143 | } | ||
144 | |||
145 | /** | ||
69 | * omap2_init_clk_clkdm - look up a clockdomain name, store pointer in clk | 146 | * omap2_init_clk_clkdm - look up a clockdomain name, store pointer in clk |
70 | * @clk: OMAP clock struct ptr to use | 147 | * @clk: OMAP clock struct ptr to use |
71 | * | 148 | * |
@@ -120,7 +197,7 @@ void omap2_init_clksel_parent(struct clk *clk) | |||
120 | clk->name, clks->parent->name, | 197 | clk->name, clks->parent->name, |
121 | ((clk->parent) ? | 198 | ((clk->parent) ? |
122 | clk->parent->name : "NULL")); | 199 | clk->parent->name : "NULL")); |
123 | clk->parent = clks->parent; | 200 | clk_reparent(clk, clks->parent); |
124 | }; | 201 | }; |
125 | found = 1; | 202 | found = 1; |
126 | } | 203 | } |
@@ -134,25 +211,52 @@ void omap2_init_clksel_parent(struct clk *clk) | |||
134 | return; | 211 | return; |
135 | } | 212 | } |
136 | 213 | ||
137 | /* Returns the DPLL rate */ | 214 | /** |
215 | * omap2_get_dpll_rate - returns the current DPLL CLKOUT rate | ||
216 | * @clk: struct clk * of a DPLL | ||
217 | * | ||
218 | * DPLLs can be locked or bypassed - basically, enabled or disabled. | ||
219 | * When locked, the DPLL output depends on the M and N values. When | ||
220 | * bypassed, on OMAP2xxx, the output rate is either the 32KiHz clock | ||
221 | * or sys_clk. Bypass rates on OMAP3 depend on the DPLL: DPLLs 1 and | ||
222 | * 2 are bypassed with dpll1_fclk and dpll2_fclk respectively | ||
223 | * (generated by DPLL3), while DPLL 3, 4, and 5 bypass rates are sys_clk. | ||
224 | * Returns the current DPLL CLKOUT rate (*not* CLKOUTX2) if the DPLL is | ||
225 | * locked, or the appropriate bypass rate if the DPLL is bypassed, or 0 | ||
226 | * if the clock @clk is not a DPLL. | ||
227 | */ | ||
138 | u32 omap2_get_dpll_rate(struct clk *clk) | 228 | u32 omap2_get_dpll_rate(struct clk *clk) |
139 | { | 229 | { |
140 | long long dpll_clk; | 230 | long long dpll_clk; |
141 | u32 dpll_mult, dpll_div, dpll; | 231 | u32 dpll_mult, dpll_div, v; |
142 | struct dpll_data *dd; | 232 | struct dpll_data *dd; |
143 | 233 | ||
144 | dd = clk->dpll_data; | 234 | dd = clk->dpll_data; |
145 | /* REVISIT: What do we return on error? */ | ||
146 | if (!dd) | 235 | if (!dd) |
147 | return 0; | 236 | return 0; |
148 | 237 | ||
149 | dpll = __raw_readl(dd->mult_div1_reg); | 238 | /* Return bypass rate if DPLL is bypassed */ |
150 | dpll_mult = dpll & dd->mult_mask; | 239 | v = __raw_readl(dd->control_reg); |
240 | v &= dd->enable_mask; | ||
241 | v >>= __ffs(dd->enable_mask); | ||
242 | |||
243 | if (cpu_is_omap24xx()) { | ||
244 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || | ||
245 | v == OMAP2XXX_EN_DPLL_FRBYPASS) | ||
246 | return dd->clk_bypass->rate; | ||
247 | } else if (cpu_is_omap34xx()) { | ||
248 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || | ||
249 | v == OMAP3XXX_EN_DPLL_FRBYPASS) | ||
250 | return dd->clk_bypass->rate; | ||
251 | } | ||
252 | |||
253 | v = __raw_readl(dd->mult_div1_reg); | ||
254 | dpll_mult = v & dd->mult_mask; | ||
151 | dpll_mult >>= __ffs(dd->mult_mask); | 255 | dpll_mult >>= __ffs(dd->mult_mask); |
152 | dpll_div = dpll & dd->div1_mask; | 256 | dpll_div = v & dd->div1_mask; |
153 | dpll_div >>= __ffs(dd->div1_mask); | 257 | dpll_div >>= __ffs(dd->div1_mask); |
154 | 258 | ||
155 | dpll_clk = (long long)clk->parent->rate * dpll_mult; | 259 | dpll_clk = (long long)dd->clk_ref->rate * dpll_mult; |
156 | do_div(dpll_clk, dpll_div + 1); | 260 | do_div(dpll_clk, dpll_div + 1); |
157 | 261 | ||
158 | return dpll_clk; | 262 | return dpll_clk; |
@@ -162,14 +266,11 @@ u32 omap2_get_dpll_rate(struct clk *clk) | |||
162 | * Used for clocks that have the same value as the parent clock, | 266 | * Used for clocks that have the same value as the parent clock, |
163 | * divided by some factor | 267 | * divided by some factor |
164 | */ | 268 | */ |
165 | void omap2_fixed_divisor_recalc(struct clk *clk) | 269 | unsigned long omap2_fixed_divisor_recalc(struct clk *clk) |
166 | { | 270 | { |
167 | WARN_ON(!clk->fixed_div); | 271 | WARN_ON(!clk->fixed_div); |
168 | 272 | ||
169 | clk->rate = clk->parent->rate / clk->fixed_div; | 273 | return clk->parent->rate / clk->fixed_div; |
170 | |||
171 | if (clk->flags & RATE_PROPAGATES) | ||
172 | propagate_rate(clk); | ||
173 | } | 274 | } |
174 | 275 | ||
175 | /** | 276 | /** |
@@ -190,11 +291,10 @@ int omap2_wait_clock_ready(void __iomem *reg, u32 mask, const char *name) | |||
190 | * 24xx uses 0 to indicate not ready, and 1 to indicate ready. | 291 | * 24xx uses 0 to indicate not ready, and 1 to indicate ready. |
191 | * 34xx reverses this, just to keep us on our toes | 292 | * 34xx reverses this, just to keep us on our toes |
192 | */ | 293 | */ |
193 | if (cpu_mask & (RATE_IN_242X | RATE_IN_243X)) { | 294 | if (cpu_mask & (RATE_IN_242X | RATE_IN_243X)) |
194 | ena = mask; | 295 | ena = mask; |
195 | } else if (cpu_mask & RATE_IN_343X) { | 296 | else if (cpu_mask & RATE_IN_343X) |
196 | ena = 0; | 297 | ena = 0; |
197 | } | ||
198 | 298 | ||
199 | /* Wait for lock */ | 299 | /* Wait for lock */ |
200 | while (((__raw_readl(reg) & mask) != ena) && | 300 | while (((__raw_readl(reg) & mask) != ena) && |
@@ -228,31 +328,12 @@ static void omap2_clk_wait_ready(struct clk *clk) | |||
228 | * it and pull it into struct clk itself somehow. | 328 | * it and pull it into struct clk itself somehow. |
229 | */ | 329 | */ |
230 | reg = clk->enable_reg; | 330 | reg = clk->enable_reg; |
231 | if ((((u32)reg & 0xff) >= CM_FCLKEN1) && | ||
232 | (((u32)reg & 0xff) <= OMAP24XX_CM_FCLKEN2)) | ||
233 | other_reg = (void __iomem *)(((u32)reg & ~0xf0) | 0x10); /* CM_ICLKEN* */ | ||
234 | else if ((((u32)reg & 0xff) >= CM_ICLKEN1) && | ||
235 | (((u32)reg & 0xff) <= OMAP24XX_CM_ICLKEN4)) | ||
236 | other_reg = (void __iomem *)(((u32)reg & ~0xf0) | 0x00); /* CM_FCLKEN* */ | ||
237 | else | ||
238 | return; | ||
239 | 331 | ||
240 | /* REVISIT: What are the appropriate exclusions for 34XX? */ | 332 | /* |
241 | /* No check for DSS or cam clocks */ | 333 | * Convert CM_ICLKEN* <-> CM_FCLKEN*. This conversion assumes |
242 | if (cpu_is_omap24xx() && ((u32)reg & 0x0f) == 0) { /* CM_{F,I}CLKEN1 */ | 334 | * it's just a matter of XORing the bits. |
243 | if (clk->enable_bit == OMAP24XX_EN_DSS2_SHIFT || | 335 | */ |
244 | clk->enable_bit == OMAP24XX_EN_DSS1_SHIFT || | 336 | other_reg = (void __iomem *)((u32)reg ^ (CM_FCLKEN ^ CM_ICLKEN)); |
245 | clk->enable_bit == OMAP24XX_EN_CAM_SHIFT) | ||
246 | return; | ||
247 | } | ||
248 | |||
249 | /* REVISIT: What are the appropriate exclusions for 34XX? */ | ||
250 | /* OMAP3: ignore DSS-mod clocks */ | ||
251 | if (cpu_is_omap34xx() && | ||
252 | (((u32)reg & ~0xff) == (u32)OMAP_CM_REGADDR(OMAP3430_DSS_MOD, 0) || | ||
253 | ((((u32)reg & ~0xff) == (u32)OMAP_CM_REGADDR(CORE_MOD, 0)) && | ||
254 | clk->enable_bit == OMAP3430_EN_SSI_SHIFT))) | ||
255 | return; | ||
256 | 337 | ||
257 | /* Check if both functional and interface clocks | 338 | /* Check if both functional and interface clocks |
258 | * are running. */ | 339 | * are running. */ |
@@ -264,18 +345,9 @@ static void omap2_clk_wait_ready(struct clk *clk) | |||
264 | omap2_wait_clock_ready(st_reg, bit, clk->name); | 345 | omap2_wait_clock_ready(st_reg, bit, clk->name); |
265 | } | 346 | } |
266 | 347 | ||
267 | /* Enables clock without considering parent dependencies or use count | 348 | static int omap2_dflt_clk_enable(struct clk *clk) |
268 | * REVISIT: Maybe change this to use clk->enable like on omap1? | ||
269 | */ | ||
270 | int _omap2_clk_enable(struct clk *clk) | ||
271 | { | 349 | { |
272 | u32 regval32; | 350 | u32 v; |
273 | |||
274 | if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK)) | ||
275 | return 0; | ||
276 | |||
277 | if (clk->enable) | ||
278 | return clk->enable(clk); | ||
279 | 351 | ||
280 | if (unlikely(clk->enable_reg == NULL)) { | 352 | if (unlikely(clk->enable_reg == NULL)) { |
281 | printk(KERN_ERR "clock.c: Enable for %s without enable code\n", | 353 | printk(KERN_ERR "clock.c: Enable for %s without enable code\n", |
@@ -283,33 +355,38 @@ int _omap2_clk_enable(struct clk *clk) | |||
283 | return 0; /* REVISIT: -EINVAL */ | 355 | return 0; /* REVISIT: -EINVAL */ |
284 | } | 356 | } |
285 | 357 | ||
286 | regval32 = __raw_readl(clk->enable_reg); | 358 | v = __raw_readl(clk->enable_reg); |
287 | if (clk->flags & INVERT_ENABLE) | 359 | if (clk->flags & INVERT_ENABLE) |
288 | regval32 &= ~(1 << clk->enable_bit); | 360 | v &= ~(1 << clk->enable_bit); |
289 | else | 361 | else |
290 | regval32 |= (1 << clk->enable_bit); | 362 | v |= (1 << clk->enable_bit); |
291 | __raw_writel(regval32, clk->enable_reg); | 363 | __raw_writel(v, clk->enable_reg); |
292 | wmb(); | 364 | v = __raw_readl(clk->enable_reg); /* OCP barrier */ |
293 | |||
294 | omap2_clk_wait_ready(clk); | ||
295 | 365 | ||
296 | return 0; | 366 | return 0; |
297 | } | 367 | } |
298 | 368 | ||
299 | /* Disables clock without considering parent dependencies or use count */ | 369 | static int omap2_dflt_clk_enable_wait(struct clk *clk) |
300 | void _omap2_clk_disable(struct clk *clk) | ||
301 | { | 370 | { |
302 | u32 regval32; | 371 | int ret; |
303 | |||
304 | if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK)) | ||
305 | return; | ||
306 | 372 | ||
307 | if (clk->disable) { | 373 | if (!clk->enable_reg) { |
308 | clk->disable(clk); | 374 | printk(KERN_ERR "clock.c: Enable for %s without enable code\n", |
309 | return; | 375 | clk->name); |
376 | return 0; /* REVISIT: -EINVAL */ | ||
310 | } | 377 | } |
311 | 378 | ||
312 | if (clk->enable_reg == NULL) { | 379 | ret = omap2_dflt_clk_enable(clk); |
380 | if (ret == 0) | ||
381 | omap2_clk_wait_ready(clk); | ||
382 | return ret; | ||
383 | } | ||
384 | |||
385 | static void omap2_dflt_clk_disable(struct clk *clk) | ||
386 | { | ||
387 | u32 v; | ||
388 | |||
389 | if (!clk->enable_reg) { | ||
313 | /* | 390 | /* |
314 | * 'Independent' here refers to a clock which is not | 391 | * 'Independent' here refers to a clock which is not |
315 | * controlled by its parent. | 392 | * controlled by its parent. |
@@ -319,20 +396,44 @@ void _omap2_clk_disable(struct clk *clk) | |||
319 | return; | 396 | return; |
320 | } | 397 | } |
321 | 398 | ||
322 | regval32 = __raw_readl(clk->enable_reg); | 399 | v = __raw_readl(clk->enable_reg); |
323 | if (clk->flags & INVERT_ENABLE) | 400 | if (clk->flags & INVERT_ENABLE) |
324 | regval32 |= (1 << clk->enable_bit); | 401 | v |= (1 << clk->enable_bit); |
325 | else | 402 | else |
326 | regval32 &= ~(1 << clk->enable_bit); | 403 | v &= ~(1 << clk->enable_bit); |
327 | __raw_writel(regval32, clk->enable_reg); | 404 | __raw_writel(v, clk->enable_reg); |
328 | wmb(); | 405 | /* No OCP barrier needed here since it is a disable operation */ |
406 | } | ||
407 | |||
408 | const struct clkops clkops_omap2_dflt_wait = { | ||
409 | .enable = omap2_dflt_clk_enable_wait, | ||
410 | .disable = omap2_dflt_clk_disable, | ||
411 | }; | ||
412 | |||
413 | const struct clkops clkops_omap2_dflt = { | ||
414 | .enable = omap2_dflt_clk_enable, | ||
415 | .disable = omap2_dflt_clk_disable, | ||
416 | }; | ||
417 | |||
418 | /* Enables clock without considering parent dependencies or use count | ||
419 | * REVISIT: Maybe change this to use clk->enable like on omap1? | ||
420 | */ | ||
421 | static int _omap2_clk_enable(struct clk *clk) | ||
422 | { | ||
423 | return clk->ops->enable(clk); | ||
424 | } | ||
425 | |||
426 | /* Disables clock without considering parent dependencies or use count */ | ||
427 | static void _omap2_clk_disable(struct clk *clk) | ||
428 | { | ||
429 | clk->ops->disable(clk); | ||
329 | } | 430 | } |
330 | 431 | ||
331 | void omap2_clk_disable(struct clk *clk) | 432 | void omap2_clk_disable(struct clk *clk) |
332 | { | 433 | { |
333 | if (clk->usecount > 0 && !(--clk->usecount)) { | 434 | if (clk->usecount > 0 && !(--clk->usecount)) { |
334 | _omap2_clk_disable(clk); | 435 | _omap2_clk_disable(clk); |
335 | if (likely((u32)clk->parent)) | 436 | if (clk->parent) |
336 | omap2_clk_disable(clk->parent); | 437 | omap2_clk_disable(clk->parent); |
337 | if (clk->clkdm) | 438 | if (clk->clkdm) |
338 | omap2_clkdm_clk_disable(clk->clkdm, clk); | 439 | omap2_clkdm_clk_disable(clk->clkdm, clk); |
@@ -345,30 +446,29 @@ int omap2_clk_enable(struct clk *clk) | |||
345 | int ret = 0; | 446 | int ret = 0; |
346 | 447 | ||
347 | if (clk->usecount++ == 0) { | 448 | if (clk->usecount++ == 0) { |
348 | if (likely((u32)clk->parent)) | ||
349 | ret = omap2_clk_enable(clk->parent); | ||
350 | |||
351 | if (unlikely(ret != 0)) { | ||
352 | clk->usecount--; | ||
353 | return ret; | ||
354 | } | ||
355 | |||
356 | if (clk->clkdm) | 449 | if (clk->clkdm) |
357 | omap2_clkdm_clk_enable(clk->clkdm, clk); | 450 | omap2_clkdm_clk_enable(clk->clkdm, clk); |
358 | 451 | ||
359 | ret = _omap2_clk_enable(clk); | 452 | if (clk->parent) { |
360 | 453 | ret = omap2_clk_enable(clk->parent); | |
361 | if (unlikely(ret != 0)) { | 454 | if (ret) |
362 | if (clk->clkdm) | 455 | goto err; |
363 | omap2_clkdm_clk_disable(clk->clkdm, clk); | 456 | } |
364 | 457 | ||
365 | if (clk->parent) { | 458 | ret = _omap2_clk_enable(clk); |
459 | if (ret) { | ||
460 | if (clk->parent) | ||
366 | omap2_clk_disable(clk->parent); | 461 | omap2_clk_disable(clk->parent); |
367 | clk->usecount--; | 462 | |
368 | } | 463 | goto err; |
369 | } | 464 | } |
370 | } | 465 | } |
466 | return ret; | ||
371 | 467 | ||
468 | err: | ||
469 | if (clk->clkdm) | ||
470 | omap2_clkdm_clk_disable(clk->clkdm, clk); | ||
471 | clk->usecount--; | ||
372 | return ret; | 472 | return ret; |
373 | } | 473 | } |
374 | 474 | ||
@@ -376,24 +476,22 @@ int omap2_clk_enable(struct clk *clk) | |||
376 | * Used for clocks that are part of CLKSEL_xyz governed clocks. | 476 | * Used for clocks that are part of CLKSEL_xyz governed clocks. |
377 | * REVISIT: Maybe change to use clk->enable() functions like on omap1? | 477 | * REVISIT: Maybe change to use clk->enable() functions like on omap1? |
378 | */ | 478 | */ |
379 | void omap2_clksel_recalc(struct clk *clk) | 479 | unsigned long omap2_clksel_recalc(struct clk *clk) |
380 | { | 480 | { |
481 | unsigned long rate; | ||
381 | u32 div = 0; | 482 | u32 div = 0; |
382 | 483 | ||
383 | pr_debug("clock: recalc'ing clksel clk %s\n", clk->name); | 484 | pr_debug("clock: recalc'ing clksel clk %s\n", clk->name); |
384 | 485 | ||
385 | div = omap2_clksel_get_divisor(clk); | 486 | div = omap2_clksel_get_divisor(clk); |
386 | if (div == 0) | 487 | if (div == 0) |
387 | return; | 488 | return clk->rate; |
388 | 489 | ||
389 | if (unlikely(clk->rate == clk->parent->rate / div)) | 490 | rate = clk->parent->rate / div; |
390 | return; | ||
391 | clk->rate = clk->parent->rate / div; | ||
392 | 491 | ||
393 | pr_debug("clock: new clock rate is %ld (div %d)\n", clk->rate, div); | 492 | pr_debug("clock: new clock rate is %ld (div %d)\n", rate, div); |
394 | 493 | ||
395 | if (unlikely(clk->flags & RATE_PROPAGATES)) | 494 | return rate; |
396 | propagate_rate(clk); | ||
397 | } | 495 | } |
398 | 496 | ||
399 | /** | 497 | /** |
@@ -405,8 +503,8 @@ void omap2_clksel_recalc(struct clk *clk) | |||
405 | * the element associated with the supplied parent clock address. | 503 | * the element associated with the supplied parent clock address. |
406 | * Returns a pointer to the struct clksel on success or NULL on error. | 504 | * Returns a pointer to the struct clksel on success or NULL on error. |
407 | */ | 505 | */ |
408 | const struct clksel *omap2_get_clksel_by_parent(struct clk *clk, | 506 | static const struct clksel *omap2_get_clksel_by_parent(struct clk *clk, |
409 | struct clk *src_clk) | 507 | struct clk *src_clk) |
410 | { | 508 | { |
411 | const struct clksel *clks; | 509 | const struct clksel *clks; |
412 | 510 | ||
@@ -455,7 +553,7 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate, | |||
455 | *new_div = 1; | 553 | *new_div = 1; |
456 | 554 | ||
457 | clks = omap2_get_clksel_by_parent(clk, clk->parent); | 555 | clks = omap2_get_clksel_by_parent(clk, clk->parent); |
458 | if (clks == NULL) | 556 | if (!clks) |
459 | return ~0; | 557 | return ~0; |
460 | 558 | ||
461 | for (clkr = clks->rates; clkr->div; clkr++) { | 559 | for (clkr = clks->rates; clkr->div; clkr++) { |
@@ -514,7 +612,7 @@ long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate) | |||
514 | /* Given a clock and a rate apply a clock specific rounding function */ | 612 | /* Given a clock and a rate apply a clock specific rounding function */ |
515 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate) | 613 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate) |
516 | { | 614 | { |
517 | if (clk->round_rate != NULL) | 615 | if (clk->round_rate) |
518 | return clk->round_rate(clk, rate); | 616 | return clk->round_rate(clk, rate); |
519 | 617 | ||
520 | if (clk->flags & RATE_FIXED) | 618 | if (clk->flags & RATE_FIXED) |
@@ -540,7 +638,7 @@ u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val) | |||
540 | const struct clksel_rate *clkr; | 638 | const struct clksel_rate *clkr; |
541 | 639 | ||
542 | clks = omap2_get_clksel_by_parent(clk, clk->parent); | 640 | clks = omap2_get_clksel_by_parent(clk, clk->parent); |
543 | if (clks == NULL) | 641 | if (!clks) |
544 | return 0; | 642 | return 0; |
545 | 643 | ||
546 | for (clkr = clks->rates; clkr->div; clkr++) { | 644 | for (clkr = clks->rates; clkr->div; clkr++) { |
@@ -565,7 +663,7 @@ u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val) | |||
565 | * | 663 | * |
566 | * Given a struct clk of a rate-selectable clksel clock, and a clock divisor, | 664 | * Given a struct clk of a rate-selectable clksel clock, and a clock divisor, |
567 | * find the corresponding register field value. The return register value is | 665 | * find the corresponding register field value. The return register value is |
568 | * the value before left-shifting. Returns 0xffffffff on error | 666 | * the value before left-shifting. Returns ~0 on error |
569 | */ | 667 | */ |
570 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) | 668 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) |
571 | { | 669 | { |
@@ -576,8 +674,8 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) | |||
576 | WARN_ON(div == 0); | 674 | WARN_ON(div == 0); |
577 | 675 | ||
578 | clks = omap2_get_clksel_by_parent(clk, clk->parent); | 676 | clks = omap2_get_clksel_by_parent(clk, clk->parent); |
579 | if (clks == NULL) | 677 | if (!clks) |
580 | return 0; | 678 | return ~0; |
581 | 679 | ||
582 | for (clkr = clks->rates; clkr->div; clkr++) { | 680 | for (clkr = clks->rates; clkr->div; clkr++) { |
583 | if ((clkr->flags & cpu_mask) && (clkr->div == div)) | 681 | if ((clkr->flags & cpu_mask) && (clkr->div == div)) |
@@ -588,30 +686,13 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) | |||
588 | printk(KERN_ERR "clock: Could not find divisor %d for " | 686 | printk(KERN_ERR "clock: Could not find divisor %d for " |
589 | "clock %s parent %s\n", div, clk->name, | 687 | "clock %s parent %s\n", div, clk->name, |
590 | clk->parent->name); | 688 | clk->parent->name); |
591 | return 0; | 689 | return ~0; |
592 | } | 690 | } |
593 | 691 | ||
594 | return clkr->val; | 692 | return clkr->val; |
595 | } | 693 | } |
596 | 694 | ||
597 | /** | 695 | /** |
598 | * omap2_get_clksel - find clksel register addr & field mask for a clk | ||
599 | * @clk: struct clk to use | ||
600 | * @field_mask: ptr to u32 to store the register field mask | ||
601 | * | ||
602 | * Returns the address of the clksel register upon success or NULL on error. | ||
603 | */ | ||
604 | void __iomem *omap2_get_clksel(struct clk *clk, u32 *field_mask) | ||
605 | { | ||
606 | if (unlikely((clk->clksel_reg == NULL) || (clk->clksel_mask == NULL))) | ||
607 | return NULL; | ||
608 | |||
609 | *field_mask = clk->clksel_mask; | ||
610 | |||
611 | return clk->clksel_reg; | ||
612 | } | ||
613 | |||
614 | /** | ||
615 | * omap2_clksel_get_divisor - get current divider applied to parent clock. | 696 | * omap2_clksel_get_divisor - get current divider applied to parent clock. |
616 | * @clk: OMAP struct clk to use. | 697 | * @clk: OMAP struct clk to use. |
617 | * | 698 | * |
@@ -619,49 +700,41 @@ void __iomem *omap2_get_clksel(struct clk *clk, u32 *field_mask) | |||
619 | */ | 700 | */ |
620 | u32 omap2_clksel_get_divisor(struct clk *clk) | 701 | u32 omap2_clksel_get_divisor(struct clk *clk) |
621 | { | 702 | { |
622 | u32 field_mask, field_val; | 703 | u32 v; |
623 | void __iomem *div_addr; | ||
624 | 704 | ||
625 | div_addr = omap2_get_clksel(clk, &field_mask); | 705 | if (!clk->clksel_mask) |
626 | if (div_addr == NULL) | ||
627 | return 0; | 706 | return 0; |
628 | 707 | ||
629 | field_val = __raw_readl(div_addr) & field_mask; | 708 | v = __raw_readl(clk->clksel_reg) & clk->clksel_mask; |
630 | field_val >>= __ffs(field_mask); | 709 | v >>= __ffs(clk->clksel_mask); |
631 | 710 | ||
632 | return omap2_clksel_to_divisor(clk, field_val); | 711 | return omap2_clksel_to_divisor(clk, v); |
633 | } | 712 | } |
634 | 713 | ||
635 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate) | 714 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate) |
636 | { | 715 | { |
637 | u32 field_mask, field_val, reg_val, validrate, new_div = 0; | 716 | u32 v, field_val, validrate, new_div = 0; |
638 | void __iomem *div_addr; | ||
639 | 717 | ||
640 | validrate = omap2_clksel_round_rate_div(clk, rate, &new_div); | 718 | if (!clk->clksel_mask) |
641 | if (validrate != rate) | ||
642 | return -EINVAL; | 719 | return -EINVAL; |
643 | 720 | ||
644 | div_addr = omap2_get_clksel(clk, &field_mask); | 721 | validrate = omap2_clksel_round_rate_div(clk, rate, &new_div); |
645 | if (div_addr == NULL) | 722 | if (validrate != rate) |
646 | return -EINVAL; | 723 | return -EINVAL; |
647 | 724 | ||
648 | field_val = omap2_divisor_to_clksel(clk, new_div); | 725 | field_val = omap2_divisor_to_clksel(clk, new_div); |
649 | if (field_val == ~0) | 726 | if (field_val == ~0) |
650 | return -EINVAL; | 727 | return -EINVAL; |
651 | 728 | ||
652 | reg_val = __raw_readl(div_addr); | 729 | v = __raw_readl(clk->clksel_reg); |
653 | reg_val &= ~field_mask; | 730 | v &= ~clk->clksel_mask; |
654 | reg_val |= (field_val << __ffs(field_mask)); | 731 | v |= field_val << __ffs(clk->clksel_mask); |
655 | __raw_writel(reg_val, div_addr); | 732 | __raw_writel(v, clk->clksel_reg); |
656 | wmb(); | 733 | v = __raw_readl(clk->clksel_reg); /* OCP barrier */ |
657 | 734 | ||
658 | clk->rate = clk->parent->rate / new_div; | 735 | clk->rate = clk->parent->rate / new_div; |
659 | 736 | ||
660 | if (clk->flags & DELAYED_APP && cpu_is_omap24xx()) { | 737 | _omap2xxx_clk_commit(clk); |
661 | prm_write_mod_reg(OMAP24XX_VALID_CONFIG, | ||
662 | OMAP24XX_GR_MOD, OMAP24XX_PRCM_CLKCFG_CTRL_OFFSET); | ||
663 | wmb(); | ||
664 | } | ||
665 | 738 | ||
666 | return 0; | 739 | return 0; |
667 | } | 740 | } |
@@ -680,35 +753,28 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate) | |||
680 | return -EINVAL; | 753 | return -EINVAL; |
681 | 754 | ||
682 | /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ | 755 | /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ |
683 | if (clk->set_rate != NULL) | 756 | if (clk->set_rate) |
684 | ret = clk->set_rate(clk, rate); | 757 | ret = clk->set_rate(clk, rate); |
685 | 758 | ||
686 | if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES))) | ||
687 | propagate_rate(clk); | ||
688 | |||
689 | return ret; | 759 | return ret; |
690 | } | 760 | } |
691 | 761 | ||
692 | /* | 762 | /* |
693 | * Converts encoded control register address into a full address | 763 | * Converts encoded control register address into a full address |
694 | * On error, *src_addr will be returned as 0. | 764 | * On error, the return value (parent_div) will be 0. |
695 | */ | 765 | */ |
696 | static u32 omap2_clksel_get_src_field(void __iomem **src_addr, | 766 | static u32 _omap2_clksel_get_src_field(struct clk *src_clk, struct clk *clk, |
697 | struct clk *src_clk, u32 *field_mask, | 767 | u32 *field_val) |
698 | struct clk *clk, u32 *parent_div) | ||
699 | { | 768 | { |
700 | const struct clksel *clks; | 769 | const struct clksel *clks; |
701 | const struct clksel_rate *clkr; | 770 | const struct clksel_rate *clkr; |
702 | 771 | ||
703 | *parent_div = 0; | ||
704 | *src_addr = NULL; | ||
705 | |||
706 | clks = omap2_get_clksel_by_parent(clk, src_clk); | 772 | clks = omap2_get_clksel_by_parent(clk, src_clk); |
707 | if (clks == NULL) | 773 | if (!clks) |
708 | return 0; | 774 | return 0; |
709 | 775 | ||
710 | for (clkr = clks->rates; clkr->div; clkr++) { | 776 | for (clkr = clks->rates; clkr->div; clkr++) { |
711 | if (clkr->flags & (cpu_mask | DEFAULT_RATE)) | 777 | if (clkr->flags & cpu_mask && clkr->flags & DEFAULT_RATE) |
712 | break; /* Found the default rate for this platform */ | 778 | break; /* Found the default rate for this platform */ |
713 | } | 779 | } |
714 | 780 | ||
@@ -722,47 +788,35 @@ static u32 omap2_clksel_get_src_field(void __iomem **src_addr, | |||
722 | /* Should never happen. Add a clksel mask to the struct clk. */ | 788 | /* Should never happen. Add a clksel mask to the struct clk. */ |
723 | WARN_ON(clk->clksel_mask == 0); | 789 | WARN_ON(clk->clksel_mask == 0); |
724 | 790 | ||
725 | *field_mask = clk->clksel_mask; | 791 | *field_val = clkr->val; |
726 | *src_addr = clk->clksel_reg; | ||
727 | *parent_div = clkr->div; | ||
728 | 792 | ||
729 | return clkr->val; | 793 | return clkr->div; |
730 | } | 794 | } |
731 | 795 | ||
732 | int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) | 796 | int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) |
733 | { | 797 | { |
734 | void __iomem *src_addr; | 798 | u32 field_val, v, parent_div; |
735 | u32 field_val, field_mask, reg_val, parent_div; | ||
736 | 799 | ||
737 | if (unlikely(clk->flags & CONFIG_PARTICIPANT)) | 800 | if (clk->flags & CONFIG_PARTICIPANT) |
738 | return -EINVAL; | 801 | return -EINVAL; |
739 | 802 | ||
740 | if (!clk->clksel) | 803 | if (!clk->clksel) |
741 | return -EINVAL; | 804 | return -EINVAL; |
742 | 805 | ||
743 | field_val = omap2_clksel_get_src_field(&src_addr, new_parent, | 806 | parent_div = _omap2_clksel_get_src_field(new_parent, clk, &field_val); |
744 | &field_mask, clk, &parent_div); | 807 | if (!parent_div) |
745 | if (src_addr == NULL) | ||
746 | return -EINVAL; | 808 | return -EINVAL; |
747 | 809 | ||
748 | if (clk->usecount > 0) | ||
749 | _omap2_clk_disable(clk); | ||
750 | |||
751 | /* Set new source value (previous dividers if any in effect) */ | 810 | /* Set new source value (previous dividers if any in effect) */ |
752 | reg_val = __raw_readl(src_addr) & ~field_mask; | 811 | v = __raw_readl(clk->clksel_reg); |
753 | reg_val |= (field_val << __ffs(field_mask)); | 812 | v &= ~clk->clksel_mask; |
754 | __raw_writel(reg_val, src_addr); | 813 | v |= field_val << __ffs(clk->clksel_mask); |
755 | wmb(); | 814 | __raw_writel(v, clk->clksel_reg); |
756 | 815 | v = __raw_readl(clk->clksel_reg); /* OCP barrier */ | |
757 | if (clk->flags & DELAYED_APP && cpu_is_omap24xx()) { | ||
758 | __raw_writel(OMAP24XX_VALID_CONFIG, OMAP24XX_PRCM_CLKCFG_CTRL); | ||
759 | wmb(); | ||
760 | } | ||
761 | 816 | ||
762 | if (clk->usecount > 0) | 817 | _omap2xxx_clk_commit(clk); |
763 | _omap2_clk_enable(clk); | ||
764 | 818 | ||
765 | clk->parent = new_parent; | 819 | clk_reparent(clk, new_parent); |
766 | 820 | ||
767 | /* CLKSEL clocks follow their parents' rates, divided by a divisor */ | 821 | /* CLKSEL clocks follow their parents' rates, divided by a divisor */ |
768 | clk->rate = new_parent->rate; | 822 | clk->rate = new_parent->rate; |
@@ -773,9 +827,6 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) | |||
773 | pr_debug("clock: set parent of %s to %s (new rate %ld)\n", | 827 | pr_debug("clock: set parent of %s to %s (new rate %ld)\n", |
774 | clk->name, clk->parent->name, clk->rate); | 828 | clk->name, clk->parent->name, clk->rate); |
775 | 829 | ||
776 | if (unlikely(clk->flags & RATE_PROPAGATES)) | ||
777 | propagate_rate(clk); | ||
778 | |||
779 | return 0; | 830 | return 0; |
780 | } | 831 | } |
781 | 832 | ||
@@ -805,7 +856,8 @@ int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance) | |||
805 | return 0; | 856 | return 0; |
806 | } | 857 | } |
807 | 858 | ||
808 | static unsigned long _dpll_compute_new_rate(unsigned long parent_rate, unsigned int m, unsigned int n) | 859 | static unsigned long _dpll_compute_new_rate(unsigned long parent_rate, |
860 | unsigned int m, unsigned int n) | ||
809 | { | 861 | { |
810 | unsigned long long num; | 862 | unsigned long long num; |
811 | 863 | ||
@@ -838,7 +890,7 @@ static int _dpll_test_mult(int *m, int n, unsigned long *new_rate, | |||
838 | unsigned long target_rate, | 890 | unsigned long target_rate, |
839 | unsigned long parent_rate) | 891 | unsigned long parent_rate) |
840 | { | 892 | { |
841 | int flags = 0, carry = 0; | 893 | int r = 0, carry = 0; |
842 | 894 | ||
843 | /* Unscale m and round if necessary */ | 895 | /* Unscale m and round if necessary */ |
844 | if (*m % DPLL_SCALE_FACTOR >= DPLL_ROUNDING_VAL) | 896 | if (*m % DPLL_SCALE_FACTOR >= DPLL_ROUNDING_VAL) |
@@ -859,13 +911,13 @@ static int _dpll_test_mult(int *m, int n, unsigned long *new_rate, | |||
859 | if (*m < DPLL_MIN_MULTIPLIER) { | 911 | if (*m < DPLL_MIN_MULTIPLIER) { |
860 | *m = DPLL_MIN_MULTIPLIER; | 912 | *m = DPLL_MIN_MULTIPLIER; |
861 | *new_rate = 0; | 913 | *new_rate = 0; |
862 | flags = DPLL_MULT_UNDERFLOW; | 914 | r = DPLL_MULT_UNDERFLOW; |
863 | } | 915 | } |
864 | 916 | ||
865 | if (*new_rate == 0) | 917 | if (*new_rate == 0) |
866 | *new_rate = _dpll_compute_new_rate(parent_rate, *m, n); | 918 | *new_rate = _dpll_compute_new_rate(parent_rate, *m, n); |
867 | 919 | ||
868 | return flags; | 920 | return r; |
869 | } | 921 | } |
870 | 922 | ||
871 | /** | 923 | /** |
@@ -889,54 +941,65 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) | |||
889 | int m, n, r, e, scaled_max_m; | 941 | int m, n, r, e, scaled_max_m; |
890 | unsigned long scaled_rt_rp, new_rate; | 942 | unsigned long scaled_rt_rp, new_rate; |
891 | int min_e = -1, min_e_m = -1, min_e_n = -1; | 943 | int min_e = -1, min_e_m = -1, min_e_n = -1; |
944 | struct dpll_data *dd; | ||
892 | 945 | ||
893 | if (!clk || !clk->dpll_data) | 946 | if (!clk || !clk->dpll_data) |
894 | return ~0; | 947 | return ~0; |
895 | 948 | ||
949 | dd = clk->dpll_data; | ||
950 | |||
896 | pr_debug("clock: starting DPLL round_rate for clock %s, target rate " | 951 | pr_debug("clock: starting DPLL round_rate for clock %s, target rate " |
897 | "%ld\n", clk->name, target_rate); | 952 | "%ld\n", clk->name, target_rate); |
898 | 953 | ||
899 | scaled_rt_rp = target_rate / (clk->parent->rate / DPLL_SCALE_FACTOR); | 954 | scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR); |
900 | scaled_max_m = clk->dpll_data->max_multiplier * DPLL_SCALE_FACTOR; | 955 | scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR; |
901 | 956 | ||
902 | clk->dpll_data->last_rounded_rate = 0; | 957 | dd->last_rounded_rate = 0; |
903 | 958 | ||
904 | for (n = clk->dpll_data->max_divider; n >= DPLL_MIN_DIVIDER; n--) { | 959 | for (n = dd->min_divider; n <= dd->max_divider; n++) { |
960 | |||
961 | /* Is the (input clk, divider) pair valid for the DPLL? */ | ||
962 | r = _dpll_test_fint(clk, n); | ||
963 | if (r == DPLL_FINT_UNDERFLOW) | ||
964 | break; | ||
965 | else if (r == DPLL_FINT_INVALID) | ||
966 | continue; | ||
905 | 967 | ||
906 | /* Compute the scaled DPLL multiplier, based on the divider */ | 968 | /* Compute the scaled DPLL multiplier, based on the divider */ |
907 | m = scaled_rt_rp * n; | 969 | m = scaled_rt_rp * n; |
908 | 970 | ||
909 | /* | 971 | /* |
910 | * Since we're counting n down, a m overflow means we can | 972 | * Since we're counting n up, a m overflow means we |
911 | * can immediately skip to the next n | 973 | * can bail out completely (since as n increases in |
974 | * the next iteration, there's no way that m can | ||
975 | * increase beyond the current m) | ||
912 | */ | 976 | */ |
913 | if (m > scaled_max_m) | 977 | if (m > scaled_max_m) |
914 | continue; | 978 | break; |
915 | 979 | ||
916 | r = _dpll_test_mult(&m, n, &new_rate, target_rate, | 980 | r = _dpll_test_mult(&m, n, &new_rate, target_rate, |
917 | clk->parent->rate); | 981 | dd->clk_ref->rate); |
982 | |||
983 | /* m can't be set low enough for this n - try with a larger n */ | ||
984 | if (r == DPLL_MULT_UNDERFLOW) | ||
985 | continue; | ||
918 | 986 | ||
919 | e = target_rate - new_rate; | 987 | e = target_rate - new_rate; |
920 | pr_debug("clock: n = %d: m = %d: rate error is %d " | 988 | pr_debug("clock: n = %d: m = %d: rate error is %d " |
921 | "(new_rate = %ld)\n", n, m, e, new_rate); | 989 | "(new_rate = %ld)\n", n, m, e, new_rate); |
922 | 990 | ||
923 | if (min_e == -1 || | 991 | if (min_e == -1 || |
924 | min_e >= (int)(abs(e) - clk->dpll_data->rate_tolerance)) { | 992 | min_e >= (int)(abs(e) - dd->rate_tolerance)) { |
925 | min_e = e; | 993 | min_e = e; |
926 | min_e_m = m; | 994 | min_e_m = m; |
927 | min_e_n = n; | 995 | min_e_n = n; |
928 | 996 | ||
929 | pr_debug("clock: found new least error %d\n", min_e); | 997 | pr_debug("clock: found new least error %d\n", min_e); |
930 | } | ||
931 | 998 | ||
932 | /* | 999 | /* We found good settings -- bail out now */ |
933 | * Since we're counting n down, a m underflow means we | 1000 | if (min_e <= dd->rate_tolerance) |
934 | * can bail out completely (since as n decreases in | 1001 | break; |
935 | * the next iteration, there's no way that m can | 1002 | } |
936 | * increase beyond the current m) | ||
937 | */ | ||
938 | if (r & DPLL_MULT_UNDERFLOW) | ||
939 | break; | ||
940 | } | 1003 | } |
941 | 1004 | ||
942 | if (min_e < 0) { | 1005 | if (min_e < 0) { |
@@ -944,17 +1007,17 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) | |||
944 | return ~0; | 1007 | return ~0; |
945 | } | 1008 | } |
946 | 1009 | ||
947 | clk->dpll_data->last_rounded_m = min_e_m; | 1010 | dd->last_rounded_m = min_e_m; |
948 | clk->dpll_data->last_rounded_n = min_e_n; | 1011 | dd->last_rounded_n = min_e_n; |
949 | clk->dpll_data->last_rounded_rate = | 1012 | dd->last_rounded_rate = _dpll_compute_new_rate(dd->clk_ref->rate, |
950 | _dpll_compute_new_rate(clk->parent->rate, min_e_m, min_e_n); | 1013 | min_e_m, min_e_n); |
951 | 1014 | ||
952 | pr_debug("clock: final least error: e = %d, m = %d, n = %d\n", | 1015 | pr_debug("clock: final least error: e = %d, m = %d, n = %d\n", |
953 | min_e, min_e_m, min_e_n); | 1016 | min_e, min_e_m, min_e_n); |
954 | pr_debug("clock: final rate: %ld (target rate: %ld)\n", | 1017 | pr_debug("clock: final rate: %ld (target rate: %ld)\n", |
955 | clk->dpll_data->last_rounded_rate, target_rate); | 1018 | dd->last_rounded_rate, target_rate); |
956 | 1019 | ||
957 | return clk->dpll_data->last_rounded_rate; | 1020 | return dd->last_rounded_rate; |
958 | } | 1021 | } |
959 | 1022 | ||
960 | /*------------------------------------------------------------------------- | 1023 | /*------------------------------------------------------------------------- |
@@ -973,6 +1036,10 @@ void omap2_clk_disable_unused(struct clk *clk) | |||
973 | return; | 1036 | return; |
974 | 1037 | ||
975 | printk(KERN_INFO "Disabling unused clock \"%s\"\n", clk->name); | 1038 | printk(KERN_INFO "Disabling unused clock \"%s\"\n", clk->name); |
976 | _omap2_clk_disable(clk); | 1039 | if (cpu_is_omap34xx()) { |
1040 | omap2_clk_enable(clk); | ||
1041 | omap2_clk_disable(clk); | ||
1042 | } else | ||
1043 | _omap2_clk_disable(clk); | ||
977 | } | 1044 | } |
978 | #endif | 1045 | #endif |
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 1fb330e0847d..2679ddfa6424 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
@@ -21,13 +21,28 @@ | |||
21 | /* The maximum error between a target DPLL rate and the rounded rate in Hz */ | 21 | /* The maximum error between a target DPLL rate and the rounded rate in Hz */ |
22 | #define DEFAULT_DPLL_RATE_TOLERANCE 50000 | 22 | #define DEFAULT_DPLL_RATE_TOLERANCE 50000 |
23 | 23 | ||
24 | /* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ | ||
25 | #define CORE_CLK_SRC_32K 0x0 | ||
26 | #define CORE_CLK_SRC_DPLL 0x1 | ||
27 | #define CORE_CLK_SRC_DPLL_X2 0x2 | ||
28 | |||
29 | /* OMAP2xxx CM_CLKEN_PLL.EN_DPLL bits - for omap2_get_dpll_rate() */ | ||
30 | #define OMAP2XXX_EN_DPLL_LPBYPASS 0x1 | ||
31 | #define OMAP2XXX_EN_DPLL_FRBYPASS 0x2 | ||
32 | #define OMAP2XXX_EN_DPLL_LOCKED 0x3 | ||
33 | |||
34 | /* OMAP3xxx CM_CLKEN_PLL*.EN_*_DPLL bits - for omap2_get_dpll_rate() */ | ||
35 | #define OMAP3XXX_EN_DPLL_LPBYPASS 0x5 | ||
36 | #define OMAP3XXX_EN_DPLL_FRBYPASS 0x6 | ||
37 | #define OMAP3XXX_EN_DPLL_LOCKED 0x7 | ||
38 | |||
24 | int omap2_clk_init(void); | 39 | int omap2_clk_init(void); |
25 | int omap2_clk_enable(struct clk *clk); | 40 | int omap2_clk_enable(struct clk *clk); |
26 | void omap2_clk_disable(struct clk *clk); | 41 | void omap2_clk_disable(struct clk *clk); |
27 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate); | 42 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate); |
28 | int omap2_clk_set_rate(struct clk *clk, unsigned long rate); | 43 | int omap2_clk_set_rate(struct clk *clk, unsigned long rate); |
29 | int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent); | 44 | int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent); |
30 | int omap2_dpll_rate_tolerance_set(struct clk *clk, unsigned int tolerance); | 45 | int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance); |
31 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate); | 46 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate); |
32 | 47 | ||
33 | #ifdef CONFIG_OMAP_RESET_CLOCKS | 48 | #ifdef CONFIG_OMAP_RESET_CLOCKS |
@@ -36,7 +51,7 @@ void omap2_clk_disable_unused(struct clk *clk); | |||
36 | #define omap2_clk_disable_unused NULL | 51 | #define omap2_clk_disable_unused NULL |
37 | #endif | 52 | #endif |
38 | 53 | ||
39 | void omap2_clksel_recalc(struct clk *clk); | 54 | unsigned long omap2_clksel_recalc(struct clk *clk); |
40 | void omap2_init_clk_clkdm(struct clk *clk); | 55 | void omap2_init_clk_clkdm(struct clk *clk); |
41 | void omap2_init_clksel_parent(struct clk *clk); | 56 | void omap2_init_clksel_parent(struct clk *clk); |
42 | u32 omap2_clksel_get_divisor(struct clk *clk); | 57 | u32 omap2_clksel_get_divisor(struct clk *clk); |
@@ -44,13 +59,16 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate, | |||
44 | u32 *new_div); | 59 | u32 *new_div); |
45 | u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val); | 60 | u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val); |
46 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div); | 61 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div); |
47 | void omap2_fixed_divisor_recalc(struct clk *clk); | 62 | unsigned long omap2_fixed_divisor_recalc(struct clk *clk); |
48 | long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate); | 63 | long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate); |
49 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); | 64 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); |
50 | u32 omap2_get_dpll_rate(struct clk *clk); | 65 | u32 omap2_get_dpll_rate(struct clk *clk); |
51 | int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name); | 66 | int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name); |
52 | void omap2_clk_prepare_for_reboot(void); | 67 | void omap2_clk_prepare_for_reboot(void); |
53 | 68 | ||
69 | extern const struct clkops clkops_omap2_dflt_wait; | ||
70 | extern const struct clkops clkops_omap2_dflt; | ||
71 | |||
54 | extern u8 cpu_mask; | 72 | extern u8 cpu_mask; |
55 | 73 | ||
56 | /* clksel_rate data common to 24xx/343x */ | 74 | /* clksel_rate data common to 24xx/343x */ |
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c index d382eb0184ac..1e839c5a28c5 100644 --- a/arch/arm/mach-omap2/clock24xx.c +++ b/arch/arm/mach-omap2/clock24xx.c | |||
@@ -31,15 +31,192 @@ | |||
31 | #include <mach/clock.h> | 31 | #include <mach/clock.h> |
32 | #include <mach/sram.h> | 32 | #include <mach/sram.h> |
33 | #include <asm/div64.h> | 33 | #include <asm/div64.h> |
34 | #include <asm/clkdev.h> | ||
34 | 35 | ||
35 | #include "memory.h" | 36 | #include <mach/sdrc.h> |
36 | #include "clock.h" | 37 | #include "clock.h" |
37 | #include "clock24xx.h" | ||
38 | #include "prm.h" | 38 | #include "prm.h" |
39 | #include "prm-regbits-24xx.h" | 39 | #include "prm-regbits-24xx.h" |
40 | #include "cm.h" | 40 | #include "cm.h" |
41 | #include "cm-regbits-24xx.h" | 41 | #include "cm-regbits-24xx.h" |
42 | 42 | ||
43 | static const struct clkops clkops_oscck; | ||
44 | static const struct clkops clkops_fixed; | ||
45 | |||
46 | #include "clock24xx.h" | ||
47 | |||
48 | struct omap_clk { | ||
49 | u32 cpu; | ||
50 | struct clk_lookup lk; | ||
51 | }; | ||
52 | |||
53 | #define CLK(dev, con, ck, cp) \ | ||
54 | { \ | ||
55 | .cpu = cp, \ | ||
56 | .lk = { \ | ||
57 | .dev_id = dev, \ | ||
58 | .con_id = con, \ | ||
59 | .clk = ck, \ | ||
60 | }, \ | ||
61 | } | ||
62 | |||
63 | #define CK_243X (1 << 0) | ||
64 | #define CK_242X (1 << 1) | ||
65 | |||
66 | static struct omap_clk omap24xx_clks[] = { | ||
67 | /* external root sources */ | ||
68 | CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X | CK_242X), | ||
69 | CLK(NULL, "osc_ck", &osc_ck, CK_243X | CK_242X), | ||
70 | CLK(NULL, "sys_ck", &sys_ck, CK_243X | CK_242X), | ||
71 | CLK(NULL, "alt_ck", &alt_ck, CK_243X | CK_242X), | ||
72 | /* internal analog sources */ | ||
73 | CLK(NULL, "dpll_ck", &dpll_ck, CK_243X | CK_242X), | ||
74 | CLK(NULL, "apll96_ck", &apll96_ck, CK_243X | CK_242X), | ||
75 | CLK(NULL, "apll54_ck", &apll54_ck, CK_243X | CK_242X), | ||
76 | /* internal prcm root sources */ | ||
77 | CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X | CK_242X), | ||
78 | CLK(NULL, "core_ck", &core_ck, CK_243X | CK_242X), | ||
79 | CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X | CK_242X), | ||
80 | CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X | CK_242X), | ||
81 | CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X | CK_242X), | ||
82 | CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_243X | CK_242X), | ||
83 | CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X | CK_242X), | ||
84 | CLK(NULL, "sys_clkout", &sys_clkout, CK_243X | CK_242X), | ||
85 | CLK(NULL, "sys_clkout2_src", &sys_clkout2_src, CK_242X), | ||
86 | CLK(NULL, "sys_clkout2", &sys_clkout2, CK_242X), | ||
87 | CLK(NULL, "emul_ck", &emul_ck, CK_242X), | ||
88 | /* mpu domain clocks */ | ||
89 | CLK(NULL, "mpu_ck", &mpu_ck, CK_243X | CK_242X), | ||
90 | /* dsp domain clocks */ | ||
91 | CLK(NULL, "dsp_fck", &dsp_fck, CK_243X | CK_242X), | ||
92 | CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X | CK_242X), | ||
93 | CLK(NULL, "dsp_ick", &dsp_ick, CK_242X), | ||
94 | CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X), | ||
95 | CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X), | ||
96 | CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X), | ||
97 | /* GFX domain clocks */ | ||
98 | CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X | CK_242X), | ||
99 | CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_243X | CK_242X), | ||
100 | CLK(NULL, "gfx_ick", &gfx_ick, CK_243X | CK_242X), | ||
101 | /* Modem domain clocks */ | ||
102 | CLK(NULL, "mdm_ick", &mdm_ick, CK_243X), | ||
103 | CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X), | ||
104 | /* DSS domain clocks */ | ||
105 | CLK(NULL, "dss_ick", &dss_ick, CK_243X | CK_242X), | ||
106 | CLK(NULL, "dss1_fck", &dss1_fck, CK_243X | CK_242X), | ||
107 | CLK(NULL, "dss2_fck", &dss2_fck, CK_243X | CK_242X), | ||
108 | CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_243X | CK_242X), | ||
109 | /* L3 domain clocks */ | ||
110 | CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X | CK_242X), | ||
111 | CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X | CK_242X), | ||
112 | CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_243X | CK_242X), | ||
113 | /* L4 domain clocks */ | ||
114 | CLK(NULL, "l4_ck", &l4_ck, CK_243X | CK_242X), | ||
115 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X | CK_242X), | ||
116 | /* virtual meta-group clock */ | ||
117 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X | CK_242X), | ||
118 | /* general l4 interface ck, multi-parent functional clk */ | ||
119 | CLK(NULL, "gpt1_ick", &gpt1_ick, CK_243X | CK_242X), | ||
120 | CLK(NULL, "gpt1_fck", &gpt1_fck, CK_243X | CK_242X), | ||
121 | CLK(NULL, "gpt2_ick", &gpt2_ick, CK_243X | CK_242X), | ||
122 | CLK(NULL, "gpt2_fck", &gpt2_fck, CK_243X | CK_242X), | ||
123 | CLK(NULL, "gpt3_ick", &gpt3_ick, CK_243X | CK_242X), | ||
124 | CLK(NULL, "gpt3_fck", &gpt3_fck, CK_243X | CK_242X), | ||
125 | CLK(NULL, "gpt4_ick", &gpt4_ick, CK_243X | CK_242X), | ||
126 | CLK(NULL, "gpt4_fck", &gpt4_fck, CK_243X | CK_242X), | ||
127 | CLK(NULL, "gpt5_ick", &gpt5_ick, CK_243X | CK_242X), | ||
128 | CLK(NULL, "gpt5_fck", &gpt5_fck, CK_243X | CK_242X), | ||
129 | CLK(NULL, "gpt6_ick", &gpt6_ick, CK_243X | CK_242X), | ||
130 | CLK(NULL, "gpt6_fck", &gpt6_fck, CK_243X | CK_242X), | ||
131 | CLK(NULL, "gpt7_ick", &gpt7_ick, CK_243X | CK_242X), | ||
132 | CLK(NULL, "gpt7_fck", &gpt7_fck, CK_243X | CK_242X), | ||
133 | CLK(NULL, "gpt8_ick", &gpt8_ick, CK_243X | CK_242X), | ||
134 | CLK(NULL, "gpt8_fck", &gpt8_fck, CK_243X | CK_242X), | ||
135 | CLK(NULL, "gpt9_ick", &gpt9_ick, CK_243X | CK_242X), | ||
136 | CLK(NULL, "gpt9_fck", &gpt9_fck, CK_243X | CK_242X), | ||
137 | CLK(NULL, "gpt10_ick", &gpt10_ick, CK_243X | CK_242X), | ||
138 | CLK(NULL, "gpt10_fck", &gpt10_fck, CK_243X | CK_242X), | ||
139 | CLK(NULL, "gpt11_ick", &gpt11_ick, CK_243X | CK_242X), | ||
140 | CLK(NULL, "gpt11_fck", &gpt11_fck, CK_243X | CK_242X), | ||
141 | CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X | CK_242X), | ||
142 | CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X | CK_242X), | ||
143 | CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X | CK_242X), | ||
144 | CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_243X | CK_242X), | ||
145 | CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X | CK_242X), | ||
146 | CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_243X | CK_242X), | ||
147 | CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X), | ||
148 | CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_243X), | ||
149 | CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X), | ||
150 | CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_243X), | ||
151 | CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X), | ||
152 | CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_243X), | ||
153 | CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X | CK_242X), | ||
154 | CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_243X | CK_242X), | ||
155 | CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X | CK_242X), | ||
156 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_243X | CK_242X), | ||
157 | CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X), | ||
158 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_243X), | ||
159 | CLK(NULL, "uart1_ick", &uart1_ick, CK_243X | CK_242X), | ||
160 | CLK(NULL, "uart1_fck", &uart1_fck, CK_243X | CK_242X), | ||
161 | CLK(NULL, "uart2_ick", &uart2_ick, CK_243X | CK_242X), | ||
162 | CLK(NULL, "uart2_fck", &uart2_fck, CK_243X | CK_242X), | ||
163 | CLK(NULL, "uart3_ick", &uart3_ick, CK_243X | CK_242X), | ||
164 | CLK(NULL, "uart3_fck", &uart3_fck, CK_243X | CK_242X), | ||
165 | CLK(NULL, "gpios_ick", &gpios_ick, CK_243X | CK_242X), | ||
166 | CLK(NULL, "gpios_fck", &gpios_fck, CK_243X | CK_242X), | ||
167 | CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X | CK_242X), | ||
168 | CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_243X | CK_242X), | ||
169 | CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X | CK_242X), | ||
170 | CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X | CK_242X), | ||
171 | CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X | CK_242X), | ||
172 | CLK(NULL, "icr_ick", &icr_ick, CK_243X), | ||
173 | CLK("omap24xxcam", "fck", &cam_fck, CK_243X | CK_242X), | ||
174 | CLK("omap24xxcam", "ick", &cam_ick, CK_243X | CK_242X), | ||
175 | CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X | CK_242X), | ||
176 | CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X | CK_242X), | ||
177 | CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X | CK_242X), | ||
178 | CLK(NULL, "wdt3_ick", &wdt3_ick, CK_242X), | ||
179 | CLK(NULL, "wdt3_fck", &wdt3_fck, CK_242X), | ||
180 | CLK(NULL, "mspro_ick", &mspro_ick, CK_243X | CK_242X), | ||
181 | CLK(NULL, "mspro_fck", &mspro_fck, CK_243X | CK_242X), | ||
182 | CLK("mmci-omap.0", "ick", &mmc_ick, CK_242X), | ||
183 | CLK("mmci-omap.0", "fck", &mmc_fck, CK_242X), | ||
184 | CLK(NULL, "fac_ick", &fac_ick, CK_243X | CK_242X), | ||
185 | CLK(NULL, "fac_fck", &fac_fck, CK_243X | CK_242X), | ||
186 | CLK(NULL, "eac_ick", &eac_ick, CK_242X), | ||
187 | CLK(NULL, "eac_fck", &eac_fck, CK_242X), | ||
188 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X | CK_242X), | ||
189 | CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X | CK_242X), | ||
190 | CLK("i2c_omap.1", "ick", &i2c1_ick, CK_243X | CK_242X), | ||
191 | CLK("i2c_omap.1", "fck", &i2c1_fck, CK_242X), | ||
192 | CLK("i2c_omap.1", "fck", &i2chs1_fck, CK_243X), | ||
193 | CLK("i2c_omap.2", "ick", &i2c2_ick, CK_243X | CK_242X), | ||
194 | CLK("i2c_omap.2", "fck", &i2c2_fck, CK_242X), | ||
195 | CLK("i2c_omap.2", "fck", &i2chs2_fck, CK_243X), | ||
196 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X | CK_242X), | ||
197 | CLK(NULL, "sdma_fck", &sdma_fck, CK_243X | CK_242X), | ||
198 | CLK(NULL, "sdma_ick", &sdma_ick, CK_243X | CK_242X), | ||
199 | CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X), | ||
200 | CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), | ||
201 | CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X), | ||
202 | CLK(NULL, "des_ick", &des_ick, CK_243X | CK_242X), | ||
203 | CLK(NULL, "sha_ick", &sha_ick, CK_243X | CK_242X), | ||
204 | CLK("omap_rng", "ick", &rng_ick, CK_243X | CK_242X), | ||
205 | CLK(NULL, "aes_ick", &aes_ick, CK_243X | CK_242X), | ||
206 | CLK(NULL, "pka_ick", &pka_ick, CK_243X | CK_242X), | ||
207 | CLK(NULL, "usb_fck", &usb_fck, CK_243X | CK_242X), | ||
208 | CLK(NULL, "usbhs_ick", &usbhs_ick, CK_243X), | ||
209 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X), | ||
210 | CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X), | ||
211 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X), | ||
212 | CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_243X), | ||
213 | CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X), | ||
214 | CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X), | ||
215 | CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), | ||
216 | CLK("mmci-omap-hs.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X), | ||
217 | CLK("mmci-omap-hs.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X), | ||
218 | }; | ||
219 | |||
43 | /* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */ | 220 | /* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */ |
44 | #define EN_APLL_STOPPED 0 | 221 | #define EN_APLL_STOPPED 0 |
45 | #define EN_APLL_LOCKED 3 | 222 | #define EN_APLL_LOCKED 3 |
@@ -59,19 +236,32 @@ static struct clk *sclk; | |||
59 | * Omap24xx specific clock functions | 236 | * Omap24xx specific clock functions |
60 | *-------------------------------------------------------------------------*/ | 237 | *-------------------------------------------------------------------------*/ |
61 | 238 | ||
62 | /* This actually returns the rate of core_ck, not dpll_ck. */ | 239 | /** |
63 | static u32 omap2_get_dpll_rate_24xx(struct clk *tclk) | 240 | * omap2xxx_clk_get_core_rate - return the CORE_CLK rate |
241 | * @clk: pointer to the combined dpll_ck + core_ck (currently "dpll_ck") | ||
242 | * | ||
243 | * Returns the CORE_CLK rate. CORE_CLK can have one of three rate | ||
244 | * sources on OMAP2xxx: the DPLL CLKOUT rate, DPLL CLKOUTX2, or 32KHz | ||
245 | * (the latter is unusual). This currently should be called with | ||
246 | * struct clk *dpll_ck, which is a composite clock of dpll_ck and | ||
247 | * core_ck. | ||
248 | */ | ||
249 | static unsigned long omap2xxx_clk_get_core_rate(struct clk *clk) | ||
64 | { | 250 | { |
65 | long long dpll_clk; | 251 | long long core_clk; |
66 | u8 amult; | 252 | u32 v; |
253 | |||
254 | core_clk = omap2_get_dpll_rate(clk); | ||
67 | 255 | ||
68 | dpll_clk = omap2_get_dpll_rate(tclk); | 256 | v = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); |
257 | v &= OMAP24XX_CORE_CLK_SRC_MASK; | ||
69 | 258 | ||
70 | amult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); | 259 | if (v == CORE_CLK_SRC_32K) |
71 | amult &= OMAP24XX_CORE_CLK_SRC_MASK; | 260 | core_clk = 32768; |
72 | dpll_clk *= amult; | 261 | else |
262 | core_clk *= v; | ||
73 | 263 | ||
74 | return dpll_clk; | 264 | return core_clk; |
75 | } | 265 | } |
76 | 266 | ||
77 | static int omap2_enable_osc_ck(struct clk *clk) | 267 | static int omap2_enable_osc_ck(struct clk *clk) |
@@ -96,6 +286,11 @@ static void omap2_disable_osc_ck(struct clk *clk) | |||
96 | OMAP24XX_PRCM_CLKSRC_CTRL); | 286 | OMAP24XX_PRCM_CLKSRC_CTRL); |
97 | } | 287 | } |
98 | 288 | ||
289 | static const struct clkops clkops_oscck = { | ||
290 | .enable = &omap2_enable_osc_ck, | ||
291 | .disable = &omap2_disable_osc_ck, | ||
292 | }; | ||
293 | |||
99 | #ifdef OLD_CK | 294 | #ifdef OLD_CK |
100 | /* Recalculate SYST_CLK */ | 295 | /* Recalculate SYST_CLK */ |
101 | static void omap2_sys_clk_recalc(struct clk * clk) | 296 | static void omap2_sys_clk_recalc(struct clk * clk) |
@@ -149,11 +344,16 @@ static void omap2_clk_fixed_disable(struct clk *clk) | |||
149 | cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); | 344 | cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); |
150 | } | 345 | } |
151 | 346 | ||
347 | static const struct clkops clkops_fixed = { | ||
348 | .enable = &omap2_clk_fixed_enable, | ||
349 | .disable = &omap2_clk_fixed_disable, | ||
350 | }; | ||
351 | |||
152 | /* | 352 | /* |
153 | * Uses the current prcm set to tell if a rate is valid. | 353 | * Uses the current prcm set to tell if a rate is valid. |
154 | * You can go slower, but not faster within a given rate set. | 354 | * You can go slower, but not faster within a given rate set. |
155 | */ | 355 | */ |
156 | long omap2_dpllcore_round_rate(unsigned long target_rate) | 356 | static long omap2_dpllcore_round_rate(unsigned long target_rate) |
157 | { | 357 | { |
158 | u32 high, low, core_clk_src; | 358 | u32 high, low, core_clk_src; |
159 | 359 | ||
@@ -182,11 +382,9 @@ long omap2_dpllcore_round_rate(unsigned long target_rate) | |||
182 | 382 | ||
183 | } | 383 | } |
184 | 384 | ||
185 | static void omap2_dpllcore_recalc(struct clk *clk) | 385 | static unsigned long omap2_dpllcore_recalc(struct clk *clk) |
186 | { | 386 | { |
187 | clk->rate = omap2_get_dpll_rate_24xx(clk); | 387 | return omap2xxx_clk_get_core_rate(clk); |
188 | |||
189 | propagate_rate(clk); | ||
190 | } | 388 | } |
191 | 389 | ||
192 | static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) | 390 | static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) |
@@ -195,22 +393,19 @@ static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) | |||
195 | u32 bypass = 0; | 393 | u32 bypass = 0; |
196 | struct prcm_config tmpset; | 394 | struct prcm_config tmpset; |
197 | const struct dpll_data *dd; | 395 | const struct dpll_data *dd; |
198 | unsigned long flags; | ||
199 | int ret = -EINVAL; | ||
200 | 396 | ||
201 | local_irq_save(flags); | 397 | cur_rate = omap2xxx_clk_get_core_rate(&dpll_ck); |
202 | cur_rate = omap2_get_dpll_rate_24xx(&dpll_ck); | ||
203 | mult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); | 398 | mult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); |
204 | mult &= OMAP24XX_CORE_CLK_SRC_MASK; | 399 | mult &= OMAP24XX_CORE_CLK_SRC_MASK; |
205 | 400 | ||
206 | if ((rate == (cur_rate / 2)) && (mult == 2)) { | 401 | if ((rate == (cur_rate / 2)) && (mult == 2)) { |
207 | omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL, 1); | 402 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1); |
208 | } else if ((rate == (cur_rate * 2)) && (mult == 1)) { | 403 | } else if ((rate == (cur_rate * 2)) && (mult == 1)) { |
209 | omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1); | 404 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); |
210 | } else if (rate != cur_rate) { | 405 | } else if (rate != cur_rate) { |
211 | valid_rate = omap2_dpllcore_round_rate(rate); | 406 | valid_rate = omap2_dpllcore_round_rate(rate); |
212 | if (valid_rate != rate) | 407 | if (valid_rate != rate) |
213 | goto dpll_exit; | 408 | return -EINVAL; |
214 | 409 | ||
215 | if (mult == 1) | 410 | if (mult == 1) |
216 | low = curr_prcm_set->dpll_speed; | 411 | low = curr_prcm_set->dpll_speed; |
@@ -219,7 +414,7 @@ static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) | |||
219 | 414 | ||
220 | dd = clk->dpll_data; | 415 | dd = clk->dpll_data; |
221 | if (!dd) | 416 | if (!dd) |
222 | goto dpll_exit; | 417 | return -EINVAL; |
223 | 418 | ||
224 | tmpset.cm_clksel1_pll = __raw_readl(dd->mult_div1_reg); | 419 | tmpset.cm_clksel1_pll = __raw_readl(dd->mult_div1_reg); |
225 | tmpset.cm_clksel1_pll &= ~(dd->mult_mask | | 420 | tmpset.cm_clksel1_pll &= ~(dd->mult_mask | |
@@ -245,22 +440,19 @@ static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) | |||
245 | if (rate == curr_prcm_set->xtal_speed) /* If asking for 1-1 */ | 440 | if (rate == curr_prcm_set->xtal_speed) /* If asking for 1-1 */ |
246 | bypass = 1; | 441 | bypass = 1; |
247 | 442 | ||
248 | omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1); /* For init_mem */ | 443 | /* For omap2xxx_sdrc_init_params() */ |
444 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); | ||
249 | 445 | ||
250 | /* Force dll lock mode */ | 446 | /* Force dll lock mode */ |
251 | omap2_set_prcm(tmpset.cm_clksel1_pll, tmpset.base_sdrc_rfr, | 447 | omap2_set_prcm(tmpset.cm_clksel1_pll, tmpset.base_sdrc_rfr, |
252 | bypass); | 448 | bypass); |
253 | 449 | ||
254 | /* Errata: ret dll entry state */ | 450 | /* Errata: ret dll entry state */ |
255 | omap2_init_memory_params(omap2_dll_force_needed()); | 451 | omap2xxx_sdrc_init_params(omap2xxx_sdrc_dll_is_unlocked()); |
256 | omap2_reprogram_sdrc(done_rate, 0); | 452 | omap2xxx_sdrc_reprogram(done_rate, 0); |
257 | } | 453 | } |
258 | omap2_dpllcore_recalc(&dpll_ck); | ||
259 | ret = 0; | ||
260 | 454 | ||
261 | dpll_exit: | 455 | return 0; |
262 | local_irq_restore(flags); | ||
263 | return(ret); | ||
264 | } | 456 | } |
265 | 457 | ||
266 | /** | 458 | /** |
@@ -269,9 +461,9 @@ dpll_exit: | |||
269 | * | 461 | * |
270 | * Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set. | 462 | * Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set. |
271 | */ | 463 | */ |
272 | static void omap2_table_mpu_recalc(struct clk *clk) | 464 | static unsigned long omap2_table_mpu_recalc(struct clk *clk) |
273 | { | 465 | { |
274 | clk->rate = curr_prcm_set->mpu_speed; | 466 | return curr_prcm_set->mpu_speed; |
275 | } | 467 | } |
276 | 468 | ||
277 | /* | 469 | /* |
@@ -337,12 +529,12 @@ static int omap2_select_table_rate(struct clk *clk, unsigned long rate) | |||
337 | } | 529 | } |
338 | 530 | ||
339 | curr_prcm_set = prcm; | 531 | curr_prcm_set = prcm; |
340 | cur_rate = omap2_get_dpll_rate_24xx(&dpll_ck); | 532 | cur_rate = omap2xxx_clk_get_core_rate(&dpll_ck); |
341 | 533 | ||
342 | if (prcm->dpll_speed == cur_rate / 2) { | 534 | if (prcm->dpll_speed == cur_rate / 2) { |
343 | omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL, 1); | 535 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1); |
344 | } else if (prcm->dpll_speed == cur_rate * 2) { | 536 | } else if (prcm->dpll_speed == cur_rate * 2) { |
345 | omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1); | 537 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); |
346 | } else if (prcm->dpll_speed != cur_rate) { | 538 | } else if (prcm->dpll_speed != cur_rate) { |
347 | local_irq_save(flags); | 539 | local_irq_save(flags); |
348 | 540 | ||
@@ -366,27 +558,67 @@ static int omap2_select_table_rate(struct clk *clk, unsigned long rate) | |||
366 | 558 | ||
367 | /* Major subsystem dividers */ | 559 | /* Major subsystem dividers */ |
368 | tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK; | 560 | tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK; |
369 | cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD, CM_CLKSEL1); | 561 | cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD, |
562 | CM_CLKSEL1); | ||
563 | |||
370 | if (cpu_is_omap2430()) | 564 | if (cpu_is_omap2430()) |
371 | cm_write_mod_reg(prcm->cm_clksel_mdm, | 565 | cm_write_mod_reg(prcm->cm_clksel_mdm, |
372 | OMAP2430_MDM_MOD, CM_CLKSEL); | 566 | OMAP2430_MDM_MOD, CM_CLKSEL); |
373 | 567 | ||
374 | /* x2 to enter init_mem */ | 568 | /* x2 to enter omap2xxx_sdrc_init_params() */ |
375 | omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1); | 569 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); |
376 | 570 | ||
377 | omap2_set_prcm(prcm->cm_clksel1_pll, prcm->base_sdrc_rfr, | 571 | omap2_set_prcm(prcm->cm_clksel1_pll, prcm->base_sdrc_rfr, |
378 | bypass); | 572 | bypass); |
379 | 573 | ||
380 | omap2_init_memory_params(omap2_dll_force_needed()); | 574 | omap2xxx_sdrc_init_params(omap2xxx_sdrc_dll_is_unlocked()); |
381 | omap2_reprogram_sdrc(done_rate, 0); | 575 | omap2xxx_sdrc_reprogram(done_rate, 0); |
382 | 576 | ||
383 | local_irq_restore(flags); | 577 | local_irq_restore(flags); |
384 | } | 578 | } |
385 | omap2_dpllcore_recalc(&dpll_ck); | ||
386 | 579 | ||
387 | return 0; | 580 | return 0; |
388 | } | 581 | } |
389 | 582 | ||
583 | #ifdef CONFIG_CPU_FREQ | ||
584 | /* | ||
585 | * Walk PRCM rate table and fillout cpufreq freq_table | ||
586 | */ | ||
587 | static struct cpufreq_frequency_table freq_table[ARRAY_SIZE(rate_table)]; | ||
588 | |||
589 | void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table) | ||
590 | { | ||
591 | struct prcm_config *prcm; | ||
592 | int i = 0; | ||
593 | |||
594 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | ||
595 | if (!(prcm->flags & cpu_mask)) | ||
596 | continue; | ||
597 | if (prcm->xtal_speed != sys_ck.rate) | ||
598 | continue; | ||
599 | |||
600 | /* don't put bypass rates in table */ | ||
601 | if (prcm->dpll_speed == prcm->xtal_speed) | ||
602 | continue; | ||
603 | |||
604 | freq_table[i].index = i; | ||
605 | freq_table[i].frequency = prcm->mpu_speed / 1000; | ||
606 | i++; | ||
607 | } | ||
608 | |||
609 | if (i == 0) { | ||
610 | printk(KERN_WARNING "%s: failed to initialize frequency " | ||
611 | "table\n", __func__); | ||
612 | return; | ||
613 | } | ||
614 | |||
615 | freq_table[i].index = i; | ||
616 | freq_table[i].frequency = CPUFREQ_TABLE_END; | ||
617 | |||
618 | *table = &freq_table[0]; | ||
619 | } | ||
620 | #endif | ||
621 | |||
390 | static struct clk_functions omap2_clk_functions = { | 622 | static struct clk_functions omap2_clk_functions = { |
391 | .clk_enable = omap2_clk_enable, | 623 | .clk_enable = omap2_clk_enable, |
392 | .clk_disable = omap2_clk_disable, | 624 | .clk_disable = omap2_clk_disable, |
@@ -394,24 +626,27 @@ static struct clk_functions omap2_clk_functions = { | |||
394 | .clk_set_rate = omap2_clk_set_rate, | 626 | .clk_set_rate = omap2_clk_set_rate, |
395 | .clk_set_parent = omap2_clk_set_parent, | 627 | .clk_set_parent = omap2_clk_set_parent, |
396 | .clk_disable_unused = omap2_clk_disable_unused, | 628 | .clk_disable_unused = omap2_clk_disable_unused, |
629 | #ifdef CONFIG_CPU_FREQ | ||
630 | .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table, | ||
631 | #endif | ||
397 | }; | 632 | }; |
398 | 633 | ||
399 | static u32 omap2_get_apll_clkin(void) | 634 | static u32 omap2_get_apll_clkin(void) |
400 | { | 635 | { |
401 | u32 aplls, sclk = 0; | 636 | u32 aplls, srate = 0; |
402 | 637 | ||
403 | aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1); | 638 | aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1); |
404 | aplls &= OMAP24XX_APLLS_CLKIN_MASK; | 639 | aplls &= OMAP24XX_APLLS_CLKIN_MASK; |
405 | aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT; | 640 | aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT; |
406 | 641 | ||
407 | if (aplls == APLLS_CLKIN_19_2MHZ) | 642 | if (aplls == APLLS_CLKIN_19_2MHZ) |
408 | sclk = 19200000; | 643 | srate = 19200000; |
409 | else if (aplls == APLLS_CLKIN_13MHZ) | 644 | else if (aplls == APLLS_CLKIN_13MHZ) |
410 | sclk = 13000000; | 645 | srate = 13000000; |
411 | else if (aplls == APLLS_CLKIN_12MHZ) | 646 | else if (aplls == APLLS_CLKIN_12MHZ) |
412 | sclk = 12000000; | 647 | srate = 12000000; |
413 | 648 | ||
414 | return sclk; | 649 | return srate; |
415 | } | 650 | } |
416 | 651 | ||
417 | static u32 omap2_get_sysclkdiv(void) | 652 | static u32 omap2_get_sysclkdiv(void) |
@@ -425,16 +660,14 @@ static u32 omap2_get_sysclkdiv(void) | |||
425 | return div; | 660 | return div; |
426 | } | 661 | } |
427 | 662 | ||
428 | static void omap2_osc_clk_recalc(struct clk *clk) | 663 | static unsigned long omap2_osc_clk_recalc(struct clk *clk) |
429 | { | 664 | { |
430 | clk->rate = omap2_get_apll_clkin() * omap2_get_sysclkdiv(); | 665 | return omap2_get_apll_clkin() * omap2_get_sysclkdiv(); |
431 | propagate_rate(clk); | ||
432 | } | 666 | } |
433 | 667 | ||
434 | static void omap2_sys_clk_recalc(struct clk *clk) | 668 | static unsigned long omap2_sys_clk_recalc(struct clk *clk) |
435 | { | 669 | { |
436 | clk->rate = clk->parent->rate / omap2_get_sysclkdiv(); | 670 | return clk->parent->rate / omap2_get_sysclkdiv(); |
437 | propagate_rate(clk); | ||
438 | } | 671 | } |
439 | 672 | ||
440 | /* | 673 | /* |
@@ -460,7 +693,7 @@ static int __init omap2_clk_arch_init(void) | |||
460 | if (!mpurate) | 693 | if (!mpurate) |
461 | return -EINVAL; | 694 | return -EINVAL; |
462 | 695 | ||
463 | if (omap2_select_table_rate(&virt_prcm_set, mpurate)) | 696 | if (clk_set_rate(&virt_prcm_set, mpurate)) |
464 | printk(KERN_ERR "Could not find matching MPU rate\n"); | 697 | printk(KERN_ERR "Could not find matching MPU rate\n"); |
465 | 698 | ||
466 | recalculate_root_clocks(); | 699 | recalculate_root_clocks(); |
@@ -477,8 +710,8 @@ arch_initcall(omap2_clk_arch_init); | |||
477 | int __init omap2_clk_init(void) | 710 | int __init omap2_clk_init(void) |
478 | { | 711 | { |
479 | struct prcm_config *prcm; | 712 | struct prcm_config *prcm; |
480 | struct clk **clkp; | 713 | struct omap_clk *c; |
481 | u32 clkrate; | 714 | u32 clkrate, cpu_mask; |
482 | 715 | ||
483 | if (cpu_is_omap242x()) | 716 | if (cpu_is_omap242x()) |
484 | cpu_mask = RATE_IN_242X; | 717 | cpu_mask = RATE_IN_242X; |
@@ -487,26 +720,28 @@ int __init omap2_clk_init(void) | |||
487 | 720 | ||
488 | clk_init(&omap2_clk_functions); | 721 | clk_init(&omap2_clk_functions); |
489 | 722 | ||
490 | omap2_osc_clk_recalc(&osc_ck); | 723 | osc_ck.rate = omap2_osc_clk_recalc(&osc_ck); |
491 | omap2_sys_clk_recalc(&sys_ck); | 724 | propagate_rate(&osc_ck); |
725 | sys_ck.rate = omap2_sys_clk_recalc(&sys_ck); | ||
726 | propagate_rate(&sys_ck); | ||
492 | 727 | ||
493 | for (clkp = onchip_24xx_clks; | 728 | for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) |
494 | clkp < onchip_24xx_clks + ARRAY_SIZE(onchip_24xx_clks); | 729 | clk_init_one(c->lk.clk); |
495 | clkp++) { | ||
496 | 730 | ||
497 | if ((*clkp)->flags & CLOCK_IN_OMAP242X && cpu_is_omap2420()) { | 731 | cpu_mask = 0; |
498 | clk_register(*clkp); | 732 | if (cpu_is_omap2420()) |
499 | continue; | 733 | cpu_mask |= CK_242X; |
500 | } | 734 | if (cpu_is_omap2430()) |
735 | cpu_mask |= CK_243X; | ||
501 | 736 | ||
502 | if ((*clkp)->flags & CLOCK_IN_OMAP243X && cpu_is_omap2430()) { | 737 | for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) |
503 | clk_register(*clkp); | 738 | if (c->cpu & cpu_mask) { |
504 | continue; | 739 | clkdev_add(&c->lk); |
740 | clk_register(c->lk.clk); | ||
505 | } | 741 | } |
506 | } | ||
507 | 742 | ||
508 | /* Check the MPU rate set by bootloader */ | 743 | /* Check the MPU rate set by bootloader */ |
509 | clkrate = omap2_get_dpll_rate_24xx(&dpll_ck); | 744 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); |
510 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | 745 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { |
511 | if (!(prcm->flags & cpu_mask)) | 746 | if (!(prcm->flags & cpu_mask)) |
512 | continue; | 747 | continue; |
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h index ad6d98d177c5..33c3e5b14323 100644 --- a/arch/arm/mach-omap2/clock24xx.h +++ b/arch/arm/mach-omap2/clock24xx.h | |||
@@ -24,17 +24,13 @@ | |||
24 | #include "cm-regbits-24xx.h" | 24 | #include "cm-regbits-24xx.h" |
25 | #include "sdrc.h" | 25 | #include "sdrc.h" |
26 | 26 | ||
27 | static void omap2_table_mpu_recalc(struct clk *clk); | 27 | static unsigned long omap2_table_mpu_recalc(struct clk *clk); |
28 | static int omap2_select_table_rate(struct clk *clk, unsigned long rate); | 28 | static int omap2_select_table_rate(struct clk *clk, unsigned long rate); |
29 | static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate); | 29 | static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate); |
30 | static void omap2_sys_clk_recalc(struct clk *clk); | 30 | static unsigned long omap2_sys_clk_recalc(struct clk *clk); |
31 | static void omap2_osc_clk_recalc(struct clk *clk); | 31 | static unsigned long omap2_osc_clk_recalc(struct clk *clk); |
32 | static void omap2_sys_clk_recalc(struct clk *clk); | 32 | static unsigned long omap2_sys_clk_recalc(struct clk *clk); |
33 | static void omap2_dpllcore_recalc(struct clk *clk); | 33 | static unsigned long omap2_dpllcore_recalc(struct clk *clk); |
34 | static int omap2_clk_fixed_enable(struct clk *clk); | ||
35 | static void omap2_clk_fixed_disable(struct clk *clk); | ||
36 | static int omap2_enable_osc_ck(struct clk *clk); | ||
37 | static void omap2_disable_osc_ck(struct clk *clk); | ||
38 | static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate); | 34 | static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate); |
39 | 35 | ||
40 | /* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. | 36 | /* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. |
@@ -623,41 +619,35 @@ static struct prcm_config rate_table[] = { | |||
623 | /* Base external input clocks */ | 619 | /* Base external input clocks */ |
624 | static struct clk func_32k_ck = { | 620 | static struct clk func_32k_ck = { |
625 | .name = "func_32k_ck", | 621 | .name = "func_32k_ck", |
622 | .ops = &clkops_null, | ||
626 | .rate = 32000, | 623 | .rate = 32000, |
627 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 624 | .flags = RATE_FIXED, |
628 | RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES, | ||
629 | .clkdm_name = "wkup_clkdm", | 625 | .clkdm_name = "wkup_clkdm", |
630 | .recalc = &propagate_rate, | ||
631 | }; | 626 | }; |
632 | 627 | ||
633 | /* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */ | 628 | /* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */ |
634 | static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */ | 629 | static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */ |
635 | .name = "osc_ck", | 630 | .name = "osc_ck", |
636 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 631 | .ops = &clkops_oscck, |
637 | RATE_PROPAGATES, | ||
638 | .clkdm_name = "wkup_clkdm", | 632 | .clkdm_name = "wkup_clkdm", |
639 | .enable = &omap2_enable_osc_ck, | ||
640 | .disable = &omap2_disable_osc_ck, | ||
641 | .recalc = &omap2_osc_clk_recalc, | 633 | .recalc = &omap2_osc_clk_recalc, |
642 | }; | 634 | }; |
643 | 635 | ||
644 | /* Without modem likely 12MHz, with modem likely 13MHz */ | 636 | /* Without modem likely 12MHz, with modem likely 13MHz */ |
645 | static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */ | 637 | static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */ |
646 | .name = "sys_ck", /* ~ ref_clk also */ | 638 | .name = "sys_ck", /* ~ ref_clk also */ |
639 | .ops = &clkops_null, | ||
647 | .parent = &osc_ck, | 640 | .parent = &osc_ck, |
648 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | ||
649 | ALWAYS_ENABLED | RATE_PROPAGATES, | ||
650 | .clkdm_name = "wkup_clkdm", | 641 | .clkdm_name = "wkup_clkdm", |
651 | .recalc = &omap2_sys_clk_recalc, | 642 | .recalc = &omap2_sys_clk_recalc, |
652 | }; | 643 | }; |
653 | 644 | ||
654 | static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ | 645 | static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ |
655 | .name = "alt_ck", | 646 | .name = "alt_ck", |
647 | .ops = &clkops_null, | ||
656 | .rate = 54000000, | 648 | .rate = 54000000, |
657 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 649 | .flags = RATE_FIXED, |
658 | RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES, | ||
659 | .clkdm_name = "wkup_clkdm", | 650 | .clkdm_name = "wkup_clkdm", |
660 | .recalc = &propagate_rate, | ||
661 | }; | 651 | }; |
662 | 652 | ||
663 | /* | 653 | /* |
@@ -673,7 +663,12 @@ static struct dpll_data dpll_dd = { | |||
673 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | 663 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
674 | .mult_mask = OMAP24XX_DPLL_MULT_MASK, | 664 | .mult_mask = OMAP24XX_DPLL_MULT_MASK, |
675 | .div1_mask = OMAP24XX_DPLL_DIV_MASK, | 665 | .div1_mask = OMAP24XX_DPLL_DIV_MASK, |
666 | .clk_bypass = &sys_ck, | ||
667 | .clk_ref = &sys_ck, | ||
668 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | ||
669 | .enable_mask = OMAP24XX_EN_DPLL_MASK, | ||
676 | .max_multiplier = 1024, | 670 | .max_multiplier = 1024, |
671 | .min_divider = 1, | ||
677 | .max_divider = 16, | 672 | .max_divider = 16, |
678 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | 673 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE |
679 | }; | 674 | }; |
@@ -684,10 +679,9 @@ static struct dpll_data dpll_dd = { | |||
684 | */ | 679 | */ |
685 | static struct clk dpll_ck = { | 680 | static struct clk dpll_ck = { |
686 | .name = "dpll_ck", | 681 | .name = "dpll_ck", |
682 | .ops = &clkops_null, | ||
687 | .parent = &sys_ck, /* Can be func_32k also */ | 683 | .parent = &sys_ck, /* Can be func_32k also */ |
688 | .dpll_data = &dpll_dd, | 684 | .dpll_data = &dpll_dd, |
689 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | ||
690 | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
691 | .clkdm_name = "wkup_clkdm", | 685 | .clkdm_name = "wkup_clkdm", |
692 | .recalc = &omap2_dpllcore_recalc, | 686 | .recalc = &omap2_dpllcore_recalc, |
693 | .set_rate = &omap2_reprogram_dpllcore, | 687 | .set_rate = &omap2_reprogram_dpllcore, |
@@ -695,30 +689,24 @@ static struct clk dpll_ck = { | |||
695 | 689 | ||
696 | static struct clk apll96_ck = { | 690 | static struct clk apll96_ck = { |
697 | .name = "apll96_ck", | 691 | .name = "apll96_ck", |
692 | .ops = &clkops_fixed, | ||
698 | .parent = &sys_ck, | 693 | .parent = &sys_ck, |
699 | .rate = 96000000, | 694 | .rate = 96000000, |
700 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 695 | .flags = RATE_FIXED | ENABLE_ON_INIT, |
701 | RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT, | ||
702 | .clkdm_name = "wkup_clkdm", | 696 | .clkdm_name = "wkup_clkdm", |
703 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 697 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
704 | .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT, | 698 | .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT, |
705 | .enable = &omap2_clk_fixed_enable, | ||
706 | .disable = &omap2_clk_fixed_disable, | ||
707 | .recalc = &propagate_rate, | ||
708 | }; | 699 | }; |
709 | 700 | ||
710 | static struct clk apll54_ck = { | 701 | static struct clk apll54_ck = { |
711 | .name = "apll54_ck", | 702 | .name = "apll54_ck", |
703 | .ops = &clkops_fixed, | ||
712 | .parent = &sys_ck, | 704 | .parent = &sys_ck, |
713 | .rate = 54000000, | 705 | .rate = 54000000, |
714 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 706 | .flags = RATE_FIXED | ENABLE_ON_INIT, |
715 | RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT, | ||
716 | .clkdm_name = "wkup_clkdm", | 707 | .clkdm_name = "wkup_clkdm", |
717 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 708 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
718 | .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT, | 709 | .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT, |
719 | .enable = &omap2_clk_fixed_enable, | ||
720 | .disable = &omap2_clk_fixed_disable, | ||
721 | .recalc = &propagate_rate, | ||
722 | }; | 710 | }; |
723 | 711 | ||
724 | /* | 712 | /* |
@@ -745,9 +733,8 @@ static const struct clksel func_54m_clksel[] = { | |||
745 | 733 | ||
746 | static struct clk func_54m_ck = { | 734 | static struct clk func_54m_ck = { |
747 | .name = "func_54m_ck", | 735 | .name = "func_54m_ck", |
736 | .ops = &clkops_null, | ||
748 | .parent = &apll54_ck, /* can also be alt_clk */ | 737 | .parent = &apll54_ck, /* can also be alt_clk */ |
749 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | ||
750 | RATE_PROPAGATES | PARENT_CONTROLS_CLOCK, | ||
751 | .clkdm_name = "wkup_clkdm", | 738 | .clkdm_name = "wkup_clkdm", |
752 | .init = &omap2_init_clksel_parent, | 739 | .init = &omap2_init_clksel_parent, |
753 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | 740 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
@@ -758,9 +745,8 @@ static struct clk func_54m_ck = { | |||
758 | 745 | ||
759 | static struct clk core_ck = { | 746 | static struct clk core_ck = { |
760 | .name = "core_ck", | 747 | .name = "core_ck", |
748 | .ops = &clkops_null, | ||
761 | .parent = &dpll_ck, /* can also be 32k */ | 749 | .parent = &dpll_ck, /* can also be 32k */ |
762 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | ||
763 | ALWAYS_ENABLED | RATE_PROPAGATES, | ||
764 | .clkdm_name = "wkup_clkdm", | 750 | .clkdm_name = "wkup_clkdm", |
765 | .recalc = &followparent_recalc, | 751 | .recalc = &followparent_recalc, |
766 | }; | 752 | }; |
@@ -785,9 +771,8 @@ static const struct clksel func_96m_clksel[] = { | |||
785 | /* The parent of this clock is not selectable on 2420. */ | 771 | /* The parent of this clock is not selectable on 2420. */ |
786 | static struct clk func_96m_ck = { | 772 | static struct clk func_96m_ck = { |
787 | .name = "func_96m_ck", | 773 | .name = "func_96m_ck", |
774 | .ops = &clkops_null, | ||
788 | .parent = &apll96_ck, | 775 | .parent = &apll96_ck, |
789 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | ||
790 | RATE_PROPAGATES | PARENT_CONTROLS_CLOCK, | ||
791 | .clkdm_name = "wkup_clkdm", | 776 | .clkdm_name = "wkup_clkdm", |
792 | .init = &omap2_init_clksel_parent, | 777 | .init = &omap2_init_clksel_parent, |
793 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | 778 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
@@ -818,9 +803,8 @@ static const struct clksel func_48m_clksel[] = { | |||
818 | 803 | ||
819 | static struct clk func_48m_ck = { | 804 | static struct clk func_48m_ck = { |
820 | .name = "func_48m_ck", | 805 | .name = "func_48m_ck", |
806 | .ops = &clkops_null, | ||
821 | .parent = &apll96_ck, /* 96M or Alt */ | 807 | .parent = &apll96_ck, /* 96M or Alt */ |
822 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | ||
823 | RATE_PROPAGATES | PARENT_CONTROLS_CLOCK, | ||
824 | .clkdm_name = "wkup_clkdm", | 808 | .clkdm_name = "wkup_clkdm", |
825 | .init = &omap2_init_clksel_parent, | 809 | .init = &omap2_init_clksel_parent, |
826 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | 810 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
@@ -833,10 +817,9 @@ static struct clk func_48m_ck = { | |||
833 | 817 | ||
834 | static struct clk func_12m_ck = { | 818 | static struct clk func_12m_ck = { |
835 | .name = "func_12m_ck", | 819 | .name = "func_12m_ck", |
820 | .ops = &clkops_null, | ||
836 | .parent = &func_48m_ck, | 821 | .parent = &func_48m_ck, |
837 | .fixed_div = 4, | 822 | .fixed_div = 4, |
838 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | ||
839 | RATE_PROPAGATES | PARENT_CONTROLS_CLOCK, | ||
840 | .clkdm_name = "wkup_clkdm", | 823 | .clkdm_name = "wkup_clkdm", |
841 | .recalc = &omap2_fixed_divisor_recalc, | 824 | .recalc = &omap2_fixed_divisor_recalc, |
842 | }; | 825 | }; |
@@ -844,8 +827,8 @@ static struct clk func_12m_ck = { | |||
844 | /* Secure timer, only available in secure mode */ | 827 | /* Secure timer, only available in secure mode */ |
845 | static struct clk wdt1_osc_ck = { | 828 | static struct clk wdt1_osc_ck = { |
846 | .name = "ck_wdt1_osc", | 829 | .name = "ck_wdt1_osc", |
830 | .ops = &clkops_null, /* RMK: missing? */ | ||
847 | .parent = &osc_ck, | 831 | .parent = &osc_ck, |
848 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
849 | .recalc = &followparent_recalc, | 832 | .recalc = &followparent_recalc, |
850 | }; | 833 | }; |
851 | 834 | ||
@@ -887,9 +870,8 @@ static const struct clksel common_clkout_src_clksel[] = { | |||
887 | 870 | ||
888 | static struct clk sys_clkout_src = { | 871 | static struct clk sys_clkout_src = { |
889 | .name = "sys_clkout_src", | 872 | .name = "sys_clkout_src", |
873 | .ops = &clkops_omap2_dflt, | ||
890 | .parent = &func_54m_ck, | 874 | .parent = &func_54m_ck, |
891 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | ||
892 | RATE_PROPAGATES, | ||
893 | .clkdm_name = "wkup_clkdm", | 875 | .clkdm_name = "wkup_clkdm", |
894 | .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL, | 876 | .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL, |
895 | .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT, | 877 | .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT, |
@@ -918,9 +900,8 @@ static const struct clksel sys_clkout_clksel[] = { | |||
918 | 900 | ||
919 | static struct clk sys_clkout = { | 901 | static struct clk sys_clkout = { |
920 | .name = "sys_clkout", | 902 | .name = "sys_clkout", |
903 | .ops = &clkops_null, | ||
921 | .parent = &sys_clkout_src, | 904 | .parent = &sys_clkout_src, |
922 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | ||
923 | PARENT_CONTROLS_CLOCK, | ||
924 | .clkdm_name = "wkup_clkdm", | 905 | .clkdm_name = "wkup_clkdm", |
925 | .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL, | 906 | .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL, |
926 | .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK, | 907 | .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK, |
@@ -933,8 +914,8 @@ static struct clk sys_clkout = { | |||
933 | /* In 2430, new in 2420 ES2 */ | 914 | /* In 2430, new in 2420 ES2 */ |
934 | static struct clk sys_clkout2_src = { | 915 | static struct clk sys_clkout2_src = { |
935 | .name = "sys_clkout2_src", | 916 | .name = "sys_clkout2_src", |
917 | .ops = &clkops_omap2_dflt, | ||
936 | .parent = &func_54m_ck, | 918 | .parent = &func_54m_ck, |
937 | .flags = CLOCK_IN_OMAP242X | RATE_PROPAGATES, | ||
938 | .clkdm_name = "wkup_clkdm", | 919 | .clkdm_name = "wkup_clkdm", |
939 | .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL, | 920 | .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL, |
940 | .enable_bit = OMAP2420_CLKOUT2_EN_SHIFT, | 921 | .enable_bit = OMAP2420_CLKOUT2_EN_SHIFT, |
@@ -955,8 +936,8 @@ static const struct clksel sys_clkout2_clksel[] = { | |||
955 | /* In 2430, new in 2420 ES2 */ | 936 | /* In 2430, new in 2420 ES2 */ |
956 | static struct clk sys_clkout2 = { | 937 | static struct clk sys_clkout2 = { |
957 | .name = "sys_clkout2", | 938 | .name = "sys_clkout2", |
939 | .ops = &clkops_null, | ||
958 | .parent = &sys_clkout2_src, | 940 | .parent = &sys_clkout2_src, |
959 | .flags = CLOCK_IN_OMAP242X | PARENT_CONTROLS_CLOCK, | ||
960 | .clkdm_name = "wkup_clkdm", | 941 | .clkdm_name = "wkup_clkdm", |
961 | .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL, | 942 | .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL, |
962 | .clksel_mask = OMAP2420_CLKOUT2_DIV_MASK, | 943 | .clksel_mask = OMAP2420_CLKOUT2_DIV_MASK, |
@@ -968,8 +949,8 @@ static struct clk sys_clkout2 = { | |||
968 | 949 | ||
969 | static struct clk emul_ck = { | 950 | static struct clk emul_ck = { |
970 | .name = "emul_ck", | 951 | .name = "emul_ck", |
952 | .ops = &clkops_omap2_dflt, | ||
971 | .parent = &func_54m_ck, | 953 | .parent = &func_54m_ck, |
972 | .flags = CLOCK_IN_OMAP242X, | ||
973 | .clkdm_name = "wkup_clkdm", | 954 | .clkdm_name = "wkup_clkdm", |
974 | .enable_reg = OMAP24XX_PRCM_CLKEMUL_CTRL, | 955 | .enable_reg = OMAP24XX_PRCM_CLKEMUL_CTRL, |
975 | .enable_bit = OMAP24XX_EMULATION_EN_SHIFT, | 956 | .enable_bit = OMAP24XX_EMULATION_EN_SHIFT, |
@@ -1003,10 +984,9 @@ static const struct clksel mpu_clksel[] = { | |||
1003 | 984 | ||
1004 | static struct clk mpu_ck = { /* Control cpu */ | 985 | static struct clk mpu_ck = { /* Control cpu */ |
1005 | .name = "mpu_ck", | 986 | .name = "mpu_ck", |
987 | .ops = &clkops_null, | ||
1006 | .parent = &core_ck, | 988 | .parent = &core_ck, |
1007 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 989 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, |
1008 | ALWAYS_ENABLED | DELAYED_APP | | ||
1009 | CONFIG_PARTICIPANT | RATE_PROPAGATES, | ||
1010 | .clkdm_name = "mpu_clkdm", | 990 | .clkdm_name = "mpu_clkdm", |
1011 | .init = &omap2_init_clksel_parent, | 991 | .init = &omap2_init_clksel_parent, |
1012 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL), | 992 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL), |
@@ -1046,9 +1026,9 @@ static const struct clksel dsp_fck_clksel[] = { | |||
1046 | 1026 | ||
1047 | static struct clk dsp_fck = { | 1027 | static struct clk dsp_fck = { |
1048 | .name = "dsp_fck", | 1028 | .name = "dsp_fck", |
1029 | .ops = &clkops_omap2_dflt_wait, | ||
1049 | .parent = &core_ck, | 1030 | .parent = &core_ck, |
1050 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | DELAYED_APP | | 1031 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, |
1051 | CONFIG_PARTICIPANT | RATE_PROPAGATES, | ||
1052 | .clkdm_name = "dsp_clkdm", | 1032 | .clkdm_name = "dsp_clkdm", |
1053 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | 1033 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), |
1054 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, | 1034 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, |
@@ -1076,9 +1056,9 @@ static const struct clksel dsp_irate_ick_clksel[] = { | |||
1076 | /* This clock does not exist as such in the TRM. */ | 1056 | /* This clock does not exist as such in the TRM. */ |
1077 | static struct clk dsp_irate_ick = { | 1057 | static struct clk dsp_irate_ick = { |
1078 | .name = "dsp_irate_ick", | 1058 | .name = "dsp_irate_ick", |
1059 | .ops = &clkops_null, | ||
1079 | .parent = &dsp_fck, | 1060 | .parent = &dsp_fck, |
1080 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | DELAYED_APP | | 1061 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, |
1081 | CONFIG_PARTICIPANT | PARENT_CONTROLS_CLOCK, | ||
1082 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | 1062 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), |
1083 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, | 1063 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, |
1084 | .clksel = dsp_irate_ick_clksel, | 1064 | .clksel = dsp_irate_ick_clksel, |
@@ -1090,8 +1070,9 @@ static struct clk dsp_irate_ick = { | |||
1090 | /* 2420 only */ | 1070 | /* 2420 only */ |
1091 | static struct clk dsp_ick = { | 1071 | static struct clk dsp_ick = { |
1092 | .name = "dsp_ick", /* apparently ipi and isp */ | 1072 | .name = "dsp_ick", /* apparently ipi and isp */ |
1073 | .ops = &clkops_omap2_dflt_wait, | ||
1093 | .parent = &dsp_irate_ick, | 1074 | .parent = &dsp_irate_ick, |
1094 | .flags = CLOCK_IN_OMAP242X | DELAYED_APP | CONFIG_PARTICIPANT, | 1075 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, |
1095 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN), | 1076 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN), |
1096 | .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */ | 1077 | .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */ |
1097 | }; | 1078 | }; |
@@ -1099,8 +1080,9 @@ static struct clk dsp_ick = { | |||
1099 | /* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ | 1080 | /* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ |
1100 | static struct clk iva2_1_ick = { | 1081 | static struct clk iva2_1_ick = { |
1101 | .name = "iva2_1_ick", | 1082 | .name = "iva2_1_ick", |
1083 | .ops = &clkops_omap2_dflt_wait, | ||
1102 | .parent = &dsp_irate_ick, | 1084 | .parent = &dsp_irate_ick, |
1103 | .flags = CLOCK_IN_OMAP243X | DELAYED_APP | CONFIG_PARTICIPANT, | 1085 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, |
1104 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | 1086 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), |
1105 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, | 1087 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, |
1106 | }; | 1088 | }; |
@@ -1112,9 +1094,9 @@ static struct clk iva2_1_ick = { | |||
1112 | */ | 1094 | */ |
1113 | static struct clk iva1_ifck = { | 1095 | static struct clk iva1_ifck = { |
1114 | .name = "iva1_ifck", | 1096 | .name = "iva1_ifck", |
1097 | .ops = &clkops_omap2_dflt_wait, | ||
1115 | .parent = &core_ck, | 1098 | .parent = &core_ck, |
1116 | .flags = CLOCK_IN_OMAP242X | CONFIG_PARTICIPANT | | 1099 | .flags = CONFIG_PARTICIPANT | DELAYED_APP, |
1117 | RATE_PROPAGATES | DELAYED_APP, | ||
1118 | .clkdm_name = "iva1_clkdm", | 1100 | .clkdm_name = "iva1_clkdm", |
1119 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | 1101 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), |
1120 | .enable_bit = OMAP2420_EN_IVA_COP_SHIFT, | 1102 | .enable_bit = OMAP2420_EN_IVA_COP_SHIFT, |
@@ -1129,8 +1111,8 @@ static struct clk iva1_ifck = { | |||
1129 | /* IVA1 mpu/int/i/f clocks are /2 of parent */ | 1111 | /* IVA1 mpu/int/i/f clocks are /2 of parent */ |
1130 | static struct clk iva1_mpu_int_ifck = { | 1112 | static struct clk iva1_mpu_int_ifck = { |
1131 | .name = "iva1_mpu_int_ifck", | 1113 | .name = "iva1_mpu_int_ifck", |
1114 | .ops = &clkops_omap2_dflt_wait, | ||
1132 | .parent = &iva1_ifck, | 1115 | .parent = &iva1_ifck, |
1133 | .flags = CLOCK_IN_OMAP242X, | ||
1134 | .clkdm_name = "iva1_clkdm", | 1116 | .clkdm_name = "iva1_clkdm", |
1135 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | 1117 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), |
1136 | .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT, | 1118 | .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT, |
@@ -1175,10 +1157,9 @@ static const struct clksel core_l3_clksel[] = { | |||
1175 | 1157 | ||
1176 | static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */ | 1158 | static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */ |
1177 | .name = "core_l3_ck", | 1159 | .name = "core_l3_ck", |
1160 | .ops = &clkops_null, | ||
1178 | .parent = &core_ck, | 1161 | .parent = &core_ck, |
1179 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 1162 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, |
1180 | ALWAYS_ENABLED | DELAYED_APP | | ||
1181 | CONFIG_PARTICIPANT | RATE_PROPAGATES, | ||
1182 | .clkdm_name = "core_l3_clkdm", | 1163 | .clkdm_name = "core_l3_clkdm", |
1183 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | 1164 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), |
1184 | .clksel_mask = OMAP24XX_CLKSEL_L3_MASK, | 1165 | .clksel_mask = OMAP24XX_CLKSEL_L3_MASK, |
@@ -1204,9 +1185,9 @@ static const struct clksel usb_l4_ick_clksel[] = { | |||
1204 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ | 1185 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ |
1205 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ | 1186 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ |
1206 | .name = "usb_l4_ick", | 1187 | .name = "usb_l4_ick", |
1188 | .ops = &clkops_omap2_dflt_wait, | ||
1207 | .parent = &core_l3_ck, | 1189 | .parent = &core_l3_ck, |
1208 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 1190 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, |
1209 | DELAYED_APP | CONFIG_PARTICIPANT, | ||
1210 | .clkdm_name = "core_l4_clkdm", | 1191 | .clkdm_name = "core_l4_clkdm", |
1211 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1192 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
1212 | .enable_bit = OMAP24XX_EN_USB_SHIFT, | 1193 | .enable_bit = OMAP24XX_EN_USB_SHIFT, |
@@ -1238,9 +1219,9 @@ static const struct clksel l4_clksel[] = { | |||
1238 | 1219 | ||
1239 | static struct clk l4_ck = { /* used both as an ick and fck */ | 1220 | static struct clk l4_ck = { /* used both as an ick and fck */ |
1240 | .name = "l4_ck", | 1221 | .name = "l4_ck", |
1222 | .ops = &clkops_null, | ||
1241 | .parent = &core_l3_ck, | 1223 | .parent = &core_l3_ck, |
1242 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 1224 | .flags = DELAYED_APP, |
1243 | ALWAYS_ENABLED | DELAYED_APP | RATE_PROPAGATES, | ||
1244 | .clkdm_name = "core_l4_clkdm", | 1225 | .clkdm_name = "core_l4_clkdm", |
1245 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | 1226 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), |
1246 | .clksel_mask = OMAP24XX_CLKSEL_L4_MASK, | 1227 | .clksel_mask = OMAP24XX_CLKSEL_L4_MASK, |
@@ -1276,9 +1257,9 @@ static const struct clksel ssi_ssr_sst_fck_clksel[] = { | |||
1276 | 1257 | ||
1277 | static struct clk ssi_ssr_sst_fck = { | 1258 | static struct clk ssi_ssr_sst_fck = { |
1278 | .name = "ssi_fck", | 1259 | .name = "ssi_fck", |
1260 | .ops = &clkops_omap2_dflt_wait, | ||
1279 | .parent = &core_ck, | 1261 | .parent = &core_ck, |
1280 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 1262 | .flags = DELAYED_APP, |
1281 | DELAYED_APP, | ||
1282 | .clkdm_name = "core_l3_clkdm", | 1263 | .clkdm_name = "core_l3_clkdm", |
1283 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1264 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
1284 | .enable_bit = OMAP24XX_EN_SSI_SHIFT, | 1265 | .enable_bit = OMAP24XX_EN_SSI_SHIFT, |
@@ -1290,6 +1271,20 @@ static struct clk ssi_ssr_sst_fck = { | |||
1290 | .set_rate = &omap2_clksel_set_rate | 1271 | .set_rate = &omap2_clksel_set_rate |
1291 | }; | 1272 | }; |
1292 | 1273 | ||
1274 | /* | ||
1275 | * Presumably this is the same as SSI_ICLK. | ||
1276 | * TRM contradicts itself on what clockdomain SSI_ICLK is in | ||
1277 | */ | ||
1278 | static struct clk ssi_l4_ick = { | ||
1279 | .name = "ssi_l4_ick", | ||
1280 | .ops = &clkops_omap2_dflt_wait, | ||
1281 | .parent = &l4_ck, | ||
1282 | .clkdm_name = "core_l4_clkdm", | ||
1283 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | ||
1284 | .enable_bit = OMAP24XX_EN_SSI_SHIFT, | ||
1285 | .recalc = &followparent_recalc, | ||
1286 | }; | ||
1287 | |||
1293 | 1288 | ||
1294 | /* | 1289 | /* |
1295 | * GFX clock domain | 1290 | * GFX clock domain |
@@ -1312,8 +1307,8 @@ static const struct clksel gfx_fck_clksel[] = { | |||
1312 | 1307 | ||
1313 | static struct clk gfx_3d_fck = { | 1308 | static struct clk gfx_3d_fck = { |
1314 | .name = "gfx_3d_fck", | 1309 | .name = "gfx_3d_fck", |
1310 | .ops = &clkops_omap2_dflt_wait, | ||
1315 | .parent = &core_l3_ck, | 1311 | .parent = &core_l3_ck, |
1316 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1317 | .clkdm_name = "gfx_clkdm", | 1312 | .clkdm_name = "gfx_clkdm", |
1318 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), | 1313 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), |
1319 | .enable_bit = OMAP24XX_EN_3D_SHIFT, | 1314 | .enable_bit = OMAP24XX_EN_3D_SHIFT, |
@@ -1327,8 +1322,8 @@ static struct clk gfx_3d_fck = { | |||
1327 | 1322 | ||
1328 | static struct clk gfx_2d_fck = { | 1323 | static struct clk gfx_2d_fck = { |
1329 | .name = "gfx_2d_fck", | 1324 | .name = "gfx_2d_fck", |
1325 | .ops = &clkops_omap2_dflt_wait, | ||
1330 | .parent = &core_l3_ck, | 1326 | .parent = &core_l3_ck, |
1331 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1332 | .clkdm_name = "gfx_clkdm", | 1327 | .clkdm_name = "gfx_clkdm", |
1333 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), | 1328 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), |
1334 | .enable_bit = OMAP24XX_EN_2D_SHIFT, | 1329 | .enable_bit = OMAP24XX_EN_2D_SHIFT, |
@@ -1342,8 +1337,8 @@ static struct clk gfx_2d_fck = { | |||
1342 | 1337 | ||
1343 | static struct clk gfx_ick = { | 1338 | static struct clk gfx_ick = { |
1344 | .name = "gfx_ick", /* From l3 */ | 1339 | .name = "gfx_ick", /* From l3 */ |
1340 | .ops = &clkops_omap2_dflt_wait, | ||
1345 | .parent = &core_l3_ck, | 1341 | .parent = &core_l3_ck, |
1346 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1347 | .clkdm_name = "gfx_clkdm", | 1342 | .clkdm_name = "gfx_clkdm", |
1348 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN), | 1343 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN), |
1349 | .enable_bit = OMAP_EN_GFX_SHIFT, | 1344 | .enable_bit = OMAP_EN_GFX_SHIFT, |
@@ -1372,8 +1367,9 @@ static const struct clksel mdm_ick_clksel[] = { | |||
1372 | 1367 | ||
1373 | static struct clk mdm_ick = { /* used both as a ick and fck */ | 1368 | static struct clk mdm_ick = { /* used both as a ick and fck */ |
1374 | .name = "mdm_ick", | 1369 | .name = "mdm_ick", |
1370 | .ops = &clkops_omap2_dflt_wait, | ||
1375 | .parent = &core_ck, | 1371 | .parent = &core_ck, |
1376 | .flags = CLOCK_IN_OMAP243X | DELAYED_APP | CONFIG_PARTICIPANT, | 1372 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, |
1377 | .clkdm_name = "mdm_clkdm", | 1373 | .clkdm_name = "mdm_clkdm", |
1378 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), | 1374 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), |
1379 | .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT, | 1375 | .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT, |
@@ -1387,8 +1383,8 @@ static struct clk mdm_ick = { /* used both as a ick and fck */ | |||
1387 | 1383 | ||
1388 | static struct clk mdm_osc_ck = { | 1384 | static struct clk mdm_osc_ck = { |
1389 | .name = "mdm_osc_ck", | 1385 | .name = "mdm_osc_ck", |
1386 | .ops = &clkops_omap2_dflt_wait, | ||
1390 | .parent = &osc_ck, | 1387 | .parent = &osc_ck, |
1391 | .flags = CLOCK_IN_OMAP243X, | ||
1392 | .clkdm_name = "mdm_clkdm", | 1388 | .clkdm_name = "mdm_clkdm", |
1393 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN), | 1389 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN), |
1394 | .enable_bit = OMAP2430_EN_OSC_SHIFT, | 1390 | .enable_bit = OMAP2430_EN_OSC_SHIFT, |
@@ -1432,8 +1428,8 @@ static const struct clksel dss1_fck_clksel[] = { | |||
1432 | 1428 | ||
1433 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ | 1429 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ |
1434 | .name = "dss_ick", | 1430 | .name = "dss_ick", |
1431 | .ops = &clkops_omap2_dflt, | ||
1435 | .parent = &l4_ck, /* really both l3 and l4 */ | 1432 | .parent = &l4_ck, /* really both l3 and l4 */ |
1436 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1437 | .clkdm_name = "dss_clkdm", | 1433 | .clkdm_name = "dss_clkdm", |
1438 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1434 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1439 | .enable_bit = OMAP24XX_EN_DSS1_SHIFT, | 1435 | .enable_bit = OMAP24XX_EN_DSS1_SHIFT, |
@@ -1442,9 +1438,9 @@ static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ | |||
1442 | 1438 | ||
1443 | static struct clk dss1_fck = { | 1439 | static struct clk dss1_fck = { |
1444 | .name = "dss1_fck", | 1440 | .name = "dss1_fck", |
1441 | .ops = &clkops_omap2_dflt, | ||
1445 | .parent = &core_ck, /* Core or sys */ | 1442 | .parent = &core_ck, /* Core or sys */ |
1446 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 1443 | .flags = DELAYED_APP, |
1447 | DELAYED_APP, | ||
1448 | .clkdm_name = "dss_clkdm", | 1444 | .clkdm_name = "dss_clkdm", |
1449 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1445 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1450 | .enable_bit = OMAP24XX_EN_DSS1_SHIFT, | 1446 | .enable_bit = OMAP24XX_EN_DSS1_SHIFT, |
@@ -1475,9 +1471,9 @@ static const struct clksel dss2_fck_clksel[] = { | |||
1475 | 1471 | ||
1476 | static struct clk dss2_fck = { /* Alt clk used in power management */ | 1472 | static struct clk dss2_fck = { /* Alt clk used in power management */ |
1477 | .name = "dss2_fck", | 1473 | .name = "dss2_fck", |
1474 | .ops = &clkops_omap2_dflt, | ||
1478 | .parent = &sys_ck, /* fixed at sys_ck or 48MHz */ | 1475 | .parent = &sys_ck, /* fixed at sys_ck or 48MHz */ |
1479 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 1476 | .flags = DELAYED_APP, |
1480 | DELAYED_APP, | ||
1481 | .clkdm_name = "dss_clkdm", | 1477 | .clkdm_name = "dss_clkdm", |
1482 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1478 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1483 | .enable_bit = OMAP24XX_EN_DSS2_SHIFT, | 1479 | .enable_bit = OMAP24XX_EN_DSS2_SHIFT, |
@@ -1490,8 +1486,8 @@ static struct clk dss2_fck = { /* Alt clk used in power management */ | |||
1490 | 1486 | ||
1491 | static struct clk dss_54m_fck = { /* Alt clk used in power management */ | 1487 | static struct clk dss_54m_fck = { /* Alt clk used in power management */ |
1492 | .name = "dss_54m_fck", /* 54m tv clk */ | 1488 | .name = "dss_54m_fck", /* 54m tv clk */ |
1489 | .ops = &clkops_omap2_dflt_wait, | ||
1493 | .parent = &func_54m_ck, | 1490 | .parent = &func_54m_ck, |
1494 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1495 | .clkdm_name = "dss_clkdm", | 1491 | .clkdm_name = "dss_clkdm", |
1496 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1492 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1497 | .enable_bit = OMAP24XX_EN_TV_SHIFT, | 1493 | .enable_bit = OMAP24XX_EN_TV_SHIFT, |
@@ -1518,8 +1514,8 @@ static const struct clksel omap24xx_gpt_clksel[] = { | |||
1518 | 1514 | ||
1519 | static struct clk gpt1_ick = { | 1515 | static struct clk gpt1_ick = { |
1520 | .name = "gpt1_ick", | 1516 | .name = "gpt1_ick", |
1517 | .ops = &clkops_omap2_dflt_wait, | ||
1521 | .parent = &l4_ck, | 1518 | .parent = &l4_ck, |
1522 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1523 | .clkdm_name = "core_l4_clkdm", | 1519 | .clkdm_name = "core_l4_clkdm", |
1524 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1520 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
1525 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, | 1521 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, |
@@ -1528,8 +1524,8 @@ static struct clk gpt1_ick = { | |||
1528 | 1524 | ||
1529 | static struct clk gpt1_fck = { | 1525 | static struct clk gpt1_fck = { |
1530 | .name = "gpt1_fck", | 1526 | .name = "gpt1_fck", |
1527 | .ops = &clkops_omap2_dflt_wait, | ||
1531 | .parent = &func_32k_ck, | 1528 | .parent = &func_32k_ck, |
1532 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1533 | .clkdm_name = "core_l4_clkdm", | 1529 | .clkdm_name = "core_l4_clkdm", |
1534 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | 1530 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
1535 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, | 1531 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, |
@@ -1544,8 +1540,8 @@ static struct clk gpt1_fck = { | |||
1544 | 1540 | ||
1545 | static struct clk gpt2_ick = { | 1541 | static struct clk gpt2_ick = { |
1546 | .name = "gpt2_ick", | 1542 | .name = "gpt2_ick", |
1543 | .ops = &clkops_omap2_dflt_wait, | ||
1547 | .parent = &l4_ck, | 1544 | .parent = &l4_ck, |
1548 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1549 | .clkdm_name = "core_l4_clkdm", | 1545 | .clkdm_name = "core_l4_clkdm", |
1550 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1546 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1551 | .enable_bit = OMAP24XX_EN_GPT2_SHIFT, | 1547 | .enable_bit = OMAP24XX_EN_GPT2_SHIFT, |
@@ -1554,8 +1550,8 @@ static struct clk gpt2_ick = { | |||
1554 | 1550 | ||
1555 | static struct clk gpt2_fck = { | 1551 | static struct clk gpt2_fck = { |
1556 | .name = "gpt2_fck", | 1552 | .name = "gpt2_fck", |
1553 | .ops = &clkops_omap2_dflt_wait, | ||
1557 | .parent = &func_32k_ck, | 1554 | .parent = &func_32k_ck, |
1558 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1559 | .clkdm_name = "core_l4_clkdm", | 1555 | .clkdm_name = "core_l4_clkdm", |
1560 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1556 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1561 | .enable_bit = OMAP24XX_EN_GPT2_SHIFT, | 1557 | .enable_bit = OMAP24XX_EN_GPT2_SHIFT, |
@@ -1568,8 +1564,8 @@ static struct clk gpt2_fck = { | |||
1568 | 1564 | ||
1569 | static struct clk gpt3_ick = { | 1565 | static struct clk gpt3_ick = { |
1570 | .name = "gpt3_ick", | 1566 | .name = "gpt3_ick", |
1567 | .ops = &clkops_omap2_dflt_wait, | ||
1571 | .parent = &l4_ck, | 1568 | .parent = &l4_ck, |
1572 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1573 | .clkdm_name = "core_l4_clkdm", | 1569 | .clkdm_name = "core_l4_clkdm", |
1574 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1570 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1575 | .enable_bit = OMAP24XX_EN_GPT3_SHIFT, | 1571 | .enable_bit = OMAP24XX_EN_GPT3_SHIFT, |
@@ -1578,8 +1574,8 @@ static struct clk gpt3_ick = { | |||
1578 | 1574 | ||
1579 | static struct clk gpt3_fck = { | 1575 | static struct clk gpt3_fck = { |
1580 | .name = "gpt3_fck", | 1576 | .name = "gpt3_fck", |
1577 | .ops = &clkops_omap2_dflt_wait, | ||
1581 | .parent = &func_32k_ck, | 1578 | .parent = &func_32k_ck, |
1582 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1583 | .clkdm_name = "core_l4_clkdm", | 1579 | .clkdm_name = "core_l4_clkdm", |
1584 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1580 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1585 | .enable_bit = OMAP24XX_EN_GPT3_SHIFT, | 1581 | .enable_bit = OMAP24XX_EN_GPT3_SHIFT, |
@@ -1592,8 +1588,8 @@ static struct clk gpt3_fck = { | |||
1592 | 1588 | ||
1593 | static struct clk gpt4_ick = { | 1589 | static struct clk gpt4_ick = { |
1594 | .name = "gpt4_ick", | 1590 | .name = "gpt4_ick", |
1591 | .ops = &clkops_omap2_dflt_wait, | ||
1595 | .parent = &l4_ck, | 1592 | .parent = &l4_ck, |
1596 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1597 | .clkdm_name = "core_l4_clkdm", | 1593 | .clkdm_name = "core_l4_clkdm", |
1598 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1594 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1599 | .enable_bit = OMAP24XX_EN_GPT4_SHIFT, | 1595 | .enable_bit = OMAP24XX_EN_GPT4_SHIFT, |
@@ -1602,8 +1598,8 @@ static struct clk gpt4_ick = { | |||
1602 | 1598 | ||
1603 | static struct clk gpt4_fck = { | 1599 | static struct clk gpt4_fck = { |
1604 | .name = "gpt4_fck", | 1600 | .name = "gpt4_fck", |
1601 | .ops = &clkops_omap2_dflt_wait, | ||
1605 | .parent = &func_32k_ck, | 1602 | .parent = &func_32k_ck, |
1606 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1607 | .clkdm_name = "core_l4_clkdm", | 1603 | .clkdm_name = "core_l4_clkdm", |
1608 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1604 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1609 | .enable_bit = OMAP24XX_EN_GPT4_SHIFT, | 1605 | .enable_bit = OMAP24XX_EN_GPT4_SHIFT, |
@@ -1616,8 +1612,8 @@ static struct clk gpt4_fck = { | |||
1616 | 1612 | ||
1617 | static struct clk gpt5_ick = { | 1613 | static struct clk gpt5_ick = { |
1618 | .name = "gpt5_ick", | 1614 | .name = "gpt5_ick", |
1615 | .ops = &clkops_omap2_dflt_wait, | ||
1619 | .parent = &l4_ck, | 1616 | .parent = &l4_ck, |
1620 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1621 | .clkdm_name = "core_l4_clkdm", | 1617 | .clkdm_name = "core_l4_clkdm", |
1622 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1618 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1623 | .enable_bit = OMAP24XX_EN_GPT5_SHIFT, | 1619 | .enable_bit = OMAP24XX_EN_GPT5_SHIFT, |
@@ -1626,8 +1622,8 @@ static struct clk gpt5_ick = { | |||
1626 | 1622 | ||
1627 | static struct clk gpt5_fck = { | 1623 | static struct clk gpt5_fck = { |
1628 | .name = "gpt5_fck", | 1624 | .name = "gpt5_fck", |
1625 | .ops = &clkops_omap2_dflt_wait, | ||
1629 | .parent = &func_32k_ck, | 1626 | .parent = &func_32k_ck, |
1630 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1631 | .clkdm_name = "core_l4_clkdm", | 1627 | .clkdm_name = "core_l4_clkdm", |
1632 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1628 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1633 | .enable_bit = OMAP24XX_EN_GPT5_SHIFT, | 1629 | .enable_bit = OMAP24XX_EN_GPT5_SHIFT, |
@@ -1640,8 +1636,8 @@ static struct clk gpt5_fck = { | |||
1640 | 1636 | ||
1641 | static struct clk gpt6_ick = { | 1637 | static struct clk gpt6_ick = { |
1642 | .name = "gpt6_ick", | 1638 | .name = "gpt6_ick", |
1639 | .ops = &clkops_omap2_dflt_wait, | ||
1643 | .parent = &l4_ck, | 1640 | .parent = &l4_ck, |
1644 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1645 | .clkdm_name = "core_l4_clkdm", | 1641 | .clkdm_name = "core_l4_clkdm", |
1646 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1642 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1647 | .enable_bit = OMAP24XX_EN_GPT6_SHIFT, | 1643 | .enable_bit = OMAP24XX_EN_GPT6_SHIFT, |
@@ -1650,8 +1646,8 @@ static struct clk gpt6_ick = { | |||
1650 | 1646 | ||
1651 | static struct clk gpt6_fck = { | 1647 | static struct clk gpt6_fck = { |
1652 | .name = "gpt6_fck", | 1648 | .name = "gpt6_fck", |
1649 | .ops = &clkops_omap2_dflt_wait, | ||
1653 | .parent = &func_32k_ck, | 1650 | .parent = &func_32k_ck, |
1654 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1655 | .clkdm_name = "core_l4_clkdm", | 1651 | .clkdm_name = "core_l4_clkdm", |
1656 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1652 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1657 | .enable_bit = OMAP24XX_EN_GPT6_SHIFT, | 1653 | .enable_bit = OMAP24XX_EN_GPT6_SHIFT, |
@@ -1664,8 +1660,8 @@ static struct clk gpt6_fck = { | |||
1664 | 1660 | ||
1665 | static struct clk gpt7_ick = { | 1661 | static struct clk gpt7_ick = { |
1666 | .name = "gpt7_ick", | 1662 | .name = "gpt7_ick", |
1663 | .ops = &clkops_omap2_dflt_wait, | ||
1667 | .parent = &l4_ck, | 1664 | .parent = &l4_ck, |
1668 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1669 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1665 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1670 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, | 1666 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, |
1671 | .recalc = &followparent_recalc, | 1667 | .recalc = &followparent_recalc, |
@@ -1673,8 +1669,8 @@ static struct clk gpt7_ick = { | |||
1673 | 1669 | ||
1674 | static struct clk gpt7_fck = { | 1670 | static struct clk gpt7_fck = { |
1675 | .name = "gpt7_fck", | 1671 | .name = "gpt7_fck", |
1672 | .ops = &clkops_omap2_dflt_wait, | ||
1676 | .parent = &func_32k_ck, | 1673 | .parent = &func_32k_ck, |
1677 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1678 | .clkdm_name = "core_l4_clkdm", | 1674 | .clkdm_name = "core_l4_clkdm", |
1679 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1675 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1680 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, | 1676 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, |
@@ -1687,8 +1683,8 @@ static struct clk gpt7_fck = { | |||
1687 | 1683 | ||
1688 | static struct clk gpt8_ick = { | 1684 | static struct clk gpt8_ick = { |
1689 | .name = "gpt8_ick", | 1685 | .name = "gpt8_ick", |
1686 | .ops = &clkops_omap2_dflt_wait, | ||
1690 | .parent = &l4_ck, | 1687 | .parent = &l4_ck, |
1691 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1692 | .clkdm_name = "core_l4_clkdm", | 1688 | .clkdm_name = "core_l4_clkdm", |
1693 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1689 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1694 | .enable_bit = OMAP24XX_EN_GPT8_SHIFT, | 1690 | .enable_bit = OMAP24XX_EN_GPT8_SHIFT, |
@@ -1697,8 +1693,8 @@ static struct clk gpt8_ick = { | |||
1697 | 1693 | ||
1698 | static struct clk gpt8_fck = { | 1694 | static struct clk gpt8_fck = { |
1699 | .name = "gpt8_fck", | 1695 | .name = "gpt8_fck", |
1696 | .ops = &clkops_omap2_dflt_wait, | ||
1700 | .parent = &func_32k_ck, | 1697 | .parent = &func_32k_ck, |
1701 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1702 | .clkdm_name = "core_l4_clkdm", | 1698 | .clkdm_name = "core_l4_clkdm", |
1703 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1699 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1704 | .enable_bit = OMAP24XX_EN_GPT8_SHIFT, | 1700 | .enable_bit = OMAP24XX_EN_GPT8_SHIFT, |
@@ -1711,8 +1707,8 @@ static struct clk gpt8_fck = { | |||
1711 | 1707 | ||
1712 | static struct clk gpt9_ick = { | 1708 | static struct clk gpt9_ick = { |
1713 | .name = "gpt9_ick", | 1709 | .name = "gpt9_ick", |
1710 | .ops = &clkops_omap2_dflt_wait, | ||
1714 | .parent = &l4_ck, | 1711 | .parent = &l4_ck, |
1715 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1716 | .clkdm_name = "core_l4_clkdm", | 1712 | .clkdm_name = "core_l4_clkdm", |
1717 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1713 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1718 | .enable_bit = OMAP24XX_EN_GPT9_SHIFT, | 1714 | .enable_bit = OMAP24XX_EN_GPT9_SHIFT, |
@@ -1721,8 +1717,8 @@ static struct clk gpt9_ick = { | |||
1721 | 1717 | ||
1722 | static struct clk gpt9_fck = { | 1718 | static struct clk gpt9_fck = { |
1723 | .name = "gpt9_fck", | 1719 | .name = "gpt9_fck", |
1720 | .ops = &clkops_omap2_dflt_wait, | ||
1724 | .parent = &func_32k_ck, | 1721 | .parent = &func_32k_ck, |
1725 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1726 | .clkdm_name = "core_l4_clkdm", | 1722 | .clkdm_name = "core_l4_clkdm", |
1727 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1723 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1728 | .enable_bit = OMAP24XX_EN_GPT9_SHIFT, | 1724 | .enable_bit = OMAP24XX_EN_GPT9_SHIFT, |
@@ -1735,8 +1731,8 @@ static struct clk gpt9_fck = { | |||
1735 | 1731 | ||
1736 | static struct clk gpt10_ick = { | 1732 | static struct clk gpt10_ick = { |
1737 | .name = "gpt10_ick", | 1733 | .name = "gpt10_ick", |
1734 | .ops = &clkops_omap2_dflt_wait, | ||
1738 | .parent = &l4_ck, | 1735 | .parent = &l4_ck, |
1739 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1740 | .clkdm_name = "core_l4_clkdm", | 1736 | .clkdm_name = "core_l4_clkdm", |
1741 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1737 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1742 | .enable_bit = OMAP24XX_EN_GPT10_SHIFT, | 1738 | .enable_bit = OMAP24XX_EN_GPT10_SHIFT, |
@@ -1745,8 +1741,8 @@ static struct clk gpt10_ick = { | |||
1745 | 1741 | ||
1746 | static struct clk gpt10_fck = { | 1742 | static struct clk gpt10_fck = { |
1747 | .name = "gpt10_fck", | 1743 | .name = "gpt10_fck", |
1744 | .ops = &clkops_omap2_dflt_wait, | ||
1748 | .parent = &func_32k_ck, | 1745 | .parent = &func_32k_ck, |
1749 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1750 | .clkdm_name = "core_l4_clkdm", | 1746 | .clkdm_name = "core_l4_clkdm", |
1751 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1747 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1752 | .enable_bit = OMAP24XX_EN_GPT10_SHIFT, | 1748 | .enable_bit = OMAP24XX_EN_GPT10_SHIFT, |
@@ -1759,8 +1755,8 @@ static struct clk gpt10_fck = { | |||
1759 | 1755 | ||
1760 | static struct clk gpt11_ick = { | 1756 | static struct clk gpt11_ick = { |
1761 | .name = "gpt11_ick", | 1757 | .name = "gpt11_ick", |
1758 | .ops = &clkops_omap2_dflt_wait, | ||
1762 | .parent = &l4_ck, | 1759 | .parent = &l4_ck, |
1763 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1764 | .clkdm_name = "core_l4_clkdm", | 1760 | .clkdm_name = "core_l4_clkdm", |
1765 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1761 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1766 | .enable_bit = OMAP24XX_EN_GPT11_SHIFT, | 1762 | .enable_bit = OMAP24XX_EN_GPT11_SHIFT, |
@@ -1769,8 +1765,8 @@ static struct clk gpt11_ick = { | |||
1769 | 1765 | ||
1770 | static struct clk gpt11_fck = { | 1766 | static struct clk gpt11_fck = { |
1771 | .name = "gpt11_fck", | 1767 | .name = "gpt11_fck", |
1768 | .ops = &clkops_omap2_dflt_wait, | ||
1772 | .parent = &func_32k_ck, | 1769 | .parent = &func_32k_ck, |
1773 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1774 | .clkdm_name = "core_l4_clkdm", | 1770 | .clkdm_name = "core_l4_clkdm", |
1775 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1771 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1776 | .enable_bit = OMAP24XX_EN_GPT11_SHIFT, | 1772 | .enable_bit = OMAP24XX_EN_GPT11_SHIFT, |
@@ -1783,8 +1779,8 @@ static struct clk gpt11_fck = { | |||
1783 | 1779 | ||
1784 | static struct clk gpt12_ick = { | 1780 | static struct clk gpt12_ick = { |
1785 | .name = "gpt12_ick", | 1781 | .name = "gpt12_ick", |
1782 | .ops = &clkops_omap2_dflt_wait, | ||
1786 | .parent = &l4_ck, | 1783 | .parent = &l4_ck, |
1787 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1788 | .clkdm_name = "core_l4_clkdm", | 1784 | .clkdm_name = "core_l4_clkdm", |
1789 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1785 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1790 | .enable_bit = OMAP24XX_EN_GPT12_SHIFT, | 1786 | .enable_bit = OMAP24XX_EN_GPT12_SHIFT, |
@@ -1793,8 +1789,8 @@ static struct clk gpt12_ick = { | |||
1793 | 1789 | ||
1794 | static struct clk gpt12_fck = { | 1790 | static struct clk gpt12_fck = { |
1795 | .name = "gpt12_fck", | 1791 | .name = "gpt12_fck", |
1792 | .ops = &clkops_omap2_dflt_wait, | ||
1796 | .parent = &func_32k_ck, | 1793 | .parent = &func_32k_ck, |
1797 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1798 | .clkdm_name = "core_l4_clkdm", | 1794 | .clkdm_name = "core_l4_clkdm", |
1799 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1795 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1800 | .enable_bit = OMAP24XX_EN_GPT12_SHIFT, | 1796 | .enable_bit = OMAP24XX_EN_GPT12_SHIFT, |
@@ -1807,9 +1803,9 @@ static struct clk gpt12_fck = { | |||
1807 | 1803 | ||
1808 | static struct clk mcbsp1_ick = { | 1804 | static struct clk mcbsp1_ick = { |
1809 | .name = "mcbsp_ick", | 1805 | .name = "mcbsp_ick", |
1806 | .ops = &clkops_omap2_dflt_wait, | ||
1810 | .id = 1, | 1807 | .id = 1, |
1811 | .parent = &l4_ck, | 1808 | .parent = &l4_ck, |
1812 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1813 | .clkdm_name = "core_l4_clkdm", | 1809 | .clkdm_name = "core_l4_clkdm", |
1814 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1810 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1815 | .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, | 1811 | .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, |
@@ -1818,9 +1814,9 @@ static struct clk mcbsp1_ick = { | |||
1818 | 1814 | ||
1819 | static struct clk mcbsp1_fck = { | 1815 | static struct clk mcbsp1_fck = { |
1820 | .name = "mcbsp_fck", | 1816 | .name = "mcbsp_fck", |
1817 | .ops = &clkops_omap2_dflt_wait, | ||
1821 | .id = 1, | 1818 | .id = 1, |
1822 | .parent = &func_96m_ck, | 1819 | .parent = &func_96m_ck, |
1823 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1824 | .clkdm_name = "core_l4_clkdm", | 1820 | .clkdm_name = "core_l4_clkdm", |
1825 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1821 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1826 | .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, | 1822 | .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, |
@@ -1829,9 +1825,9 @@ static struct clk mcbsp1_fck = { | |||
1829 | 1825 | ||
1830 | static struct clk mcbsp2_ick = { | 1826 | static struct clk mcbsp2_ick = { |
1831 | .name = "mcbsp_ick", | 1827 | .name = "mcbsp_ick", |
1828 | .ops = &clkops_omap2_dflt_wait, | ||
1832 | .id = 2, | 1829 | .id = 2, |
1833 | .parent = &l4_ck, | 1830 | .parent = &l4_ck, |
1834 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1835 | .clkdm_name = "core_l4_clkdm", | 1831 | .clkdm_name = "core_l4_clkdm", |
1836 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1832 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1837 | .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, | 1833 | .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, |
@@ -1840,9 +1836,9 @@ static struct clk mcbsp2_ick = { | |||
1840 | 1836 | ||
1841 | static struct clk mcbsp2_fck = { | 1837 | static struct clk mcbsp2_fck = { |
1842 | .name = "mcbsp_fck", | 1838 | .name = "mcbsp_fck", |
1839 | .ops = &clkops_omap2_dflt_wait, | ||
1843 | .id = 2, | 1840 | .id = 2, |
1844 | .parent = &func_96m_ck, | 1841 | .parent = &func_96m_ck, |
1845 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1846 | .clkdm_name = "core_l4_clkdm", | 1842 | .clkdm_name = "core_l4_clkdm", |
1847 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1843 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1848 | .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, | 1844 | .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, |
@@ -1851,9 +1847,9 @@ static struct clk mcbsp2_fck = { | |||
1851 | 1847 | ||
1852 | static struct clk mcbsp3_ick = { | 1848 | static struct clk mcbsp3_ick = { |
1853 | .name = "mcbsp_ick", | 1849 | .name = "mcbsp_ick", |
1850 | .ops = &clkops_omap2_dflt_wait, | ||
1854 | .id = 3, | 1851 | .id = 3, |
1855 | .parent = &l4_ck, | 1852 | .parent = &l4_ck, |
1856 | .flags = CLOCK_IN_OMAP243X, | ||
1857 | .clkdm_name = "core_l4_clkdm", | 1853 | .clkdm_name = "core_l4_clkdm", |
1858 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1854 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
1859 | .enable_bit = OMAP2430_EN_MCBSP3_SHIFT, | 1855 | .enable_bit = OMAP2430_EN_MCBSP3_SHIFT, |
@@ -1862,9 +1858,9 @@ static struct clk mcbsp3_ick = { | |||
1862 | 1858 | ||
1863 | static struct clk mcbsp3_fck = { | 1859 | static struct clk mcbsp3_fck = { |
1864 | .name = "mcbsp_fck", | 1860 | .name = "mcbsp_fck", |
1861 | .ops = &clkops_omap2_dflt_wait, | ||
1865 | .id = 3, | 1862 | .id = 3, |
1866 | .parent = &func_96m_ck, | 1863 | .parent = &func_96m_ck, |
1867 | .flags = CLOCK_IN_OMAP243X, | ||
1868 | .clkdm_name = "core_l4_clkdm", | 1864 | .clkdm_name = "core_l4_clkdm", |
1869 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1865 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
1870 | .enable_bit = OMAP2430_EN_MCBSP3_SHIFT, | 1866 | .enable_bit = OMAP2430_EN_MCBSP3_SHIFT, |
@@ -1873,9 +1869,9 @@ static struct clk mcbsp3_fck = { | |||
1873 | 1869 | ||
1874 | static struct clk mcbsp4_ick = { | 1870 | static struct clk mcbsp4_ick = { |
1875 | .name = "mcbsp_ick", | 1871 | .name = "mcbsp_ick", |
1872 | .ops = &clkops_omap2_dflt_wait, | ||
1876 | .id = 4, | 1873 | .id = 4, |
1877 | .parent = &l4_ck, | 1874 | .parent = &l4_ck, |
1878 | .flags = CLOCK_IN_OMAP243X, | ||
1879 | .clkdm_name = "core_l4_clkdm", | 1875 | .clkdm_name = "core_l4_clkdm", |
1880 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1876 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
1881 | .enable_bit = OMAP2430_EN_MCBSP4_SHIFT, | 1877 | .enable_bit = OMAP2430_EN_MCBSP4_SHIFT, |
@@ -1884,9 +1880,9 @@ static struct clk mcbsp4_ick = { | |||
1884 | 1880 | ||
1885 | static struct clk mcbsp4_fck = { | 1881 | static struct clk mcbsp4_fck = { |
1886 | .name = "mcbsp_fck", | 1882 | .name = "mcbsp_fck", |
1883 | .ops = &clkops_omap2_dflt_wait, | ||
1887 | .id = 4, | 1884 | .id = 4, |
1888 | .parent = &func_96m_ck, | 1885 | .parent = &func_96m_ck, |
1889 | .flags = CLOCK_IN_OMAP243X, | ||
1890 | .clkdm_name = "core_l4_clkdm", | 1886 | .clkdm_name = "core_l4_clkdm", |
1891 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1887 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
1892 | .enable_bit = OMAP2430_EN_MCBSP4_SHIFT, | 1888 | .enable_bit = OMAP2430_EN_MCBSP4_SHIFT, |
@@ -1895,9 +1891,9 @@ static struct clk mcbsp4_fck = { | |||
1895 | 1891 | ||
1896 | static struct clk mcbsp5_ick = { | 1892 | static struct clk mcbsp5_ick = { |
1897 | .name = "mcbsp_ick", | 1893 | .name = "mcbsp_ick", |
1894 | .ops = &clkops_omap2_dflt_wait, | ||
1898 | .id = 5, | 1895 | .id = 5, |
1899 | .parent = &l4_ck, | 1896 | .parent = &l4_ck, |
1900 | .flags = CLOCK_IN_OMAP243X, | ||
1901 | .clkdm_name = "core_l4_clkdm", | 1897 | .clkdm_name = "core_l4_clkdm", |
1902 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1898 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
1903 | .enable_bit = OMAP2430_EN_MCBSP5_SHIFT, | 1899 | .enable_bit = OMAP2430_EN_MCBSP5_SHIFT, |
@@ -1906,9 +1902,9 @@ static struct clk mcbsp5_ick = { | |||
1906 | 1902 | ||
1907 | static struct clk mcbsp5_fck = { | 1903 | static struct clk mcbsp5_fck = { |
1908 | .name = "mcbsp_fck", | 1904 | .name = "mcbsp_fck", |
1905 | .ops = &clkops_omap2_dflt_wait, | ||
1909 | .id = 5, | 1906 | .id = 5, |
1910 | .parent = &func_96m_ck, | 1907 | .parent = &func_96m_ck, |
1911 | .flags = CLOCK_IN_OMAP243X, | ||
1912 | .clkdm_name = "core_l4_clkdm", | 1908 | .clkdm_name = "core_l4_clkdm", |
1913 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1909 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
1914 | .enable_bit = OMAP2430_EN_MCBSP5_SHIFT, | 1910 | .enable_bit = OMAP2430_EN_MCBSP5_SHIFT, |
@@ -1917,10 +1913,10 @@ static struct clk mcbsp5_fck = { | |||
1917 | 1913 | ||
1918 | static struct clk mcspi1_ick = { | 1914 | static struct clk mcspi1_ick = { |
1919 | .name = "mcspi_ick", | 1915 | .name = "mcspi_ick", |
1916 | .ops = &clkops_omap2_dflt_wait, | ||
1920 | .id = 1, | 1917 | .id = 1, |
1921 | .parent = &l4_ck, | 1918 | .parent = &l4_ck, |
1922 | .clkdm_name = "core_l4_clkdm", | 1919 | .clkdm_name = "core_l4_clkdm", |
1923 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1924 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1920 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1925 | .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT, | 1921 | .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT, |
1926 | .recalc = &followparent_recalc, | 1922 | .recalc = &followparent_recalc, |
@@ -1928,9 +1924,9 @@ static struct clk mcspi1_ick = { | |||
1928 | 1924 | ||
1929 | static struct clk mcspi1_fck = { | 1925 | static struct clk mcspi1_fck = { |
1930 | .name = "mcspi_fck", | 1926 | .name = "mcspi_fck", |
1927 | .ops = &clkops_omap2_dflt_wait, | ||
1931 | .id = 1, | 1928 | .id = 1, |
1932 | .parent = &func_48m_ck, | 1929 | .parent = &func_48m_ck, |
1933 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1934 | .clkdm_name = "core_l4_clkdm", | 1930 | .clkdm_name = "core_l4_clkdm", |
1935 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1931 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1936 | .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT, | 1932 | .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT, |
@@ -1939,9 +1935,9 @@ static struct clk mcspi1_fck = { | |||
1939 | 1935 | ||
1940 | static struct clk mcspi2_ick = { | 1936 | static struct clk mcspi2_ick = { |
1941 | .name = "mcspi_ick", | 1937 | .name = "mcspi_ick", |
1938 | .ops = &clkops_omap2_dflt_wait, | ||
1942 | .id = 2, | 1939 | .id = 2, |
1943 | .parent = &l4_ck, | 1940 | .parent = &l4_ck, |
1944 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1945 | .clkdm_name = "core_l4_clkdm", | 1941 | .clkdm_name = "core_l4_clkdm", |
1946 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1942 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1947 | .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT, | 1943 | .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT, |
@@ -1950,9 +1946,9 @@ static struct clk mcspi2_ick = { | |||
1950 | 1946 | ||
1951 | static struct clk mcspi2_fck = { | 1947 | static struct clk mcspi2_fck = { |
1952 | .name = "mcspi_fck", | 1948 | .name = "mcspi_fck", |
1949 | .ops = &clkops_omap2_dflt_wait, | ||
1953 | .id = 2, | 1950 | .id = 2, |
1954 | .parent = &func_48m_ck, | 1951 | .parent = &func_48m_ck, |
1955 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1956 | .clkdm_name = "core_l4_clkdm", | 1952 | .clkdm_name = "core_l4_clkdm", |
1957 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1953 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1958 | .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT, | 1954 | .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT, |
@@ -1961,9 +1957,9 @@ static struct clk mcspi2_fck = { | |||
1961 | 1957 | ||
1962 | static struct clk mcspi3_ick = { | 1958 | static struct clk mcspi3_ick = { |
1963 | .name = "mcspi_ick", | 1959 | .name = "mcspi_ick", |
1960 | .ops = &clkops_omap2_dflt_wait, | ||
1964 | .id = 3, | 1961 | .id = 3, |
1965 | .parent = &l4_ck, | 1962 | .parent = &l4_ck, |
1966 | .flags = CLOCK_IN_OMAP243X, | ||
1967 | .clkdm_name = "core_l4_clkdm", | 1963 | .clkdm_name = "core_l4_clkdm", |
1968 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1964 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
1969 | .enable_bit = OMAP2430_EN_MCSPI3_SHIFT, | 1965 | .enable_bit = OMAP2430_EN_MCSPI3_SHIFT, |
@@ -1972,9 +1968,9 @@ static struct clk mcspi3_ick = { | |||
1972 | 1968 | ||
1973 | static struct clk mcspi3_fck = { | 1969 | static struct clk mcspi3_fck = { |
1974 | .name = "mcspi_fck", | 1970 | .name = "mcspi_fck", |
1971 | .ops = &clkops_omap2_dflt_wait, | ||
1975 | .id = 3, | 1972 | .id = 3, |
1976 | .parent = &func_48m_ck, | 1973 | .parent = &func_48m_ck, |
1977 | .flags = CLOCK_IN_OMAP243X, | ||
1978 | .clkdm_name = "core_l4_clkdm", | 1974 | .clkdm_name = "core_l4_clkdm", |
1979 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1975 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
1980 | .enable_bit = OMAP2430_EN_MCSPI3_SHIFT, | 1976 | .enable_bit = OMAP2430_EN_MCSPI3_SHIFT, |
@@ -1983,8 +1979,8 @@ static struct clk mcspi3_fck = { | |||
1983 | 1979 | ||
1984 | static struct clk uart1_ick = { | 1980 | static struct clk uart1_ick = { |
1985 | .name = "uart1_ick", | 1981 | .name = "uart1_ick", |
1982 | .ops = &clkops_omap2_dflt_wait, | ||
1986 | .parent = &l4_ck, | 1983 | .parent = &l4_ck, |
1987 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1988 | .clkdm_name = "core_l4_clkdm", | 1984 | .clkdm_name = "core_l4_clkdm", |
1989 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1985 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1990 | .enable_bit = OMAP24XX_EN_UART1_SHIFT, | 1986 | .enable_bit = OMAP24XX_EN_UART1_SHIFT, |
@@ -1993,8 +1989,8 @@ static struct clk uart1_ick = { | |||
1993 | 1989 | ||
1994 | static struct clk uart1_fck = { | 1990 | static struct clk uart1_fck = { |
1995 | .name = "uart1_fck", | 1991 | .name = "uart1_fck", |
1992 | .ops = &clkops_omap2_dflt_wait, | ||
1996 | .parent = &func_48m_ck, | 1993 | .parent = &func_48m_ck, |
1997 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
1998 | .clkdm_name = "core_l4_clkdm", | 1994 | .clkdm_name = "core_l4_clkdm", |
1999 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1995 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2000 | .enable_bit = OMAP24XX_EN_UART1_SHIFT, | 1996 | .enable_bit = OMAP24XX_EN_UART1_SHIFT, |
@@ -2003,8 +1999,8 @@ static struct clk uart1_fck = { | |||
2003 | 1999 | ||
2004 | static struct clk uart2_ick = { | 2000 | static struct clk uart2_ick = { |
2005 | .name = "uart2_ick", | 2001 | .name = "uart2_ick", |
2002 | .ops = &clkops_omap2_dflt_wait, | ||
2006 | .parent = &l4_ck, | 2003 | .parent = &l4_ck, |
2007 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2008 | .clkdm_name = "core_l4_clkdm", | 2004 | .clkdm_name = "core_l4_clkdm", |
2009 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2005 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2010 | .enable_bit = OMAP24XX_EN_UART2_SHIFT, | 2006 | .enable_bit = OMAP24XX_EN_UART2_SHIFT, |
@@ -2013,8 +2009,8 @@ static struct clk uart2_ick = { | |||
2013 | 2009 | ||
2014 | static struct clk uart2_fck = { | 2010 | static struct clk uart2_fck = { |
2015 | .name = "uart2_fck", | 2011 | .name = "uart2_fck", |
2012 | .ops = &clkops_omap2_dflt_wait, | ||
2016 | .parent = &func_48m_ck, | 2013 | .parent = &func_48m_ck, |
2017 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2018 | .clkdm_name = "core_l4_clkdm", | 2014 | .clkdm_name = "core_l4_clkdm", |
2019 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2015 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2020 | .enable_bit = OMAP24XX_EN_UART2_SHIFT, | 2016 | .enable_bit = OMAP24XX_EN_UART2_SHIFT, |
@@ -2023,8 +2019,8 @@ static struct clk uart2_fck = { | |||
2023 | 2019 | ||
2024 | static struct clk uart3_ick = { | 2020 | static struct clk uart3_ick = { |
2025 | .name = "uart3_ick", | 2021 | .name = "uart3_ick", |
2022 | .ops = &clkops_omap2_dflt_wait, | ||
2026 | .parent = &l4_ck, | 2023 | .parent = &l4_ck, |
2027 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2028 | .clkdm_name = "core_l4_clkdm", | 2024 | .clkdm_name = "core_l4_clkdm", |
2029 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2025 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2030 | .enable_bit = OMAP24XX_EN_UART3_SHIFT, | 2026 | .enable_bit = OMAP24XX_EN_UART3_SHIFT, |
@@ -2033,8 +2029,8 @@ static struct clk uart3_ick = { | |||
2033 | 2029 | ||
2034 | static struct clk uart3_fck = { | 2030 | static struct clk uart3_fck = { |
2035 | .name = "uart3_fck", | 2031 | .name = "uart3_fck", |
2032 | .ops = &clkops_omap2_dflt_wait, | ||
2036 | .parent = &func_48m_ck, | 2033 | .parent = &func_48m_ck, |
2037 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2038 | .clkdm_name = "core_l4_clkdm", | 2034 | .clkdm_name = "core_l4_clkdm", |
2039 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 2035 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
2040 | .enable_bit = OMAP24XX_EN_UART3_SHIFT, | 2036 | .enable_bit = OMAP24XX_EN_UART3_SHIFT, |
@@ -2043,8 +2039,8 @@ static struct clk uart3_fck = { | |||
2043 | 2039 | ||
2044 | static struct clk gpios_ick = { | 2040 | static struct clk gpios_ick = { |
2045 | .name = "gpios_ick", | 2041 | .name = "gpios_ick", |
2042 | .ops = &clkops_omap2_dflt_wait, | ||
2046 | .parent = &l4_ck, | 2043 | .parent = &l4_ck, |
2047 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2048 | .clkdm_name = "core_l4_clkdm", | 2044 | .clkdm_name = "core_l4_clkdm", |
2049 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2045 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2050 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, | 2046 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, |
@@ -2053,8 +2049,8 @@ static struct clk gpios_ick = { | |||
2053 | 2049 | ||
2054 | static struct clk gpios_fck = { | 2050 | static struct clk gpios_fck = { |
2055 | .name = "gpios_fck", | 2051 | .name = "gpios_fck", |
2052 | .ops = &clkops_omap2_dflt_wait, | ||
2056 | .parent = &func_32k_ck, | 2053 | .parent = &func_32k_ck, |
2057 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2058 | .clkdm_name = "wkup_clkdm", | 2054 | .clkdm_name = "wkup_clkdm", |
2059 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | 2055 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
2060 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, | 2056 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, |
@@ -2063,8 +2059,8 @@ static struct clk gpios_fck = { | |||
2063 | 2059 | ||
2064 | static struct clk mpu_wdt_ick = { | 2060 | static struct clk mpu_wdt_ick = { |
2065 | .name = "mpu_wdt_ick", | 2061 | .name = "mpu_wdt_ick", |
2062 | .ops = &clkops_omap2_dflt_wait, | ||
2066 | .parent = &l4_ck, | 2063 | .parent = &l4_ck, |
2067 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2068 | .clkdm_name = "core_l4_clkdm", | 2064 | .clkdm_name = "core_l4_clkdm", |
2069 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2065 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2070 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, | 2066 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, |
@@ -2073,8 +2069,8 @@ static struct clk mpu_wdt_ick = { | |||
2073 | 2069 | ||
2074 | static struct clk mpu_wdt_fck = { | 2070 | static struct clk mpu_wdt_fck = { |
2075 | .name = "mpu_wdt_fck", | 2071 | .name = "mpu_wdt_fck", |
2072 | .ops = &clkops_omap2_dflt_wait, | ||
2076 | .parent = &func_32k_ck, | 2073 | .parent = &func_32k_ck, |
2077 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2078 | .clkdm_name = "wkup_clkdm", | 2074 | .clkdm_name = "wkup_clkdm", |
2079 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | 2075 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
2080 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, | 2076 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, |
@@ -2083,9 +2079,9 @@ static struct clk mpu_wdt_fck = { | |||
2083 | 2079 | ||
2084 | static struct clk sync_32k_ick = { | 2080 | static struct clk sync_32k_ick = { |
2085 | .name = "sync_32k_ick", | 2081 | .name = "sync_32k_ick", |
2082 | .ops = &clkops_omap2_dflt_wait, | ||
2086 | .parent = &l4_ck, | 2083 | .parent = &l4_ck, |
2087 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 2084 | .flags = ENABLE_ON_INIT, |
2088 | ENABLE_ON_INIT, | ||
2089 | .clkdm_name = "core_l4_clkdm", | 2085 | .clkdm_name = "core_l4_clkdm", |
2090 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2086 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2091 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, | 2087 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, |
@@ -2094,8 +2090,8 @@ static struct clk sync_32k_ick = { | |||
2094 | 2090 | ||
2095 | static struct clk wdt1_ick = { | 2091 | static struct clk wdt1_ick = { |
2096 | .name = "wdt1_ick", | 2092 | .name = "wdt1_ick", |
2093 | .ops = &clkops_omap2_dflt_wait, | ||
2097 | .parent = &l4_ck, | 2094 | .parent = &l4_ck, |
2098 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2099 | .clkdm_name = "core_l4_clkdm", | 2095 | .clkdm_name = "core_l4_clkdm", |
2100 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2096 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2101 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, | 2097 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, |
@@ -2104,9 +2100,9 @@ static struct clk wdt1_ick = { | |||
2104 | 2100 | ||
2105 | static struct clk omapctrl_ick = { | 2101 | static struct clk omapctrl_ick = { |
2106 | .name = "omapctrl_ick", | 2102 | .name = "omapctrl_ick", |
2103 | .ops = &clkops_omap2_dflt_wait, | ||
2107 | .parent = &l4_ck, | 2104 | .parent = &l4_ck, |
2108 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 2105 | .flags = ENABLE_ON_INIT, |
2109 | ENABLE_ON_INIT, | ||
2110 | .clkdm_name = "core_l4_clkdm", | 2106 | .clkdm_name = "core_l4_clkdm", |
2111 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2107 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2112 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, | 2108 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, |
@@ -2115,8 +2111,8 @@ static struct clk omapctrl_ick = { | |||
2115 | 2111 | ||
2116 | static struct clk icr_ick = { | 2112 | static struct clk icr_ick = { |
2117 | .name = "icr_ick", | 2113 | .name = "icr_ick", |
2114 | .ops = &clkops_omap2_dflt_wait, | ||
2118 | .parent = &l4_ck, | 2115 | .parent = &l4_ck, |
2119 | .flags = CLOCK_IN_OMAP243X, | ||
2120 | .clkdm_name = "core_l4_clkdm", | 2116 | .clkdm_name = "core_l4_clkdm", |
2121 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2117 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2122 | .enable_bit = OMAP2430_EN_ICR_SHIFT, | 2118 | .enable_bit = OMAP2430_EN_ICR_SHIFT, |
@@ -2125,8 +2121,8 @@ static struct clk icr_ick = { | |||
2125 | 2121 | ||
2126 | static struct clk cam_ick = { | 2122 | static struct clk cam_ick = { |
2127 | .name = "cam_ick", | 2123 | .name = "cam_ick", |
2124 | .ops = &clkops_omap2_dflt, | ||
2128 | .parent = &l4_ck, | 2125 | .parent = &l4_ck, |
2129 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2130 | .clkdm_name = "core_l4_clkdm", | 2126 | .clkdm_name = "core_l4_clkdm", |
2131 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2127 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2132 | .enable_bit = OMAP24XX_EN_CAM_SHIFT, | 2128 | .enable_bit = OMAP24XX_EN_CAM_SHIFT, |
@@ -2140,8 +2136,8 @@ static struct clk cam_ick = { | |||
2140 | */ | 2136 | */ |
2141 | static struct clk cam_fck = { | 2137 | static struct clk cam_fck = { |
2142 | .name = "cam_fck", | 2138 | .name = "cam_fck", |
2139 | .ops = &clkops_omap2_dflt, | ||
2143 | .parent = &func_96m_ck, | 2140 | .parent = &func_96m_ck, |
2144 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2145 | .clkdm_name = "core_l3_clkdm", | 2141 | .clkdm_name = "core_l3_clkdm", |
2146 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2142 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2147 | .enable_bit = OMAP24XX_EN_CAM_SHIFT, | 2143 | .enable_bit = OMAP24XX_EN_CAM_SHIFT, |
@@ -2150,8 +2146,8 @@ static struct clk cam_fck = { | |||
2150 | 2146 | ||
2151 | static struct clk mailboxes_ick = { | 2147 | static struct clk mailboxes_ick = { |
2152 | .name = "mailboxes_ick", | 2148 | .name = "mailboxes_ick", |
2149 | .ops = &clkops_omap2_dflt_wait, | ||
2153 | .parent = &l4_ck, | 2150 | .parent = &l4_ck, |
2154 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2155 | .clkdm_name = "core_l4_clkdm", | 2151 | .clkdm_name = "core_l4_clkdm", |
2156 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2152 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2157 | .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT, | 2153 | .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT, |
@@ -2160,8 +2156,8 @@ static struct clk mailboxes_ick = { | |||
2160 | 2156 | ||
2161 | static struct clk wdt4_ick = { | 2157 | static struct clk wdt4_ick = { |
2162 | .name = "wdt4_ick", | 2158 | .name = "wdt4_ick", |
2159 | .ops = &clkops_omap2_dflt_wait, | ||
2163 | .parent = &l4_ck, | 2160 | .parent = &l4_ck, |
2164 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2165 | .clkdm_name = "core_l4_clkdm", | 2161 | .clkdm_name = "core_l4_clkdm", |
2166 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2162 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2167 | .enable_bit = OMAP24XX_EN_WDT4_SHIFT, | 2163 | .enable_bit = OMAP24XX_EN_WDT4_SHIFT, |
@@ -2170,8 +2166,8 @@ static struct clk wdt4_ick = { | |||
2170 | 2166 | ||
2171 | static struct clk wdt4_fck = { | 2167 | static struct clk wdt4_fck = { |
2172 | .name = "wdt4_fck", | 2168 | .name = "wdt4_fck", |
2169 | .ops = &clkops_omap2_dflt_wait, | ||
2173 | .parent = &func_32k_ck, | 2170 | .parent = &func_32k_ck, |
2174 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2175 | .clkdm_name = "core_l4_clkdm", | 2171 | .clkdm_name = "core_l4_clkdm", |
2176 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2172 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2177 | .enable_bit = OMAP24XX_EN_WDT4_SHIFT, | 2173 | .enable_bit = OMAP24XX_EN_WDT4_SHIFT, |
@@ -2180,8 +2176,8 @@ static struct clk wdt4_fck = { | |||
2180 | 2176 | ||
2181 | static struct clk wdt3_ick = { | 2177 | static struct clk wdt3_ick = { |
2182 | .name = "wdt3_ick", | 2178 | .name = "wdt3_ick", |
2179 | .ops = &clkops_omap2_dflt_wait, | ||
2183 | .parent = &l4_ck, | 2180 | .parent = &l4_ck, |
2184 | .flags = CLOCK_IN_OMAP242X, | ||
2185 | .clkdm_name = "core_l4_clkdm", | 2181 | .clkdm_name = "core_l4_clkdm", |
2186 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2182 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2187 | .enable_bit = OMAP2420_EN_WDT3_SHIFT, | 2183 | .enable_bit = OMAP2420_EN_WDT3_SHIFT, |
@@ -2190,8 +2186,8 @@ static struct clk wdt3_ick = { | |||
2190 | 2186 | ||
2191 | static struct clk wdt3_fck = { | 2187 | static struct clk wdt3_fck = { |
2192 | .name = "wdt3_fck", | 2188 | .name = "wdt3_fck", |
2189 | .ops = &clkops_omap2_dflt_wait, | ||
2193 | .parent = &func_32k_ck, | 2190 | .parent = &func_32k_ck, |
2194 | .flags = CLOCK_IN_OMAP242X, | ||
2195 | .clkdm_name = "core_l4_clkdm", | 2191 | .clkdm_name = "core_l4_clkdm", |
2196 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2192 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2197 | .enable_bit = OMAP2420_EN_WDT3_SHIFT, | 2193 | .enable_bit = OMAP2420_EN_WDT3_SHIFT, |
@@ -2200,8 +2196,8 @@ static struct clk wdt3_fck = { | |||
2200 | 2196 | ||
2201 | static struct clk mspro_ick = { | 2197 | static struct clk mspro_ick = { |
2202 | .name = "mspro_ick", | 2198 | .name = "mspro_ick", |
2199 | .ops = &clkops_omap2_dflt_wait, | ||
2203 | .parent = &l4_ck, | 2200 | .parent = &l4_ck, |
2204 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2205 | .clkdm_name = "core_l4_clkdm", | 2201 | .clkdm_name = "core_l4_clkdm", |
2206 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2202 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2207 | .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, | 2203 | .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, |
@@ -2210,8 +2206,8 @@ static struct clk mspro_ick = { | |||
2210 | 2206 | ||
2211 | static struct clk mspro_fck = { | 2207 | static struct clk mspro_fck = { |
2212 | .name = "mspro_fck", | 2208 | .name = "mspro_fck", |
2209 | .ops = &clkops_omap2_dflt_wait, | ||
2213 | .parent = &func_96m_ck, | 2210 | .parent = &func_96m_ck, |
2214 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2215 | .clkdm_name = "core_l4_clkdm", | 2211 | .clkdm_name = "core_l4_clkdm", |
2216 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2212 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2217 | .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, | 2213 | .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, |
@@ -2220,8 +2216,8 @@ static struct clk mspro_fck = { | |||
2220 | 2216 | ||
2221 | static struct clk mmc_ick = { | 2217 | static struct clk mmc_ick = { |
2222 | .name = "mmc_ick", | 2218 | .name = "mmc_ick", |
2219 | .ops = &clkops_omap2_dflt_wait, | ||
2223 | .parent = &l4_ck, | 2220 | .parent = &l4_ck, |
2224 | .flags = CLOCK_IN_OMAP242X, | ||
2225 | .clkdm_name = "core_l4_clkdm", | 2221 | .clkdm_name = "core_l4_clkdm", |
2226 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2222 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2227 | .enable_bit = OMAP2420_EN_MMC_SHIFT, | 2223 | .enable_bit = OMAP2420_EN_MMC_SHIFT, |
@@ -2230,8 +2226,8 @@ static struct clk mmc_ick = { | |||
2230 | 2226 | ||
2231 | static struct clk mmc_fck = { | 2227 | static struct clk mmc_fck = { |
2232 | .name = "mmc_fck", | 2228 | .name = "mmc_fck", |
2229 | .ops = &clkops_omap2_dflt_wait, | ||
2233 | .parent = &func_96m_ck, | 2230 | .parent = &func_96m_ck, |
2234 | .flags = CLOCK_IN_OMAP242X, | ||
2235 | .clkdm_name = "core_l4_clkdm", | 2231 | .clkdm_name = "core_l4_clkdm", |
2236 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2232 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2237 | .enable_bit = OMAP2420_EN_MMC_SHIFT, | 2233 | .enable_bit = OMAP2420_EN_MMC_SHIFT, |
@@ -2240,8 +2236,8 @@ static struct clk mmc_fck = { | |||
2240 | 2236 | ||
2241 | static struct clk fac_ick = { | 2237 | static struct clk fac_ick = { |
2242 | .name = "fac_ick", | 2238 | .name = "fac_ick", |
2239 | .ops = &clkops_omap2_dflt_wait, | ||
2243 | .parent = &l4_ck, | 2240 | .parent = &l4_ck, |
2244 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2245 | .clkdm_name = "core_l4_clkdm", | 2241 | .clkdm_name = "core_l4_clkdm", |
2246 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2242 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2247 | .enable_bit = OMAP24XX_EN_FAC_SHIFT, | 2243 | .enable_bit = OMAP24XX_EN_FAC_SHIFT, |
@@ -2250,8 +2246,8 @@ static struct clk fac_ick = { | |||
2250 | 2246 | ||
2251 | static struct clk fac_fck = { | 2247 | static struct clk fac_fck = { |
2252 | .name = "fac_fck", | 2248 | .name = "fac_fck", |
2249 | .ops = &clkops_omap2_dflt_wait, | ||
2253 | .parent = &func_12m_ck, | 2250 | .parent = &func_12m_ck, |
2254 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2255 | .clkdm_name = "core_l4_clkdm", | 2251 | .clkdm_name = "core_l4_clkdm", |
2256 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2252 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2257 | .enable_bit = OMAP24XX_EN_FAC_SHIFT, | 2253 | .enable_bit = OMAP24XX_EN_FAC_SHIFT, |
@@ -2260,8 +2256,8 @@ static struct clk fac_fck = { | |||
2260 | 2256 | ||
2261 | static struct clk eac_ick = { | 2257 | static struct clk eac_ick = { |
2262 | .name = "eac_ick", | 2258 | .name = "eac_ick", |
2259 | .ops = &clkops_omap2_dflt_wait, | ||
2263 | .parent = &l4_ck, | 2260 | .parent = &l4_ck, |
2264 | .flags = CLOCK_IN_OMAP242X, | ||
2265 | .clkdm_name = "core_l4_clkdm", | 2261 | .clkdm_name = "core_l4_clkdm", |
2266 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2262 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2267 | .enable_bit = OMAP2420_EN_EAC_SHIFT, | 2263 | .enable_bit = OMAP2420_EN_EAC_SHIFT, |
@@ -2270,8 +2266,8 @@ static struct clk eac_ick = { | |||
2270 | 2266 | ||
2271 | static struct clk eac_fck = { | 2267 | static struct clk eac_fck = { |
2272 | .name = "eac_fck", | 2268 | .name = "eac_fck", |
2269 | .ops = &clkops_omap2_dflt_wait, | ||
2273 | .parent = &func_96m_ck, | 2270 | .parent = &func_96m_ck, |
2274 | .flags = CLOCK_IN_OMAP242X, | ||
2275 | .clkdm_name = "core_l4_clkdm", | 2271 | .clkdm_name = "core_l4_clkdm", |
2276 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2272 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2277 | .enable_bit = OMAP2420_EN_EAC_SHIFT, | 2273 | .enable_bit = OMAP2420_EN_EAC_SHIFT, |
@@ -2280,8 +2276,8 @@ static struct clk eac_fck = { | |||
2280 | 2276 | ||
2281 | static struct clk hdq_ick = { | 2277 | static struct clk hdq_ick = { |
2282 | .name = "hdq_ick", | 2278 | .name = "hdq_ick", |
2279 | .ops = &clkops_omap2_dflt_wait, | ||
2283 | .parent = &l4_ck, | 2280 | .parent = &l4_ck, |
2284 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2285 | .clkdm_name = "core_l4_clkdm", | 2281 | .clkdm_name = "core_l4_clkdm", |
2286 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2282 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2287 | .enable_bit = OMAP24XX_EN_HDQ_SHIFT, | 2283 | .enable_bit = OMAP24XX_EN_HDQ_SHIFT, |
@@ -2290,8 +2286,8 @@ static struct clk hdq_ick = { | |||
2290 | 2286 | ||
2291 | static struct clk hdq_fck = { | 2287 | static struct clk hdq_fck = { |
2292 | .name = "hdq_fck", | 2288 | .name = "hdq_fck", |
2289 | .ops = &clkops_omap2_dflt_wait, | ||
2293 | .parent = &func_12m_ck, | 2290 | .parent = &func_12m_ck, |
2294 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2295 | .clkdm_name = "core_l4_clkdm", | 2291 | .clkdm_name = "core_l4_clkdm", |
2296 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2292 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2297 | .enable_bit = OMAP24XX_EN_HDQ_SHIFT, | 2293 | .enable_bit = OMAP24XX_EN_HDQ_SHIFT, |
@@ -2300,9 +2296,9 @@ static struct clk hdq_fck = { | |||
2300 | 2296 | ||
2301 | static struct clk i2c2_ick = { | 2297 | static struct clk i2c2_ick = { |
2302 | .name = "i2c_ick", | 2298 | .name = "i2c_ick", |
2299 | .ops = &clkops_omap2_dflt_wait, | ||
2303 | .id = 2, | 2300 | .id = 2, |
2304 | .parent = &l4_ck, | 2301 | .parent = &l4_ck, |
2305 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2306 | .clkdm_name = "core_l4_clkdm", | 2302 | .clkdm_name = "core_l4_clkdm", |
2307 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2303 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2308 | .enable_bit = OMAP2420_EN_I2C2_SHIFT, | 2304 | .enable_bit = OMAP2420_EN_I2C2_SHIFT, |
@@ -2311,9 +2307,9 @@ static struct clk i2c2_ick = { | |||
2311 | 2307 | ||
2312 | static struct clk i2c2_fck = { | 2308 | static struct clk i2c2_fck = { |
2313 | .name = "i2c_fck", | 2309 | .name = "i2c_fck", |
2310 | .ops = &clkops_omap2_dflt_wait, | ||
2314 | .id = 2, | 2311 | .id = 2, |
2315 | .parent = &func_12m_ck, | 2312 | .parent = &func_12m_ck, |
2316 | .flags = CLOCK_IN_OMAP242X, | ||
2317 | .clkdm_name = "core_l4_clkdm", | 2313 | .clkdm_name = "core_l4_clkdm", |
2318 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2314 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2319 | .enable_bit = OMAP2420_EN_I2C2_SHIFT, | 2315 | .enable_bit = OMAP2420_EN_I2C2_SHIFT, |
@@ -2322,9 +2318,9 @@ static struct clk i2c2_fck = { | |||
2322 | 2318 | ||
2323 | static struct clk i2chs2_fck = { | 2319 | static struct clk i2chs2_fck = { |
2324 | .name = "i2c_fck", | 2320 | .name = "i2c_fck", |
2321 | .ops = &clkops_omap2_dflt_wait, | ||
2325 | .id = 2, | 2322 | .id = 2, |
2326 | .parent = &func_96m_ck, | 2323 | .parent = &func_96m_ck, |
2327 | .flags = CLOCK_IN_OMAP243X, | ||
2328 | .clkdm_name = "core_l4_clkdm", | 2324 | .clkdm_name = "core_l4_clkdm", |
2329 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 2325 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
2330 | .enable_bit = OMAP2430_EN_I2CHS2_SHIFT, | 2326 | .enable_bit = OMAP2430_EN_I2CHS2_SHIFT, |
@@ -2333,9 +2329,9 @@ static struct clk i2chs2_fck = { | |||
2333 | 2329 | ||
2334 | static struct clk i2c1_ick = { | 2330 | static struct clk i2c1_ick = { |
2335 | .name = "i2c_ick", | 2331 | .name = "i2c_ick", |
2332 | .ops = &clkops_omap2_dflt_wait, | ||
2336 | .id = 1, | 2333 | .id = 1, |
2337 | .parent = &l4_ck, | 2334 | .parent = &l4_ck, |
2338 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2339 | .clkdm_name = "core_l4_clkdm", | 2335 | .clkdm_name = "core_l4_clkdm", |
2340 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2336 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2341 | .enable_bit = OMAP2420_EN_I2C1_SHIFT, | 2337 | .enable_bit = OMAP2420_EN_I2C1_SHIFT, |
@@ -2344,9 +2340,9 @@ static struct clk i2c1_ick = { | |||
2344 | 2340 | ||
2345 | static struct clk i2c1_fck = { | 2341 | static struct clk i2c1_fck = { |
2346 | .name = "i2c_fck", | 2342 | .name = "i2c_fck", |
2343 | .ops = &clkops_omap2_dflt_wait, | ||
2347 | .id = 1, | 2344 | .id = 1, |
2348 | .parent = &func_12m_ck, | 2345 | .parent = &func_12m_ck, |
2349 | .flags = CLOCK_IN_OMAP242X, | ||
2350 | .clkdm_name = "core_l4_clkdm", | 2346 | .clkdm_name = "core_l4_clkdm", |
2351 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2347 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2352 | .enable_bit = OMAP2420_EN_I2C1_SHIFT, | 2348 | .enable_bit = OMAP2420_EN_I2C1_SHIFT, |
@@ -2355,9 +2351,9 @@ static struct clk i2c1_fck = { | |||
2355 | 2351 | ||
2356 | static struct clk i2chs1_fck = { | 2352 | static struct clk i2chs1_fck = { |
2357 | .name = "i2c_fck", | 2353 | .name = "i2c_fck", |
2354 | .ops = &clkops_omap2_dflt_wait, | ||
2358 | .id = 1, | 2355 | .id = 1, |
2359 | .parent = &func_96m_ck, | 2356 | .parent = &func_96m_ck, |
2360 | .flags = CLOCK_IN_OMAP243X, | ||
2361 | .clkdm_name = "core_l4_clkdm", | 2357 | .clkdm_name = "core_l4_clkdm", |
2362 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 2358 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
2363 | .enable_bit = OMAP2430_EN_I2CHS1_SHIFT, | 2359 | .enable_bit = OMAP2430_EN_I2CHS1_SHIFT, |
@@ -2366,33 +2362,33 @@ static struct clk i2chs1_fck = { | |||
2366 | 2362 | ||
2367 | static struct clk gpmc_fck = { | 2363 | static struct clk gpmc_fck = { |
2368 | .name = "gpmc_fck", | 2364 | .name = "gpmc_fck", |
2365 | .ops = &clkops_null, /* RMK: missing? */ | ||
2369 | .parent = &core_l3_ck, | 2366 | .parent = &core_l3_ck, |
2370 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 2367 | .flags = ENABLE_ON_INIT, |
2371 | ENABLE_ON_INIT, | ||
2372 | .clkdm_name = "core_l3_clkdm", | 2368 | .clkdm_name = "core_l3_clkdm", |
2373 | .recalc = &followparent_recalc, | 2369 | .recalc = &followparent_recalc, |
2374 | }; | 2370 | }; |
2375 | 2371 | ||
2376 | static struct clk sdma_fck = { | 2372 | static struct clk sdma_fck = { |
2377 | .name = "sdma_fck", | 2373 | .name = "sdma_fck", |
2374 | .ops = &clkops_null, /* RMK: missing? */ | ||
2378 | .parent = &core_l3_ck, | 2375 | .parent = &core_l3_ck, |
2379 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2380 | .clkdm_name = "core_l3_clkdm", | 2376 | .clkdm_name = "core_l3_clkdm", |
2381 | .recalc = &followparent_recalc, | 2377 | .recalc = &followparent_recalc, |
2382 | }; | 2378 | }; |
2383 | 2379 | ||
2384 | static struct clk sdma_ick = { | 2380 | static struct clk sdma_ick = { |
2385 | .name = "sdma_ick", | 2381 | .name = "sdma_ick", |
2382 | .ops = &clkops_null, /* RMK: missing? */ | ||
2386 | .parent = &l4_ck, | 2383 | .parent = &l4_ck, |
2387 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, | ||
2388 | .clkdm_name = "core_l3_clkdm", | 2384 | .clkdm_name = "core_l3_clkdm", |
2389 | .recalc = &followparent_recalc, | 2385 | .recalc = &followparent_recalc, |
2390 | }; | 2386 | }; |
2391 | 2387 | ||
2392 | static struct clk vlynq_ick = { | 2388 | static struct clk vlynq_ick = { |
2393 | .name = "vlynq_ick", | 2389 | .name = "vlynq_ick", |
2390 | .ops = &clkops_omap2_dflt_wait, | ||
2394 | .parent = &core_l3_ck, | 2391 | .parent = &core_l3_ck, |
2395 | .flags = CLOCK_IN_OMAP242X, | ||
2396 | .clkdm_name = "core_l3_clkdm", | 2392 | .clkdm_name = "core_l3_clkdm", |
2397 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2393 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2398 | .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, | 2394 | .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, |
@@ -2426,8 +2422,9 @@ static const struct clksel vlynq_fck_clksel[] = { | |||
2426 | 2422 | ||
2427 | static struct clk vlynq_fck = { | 2423 | static struct clk vlynq_fck = { |
2428 | .name = "vlynq_fck", | 2424 | .name = "vlynq_fck", |
2425 | .ops = &clkops_omap2_dflt_wait, | ||
2429 | .parent = &func_96m_ck, | 2426 | .parent = &func_96m_ck, |
2430 | .flags = CLOCK_IN_OMAP242X | DELAYED_APP, | 2427 | .flags = DELAYED_APP, |
2431 | .clkdm_name = "core_l3_clkdm", | 2428 | .clkdm_name = "core_l3_clkdm", |
2432 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 2429 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
2433 | .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, | 2430 | .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, |
@@ -2442,8 +2439,9 @@ static struct clk vlynq_fck = { | |||
2442 | 2439 | ||
2443 | static struct clk sdrc_ick = { | 2440 | static struct clk sdrc_ick = { |
2444 | .name = "sdrc_ick", | 2441 | .name = "sdrc_ick", |
2442 | .ops = &clkops_omap2_dflt_wait, | ||
2445 | .parent = &l4_ck, | 2443 | .parent = &l4_ck, |
2446 | .flags = CLOCK_IN_OMAP243X | ENABLE_ON_INIT, | 2444 | .flags = ENABLE_ON_INIT, |
2447 | .clkdm_name = "core_l4_clkdm", | 2445 | .clkdm_name = "core_l4_clkdm", |
2448 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | 2446 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), |
2449 | .enable_bit = OMAP2430_EN_SDRC_SHIFT, | 2447 | .enable_bit = OMAP2430_EN_SDRC_SHIFT, |
@@ -2452,8 +2450,8 @@ static struct clk sdrc_ick = { | |||
2452 | 2450 | ||
2453 | static struct clk des_ick = { | 2451 | static struct clk des_ick = { |
2454 | .name = "des_ick", | 2452 | .name = "des_ick", |
2453 | .ops = &clkops_omap2_dflt_wait, | ||
2455 | .parent = &l4_ck, | 2454 | .parent = &l4_ck, |
2456 | .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, | ||
2457 | .clkdm_name = "core_l4_clkdm", | 2455 | .clkdm_name = "core_l4_clkdm", |
2458 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 2456 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
2459 | .enable_bit = OMAP24XX_EN_DES_SHIFT, | 2457 | .enable_bit = OMAP24XX_EN_DES_SHIFT, |
@@ -2462,8 +2460,8 @@ static struct clk des_ick = { | |||
2462 | 2460 | ||
2463 | static struct clk sha_ick = { | 2461 | static struct clk sha_ick = { |
2464 | .name = "sha_ick", | 2462 | .name = "sha_ick", |
2463 | .ops = &clkops_omap2_dflt_wait, | ||
2465 | .parent = &l4_ck, | 2464 | .parent = &l4_ck, |
2466 | .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, | ||
2467 | .clkdm_name = "core_l4_clkdm", | 2465 | .clkdm_name = "core_l4_clkdm", |
2468 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 2466 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
2469 | .enable_bit = OMAP24XX_EN_SHA_SHIFT, | 2467 | .enable_bit = OMAP24XX_EN_SHA_SHIFT, |
@@ -2472,8 +2470,8 @@ static struct clk sha_ick = { | |||
2472 | 2470 | ||
2473 | static struct clk rng_ick = { | 2471 | static struct clk rng_ick = { |
2474 | .name = "rng_ick", | 2472 | .name = "rng_ick", |
2473 | .ops = &clkops_omap2_dflt_wait, | ||
2475 | .parent = &l4_ck, | 2474 | .parent = &l4_ck, |
2476 | .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, | ||
2477 | .clkdm_name = "core_l4_clkdm", | 2475 | .clkdm_name = "core_l4_clkdm", |
2478 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 2476 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
2479 | .enable_bit = OMAP24XX_EN_RNG_SHIFT, | 2477 | .enable_bit = OMAP24XX_EN_RNG_SHIFT, |
@@ -2482,8 +2480,8 @@ static struct clk rng_ick = { | |||
2482 | 2480 | ||
2483 | static struct clk aes_ick = { | 2481 | static struct clk aes_ick = { |
2484 | .name = "aes_ick", | 2482 | .name = "aes_ick", |
2483 | .ops = &clkops_omap2_dflt_wait, | ||
2485 | .parent = &l4_ck, | 2484 | .parent = &l4_ck, |
2486 | .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, | ||
2487 | .clkdm_name = "core_l4_clkdm", | 2485 | .clkdm_name = "core_l4_clkdm", |
2488 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 2486 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
2489 | .enable_bit = OMAP24XX_EN_AES_SHIFT, | 2487 | .enable_bit = OMAP24XX_EN_AES_SHIFT, |
@@ -2492,8 +2490,8 @@ static struct clk aes_ick = { | |||
2492 | 2490 | ||
2493 | static struct clk pka_ick = { | 2491 | static struct clk pka_ick = { |
2494 | .name = "pka_ick", | 2492 | .name = "pka_ick", |
2493 | .ops = &clkops_omap2_dflt_wait, | ||
2495 | .parent = &l4_ck, | 2494 | .parent = &l4_ck, |
2496 | .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, | ||
2497 | .clkdm_name = "core_l4_clkdm", | 2495 | .clkdm_name = "core_l4_clkdm", |
2498 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 2496 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
2499 | .enable_bit = OMAP24XX_EN_PKA_SHIFT, | 2497 | .enable_bit = OMAP24XX_EN_PKA_SHIFT, |
@@ -2502,8 +2500,8 @@ static struct clk pka_ick = { | |||
2502 | 2500 | ||
2503 | static struct clk usb_fck = { | 2501 | static struct clk usb_fck = { |
2504 | .name = "usb_fck", | 2502 | .name = "usb_fck", |
2503 | .ops = &clkops_omap2_dflt_wait, | ||
2505 | .parent = &func_48m_ck, | 2504 | .parent = &func_48m_ck, |
2506 | .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X, | ||
2507 | .clkdm_name = "core_l3_clkdm", | 2505 | .clkdm_name = "core_l3_clkdm", |
2508 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 2506 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
2509 | .enable_bit = OMAP24XX_EN_USB_SHIFT, | 2507 | .enable_bit = OMAP24XX_EN_USB_SHIFT, |
@@ -2512,8 +2510,8 @@ static struct clk usb_fck = { | |||
2512 | 2510 | ||
2513 | static struct clk usbhs_ick = { | 2511 | static struct clk usbhs_ick = { |
2514 | .name = "usbhs_ick", | 2512 | .name = "usbhs_ick", |
2513 | .ops = &clkops_omap2_dflt_wait, | ||
2515 | .parent = &core_l3_ck, | 2514 | .parent = &core_l3_ck, |
2516 | .flags = CLOCK_IN_OMAP243X, | ||
2517 | .clkdm_name = "core_l3_clkdm", | 2515 | .clkdm_name = "core_l3_clkdm", |
2518 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2516 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2519 | .enable_bit = OMAP2430_EN_USBHS_SHIFT, | 2517 | .enable_bit = OMAP2430_EN_USBHS_SHIFT, |
@@ -2522,8 +2520,8 @@ static struct clk usbhs_ick = { | |||
2522 | 2520 | ||
2523 | static struct clk mmchs1_ick = { | 2521 | static struct clk mmchs1_ick = { |
2524 | .name = "mmchs_ick", | 2522 | .name = "mmchs_ick", |
2523 | .ops = &clkops_omap2_dflt_wait, | ||
2525 | .parent = &l4_ck, | 2524 | .parent = &l4_ck, |
2526 | .flags = CLOCK_IN_OMAP243X, | ||
2527 | .clkdm_name = "core_l4_clkdm", | 2525 | .clkdm_name = "core_l4_clkdm", |
2528 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2526 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2529 | .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, | 2527 | .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, |
@@ -2532,8 +2530,8 @@ static struct clk mmchs1_ick = { | |||
2532 | 2530 | ||
2533 | static struct clk mmchs1_fck = { | 2531 | static struct clk mmchs1_fck = { |
2534 | .name = "mmchs_fck", | 2532 | .name = "mmchs_fck", |
2533 | .ops = &clkops_omap2_dflt_wait, | ||
2535 | .parent = &func_96m_ck, | 2534 | .parent = &func_96m_ck, |
2536 | .flags = CLOCK_IN_OMAP243X, | ||
2537 | .clkdm_name = "core_l3_clkdm", | 2535 | .clkdm_name = "core_l3_clkdm", |
2538 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 2536 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
2539 | .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, | 2537 | .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, |
@@ -2542,9 +2540,9 @@ static struct clk mmchs1_fck = { | |||
2542 | 2540 | ||
2543 | static struct clk mmchs2_ick = { | 2541 | static struct clk mmchs2_ick = { |
2544 | .name = "mmchs_ick", | 2542 | .name = "mmchs_ick", |
2543 | .ops = &clkops_omap2_dflt_wait, | ||
2545 | .id = 1, | 2544 | .id = 1, |
2546 | .parent = &l4_ck, | 2545 | .parent = &l4_ck, |
2547 | .flags = CLOCK_IN_OMAP243X, | ||
2548 | .clkdm_name = "core_l4_clkdm", | 2546 | .clkdm_name = "core_l4_clkdm", |
2549 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2547 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2550 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, | 2548 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, |
@@ -2553,9 +2551,9 @@ static struct clk mmchs2_ick = { | |||
2553 | 2551 | ||
2554 | static struct clk mmchs2_fck = { | 2552 | static struct clk mmchs2_fck = { |
2555 | .name = "mmchs_fck", | 2553 | .name = "mmchs_fck", |
2554 | .ops = &clkops_omap2_dflt_wait, | ||
2556 | .id = 1, | 2555 | .id = 1, |
2557 | .parent = &func_96m_ck, | 2556 | .parent = &func_96m_ck, |
2558 | .flags = CLOCK_IN_OMAP243X, | ||
2559 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 2557 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
2560 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, | 2558 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, |
2561 | .recalc = &followparent_recalc, | 2559 | .recalc = &followparent_recalc, |
@@ -2563,8 +2561,8 @@ static struct clk mmchs2_fck = { | |||
2563 | 2561 | ||
2564 | static struct clk gpio5_ick = { | 2562 | static struct clk gpio5_ick = { |
2565 | .name = "gpio5_ick", | 2563 | .name = "gpio5_ick", |
2564 | .ops = &clkops_omap2_dflt_wait, | ||
2566 | .parent = &l4_ck, | 2565 | .parent = &l4_ck, |
2567 | .flags = CLOCK_IN_OMAP243X, | ||
2568 | .clkdm_name = "core_l4_clkdm", | 2566 | .clkdm_name = "core_l4_clkdm", |
2569 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2567 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2570 | .enable_bit = OMAP2430_EN_GPIO5_SHIFT, | 2568 | .enable_bit = OMAP2430_EN_GPIO5_SHIFT, |
@@ -2573,8 +2571,8 @@ static struct clk gpio5_ick = { | |||
2573 | 2571 | ||
2574 | static struct clk gpio5_fck = { | 2572 | static struct clk gpio5_fck = { |
2575 | .name = "gpio5_fck", | 2573 | .name = "gpio5_fck", |
2574 | .ops = &clkops_omap2_dflt_wait, | ||
2576 | .parent = &func_32k_ck, | 2575 | .parent = &func_32k_ck, |
2577 | .flags = CLOCK_IN_OMAP243X, | ||
2578 | .clkdm_name = "core_l4_clkdm", | 2576 | .clkdm_name = "core_l4_clkdm", |
2579 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 2577 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
2580 | .enable_bit = OMAP2430_EN_GPIO5_SHIFT, | 2578 | .enable_bit = OMAP2430_EN_GPIO5_SHIFT, |
@@ -2583,8 +2581,8 @@ static struct clk gpio5_fck = { | |||
2583 | 2581 | ||
2584 | static struct clk mdm_intc_ick = { | 2582 | static struct clk mdm_intc_ick = { |
2585 | .name = "mdm_intc_ick", | 2583 | .name = "mdm_intc_ick", |
2584 | .ops = &clkops_omap2_dflt_wait, | ||
2586 | .parent = &l4_ck, | 2585 | .parent = &l4_ck, |
2587 | .flags = CLOCK_IN_OMAP243X, | ||
2588 | .clkdm_name = "core_l4_clkdm", | 2586 | .clkdm_name = "core_l4_clkdm", |
2589 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2587 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2590 | .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT, | 2588 | .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT, |
@@ -2593,8 +2591,8 @@ static struct clk mdm_intc_ick = { | |||
2593 | 2591 | ||
2594 | static struct clk mmchsdb1_fck = { | 2592 | static struct clk mmchsdb1_fck = { |
2595 | .name = "mmchsdb_fck", | 2593 | .name = "mmchsdb_fck", |
2594 | .ops = &clkops_omap2_dflt_wait, | ||
2596 | .parent = &func_32k_ck, | 2595 | .parent = &func_32k_ck, |
2597 | .flags = CLOCK_IN_OMAP243X, | ||
2598 | .clkdm_name = "core_l4_clkdm", | 2596 | .clkdm_name = "core_l4_clkdm", |
2599 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 2597 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
2600 | .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT, | 2598 | .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT, |
@@ -2603,9 +2601,9 @@ static struct clk mmchsdb1_fck = { | |||
2603 | 2601 | ||
2604 | static struct clk mmchsdb2_fck = { | 2602 | static struct clk mmchsdb2_fck = { |
2605 | .name = "mmchsdb_fck", | 2603 | .name = "mmchsdb_fck", |
2604 | .ops = &clkops_omap2_dflt_wait, | ||
2606 | .id = 1, | 2605 | .id = 1, |
2607 | .parent = &func_32k_ck, | 2606 | .parent = &func_32k_ck, |
2608 | .flags = CLOCK_IN_OMAP243X, | ||
2609 | .clkdm_name = "core_l4_clkdm", | 2607 | .clkdm_name = "core_l4_clkdm", |
2610 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 2608 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
2611 | .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT, | 2609 | .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT, |
@@ -2628,166 +2626,13 @@ static struct clk mmchsdb2_fck = { | |||
2628 | */ | 2626 | */ |
2629 | static struct clk virt_prcm_set = { | 2627 | static struct clk virt_prcm_set = { |
2630 | .name = "virt_prcm_set", | 2628 | .name = "virt_prcm_set", |
2631 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 2629 | .ops = &clkops_null, |
2632 | VIRTUAL_CLOCK | ALWAYS_ENABLED | DELAYED_APP, | 2630 | .flags = DELAYED_APP, |
2633 | .parent = &mpu_ck, /* Indexed by mpu speed, no parent */ | 2631 | .parent = &mpu_ck, /* Indexed by mpu speed, no parent */ |
2634 | .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */ | 2632 | .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */ |
2635 | .set_rate = &omap2_select_table_rate, | 2633 | .set_rate = &omap2_select_table_rate, |
2636 | .round_rate = &omap2_round_to_table_rate, | 2634 | .round_rate = &omap2_round_to_table_rate, |
2637 | }; | 2635 | }; |
2638 | 2636 | ||
2639 | static struct clk *onchip_24xx_clks[] __initdata = { | ||
2640 | /* external root sources */ | ||
2641 | &func_32k_ck, | ||
2642 | &osc_ck, | ||
2643 | &sys_ck, | ||
2644 | &alt_ck, | ||
2645 | /* internal analog sources */ | ||
2646 | &dpll_ck, | ||
2647 | &apll96_ck, | ||
2648 | &apll54_ck, | ||
2649 | /* internal prcm root sources */ | ||
2650 | &func_54m_ck, | ||
2651 | &core_ck, | ||
2652 | &func_96m_ck, | ||
2653 | &func_48m_ck, | ||
2654 | &func_12m_ck, | ||
2655 | &wdt1_osc_ck, | ||
2656 | &sys_clkout_src, | ||
2657 | &sys_clkout, | ||
2658 | &sys_clkout2_src, | ||
2659 | &sys_clkout2, | ||
2660 | &emul_ck, | ||
2661 | /* mpu domain clocks */ | ||
2662 | &mpu_ck, | ||
2663 | /* dsp domain clocks */ | ||
2664 | &dsp_fck, | ||
2665 | &dsp_irate_ick, | ||
2666 | &dsp_ick, /* 242x */ | ||
2667 | &iva2_1_ick, /* 243x */ | ||
2668 | &iva1_ifck, /* 242x */ | ||
2669 | &iva1_mpu_int_ifck, /* 242x */ | ||
2670 | /* GFX domain clocks */ | ||
2671 | &gfx_3d_fck, | ||
2672 | &gfx_2d_fck, | ||
2673 | &gfx_ick, | ||
2674 | /* Modem domain clocks */ | ||
2675 | &mdm_ick, | ||
2676 | &mdm_osc_ck, | ||
2677 | /* DSS domain clocks */ | ||
2678 | &dss_ick, | ||
2679 | &dss1_fck, | ||
2680 | &dss2_fck, | ||
2681 | &dss_54m_fck, | ||
2682 | /* L3 domain clocks */ | ||
2683 | &core_l3_ck, | ||
2684 | &ssi_ssr_sst_fck, | ||
2685 | &usb_l4_ick, | ||
2686 | /* L4 domain clocks */ | ||
2687 | &l4_ck, /* used as both core_l4 and wu_l4 */ | ||
2688 | /* virtual meta-group clock */ | ||
2689 | &virt_prcm_set, | ||
2690 | /* general l4 interface ck, multi-parent functional clk */ | ||
2691 | &gpt1_ick, | ||
2692 | &gpt1_fck, | ||
2693 | &gpt2_ick, | ||
2694 | &gpt2_fck, | ||
2695 | &gpt3_ick, | ||
2696 | &gpt3_fck, | ||
2697 | &gpt4_ick, | ||
2698 | &gpt4_fck, | ||
2699 | &gpt5_ick, | ||
2700 | &gpt5_fck, | ||
2701 | &gpt6_ick, | ||
2702 | &gpt6_fck, | ||
2703 | &gpt7_ick, | ||
2704 | &gpt7_fck, | ||
2705 | &gpt8_ick, | ||
2706 | &gpt8_fck, | ||
2707 | &gpt9_ick, | ||
2708 | &gpt9_fck, | ||
2709 | &gpt10_ick, | ||
2710 | &gpt10_fck, | ||
2711 | &gpt11_ick, | ||
2712 | &gpt11_fck, | ||
2713 | &gpt12_ick, | ||
2714 | &gpt12_fck, | ||
2715 | &mcbsp1_ick, | ||
2716 | &mcbsp1_fck, | ||
2717 | &mcbsp2_ick, | ||
2718 | &mcbsp2_fck, | ||
2719 | &mcbsp3_ick, | ||
2720 | &mcbsp3_fck, | ||
2721 | &mcbsp4_ick, | ||
2722 | &mcbsp4_fck, | ||
2723 | &mcbsp5_ick, | ||
2724 | &mcbsp5_fck, | ||
2725 | &mcspi1_ick, | ||
2726 | &mcspi1_fck, | ||
2727 | &mcspi2_ick, | ||
2728 | &mcspi2_fck, | ||
2729 | &mcspi3_ick, | ||
2730 | &mcspi3_fck, | ||
2731 | &uart1_ick, | ||
2732 | &uart1_fck, | ||
2733 | &uart2_ick, | ||
2734 | &uart2_fck, | ||
2735 | &uart3_ick, | ||
2736 | &uart3_fck, | ||
2737 | &gpios_ick, | ||
2738 | &gpios_fck, | ||
2739 | &mpu_wdt_ick, | ||
2740 | &mpu_wdt_fck, | ||
2741 | &sync_32k_ick, | ||
2742 | &wdt1_ick, | ||
2743 | &omapctrl_ick, | ||
2744 | &icr_ick, | ||
2745 | &cam_fck, | ||
2746 | &cam_ick, | ||
2747 | &mailboxes_ick, | ||
2748 | &wdt4_ick, | ||
2749 | &wdt4_fck, | ||
2750 | &wdt3_ick, | ||
2751 | &wdt3_fck, | ||
2752 | &mspro_ick, | ||
2753 | &mspro_fck, | ||
2754 | &mmc_ick, | ||
2755 | &mmc_fck, | ||
2756 | &fac_ick, | ||
2757 | &fac_fck, | ||
2758 | &eac_ick, | ||
2759 | &eac_fck, | ||
2760 | &hdq_ick, | ||
2761 | &hdq_fck, | ||
2762 | &i2c1_ick, | ||
2763 | &i2c1_fck, | ||
2764 | &i2chs1_fck, | ||
2765 | &i2c2_ick, | ||
2766 | &i2c2_fck, | ||
2767 | &i2chs2_fck, | ||
2768 | &gpmc_fck, | ||
2769 | &sdma_fck, | ||
2770 | &sdma_ick, | ||
2771 | &vlynq_ick, | ||
2772 | &vlynq_fck, | ||
2773 | &sdrc_ick, | ||
2774 | &des_ick, | ||
2775 | &sha_ick, | ||
2776 | &rng_ick, | ||
2777 | &aes_ick, | ||
2778 | &pka_ick, | ||
2779 | &usb_fck, | ||
2780 | &usbhs_ick, | ||
2781 | &mmchs1_ick, | ||
2782 | &mmchs1_fck, | ||
2783 | &mmchs2_ick, | ||
2784 | &mmchs2_fck, | ||
2785 | &gpio5_ick, | ||
2786 | &gpio5_fck, | ||
2787 | &mdm_intc_ick, | ||
2788 | &mmchsdb1_fck, | ||
2789 | &mmchsdb2_fck, | ||
2790 | }; | ||
2791 | |||
2792 | #endif | 2637 | #endif |
2793 | 2638 | ||
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c index 31bb7010bd48..0a14dca31e30 100644 --- a/arch/arm/mach-omap2/clock34xx.c +++ b/arch/arm/mach-omap2/clock34xx.c | |||
@@ -30,15 +30,251 @@ | |||
30 | #include <mach/clock.h> | 30 | #include <mach/clock.h> |
31 | #include <mach/sram.h> | 31 | #include <mach/sram.h> |
32 | #include <asm/div64.h> | 32 | #include <asm/div64.h> |
33 | #include <asm/clkdev.h> | ||
33 | 34 | ||
34 | #include "memory.h" | 35 | #include <mach/sdrc.h> |
35 | #include "clock.h" | 36 | #include "clock.h" |
36 | #include "clock34xx.h" | ||
37 | #include "prm.h" | 37 | #include "prm.h" |
38 | #include "prm-regbits-34xx.h" | 38 | #include "prm-regbits-34xx.h" |
39 | #include "cm.h" | 39 | #include "cm.h" |
40 | #include "cm-regbits-34xx.h" | 40 | #include "cm-regbits-34xx.h" |
41 | 41 | ||
42 | static const struct clkops clkops_noncore_dpll_ops; | ||
43 | |||
44 | #include "clock34xx.h" | ||
45 | |||
46 | struct omap_clk { | ||
47 | u32 cpu; | ||
48 | struct clk_lookup lk; | ||
49 | }; | ||
50 | |||
51 | #define CLK(dev, con, ck, cp) \ | ||
52 | { \ | ||
53 | .cpu = cp, \ | ||
54 | .lk = { \ | ||
55 | .dev_id = dev, \ | ||
56 | .con_id = con, \ | ||
57 | .clk = ck, \ | ||
58 | }, \ | ||
59 | } | ||
60 | |||
61 | #define CK_343X (1 << 0) | ||
62 | #define CK_3430ES1 (1 << 1) | ||
63 | #define CK_3430ES2 (1 << 2) | ||
64 | |||
65 | static struct omap_clk omap34xx_clks[] = { | ||
66 | CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_343X), | ||
67 | CLK(NULL, "virt_12m_ck", &virt_12m_ck, CK_343X), | ||
68 | CLK(NULL, "virt_13m_ck", &virt_13m_ck, CK_343X), | ||
69 | CLK(NULL, "virt_16_8m_ck", &virt_16_8m_ck, CK_3430ES2), | ||
70 | CLK(NULL, "virt_19_2m_ck", &virt_19_2m_ck, CK_343X), | ||
71 | CLK(NULL, "virt_26m_ck", &virt_26m_ck, CK_343X), | ||
72 | CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_343X), | ||
73 | CLK(NULL, "osc_sys_ck", &osc_sys_ck, CK_343X), | ||
74 | CLK(NULL, "sys_ck", &sys_ck, CK_343X), | ||
75 | CLK(NULL, "sys_altclk", &sys_altclk, CK_343X), | ||
76 | CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_343X), | ||
77 | CLK(NULL, "sys_clkout1", &sys_clkout1, CK_343X), | ||
78 | CLK(NULL, "dpll1_ck", &dpll1_ck, CK_343X), | ||
79 | CLK(NULL, "dpll1_x2_ck", &dpll1_x2_ck, CK_343X), | ||
80 | CLK(NULL, "dpll1_x2m2_ck", &dpll1_x2m2_ck, CK_343X), | ||
81 | CLK(NULL, "dpll2_ck", &dpll2_ck, CK_343X), | ||
82 | CLK(NULL, "dpll2_m2_ck", &dpll2_m2_ck, CK_343X), | ||
83 | CLK(NULL, "dpll3_ck", &dpll3_ck, CK_343X), | ||
84 | CLK(NULL, "core_ck", &core_ck, CK_343X), | ||
85 | CLK(NULL, "dpll3_x2_ck", &dpll3_x2_ck, CK_343X), | ||
86 | CLK(NULL, "dpll3_m2_ck", &dpll3_m2_ck, CK_343X), | ||
87 | CLK(NULL, "dpll3_m2x2_ck", &dpll3_m2x2_ck, CK_343X), | ||
88 | CLK(NULL, "dpll3_m3_ck", &dpll3_m3_ck, CK_343X), | ||
89 | CLK(NULL, "dpll3_m3x2_ck", &dpll3_m3x2_ck, CK_343X), | ||
90 | CLK(NULL, "emu_core_alwon_ck", &emu_core_alwon_ck, CK_343X), | ||
91 | CLK(NULL, "dpll4_ck", &dpll4_ck, CK_343X), | ||
92 | CLK(NULL, "dpll4_x2_ck", &dpll4_x2_ck, CK_343X), | ||
93 | CLK(NULL, "omap_96m_alwon_fck", &omap_96m_alwon_fck, CK_343X), | ||
94 | CLK(NULL, "omap_96m_fck", &omap_96m_fck, CK_343X), | ||
95 | CLK(NULL, "cm_96m_fck", &cm_96m_fck, CK_343X), | ||
96 | CLK(NULL, "omap_54m_fck", &omap_54m_fck, CK_343X), | ||
97 | CLK(NULL, "omap_48m_fck", &omap_48m_fck, CK_343X), | ||
98 | CLK(NULL, "omap_12m_fck", &omap_12m_fck, CK_343X), | ||
99 | CLK(NULL, "dpll4_m2_ck", &dpll4_m2_ck, CK_343X), | ||
100 | CLK(NULL, "dpll4_m2x2_ck", &dpll4_m2x2_ck, CK_343X), | ||
101 | CLK(NULL, "dpll4_m3_ck", &dpll4_m3_ck, CK_343X), | ||
102 | CLK(NULL, "dpll4_m3x2_ck", &dpll4_m3x2_ck, CK_343X), | ||
103 | CLK(NULL, "dpll4_m4_ck", &dpll4_m4_ck, CK_343X), | ||
104 | CLK(NULL, "dpll4_m4x2_ck", &dpll4_m4x2_ck, CK_343X), | ||
105 | CLK(NULL, "dpll4_m5_ck", &dpll4_m5_ck, CK_343X), | ||
106 | CLK(NULL, "dpll4_m5x2_ck", &dpll4_m5x2_ck, CK_343X), | ||
107 | CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_343X), | ||
108 | CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_343X), | ||
109 | CLK(NULL, "emu_per_alwon_ck", &emu_per_alwon_ck, CK_343X), | ||
110 | CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2), | ||
111 | CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2), | ||
112 | CLK(NULL, "clkout2_src_ck", &clkout2_src_ck, CK_343X), | ||
113 | CLK(NULL, "sys_clkout2", &sys_clkout2, CK_343X), | ||
114 | CLK(NULL, "corex2_fck", &corex2_fck, CK_343X), | ||
115 | CLK(NULL, "dpll1_fck", &dpll1_fck, CK_343X), | ||
116 | CLK(NULL, "mpu_ck", &mpu_ck, CK_343X), | ||
117 | CLK(NULL, "arm_fck", &arm_fck, CK_343X), | ||
118 | CLK(NULL, "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_343X), | ||
119 | CLK(NULL, "dpll2_fck", &dpll2_fck, CK_343X), | ||
120 | CLK(NULL, "iva2_ck", &iva2_ck, CK_343X), | ||
121 | CLK(NULL, "l3_ick", &l3_ick, CK_343X), | ||
122 | CLK(NULL, "l4_ick", &l4_ick, CK_343X), | ||
123 | CLK(NULL, "rm_ick", &rm_ick, CK_343X), | ||
124 | CLK(NULL, "gfx_l3_ck", &gfx_l3_ck, CK_3430ES1), | ||
125 | CLK(NULL, "gfx_l3_fck", &gfx_l3_fck, CK_3430ES1), | ||
126 | CLK(NULL, "gfx_l3_ick", &gfx_l3_ick, CK_3430ES1), | ||
127 | CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck, CK_3430ES1), | ||
128 | CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck, CK_3430ES1), | ||
129 | CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2), | ||
130 | CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2), | ||
131 | CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1), | ||
132 | CLK(NULL, "gpt10_fck", &gpt10_fck, CK_343X), | ||
133 | CLK(NULL, "gpt11_fck", &gpt11_fck, CK_343X), | ||
134 | CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2), | ||
135 | CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2), | ||
136 | CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2), | ||
137 | CLK(NULL, "core_96m_fck", &core_96m_fck, CK_343X), | ||
138 | CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2), | ||
139 | CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_343X), | ||
140 | CLK(NULL, "mspro_fck", &mspro_fck, CK_343X), | ||
141 | CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_343X), | ||
142 | CLK("i2c_omap.3", "fck", &i2c3_fck, CK_343X), | ||
143 | CLK("i2c_omap.2", "fck", &i2c2_fck, CK_343X), | ||
144 | CLK("i2c_omap.1", "fck", &i2c1_fck, CK_343X), | ||
145 | CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_343X), | ||
146 | CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_343X), | ||
147 | CLK(NULL, "core_48m_fck", &core_48m_fck, CK_343X), | ||
148 | CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_343X), | ||
149 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_343X), | ||
150 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_343X), | ||
151 | CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_343X), | ||
152 | CLK(NULL, "uart2_fck", &uart2_fck, CK_343X), | ||
153 | CLK(NULL, "uart1_fck", &uart1_fck, CK_343X), | ||
154 | CLK(NULL, "fshostusb_fck", &fshostusb_fck, CK_3430ES1), | ||
155 | CLK(NULL, "core_12m_fck", &core_12m_fck, CK_343X), | ||
156 | CLK("omap_hdq.0", "fck", &hdq_fck, CK_343X), | ||
157 | CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck, CK_343X), | ||
158 | CLK(NULL, "ssi_sst_fck", &ssi_sst_fck, CK_343X), | ||
159 | CLK(NULL, "core_l3_ick", &core_l3_ick, CK_343X), | ||
160 | CLK(NULL, "hsotgusb_ick", &hsotgusb_ick, CK_343X), | ||
161 | CLK(NULL, "sdrc_ick", &sdrc_ick, CK_343X), | ||
162 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_343X), | ||
163 | CLK(NULL, "security_l3_ick", &security_l3_ick, CK_343X), | ||
164 | CLK(NULL, "pka_ick", &pka_ick, CK_343X), | ||
165 | CLK(NULL, "core_l4_ick", &core_l4_ick, CK_343X), | ||
166 | CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2), | ||
167 | CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2), | ||
168 | CLK(NULL, "icr_ick", &icr_ick, CK_343X), | ||
169 | CLK(NULL, "aes2_ick", &aes2_ick, CK_343X), | ||
170 | CLK(NULL, "sha12_ick", &sha12_ick, CK_343X), | ||
171 | CLK(NULL, "des2_ick", &des2_ick, CK_343X), | ||
172 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_343X), | ||
173 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_343X), | ||
174 | CLK(NULL, "mspro_ick", &mspro_ick, CK_343X), | ||
175 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_343X), | ||
176 | CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_343X), | ||
177 | CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_343X), | ||
178 | CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_343X), | ||
179 | CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_343X), | ||
180 | CLK("i2c_omap.3", "ick", &i2c3_ick, CK_343X), | ||
181 | CLK("i2c_omap.2", "ick", &i2c2_ick, CK_343X), | ||
182 | CLK("i2c_omap.1", "ick", &i2c1_ick, CK_343X), | ||
183 | CLK(NULL, "uart2_ick", &uart2_ick, CK_343X), | ||
184 | CLK(NULL, "uart1_ick", &uart1_ick, CK_343X), | ||
185 | CLK(NULL, "gpt11_ick", &gpt11_ick, CK_343X), | ||
186 | CLK(NULL, "gpt10_ick", &gpt10_ick, CK_343X), | ||
187 | CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_343X), | ||
188 | CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_343X), | ||
189 | CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1), | ||
190 | CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_343X), | ||
191 | CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_343X), | ||
192 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_343X), | ||
193 | CLK(NULL, "ssi_ick", &ssi_ick, CK_343X), | ||
194 | CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_3430ES1), | ||
195 | CLK(NULL, "security_l4_ick2", &security_l4_ick2, CK_343X), | ||
196 | CLK(NULL, "aes1_ick", &aes1_ick, CK_343X), | ||
197 | CLK("omap_rng", "ick", &rng_ick, CK_343X), | ||
198 | CLK(NULL, "sha11_ick", &sha11_ick, CK_343X), | ||
199 | CLK(NULL, "des1_ick", &des1_ick, CK_343X), | ||
200 | CLK(NULL, "dss1_alwon_fck", &dss1_alwon_fck, CK_343X), | ||
201 | CLK(NULL, "dss_tv_fck", &dss_tv_fck, CK_343X), | ||
202 | CLK(NULL, "dss_96m_fck", &dss_96m_fck, CK_343X), | ||
203 | CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck, CK_343X), | ||
204 | CLK(NULL, "dss_ick", &dss_ick, CK_343X), | ||
205 | CLK(NULL, "cam_mclk", &cam_mclk, CK_343X), | ||
206 | CLK(NULL, "cam_ick", &cam_ick, CK_343X), | ||
207 | CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_343X), | ||
208 | CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2), | ||
209 | CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2), | ||
210 | CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2), | ||
211 | CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2), | ||
212 | CLK(NULL, "gpt1_fck", &gpt1_fck, CK_343X), | ||
213 | CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_343X), | ||
214 | CLK(NULL, "gpio1_dbck", &gpio1_dbck, CK_343X), | ||
215 | CLK("omap_wdt", "fck", &wdt2_fck, CK_343X), | ||
216 | CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_343X), | ||
217 | CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2), | ||
218 | CLK("omap_wdt", "ick", &wdt2_ick, CK_343X), | ||
219 | CLK(NULL, "wdt1_ick", &wdt1_ick, CK_343X), | ||
220 | CLK(NULL, "gpio1_ick", &gpio1_ick, CK_343X), | ||
221 | CLK(NULL, "omap_32ksync_ick", &omap_32ksync_ick, CK_343X), | ||
222 | CLK(NULL, "gpt12_ick", &gpt12_ick, CK_343X), | ||
223 | CLK(NULL, "gpt1_ick", &gpt1_ick, CK_343X), | ||
224 | CLK(NULL, "per_96m_fck", &per_96m_fck, CK_343X), | ||
225 | CLK(NULL, "per_48m_fck", &per_48m_fck, CK_343X), | ||
226 | CLK(NULL, "uart3_fck", &uart3_fck, CK_343X), | ||
227 | CLK(NULL, "gpt2_fck", &gpt2_fck, CK_343X), | ||
228 | CLK(NULL, "gpt3_fck", &gpt3_fck, CK_343X), | ||
229 | CLK(NULL, "gpt4_fck", &gpt4_fck, CK_343X), | ||
230 | CLK(NULL, "gpt5_fck", &gpt5_fck, CK_343X), | ||
231 | CLK(NULL, "gpt6_fck", &gpt6_fck, CK_343X), | ||
232 | CLK(NULL, "gpt7_fck", &gpt7_fck, CK_343X), | ||
233 | CLK(NULL, "gpt8_fck", &gpt8_fck, CK_343X), | ||
234 | CLK(NULL, "gpt9_fck", &gpt9_fck, CK_343X), | ||
235 | CLK(NULL, "per_32k_alwon_fck", &per_32k_alwon_fck, CK_343X), | ||
236 | CLK(NULL, "gpio6_dbck", &gpio6_dbck, CK_343X), | ||
237 | CLK(NULL, "gpio5_dbck", &gpio5_dbck, CK_343X), | ||
238 | CLK(NULL, "gpio4_dbck", &gpio4_dbck, CK_343X), | ||
239 | CLK(NULL, "gpio3_dbck", &gpio3_dbck, CK_343X), | ||
240 | CLK(NULL, "gpio2_dbck", &gpio2_dbck, CK_343X), | ||
241 | CLK(NULL, "wdt3_fck", &wdt3_fck, CK_343X), | ||
242 | CLK(NULL, "per_l4_ick", &per_l4_ick, CK_343X), | ||
243 | CLK(NULL, "gpio6_ick", &gpio6_ick, CK_343X), | ||
244 | CLK(NULL, "gpio5_ick", &gpio5_ick, CK_343X), | ||
245 | CLK(NULL, "gpio4_ick", &gpio4_ick, CK_343X), | ||
246 | CLK(NULL, "gpio3_ick", &gpio3_ick, CK_343X), | ||
247 | CLK(NULL, "gpio2_ick", &gpio2_ick, CK_343X), | ||
248 | CLK(NULL, "wdt3_ick", &wdt3_ick, CK_343X), | ||
249 | CLK(NULL, "uart3_ick", &uart3_ick, CK_343X), | ||
250 | CLK(NULL, "gpt9_ick", &gpt9_ick, CK_343X), | ||
251 | CLK(NULL, "gpt8_ick", &gpt8_ick, CK_343X), | ||
252 | CLK(NULL, "gpt7_ick", &gpt7_ick, CK_343X), | ||
253 | CLK(NULL, "gpt6_ick", &gpt6_ick, CK_343X), | ||
254 | CLK(NULL, "gpt5_ick", &gpt5_ick, CK_343X), | ||
255 | CLK(NULL, "gpt4_ick", &gpt4_ick, CK_343X), | ||
256 | CLK(NULL, "gpt3_ick", &gpt3_ick, CK_343X), | ||
257 | CLK(NULL, "gpt2_ick", &gpt2_ick, CK_343X), | ||
258 | CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_343X), | ||
259 | CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_343X), | ||
260 | CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_343X), | ||
261 | CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_343X), | ||
262 | CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_343X), | ||
263 | CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_343X), | ||
264 | CLK(NULL, "emu_src_ck", &emu_src_ck, CK_343X), | ||
265 | CLK(NULL, "pclk_fck", &pclk_fck, CK_343X), | ||
266 | CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_343X), | ||
267 | CLK(NULL, "atclk_fck", &atclk_fck, CK_343X), | ||
268 | CLK(NULL, "traceclk_src_fck", &traceclk_src_fck, CK_343X), | ||
269 | CLK(NULL, "traceclk_fck", &traceclk_fck, CK_343X), | ||
270 | CLK(NULL, "sr1_fck", &sr1_fck, CK_343X), | ||
271 | CLK(NULL, "sr2_fck", &sr2_fck, CK_343X), | ||
272 | CLK(NULL, "sr_l4_ick", &sr_l4_ick, CK_343X), | ||
273 | CLK(NULL, "secure_32k_fck", &secure_32k_fck, CK_343X), | ||
274 | CLK(NULL, "gpt12_fck", &gpt12_fck, CK_343X), | ||
275 | CLK(NULL, "wdt1_fck", &wdt1_fck, CK_343X), | ||
276 | }; | ||
277 | |||
42 | /* CM_AUTOIDLE_PLL*.AUTO_* bit values */ | 278 | /* CM_AUTOIDLE_PLL*.AUTO_* bit values */ |
43 | #define DPLL_AUTOIDLE_DISABLE 0x0 | 279 | #define DPLL_AUTOIDLE_DISABLE 0x0 |
44 | #define DPLL_AUTOIDLE_LOW_POWER_STOP 0x1 | 280 | #define DPLL_AUTOIDLE_LOW_POWER_STOP 0x1 |
@@ -51,11 +287,9 @@ | |||
51 | * | 287 | * |
52 | * Recalculate and propagate the DPLL rate. | 288 | * Recalculate and propagate the DPLL rate. |
53 | */ | 289 | */ |
54 | static void omap3_dpll_recalc(struct clk *clk) | 290 | static unsigned long omap3_dpll_recalc(struct clk *clk) |
55 | { | 291 | { |
56 | clk->rate = omap2_get_dpll_rate(clk); | 292 | return omap2_get_dpll_rate(clk); |
57 | |||
58 | propagate_rate(clk); | ||
59 | } | 293 | } |
60 | 294 | ||
61 | /* _omap3_dpll_write_clken - write clken_bits arg to a DPLL's enable bits */ | 295 | /* _omap3_dpll_write_clken - write clken_bits arg to a DPLL's enable bits */ |
@@ -78,14 +312,12 @@ static int _omap3_wait_dpll_status(struct clk *clk, u8 state) | |||
78 | const struct dpll_data *dd; | 312 | const struct dpll_data *dd; |
79 | int i = 0; | 313 | int i = 0; |
80 | int ret = -EINVAL; | 314 | int ret = -EINVAL; |
81 | u32 idlest_mask; | ||
82 | 315 | ||
83 | dd = clk->dpll_data; | 316 | dd = clk->dpll_data; |
84 | 317 | ||
85 | state <<= dd->idlest_bit; | 318 | state <<= __ffs(dd->idlest_mask); |
86 | idlest_mask = 1 << dd->idlest_bit; | ||
87 | 319 | ||
88 | while (((__raw_readl(dd->idlest_reg) & idlest_mask) != state) && | 320 | while (((__raw_readl(dd->idlest_reg) & dd->idlest_mask) != state) && |
89 | i < MAX_DPLL_WAIT_TRIES) { | 321 | i < MAX_DPLL_WAIT_TRIES) { |
90 | i++; | 322 | i++; |
91 | udelay(1); | 323 | udelay(1); |
@@ -104,6 +336,42 @@ static int _omap3_wait_dpll_status(struct clk *clk, u8 state) | |||
104 | return ret; | 336 | return ret; |
105 | } | 337 | } |
106 | 338 | ||
339 | /* From 3430 TRM ES2 4.7.6.2 */ | ||
340 | static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n) | ||
341 | { | ||
342 | unsigned long fint; | ||
343 | u16 f = 0; | ||
344 | |||
345 | fint = clk->dpll_data->clk_ref->rate / (n + 1); | ||
346 | |||
347 | pr_debug("clock: fint is %lu\n", fint); | ||
348 | |||
349 | if (fint >= 750000 && fint <= 1000000) | ||
350 | f = 0x3; | ||
351 | else if (fint > 1000000 && fint <= 1250000) | ||
352 | f = 0x4; | ||
353 | else if (fint > 1250000 && fint <= 1500000) | ||
354 | f = 0x5; | ||
355 | else if (fint > 1500000 && fint <= 1750000) | ||
356 | f = 0x6; | ||
357 | else if (fint > 1750000 && fint <= 2100000) | ||
358 | f = 0x7; | ||
359 | else if (fint > 7500000 && fint <= 10000000) | ||
360 | f = 0xB; | ||
361 | else if (fint > 10000000 && fint <= 12500000) | ||
362 | f = 0xC; | ||
363 | else if (fint > 12500000 && fint <= 15000000) | ||
364 | f = 0xD; | ||
365 | else if (fint > 15000000 && fint <= 17500000) | ||
366 | f = 0xE; | ||
367 | else if (fint > 17500000 && fint <= 21000000) | ||
368 | f = 0xF; | ||
369 | else | ||
370 | pr_debug("clock: unknown freqsel setting for %d\n", n); | ||
371 | |||
372 | return f; | ||
373 | } | ||
374 | |||
107 | /* Non-CORE DPLL (e.g., DPLLs that do not control SDRC) clock functions */ | 375 | /* Non-CORE DPLL (e.g., DPLLs that do not control SDRC) clock functions */ |
108 | 376 | ||
109 | /* | 377 | /* |
@@ -128,25 +396,20 @@ static int _omap3_noncore_dpll_lock(struct clk *clk) | |||
128 | 396 | ||
129 | ai = omap3_dpll_autoidle_read(clk); | 397 | ai = omap3_dpll_autoidle_read(clk); |
130 | 398 | ||
399 | omap3_dpll_deny_idle(clk); | ||
400 | |||
131 | _omap3_dpll_write_clken(clk, DPLL_LOCKED); | 401 | _omap3_dpll_write_clken(clk, DPLL_LOCKED); |
132 | 402 | ||
133 | if (ai) { | 403 | r = _omap3_wait_dpll_status(clk, 1); |
134 | /* | 404 | |
135 | * If no downstream clocks are enabled, CM_IDLEST bit | 405 | if (ai) |
136 | * may never become active, so don't wait for DPLL to lock. | ||
137 | */ | ||
138 | r = 0; | ||
139 | omap3_dpll_allow_idle(clk); | 406 | omap3_dpll_allow_idle(clk); |
140 | } else { | ||
141 | r = _omap3_wait_dpll_status(clk, 1); | ||
142 | omap3_dpll_deny_idle(clk); | ||
143 | }; | ||
144 | 407 | ||
145 | return r; | 408 | return r; |
146 | } | 409 | } |
147 | 410 | ||
148 | /* | 411 | /* |
149 | * omap3_noncore_dpll_bypass - instruct a DPLL to bypass and wait for readiness | 412 | * _omap3_noncore_dpll_bypass - instruct a DPLL to bypass and wait for readiness |
150 | * @clk: pointer to a DPLL struct clk | 413 | * @clk: pointer to a DPLL struct clk |
151 | * | 414 | * |
152 | * Instructs a non-CORE DPLL to enter low-power bypass mode. In | 415 | * Instructs a non-CORE DPLL to enter low-power bypass mode. In |
@@ -236,14 +499,25 @@ static int _omap3_noncore_dpll_stop(struct clk *clk) | |||
236 | static int omap3_noncore_dpll_enable(struct clk *clk) | 499 | static int omap3_noncore_dpll_enable(struct clk *clk) |
237 | { | 500 | { |
238 | int r; | 501 | int r; |
502 | struct dpll_data *dd; | ||
239 | 503 | ||
240 | if (clk == &dpll3_ck) | 504 | if (clk == &dpll3_ck) |
241 | return -EINVAL; | 505 | return -EINVAL; |
242 | 506 | ||
243 | if (clk->parent->rate == clk_get_rate(clk)) | 507 | dd = clk->dpll_data; |
508 | if (!dd) | ||
509 | return -EINVAL; | ||
510 | |||
511 | if (clk->rate == dd->clk_bypass->rate) { | ||
512 | WARN_ON(clk->parent != dd->clk_bypass); | ||
244 | r = _omap3_noncore_dpll_bypass(clk); | 513 | r = _omap3_noncore_dpll_bypass(clk); |
245 | else | 514 | } else { |
515 | WARN_ON(clk->parent != dd->clk_ref); | ||
246 | r = _omap3_noncore_dpll_lock(clk); | 516 | r = _omap3_noncore_dpll_lock(clk); |
517 | } | ||
518 | /* FIXME: this is dubious - if clk->rate has changed, what about propagating? */ | ||
519 | if (!r) | ||
520 | clk->rate = omap2_get_dpll_rate(clk); | ||
247 | 521 | ||
248 | return r; | 522 | return r; |
249 | } | 523 | } |
@@ -270,6 +544,215 @@ static void omap3_noncore_dpll_disable(struct clk *clk) | |||
270 | _omap3_noncore_dpll_stop(clk); | 544 | _omap3_noncore_dpll_stop(clk); |
271 | } | 545 | } |
272 | 546 | ||
547 | |||
548 | /* Non-CORE DPLL rate set code */ | ||
549 | |||
550 | /* | ||
551 | * omap3_noncore_dpll_program - set non-core DPLL M,N values directly | ||
552 | * @clk: struct clk * of DPLL to set | ||
553 | * @m: DPLL multiplier to set | ||
554 | * @n: DPLL divider to set | ||
555 | * @freqsel: FREQSEL value to set | ||
556 | * | ||
557 | * Program the DPLL with the supplied M, N values, and wait for the DPLL to | ||
558 | * lock.. Returns -EINVAL upon error, or 0 upon success. | ||
559 | */ | ||
560 | static int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel) | ||
561 | { | ||
562 | struct dpll_data *dd = clk->dpll_data; | ||
563 | u32 v; | ||
564 | |||
565 | /* 3430 ES2 TRM: 4.7.6.9 DPLL Programming Sequence */ | ||
566 | _omap3_noncore_dpll_bypass(clk); | ||
567 | |||
568 | /* Set jitter correction */ | ||
569 | v = __raw_readl(dd->control_reg); | ||
570 | v &= ~dd->freqsel_mask; | ||
571 | v |= freqsel << __ffs(dd->freqsel_mask); | ||
572 | __raw_writel(v, dd->control_reg); | ||
573 | |||
574 | /* Set DPLL multiplier, divider */ | ||
575 | v = __raw_readl(dd->mult_div1_reg); | ||
576 | v &= ~(dd->mult_mask | dd->div1_mask); | ||
577 | v |= m << __ffs(dd->mult_mask); | ||
578 | v |= (n - 1) << __ffs(dd->div1_mask); | ||
579 | __raw_writel(v, dd->mult_div1_reg); | ||
580 | |||
581 | /* We let the clock framework set the other output dividers later */ | ||
582 | |||
583 | /* REVISIT: Set ramp-up delay? */ | ||
584 | |||
585 | _omap3_noncore_dpll_lock(clk); | ||
586 | |||
587 | return 0; | ||
588 | } | ||
589 | |||
590 | /** | ||
591 | * omap3_noncore_dpll_set_rate - set non-core DPLL rate | ||
592 | * @clk: struct clk * of DPLL to set | ||
593 | * @rate: rounded target rate | ||
594 | * | ||
595 | * Set the DPLL CLKOUT to the target rate. If the DPLL can enter | ||
596 | * low-power bypass, and the target rate is the bypass source clock | ||
597 | * rate, then configure the DPLL for bypass. Otherwise, round the | ||
598 | * target rate if it hasn't been done already, then program and lock | ||
599 | * the DPLL. Returns -EINVAL upon error, or 0 upon success. | ||
600 | */ | ||
601 | static int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate) | ||
602 | { | ||
603 | struct clk *new_parent = NULL; | ||
604 | u16 freqsel; | ||
605 | struct dpll_data *dd; | ||
606 | int ret; | ||
607 | |||
608 | if (!clk || !rate) | ||
609 | return -EINVAL; | ||
610 | |||
611 | dd = clk->dpll_data; | ||
612 | if (!dd) | ||
613 | return -EINVAL; | ||
614 | |||
615 | if (rate == omap2_get_dpll_rate(clk)) | ||
616 | return 0; | ||
617 | |||
618 | /* | ||
619 | * Ensure both the bypass and ref clocks are enabled prior to | ||
620 | * doing anything; we need the bypass clock running to reprogram | ||
621 | * the DPLL. | ||
622 | */ | ||
623 | omap2_clk_enable(dd->clk_bypass); | ||
624 | omap2_clk_enable(dd->clk_ref); | ||
625 | |||
626 | if (dd->clk_bypass->rate == rate && | ||
627 | (clk->dpll_data->modes & (1 << DPLL_LOW_POWER_BYPASS))) { | ||
628 | pr_debug("clock: %s: set rate: entering bypass.\n", clk->name); | ||
629 | |||
630 | ret = _omap3_noncore_dpll_bypass(clk); | ||
631 | if (!ret) | ||
632 | new_parent = dd->clk_bypass; | ||
633 | } else { | ||
634 | if (dd->last_rounded_rate != rate) | ||
635 | omap2_dpll_round_rate(clk, rate); | ||
636 | |||
637 | if (dd->last_rounded_rate == 0) | ||
638 | return -EINVAL; | ||
639 | |||
640 | freqsel = _omap3_dpll_compute_freqsel(clk, dd->last_rounded_n); | ||
641 | if (!freqsel) | ||
642 | WARN_ON(1); | ||
643 | |||
644 | pr_debug("clock: %s: set rate: locking rate to %lu.\n", | ||
645 | clk->name, rate); | ||
646 | |||
647 | ret = omap3_noncore_dpll_program(clk, dd->last_rounded_m, | ||
648 | dd->last_rounded_n, freqsel); | ||
649 | if (!ret) | ||
650 | new_parent = dd->clk_ref; | ||
651 | } | ||
652 | if (!ret) { | ||
653 | /* | ||
654 | * Switch the parent clock in the heirarchy, and make sure | ||
655 | * that the new parent's usecount is correct. Note: we | ||
656 | * enable the new parent before disabling the old to avoid | ||
657 | * any unnecessary hardware disable->enable transitions. | ||
658 | */ | ||
659 | if (clk->usecount) { | ||
660 | omap2_clk_enable(new_parent); | ||
661 | omap2_clk_disable(clk->parent); | ||
662 | } | ||
663 | clk_reparent(clk, new_parent); | ||
664 | clk->rate = rate; | ||
665 | } | ||
666 | omap2_clk_disable(dd->clk_ref); | ||
667 | omap2_clk_disable(dd->clk_bypass); | ||
668 | |||
669 | return 0; | ||
670 | } | ||
671 | |||
672 | static int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate) | ||
673 | { | ||
674 | /* | ||
675 | * According to the 12-5 CDP code from TI, "Limitation 2.5" | ||
676 | * on 3430ES1 prevents us from changing DPLL multipliers or dividers | ||
677 | * on DPLL4. | ||
678 | */ | ||
679 | if (omap_rev() == OMAP3430_REV_ES1_0) { | ||
680 | printk(KERN_ERR "clock: DPLL4 cannot change rate due to " | ||
681 | "silicon 'Limitation 2.5' on 3430ES1.\n"); | ||
682 | return -EINVAL; | ||
683 | } | ||
684 | return omap3_noncore_dpll_set_rate(clk, rate); | ||
685 | } | ||
686 | |||
687 | |||
688 | /* | ||
689 | * CORE DPLL (DPLL3) rate programming functions | ||
690 | * | ||
691 | * These call into SRAM code to do the actual CM writes, since the SDRAM | ||
692 | * is clocked from DPLL3. | ||
693 | */ | ||
694 | |||
695 | /** | ||
696 | * omap3_core_dpll_m2_set_rate - set CORE DPLL M2 divider | ||
697 | * @clk: struct clk * of DPLL to set | ||
698 | * @rate: rounded target rate | ||
699 | * | ||
700 | * Program the DPLL M2 divider with the rounded target rate. Returns | ||
701 | * -EINVAL upon error, or 0 upon success. | ||
702 | */ | ||
703 | static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) | ||
704 | { | ||
705 | u32 new_div = 0; | ||
706 | unsigned long validrate, sdrcrate; | ||
707 | struct omap_sdrc_params *sp; | ||
708 | |||
709 | if (!clk || !rate) | ||
710 | return -EINVAL; | ||
711 | |||
712 | if (clk != &dpll3_m2_ck) | ||
713 | return -EINVAL; | ||
714 | |||
715 | if (rate == clk->rate) | ||
716 | return 0; | ||
717 | |||
718 | validrate = omap2_clksel_round_rate_div(clk, rate, &new_div); | ||
719 | if (validrate != rate) | ||
720 | return -EINVAL; | ||
721 | |||
722 | sdrcrate = sdrc_ick.rate; | ||
723 | if (rate > clk->rate) | ||
724 | sdrcrate <<= ((rate / clk->rate) - 1); | ||
725 | else | ||
726 | sdrcrate >>= ((clk->rate / rate) - 1); | ||
727 | |||
728 | sp = omap2_sdrc_get_params(sdrcrate); | ||
729 | if (!sp) | ||
730 | return -EINVAL; | ||
731 | |||
732 | pr_info("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, | ||
733 | validrate); | ||
734 | pr_info("clock: SDRC timing params used: %08x %08x %08x\n", | ||
735 | sp->rfr_ctrl, sp->actim_ctrla, sp->actim_ctrlb); | ||
736 | |||
737 | /* REVISIT: SRAM code doesn't support other M2 divisors yet */ | ||
738 | WARN_ON(new_div != 1 && new_div != 2); | ||
739 | |||
740 | /* REVISIT: Add SDRC_MR changing to this code also */ | ||
741 | omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla, | ||
742 | sp->actim_ctrlb, new_div); | ||
743 | |||
744 | return 0; | ||
745 | } | ||
746 | |||
747 | |||
748 | static const struct clkops clkops_noncore_dpll_ops = { | ||
749 | .enable = &omap3_noncore_dpll_enable, | ||
750 | .disable = &omap3_noncore_dpll_disable, | ||
751 | }; | ||
752 | |||
753 | /* DPLL autoidle read/set code */ | ||
754 | |||
755 | |||
273 | /** | 756 | /** |
274 | * omap3_dpll_autoidle_read - read a DPLL's autoidle bits | 757 | * omap3_dpll_autoidle_read - read a DPLL's autoidle bits |
275 | * @clk: struct clk * of the DPLL to read | 758 | * @clk: struct clk * of the DPLL to read |
@@ -356,9 +839,10 @@ static void omap3_dpll_deny_idle(struct clk *clk) | |||
356 | * Using parent clock DPLL data, look up DPLL state. If locked, set our | 839 | * Using parent clock DPLL data, look up DPLL state. If locked, set our |
357 | * rate to the dpll_clk * 2; otherwise, just use dpll_clk. | 840 | * rate to the dpll_clk * 2; otherwise, just use dpll_clk. |
358 | */ | 841 | */ |
359 | static void omap3_clkoutx2_recalc(struct clk *clk) | 842 | static unsigned long omap3_clkoutx2_recalc(struct clk *clk) |
360 | { | 843 | { |
361 | const struct dpll_data *dd; | 844 | const struct dpll_data *dd; |
845 | unsigned long rate; | ||
362 | u32 v; | 846 | u32 v; |
363 | struct clk *pclk; | 847 | struct clk *pclk; |
364 | 848 | ||
@@ -372,17 +856,15 @@ static void omap3_clkoutx2_recalc(struct clk *clk) | |||
372 | 856 | ||
373 | dd = pclk->dpll_data; | 857 | dd = pclk->dpll_data; |
374 | 858 | ||
375 | WARN_ON(!dd->control_reg || !dd->enable_mask); | 859 | WARN_ON(!dd->enable_mask); |
376 | 860 | ||
377 | v = __raw_readl(dd->control_reg) & dd->enable_mask; | 861 | v = __raw_readl(dd->control_reg) & dd->enable_mask; |
378 | v >>= __ffs(dd->enable_mask); | 862 | v >>= __ffs(dd->enable_mask); |
379 | if (v != DPLL_LOCKED) | 863 | if (v != OMAP3XXX_EN_DPLL_LOCKED) |
380 | clk->rate = clk->parent->rate; | 864 | rate = clk->parent->rate; |
381 | else | 865 | else |
382 | clk->rate = clk->parent->rate * 2; | 866 | rate = clk->parent->rate * 2; |
383 | 867 | return rate; | |
384 | if (clk->flags & RATE_PROPAGATES) | ||
385 | propagate_rate(clk); | ||
386 | } | 868 | } |
387 | 869 | ||
388 | /* Common clock code */ | 870 | /* Common clock code */ |
@@ -432,7 +914,7 @@ static int __init omap2_clk_arch_init(void) | |||
432 | 914 | ||
433 | /* REVISIT: not yet ready for 343x */ | 915 | /* REVISIT: not yet ready for 343x */ |
434 | #if 0 | 916 | #if 0 |
435 | if (omap2_select_table_rate(&virt_prcm_set, mpurate)) | 917 | if (clk_set_rate(&virt_prcm_set, mpurate)) |
436 | printk(KERN_ERR "Could not find matching MPU rate\n"); | 918 | printk(KERN_ERR "Could not find matching MPU rate\n"); |
437 | #endif | 919 | #endif |
438 | 920 | ||
@@ -450,26 +932,13 @@ arch_initcall(omap2_clk_arch_init); | |||
450 | int __init omap2_clk_init(void) | 932 | int __init omap2_clk_init(void) |
451 | { | 933 | { |
452 | /* struct prcm_config *prcm; */ | 934 | /* struct prcm_config *prcm; */ |
453 | struct clk **clkp; | 935 | struct omap_clk *c; |
454 | /* u32 clkrate; */ | 936 | /* u32 clkrate; */ |
455 | u32 cpu_clkflg; | 937 | u32 cpu_clkflg; |
456 | 938 | ||
457 | /* REVISIT: Ultimately this will be used for multiboot */ | ||
458 | #if 0 | ||
459 | if (cpu_is_omap242x()) { | ||
460 | cpu_mask = RATE_IN_242X; | ||
461 | cpu_clkflg = CLOCK_IN_OMAP242X; | ||
462 | clkp = onchip_24xx_clks; | ||
463 | } else if (cpu_is_omap2430()) { | ||
464 | cpu_mask = RATE_IN_243X; | ||
465 | cpu_clkflg = CLOCK_IN_OMAP243X; | ||
466 | clkp = onchip_24xx_clks; | ||
467 | } | ||
468 | #endif | ||
469 | if (cpu_is_omap34xx()) { | 939 | if (cpu_is_omap34xx()) { |
470 | cpu_mask = RATE_IN_343X; | 940 | cpu_mask = RATE_IN_343X; |
471 | cpu_clkflg = CLOCK_IN_OMAP343X; | 941 | cpu_clkflg = CK_343X; |
472 | clkp = onchip_34xx_clks; | ||
473 | 942 | ||
474 | /* | 943 | /* |
475 | * Update this if there are further clock changes between ES2 | 944 | * Update this if there are further clock changes between ES2 |
@@ -477,23 +946,24 @@ int __init omap2_clk_init(void) | |||
477 | */ | 946 | */ |
478 | if (omap_rev() == OMAP3430_REV_ES1_0) { | 947 | if (omap_rev() == OMAP3430_REV_ES1_0) { |
479 | /* No 3430ES1-only rates exist, so no RATE_IN_3430ES1 */ | 948 | /* No 3430ES1-only rates exist, so no RATE_IN_3430ES1 */ |
480 | cpu_clkflg |= CLOCK_IN_OMAP3430ES1; | 949 | cpu_clkflg |= CK_3430ES1; |
481 | } else { | 950 | } else { |
482 | cpu_mask |= RATE_IN_3430ES2; | 951 | cpu_mask |= RATE_IN_3430ES2; |
483 | cpu_clkflg |= CLOCK_IN_OMAP3430ES2; | 952 | cpu_clkflg |= CK_3430ES2; |
484 | } | 953 | } |
485 | } | 954 | } |
486 | 955 | ||
487 | clk_init(&omap2_clk_functions); | 956 | clk_init(&omap2_clk_functions); |
488 | 957 | ||
489 | for (clkp = onchip_34xx_clks; | 958 | for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++) |
490 | clkp < onchip_34xx_clks + ARRAY_SIZE(onchip_34xx_clks); | 959 | clk_init_one(c->lk.clk); |
491 | clkp++) { | 960 | |
492 | if ((*clkp)->flags & cpu_clkflg) { | 961 | for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++) |
493 | clk_register(*clkp); | 962 | if (c->cpu & cpu_clkflg) { |
494 | omap2_init_clk_clkdm(*clkp); | 963 | clkdev_add(&c->lk); |
964 | clk_register(c->lk.clk); | ||
965 | omap2_init_clk_clkdm(c->lk.clk); | ||
495 | } | 966 | } |
496 | } | ||
497 | 967 | ||
498 | /* REVISIT: Not yet ready for OMAP3 */ | 968 | /* REVISIT: Not yet ready for OMAP3 */ |
499 | #if 0 | 969 | #if 0 |
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h index a826094d89b5..70ec10deb654 100644 --- a/arch/arm/mach-omap2/clock34xx.h +++ b/arch/arm/mach-omap2/clock34xx.h | |||
@@ -27,13 +27,14 @@ | |||
27 | #include "prm.h" | 27 | #include "prm.h" |
28 | #include "prm-regbits-34xx.h" | 28 | #include "prm-regbits-34xx.h" |
29 | 29 | ||
30 | static void omap3_dpll_recalc(struct clk *clk); | 30 | static unsigned long omap3_dpll_recalc(struct clk *clk); |
31 | static void omap3_clkoutx2_recalc(struct clk *clk); | 31 | static unsigned long omap3_clkoutx2_recalc(struct clk *clk); |
32 | static void omap3_dpll_allow_idle(struct clk *clk); | 32 | static void omap3_dpll_allow_idle(struct clk *clk); |
33 | static void omap3_dpll_deny_idle(struct clk *clk); | 33 | static void omap3_dpll_deny_idle(struct clk *clk); |
34 | static u32 omap3_dpll_autoidle_read(struct clk *clk); | 34 | static u32 omap3_dpll_autoidle_read(struct clk *clk); |
35 | static int omap3_noncore_dpll_enable(struct clk *clk); | 35 | static int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate); |
36 | static void omap3_noncore_dpll_disable(struct clk *clk); | 36 | static int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate); |
37 | static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate); | ||
37 | 38 | ||
38 | /* Maximum DPLL multiplier, divider values for OMAP3 */ | 39 | /* Maximum DPLL multiplier, divider values for OMAP3 */ |
39 | #define OMAP3_MAX_DPLL_MULT 2048 | 40 | #define OMAP3_MAX_DPLL_MULT 2048 |
@@ -47,6 +48,10 @@ static void omap3_noncore_dpll_disable(struct clk *clk); | |||
47 | * DPLL5 supplies other peripheral clocks (USBHOST, USIM). | 48 | * DPLL5 supplies other peripheral clocks (USBHOST, USIM). |
48 | */ | 49 | */ |
49 | 50 | ||
51 | /* Forward declarations for DPLL bypass clocks */ | ||
52 | static struct clk dpll1_fck; | ||
53 | static struct clk dpll2_fck; | ||
54 | |||
50 | /* CM_CLKEN_PLL*.EN* bit values - not all are available for every DPLL */ | 55 | /* CM_CLKEN_PLL*.EN* bit values - not all are available for every DPLL */ |
51 | #define DPLL_LOW_POWER_STOP 0x1 | 56 | #define DPLL_LOW_POWER_STOP 0x1 |
52 | #define DPLL_LOW_POWER_BYPASS 0x5 | 57 | #define DPLL_LOW_POWER_BYPASS 0x5 |
@@ -57,67 +62,59 @@ static void omap3_noncore_dpll_disable(struct clk *clk); | |||
57 | /* According to timer32k.c, this is a 32768Hz clock, not a 32000Hz clock. */ | 62 | /* According to timer32k.c, this is a 32768Hz clock, not a 32000Hz clock. */ |
58 | static struct clk omap_32k_fck = { | 63 | static struct clk omap_32k_fck = { |
59 | .name = "omap_32k_fck", | 64 | .name = "omap_32k_fck", |
65 | .ops = &clkops_null, | ||
60 | .rate = 32768, | 66 | .rate = 32768, |
61 | .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | | 67 | .flags = RATE_FIXED, |
62 | ALWAYS_ENABLED, | ||
63 | .recalc = &propagate_rate, | ||
64 | }; | 68 | }; |
65 | 69 | ||
66 | static struct clk secure_32k_fck = { | 70 | static struct clk secure_32k_fck = { |
67 | .name = "secure_32k_fck", | 71 | .name = "secure_32k_fck", |
72 | .ops = &clkops_null, | ||
68 | .rate = 32768, | 73 | .rate = 32768, |
69 | .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | | 74 | .flags = RATE_FIXED, |
70 | ALWAYS_ENABLED, | ||
71 | .recalc = &propagate_rate, | ||
72 | }; | 75 | }; |
73 | 76 | ||
74 | /* Virtual source clocks for osc_sys_ck */ | 77 | /* Virtual source clocks for osc_sys_ck */ |
75 | static struct clk virt_12m_ck = { | 78 | static struct clk virt_12m_ck = { |
76 | .name = "virt_12m_ck", | 79 | .name = "virt_12m_ck", |
80 | .ops = &clkops_null, | ||
77 | .rate = 12000000, | 81 | .rate = 12000000, |
78 | .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | | 82 | .flags = RATE_FIXED, |
79 | ALWAYS_ENABLED, | ||
80 | .recalc = &propagate_rate, | ||
81 | }; | 83 | }; |
82 | 84 | ||
83 | static struct clk virt_13m_ck = { | 85 | static struct clk virt_13m_ck = { |
84 | .name = "virt_13m_ck", | 86 | .name = "virt_13m_ck", |
87 | .ops = &clkops_null, | ||
85 | .rate = 13000000, | 88 | .rate = 13000000, |
86 | .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | | 89 | .flags = RATE_FIXED, |
87 | ALWAYS_ENABLED, | ||
88 | .recalc = &propagate_rate, | ||
89 | }; | 90 | }; |
90 | 91 | ||
91 | static struct clk virt_16_8m_ck = { | 92 | static struct clk virt_16_8m_ck = { |
92 | .name = "virt_16_8m_ck", | 93 | .name = "virt_16_8m_ck", |
94 | .ops = &clkops_null, | ||
93 | .rate = 16800000, | 95 | .rate = 16800000, |
94 | .flags = CLOCK_IN_OMAP3430ES2 | RATE_FIXED | RATE_PROPAGATES | | 96 | .flags = RATE_FIXED, |
95 | ALWAYS_ENABLED, | ||
96 | .recalc = &propagate_rate, | ||
97 | }; | 97 | }; |
98 | 98 | ||
99 | static struct clk virt_19_2m_ck = { | 99 | static struct clk virt_19_2m_ck = { |
100 | .name = "virt_19_2m_ck", | 100 | .name = "virt_19_2m_ck", |
101 | .ops = &clkops_null, | ||
101 | .rate = 19200000, | 102 | .rate = 19200000, |
102 | .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | | 103 | .flags = RATE_FIXED, |
103 | ALWAYS_ENABLED, | ||
104 | .recalc = &propagate_rate, | ||
105 | }; | 104 | }; |
106 | 105 | ||
107 | static struct clk virt_26m_ck = { | 106 | static struct clk virt_26m_ck = { |
108 | .name = "virt_26m_ck", | 107 | .name = "virt_26m_ck", |
108 | .ops = &clkops_null, | ||
109 | .rate = 26000000, | 109 | .rate = 26000000, |
110 | .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | | 110 | .flags = RATE_FIXED, |
111 | ALWAYS_ENABLED, | ||
112 | .recalc = &propagate_rate, | ||
113 | }; | 111 | }; |
114 | 112 | ||
115 | static struct clk virt_38_4m_ck = { | 113 | static struct clk virt_38_4m_ck = { |
116 | .name = "virt_38_4m_ck", | 114 | .name = "virt_38_4m_ck", |
115 | .ops = &clkops_null, | ||
117 | .rate = 38400000, | 116 | .rate = 38400000, |
118 | .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | | 117 | .flags = RATE_FIXED, |
119 | ALWAYS_ENABLED, | ||
120 | .recalc = &propagate_rate, | ||
121 | }; | 118 | }; |
122 | 119 | ||
123 | static const struct clksel_rate osc_sys_12m_rates[] = { | 120 | static const struct clksel_rate osc_sys_12m_rates[] = { |
@@ -164,13 +161,13 @@ static const struct clksel osc_sys_clksel[] = { | |||
164 | /* 12, 13, 16.8, 19.2, 26, or 38.4 MHz */ | 161 | /* 12, 13, 16.8, 19.2, 26, or 38.4 MHz */ |
165 | static struct clk osc_sys_ck = { | 162 | static struct clk osc_sys_ck = { |
166 | .name = "osc_sys_ck", | 163 | .name = "osc_sys_ck", |
164 | .ops = &clkops_null, | ||
167 | .init = &omap2_init_clksel_parent, | 165 | .init = &omap2_init_clksel_parent, |
168 | .clksel_reg = OMAP3430_PRM_CLKSEL, | 166 | .clksel_reg = OMAP3430_PRM_CLKSEL, |
169 | .clksel_mask = OMAP3430_SYS_CLKIN_SEL_MASK, | 167 | .clksel_mask = OMAP3430_SYS_CLKIN_SEL_MASK, |
170 | .clksel = osc_sys_clksel, | 168 | .clksel = osc_sys_clksel, |
171 | /* REVISIT: deal with autoextclkmode? */ | 169 | /* REVISIT: deal with autoextclkmode? */ |
172 | .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | | 170 | .flags = RATE_FIXED, |
173 | ALWAYS_ENABLED, | ||
174 | .recalc = &omap2_clksel_recalc, | 171 | .recalc = &omap2_clksel_recalc, |
175 | }; | 172 | }; |
176 | 173 | ||
@@ -189,36 +186,34 @@ static const struct clksel sys_clksel[] = { | |||
189 | /* Feeds DPLLs - divided first by PRM_CLKSRC_CTRL.SYSCLKDIV? */ | 186 | /* Feeds DPLLs - divided first by PRM_CLKSRC_CTRL.SYSCLKDIV? */ |
190 | static struct clk sys_ck = { | 187 | static struct clk sys_ck = { |
191 | .name = "sys_ck", | 188 | .name = "sys_ck", |
189 | .ops = &clkops_null, | ||
192 | .parent = &osc_sys_ck, | 190 | .parent = &osc_sys_ck, |
193 | .init = &omap2_init_clksel_parent, | 191 | .init = &omap2_init_clksel_parent, |
194 | .clksel_reg = OMAP3430_PRM_CLKSRC_CTRL, | 192 | .clksel_reg = OMAP3430_PRM_CLKSRC_CTRL, |
195 | .clksel_mask = OMAP_SYSCLKDIV_MASK, | 193 | .clksel_mask = OMAP_SYSCLKDIV_MASK, |
196 | .clksel = sys_clksel, | 194 | .clksel = sys_clksel, |
197 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
198 | .recalc = &omap2_clksel_recalc, | 195 | .recalc = &omap2_clksel_recalc, |
199 | }; | 196 | }; |
200 | 197 | ||
201 | static struct clk sys_altclk = { | 198 | static struct clk sys_altclk = { |
202 | .name = "sys_altclk", | 199 | .name = "sys_altclk", |
203 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | 200 | .ops = &clkops_null, |
204 | .recalc = &propagate_rate, | ||
205 | }; | 201 | }; |
206 | 202 | ||
207 | /* Optional external clock input for some McBSPs */ | 203 | /* Optional external clock input for some McBSPs */ |
208 | static struct clk mcbsp_clks = { | 204 | static struct clk mcbsp_clks = { |
209 | .name = "mcbsp_clks", | 205 | .name = "mcbsp_clks", |
210 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | 206 | .ops = &clkops_null, |
211 | .recalc = &propagate_rate, | ||
212 | }; | 207 | }; |
213 | 208 | ||
214 | /* PRM EXTERNAL CLOCK OUTPUT */ | 209 | /* PRM EXTERNAL CLOCK OUTPUT */ |
215 | 210 | ||
216 | static struct clk sys_clkout1 = { | 211 | static struct clk sys_clkout1 = { |
217 | .name = "sys_clkout1", | 212 | .name = "sys_clkout1", |
213 | .ops = &clkops_omap2_dflt, | ||
218 | .parent = &osc_sys_ck, | 214 | .parent = &osc_sys_ck, |
219 | .enable_reg = OMAP3430_PRM_CLKOUT_CTRL, | 215 | .enable_reg = OMAP3430_PRM_CLKOUT_CTRL, |
220 | .enable_bit = OMAP3430_CLKOUT_EN_SHIFT, | 216 | .enable_bit = OMAP3430_CLKOUT_EN_SHIFT, |
221 | .flags = CLOCK_IN_OMAP343X, | ||
222 | .recalc = &followparent_recalc, | 217 | .recalc = &followparent_recalc, |
223 | }; | 218 | }; |
224 | 219 | ||
@@ -226,16 +221,6 @@ static struct clk sys_clkout1 = { | |||
226 | 221 | ||
227 | /* CM CLOCKS */ | 222 | /* CM CLOCKS */ |
228 | 223 | ||
229 | static const struct clksel_rate dpll_bypass_rates[] = { | ||
230 | { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, | ||
231 | { .div = 0 } | ||
232 | }; | ||
233 | |||
234 | static const struct clksel_rate dpll_locked_rates[] = { | ||
235 | { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE }, | ||
236 | { .div = 0 } | ||
237 | }; | ||
238 | |||
239 | static const struct clksel_rate div16_dpll_rates[] = { | 224 | static const struct clksel_rate div16_dpll_rates[] = { |
240 | { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE }, | 225 | { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE }, |
241 | { .div = 2, .val = 2, .flags = RATE_IN_343X }, | 226 | { .div = 2, .val = 2, .flags = RATE_IN_343X }, |
@@ -263,6 +248,9 @@ static struct dpll_data dpll1_dd = { | |||
263 | .mult_div1_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL), | 248 | .mult_div1_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL), |
264 | .mult_mask = OMAP3430_MPU_DPLL_MULT_MASK, | 249 | .mult_mask = OMAP3430_MPU_DPLL_MULT_MASK, |
265 | .div1_mask = OMAP3430_MPU_DPLL_DIV_MASK, | 250 | .div1_mask = OMAP3430_MPU_DPLL_DIV_MASK, |
251 | .clk_bypass = &dpll1_fck, | ||
252 | .clk_ref = &sys_ck, | ||
253 | .freqsel_mask = OMAP3430_MPU_DPLL_FREQSEL_MASK, | ||
266 | .control_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL), | 254 | .control_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL), |
267 | .enable_mask = OMAP3430_EN_MPU_DPLL_MASK, | 255 | .enable_mask = OMAP3430_EN_MPU_DPLL_MASK, |
268 | .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED), | 256 | .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED), |
@@ -272,18 +260,21 @@ static struct dpll_data dpll1_dd = { | |||
272 | .autoidle_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL), | 260 | .autoidle_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL), |
273 | .autoidle_mask = OMAP3430_AUTO_MPU_DPLL_MASK, | 261 | .autoidle_mask = OMAP3430_AUTO_MPU_DPLL_MASK, |
274 | .idlest_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL), | 262 | .idlest_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL), |
275 | .idlest_bit = OMAP3430_ST_MPU_CLK_SHIFT, | 263 | .idlest_mask = OMAP3430_ST_MPU_CLK_MASK, |
276 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 264 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
265 | .min_divider = 1, | ||
277 | .max_divider = OMAP3_MAX_DPLL_DIV, | 266 | .max_divider = OMAP3_MAX_DPLL_DIV, |
278 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | 267 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE |
279 | }; | 268 | }; |
280 | 269 | ||
281 | static struct clk dpll1_ck = { | 270 | static struct clk dpll1_ck = { |
282 | .name = "dpll1_ck", | 271 | .name = "dpll1_ck", |
272 | .ops = &clkops_null, | ||
283 | .parent = &sys_ck, | 273 | .parent = &sys_ck, |
284 | .dpll_data = &dpll1_dd, | 274 | .dpll_data = &dpll1_dd, |
285 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
286 | .round_rate = &omap2_dpll_round_rate, | 275 | .round_rate = &omap2_dpll_round_rate, |
276 | .set_rate = &omap3_noncore_dpll_set_rate, | ||
277 | .clkdm_name = "dpll1_clkdm", | ||
287 | .recalc = &omap3_dpll_recalc, | 278 | .recalc = &omap3_dpll_recalc, |
288 | }; | 279 | }; |
289 | 280 | ||
@@ -293,9 +284,9 @@ static struct clk dpll1_ck = { | |||
293 | */ | 284 | */ |
294 | static struct clk dpll1_x2_ck = { | 285 | static struct clk dpll1_x2_ck = { |
295 | .name = "dpll1_x2_ck", | 286 | .name = "dpll1_x2_ck", |
287 | .ops = &clkops_null, | ||
296 | .parent = &dpll1_ck, | 288 | .parent = &dpll1_ck, |
297 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 289 | .clkdm_name = "dpll1_clkdm", |
298 | PARENT_CONTROLS_CLOCK, | ||
299 | .recalc = &omap3_clkoutx2_recalc, | 290 | .recalc = &omap3_clkoutx2_recalc, |
300 | }; | 291 | }; |
301 | 292 | ||
@@ -311,13 +302,13 @@ static const struct clksel div16_dpll1_x2m2_clksel[] = { | |||
311 | */ | 302 | */ |
312 | static struct clk dpll1_x2m2_ck = { | 303 | static struct clk dpll1_x2m2_ck = { |
313 | .name = "dpll1_x2m2_ck", | 304 | .name = "dpll1_x2m2_ck", |
305 | .ops = &clkops_null, | ||
314 | .parent = &dpll1_x2_ck, | 306 | .parent = &dpll1_x2_ck, |
315 | .init = &omap2_init_clksel_parent, | 307 | .init = &omap2_init_clksel_parent, |
316 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL), | 308 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL), |
317 | .clksel_mask = OMAP3430_MPU_DPLL_CLKOUT_DIV_MASK, | 309 | .clksel_mask = OMAP3430_MPU_DPLL_CLKOUT_DIV_MASK, |
318 | .clksel = div16_dpll1_x2m2_clksel, | 310 | .clksel = div16_dpll1_x2m2_clksel, |
319 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 311 | .clkdm_name = "dpll1_clkdm", |
320 | PARENT_CONTROLS_CLOCK, | ||
321 | .recalc = &omap2_clksel_recalc, | 312 | .recalc = &omap2_clksel_recalc, |
322 | }; | 313 | }; |
323 | 314 | ||
@@ -329,6 +320,9 @@ static struct dpll_data dpll2_dd = { | |||
329 | .mult_div1_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL), | 320 | .mult_div1_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL), |
330 | .mult_mask = OMAP3430_IVA2_DPLL_MULT_MASK, | 321 | .mult_mask = OMAP3430_IVA2_DPLL_MULT_MASK, |
331 | .div1_mask = OMAP3430_IVA2_DPLL_DIV_MASK, | 322 | .div1_mask = OMAP3430_IVA2_DPLL_DIV_MASK, |
323 | .clk_bypass = &dpll2_fck, | ||
324 | .clk_ref = &sys_ck, | ||
325 | .freqsel_mask = OMAP3430_IVA2_DPLL_FREQSEL_MASK, | ||
332 | .control_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL), | 326 | .control_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL), |
333 | .enable_mask = OMAP3430_EN_IVA2_DPLL_MASK, | 327 | .enable_mask = OMAP3430_EN_IVA2_DPLL_MASK, |
334 | .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) | | 328 | .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) | |
@@ -339,20 +333,21 @@ static struct dpll_data dpll2_dd = { | |||
339 | .autoidle_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_AUTOIDLE_PLL), | 333 | .autoidle_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_AUTOIDLE_PLL), |
340 | .autoidle_mask = OMAP3430_AUTO_IVA2_DPLL_MASK, | 334 | .autoidle_mask = OMAP3430_AUTO_IVA2_DPLL_MASK, |
341 | .idlest_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_IDLEST_PLL), | 335 | .idlest_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_IDLEST_PLL), |
342 | .idlest_bit = OMAP3430_ST_IVA2_CLK_SHIFT, | 336 | .idlest_mask = OMAP3430_ST_IVA2_CLK_MASK, |
343 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 337 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
338 | .min_divider = 1, | ||
344 | .max_divider = OMAP3_MAX_DPLL_DIV, | 339 | .max_divider = OMAP3_MAX_DPLL_DIV, |
345 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | 340 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE |
346 | }; | 341 | }; |
347 | 342 | ||
348 | static struct clk dpll2_ck = { | 343 | static struct clk dpll2_ck = { |
349 | .name = "dpll2_ck", | 344 | .name = "dpll2_ck", |
345 | .ops = &clkops_noncore_dpll_ops, | ||
350 | .parent = &sys_ck, | 346 | .parent = &sys_ck, |
351 | .dpll_data = &dpll2_dd, | 347 | .dpll_data = &dpll2_dd, |
352 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, | ||
353 | .enable = &omap3_noncore_dpll_enable, | ||
354 | .disable = &omap3_noncore_dpll_disable, | ||
355 | .round_rate = &omap2_dpll_round_rate, | 348 | .round_rate = &omap2_dpll_round_rate, |
349 | .set_rate = &omap3_noncore_dpll_set_rate, | ||
350 | .clkdm_name = "dpll2_clkdm", | ||
356 | .recalc = &omap3_dpll_recalc, | 351 | .recalc = &omap3_dpll_recalc, |
357 | }; | 352 | }; |
358 | 353 | ||
@@ -367,14 +362,14 @@ static const struct clksel div16_dpll2_m2x2_clksel[] = { | |||
367 | */ | 362 | */ |
368 | static struct clk dpll2_m2_ck = { | 363 | static struct clk dpll2_m2_ck = { |
369 | .name = "dpll2_m2_ck", | 364 | .name = "dpll2_m2_ck", |
365 | .ops = &clkops_null, | ||
370 | .parent = &dpll2_ck, | 366 | .parent = &dpll2_ck, |
371 | .init = &omap2_init_clksel_parent, | 367 | .init = &omap2_init_clksel_parent, |
372 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, | 368 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, |
373 | OMAP3430_CM_CLKSEL2_PLL), | 369 | OMAP3430_CM_CLKSEL2_PLL), |
374 | .clksel_mask = OMAP3430_IVA2_DPLL_CLKOUT_DIV_MASK, | 370 | .clksel_mask = OMAP3430_IVA2_DPLL_CLKOUT_DIV_MASK, |
375 | .clksel = div16_dpll2_m2x2_clksel, | 371 | .clksel = div16_dpll2_m2x2_clksel, |
376 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 372 | .clkdm_name = "dpll2_clkdm", |
377 | PARENT_CONTROLS_CLOCK, | ||
378 | .recalc = &omap2_clksel_recalc, | 373 | .recalc = &omap2_clksel_recalc, |
379 | }; | 374 | }; |
380 | 375 | ||
@@ -387,6 +382,9 @@ static struct dpll_data dpll3_dd = { | |||
387 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | 382 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
388 | .mult_mask = OMAP3430_CORE_DPLL_MULT_MASK, | 383 | .mult_mask = OMAP3430_CORE_DPLL_MULT_MASK, |
389 | .div1_mask = OMAP3430_CORE_DPLL_DIV_MASK, | 384 | .div1_mask = OMAP3430_CORE_DPLL_DIV_MASK, |
385 | .clk_bypass = &sys_ck, | ||
386 | .clk_ref = &sys_ck, | ||
387 | .freqsel_mask = OMAP3430_CORE_DPLL_FREQSEL_MASK, | ||
390 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 388 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
391 | .enable_mask = OMAP3430_EN_CORE_DPLL_MASK, | 389 | .enable_mask = OMAP3430_EN_CORE_DPLL_MASK, |
392 | .auto_recal_bit = OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT, | 390 | .auto_recal_bit = OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT, |
@@ -394,17 +392,21 @@ static struct dpll_data dpll3_dd = { | |||
394 | .recal_st_bit = OMAP3430_CORE_DPLL_ST_SHIFT, | 392 | .recal_st_bit = OMAP3430_CORE_DPLL_ST_SHIFT, |
395 | .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE), | 393 | .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE), |
396 | .autoidle_mask = OMAP3430_AUTO_CORE_DPLL_MASK, | 394 | .autoidle_mask = OMAP3430_AUTO_CORE_DPLL_MASK, |
395 | .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | ||
396 | .idlest_mask = OMAP3430_ST_CORE_CLK_MASK, | ||
397 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 397 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
398 | .min_divider = 1, | ||
398 | .max_divider = OMAP3_MAX_DPLL_DIV, | 399 | .max_divider = OMAP3_MAX_DPLL_DIV, |
399 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | 400 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE |
400 | }; | 401 | }; |
401 | 402 | ||
402 | static struct clk dpll3_ck = { | 403 | static struct clk dpll3_ck = { |
403 | .name = "dpll3_ck", | 404 | .name = "dpll3_ck", |
405 | .ops = &clkops_null, | ||
404 | .parent = &sys_ck, | 406 | .parent = &sys_ck, |
405 | .dpll_data = &dpll3_dd, | 407 | .dpll_data = &dpll3_dd, |
406 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
407 | .round_rate = &omap2_dpll_round_rate, | 408 | .round_rate = &omap2_dpll_round_rate, |
409 | .clkdm_name = "dpll3_clkdm", | ||
408 | .recalc = &omap3_dpll_recalc, | 410 | .recalc = &omap3_dpll_recalc, |
409 | }; | 411 | }; |
410 | 412 | ||
@@ -414,9 +416,9 @@ static struct clk dpll3_ck = { | |||
414 | */ | 416 | */ |
415 | static struct clk dpll3_x2_ck = { | 417 | static struct clk dpll3_x2_ck = { |
416 | .name = "dpll3_x2_ck", | 418 | .name = "dpll3_x2_ck", |
419 | .ops = &clkops_null, | ||
417 | .parent = &dpll3_ck, | 420 | .parent = &dpll3_ck, |
418 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 421 | .clkdm_name = "dpll3_clkdm", |
419 | PARENT_CONTROLS_CLOCK, | ||
420 | .recalc = &omap3_clkoutx2_recalc, | 422 | .recalc = &omap3_clkoutx2_recalc, |
421 | }; | 423 | }; |
422 | 424 | ||
@@ -460,55 +462,34 @@ static const struct clksel div31_dpll3m2_clksel[] = { | |||
460 | { .parent = NULL } | 462 | { .parent = NULL } |
461 | }; | 463 | }; |
462 | 464 | ||
463 | /* | 465 | /* DPLL3 output M2 - primary control point for CORE speed */ |
464 | * DPLL3 output M2 | ||
465 | * REVISIT: This DPLL output divider must be changed in SRAM, so until | ||
466 | * that code is ready, this should remain a 'read-only' clksel clock. | ||
467 | */ | ||
468 | static struct clk dpll3_m2_ck = { | 466 | static struct clk dpll3_m2_ck = { |
469 | .name = "dpll3_m2_ck", | 467 | .name = "dpll3_m2_ck", |
468 | .ops = &clkops_null, | ||
470 | .parent = &dpll3_ck, | 469 | .parent = &dpll3_ck, |
471 | .init = &omap2_init_clksel_parent, | 470 | .init = &omap2_init_clksel_parent, |
472 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | 471 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
473 | .clksel_mask = OMAP3430_CORE_DPLL_CLKOUT_DIV_MASK, | 472 | .clksel_mask = OMAP3430_CORE_DPLL_CLKOUT_DIV_MASK, |
474 | .clksel = div31_dpll3m2_clksel, | 473 | .clksel = div31_dpll3m2_clksel, |
475 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 474 | .clkdm_name = "dpll3_clkdm", |
476 | PARENT_CONTROLS_CLOCK, | 475 | .round_rate = &omap2_clksel_round_rate, |
476 | .set_rate = &omap3_core_dpll_m2_set_rate, | ||
477 | .recalc = &omap2_clksel_recalc, | 477 | .recalc = &omap2_clksel_recalc, |
478 | }; | 478 | }; |
479 | 479 | ||
480 | static const struct clksel core_ck_clksel[] = { | ||
481 | { .parent = &sys_ck, .rates = dpll_bypass_rates }, | ||
482 | { .parent = &dpll3_m2_ck, .rates = dpll_locked_rates }, | ||
483 | { .parent = NULL } | ||
484 | }; | ||
485 | |||
486 | static struct clk core_ck = { | 480 | static struct clk core_ck = { |
487 | .name = "core_ck", | 481 | .name = "core_ck", |
488 | .init = &omap2_init_clksel_parent, | 482 | .ops = &clkops_null, |
489 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | 483 | .parent = &dpll3_m2_ck, |
490 | .clksel_mask = OMAP3430_ST_CORE_CLK_MASK, | 484 | .recalc = &followparent_recalc, |
491 | .clksel = core_ck_clksel, | ||
492 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
493 | PARENT_CONTROLS_CLOCK, | ||
494 | .recalc = &omap2_clksel_recalc, | ||
495 | }; | ||
496 | |||
497 | static const struct clksel dpll3_m2x2_ck_clksel[] = { | ||
498 | { .parent = &sys_ck, .rates = dpll_bypass_rates }, | ||
499 | { .parent = &dpll3_x2_ck, .rates = dpll_locked_rates }, | ||
500 | { .parent = NULL } | ||
501 | }; | 485 | }; |
502 | 486 | ||
503 | static struct clk dpll3_m2x2_ck = { | 487 | static struct clk dpll3_m2x2_ck = { |
504 | .name = "dpll3_m2x2_ck", | 488 | .name = "dpll3_m2x2_ck", |
505 | .init = &omap2_init_clksel_parent, | 489 | .ops = &clkops_null, |
506 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | 490 | .parent = &dpll3_x2_ck, |
507 | .clksel_mask = OMAP3430_ST_CORE_CLK_MASK, | 491 | .clkdm_name = "dpll3_clkdm", |
508 | .clksel = dpll3_m2x2_ck_clksel, | 492 | .recalc = &followparent_recalc, |
509 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
510 | PARENT_CONTROLS_CLOCK, | ||
511 | .recalc = &omap2_clksel_recalc, | ||
512 | }; | 493 | }; |
513 | 494 | ||
514 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ | 495 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ |
@@ -520,42 +501,34 @@ static const struct clksel div16_dpll3_clksel[] = { | |||
520 | /* This virtual clock is the source for dpll3_m3x2_ck */ | 501 | /* This virtual clock is the source for dpll3_m3x2_ck */ |
521 | static struct clk dpll3_m3_ck = { | 502 | static struct clk dpll3_m3_ck = { |
522 | .name = "dpll3_m3_ck", | 503 | .name = "dpll3_m3_ck", |
504 | .ops = &clkops_null, | ||
523 | .parent = &dpll3_ck, | 505 | .parent = &dpll3_ck, |
524 | .init = &omap2_init_clksel_parent, | 506 | .init = &omap2_init_clksel_parent, |
525 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), | 507 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), |
526 | .clksel_mask = OMAP3430_DIV_DPLL3_MASK, | 508 | .clksel_mask = OMAP3430_DIV_DPLL3_MASK, |
527 | .clksel = div16_dpll3_clksel, | 509 | .clksel = div16_dpll3_clksel, |
528 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 510 | .clkdm_name = "dpll3_clkdm", |
529 | PARENT_CONTROLS_CLOCK, | ||
530 | .recalc = &omap2_clksel_recalc, | 511 | .recalc = &omap2_clksel_recalc, |
531 | }; | 512 | }; |
532 | 513 | ||
533 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ | 514 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ |
534 | static struct clk dpll3_m3x2_ck = { | 515 | static struct clk dpll3_m3x2_ck = { |
535 | .name = "dpll3_m3x2_ck", | 516 | .name = "dpll3_m3x2_ck", |
517 | .ops = &clkops_omap2_dflt_wait, | ||
536 | .parent = &dpll3_m3_ck, | 518 | .parent = &dpll3_m3_ck, |
537 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 519 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
538 | .enable_bit = OMAP3430_PWRDN_EMU_CORE_SHIFT, | 520 | .enable_bit = OMAP3430_PWRDN_EMU_CORE_SHIFT, |
539 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, | 521 | .flags = INVERT_ENABLE, |
522 | .clkdm_name = "dpll3_clkdm", | ||
540 | .recalc = &omap3_clkoutx2_recalc, | 523 | .recalc = &omap3_clkoutx2_recalc, |
541 | }; | 524 | }; |
542 | 525 | ||
543 | static const struct clksel emu_core_alwon_ck_clksel[] = { | ||
544 | { .parent = &sys_ck, .rates = dpll_bypass_rates }, | ||
545 | { .parent = &dpll3_m3x2_ck, .rates = dpll_locked_rates }, | ||
546 | { .parent = NULL } | ||
547 | }; | ||
548 | |||
549 | static struct clk emu_core_alwon_ck = { | 526 | static struct clk emu_core_alwon_ck = { |
550 | .name = "emu_core_alwon_ck", | 527 | .name = "emu_core_alwon_ck", |
528 | .ops = &clkops_null, | ||
551 | .parent = &dpll3_m3x2_ck, | 529 | .parent = &dpll3_m3x2_ck, |
552 | .init = &omap2_init_clksel_parent, | 530 | .clkdm_name = "dpll3_clkdm", |
553 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | 531 | .recalc = &followparent_recalc, |
554 | .clksel_mask = OMAP3430_ST_CORE_CLK_MASK, | ||
555 | .clksel = emu_core_alwon_ck_clksel, | ||
556 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
557 | PARENT_CONTROLS_CLOCK, | ||
558 | .recalc = &omap2_clksel_recalc, | ||
559 | }; | 532 | }; |
560 | 533 | ||
561 | /* DPLL4 */ | 534 | /* DPLL4 */ |
@@ -565,6 +538,9 @@ static struct dpll_data dpll4_dd = { | |||
565 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2), | 538 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2), |
566 | .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK, | 539 | .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK, |
567 | .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK, | 540 | .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK, |
541 | .clk_bypass = &sys_ck, | ||
542 | .clk_ref = &sys_ck, | ||
543 | .freqsel_mask = OMAP3430_PERIPH_DPLL_FREQSEL_MASK, | ||
568 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 544 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
569 | .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK, | 545 | .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK, |
570 | .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED), | 546 | .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED), |
@@ -574,20 +550,21 @@ static struct dpll_data dpll4_dd = { | |||
574 | .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE), | 550 | .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE), |
575 | .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK, | 551 | .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK, |
576 | .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | 552 | .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), |
577 | .idlest_bit = OMAP3430_ST_PERIPH_CLK_SHIFT, | 553 | .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK, |
578 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 554 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
555 | .min_divider = 1, | ||
579 | .max_divider = OMAP3_MAX_DPLL_DIV, | 556 | .max_divider = OMAP3_MAX_DPLL_DIV, |
580 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | 557 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE |
581 | }; | 558 | }; |
582 | 559 | ||
583 | static struct clk dpll4_ck = { | 560 | static struct clk dpll4_ck = { |
584 | .name = "dpll4_ck", | 561 | .name = "dpll4_ck", |
562 | .ops = &clkops_noncore_dpll_ops, | ||
585 | .parent = &sys_ck, | 563 | .parent = &sys_ck, |
586 | .dpll_data = &dpll4_dd, | 564 | .dpll_data = &dpll4_dd, |
587 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, | ||
588 | .enable = &omap3_noncore_dpll_enable, | ||
589 | .disable = &omap3_noncore_dpll_disable, | ||
590 | .round_rate = &omap2_dpll_round_rate, | 565 | .round_rate = &omap2_dpll_round_rate, |
566 | .set_rate = &omap3_dpll4_set_rate, | ||
567 | .clkdm_name = "dpll4_clkdm", | ||
591 | .recalc = &omap3_dpll_recalc, | 568 | .recalc = &omap3_dpll_recalc, |
592 | }; | 569 | }; |
593 | 570 | ||
@@ -598,9 +575,9 @@ static struct clk dpll4_ck = { | |||
598 | */ | 575 | */ |
599 | static struct clk dpll4_x2_ck = { | 576 | static struct clk dpll4_x2_ck = { |
600 | .name = "dpll4_x2_ck", | 577 | .name = "dpll4_x2_ck", |
578 | .ops = &clkops_null, | ||
601 | .parent = &dpll4_ck, | 579 | .parent = &dpll4_ck, |
602 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 580 | .clkdm_name = "dpll4_clkdm", |
603 | PARENT_CONTROLS_CLOCK, | ||
604 | .recalc = &omap3_clkoutx2_recalc, | 581 | .recalc = &omap3_clkoutx2_recalc, |
605 | }; | 582 | }; |
606 | 583 | ||
@@ -612,112 +589,101 @@ static const struct clksel div16_dpll4_clksel[] = { | |||
612 | /* This virtual clock is the source for dpll4_m2x2_ck */ | 589 | /* This virtual clock is the source for dpll4_m2x2_ck */ |
613 | static struct clk dpll4_m2_ck = { | 590 | static struct clk dpll4_m2_ck = { |
614 | .name = "dpll4_m2_ck", | 591 | .name = "dpll4_m2_ck", |
592 | .ops = &clkops_null, | ||
615 | .parent = &dpll4_ck, | 593 | .parent = &dpll4_ck, |
616 | .init = &omap2_init_clksel_parent, | 594 | .init = &omap2_init_clksel_parent, |
617 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3), | 595 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3), |
618 | .clksel_mask = OMAP3430_DIV_96M_MASK, | 596 | .clksel_mask = OMAP3430_DIV_96M_MASK, |
619 | .clksel = div16_dpll4_clksel, | 597 | .clksel = div16_dpll4_clksel, |
620 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 598 | .clkdm_name = "dpll4_clkdm", |
621 | PARENT_CONTROLS_CLOCK, | ||
622 | .recalc = &omap2_clksel_recalc, | 599 | .recalc = &omap2_clksel_recalc, |
623 | }; | 600 | }; |
624 | 601 | ||
625 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ | 602 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ |
626 | static struct clk dpll4_m2x2_ck = { | 603 | static struct clk dpll4_m2x2_ck = { |
627 | .name = "dpll4_m2x2_ck", | 604 | .name = "dpll4_m2x2_ck", |
605 | .ops = &clkops_omap2_dflt_wait, | ||
628 | .parent = &dpll4_m2_ck, | 606 | .parent = &dpll4_m2_ck, |
629 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 607 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
630 | .enable_bit = OMAP3430_PWRDN_96M_SHIFT, | 608 | .enable_bit = OMAP3430_PWRDN_96M_SHIFT, |
631 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, | 609 | .flags = INVERT_ENABLE, |
610 | .clkdm_name = "dpll4_clkdm", | ||
632 | .recalc = &omap3_clkoutx2_recalc, | 611 | .recalc = &omap3_clkoutx2_recalc, |
633 | }; | 612 | }; |
634 | 613 | ||
635 | static const struct clksel omap_96m_alwon_fck_clksel[] = { | 614 | /* |
636 | { .parent = &sys_ck, .rates = dpll_bypass_rates }, | 615 | * DPLL4 generates DPLL4_M2X2_CLK which is then routed into the PRM as |
637 | { .parent = &dpll4_m2x2_ck, .rates = dpll_locked_rates }, | 616 | * PRM_96M_ALWON_(F)CLK. Two clocks then emerge from the PRM: |
638 | { .parent = NULL } | 617 | * 96M_ALWON_FCLK (called "omap_96m_alwon_fck" below) and |
639 | }; | 618 | * CM_96K_(F)CLK. |
640 | 619 | */ | |
641 | static struct clk omap_96m_alwon_fck = { | 620 | static struct clk omap_96m_alwon_fck = { |
642 | .name = "omap_96m_alwon_fck", | 621 | .name = "omap_96m_alwon_fck", |
622 | .ops = &clkops_null, | ||
643 | .parent = &dpll4_m2x2_ck, | 623 | .parent = &dpll4_m2x2_ck, |
644 | .init = &omap2_init_clksel_parent, | 624 | .recalc = &followparent_recalc, |
645 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | ||
646 | .clksel_mask = OMAP3430_ST_PERIPH_CLK_MASK, | ||
647 | .clksel = omap_96m_alwon_fck_clksel, | ||
648 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
649 | PARENT_CONTROLS_CLOCK, | ||
650 | .recalc = &omap2_clksel_recalc, | ||
651 | }; | 625 | }; |
652 | 626 | ||
653 | static struct clk omap_96m_fck = { | 627 | static struct clk cm_96m_fck = { |
654 | .name = "omap_96m_fck", | 628 | .name = "cm_96m_fck", |
629 | .ops = &clkops_null, | ||
655 | .parent = &omap_96m_alwon_fck, | 630 | .parent = &omap_96m_alwon_fck, |
656 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
657 | PARENT_CONTROLS_CLOCK, | ||
658 | .recalc = &followparent_recalc, | 631 | .recalc = &followparent_recalc, |
659 | }; | 632 | }; |
660 | 633 | ||
661 | static const struct clksel cm_96m_fck_clksel[] = { | 634 | static const struct clksel_rate omap_96m_dpll_rates[] = { |
662 | { .parent = &sys_ck, .rates = dpll_bypass_rates }, | 635 | { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, |
663 | { .parent = &dpll4_m2x2_ck, .rates = dpll_locked_rates }, | 636 | { .div = 0 } |
637 | }; | ||
638 | |||
639 | static const struct clksel_rate omap_96m_sys_rates[] = { | ||
640 | { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE }, | ||
641 | { .div = 0 } | ||
642 | }; | ||
643 | |||
644 | static const struct clksel omap_96m_fck_clksel[] = { | ||
645 | { .parent = &cm_96m_fck, .rates = omap_96m_dpll_rates }, | ||
646 | { .parent = &sys_ck, .rates = omap_96m_sys_rates }, | ||
664 | { .parent = NULL } | 647 | { .parent = NULL } |
665 | }; | 648 | }; |
666 | 649 | ||
667 | static struct clk cm_96m_fck = { | 650 | static struct clk omap_96m_fck = { |
668 | .name = "cm_96m_fck", | 651 | .name = "omap_96m_fck", |
669 | .parent = &dpll4_m2x2_ck, | 652 | .ops = &clkops_null, |
653 | .parent = &sys_ck, | ||
670 | .init = &omap2_init_clksel_parent, | 654 | .init = &omap2_init_clksel_parent, |
671 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | 655 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
672 | .clksel_mask = OMAP3430_ST_PERIPH_CLK_MASK, | 656 | .clksel_mask = OMAP3430_SOURCE_96M_MASK, |
673 | .clksel = cm_96m_fck_clksel, | 657 | .clksel = omap_96m_fck_clksel, |
674 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
675 | PARENT_CONTROLS_CLOCK, | ||
676 | .recalc = &omap2_clksel_recalc, | 658 | .recalc = &omap2_clksel_recalc, |
677 | }; | 659 | }; |
678 | 660 | ||
679 | /* This virtual clock is the source for dpll4_m3x2_ck */ | 661 | /* This virtual clock is the source for dpll4_m3x2_ck */ |
680 | static struct clk dpll4_m3_ck = { | 662 | static struct clk dpll4_m3_ck = { |
681 | .name = "dpll4_m3_ck", | 663 | .name = "dpll4_m3_ck", |
664 | .ops = &clkops_null, | ||
682 | .parent = &dpll4_ck, | 665 | .parent = &dpll4_ck, |
683 | .init = &omap2_init_clksel_parent, | 666 | .init = &omap2_init_clksel_parent, |
684 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), | 667 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), |
685 | .clksel_mask = OMAP3430_CLKSEL_TV_MASK, | 668 | .clksel_mask = OMAP3430_CLKSEL_TV_MASK, |
686 | .clksel = div16_dpll4_clksel, | 669 | .clksel = div16_dpll4_clksel, |
687 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 670 | .clkdm_name = "dpll4_clkdm", |
688 | PARENT_CONTROLS_CLOCK, | ||
689 | .recalc = &omap2_clksel_recalc, | 671 | .recalc = &omap2_clksel_recalc, |
690 | }; | 672 | }; |
691 | 673 | ||
692 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ | 674 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ |
693 | static struct clk dpll4_m3x2_ck = { | 675 | static struct clk dpll4_m3x2_ck = { |
694 | .name = "dpll4_m3x2_ck", | 676 | .name = "dpll4_m3x2_ck", |
677 | .ops = &clkops_omap2_dflt_wait, | ||
695 | .parent = &dpll4_m3_ck, | 678 | .parent = &dpll4_m3_ck, |
696 | .init = &omap2_init_clksel_parent, | 679 | .init = &omap2_init_clksel_parent, |
697 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 680 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
698 | .enable_bit = OMAP3430_PWRDN_TV_SHIFT, | 681 | .enable_bit = OMAP3430_PWRDN_TV_SHIFT, |
699 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, | 682 | .flags = INVERT_ENABLE, |
683 | .clkdm_name = "dpll4_clkdm", | ||
700 | .recalc = &omap3_clkoutx2_recalc, | 684 | .recalc = &omap3_clkoutx2_recalc, |
701 | }; | 685 | }; |
702 | 686 | ||
703 | static const struct clksel virt_omap_54m_fck_clksel[] = { | ||
704 | { .parent = &sys_ck, .rates = dpll_bypass_rates }, | ||
705 | { .parent = &dpll4_m3x2_ck, .rates = dpll_locked_rates }, | ||
706 | { .parent = NULL } | ||
707 | }; | ||
708 | |||
709 | static struct clk virt_omap_54m_fck = { | ||
710 | .name = "virt_omap_54m_fck", | ||
711 | .parent = &dpll4_m3x2_ck, | ||
712 | .init = &omap2_init_clksel_parent, | ||
713 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | ||
714 | .clksel_mask = OMAP3430_ST_PERIPH_CLK_MASK, | ||
715 | .clksel = virt_omap_54m_fck_clksel, | ||
716 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
717 | PARENT_CONTROLS_CLOCK, | ||
718 | .recalc = &omap2_clksel_recalc, | ||
719 | }; | ||
720 | |||
721 | static const struct clksel_rate omap_54m_d4m3x2_rates[] = { | 687 | static const struct clksel_rate omap_54m_d4m3x2_rates[] = { |
722 | { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, | 688 | { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, |
723 | { .div = 0 } | 689 | { .div = 0 } |
@@ -729,23 +695,22 @@ static const struct clksel_rate omap_54m_alt_rates[] = { | |||
729 | }; | 695 | }; |
730 | 696 | ||
731 | static const struct clksel omap_54m_clksel[] = { | 697 | static const struct clksel omap_54m_clksel[] = { |
732 | { .parent = &virt_omap_54m_fck, .rates = omap_54m_d4m3x2_rates }, | 698 | { .parent = &dpll4_m3x2_ck, .rates = omap_54m_d4m3x2_rates }, |
733 | { .parent = &sys_altclk, .rates = omap_54m_alt_rates }, | 699 | { .parent = &sys_altclk, .rates = omap_54m_alt_rates }, |
734 | { .parent = NULL } | 700 | { .parent = NULL } |
735 | }; | 701 | }; |
736 | 702 | ||
737 | static struct clk omap_54m_fck = { | 703 | static struct clk omap_54m_fck = { |
738 | .name = "omap_54m_fck", | 704 | .name = "omap_54m_fck", |
705 | .ops = &clkops_null, | ||
739 | .init = &omap2_init_clksel_parent, | 706 | .init = &omap2_init_clksel_parent, |
740 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | 707 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
741 | .clksel_mask = OMAP3430_SOURCE_54M, | 708 | .clksel_mask = OMAP3430_SOURCE_54M_MASK, |
742 | .clksel = omap_54m_clksel, | 709 | .clksel = omap_54m_clksel, |
743 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
744 | PARENT_CONTROLS_CLOCK, | ||
745 | .recalc = &omap2_clksel_recalc, | 710 | .recalc = &omap2_clksel_recalc, |
746 | }; | 711 | }; |
747 | 712 | ||
748 | static const struct clksel_rate omap_48m_96md2_rates[] = { | 713 | static const struct clksel_rate omap_48m_cm96m_rates[] = { |
749 | { .div = 2, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, | 714 | { .div = 2, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, |
750 | { .div = 0 } | 715 | { .div = 0 } |
751 | }; | 716 | }; |
@@ -756,106 +721,112 @@ static const struct clksel_rate omap_48m_alt_rates[] = { | |||
756 | }; | 721 | }; |
757 | 722 | ||
758 | static const struct clksel omap_48m_clksel[] = { | 723 | static const struct clksel omap_48m_clksel[] = { |
759 | { .parent = &cm_96m_fck, .rates = omap_48m_96md2_rates }, | 724 | { .parent = &cm_96m_fck, .rates = omap_48m_cm96m_rates }, |
760 | { .parent = &sys_altclk, .rates = omap_48m_alt_rates }, | 725 | { .parent = &sys_altclk, .rates = omap_48m_alt_rates }, |
761 | { .parent = NULL } | 726 | { .parent = NULL } |
762 | }; | 727 | }; |
763 | 728 | ||
764 | static struct clk omap_48m_fck = { | 729 | static struct clk omap_48m_fck = { |
765 | .name = "omap_48m_fck", | 730 | .name = "omap_48m_fck", |
731 | .ops = &clkops_null, | ||
766 | .init = &omap2_init_clksel_parent, | 732 | .init = &omap2_init_clksel_parent, |
767 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | 733 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
768 | .clksel_mask = OMAP3430_SOURCE_48M, | 734 | .clksel_mask = OMAP3430_SOURCE_48M_MASK, |
769 | .clksel = omap_48m_clksel, | 735 | .clksel = omap_48m_clksel, |
770 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
771 | PARENT_CONTROLS_CLOCK, | ||
772 | .recalc = &omap2_clksel_recalc, | 736 | .recalc = &omap2_clksel_recalc, |
773 | }; | 737 | }; |
774 | 738 | ||
775 | static struct clk omap_12m_fck = { | 739 | static struct clk omap_12m_fck = { |
776 | .name = "omap_12m_fck", | 740 | .name = "omap_12m_fck", |
741 | .ops = &clkops_null, | ||
777 | .parent = &omap_48m_fck, | 742 | .parent = &omap_48m_fck, |
778 | .fixed_div = 4, | 743 | .fixed_div = 4, |
779 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
780 | PARENT_CONTROLS_CLOCK, | ||
781 | .recalc = &omap2_fixed_divisor_recalc, | 744 | .recalc = &omap2_fixed_divisor_recalc, |
782 | }; | 745 | }; |
783 | 746 | ||
784 | /* This virstual clock is the source for dpll4_m4x2_ck */ | 747 | /* This virstual clock is the source for dpll4_m4x2_ck */ |
785 | static struct clk dpll4_m4_ck = { | 748 | static struct clk dpll4_m4_ck = { |
786 | .name = "dpll4_m4_ck", | 749 | .name = "dpll4_m4_ck", |
750 | .ops = &clkops_null, | ||
787 | .parent = &dpll4_ck, | 751 | .parent = &dpll4_ck, |
788 | .init = &omap2_init_clksel_parent, | 752 | .init = &omap2_init_clksel_parent, |
789 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), | 753 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), |
790 | .clksel_mask = OMAP3430_CLKSEL_DSS1_MASK, | 754 | .clksel_mask = OMAP3430_CLKSEL_DSS1_MASK, |
791 | .clksel = div16_dpll4_clksel, | 755 | .clksel = div16_dpll4_clksel, |
792 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 756 | .clkdm_name = "dpll4_clkdm", |
793 | PARENT_CONTROLS_CLOCK, | ||
794 | .recalc = &omap2_clksel_recalc, | 757 | .recalc = &omap2_clksel_recalc, |
758 | .set_rate = &omap2_clksel_set_rate, | ||
759 | .round_rate = &omap2_clksel_round_rate, | ||
795 | }; | 760 | }; |
796 | 761 | ||
797 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ | 762 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ |
798 | static struct clk dpll4_m4x2_ck = { | 763 | static struct clk dpll4_m4x2_ck = { |
799 | .name = "dpll4_m4x2_ck", | 764 | .name = "dpll4_m4x2_ck", |
765 | .ops = &clkops_omap2_dflt_wait, | ||
800 | .parent = &dpll4_m4_ck, | 766 | .parent = &dpll4_m4_ck, |
801 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 767 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
802 | .enable_bit = OMAP3430_PWRDN_CAM_SHIFT, | 768 | .enable_bit = OMAP3430_PWRDN_CAM_SHIFT, |
803 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, | 769 | .flags = INVERT_ENABLE, |
770 | .clkdm_name = "dpll4_clkdm", | ||
804 | .recalc = &omap3_clkoutx2_recalc, | 771 | .recalc = &omap3_clkoutx2_recalc, |
805 | }; | 772 | }; |
806 | 773 | ||
807 | /* This virtual clock is the source for dpll4_m5x2_ck */ | 774 | /* This virtual clock is the source for dpll4_m5x2_ck */ |
808 | static struct clk dpll4_m5_ck = { | 775 | static struct clk dpll4_m5_ck = { |
809 | .name = "dpll4_m5_ck", | 776 | .name = "dpll4_m5_ck", |
777 | .ops = &clkops_null, | ||
810 | .parent = &dpll4_ck, | 778 | .parent = &dpll4_ck, |
811 | .init = &omap2_init_clksel_parent, | 779 | .init = &omap2_init_clksel_parent, |
812 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL), | 780 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL), |
813 | .clksel_mask = OMAP3430_CLKSEL_CAM_MASK, | 781 | .clksel_mask = OMAP3430_CLKSEL_CAM_MASK, |
814 | .clksel = div16_dpll4_clksel, | 782 | .clksel = div16_dpll4_clksel, |
815 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 783 | .clkdm_name = "dpll4_clkdm", |
816 | PARENT_CONTROLS_CLOCK, | ||
817 | .recalc = &omap2_clksel_recalc, | 784 | .recalc = &omap2_clksel_recalc, |
818 | }; | 785 | }; |
819 | 786 | ||
820 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ | 787 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ |
821 | static struct clk dpll4_m5x2_ck = { | 788 | static struct clk dpll4_m5x2_ck = { |
822 | .name = "dpll4_m5x2_ck", | 789 | .name = "dpll4_m5x2_ck", |
790 | .ops = &clkops_omap2_dflt_wait, | ||
823 | .parent = &dpll4_m5_ck, | 791 | .parent = &dpll4_m5_ck, |
824 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 792 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
825 | .enable_bit = OMAP3430_PWRDN_CAM_SHIFT, | 793 | .enable_bit = OMAP3430_PWRDN_CAM_SHIFT, |
826 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, | 794 | .flags = INVERT_ENABLE, |
795 | .clkdm_name = "dpll4_clkdm", | ||
827 | .recalc = &omap3_clkoutx2_recalc, | 796 | .recalc = &omap3_clkoutx2_recalc, |
828 | }; | 797 | }; |
829 | 798 | ||
830 | /* This virtual clock is the source for dpll4_m6x2_ck */ | 799 | /* This virtual clock is the source for dpll4_m6x2_ck */ |
831 | static struct clk dpll4_m6_ck = { | 800 | static struct clk dpll4_m6_ck = { |
832 | .name = "dpll4_m6_ck", | 801 | .name = "dpll4_m6_ck", |
802 | .ops = &clkops_null, | ||
833 | .parent = &dpll4_ck, | 803 | .parent = &dpll4_ck, |
834 | .init = &omap2_init_clksel_parent, | 804 | .init = &omap2_init_clksel_parent, |
835 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), | 805 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), |
836 | .clksel_mask = OMAP3430_DIV_DPLL4_MASK, | 806 | .clksel_mask = OMAP3430_DIV_DPLL4_MASK, |
837 | .clksel = div16_dpll4_clksel, | 807 | .clksel = div16_dpll4_clksel, |
838 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 808 | .clkdm_name = "dpll4_clkdm", |
839 | PARENT_CONTROLS_CLOCK, | ||
840 | .recalc = &omap2_clksel_recalc, | 809 | .recalc = &omap2_clksel_recalc, |
841 | }; | 810 | }; |
842 | 811 | ||
843 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ | 812 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ |
844 | static struct clk dpll4_m6x2_ck = { | 813 | static struct clk dpll4_m6x2_ck = { |
845 | .name = "dpll4_m6x2_ck", | 814 | .name = "dpll4_m6x2_ck", |
815 | .ops = &clkops_omap2_dflt_wait, | ||
846 | .parent = &dpll4_m6_ck, | 816 | .parent = &dpll4_m6_ck, |
847 | .init = &omap2_init_clksel_parent, | 817 | .init = &omap2_init_clksel_parent, |
848 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 818 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
849 | .enable_bit = OMAP3430_PWRDN_EMU_PERIPH_SHIFT, | 819 | .enable_bit = OMAP3430_PWRDN_EMU_PERIPH_SHIFT, |
850 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, | 820 | .flags = INVERT_ENABLE, |
821 | .clkdm_name = "dpll4_clkdm", | ||
851 | .recalc = &omap3_clkoutx2_recalc, | 822 | .recalc = &omap3_clkoutx2_recalc, |
852 | }; | 823 | }; |
853 | 824 | ||
854 | static struct clk emu_per_alwon_ck = { | 825 | static struct clk emu_per_alwon_ck = { |
855 | .name = "emu_per_alwon_ck", | 826 | .name = "emu_per_alwon_ck", |
827 | .ops = &clkops_null, | ||
856 | .parent = &dpll4_m6x2_ck, | 828 | .parent = &dpll4_m6x2_ck, |
857 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | 829 | .clkdm_name = "dpll4_clkdm", |
858 | PARENT_CONTROLS_CLOCK, | ||
859 | .recalc = &followparent_recalc, | 830 | .recalc = &followparent_recalc, |
860 | }; | 831 | }; |
861 | 832 | ||
@@ -867,6 +838,9 @@ static struct dpll_data dpll5_dd = { | |||
867 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4), | 838 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4), |
868 | .mult_mask = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK, | 839 | .mult_mask = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK, |
869 | .div1_mask = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK, | 840 | .div1_mask = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK, |
841 | .clk_bypass = &sys_ck, | ||
842 | .clk_ref = &sys_ck, | ||
843 | .freqsel_mask = OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK, | ||
870 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2), | 844 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2), |
871 | .enable_mask = OMAP3430ES2_EN_PERIPH2_DPLL_MASK, | 845 | .enable_mask = OMAP3430ES2_EN_PERIPH2_DPLL_MASK, |
872 | .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED), | 846 | .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED), |
@@ -876,20 +850,21 @@ static struct dpll_data dpll5_dd = { | |||
876 | .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_AUTOIDLE2_PLL), | 850 | .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_AUTOIDLE2_PLL), |
877 | .autoidle_mask = OMAP3430ES2_AUTO_PERIPH2_DPLL_MASK, | 851 | .autoidle_mask = OMAP3430ES2_AUTO_PERIPH2_DPLL_MASK, |
878 | .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2), | 852 | .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2), |
879 | .idlest_bit = OMAP3430ES2_ST_PERIPH2_CLK_SHIFT, | 853 | .idlest_mask = OMAP3430ES2_ST_PERIPH2_CLK_MASK, |
880 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 854 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
855 | .min_divider = 1, | ||
881 | .max_divider = OMAP3_MAX_DPLL_DIV, | 856 | .max_divider = OMAP3_MAX_DPLL_DIV, |
882 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | 857 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE |
883 | }; | 858 | }; |
884 | 859 | ||
885 | static struct clk dpll5_ck = { | 860 | static struct clk dpll5_ck = { |
886 | .name = "dpll5_ck", | 861 | .name = "dpll5_ck", |
862 | .ops = &clkops_noncore_dpll_ops, | ||
887 | .parent = &sys_ck, | 863 | .parent = &sys_ck, |
888 | .dpll_data = &dpll5_dd, | 864 | .dpll_data = &dpll5_dd, |
889 | .flags = CLOCK_IN_OMAP3430ES2 | RATE_PROPAGATES, | ||
890 | .enable = &omap3_noncore_dpll_enable, | ||
891 | .disable = &omap3_noncore_dpll_disable, | ||
892 | .round_rate = &omap2_dpll_round_rate, | 865 | .round_rate = &omap2_dpll_round_rate, |
866 | .set_rate = &omap3_noncore_dpll_set_rate, | ||
867 | .clkdm_name = "dpll5_clkdm", | ||
893 | .recalc = &omap3_dpll_recalc, | 868 | .recalc = &omap3_dpll_recalc, |
894 | }; | 869 | }; |
895 | 870 | ||
@@ -900,31 +875,13 @@ static const struct clksel div16_dpll5_clksel[] = { | |||
900 | 875 | ||
901 | static struct clk dpll5_m2_ck = { | 876 | static struct clk dpll5_m2_ck = { |
902 | .name = "dpll5_m2_ck", | 877 | .name = "dpll5_m2_ck", |
878 | .ops = &clkops_null, | ||
903 | .parent = &dpll5_ck, | 879 | .parent = &dpll5_ck, |
904 | .init = &omap2_init_clksel_parent, | 880 | .init = &omap2_init_clksel_parent, |
905 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5), | 881 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5), |
906 | .clksel_mask = OMAP3430ES2_DIV_120M_MASK, | 882 | .clksel_mask = OMAP3430ES2_DIV_120M_MASK, |
907 | .clksel = div16_dpll5_clksel, | 883 | .clksel = div16_dpll5_clksel, |
908 | .flags = CLOCK_IN_OMAP3430ES2 | RATE_PROPAGATES | | 884 | .clkdm_name = "dpll5_clkdm", |
909 | PARENT_CONTROLS_CLOCK, | ||
910 | .recalc = &omap2_clksel_recalc, | ||
911 | }; | ||
912 | |||
913 | static const struct clksel omap_120m_fck_clksel[] = { | ||
914 | { .parent = &sys_ck, .rates = dpll_bypass_rates }, | ||
915 | { .parent = &dpll5_m2_ck, .rates = dpll_locked_rates }, | ||
916 | { .parent = NULL } | ||
917 | }; | ||
918 | |||
919 | static struct clk omap_120m_fck = { | ||
920 | .name = "omap_120m_fck", | ||
921 | .parent = &dpll5_m2_ck, | ||
922 | .init = &omap2_init_clksel_parent, | ||
923 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2), | ||
924 | .clksel_mask = OMAP3430ES2_ST_PERIPH2_CLK_MASK, | ||
925 | .clksel = omap_120m_fck_clksel, | ||
926 | .flags = CLOCK_IN_OMAP3430ES2 | RATE_PROPAGATES | | ||
927 | PARENT_CONTROLS_CLOCK, | ||
928 | .recalc = &omap2_clksel_recalc, | 885 | .recalc = &omap2_clksel_recalc, |
929 | }; | 886 | }; |
930 | 887 | ||
@@ -951,22 +908,23 @@ static const struct clksel_rate clkout2_src_54m_rates[] = { | |||
951 | }; | 908 | }; |
952 | 909 | ||
953 | static const struct clksel clkout2_src_clksel[] = { | 910 | static const struct clksel clkout2_src_clksel[] = { |
954 | { .parent = &core_ck, .rates = clkout2_src_core_rates }, | 911 | { .parent = &core_ck, .rates = clkout2_src_core_rates }, |
955 | { .parent = &sys_ck, .rates = clkout2_src_sys_rates }, | 912 | { .parent = &sys_ck, .rates = clkout2_src_sys_rates }, |
956 | { .parent = &omap_96m_alwon_fck, .rates = clkout2_src_96m_rates }, | 913 | { .parent = &cm_96m_fck, .rates = clkout2_src_96m_rates }, |
957 | { .parent = &omap_54m_fck, .rates = clkout2_src_54m_rates }, | 914 | { .parent = &omap_54m_fck, .rates = clkout2_src_54m_rates }, |
958 | { .parent = NULL } | 915 | { .parent = NULL } |
959 | }; | 916 | }; |
960 | 917 | ||
961 | static struct clk clkout2_src_ck = { | 918 | static struct clk clkout2_src_ck = { |
962 | .name = "clkout2_src_ck", | 919 | .name = "clkout2_src_ck", |
920 | .ops = &clkops_omap2_dflt, | ||
963 | .init = &omap2_init_clksel_parent, | 921 | .init = &omap2_init_clksel_parent, |
964 | .enable_reg = OMAP3430_CM_CLKOUT_CTRL, | 922 | .enable_reg = OMAP3430_CM_CLKOUT_CTRL, |
965 | .enable_bit = OMAP3430_CLKOUT2_EN_SHIFT, | 923 | .enable_bit = OMAP3430_CLKOUT2_EN_SHIFT, |
966 | .clksel_reg = OMAP3430_CM_CLKOUT_CTRL, | 924 | .clksel_reg = OMAP3430_CM_CLKOUT_CTRL, |
967 | .clksel_mask = OMAP3430_CLKOUT2SOURCE_MASK, | 925 | .clksel_mask = OMAP3430_CLKOUT2SOURCE_MASK, |
968 | .clksel = clkout2_src_clksel, | 926 | .clksel = clkout2_src_clksel, |
969 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, | 927 | .clkdm_name = "core_clkdm", |
970 | .recalc = &omap2_clksel_recalc, | 928 | .recalc = &omap2_clksel_recalc, |
971 | }; | 929 | }; |
972 | 930 | ||
@@ -986,11 +944,11 @@ static const struct clksel sys_clkout2_clksel[] = { | |||
986 | 944 | ||
987 | static struct clk sys_clkout2 = { | 945 | static struct clk sys_clkout2 = { |
988 | .name = "sys_clkout2", | 946 | .name = "sys_clkout2", |
947 | .ops = &clkops_null, | ||
989 | .init = &omap2_init_clksel_parent, | 948 | .init = &omap2_init_clksel_parent, |
990 | .clksel_reg = OMAP3430_CM_CLKOUT_CTRL, | 949 | .clksel_reg = OMAP3430_CM_CLKOUT_CTRL, |
991 | .clksel_mask = OMAP3430_CLKOUT2_DIV_MASK, | 950 | .clksel_mask = OMAP3430_CLKOUT2_DIV_MASK, |
992 | .clksel = sys_clkout2_clksel, | 951 | .clksel = sys_clkout2_clksel, |
993 | .flags = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK, | ||
994 | .recalc = &omap2_clksel_recalc, | 952 | .recalc = &omap2_clksel_recalc, |
995 | }; | 953 | }; |
996 | 954 | ||
@@ -998,16 +956,22 @@ static struct clk sys_clkout2 = { | |||
998 | 956 | ||
999 | static struct clk corex2_fck = { | 957 | static struct clk corex2_fck = { |
1000 | .name = "corex2_fck", | 958 | .name = "corex2_fck", |
959 | .ops = &clkops_null, | ||
1001 | .parent = &dpll3_m2x2_ck, | 960 | .parent = &dpll3_m2x2_ck, |
1002 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1003 | PARENT_CONTROLS_CLOCK, | ||
1004 | .recalc = &followparent_recalc, | 961 | .recalc = &followparent_recalc, |
1005 | }; | 962 | }; |
1006 | 963 | ||
1007 | /* DPLL power domain clock controls */ | 964 | /* DPLL power domain clock controls */ |
1008 | 965 | ||
1009 | static const struct clksel div2_core_clksel[] = { | 966 | static const struct clksel_rate div4_rates[] = { |
1010 | { .parent = &core_ck, .rates = div2_rates }, | 967 | { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE }, |
968 | { .div = 2, .val = 2, .flags = RATE_IN_343X }, | ||
969 | { .div = 4, .val = 4, .flags = RATE_IN_343X }, | ||
970 | { .div = 0 } | ||
971 | }; | ||
972 | |||
973 | static const struct clksel div4_core_clksel[] = { | ||
974 | { .parent = &core_ck, .rates = div4_rates }, | ||
1011 | { .parent = NULL } | 975 | { .parent = NULL } |
1012 | }; | 976 | }; |
1013 | 977 | ||
@@ -1017,39 +981,21 @@ static const struct clksel div2_core_clksel[] = { | |||
1017 | */ | 981 | */ |
1018 | static struct clk dpll1_fck = { | 982 | static struct clk dpll1_fck = { |
1019 | .name = "dpll1_fck", | 983 | .name = "dpll1_fck", |
984 | .ops = &clkops_null, | ||
1020 | .parent = &core_ck, | 985 | .parent = &core_ck, |
1021 | .init = &omap2_init_clksel_parent, | 986 | .init = &omap2_init_clksel_parent, |
1022 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL), | 987 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL), |
1023 | .clksel_mask = OMAP3430_MPU_CLK_SRC_MASK, | 988 | .clksel_mask = OMAP3430_MPU_CLK_SRC_MASK, |
1024 | .clksel = div2_core_clksel, | 989 | .clksel = div4_core_clksel, |
1025 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1026 | PARENT_CONTROLS_CLOCK, | ||
1027 | .recalc = &omap2_clksel_recalc, | 990 | .recalc = &omap2_clksel_recalc, |
1028 | }; | 991 | }; |
1029 | 992 | ||
1030 | /* | ||
1031 | * MPU clksel: | ||
1032 | * If DPLL1 is locked, mpu_ck derives from DPLL1; otherwise, mpu_ck | ||
1033 | * derives from the high-frequency bypass clock originating from DPLL3, | ||
1034 | * called 'dpll1_fck' | ||
1035 | */ | ||
1036 | static const struct clksel mpu_clksel[] = { | ||
1037 | { .parent = &dpll1_fck, .rates = dpll_bypass_rates }, | ||
1038 | { .parent = &dpll1_x2m2_ck, .rates = dpll_locked_rates }, | ||
1039 | { .parent = NULL } | ||
1040 | }; | ||
1041 | |||
1042 | static struct clk mpu_ck = { | 993 | static struct clk mpu_ck = { |
1043 | .name = "mpu_ck", | 994 | .name = "mpu_ck", |
995 | .ops = &clkops_null, | ||
1044 | .parent = &dpll1_x2m2_ck, | 996 | .parent = &dpll1_x2m2_ck, |
1045 | .init = &omap2_init_clksel_parent, | ||
1046 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL), | ||
1047 | .clksel_mask = OMAP3430_ST_MPU_CLK_MASK, | ||
1048 | .clksel = mpu_clksel, | ||
1049 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1050 | PARENT_CONTROLS_CLOCK, | ||
1051 | .clkdm_name = "mpu_clkdm", | 997 | .clkdm_name = "mpu_clkdm", |
1052 | .recalc = &omap2_clksel_recalc, | 998 | .recalc = &followparent_recalc, |
1053 | }; | 999 | }; |
1054 | 1000 | ||
1055 | /* arm_fck is divided by two when DPLL1 locked; otherwise, passthrough mpu_ck */ | 1001 | /* arm_fck is divided by two when DPLL1 locked; otherwise, passthrough mpu_ck */ |
@@ -1066,13 +1012,12 @@ static const struct clksel arm_fck_clksel[] = { | |||
1066 | 1012 | ||
1067 | static struct clk arm_fck = { | 1013 | static struct clk arm_fck = { |
1068 | .name = "arm_fck", | 1014 | .name = "arm_fck", |
1015 | .ops = &clkops_null, | ||
1069 | .parent = &mpu_ck, | 1016 | .parent = &mpu_ck, |
1070 | .init = &omap2_init_clksel_parent, | 1017 | .init = &omap2_init_clksel_parent, |
1071 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL), | 1018 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL), |
1072 | .clksel_mask = OMAP3430_ST_MPU_CLK_MASK, | 1019 | .clksel_mask = OMAP3430_ST_MPU_CLK_MASK, |
1073 | .clksel = arm_fck_clksel, | 1020 | .clksel = arm_fck_clksel, |
1074 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1075 | PARENT_CONTROLS_CLOCK, | ||
1076 | .recalc = &omap2_clksel_recalc, | 1021 | .recalc = &omap2_clksel_recalc, |
1077 | }; | 1022 | }; |
1078 | 1023 | ||
@@ -1084,63 +1029,48 @@ static struct clk arm_fck = { | |||
1084 | */ | 1029 | */ |
1085 | static struct clk emu_mpu_alwon_ck = { | 1030 | static struct clk emu_mpu_alwon_ck = { |
1086 | .name = "emu_mpu_alwon_ck", | 1031 | .name = "emu_mpu_alwon_ck", |
1032 | .ops = &clkops_null, | ||
1087 | .parent = &mpu_ck, | 1033 | .parent = &mpu_ck, |
1088 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1089 | PARENT_CONTROLS_CLOCK, | ||
1090 | .recalc = &followparent_recalc, | 1034 | .recalc = &followparent_recalc, |
1091 | }; | 1035 | }; |
1092 | 1036 | ||
1093 | static struct clk dpll2_fck = { | 1037 | static struct clk dpll2_fck = { |
1094 | .name = "dpll2_fck", | 1038 | .name = "dpll2_fck", |
1039 | .ops = &clkops_null, | ||
1095 | .parent = &core_ck, | 1040 | .parent = &core_ck, |
1096 | .init = &omap2_init_clksel_parent, | 1041 | .init = &omap2_init_clksel_parent, |
1097 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL), | 1042 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL), |
1098 | .clksel_mask = OMAP3430_IVA2_CLK_SRC_MASK, | 1043 | .clksel_mask = OMAP3430_IVA2_CLK_SRC_MASK, |
1099 | .clksel = div2_core_clksel, | 1044 | .clksel = div4_core_clksel, |
1100 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1101 | PARENT_CONTROLS_CLOCK, | ||
1102 | .recalc = &omap2_clksel_recalc, | 1045 | .recalc = &omap2_clksel_recalc, |
1103 | }; | 1046 | }; |
1104 | 1047 | ||
1105 | /* | ||
1106 | * IVA2 clksel: | ||
1107 | * If DPLL2 is locked, iva2_ck derives from DPLL2; otherwise, iva2_ck | ||
1108 | * derives from the high-frequency bypass clock originating from DPLL3, | ||
1109 | * called 'dpll2_fck' | ||
1110 | */ | ||
1111 | |||
1112 | static const struct clksel iva2_clksel[] = { | ||
1113 | { .parent = &dpll2_fck, .rates = dpll_bypass_rates }, | ||
1114 | { .parent = &dpll2_m2_ck, .rates = dpll_locked_rates }, | ||
1115 | { .parent = NULL } | ||
1116 | }; | ||
1117 | |||
1118 | static struct clk iva2_ck = { | 1048 | static struct clk iva2_ck = { |
1119 | .name = "iva2_ck", | 1049 | .name = "iva2_ck", |
1050 | .ops = &clkops_omap2_dflt_wait, | ||
1120 | .parent = &dpll2_m2_ck, | 1051 | .parent = &dpll2_m2_ck, |
1121 | .init = &omap2_init_clksel_parent, | 1052 | .init = &omap2_init_clksel_parent, |
1122 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, CM_FCLKEN), | 1053 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, CM_FCLKEN), |
1123 | .enable_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT, | 1054 | .enable_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT, |
1124 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, | ||
1125 | OMAP3430_CM_IDLEST_PLL), | ||
1126 | .clksel_mask = OMAP3430_ST_IVA2_CLK_MASK, | ||
1127 | .clksel = iva2_clksel, | ||
1128 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, | ||
1129 | .clkdm_name = "iva2_clkdm", | 1055 | .clkdm_name = "iva2_clkdm", |
1130 | .recalc = &omap2_clksel_recalc, | 1056 | .recalc = &followparent_recalc, |
1131 | }; | 1057 | }; |
1132 | 1058 | ||
1133 | /* Common interface clocks */ | 1059 | /* Common interface clocks */ |
1134 | 1060 | ||
1061 | static const struct clksel div2_core_clksel[] = { | ||
1062 | { .parent = &core_ck, .rates = div2_rates }, | ||
1063 | { .parent = NULL } | ||
1064 | }; | ||
1065 | |||
1135 | static struct clk l3_ick = { | 1066 | static struct clk l3_ick = { |
1136 | .name = "l3_ick", | 1067 | .name = "l3_ick", |
1068 | .ops = &clkops_null, | ||
1137 | .parent = &core_ck, | 1069 | .parent = &core_ck, |
1138 | .init = &omap2_init_clksel_parent, | 1070 | .init = &omap2_init_clksel_parent, |
1139 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), | 1071 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), |
1140 | .clksel_mask = OMAP3430_CLKSEL_L3_MASK, | 1072 | .clksel_mask = OMAP3430_CLKSEL_L3_MASK, |
1141 | .clksel = div2_core_clksel, | 1073 | .clksel = div2_core_clksel, |
1142 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1143 | PARENT_CONTROLS_CLOCK, | ||
1144 | .clkdm_name = "core_l3_clkdm", | 1074 | .clkdm_name = "core_l3_clkdm", |
1145 | .recalc = &omap2_clksel_recalc, | 1075 | .recalc = &omap2_clksel_recalc, |
1146 | }; | 1076 | }; |
@@ -1152,13 +1082,12 @@ static const struct clksel div2_l3_clksel[] = { | |||
1152 | 1082 | ||
1153 | static struct clk l4_ick = { | 1083 | static struct clk l4_ick = { |
1154 | .name = "l4_ick", | 1084 | .name = "l4_ick", |
1085 | .ops = &clkops_null, | ||
1155 | .parent = &l3_ick, | 1086 | .parent = &l3_ick, |
1156 | .init = &omap2_init_clksel_parent, | 1087 | .init = &omap2_init_clksel_parent, |
1157 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), | 1088 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), |
1158 | .clksel_mask = OMAP3430_CLKSEL_L4_MASK, | 1089 | .clksel_mask = OMAP3430_CLKSEL_L4_MASK, |
1159 | .clksel = div2_l3_clksel, | 1090 | .clksel = div2_l3_clksel, |
1160 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1161 | PARENT_CONTROLS_CLOCK, | ||
1162 | .clkdm_name = "core_l4_clkdm", | 1091 | .clkdm_name = "core_l4_clkdm", |
1163 | .recalc = &omap2_clksel_recalc, | 1092 | .recalc = &omap2_clksel_recalc, |
1164 | 1093 | ||
@@ -1171,12 +1100,12 @@ static const struct clksel div2_l4_clksel[] = { | |||
1171 | 1100 | ||
1172 | static struct clk rm_ick = { | 1101 | static struct clk rm_ick = { |
1173 | .name = "rm_ick", | 1102 | .name = "rm_ick", |
1103 | .ops = &clkops_null, | ||
1174 | .parent = &l4_ick, | 1104 | .parent = &l4_ick, |
1175 | .init = &omap2_init_clksel_parent, | 1105 | .init = &omap2_init_clksel_parent, |
1176 | .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL), | 1106 | .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL), |
1177 | .clksel_mask = OMAP3430_CLKSEL_RM_MASK, | 1107 | .clksel_mask = OMAP3430_CLKSEL_RM_MASK, |
1178 | .clksel = div2_l4_clksel, | 1108 | .clksel = div2_l4_clksel, |
1179 | .flags = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK, | ||
1180 | .recalc = &omap2_clksel_recalc, | 1109 | .recalc = &omap2_clksel_recalc, |
1181 | }; | 1110 | }; |
1182 | 1111 | ||
@@ -1192,53 +1121,52 @@ static const struct clksel gfx_l3_clksel[] = { | |||
1192 | /* Virtual parent clock for gfx_l3_ick and gfx_l3_fck */ | 1121 | /* Virtual parent clock for gfx_l3_ick and gfx_l3_fck */ |
1193 | static struct clk gfx_l3_ck = { | 1122 | static struct clk gfx_l3_ck = { |
1194 | .name = "gfx_l3_ck", | 1123 | .name = "gfx_l3_ck", |
1124 | .ops = &clkops_omap2_dflt_wait, | ||
1195 | .parent = &l3_ick, | 1125 | .parent = &l3_ick, |
1196 | .init = &omap2_init_clksel_parent, | 1126 | .init = &omap2_init_clksel_parent, |
1197 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN), | 1127 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN), |
1198 | .enable_bit = OMAP_EN_GFX_SHIFT, | 1128 | .enable_bit = OMAP_EN_GFX_SHIFT, |
1199 | .flags = CLOCK_IN_OMAP3430ES1, | ||
1200 | .recalc = &followparent_recalc, | 1129 | .recalc = &followparent_recalc, |
1201 | }; | 1130 | }; |
1202 | 1131 | ||
1203 | static struct clk gfx_l3_fck = { | 1132 | static struct clk gfx_l3_fck = { |
1204 | .name = "gfx_l3_fck", | 1133 | .name = "gfx_l3_fck", |
1134 | .ops = &clkops_null, | ||
1205 | .parent = &gfx_l3_ck, | 1135 | .parent = &gfx_l3_ck, |
1206 | .init = &omap2_init_clksel_parent, | 1136 | .init = &omap2_init_clksel_parent, |
1207 | .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL), | 1137 | .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL), |
1208 | .clksel_mask = OMAP_CLKSEL_GFX_MASK, | 1138 | .clksel_mask = OMAP_CLKSEL_GFX_MASK, |
1209 | .clksel = gfx_l3_clksel, | 1139 | .clksel = gfx_l3_clksel, |
1210 | .flags = CLOCK_IN_OMAP3430ES1 | RATE_PROPAGATES | | ||
1211 | PARENT_CONTROLS_CLOCK, | ||
1212 | .clkdm_name = "gfx_3430es1_clkdm", | 1140 | .clkdm_name = "gfx_3430es1_clkdm", |
1213 | .recalc = &omap2_clksel_recalc, | 1141 | .recalc = &omap2_clksel_recalc, |
1214 | }; | 1142 | }; |
1215 | 1143 | ||
1216 | static struct clk gfx_l3_ick = { | 1144 | static struct clk gfx_l3_ick = { |
1217 | .name = "gfx_l3_ick", | 1145 | .name = "gfx_l3_ick", |
1146 | .ops = &clkops_null, | ||
1218 | .parent = &gfx_l3_ck, | 1147 | .parent = &gfx_l3_ck, |
1219 | .flags = CLOCK_IN_OMAP3430ES1 | PARENT_CONTROLS_CLOCK, | ||
1220 | .clkdm_name = "gfx_3430es1_clkdm", | 1148 | .clkdm_name = "gfx_3430es1_clkdm", |
1221 | .recalc = &followparent_recalc, | 1149 | .recalc = &followparent_recalc, |
1222 | }; | 1150 | }; |
1223 | 1151 | ||
1224 | static struct clk gfx_cg1_ck = { | 1152 | static struct clk gfx_cg1_ck = { |
1225 | .name = "gfx_cg1_ck", | 1153 | .name = "gfx_cg1_ck", |
1154 | .ops = &clkops_omap2_dflt_wait, | ||
1226 | .parent = &gfx_l3_fck, /* REVISIT: correct? */ | 1155 | .parent = &gfx_l3_fck, /* REVISIT: correct? */ |
1227 | .init = &omap2_init_clk_clkdm, | 1156 | .init = &omap2_init_clk_clkdm, |
1228 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), | 1157 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), |
1229 | .enable_bit = OMAP3430ES1_EN_2D_SHIFT, | 1158 | .enable_bit = OMAP3430ES1_EN_2D_SHIFT, |
1230 | .flags = CLOCK_IN_OMAP3430ES1, | ||
1231 | .clkdm_name = "gfx_3430es1_clkdm", | 1159 | .clkdm_name = "gfx_3430es1_clkdm", |
1232 | .recalc = &followparent_recalc, | 1160 | .recalc = &followparent_recalc, |
1233 | }; | 1161 | }; |
1234 | 1162 | ||
1235 | static struct clk gfx_cg2_ck = { | 1163 | static struct clk gfx_cg2_ck = { |
1236 | .name = "gfx_cg2_ck", | 1164 | .name = "gfx_cg2_ck", |
1165 | .ops = &clkops_omap2_dflt_wait, | ||
1237 | .parent = &gfx_l3_fck, /* REVISIT: correct? */ | 1166 | .parent = &gfx_l3_fck, /* REVISIT: correct? */ |
1238 | .init = &omap2_init_clk_clkdm, | 1167 | .init = &omap2_init_clk_clkdm, |
1239 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), | 1168 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), |
1240 | .enable_bit = OMAP3430ES1_EN_3D_SHIFT, | 1169 | .enable_bit = OMAP3430ES1_EN_3D_SHIFT, |
1241 | .flags = CLOCK_IN_OMAP3430ES1, | ||
1242 | .clkdm_name = "gfx_3430es1_clkdm", | 1170 | .clkdm_name = "gfx_3430es1_clkdm", |
1243 | .recalc = &followparent_recalc, | 1171 | .recalc = &followparent_recalc, |
1244 | }; | 1172 | }; |
@@ -1265,24 +1193,24 @@ static const struct clksel sgx_clksel[] = { | |||
1265 | 1193 | ||
1266 | static struct clk sgx_fck = { | 1194 | static struct clk sgx_fck = { |
1267 | .name = "sgx_fck", | 1195 | .name = "sgx_fck", |
1196 | .ops = &clkops_omap2_dflt_wait, | ||
1268 | .init = &omap2_init_clksel_parent, | 1197 | .init = &omap2_init_clksel_parent, |
1269 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_FCLKEN), | 1198 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_FCLKEN), |
1270 | .enable_bit = OMAP3430ES2_EN_SGX_SHIFT, | 1199 | .enable_bit = OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT, |
1271 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_CLKSEL), | 1200 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_CLKSEL), |
1272 | .clksel_mask = OMAP3430ES2_CLKSEL_SGX_MASK, | 1201 | .clksel_mask = OMAP3430ES2_CLKSEL_SGX_MASK, |
1273 | .clksel = sgx_clksel, | 1202 | .clksel = sgx_clksel, |
1274 | .flags = CLOCK_IN_OMAP3430ES2, | ||
1275 | .clkdm_name = "sgx_clkdm", | 1203 | .clkdm_name = "sgx_clkdm", |
1276 | .recalc = &omap2_clksel_recalc, | 1204 | .recalc = &omap2_clksel_recalc, |
1277 | }; | 1205 | }; |
1278 | 1206 | ||
1279 | static struct clk sgx_ick = { | 1207 | static struct clk sgx_ick = { |
1280 | .name = "sgx_ick", | 1208 | .name = "sgx_ick", |
1209 | .ops = &clkops_omap2_dflt_wait, | ||
1281 | .parent = &l3_ick, | 1210 | .parent = &l3_ick, |
1282 | .init = &omap2_init_clk_clkdm, | 1211 | .init = &omap2_init_clk_clkdm, |
1283 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_ICLKEN), | 1212 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_ICLKEN), |
1284 | .enable_bit = OMAP3430ES2_EN_SGX_SHIFT, | 1213 | .enable_bit = OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT, |
1285 | .flags = CLOCK_IN_OMAP3430ES2, | ||
1286 | .clkdm_name = "sgx_clkdm", | 1214 | .clkdm_name = "sgx_clkdm", |
1287 | .recalc = &followparent_recalc, | 1215 | .recalc = &followparent_recalc, |
1288 | }; | 1216 | }; |
@@ -1291,11 +1219,11 @@ static struct clk sgx_ick = { | |||
1291 | 1219 | ||
1292 | static struct clk d2d_26m_fck = { | 1220 | static struct clk d2d_26m_fck = { |
1293 | .name = "d2d_26m_fck", | 1221 | .name = "d2d_26m_fck", |
1222 | .ops = &clkops_omap2_dflt_wait, | ||
1294 | .parent = &sys_ck, | 1223 | .parent = &sys_ck, |
1295 | .init = &omap2_init_clk_clkdm, | 1224 | .init = &omap2_init_clk_clkdm, |
1296 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1225 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1297 | .enable_bit = OMAP3430ES1_EN_D2D_SHIFT, | 1226 | .enable_bit = OMAP3430ES1_EN_D2D_SHIFT, |
1298 | .flags = CLOCK_IN_OMAP3430ES1, | ||
1299 | .clkdm_name = "d2d_clkdm", | 1227 | .clkdm_name = "d2d_clkdm", |
1300 | .recalc = &followparent_recalc, | 1228 | .recalc = &followparent_recalc, |
1301 | }; | 1229 | }; |
@@ -1308,6 +1236,7 @@ static const struct clksel omap343x_gpt_clksel[] = { | |||
1308 | 1236 | ||
1309 | static struct clk gpt10_fck = { | 1237 | static struct clk gpt10_fck = { |
1310 | .name = "gpt10_fck", | 1238 | .name = "gpt10_fck", |
1239 | .ops = &clkops_omap2_dflt_wait, | ||
1311 | .parent = &sys_ck, | 1240 | .parent = &sys_ck, |
1312 | .init = &omap2_init_clksel_parent, | 1241 | .init = &omap2_init_clksel_parent, |
1313 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1242 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
@@ -1315,13 +1244,13 @@ static struct clk gpt10_fck = { | |||
1315 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), | 1244 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), |
1316 | .clksel_mask = OMAP3430_CLKSEL_GPT10_MASK, | 1245 | .clksel_mask = OMAP3430_CLKSEL_GPT10_MASK, |
1317 | .clksel = omap343x_gpt_clksel, | 1246 | .clksel = omap343x_gpt_clksel, |
1318 | .flags = CLOCK_IN_OMAP343X, | ||
1319 | .clkdm_name = "core_l4_clkdm", | 1247 | .clkdm_name = "core_l4_clkdm", |
1320 | .recalc = &omap2_clksel_recalc, | 1248 | .recalc = &omap2_clksel_recalc, |
1321 | }; | 1249 | }; |
1322 | 1250 | ||
1323 | static struct clk gpt11_fck = { | 1251 | static struct clk gpt11_fck = { |
1324 | .name = "gpt11_fck", | 1252 | .name = "gpt11_fck", |
1253 | .ops = &clkops_omap2_dflt_wait, | ||
1325 | .parent = &sys_ck, | 1254 | .parent = &sys_ck, |
1326 | .init = &omap2_init_clksel_parent, | 1255 | .init = &omap2_init_clksel_parent, |
1327 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1256 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
@@ -1329,35 +1258,34 @@ static struct clk gpt11_fck = { | |||
1329 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), | 1258 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), |
1330 | .clksel_mask = OMAP3430_CLKSEL_GPT11_MASK, | 1259 | .clksel_mask = OMAP3430_CLKSEL_GPT11_MASK, |
1331 | .clksel = omap343x_gpt_clksel, | 1260 | .clksel = omap343x_gpt_clksel, |
1332 | .flags = CLOCK_IN_OMAP343X, | ||
1333 | .clkdm_name = "core_l4_clkdm", | 1261 | .clkdm_name = "core_l4_clkdm", |
1334 | .recalc = &omap2_clksel_recalc, | 1262 | .recalc = &omap2_clksel_recalc, |
1335 | }; | 1263 | }; |
1336 | 1264 | ||
1337 | static struct clk cpefuse_fck = { | 1265 | static struct clk cpefuse_fck = { |
1338 | .name = "cpefuse_fck", | 1266 | .name = "cpefuse_fck", |
1267 | .ops = &clkops_omap2_dflt, | ||
1339 | .parent = &sys_ck, | 1268 | .parent = &sys_ck, |
1340 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), | 1269 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), |
1341 | .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT, | 1270 | .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT, |
1342 | .flags = CLOCK_IN_OMAP3430ES2, | ||
1343 | .recalc = &followparent_recalc, | 1271 | .recalc = &followparent_recalc, |
1344 | }; | 1272 | }; |
1345 | 1273 | ||
1346 | static struct clk ts_fck = { | 1274 | static struct clk ts_fck = { |
1347 | .name = "ts_fck", | 1275 | .name = "ts_fck", |
1276 | .ops = &clkops_omap2_dflt, | ||
1348 | .parent = &omap_32k_fck, | 1277 | .parent = &omap_32k_fck, |
1349 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), | 1278 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), |
1350 | .enable_bit = OMAP3430ES2_EN_TS_SHIFT, | 1279 | .enable_bit = OMAP3430ES2_EN_TS_SHIFT, |
1351 | .flags = CLOCK_IN_OMAP3430ES2, | ||
1352 | .recalc = &followparent_recalc, | 1280 | .recalc = &followparent_recalc, |
1353 | }; | 1281 | }; |
1354 | 1282 | ||
1355 | static struct clk usbtll_fck = { | 1283 | static struct clk usbtll_fck = { |
1356 | .name = "usbtll_fck", | 1284 | .name = "usbtll_fck", |
1357 | .parent = &omap_120m_fck, | 1285 | .ops = &clkops_omap2_dflt, |
1286 | .parent = &dpll5_m2_ck, | ||
1358 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), | 1287 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), |
1359 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, | 1288 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, |
1360 | .flags = CLOCK_IN_OMAP3430ES2, | ||
1361 | .recalc = &followparent_recalc, | 1289 | .recalc = &followparent_recalc, |
1362 | }; | 1290 | }; |
1363 | 1291 | ||
@@ -1365,84 +1293,83 @@ static struct clk usbtll_fck = { | |||
1365 | 1293 | ||
1366 | static struct clk core_96m_fck = { | 1294 | static struct clk core_96m_fck = { |
1367 | .name = "core_96m_fck", | 1295 | .name = "core_96m_fck", |
1296 | .ops = &clkops_null, | ||
1368 | .parent = &omap_96m_fck, | 1297 | .parent = &omap_96m_fck, |
1369 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1370 | PARENT_CONTROLS_CLOCK, | ||
1371 | .clkdm_name = "core_l4_clkdm", | 1298 | .clkdm_name = "core_l4_clkdm", |
1372 | .recalc = &followparent_recalc, | 1299 | .recalc = &followparent_recalc, |
1373 | }; | 1300 | }; |
1374 | 1301 | ||
1375 | static struct clk mmchs3_fck = { | 1302 | static struct clk mmchs3_fck = { |
1376 | .name = "mmchs_fck", | 1303 | .name = "mmchs_fck", |
1304 | .ops = &clkops_omap2_dflt_wait, | ||
1377 | .id = 2, | 1305 | .id = 2, |
1378 | .parent = &core_96m_fck, | 1306 | .parent = &core_96m_fck, |
1379 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1307 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1380 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, | 1308 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, |
1381 | .flags = CLOCK_IN_OMAP3430ES2, | ||
1382 | .clkdm_name = "core_l4_clkdm", | 1309 | .clkdm_name = "core_l4_clkdm", |
1383 | .recalc = &followparent_recalc, | 1310 | .recalc = &followparent_recalc, |
1384 | }; | 1311 | }; |
1385 | 1312 | ||
1386 | static struct clk mmchs2_fck = { | 1313 | static struct clk mmchs2_fck = { |
1387 | .name = "mmchs_fck", | 1314 | .name = "mmchs_fck", |
1315 | .ops = &clkops_omap2_dflt_wait, | ||
1388 | .id = 1, | 1316 | .id = 1, |
1389 | .parent = &core_96m_fck, | 1317 | .parent = &core_96m_fck, |
1390 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1318 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1391 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, | 1319 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, |
1392 | .flags = CLOCK_IN_OMAP343X, | ||
1393 | .clkdm_name = "core_l4_clkdm", | 1320 | .clkdm_name = "core_l4_clkdm", |
1394 | .recalc = &followparent_recalc, | 1321 | .recalc = &followparent_recalc, |
1395 | }; | 1322 | }; |
1396 | 1323 | ||
1397 | static struct clk mspro_fck = { | 1324 | static struct clk mspro_fck = { |
1398 | .name = "mspro_fck", | 1325 | .name = "mspro_fck", |
1326 | .ops = &clkops_omap2_dflt_wait, | ||
1399 | .parent = &core_96m_fck, | 1327 | .parent = &core_96m_fck, |
1400 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1328 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1401 | .enable_bit = OMAP3430_EN_MSPRO_SHIFT, | 1329 | .enable_bit = OMAP3430_EN_MSPRO_SHIFT, |
1402 | .flags = CLOCK_IN_OMAP343X, | ||
1403 | .clkdm_name = "core_l4_clkdm", | 1330 | .clkdm_name = "core_l4_clkdm", |
1404 | .recalc = &followparent_recalc, | 1331 | .recalc = &followparent_recalc, |
1405 | }; | 1332 | }; |
1406 | 1333 | ||
1407 | static struct clk mmchs1_fck = { | 1334 | static struct clk mmchs1_fck = { |
1408 | .name = "mmchs_fck", | 1335 | .name = "mmchs_fck", |
1336 | .ops = &clkops_omap2_dflt_wait, | ||
1409 | .parent = &core_96m_fck, | 1337 | .parent = &core_96m_fck, |
1410 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1338 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1411 | .enable_bit = OMAP3430_EN_MMC1_SHIFT, | 1339 | .enable_bit = OMAP3430_EN_MMC1_SHIFT, |
1412 | .flags = CLOCK_IN_OMAP343X, | ||
1413 | .clkdm_name = "core_l4_clkdm", | 1340 | .clkdm_name = "core_l4_clkdm", |
1414 | .recalc = &followparent_recalc, | 1341 | .recalc = &followparent_recalc, |
1415 | }; | 1342 | }; |
1416 | 1343 | ||
1417 | static struct clk i2c3_fck = { | 1344 | static struct clk i2c3_fck = { |
1418 | .name = "i2c_fck", | 1345 | .name = "i2c_fck", |
1346 | .ops = &clkops_omap2_dflt_wait, | ||
1419 | .id = 3, | 1347 | .id = 3, |
1420 | .parent = &core_96m_fck, | 1348 | .parent = &core_96m_fck, |
1421 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1349 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1422 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, | 1350 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, |
1423 | .flags = CLOCK_IN_OMAP343X, | ||
1424 | .clkdm_name = "core_l4_clkdm", | 1351 | .clkdm_name = "core_l4_clkdm", |
1425 | .recalc = &followparent_recalc, | 1352 | .recalc = &followparent_recalc, |
1426 | }; | 1353 | }; |
1427 | 1354 | ||
1428 | static struct clk i2c2_fck = { | 1355 | static struct clk i2c2_fck = { |
1429 | .name = "i2c_fck", | 1356 | .name = "i2c_fck", |
1357 | .ops = &clkops_omap2_dflt_wait, | ||
1430 | .id = 2, | 1358 | .id = 2, |
1431 | .parent = &core_96m_fck, | 1359 | .parent = &core_96m_fck, |
1432 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1360 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1433 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, | 1361 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, |
1434 | .flags = CLOCK_IN_OMAP343X, | ||
1435 | .clkdm_name = "core_l4_clkdm", | 1362 | .clkdm_name = "core_l4_clkdm", |
1436 | .recalc = &followparent_recalc, | 1363 | .recalc = &followparent_recalc, |
1437 | }; | 1364 | }; |
1438 | 1365 | ||
1439 | static struct clk i2c1_fck = { | 1366 | static struct clk i2c1_fck = { |
1440 | .name = "i2c_fck", | 1367 | .name = "i2c_fck", |
1368 | .ops = &clkops_omap2_dflt_wait, | ||
1441 | .id = 1, | 1369 | .id = 1, |
1442 | .parent = &core_96m_fck, | 1370 | .parent = &core_96m_fck, |
1443 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1371 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1444 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, | 1372 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, |
1445 | .flags = CLOCK_IN_OMAP343X, | ||
1446 | .clkdm_name = "core_l4_clkdm", | 1373 | .clkdm_name = "core_l4_clkdm", |
1447 | .recalc = &followparent_recalc, | 1374 | .recalc = &followparent_recalc, |
1448 | }; | 1375 | }; |
@@ -1469,6 +1396,7 @@ static const struct clksel mcbsp_15_clksel[] = { | |||
1469 | 1396 | ||
1470 | static struct clk mcbsp5_fck = { | 1397 | static struct clk mcbsp5_fck = { |
1471 | .name = "mcbsp_fck", | 1398 | .name = "mcbsp_fck", |
1399 | .ops = &clkops_omap2_dflt_wait, | ||
1472 | .id = 5, | 1400 | .id = 5, |
1473 | .init = &omap2_init_clksel_parent, | 1401 | .init = &omap2_init_clksel_parent, |
1474 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1402 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
@@ -1476,13 +1404,13 @@ static struct clk mcbsp5_fck = { | |||
1476 | .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1), | 1404 | .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1), |
1477 | .clksel_mask = OMAP2_MCBSP5_CLKS_MASK, | 1405 | .clksel_mask = OMAP2_MCBSP5_CLKS_MASK, |
1478 | .clksel = mcbsp_15_clksel, | 1406 | .clksel = mcbsp_15_clksel, |
1479 | .flags = CLOCK_IN_OMAP343X, | ||
1480 | .clkdm_name = "core_l4_clkdm", | 1407 | .clkdm_name = "core_l4_clkdm", |
1481 | .recalc = &omap2_clksel_recalc, | 1408 | .recalc = &omap2_clksel_recalc, |
1482 | }; | 1409 | }; |
1483 | 1410 | ||
1484 | static struct clk mcbsp1_fck = { | 1411 | static struct clk mcbsp1_fck = { |
1485 | .name = "mcbsp_fck", | 1412 | .name = "mcbsp_fck", |
1413 | .ops = &clkops_omap2_dflt_wait, | ||
1486 | .id = 1, | 1414 | .id = 1, |
1487 | .init = &omap2_init_clksel_parent, | 1415 | .init = &omap2_init_clksel_parent, |
1488 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1416 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
@@ -1490,7 +1418,6 @@ static struct clk mcbsp1_fck = { | |||
1490 | .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), | 1418 | .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), |
1491 | .clksel_mask = OMAP2_MCBSP1_CLKS_MASK, | 1419 | .clksel_mask = OMAP2_MCBSP1_CLKS_MASK, |
1492 | .clksel = mcbsp_15_clksel, | 1420 | .clksel = mcbsp_15_clksel, |
1493 | .flags = CLOCK_IN_OMAP343X, | ||
1494 | .clkdm_name = "core_l4_clkdm", | 1421 | .clkdm_name = "core_l4_clkdm", |
1495 | .recalc = &omap2_clksel_recalc, | 1422 | .recalc = &omap2_clksel_recalc, |
1496 | }; | 1423 | }; |
@@ -1499,77 +1426,76 @@ static struct clk mcbsp1_fck = { | |||
1499 | 1426 | ||
1500 | static struct clk core_48m_fck = { | 1427 | static struct clk core_48m_fck = { |
1501 | .name = "core_48m_fck", | 1428 | .name = "core_48m_fck", |
1429 | .ops = &clkops_null, | ||
1502 | .parent = &omap_48m_fck, | 1430 | .parent = &omap_48m_fck, |
1503 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1504 | PARENT_CONTROLS_CLOCK, | ||
1505 | .clkdm_name = "core_l4_clkdm", | 1431 | .clkdm_name = "core_l4_clkdm", |
1506 | .recalc = &followparent_recalc, | 1432 | .recalc = &followparent_recalc, |
1507 | }; | 1433 | }; |
1508 | 1434 | ||
1509 | static struct clk mcspi4_fck = { | 1435 | static struct clk mcspi4_fck = { |
1510 | .name = "mcspi_fck", | 1436 | .name = "mcspi_fck", |
1437 | .ops = &clkops_omap2_dflt_wait, | ||
1511 | .id = 4, | 1438 | .id = 4, |
1512 | .parent = &core_48m_fck, | 1439 | .parent = &core_48m_fck, |
1513 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1440 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1514 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, | 1441 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, |
1515 | .flags = CLOCK_IN_OMAP343X, | ||
1516 | .recalc = &followparent_recalc, | 1442 | .recalc = &followparent_recalc, |
1517 | }; | 1443 | }; |
1518 | 1444 | ||
1519 | static struct clk mcspi3_fck = { | 1445 | static struct clk mcspi3_fck = { |
1520 | .name = "mcspi_fck", | 1446 | .name = "mcspi_fck", |
1447 | .ops = &clkops_omap2_dflt_wait, | ||
1521 | .id = 3, | 1448 | .id = 3, |
1522 | .parent = &core_48m_fck, | 1449 | .parent = &core_48m_fck, |
1523 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1450 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1524 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, | 1451 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, |
1525 | .flags = CLOCK_IN_OMAP343X, | ||
1526 | .recalc = &followparent_recalc, | 1452 | .recalc = &followparent_recalc, |
1527 | }; | 1453 | }; |
1528 | 1454 | ||
1529 | static struct clk mcspi2_fck = { | 1455 | static struct clk mcspi2_fck = { |
1530 | .name = "mcspi_fck", | 1456 | .name = "mcspi_fck", |
1457 | .ops = &clkops_omap2_dflt_wait, | ||
1531 | .id = 2, | 1458 | .id = 2, |
1532 | .parent = &core_48m_fck, | 1459 | .parent = &core_48m_fck, |
1533 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1460 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1534 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, | 1461 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, |
1535 | .flags = CLOCK_IN_OMAP343X, | ||
1536 | .recalc = &followparent_recalc, | 1462 | .recalc = &followparent_recalc, |
1537 | }; | 1463 | }; |
1538 | 1464 | ||
1539 | static struct clk mcspi1_fck = { | 1465 | static struct clk mcspi1_fck = { |
1540 | .name = "mcspi_fck", | 1466 | .name = "mcspi_fck", |
1467 | .ops = &clkops_omap2_dflt_wait, | ||
1541 | .id = 1, | 1468 | .id = 1, |
1542 | .parent = &core_48m_fck, | 1469 | .parent = &core_48m_fck, |
1543 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1470 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1544 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, | 1471 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, |
1545 | .flags = CLOCK_IN_OMAP343X, | ||
1546 | .recalc = &followparent_recalc, | 1472 | .recalc = &followparent_recalc, |
1547 | }; | 1473 | }; |
1548 | 1474 | ||
1549 | static struct clk uart2_fck = { | 1475 | static struct clk uart2_fck = { |
1550 | .name = "uart2_fck", | 1476 | .name = "uart2_fck", |
1477 | .ops = &clkops_omap2_dflt_wait, | ||
1551 | .parent = &core_48m_fck, | 1478 | .parent = &core_48m_fck, |
1552 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1479 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1553 | .enable_bit = OMAP3430_EN_UART2_SHIFT, | 1480 | .enable_bit = OMAP3430_EN_UART2_SHIFT, |
1554 | .flags = CLOCK_IN_OMAP343X, | ||
1555 | .recalc = &followparent_recalc, | 1481 | .recalc = &followparent_recalc, |
1556 | }; | 1482 | }; |
1557 | 1483 | ||
1558 | static struct clk uart1_fck = { | 1484 | static struct clk uart1_fck = { |
1559 | .name = "uart1_fck", | 1485 | .name = "uart1_fck", |
1486 | .ops = &clkops_omap2_dflt_wait, | ||
1560 | .parent = &core_48m_fck, | 1487 | .parent = &core_48m_fck, |
1561 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1488 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1562 | .enable_bit = OMAP3430_EN_UART1_SHIFT, | 1489 | .enable_bit = OMAP3430_EN_UART1_SHIFT, |
1563 | .flags = CLOCK_IN_OMAP343X, | ||
1564 | .recalc = &followparent_recalc, | 1490 | .recalc = &followparent_recalc, |
1565 | }; | 1491 | }; |
1566 | 1492 | ||
1567 | static struct clk fshostusb_fck = { | 1493 | static struct clk fshostusb_fck = { |
1568 | .name = "fshostusb_fck", | 1494 | .name = "fshostusb_fck", |
1495 | .ops = &clkops_omap2_dflt_wait, | ||
1569 | .parent = &core_48m_fck, | 1496 | .parent = &core_48m_fck, |
1570 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1497 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1571 | .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT, | 1498 | .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT, |
1572 | .flags = CLOCK_IN_OMAP3430ES1, | ||
1573 | .recalc = &followparent_recalc, | 1499 | .recalc = &followparent_recalc, |
1574 | }; | 1500 | }; |
1575 | 1501 | ||
@@ -1577,19 +1503,18 @@ static struct clk fshostusb_fck = { | |||
1577 | 1503 | ||
1578 | static struct clk core_12m_fck = { | 1504 | static struct clk core_12m_fck = { |
1579 | .name = "core_12m_fck", | 1505 | .name = "core_12m_fck", |
1506 | .ops = &clkops_null, | ||
1580 | .parent = &omap_12m_fck, | 1507 | .parent = &omap_12m_fck, |
1581 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1582 | PARENT_CONTROLS_CLOCK, | ||
1583 | .clkdm_name = "core_l4_clkdm", | 1508 | .clkdm_name = "core_l4_clkdm", |
1584 | .recalc = &followparent_recalc, | 1509 | .recalc = &followparent_recalc, |
1585 | }; | 1510 | }; |
1586 | 1511 | ||
1587 | static struct clk hdq_fck = { | 1512 | static struct clk hdq_fck = { |
1588 | .name = "hdq_fck", | 1513 | .name = "hdq_fck", |
1514 | .ops = &clkops_omap2_dflt_wait, | ||
1589 | .parent = &core_12m_fck, | 1515 | .parent = &core_12m_fck, |
1590 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1516 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1591 | .enable_bit = OMAP3430_EN_HDQ_SHIFT, | 1517 | .enable_bit = OMAP3430_EN_HDQ_SHIFT, |
1592 | .flags = CLOCK_IN_OMAP343X, | ||
1593 | .recalc = &followparent_recalc, | 1518 | .recalc = &followparent_recalc, |
1594 | }; | 1519 | }; |
1595 | 1520 | ||
@@ -1612,22 +1537,22 @@ static const struct clksel ssi_ssr_clksel[] = { | |||
1612 | 1537 | ||
1613 | static struct clk ssi_ssr_fck = { | 1538 | static struct clk ssi_ssr_fck = { |
1614 | .name = "ssi_ssr_fck", | 1539 | .name = "ssi_ssr_fck", |
1540 | .ops = &clkops_omap2_dflt, | ||
1615 | .init = &omap2_init_clksel_parent, | 1541 | .init = &omap2_init_clksel_parent, |
1616 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1542 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1617 | .enable_bit = OMAP3430_EN_SSI_SHIFT, | 1543 | .enable_bit = OMAP3430_EN_SSI_SHIFT, |
1618 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), | 1544 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), |
1619 | .clksel_mask = OMAP3430_CLKSEL_SSI_MASK, | 1545 | .clksel_mask = OMAP3430_CLKSEL_SSI_MASK, |
1620 | .clksel = ssi_ssr_clksel, | 1546 | .clksel = ssi_ssr_clksel, |
1621 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, | ||
1622 | .clkdm_name = "core_l4_clkdm", | 1547 | .clkdm_name = "core_l4_clkdm", |
1623 | .recalc = &omap2_clksel_recalc, | 1548 | .recalc = &omap2_clksel_recalc, |
1624 | }; | 1549 | }; |
1625 | 1550 | ||
1626 | static struct clk ssi_sst_fck = { | 1551 | static struct clk ssi_sst_fck = { |
1627 | .name = "ssi_sst_fck", | 1552 | .name = "ssi_sst_fck", |
1553 | .ops = &clkops_null, | ||
1628 | .parent = &ssi_ssr_fck, | 1554 | .parent = &ssi_ssr_fck, |
1629 | .fixed_div = 2, | 1555 | .fixed_div = 2, |
1630 | .flags = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK, | ||
1631 | .recalc = &omap2_fixed_divisor_recalc, | 1556 | .recalc = &omap2_fixed_divisor_recalc, |
1632 | }; | 1557 | }; |
1633 | 1558 | ||
@@ -1641,39 +1566,39 @@ static struct clk ssi_sst_fck = { | |||
1641 | */ | 1566 | */ |
1642 | static struct clk core_l3_ick = { | 1567 | static struct clk core_l3_ick = { |
1643 | .name = "core_l3_ick", | 1568 | .name = "core_l3_ick", |
1569 | .ops = &clkops_null, | ||
1644 | .parent = &l3_ick, | 1570 | .parent = &l3_ick, |
1645 | .init = &omap2_init_clk_clkdm, | 1571 | .init = &omap2_init_clk_clkdm, |
1646 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1647 | PARENT_CONTROLS_CLOCK, | ||
1648 | .clkdm_name = "core_l3_clkdm", | 1572 | .clkdm_name = "core_l3_clkdm", |
1649 | .recalc = &followparent_recalc, | 1573 | .recalc = &followparent_recalc, |
1650 | }; | 1574 | }; |
1651 | 1575 | ||
1652 | static struct clk hsotgusb_ick = { | 1576 | static struct clk hsotgusb_ick = { |
1653 | .name = "hsotgusb_ick", | 1577 | .name = "hsotgusb_ick", |
1578 | .ops = &clkops_omap2_dflt_wait, | ||
1654 | .parent = &core_l3_ick, | 1579 | .parent = &core_l3_ick, |
1655 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1580 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1656 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, | 1581 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, |
1657 | .flags = CLOCK_IN_OMAP343X, | ||
1658 | .clkdm_name = "core_l3_clkdm", | 1582 | .clkdm_name = "core_l3_clkdm", |
1659 | .recalc = &followparent_recalc, | 1583 | .recalc = &followparent_recalc, |
1660 | }; | 1584 | }; |
1661 | 1585 | ||
1662 | static struct clk sdrc_ick = { | 1586 | static struct clk sdrc_ick = { |
1663 | .name = "sdrc_ick", | 1587 | .name = "sdrc_ick", |
1588 | .ops = &clkops_omap2_dflt_wait, | ||
1664 | .parent = &core_l3_ick, | 1589 | .parent = &core_l3_ick, |
1665 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1590 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1666 | .enable_bit = OMAP3430_EN_SDRC_SHIFT, | 1591 | .enable_bit = OMAP3430_EN_SDRC_SHIFT, |
1667 | .flags = CLOCK_IN_OMAP343X | ENABLE_ON_INIT, | 1592 | .flags = ENABLE_ON_INIT, |
1668 | .clkdm_name = "core_l3_clkdm", | 1593 | .clkdm_name = "core_l3_clkdm", |
1669 | .recalc = &followparent_recalc, | 1594 | .recalc = &followparent_recalc, |
1670 | }; | 1595 | }; |
1671 | 1596 | ||
1672 | static struct clk gpmc_fck = { | 1597 | static struct clk gpmc_fck = { |
1673 | .name = "gpmc_fck", | 1598 | .name = "gpmc_fck", |
1599 | .ops = &clkops_null, | ||
1674 | .parent = &core_l3_ick, | 1600 | .parent = &core_l3_ick, |
1675 | .flags = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK | | 1601 | .flags = ENABLE_ON_INIT, /* huh? */ |
1676 | ENABLE_ON_INIT, | ||
1677 | .clkdm_name = "core_l3_clkdm", | 1602 | .clkdm_name = "core_l3_clkdm", |
1678 | .recalc = &followparent_recalc, | 1603 | .recalc = &followparent_recalc, |
1679 | }; | 1604 | }; |
@@ -1682,18 +1607,17 @@ static struct clk gpmc_fck = { | |||
1682 | 1607 | ||
1683 | static struct clk security_l3_ick = { | 1608 | static struct clk security_l3_ick = { |
1684 | .name = "security_l3_ick", | 1609 | .name = "security_l3_ick", |
1610 | .ops = &clkops_null, | ||
1685 | .parent = &l3_ick, | 1611 | .parent = &l3_ick, |
1686 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1687 | PARENT_CONTROLS_CLOCK, | ||
1688 | .recalc = &followparent_recalc, | 1612 | .recalc = &followparent_recalc, |
1689 | }; | 1613 | }; |
1690 | 1614 | ||
1691 | static struct clk pka_ick = { | 1615 | static struct clk pka_ick = { |
1692 | .name = "pka_ick", | 1616 | .name = "pka_ick", |
1617 | .ops = &clkops_omap2_dflt_wait, | ||
1693 | .parent = &security_l3_ick, | 1618 | .parent = &security_l3_ick, |
1694 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1619 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
1695 | .enable_bit = OMAP3430_EN_PKA_SHIFT, | 1620 | .enable_bit = OMAP3430_EN_PKA_SHIFT, |
1696 | .flags = CLOCK_IN_OMAP343X, | ||
1697 | .recalc = &followparent_recalc, | 1621 | .recalc = &followparent_recalc, |
1698 | }; | 1622 | }; |
1699 | 1623 | ||
@@ -1701,31 +1625,30 @@ static struct clk pka_ick = { | |||
1701 | 1625 | ||
1702 | static struct clk core_l4_ick = { | 1626 | static struct clk core_l4_ick = { |
1703 | .name = "core_l4_ick", | 1627 | .name = "core_l4_ick", |
1628 | .ops = &clkops_null, | ||
1704 | .parent = &l4_ick, | 1629 | .parent = &l4_ick, |
1705 | .init = &omap2_init_clk_clkdm, | 1630 | .init = &omap2_init_clk_clkdm, |
1706 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1707 | PARENT_CONTROLS_CLOCK, | ||
1708 | .clkdm_name = "core_l4_clkdm", | 1631 | .clkdm_name = "core_l4_clkdm", |
1709 | .recalc = &followparent_recalc, | 1632 | .recalc = &followparent_recalc, |
1710 | }; | 1633 | }; |
1711 | 1634 | ||
1712 | static struct clk usbtll_ick = { | 1635 | static struct clk usbtll_ick = { |
1713 | .name = "usbtll_ick", | 1636 | .name = "usbtll_ick", |
1637 | .ops = &clkops_omap2_dflt_wait, | ||
1714 | .parent = &core_l4_ick, | 1638 | .parent = &core_l4_ick, |
1715 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | 1639 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), |
1716 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, | 1640 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, |
1717 | .flags = CLOCK_IN_OMAP3430ES2, | ||
1718 | .clkdm_name = "core_l4_clkdm", | 1641 | .clkdm_name = "core_l4_clkdm", |
1719 | .recalc = &followparent_recalc, | 1642 | .recalc = &followparent_recalc, |
1720 | }; | 1643 | }; |
1721 | 1644 | ||
1722 | static struct clk mmchs3_ick = { | 1645 | static struct clk mmchs3_ick = { |
1723 | .name = "mmchs_ick", | 1646 | .name = "mmchs_ick", |
1647 | .ops = &clkops_omap2_dflt_wait, | ||
1724 | .id = 2, | 1648 | .id = 2, |
1725 | .parent = &core_l4_ick, | 1649 | .parent = &core_l4_ick, |
1726 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1650 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1727 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, | 1651 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, |
1728 | .flags = CLOCK_IN_OMAP3430ES2, | ||
1729 | .clkdm_name = "core_l4_clkdm", | 1652 | .clkdm_name = "core_l4_clkdm", |
1730 | .recalc = &followparent_recalc, | 1653 | .recalc = &followparent_recalc, |
1731 | }; | 1654 | }; |
@@ -1733,250 +1656,251 @@ static struct clk mmchs3_ick = { | |||
1733 | /* Intersystem Communication Registers - chassis mode only */ | 1656 | /* Intersystem Communication Registers - chassis mode only */ |
1734 | static struct clk icr_ick = { | 1657 | static struct clk icr_ick = { |
1735 | .name = "icr_ick", | 1658 | .name = "icr_ick", |
1659 | .ops = &clkops_omap2_dflt_wait, | ||
1736 | .parent = &core_l4_ick, | 1660 | .parent = &core_l4_ick, |
1737 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1661 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1738 | .enable_bit = OMAP3430_EN_ICR_SHIFT, | 1662 | .enable_bit = OMAP3430_EN_ICR_SHIFT, |
1739 | .flags = CLOCK_IN_OMAP343X, | ||
1740 | .clkdm_name = "core_l4_clkdm", | 1663 | .clkdm_name = "core_l4_clkdm", |
1741 | .recalc = &followparent_recalc, | 1664 | .recalc = &followparent_recalc, |
1742 | }; | 1665 | }; |
1743 | 1666 | ||
1744 | static struct clk aes2_ick = { | 1667 | static struct clk aes2_ick = { |
1745 | .name = "aes2_ick", | 1668 | .name = "aes2_ick", |
1669 | .ops = &clkops_omap2_dflt_wait, | ||
1746 | .parent = &core_l4_ick, | 1670 | .parent = &core_l4_ick, |
1747 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1671 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1748 | .enable_bit = OMAP3430_EN_AES2_SHIFT, | 1672 | .enable_bit = OMAP3430_EN_AES2_SHIFT, |
1749 | .flags = CLOCK_IN_OMAP343X, | ||
1750 | .clkdm_name = "core_l4_clkdm", | 1673 | .clkdm_name = "core_l4_clkdm", |
1751 | .recalc = &followparent_recalc, | 1674 | .recalc = &followparent_recalc, |
1752 | }; | 1675 | }; |
1753 | 1676 | ||
1754 | static struct clk sha12_ick = { | 1677 | static struct clk sha12_ick = { |
1755 | .name = "sha12_ick", | 1678 | .name = "sha12_ick", |
1679 | .ops = &clkops_omap2_dflt_wait, | ||
1756 | .parent = &core_l4_ick, | 1680 | .parent = &core_l4_ick, |
1757 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1681 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1758 | .enable_bit = OMAP3430_EN_SHA12_SHIFT, | 1682 | .enable_bit = OMAP3430_EN_SHA12_SHIFT, |
1759 | .flags = CLOCK_IN_OMAP343X, | ||
1760 | .clkdm_name = "core_l4_clkdm", | 1683 | .clkdm_name = "core_l4_clkdm", |
1761 | .recalc = &followparent_recalc, | 1684 | .recalc = &followparent_recalc, |
1762 | }; | 1685 | }; |
1763 | 1686 | ||
1764 | static struct clk des2_ick = { | 1687 | static struct clk des2_ick = { |
1765 | .name = "des2_ick", | 1688 | .name = "des2_ick", |
1689 | .ops = &clkops_omap2_dflt_wait, | ||
1766 | .parent = &core_l4_ick, | 1690 | .parent = &core_l4_ick, |
1767 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1691 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1768 | .enable_bit = OMAP3430_EN_DES2_SHIFT, | 1692 | .enable_bit = OMAP3430_EN_DES2_SHIFT, |
1769 | .flags = CLOCK_IN_OMAP343X, | ||
1770 | .clkdm_name = "core_l4_clkdm", | 1693 | .clkdm_name = "core_l4_clkdm", |
1771 | .recalc = &followparent_recalc, | 1694 | .recalc = &followparent_recalc, |
1772 | }; | 1695 | }; |
1773 | 1696 | ||
1774 | static struct clk mmchs2_ick = { | 1697 | static struct clk mmchs2_ick = { |
1775 | .name = "mmchs_ick", | 1698 | .name = "mmchs_ick", |
1699 | .ops = &clkops_omap2_dflt_wait, | ||
1776 | .id = 1, | 1700 | .id = 1, |
1777 | .parent = &core_l4_ick, | 1701 | .parent = &core_l4_ick, |
1778 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1702 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1779 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, | 1703 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, |
1780 | .flags = CLOCK_IN_OMAP343X, | ||
1781 | .clkdm_name = "core_l4_clkdm", | 1704 | .clkdm_name = "core_l4_clkdm", |
1782 | .recalc = &followparent_recalc, | 1705 | .recalc = &followparent_recalc, |
1783 | }; | 1706 | }; |
1784 | 1707 | ||
1785 | static struct clk mmchs1_ick = { | 1708 | static struct clk mmchs1_ick = { |
1786 | .name = "mmchs_ick", | 1709 | .name = "mmchs_ick", |
1710 | .ops = &clkops_omap2_dflt_wait, | ||
1787 | .parent = &core_l4_ick, | 1711 | .parent = &core_l4_ick, |
1788 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1712 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1789 | .enable_bit = OMAP3430_EN_MMC1_SHIFT, | 1713 | .enable_bit = OMAP3430_EN_MMC1_SHIFT, |
1790 | .flags = CLOCK_IN_OMAP343X, | ||
1791 | .clkdm_name = "core_l4_clkdm", | 1714 | .clkdm_name = "core_l4_clkdm", |
1792 | .recalc = &followparent_recalc, | 1715 | .recalc = &followparent_recalc, |
1793 | }; | 1716 | }; |
1794 | 1717 | ||
1795 | static struct clk mspro_ick = { | 1718 | static struct clk mspro_ick = { |
1796 | .name = "mspro_ick", | 1719 | .name = "mspro_ick", |
1720 | .ops = &clkops_omap2_dflt_wait, | ||
1797 | .parent = &core_l4_ick, | 1721 | .parent = &core_l4_ick, |
1798 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1722 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1799 | .enable_bit = OMAP3430_EN_MSPRO_SHIFT, | 1723 | .enable_bit = OMAP3430_EN_MSPRO_SHIFT, |
1800 | .flags = CLOCK_IN_OMAP343X, | ||
1801 | .clkdm_name = "core_l4_clkdm", | 1724 | .clkdm_name = "core_l4_clkdm", |
1802 | .recalc = &followparent_recalc, | 1725 | .recalc = &followparent_recalc, |
1803 | }; | 1726 | }; |
1804 | 1727 | ||
1805 | static struct clk hdq_ick = { | 1728 | static struct clk hdq_ick = { |
1806 | .name = "hdq_ick", | 1729 | .name = "hdq_ick", |
1730 | .ops = &clkops_omap2_dflt_wait, | ||
1807 | .parent = &core_l4_ick, | 1731 | .parent = &core_l4_ick, |
1808 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1732 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1809 | .enable_bit = OMAP3430_EN_HDQ_SHIFT, | 1733 | .enable_bit = OMAP3430_EN_HDQ_SHIFT, |
1810 | .flags = CLOCK_IN_OMAP343X, | ||
1811 | .clkdm_name = "core_l4_clkdm", | 1734 | .clkdm_name = "core_l4_clkdm", |
1812 | .recalc = &followparent_recalc, | 1735 | .recalc = &followparent_recalc, |
1813 | }; | 1736 | }; |
1814 | 1737 | ||
1815 | static struct clk mcspi4_ick = { | 1738 | static struct clk mcspi4_ick = { |
1816 | .name = "mcspi_ick", | 1739 | .name = "mcspi_ick", |
1740 | .ops = &clkops_omap2_dflt_wait, | ||
1817 | .id = 4, | 1741 | .id = 4, |
1818 | .parent = &core_l4_ick, | 1742 | .parent = &core_l4_ick, |
1819 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1743 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1820 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, | 1744 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, |
1821 | .flags = CLOCK_IN_OMAP343X, | ||
1822 | .clkdm_name = "core_l4_clkdm", | 1745 | .clkdm_name = "core_l4_clkdm", |
1823 | .recalc = &followparent_recalc, | 1746 | .recalc = &followparent_recalc, |
1824 | }; | 1747 | }; |
1825 | 1748 | ||
1826 | static struct clk mcspi3_ick = { | 1749 | static struct clk mcspi3_ick = { |
1827 | .name = "mcspi_ick", | 1750 | .name = "mcspi_ick", |
1751 | .ops = &clkops_omap2_dflt_wait, | ||
1828 | .id = 3, | 1752 | .id = 3, |
1829 | .parent = &core_l4_ick, | 1753 | .parent = &core_l4_ick, |
1830 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1754 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1831 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, | 1755 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, |
1832 | .flags = CLOCK_IN_OMAP343X, | ||
1833 | .clkdm_name = "core_l4_clkdm", | 1756 | .clkdm_name = "core_l4_clkdm", |
1834 | .recalc = &followparent_recalc, | 1757 | .recalc = &followparent_recalc, |
1835 | }; | 1758 | }; |
1836 | 1759 | ||
1837 | static struct clk mcspi2_ick = { | 1760 | static struct clk mcspi2_ick = { |
1838 | .name = "mcspi_ick", | 1761 | .name = "mcspi_ick", |
1762 | .ops = &clkops_omap2_dflt_wait, | ||
1839 | .id = 2, | 1763 | .id = 2, |
1840 | .parent = &core_l4_ick, | 1764 | .parent = &core_l4_ick, |
1841 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1765 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1842 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, | 1766 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, |
1843 | .flags = CLOCK_IN_OMAP343X, | ||
1844 | .clkdm_name = "core_l4_clkdm", | 1767 | .clkdm_name = "core_l4_clkdm", |
1845 | .recalc = &followparent_recalc, | 1768 | .recalc = &followparent_recalc, |
1846 | }; | 1769 | }; |
1847 | 1770 | ||
1848 | static struct clk mcspi1_ick = { | 1771 | static struct clk mcspi1_ick = { |
1849 | .name = "mcspi_ick", | 1772 | .name = "mcspi_ick", |
1773 | .ops = &clkops_omap2_dflt_wait, | ||
1850 | .id = 1, | 1774 | .id = 1, |
1851 | .parent = &core_l4_ick, | 1775 | .parent = &core_l4_ick, |
1852 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1776 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1853 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, | 1777 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, |
1854 | .flags = CLOCK_IN_OMAP343X, | ||
1855 | .clkdm_name = "core_l4_clkdm", | 1778 | .clkdm_name = "core_l4_clkdm", |
1856 | .recalc = &followparent_recalc, | 1779 | .recalc = &followparent_recalc, |
1857 | }; | 1780 | }; |
1858 | 1781 | ||
1859 | static struct clk i2c3_ick = { | 1782 | static struct clk i2c3_ick = { |
1860 | .name = "i2c_ick", | 1783 | .name = "i2c_ick", |
1784 | .ops = &clkops_omap2_dflt_wait, | ||
1861 | .id = 3, | 1785 | .id = 3, |
1862 | .parent = &core_l4_ick, | 1786 | .parent = &core_l4_ick, |
1863 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1787 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1864 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, | 1788 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, |
1865 | .flags = CLOCK_IN_OMAP343X, | ||
1866 | .clkdm_name = "core_l4_clkdm", | 1789 | .clkdm_name = "core_l4_clkdm", |
1867 | .recalc = &followparent_recalc, | 1790 | .recalc = &followparent_recalc, |
1868 | }; | 1791 | }; |
1869 | 1792 | ||
1870 | static struct clk i2c2_ick = { | 1793 | static struct clk i2c2_ick = { |
1871 | .name = "i2c_ick", | 1794 | .name = "i2c_ick", |
1795 | .ops = &clkops_omap2_dflt_wait, | ||
1872 | .id = 2, | 1796 | .id = 2, |
1873 | .parent = &core_l4_ick, | 1797 | .parent = &core_l4_ick, |
1874 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1798 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1875 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, | 1799 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, |
1876 | .flags = CLOCK_IN_OMAP343X, | ||
1877 | .clkdm_name = "core_l4_clkdm", | 1800 | .clkdm_name = "core_l4_clkdm", |
1878 | .recalc = &followparent_recalc, | 1801 | .recalc = &followparent_recalc, |
1879 | }; | 1802 | }; |
1880 | 1803 | ||
1881 | static struct clk i2c1_ick = { | 1804 | static struct clk i2c1_ick = { |
1882 | .name = "i2c_ick", | 1805 | .name = "i2c_ick", |
1806 | .ops = &clkops_omap2_dflt_wait, | ||
1883 | .id = 1, | 1807 | .id = 1, |
1884 | .parent = &core_l4_ick, | 1808 | .parent = &core_l4_ick, |
1885 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1809 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1886 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, | 1810 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, |
1887 | .flags = CLOCK_IN_OMAP343X, | ||
1888 | .clkdm_name = "core_l4_clkdm", | 1811 | .clkdm_name = "core_l4_clkdm", |
1889 | .recalc = &followparent_recalc, | 1812 | .recalc = &followparent_recalc, |
1890 | }; | 1813 | }; |
1891 | 1814 | ||
1892 | static struct clk uart2_ick = { | 1815 | static struct clk uart2_ick = { |
1893 | .name = "uart2_ick", | 1816 | .name = "uart2_ick", |
1817 | .ops = &clkops_omap2_dflt_wait, | ||
1894 | .parent = &core_l4_ick, | 1818 | .parent = &core_l4_ick, |
1895 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1819 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1896 | .enable_bit = OMAP3430_EN_UART2_SHIFT, | 1820 | .enable_bit = OMAP3430_EN_UART2_SHIFT, |
1897 | .flags = CLOCK_IN_OMAP343X, | ||
1898 | .clkdm_name = "core_l4_clkdm", | 1821 | .clkdm_name = "core_l4_clkdm", |
1899 | .recalc = &followparent_recalc, | 1822 | .recalc = &followparent_recalc, |
1900 | }; | 1823 | }; |
1901 | 1824 | ||
1902 | static struct clk uart1_ick = { | 1825 | static struct clk uart1_ick = { |
1903 | .name = "uart1_ick", | 1826 | .name = "uart1_ick", |
1827 | .ops = &clkops_omap2_dflt_wait, | ||
1904 | .parent = &core_l4_ick, | 1828 | .parent = &core_l4_ick, |
1905 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1829 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1906 | .enable_bit = OMAP3430_EN_UART1_SHIFT, | 1830 | .enable_bit = OMAP3430_EN_UART1_SHIFT, |
1907 | .flags = CLOCK_IN_OMAP343X, | ||
1908 | .clkdm_name = "core_l4_clkdm", | 1831 | .clkdm_name = "core_l4_clkdm", |
1909 | .recalc = &followparent_recalc, | 1832 | .recalc = &followparent_recalc, |
1910 | }; | 1833 | }; |
1911 | 1834 | ||
1912 | static struct clk gpt11_ick = { | 1835 | static struct clk gpt11_ick = { |
1913 | .name = "gpt11_ick", | 1836 | .name = "gpt11_ick", |
1837 | .ops = &clkops_omap2_dflt_wait, | ||
1914 | .parent = &core_l4_ick, | 1838 | .parent = &core_l4_ick, |
1915 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1839 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1916 | .enable_bit = OMAP3430_EN_GPT11_SHIFT, | 1840 | .enable_bit = OMAP3430_EN_GPT11_SHIFT, |
1917 | .flags = CLOCK_IN_OMAP343X, | ||
1918 | .clkdm_name = "core_l4_clkdm", | 1841 | .clkdm_name = "core_l4_clkdm", |
1919 | .recalc = &followparent_recalc, | 1842 | .recalc = &followparent_recalc, |
1920 | }; | 1843 | }; |
1921 | 1844 | ||
1922 | static struct clk gpt10_ick = { | 1845 | static struct clk gpt10_ick = { |
1923 | .name = "gpt10_ick", | 1846 | .name = "gpt10_ick", |
1847 | .ops = &clkops_omap2_dflt_wait, | ||
1924 | .parent = &core_l4_ick, | 1848 | .parent = &core_l4_ick, |
1925 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1849 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1926 | .enable_bit = OMAP3430_EN_GPT10_SHIFT, | 1850 | .enable_bit = OMAP3430_EN_GPT10_SHIFT, |
1927 | .flags = CLOCK_IN_OMAP343X, | ||
1928 | .clkdm_name = "core_l4_clkdm", | 1851 | .clkdm_name = "core_l4_clkdm", |
1929 | .recalc = &followparent_recalc, | 1852 | .recalc = &followparent_recalc, |
1930 | }; | 1853 | }; |
1931 | 1854 | ||
1932 | static struct clk mcbsp5_ick = { | 1855 | static struct clk mcbsp5_ick = { |
1933 | .name = "mcbsp_ick", | 1856 | .name = "mcbsp_ick", |
1857 | .ops = &clkops_omap2_dflt_wait, | ||
1934 | .id = 5, | 1858 | .id = 5, |
1935 | .parent = &core_l4_ick, | 1859 | .parent = &core_l4_ick, |
1936 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1860 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1937 | .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, | 1861 | .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, |
1938 | .flags = CLOCK_IN_OMAP343X, | ||
1939 | .clkdm_name = "core_l4_clkdm", | 1862 | .clkdm_name = "core_l4_clkdm", |
1940 | .recalc = &followparent_recalc, | 1863 | .recalc = &followparent_recalc, |
1941 | }; | 1864 | }; |
1942 | 1865 | ||
1943 | static struct clk mcbsp1_ick = { | 1866 | static struct clk mcbsp1_ick = { |
1944 | .name = "mcbsp_ick", | 1867 | .name = "mcbsp_ick", |
1868 | .ops = &clkops_omap2_dflt_wait, | ||
1945 | .id = 1, | 1869 | .id = 1, |
1946 | .parent = &core_l4_ick, | 1870 | .parent = &core_l4_ick, |
1947 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1871 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1948 | .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, | 1872 | .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, |
1949 | .flags = CLOCK_IN_OMAP343X, | ||
1950 | .clkdm_name = "core_l4_clkdm", | 1873 | .clkdm_name = "core_l4_clkdm", |
1951 | .recalc = &followparent_recalc, | 1874 | .recalc = &followparent_recalc, |
1952 | }; | 1875 | }; |
1953 | 1876 | ||
1954 | static struct clk fac_ick = { | 1877 | static struct clk fac_ick = { |
1955 | .name = "fac_ick", | 1878 | .name = "fac_ick", |
1879 | .ops = &clkops_omap2_dflt_wait, | ||
1956 | .parent = &core_l4_ick, | 1880 | .parent = &core_l4_ick, |
1957 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1881 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1958 | .enable_bit = OMAP3430ES1_EN_FAC_SHIFT, | 1882 | .enable_bit = OMAP3430ES1_EN_FAC_SHIFT, |
1959 | .flags = CLOCK_IN_OMAP3430ES1, | ||
1960 | .clkdm_name = "core_l4_clkdm", | 1883 | .clkdm_name = "core_l4_clkdm", |
1961 | .recalc = &followparent_recalc, | 1884 | .recalc = &followparent_recalc, |
1962 | }; | 1885 | }; |
1963 | 1886 | ||
1964 | static struct clk mailboxes_ick = { | 1887 | static struct clk mailboxes_ick = { |
1965 | .name = "mailboxes_ick", | 1888 | .name = "mailboxes_ick", |
1889 | .ops = &clkops_omap2_dflt_wait, | ||
1966 | .parent = &core_l4_ick, | 1890 | .parent = &core_l4_ick, |
1967 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1891 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1968 | .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT, | 1892 | .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT, |
1969 | .flags = CLOCK_IN_OMAP343X, | ||
1970 | .clkdm_name = "core_l4_clkdm", | 1893 | .clkdm_name = "core_l4_clkdm", |
1971 | .recalc = &followparent_recalc, | 1894 | .recalc = &followparent_recalc, |
1972 | }; | 1895 | }; |
1973 | 1896 | ||
1974 | static struct clk omapctrl_ick = { | 1897 | static struct clk omapctrl_ick = { |
1975 | .name = "omapctrl_ick", | 1898 | .name = "omapctrl_ick", |
1899 | .ops = &clkops_omap2_dflt_wait, | ||
1976 | .parent = &core_l4_ick, | 1900 | .parent = &core_l4_ick, |
1977 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1901 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1978 | .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, | 1902 | .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, |
1979 | .flags = CLOCK_IN_OMAP343X | ENABLE_ON_INIT, | 1903 | .flags = ENABLE_ON_INIT, |
1980 | .recalc = &followparent_recalc, | 1904 | .recalc = &followparent_recalc, |
1981 | }; | 1905 | }; |
1982 | 1906 | ||
@@ -1984,19 +1908,18 @@ static struct clk omapctrl_ick = { | |||
1984 | 1908 | ||
1985 | static struct clk ssi_l4_ick = { | 1909 | static struct clk ssi_l4_ick = { |
1986 | .name = "ssi_l4_ick", | 1910 | .name = "ssi_l4_ick", |
1911 | .ops = &clkops_null, | ||
1987 | .parent = &l4_ick, | 1912 | .parent = &l4_ick, |
1988 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
1989 | PARENT_CONTROLS_CLOCK, | ||
1990 | .clkdm_name = "core_l4_clkdm", | 1913 | .clkdm_name = "core_l4_clkdm", |
1991 | .recalc = &followparent_recalc, | 1914 | .recalc = &followparent_recalc, |
1992 | }; | 1915 | }; |
1993 | 1916 | ||
1994 | static struct clk ssi_ick = { | 1917 | static struct clk ssi_ick = { |
1995 | .name = "ssi_ick", | 1918 | .name = "ssi_ick", |
1919 | .ops = &clkops_omap2_dflt, | ||
1996 | .parent = &ssi_l4_ick, | 1920 | .parent = &ssi_l4_ick, |
1997 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1921 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1998 | .enable_bit = OMAP3430_EN_SSI_SHIFT, | 1922 | .enable_bit = OMAP3430_EN_SSI_SHIFT, |
1999 | .flags = CLOCK_IN_OMAP343X, | ||
2000 | .clkdm_name = "core_l4_clkdm", | 1923 | .clkdm_name = "core_l4_clkdm", |
2001 | .recalc = &followparent_recalc, | 1924 | .recalc = &followparent_recalc, |
2002 | }; | 1925 | }; |
@@ -2011,6 +1934,7 @@ static const struct clksel usb_l4_clksel[] = { | |||
2011 | 1934 | ||
2012 | static struct clk usb_l4_ick = { | 1935 | static struct clk usb_l4_ick = { |
2013 | .name = "usb_l4_ick", | 1936 | .name = "usb_l4_ick", |
1937 | .ops = &clkops_omap2_dflt_wait, | ||
2014 | .parent = &l4_ick, | 1938 | .parent = &l4_ick, |
2015 | .init = &omap2_init_clksel_parent, | 1939 | .init = &omap2_init_clksel_parent, |
2016 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1940 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -2018,7 +1942,6 @@ static struct clk usb_l4_ick = { | |||
2018 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), | 1942 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), |
2019 | .clksel_mask = OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK, | 1943 | .clksel_mask = OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK, |
2020 | .clksel = usb_l4_clksel, | 1944 | .clksel = usb_l4_clksel, |
2021 | .flags = CLOCK_IN_OMAP3430ES1, | ||
2022 | .recalc = &omap2_clksel_recalc, | 1945 | .recalc = &omap2_clksel_recalc, |
2023 | }; | 1946 | }; |
2024 | 1947 | ||
@@ -2028,98 +1951,87 @@ static struct clk usb_l4_ick = { | |||
2028 | 1951 | ||
2029 | static struct clk security_l4_ick2 = { | 1952 | static struct clk security_l4_ick2 = { |
2030 | .name = "security_l4_ick2", | 1953 | .name = "security_l4_ick2", |
1954 | .ops = &clkops_null, | ||
2031 | .parent = &l4_ick, | 1955 | .parent = &l4_ick, |
2032 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
2033 | PARENT_CONTROLS_CLOCK, | ||
2034 | .recalc = &followparent_recalc, | 1956 | .recalc = &followparent_recalc, |
2035 | }; | 1957 | }; |
2036 | 1958 | ||
2037 | static struct clk aes1_ick = { | 1959 | static struct clk aes1_ick = { |
2038 | .name = "aes1_ick", | 1960 | .name = "aes1_ick", |
1961 | .ops = &clkops_omap2_dflt_wait, | ||
2039 | .parent = &security_l4_ick2, | 1962 | .parent = &security_l4_ick2, |
2040 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1963 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2041 | .enable_bit = OMAP3430_EN_AES1_SHIFT, | 1964 | .enable_bit = OMAP3430_EN_AES1_SHIFT, |
2042 | .flags = CLOCK_IN_OMAP343X, | ||
2043 | .recalc = &followparent_recalc, | 1965 | .recalc = &followparent_recalc, |
2044 | }; | 1966 | }; |
2045 | 1967 | ||
2046 | static struct clk rng_ick = { | 1968 | static struct clk rng_ick = { |
2047 | .name = "rng_ick", | 1969 | .name = "rng_ick", |
1970 | .ops = &clkops_omap2_dflt_wait, | ||
2048 | .parent = &security_l4_ick2, | 1971 | .parent = &security_l4_ick2, |
2049 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1972 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2050 | .enable_bit = OMAP3430_EN_RNG_SHIFT, | 1973 | .enable_bit = OMAP3430_EN_RNG_SHIFT, |
2051 | .flags = CLOCK_IN_OMAP343X, | ||
2052 | .recalc = &followparent_recalc, | 1974 | .recalc = &followparent_recalc, |
2053 | }; | 1975 | }; |
2054 | 1976 | ||
2055 | static struct clk sha11_ick = { | 1977 | static struct clk sha11_ick = { |
2056 | .name = "sha11_ick", | 1978 | .name = "sha11_ick", |
1979 | .ops = &clkops_omap2_dflt_wait, | ||
2057 | .parent = &security_l4_ick2, | 1980 | .parent = &security_l4_ick2, |
2058 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1981 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2059 | .enable_bit = OMAP3430_EN_SHA11_SHIFT, | 1982 | .enable_bit = OMAP3430_EN_SHA11_SHIFT, |
2060 | .flags = CLOCK_IN_OMAP343X, | ||
2061 | .recalc = &followparent_recalc, | 1983 | .recalc = &followparent_recalc, |
2062 | }; | 1984 | }; |
2063 | 1985 | ||
2064 | static struct clk des1_ick = { | 1986 | static struct clk des1_ick = { |
2065 | .name = "des1_ick", | 1987 | .name = "des1_ick", |
1988 | .ops = &clkops_omap2_dflt_wait, | ||
2066 | .parent = &security_l4_ick2, | 1989 | .parent = &security_l4_ick2, |
2067 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1990 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
2068 | .enable_bit = OMAP3430_EN_DES1_SHIFT, | 1991 | .enable_bit = OMAP3430_EN_DES1_SHIFT, |
2069 | .flags = CLOCK_IN_OMAP343X, | ||
2070 | .recalc = &followparent_recalc, | 1992 | .recalc = &followparent_recalc, |
2071 | }; | 1993 | }; |
2072 | 1994 | ||
2073 | /* DSS */ | 1995 | /* DSS */ |
2074 | static const struct clksel dss1_alwon_fck_clksel[] = { | ||
2075 | { .parent = &sys_ck, .rates = dpll_bypass_rates }, | ||
2076 | { .parent = &dpll4_m4x2_ck, .rates = dpll_locked_rates }, | ||
2077 | { .parent = NULL } | ||
2078 | }; | ||
2079 | |||
2080 | static struct clk dss1_alwon_fck = { | 1996 | static struct clk dss1_alwon_fck = { |
2081 | .name = "dss1_alwon_fck", | 1997 | .name = "dss1_alwon_fck", |
1998 | .ops = &clkops_omap2_dflt, | ||
2082 | .parent = &dpll4_m4x2_ck, | 1999 | .parent = &dpll4_m4x2_ck, |
2083 | .init = &omap2_init_clksel_parent, | ||
2084 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), | 2000 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), |
2085 | .enable_bit = OMAP3430_EN_DSS1_SHIFT, | 2001 | .enable_bit = OMAP3430_EN_DSS1_SHIFT, |
2086 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | ||
2087 | .clksel_mask = OMAP3430_ST_PERIPH_CLK_MASK, | ||
2088 | .clksel = dss1_alwon_fck_clksel, | ||
2089 | .flags = CLOCK_IN_OMAP343X, | ||
2090 | .clkdm_name = "dss_clkdm", | 2002 | .clkdm_name = "dss_clkdm", |
2091 | .recalc = &omap2_clksel_recalc, | 2003 | .recalc = &followparent_recalc, |
2092 | }; | 2004 | }; |
2093 | 2005 | ||
2094 | static struct clk dss_tv_fck = { | 2006 | static struct clk dss_tv_fck = { |
2095 | .name = "dss_tv_fck", | 2007 | .name = "dss_tv_fck", |
2008 | .ops = &clkops_omap2_dflt, | ||
2096 | .parent = &omap_54m_fck, | 2009 | .parent = &omap_54m_fck, |
2097 | .init = &omap2_init_clk_clkdm, | 2010 | .init = &omap2_init_clk_clkdm, |
2098 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), | 2011 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), |
2099 | .enable_bit = OMAP3430_EN_TV_SHIFT, | 2012 | .enable_bit = OMAP3430_EN_TV_SHIFT, |
2100 | .flags = CLOCK_IN_OMAP343X, | ||
2101 | .clkdm_name = "dss_clkdm", | 2013 | .clkdm_name = "dss_clkdm", |
2102 | .recalc = &followparent_recalc, | 2014 | .recalc = &followparent_recalc, |
2103 | }; | 2015 | }; |
2104 | 2016 | ||
2105 | static struct clk dss_96m_fck = { | 2017 | static struct clk dss_96m_fck = { |
2106 | .name = "dss_96m_fck", | 2018 | .name = "dss_96m_fck", |
2019 | .ops = &clkops_omap2_dflt, | ||
2107 | .parent = &omap_96m_fck, | 2020 | .parent = &omap_96m_fck, |
2108 | .init = &omap2_init_clk_clkdm, | 2021 | .init = &omap2_init_clk_clkdm, |
2109 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), | 2022 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), |
2110 | .enable_bit = OMAP3430_EN_TV_SHIFT, | 2023 | .enable_bit = OMAP3430_EN_TV_SHIFT, |
2111 | .flags = CLOCK_IN_OMAP343X, | ||
2112 | .clkdm_name = "dss_clkdm", | 2024 | .clkdm_name = "dss_clkdm", |
2113 | .recalc = &followparent_recalc, | 2025 | .recalc = &followparent_recalc, |
2114 | }; | 2026 | }; |
2115 | 2027 | ||
2116 | static struct clk dss2_alwon_fck = { | 2028 | static struct clk dss2_alwon_fck = { |
2117 | .name = "dss2_alwon_fck", | 2029 | .name = "dss2_alwon_fck", |
2030 | .ops = &clkops_omap2_dflt, | ||
2118 | .parent = &sys_ck, | 2031 | .parent = &sys_ck, |
2119 | .init = &omap2_init_clk_clkdm, | 2032 | .init = &omap2_init_clk_clkdm, |
2120 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), | 2033 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), |
2121 | .enable_bit = OMAP3430_EN_DSS2_SHIFT, | 2034 | .enable_bit = OMAP3430_EN_DSS2_SHIFT, |
2122 | .flags = CLOCK_IN_OMAP343X, | ||
2123 | .clkdm_name = "dss_clkdm", | 2035 | .clkdm_name = "dss_clkdm", |
2124 | .recalc = &followparent_recalc, | 2036 | .recalc = &followparent_recalc, |
2125 | }; | 2037 | }; |
@@ -2127,45 +2039,46 @@ static struct clk dss2_alwon_fck = { | |||
2127 | static struct clk dss_ick = { | 2039 | static struct clk dss_ick = { |
2128 | /* Handles both L3 and L4 clocks */ | 2040 | /* Handles both L3 and L4 clocks */ |
2129 | .name = "dss_ick", | 2041 | .name = "dss_ick", |
2042 | .ops = &clkops_omap2_dflt, | ||
2130 | .parent = &l4_ick, | 2043 | .parent = &l4_ick, |
2131 | .init = &omap2_init_clk_clkdm, | 2044 | .init = &omap2_init_clk_clkdm, |
2132 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), | 2045 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), |
2133 | .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, | 2046 | .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, |
2134 | .flags = CLOCK_IN_OMAP343X, | ||
2135 | .clkdm_name = "dss_clkdm", | 2047 | .clkdm_name = "dss_clkdm", |
2136 | .recalc = &followparent_recalc, | 2048 | .recalc = &followparent_recalc, |
2137 | }; | 2049 | }; |
2138 | 2050 | ||
2139 | /* CAM */ | 2051 | /* CAM */ |
2140 | 2052 | ||
2141 | static const struct clksel cam_mclk_clksel[] = { | ||
2142 | { .parent = &sys_ck, .rates = dpll_bypass_rates }, | ||
2143 | { .parent = &dpll4_m5x2_ck, .rates = dpll_locked_rates }, | ||
2144 | { .parent = NULL } | ||
2145 | }; | ||
2146 | |||
2147 | static struct clk cam_mclk = { | 2053 | static struct clk cam_mclk = { |
2148 | .name = "cam_mclk", | 2054 | .name = "cam_mclk", |
2055 | .ops = &clkops_omap2_dflt_wait, | ||
2149 | .parent = &dpll4_m5x2_ck, | 2056 | .parent = &dpll4_m5x2_ck, |
2150 | .init = &omap2_init_clksel_parent, | ||
2151 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | ||
2152 | .clksel_mask = OMAP3430_ST_PERIPH_CLK_MASK, | ||
2153 | .clksel = cam_mclk_clksel, | ||
2154 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN), | 2057 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN), |
2155 | .enable_bit = OMAP3430_EN_CAM_SHIFT, | 2058 | .enable_bit = OMAP3430_EN_CAM_SHIFT, |
2156 | .flags = CLOCK_IN_OMAP343X, | ||
2157 | .clkdm_name = "cam_clkdm", | 2059 | .clkdm_name = "cam_clkdm", |
2158 | .recalc = &omap2_clksel_recalc, | 2060 | .recalc = &followparent_recalc, |
2159 | }; | 2061 | }; |
2160 | 2062 | ||
2161 | static struct clk cam_ick = { | 2063 | static struct clk cam_ick = { |
2162 | /* Handles both L3 and L4 clocks */ | 2064 | /* Handles both L3 and L4 clocks */ |
2163 | .name = "cam_ick", | 2065 | .name = "cam_ick", |
2066 | .ops = &clkops_omap2_dflt_wait, | ||
2164 | .parent = &l4_ick, | 2067 | .parent = &l4_ick, |
2165 | .init = &omap2_init_clk_clkdm, | 2068 | .init = &omap2_init_clk_clkdm, |
2166 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN), | 2069 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN), |
2167 | .enable_bit = OMAP3430_EN_CAM_SHIFT, | 2070 | .enable_bit = OMAP3430_EN_CAM_SHIFT, |
2168 | .flags = CLOCK_IN_OMAP343X, | 2071 | .clkdm_name = "cam_clkdm", |
2072 | .recalc = &followparent_recalc, | ||
2073 | }; | ||
2074 | |||
2075 | static struct clk csi2_96m_fck = { | ||
2076 | .name = "csi2_96m_fck", | ||
2077 | .ops = &clkops_omap2_dflt_wait, | ||
2078 | .parent = &core_96m_fck, | ||
2079 | .init = &omap2_init_clk_clkdm, | ||
2080 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN), | ||
2081 | .enable_bit = OMAP3430_EN_CSI2_SHIFT, | ||
2169 | .clkdm_name = "cam_clkdm", | 2082 | .clkdm_name = "cam_clkdm", |
2170 | .recalc = &followparent_recalc, | 2083 | .recalc = &followparent_recalc, |
2171 | }; | 2084 | }; |
@@ -2174,22 +2087,22 @@ static struct clk cam_ick = { | |||
2174 | 2087 | ||
2175 | static struct clk usbhost_120m_fck = { | 2088 | static struct clk usbhost_120m_fck = { |
2176 | .name = "usbhost_120m_fck", | 2089 | .name = "usbhost_120m_fck", |
2177 | .parent = &omap_120m_fck, | 2090 | .ops = &clkops_omap2_dflt_wait, |
2091 | .parent = &dpll5_m2_ck, | ||
2178 | .init = &omap2_init_clk_clkdm, | 2092 | .init = &omap2_init_clk_clkdm, |
2179 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN), | 2093 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN), |
2180 | .enable_bit = OMAP3430ES2_EN_USBHOST2_SHIFT, | 2094 | .enable_bit = OMAP3430ES2_EN_USBHOST2_SHIFT, |
2181 | .flags = CLOCK_IN_OMAP3430ES2, | ||
2182 | .clkdm_name = "usbhost_clkdm", | 2095 | .clkdm_name = "usbhost_clkdm", |
2183 | .recalc = &followparent_recalc, | 2096 | .recalc = &followparent_recalc, |
2184 | }; | 2097 | }; |
2185 | 2098 | ||
2186 | static struct clk usbhost_48m_fck = { | 2099 | static struct clk usbhost_48m_fck = { |
2187 | .name = "usbhost_48m_fck", | 2100 | .name = "usbhost_48m_fck", |
2101 | .ops = &clkops_omap2_dflt_wait, | ||
2188 | .parent = &omap_48m_fck, | 2102 | .parent = &omap_48m_fck, |
2189 | .init = &omap2_init_clk_clkdm, | 2103 | .init = &omap2_init_clk_clkdm, |
2190 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN), | 2104 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN), |
2191 | .enable_bit = OMAP3430ES2_EN_USBHOST1_SHIFT, | 2105 | .enable_bit = OMAP3430ES2_EN_USBHOST1_SHIFT, |
2192 | .flags = CLOCK_IN_OMAP3430ES2, | ||
2193 | .clkdm_name = "usbhost_clkdm", | 2106 | .clkdm_name = "usbhost_clkdm", |
2194 | .recalc = &followparent_recalc, | 2107 | .recalc = &followparent_recalc, |
2195 | }; | 2108 | }; |
@@ -2197,22 +2110,11 @@ static struct clk usbhost_48m_fck = { | |||
2197 | static struct clk usbhost_ick = { | 2110 | static struct clk usbhost_ick = { |
2198 | /* Handles both L3 and L4 clocks */ | 2111 | /* Handles both L3 and L4 clocks */ |
2199 | .name = "usbhost_ick", | 2112 | .name = "usbhost_ick", |
2113 | .ops = &clkops_omap2_dflt_wait, | ||
2200 | .parent = &l4_ick, | 2114 | .parent = &l4_ick, |
2201 | .init = &omap2_init_clk_clkdm, | 2115 | .init = &omap2_init_clk_clkdm, |
2202 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN), | 2116 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN), |
2203 | .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT, | 2117 | .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT, |
2204 | .flags = CLOCK_IN_OMAP3430ES2, | ||
2205 | .clkdm_name = "usbhost_clkdm", | ||
2206 | .recalc = &followparent_recalc, | ||
2207 | }; | ||
2208 | |||
2209 | static struct clk usbhost_sar_fck = { | ||
2210 | .name = "usbhost_sar_fck", | ||
2211 | .parent = &osc_sys_ck, | ||
2212 | .init = &omap2_init_clk_clkdm, | ||
2213 | .enable_reg = OMAP_PRM_REGADDR(OMAP3430ES2_USBHOST_MOD, PM_PWSTCTRL), | ||
2214 | .enable_bit = OMAP3430ES2_SAVEANDRESTORE_SHIFT, | ||
2215 | .flags = CLOCK_IN_OMAP3430ES2, | ||
2216 | .clkdm_name = "usbhost_clkdm", | 2118 | .clkdm_name = "usbhost_clkdm", |
2217 | .recalc = &followparent_recalc, | 2119 | .recalc = &followparent_recalc, |
2218 | }; | 2120 | }; |
@@ -2237,7 +2139,7 @@ static const struct clksel_rate usim_120m_rates[] = { | |||
2237 | 2139 | ||
2238 | static const struct clksel usim_clksel[] = { | 2140 | static const struct clksel usim_clksel[] = { |
2239 | { .parent = &omap_96m_fck, .rates = usim_96m_rates }, | 2141 | { .parent = &omap_96m_fck, .rates = usim_96m_rates }, |
2240 | { .parent = &omap_120m_fck, .rates = usim_120m_rates }, | 2142 | { .parent = &dpll5_m2_ck, .rates = usim_120m_rates }, |
2241 | { .parent = &sys_ck, .rates = div2_rates }, | 2143 | { .parent = &sys_ck, .rates = div2_rates }, |
2242 | { .parent = NULL }, | 2144 | { .parent = NULL }, |
2243 | }; | 2145 | }; |
@@ -2245,63 +2147,63 @@ static const struct clksel usim_clksel[] = { | |||
2245 | /* 3430ES2 only */ | 2147 | /* 3430ES2 only */ |
2246 | static struct clk usim_fck = { | 2148 | static struct clk usim_fck = { |
2247 | .name = "usim_fck", | 2149 | .name = "usim_fck", |
2150 | .ops = &clkops_omap2_dflt_wait, | ||
2248 | .init = &omap2_init_clksel_parent, | 2151 | .init = &omap2_init_clksel_parent, |
2249 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | 2152 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
2250 | .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, | 2153 | .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, |
2251 | .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL), | 2154 | .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL), |
2252 | .clksel_mask = OMAP3430ES2_CLKSEL_USIMOCP_MASK, | 2155 | .clksel_mask = OMAP3430ES2_CLKSEL_USIMOCP_MASK, |
2253 | .clksel = usim_clksel, | 2156 | .clksel = usim_clksel, |
2254 | .flags = CLOCK_IN_OMAP3430ES2, | ||
2255 | .recalc = &omap2_clksel_recalc, | 2157 | .recalc = &omap2_clksel_recalc, |
2256 | }; | 2158 | }; |
2257 | 2159 | ||
2258 | /* XXX should gpt1's clksel have wkup_32k_fck as the 32k opt? */ | 2160 | /* XXX should gpt1's clksel have wkup_32k_fck as the 32k opt? */ |
2259 | static struct clk gpt1_fck = { | 2161 | static struct clk gpt1_fck = { |
2260 | .name = "gpt1_fck", | 2162 | .name = "gpt1_fck", |
2163 | .ops = &clkops_omap2_dflt_wait, | ||
2261 | .init = &omap2_init_clksel_parent, | 2164 | .init = &omap2_init_clksel_parent, |
2262 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | 2165 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
2263 | .enable_bit = OMAP3430_EN_GPT1_SHIFT, | 2166 | .enable_bit = OMAP3430_EN_GPT1_SHIFT, |
2264 | .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL), | 2167 | .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL), |
2265 | .clksel_mask = OMAP3430_CLKSEL_GPT1_MASK, | 2168 | .clksel_mask = OMAP3430_CLKSEL_GPT1_MASK, |
2266 | .clksel = omap343x_gpt_clksel, | 2169 | .clksel = omap343x_gpt_clksel, |
2267 | .flags = CLOCK_IN_OMAP343X, | ||
2268 | .clkdm_name = "wkup_clkdm", | 2170 | .clkdm_name = "wkup_clkdm", |
2269 | .recalc = &omap2_clksel_recalc, | 2171 | .recalc = &omap2_clksel_recalc, |
2270 | }; | 2172 | }; |
2271 | 2173 | ||
2272 | static struct clk wkup_32k_fck = { | 2174 | static struct clk wkup_32k_fck = { |
2273 | .name = "wkup_32k_fck", | 2175 | .name = "wkup_32k_fck", |
2176 | .ops = &clkops_null, | ||
2274 | .init = &omap2_init_clk_clkdm, | 2177 | .init = &omap2_init_clk_clkdm, |
2275 | .parent = &omap_32k_fck, | 2178 | .parent = &omap_32k_fck, |
2276 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
2277 | .clkdm_name = "wkup_clkdm", | 2179 | .clkdm_name = "wkup_clkdm", |
2278 | .recalc = &followparent_recalc, | 2180 | .recalc = &followparent_recalc, |
2279 | }; | 2181 | }; |
2280 | 2182 | ||
2281 | static struct clk gpio1_dbck = { | 2183 | static struct clk gpio1_dbck = { |
2282 | .name = "gpio1_dbck", | 2184 | .name = "gpio1_dbck", |
2185 | .ops = &clkops_omap2_dflt_wait, | ||
2283 | .parent = &wkup_32k_fck, | 2186 | .parent = &wkup_32k_fck, |
2284 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | 2187 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
2285 | .enable_bit = OMAP3430_EN_GPIO1_SHIFT, | 2188 | .enable_bit = OMAP3430_EN_GPIO1_SHIFT, |
2286 | .flags = CLOCK_IN_OMAP343X, | ||
2287 | .clkdm_name = "wkup_clkdm", | 2189 | .clkdm_name = "wkup_clkdm", |
2288 | .recalc = &followparent_recalc, | 2190 | .recalc = &followparent_recalc, |
2289 | }; | 2191 | }; |
2290 | 2192 | ||
2291 | static struct clk wdt2_fck = { | 2193 | static struct clk wdt2_fck = { |
2292 | .name = "wdt2_fck", | 2194 | .name = "wdt2_fck", |
2195 | .ops = &clkops_omap2_dflt_wait, | ||
2293 | .parent = &wkup_32k_fck, | 2196 | .parent = &wkup_32k_fck, |
2294 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | 2197 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
2295 | .enable_bit = OMAP3430_EN_WDT2_SHIFT, | 2198 | .enable_bit = OMAP3430_EN_WDT2_SHIFT, |
2296 | .flags = CLOCK_IN_OMAP343X, | ||
2297 | .clkdm_name = "wkup_clkdm", | 2199 | .clkdm_name = "wkup_clkdm", |
2298 | .recalc = &followparent_recalc, | 2200 | .recalc = &followparent_recalc, |
2299 | }; | 2201 | }; |
2300 | 2202 | ||
2301 | static struct clk wkup_l4_ick = { | 2203 | static struct clk wkup_l4_ick = { |
2302 | .name = "wkup_l4_ick", | 2204 | .name = "wkup_l4_ick", |
2205 | .ops = &clkops_null, | ||
2303 | .parent = &sys_ck, | 2206 | .parent = &sys_ck, |
2304 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
2305 | .clkdm_name = "wkup_clkdm", | 2207 | .clkdm_name = "wkup_clkdm", |
2306 | .recalc = &followparent_recalc, | 2208 | .recalc = &followparent_recalc, |
2307 | }; | 2209 | }; |
@@ -2310,50 +2212,50 @@ static struct clk wkup_l4_ick = { | |||
2310 | /* Never specifically named in the TRM, so we have to infer a likely name */ | 2212 | /* Never specifically named in the TRM, so we have to infer a likely name */ |
2311 | static struct clk usim_ick = { | 2213 | static struct clk usim_ick = { |
2312 | .name = "usim_ick", | 2214 | .name = "usim_ick", |
2215 | .ops = &clkops_omap2_dflt_wait, | ||
2313 | .parent = &wkup_l4_ick, | 2216 | .parent = &wkup_l4_ick, |
2314 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2217 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2315 | .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, | 2218 | .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, |
2316 | .flags = CLOCK_IN_OMAP3430ES2, | ||
2317 | .clkdm_name = "wkup_clkdm", | 2219 | .clkdm_name = "wkup_clkdm", |
2318 | .recalc = &followparent_recalc, | 2220 | .recalc = &followparent_recalc, |
2319 | }; | 2221 | }; |
2320 | 2222 | ||
2321 | static struct clk wdt2_ick = { | 2223 | static struct clk wdt2_ick = { |
2322 | .name = "wdt2_ick", | 2224 | .name = "wdt2_ick", |
2225 | .ops = &clkops_omap2_dflt_wait, | ||
2323 | .parent = &wkup_l4_ick, | 2226 | .parent = &wkup_l4_ick, |
2324 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2227 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2325 | .enable_bit = OMAP3430_EN_WDT2_SHIFT, | 2228 | .enable_bit = OMAP3430_EN_WDT2_SHIFT, |
2326 | .flags = CLOCK_IN_OMAP343X, | ||
2327 | .clkdm_name = "wkup_clkdm", | 2229 | .clkdm_name = "wkup_clkdm", |
2328 | .recalc = &followparent_recalc, | 2230 | .recalc = &followparent_recalc, |
2329 | }; | 2231 | }; |
2330 | 2232 | ||
2331 | static struct clk wdt1_ick = { | 2233 | static struct clk wdt1_ick = { |
2332 | .name = "wdt1_ick", | 2234 | .name = "wdt1_ick", |
2235 | .ops = &clkops_omap2_dflt_wait, | ||
2333 | .parent = &wkup_l4_ick, | 2236 | .parent = &wkup_l4_ick, |
2334 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2237 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2335 | .enable_bit = OMAP3430_EN_WDT1_SHIFT, | 2238 | .enable_bit = OMAP3430_EN_WDT1_SHIFT, |
2336 | .flags = CLOCK_IN_OMAP343X, | ||
2337 | .clkdm_name = "wkup_clkdm", | 2239 | .clkdm_name = "wkup_clkdm", |
2338 | .recalc = &followparent_recalc, | 2240 | .recalc = &followparent_recalc, |
2339 | }; | 2241 | }; |
2340 | 2242 | ||
2341 | static struct clk gpio1_ick = { | 2243 | static struct clk gpio1_ick = { |
2342 | .name = "gpio1_ick", | 2244 | .name = "gpio1_ick", |
2245 | .ops = &clkops_omap2_dflt_wait, | ||
2343 | .parent = &wkup_l4_ick, | 2246 | .parent = &wkup_l4_ick, |
2344 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2247 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2345 | .enable_bit = OMAP3430_EN_GPIO1_SHIFT, | 2248 | .enable_bit = OMAP3430_EN_GPIO1_SHIFT, |
2346 | .flags = CLOCK_IN_OMAP343X, | ||
2347 | .clkdm_name = "wkup_clkdm", | 2249 | .clkdm_name = "wkup_clkdm", |
2348 | .recalc = &followparent_recalc, | 2250 | .recalc = &followparent_recalc, |
2349 | }; | 2251 | }; |
2350 | 2252 | ||
2351 | static struct clk omap_32ksync_ick = { | 2253 | static struct clk omap_32ksync_ick = { |
2352 | .name = "omap_32ksync_ick", | 2254 | .name = "omap_32ksync_ick", |
2255 | .ops = &clkops_omap2_dflt_wait, | ||
2353 | .parent = &wkup_l4_ick, | 2256 | .parent = &wkup_l4_ick, |
2354 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2257 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2355 | .enable_bit = OMAP3430_EN_32KSYNC_SHIFT, | 2258 | .enable_bit = OMAP3430_EN_32KSYNC_SHIFT, |
2356 | .flags = CLOCK_IN_OMAP343X, | ||
2357 | .clkdm_name = "wkup_clkdm", | 2259 | .clkdm_name = "wkup_clkdm", |
2358 | .recalc = &followparent_recalc, | 2260 | .recalc = &followparent_recalc, |
2359 | }; | 2261 | }; |
@@ -2361,20 +2263,20 @@ static struct clk omap_32ksync_ick = { | |||
2361 | /* XXX This clock no longer exists in 3430 TRM rev F */ | 2263 | /* XXX This clock no longer exists in 3430 TRM rev F */ |
2362 | static struct clk gpt12_ick = { | 2264 | static struct clk gpt12_ick = { |
2363 | .name = "gpt12_ick", | 2265 | .name = "gpt12_ick", |
2266 | .ops = &clkops_omap2_dflt_wait, | ||
2364 | .parent = &wkup_l4_ick, | 2267 | .parent = &wkup_l4_ick, |
2365 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2268 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2366 | .enable_bit = OMAP3430_EN_GPT12_SHIFT, | 2269 | .enable_bit = OMAP3430_EN_GPT12_SHIFT, |
2367 | .flags = CLOCK_IN_OMAP343X, | ||
2368 | .clkdm_name = "wkup_clkdm", | 2270 | .clkdm_name = "wkup_clkdm", |
2369 | .recalc = &followparent_recalc, | 2271 | .recalc = &followparent_recalc, |
2370 | }; | 2272 | }; |
2371 | 2273 | ||
2372 | static struct clk gpt1_ick = { | 2274 | static struct clk gpt1_ick = { |
2373 | .name = "gpt1_ick", | 2275 | .name = "gpt1_ick", |
2276 | .ops = &clkops_omap2_dflt_wait, | ||
2374 | .parent = &wkup_l4_ick, | 2277 | .parent = &wkup_l4_ick, |
2375 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2278 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
2376 | .enable_bit = OMAP3430_EN_GPT1_SHIFT, | 2279 | .enable_bit = OMAP3430_EN_GPT1_SHIFT, |
2377 | .flags = CLOCK_IN_OMAP343X, | ||
2378 | .clkdm_name = "wkup_clkdm", | 2280 | .clkdm_name = "wkup_clkdm", |
2379 | .recalc = &followparent_recalc, | 2281 | .recalc = &followparent_recalc, |
2380 | }; | 2282 | }; |
@@ -2385,406 +2287,404 @@ static struct clk gpt1_ick = { | |||
2385 | 2287 | ||
2386 | static struct clk per_96m_fck = { | 2288 | static struct clk per_96m_fck = { |
2387 | .name = "per_96m_fck", | 2289 | .name = "per_96m_fck", |
2290 | .ops = &clkops_null, | ||
2388 | .parent = &omap_96m_alwon_fck, | 2291 | .parent = &omap_96m_alwon_fck, |
2389 | .init = &omap2_init_clk_clkdm, | 2292 | .init = &omap2_init_clk_clkdm, |
2390 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
2391 | PARENT_CONTROLS_CLOCK, | ||
2392 | .clkdm_name = "per_clkdm", | 2293 | .clkdm_name = "per_clkdm", |
2393 | .recalc = &followparent_recalc, | 2294 | .recalc = &followparent_recalc, |
2394 | }; | 2295 | }; |
2395 | 2296 | ||
2396 | static struct clk per_48m_fck = { | 2297 | static struct clk per_48m_fck = { |
2397 | .name = "per_48m_fck", | 2298 | .name = "per_48m_fck", |
2299 | .ops = &clkops_null, | ||
2398 | .parent = &omap_48m_fck, | 2300 | .parent = &omap_48m_fck, |
2399 | .init = &omap2_init_clk_clkdm, | 2301 | .init = &omap2_init_clk_clkdm, |
2400 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
2401 | PARENT_CONTROLS_CLOCK, | ||
2402 | .clkdm_name = "per_clkdm", | 2302 | .clkdm_name = "per_clkdm", |
2403 | .recalc = &followparent_recalc, | 2303 | .recalc = &followparent_recalc, |
2404 | }; | 2304 | }; |
2405 | 2305 | ||
2406 | static struct clk uart3_fck = { | 2306 | static struct clk uart3_fck = { |
2407 | .name = "uart3_fck", | 2307 | .name = "uart3_fck", |
2308 | .ops = &clkops_omap2_dflt_wait, | ||
2408 | .parent = &per_48m_fck, | 2309 | .parent = &per_48m_fck, |
2409 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2310 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2410 | .enable_bit = OMAP3430_EN_UART3_SHIFT, | 2311 | .enable_bit = OMAP3430_EN_UART3_SHIFT, |
2411 | .flags = CLOCK_IN_OMAP343X, | ||
2412 | .clkdm_name = "per_clkdm", | 2312 | .clkdm_name = "per_clkdm", |
2413 | .recalc = &followparent_recalc, | 2313 | .recalc = &followparent_recalc, |
2414 | }; | 2314 | }; |
2415 | 2315 | ||
2416 | static struct clk gpt2_fck = { | 2316 | static struct clk gpt2_fck = { |
2417 | .name = "gpt2_fck", | 2317 | .name = "gpt2_fck", |
2318 | .ops = &clkops_omap2_dflt_wait, | ||
2418 | .init = &omap2_init_clksel_parent, | 2319 | .init = &omap2_init_clksel_parent, |
2419 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2320 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2420 | .enable_bit = OMAP3430_EN_GPT2_SHIFT, | 2321 | .enable_bit = OMAP3430_EN_GPT2_SHIFT, |
2421 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), | 2322 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), |
2422 | .clksel_mask = OMAP3430_CLKSEL_GPT2_MASK, | 2323 | .clksel_mask = OMAP3430_CLKSEL_GPT2_MASK, |
2423 | .clksel = omap343x_gpt_clksel, | 2324 | .clksel = omap343x_gpt_clksel, |
2424 | .flags = CLOCK_IN_OMAP343X, | ||
2425 | .clkdm_name = "per_clkdm", | 2325 | .clkdm_name = "per_clkdm", |
2426 | .recalc = &omap2_clksel_recalc, | 2326 | .recalc = &omap2_clksel_recalc, |
2427 | }; | 2327 | }; |
2428 | 2328 | ||
2429 | static struct clk gpt3_fck = { | 2329 | static struct clk gpt3_fck = { |
2430 | .name = "gpt3_fck", | 2330 | .name = "gpt3_fck", |
2331 | .ops = &clkops_omap2_dflt_wait, | ||
2431 | .init = &omap2_init_clksel_parent, | 2332 | .init = &omap2_init_clksel_parent, |
2432 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2333 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2433 | .enable_bit = OMAP3430_EN_GPT3_SHIFT, | 2334 | .enable_bit = OMAP3430_EN_GPT3_SHIFT, |
2434 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), | 2335 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), |
2435 | .clksel_mask = OMAP3430_CLKSEL_GPT3_MASK, | 2336 | .clksel_mask = OMAP3430_CLKSEL_GPT3_MASK, |
2436 | .clksel = omap343x_gpt_clksel, | 2337 | .clksel = omap343x_gpt_clksel, |
2437 | .flags = CLOCK_IN_OMAP343X, | ||
2438 | .clkdm_name = "per_clkdm", | 2338 | .clkdm_name = "per_clkdm", |
2439 | .recalc = &omap2_clksel_recalc, | 2339 | .recalc = &omap2_clksel_recalc, |
2440 | }; | 2340 | }; |
2441 | 2341 | ||
2442 | static struct clk gpt4_fck = { | 2342 | static struct clk gpt4_fck = { |
2443 | .name = "gpt4_fck", | 2343 | .name = "gpt4_fck", |
2344 | .ops = &clkops_omap2_dflt_wait, | ||
2444 | .init = &omap2_init_clksel_parent, | 2345 | .init = &omap2_init_clksel_parent, |
2445 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2346 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2446 | .enable_bit = OMAP3430_EN_GPT4_SHIFT, | 2347 | .enable_bit = OMAP3430_EN_GPT4_SHIFT, |
2447 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), | 2348 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), |
2448 | .clksel_mask = OMAP3430_CLKSEL_GPT4_MASK, | 2349 | .clksel_mask = OMAP3430_CLKSEL_GPT4_MASK, |
2449 | .clksel = omap343x_gpt_clksel, | 2350 | .clksel = omap343x_gpt_clksel, |
2450 | .flags = CLOCK_IN_OMAP343X, | ||
2451 | .clkdm_name = "per_clkdm", | 2351 | .clkdm_name = "per_clkdm", |
2452 | .recalc = &omap2_clksel_recalc, | 2352 | .recalc = &omap2_clksel_recalc, |
2453 | }; | 2353 | }; |
2454 | 2354 | ||
2455 | static struct clk gpt5_fck = { | 2355 | static struct clk gpt5_fck = { |
2456 | .name = "gpt5_fck", | 2356 | .name = "gpt5_fck", |
2357 | .ops = &clkops_omap2_dflt_wait, | ||
2457 | .init = &omap2_init_clksel_parent, | 2358 | .init = &omap2_init_clksel_parent, |
2458 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2359 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2459 | .enable_bit = OMAP3430_EN_GPT5_SHIFT, | 2360 | .enable_bit = OMAP3430_EN_GPT5_SHIFT, |
2460 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), | 2361 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), |
2461 | .clksel_mask = OMAP3430_CLKSEL_GPT5_MASK, | 2362 | .clksel_mask = OMAP3430_CLKSEL_GPT5_MASK, |
2462 | .clksel = omap343x_gpt_clksel, | 2363 | .clksel = omap343x_gpt_clksel, |
2463 | .flags = CLOCK_IN_OMAP343X, | ||
2464 | .clkdm_name = "per_clkdm", | 2364 | .clkdm_name = "per_clkdm", |
2465 | .recalc = &omap2_clksel_recalc, | 2365 | .recalc = &omap2_clksel_recalc, |
2466 | }; | 2366 | }; |
2467 | 2367 | ||
2468 | static struct clk gpt6_fck = { | 2368 | static struct clk gpt6_fck = { |
2469 | .name = "gpt6_fck", | 2369 | .name = "gpt6_fck", |
2370 | .ops = &clkops_omap2_dflt_wait, | ||
2470 | .init = &omap2_init_clksel_parent, | 2371 | .init = &omap2_init_clksel_parent, |
2471 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2372 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2472 | .enable_bit = OMAP3430_EN_GPT6_SHIFT, | 2373 | .enable_bit = OMAP3430_EN_GPT6_SHIFT, |
2473 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), | 2374 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), |
2474 | .clksel_mask = OMAP3430_CLKSEL_GPT6_MASK, | 2375 | .clksel_mask = OMAP3430_CLKSEL_GPT6_MASK, |
2475 | .clksel = omap343x_gpt_clksel, | 2376 | .clksel = omap343x_gpt_clksel, |
2476 | .flags = CLOCK_IN_OMAP343X, | ||
2477 | .clkdm_name = "per_clkdm", | 2377 | .clkdm_name = "per_clkdm", |
2478 | .recalc = &omap2_clksel_recalc, | 2378 | .recalc = &omap2_clksel_recalc, |
2479 | }; | 2379 | }; |
2480 | 2380 | ||
2481 | static struct clk gpt7_fck = { | 2381 | static struct clk gpt7_fck = { |
2482 | .name = "gpt7_fck", | 2382 | .name = "gpt7_fck", |
2383 | .ops = &clkops_omap2_dflt_wait, | ||
2483 | .init = &omap2_init_clksel_parent, | 2384 | .init = &omap2_init_clksel_parent, |
2484 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2385 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2485 | .enable_bit = OMAP3430_EN_GPT7_SHIFT, | 2386 | .enable_bit = OMAP3430_EN_GPT7_SHIFT, |
2486 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), | 2387 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), |
2487 | .clksel_mask = OMAP3430_CLKSEL_GPT7_MASK, | 2388 | .clksel_mask = OMAP3430_CLKSEL_GPT7_MASK, |
2488 | .clksel = omap343x_gpt_clksel, | 2389 | .clksel = omap343x_gpt_clksel, |
2489 | .flags = CLOCK_IN_OMAP343X, | ||
2490 | .clkdm_name = "per_clkdm", | 2390 | .clkdm_name = "per_clkdm", |
2491 | .recalc = &omap2_clksel_recalc, | 2391 | .recalc = &omap2_clksel_recalc, |
2492 | }; | 2392 | }; |
2493 | 2393 | ||
2494 | static struct clk gpt8_fck = { | 2394 | static struct clk gpt8_fck = { |
2495 | .name = "gpt8_fck", | 2395 | .name = "gpt8_fck", |
2396 | .ops = &clkops_omap2_dflt_wait, | ||
2496 | .init = &omap2_init_clksel_parent, | 2397 | .init = &omap2_init_clksel_parent, |
2497 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2398 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2498 | .enable_bit = OMAP3430_EN_GPT8_SHIFT, | 2399 | .enable_bit = OMAP3430_EN_GPT8_SHIFT, |
2499 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), | 2400 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), |
2500 | .clksel_mask = OMAP3430_CLKSEL_GPT8_MASK, | 2401 | .clksel_mask = OMAP3430_CLKSEL_GPT8_MASK, |
2501 | .clksel = omap343x_gpt_clksel, | 2402 | .clksel = omap343x_gpt_clksel, |
2502 | .flags = CLOCK_IN_OMAP343X, | ||
2503 | .clkdm_name = "per_clkdm", | 2403 | .clkdm_name = "per_clkdm", |
2504 | .recalc = &omap2_clksel_recalc, | 2404 | .recalc = &omap2_clksel_recalc, |
2505 | }; | 2405 | }; |
2506 | 2406 | ||
2507 | static struct clk gpt9_fck = { | 2407 | static struct clk gpt9_fck = { |
2508 | .name = "gpt9_fck", | 2408 | .name = "gpt9_fck", |
2409 | .ops = &clkops_omap2_dflt_wait, | ||
2509 | .init = &omap2_init_clksel_parent, | 2410 | .init = &omap2_init_clksel_parent, |
2510 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2411 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2511 | .enable_bit = OMAP3430_EN_GPT9_SHIFT, | 2412 | .enable_bit = OMAP3430_EN_GPT9_SHIFT, |
2512 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), | 2413 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), |
2513 | .clksel_mask = OMAP3430_CLKSEL_GPT9_MASK, | 2414 | .clksel_mask = OMAP3430_CLKSEL_GPT9_MASK, |
2514 | .clksel = omap343x_gpt_clksel, | 2415 | .clksel = omap343x_gpt_clksel, |
2515 | .flags = CLOCK_IN_OMAP343X, | ||
2516 | .clkdm_name = "per_clkdm", | 2416 | .clkdm_name = "per_clkdm", |
2517 | .recalc = &omap2_clksel_recalc, | 2417 | .recalc = &omap2_clksel_recalc, |
2518 | }; | 2418 | }; |
2519 | 2419 | ||
2520 | static struct clk per_32k_alwon_fck = { | 2420 | static struct clk per_32k_alwon_fck = { |
2521 | .name = "per_32k_alwon_fck", | 2421 | .name = "per_32k_alwon_fck", |
2422 | .ops = &clkops_null, | ||
2522 | .parent = &omap_32k_fck, | 2423 | .parent = &omap_32k_fck, |
2523 | .clkdm_name = "per_clkdm", | 2424 | .clkdm_name = "per_clkdm", |
2524 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
2525 | .recalc = &followparent_recalc, | 2425 | .recalc = &followparent_recalc, |
2526 | }; | 2426 | }; |
2527 | 2427 | ||
2528 | static struct clk gpio6_dbck = { | 2428 | static struct clk gpio6_dbck = { |
2529 | .name = "gpio6_dbck", | 2429 | .name = "gpio6_dbck", |
2430 | .ops = &clkops_omap2_dflt_wait, | ||
2530 | .parent = &per_32k_alwon_fck, | 2431 | .parent = &per_32k_alwon_fck, |
2531 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2432 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2532 | .enable_bit = OMAP3430_EN_GPIO6_SHIFT, | 2433 | .enable_bit = OMAP3430_EN_GPIO6_SHIFT, |
2533 | .flags = CLOCK_IN_OMAP343X, | ||
2534 | .clkdm_name = "per_clkdm", | 2434 | .clkdm_name = "per_clkdm", |
2535 | .recalc = &followparent_recalc, | 2435 | .recalc = &followparent_recalc, |
2536 | }; | 2436 | }; |
2537 | 2437 | ||
2538 | static struct clk gpio5_dbck = { | 2438 | static struct clk gpio5_dbck = { |
2539 | .name = "gpio5_dbck", | 2439 | .name = "gpio5_dbck", |
2440 | .ops = &clkops_omap2_dflt_wait, | ||
2540 | .parent = &per_32k_alwon_fck, | 2441 | .parent = &per_32k_alwon_fck, |
2541 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2442 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2542 | .enable_bit = OMAP3430_EN_GPIO5_SHIFT, | 2443 | .enable_bit = OMAP3430_EN_GPIO5_SHIFT, |
2543 | .flags = CLOCK_IN_OMAP343X, | ||
2544 | .clkdm_name = "per_clkdm", | 2444 | .clkdm_name = "per_clkdm", |
2545 | .recalc = &followparent_recalc, | 2445 | .recalc = &followparent_recalc, |
2546 | }; | 2446 | }; |
2547 | 2447 | ||
2548 | static struct clk gpio4_dbck = { | 2448 | static struct clk gpio4_dbck = { |
2549 | .name = "gpio4_dbck", | 2449 | .name = "gpio4_dbck", |
2450 | .ops = &clkops_omap2_dflt_wait, | ||
2550 | .parent = &per_32k_alwon_fck, | 2451 | .parent = &per_32k_alwon_fck, |
2551 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2452 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2552 | .enable_bit = OMAP3430_EN_GPIO4_SHIFT, | 2453 | .enable_bit = OMAP3430_EN_GPIO4_SHIFT, |
2553 | .flags = CLOCK_IN_OMAP343X, | ||
2554 | .clkdm_name = "per_clkdm", | 2454 | .clkdm_name = "per_clkdm", |
2555 | .recalc = &followparent_recalc, | 2455 | .recalc = &followparent_recalc, |
2556 | }; | 2456 | }; |
2557 | 2457 | ||
2558 | static struct clk gpio3_dbck = { | 2458 | static struct clk gpio3_dbck = { |
2559 | .name = "gpio3_dbck", | 2459 | .name = "gpio3_dbck", |
2460 | .ops = &clkops_omap2_dflt_wait, | ||
2560 | .parent = &per_32k_alwon_fck, | 2461 | .parent = &per_32k_alwon_fck, |
2561 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2462 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2562 | .enable_bit = OMAP3430_EN_GPIO3_SHIFT, | 2463 | .enable_bit = OMAP3430_EN_GPIO3_SHIFT, |
2563 | .flags = CLOCK_IN_OMAP343X, | ||
2564 | .clkdm_name = "per_clkdm", | 2464 | .clkdm_name = "per_clkdm", |
2565 | .recalc = &followparent_recalc, | 2465 | .recalc = &followparent_recalc, |
2566 | }; | 2466 | }; |
2567 | 2467 | ||
2568 | static struct clk gpio2_dbck = { | 2468 | static struct clk gpio2_dbck = { |
2569 | .name = "gpio2_dbck", | 2469 | .name = "gpio2_dbck", |
2470 | .ops = &clkops_omap2_dflt_wait, | ||
2570 | .parent = &per_32k_alwon_fck, | 2471 | .parent = &per_32k_alwon_fck, |
2571 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2472 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2572 | .enable_bit = OMAP3430_EN_GPIO2_SHIFT, | 2473 | .enable_bit = OMAP3430_EN_GPIO2_SHIFT, |
2573 | .flags = CLOCK_IN_OMAP343X, | ||
2574 | .clkdm_name = "per_clkdm", | 2474 | .clkdm_name = "per_clkdm", |
2575 | .recalc = &followparent_recalc, | 2475 | .recalc = &followparent_recalc, |
2576 | }; | 2476 | }; |
2577 | 2477 | ||
2578 | static struct clk wdt3_fck = { | 2478 | static struct clk wdt3_fck = { |
2579 | .name = "wdt3_fck", | 2479 | .name = "wdt3_fck", |
2480 | .ops = &clkops_omap2_dflt_wait, | ||
2580 | .parent = &per_32k_alwon_fck, | 2481 | .parent = &per_32k_alwon_fck, |
2581 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2482 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2582 | .enable_bit = OMAP3430_EN_WDT3_SHIFT, | 2483 | .enable_bit = OMAP3430_EN_WDT3_SHIFT, |
2583 | .flags = CLOCK_IN_OMAP343X, | ||
2584 | .clkdm_name = "per_clkdm", | 2484 | .clkdm_name = "per_clkdm", |
2585 | .recalc = &followparent_recalc, | 2485 | .recalc = &followparent_recalc, |
2586 | }; | 2486 | }; |
2587 | 2487 | ||
2588 | static struct clk per_l4_ick = { | 2488 | static struct clk per_l4_ick = { |
2589 | .name = "per_l4_ick", | 2489 | .name = "per_l4_ick", |
2490 | .ops = &clkops_null, | ||
2590 | .parent = &l4_ick, | 2491 | .parent = &l4_ick, |
2591 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | | ||
2592 | PARENT_CONTROLS_CLOCK, | ||
2593 | .clkdm_name = "per_clkdm", | 2492 | .clkdm_name = "per_clkdm", |
2594 | .recalc = &followparent_recalc, | 2493 | .recalc = &followparent_recalc, |
2595 | }; | 2494 | }; |
2596 | 2495 | ||
2597 | static struct clk gpio6_ick = { | 2496 | static struct clk gpio6_ick = { |
2598 | .name = "gpio6_ick", | 2497 | .name = "gpio6_ick", |
2498 | .ops = &clkops_omap2_dflt_wait, | ||
2599 | .parent = &per_l4_ick, | 2499 | .parent = &per_l4_ick, |
2600 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2500 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2601 | .enable_bit = OMAP3430_EN_GPIO6_SHIFT, | 2501 | .enable_bit = OMAP3430_EN_GPIO6_SHIFT, |
2602 | .flags = CLOCK_IN_OMAP343X, | ||
2603 | .clkdm_name = "per_clkdm", | 2502 | .clkdm_name = "per_clkdm", |
2604 | .recalc = &followparent_recalc, | 2503 | .recalc = &followparent_recalc, |
2605 | }; | 2504 | }; |
2606 | 2505 | ||
2607 | static struct clk gpio5_ick = { | 2506 | static struct clk gpio5_ick = { |
2608 | .name = "gpio5_ick", | 2507 | .name = "gpio5_ick", |
2508 | .ops = &clkops_omap2_dflt_wait, | ||
2609 | .parent = &per_l4_ick, | 2509 | .parent = &per_l4_ick, |
2610 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2510 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2611 | .enable_bit = OMAP3430_EN_GPIO5_SHIFT, | 2511 | .enable_bit = OMAP3430_EN_GPIO5_SHIFT, |
2612 | .flags = CLOCK_IN_OMAP343X, | ||
2613 | .clkdm_name = "per_clkdm", | 2512 | .clkdm_name = "per_clkdm", |
2614 | .recalc = &followparent_recalc, | 2513 | .recalc = &followparent_recalc, |
2615 | }; | 2514 | }; |
2616 | 2515 | ||
2617 | static struct clk gpio4_ick = { | 2516 | static struct clk gpio4_ick = { |
2618 | .name = "gpio4_ick", | 2517 | .name = "gpio4_ick", |
2518 | .ops = &clkops_omap2_dflt_wait, | ||
2619 | .parent = &per_l4_ick, | 2519 | .parent = &per_l4_ick, |
2620 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2520 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2621 | .enable_bit = OMAP3430_EN_GPIO4_SHIFT, | 2521 | .enable_bit = OMAP3430_EN_GPIO4_SHIFT, |
2622 | .flags = CLOCK_IN_OMAP343X, | ||
2623 | .clkdm_name = "per_clkdm", | 2522 | .clkdm_name = "per_clkdm", |
2624 | .recalc = &followparent_recalc, | 2523 | .recalc = &followparent_recalc, |
2625 | }; | 2524 | }; |
2626 | 2525 | ||
2627 | static struct clk gpio3_ick = { | 2526 | static struct clk gpio3_ick = { |
2628 | .name = "gpio3_ick", | 2527 | .name = "gpio3_ick", |
2528 | .ops = &clkops_omap2_dflt_wait, | ||
2629 | .parent = &per_l4_ick, | 2529 | .parent = &per_l4_ick, |
2630 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2530 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2631 | .enable_bit = OMAP3430_EN_GPIO3_SHIFT, | 2531 | .enable_bit = OMAP3430_EN_GPIO3_SHIFT, |
2632 | .flags = CLOCK_IN_OMAP343X, | ||
2633 | .clkdm_name = "per_clkdm", | 2532 | .clkdm_name = "per_clkdm", |
2634 | .recalc = &followparent_recalc, | 2533 | .recalc = &followparent_recalc, |
2635 | }; | 2534 | }; |
2636 | 2535 | ||
2637 | static struct clk gpio2_ick = { | 2536 | static struct clk gpio2_ick = { |
2638 | .name = "gpio2_ick", | 2537 | .name = "gpio2_ick", |
2538 | .ops = &clkops_omap2_dflt_wait, | ||
2639 | .parent = &per_l4_ick, | 2539 | .parent = &per_l4_ick, |
2640 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2540 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2641 | .enable_bit = OMAP3430_EN_GPIO2_SHIFT, | 2541 | .enable_bit = OMAP3430_EN_GPIO2_SHIFT, |
2642 | .flags = CLOCK_IN_OMAP343X, | ||
2643 | .clkdm_name = "per_clkdm", | 2542 | .clkdm_name = "per_clkdm", |
2644 | .recalc = &followparent_recalc, | 2543 | .recalc = &followparent_recalc, |
2645 | }; | 2544 | }; |
2646 | 2545 | ||
2647 | static struct clk wdt3_ick = { | 2546 | static struct clk wdt3_ick = { |
2648 | .name = "wdt3_ick", | 2547 | .name = "wdt3_ick", |
2548 | .ops = &clkops_omap2_dflt_wait, | ||
2649 | .parent = &per_l4_ick, | 2549 | .parent = &per_l4_ick, |
2650 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2550 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2651 | .enable_bit = OMAP3430_EN_WDT3_SHIFT, | 2551 | .enable_bit = OMAP3430_EN_WDT3_SHIFT, |
2652 | .flags = CLOCK_IN_OMAP343X, | ||
2653 | .clkdm_name = "per_clkdm", | 2552 | .clkdm_name = "per_clkdm", |
2654 | .recalc = &followparent_recalc, | 2553 | .recalc = &followparent_recalc, |
2655 | }; | 2554 | }; |
2656 | 2555 | ||
2657 | static struct clk uart3_ick = { | 2556 | static struct clk uart3_ick = { |
2658 | .name = "uart3_ick", | 2557 | .name = "uart3_ick", |
2558 | .ops = &clkops_omap2_dflt_wait, | ||
2659 | .parent = &per_l4_ick, | 2559 | .parent = &per_l4_ick, |
2660 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2560 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2661 | .enable_bit = OMAP3430_EN_UART3_SHIFT, | 2561 | .enable_bit = OMAP3430_EN_UART3_SHIFT, |
2662 | .flags = CLOCK_IN_OMAP343X, | ||
2663 | .clkdm_name = "per_clkdm", | 2562 | .clkdm_name = "per_clkdm", |
2664 | .recalc = &followparent_recalc, | 2563 | .recalc = &followparent_recalc, |
2665 | }; | 2564 | }; |
2666 | 2565 | ||
2667 | static struct clk gpt9_ick = { | 2566 | static struct clk gpt9_ick = { |
2668 | .name = "gpt9_ick", | 2567 | .name = "gpt9_ick", |
2568 | .ops = &clkops_omap2_dflt_wait, | ||
2669 | .parent = &per_l4_ick, | 2569 | .parent = &per_l4_ick, |
2670 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2570 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2671 | .enable_bit = OMAP3430_EN_GPT9_SHIFT, | 2571 | .enable_bit = OMAP3430_EN_GPT9_SHIFT, |
2672 | .flags = CLOCK_IN_OMAP343X, | ||
2673 | .clkdm_name = "per_clkdm", | 2572 | .clkdm_name = "per_clkdm", |
2674 | .recalc = &followparent_recalc, | 2573 | .recalc = &followparent_recalc, |
2675 | }; | 2574 | }; |
2676 | 2575 | ||
2677 | static struct clk gpt8_ick = { | 2576 | static struct clk gpt8_ick = { |
2678 | .name = "gpt8_ick", | 2577 | .name = "gpt8_ick", |
2578 | .ops = &clkops_omap2_dflt_wait, | ||
2679 | .parent = &per_l4_ick, | 2579 | .parent = &per_l4_ick, |
2680 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2580 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2681 | .enable_bit = OMAP3430_EN_GPT8_SHIFT, | 2581 | .enable_bit = OMAP3430_EN_GPT8_SHIFT, |
2682 | .flags = CLOCK_IN_OMAP343X, | ||
2683 | .clkdm_name = "per_clkdm", | 2582 | .clkdm_name = "per_clkdm", |
2684 | .recalc = &followparent_recalc, | 2583 | .recalc = &followparent_recalc, |
2685 | }; | 2584 | }; |
2686 | 2585 | ||
2687 | static struct clk gpt7_ick = { | 2586 | static struct clk gpt7_ick = { |
2688 | .name = "gpt7_ick", | 2587 | .name = "gpt7_ick", |
2588 | .ops = &clkops_omap2_dflt_wait, | ||
2689 | .parent = &per_l4_ick, | 2589 | .parent = &per_l4_ick, |
2690 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2590 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2691 | .enable_bit = OMAP3430_EN_GPT7_SHIFT, | 2591 | .enable_bit = OMAP3430_EN_GPT7_SHIFT, |
2692 | .flags = CLOCK_IN_OMAP343X, | ||
2693 | .clkdm_name = "per_clkdm", | 2592 | .clkdm_name = "per_clkdm", |
2694 | .recalc = &followparent_recalc, | 2593 | .recalc = &followparent_recalc, |
2695 | }; | 2594 | }; |
2696 | 2595 | ||
2697 | static struct clk gpt6_ick = { | 2596 | static struct clk gpt6_ick = { |
2698 | .name = "gpt6_ick", | 2597 | .name = "gpt6_ick", |
2598 | .ops = &clkops_omap2_dflt_wait, | ||
2699 | .parent = &per_l4_ick, | 2599 | .parent = &per_l4_ick, |
2700 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2600 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2701 | .enable_bit = OMAP3430_EN_GPT6_SHIFT, | 2601 | .enable_bit = OMAP3430_EN_GPT6_SHIFT, |
2702 | .flags = CLOCK_IN_OMAP343X, | ||
2703 | .clkdm_name = "per_clkdm", | 2602 | .clkdm_name = "per_clkdm", |
2704 | .recalc = &followparent_recalc, | 2603 | .recalc = &followparent_recalc, |
2705 | }; | 2604 | }; |
2706 | 2605 | ||
2707 | static struct clk gpt5_ick = { | 2606 | static struct clk gpt5_ick = { |
2708 | .name = "gpt5_ick", | 2607 | .name = "gpt5_ick", |
2608 | .ops = &clkops_omap2_dflt_wait, | ||
2709 | .parent = &per_l4_ick, | 2609 | .parent = &per_l4_ick, |
2710 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2610 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2711 | .enable_bit = OMAP3430_EN_GPT5_SHIFT, | 2611 | .enable_bit = OMAP3430_EN_GPT5_SHIFT, |
2712 | .flags = CLOCK_IN_OMAP343X, | ||
2713 | .clkdm_name = "per_clkdm", | 2612 | .clkdm_name = "per_clkdm", |
2714 | .recalc = &followparent_recalc, | 2613 | .recalc = &followparent_recalc, |
2715 | }; | 2614 | }; |
2716 | 2615 | ||
2717 | static struct clk gpt4_ick = { | 2616 | static struct clk gpt4_ick = { |
2718 | .name = "gpt4_ick", | 2617 | .name = "gpt4_ick", |
2618 | .ops = &clkops_omap2_dflt_wait, | ||
2719 | .parent = &per_l4_ick, | 2619 | .parent = &per_l4_ick, |
2720 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2620 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2721 | .enable_bit = OMAP3430_EN_GPT4_SHIFT, | 2621 | .enable_bit = OMAP3430_EN_GPT4_SHIFT, |
2722 | .flags = CLOCK_IN_OMAP343X, | ||
2723 | .clkdm_name = "per_clkdm", | 2622 | .clkdm_name = "per_clkdm", |
2724 | .recalc = &followparent_recalc, | 2623 | .recalc = &followparent_recalc, |
2725 | }; | 2624 | }; |
2726 | 2625 | ||
2727 | static struct clk gpt3_ick = { | 2626 | static struct clk gpt3_ick = { |
2728 | .name = "gpt3_ick", | 2627 | .name = "gpt3_ick", |
2628 | .ops = &clkops_omap2_dflt_wait, | ||
2729 | .parent = &per_l4_ick, | 2629 | .parent = &per_l4_ick, |
2730 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2630 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2731 | .enable_bit = OMAP3430_EN_GPT3_SHIFT, | 2631 | .enable_bit = OMAP3430_EN_GPT3_SHIFT, |
2732 | .flags = CLOCK_IN_OMAP343X, | ||
2733 | .clkdm_name = "per_clkdm", | 2632 | .clkdm_name = "per_clkdm", |
2734 | .recalc = &followparent_recalc, | 2633 | .recalc = &followparent_recalc, |
2735 | }; | 2634 | }; |
2736 | 2635 | ||
2737 | static struct clk gpt2_ick = { | 2636 | static struct clk gpt2_ick = { |
2738 | .name = "gpt2_ick", | 2637 | .name = "gpt2_ick", |
2638 | .ops = &clkops_omap2_dflt_wait, | ||
2739 | .parent = &per_l4_ick, | 2639 | .parent = &per_l4_ick, |
2740 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2640 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2741 | .enable_bit = OMAP3430_EN_GPT2_SHIFT, | 2641 | .enable_bit = OMAP3430_EN_GPT2_SHIFT, |
2742 | .flags = CLOCK_IN_OMAP343X, | ||
2743 | .clkdm_name = "per_clkdm", | 2642 | .clkdm_name = "per_clkdm", |
2744 | .recalc = &followparent_recalc, | 2643 | .recalc = &followparent_recalc, |
2745 | }; | 2644 | }; |
2746 | 2645 | ||
2747 | static struct clk mcbsp2_ick = { | 2646 | static struct clk mcbsp2_ick = { |
2748 | .name = "mcbsp_ick", | 2647 | .name = "mcbsp_ick", |
2648 | .ops = &clkops_omap2_dflt_wait, | ||
2749 | .id = 2, | 2649 | .id = 2, |
2750 | .parent = &per_l4_ick, | 2650 | .parent = &per_l4_ick, |
2751 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2651 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2752 | .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, | 2652 | .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, |
2753 | .flags = CLOCK_IN_OMAP343X, | ||
2754 | .clkdm_name = "per_clkdm", | 2653 | .clkdm_name = "per_clkdm", |
2755 | .recalc = &followparent_recalc, | 2654 | .recalc = &followparent_recalc, |
2756 | }; | 2655 | }; |
2757 | 2656 | ||
2758 | static struct clk mcbsp3_ick = { | 2657 | static struct clk mcbsp3_ick = { |
2759 | .name = "mcbsp_ick", | 2658 | .name = "mcbsp_ick", |
2659 | .ops = &clkops_omap2_dflt_wait, | ||
2760 | .id = 3, | 2660 | .id = 3, |
2761 | .parent = &per_l4_ick, | 2661 | .parent = &per_l4_ick, |
2762 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2662 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2763 | .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, | 2663 | .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, |
2764 | .flags = CLOCK_IN_OMAP343X, | ||
2765 | .clkdm_name = "per_clkdm", | 2664 | .clkdm_name = "per_clkdm", |
2766 | .recalc = &followparent_recalc, | 2665 | .recalc = &followparent_recalc, |
2767 | }; | 2666 | }; |
2768 | 2667 | ||
2769 | static struct clk mcbsp4_ick = { | 2668 | static struct clk mcbsp4_ick = { |
2770 | .name = "mcbsp_ick", | 2669 | .name = "mcbsp_ick", |
2670 | .ops = &clkops_omap2_dflt_wait, | ||
2771 | .id = 4, | 2671 | .id = 4, |
2772 | .parent = &per_l4_ick, | 2672 | .parent = &per_l4_ick, |
2773 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2673 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2774 | .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, | 2674 | .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, |
2775 | .flags = CLOCK_IN_OMAP343X, | ||
2776 | .clkdm_name = "per_clkdm", | 2675 | .clkdm_name = "per_clkdm", |
2777 | .recalc = &followparent_recalc, | 2676 | .recalc = &followparent_recalc, |
2778 | }; | 2677 | }; |
2779 | 2678 | ||
2780 | static const struct clksel mcbsp_234_clksel[] = { | 2679 | static const struct clksel mcbsp_234_clksel[] = { |
2781 | { .parent = &per_96m_fck, .rates = common_mcbsp_96m_rates }, | 2680 | { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates }, |
2782 | { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, | 2681 | { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, |
2783 | { .parent = NULL } | 2682 | { .parent = NULL } |
2784 | }; | 2683 | }; |
2785 | 2684 | ||
2786 | static struct clk mcbsp2_fck = { | 2685 | static struct clk mcbsp2_fck = { |
2787 | .name = "mcbsp_fck", | 2686 | .name = "mcbsp_fck", |
2687 | .ops = &clkops_omap2_dflt_wait, | ||
2788 | .id = 2, | 2688 | .id = 2, |
2789 | .init = &omap2_init_clksel_parent, | 2689 | .init = &omap2_init_clksel_parent, |
2790 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2690 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
@@ -2792,13 +2692,13 @@ static struct clk mcbsp2_fck = { | |||
2792 | .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), | 2692 | .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), |
2793 | .clksel_mask = OMAP2_MCBSP2_CLKS_MASK, | 2693 | .clksel_mask = OMAP2_MCBSP2_CLKS_MASK, |
2794 | .clksel = mcbsp_234_clksel, | 2694 | .clksel = mcbsp_234_clksel, |
2795 | .flags = CLOCK_IN_OMAP343X, | ||
2796 | .clkdm_name = "per_clkdm", | 2695 | .clkdm_name = "per_clkdm", |
2797 | .recalc = &omap2_clksel_recalc, | 2696 | .recalc = &omap2_clksel_recalc, |
2798 | }; | 2697 | }; |
2799 | 2698 | ||
2800 | static struct clk mcbsp3_fck = { | 2699 | static struct clk mcbsp3_fck = { |
2801 | .name = "mcbsp_fck", | 2700 | .name = "mcbsp_fck", |
2701 | .ops = &clkops_omap2_dflt_wait, | ||
2802 | .id = 3, | 2702 | .id = 3, |
2803 | .init = &omap2_init_clksel_parent, | 2703 | .init = &omap2_init_clksel_parent, |
2804 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2704 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
@@ -2806,13 +2706,13 @@ static struct clk mcbsp3_fck = { | |||
2806 | .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1), | 2706 | .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1), |
2807 | .clksel_mask = OMAP2_MCBSP3_CLKS_MASK, | 2707 | .clksel_mask = OMAP2_MCBSP3_CLKS_MASK, |
2808 | .clksel = mcbsp_234_clksel, | 2708 | .clksel = mcbsp_234_clksel, |
2809 | .flags = CLOCK_IN_OMAP343X, | ||
2810 | .clkdm_name = "per_clkdm", | 2709 | .clkdm_name = "per_clkdm", |
2811 | .recalc = &omap2_clksel_recalc, | 2710 | .recalc = &omap2_clksel_recalc, |
2812 | }; | 2711 | }; |
2813 | 2712 | ||
2814 | static struct clk mcbsp4_fck = { | 2713 | static struct clk mcbsp4_fck = { |
2815 | .name = "mcbsp_fck", | 2714 | .name = "mcbsp_fck", |
2715 | .ops = &clkops_omap2_dflt_wait, | ||
2816 | .id = 4, | 2716 | .id = 4, |
2817 | .init = &omap2_init_clksel_parent, | 2717 | .init = &omap2_init_clksel_parent, |
2818 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2718 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
@@ -2820,7 +2720,6 @@ static struct clk mcbsp4_fck = { | |||
2820 | .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1), | 2720 | .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1), |
2821 | .clksel_mask = OMAP2_MCBSP4_CLKS_MASK, | 2721 | .clksel_mask = OMAP2_MCBSP4_CLKS_MASK, |
2822 | .clksel = mcbsp_234_clksel, | 2722 | .clksel = mcbsp_234_clksel, |
2823 | .flags = CLOCK_IN_OMAP343X, | ||
2824 | .clkdm_name = "per_clkdm", | 2723 | .clkdm_name = "per_clkdm", |
2825 | .recalc = &omap2_clksel_recalc, | 2724 | .recalc = &omap2_clksel_recalc, |
2826 | }; | 2725 | }; |
@@ -2864,11 +2763,11 @@ static const struct clksel emu_src_clksel[] = { | |||
2864 | */ | 2763 | */ |
2865 | static struct clk emu_src_ck = { | 2764 | static struct clk emu_src_ck = { |
2866 | .name = "emu_src_ck", | 2765 | .name = "emu_src_ck", |
2766 | .ops = &clkops_null, | ||
2867 | .init = &omap2_init_clksel_parent, | 2767 | .init = &omap2_init_clksel_parent, |
2868 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), | 2768 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), |
2869 | .clksel_mask = OMAP3430_MUX_CTRL_MASK, | 2769 | .clksel_mask = OMAP3430_MUX_CTRL_MASK, |
2870 | .clksel = emu_src_clksel, | 2770 | .clksel = emu_src_clksel, |
2871 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
2872 | .clkdm_name = "emu_clkdm", | 2771 | .clkdm_name = "emu_clkdm", |
2873 | .recalc = &omap2_clksel_recalc, | 2772 | .recalc = &omap2_clksel_recalc, |
2874 | }; | 2773 | }; |
@@ -2888,11 +2787,11 @@ static const struct clksel pclk_emu_clksel[] = { | |||
2888 | 2787 | ||
2889 | static struct clk pclk_fck = { | 2788 | static struct clk pclk_fck = { |
2890 | .name = "pclk_fck", | 2789 | .name = "pclk_fck", |
2790 | .ops = &clkops_null, | ||
2891 | .init = &omap2_init_clksel_parent, | 2791 | .init = &omap2_init_clksel_parent, |
2892 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), | 2792 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), |
2893 | .clksel_mask = OMAP3430_CLKSEL_PCLK_MASK, | 2793 | .clksel_mask = OMAP3430_CLKSEL_PCLK_MASK, |
2894 | .clksel = pclk_emu_clksel, | 2794 | .clksel = pclk_emu_clksel, |
2895 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
2896 | .clkdm_name = "emu_clkdm", | 2795 | .clkdm_name = "emu_clkdm", |
2897 | .recalc = &omap2_clksel_recalc, | 2796 | .recalc = &omap2_clksel_recalc, |
2898 | }; | 2797 | }; |
@@ -2911,11 +2810,11 @@ static const struct clksel pclkx2_emu_clksel[] = { | |||
2911 | 2810 | ||
2912 | static struct clk pclkx2_fck = { | 2811 | static struct clk pclkx2_fck = { |
2913 | .name = "pclkx2_fck", | 2812 | .name = "pclkx2_fck", |
2813 | .ops = &clkops_null, | ||
2914 | .init = &omap2_init_clksel_parent, | 2814 | .init = &omap2_init_clksel_parent, |
2915 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), | 2815 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), |
2916 | .clksel_mask = OMAP3430_CLKSEL_PCLKX2_MASK, | 2816 | .clksel_mask = OMAP3430_CLKSEL_PCLKX2_MASK, |
2917 | .clksel = pclkx2_emu_clksel, | 2817 | .clksel = pclkx2_emu_clksel, |
2918 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
2919 | .clkdm_name = "emu_clkdm", | 2818 | .clkdm_name = "emu_clkdm", |
2920 | .recalc = &omap2_clksel_recalc, | 2819 | .recalc = &omap2_clksel_recalc, |
2921 | }; | 2820 | }; |
@@ -2927,22 +2826,22 @@ static const struct clksel atclk_emu_clksel[] = { | |||
2927 | 2826 | ||
2928 | static struct clk atclk_fck = { | 2827 | static struct clk atclk_fck = { |
2929 | .name = "atclk_fck", | 2828 | .name = "atclk_fck", |
2829 | .ops = &clkops_null, | ||
2930 | .init = &omap2_init_clksel_parent, | 2830 | .init = &omap2_init_clksel_parent, |
2931 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), | 2831 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), |
2932 | .clksel_mask = OMAP3430_CLKSEL_ATCLK_MASK, | 2832 | .clksel_mask = OMAP3430_CLKSEL_ATCLK_MASK, |
2933 | .clksel = atclk_emu_clksel, | 2833 | .clksel = atclk_emu_clksel, |
2934 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
2935 | .clkdm_name = "emu_clkdm", | 2834 | .clkdm_name = "emu_clkdm", |
2936 | .recalc = &omap2_clksel_recalc, | 2835 | .recalc = &omap2_clksel_recalc, |
2937 | }; | 2836 | }; |
2938 | 2837 | ||
2939 | static struct clk traceclk_src_fck = { | 2838 | static struct clk traceclk_src_fck = { |
2940 | .name = "traceclk_src_fck", | 2839 | .name = "traceclk_src_fck", |
2840 | .ops = &clkops_null, | ||
2941 | .init = &omap2_init_clksel_parent, | 2841 | .init = &omap2_init_clksel_parent, |
2942 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), | 2842 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), |
2943 | .clksel_mask = OMAP3430_TRACE_MUX_CTRL_MASK, | 2843 | .clksel_mask = OMAP3430_TRACE_MUX_CTRL_MASK, |
2944 | .clksel = emu_src_clksel, | 2844 | .clksel = emu_src_clksel, |
2945 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, | ||
2946 | .clkdm_name = "emu_clkdm", | 2845 | .clkdm_name = "emu_clkdm", |
2947 | .recalc = &omap2_clksel_recalc, | 2846 | .recalc = &omap2_clksel_recalc, |
2948 | }; | 2847 | }; |
@@ -2961,11 +2860,11 @@ static const struct clksel traceclk_clksel[] = { | |||
2961 | 2860 | ||
2962 | static struct clk traceclk_fck = { | 2861 | static struct clk traceclk_fck = { |
2963 | .name = "traceclk_fck", | 2862 | .name = "traceclk_fck", |
2863 | .ops = &clkops_null, | ||
2964 | .init = &omap2_init_clksel_parent, | 2864 | .init = &omap2_init_clksel_parent, |
2965 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), | 2865 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), |
2966 | .clksel_mask = OMAP3430_CLKSEL_TRACECLK_MASK, | 2866 | .clksel_mask = OMAP3430_CLKSEL_TRACECLK_MASK, |
2967 | .clksel = traceclk_clksel, | 2867 | .clksel = traceclk_clksel, |
2968 | .flags = CLOCK_IN_OMAP343X | ALWAYS_ENABLED, | ||
2969 | .clkdm_name = "emu_clkdm", | 2868 | .clkdm_name = "emu_clkdm", |
2970 | .recalc = &omap2_clksel_recalc, | 2869 | .recalc = &omap2_clksel_recalc, |
2971 | }; | 2870 | }; |
@@ -2975,27 +2874,27 @@ static struct clk traceclk_fck = { | |||
2975 | /* SmartReflex fclk (VDD1) */ | 2874 | /* SmartReflex fclk (VDD1) */ |
2976 | static struct clk sr1_fck = { | 2875 | static struct clk sr1_fck = { |
2977 | .name = "sr1_fck", | 2876 | .name = "sr1_fck", |
2877 | .ops = &clkops_omap2_dflt_wait, | ||
2978 | .parent = &sys_ck, | 2878 | .parent = &sys_ck, |
2979 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | 2879 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
2980 | .enable_bit = OMAP3430_EN_SR1_SHIFT, | 2880 | .enable_bit = OMAP3430_EN_SR1_SHIFT, |
2981 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, | ||
2982 | .recalc = &followparent_recalc, | 2881 | .recalc = &followparent_recalc, |
2983 | }; | 2882 | }; |
2984 | 2883 | ||
2985 | /* SmartReflex fclk (VDD2) */ | 2884 | /* SmartReflex fclk (VDD2) */ |
2986 | static struct clk sr2_fck = { | 2885 | static struct clk sr2_fck = { |
2987 | .name = "sr2_fck", | 2886 | .name = "sr2_fck", |
2887 | .ops = &clkops_omap2_dflt_wait, | ||
2988 | .parent = &sys_ck, | 2888 | .parent = &sys_ck, |
2989 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | 2889 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
2990 | .enable_bit = OMAP3430_EN_SR2_SHIFT, | 2890 | .enable_bit = OMAP3430_EN_SR2_SHIFT, |
2991 | .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, | ||
2992 | .recalc = &followparent_recalc, | 2891 | .recalc = &followparent_recalc, |
2993 | }; | 2892 | }; |
2994 | 2893 | ||
2995 | static struct clk sr_l4_ick = { | 2894 | static struct clk sr_l4_ick = { |
2996 | .name = "sr_l4_ick", | 2895 | .name = "sr_l4_ick", |
2896 | .ops = &clkops_null, /* RMK: missing? */ | ||
2997 | .parent = &l4_ick, | 2897 | .parent = &l4_ick, |
2998 | .flags = CLOCK_IN_OMAP343X, | ||
2999 | .clkdm_name = "core_l4_clkdm", | 2898 | .clkdm_name = "core_l4_clkdm", |
3000 | .recalc = &followparent_recalc, | 2899 | .recalc = &followparent_recalc, |
3001 | }; | 2900 | }; |
@@ -3005,231 +2904,16 @@ static struct clk sr_l4_ick = { | |||
3005 | /* XXX This clock no longer exists in 3430 TRM rev F */ | 2904 | /* XXX This clock no longer exists in 3430 TRM rev F */ |
3006 | static struct clk gpt12_fck = { | 2905 | static struct clk gpt12_fck = { |
3007 | .name = "gpt12_fck", | 2906 | .name = "gpt12_fck", |
2907 | .ops = &clkops_null, | ||
3008 | .parent = &secure_32k_fck, | 2908 | .parent = &secure_32k_fck, |
3009 | .flags = CLOCK_IN_OMAP343X | ALWAYS_ENABLED, | ||
3010 | .recalc = &followparent_recalc, | 2909 | .recalc = &followparent_recalc, |
3011 | }; | 2910 | }; |
3012 | 2911 | ||
3013 | static struct clk wdt1_fck = { | 2912 | static struct clk wdt1_fck = { |
3014 | .name = "wdt1_fck", | 2913 | .name = "wdt1_fck", |
2914 | .ops = &clkops_null, | ||
3015 | .parent = &secure_32k_fck, | 2915 | .parent = &secure_32k_fck, |
3016 | .flags = CLOCK_IN_OMAP343X | ALWAYS_ENABLED, | 2916 | .recalc = &followparent_recalc, |
3017 | .recalc = &followparent_recalc, | ||
3018 | }; | ||
3019 | |||
3020 | static struct clk *onchip_34xx_clks[] __initdata = { | ||
3021 | &omap_32k_fck, | ||
3022 | &virt_12m_ck, | ||
3023 | &virt_13m_ck, | ||
3024 | &virt_16_8m_ck, | ||
3025 | &virt_19_2m_ck, | ||
3026 | &virt_26m_ck, | ||
3027 | &virt_38_4m_ck, | ||
3028 | &osc_sys_ck, | ||
3029 | &sys_ck, | ||
3030 | &sys_altclk, | ||
3031 | &mcbsp_clks, | ||
3032 | &sys_clkout1, | ||
3033 | &dpll1_ck, | ||
3034 | &dpll1_x2_ck, | ||
3035 | &dpll1_x2m2_ck, | ||
3036 | &dpll2_ck, | ||
3037 | &dpll2_m2_ck, | ||
3038 | &dpll3_ck, | ||
3039 | &core_ck, | ||
3040 | &dpll3_x2_ck, | ||
3041 | &dpll3_m2_ck, | ||
3042 | &dpll3_m2x2_ck, | ||
3043 | &dpll3_m3_ck, | ||
3044 | &dpll3_m3x2_ck, | ||
3045 | &emu_core_alwon_ck, | ||
3046 | &dpll4_ck, | ||
3047 | &dpll4_x2_ck, | ||
3048 | &omap_96m_alwon_fck, | ||
3049 | &omap_96m_fck, | ||
3050 | &cm_96m_fck, | ||
3051 | &virt_omap_54m_fck, | ||
3052 | &omap_54m_fck, | ||
3053 | &omap_48m_fck, | ||
3054 | &omap_12m_fck, | ||
3055 | &dpll4_m2_ck, | ||
3056 | &dpll4_m2x2_ck, | ||
3057 | &dpll4_m3_ck, | ||
3058 | &dpll4_m3x2_ck, | ||
3059 | &dpll4_m4_ck, | ||
3060 | &dpll4_m4x2_ck, | ||
3061 | &dpll4_m5_ck, | ||
3062 | &dpll4_m5x2_ck, | ||
3063 | &dpll4_m6_ck, | ||
3064 | &dpll4_m6x2_ck, | ||
3065 | &emu_per_alwon_ck, | ||
3066 | &dpll5_ck, | ||
3067 | &dpll5_m2_ck, | ||
3068 | &omap_120m_fck, | ||
3069 | &clkout2_src_ck, | ||
3070 | &sys_clkout2, | ||
3071 | &corex2_fck, | ||
3072 | &dpll1_fck, | ||
3073 | &mpu_ck, | ||
3074 | &arm_fck, | ||
3075 | &emu_mpu_alwon_ck, | ||
3076 | &dpll2_fck, | ||
3077 | &iva2_ck, | ||
3078 | &l3_ick, | ||
3079 | &l4_ick, | ||
3080 | &rm_ick, | ||
3081 | &gfx_l3_ck, | ||
3082 | &gfx_l3_fck, | ||
3083 | &gfx_l3_ick, | ||
3084 | &gfx_cg1_ck, | ||
3085 | &gfx_cg2_ck, | ||
3086 | &sgx_fck, | ||
3087 | &sgx_ick, | ||
3088 | &d2d_26m_fck, | ||
3089 | &gpt10_fck, | ||
3090 | &gpt11_fck, | ||
3091 | &cpefuse_fck, | ||
3092 | &ts_fck, | ||
3093 | &usbtll_fck, | ||
3094 | &core_96m_fck, | ||
3095 | &mmchs3_fck, | ||
3096 | &mmchs2_fck, | ||
3097 | &mspro_fck, | ||
3098 | &mmchs1_fck, | ||
3099 | &i2c3_fck, | ||
3100 | &i2c2_fck, | ||
3101 | &i2c1_fck, | ||
3102 | &mcbsp5_fck, | ||
3103 | &mcbsp1_fck, | ||
3104 | &core_48m_fck, | ||
3105 | &mcspi4_fck, | ||
3106 | &mcspi3_fck, | ||
3107 | &mcspi2_fck, | ||
3108 | &mcspi1_fck, | ||
3109 | &uart2_fck, | ||
3110 | &uart1_fck, | ||
3111 | &fshostusb_fck, | ||
3112 | &core_12m_fck, | ||
3113 | &hdq_fck, | ||
3114 | &ssi_ssr_fck, | ||
3115 | &ssi_sst_fck, | ||
3116 | &core_l3_ick, | ||
3117 | &hsotgusb_ick, | ||
3118 | &sdrc_ick, | ||
3119 | &gpmc_fck, | ||
3120 | &security_l3_ick, | ||
3121 | &pka_ick, | ||
3122 | &core_l4_ick, | ||
3123 | &usbtll_ick, | ||
3124 | &mmchs3_ick, | ||
3125 | &icr_ick, | ||
3126 | &aes2_ick, | ||
3127 | &sha12_ick, | ||
3128 | &des2_ick, | ||
3129 | &mmchs2_ick, | ||
3130 | &mmchs1_ick, | ||
3131 | &mspro_ick, | ||
3132 | &hdq_ick, | ||
3133 | &mcspi4_ick, | ||
3134 | &mcspi3_ick, | ||
3135 | &mcspi2_ick, | ||
3136 | &mcspi1_ick, | ||
3137 | &i2c3_ick, | ||
3138 | &i2c2_ick, | ||
3139 | &i2c1_ick, | ||
3140 | &uart2_ick, | ||
3141 | &uart1_ick, | ||
3142 | &gpt11_ick, | ||
3143 | &gpt10_ick, | ||
3144 | &mcbsp5_ick, | ||
3145 | &mcbsp1_ick, | ||
3146 | &fac_ick, | ||
3147 | &mailboxes_ick, | ||
3148 | &omapctrl_ick, | ||
3149 | &ssi_l4_ick, | ||
3150 | &ssi_ick, | ||
3151 | &usb_l4_ick, | ||
3152 | &security_l4_ick2, | ||
3153 | &aes1_ick, | ||
3154 | &rng_ick, | ||
3155 | &sha11_ick, | ||
3156 | &des1_ick, | ||
3157 | &dss1_alwon_fck, | ||
3158 | &dss_tv_fck, | ||
3159 | &dss_96m_fck, | ||
3160 | &dss2_alwon_fck, | ||
3161 | &dss_ick, | ||
3162 | &cam_mclk, | ||
3163 | &cam_ick, | ||
3164 | &usbhost_120m_fck, | ||
3165 | &usbhost_48m_fck, | ||
3166 | &usbhost_ick, | ||
3167 | &usbhost_sar_fck, | ||
3168 | &usim_fck, | ||
3169 | &gpt1_fck, | ||
3170 | &wkup_32k_fck, | ||
3171 | &gpio1_dbck, | ||
3172 | &wdt2_fck, | ||
3173 | &wkup_l4_ick, | ||
3174 | &usim_ick, | ||
3175 | &wdt2_ick, | ||
3176 | &wdt1_ick, | ||
3177 | &gpio1_ick, | ||
3178 | &omap_32ksync_ick, | ||
3179 | &gpt12_ick, | ||
3180 | &gpt1_ick, | ||
3181 | &per_96m_fck, | ||
3182 | &per_48m_fck, | ||
3183 | &uart3_fck, | ||
3184 | &gpt2_fck, | ||
3185 | &gpt3_fck, | ||
3186 | &gpt4_fck, | ||
3187 | &gpt5_fck, | ||
3188 | &gpt6_fck, | ||
3189 | &gpt7_fck, | ||
3190 | &gpt8_fck, | ||
3191 | &gpt9_fck, | ||
3192 | &per_32k_alwon_fck, | ||
3193 | &gpio6_dbck, | ||
3194 | &gpio5_dbck, | ||
3195 | &gpio4_dbck, | ||
3196 | &gpio3_dbck, | ||
3197 | &gpio2_dbck, | ||
3198 | &wdt3_fck, | ||
3199 | &per_l4_ick, | ||
3200 | &gpio6_ick, | ||
3201 | &gpio5_ick, | ||
3202 | &gpio4_ick, | ||
3203 | &gpio3_ick, | ||
3204 | &gpio2_ick, | ||
3205 | &wdt3_ick, | ||
3206 | &uart3_ick, | ||
3207 | &gpt9_ick, | ||
3208 | &gpt8_ick, | ||
3209 | &gpt7_ick, | ||
3210 | &gpt6_ick, | ||
3211 | &gpt5_ick, | ||
3212 | &gpt4_ick, | ||
3213 | &gpt3_ick, | ||
3214 | &gpt2_ick, | ||
3215 | &mcbsp2_ick, | ||
3216 | &mcbsp3_ick, | ||
3217 | &mcbsp4_ick, | ||
3218 | &mcbsp2_fck, | ||
3219 | &mcbsp3_fck, | ||
3220 | &mcbsp4_fck, | ||
3221 | &emu_src_ck, | ||
3222 | &pclk_fck, | ||
3223 | &pclkx2_fck, | ||
3224 | &atclk_fck, | ||
3225 | &traceclk_src_fck, | ||
3226 | &traceclk_fck, | ||
3227 | &sr1_fck, | ||
3228 | &sr2_fck, | ||
3229 | &sr_l4_ick, | ||
3230 | &secure_32k_fck, | ||
3231 | &gpt12_fck, | ||
3232 | &wdt1_fck, | ||
3233 | }; | 2917 | }; |
3234 | 2918 | ||
3235 | #endif | 2919 | #endif |
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 4c3ce9cfd948..0e7d501865b6 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
24 | #include <linux/limits.h> | 24 | #include <linux/limits.h> |
25 | #include <linux/err.h> | ||
25 | 26 | ||
26 | #include <linux/io.h> | 27 | #include <linux/io.h> |
27 | 28 | ||
@@ -71,16 +72,13 @@ static void _autodep_lookup(struct clkdm_pwrdm_autodep *autodep) | |||
71 | if (!omap_chip_is(autodep->omap_chip)) | 72 | if (!omap_chip_is(autodep->omap_chip)) |
72 | return; | 73 | return; |
73 | 74 | ||
74 | pwrdm = pwrdm_lookup(autodep->pwrdm_name); | 75 | pwrdm = pwrdm_lookup(autodep->pwrdm.name); |
75 | if (!pwrdm) { | 76 | if (!pwrdm) { |
76 | pr_debug("clockdomain: _autodep_lookup: powerdomain %s " | 77 | pr_err("clockdomain: autodeps: powerdomain %s does not exist\n", |
77 | "does not exist\n", autodep->pwrdm_name); | 78 | autodep->pwrdm.name); |
78 | WARN_ON(1); | 79 | pwrdm = ERR_PTR(-ENOENT); |
79 | return; | ||
80 | } | 80 | } |
81 | autodep->pwrdm = pwrdm; | 81 | autodep->pwrdm.ptr = pwrdm; |
82 | |||
83 | return; | ||
84 | } | 82 | } |
85 | 83 | ||
86 | /* | 84 | /* |
@@ -95,16 +93,19 @@ static void _clkdm_add_autodeps(struct clockdomain *clkdm) | |||
95 | { | 93 | { |
96 | struct clkdm_pwrdm_autodep *autodep; | 94 | struct clkdm_pwrdm_autodep *autodep; |
97 | 95 | ||
98 | for (autodep = autodeps; autodep->pwrdm_name; autodep++) { | 96 | for (autodep = autodeps; autodep->pwrdm.ptr; autodep++) { |
99 | if (!autodep->pwrdm) | 97 | if (IS_ERR(autodep->pwrdm.ptr)) |
98 | continue; | ||
99 | |||
100 | if (!omap_chip_is(autodep->omap_chip)) | ||
100 | continue; | 101 | continue; |
101 | 102 | ||
102 | pr_debug("clockdomain: adding %s sleepdep/wkdep for " | 103 | pr_debug("clockdomain: adding %s sleepdep/wkdep for " |
103 | "pwrdm %s\n", autodep->pwrdm_name, | 104 | "pwrdm %s\n", autodep->pwrdm.ptr->name, |
104 | clkdm->pwrdm->name); | 105 | clkdm->pwrdm.ptr->name); |
105 | 106 | ||
106 | pwrdm_add_sleepdep(clkdm->pwrdm, autodep->pwrdm); | 107 | pwrdm_add_sleepdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr); |
107 | pwrdm_add_wkdep(clkdm->pwrdm, autodep->pwrdm); | 108 | pwrdm_add_wkdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr); |
108 | } | 109 | } |
109 | } | 110 | } |
110 | 111 | ||
@@ -120,16 +121,19 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm) | |||
120 | { | 121 | { |
121 | struct clkdm_pwrdm_autodep *autodep; | 122 | struct clkdm_pwrdm_autodep *autodep; |
122 | 123 | ||
123 | for (autodep = autodeps; autodep->pwrdm_name; autodep++) { | 124 | for (autodep = autodeps; autodep->pwrdm.ptr; autodep++) { |
124 | if (!autodep->pwrdm) | 125 | if (IS_ERR(autodep->pwrdm.ptr)) |
126 | continue; | ||
127 | |||
128 | if (!omap_chip_is(autodep->omap_chip)) | ||
125 | continue; | 129 | continue; |
126 | 130 | ||
127 | pr_debug("clockdomain: removing %s sleepdep/wkdep for " | 131 | pr_debug("clockdomain: removing %s sleepdep/wkdep for " |
128 | "pwrdm %s\n", autodep->pwrdm_name, | 132 | "pwrdm %s\n", autodep->pwrdm.ptr->name, |
129 | clkdm->pwrdm->name); | 133 | clkdm->pwrdm.ptr->name); |
130 | 134 | ||
131 | pwrdm_del_sleepdep(clkdm->pwrdm, autodep->pwrdm); | 135 | pwrdm_del_sleepdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr); |
132 | pwrdm_del_wkdep(clkdm->pwrdm, autodep->pwrdm); | 136 | pwrdm_del_wkdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr); |
133 | } | 137 | } |
134 | } | 138 | } |
135 | 139 | ||
@@ -179,7 +183,7 @@ void clkdm_init(struct clockdomain **clkdms, | |||
179 | 183 | ||
180 | autodeps = init_autodeps; | 184 | autodeps = init_autodeps; |
181 | if (autodeps) | 185 | if (autodeps) |
182 | for (autodep = autodeps; autodep->pwrdm_name; autodep++) | 186 | for (autodep = autodeps; autodep->pwrdm.ptr; autodep++) |
183 | _autodep_lookup(autodep); | 187 | _autodep_lookup(autodep); |
184 | } | 188 | } |
185 | 189 | ||
@@ -202,20 +206,20 @@ int clkdm_register(struct clockdomain *clkdm) | |||
202 | if (!omap_chip_is(clkdm->omap_chip)) | 206 | if (!omap_chip_is(clkdm->omap_chip)) |
203 | return -EINVAL; | 207 | return -EINVAL; |
204 | 208 | ||
205 | pwrdm = pwrdm_lookup(clkdm->pwrdm_name); | 209 | pwrdm = pwrdm_lookup(clkdm->pwrdm.name); |
206 | if (!pwrdm) { | 210 | if (!pwrdm) { |
207 | pr_debug("clockdomain: clkdm_register %s: powerdomain %s " | 211 | pr_err("clockdomain: %s: powerdomain %s does not exist\n", |
208 | "does not exist\n", clkdm->name, clkdm->pwrdm_name); | 212 | clkdm->name, clkdm->pwrdm.name); |
209 | return -EINVAL; | 213 | return -EINVAL; |
210 | } | 214 | } |
211 | clkdm->pwrdm = pwrdm; | 215 | clkdm->pwrdm.ptr = pwrdm; |
212 | 216 | ||
213 | mutex_lock(&clkdm_mutex); | 217 | mutex_lock(&clkdm_mutex); |
214 | /* Verify that the clockdomain is not already registered */ | 218 | /* Verify that the clockdomain is not already registered */ |
215 | if (_clkdm_lookup(clkdm->name)) { | 219 | if (_clkdm_lookup(clkdm->name)) { |
216 | ret = -EEXIST; | 220 | ret = -EEXIST; |
217 | goto cr_unlock; | 221 | goto cr_unlock; |
218 | }; | 222 | } |
219 | 223 | ||
220 | list_add(&clkdm->node, &clkdm_list); | 224 | list_add(&clkdm->node, &clkdm_list); |
221 | 225 | ||
@@ -242,7 +246,7 @@ int clkdm_unregister(struct clockdomain *clkdm) | |||
242 | if (!clkdm) | 246 | if (!clkdm) |
243 | return -EINVAL; | 247 | return -EINVAL; |
244 | 248 | ||
245 | pwrdm_del_clkdm(clkdm->pwrdm, clkdm); | 249 | pwrdm_del_clkdm(clkdm->pwrdm.ptr, clkdm); |
246 | 250 | ||
247 | mutex_lock(&clkdm_mutex); | 251 | mutex_lock(&clkdm_mutex); |
248 | list_del(&clkdm->node); | 252 | list_del(&clkdm->node); |
@@ -327,7 +331,7 @@ struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm) | |||
327 | if (!clkdm) | 331 | if (!clkdm) |
328 | return NULL; | 332 | return NULL; |
329 | 333 | ||
330 | return clkdm->pwrdm; | 334 | return clkdm->pwrdm.ptr; |
331 | } | 335 | } |
332 | 336 | ||
333 | 337 | ||
@@ -348,7 +352,7 @@ static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm) | |||
348 | if (!clkdm) | 352 | if (!clkdm) |
349 | return -EINVAL; | 353 | return -EINVAL; |
350 | 354 | ||
351 | v = cm_read_mod_reg(clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL); | 355 | v = cm_read_mod_reg(clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); |
352 | v &= clkdm->clktrctrl_mask; | 356 | v &= clkdm->clktrctrl_mask; |
353 | v >>= __ffs(clkdm->clktrctrl_mask); | 357 | v >>= __ffs(clkdm->clktrctrl_mask); |
354 | 358 | ||
@@ -380,7 +384,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
380 | if (cpu_is_omap24xx()) { | 384 | if (cpu_is_omap24xx()) { |
381 | 385 | ||
382 | cm_set_mod_reg_bits(OMAP24XX_FORCESTATE, | 386 | cm_set_mod_reg_bits(OMAP24XX_FORCESTATE, |
383 | clkdm->pwrdm->prcm_offs, PM_PWSTCTRL); | 387 | clkdm->pwrdm.ptr->prcm_offs, PM_PWSTCTRL); |
384 | 388 | ||
385 | } else if (cpu_is_omap34xx()) { | 389 | } else if (cpu_is_omap34xx()) { |
386 | 390 | ||
@@ -388,7 +392,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
388 | __ffs(clkdm->clktrctrl_mask)); | 392 | __ffs(clkdm->clktrctrl_mask)); |
389 | 393 | ||
390 | cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v, | 394 | cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v, |
391 | clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL); | 395 | clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); |
392 | 396 | ||
393 | } else { | 397 | } else { |
394 | BUG(); | 398 | BUG(); |
@@ -422,7 +426,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm) | |||
422 | if (cpu_is_omap24xx()) { | 426 | if (cpu_is_omap24xx()) { |
423 | 427 | ||
424 | cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE, | 428 | cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE, |
425 | clkdm->pwrdm->prcm_offs, PM_PWSTCTRL); | 429 | clkdm->pwrdm.ptr->prcm_offs, PM_PWSTCTRL); |
426 | 430 | ||
427 | } else if (cpu_is_omap34xx()) { | 431 | } else if (cpu_is_omap34xx()) { |
428 | 432 | ||
@@ -430,7 +434,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm) | |||
430 | __ffs(clkdm->clktrctrl_mask)); | 434 | __ffs(clkdm->clktrctrl_mask)); |
431 | 435 | ||
432 | cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v, | 436 | cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v, |
433 | clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL); | 437 | clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); |
434 | 438 | ||
435 | } else { | 439 | } else { |
436 | BUG(); | 440 | BUG(); |
@@ -478,7 +482,7 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm) | |||
478 | 482 | ||
479 | cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, | 483 | cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, |
480 | v << __ffs(clkdm->clktrctrl_mask), | 484 | v << __ffs(clkdm->clktrctrl_mask), |
481 | clkdm->pwrdm->prcm_offs, | 485 | clkdm->pwrdm.ptr->prcm_offs, |
482 | CM_CLKSTCTRL); | 486 | CM_CLKSTCTRL); |
483 | } | 487 | } |
484 | 488 | ||
@@ -516,7 +520,7 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm) | |||
516 | 520 | ||
517 | cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, | 521 | cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, |
518 | v << __ffs(clkdm->clktrctrl_mask), | 522 | v << __ffs(clkdm->clktrctrl_mask), |
519 | clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL); | 523 | clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); |
520 | 524 | ||
521 | if (atomic_read(&clkdm->usecount) > 0) | 525 | if (atomic_read(&clkdm->usecount) > 0) |
522 | _clkdm_del_autodeps(clkdm); | 526 | _clkdm_del_autodeps(clkdm); |
@@ -567,6 +571,8 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | |||
567 | else | 571 | else |
568 | omap2_clkdm_wakeup(clkdm); | 572 | omap2_clkdm_wakeup(clkdm); |
569 | 573 | ||
574 | pwrdm_wait_transition(clkdm->pwrdm.ptr); | ||
575 | |||
570 | return 0; | 576 | return 0; |
571 | } | 577 | } |
572 | 578 | ||
diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains.h index cd86dcc7b424..281d5da19188 100644 --- a/arch/arm/mach-omap2/clockdomains.h +++ b/arch/arm/mach-omap2/clockdomains.h | |||
@@ -14,12 +14,29 @@ | |||
14 | 14 | ||
15 | /* | 15 | /* |
16 | * OMAP2/3-common clockdomains | 16 | * OMAP2/3-common clockdomains |
17 | * | ||
18 | * Even though the 2420 has a single PRCM module from the | ||
19 | * interconnect's perspective, internally it does appear to have | ||
20 | * separate PRM and CM clockdomains. The usual test case is | ||
21 | * sys_clkout/sys_clkout2. | ||
17 | */ | 22 | */ |
18 | 23 | ||
19 | /* This is an implicit clockdomain - it is never defined as such in TRM */ | 24 | /* This is an implicit clockdomain - it is never defined as such in TRM */ |
20 | static struct clockdomain wkup_clkdm = { | 25 | static struct clockdomain wkup_clkdm = { |
21 | .name = "wkup_clkdm", | 26 | .name = "wkup_clkdm", |
22 | .pwrdm_name = "wkup_pwrdm", | 27 | .pwrdm = { .name = "wkup_pwrdm" }, |
28 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | ||
29 | }; | ||
30 | |||
31 | static struct clockdomain prm_clkdm = { | ||
32 | .name = "prm_clkdm", | ||
33 | .pwrdm = { .name = "wkup_pwrdm" }, | ||
34 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | ||
35 | }; | ||
36 | |||
37 | static struct clockdomain cm_clkdm = { | ||
38 | .name = "cm_clkdm", | ||
39 | .pwrdm = { .name = "core_pwrdm" }, | ||
23 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | 40 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), |
24 | }; | 41 | }; |
25 | 42 | ||
@@ -31,7 +48,7 @@ static struct clockdomain wkup_clkdm = { | |||
31 | 48 | ||
32 | static struct clockdomain mpu_2420_clkdm = { | 49 | static struct clockdomain mpu_2420_clkdm = { |
33 | .name = "mpu_clkdm", | 50 | .name = "mpu_clkdm", |
34 | .pwrdm_name = "mpu_pwrdm", | 51 | .pwrdm = { .name = "mpu_pwrdm" }, |
35 | .flags = CLKDM_CAN_HWSUP, | 52 | .flags = CLKDM_CAN_HWSUP, |
36 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, | 53 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, |
37 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 54 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
@@ -39,7 +56,7 @@ static struct clockdomain mpu_2420_clkdm = { | |||
39 | 56 | ||
40 | static struct clockdomain iva1_2420_clkdm = { | 57 | static struct clockdomain iva1_2420_clkdm = { |
41 | .name = "iva1_clkdm", | 58 | .name = "iva1_clkdm", |
42 | .pwrdm_name = "dsp_pwrdm", | 59 | .pwrdm = { .name = "dsp_pwrdm" }, |
43 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 60 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
44 | .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, | 61 | .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, |
45 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 62 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
@@ -56,7 +73,7 @@ static struct clockdomain iva1_2420_clkdm = { | |||
56 | 73 | ||
57 | static struct clockdomain mpu_2430_clkdm = { | 74 | static struct clockdomain mpu_2430_clkdm = { |
58 | .name = "mpu_clkdm", | 75 | .name = "mpu_clkdm", |
59 | .pwrdm_name = "mpu_pwrdm", | 76 | .pwrdm = { .name = "mpu_pwrdm" }, |
60 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 77 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
61 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, | 78 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, |
62 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 79 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
@@ -64,7 +81,7 @@ static struct clockdomain mpu_2430_clkdm = { | |||
64 | 81 | ||
65 | static struct clockdomain mdm_clkdm = { | 82 | static struct clockdomain mdm_clkdm = { |
66 | .name = "mdm_clkdm", | 83 | .name = "mdm_clkdm", |
67 | .pwrdm_name = "mdm_pwrdm", | 84 | .pwrdm = { .name = "mdm_pwrdm" }, |
68 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 85 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
69 | .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, | 86 | .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, |
70 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 87 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
@@ -81,7 +98,7 @@ static struct clockdomain mdm_clkdm = { | |||
81 | 98 | ||
82 | static struct clockdomain dsp_clkdm = { | 99 | static struct clockdomain dsp_clkdm = { |
83 | .name = "dsp_clkdm", | 100 | .name = "dsp_clkdm", |
84 | .pwrdm_name = "dsp_pwrdm", | 101 | .pwrdm = { .name = "dsp_pwrdm" }, |
85 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 102 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
86 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, | 103 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, |
87 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 104 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
@@ -89,7 +106,7 @@ static struct clockdomain dsp_clkdm = { | |||
89 | 106 | ||
90 | static struct clockdomain gfx_24xx_clkdm = { | 107 | static struct clockdomain gfx_24xx_clkdm = { |
91 | .name = "gfx_clkdm", | 108 | .name = "gfx_clkdm", |
92 | .pwrdm_name = "gfx_pwrdm", | 109 | .pwrdm = { .name = "gfx_pwrdm" }, |
93 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 110 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
94 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, | 111 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, |
95 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 112 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
@@ -97,7 +114,7 @@ static struct clockdomain gfx_24xx_clkdm = { | |||
97 | 114 | ||
98 | static struct clockdomain core_l3_24xx_clkdm = { | 115 | static struct clockdomain core_l3_24xx_clkdm = { |
99 | .name = "core_l3_clkdm", | 116 | .name = "core_l3_clkdm", |
100 | .pwrdm_name = "core_pwrdm", | 117 | .pwrdm = { .name = "core_pwrdm" }, |
101 | .flags = CLKDM_CAN_HWSUP, | 118 | .flags = CLKDM_CAN_HWSUP, |
102 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, | 119 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, |
103 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 120 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
@@ -105,7 +122,7 @@ static struct clockdomain core_l3_24xx_clkdm = { | |||
105 | 122 | ||
106 | static struct clockdomain core_l4_24xx_clkdm = { | 123 | static struct clockdomain core_l4_24xx_clkdm = { |
107 | .name = "core_l4_clkdm", | 124 | .name = "core_l4_clkdm", |
108 | .pwrdm_name = "core_pwrdm", | 125 | .pwrdm = { .name = "core_pwrdm" }, |
109 | .flags = CLKDM_CAN_HWSUP, | 126 | .flags = CLKDM_CAN_HWSUP, |
110 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, | 127 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, |
111 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 128 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
@@ -113,7 +130,7 @@ static struct clockdomain core_l4_24xx_clkdm = { | |||
113 | 130 | ||
114 | static struct clockdomain dss_24xx_clkdm = { | 131 | static struct clockdomain dss_24xx_clkdm = { |
115 | .name = "dss_clkdm", | 132 | .name = "dss_clkdm", |
116 | .pwrdm_name = "core_pwrdm", | 133 | .pwrdm = { .name = "core_pwrdm" }, |
117 | .flags = CLKDM_CAN_HWSUP, | 134 | .flags = CLKDM_CAN_HWSUP, |
118 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, | 135 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, |
119 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 136 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
@@ -130,7 +147,7 @@ static struct clockdomain dss_24xx_clkdm = { | |||
130 | 147 | ||
131 | static struct clockdomain mpu_34xx_clkdm = { | 148 | static struct clockdomain mpu_34xx_clkdm = { |
132 | .name = "mpu_clkdm", | 149 | .name = "mpu_clkdm", |
133 | .pwrdm_name = "mpu_pwrdm", | 150 | .pwrdm = { .name = "mpu_pwrdm" }, |
134 | .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, | 151 | .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, |
135 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, | 152 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, |
136 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 153 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -138,7 +155,7 @@ static struct clockdomain mpu_34xx_clkdm = { | |||
138 | 155 | ||
139 | static struct clockdomain neon_clkdm = { | 156 | static struct clockdomain neon_clkdm = { |
140 | .name = "neon_clkdm", | 157 | .name = "neon_clkdm", |
141 | .pwrdm_name = "neon_pwrdm", | 158 | .pwrdm = { .name = "neon_pwrdm" }, |
142 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 159 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
143 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, | 160 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, |
144 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 161 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -146,7 +163,7 @@ static struct clockdomain neon_clkdm = { | |||
146 | 163 | ||
147 | static struct clockdomain iva2_clkdm = { | 164 | static struct clockdomain iva2_clkdm = { |
148 | .name = "iva2_clkdm", | 165 | .name = "iva2_clkdm", |
149 | .pwrdm_name = "iva2_pwrdm", | 166 | .pwrdm = { .name = "iva2_pwrdm" }, |
150 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 167 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
151 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, | 168 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, |
152 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 169 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -154,7 +171,7 @@ static struct clockdomain iva2_clkdm = { | |||
154 | 171 | ||
155 | static struct clockdomain gfx_3430es1_clkdm = { | 172 | static struct clockdomain gfx_3430es1_clkdm = { |
156 | .name = "gfx_clkdm", | 173 | .name = "gfx_clkdm", |
157 | .pwrdm_name = "gfx_pwrdm", | 174 | .pwrdm = { .name = "gfx_pwrdm" }, |
158 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 175 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
159 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, | 176 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, |
160 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1), | 177 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1), |
@@ -162,10 +179,10 @@ static struct clockdomain gfx_3430es1_clkdm = { | |||
162 | 179 | ||
163 | static struct clockdomain sgx_clkdm = { | 180 | static struct clockdomain sgx_clkdm = { |
164 | .name = "sgx_clkdm", | 181 | .name = "sgx_clkdm", |
165 | .pwrdm_name = "sgx_pwrdm", | 182 | .pwrdm = { .name = "sgx_pwrdm" }, |
166 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 183 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
167 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, | 184 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, |
168 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2), | 185 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
169 | }; | 186 | }; |
170 | 187 | ||
171 | /* | 188 | /* |
@@ -177,7 +194,7 @@ static struct clockdomain sgx_clkdm = { | |||
177 | */ | 194 | */ |
178 | static struct clockdomain d2d_clkdm = { | 195 | static struct clockdomain d2d_clkdm = { |
179 | .name = "d2d_clkdm", | 196 | .name = "d2d_clkdm", |
180 | .pwrdm_name = "core_pwrdm", | 197 | .pwrdm = { .name = "core_pwrdm" }, |
181 | .flags = CLKDM_CAN_HWSUP, | 198 | .flags = CLKDM_CAN_HWSUP, |
182 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, | 199 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, |
183 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 200 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -185,7 +202,7 @@ static struct clockdomain d2d_clkdm = { | |||
185 | 202 | ||
186 | static struct clockdomain core_l3_34xx_clkdm = { | 203 | static struct clockdomain core_l3_34xx_clkdm = { |
187 | .name = "core_l3_clkdm", | 204 | .name = "core_l3_clkdm", |
188 | .pwrdm_name = "core_pwrdm", | 205 | .pwrdm = { .name = "core_pwrdm" }, |
189 | .flags = CLKDM_CAN_HWSUP, | 206 | .flags = CLKDM_CAN_HWSUP, |
190 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, | 207 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, |
191 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 208 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -193,7 +210,7 @@ static struct clockdomain core_l3_34xx_clkdm = { | |||
193 | 210 | ||
194 | static struct clockdomain core_l4_34xx_clkdm = { | 211 | static struct clockdomain core_l4_34xx_clkdm = { |
195 | .name = "core_l4_clkdm", | 212 | .name = "core_l4_clkdm", |
196 | .pwrdm_name = "core_pwrdm", | 213 | .pwrdm = { .name = "core_pwrdm" }, |
197 | .flags = CLKDM_CAN_HWSUP, | 214 | .flags = CLKDM_CAN_HWSUP, |
198 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, | 215 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, |
199 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 216 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -201,7 +218,7 @@ static struct clockdomain core_l4_34xx_clkdm = { | |||
201 | 218 | ||
202 | static struct clockdomain dss_34xx_clkdm = { | 219 | static struct clockdomain dss_34xx_clkdm = { |
203 | .name = "dss_clkdm", | 220 | .name = "dss_clkdm", |
204 | .pwrdm_name = "dss_pwrdm", | 221 | .pwrdm = { .name = "dss_pwrdm" }, |
205 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 222 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
206 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK, | 223 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK, |
207 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 224 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -209,7 +226,7 @@ static struct clockdomain dss_34xx_clkdm = { | |||
209 | 226 | ||
210 | static struct clockdomain cam_clkdm = { | 227 | static struct clockdomain cam_clkdm = { |
211 | .name = "cam_clkdm", | 228 | .name = "cam_clkdm", |
212 | .pwrdm_name = "cam_pwrdm", | 229 | .pwrdm = { .name = "cam_pwrdm" }, |
213 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 230 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
214 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, | 231 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, |
215 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 232 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -217,28 +234,62 @@ static struct clockdomain cam_clkdm = { | |||
217 | 234 | ||
218 | static struct clockdomain usbhost_clkdm = { | 235 | static struct clockdomain usbhost_clkdm = { |
219 | .name = "usbhost_clkdm", | 236 | .name = "usbhost_clkdm", |
220 | .pwrdm_name = "usbhost_pwrdm", | 237 | .pwrdm = { .name = "usbhost_pwrdm" }, |
221 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 238 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
222 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, | 239 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, |
223 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2), | 240 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
224 | }; | 241 | }; |
225 | 242 | ||
226 | static struct clockdomain per_clkdm = { | 243 | static struct clockdomain per_clkdm = { |
227 | .name = "per_clkdm", | 244 | .name = "per_clkdm", |
228 | .pwrdm_name = "per_pwrdm", | 245 | .pwrdm = { .name = "per_pwrdm" }, |
229 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 246 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
230 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK, | 247 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK, |
231 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 248 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
232 | }; | 249 | }; |
233 | 250 | ||
251 | /* | ||
252 | * Disable hw supervised mode for emu_clkdm, because emu_pwrdm is | ||
253 | * switched of even if sdti is in use | ||
254 | */ | ||
234 | static struct clockdomain emu_clkdm = { | 255 | static struct clockdomain emu_clkdm = { |
235 | .name = "emu_clkdm", | 256 | .name = "emu_clkdm", |
236 | .pwrdm_name = "emu_pwrdm", | 257 | .pwrdm = { .name = "emu_pwrdm" }, |
237 | .flags = CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_SWSUP, | 258 | .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP, |
238 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, | 259 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, |
239 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 260 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
240 | }; | 261 | }; |
241 | 262 | ||
263 | static struct clockdomain dpll1_clkdm = { | ||
264 | .name = "dpll1_clkdm", | ||
265 | .pwrdm = { .name = "dpll1_pwrdm" }, | ||
266 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
267 | }; | ||
268 | |||
269 | static struct clockdomain dpll2_clkdm = { | ||
270 | .name = "dpll2_clkdm", | ||
271 | .pwrdm = { .name = "dpll2_pwrdm" }, | ||
272 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
273 | }; | ||
274 | |||
275 | static struct clockdomain dpll3_clkdm = { | ||
276 | .name = "dpll3_clkdm", | ||
277 | .pwrdm = { .name = "dpll3_pwrdm" }, | ||
278 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
279 | }; | ||
280 | |||
281 | static struct clockdomain dpll4_clkdm = { | ||
282 | .name = "dpll4_clkdm", | ||
283 | .pwrdm = { .name = "dpll4_pwrdm" }, | ||
284 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
285 | }; | ||
286 | |||
287 | static struct clockdomain dpll5_clkdm = { | ||
288 | .name = "dpll5_clkdm", | ||
289 | .pwrdm = { .name = "dpll5_pwrdm" }, | ||
290 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | ||
291 | }; | ||
292 | |||
242 | #endif /* CONFIG_ARCH_OMAP34XX */ | 293 | #endif /* CONFIG_ARCH_OMAP34XX */ |
243 | 294 | ||
244 | /* | 295 | /* |
@@ -247,14 +298,16 @@ static struct clockdomain emu_clkdm = { | |||
247 | 298 | ||
248 | static struct clkdm_pwrdm_autodep clkdm_pwrdm_autodeps[] = { | 299 | static struct clkdm_pwrdm_autodep clkdm_pwrdm_autodeps[] = { |
249 | { | 300 | { |
250 | .pwrdm_name = "mpu_pwrdm", | 301 | .pwrdm = { .name = "mpu_pwrdm" }, |
251 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | 302 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) |
252 | }, | 303 | }, |
253 | { | 304 | { |
254 | .pwrdm_name = "iva2_pwrdm", | 305 | .pwrdm = { .name = "iva2_pwrdm" }, |
255 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | 306 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) |
256 | }, | 307 | }, |
257 | { NULL } | 308 | { |
309 | .pwrdm = { .name = NULL }, | ||
310 | } | ||
258 | }; | 311 | }; |
259 | 312 | ||
260 | /* | 313 | /* |
@@ -264,6 +317,8 @@ static struct clkdm_pwrdm_autodep clkdm_pwrdm_autodeps[] = { | |||
264 | static struct clockdomain *clockdomains_omap[] = { | 317 | static struct clockdomain *clockdomains_omap[] = { |
265 | 318 | ||
266 | &wkup_clkdm, | 319 | &wkup_clkdm, |
320 | &cm_clkdm, | ||
321 | &prm_clkdm, | ||
267 | 322 | ||
268 | #ifdef CONFIG_ARCH_OMAP2420 | 323 | #ifdef CONFIG_ARCH_OMAP2420 |
269 | &mpu_2420_clkdm, | 324 | &mpu_2420_clkdm, |
@@ -297,6 +352,11 @@ static struct clockdomain *clockdomains_omap[] = { | |||
297 | &usbhost_clkdm, | 352 | &usbhost_clkdm, |
298 | &per_clkdm, | 353 | &per_clkdm, |
299 | &emu_clkdm, | 354 | &emu_clkdm, |
355 | &dpll1_clkdm, | ||
356 | &dpll2_clkdm, | ||
357 | &dpll3_clkdm, | ||
358 | &dpll4_clkdm, | ||
359 | &dpll5_clkdm, | ||
300 | #endif | 360 | #endif |
301 | 361 | ||
302 | NULL, | 362 | NULL, |
diff --git a/arch/arm/mach-omap2/cm-regbits-24xx.h b/arch/arm/mach-omap2/cm-regbits-24xx.h index 1098ecfab861..297a2fe634ea 100644 --- a/arch/arm/mach-omap2/cm-regbits-24xx.h +++ b/arch/arm/mach-omap2/cm-regbits-24xx.h | |||
@@ -110,35 +110,56 @@ | |||
110 | #define OMAP24XX_EN_DES (1 << 0) | 110 | #define OMAP24XX_EN_DES (1 << 0) |
111 | 111 | ||
112 | /* CM_IDLEST1_CORE specific bits */ | 112 | /* CM_IDLEST1_CORE specific bits */ |
113 | #define OMAP24XX_ST_MAILBOXES (1 << 30) | 113 | #define OMAP24XX_ST_MAILBOXES_SHIFT 30 |
114 | #define OMAP24XX_ST_WDT4 (1 << 29) | 114 | #define OMAP24XX_ST_MAILBOXES_MASK (1 << 30) |
115 | #define OMAP2420_ST_WDT3 (1 << 28) | 115 | #define OMAP24XX_ST_WDT4_SHIFT 29 |
116 | #define OMAP24XX_ST_MSPRO (1 << 27) | 116 | #define OMAP24XX_ST_WDT4_MASK (1 << 29) |
117 | #define OMAP24XX_ST_FAC (1 << 25) | 117 | #define OMAP2420_ST_WDT3_SHIFT 28 |
118 | #define OMAP2420_ST_EAC (1 << 24) | 118 | #define OMAP2420_ST_WDT3_MASK (1 << 28) |
119 | #define OMAP24XX_ST_HDQ (1 << 23) | 119 | #define OMAP24XX_ST_MSPRO_SHIFT 27 |
120 | #define OMAP24XX_ST_I2C2 (1 << 20) | 120 | #define OMAP24XX_ST_MSPRO_MASK (1 << 27) |
121 | #define OMAP24XX_ST_I2C1 (1 << 19) | 121 | #define OMAP24XX_ST_FAC_SHIFT 25 |
122 | #define OMAP24XX_ST_MCBSP2 (1 << 16) | 122 | #define OMAP24XX_ST_FAC_MASK (1 << 25) |
123 | #define OMAP24XX_ST_MCBSP1 (1 << 15) | 123 | #define OMAP2420_ST_EAC_SHIFT 24 |
124 | #define OMAP24XX_ST_DSS (1 << 0) | 124 | #define OMAP2420_ST_EAC_MASK (1 << 24) |
125 | #define OMAP24XX_ST_HDQ_SHIFT 23 | ||
126 | #define OMAP24XX_ST_HDQ_MASK (1 << 23) | ||
127 | #define OMAP2420_ST_I2C2_SHIFT 20 | ||
128 | #define OMAP2420_ST_I2C2_MASK (1 << 20) | ||
129 | #define OMAP2420_ST_I2C1_SHIFT 19 | ||
130 | #define OMAP2420_ST_I2C1_MASK (1 << 19) | ||
131 | #define OMAP24XX_ST_MCBSP2_SHIFT 16 | ||
132 | #define OMAP24XX_ST_MCBSP2_MASK (1 << 16) | ||
133 | #define OMAP24XX_ST_MCBSP1_SHIFT 15 | ||
134 | #define OMAP24XX_ST_MCBSP1_MASK (1 << 15) | ||
135 | #define OMAP24XX_ST_DSS_SHIFT 0 | ||
136 | #define OMAP24XX_ST_DSS_MASK (1 << 0) | ||
125 | 137 | ||
126 | /* CM_IDLEST2_CORE */ | 138 | /* CM_IDLEST2_CORE */ |
127 | #define OMAP2430_ST_MCBSP5 (1 << 5) | 139 | #define OMAP2430_ST_MCBSP5_SHIFT 5 |
128 | #define OMAP2430_ST_MCBSP4 (1 << 4) | 140 | #define OMAP2430_ST_MCBSP5_MASK (1 << 5) |
129 | #define OMAP2430_ST_MCBSP3 (1 << 3) | 141 | #define OMAP2430_ST_MCBSP4_SHIFT 4 |
130 | #define OMAP24XX_ST_SSI (1 << 1) | 142 | #define OMAP2430_ST_MCBSP4_MASK (1 << 4) |
143 | #define OMAP2430_ST_MCBSP3_SHIFT 3 | ||
144 | #define OMAP2430_ST_MCBSP3_MASK (1 << 3) | ||
145 | #define OMAP24XX_ST_SSI_SHIFT 1 | ||
146 | #define OMAP24XX_ST_SSI_MASK (1 << 1) | ||
131 | 147 | ||
132 | /* CM_IDLEST3_CORE */ | 148 | /* CM_IDLEST3_CORE */ |
133 | /* 2430 only */ | 149 | /* 2430 only */ |
134 | #define OMAP2430_ST_SDRC (1 << 2) | 150 | #define OMAP2430_ST_SDRC_MASK (1 << 2) |
135 | 151 | ||
136 | /* CM_IDLEST4_CORE */ | 152 | /* CM_IDLEST4_CORE */ |
137 | #define OMAP24XX_ST_PKA (1 << 4) | 153 | #define OMAP24XX_ST_PKA_SHIFT 4 |
138 | #define OMAP24XX_ST_AES (1 << 3) | 154 | #define OMAP24XX_ST_PKA_MASK (1 << 4) |
139 | #define OMAP24XX_ST_RNG (1 << 2) | 155 | #define OMAP24XX_ST_AES_SHIFT 3 |
140 | #define OMAP24XX_ST_SHA (1 << 1) | 156 | #define OMAP24XX_ST_AES_MASK (1 << 3) |
141 | #define OMAP24XX_ST_DES (1 << 0) | 157 | #define OMAP24XX_ST_RNG_SHIFT 2 |
158 | #define OMAP24XX_ST_RNG_MASK (1 << 2) | ||
159 | #define OMAP24XX_ST_SHA_SHIFT 1 | ||
160 | #define OMAP24XX_ST_SHA_MASK (1 << 1) | ||
161 | #define OMAP24XX_ST_DES_SHIFT 0 | ||
162 | #define OMAP24XX_ST_DES_MASK (1 << 0) | ||
142 | 163 | ||
143 | /* CM_AUTOIDLE1_CORE */ | 164 | /* CM_AUTOIDLE1_CORE */ |
144 | #define OMAP24XX_AUTO_CAM (1 << 31) | 165 | #define OMAP24XX_AUTO_CAM (1 << 31) |
@@ -275,11 +296,16 @@ | |||
275 | #define OMAP24XX_EN_32KSYNC (1 << 1) | 296 | #define OMAP24XX_EN_32KSYNC (1 << 1) |
276 | 297 | ||
277 | /* CM_IDLEST_WKUP specific bits */ | 298 | /* CM_IDLEST_WKUP specific bits */ |
278 | #define OMAP2430_ST_ICR (1 << 6) | 299 | #define OMAP2430_ST_ICR_SHIFT 6 |
279 | #define OMAP24XX_ST_OMAPCTRL (1 << 5) | 300 | #define OMAP2430_ST_ICR_MASK (1 << 6) |
280 | #define OMAP24XX_ST_WDT1 (1 << 4) | 301 | #define OMAP24XX_ST_OMAPCTRL_SHIFT 5 |
281 | #define OMAP24XX_ST_MPU_WDT (1 << 3) | 302 | #define OMAP24XX_ST_OMAPCTRL_MASK (1 << 5) |
282 | #define OMAP24XX_ST_32KSYNC (1 << 1) | 303 | #define OMAP24XX_ST_WDT1_SHIFT 4 |
304 | #define OMAP24XX_ST_WDT1_MASK (1 << 4) | ||
305 | #define OMAP24XX_ST_MPU_WDT_SHIFT 3 | ||
306 | #define OMAP24XX_ST_MPU_WDT_MASK (1 << 3) | ||
307 | #define OMAP24XX_ST_32KSYNC_SHIFT 1 | ||
308 | #define OMAP24XX_ST_32KSYNC_MASK (1 << 1) | ||
283 | 309 | ||
284 | /* CM_AUTOIDLE_WKUP */ | 310 | /* CM_AUTOIDLE_WKUP */ |
285 | #define OMAP24XX_AUTO_OMAPCTRL (1 << 5) | 311 | #define OMAP24XX_AUTO_OMAPCTRL (1 << 5) |
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h index 219f5c8d9659..6f3f5a36aae6 100644 --- a/arch/arm/mach-omap2/cm-regbits-34xx.h +++ b/arch/arm/mach-omap2/cm-regbits-34xx.h | |||
@@ -183,31 +183,58 @@ | |||
183 | #define OMAP3430ES2_EN_CPEFUSE_MASK (1 << 0) | 183 | #define OMAP3430ES2_EN_CPEFUSE_MASK (1 << 0) |
184 | 184 | ||
185 | /* CM_IDLEST1_CORE specific bits */ | 185 | /* CM_IDLEST1_CORE specific bits */ |
186 | #define OMAP3430_ST_ICR (1 << 29) | 186 | #define OMAP3430ES2_ST_MMC3_SHIFT 30 |
187 | #define OMAP3430_ST_AES2 (1 << 28) | 187 | #define OMAP3430ES2_ST_MMC3_MASK (1 << 30) |
188 | #define OMAP3430_ST_SHA12 (1 << 27) | 188 | #define OMAP3430_ST_ICR_SHIFT 29 |
189 | #define OMAP3430_ST_DES2 (1 << 26) | 189 | #define OMAP3430_ST_ICR_MASK (1 << 29) |
190 | #define OMAP3430_ST_MSPRO (1 << 23) | 190 | #define OMAP3430_ST_AES2_SHIFT 28 |
191 | #define OMAP3430_ST_HDQ (1 << 22) | 191 | #define OMAP3430_ST_AES2_MASK (1 << 28) |
192 | #define OMAP3430ES1_ST_FAC (1 << 8) | 192 | #define OMAP3430_ST_SHA12_SHIFT 27 |
193 | #define OMAP3430ES1_ST_MAILBOXES (1 << 7) | 193 | #define OMAP3430_ST_SHA12_MASK (1 << 27) |
194 | #define OMAP3430_ST_OMAPCTRL (1 << 6) | 194 | #define OMAP3430_ST_DES2_SHIFT 26 |
195 | #define OMAP3430_ST_SDMA (1 << 2) | 195 | #define OMAP3430_ST_DES2_MASK (1 << 26) |
196 | #define OMAP3430_ST_SDRC (1 << 1) | 196 | #define OMAP3430_ST_MSPRO_SHIFT 23 |
197 | #define OMAP3430_ST_SSI (1 << 0) | 197 | #define OMAP3430_ST_MSPRO_MASK (1 << 23) |
198 | #define OMAP3430_ST_HDQ_SHIFT 22 | ||
199 | #define OMAP3430_ST_HDQ_MASK (1 << 22) | ||
200 | #define OMAP3430ES1_ST_FAC_SHIFT 8 | ||
201 | #define OMAP3430ES1_ST_FAC_MASK (1 << 8) | ||
202 | #define OMAP3430ES2_ST_SSI_IDLE_SHIFT 8 | ||
203 | #define OMAP3430ES2_ST_SSI_IDLE_MASK (1 << 8) | ||
204 | #define OMAP3430_ST_MAILBOXES_SHIFT 7 | ||
205 | #define OMAP3430_ST_MAILBOXES_MASK (1 << 7) | ||
206 | #define OMAP3430_ST_OMAPCTRL_SHIFT 6 | ||
207 | #define OMAP3430_ST_OMAPCTRL_MASK (1 << 6) | ||
208 | #define OMAP3430_ST_SDMA_SHIFT 2 | ||
209 | #define OMAP3430_ST_SDMA_MASK (1 << 2) | ||
210 | #define OMAP3430_ST_SDRC_SHIFT 1 | ||
211 | #define OMAP3430_ST_SDRC_MASK (1 << 1) | ||
212 | #define OMAP3430_ST_SSI_STDBY_SHIFT 0 | ||
213 | #define OMAP3430_ST_SSI_STDBY_MASK (1 << 0) | ||
198 | 214 | ||
199 | /* CM_IDLEST2_CORE */ | 215 | /* CM_IDLEST2_CORE */ |
200 | #define OMAP3430_ST_PKA (1 << 4) | 216 | #define OMAP3430_ST_PKA_SHIFT 4 |
201 | #define OMAP3430_ST_AES1 (1 << 3) | 217 | #define OMAP3430_ST_PKA_MASK (1 << 4) |
202 | #define OMAP3430_ST_RNG (1 << 2) | 218 | #define OMAP3430_ST_AES1_SHIFT 3 |
203 | #define OMAP3430_ST_SHA11 (1 << 1) | 219 | #define OMAP3430_ST_AES1_MASK (1 << 3) |
204 | #define OMAP3430_ST_DES1 (1 << 0) | 220 | #define OMAP3430_ST_RNG_SHIFT 2 |
221 | #define OMAP3430_ST_RNG_MASK (1 << 2) | ||
222 | #define OMAP3430_ST_SHA11_SHIFT 1 | ||
223 | #define OMAP3430_ST_SHA11_MASK (1 << 1) | ||
224 | #define OMAP3430_ST_DES1_SHIFT 0 | ||
225 | #define OMAP3430_ST_DES1_MASK (1 << 0) | ||
205 | 226 | ||
206 | /* CM_IDLEST3_CORE */ | 227 | /* CM_IDLEST3_CORE */ |
207 | #define OMAP3430ES2_ST_USBTLL_SHIFT 2 | 228 | #define OMAP3430ES2_ST_USBTLL_SHIFT 2 |
208 | #define OMAP3430ES2_ST_USBTLL_MASK (1 << 2) | 229 | #define OMAP3430ES2_ST_USBTLL_MASK (1 << 2) |
230 | #define OMAP3430ES2_ST_CPEFUSE_SHIFT 0 | ||
231 | #define OMAP3430ES2_ST_CPEFUSE_MASK (1 << 0) | ||
209 | 232 | ||
210 | /* CM_AUTOIDLE1_CORE */ | 233 | /* CM_AUTOIDLE1_CORE */ |
234 | #define OMAP3430ES2_AUTO_MMC3 (1 << 30) | ||
235 | #define OMAP3430ES2_AUTO_MMC3_SHIFT 30 | ||
236 | #define OMAP3430ES2_AUTO_ICR (1 << 29) | ||
237 | #define OMAP3430ES2_AUTO_ICR_SHIFT 29 | ||
211 | #define OMAP3430_AUTO_AES2 (1 << 28) | 238 | #define OMAP3430_AUTO_AES2 (1 << 28) |
212 | #define OMAP3430_AUTO_AES2_SHIFT 28 | 239 | #define OMAP3430_AUTO_AES2_SHIFT 28 |
213 | #define OMAP3430_AUTO_SHA12 (1 << 27) | 240 | #define OMAP3430_AUTO_SHA12 (1 << 27) |
@@ -276,6 +303,9 @@ | |||
276 | #define OMAP3430_AUTO_DES1_SHIFT 0 | 303 | #define OMAP3430_AUTO_DES1_SHIFT 0 |
277 | 304 | ||
278 | /* CM_AUTOIDLE3_CORE */ | 305 | /* CM_AUTOIDLE3_CORE */ |
306 | #define OMAP3430ES2_AUTO_USBHOST (1 << 0) | ||
307 | #define OMAP3430ES2_AUTO_USBHOST_SHIFT 0 | ||
308 | #define OMAP3430ES2_AUTO_USBTLL (1 << 2) | ||
279 | #define OMAP3430ES2_AUTO_USBTLL_SHIFT 2 | 309 | #define OMAP3430ES2_AUTO_USBTLL_SHIFT 2 |
280 | #define OMAP3430ES2_AUTO_USBTLL_MASK (1 << 2) | 310 | #define OMAP3430ES2_AUTO_USBTLL_MASK (1 << 2) |
281 | 311 | ||
@@ -332,8 +362,12 @@ | |||
332 | #define OMAP3430ES1_CLKACTIVITY_GFX_MASK (1 << 0) | 362 | #define OMAP3430ES1_CLKACTIVITY_GFX_MASK (1 << 0) |
333 | 363 | ||
334 | /* CM_FCLKEN_SGX */ | 364 | /* CM_FCLKEN_SGX */ |
335 | #define OMAP3430ES2_EN_SGX_SHIFT 1 | 365 | #define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT 1 |
336 | #define OMAP3430ES2_EN_SGX_MASK (1 << 1) | 366 | #define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_MASK (1 << 1) |
367 | |||
368 | /* CM_ICLKEN_SGX */ | ||
369 | #define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT 0 | ||
370 | #define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_MASK (1 << 0) | ||
337 | 371 | ||
338 | /* CM_CLKSEL_SGX */ | 372 | /* CM_CLKSEL_SGX */ |
339 | #define OMAP3430ES2_CLKSEL_SGX_SHIFT 0 | 373 | #define OMAP3430ES2_CLKSEL_SGX_SHIFT 0 |
@@ -349,6 +383,7 @@ | |||
349 | 383 | ||
350 | /* CM_FCLKEN_WKUP specific bits */ | 384 | /* CM_FCLKEN_WKUP specific bits */ |
351 | #define OMAP3430ES2_EN_USIMOCP_SHIFT 9 | 385 | #define OMAP3430ES2_EN_USIMOCP_SHIFT 9 |
386 | #define OMAP3430ES2_EN_USIMOCP_MASK (1 << 9) | ||
352 | 387 | ||
353 | /* CM_ICLKEN_WKUP specific bits */ | 388 | /* CM_ICLKEN_WKUP specific bits */ |
354 | #define OMAP3430_EN_WDT1 (1 << 4) | 389 | #define OMAP3430_EN_WDT1 (1 << 4) |
@@ -357,11 +392,18 @@ | |||
357 | #define OMAP3430_EN_32KSYNC_SHIFT 2 | 392 | #define OMAP3430_EN_32KSYNC_SHIFT 2 |
358 | 393 | ||
359 | /* CM_IDLEST_WKUP specific bits */ | 394 | /* CM_IDLEST_WKUP specific bits */ |
360 | #define OMAP3430_ST_WDT2 (1 << 5) | 395 | #define OMAP3430ES2_ST_USIMOCP_SHIFT 9 |
361 | #define OMAP3430_ST_WDT1 (1 << 4) | 396 | #define OMAP3430ES2_ST_USIMOCP_MASK (1 << 9) |
362 | #define OMAP3430_ST_32KSYNC (1 << 2) | 397 | #define OMAP3430_ST_WDT2_SHIFT 5 |
398 | #define OMAP3430_ST_WDT2_MASK (1 << 5) | ||
399 | #define OMAP3430_ST_WDT1_SHIFT 4 | ||
400 | #define OMAP3430_ST_WDT1_MASK (1 << 4) | ||
401 | #define OMAP3430_ST_32KSYNC_SHIFT 2 | ||
402 | #define OMAP3430_ST_32KSYNC_MASK (1 << 2) | ||
363 | 403 | ||
364 | /* CM_AUTOIDLE_WKUP */ | 404 | /* CM_AUTOIDLE_WKUP */ |
405 | #define OMAP3430ES2_AUTO_USIMOCP (1 << 9) | ||
406 | #define OMAP3430ES2_AUTO_USIMOCP_SHIFT 9 | ||
365 | #define OMAP3430_AUTO_WDT2 (1 << 5) | 407 | #define OMAP3430_AUTO_WDT2 (1 << 5) |
366 | #define OMAP3430_AUTO_WDT2_SHIFT 5 | 408 | #define OMAP3430_AUTO_WDT2_SHIFT 5 |
367 | #define OMAP3430_AUTO_WDT1 (1 << 4) | 409 | #define OMAP3430_AUTO_WDT1 (1 << 4) |
@@ -426,6 +468,8 @@ | |||
426 | #define OMAP3430_ST_CORE_CLK_MASK (1 << 0) | 468 | #define OMAP3430_ST_CORE_CLK_MASK (1 << 0) |
427 | 469 | ||
428 | /* CM_IDLEST2_CKGEN */ | 470 | /* CM_IDLEST2_CKGEN */ |
471 | #define OMAP3430ES2_ST_USIM_CLK_SHIFT 2 | ||
472 | #define OMAP3430ES2_ST_USIM_CLK_MASK (1 << 2) | ||
429 | #define OMAP3430ES2_ST_120M_CLK_SHIFT 1 | 473 | #define OMAP3430ES2_ST_120M_CLK_SHIFT 1 |
430 | #define OMAP3430ES2_ST_120M_CLK_MASK (1 << 1) | 474 | #define OMAP3430ES2_ST_120M_CLK_MASK (1 << 1) |
431 | #define OMAP3430ES2_ST_PERIPH2_CLK_SHIFT 0 | 475 | #define OMAP3430ES2_ST_PERIPH2_CLK_SHIFT 0 |
@@ -449,8 +493,12 @@ | |||
449 | #define OMAP3430_CORE_DPLL_MULT_MASK (0x7ff << 16) | 493 | #define OMAP3430_CORE_DPLL_MULT_MASK (0x7ff << 16) |
450 | #define OMAP3430_CORE_DPLL_DIV_SHIFT 8 | 494 | #define OMAP3430_CORE_DPLL_DIV_SHIFT 8 |
451 | #define OMAP3430_CORE_DPLL_DIV_MASK (0x7f << 8) | 495 | #define OMAP3430_CORE_DPLL_DIV_MASK (0x7f << 8) |
452 | #define OMAP3430_SOURCE_54M (1 << 5) | 496 | #define OMAP3430_SOURCE_96M_SHIFT 6 |
453 | #define OMAP3430_SOURCE_48M (1 << 3) | 497 | #define OMAP3430_SOURCE_96M_MASK (1 << 6) |
498 | #define OMAP3430_SOURCE_54M_SHIFT 5 | ||
499 | #define OMAP3430_SOURCE_54M_MASK (1 << 5) | ||
500 | #define OMAP3430_SOURCE_48M_SHIFT 3 | ||
501 | #define OMAP3430_SOURCE_48M_MASK (1 << 3) | ||
454 | 502 | ||
455 | /* CM_CLKSEL2_PLL */ | 503 | /* CM_CLKSEL2_PLL */ |
456 | #define OMAP3430_PERIPH_DPLL_MULT_SHIFT 8 | 504 | #define OMAP3430_PERIPH_DPLL_MULT_SHIFT 8 |
@@ -493,7 +541,12 @@ | |||
493 | #define OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT 0 | 541 | #define OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT 0 |
494 | 542 | ||
495 | /* CM_IDLEST_DSS */ | 543 | /* CM_IDLEST_DSS */ |
496 | #define OMAP3430_ST_DSS (1 << 0) | 544 | #define OMAP3430ES2_ST_DSS_IDLE_SHIFT 1 |
545 | #define OMAP3430ES2_ST_DSS_IDLE_MASK (1 << 1) | ||
546 | #define OMAP3430ES2_ST_DSS_STDBY_SHIFT 0 | ||
547 | #define OMAP3430ES2_ST_DSS_STDBY_MASK (1 << 0) | ||
548 | #define OMAP3430ES1_ST_DSS_SHIFT 0 | ||
549 | #define OMAP3430ES1_ST_DSS_MASK (1 << 0) | ||
497 | 550 | ||
498 | /* CM_AUTOIDLE_DSS */ | 551 | /* CM_AUTOIDLE_DSS */ |
499 | #define OMAP3430_AUTO_DSS (1 << 0) | 552 | #define OMAP3430_AUTO_DSS (1 << 0) |
@@ -516,6 +569,8 @@ | |||
516 | #define OMAP3430_CLKACTIVITY_DSS_MASK (1 << 0) | 569 | #define OMAP3430_CLKACTIVITY_DSS_MASK (1 << 0) |
517 | 570 | ||
518 | /* CM_FCLKEN_CAM specific bits */ | 571 | /* CM_FCLKEN_CAM specific bits */ |
572 | #define OMAP3430_EN_CSI2 (1 << 1) | ||
573 | #define OMAP3430_EN_CSI2_SHIFT 1 | ||
519 | 574 | ||
520 | /* CM_ICLKEN_CAM specific bits */ | 575 | /* CM_ICLKEN_CAM specific bits */ |
521 | 576 | ||
@@ -545,10 +600,14 @@ | |||
545 | /* CM_ICLKEN_PER specific bits */ | 600 | /* CM_ICLKEN_PER specific bits */ |
546 | 601 | ||
547 | /* CM_IDLEST_PER */ | 602 | /* CM_IDLEST_PER */ |
548 | #define OMAP3430_ST_WDT3 (1 << 12) | 603 | #define OMAP3430_ST_WDT3_SHIFT 12 |
549 | #define OMAP3430_ST_MCBSP4 (1 << 2) | 604 | #define OMAP3430_ST_WDT3_MASK (1 << 12) |
550 | #define OMAP3430_ST_MCBSP3 (1 << 1) | 605 | #define OMAP3430_ST_MCBSP4_SHIFT 2 |
551 | #define OMAP3430_ST_MCBSP2 (1 << 0) | 606 | #define OMAP3430_ST_MCBSP4_MASK (1 << 2) |
607 | #define OMAP3430_ST_MCBSP3_SHIFT 1 | ||
608 | #define OMAP3430_ST_MCBSP3_MASK (1 << 1) | ||
609 | #define OMAP3430_ST_MCBSP2_SHIFT 0 | ||
610 | #define OMAP3430_ST_MCBSP2_MASK (1 << 0) | ||
552 | 611 | ||
553 | /* CM_AUTOIDLE_PER */ | 612 | /* CM_AUTOIDLE_PER */ |
554 | #define OMAP3430_AUTO_GPIO6 (1 << 17) | 613 | #define OMAP3430_AUTO_GPIO6 (1 << 17) |
@@ -676,6 +735,10 @@ | |||
676 | #define OMAP3430ES2_EN_USBHOST_MASK (1 << 0) | 735 | #define OMAP3430ES2_EN_USBHOST_MASK (1 << 0) |
677 | 736 | ||
678 | /* CM_IDLEST_USBHOST */ | 737 | /* CM_IDLEST_USBHOST */ |
738 | #define OMAP3430ES2_ST_USBHOST_IDLE_SHIFT 1 | ||
739 | #define OMAP3430ES2_ST_USBHOST_IDLE_MASK (1 << 1) | ||
740 | #define OMAP3430ES2_ST_USBHOST_STDBY_SHIFT 0 | ||
741 | #define OMAP3430ES2_ST_USBHOST_STDBY_MASK (1 << 0) | ||
679 | 742 | ||
680 | /* CM_AUTOIDLE_USBHOST */ | 743 | /* CM_AUTOIDLE_USBHOST */ |
681 | #define OMAP3430ES2_AUTO_USBHOST_SHIFT 0 | 744 | #define OMAP3430ES2_AUTO_USBHOST_SHIFT 0 |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index ce03fa750775..8075f5868c38 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -348,11 +348,12 @@ static void __init omap_hsmmc_reset(void) | |||
348 | } | 348 | } |
349 | 349 | ||
350 | dummy_pdev.id = i; | 350 | dummy_pdev.id = i; |
351 | iclk = clk_get(dev, "mmchs_ick"); | 351 | dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i); |
352 | iclk = clk_get(dev, "ick"); | ||
352 | if (iclk && clk_enable(iclk)) | 353 | if (iclk && clk_enable(iclk)) |
353 | iclk = NULL; | 354 | iclk = NULL; |
354 | 355 | ||
355 | fclk = clk_get(dev, "mmchs_fck"); | 356 | fclk = clk_get(dev, "fck"); |
356 | if (fclk && clk_enable(fclk)) | 357 | if (fclk && clk_enable(fclk)) |
357 | fclk = NULL; | 358 | fclk = NULL; |
358 | 359 | ||
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index b52a02fc7cd6..34b5914e0f8b 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -217,8 +217,13 @@ void __init omap2_check_revision(void) | |||
217 | omap_chip.oc = CHIP_IS_OMAP3430; | 217 | omap_chip.oc = CHIP_IS_OMAP3430; |
218 | if (omap_rev() == OMAP3430_REV_ES1_0) | 218 | if (omap_rev() == OMAP3430_REV_ES1_0) |
219 | omap_chip.oc |= CHIP_IS_OMAP3430ES1; | 219 | omap_chip.oc |= CHIP_IS_OMAP3430ES1; |
220 | else if (omap_rev() > OMAP3430_REV_ES1_0) | 220 | else if (omap_rev() >= OMAP3430_REV_ES2_0 && |
221 | omap_rev() <= OMAP3430_REV_ES2_1) | ||
221 | omap_chip.oc |= CHIP_IS_OMAP3430ES2; | 222 | omap_chip.oc |= CHIP_IS_OMAP3430ES2; |
223 | else if (omap_rev() == OMAP3430_REV_ES3_0) | ||
224 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_0; | ||
225 | else if (omap_rev() == OMAP3430_REV_ES3_1) | ||
226 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_1; | ||
222 | } else { | 227 | } else { |
223 | pr_err("Uninitialized omap_chip, please fix!\n"); | 228 | pr_err("Uninitialized omap_chip, please fix!\n"); |
224 | } | 229 | } |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 5ea64f926ed5..916fcd3a2328 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -27,8 +27,8 @@ | |||
27 | #include <mach/mux.h> | 27 | #include <mach/mux.h> |
28 | #include <mach/omapfb.h> | 28 | #include <mach/omapfb.h> |
29 | #include <mach/sram.h> | 29 | #include <mach/sram.h> |
30 | 30 | #include <mach/sdrc.h> | |
31 | #include "memory.h" | 31 | #include <mach/gpmc.h> |
32 | 32 | ||
33 | #include "clock.h" | 33 | #include "clock.h" |
34 | 34 | ||
@@ -195,12 +195,12 @@ void __init omap2_map_common_io(void) | |||
195 | omapfb_reserve_sdram(); | 195 | omapfb_reserve_sdram(); |
196 | } | 196 | } |
197 | 197 | ||
198 | void __init omap2_init_common_hw(void) | 198 | void __init omap2_init_common_hw(struct omap_sdrc_params *sp) |
199 | { | 199 | { |
200 | omap2_mux_init(); | 200 | omap2_mux_init(); |
201 | pwrdm_init(powerdomains_omap); | 201 | pwrdm_init(powerdomains_omap); |
202 | clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); | 202 | clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); |
203 | omap2_clk_init(); | 203 | omap2_clk_init(); |
204 | omap2_init_memory(); | 204 | omap2_sdrc_init(sp); |
205 | gpmc_init(); | 205 | gpmc_init(); |
206 | } | 206 | } |
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index a9e631fc1134..a5c0f0435cd6 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -24,8 +24,6 @@ | |||
24 | #include <mach/cpu.h> | 24 | #include <mach/cpu.h> |
25 | #include <mach/mcbsp.h> | 25 | #include <mach/mcbsp.h> |
26 | 26 | ||
27 | const char *clk_names[] = { "mcbsp_ick", "mcbsp_fck" }; | ||
28 | |||
29 | static void omap2_mcbsp2_mux_setup(void) | 27 | static void omap2_mcbsp2_mux_setup(void) |
30 | { | 28 | { |
31 | omap_cfg_reg(Y15_24XX_MCBSP2_CLKX); | 29 | omap_cfg_reg(Y15_24XX_MCBSP2_CLKX); |
@@ -57,8 +55,6 @@ static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = { | |||
57 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, | 55 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, |
58 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, | 56 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, |
59 | .ops = &omap2_mcbsp_ops, | 57 | .ops = &omap2_mcbsp_ops, |
60 | .clk_names = clk_names, | ||
61 | .num_clks = 2, | ||
62 | }, | 58 | }, |
63 | { | 59 | { |
64 | .phys_base = OMAP24XX_MCBSP2_BASE, | 60 | .phys_base = OMAP24XX_MCBSP2_BASE, |
@@ -67,8 +63,6 @@ static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = { | |||
67 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | 63 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, |
68 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, | 64 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, |
69 | .ops = &omap2_mcbsp_ops, | 65 | .ops = &omap2_mcbsp_ops, |
70 | .clk_names = clk_names, | ||
71 | .num_clks = 2, | ||
72 | }, | 66 | }, |
73 | }; | 67 | }; |
74 | #define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata) | 68 | #define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata) |
@@ -86,8 +80,6 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { | |||
86 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, | 80 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, |
87 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, | 81 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, |
88 | .ops = &omap2_mcbsp_ops, | 82 | .ops = &omap2_mcbsp_ops, |
89 | .clk_names = clk_names, | ||
90 | .num_clks = 2, | ||
91 | }, | 83 | }, |
92 | { | 84 | { |
93 | .phys_base = OMAP24XX_MCBSP2_BASE, | 85 | .phys_base = OMAP24XX_MCBSP2_BASE, |
@@ -96,8 +88,6 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { | |||
96 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | 88 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, |
97 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, | 89 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, |
98 | .ops = &omap2_mcbsp_ops, | 90 | .ops = &omap2_mcbsp_ops, |
99 | .clk_names = clk_names, | ||
100 | .num_clks = 2, | ||
101 | }, | 91 | }, |
102 | { | 92 | { |
103 | .phys_base = OMAP2430_MCBSP3_BASE, | 93 | .phys_base = OMAP2430_MCBSP3_BASE, |
@@ -106,8 +96,6 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { | |||
106 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, | 96 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, |
107 | .tx_irq = INT_24XX_MCBSP3_IRQ_TX, | 97 | .tx_irq = INT_24XX_MCBSP3_IRQ_TX, |
108 | .ops = &omap2_mcbsp_ops, | 98 | .ops = &omap2_mcbsp_ops, |
109 | .clk_names = clk_names, | ||
110 | .num_clks = 2, | ||
111 | }, | 99 | }, |
112 | { | 100 | { |
113 | .phys_base = OMAP2430_MCBSP4_BASE, | 101 | .phys_base = OMAP2430_MCBSP4_BASE, |
@@ -116,8 +104,6 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { | |||
116 | .rx_irq = INT_24XX_MCBSP4_IRQ_RX, | 104 | .rx_irq = INT_24XX_MCBSP4_IRQ_RX, |
117 | .tx_irq = INT_24XX_MCBSP4_IRQ_TX, | 105 | .tx_irq = INT_24XX_MCBSP4_IRQ_TX, |
118 | .ops = &omap2_mcbsp_ops, | 106 | .ops = &omap2_mcbsp_ops, |
119 | .clk_names = clk_names, | ||
120 | .num_clks = 2, | ||
121 | }, | 107 | }, |
122 | { | 108 | { |
123 | .phys_base = OMAP2430_MCBSP5_BASE, | 109 | .phys_base = OMAP2430_MCBSP5_BASE, |
@@ -126,8 +112,6 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { | |||
126 | .rx_irq = INT_24XX_MCBSP5_IRQ_RX, | 112 | .rx_irq = INT_24XX_MCBSP5_IRQ_RX, |
127 | .tx_irq = INT_24XX_MCBSP5_IRQ_TX, | 113 | .tx_irq = INT_24XX_MCBSP5_IRQ_TX, |
128 | .ops = &omap2_mcbsp_ops, | 114 | .ops = &omap2_mcbsp_ops, |
129 | .clk_names = clk_names, | ||
130 | .num_clks = 2, | ||
131 | }, | 115 | }, |
132 | }; | 116 | }; |
133 | #define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata) | 117 | #define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata) |
@@ -145,8 +129,6 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
145 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, | 129 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, |
146 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, | 130 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, |
147 | .ops = &omap2_mcbsp_ops, | 131 | .ops = &omap2_mcbsp_ops, |
148 | .clk_names = clk_names, | ||
149 | .num_clks = 2, | ||
150 | }, | 132 | }, |
151 | { | 133 | { |
152 | .phys_base = OMAP34XX_MCBSP2_BASE, | 134 | .phys_base = OMAP34XX_MCBSP2_BASE, |
@@ -155,8 +137,6 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
155 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | 137 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, |
156 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, | 138 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, |
157 | .ops = &omap2_mcbsp_ops, | 139 | .ops = &omap2_mcbsp_ops, |
158 | .clk_names = clk_names, | ||
159 | .num_clks = 2, | ||
160 | }, | 140 | }, |
161 | { | 141 | { |
162 | .phys_base = OMAP34XX_MCBSP3_BASE, | 142 | .phys_base = OMAP34XX_MCBSP3_BASE, |
@@ -165,8 +145,6 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
165 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, | 145 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, |
166 | .tx_irq = INT_24XX_MCBSP3_IRQ_TX, | 146 | .tx_irq = INT_24XX_MCBSP3_IRQ_TX, |
167 | .ops = &omap2_mcbsp_ops, | 147 | .ops = &omap2_mcbsp_ops, |
168 | .clk_names = clk_names, | ||
169 | .num_clks = 2, | ||
170 | }, | 148 | }, |
171 | { | 149 | { |
172 | .phys_base = OMAP34XX_MCBSP4_BASE, | 150 | .phys_base = OMAP34XX_MCBSP4_BASE, |
@@ -175,8 +153,6 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
175 | .rx_irq = INT_24XX_MCBSP4_IRQ_RX, | 153 | .rx_irq = INT_24XX_MCBSP4_IRQ_RX, |
176 | .tx_irq = INT_24XX_MCBSP4_IRQ_TX, | 154 | .tx_irq = INT_24XX_MCBSP4_IRQ_TX, |
177 | .ops = &omap2_mcbsp_ops, | 155 | .ops = &omap2_mcbsp_ops, |
178 | .clk_names = clk_names, | ||
179 | .num_clks = 2, | ||
180 | }, | 156 | }, |
181 | { | 157 | { |
182 | .phys_base = OMAP34XX_MCBSP5_BASE, | 158 | .phys_base = OMAP34XX_MCBSP5_BASE, |
@@ -185,8 +161,6 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
185 | .rx_irq = INT_24XX_MCBSP5_IRQ_RX, | 161 | .rx_irq = INT_24XX_MCBSP5_IRQ_RX, |
186 | .tx_irq = INT_24XX_MCBSP5_IRQ_TX, | 162 | .tx_irq = INT_24XX_MCBSP5_IRQ_TX, |
187 | .ops = &omap2_mcbsp_ops, | 163 | .ops = &omap2_mcbsp_ops, |
188 | .clk_names = clk_names, | ||
189 | .num_clks = 2, | ||
190 | }, | 164 | }, |
191 | }; | 165 | }; |
192 | #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata) | 166 | #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata) |
diff --git a/arch/arm/mach-omap2/memory.h b/arch/arm/mach-omap2/memory.h deleted file mode 100644 index bb3db80a7c46..000000000000 --- a/arch/arm/mach-omap2/memory.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap2/memory.h | ||
3 | * | ||
4 | * Interface for memory timing related functions for OMAP24XX | ||
5 | * | ||
6 | * Copyright (C) 2005 Texas Instruments Inc. | ||
7 | * Richard Woodruff <r-woodruff2@ti.com> | ||
8 | * | ||
9 | * Copyright (C) 2005 Nokia Corporation | ||
10 | * Tony Lindgren <tony@atomide.com> | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License version 2 as | ||
14 | * published by the Free Software Foundation. | ||
15 | */ | ||
16 | |||
17 | #ifndef ARCH_ARM_MACH_OMAP2_MEMORY_H | ||
18 | #define ARCH_ARM_MACH_OMAP2_MEMORY_H | ||
19 | |||
20 | /* Memory timings */ | ||
21 | #define M_DDR 1 | ||
22 | #define M_LOCK_CTRL (1 << 2) | ||
23 | #define M_UNLOCK 0 | ||
24 | #define M_LOCK 1 | ||
25 | |||
26 | struct memory_timings { | ||
27 | u32 m_type; /* ddr = 1, sdr = 0 */ | ||
28 | u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */ | ||
29 | u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */ | ||
30 | u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */ | ||
31 | u32 base_cs; /* base chip select to use for calculations */ | ||
32 | }; | ||
33 | |||
34 | extern void omap2_init_memory_params(u32 force_lock_to_unlock_mode); | ||
35 | extern u32 omap2_memory_get_slow_dll_ctrl(void); | ||
36 | extern u32 omap2_memory_get_fast_dll_ctrl(void); | ||
37 | extern u32 omap2_memory_get_type(void); | ||
38 | u32 omap2_dll_force_needed(void); | ||
39 | u32 omap2_reprogram_sdrc(u32 level, u32 force); | ||
40 | void __init omap2_init_memory(void); | ||
41 | void __init gpmc_init(void); | ||
42 | |||
43 | #endif | ||
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 55361c16c9d9..ea8ceaed09cb 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -103,7 +103,7 @@ static struct platform_suspend_ops omap_pm_ops = { | |||
103 | .valid = suspend_valid_only_mem, | 103 | .valid = suspend_valid_only_mem, |
104 | }; | 104 | }; |
105 | 105 | ||
106 | int __init omap2_pm_init(void) | 106 | static int __init omap2_pm_init(void) |
107 | { | 107 | { |
108 | return 0; | 108 | return 0; |
109 | } | 109 | } |
diff --git a/arch/arm/mach-omap2/powerdomains.h b/arch/arm/mach-omap2/powerdomains.h index 1e151faebbd3..691470ea4c6a 100644 --- a/arch/arm/mach-omap2/powerdomains.h +++ b/arch/arm/mach-omap2/powerdomains.h | |||
@@ -171,13 +171,19 @@ static struct powerdomain *powerdomains_omap[] __initdata = { | |||
171 | &iva2_pwrdm, | 171 | &iva2_pwrdm, |
172 | &mpu_34xx_pwrdm, | 172 | &mpu_34xx_pwrdm, |
173 | &neon_pwrdm, | 173 | &neon_pwrdm, |
174 | &core_34xx_pwrdm, | 174 | &core_34xx_pre_es3_1_pwrdm, |
175 | &core_34xx_es3_1_pwrdm, | ||
175 | &cam_pwrdm, | 176 | &cam_pwrdm, |
176 | &dss_pwrdm, | 177 | &dss_pwrdm, |
177 | &per_pwrdm, | 178 | &per_pwrdm, |
178 | &emu_pwrdm, | 179 | &emu_pwrdm, |
179 | &sgx_pwrdm, | 180 | &sgx_pwrdm, |
180 | &usbhost_pwrdm, | 181 | &usbhost_pwrdm, |
182 | &dpll1_pwrdm, | ||
183 | &dpll2_pwrdm, | ||
184 | &dpll3_pwrdm, | ||
185 | &dpll4_pwrdm, | ||
186 | &dpll5_pwrdm, | ||
181 | #endif | 187 | #endif |
182 | 188 | ||
183 | NULL | 189 | NULL |
diff --git a/arch/arm/mach-omap2/powerdomains34xx.h b/arch/arm/mach-omap2/powerdomains34xx.h index f573f7108398..4dcf94b800ab 100644 --- a/arch/arm/mach-omap2/powerdomains34xx.h +++ b/arch/arm/mach-omap2/powerdomains34xx.h | |||
@@ -200,12 +200,33 @@ static struct powerdomain mpu_34xx_pwrdm = { | |||
200 | }; | 200 | }; |
201 | 201 | ||
202 | /* No wkdeps or sleepdeps for 34xx core apparently */ | 202 | /* No wkdeps or sleepdeps for 34xx core apparently */ |
203 | static struct powerdomain core_34xx_pwrdm = { | 203 | static struct powerdomain core_34xx_pre_es3_1_pwrdm = { |
204 | .name = "core_pwrdm", | 204 | .name = "core_pwrdm", |
205 | .prcm_offs = CORE_MOD, | 205 | .prcm_offs = CORE_MOD, |
206 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 206 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | |
207 | CHIP_IS_OMAP3430ES2 | | ||
208 | CHIP_IS_OMAP3430ES3_0), | ||
209 | .pwrsts = PWRSTS_OFF_RET_ON, | ||
210 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | ||
211 | .banks = 2, | ||
212 | .pwrsts_mem_ret = { | ||
213 | [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ | ||
214 | [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */ | ||
215 | }, | ||
216 | .pwrsts_mem_on = { | ||
217 | [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ | ||
218 | [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ | ||
219 | }, | ||
220 | }; | ||
221 | |||
222 | /* No wkdeps or sleepdeps for 34xx core apparently */ | ||
223 | static struct powerdomain core_34xx_es3_1_pwrdm = { | ||
224 | .name = "core_pwrdm", | ||
225 | .prcm_offs = CORE_MOD, | ||
226 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES3_1), | ||
207 | .pwrsts = PWRSTS_OFF_RET_ON, | 227 | .pwrsts = PWRSTS_OFF_RET_ON, |
208 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | 228 | .dep_bit = OMAP3430_EN_CORE_SHIFT, |
229 | .flags = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */ | ||
209 | .banks = 2, | 230 | .banks = 2, |
210 | .pwrsts_mem_ret = { | 231 | .pwrsts_mem_ret = { |
211 | [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ | 232 | [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ |
@@ -236,14 +257,19 @@ static struct powerdomain dss_pwrdm = { | |||
236 | }, | 257 | }, |
237 | }; | 258 | }; |
238 | 259 | ||
260 | /* | ||
261 | * Although the 34XX TRM Rev K Table 4-371 notes that retention is a | ||
262 | * possible SGX powerstate, the SGX device itself does not support | ||
263 | * retention. | ||
264 | */ | ||
239 | static struct powerdomain sgx_pwrdm = { | 265 | static struct powerdomain sgx_pwrdm = { |
240 | .name = "sgx_pwrdm", | 266 | .name = "sgx_pwrdm", |
241 | .prcm_offs = OMAP3430ES2_SGX_MOD, | 267 | .prcm_offs = OMAP3430ES2_SGX_MOD, |
242 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2), | 268 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
243 | .wkdep_srcs = gfx_sgx_wkdeps, | 269 | .wkdep_srcs = gfx_sgx_wkdeps, |
244 | .sleepdep_srcs = cam_gfx_sleepdeps, | 270 | .sleepdep_srcs = cam_gfx_sleepdeps, |
245 | /* XXX This is accurate for 3430 SGX, but what about GFX? */ | 271 | /* XXX This is accurate for 3430 SGX, but what about GFX? */ |
246 | .pwrsts = PWRSTS_OFF_RET_ON, | 272 | .pwrsts = PWRSTS_OFF_ON, |
247 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 273 | .pwrsts_logic_ret = PWRDM_POWER_RET, |
248 | .banks = 1, | 274 | .banks = 1, |
249 | .pwrsts_mem_ret = { | 275 | .pwrsts_mem_ret = { |
@@ -307,11 +333,12 @@ static struct powerdomain neon_pwrdm = { | |||
307 | static struct powerdomain usbhost_pwrdm = { | 333 | static struct powerdomain usbhost_pwrdm = { |
308 | .name = "usbhost_pwrdm", | 334 | .name = "usbhost_pwrdm", |
309 | .prcm_offs = OMAP3430ES2_USBHOST_MOD, | 335 | .prcm_offs = OMAP3430ES2_USBHOST_MOD, |
310 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2), | 336 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
311 | .wkdep_srcs = per_usbhost_wkdeps, | 337 | .wkdep_srcs = per_usbhost_wkdeps, |
312 | .sleepdep_srcs = dss_per_usbhost_sleepdeps, | 338 | .sleepdep_srcs = dss_per_usbhost_sleepdeps, |
313 | .pwrsts = PWRSTS_OFF_RET_ON, | 339 | .pwrsts = PWRSTS_OFF_RET_ON, |
314 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 340 | .pwrsts_logic_ret = PWRDM_POWER_RET, |
341 | .flags = PWRDM_HAS_HDWR_SAR, /* for USBHOST ctrlr only */ | ||
315 | .banks = 1, | 342 | .banks = 1, |
316 | .pwrsts_mem_ret = { | 343 | .pwrsts_mem_ret = { |
317 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 344 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ |
@@ -321,6 +348,37 @@ static struct powerdomain usbhost_pwrdm = { | |||
321 | }, | 348 | }, |
322 | }; | 349 | }; |
323 | 350 | ||
351 | static struct powerdomain dpll1_pwrdm = { | ||
352 | .name = "dpll1_pwrdm", | ||
353 | .prcm_offs = MPU_MOD, | ||
354 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
355 | }; | ||
356 | |||
357 | static struct powerdomain dpll2_pwrdm = { | ||
358 | .name = "dpll2_pwrdm", | ||
359 | .prcm_offs = OMAP3430_IVA2_MOD, | ||
360 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
361 | }; | ||
362 | |||
363 | static struct powerdomain dpll3_pwrdm = { | ||
364 | .name = "dpll3_pwrdm", | ||
365 | .prcm_offs = PLL_MOD, | ||
366 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
367 | }; | ||
368 | |||
369 | static struct powerdomain dpll4_pwrdm = { | ||
370 | .name = "dpll4_pwrdm", | ||
371 | .prcm_offs = PLL_MOD, | ||
372 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
373 | }; | ||
374 | |||
375 | static struct powerdomain dpll5_pwrdm = { | ||
376 | .name = "dpll5_pwrdm", | ||
377 | .prcm_offs = PLL_MOD, | ||
378 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | ||
379 | }; | ||
380 | |||
381 | |||
324 | #endif /* CONFIG_ARCH_OMAP34XX */ | 382 | #endif /* CONFIG_ARCH_OMAP34XX */ |
325 | 383 | ||
326 | 384 | ||
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h index 4a32822ff3fc..812d50ee495d 100644 --- a/arch/arm/mach-omap2/prcm-common.h +++ b/arch/arm/mach-omap2/prcm-common.h | |||
@@ -113,33 +113,58 @@ | |||
113 | #define OMAP2430_EN_USBHS (1 << 6) | 113 | #define OMAP2430_EN_USBHS (1 << 6) |
114 | 114 | ||
115 | /* CM_IDLEST1_CORE, PM_WKST1_CORE shared bits */ | 115 | /* CM_IDLEST1_CORE, PM_WKST1_CORE shared bits */ |
116 | #define OMAP2420_ST_MMC (1 << 26) | 116 | #define OMAP2420_ST_MMC_SHIFT 26 |
117 | #define OMAP24XX_ST_UART2 (1 << 22) | 117 | #define OMAP2420_ST_MMC_MASK (1 << 26) |
118 | #define OMAP24XX_ST_UART1 (1 << 21) | 118 | #define OMAP24XX_ST_UART2_SHIFT 22 |
119 | #define OMAP24XX_ST_MCSPI2 (1 << 18) | 119 | #define OMAP24XX_ST_UART2_MASK (1 << 22) |
120 | #define OMAP24XX_ST_MCSPI1 (1 << 17) | 120 | #define OMAP24XX_ST_UART1_SHIFT 21 |
121 | #define OMAP24XX_ST_GPT12 (1 << 14) | 121 | #define OMAP24XX_ST_UART1_MASK (1 << 21) |
122 | #define OMAP24XX_ST_GPT11 (1 << 13) | 122 | #define OMAP24XX_ST_MCSPI2_SHIFT 18 |
123 | #define OMAP24XX_ST_GPT10 (1 << 12) | 123 | #define OMAP24XX_ST_MCSPI2_MASK (1 << 18) |
124 | #define OMAP24XX_ST_GPT9 (1 << 11) | 124 | #define OMAP24XX_ST_MCSPI1_SHIFT 17 |
125 | #define OMAP24XX_ST_GPT8 (1 << 10) | 125 | #define OMAP24XX_ST_MCSPI1_MASK (1 << 17) |
126 | #define OMAP24XX_ST_GPT7 (1 << 9) | 126 | #define OMAP24XX_ST_GPT12_SHIFT 14 |
127 | #define OMAP24XX_ST_GPT6 (1 << 8) | 127 | #define OMAP24XX_ST_GPT12_MASK (1 << 14) |
128 | #define OMAP24XX_ST_GPT5 (1 << 7) | 128 | #define OMAP24XX_ST_GPT11_SHIFT 13 |
129 | #define OMAP24XX_ST_GPT4 (1 << 6) | 129 | #define OMAP24XX_ST_GPT11_MASK (1 << 13) |
130 | #define OMAP24XX_ST_GPT3 (1 << 5) | 130 | #define OMAP24XX_ST_GPT10_SHIFT 12 |
131 | #define OMAP24XX_ST_GPT2 (1 << 4) | 131 | #define OMAP24XX_ST_GPT10_MASK (1 << 12) |
132 | #define OMAP2420_ST_VLYNQ (1 << 3) | 132 | #define OMAP24XX_ST_GPT9_SHIFT 11 |
133 | #define OMAP24XX_ST_GPT9_MASK (1 << 11) | ||
134 | #define OMAP24XX_ST_GPT8_SHIFT 10 | ||
135 | #define OMAP24XX_ST_GPT8_MASK (1 << 10) | ||
136 | #define OMAP24XX_ST_GPT7_SHIFT 9 | ||
137 | #define OMAP24XX_ST_GPT7_MASK (1 << 9) | ||
138 | #define OMAP24XX_ST_GPT6_SHIFT 8 | ||
139 | #define OMAP24XX_ST_GPT6_MASK (1 << 8) | ||
140 | #define OMAP24XX_ST_GPT5_SHIFT 7 | ||
141 | #define OMAP24XX_ST_GPT5_MASK (1 << 7) | ||
142 | #define OMAP24XX_ST_GPT4_SHIFT 6 | ||
143 | #define OMAP24XX_ST_GPT4_MASK (1 << 6) | ||
144 | #define OMAP24XX_ST_GPT3_SHIFT 5 | ||
145 | #define OMAP24XX_ST_GPT3_MASK (1 << 5) | ||
146 | #define OMAP24XX_ST_GPT2_SHIFT 4 | ||
147 | #define OMAP24XX_ST_GPT2_MASK (1 << 4) | ||
148 | #define OMAP2420_ST_VLYNQ_SHIFT 3 | ||
149 | #define OMAP2420_ST_VLYNQ_MASK (1 << 3) | ||
133 | 150 | ||
134 | /* CM_IDLEST2_CORE, PM_WKST2_CORE shared bits */ | 151 | /* CM_IDLEST2_CORE, PM_WKST2_CORE shared bits */ |
135 | #define OMAP2430_ST_MDM_INTC (1 << 11) | 152 | #define OMAP2430_ST_MDM_INTC_SHIFT 11 |
136 | #define OMAP2430_ST_GPIO5 (1 << 10) | 153 | #define OMAP2430_ST_MDM_INTC_MASK (1 << 11) |
137 | #define OMAP2430_ST_MCSPI3 (1 << 9) | 154 | #define OMAP2430_ST_GPIO5_SHIFT 10 |
138 | #define OMAP2430_ST_MMCHS2 (1 << 8) | 155 | #define OMAP2430_ST_GPIO5_MASK (1 << 10) |
139 | #define OMAP2430_ST_MMCHS1 (1 << 7) | 156 | #define OMAP2430_ST_MCSPI3_SHIFT 9 |
140 | #define OMAP2430_ST_USBHS (1 << 6) | 157 | #define OMAP2430_ST_MCSPI3_MASK (1 << 9) |
141 | #define OMAP24XX_ST_UART3 (1 << 2) | 158 | #define OMAP2430_ST_MMCHS2_SHIFT 8 |
142 | #define OMAP24XX_ST_USB (1 << 0) | 159 | #define OMAP2430_ST_MMCHS2_MASK (1 << 8) |
160 | #define OMAP2430_ST_MMCHS1_SHIFT 7 | ||
161 | #define OMAP2430_ST_MMCHS1_MASK (1 << 7) | ||
162 | #define OMAP2430_ST_USBHS_SHIFT 6 | ||
163 | #define OMAP2430_ST_USBHS_MASK (1 << 6) | ||
164 | #define OMAP24XX_ST_UART3_SHIFT 2 | ||
165 | #define OMAP24XX_ST_UART3_MASK (1 << 2) | ||
166 | #define OMAP24XX_ST_USB_SHIFT 0 | ||
167 | #define OMAP24XX_ST_USB_MASK (1 << 0) | ||
143 | 168 | ||
144 | /* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */ | 169 | /* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */ |
145 | #define OMAP24XX_EN_GPIOS_SHIFT 2 | 170 | #define OMAP24XX_EN_GPIOS_SHIFT 2 |
@@ -148,11 +173,13 @@ | |||
148 | #define OMAP24XX_EN_GPT1 (1 << 0) | 173 | #define OMAP24XX_EN_GPT1 (1 << 0) |
149 | 174 | ||
150 | /* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */ | 175 | /* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */ |
151 | #define OMAP24XX_ST_GPIOS (1 << 2) | 176 | #define OMAP24XX_ST_GPIOS_SHIFT (1 << 2) |
152 | #define OMAP24XX_ST_GPT1 (1 << 0) | 177 | #define OMAP24XX_ST_GPIOS_MASK 2 |
178 | #define OMAP24XX_ST_GPT1_SHIFT (1 << 0) | ||
179 | #define OMAP24XX_ST_GPT1_MASK 0 | ||
153 | 180 | ||
154 | /* CM_IDLEST_MDM and PM_WKST_MDM shared bits */ | 181 | /* CM_IDLEST_MDM and PM_WKST_MDM shared bits */ |
155 | #define OMAP2430_ST_MDM (1 << 0) | 182 | #define OMAP2430_ST_MDM_SHIFT (1 << 0) |
156 | 183 | ||
157 | 184 | ||
158 | /* 3430 register bits shared between CM & PRM registers */ | 185 | /* 3430 register bits shared between CM & PRM registers */ |
@@ -205,24 +232,46 @@ | |||
205 | #define OMAP3430_EN_HSOTGUSB_SHIFT 4 | 232 | #define OMAP3430_EN_HSOTGUSB_SHIFT 4 |
206 | 233 | ||
207 | /* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */ | 234 | /* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */ |
208 | #define OMAP3430_ST_MMC2 (1 << 25) | 235 | #define OMAP3430_ST_MMC2_SHIFT 25 |
209 | #define OMAP3430_ST_MMC1 (1 << 24) | 236 | #define OMAP3430_ST_MMC2_MASK (1 << 25) |
210 | #define OMAP3430_ST_MCSPI4 (1 << 21) | 237 | #define OMAP3430_ST_MMC1_SHIFT 24 |
211 | #define OMAP3430_ST_MCSPI3 (1 << 20) | 238 | #define OMAP3430_ST_MMC1_MASK (1 << 24) |
212 | #define OMAP3430_ST_MCSPI2 (1 << 19) | 239 | #define OMAP3430_ST_MCSPI4_SHIFT 21 |
213 | #define OMAP3430_ST_MCSPI1 (1 << 18) | 240 | #define OMAP3430_ST_MCSPI4_MASK (1 << 21) |
214 | #define OMAP3430_ST_I2C3 (1 << 17) | 241 | #define OMAP3430_ST_MCSPI3_SHIFT 20 |
215 | #define OMAP3430_ST_I2C2 (1 << 16) | 242 | #define OMAP3430_ST_MCSPI3_MASK (1 << 20) |
216 | #define OMAP3430_ST_I2C1 (1 << 15) | 243 | #define OMAP3430_ST_MCSPI2_SHIFT 19 |
217 | #define OMAP3430_ST_UART2 (1 << 14) | 244 | #define OMAP3430_ST_MCSPI2_MASK (1 << 19) |
218 | #define OMAP3430_ST_UART1 (1 << 13) | 245 | #define OMAP3430_ST_MCSPI1_SHIFT 18 |
219 | #define OMAP3430_ST_GPT11 (1 << 12) | 246 | #define OMAP3430_ST_MCSPI1_MASK (1 << 18) |
220 | #define OMAP3430_ST_GPT10 (1 << 11) | 247 | #define OMAP3430_ST_I2C3_SHIFT 17 |
221 | #define OMAP3430_ST_MCBSP5 (1 << 10) | 248 | #define OMAP3430_ST_I2C3_MASK (1 << 17) |
222 | #define OMAP3430_ST_MCBSP1 (1 << 9) | 249 | #define OMAP3430_ST_I2C2_SHIFT 16 |
223 | #define OMAP3430_ST_FSHOSTUSB (1 << 5) | 250 | #define OMAP3430_ST_I2C2_MASK (1 << 16) |
224 | #define OMAP3430_ST_HSOTGUSB (1 << 4) | 251 | #define OMAP3430_ST_I2C1_SHIFT 15 |
225 | #define OMAP3430_ST_D2D (1 << 3) | 252 | #define OMAP3430_ST_I2C1_MASK (1 << 15) |
253 | #define OMAP3430_ST_UART2_SHIFT 14 | ||
254 | #define OMAP3430_ST_UART2_MASK (1 << 14) | ||
255 | #define OMAP3430_ST_UART1_SHIFT 13 | ||
256 | #define OMAP3430_ST_UART1_MASK (1 << 13) | ||
257 | #define OMAP3430_ST_GPT11_SHIFT 12 | ||
258 | #define OMAP3430_ST_GPT11_MASK (1 << 12) | ||
259 | #define OMAP3430_ST_GPT10_SHIFT 11 | ||
260 | #define OMAP3430_ST_GPT10_MASK (1 << 11) | ||
261 | #define OMAP3430_ST_MCBSP5_SHIFT 10 | ||
262 | #define OMAP3430_ST_MCBSP5_MASK (1 << 10) | ||
263 | #define OMAP3430_ST_MCBSP1_SHIFT 9 | ||
264 | #define OMAP3430_ST_MCBSP1_MASK (1 << 9) | ||
265 | #define OMAP3430ES1_ST_FSHOSTUSB_SHIFT 5 | ||
266 | #define OMAP3430ES1_ST_FSHOSTUSB_MASK (1 << 5) | ||
267 | #define OMAP3430ES1_ST_HSOTGUSB_SHIFT 4 | ||
268 | #define OMAP3430ES1_ST_HSOTGUSB_MASK (1 << 4) | ||
269 | #define OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT 5 | ||
270 | #define OMAP3430ES2_ST_HSOTGUSB_IDLE_MASK (1 << 5) | ||
271 | #define OMAP3430ES2_ST_HSOTGUSB_STDBY_SHIFT 4 | ||
272 | #define OMAP3430ES2_ST_HSOTGUSB_STDBY_MASK (1 << 4) | ||
273 | #define OMAP3430_ST_D2D_SHIFT 3 | ||
274 | #define OMAP3430_ST_D2D_MASK (1 << 3) | ||
226 | 275 | ||
227 | /* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */ | 276 | /* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */ |
228 | #define OMAP3430_EN_GPIO1 (1 << 3) | 277 | #define OMAP3430_EN_GPIO1 (1 << 3) |
@@ -241,11 +290,16 @@ | |||
241 | #define OMAP3430_EN_GPT12_SHIFT 1 | 290 | #define OMAP3430_EN_GPT12_SHIFT 1 |
242 | 291 | ||
243 | /* CM_IDLEST_WKUP, PM_WKST_WKUP shared bits */ | 292 | /* CM_IDLEST_WKUP, PM_WKST_WKUP shared bits */ |
244 | #define OMAP3430_ST_SR2 (1 << 7) | 293 | #define OMAP3430_ST_SR2_SHIFT 7 |
245 | #define OMAP3430_ST_SR1 (1 << 6) | 294 | #define OMAP3430_ST_SR2_MASK (1 << 7) |
246 | #define OMAP3430_ST_GPIO1 (1 << 3) | 295 | #define OMAP3430_ST_SR1_SHIFT 6 |
247 | #define OMAP3430_ST_GPT12 (1 << 1) | 296 | #define OMAP3430_ST_SR1_MASK (1 << 6) |
248 | #define OMAP3430_ST_GPT1 (1 << 0) | 297 | #define OMAP3430_ST_GPIO1_SHIFT 3 |
298 | #define OMAP3430_ST_GPIO1_MASK (1 << 3) | ||
299 | #define OMAP3430_ST_GPT12_SHIFT 1 | ||
300 | #define OMAP3430_ST_GPT12_MASK (1 << 1) | ||
301 | #define OMAP3430_ST_GPT1_SHIFT 0 | ||
302 | #define OMAP3430_ST_GPT1_MASK (1 << 0) | ||
249 | 303 | ||
250 | /* | 304 | /* |
251 | * CM_SLEEPDEP_GFX, CM_SLEEPDEP_DSS, CM_SLEEPDEP_CAM, | 305 | * CM_SLEEPDEP_GFX, CM_SLEEPDEP_DSS, CM_SLEEPDEP_CAM, |
@@ -296,20 +350,34 @@ | |||
296 | #define OMAP3430_EN_MCBSP2_SHIFT 0 | 350 | #define OMAP3430_EN_MCBSP2_SHIFT 0 |
297 | 351 | ||
298 | /* CM_IDLEST_PER, PM_WKST_PER shared bits */ | 352 | /* CM_IDLEST_PER, PM_WKST_PER shared bits */ |
299 | #define OMAP3430_ST_GPIO6 (1 << 17) | 353 | #define OMAP3430_ST_GPIO6_SHIFT 17 |
300 | #define OMAP3430_ST_GPIO5 (1 << 16) | 354 | #define OMAP3430_ST_GPIO6_MASK (1 << 17) |
301 | #define OMAP3430_ST_GPIO4 (1 << 15) | 355 | #define OMAP3430_ST_GPIO5_SHIFT 16 |
302 | #define OMAP3430_ST_GPIO3 (1 << 14) | 356 | #define OMAP3430_ST_GPIO5_MASK (1 << 16) |
303 | #define OMAP3430_ST_GPIO2 (1 << 13) | 357 | #define OMAP3430_ST_GPIO4_SHIFT 15 |
304 | #define OMAP3430_ST_UART3 (1 << 11) | 358 | #define OMAP3430_ST_GPIO4_MASK (1 << 15) |
305 | #define OMAP3430_ST_GPT9 (1 << 10) | 359 | #define OMAP3430_ST_GPIO3_SHIFT 14 |
306 | #define OMAP3430_ST_GPT8 (1 << 9) | 360 | #define OMAP3430_ST_GPIO3_MASK (1 << 14) |
307 | #define OMAP3430_ST_GPT7 (1 << 8) | 361 | #define OMAP3430_ST_GPIO2_SHIFT 13 |
308 | #define OMAP3430_ST_GPT6 (1 << 7) | 362 | #define OMAP3430_ST_GPIO2_MASK (1 << 13) |
309 | #define OMAP3430_ST_GPT5 (1 << 6) | 363 | #define OMAP3430_ST_UART3_SHIFT 11 |
310 | #define OMAP3430_ST_GPT4 (1 << 5) | 364 | #define OMAP3430_ST_UART3_MASK (1 << 11) |
311 | #define OMAP3430_ST_GPT3 (1 << 4) | 365 | #define OMAP3430_ST_GPT9_SHIFT 10 |
312 | #define OMAP3430_ST_GPT2 (1 << 3) | 366 | #define OMAP3430_ST_GPT9_MASK (1 << 10) |
367 | #define OMAP3430_ST_GPT8_SHIFT 9 | ||
368 | #define OMAP3430_ST_GPT8_MASK (1 << 9) | ||
369 | #define OMAP3430_ST_GPT7_SHIFT 8 | ||
370 | #define OMAP3430_ST_GPT7_MASK (1 << 8) | ||
371 | #define OMAP3430_ST_GPT6_SHIFT 7 | ||
372 | #define OMAP3430_ST_GPT6_MASK (1 << 7) | ||
373 | #define OMAP3430_ST_GPT5_SHIFT 6 | ||
374 | #define OMAP3430_ST_GPT5_MASK (1 << 6) | ||
375 | #define OMAP3430_ST_GPT4_SHIFT 5 | ||
376 | #define OMAP3430_ST_GPT4_MASK (1 << 5) | ||
377 | #define OMAP3430_ST_GPT3_SHIFT 4 | ||
378 | #define OMAP3430_ST_GPT3_MASK (1 << 4) | ||
379 | #define OMAP3430_ST_GPT2_SHIFT 3 | ||
380 | #define OMAP3430_ST_GPT2_MASK (1 << 3) | ||
313 | 381 | ||
314 | /* CM_SLEEPDEP_PER, PM_WKDEP_IVA2, PM_WKDEP_MPU, PM_WKDEP_PER shared bits */ | 382 | /* CM_SLEEPDEP_PER, PM_WKDEP_IVA2, PM_WKDEP_MPU, PM_WKDEP_PER shared bits */ |
315 | #define OMAP3430_EN_CORE_SHIFT 0 | 383 | #define OMAP3430_EN_CORE_SHIFT 0 |
diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h index 5b5ecfe6c999..c6a7940f4287 100644 --- a/arch/arm/mach-omap2/prm-regbits-34xx.h +++ b/arch/arm/mach-omap2/prm-regbits-34xx.h | |||
@@ -366,6 +366,7 @@ | |||
366 | 366 | ||
367 | /* PM_WKEN_WKUP specific bits */ | 367 | /* PM_WKEN_WKUP specific bits */ |
368 | #define OMAP3430_EN_IO (1 << 8) | 368 | #define OMAP3430_EN_IO (1 << 8) |
369 | #define OMAP3430_EN_GPIO1 (1 << 3) | ||
369 | 370 | ||
370 | /* PM_MPUGRPSEL_WKUP specific bits */ | 371 | /* PM_MPUGRPSEL_WKUP specific bits */ |
371 | 372 | ||
@@ -452,6 +453,14 @@ | |||
452 | #define OMAP3430_CMDRA0_MASK (0xff << 0) | 453 | #define OMAP3430_CMDRA0_MASK (0xff << 0) |
453 | 454 | ||
454 | /* PRM_VC_CMD_VAL_0 specific bits */ | 455 | /* PRM_VC_CMD_VAL_0 specific bits */ |
456 | #define OMAP3430_VC_CMD_ON_SHIFT 24 | ||
457 | #define OMAP3430_VC_CMD_ON_MASK (0xFF << 24) | ||
458 | #define OMAP3430_VC_CMD_ONLP_SHIFT 16 | ||
459 | #define OMAP3430_VC_CMD_ONLP_MASK (0xFF << 16) | ||
460 | #define OMAP3430_VC_CMD_RET_SHIFT 8 | ||
461 | #define OMAP3430_VC_CMD_RET_MASK (0xFF << 8) | ||
462 | #define OMAP3430_VC_CMD_OFF_SHIFT 0 | ||
463 | #define OMAP3430_VC_CMD_OFF_MASK (0xFF << 0) | ||
455 | 464 | ||
456 | /* PRM_VC_CMD_VAL_1 specific bits */ | 465 | /* PRM_VC_CMD_VAL_1 specific bits */ |
457 | 466 | ||
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h index e4dc4b17881d..826d326b8062 100644 --- a/arch/arm/mach-omap2/prm.h +++ b/arch/arm/mach-omap2/prm.h | |||
@@ -141,6 +141,19 @@ | |||
141 | #define PM_PWSTCTRL 0x00e0 | 141 | #define PM_PWSTCTRL 0x00e0 |
142 | #define PM_PWSTST 0x00e4 | 142 | #define PM_PWSTST 0x00e4 |
143 | 143 | ||
144 | /* Omap2 specific registers */ | ||
145 | #define OMAP24XX_PM_WKEN2 0x00a4 | ||
146 | #define OMAP24XX_PM_WKST2 0x00b4 | ||
147 | |||
148 | #define OMAP24XX_PRCM_IRQSTATUS_DSP 0x00f0 /* IVA mod */ | ||
149 | #define OMAP24XX_PRCM_IRQENABLE_DSP 0x00f4 /* IVA mod */ | ||
150 | #define OMAP24XX_PRCM_IRQSTATUS_IVA 0x00f8 | ||
151 | #define OMAP24XX_PRCM_IRQENABLE_IVA 0x00fc | ||
152 | |||
153 | /* Omap3 specific registers */ | ||
154 | #define OMAP3430ES2_PM_WKEN3 0x00f0 | ||
155 | #define OMAP3430ES2_PM_WKST3 0x00b8 | ||
156 | |||
144 | #define OMAP3430_PM_MPUGRPSEL 0x00a4 | 157 | #define OMAP3430_PM_MPUGRPSEL 0x00a4 |
145 | #define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL | 158 | #define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL |
146 | 159 | ||
@@ -153,16 +166,6 @@ | |||
153 | #define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc | 166 | #define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc |
154 | 167 | ||
155 | 168 | ||
156 | /* Architecture-specific registers */ | ||
157 | |||
158 | #define OMAP24XX_PM_WKEN2 0x00a4 | ||
159 | #define OMAP24XX_PM_WKST2 0x00b4 | ||
160 | |||
161 | #define OMAP24XX_PRCM_IRQSTATUS_DSP 0x00f0 /* IVA mod */ | ||
162 | #define OMAP24XX_PRCM_IRQENABLE_DSP 0x00f4 /* IVA mod */ | ||
163 | #define OMAP24XX_PRCM_IRQSTATUS_IVA 0x00f8 | ||
164 | #define OMAP24XX_PRCM_IRQENABLE_IVA 0x00fc | ||
165 | |||
166 | #ifndef __ASSEMBLER__ | 169 | #ifndef __ASSEMBLER__ |
167 | 170 | ||
168 | /* Power/reset management domain register get/set */ | 171 | /* Power/reset management domain register get/set */ |
@@ -228,7 +231,6 @@ static inline u32 prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx) | |||
228 | #define OMAP_RSTTIME1_SHIFT 0 | 231 | #define OMAP_RSTTIME1_SHIFT 0 |
229 | #define OMAP_RSTTIME1_MASK (0xff << 0) | 232 | #define OMAP_RSTTIME1_MASK (0xff << 0) |
230 | 233 | ||
231 | |||
232 | /* PRM_RSTCTRL */ | 234 | /* PRM_RSTCTRL */ |
233 | /* Named RM_RSTCTRL_WKUP on the 24xx */ | 235 | /* Named RM_RSTCTRL_WKUP on the 24xx */ |
234 | /* 2420 calls RST_DPLL3 'RST_DPLL' */ | 236 | /* 2420 calls RST_DPLL3 'RST_DPLL' */ |
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c new file mode 100644 index 000000000000..2a30060cb4b7 --- /dev/null +++ b/arch/arm/mach-omap2/sdrc.c | |||
@@ -0,0 +1,93 @@ | |||
1 | /* | ||
2 | * SMS/SDRC (SDRAM controller) common code for OMAP2/3 | ||
3 | * | ||
4 | * Copyright (C) 2005, 2008 Texas Instruments Inc. | ||
5 | * Copyright (C) 2005, 2008 Nokia Corporation | ||
6 | * | ||
7 | * Tony Lindgren <tony@atomide.com> | ||
8 | * Paul Walmsley | ||
9 | * Richard Woodruff <r-woodruff2@ti.com> | ||
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 | #undef DEBUG | ||
16 | |||
17 | #include <linux/module.h> | ||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/device.h> | ||
20 | #include <linux/list.h> | ||
21 | #include <linux/errno.h> | ||
22 | #include <linux/delay.h> | ||
23 | #include <linux/clk.h> | ||
24 | #include <linux/io.h> | ||
25 | |||
26 | #include <mach/common.h> | ||
27 | #include <mach/clock.h> | ||
28 | #include <mach/sram.h> | ||
29 | |||
30 | #include "prm.h" | ||
31 | |||
32 | #include <mach/sdrc.h> | ||
33 | #include "sdrc.h" | ||
34 | |||
35 | static struct omap_sdrc_params *sdrc_init_params; | ||
36 | |||
37 | void __iomem *omap2_sdrc_base; | ||
38 | void __iomem *omap2_sms_base; | ||
39 | |||
40 | |||
41 | /** | ||
42 | * omap2_sdrc_get_params - return SDRC register values for a given clock rate | ||
43 | * @r: SDRC clock rate (in Hz) | ||
44 | * | ||
45 | * Return pre-calculated values for the SDRC_ACTIM_CTRLA, | ||
46 | * SDRC_ACTIM_CTRLB, SDRC_RFR_CTRL, and SDRC_MR registers, for a given | ||
47 | * SDRC clock rate 'r'. These parameters control various timing | ||
48 | * delays in the SDRAM controller that are expressed in terms of the | ||
49 | * number of SDRC clock cycles to wait; hence the clock rate | ||
50 | * dependency. Note that sdrc_init_params must be sorted rate | ||
51 | * descending. Also assumes that both chip-selects use the same | ||
52 | * timing parameters. Returns a struct omap_sdrc_params * upon | ||
53 | * success, or NULL upon failure. | ||
54 | */ | ||
55 | struct omap_sdrc_params *omap2_sdrc_get_params(unsigned long r) | ||
56 | { | ||
57 | struct omap_sdrc_params *sp; | ||
58 | |||
59 | sp = sdrc_init_params; | ||
60 | |||
61 | while (sp->rate != r) | ||
62 | sp++; | ||
63 | |||
64 | if (!sp->rate) | ||
65 | return NULL; | ||
66 | |||
67 | return sp; | ||
68 | } | ||
69 | |||
70 | |||
71 | void __init omap2_set_globals_sdrc(struct omap_globals *omap2_globals) | ||
72 | { | ||
73 | omap2_sdrc_base = omap2_globals->sdrc; | ||
74 | omap2_sms_base = omap2_globals->sms; | ||
75 | } | ||
76 | |||
77 | /* turn on smart idle modes for SDRAM scheduler and controller */ | ||
78 | void __init omap2_sdrc_init(struct omap_sdrc_params *sp) | ||
79 | { | ||
80 | u32 l; | ||
81 | |||
82 | l = sms_read_reg(SMS_SYSCONFIG); | ||
83 | l &= ~(0x3 << 3); | ||
84 | l |= (0x2 << 3); | ||
85 | sms_write_reg(l, SMS_SYSCONFIG); | ||
86 | |||
87 | l = sdrc_read_reg(SDRC_SYSCONFIG); | ||
88 | l &= ~(0x3 << 3); | ||
89 | l |= (0x2 << 3); | ||
90 | sdrc_write_reg(l, SDRC_SYSCONFIG); | ||
91 | |||
92 | sdrc_init_params = sp; | ||
93 | } | ||
diff --git a/arch/arm/mach-omap2/memory.c b/arch/arm/mach-omap2/sdrc2xxx.c index 882c70224292..0afdad5ae9fb 100644 --- a/arch/arm/mach-omap2/memory.c +++ b/arch/arm/mach-omap2/sdrc2xxx.c | |||
@@ -1,13 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-omap2/memory.c | 2 | * linux/arch/arm/mach-omap2/sdrc2xxx.c |
3 | * | 3 | * |
4 | * Memory timing related functions for OMAP24XX | 4 | * SDRAM timing related functions for OMAP2xxx |
5 | * | 5 | * |
6 | * Copyright (C) 2005 Texas Instruments Inc. | 6 | * Copyright (C) 2005, 2008 Texas Instruments Inc. |
7 | * Richard Woodruff <r-woodruff2@ti.com> | 7 | * Copyright (C) 2005, 2008 Nokia Corporation |
8 | * | 8 | * |
9 | * Copyright (C) 2005 Nokia Corporation | ||
10 | * Tony Lindgren <tony@atomide.com> | 9 | * Tony Lindgren <tony@atomide.com> |
10 | * Paul Walmsley | ||
11 | * Richard Woodruff <r-woodruff2@ti.com> | ||
11 | * | 12 | * |
12 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
13 | * it under the terms of the GNU General Public License version 2 as | 14 | * it under the terms of the GNU General Public License version 2 as |
@@ -28,27 +29,31 @@ | |||
28 | #include <mach/sram.h> | 29 | #include <mach/sram.h> |
29 | 30 | ||
30 | #include "prm.h" | 31 | #include "prm.h" |
31 | 32 | #include "clock.h" | |
32 | #include "memory.h" | 33 | #include <mach/sdrc.h> |
33 | #include "sdrc.h" | 34 | #include "sdrc.h" |
34 | 35 | ||
35 | void __iomem *omap2_sdrc_base; | 36 | /* Memory timing, DLL mode flags */ |
36 | void __iomem *omap2_sms_base; | 37 | #define M_DDR 1 |
38 | #define M_LOCK_CTRL (1 << 2) | ||
39 | #define M_UNLOCK 0 | ||
40 | #define M_LOCK 1 | ||
41 | |||
37 | 42 | ||
38 | static struct memory_timings mem_timings; | 43 | static struct memory_timings mem_timings; |
39 | static u32 curr_perf_level = CORE_CLK_SRC_DPLL_X2; | 44 | static u32 curr_perf_level = CORE_CLK_SRC_DPLL_X2; |
40 | 45 | ||
41 | u32 omap2_memory_get_slow_dll_ctrl(void) | 46 | static u32 omap2xxx_sdrc_get_slow_dll_ctrl(void) |
42 | { | 47 | { |
43 | return mem_timings.slow_dll_ctrl; | 48 | return mem_timings.slow_dll_ctrl; |
44 | } | 49 | } |
45 | 50 | ||
46 | u32 omap2_memory_get_fast_dll_ctrl(void) | 51 | static u32 omap2xxx_sdrc_get_fast_dll_ctrl(void) |
47 | { | 52 | { |
48 | return mem_timings.fast_dll_ctrl; | 53 | return mem_timings.fast_dll_ctrl; |
49 | } | 54 | } |
50 | 55 | ||
51 | u32 omap2_memory_get_type(void) | 56 | static u32 omap2xxx_sdrc_get_type(void) |
52 | { | 57 | { |
53 | return mem_timings.m_type; | 58 | return mem_timings.m_type; |
54 | } | 59 | } |
@@ -57,7 +62,7 @@ u32 omap2_memory_get_type(void) | |||
57 | * Check the DLL lock state, and return tue if running in unlock mode. | 62 | * Check the DLL lock state, and return tue if running in unlock mode. |
58 | * This is needed to compensate for the shifted DLL value in unlock mode. | 63 | * This is needed to compensate for the shifted DLL value in unlock mode. |
59 | */ | 64 | */ |
60 | u32 omap2_dll_force_needed(void) | 65 | u32 omap2xxx_sdrc_dll_is_unlocked(void) |
61 | { | 66 | { |
62 | /* dlla and dllb are a set */ | 67 | /* dlla and dllb are a set */ |
63 | u32 dll_state = sdrc_read_reg(SDRC_DLLA_CTRL); | 68 | u32 dll_state = sdrc_read_reg(SDRC_DLLA_CTRL); |
@@ -72,8 +77,10 @@ u32 omap2_dll_force_needed(void) | |||
72 | * 'level' is the value to store to CM_CLKSEL2_PLL.CORE_CLK_SRC. | 77 | * 'level' is the value to store to CM_CLKSEL2_PLL.CORE_CLK_SRC. |
73 | * Practical values are CORE_CLK_SRC_DPLL (for CORE_CLK = DPLL_CLK) or | 78 | * Practical values are CORE_CLK_SRC_DPLL (for CORE_CLK = DPLL_CLK) or |
74 | * CORE_CLK_SRC_DPLL_X2 (for CORE_CLK = * DPLL_CLK * 2) | 79 | * CORE_CLK_SRC_DPLL_X2 (for CORE_CLK = * DPLL_CLK * 2) |
80 | * | ||
81 | * Used by the clock framework during CORE DPLL changes | ||
75 | */ | 82 | */ |
76 | u32 omap2_reprogram_sdrc(u32 level, u32 force) | 83 | u32 omap2xxx_sdrc_reprogram(u32 level, u32 force) |
77 | { | 84 | { |
78 | u32 dll_ctrl, m_type; | 85 | u32 dll_ctrl, m_type; |
79 | u32 prev = curr_perf_level; | 86 | u32 prev = curr_perf_level; |
@@ -82,15 +89,14 @@ u32 omap2_reprogram_sdrc(u32 level, u32 force) | |||
82 | if ((curr_perf_level == level) && !force) | 89 | if ((curr_perf_level == level) && !force) |
83 | return prev; | 90 | return prev; |
84 | 91 | ||
85 | if (level == CORE_CLK_SRC_DPLL) { | 92 | if (level == CORE_CLK_SRC_DPLL) |
86 | dll_ctrl = omap2_memory_get_slow_dll_ctrl(); | 93 | dll_ctrl = omap2xxx_sdrc_get_slow_dll_ctrl(); |
87 | } else if (level == CORE_CLK_SRC_DPLL_X2) { | 94 | else if (level == CORE_CLK_SRC_DPLL_X2) |
88 | dll_ctrl = omap2_memory_get_fast_dll_ctrl(); | 95 | dll_ctrl = omap2xxx_sdrc_get_fast_dll_ctrl(); |
89 | } else { | 96 | else |
90 | return prev; | 97 | return prev; |
91 | } | ||
92 | 98 | ||
93 | m_type = omap2_memory_get_type(); | 99 | m_type = omap2xxx_sdrc_get_type(); |
94 | 100 | ||
95 | local_irq_save(flags); | 101 | local_irq_save(flags); |
96 | __raw_writel(0xffff, OMAP24XX_PRCM_VOLTSETUP); | 102 | __raw_writel(0xffff, OMAP24XX_PRCM_VOLTSETUP); |
@@ -101,23 +107,14 @@ u32 omap2_reprogram_sdrc(u32 level, u32 force) | |||
101 | return prev; | 107 | return prev; |
102 | } | 108 | } |
103 | 109 | ||
104 | #if !defined(CONFIG_ARCH_OMAP2) | 110 | /* Used by the clock framework during CORE DPLL changes */ |
105 | void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, | 111 | void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode) |
106 | u32 base_cs, u32 force_unlock) | ||
107 | { | ||
108 | } | ||
109 | void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, | ||
110 | u32 mem_type) | ||
111 | { | ||
112 | } | ||
113 | #endif | ||
114 | |||
115 | void omap2_init_memory_params(u32 force_lock_to_unlock_mode) | ||
116 | { | 112 | { |
117 | unsigned long dll_cnt; | 113 | unsigned long dll_cnt; |
118 | u32 fast_dll = 0; | 114 | u32 fast_dll = 0; |
119 | 115 | ||
120 | mem_timings.m_type = !((sdrc_read_reg(SDRC_MR_0) & 0x3) == 0x1); /* DDR = 1, SDR = 0 */ | 116 | /* DDR = 1, SDR = 0 */ |
117 | mem_timings.m_type = !((sdrc_read_reg(SDRC_MR_0) & 0x3) == 0x1); | ||
121 | 118 | ||
122 | /* 2422 es2.05 and beyond has a single SIP DDR instead of 2 like others. | 119 | /* 2422 es2.05 and beyond has a single SIP DDR instead of 2 like others. |
123 | * In the case of 2422, its ok to use CS1 instead of CS0. | 120 | * In the case of 2422, its ok to use CS1 instead of CS0. |
@@ -164,28 +161,3 @@ void omap2_init_memory_params(u32 force_lock_to_unlock_mode) | |||
164 | /* 90 degree phase for anything below 133Mhz + disable DLL filter */ | 161 | /* 90 degree phase for anything below 133Mhz + disable DLL filter */ |
165 | mem_timings.slow_dll_ctrl |= ((1 << 1) | (3 << 8)); | 162 | mem_timings.slow_dll_ctrl |= ((1 << 1) | (3 << 8)); |
166 | } | 163 | } |
167 | |||
168 | void __init omap2_set_globals_memory(struct omap_globals *omap2_globals) | ||
169 | { | ||
170 | omap2_sdrc_base = omap2_globals->sdrc; | ||
171 | omap2_sms_base = omap2_globals->sms; | ||
172 | } | ||
173 | |||
174 | /* turn on smart idle modes for SDRAM scheduler and controller */ | ||
175 | void __init omap2_init_memory(void) | ||
176 | { | ||
177 | u32 l; | ||
178 | |||
179 | if (!cpu_is_omap2420()) | ||
180 | return; | ||
181 | |||
182 | l = sms_read_reg(SMS_SYSCONFIG); | ||
183 | l &= ~(0x3 << 3); | ||
184 | l |= (0x2 << 3); | ||
185 | sms_write_reg(l, SMS_SYSCONFIG); | ||
186 | |||
187 | l = sdrc_read_reg(SDRC_SYSCONFIG); | ||
188 | l &= ~(0x3 << 3); | ||
189 | l |= (0x2 << 3); | ||
190 | sdrc_write_reg(l, SDRC_SYSCONFIG); | ||
191 | } | ||
diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig index f59a8d0e0824..2c7035d8dcbf 100644 --- a/arch/arm/mach-orion5x/Kconfig +++ b/arch/arm/mach-orion5x/Kconfig | |||
@@ -71,6 +71,7 @@ config MACH_WRT350N_V2 | |||
71 | 71 | ||
72 | config MACH_TS78XX | 72 | config MACH_TS78XX |
73 | bool "Technologic Systems TS-78xx" | 73 | bool "Technologic Systems TS-78xx" |
74 | select PM | ||
74 | help | 75 | help |
75 | Say 'Y' here if you want your kernel to support the | 76 | Say 'Y' here if you want your kernel to support the |
76 | Technologic Systems TS-78xx platform. | 77 | Technologic Systems TS-78xx platform. |
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index 0a623379789f..8a0e49d84256 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c | |||
@@ -431,6 +431,10 @@ void __init orion5x_uart1_init(void) | |||
431 | /***************************************************************************** | 431 | /***************************************************************************** |
432 | * XOR engine | 432 | * XOR engine |
433 | ****************************************************************************/ | 433 | ****************************************************************************/ |
434 | struct mv_xor_platform_shared_data orion5x_xor_shared_data = { | ||
435 | .dram = &orion5x_mbus_dram_info, | ||
436 | }; | ||
437 | |||
434 | static struct resource orion5x_xor_shared_resources[] = { | 438 | static struct resource orion5x_xor_shared_resources[] = { |
435 | { | 439 | { |
436 | .name = "xor low", | 440 | .name = "xor low", |
@@ -448,6 +452,9 @@ static struct resource orion5x_xor_shared_resources[] = { | |||
448 | static struct platform_device orion5x_xor_shared = { | 452 | static struct platform_device orion5x_xor_shared = { |
449 | .name = MV_XOR_SHARED_NAME, | 453 | .name = MV_XOR_SHARED_NAME, |
450 | .id = 0, | 454 | .id = 0, |
455 | .dev = { | ||
456 | .platform_data = &orion5x_xor_shared_data, | ||
457 | }, | ||
451 | .num_resources = ARRAY_SIZE(orion5x_xor_shared_resources), | 458 | .num_resources = ARRAY_SIZE(orion5x_xor_shared_resources), |
452 | .resource = orion5x_xor_shared_resources, | 459 | .resource = orion5x_xor_shared_resources, |
453 | }; | 460 | }; |
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index 0722d6510df1..b31ca4cef365 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c | |||
@@ -76,7 +76,7 @@ static int __init dns323_dev_id(void) | |||
76 | 76 | ||
77 | static int __init dns323_pci_init(void) | 77 | static int __init dns323_pci_init(void) |
78 | { | 78 | { |
79 | /* The 5182 doesn't really use it's PCI bus, and initialising PCI | 79 | /* The 5182 doesn't really use its PCI bus, and initialising PCI |
80 | * gets in the way of initialising the SATA controller. | 80 | * gets in the way of initialising the SATA controller. |
81 | */ | 81 | */ |
82 | if (machine_is_dns323() && dns323_dev_id() != MV88F5182_DEV_ID) | 82 | if (machine_is_dns323() && dns323_dev_id() != MV88F5182_DEV_ID) |
@@ -418,7 +418,7 @@ static void __init dns323_init(void) | |||
418 | orion5x_i2c_init(); | 418 | orion5x_i2c_init(); |
419 | orion5x_uart0_init(); | 419 | orion5x_uart0_init(); |
420 | 420 | ||
421 | /* The 5182 has it's SATA controller on-chip, and needs it's own little | 421 | /* The 5182 has its SATA controller on-chip, and needs its own little |
422 | * init routine. | 422 | * init routine. |
423 | */ | 423 | */ |
424 | if (dns323_dev_id() == MV88F5182_DEV_ID) | 424 | if (dns323_dev_id() == MV88F5182_DEV_ID) |
diff --git a/arch/arm/mach-orion5x/include/mach/system.h b/arch/arm/mach-orion5x/include/mach/system.h index 08e430757890..9b8db1dcfa83 100644 --- a/arch/arm/mach-orion5x/include/mach/system.h +++ b/arch/arm/mach-orion5x/include/mach/system.h | |||
@@ -19,7 +19,7 @@ static inline void arch_idle(void) | |||
19 | cpu_do_idle(); | 19 | cpu_do_idle(); |
20 | } | 20 | } |
21 | 21 | ||
22 | static inline void arch_reset(char mode) | 22 | static inline void arch_reset(char mode, const char *cmd) |
23 | { | 23 | { |
24 | /* | 24 | /* |
25 | * Enable and issue soft reset | 25 | * Enable and issue soft reset |
diff --git a/arch/arm/mach-orion5x/irq.c b/arch/arm/mach-orion5x/irq.c index 0caae43301e5..e03f7b45cb0d 100644 --- a/arch/arm/mach-orion5x/irq.c +++ b/arch/arm/mach-orion5x/irq.c | |||
@@ -44,7 +44,7 @@ void __init orion5x_init_irq(void) | |||
44 | * User can use set_type() if he wants to use edge types handlers. | 44 | * User can use set_type() if he wants to use edge types handlers. |
45 | */ | 45 | */ |
46 | for (i = IRQ_ORION5X_GPIO_START; i < NR_IRQS; i++) { | 46 | for (i = IRQ_ORION5X_GPIO_START; i < NR_IRQS; i++) { |
47 | set_irq_chip(i, &orion_gpio_irq_level_chip); | 47 | set_irq_chip(i, &orion_gpio_irq_chip); |
48 | set_irq_handler(i, handle_level_irq); | 48 | set_irq_handler(i, handle_level_irq); |
49 | irq_desc[i].status |= IRQ_LEVEL; | 49 | irq_desc[i].status |= IRQ_LEVEL; |
50 | set_irq_flags(i, IRQF_VALID); | 50 | set_irq_flags(i, IRQF_VALID); |
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c index e0c43b8beb72..c9bf6b81a80d 100644 --- a/arch/arm/mach-orion5x/lsmini-setup.c +++ b/arch/arm/mach-orion5x/lsmini-setup.c | |||
@@ -186,7 +186,7 @@ static struct mv_sata_platform_data lsmini_sata_data = { | |||
186 | 186 | ||
187 | static void lsmini_power_off(void) | 187 | static void lsmini_power_off(void) |
188 | { | 188 | { |
189 | arch_reset(0); | 189 | arch_reset(0, NULL); |
190 | } | 190 | } |
191 | 191 | ||
192 | 192 | ||
diff --git a/arch/arm/mach-orion5x/ts78xx-fpga.h b/arch/arm/mach-orion5x/ts78xx-fpga.h new file mode 100644 index 000000000000..0a314ddef658 --- /dev/null +++ b/arch/arm/mach-orion5x/ts78xx-fpga.h | |||
@@ -0,0 +1,29 @@ | |||
1 | #define FPGAID(_magic, _rev) ((_magic << 8) + _rev) | ||
2 | |||
3 | /* | ||
4 | * get yer id's from http://ts78xx.digriz.org.uk/ | ||
5 | * do *not* make up your own or 'borrow' any! | ||
6 | */ | ||
7 | enum fpga_ids { | ||
8 | /* Technologic Systems */ | ||
9 | TS7800_REV_B2 = FPGAID(0x00b480, 0x02), | ||
10 | TS7800_REV_B3 = FPGAID(0x00b480, 0x03), | ||
11 | }; | ||
12 | |||
13 | struct fpga_device { | ||
14 | unsigned present:1; | ||
15 | unsigned init:1; | ||
16 | }; | ||
17 | |||
18 | struct fpga_devices { | ||
19 | /* Technologic Systems */ | ||
20 | struct fpga_device ts_rtc; | ||
21 | struct fpga_device ts_nand; | ||
22 | }; | ||
23 | |||
24 | struct ts78xx_fpga_data { | ||
25 | unsigned int id; | ||
26 | int state; | ||
27 | |||
28 | struct fpga_devices supports; | ||
29 | }; | ||
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c index 1368e9fd1a06..f5191ddea085 100644 --- a/arch/arm/mach-orion5x/ts78xx-setup.c +++ b/arch/arm/mach-orion5x/ts78xx-setup.c | |||
@@ -10,17 +10,20 @@ | |||
10 | 10 | ||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/sysfs.h> | ||
13 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
14 | #include <linux/mtd/physmap.h> | ||
15 | #include <linux/mv643xx_eth.h> | 15 | #include <linux/mv643xx_eth.h> |
16 | #include <linux/ata_platform.h> | 16 | #include <linux/ata_platform.h> |
17 | #include <linux/m48t86.h> | 17 | #include <linux/m48t86.h> |
18 | #include <linux/mtd/nand.h> | ||
19 | #include <linux/mtd/partitions.h> | ||
18 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
19 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
20 | #include <asm/mach/map.h> | 22 | #include <asm/mach/map.h> |
21 | #include <mach/orion5x.h> | 23 | #include <mach/orion5x.h> |
22 | #include "common.h" | 24 | #include "common.h" |
23 | #include "mpp.h" | 25 | #include "mpp.h" |
26 | #include "ts78xx-fpga.h" | ||
24 | 27 | ||
25 | /***************************************************************************** | 28 | /***************************************************************************** |
26 | * TS-78xx Info | 29 | * TS-78xx Info |
@@ -33,18 +36,11 @@ | |||
33 | #define TS78XX_FPGA_REGS_VIRT_BASE 0xff900000 | 36 | #define TS78XX_FPGA_REGS_VIRT_BASE 0xff900000 |
34 | #define TS78XX_FPGA_REGS_SIZE SZ_1M | 37 | #define TS78XX_FPGA_REGS_SIZE SZ_1M |
35 | 38 | ||
36 | #define TS78XX_FPGA_REGS_SYSCON_ID (TS78XX_FPGA_REGS_VIRT_BASE | 0x000) | 39 | static struct ts78xx_fpga_data ts78xx_fpga = { |
37 | #define TS78XX_FPGA_REGS_SYSCON_LCDI (TS78XX_FPGA_REGS_VIRT_BASE | 0x004) | 40 | .id = 0, |
38 | #define TS78XX_FPGA_REGS_SYSCON_LCDO (TS78XX_FPGA_REGS_VIRT_BASE | 0x008) | 41 | .state = 1, |
39 | 42 | /* .supports = ... - populated by ts78xx_fpga_supports() */ | |
40 | #define TS78XX_FPGA_REGS_RTC_CTRL (TS78XX_FPGA_REGS_VIRT_BASE | 0x808) | 43 | }; |
41 | #define TS78XX_FPGA_REGS_RTC_DATA (TS78XX_FPGA_REGS_VIRT_BASE | 0x80c) | ||
42 | |||
43 | /* | ||
44 | * 512kB NOR flash Device | ||
45 | */ | ||
46 | #define TS78XX_NOR_BOOT_BASE 0xff800000 | ||
47 | #define TS78XX_NOR_BOOT_SIZE SZ_512K | ||
48 | 44 | ||
49 | /***************************************************************************** | 45 | /***************************************************************************** |
50 | * I/O Address Mapping | 46 | * I/O Address Mapping |
@@ -65,73 +61,47 @@ void __init ts78xx_map_io(void) | |||
65 | } | 61 | } |
66 | 62 | ||
67 | /***************************************************************************** | 63 | /***************************************************************************** |
68 | * 512kB NOR Boot Flash - the chip is a M25P40 | 64 | * Ethernet |
69 | ****************************************************************************/ | 65 | ****************************************************************************/ |
70 | static struct mtd_partition ts78xx_nor_boot_flash_resources[] = { | 66 | static struct mv643xx_eth_platform_data ts78xx_eth_data = { |
71 | { | 67 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), |
72 | .name = "ts-bootrom", | ||
73 | .offset = 0, | ||
74 | /* only the first 256kB is used */ | ||
75 | .size = SZ_256K, | ||
76 | .mask_flags = MTD_WRITEABLE, | ||
77 | }, | ||
78 | }; | ||
79 | |||
80 | static struct physmap_flash_data ts78xx_nor_boot_flash_data = { | ||
81 | .width = 1, | ||
82 | .parts = ts78xx_nor_boot_flash_resources, | ||
83 | .nr_parts = ARRAY_SIZE(ts78xx_nor_boot_flash_resources), | ||
84 | }; | ||
85 | |||
86 | static struct resource ts78xx_nor_boot_flash_resource = { | ||
87 | .flags = IORESOURCE_MEM, | ||
88 | .start = TS78XX_NOR_BOOT_BASE, | ||
89 | .end = TS78XX_NOR_BOOT_BASE + TS78XX_NOR_BOOT_SIZE - 1, | ||
90 | }; | ||
91 | |||
92 | static struct platform_device ts78xx_nor_boot_flash = { | ||
93 | .name = "physmap-flash", | ||
94 | .id = -1, | ||
95 | .dev = { | ||
96 | .platform_data = &ts78xx_nor_boot_flash_data, | ||
97 | }, | ||
98 | .num_resources = 1, | ||
99 | .resource = &ts78xx_nor_boot_flash_resource, | ||
100 | }; | 68 | }; |
101 | 69 | ||
102 | /***************************************************************************** | 70 | /***************************************************************************** |
103 | * Ethernet | 71 | * SATA |
104 | ****************************************************************************/ | 72 | ****************************************************************************/ |
105 | static struct mv643xx_eth_platform_data ts78xx_eth_data = { | 73 | static struct mv_sata_platform_data ts78xx_sata_data = { |
106 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | 74 | .n_ports = 2, |
107 | }; | 75 | }; |
108 | 76 | ||
109 | /***************************************************************************** | 77 | /***************************************************************************** |
110 | * RTC M48T86 - nicked^Wborrowed from arch/arm/mach-ep93xx/ts72xx.c | 78 | * RTC M48T86 - nicked^Wborrowed from arch/arm/mach-ep93xx/ts72xx.c |
111 | ****************************************************************************/ | 79 | ****************************************************************************/ |
112 | #ifdef CONFIG_RTC_DRV_M48T86 | 80 | #define TS_RTC_CTRL (TS78XX_FPGA_REGS_VIRT_BASE | 0x808) |
113 | static unsigned char ts78xx_rtc_readbyte(unsigned long addr) | 81 | #define TS_RTC_DATA (TS78XX_FPGA_REGS_VIRT_BASE | 0x80c) |
82 | |||
83 | static unsigned char ts78xx_ts_rtc_readbyte(unsigned long addr) | ||
114 | { | 84 | { |
115 | writeb(addr, TS78XX_FPGA_REGS_RTC_CTRL); | 85 | writeb(addr, TS_RTC_CTRL); |
116 | return readb(TS78XX_FPGA_REGS_RTC_DATA); | 86 | return readb(TS_RTC_DATA); |
117 | } | 87 | } |
118 | 88 | ||
119 | static void ts78xx_rtc_writebyte(unsigned char value, unsigned long addr) | 89 | static void ts78xx_ts_rtc_writebyte(unsigned char value, unsigned long addr) |
120 | { | 90 | { |
121 | writeb(addr, TS78XX_FPGA_REGS_RTC_CTRL); | 91 | writeb(addr, TS_RTC_CTRL); |
122 | writeb(value, TS78XX_FPGA_REGS_RTC_DATA); | 92 | writeb(value, TS_RTC_DATA); |
123 | } | 93 | } |
124 | 94 | ||
125 | static struct m48t86_ops ts78xx_rtc_ops = { | 95 | static struct m48t86_ops ts78xx_ts_rtc_ops = { |
126 | .readbyte = ts78xx_rtc_readbyte, | 96 | .readbyte = ts78xx_ts_rtc_readbyte, |
127 | .writebyte = ts78xx_rtc_writebyte, | 97 | .writebyte = ts78xx_ts_rtc_writebyte, |
128 | }; | 98 | }; |
129 | 99 | ||
130 | static struct platform_device ts78xx_rtc_device = { | 100 | static struct platform_device ts78xx_ts_rtc_device = { |
131 | .name = "rtc-m48t86", | 101 | .name = "rtc-m48t86", |
132 | .id = -1, | 102 | .id = -1, |
133 | .dev = { | 103 | .dev = { |
134 | .platform_data = &ts78xx_rtc_ops, | 104 | .platform_data = &ts78xx_ts_rtc_ops, |
135 | }, | 105 | }, |
136 | .num_resources = 0, | 106 | .num_resources = 0, |
137 | }; | 107 | }; |
@@ -146,59 +116,311 @@ static struct platform_device ts78xx_rtc_device = { | |||
146 | * TODO: track down a guinea pig without an RTC to see if we can work out a | 116 | * TODO: track down a guinea pig without an RTC to see if we can work out a |
147 | * better RTC detection routine | 117 | * better RTC detection routine |
148 | */ | 118 | */ |
149 | static int __init ts78xx_rtc_init(void) | 119 | static int ts78xx_ts_rtc_load(void) |
150 | { | 120 | { |
121 | int rc; | ||
151 | unsigned char tmp_rtc0, tmp_rtc1; | 122 | unsigned char tmp_rtc0, tmp_rtc1; |
152 | 123 | ||
153 | tmp_rtc0 = ts78xx_rtc_readbyte(126); | 124 | tmp_rtc0 = ts78xx_ts_rtc_readbyte(126); |
154 | tmp_rtc1 = ts78xx_rtc_readbyte(127); | 125 | tmp_rtc1 = ts78xx_ts_rtc_readbyte(127); |
155 | 126 | ||
156 | ts78xx_rtc_writebyte(0x00, 126); | 127 | ts78xx_ts_rtc_writebyte(0x00, 126); |
157 | ts78xx_rtc_writebyte(0x55, 127); | 128 | ts78xx_ts_rtc_writebyte(0x55, 127); |
158 | if (ts78xx_rtc_readbyte(127) == 0x55) { | 129 | if (ts78xx_ts_rtc_readbyte(127) == 0x55) { |
159 | ts78xx_rtc_writebyte(0xaa, 127); | 130 | ts78xx_ts_rtc_writebyte(0xaa, 127); |
160 | if (ts78xx_rtc_readbyte(127) == 0xaa | 131 | if (ts78xx_ts_rtc_readbyte(127) == 0xaa |
161 | && ts78xx_rtc_readbyte(126) == 0x00) { | 132 | && ts78xx_ts_rtc_readbyte(126) == 0x00) { |
162 | ts78xx_rtc_writebyte(tmp_rtc0, 126); | 133 | ts78xx_ts_rtc_writebyte(tmp_rtc0, 126); |
163 | ts78xx_rtc_writebyte(tmp_rtc1, 127); | 134 | ts78xx_ts_rtc_writebyte(tmp_rtc1, 127); |
164 | platform_device_register(&ts78xx_rtc_device); | 135 | |
165 | return 1; | 136 | if (ts78xx_fpga.supports.ts_rtc.init == 0) { |
137 | rc = platform_device_register(&ts78xx_ts_rtc_device); | ||
138 | if (!rc) | ||
139 | ts78xx_fpga.supports.ts_rtc.init = 1; | ||
140 | } else | ||
141 | rc = platform_device_add(&ts78xx_ts_rtc_device); | ||
142 | |||
143 | return rc; | ||
166 | } | 144 | } |
167 | } | 145 | } |
168 | 146 | ||
169 | return 0; | 147 | return -ENODEV; |
170 | }; | 148 | }; |
171 | #else | 149 | |
172 | static int __init ts78xx_rtc_init(void) | 150 | static void ts78xx_ts_rtc_unload(void) |
173 | { | 151 | { |
174 | return 0; | 152 | platform_device_del(&ts78xx_ts_rtc_device); |
175 | } | 153 | } |
176 | #endif | ||
177 | 154 | ||
178 | /***************************************************************************** | 155 | /***************************************************************************** |
179 | * SATA | 156 | * NAND Flash |
180 | ****************************************************************************/ | 157 | ****************************************************************************/ |
181 | static struct mv_sata_platform_data ts78xx_sata_data = { | 158 | #define TS_NAND_CTRL (TS78XX_FPGA_REGS_VIRT_BASE | 0x800) /* VIRT */ |
182 | .n_ports = 2, | 159 | #define TS_NAND_DATA (TS78XX_FPGA_REGS_PHYS_BASE | 0x804) /* PHYS */ |
160 | |||
161 | /* | ||
162 | * hardware specific access to control-lines | ||
163 | * | ||
164 | * ctrl: | ||
165 | * NAND_NCE: bit 0 -> bit 2 | ||
166 | * NAND_CLE: bit 1 -> bit 1 | ||
167 | * NAND_ALE: bit 2 -> bit 0 | ||
168 | */ | ||
169 | static void ts78xx_ts_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, | ||
170 | unsigned int ctrl) | ||
171 | { | ||
172 | struct nand_chip *this = mtd->priv; | ||
173 | |||
174 | if (ctrl & NAND_CTRL_CHANGE) { | ||
175 | unsigned char bits; | ||
176 | |||
177 | bits = (ctrl & NAND_NCE) << 2; | ||
178 | bits |= ctrl & NAND_CLE; | ||
179 | bits |= (ctrl & NAND_ALE) >> 2; | ||
180 | |||
181 | writeb((readb(TS_NAND_CTRL) & ~0x7) | bits, TS_NAND_CTRL); | ||
182 | } | ||
183 | |||
184 | if (cmd != NAND_CMD_NONE) | ||
185 | writeb(cmd, this->IO_ADDR_W); | ||
186 | } | ||
187 | |||
188 | static int ts78xx_ts_nand_dev_ready(struct mtd_info *mtd) | ||
189 | { | ||
190 | return readb(TS_NAND_CTRL) & 0x20; | ||
191 | } | ||
192 | |||
193 | const char *ts_nand_part_probes[] = { "cmdlinepart", NULL }; | ||
194 | |||
195 | static struct mtd_partition ts78xx_ts_nand_parts[] = { | ||
196 | { | ||
197 | .name = "mbr", | ||
198 | .offset = 0, | ||
199 | .size = SZ_128K, | ||
200 | .mask_flags = MTD_WRITEABLE, | ||
201 | }, { | ||
202 | .name = "kernel", | ||
203 | .offset = MTDPART_OFS_APPEND, | ||
204 | .size = SZ_4M, | ||
205 | }, { | ||
206 | .name = "initrd", | ||
207 | .offset = MTDPART_OFS_APPEND, | ||
208 | .size = SZ_4M, | ||
209 | }, { | ||
210 | .name = "rootfs", | ||
211 | .offset = MTDPART_OFS_APPEND, | ||
212 | .size = MTDPART_SIZ_FULL, | ||
213 | } | ||
183 | }; | 214 | }; |
184 | 215 | ||
216 | static struct platform_nand_data ts78xx_ts_nand_data = { | ||
217 | .chip = { | ||
218 | .part_probe_types = ts_nand_part_probes, | ||
219 | .partitions = ts78xx_ts_nand_parts, | ||
220 | .nr_partitions = ARRAY_SIZE(ts78xx_ts_nand_parts), | ||
221 | .chip_delay = 15, | ||
222 | .options = NAND_USE_FLASH_BBT, | ||
223 | }, | ||
224 | .ctrl = { | ||
225 | /* | ||
226 | * The HW ECC offloading functions, used to give about a 9% | ||
227 | * performance increase for 'dd if=/dev/mtdblockX' and 5% for | ||
228 | * nanddump. This all however was changed by git commit | ||
229 | * e6cf5df1838c28bb060ac45b5585e48e71bbc740 so now there is | ||
230 | * no performance advantage to be had so we no longer bother | ||
231 | */ | ||
232 | .cmd_ctrl = ts78xx_ts_nand_cmd_ctrl, | ||
233 | .dev_ready = ts78xx_ts_nand_dev_ready, | ||
234 | }, | ||
235 | }; | ||
236 | |||
237 | static struct resource ts78xx_ts_nand_resources = { | ||
238 | .start = TS_NAND_DATA, | ||
239 | .end = TS_NAND_DATA + 4, | ||
240 | .flags = IORESOURCE_IO, | ||
241 | }; | ||
242 | |||
243 | static struct platform_device ts78xx_ts_nand_device = { | ||
244 | .name = "gen_nand", | ||
245 | .id = -1, | ||
246 | .dev = { | ||
247 | .platform_data = &ts78xx_ts_nand_data, | ||
248 | }, | ||
249 | .resource = &ts78xx_ts_nand_resources, | ||
250 | .num_resources = 1, | ||
251 | }; | ||
252 | |||
253 | static int ts78xx_ts_nand_load(void) | ||
254 | { | ||
255 | int rc; | ||
256 | |||
257 | if (ts78xx_fpga.supports.ts_nand.init == 0) { | ||
258 | rc = platform_device_register(&ts78xx_ts_nand_device); | ||
259 | if (!rc) | ||
260 | ts78xx_fpga.supports.ts_nand.init = 1; | ||
261 | } else | ||
262 | rc = platform_device_add(&ts78xx_ts_nand_device); | ||
263 | |||
264 | return rc; | ||
265 | }; | ||
266 | |||
267 | static void ts78xx_ts_nand_unload(void) | ||
268 | { | ||
269 | platform_device_del(&ts78xx_ts_nand_device); | ||
270 | } | ||
271 | |||
185 | /***************************************************************************** | 272 | /***************************************************************************** |
186 | * print some information regarding the board | 273 | * FPGA 'hotplug' support code |
187 | ****************************************************************************/ | 274 | ****************************************************************************/ |
188 | static void __init ts78xx_print_board_id(void) | 275 | static void ts78xx_fpga_devices_zero_init(void) |
189 | { | 276 | { |
190 | unsigned int board_info; | 277 | ts78xx_fpga.supports.ts_rtc.init = 0; |
191 | 278 | ts78xx_fpga.supports.ts_nand.init = 0; | |
192 | board_info = readl(TS78XX_FPGA_REGS_SYSCON_ID); | 279 | } |
193 | printk(KERN_INFO "TS-78xx Info: FPGA rev=%.2x, Board Magic=%.6x, ", | 280 | |
194 | board_info & 0xff, | 281 | static void ts78xx_fpga_supports(void) |
195 | (board_info >> 8) & 0xffffff); | 282 | { |
196 | board_info = readl(TS78XX_FPGA_REGS_SYSCON_LCDI); | 283 | /* TODO: put this 'table' into ts78xx-fpga.h */ |
197 | printk("JP1=%d, JP2=%d\n", | 284 | switch (ts78xx_fpga.id) { |
198 | (board_info >> 30) & 0x1, | 285 | case TS7800_REV_B2: |
199 | (board_info >> 31) & 0x1); | 286 | case TS7800_REV_B3: |
287 | ts78xx_fpga.supports.ts_rtc.present = 1; | ||
288 | ts78xx_fpga.supports.ts_nand.present = 1; | ||
289 | break; | ||
290 | default: | ||
291 | ts78xx_fpga.supports.ts_rtc.present = 0; | ||
292 | ts78xx_fpga.supports.ts_nand.present = 0; | ||
293 | } | ||
294 | } | ||
295 | |||
296 | static int ts78xx_fpga_load_devices(void) | ||
297 | { | ||
298 | int tmp, ret = 0; | ||
299 | |||
300 | if (ts78xx_fpga.supports.ts_rtc.present == 1) { | ||
301 | tmp = ts78xx_ts_rtc_load(); | ||
302 | if (tmp) { | ||
303 | printk(KERN_INFO "TS-78xx: RTC not registered\n"); | ||
304 | ts78xx_fpga.supports.ts_rtc.present = 0; | ||
305 | } | ||
306 | ret |= tmp; | ||
307 | } | ||
308 | if (ts78xx_fpga.supports.ts_nand.present == 1) { | ||
309 | tmp = ts78xx_ts_nand_load(); | ||
310 | if (tmp) { | ||
311 | printk(KERN_INFO "TS-78xx: NAND not registered\n"); | ||
312 | ts78xx_fpga.supports.ts_nand.present = 0; | ||
313 | } | ||
314 | ret |= tmp; | ||
315 | } | ||
316 | |||
317 | return ret; | ||
318 | } | ||
319 | |||
320 | static int ts78xx_fpga_unload_devices(void) | ||
321 | { | ||
322 | int ret = 0; | ||
323 | |||
324 | if (ts78xx_fpga.supports.ts_rtc.present == 1) | ||
325 | ts78xx_ts_rtc_unload(); | ||
326 | if (ts78xx_fpga.supports.ts_nand.present == 1) | ||
327 | ts78xx_ts_nand_unload(); | ||
328 | |||
329 | return ret; | ||
330 | } | ||
331 | |||
332 | static int ts78xx_fpga_load(void) | ||
333 | { | ||
334 | ts78xx_fpga.id = readl(TS78XX_FPGA_REGS_VIRT_BASE); | ||
335 | |||
336 | printk(KERN_INFO "TS-78xx FPGA: magic=0x%.6x, rev=0x%.2x\n", | ||
337 | (ts78xx_fpga.id >> 8) & 0xffffff, | ||
338 | ts78xx_fpga.id & 0xff); | ||
339 | |||
340 | ts78xx_fpga_supports(); | ||
341 | |||
342 | if (ts78xx_fpga_load_devices()) { | ||
343 | ts78xx_fpga.state = -1; | ||
344 | return -EBUSY; | ||
345 | } | ||
346 | |||
347 | return 0; | ||
200 | }; | 348 | }; |
201 | 349 | ||
350 | static int ts78xx_fpga_unload(void) | ||
351 | { | ||
352 | unsigned int fpga_id; | ||
353 | |||
354 | fpga_id = readl(TS78XX_FPGA_REGS_VIRT_BASE); | ||
355 | |||
356 | /* | ||
357 | * There does not seem to be a feasible way to block access to the GPIO | ||
358 | * pins from userspace (/dev/mem). This if clause should hopefully warn | ||
359 | * those foolish enough not to follow 'policy' :) | ||
360 | * | ||
361 | * UrJTAG SVN since r1381 can be used to reprogram the FPGA | ||
362 | */ | ||
363 | if (ts78xx_fpga.id != fpga_id) { | ||
364 | printk(KERN_ERR "TS-78xx FPGA: magic/rev mismatch\n" | ||
365 | "TS-78xx FPGA: was 0x%.6x/%.2x but now 0x%.6x/%.2x\n", | ||
366 | (ts78xx_fpga.id >> 8) & 0xffffff, ts78xx_fpga.id & 0xff, | ||
367 | (fpga_id >> 8) & 0xffffff, fpga_id & 0xff); | ||
368 | ts78xx_fpga.state = -1; | ||
369 | return -EBUSY; | ||
370 | } | ||
371 | |||
372 | if (ts78xx_fpga_unload_devices()) { | ||
373 | ts78xx_fpga.state = -1; | ||
374 | return -EBUSY; | ||
375 | } | ||
376 | |||
377 | return 0; | ||
378 | }; | ||
379 | |||
380 | static ssize_t ts78xx_fpga_show(struct kobject *kobj, | ||
381 | struct kobj_attribute *attr, char *buf) | ||
382 | { | ||
383 | if (ts78xx_fpga.state < 0) | ||
384 | return sprintf(buf, "borked\n"); | ||
385 | |||
386 | return sprintf(buf, "%s\n", (ts78xx_fpga.state) ? "online" : "offline"); | ||
387 | } | ||
388 | |||
389 | static ssize_t ts78xx_fpga_store(struct kobject *kobj, | ||
390 | struct kobj_attribute *attr, const char *buf, size_t n) | ||
391 | { | ||
392 | int value, ret; | ||
393 | |||
394 | if (ts78xx_fpga.state < 0) { | ||
395 | printk(KERN_ERR "TS-78xx FPGA: borked, you must powercycle asap\n"); | ||
396 | return -EBUSY; | ||
397 | } | ||
398 | |||
399 | if (strncmp(buf, "online", sizeof("online") - 1) == 0) | ||
400 | value = 1; | ||
401 | else if (strncmp(buf, "offline", sizeof("offline") - 1) == 0) | ||
402 | value = 0; | ||
403 | else { | ||
404 | printk(KERN_ERR "ts78xx_fpga_store: Invalid value\n"); | ||
405 | return -EINVAL; | ||
406 | } | ||
407 | |||
408 | if (ts78xx_fpga.state == value) | ||
409 | return n; | ||
410 | |||
411 | ret = (ts78xx_fpga.state == 0) | ||
412 | ? ts78xx_fpga_load() | ||
413 | : ts78xx_fpga_unload(); | ||
414 | |||
415 | if (!(ret < 0)) | ||
416 | ts78xx_fpga.state = value; | ||
417 | |||
418 | return n; | ||
419 | } | ||
420 | |||
421 | static struct kobj_attribute ts78xx_fpga_attr = | ||
422 | __ATTR(ts78xx_fpga, 0644, ts78xx_fpga_show, ts78xx_fpga_store); | ||
423 | |||
202 | /***************************************************************************** | 424 | /***************************************************************************** |
203 | * General Setup | 425 | * General Setup |
204 | ****************************************************************************/ | 426 | ****************************************************************************/ |
@@ -223,30 +445,29 @@ static struct orion5x_mpp_mode ts78xx_mpp_modes[] __initdata = { | |||
223 | { 17, MPP_UART }, | 445 | { 17, MPP_UART }, |
224 | { 18, MPP_UART }, | 446 | { 18, MPP_UART }, |
225 | { 19, MPP_UART }, | 447 | { 19, MPP_UART }, |
448 | /* | ||
449 | * MPP[20] PCI Clock Out 1 | ||
450 | * MPP[21] PCI Clock Out 0 | ||
451 | * MPP[22] Unused | ||
452 | * MPP[23] Unused | ||
453 | * MPP[24] Unused | ||
454 | * MPP[25] Unused | ||
455 | */ | ||
226 | { -1 }, | 456 | { -1 }, |
227 | }; | 457 | }; |
228 | 458 | ||
229 | static void __init ts78xx_init(void) | 459 | static void __init ts78xx_init(void) |
230 | { | 460 | { |
461 | int ret; | ||
462 | |||
231 | /* | 463 | /* |
232 | * Setup basic Orion functions. Need to be called early. | 464 | * Setup basic Orion functions. Need to be called early. |
233 | */ | 465 | */ |
234 | orion5x_init(); | 466 | orion5x_init(); |
235 | 467 | ||
236 | ts78xx_print_board_id(); | ||
237 | |||
238 | orion5x_mpp_conf(ts78xx_mpp_modes); | 468 | orion5x_mpp_conf(ts78xx_mpp_modes); |
239 | 469 | ||
240 | /* | 470 | /* |
241 | * MPP[20] PCI Clock Out 1 | ||
242 | * MPP[21] PCI Clock Out 0 | ||
243 | * MPP[22] Unused | ||
244 | * MPP[23] Unused | ||
245 | * MPP[24] Unused | ||
246 | * MPP[25] Unused | ||
247 | */ | ||
248 | |||
249 | /* | ||
250 | * Configure peripherals. | 471 | * Configure peripherals. |
251 | */ | 472 | */ |
252 | orion5x_ehci0_init(); | 473 | orion5x_ehci0_init(); |
@@ -257,12 +478,12 @@ static void __init ts78xx_init(void) | |||
257 | orion5x_uart1_init(); | 478 | orion5x_uart1_init(); |
258 | orion5x_xor_init(); | 479 | orion5x_xor_init(); |
259 | 480 | ||
260 | orion5x_setup_dev_boot_win(TS78XX_NOR_BOOT_BASE, | 481 | /* FPGA init */ |
261 | TS78XX_NOR_BOOT_SIZE); | 482 | ts78xx_fpga_devices_zero_init(); |
262 | platform_device_register(&ts78xx_nor_boot_flash); | 483 | ret = ts78xx_fpga_load(); |
263 | 484 | ret = sysfs_create_file(power_kobj, &ts78xx_fpga_attr.attr); | |
264 | if (!ts78xx_rtc_init()) | 485 | if (ret) |
265 | printk(KERN_INFO "TS-78xx RTC not detected or enabled\n"); | 486 | printk(KERN_ERR "sysfs_create_file failed: %d\n", ret); |
266 | } | 487 | } |
267 | 488 | ||
268 | MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC") | 489 | MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC") |
diff --git a/arch/arm/mach-pnx4008/include/mach/system.h b/arch/arm/mach-pnx4008/include/mach/system.h index e12e7abfcbcf..5dda2bb55f8d 100644 --- a/arch/arm/mach-pnx4008/include/mach/system.h +++ b/arch/arm/mach-pnx4008/include/mach/system.h | |||
@@ -30,7 +30,7 @@ static void arch_idle(void) | |||
30 | cpu_do_idle(); | 30 | cpu_do_idle(); |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline void arch_reset(char mode) | 33 | static inline void arch_reset(char mode, const char *cmd) |
34 | { | 34 | { |
35 | cpu_reset(0); | 35 | cpu_reset(0); |
36 | } | 36 | } |
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 3b89e5010fb3..cdf21dd135b4 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -635,16 +635,16 @@ static void corgi_poweroff(void) | |||
635 | /* Green LED off tells the bootloader to halt */ | 635 | /* Green LED off tells the bootloader to halt */ |
636 | gpio_set_value(CORGI_GPIO_LED_GREEN, 0); | 636 | gpio_set_value(CORGI_GPIO_LED_GREEN, 0); |
637 | 637 | ||
638 | arm_machine_restart('h'); | 638 | arm_machine_restart('h', NULL); |
639 | } | 639 | } |
640 | 640 | ||
641 | static void corgi_restart(char mode) | 641 | static void corgi_restart(char mode, const char *cmd) |
642 | { | 642 | { |
643 | if (!machine_is_corgi()) | 643 | if (!machine_is_corgi()) |
644 | /* Green LED on tells the bootloader to reboot */ | 644 | /* Green LED on tells the bootloader to reboot */ |
645 | gpio_set_value(CORGI_GPIO_LED_GREEN, 1); | 645 | gpio_set_value(CORGI_GPIO_LED_GREEN, 1); |
646 | 646 | ||
647 | arm_machine_restart('h'); | 647 | arm_machine_restart('h', cmd); |
648 | } | 648 | } |
649 | 649 | ||
650 | static void __init corgi_init(void) | 650 | static void __init corgi_init(void) |
diff --git a/arch/arm/mach-pxa/include/mach/system.h b/arch/arm/mach-pxa/include/mach/system.h index 0a587c4ec709..d1fce8b6d105 100644 --- a/arch/arm/mach-pxa/include/mach/system.h +++ b/arch/arm/mach-pxa/include/mach/system.h | |||
@@ -20,4 +20,4 @@ static inline void arch_idle(void) | |||
20 | } | 20 | } |
21 | 21 | ||
22 | 22 | ||
23 | void arch_reset(char mode); | 23 | void arch_reset(char mode, const char *cmd); |
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 025772785d36..97c93a7a285c 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -788,13 +788,13 @@ static void mioa701_machine_exit(void); | |||
788 | static void mioa701_poweroff(void) | 788 | static void mioa701_poweroff(void) |
789 | { | 789 | { |
790 | mioa701_machine_exit(); | 790 | mioa701_machine_exit(); |
791 | arm_machine_restart('s'); | 791 | arm_machine_restart('s', NULL); |
792 | } | 792 | } |
793 | 793 | ||
794 | static void mioa701_restart(char c) | 794 | static void mioa701_restart(char c, const char *cmd) |
795 | { | 795 | { |
796 | mioa701_machine_exit(); | 796 | mioa701_machine_exit(); |
797 | arm_machine_restart('s'); | 797 | arm_machine_restart('s', cmd); |
798 | } | 798 | } |
799 | 799 | ||
800 | struct gpio_ress global_gpios[] = { | 800 | struct gpio_ress global_gpios[] = { |
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 572ddec2b3e6..036bbde4d221 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c | |||
@@ -501,12 +501,12 @@ static struct platform_device *devices[] __initdata = { | |||
501 | 501 | ||
502 | static void poodle_poweroff(void) | 502 | static void poodle_poweroff(void) |
503 | { | 503 | { |
504 | arm_machine_restart('h'); | 504 | arm_machine_restart('h', NULL); |
505 | } | 505 | } |
506 | 506 | ||
507 | static void poodle_restart(char mode) | 507 | static void poodle_restart(char mode, const char *cmd) |
508 | { | 508 | { |
509 | arm_machine_restart('h'); | 509 | arm_machine_restart('h', cmd); |
510 | } | 510 | } |
511 | 511 | ||
512 | static void __init poodle_init(void) | 512 | static void __init poodle_init(void) |
diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c index 867c95c09618..df29d45fb4e7 100644 --- a/arch/arm/mach-pxa/reset.c +++ b/arch/arm/mach-pxa/reset.c | |||
@@ -81,7 +81,7 @@ static void do_hw_reset(void) | |||
81 | OSMR3 = OSCR + 368640; /* ... in 100 ms */ | 81 | OSMR3 = OSCR + 368640; /* ... in 100 ms */ |
82 | } | 82 | } |
83 | 83 | ||
84 | void arch_reset(char mode) | 84 | void arch_reset(char mode, const char *cmd) |
85 | { | 85 | { |
86 | clear_reset_status(RESET_STATUS_ALL); | 86 | clear_reset_status(RESET_STATUS_ALL); |
87 | 87 | ||
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index f697c492b2ab..7a0a430222cf 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -701,10 +701,10 @@ static struct platform_device *devices[] __initdata = { | |||
701 | 701 | ||
702 | static void spitz_poweroff(void) | 702 | static void spitz_poweroff(void) |
703 | { | 703 | { |
704 | arm_machine_restart('g'); | 704 | arm_machine_restart('g', NULL); |
705 | } | 705 | } |
706 | 706 | ||
707 | static void spitz_restart(char mode) | 707 | static void spitz_restart(char mode, const char *cmd) |
708 | { | 708 | { |
709 | /* Bootloader magic for a reboot */ | 709 | /* Bootloader magic for a reboot */ |
710 | if((MSC0 & 0xffff0000) == 0x7ff00000) | 710 | if((MSC0 & 0xffff0000) == 0x7ff00000) |
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 581dc105690c..6e8ade6ae339 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -876,10 +876,10 @@ static struct platform_device *devices[] __initdata = { | |||
876 | 876 | ||
877 | static void tosa_poweroff(void) | 877 | static void tosa_poweroff(void) |
878 | { | 878 | { |
879 | arm_machine_restart('g'); | 879 | arm_machine_restart('g', NULL); |
880 | } | 880 | } |
881 | 881 | ||
882 | static void tosa_restart(char mode) | 882 | static void tosa_restart(char mode, const char *cmd) |
883 | { | 883 | { |
884 | /* Bootloader magic for a reboot */ | 884 | /* Bootloader magic for a reboot */ |
885 | if((MSC0 & 0xffff0000) == 0x7ff00000) | 885 | if((MSC0 & 0xffff0000) == 0x7ff00000) |
diff --git a/arch/arm/mach-realview/include/mach/system.h b/arch/arm/mach-realview/include/mach/system.h index a2f61c78adbf..1a15a441e027 100644 --- a/arch/arm/mach-realview/include/mach/system.h +++ b/arch/arm/mach-realview/include/mach/system.h | |||
@@ -34,7 +34,7 @@ static inline void arch_idle(void) | |||
34 | cpu_do_idle(); | 34 | cpu_do_idle(); |
35 | } | 35 | } |
36 | 36 | ||
37 | static inline void arch_reset(char mode) | 37 | static inline void arch_reset(char mode, const char *cmd) |
38 | { | 38 | { |
39 | void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_RESETCTL_OFFSET; | 39 | void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_RESETCTL_OFFSET; |
40 | unsigned int val; | 40 | unsigned int val; |
diff --git a/arch/arm/mach-rpc/include/mach/system.h b/arch/arm/mach-rpc/include/mach/system.h index bd7268ba17e2..45c7b935dc45 100644 --- a/arch/arm/mach-rpc/include/mach/system.h +++ b/arch/arm/mach-rpc/include/mach/system.h | |||
@@ -16,7 +16,7 @@ static inline void arch_idle(void) | |||
16 | cpu_do_idle(); | 16 | cpu_do_idle(); |
17 | } | 17 | } |
18 | 18 | ||
19 | static inline void arch_reset(char mode) | 19 | static inline void arch_reset(char mode, const char *cmd) |
20 | { | 20 | { |
21 | iomd_writeb(0, IOMD_ROMCR0); | 21 | iomd_writeb(0, IOMD_ROMCR0); |
22 | 22 | ||
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c index e88d417736af..c7fc01e9d1f6 100644 --- a/arch/arm/mach-rpc/riscpc.c +++ b/arch/arm/mach-rpc/riscpc.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/serial_8250.h> | 19 | #include <linux/serial_8250.h> |
20 | #include <linux/ata_platform.h> | 20 | #include <linux/ata_platform.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/i2c.h> | ||
22 | 23 | ||
23 | #include <asm/elf.h> | 24 | #include <asm/elf.h> |
24 | #include <asm/mach-types.h> | 25 | #include <asm/mach-types.h> |
@@ -201,8 +202,13 @@ static struct platform_device *devs[] __initdata = { | |||
201 | &pata_device, | 202 | &pata_device, |
202 | }; | 203 | }; |
203 | 204 | ||
205 | static struct i2c_board_info i2c_rtc = { | ||
206 | I2C_BOARD_INFO("pcf8583", 0x50) | ||
207 | }; | ||
208 | |||
204 | static int __init rpc_init(void) | 209 | static int __init rpc_init(void) |
205 | { | 210 | { |
211 | i2c_register_board_info(0, &i2c_rtc, 1); | ||
206 | return platform_add_devices(devs, ARRAY_SIZE(devs)); | 212 | return platform_add_devices(devs, ARRAY_SIZE(devs)); |
207 | } | 213 | } |
208 | 214 | ||
diff --git a/arch/arm/mach-s3c2410/include/mach/system-reset.h b/arch/arm/mach-s3c2410/include/mach/system-reset.h index 7613d0a384ba..b8687f71c304 100644 --- a/arch/arm/mach-s3c2410/include/mach/system-reset.h +++ b/arch/arm/mach-s3c2410/include/mach/system-reset.h | |||
@@ -22,7 +22,7 @@ | |||
22 | extern void (*s3c24xx_reset_hook)(void); | 22 | extern void (*s3c24xx_reset_hook)(void); |
23 | 23 | ||
24 | static void | 24 | static void |
25 | arch_reset(char mode) | 25 | arch_reset(char mode, const char *cmd) |
26 | { | 26 | { |
27 | struct clk *wdtclk; | 27 | struct clk *wdtclk; |
28 | 28 | ||
diff --git a/arch/arm/mach-s3c6400/include/mach/system.h b/arch/arm/mach-s3c6400/include/mach/system.h index 652bbc403f0b..090cfd969bc7 100644 --- a/arch/arm/mach-s3c6400/include/mach/system.h +++ b/arch/arm/mach-s3c6400/include/mach/system.h | |||
@@ -16,7 +16,7 @@ static void arch_idle(void) | |||
16 | /* nothing here yet */ | 16 | /* nothing here yet */ |
17 | } | 17 | } |
18 | 18 | ||
19 | static void arch_reset(char mode) | 19 | static void arch_reset(char mode, const char *cmd) |
20 | { | 20 | { |
21 | /* nothing here yet */ | 21 | /* nothing here yet */ |
22 | } | 22 | } |
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index 3c4d47145c83..25f7935576f8 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c | |||
@@ -129,7 +129,7 @@ static struct s3c_fb_platdata smdk6410_lcd_pdata __initdata = { | |||
129 | .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, | 129 | .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, |
130 | }; | 130 | }; |
131 | 131 | ||
132 | struct map_desc smdk6410_iodesc[] = {}; | 132 | static struct map_desc smdk6410_iodesc[] = {}; |
133 | 133 | ||
134 | static struct platform_device *smdk6410_devices[] __initdata = { | 134 | static struct platform_device *smdk6410_devices[] __initdata = { |
135 | #ifdef CONFIG_SMDK6410_SD_CH0 | 135 | #ifdef CONFIG_SMDK6410_SD_CH0 |
@@ -146,7 +146,7 @@ static struct platform_device *smdk6410_devices[] __initdata = { | |||
146 | 146 | ||
147 | static struct i2c_board_info i2c_devs0[] __initdata = { | 147 | static struct i2c_board_info i2c_devs0[] __initdata = { |
148 | { I2C_BOARD_INFO("24c08", 0x50), }, | 148 | { I2C_BOARD_INFO("24c08", 0x50), }, |
149 | { I2C_BOARD_INFO("WM8580", 0X1b), }, | 149 | { I2C_BOARD_INFO("wm8580", 0x1b), }, |
150 | }; | 150 | }; |
151 | 151 | ||
152 | static struct i2c_board_info i2c_devs1[] __initdata = { | 152 | static struct i2c_board_info i2c_devs1[] __initdata = { |
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig index bfc38e315187..81ffff7ed498 100644 --- a/arch/arm/mach-sa1100/Kconfig +++ b/arch/arm/mach-sa1100/Kconfig | |||
@@ -147,15 +147,6 @@ config SA1100_SSP | |||
147 | This isn't for audio support, but for attached sensors and | 147 | This isn't for audio support, but for attached sensors and |
148 | other devices, eg for BadgePAD 4 sensor support. | 148 | other devices, eg for BadgePAD 4 sensor support. |
149 | 149 | ||
150 | config H3600_SLEEVE | ||
151 | tristate "Compaq iPAQ Handheld sleeve support" | ||
152 | depends on SA1100_H3100 || SA1100_H3600 | ||
153 | help | ||
154 | Choose this option to enable support for extension packs (sleeves) | ||
155 | for the Compaq iPAQ H3XXX series of handheld computers. This option | ||
156 | is required for the CF, PCMCIA, Bluetooth and GSM/GPRS extension | ||
157 | packs. | ||
158 | |||
159 | endmenu | 150 | endmenu |
160 | 151 | ||
161 | endif | 152 | endif |
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index b9aaa45c6ca4..0eb2f159578b 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c | |||
@@ -46,8 +46,8 @@ | |||
46 | 46 | ||
47 | #include "generic.h" | 47 | #include "generic.h" |
48 | 48 | ||
49 | struct ipaq_model_ops ipaq_model_ops; | 49 | void (*assign_h3600_egpio)(enum ipaq_egpio_type x, int level); |
50 | EXPORT_SYMBOL(ipaq_model_ops); | 50 | EXPORT_SYMBOL(assign_h3600_egpio); |
51 | 51 | ||
52 | static struct mtd_partition h3xxx_partitions[] = { | 52 | static struct mtd_partition h3xxx_partitions[] = { |
53 | { | 53 | { |
@@ -56,41 +56,9 @@ static struct mtd_partition h3xxx_partitions[] = { | |||
56 | .offset = 0, | 56 | .offset = 0, |
57 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | 57 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
58 | }, { | 58 | }, { |
59 | #ifdef CONFIG_MTD_2PARTS_IPAQ | 59 | .name = "H3XXX rootfs", |
60 | .name = "H3XXX root jffs2", | ||
61 | .size = MTDPART_SIZ_FULL, | 60 | .size = MTDPART_SIZ_FULL, |
62 | .offset = 0x00040000, | 61 | .offset = 0x00040000, |
63 | #else | ||
64 | .name = "H3XXX kernel", | ||
65 | .size = 0x00080000, | ||
66 | .offset = 0x00040000, | ||
67 | }, { | ||
68 | .name = "H3XXX params", | ||
69 | .size = 0x00040000, | ||
70 | .offset = 0x000C0000, | ||
71 | }, { | ||
72 | #ifdef CONFIG_JFFS2_FS | ||
73 | .name = "H3XXX root jffs2", | ||
74 | .size = MTDPART_SIZ_FULL, | ||
75 | .offset = 0x00100000, | ||
76 | #else | ||
77 | .name = "H3XXX initrd", | ||
78 | .size = 0x00100000, | ||
79 | .offset = 0x00100000, | ||
80 | }, { | ||
81 | .name = "H3XXX root cramfs", | ||
82 | .size = 0x00300000, | ||
83 | .offset = 0x00200000, | ||
84 | }, { | ||
85 | .name = "H3XXX usr cramfs", | ||
86 | .size = 0x00800000, | ||
87 | .offset = 0x00500000, | ||
88 | }, { | ||
89 | .name = "H3XXX usr local", | ||
90 | .size = MTDPART_SIZ_FULL, | ||
91 | .offset = 0x00d00000, | ||
92 | #endif | ||
93 | #endif | ||
94 | } | 62 | } |
95 | }; | 63 | }; |
96 | 64 | ||
@@ -124,11 +92,7 @@ static int h3600_irda_set_power(struct device *dev, unsigned int state) | |||
124 | 92 | ||
125 | static void h3600_irda_set_speed(struct device *dev, unsigned int speed) | 93 | static void h3600_irda_set_speed(struct device *dev, unsigned int speed) |
126 | { | 94 | { |
127 | if (speed < 4000000) { | 95 | assign_h3600_egpio(IPAQ_EGPIO_IR_FSEL, !(speed < 4000000)); |
128 | clr_h3600_egpio(IPAQ_EGPIO_IR_FSEL); | ||
129 | } else { | ||
130 | set_h3600_egpio(IPAQ_EGPIO_IR_FSEL); | ||
131 | } | ||
132 | } | 96 | } |
133 | 97 | ||
134 | static struct irda_platform_data h3600_irda_data = { | 98 | static struct irda_platform_data h3600_irda_data = { |
@@ -259,12 +223,6 @@ static void __init h3xxx_map_io(void) | |||
259 | sa1100fb_lcd_power = h3xxx_lcd_power; | 223 | sa1100fb_lcd_power = h3xxx_lcd_power; |
260 | } | 224 | } |
261 | 225 | ||
262 | static __inline__ void do_blank(int setp) | ||
263 | { | ||
264 | if (ipaq_model_ops.blank_callback) | ||
265 | ipaq_model_ops.blank_callback(1-setp); | ||
266 | } | ||
267 | |||
268 | /************************* H3100 *************************/ | 226 | /************************* H3100 *************************/ |
269 | 227 | ||
270 | #ifdef CONFIG_SA1100_H3100 | 228 | #ifdef CONFIG_SA1100_H3100 |
@@ -282,7 +240,6 @@ static void h3100_control_egpio(enum ipaq_egpio_type x, int setp) | |||
282 | case IPAQ_EGPIO_LCD_POWER: | 240 | case IPAQ_EGPIO_LCD_POWER: |
283 | egpio |= EGPIO_H3600_LCD_ON; | 241 | egpio |= EGPIO_H3600_LCD_ON; |
284 | gpio |= GPIO_H3100_LCD_3V_ON; | 242 | gpio |= GPIO_H3100_LCD_3V_ON; |
285 | do_blank(setp); | ||
286 | break; | 243 | break; |
287 | case IPAQ_EGPIO_LCD_ENABLE: | 244 | case IPAQ_EGPIO_LCD_ENABLE: |
288 | break; | 245 | break; |
@@ -336,25 +293,6 @@ static void h3100_control_egpio(enum ipaq_egpio_type x, int setp) | |||
336 | } | 293 | } |
337 | } | 294 | } |
338 | 295 | ||
339 | static unsigned long h3100_read_egpio(void) | ||
340 | { | ||
341 | return h3100_egpio; | ||
342 | } | ||
343 | |||
344 | static int h3100_pm_callback(int req) | ||
345 | { | ||
346 | if (ipaq_model_ops.pm_callback_aux) | ||
347 | return ipaq_model_ops.pm_callback_aux(req); | ||
348 | return 0; | ||
349 | } | ||
350 | |||
351 | static struct ipaq_model_ops h3100_model_ops __initdata = { | ||
352 | .generic_name = "3100", | ||
353 | .control = h3100_control_egpio, | ||
354 | .read = h3100_read_egpio, | ||
355 | .pm_callback = h3100_pm_callback | ||
356 | }; | ||
357 | |||
358 | #define H3100_DIRECT_EGPIO (GPIO_H3100_BT_ON \ | 296 | #define H3100_DIRECT_EGPIO (GPIO_H3100_BT_ON \ |
359 | | GPIO_H3100_GPIO3 \ | 297 | | GPIO_H3100_GPIO3 \ |
360 | | GPIO_H3100_QMUTE \ | 298 | | GPIO_H3100_QMUTE \ |
@@ -380,7 +318,7 @@ static void __init h3100_map_io(void) | |||
380 | GAFR &= ~H3100_DIRECT_EGPIO; | 318 | GAFR &= ~H3100_DIRECT_EGPIO; |
381 | 319 | ||
382 | H3100_EGPIO = h3100_egpio; | 320 | H3100_EGPIO = h3100_egpio; |
383 | ipaq_model_ops = h3100_model_ops; | 321 | assign_h3600_egpio = h3100_control_egpio; |
384 | } | 322 | } |
385 | 323 | ||
386 | MACHINE_START(H3100, "Compaq iPAQ H3100") | 324 | MACHINE_START(H3100, "Compaq iPAQ H3100") |
@@ -413,7 +351,6 @@ static void h3600_control_egpio(enum ipaq_egpio_type x, int setp) | |||
413 | EGPIO_H3600_LCD_PCI | | 351 | EGPIO_H3600_LCD_PCI | |
414 | EGPIO_H3600_LCD_5V_ON | | 352 | EGPIO_H3600_LCD_5V_ON | |
415 | EGPIO_H3600_LVDD_ON; | 353 | EGPIO_H3600_LVDD_ON; |
416 | do_blank(setp); | ||
417 | break; | 354 | break; |
418 | case IPAQ_EGPIO_LCD_ENABLE: | 355 | case IPAQ_EGPIO_LCD_ENABLE: |
419 | break; | 356 | break; |
@@ -464,25 +401,6 @@ static void h3600_control_egpio(enum ipaq_egpio_type x, int setp) | |||
464 | } | 401 | } |
465 | } | 402 | } |
466 | 403 | ||
467 | static unsigned long h3600_read_egpio(void) | ||
468 | { | ||
469 | return h3600_egpio; | ||
470 | } | ||
471 | |||
472 | static int h3600_pm_callback(int req) | ||
473 | { | ||
474 | if (ipaq_model_ops.pm_callback_aux) | ||
475 | return ipaq_model_ops.pm_callback_aux(req); | ||
476 | return 0; | ||
477 | } | ||
478 | |||
479 | static struct ipaq_model_ops h3600_model_ops __initdata = { | ||
480 | .generic_name = "3600", | ||
481 | .control = h3600_control_egpio, | ||
482 | .read = h3600_read_egpio, | ||
483 | .pm_callback = h3600_pm_callback | ||
484 | }; | ||
485 | |||
486 | static void __init h3600_map_io(void) | 404 | static void __init h3600_map_io(void) |
487 | { | 405 | { |
488 | h3xxx_map_io(); | 406 | h3xxx_map_io(); |
@@ -497,7 +415,7 @@ static void __init h3600_map_io(void) | |||
497 | GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8; | 415 | GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8; |
498 | 416 | ||
499 | H3600_EGPIO = h3600_egpio; /* Maintains across sleep? */ | 417 | H3600_EGPIO = h3600_egpio; /* Maintains across sleep? */ |
500 | ipaq_model_ops = h3600_model_ops; | 418 | assign_h3600_egpio = h3600_control_egpio; |
501 | } | 419 | } |
502 | 420 | ||
503 | MACHINE_START(H3600, "Compaq iPAQ H3600") | 421 | MACHINE_START(H3600, "Compaq iPAQ H3600") |
diff --git a/arch/arm/mach-sa1100/include/mach/h3600.h b/arch/arm/mach-sa1100/include/mach/h3600.h index e692ab3dd79f..2827faa47421 100644 --- a/arch/arm/mach-sa1100/include/mach/h3600.h +++ b/arch/arm/mach-sa1100/include/mach/h3600.h | |||
@@ -93,76 +93,7 @@ enum ipaq_egpio_type { | |||
93 | IPAQ_EGPIO_LCD_ENABLE, /* Enable/disable LCD controller */ | 93 | IPAQ_EGPIO_LCD_ENABLE, /* Enable/disable LCD controller */ |
94 | }; | 94 | }; |
95 | 95 | ||
96 | struct ipaq_model_ops { | 96 | extern void (*assign_h3600_egpio)(enum ipaq_egpio_type x, int level); |
97 | const char *generic_name; | ||
98 | void (*control)(enum ipaq_egpio_type, int); | ||
99 | unsigned long (*read)(void); | ||
100 | void (*blank_callback)(int blank); | ||
101 | int (*pm_callback)(int req); /* Primary model callback */ | ||
102 | int (*pm_callback_aux)(int req); /* Secondary callback (used by HAL modules) */ | ||
103 | }; | ||
104 | |||
105 | extern struct ipaq_model_ops ipaq_model_ops; | ||
106 | |||
107 | static __inline__ const char * h3600_generic_name(void) | ||
108 | { | ||
109 | return ipaq_model_ops.generic_name; | ||
110 | } | ||
111 | |||
112 | static __inline__ void assign_h3600_egpio(enum ipaq_egpio_type x, int level) | ||
113 | { | ||
114 | if (ipaq_model_ops.control) | ||
115 | ipaq_model_ops.control(x,level); | ||
116 | } | ||
117 | |||
118 | static __inline__ void clr_h3600_egpio(enum ipaq_egpio_type x) | ||
119 | { | ||
120 | if (ipaq_model_ops.control) | ||
121 | ipaq_model_ops.control(x,0); | ||
122 | } | ||
123 | |||
124 | static __inline__ void set_h3600_egpio(enum ipaq_egpio_type x) | ||
125 | { | ||
126 | if (ipaq_model_ops.control) | ||
127 | ipaq_model_ops.control(x,1); | ||
128 | } | ||
129 | |||
130 | static __inline__ unsigned long read_h3600_egpio(void) | ||
131 | { | ||
132 | if (ipaq_model_ops.read) | ||
133 | return ipaq_model_ops.read(); | ||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | static __inline__ int h3600_register_blank_callback(void (*f)(int)) | ||
138 | { | ||
139 | ipaq_model_ops.blank_callback = f; | ||
140 | return 0; | ||
141 | } | ||
142 | |||
143 | static __inline__ void h3600_unregister_blank_callback(void (*f)(int)) | ||
144 | { | ||
145 | ipaq_model_ops.blank_callback = NULL; | ||
146 | } | ||
147 | |||
148 | |||
149 | static __inline__ int h3600_register_pm_callback(int (*f)(int)) | ||
150 | { | ||
151 | ipaq_model_ops.pm_callback_aux = f; | ||
152 | return 0; | ||
153 | } | ||
154 | |||
155 | static __inline__ void h3600_unregister_pm_callback(int (*f)(int)) | ||
156 | { | ||
157 | ipaq_model_ops.pm_callback_aux = NULL; | ||
158 | } | ||
159 | |||
160 | static __inline__ int h3600_power_management(int req) | ||
161 | { | ||
162 | if (ipaq_model_ops.pm_callback) | ||
163 | return ipaq_model_ops.pm_callback(req); | ||
164 | return 0; | ||
165 | } | ||
166 | 97 | ||
167 | #endif /* ASSEMBLY */ | 98 | #endif /* ASSEMBLY */ |
168 | 99 | ||
diff --git a/arch/arm/mach-sa1100/include/mach/system.h b/arch/arm/mach-sa1100/include/mach/system.h index 63755ca5b1b4..942b153e251d 100644 --- a/arch/arm/mach-sa1100/include/mach/system.h +++ b/arch/arm/mach-sa1100/include/mach/system.h | |||
@@ -10,7 +10,7 @@ static inline void arch_idle(void) | |||
10 | cpu_do_idle(); | 10 | cpu_do_idle(); |
11 | } | 11 | } |
12 | 12 | ||
13 | static inline void arch_reset(char mode) | 13 | static inline void arch_reset(char mode, const char *cmd) |
14 | { | 14 | { |
15 | if (mode == 's') { | 15 | if (mode == 's') { |
16 | /* Jump into ROM at address 0 */ | 16 | /* Jump into ROM at address 0 */ |
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c index 4f3a26512599..358d875ace14 100644 --- a/arch/arm/mach-shark/core.c +++ b/arch/arm/mach-shark/core.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #define ROMCARD_SIZE 0x08000000 | 26 | #define ROMCARD_SIZE 0x08000000 |
27 | #define ROMCARD_START 0x10000000 | 27 | #define ROMCARD_START 0x10000000 |
28 | 28 | ||
29 | void arch_reset(char mode) | 29 | void arch_reset(char mode, const char *cmd) |
30 | { | 30 | { |
31 | short temp; | 31 | short temp; |
32 | local_irq_disable(); | 32 | local_irq_disable(); |
diff --git a/arch/arm/mach-shark/include/mach/system.h b/arch/arm/mach-shark/include/mach/system.h index 0752ca29971a..21c373b30bbc 100644 --- a/arch/arm/mach-shark/include/mach/system.h +++ b/arch/arm/mach-shark/include/mach/system.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #define __ASM_ARCH_SYSTEM_H | 7 | #define __ASM_ARCH_SYSTEM_H |
8 | 8 | ||
9 | /* Found in arch/mach-shark/core.c */ | 9 | /* Found in arch/mach-shark/core.c */ |
10 | extern void arch_reset(char mode); | 10 | extern void arch_reset(char mode, const char *cmd); |
11 | 11 | ||
12 | static inline void arch_idle(void) | 12 | static inline void arch_idle(void) |
13 | { | 13 | { |
diff --git a/arch/arm/mach-versatile/include/mach/system.h b/arch/arm/mach-versatile/include/mach/system.h index c59e6100c7e3..8ffc12a7cb25 100644 --- a/arch/arm/mach-versatile/include/mach/system.h +++ b/arch/arm/mach-versatile/include/mach/system.h | |||
@@ -34,7 +34,7 @@ static inline void arch_idle(void) | |||
34 | cpu_do_idle(); | 34 | cpu_do_idle(); |
35 | } | 35 | } |
36 | 36 | ||
37 | static inline void arch_reset(char mode) | 37 | static inline void arch_reset(char mode, const char *cmd) |
38 | { | 38 | { |
39 | u32 val; | 39 | u32 val; |
40 | 40 | ||
diff --git a/arch/arm/mach-w90x900/include/mach/system.h b/arch/arm/mach-w90x900/include/mach/system.h index 93753f922618..940640066857 100644 --- a/arch/arm/mach-w90x900/include/mach/system.h +++ b/arch/arm/mach-w90x900/include/mach/system.h | |||
@@ -21,7 +21,7 @@ static void arch_idle(void) | |||
21 | { | 21 | { |
22 | } | 22 | } |
23 | 23 | ||
24 | static void arch_reset(char mode) | 24 | static void arch_reset(char mode, const char *cmd) |
25 | { | 25 | { |
26 | cpu_reset(0); | 26 | cpu_reset(0); |
27 | } | 27 | } |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 64086f4f5fcc..a6230f7a24c8 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -715,7 +715,8 @@ config CACHE_FEROCEON_L2_WRITETHROUGH | |||
715 | 715 | ||
716 | config CACHE_L2X0 | 716 | config CACHE_L2X0 |
717 | bool "Enable the L2x0 outer cache controller" | 717 | bool "Enable the L2x0 outer cache controller" |
718 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || REALVIEW_EB_A9MP | 718 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ |
719 | REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 | ||
719 | default y | 720 | default y |
720 | select OUTER_CACHE | 721 | select OUTER_CACHE |
721 | help | 722 | help |
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S index 8a7f65ba14b7..94077fbd96b7 100644 --- a/arch/arm/mm/abort-ev6.S +++ b/arch/arm/mm/abort-ev6.S | |||
@@ -23,7 +23,8 @@ ENTRY(v6_early_abort) | |||
23 | #ifdef CONFIG_CPU_32v6K | 23 | #ifdef CONFIG_CPU_32v6K |
24 | clrex | 24 | clrex |
25 | #else | 25 | #else |
26 | strex r0, r1, [sp] @ Clear the exclusive monitor | 26 | sub r1, sp, #4 @ Get unused stack location |
27 | strex r0, r1, [r1] @ Clear the exclusive monitor | ||
27 | #endif | 28 | #endif |
28 | mrc p15, 0, r1, c5, c0, 0 @ get FSR | 29 | mrc p15, 0, r1, c5, c0, 0 @ get FSR |
29 | mrc p15, 0, r0, c6, c0, 0 @ get FAR | 30 | mrc p15, 0, r0, c6, c0, 0 @ get FAR |
diff --git a/arch/arm/mm/copypage-feroceon.c b/arch/arm/mm/copypage-feroceon.c index c3ba6a94da0c..70997d5bee2d 100644 --- a/arch/arm/mm/copypage-feroceon.c +++ b/arch/arm/mm/copypage-feroceon.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/highmem.h> | 14 | #include <linux/highmem.h> |
15 | 15 | ||
16 | static void __attribute__((naked)) | 16 | static void __naked |
17 | feroceon_copy_user_page(void *kto, const void *kfrom) | 17 | feroceon_copy_user_page(void *kto, const void *kfrom) |
18 | { | 18 | { |
19 | asm("\ | 19 | asm("\ |
diff --git a/arch/arm/mm/copypage-v3.c b/arch/arm/mm/copypage-v3.c index 70ed96c8af8e..de9c06854ad7 100644 --- a/arch/arm/mm/copypage-v3.c +++ b/arch/arm/mm/copypage-v3.c | |||
@@ -15,7 +15,7 @@ | |||
15 | * | 15 | * |
16 | * FIXME: do we need to handle cache stuff... | 16 | * FIXME: do we need to handle cache stuff... |
17 | */ | 17 | */ |
18 | static void __attribute__((naked)) | 18 | static void __naked |
19 | v3_copy_user_page(void *kto, const void *kfrom) | 19 | v3_copy_user_page(void *kto, const void *kfrom) |
20 | { | 20 | { |
21 | asm("\n\ | 21 | asm("\n\ |
diff --git a/arch/arm/mm/copypage-v4mc.c b/arch/arm/mm/copypage-v4mc.c index 1601698b9800..7370a7142b04 100644 --- a/arch/arm/mm/copypage-v4mc.c +++ b/arch/arm/mm/copypage-v4mc.c | |||
@@ -44,7 +44,7 @@ static DEFINE_SPINLOCK(minicache_lock); | |||
44 | * instruction. If your processor does not supply this, you have to write your | 44 | * instruction. If your processor does not supply this, you have to write your |
45 | * own copy_user_highpage that does the right thing. | 45 | * own copy_user_highpage that does the right thing. |
46 | */ | 46 | */ |
47 | static void __attribute__((naked)) | 47 | static void __naked |
48 | mc_copy_user_page(void *from, void *to) | 48 | mc_copy_user_page(void *from, void *to) |
49 | { | 49 | { |
50 | asm volatile( | 50 | asm volatile( |
diff --git a/arch/arm/mm/copypage-v4wb.c b/arch/arm/mm/copypage-v4wb.c index 3ec93dab7656..9ab098414227 100644 --- a/arch/arm/mm/copypage-v4wb.c +++ b/arch/arm/mm/copypage-v4wb.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * instruction. If your processor does not supply this, you have to write your | 22 | * instruction. If your processor does not supply this, you have to write your |
23 | * own copy_user_highpage that does the right thing. | 23 | * own copy_user_highpage that does the right thing. |
24 | */ | 24 | */ |
25 | static void __attribute__((naked)) | 25 | static void __naked |
26 | v4wb_copy_user_page(void *kto, const void *kfrom) | 26 | v4wb_copy_user_page(void *kto, const void *kfrom) |
27 | { | 27 | { |
28 | asm("\ | 28 | asm("\ |
diff --git a/arch/arm/mm/copypage-v4wt.c b/arch/arm/mm/copypage-v4wt.c index 0f1188efae45..300efafd6643 100644 --- a/arch/arm/mm/copypage-v4wt.c +++ b/arch/arm/mm/copypage-v4wt.c | |||
@@ -20,7 +20,7 @@ | |||
20 | * dirty data in the cache. However, we do have to ensure that | 20 | * dirty data in the cache. However, we do have to ensure that |
21 | * subsequent reads are up to date. | 21 | * subsequent reads are up to date. |
22 | */ | 22 | */ |
23 | static void __attribute__((naked)) | 23 | static void __naked |
24 | v4wt_copy_user_page(void *kto, const void *kfrom) | 24 | v4wt_copy_user_page(void *kto, const void *kfrom) |
25 | { | 25 | { |
26 | asm("\ | 26 | asm("\ |
diff --git a/arch/arm/mm/copypage-xsc3.c b/arch/arm/mm/copypage-xsc3.c index 39a994542cad..bc4525f5ab23 100644 --- a/arch/arm/mm/copypage-xsc3.c +++ b/arch/arm/mm/copypage-xsc3.c | |||
@@ -29,7 +29,7 @@ | |||
29 | * if we eventually end up using our copied page. | 29 | * if we eventually end up using our copied page. |
30 | * | 30 | * |
31 | */ | 31 | */ |
32 | static void __attribute__((naked)) | 32 | static void __naked |
33 | xsc3_mc_copy_user_page(void *kto, const void *kfrom) | 33 | xsc3_mc_copy_user_page(void *kto, const void *kfrom) |
34 | { | 34 | { |
35 | asm("\ | 35 | asm("\ |
diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c index d18f2397ee2d..76824d3e966a 100644 --- a/arch/arm/mm/copypage-xscale.c +++ b/arch/arm/mm/copypage-xscale.c | |||
@@ -42,7 +42,7 @@ static DEFINE_SPINLOCK(minicache_lock); | |||
42 | * Dcache aliasing issue. The writes will be forwarded to the write buffer, | 42 | * Dcache aliasing issue. The writes will be forwarded to the write buffer, |
43 | * and merged as appropriate. | 43 | * and merged as appropriate. |
44 | */ | 44 | */ |
45 | static void __attribute__((naked)) | 45 | static void __naked |
46 | mc_copy_user_page(void *from, void *to) | 46 | mc_copy_user_page(void *from, void *to) |
47 | { | 47 | { |
48 | /* | 48 | /* |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 9b36c5cb5e9f..8c6fc5a6237e 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -243,6 +243,10 @@ static struct mem_type mem_types[] = { | |||
243 | .prot_sect = PMD_TYPE_SECT, | 243 | .prot_sect = PMD_TYPE_SECT, |
244 | .domain = DOMAIN_KERNEL, | 244 | .domain = DOMAIN_KERNEL, |
245 | }, | 245 | }, |
246 | [MT_MEMORY_NONCACHED] = { | ||
247 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, | ||
248 | .domain = DOMAIN_KERNEL, | ||
249 | }, | ||
246 | }; | 250 | }; |
247 | 251 | ||
248 | const struct mem_type *get_mem_type(unsigned int type) | 252 | const struct mem_type *get_mem_type(unsigned int type) |
@@ -406,9 +410,28 @@ static void __init build_mem_type_table(void) | |||
406 | kern_pgprot |= L_PTE_SHARED; | 410 | kern_pgprot |= L_PTE_SHARED; |
407 | vecs_pgprot |= L_PTE_SHARED; | 411 | vecs_pgprot |= L_PTE_SHARED; |
408 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; | 412 | mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; |
413 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S; | ||
409 | #endif | 414 | #endif |
410 | } | 415 | } |
411 | 416 | ||
417 | /* | ||
418 | * Non-cacheable Normal - intended for memory areas that must | ||
419 | * not cause dirty cache line writebacks when used | ||
420 | */ | ||
421 | if (cpu_arch >= CPU_ARCH_ARMv6) { | ||
422 | if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) { | ||
423 | /* Non-cacheable Normal is XCB = 001 */ | ||
424 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= | ||
425 | PMD_SECT_BUFFERED; | ||
426 | } else { | ||
427 | /* For both ARMv6 and non-TEX-remapping ARMv7 */ | ||
428 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= | ||
429 | PMD_SECT_TEX(1); | ||
430 | } | ||
431 | } else { | ||
432 | mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_BUFFERABLE; | ||
433 | } | ||
434 | |||
412 | for (i = 0; i < 16; i++) { | 435 | for (i = 0; i < 16; i++) { |
413 | unsigned long v = pgprot_val(protection_map[i]); | 436 | unsigned long v = pgprot_val(protection_map[i]); |
414 | protection_map[i] = __pgprot(v | user_pgprot); | 437 | protection_map[i] = __pgprot(v | user_pgprot); |
@@ -693,7 +716,8 @@ static void __init sanity_check_meminfo(void) | |||
693 | * Check whether this memory bank would entirely overlap | 716 | * Check whether this memory bank would entirely overlap |
694 | * the vmalloc area. | 717 | * the vmalloc area. |
695 | */ | 718 | */ |
696 | if (__va(bank->start) >= VMALLOC_MIN) { | 719 | if (__va(bank->start) >= VMALLOC_MIN || |
720 | __va(bank->start) < PAGE_OFFSET) { | ||
697 | printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx " | 721 | printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx " |
698 | "(vmalloc region overlap).\n", | 722 | "(vmalloc region overlap).\n", |
699 | bank->start, bank->start + bank->size - 1); | 723 | bank->start, bank->start + bank->size - 1); |
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig index 9cc2b16fdf79..17d0e9906d5f 100644 --- a/arch/arm/plat-mxc/Kconfig +++ b/arch/arm/plat-mxc/Kconfig | |||
@@ -3,7 +3,7 @@ if ARCH_MXC | |||
3 | menu "Freescale MXC Implementations" | 3 | menu "Freescale MXC Implementations" |
4 | 4 | ||
5 | choice | 5 | choice |
6 | prompt "MXC/iMX Base Type" | 6 | prompt "Freescale CPU family:" |
7 | default ARCH_MX3 | 7 | default ARCH_MX3 |
8 | 8 | ||
9 | config ARCH_MX1 | 9 | config ARCH_MX1 |
@@ -15,12 +15,14 @@ config ARCH_MX1 | |||
15 | config ARCH_MX2 | 15 | config ARCH_MX2 |
16 | bool "MX2-based" | 16 | bool "MX2-based" |
17 | select CPU_ARM926T | 17 | select CPU_ARM926T |
18 | select COMMON_CLKDEV | ||
18 | help | 19 | help |
19 | This enables support for systems based on the Freescale i.MX2 family | 20 | This enables support for systems based on the Freescale i.MX2 family |
20 | 21 | ||
21 | config ARCH_MX3 | 22 | config ARCH_MX3 |
22 | bool "MX3-based" | 23 | bool "MX3-based" |
23 | select CPU_V6 | 24 | select CPU_V6 |
25 | select COMMON_CLKDEV | ||
24 | help | 26 | help |
25 | This enables support for systems based on the Freescale i.MX3 family | 27 | This enables support for systems based on the Freescale i.MX3 family |
26 | 28 | ||
@@ -43,4 +45,10 @@ config MXC_IRQ_PRIOR | |||
43 | requirements for timing. | 45 | requirements for timing. |
44 | Say N here, unless you have a specialized requirement. | 46 | Say N here, unless you have a specialized requirement. |
45 | 47 | ||
48 | config MXC_PWM | ||
49 | tristate "Enable PWM driver" | ||
50 | depends on ARCH_MXC | ||
51 | help | ||
52 | Enable support for the i.MX PWM controller(s). | ||
53 | |||
46 | endif | 54 | endif |
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile index db74a929179d..564fd4ebf38a 100644 --- a/arch/arm/plat-mxc/Makefile +++ b/arch/arm/plat-mxc/Makefile | |||
@@ -3,7 +3,8 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | # Common support | 5 | # Common support |
6 | obj-y := irq.o clock.o gpio.o time.o devices.o | 6 | obj-y := irq.o clock.o gpio.o time.o devices.o cpu.o |
7 | 7 | ||
8 | obj-$(CONFIG_ARCH_MX1) += iomux-mx1-mx2.o dma-mx1-mx2.o | 8 | obj-$(CONFIG_ARCH_MX1) += iomux-mx1-mx2.o dma-mx1-mx2.o |
9 | obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o | 9 | obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o |
10 | obj-$(CONFIG_MXC_PWM) += pwm.o | ||
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c index 0a38f0b396eb..92e13566cd4f 100644 --- a/arch/arm/plat-mxc/clock.c +++ b/arch/arm/plat-mxc/clock.c | |||
@@ -48,6 +48,11 @@ static DEFINE_MUTEX(clocks_mutex); | |||
48 | *-------------------------------------------------------------------------*/ | 48 | *-------------------------------------------------------------------------*/ |
49 | 49 | ||
50 | /* | 50 | /* |
51 | * All the code inside #ifndef CONFIG_COMMON_CLKDEV can be removed once all | ||
52 | * MXC architectures have switched to using clkdev. | ||
53 | */ | ||
54 | #ifndef CONFIG_COMMON_CLKDEV | ||
55 | /* | ||
51 | * Retrieve a clock by name. | 56 | * Retrieve a clock by name. |
52 | * | 57 | * |
53 | * Note that we first try to use device id on the bus | 58 | * Note that we first try to use device id on the bus |
@@ -110,6 +115,7 @@ found: | |||
110 | return clk; | 115 | return clk; |
111 | } | 116 | } |
112 | EXPORT_SYMBOL(clk_get); | 117 | EXPORT_SYMBOL(clk_get); |
118 | #endif | ||
113 | 119 | ||
114 | static void __clk_disable(struct clk *clk) | 120 | static void __clk_disable(struct clk *clk) |
115 | { | 121 | { |
@@ -187,6 +193,7 @@ unsigned long clk_get_rate(struct clk *clk) | |||
187 | } | 193 | } |
188 | EXPORT_SYMBOL(clk_get_rate); | 194 | EXPORT_SYMBOL(clk_get_rate); |
189 | 195 | ||
196 | #ifndef CONFIG_COMMON_CLKDEV | ||
190 | /* Decrement the clock's module reference count */ | 197 | /* Decrement the clock's module reference count */ |
191 | void clk_put(struct clk *clk) | 198 | void clk_put(struct clk *clk) |
192 | { | 199 | { |
@@ -194,6 +201,7 @@ void clk_put(struct clk *clk) | |||
194 | module_put(clk->owner); | 201 | module_put(clk->owner); |
195 | } | 202 | } |
196 | EXPORT_SYMBOL(clk_put); | 203 | EXPORT_SYMBOL(clk_put); |
204 | #endif | ||
197 | 205 | ||
198 | /* Round the requested clock rate to the nearest supported | 206 | /* Round the requested clock rate to the nearest supported |
199 | * rate that is less than or equal to the requested rate. | 207 | * rate that is less than or equal to the requested rate. |
@@ -257,6 +265,7 @@ struct clk *clk_get_parent(struct clk *clk) | |||
257 | } | 265 | } |
258 | EXPORT_SYMBOL(clk_get_parent); | 266 | EXPORT_SYMBOL(clk_get_parent); |
259 | 267 | ||
268 | #ifndef CONFIG_COMMON_CLKDEV | ||
260 | /* | 269 | /* |
261 | * Add a new clock to the clock tree. | 270 | * Add a new clock to the clock tree. |
262 | */ | 271 | */ |
@@ -327,4 +336,49 @@ static int __init mxc_setup_proc_entry(void) | |||
327 | } | 336 | } |
328 | 337 | ||
329 | late_initcall(mxc_setup_proc_entry); | 338 | late_initcall(mxc_setup_proc_entry); |
339 | #endif /* CONFIG_PROC_FS */ | ||
340 | #endif | ||
341 | |||
342 | /* | ||
343 | * Get the resulting clock rate from a PLL register value and the input | ||
344 | * frequency. PLLs with this register layout can at least be found on | ||
345 | * MX1, MX21, MX27 and MX31 | ||
346 | * | ||
347 | * mfi + mfn / (mfd + 1) | ||
348 | * f = 2 * f_ref * -------------------- | ||
349 | * pd + 1 | ||
350 | */ | ||
351 | unsigned long mxc_decode_pll(unsigned int reg_val, u32 freq) | ||
352 | { | ||
353 | long long ll; | ||
354 | int mfn_abs; | ||
355 | unsigned int mfi, mfn, mfd, pd; | ||
356 | |||
357 | mfi = (reg_val >> 10) & 0xf; | ||
358 | mfn = reg_val & 0x3ff; | ||
359 | mfd = (reg_val >> 16) & 0x3ff; | ||
360 | pd = (reg_val >> 26) & 0xf; | ||
361 | |||
362 | mfi = mfi <= 5 ? 5 : mfi; | ||
363 | |||
364 | mfn_abs = mfn; | ||
365 | |||
366 | #if !defined CONFIG_ARCH_MX1 && !defined CONFIG_ARCH_MX21 | ||
367 | if (mfn >= 0x200) { | ||
368 | mfn |= 0xFFFFFE00; | ||
369 | mfn_abs = -mfn; | ||
370 | } | ||
330 | #endif | 371 | #endif |
372 | |||
373 | freq *= 2; | ||
374 | freq /= pd + 1; | ||
375 | |||
376 | ll = (unsigned long long)freq * mfn_abs; | ||
377 | |||
378 | do_div(ll, mfd + 1); | ||
379 | if (mfn < 0) | ||
380 | ll = -ll; | ||
381 | ll = (freq * mfi) + ll; | ||
382 | |||
383 | return ll; | ||
384 | } | ||
diff --git a/arch/arm/plat-mxc/cpu.c b/arch/arm/plat-mxc/cpu.c new file mode 100644 index 000000000000..386e0d52cf58 --- /dev/null +++ b/arch/arm/plat-mxc/cpu.c | |||
@@ -0,0 +1,11 @@ | |||
1 | |||
2 | #include <linux/module.h> | ||
3 | |||
4 | unsigned int __mxc_cpu_type; | ||
5 | EXPORT_SYMBOL(__mxc_cpu_type); | ||
6 | |||
7 | void mxc_set_cpu_type(unsigned int type) | ||
8 | { | ||
9 | __mxc_cpu_type = type; | ||
10 | } | ||
11 | |||
diff --git a/arch/arm/plat-mxc/devices.c b/arch/arm/plat-mxc/devices.c index c66748267c45..56f2fb5cc456 100644 --- a/arch/arm/plat-mxc/devices.c +++ b/arch/arm/plat-mxc/devices.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <mach/common.h> | ||
22 | 23 | ||
23 | int __init mxc_register_device(struct platform_device *pdev, void *data) | 24 | int __init mxc_register_device(struct platform_device *pdev, void *data) |
24 | { | 25 | { |
diff --git a/arch/arm/plat-mxc/dma-mx1-mx2.c b/arch/arm/plat-mxc/dma-mx1-mx2.c index a9bab15f0fd0..e364a5ed10f1 100644 --- a/arch/arm/plat-mxc/dma-mx1-mx2.c +++ b/arch/arm/plat-mxc/dma-mx1-mx2.c | |||
@@ -802,7 +802,7 @@ static int __init imx_dma_init(void) | |||
802 | int ret = 0; | 802 | int ret = 0; |
803 | int i; | 803 | int i; |
804 | 804 | ||
805 | dma_clk = clk_get(NULL, "dma_clk"); | 805 | dma_clk = clk_get(NULL, "dma"); |
806 | clk_enable(dma_clk); | 806 | clk_enable(dma_clk); |
807 | 807 | ||
808 | /* reset DMA module */ | 808 | /* reset DMA module */ |
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c index ccbd94adc668..c6483bad8a26 100644 --- a/arch/arm/plat-mxc/gpio.c +++ b/arch/arm/plat-mxc/gpio.c | |||
@@ -200,8 +200,8 @@ static int mxc_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | |||
200 | static int mxc_gpio_direction_output(struct gpio_chip *chip, | 200 | static int mxc_gpio_direction_output(struct gpio_chip *chip, |
201 | unsigned offset, int value) | 201 | unsigned offset, int value) |
202 | { | 202 | { |
203 | _set_gpio_direction(chip, offset, 1); | ||
204 | mxc_gpio_set(chip, offset, value); | 203 | mxc_gpio_set(chip, offset, value); |
204 | _set_gpio_direction(chip, offset, 1); | ||
205 | return 0; | 205 | return 0; |
206 | } | 206 | } |
207 | 207 | ||
diff --git a/arch/arm/plat-mxc/include/mach/board-mx27ads.h b/arch/arm/plat-mxc/include/mach/board-mx27ads.h index 8f34a05afc87..1cac9d1135cd 100644 --- a/arch/arm/plat-mxc/include/mach/board-mx27ads.h +++ b/arch/arm/plat-mxc/include/mach/board-mx27ads.h | |||
@@ -48,7 +48,8 @@ | |||
48 | * Base address of PBC controller, CS4 | 48 | * Base address of PBC controller, CS4 |
49 | */ | 49 | */ |
50 | #define PBC_BASE_ADDRESS 0xEB000000 | 50 | #define PBC_BASE_ADDRESS 0xEB000000 |
51 | #define PBC_REG_ADDR(offset) (PBC_BASE_ADDRESS + (offset)) | 51 | #define PBC_REG_ADDR(offset) (void __force __iomem *) \ |
52 | (PBC_BASE_ADDRESS + (offset)) | ||
52 | 53 | ||
53 | /* | 54 | /* |
54 | * PBC Interupt name definitions | 55 | * PBC Interupt name definitions |
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31ads.h b/arch/arm/plat-mxc/include/mach/board-mx31ads.h index 451d510d08c3..318c72ada13d 100644 --- a/arch/arm/plat-mxc/include/mach/board-mx31ads.h +++ b/arch/arm/plat-mxc/include/mach/board-mx31ads.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__ | 11 | #ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__ |
12 | #define __ASM_ARCH_MXC_BOARD_MX31ADS_H__ | 12 | #define __ASM_ARCH_MXC_BOARD_MX31ADS_H__ |
13 | 13 | ||
14 | #include <mach/hardware.h> | ||
15 | |||
14 | /* Base address of PBC controller */ | 16 | /* Base address of PBC controller */ |
15 | #define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR) | 17 | #define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR) |
16 | /* Offsets for the PBC Controller register */ | 18 | /* Offsets for the PBC Controller register */ |
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31moboard.h b/arch/arm/plat-mxc/include/mach/board-mx31moboard.h new file mode 100644 index 000000000000..f8aef1babb75 --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/board-mx31moboard.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group | ||
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; either version 2 | ||
7 | * of the License, or (at your option) any later version. | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
16 | * MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__ | ||
20 | #define __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__ | ||
21 | |||
22 | /* mandatory for CONFIG_LL_DEBUG */ | ||
23 | |||
24 | #define MXC_LL_UART_PADDR UART1_BASE_ADDR | ||
25 | #define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000) | ||
26 | |||
27 | #ifndef __ASSEMBLY__ | ||
28 | |||
29 | enum mx31moboard_boards { | ||
30 | MX31NOBOARD = 0, | ||
31 | MX31DEVBOARD = 1, | ||
32 | MX31MARXBOT = 2, | ||
33 | }; | ||
34 | |||
35 | /* | ||
36 | * This CPU module needs a baseboard to work. After basic initializing | ||
37 | * its own devices, it calls baseboard's init function. | ||
38 | */ | ||
39 | |||
40 | extern void mx31moboard_devboard_init(void); | ||
41 | extern void mx31moboard_marxbot_init(void); | ||
42 | |||
43 | #endif | ||
44 | |||
45 | #endif /* __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__ */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/board-qong.h b/arch/arm/plat-mxc/include/mach/board-qong.h new file mode 100644 index 000000000000..4ff762dd45cf --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/board-qong.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright 2009 Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com> | ||
3 | */ | ||
4 | |||
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 | #ifndef __ASM_ARCH_MXC_BOARD_QONG_H__ | ||
12 | #define __ASM_ARCH_MXC_BOARD_QONG_H__ | ||
13 | |||
14 | /* mandatory for CONFIG_LL_DEBUG */ | ||
15 | |||
16 | #define MXC_LL_UART_PADDR UART1_BASE_ADDR | ||
17 | #define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR) | ||
18 | |||
19 | /* NOR FLASH */ | ||
20 | #define QONG_NOR_SIZE (128*1024*1024) | ||
21 | |||
22 | #endif /* __ASM_ARCH_MXC_BOARD_QONG_H__ */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/clkdev.h b/arch/arm/plat-mxc/include/mach/clkdev.h new file mode 100644 index 000000000000..04b37a89801c --- /dev/null +++ b/arch/arm/plat-mxc/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-mxc/include/mach/clock.h b/arch/arm/plat-mxc/include/mach/clock.h index d21f78e78819..43a82d0c534d 100644 --- a/arch/arm/plat-mxc/include/mach/clock.h +++ b/arch/arm/plat-mxc/include/mach/clock.h | |||
@@ -26,9 +26,13 @@ | |||
26 | struct module; | 26 | struct module; |
27 | 27 | ||
28 | struct clk { | 28 | struct clk { |
29 | #ifndef CONFIG_COMMON_CLKDEV | ||
30 | /* As soon as i.MX1 and i.MX31 switched to clkdev, this | ||
31 | * block can go away */ | ||
29 | struct list_head node; | 32 | struct list_head node; |
30 | struct module *owner; | 33 | struct module *owner; |
31 | const char *name; | 34 | const char *name; |
35 | #endif | ||
32 | int id; | 36 | int id; |
33 | /* Source clock this clk depends on */ | 37 | /* Source clock this clk depends on */ |
34 | struct clk *parent; | 38 | struct clk *parent; |
@@ -63,5 +67,7 @@ struct clk { | |||
63 | int clk_register(struct clk *clk); | 67 | int clk_register(struct clk *clk); |
64 | void clk_unregister(struct clk *clk); | 68 | void clk_unregister(struct clk *clk); |
65 | 69 | ||
70 | unsigned long mxc_decode_pll(unsigned int pll, u32 f_ref); | ||
71 | |||
66 | #endif /* __ASSEMBLY__ */ | 72 | #endif /* __ASSEMBLY__ */ |
67 | #endif /* __ASM_ARCH_MXC_CLOCK_H__ */ | 73 | #endif /* __ASM_ARCH_MXC_CLOCK_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h index 6350287a59b9..b2f9b72644db 100644 --- a/arch/arm/plat-mxc/include/mach/common.h +++ b/arch/arm/plat-mxc/include/mach/common.h | |||
@@ -12,12 +12,18 @@ | |||
12 | #define __ASM_ARCH_MXC_COMMON_H__ | 12 | #define __ASM_ARCH_MXC_COMMON_H__ |
13 | 13 | ||
14 | struct platform_device; | 14 | struct platform_device; |
15 | struct clk; | ||
15 | 16 | ||
16 | extern void mxc_map_io(void); | 17 | extern void mxc_map_io(void); |
17 | extern void mxc_init_irq(void); | 18 | extern void mxc_init_irq(void); |
18 | extern void mxc_timer_init(const char *clk_timer); | 19 | extern void mxc_timer_init(struct clk *timer_clk); |
19 | extern int mxc_clocks_init(unsigned long fref); | 20 | extern int mx1_clocks_init(unsigned long fref); |
21 | extern int mx21_clocks_init(unsigned long lref, unsigned long fref); | ||
22 | extern int mx27_clocks_init(unsigned long fref); | ||
23 | extern int mx31_clocks_init(unsigned long fref); | ||
24 | extern int mx35_clocks_init(void); | ||
20 | extern int mxc_register_gpios(void); | 25 | extern int mxc_register_gpios(void); |
21 | extern int mxc_register_device(struct platform_device *pdev, void *data); | 26 | extern int mxc_register_device(struct platform_device *pdev, void *data); |
27 | extern void mxc_set_cpu_type(unsigned int type); | ||
22 | 28 | ||
23 | #endif | 29 | #endif |
diff --git a/arch/arm/plat-mxc/include/mach/debug-macro.S b/arch/arm/plat-mxc/include/mach/debug-macro.S index 602768b427e2..4f773148bc20 100644 --- a/arch/arm/plat-mxc/include/mach/debug-macro.S +++ b/arch/arm/plat-mxc/include/mach/debug-macro.S | |||
@@ -31,6 +31,9 @@ | |||
31 | #ifdef CONFIG_MACH_MX31_3DS | 31 | #ifdef CONFIG_MACH_MX31_3DS |
32 | #include <mach/board-mx31pdk.h> | 32 | #include <mach/board-mx31pdk.h> |
33 | #endif | 33 | #endif |
34 | #ifdef CONFIG_MACH_QONG | ||
35 | #include <mach/board-qong.h> | ||
36 | #endif | ||
34 | .macro addruart,rx | 37 | .macro addruart,rx |
35 | mrc p15, 0, \rx, c1, c0 | 38 | mrc p15, 0, \rx, c1, c0 |
36 | tst \rx, #1 @ MMU enabled? | 39 | tst \rx, #1 @ MMU enabled? |
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h index a612d8bb73c8..42e4ee37ca1f 100644 --- a/arch/arm/plat-mxc/include/mach/hardware.h +++ b/arch/arm/plat-mxc/include/mach/hardware.h | |||
@@ -23,10 +23,16 @@ | |||
23 | #include <asm/sizes.h> | 23 | #include <asm/sizes.h> |
24 | 24 | ||
25 | #ifdef CONFIG_ARCH_MX3 | 25 | #ifdef CONFIG_ARCH_MX3 |
26 | # include <mach/mx31.h> | 26 | #include <mach/mx3x.h> |
27 | #include <mach/mx31.h> | ||
28 | #include <mach/mx35.h> | ||
27 | #endif | 29 | #endif |
28 | 30 | ||
29 | #ifdef CONFIG_ARCH_MX2 | 31 | #ifdef CONFIG_ARCH_MX2 |
32 | # include <mach/mx2x.h> | ||
33 | # ifdef CONFIG_MACH_MX21 | ||
34 | # include <mach/mx21.h> | ||
35 | # endif | ||
30 | # ifdef CONFIG_MACH_MX27 | 36 | # ifdef CONFIG_MACH_MX27 |
31 | # include <mach/mx27.h> | 37 | # include <mach/mx27.h> |
32 | # endif | 38 | # endif |
diff --git a/arch/arm/mach-imx/include/mach/imxfb.h b/arch/arm/plat-mxc/include/mach/imxfb.h index 870d0d939616..762a7b0430e2 100644 --- a/arch/arm/mach-imx/include/mach/imxfb.h +++ b/arch/arm/plat-mxc/include/mach/imxfb.h | |||
@@ -76,6 +76,9 @@ struct imx_fb_platform_data { | |||
76 | u_char * fixed_screen_cpu; | 76 | u_char * fixed_screen_cpu; |
77 | dma_addr_t fixed_screen_dma; | 77 | dma_addr_t fixed_screen_dma; |
78 | 78 | ||
79 | int (*init)(struct platform_device*); | ||
80 | int (*exit)(struct platform_device*); | ||
81 | |||
79 | void (*lcd_power)(int); | 82 | void (*lcd_power)(int); |
80 | void (*backlight_power)(int); | 83 | void (*backlight_power)(int); |
81 | }; | 84 | }; |
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h b/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h deleted file mode 100644 index 95a383be628e..000000000000 --- a/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h +++ /dev/null | |||
@@ -1,416 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 by Sascha Hauer <kernel@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; either version 2 | ||
7 | * of the License, or (at your option) any later version. | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
16 | * MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef _MXC_GPIO_MX1_MX2_H | ||
20 | #define _MXC_GPIO_MX1_MX2_H | ||
21 | |||
22 | #include <linux/io.h> | ||
23 | |||
24 | /* | ||
25 | * GPIO Module and I/O Multiplexer | ||
26 | * x = 0..3 for reg_A, reg_B, reg_C, reg_D | ||
27 | */ | ||
28 | #define VA_GPIO_BASE IO_ADDRESS(GPIO_BASE_ADDR) | ||
29 | #define MXC_DDIR(x) (0x00 + ((x) << 8)) | ||
30 | #define MXC_OCR1(x) (0x04 + ((x) << 8)) | ||
31 | #define MXC_OCR2(x) (0x08 + ((x) << 8)) | ||
32 | #define MXC_ICONFA1(x) (0x0c + ((x) << 8)) | ||
33 | #define MXC_ICONFA2(x) (0x10 + ((x) << 8)) | ||
34 | #define MXC_ICONFB1(x) (0x14 + ((x) << 8)) | ||
35 | #define MXC_ICONFB2(x) (0x18 + ((x) << 8)) | ||
36 | #define MXC_DR(x) (0x1c + ((x) << 8)) | ||
37 | #define MXC_GIUS(x) (0x20 + ((x) << 8)) | ||
38 | #define MXC_SSR(x) (0x24 + ((x) << 8)) | ||
39 | #define MXC_ICR1(x) (0x28 + ((x) << 8)) | ||
40 | #define MXC_ICR2(x) (0x2c + ((x) << 8)) | ||
41 | #define MXC_IMR(x) (0x30 + ((x) << 8)) | ||
42 | #define MXC_ISR(x) (0x34 + ((x) << 8)) | ||
43 | #define MXC_GPR(x) (0x38 + ((x) << 8)) | ||
44 | #define MXC_SWR(x) (0x3c + ((x) << 8)) | ||
45 | #define MXC_PUEN(x) (0x40 + ((x) << 8)) | ||
46 | |||
47 | #ifdef CONFIG_ARCH_MX1 | ||
48 | # define GPIO_PORT_MAX 3 | ||
49 | #endif | ||
50 | #ifdef CONFIG_ARCH_MX2 | ||
51 | # define GPIO_PORT_MAX 5 | ||
52 | #endif | ||
53 | |||
54 | #ifndef GPIO_PORT_MAX | ||
55 | # error "GPIO config port count unknown!" | ||
56 | #endif | ||
57 | |||
58 | #define GPIO_PIN_MASK 0x1f | ||
59 | |||
60 | #define GPIO_PORT_SHIFT 5 | ||
61 | #define GPIO_PORT_MASK (0x7 << GPIO_PORT_SHIFT) | ||
62 | |||
63 | #define GPIO_PORTA (0 << GPIO_PORT_SHIFT) | ||
64 | #define GPIO_PORTB (1 << GPIO_PORT_SHIFT) | ||
65 | #define GPIO_PORTC (2 << GPIO_PORT_SHIFT) | ||
66 | #define GPIO_PORTD (3 << GPIO_PORT_SHIFT) | ||
67 | #define GPIO_PORTE (4 << GPIO_PORT_SHIFT) | ||
68 | #define GPIO_PORTF (5 << GPIO_PORT_SHIFT) | ||
69 | |||
70 | #define GPIO_OUT (1 << 8) | ||
71 | #define GPIO_IN (0 << 8) | ||
72 | #define GPIO_PUEN (1 << 9) | ||
73 | |||
74 | #define GPIO_PF (1 << 10) | ||
75 | #define GPIO_AF (1 << 11) | ||
76 | |||
77 | #define GPIO_OCR_SHIFT 12 | ||
78 | #define GPIO_OCR_MASK (3 << GPIO_OCR_SHIFT) | ||
79 | #define GPIO_AIN (0 << GPIO_OCR_SHIFT) | ||
80 | #define GPIO_BIN (1 << GPIO_OCR_SHIFT) | ||
81 | #define GPIO_CIN (2 << GPIO_OCR_SHIFT) | ||
82 | #define GPIO_GPIO (3 << GPIO_OCR_SHIFT) | ||
83 | |||
84 | #define GPIO_AOUT_SHIFT 14 | ||
85 | #define GPIO_AOUT_MASK (3 << GPIO_AOUT_SHIFT) | ||
86 | #define GPIO_AOUT (0 << GPIO_AOUT_SHIFT) | ||
87 | #define GPIO_AOUT_ISR (1 << GPIO_AOUT_SHIFT) | ||
88 | #define GPIO_AOUT_0 (2 << GPIO_AOUT_SHIFT) | ||
89 | #define GPIO_AOUT_1 (3 << GPIO_AOUT_SHIFT) | ||
90 | |||
91 | #define GPIO_BOUT_SHIFT 16 | ||
92 | #define GPIO_BOUT_MASK (3 << GPIO_BOUT_SHIFT) | ||
93 | #define GPIO_BOUT (0 << GPIO_BOUT_SHIFT) | ||
94 | #define GPIO_BOUT_ISR (1 << GPIO_BOUT_SHIFT) | ||
95 | #define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT) | ||
96 | #define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT) | ||
97 | |||
98 | extern void mxc_gpio_mode(int gpio_mode); | ||
99 | extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count, | ||
100 | const char *label); | ||
101 | extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count); | ||
102 | |||
103 | /*-------------------------------------------------------------------------*/ | ||
104 | |||
105 | /* assignements for GPIO alternate/primary functions */ | ||
106 | |||
107 | /* FIXME: This list is not completed. The correct directions are | ||
108 | * missing on some (many) pins | ||
109 | */ | ||
110 | #ifdef CONFIG_ARCH_MX1 | ||
111 | #define PA0_AIN_SPI2_CLK (GPIO_PORTA | GPIO_OUT | 0) | ||
112 | #define PA0_AF_ETMTRACESYNC (GPIO_PORTA | GPIO_AF | 0) | ||
113 | #define PA1_AOUT_SPI2_RXD (GPIO_PORTA | GPIO_IN | 1) | ||
114 | #define PA1_PF_TIN (GPIO_PORTA | GPIO_PF | 1) | ||
115 | #define PA2_PF_PWM0 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 2) | ||
116 | #define PA3_PF_CSI_MCLK (GPIO_PORTA | GPIO_PF | 3) | ||
117 | #define PA4_PF_CSI_D0 (GPIO_PORTA | GPIO_PF | 4) | ||
118 | #define PA5_PF_CSI_D1 (GPIO_PORTA | GPIO_PF | 5) | ||
119 | #define PA6_PF_CSI_D2 (GPIO_PORTA | GPIO_PF | 6) | ||
120 | #define PA7_PF_CSI_D3 (GPIO_PORTA | GPIO_PF | 7) | ||
121 | #define PA8_PF_CSI_D4 (GPIO_PORTA | GPIO_PF | 8) | ||
122 | #define PA9_PF_CSI_D5 (GPIO_PORTA | GPIO_PF | 9) | ||
123 | #define PA10_PF_CSI_D6 (GPIO_PORTA | GPIO_PF | 10) | ||
124 | #define PA11_PF_CSI_D7 (GPIO_PORTA | GPIO_PF | 11) | ||
125 | #define PA12_PF_CSI_VSYNC (GPIO_PORTA | GPIO_PF | 12) | ||
126 | #define PA13_PF_CSI_HSYNC (GPIO_PORTA | GPIO_PF | 13) | ||
127 | #define PA14_PF_CSI_PIXCLK (GPIO_PORTA | GPIO_PF | 14) | ||
128 | #define PA15_PF_I2C_SDA (GPIO_PORTA | GPIO_OUT | GPIO_PF | 15) | ||
129 | #define PA16_PF_I2C_SCL (GPIO_PORTA | GPIO_OUT | GPIO_PF | 16) | ||
130 | #define PA17_AF_ETMTRACEPKT4 (GPIO_PORTA | GPIO_AF | 17) | ||
131 | #define PA17_AIN_SPI2_SS (GPIO_PORTA | GPIO_OUT | 17) | ||
132 | #define PA18_AF_ETMTRACEPKT5 (GPIO_PORTA | GPIO_AF | 18) | ||
133 | #define PA19_AF_ETMTRACEPKT6 (GPIO_PORTA | GPIO_AF | 19) | ||
134 | #define PA20_AF_ETMTRACEPKT7 (GPIO_PORTA | GPIO_AF | 20) | ||
135 | #define PA21_PF_A0 (GPIO_PORTA | GPIO_PF | 21) | ||
136 | #define PA22_PF_CS4 (GPIO_PORTA | GPIO_PF | 22) | ||
137 | #define PA23_PF_CS5 (GPIO_PORTA | GPIO_PF | 23) | ||
138 | #define PA24_PF_A16 (GPIO_PORTA | GPIO_PF | 24) | ||
139 | #define PA24_AF_ETMTRACEPKT0 (GPIO_PORTA | GPIO_AF | 24) | ||
140 | #define PA25_PF_A17 (GPIO_PORTA | GPIO_PF | 25) | ||
141 | #define PA25_AF_ETMTRACEPKT1 (GPIO_PORTA | GPIO_AF | 25) | ||
142 | #define PA26_PF_A18 (GPIO_PORTA | GPIO_PF | 26) | ||
143 | #define PA26_AF_ETMTRACEPKT2 (GPIO_PORTA | GPIO_AF | 26) | ||
144 | #define PA27_PF_A19 (GPIO_PORTA | GPIO_PF | 27) | ||
145 | #define PA27_AF_ETMTRACEPKT3 (GPIO_PORTA | GPIO_AF | 27) | ||
146 | #define PA28_PF_A20 (GPIO_PORTA | GPIO_PF | 28) | ||
147 | #define PA28_AF_ETMPIPESTAT0 (GPIO_PORTA | GPIO_AF | 28) | ||
148 | #define PA29_PF_A21 (GPIO_PORTA | GPIO_PF | 29) | ||
149 | #define PA29_AF_ETMPIPESTAT1 (GPIO_PORTA | GPIO_AF | 29) | ||
150 | #define PA30_PF_A22 (GPIO_PORTA | GPIO_PF | 30) | ||
151 | #define PA30_AF_ETMPIPESTAT2 (GPIO_PORTA | GPIO_AF | 30) | ||
152 | #define PA31_PF_A23 (GPIO_PORTA | GPIO_PF | 31) | ||
153 | #define PA31_AF_ETMTRACECLK (GPIO_PORTA | GPIO_AF | 31) | ||
154 | #define PB8_PF_SD_DAT0 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 8) | ||
155 | #define PB8_AF_MS_PIO (GPIO_PORTB | GPIO_AF | 8) | ||
156 | #define PB9_PF_SD_DAT1 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 9) | ||
157 | #define PB9_AF_MS_PI1 (GPIO_PORTB | GPIO_AF | 9) | ||
158 | #define PB10_PF_SD_DAT2 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10) | ||
159 | #define PB10_AF_MS_SCLKI (GPIO_PORTB | GPIO_AF | 10) | ||
160 | #define PB11_PF_SD_DAT3 (GPIO_PORTB | GPIO_PF | 11) | ||
161 | #define PB11_AF_MS_SDIO (GPIO_PORTB | GPIO_AF | 11) | ||
162 | #define PB12_PF_SD_CLK (GPIO_PORTB | GPIO_PF | 12) | ||
163 | #define PB12_AF_MS_SCLK0 (GPIO_PORTB | GPIO_AF | 12) | ||
164 | #define PB13_PF_SD_CMD (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 13) | ||
165 | #define PB13_AF_MS_BS (GPIO_PORTB | GPIO_AF | 13) | ||
166 | #define PB14_AF_SSI_RXFS (GPIO_PORTB | GPIO_AF | 14) | ||
167 | #define PB15_AF_SSI_RXCLK (GPIO_PORTB | GPIO_AF | 15) | ||
168 | #define PB16_AF_SSI_RXDAT (GPIO_PORTB | GPIO_IN | GPIO_AF | 16) | ||
169 | #define PB17_AF_SSI_TXDAT (GPIO_PORTB | GPIO_OUT | GPIO_AF | 17) | ||
170 | #define PB18_AF_SSI_TXFS (GPIO_PORTB | GPIO_AF | 18) | ||
171 | #define PB19_AF_SSI_TXCLK (GPIO_PORTB | GPIO_AF | 19) | ||
172 | #define PB20_PF_USBD_AFE (GPIO_PORTB | GPIO_PF | 20) | ||
173 | #define PB21_PF_USBD_OE (GPIO_PORTB | GPIO_PF | 21) | ||
174 | #define PB22_PFUSBD_RCV (GPIO_PORTB | GPIO_PF | 22) | ||
175 | #define PB23_PF_USBD_SUSPND (GPIO_PORTB | GPIO_PF | 23) | ||
176 | #define PB24_PF_USBD_VP (GPIO_PORTB | GPIO_PF | 24) | ||
177 | #define PB25_PF_USBD_VM (GPIO_PORTB | GPIO_PF | 25) | ||
178 | #define PB26_PF_USBD_VPO (GPIO_PORTB | GPIO_PF | 26) | ||
179 | #define PB27_PF_USBD_VMO (GPIO_PORTB | GPIO_PF | 27) | ||
180 | #define PB28_PF_UART2_CTS (GPIO_PORTB | GPIO_OUT | GPIO_PF | 28) | ||
181 | #define PB29_PF_UART2_RTS (GPIO_PORTB | GPIO_IN | GPIO_PF | 29) | ||
182 | #define PB30_PF_UART2_TXD (GPIO_PORTB | GPIO_OUT | GPIO_PF | 30) | ||
183 | #define PB31_PF_UART2_RXD (GPIO_PORTB | GPIO_IN | GPIO_PF | 31) | ||
184 | #define PC3_PF_SSI_RXFS (GPIO_PORTC | GPIO_PF | 3) | ||
185 | #define PC4_PF_SSI_RXCLK (GPIO_PORTC | GPIO_PF | 4) | ||
186 | #define PC5_PF_SSI_RXDAT (GPIO_PORTC | GPIO_IN | GPIO_PF | 5) | ||
187 | #define PC6_PF_SSI_TXDAT (GPIO_PORTC | GPIO_OUT | GPIO_PF | 6) | ||
188 | #define PC7_PF_SSI_TXFS (GPIO_PORTC | GPIO_PF | 7) | ||
189 | #define PC8_PF_SSI_TXCLK (GPIO_PORTC | GPIO_PF | 8) | ||
190 | #define PC9_PF_UART1_CTS (GPIO_PORTC | GPIO_OUT | GPIO_PF | 9) | ||
191 | #define PC10_PF_UART1_RTS (GPIO_PORTC | GPIO_IN | GPIO_PF | 10) | ||
192 | #define PC11_PF_UART1_TXD (GPIO_PORTC | GPIO_OUT | GPIO_PF | 11) | ||
193 | #define PC12_PF_UART1_RXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 12) | ||
194 | #define PC13_PF_SPI1_SPI_RDY (GPIO_PORTC | GPIO_PF | 13) | ||
195 | #define PC14_PF_SPI1_SCLK (GPIO_PORTC | GPIO_PF | 14) | ||
196 | #define PC15_PF_SPI1_SS (GPIO_PORTC | GPIO_PF | 15) | ||
197 | #define PC16_PF_SPI1_MISO (GPIO_PORTC | GPIO_PF | 16) | ||
198 | #define PC17_PF_SPI1_MOSI (GPIO_PORTC | GPIO_PF | 17) | ||
199 | #define PC24_BIN_UART3_RI (GPIO_PORTC | GPIO_OUT | GPIO_BIN | 24) | ||
200 | #define PC25_BIN_UART3_DSR (GPIO_PORTC | GPIO_OUT | GPIO_BIN | 25) | ||
201 | #define PC26_AOUT_UART3_DTR (GPIO_PORTC | GPIO_IN | 26) | ||
202 | #define PC27_BIN_UART3_DCD (GPIO_PORTC | GPIO_OUT | GPIO_BIN | 27) | ||
203 | #define PC28_BIN_UART3_CTS (GPIO_PORTC | GPIO_OUT | GPIO_BIN | 28) | ||
204 | #define PC29_AOUT_UART3_RTS (GPIO_PORTC | GPIO_IN | 29) | ||
205 | #define PC30_BIN_UART3_TX (GPIO_PORTC | GPIO_BIN | 30) | ||
206 | #define PC31_AOUT_UART3_RX (GPIO_PORTC | GPIO_IN | 31) | ||
207 | #define PD6_PF_LSCLK (GPIO_PORTD | GPIO_OUT | GPIO_PF | 6) | ||
208 | #define PD7_PF_REV (GPIO_PORTD | GPIO_PF | 7) | ||
209 | #define PD7_AF_UART2_DTR (GPIO_PORTD | GPIO_IN | GPIO_AF | 7) | ||
210 | #define PD7_AIN_SPI2_SCLK (GPIO_PORTD | GPIO_AIN | 7) | ||
211 | #define PD8_PF_CLS (GPIO_PORTD | GPIO_PF | 8) | ||
212 | #define PD8_AF_UART2_DCD (GPIO_PORTD | GPIO_OUT | GPIO_AF | 8) | ||
213 | #define PD8_AIN_SPI2_SS (GPIO_PORTD | GPIO_AIN | 8) | ||
214 | #define PD9_PF_PS (GPIO_PORTD | GPIO_PF | 9) | ||
215 | #define PD9_AF_UART2_RI (GPIO_PORTD | GPIO_OUT | GPIO_AF | 9) | ||
216 | #define PD9_AOUT_SPI2_RXD (GPIO_PORTD | GPIO_IN | 9) | ||
217 | #define PD10_PF_SPL_SPR (GPIO_PORTD | GPIO_OUT | GPIO_PF | 10) | ||
218 | #define PD10_AF_UART2_DSR (GPIO_PORTD | GPIO_OUT | GPIO_AF | 10) | ||
219 | #define PD10_AIN_SPI2_TXD (GPIO_PORTD | GPIO_OUT | 10) | ||
220 | #define PD11_PF_CONTRAST (GPIO_PORTD | GPIO_OUT | GPIO_PF | 11) | ||
221 | #define PD12_PF_ACD_OE (GPIO_PORTD | GPIO_OUT | GPIO_PF | 12) | ||
222 | #define PD13_PF_LP_HSYNC (GPIO_PORTD | GPIO_OUT | GPIO_PF | 13) | ||
223 | #define PD14_PF_FLM_VSYNC (GPIO_PORTD | GPIO_OUT | GPIO_PF | 14) | ||
224 | #define PD15_PF_LD0 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 15) | ||
225 | #define PD16_PF_LD1 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 16) | ||
226 | #define PD17_PF_LD2 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 17) | ||
227 | #define PD18_PF_LD3 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 18) | ||
228 | #define PD19_PF_LD4 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 19) | ||
229 | #define PD20_PF_LD5 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 20) | ||
230 | #define PD21_PF_LD6 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 21) | ||
231 | #define PD22_PF_LD7 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 22) | ||
232 | #define PD23_PF_LD8 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 23) | ||
233 | #define PD24_PF_LD9 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 24) | ||
234 | #define PD25_PF_LD10 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 25) | ||
235 | #define PD26_PF_LD11 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 26) | ||
236 | #define PD27_PF_LD12 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 27) | ||
237 | #define PD28_PF_LD13 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 28) | ||
238 | #define PD29_PF_LD14 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 29) | ||
239 | #define PD30_PF_LD15 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 30) | ||
240 | #define PD31_PF_TMR2OUT (GPIO_PORTD | GPIO_PF | 31) | ||
241 | #define PD31_BIN_SPI2_TXD (GPIO_PORTD | GPIO_BIN | 31) | ||
242 | #endif | ||
243 | |||
244 | #ifdef CONFIG_ARCH_MX2 | ||
245 | #define PA0_PF_USBH2_CLK (GPIO_PORTA | GPIO_PF | 0) | ||
246 | #define PA1_PF_USBH2_DIR (GPIO_PORTA | GPIO_PF | 1) | ||
247 | #define PA2_PF_USBH2_DATA7 (GPIO_PORTA | GPIO_PF | 2) | ||
248 | #define PA3_PF_USBH2_NXT (GPIO_PORTA | GPIO_PF | 3) | ||
249 | #define PA4_PF_USBH2_STP (GPIO_PORTA | GPIO_PF | 4) | ||
250 | #define PA5_PF_LSCLK (GPIO_PORTA | GPIO_OUT | GPIO_PF | 5) | ||
251 | #define PA6_PF_LD0 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 6) | ||
252 | #define PA7_PF_LD1 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 7) | ||
253 | #define PA8_PF_LD2 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 8) | ||
254 | #define PA9_PF_LD3 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 9) | ||
255 | #define PA10_PF_LD4 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 10) | ||
256 | #define PA11_PF_LD5 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 11) | ||
257 | #define PA12_PF_LD6 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 12) | ||
258 | #define PA13_PF_LD7 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 13) | ||
259 | #define PA14_PF_LD8 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 14) | ||
260 | #define PA15_PF_LD9 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 15) | ||
261 | #define PA16_PF_LD10 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 16) | ||
262 | #define PA17_PF_LD11 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 17) | ||
263 | #define PA18_PF_LD12 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 18) | ||
264 | #define PA19_PF_LD13 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 19) | ||
265 | #define PA20_PF_LD14 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 20) | ||
266 | #define PA21_PF_LD15 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 21) | ||
267 | #define PA22_PF_LD16 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 22) | ||
268 | #define PA23_PF_LD17 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 23) | ||
269 | #define PA24_PF_REV (GPIO_PORTA | GPIO_OUT | GPIO_PF | 24) | ||
270 | #define PA25_PF_CLS (GPIO_PORTA | GPIO_OUT | GPIO_PF | 25) | ||
271 | #define PA26_PF_PS (GPIO_PORTA | GPIO_OUT | GPIO_PF | 26) | ||
272 | #define PA27_PF_SPL_SPR (GPIO_PORTA | GPIO_OUT | GPIO_PF | 27) | ||
273 | #define PA28_PF_HSYNC (GPIO_PORTA | GPIO_OUT | GPIO_PF | 28) | ||
274 | #define PA29_PF_VSYNC (GPIO_PORTA | GPIO_OUT | GPIO_PF | 29) | ||
275 | #define PA30_PF_CONTRAST (GPIO_PORTA | GPIO_OUT | GPIO_PF | 30) | ||
276 | #define PA31_PF_OE_ACD (GPIO_PORTA | GPIO_OUT | GPIO_PF | 31) | ||
277 | #define PB4_PF_SD2_D0 (GPIO_PORTB | GPIO_PF | 4) | ||
278 | #define PB5_PF_SD2_D1 (GPIO_PORTB | GPIO_PF | 5) | ||
279 | #define PB6_PF_SD2_D2 (GPIO_PORTB | GPIO_PF | 6) | ||
280 | #define PB7_PF_SD2_D3 (GPIO_PORTB | GPIO_PF | 7) | ||
281 | #define PB8_PF_SD2_CMD (GPIO_PORTB | GPIO_PF | 8) | ||
282 | #define PB9_PF_SD2_CLK (GPIO_PORTB | GPIO_PF | 9) | ||
283 | #define PB10_PF_CSI_D0 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 10) | ||
284 | #define PB10_AF_UART6_TXD (GPIO_PORTB | GPIO_OUT | GPIO_AF | 10) | ||
285 | #define PB11_PF_CSI_D1 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 11) | ||
286 | #define PB11_AF_UART6_RXD (GPIO_PORTB | GPIO_IN | GPIO_AF | 11) | ||
287 | #define PB12_PF_CSI_D2 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 12) | ||
288 | #define PB12_AF_UART6_CTS (GPIO_PORTB | GPIO_OUT | GPIO_AF | 12) | ||
289 | #define PB13_PF_CSI_D3 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 13) | ||
290 | #define PB13_AF_UART6_RTS (GPIO_PORTB | GPIO_IN | GPIO_AF | 13) | ||
291 | #define PB14_PF_CSI_D4 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 14) | ||
292 | #define PB15_PF_CSI_MCLK (GPIO_PORTB | GPIO_OUT | GPIO_PF | 15) | ||
293 | #define PB16_PF_CSI_PIXCLK (GPIO_PORTB | GPIO_OUT | GPIO_PF | 16) | ||
294 | #define PB17_PF_CSI_D5 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 17) | ||
295 | #define PB18_PF_CSI_D6 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 18) | ||
296 | #define PB18_AF_UART5_TXD (GPIO_PORTB | GPIO_OUT | GPIO_AF | 18) | ||
297 | #define PB19_PF_CSI_D7 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 19) | ||
298 | #define PB19_AF_UART5_RXD (GPIO_PORTB | GPIO_IN | GPIO_AF | 19) | ||
299 | #define PB20_PF_CSI_VSYNC (GPIO_PORTB | GPIO_OUT | GPIO_PF | 20) | ||
300 | #define PB20_AF_UART5_CTS (GPIO_PORTB | GPIO_OUT | GPIO_AF | 20) | ||
301 | #define PB21_PF_CSI_HSYNC (GPIO_PORTB | GPIO_OUT | GPIO_PF | 21) | ||
302 | #define PB21_AF_UART5_RTS (GPIO_PORTB | GPIO_IN | GPIO_AF | 21) | ||
303 | #define PB22_PF_USBH1_SUSP (GPIO_PORTB | GPIO_PF | 22) | ||
304 | #define PB23_PF_USB_PWR (GPIO_PORTB | GPIO_PF | 23) | ||
305 | #define PB24_PF_USB_OC_B (GPIO_PORTB | GPIO_PF | 24) | ||
306 | #define PB25_PF_USBH1_RCV (GPIO_PORTB | GPIO_PF | 25) | ||
307 | #define PB26_PF_USBH1_FS (GPIO_PORTB | GPIO_PF | 26) | ||
308 | #define PB27_PF_USBH1_OE_B (GPIO_PORTB | GPIO_PF | 27) | ||
309 | #define PB28_PF_USBH1_TXDM (GPIO_PORTB | GPIO_PF | 28) | ||
310 | #define PB29_PF_USBH1_TXDP (GPIO_PORTB | GPIO_PF | 29) | ||
311 | #define PB30_PF_USBH1_RXDM (GPIO_PORTB | GPIO_PF | 30) | ||
312 | #define PB31_PF_USBH1_RXDP (GPIO_PORTB | GPIO_PF | 31) | ||
313 | #define PB26_AF_UART4_RTS (GPIO_PORTB | GPIO_IN | GPIO_PF | 26) | ||
314 | #define PB28_AF_UART4_TXD (GPIO_PORTB | GPIO_OUT | GPIO_AF | 28) | ||
315 | #define PB29_AF_UART4_CTS (GPIO_PORTB | GPIO_OUT | GPIO_AF | 29) | ||
316 | #define PB31_AF_UART4_RXD (GPIO_PORTB | GPIO_IN | GPIO_AF | 31) | ||
317 | #define PC5_PF_I2C2_SDA (GPIO_PORTC | GPIO_IN | GPIO_PF | 5) | ||
318 | #define PC6_PF_I2C2_SCL (GPIO_PORTC | GPIO_IN | GPIO_PF | 6) | ||
319 | #define PC7_PF_USBOTG_DATA5 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 7) | ||
320 | #define PC8_PF_USBOTG_DATA6 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 8) | ||
321 | #define PC9_PF_USBOTG_DATA0 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 9) | ||
322 | #define PC10_PF_USBOTG_DATA2 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 10) | ||
323 | #define PC11_PF_USBOTG_DATA1 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 11) | ||
324 | #define PC12_PF_USBOTG_DATA4 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 12) | ||
325 | #define PC13_PF_USBOTG_DATA3 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 13) | ||
326 | #define PC16_PF_SSI4_FS (GPIO_PORTC | GPIO_IN | GPIO_PF | 16) | ||
327 | #define PC17_PF_SSI4_RXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 17) | ||
328 | #define PC18_PF_SSI4_TXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 18) | ||
329 | #define PC19_PF_SSI4_CLK (GPIO_PORTC | GPIO_IN | GPIO_PF | 19) | ||
330 | #define PC20_PF_SSI1_FS (GPIO_PORTC | GPIO_IN | GPIO_PF | 20) | ||
331 | #define PC21_PF_SSI1_RXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 21) | ||
332 | #define PC22_PF_SSI1_TXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 22) | ||
333 | #define PC23_PF_SSI1_CLK (GPIO_PORTC | GPIO_IN | GPIO_PF | 23) | ||
334 | #define PC24_PF_SSI2_FS (GPIO_PORTC | GPIO_IN | GPIO_PF | 24) | ||
335 | #define PC25_PF_SSI2_RXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 25) | ||
336 | #define PC26_PF_SSI2_TXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 26) | ||
337 | #define PC27_PF_SSI2_CLK (GPIO_PORTC | GPIO_IN | GPIO_PF | 27) | ||
338 | #define PC28_PF_SSI3_FS (GPIO_PORTC | GPIO_IN | GPIO_PF | 28) | ||
339 | #define PC29_PF_SSI3_RXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 29) | ||
340 | #define PC30_PF_SSI3_TXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 30) | ||
341 | #define PC31_PF_SSI3_CLK (GPIO_PORTC | GPIO_IN | GPIO_PF | 31) | ||
342 | #define PD0_AIN_FEC_TXD0 (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 0) | ||
343 | #define PD1_AIN_FEC_TXD1 (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 1) | ||
344 | #define PD2_AIN_FEC_TXD2 (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 2) | ||
345 | #define PD3_AIN_FEC_TXD3 (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 3) | ||
346 | #define PD4_AOUT_FEC_RX_ER (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 4) | ||
347 | #define PD5_AOUT_FEC_RXD1 (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 5) | ||
348 | #define PD6_AOUT_FEC_RXD2 (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 6) | ||
349 | #define PD7_AOUT_FEC_RXD3 (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 7) | ||
350 | #define PD8_AF_FEC_MDIO (GPIO_PORTD | GPIO_IN | GPIO_AF | 8) | ||
351 | #define PD9_AIN_FEC_MDC (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 9) | ||
352 | #define PD10_AOUT_FEC_CRS (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 10) | ||
353 | #define PD11_AOUT_FEC_TX_CLK (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 11) | ||
354 | #define PD12_AOUT_FEC_RXD0 (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 12) | ||
355 | #define PD13_AOUT_FEC_RX_DV (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 13) | ||
356 | #define PD14_AOUT_FEC_CLR (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 14) | ||
357 | #define PD15_AOUT_FEC_COL (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 15) | ||
358 | #define PD16_AIN_FEC_TX_ER (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 16) | ||
359 | #define PD17_PF_I2C_DATA (GPIO_PORTD | GPIO_OUT | GPIO_PF | 17) | ||
360 | #define PD18_PF_I2C_CLK (GPIO_PORTD | GPIO_OUT | GPIO_PF | 18) | ||
361 | #define PD19_AF_USBH2_DATA4 (GPIO_PORTD | GPIO_AF | 19) | ||
362 | #define PD20_AF_USBH2_DATA3 (GPIO_PORTD | GPIO_AF | 20) | ||
363 | #define PD21_AF_USBH2_DATA6 (GPIO_PORTD | GPIO_AF | 21) | ||
364 | #define PD22_AF_USBH2_DATA0 (GPIO_PORTD | GPIO_AF | 22) | ||
365 | #define PD23_AF_USBH2_DATA2 (GPIO_PORTD | GPIO_AF | 23) | ||
366 | #define PD24_AF_USBH2_DATA1 (GPIO_PORTD | GPIO_AF | 24) | ||
367 | #define PD25_PF_CSPI1_RDY (GPIO_PORTD | GPIO_OUT | GPIO_PF | 25) | ||
368 | #define PD26_PF_CSPI1_SS2 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 26) | ||
369 | #define PD26_AF_USBH2_DATA5 (GPIO_PORTD | GPIO_AF | 26) | ||
370 | #define PD27_PF_CSPI1_SS1 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 27) | ||
371 | #define PD28_PF_CSPI1_SS0 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 28) | ||
372 | #define PD29_PF_CSPI1_SCLK (GPIO_PORTD | GPIO_OUT | GPIO_PF | 29) | ||
373 | #define PD30_PF_CSPI1_MISO (GPIO_PORTD | GPIO_IN | GPIO_PF | 30) | ||
374 | #define PD31_PF_CSPI1_MOSI (GPIO_PORTD | GPIO_OUT | GPIO_PF | 31) | ||
375 | #define PF23_AIN_FEC_TX_EN (GPIO_PORTF | GPIO_OUT | GPIO_AIN | 23) | ||
376 | #define PE0_PF_USBOTG_NXT (GPIO_PORTE | GPIO_OUT | GPIO_PF | 0) | ||
377 | #define PE1_PF_USBOTG_STP (GPIO_PORTE | GPIO_OUT | GPIO_PF | 1) | ||
378 | #define PE2_PF_USBOTG_DIR (GPIO_PORTE | GPIO_OUT | GPIO_PF | 2) | ||
379 | #define PE3_PF_UART2_CTS (GPIO_PORTE | GPIO_OUT | GPIO_PF | 3) | ||
380 | #define PE4_PF_UART2_RTS (GPIO_PORTE | GPIO_IN | GPIO_PF | 4) | ||
381 | #define PE6_PF_UART2_TXD (GPIO_PORTE | GPIO_OUT | GPIO_PF | 6) | ||
382 | #define PE7_PF_UART2_RXD (GPIO_PORTE | GPIO_IN | GPIO_PF | 7) | ||
383 | #define PE8_PF_UART3_TXD (GPIO_PORTE | GPIO_OUT | GPIO_PF | 8) | ||
384 | #define PE9_PF_UART3_RXD (GPIO_PORTE | GPIO_IN | GPIO_PF | 9) | ||
385 | #define PE10_PF_UART3_CTS (GPIO_PORTE | GPIO_OUT | GPIO_PF | 10) | ||
386 | #define PE11_PF_UART3_RTS (GPIO_PORTE | GPIO_IN | GPIO_PF | 11) | ||
387 | #define PE12_PF_UART1_TXD (GPIO_PORTE | GPIO_OUT | GPIO_PF | 12) | ||
388 | #define PE13_PF_UART1_RXD (GPIO_PORTE | GPIO_IN | GPIO_PF | 13) | ||
389 | #define PE14_PF_UART1_CTS (GPIO_PORTE | GPIO_OUT | GPIO_PF | 14) | ||
390 | #define PE15_PF_UART1_RTS (GPIO_PORTE | GPIO_IN | GPIO_PF | 15) | ||
391 | #define PE16_AF_RTCK (GPIO_PORTE | GPIO_OUT | GPIO_AF | 16) | ||
392 | #define PE16_PF_RTCK (GPIO_PORTE | GPIO_OUT | GPIO_PF | 16) | ||
393 | #define PE18_PF_SDHC1_D0 (GPIO_PORTE | GPIO_PF | 18) | ||
394 | #define PE18_AF_CSPI3_MISO (GPIO_PORTE | GPIO_IN | GPIO_AF | 18) | ||
395 | #define PE19_PF_SDHC1_D1 (GPIO_PORTE | GPIO_PF | 19) | ||
396 | #define PE20_PF_SDHC1_D2 (GPIO_PORTE | GPIO_PF | 20) | ||
397 | #define PE21_PF_SDHC1_D3 (GPIO_PORTE | GPIO_PF | 21) | ||
398 | #define PE21_AF_CSPI3_SS (GPIO_PORTE | GPIO_OUT | GPIO_AF | 21) | ||
399 | #define PE22_PF_SDHC1_CMD (GPIO_PORTE | GPIO_PF | 22) | ||
400 | #define PE22_AF_CSPI3_MOSI (GPIO_PORTE | GPIO_OUT | GPIO_AF | 22) | ||
401 | #define PE22_PF_SDHC1_CLK (GPIO_PORTE | GPIO_PF | 23) | ||
402 | #define PE23_AF_CSPI3_SCLK (GPIO_PORTE | GPIO_OUT | GPIO_AF | 23) | ||
403 | #define PE24_PF_USBOTG_CLK (GPIO_PORTE | GPIO_OUT | GPIO_PF | 24) | ||
404 | #define PE25_PF_USBOTG_DATA7 (GPIO_PORTE | GPIO_OUT | GPIO_PF | 25) | ||
405 | #endif | ||
406 | |||
407 | /* decode irq number to use with IMR(x), ISR(x) and friends */ | ||
408 | #define IRQ_TO_REG(irq) ((irq - MXC_INTERNAL_IRQS) >> 5) | ||
409 | |||
410 | #define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x) | ||
411 | #define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x) | ||
412 | #define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x) | ||
413 | #define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x) | ||
414 | #define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x) | ||
415 | |||
416 | #endif /* _MXC_GPIO_MX1_MX2_H */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx1.h b/arch/arm/plat-mxc/include/mach/iomux-mx1.h new file mode 100644 index 000000000000..bf23305c19cc --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/iomux-mx1.h | |||
@@ -0,0 +1,166 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 by Sascha Hauer <kernel@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; either version 2 | ||
7 | * of the License, or (at your option) any later version. | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
16 | * MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef _MXC_IOMUX_MX1_H | ||
20 | #define _MXC_IOMUX_MX1_H | ||
21 | |||
22 | #ifndef GPIO_PORTA | ||
23 | #error Please include mach/iomux.h | ||
24 | #endif | ||
25 | |||
26 | /* FIXME: This list is not completed. The correct directions are | ||
27 | * missing on some (many) pins | ||
28 | */ | ||
29 | |||
30 | |||
31 | /* Primary GPIO pin functions */ | ||
32 | |||
33 | #define PA0_AIN_SPI2_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0) | ||
34 | #define PA0_AF_ETMTRACESYNC (GPIO_PORTA | GPIO_AF | 0) | ||
35 | #define PA1_AOUT_SPI2_RXD (GPIO_PORTA | GPIO_AOUT | GPIO_IN | 1) | ||
36 | #define PA1_PF_TIN (GPIO_PORTA | GPIO_PF | 1) | ||
37 | #define PA2_PF_PWM0 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 2) | ||
38 | #define PA3_PF_CSI_MCLK (GPIO_PORTA | GPIO_PF | 3) | ||
39 | #define PA4_PF_CSI_D0 (GPIO_PORTA | GPIO_PF | 4) | ||
40 | #define PA5_PF_CSI_D1 (GPIO_PORTA | GPIO_PF | 5) | ||
41 | #define PA6_PF_CSI_D2 (GPIO_PORTA | GPIO_PF | 6) | ||
42 | #define PA7_PF_CSI_D3 (GPIO_PORTA | GPIO_PF | 7) | ||
43 | #define PA8_PF_CSI_D4 (GPIO_PORTA | GPIO_PF | 8) | ||
44 | #define PA9_PF_CSI_D5 (GPIO_PORTA | GPIO_PF | 9) | ||
45 | #define PA10_PF_CSI_D6 (GPIO_PORTA | GPIO_PF | 10) | ||
46 | #define PA11_PF_CSI_D7 (GPIO_PORTA | GPIO_PF | 11) | ||
47 | #define PA12_PF_CSI_VSYNC (GPIO_PORTA | GPIO_PF | 12) | ||
48 | #define PA13_PF_CSI_HSYNC (GPIO_PORTA | GPIO_PF | 13) | ||
49 | #define PA14_PF_CSI_PIXCLK (GPIO_PORTA | GPIO_PF | 14) | ||
50 | #define PA15_PF_I2C_SDA (GPIO_PORTA | GPIO_PF | GPIO_OUT | 15) | ||
51 | #define PA16_PF_I2C_SCL (GPIO_PORTA | GPIO_PF | GPIO_OUT | 16) | ||
52 | #define PA17_AF_ETMTRACEPKT4 (GPIO_PORTA | GPIO_AF | 17) | ||
53 | #define PA17_AIN_SPI2_SS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 17) | ||
54 | #define PA18_AF_ETMTRACEPKT5 (GPIO_PORTA | GPIO_AF | 18) | ||
55 | #define PA19_AF_ETMTRACEPKT6 (GPIO_PORTA | GPIO_AF | 19) | ||
56 | #define PA20_AF_ETMTRACEPKT7 (GPIO_PORTA | GPIO_AF | 20) | ||
57 | #define PA21_PF_A0 (GPIO_PORTA | GPIO_PF | 21) | ||
58 | #define PA22_PF_CS4 (GPIO_PORTA | GPIO_PF | 22) | ||
59 | #define PA23_PF_CS5 (GPIO_PORTA | GPIO_PF | 23) | ||
60 | #define PA24_PF_A16 (GPIO_PORTA | GPIO_PF | 24) | ||
61 | #define PA24_AF_ETMTRACEPKT0 (GPIO_PORTA | GPIO_AF | 24) | ||
62 | #define PA25_PF_A17 (GPIO_PORTA | GPIO_PF | 25) | ||
63 | #define PA25_AF_ETMTRACEPKT1 (GPIO_PORTA | GPIO_AF | 25) | ||
64 | #define PA26_PF_A18 (GPIO_PORTA | GPIO_PF | 26) | ||
65 | #define PA26_AF_ETMTRACEPKT2 (GPIO_PORTA | GPIO_AF | 26) | ||
66 | #define PA27_PF_A19 (GPIO_PORTA | GPIO_PF | 27) | ||
67 | #define PA27_AF_ETMTRACEPKT3 (GPIO_PORTA | GPIO_AF | 27) | ||
68 | #define PA28_PF_A20 (GPIO_PORTA | GPIO_PF | 28) | ||
69 | #define PA28_AF_ETMPIPESTAT0 (GPIO_PORTA | GPIO_AF | 28) | ||
70 | #define PA29_PF_A21 (GPIO_PORTA | GPIO_PF | 29) | ||
71 | #define PA29_AF_ETMPIPESTAT1 (GPIO_PORTA | GPIO_AF | 29) | ||
72 | #define PA30_PF_A22 (GPIO_PORTA | GPIO_PF | 30) | ||
73 | #define PA30_AF_ETMPIPESTAT2 (GPIO_PORTA | GPIO_AF | 30) | ||
74 | #define PA31_PF_A23 (GPIO_PORTA | GPIO_PF | 31) | ||
75 | #define PA31_AF_ETMTRACECLK (GPIO_PORTA | GPIO_AF | 31) | ||
76 | #define PB8_PF_SD_DAT0 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 8) | ||
77 | #define PB8_AF_MS_PIO (GPIO_PORTB | GPIO_AF | 8) | ||
78 | #define PB9_PF_SD_DAT1 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 9) | ||
79 | #define PB9_AF_MS_PI1 (GPIO_PORTB | GPIO_AF | 9) | ||
80 | #define PB10_PF_SD_DAT2 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10) | ||
81 | #define PB10_AF_MS_SCLKI (GPIO_PORTB | GPIO_AF | 10) | ||
82 | #define PB11_PF_SD_DAT3 (GPIO_PORTB | GPIO_PF | 11) | ||
83 | #define PB11_AF_MS_SDIO (GPIO_PORTB | GPIO_AF | 11) | ||
84 | #define PB12_PF_SD_CLK (GPIO_PORTB | GPIO_PF | 12) | ||
85 | #define PB12_AF_MS_SCLK0 (GPIO_PORTB | GPIO_AF | 12) | ||
86 | #define PB13_PF_SD_CMD (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 13) | ||
87 | #define PB13_AF_MS_BS (GPIO_PORTB | GPIO_AF | 13) | ||
88 | #define PB14_AF_SSI_RXFS (GPIO_PORTB | GPIO_AF | 14) | ||
89 | #define PB15_AF_SSI_RXCLK (GPIO_PORTB | GPIO_AF | 15) | ||
90 | #define PB16_AF_SSI_RXDAT (GPIO_PORTB | GPIO_AF | GPIO_IN | 16) | ||
91 | #define PB17_AF_SSI_TXDAT (GPIO_PORTB | GPIO_AF | GPIO_OUT | 17) | ||
92 | #define PB18_AF_SSI_TXFS (GPIO_PORTB | GPIO_AF | 18) | ||
93 | #define PB19_AF_SSI_TXCLK (GPIO_PORTB | GPIO_AF | 19) | ||
94 | #define PB20_PF_USBD_AFE (GPIO_PORTB | GPIO_PF | 20) | ||
95 | #define PB21_PF_USBD_OE (GPIO_PORTB | GPIO_PF | 21) | ||
96 | #define PB22_PF_USBD_RCV (GPIO_PORTB | GPIO_PF | 22) | ||
97 | #define PB23_PF_USBD_SUSPND (GPIO_PORTB | GPIO_PF | 23) | ||
98 | #define PB24_PF_USBD_VP (GPIO_PORTB | GPIO_PF | 24) | ||
99 | #define PB25_PF_USBD_VM (GPIO_PORTB | GPIO_PF | 25) | ||
100 | #define PB26_PF_USBD_VPO (GPIO_PORTB | GPIO_PF | 26) | ||
101 | #define PB27_PF_USBD_VMO (GPIO_PORTB | GPIO_PF | 27) | ||
102 | #define PB28_PF_UART2_CTS (GPIO_PORTB | GPIO_PF | GPIO_OUT | 28) | ||
103 | #define PB29_PF_UART2_RTS (GPIO_PORTB | GPIO_PF | GPIO_IN | 29) | ||
104 | #define PB30_PF_UART2_TXD (GPIO_PORTB | GPIO_PF | GPIO_OUT | 30) | ||
105 | #define PB31_PF_UART2_RXD (GPIO_PORTB | GPIO_PF | GPIO_IN | 31) | ||
106 | #define PC3_PF_SSI_RXFS (GPIO_PORTC | GPIO_PF | 3) | ||
107 | #define PC4_PF_SSI_RXCLK (GPIO_PORTC | GPIO_PF | 4) | ||
108 | #define PC5_PF_SSI_RXDAT (GPIO_PORTC | GPIO_PF | GPIO_IN | 5) | ||
109 | #define PC6_PF_SSI_TXDAT (GPIO_PORTC | GPIO_PF | GPIO_OUT | 6) | ||
110 | #define PC7_PF_SSI_TXFS (GPIO_PORTC | GPIO_PF | 7) | ||
111 | #define PC8_PF_SSI_TXCLK (GPIO_PORTC | GPIO_PF | 8) | ||
112 | #define PC9_PF_UART1_CTS (GPIO_PORTC | GPIO_PF | GPIO_OUT | 9) | ||
113 | #define PC10_PF_UART1_RTS (GPIO_PORTC | GPIO_PF | GPIO_IN | 10) | ||
114 | #define PC11_PF_UART1_TXD (GPIO_PORTC | GPIO_PF | GPIO_OUT | 11) | ||
115 | #define PC12_PF_UART1_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 12) | ||
116 | #define PC13_PF_SPI1_SPI_RDY (GPIO_PORTC | GPIO_PF | 13) | ||
117 | #define PC14_PF_SPI1_SCLK (GPIO_PORTC | GPIO_PF | 14) | ||
118 | #define PC15_PF_SPI1_SS (GPIO_PORTC | GPIO_PF | 15) | ||
119 | #define PC16_PF_SPI1_MISO (GPIO_PORTC | GPIO_PF | 16) | ||
120 | #define PC17_PF_SPI1_MOSI (GPIO_PORTC | GPIO_PF | 17) | ||
121 | #define PC24_BIN_UART3_RI (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 24) | ||
122 | #define PC25_BIN_UART3_DSR (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 25) | ||
123 | #define PC26_AOUT_UART3_DTR (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 26) | ||
124 | #define PC27_BIN_UART3_DCD (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 27) | ||
125 | #define PC28_BIN_UART3_CTS (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 28) | ||
126 | #define PC29_AOUT_UART3_RTS (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 29) | ||
127 | #define PC30_BIN_UART3_TX (GPIO_PORTC | GPIO_BIN | 30) | ||
128 | #define PC31_AOUT_UART3_RX (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 31) | ||
129 | #define PD6_PF_LSCLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 6) | ||
130 | #define PD7_PF_REV (GPIO_PORTD | GPIO_PF | 7) | ||
131 | #define PD7_AF_UART2_DTR (GPIO_PORTD | GPIO_AF | GPIO_IN | 7) | ||
132 | #define PD7_AIN_SPI2_SCLK (GPIO_PORTD | GPIO_AIN | 7) | ||
133 | #define PD8_PF_CLS (GPIO_PORTD | GPIO_PF | 8) | ||
134 | #define PD8_AF_UART2_DCD (GPIO_PORTD | GPIO_AF | GPIO_OUT | 8) | ||
135 | #define PD8_AIN_SPI2_SS (GPIO_PORTD | GPIO_AIN | 8) | ||
136 | #define PD9_PF_PS (GPIO_PORTD | GPIO_PF | 9) | ||
137 | #define PD9_AF_UART2_RI (GPIO_PORTD | GPIO_AF | GPIO_OUT | 9) | ||
138 | #define PD9_AOUT_SPI2_RXD (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 9) | ||
139 | #define PD10_PF_SPL_SPR (GPIO_PORTD | GPIO_PF | GPIO_OUT | 10) | ||
140 | #define PD10_AF_UART2_DSR (GPIO_PORTD | GPIO_AF | GPIO_OUT | 10) | ||
141 | #define PD10_AIN_SPI2_TXD (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 10) | ||
142 | #define PD11_PF_CONTRAST (GPIO_PORTD | GPIO_PF | GPIO_OUT | 11) | ||
143 | #define PD12_PF_ACD_OE (GPIO_PORTD | GPIO_PF | GPIO_OUT | 12) | ||
144 | #define PD13_PF_LP_HSYNC (GPIO_PORTD | GPIO_PF | GPIO_OUT | 13) | ||
145 | #define PD14_PF_FLM_VSYNC (GPIO_PORTD | GPIO_PF | GPIO_OUT | 14) | ||
146 | #define PD15_PF_LD0 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 15) | ||
147 | #define PD16_PF_LD1 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 16) | ||
148 | #define PD17_PF_LD2 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 17) | ||
149 | #define PD18_PF_LD3 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 18) | ||
150 | #define PD19_PF_LD4 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 19) | ||
151 | #define PD20_PF_LD5 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 20) | ||
152 | #define PD21_PF_LD6 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 21) | ||
153 | #define PD22_PF_LD7 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 22) | ||
154 | #define PD23_PF_LD8 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 23) | ||
155 | #define PD24_PF_LD9 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 24) | ||
156 | #define PD25_PF_LD10 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 25) | ||
157 | #define PD26_PF_LD11 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 26) | ||
158 | #define PD27_PF_LD12 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 27) | ||
159 | #define PD28_PF_LD13 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 28) | ||
160 | #define PD29_PF_LD14 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 29) | ||
161 | #define PD30_PF_LD15 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 30) | ||
162 | #define PD31_PF_TMR2OUT (GPIO_PORTD | GPIO_PF | 31) | ||
163 | #define PD31_BIN_SPI2_TXD (GPIO_PORTD | GPIO_BIN | 31) | ||
164 | |||
165 | |||
166 | #endif | ||
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx21.h b/arch/arm/plat-mxc/include/mach/iomux-mx21.h new file mode 100644 index 000000000000..63aaa972e275 --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/iomux-mx21.h | |||
@@ -0,0 +1,126 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.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; either version 2 | ||
7 | * of the License, or (at your option) any later version. | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
16 | * MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef _MXC_IOMUX_MX21_H | ||
20 | #define _MXC_IOMUX_MX21_H | ||
21 | |||
22 | #ifndef GPIO_PORTA | ||
23 | #error Please include mach/iomux.h | ||
24 | #endif | ||
25 | |||
26 | |||
27 | /* Primary GPIO pin functions */ | ||
28 | |||
29 | #define PB22_PF_USBH1_BYP (GPIO_PORTB | GPIO_PF | 22) | ||
30 | #define PB25_PF_USBH1_ON (GPIO_PORTB | GPIO_PF | 25) | ||
31 | #define PC5_PF_USBOTG_SDA (GPIO_PORTC | GPIO_PF | 5) | ||
32 | #define PC6_PF_USBOTG_SCL (GPIO_PORTC | GPIO_PF | 6) | ||
33 | #define PC7_PF_USBOTG_ON (GPIO_PORTC | GPIO_PF | 7) | ||
34 | #define PC8_PF_USBOTG_FS (GPIO_PORTC | GPIO_PF | 8) | ||
35 | #define PC9_PF_USBOTG_OE (GPIO_PORTC | GPIO_PF | 9) | ||
36 | #define PC10_PF_USBOTG_TXDM (GPIO_PORTC | GPIO_PF | 10) | ||
37 | #define PC11_PF_USBOTG_TXDP (GPIO_PORTC | GPIO_PF | 11) | ||
38 | #define PC12_PF_USBOTG_RXDM (GPIO_PORTC | GPIO_PF | 12) | ||
39 | #define PC13_PF_USBOTG_RXDP (GPIO_PORTC | GPIO_PF | 13) | ||
40 | #define PC16_PF_SAP_FS (GPIO_PORTC | GPIO_PF | 16) | ||
41 | #define PC17_PF_SAP_RXD (GPIO_PORTC | GPIO_PF | 17) | ||
42 | #define PC18_PF_SAP_TXD (GPIO_PORTC | GPIO_PF | 18) | ||
43 | #define PC19_PF_SAP_CLK (GPIO_PORTC | GPIO_PF | 19) | ||
44 | #define PE0_PF_TEST_WB2 (GPIO_PORTE | GPIO_PF | 0) | ||
45 | #define PE1_PF_TEST_WB1 (GPIO_PORTE | GPIO_PF | 1) | ||
46 | #define PE2_PF_TEST_WB0 (GPIO_PORTE | GPIO_PF | 2) | ||
47 | #define PF1_PF_NFCE (GPIO_PORTF | GPIO_PF | 1) | ||
48 | #define PF3_PF_NFCLE (GPIO_PORTF | GPIO_PF | 3) | ||
49 | #define PF7_PF_NFIO0 (GPIO_PORTF | GPIO_PF | 7) | ||
50 | #define PF8_PF_NFIO1 (GPIO_PORTF | GPIO_PF | 8) | ||
51 | #define PF9_PF_NFIO2 (GPIO_PORTF | GPIO_PF | 9) | ||
52 | #define PF10_PF_NFIO3 (GPIO_PORTF | GPIO_PF | 10) | ||
53 | #define PF11_PF_NFIO4 (GPIO_PORTF | GPIO_PF | 11) | ||
54 | #define PF12_PF_NFIO5 (GPIO_PORTF | GPIO_PF | 12) | ||
55 | #define PF13_PF_NFIO6 (GPIO_PORTF | GPIO_PF | 13) | ||
56 | #define PF14_PF_NFIO7 (GPIO_PORTF | GPIO_PF | 14) | ||
57 | #define PF16_PF_RES (GPIO_PORTF | GPIO_PF | 16) | ||
58 | |||
59 | /* Alternate GPIO pin functions */ | ||
60 | |||
61 | #define PA5_AF_BMI_CLK_CS (GPIO_PORTA | GPIO_AF | 5) | ||
62 | #define PA6_AF_BMI_D0 (GPIO_PORTA | GPIO_AF | 6) | ||
63 | #define PA7_AF_BMI_D1 (GPIO_PORTA | GPIO_AF | 7) | ||
64 | #define PA8_AF_BMI_D2 (GPIO_PORTA | GPIO_AF | 8) | ||
65 | #define PA9_AF_BMI_D3 (GPIO_PORTA | GPIO_AF | 9) | ||
66 | #define PA10_AF_BMI_D4 (GPIO_PORTA | GPIO_AF | 10) | ||
67 | #define PA11_AF_BMI_D5 (GPIO_PORTA | GPIO_AF | 11) | ||
68 | #define PA12_AF_BMI_D6 (GPIO_PORTA | GPIO_AF | 12) | ||
69 | #define PA13_AF_BMI_D7 (GPIO_PORTA | GPIO_AF | 13) | ||
70 | #define PA14_AF_BMI_D8 (GPIO_PORTA | GPIO_AF | 14) | ||
71 | #define PA15_AF_BMI_D9 (GPIO_PORTA | GPIO_AF | 15) | ||
72 | #define PA16_AF_BMI_D10 (GPIO_PORTA | GPIO_AF | 16) | ||
73 | #define PA17_AF_BMI_D11 (GPIO_PORTA | GPIO_AF | 17) | ||
74 | #define PA18_AF_BMI_D12 (GPIO_PORTA | GPIO_AF | 18) | ||
75 | #define PA19_AF_BMI_D13 (GPIO_PORTA | GPIO_AF | 19) | ||
76 | #define PA20_AF_BMI_D14 (GPIO_PORTA | GPIO_AF | 20) | ||
77 | #define PA21_AF_BMI_D15 (GPIO_PORTA | GPIO_AF | 21) | ||
78 | #define PA22_AF_BMI_READ_REQ (GPIO_PORTA | GPIO_AF | 22) | ||
79 | #define PA23_AF_BMI_WRITE (GPIO_PORTA | GPIO_AF | 23) | ||
80 | #define PA29_AF_BMI_RX_FULL (GPIO_PORTA | GPIO_AF | 29) | ||
81 | #define PA30_AF_BMI_READ (GPIO_PORTA | GPIO_AF | 30) | ||
82 | |||
83 | /* AIN GPIO pin functions */ | ||
84 | |||
85 | #define PC14_AIN_SYS_CLK (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 14) | ||
86 | #define PD21_AIN_USBH2_FS (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 21) | ||
87 | #define PD22_AIN_USBH2_OE (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 22) | ||
88 | #define PD23_AIN_USBH2_TXDM (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 23) | ||
89 | #define PD24_AIN_USBH2_TXDP (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 24) | ||
90 | #define PE8_AIN_IR_TXD (GPIO_PORTE | GPIO_AIN | GPIO_OUT | 8) | ||
91 | #define PF0_AIN_PC_RST (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 0) | ||
92 | #define PF1_AIN_PC_CE1 (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 1) | ||
93 | #define PF2_AIN_PC_CE2 (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 2) | ||
94 | #define PF3_AIN_PC_POE (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 3) | ||
95 | #define PF4_AIN_PC_OE (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 4) | ||
96 | #define PF5_AIN_PC_RW (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 5) | ||
97 | |||
98 | /* BIN GPIO pin functions */ | ||
99 | |||
100 | #define PC14_BIN_SYS_CLK (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 14) | ||
101 | #define PD27_BIN_EXT_DMA_GRANT (GPIO_PORTD | GPIO_BIN | GPIO_OUT | 27) | ||
102 | |||
103 | /* CIN GPIO pin functions */ | ||
104 | |||
105 | #define PB26_CIN_USBH1_RXDAT (GPIO_PORTB | GPIO_CIN | GPIO_OUT | 26) | ||
106 | |||
107 | /* AOUT GPIO pin functions */ | ||
108 | |||
109 | #define PA29_AOUT_BMI_WAIT (GPIO_PORTA | GPIO_AOUT | GPIO_IN | 29) | ||
110 | #define PD19_AOUT_USBH2_RXDM (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 19) | ||
111 | #define PD20_AOUT_USBH2_RXDP (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 20) | ||
112 | #define PD25_AOUT_EXT_DMAREQ (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 25) | ||
113 | #define PD26_AOUT_USBOTG_RXDAT (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 26) | ||
114 | #define PE9_AOUT_IR_RXD (GPIO_PORTE | GPIO_AOUT | GPIO_IN | 9) | ||
115 | #define PF6_AOUT_PC_BVD2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 6) | ||
116 | #define PF7_AOUT_PC_BVD1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 7) | ||
117 | #define PF8_AOUT_PC_VS2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 8) | ||
118 | #define PF9_AOUT_PC_VS1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 9) | ||
119 | #define PF10_AOUT_PC_WP (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 10) | ||
120 | #define PF11_AOUT_PC_READY (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 11) | ||
121 | #define PF12_AOUT_PC_WAIT (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 12) | ||
122 | #define PF13_AOUT_PC_CD2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 13) | ||
123 | #define PF14_AOUT_PC_CD1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 14) | ||
124 | |||
125 | |||
126 | #endif | ||
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx27.h b/arch/arm/plat-mxc/include/mach/iomux-mx27.h new file mode 100644 index 000000000000..5ac158b70f61 --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/iomux-mx27.h | |||
@@ -0,0 +1,207 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> | ||
3 | * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
17 | * MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef _MXC_IOMUX_MX27_H | ||
21 | #define _MXC_IOMUX_MX27_H | ||
22 | |||
23 | #ifndef GPIO_PORTA | ||
24 | #error Please include mach/iomux.h | ||
25 | #endif | ||
26 | |||
27 | |||
28 | /* Primary GPIO pin functions */ | ||
29 | |||
30 | #define PA0_PF_USBH2_CLK (GPIO_PORTA | GPIO_PF | 0) | ||
31 | #define PA1_PF_USBH2_DIR (GPIO_PORTA | GPIO_PF | 1) | ||
32 | #define PA2_PF_USBH2_DATA7 (GPIO_PORTA | GPIO_PF | 2) | ||
33 | #define PA3_PF_USBH2_NXT (GPIO_PORTA | GPIO_PF | 3) | ||
34 | #define PA4_PF_USBH2_STP (GPIO_PORTA | GPIO_PF | 4) | ||
35 | #define PB22_PF_USBH1_SUSP (GPIO_PORTB | GPIO_PF | 22) | ||
36 | #define PB25_PF_USBH1_RCV (GPIO_PORTB | GPIO_PF | 25) | ||
37 | #define PC5_PF_I2C2_SDA (GPIO_PORTC | GPIO_PF | GPIO_IN | 5) | ||
38 | #define PC6_PF_I2C2_SCL (GPIO_PORTC | GPIO_PF | GPIO_IN | 6) | ||
39 | #define PC7_PF_USBOTG_DATA5 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 7) | ||
40 | #define PC8_PF_USBOTG_DATA6 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 8) | ||
41 | #define PC9_PF_USBOTG_DATA0 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 9) | ||
42 | #define PC10_PF_USBOTG_DATA2 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 10) | ||
43 | #define PC11_PF_USBOTG_DATA1 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 11) | ||
44 | #define PC12_PF_USBOTG_DATA4 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 12) | ||
45 | #define PC13_PF_USBOTG_DATA3 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 13) | ||
46 | #define PC16_PF_SSI4_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 16) | ||
47 | #define PC17_PF_SSI4_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 17) | ||
48 | #define PC18_PF_SSI4_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 18) | ||
49 | #define PC19_PF_SSI4_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 19) | ||
50 | #define PC25_AF_GPT5_TIN (GPIO_PORTC | GPIO_AF | 25) | ||
51 | #define PC27_AF_GPT4_TIN (GPIO_PORTC | GPIO_AF | 27) | ||
52 | #define PD0_PF_SD3_CMD (GPIO_PORTD | GPIO_PF | 0) | ||
53 | #define PD1_PF_SD3_CLK (GPIO_PORTD | GPIO_PF | 1) | ||
54 | #define PD2_PF_ATA_DATA0 (GPIO_PORTD | GPIO_PF | 2) | ||
55 | #define PD3_PF_ATA_DATA1 (GPIO_PORTD | GPIO_PF | 3) | ||
56 | #define PD4_PF_ATA_DATA2 (GPIO_PORTD | GPIO_PF | 4) | ||
57 | #define PD5_PF_ATA_DATA3 (GPIO_PORTD | GPIO_PF | 5) | ||
58 | #define PD6_PF_ATA_DATA4 (GPIO_PORTD | GPIO_PF | 6) | ||
59 | #define PD7_PF_ATA_DATA5 (GPIO_PORTD | GPIO_PF | 7) | ||
60 | #define PD8_PF_ATA_DATA6 (GPIO_PORTD | GPIO_PF | 8) | ||
61 | #define PD9_PF_ATA_DATA7 (GPIO_PORTD | GPIO_PF | 9) | ||
62 | #define PD10_PF_ATA_DATA8 (GPIO_PORTD | GPIO_PF | 10) | ||
63 | #define PD11_PF_ATA_DATA9 (GPIO_PORTD | GPIO_PF | 11) | ||
64 | #define PD12_PF_ATA_DATA10 (GPIO_PORTD | GPIO_PF | 12) | ||
65 | #define PD13_PF_ATA_DATA11 (GPIO_PORTD | GPIO_PF | 13) | ||
66 | #define PD14_PF_ATA_DATA12 (GPIO_PORTD | GPIO_PF | 14) | ||
67 | #define PD15_PF_ATA_DATA13 (GPIO_PORTD | GPIO_PF | 15) | ||
68 | #define PD16_PF_ATA_DATA14 (GPIO_PORTD | GPIO_PF | 16) | ||
69 | #define PE0_PF_USBOTG_NXT (GPIO_PORTE | GPIO_PF | GPIO_OUT | 0) | ||
70 | #define PE1_PF_USBOTG_STP (GPIO_PORTE | GPIO_PF | GPIO_OUT | 1) | ||
71 | #define PE2_PF_USBOTG_DIR (GPIO_PORTE | GPIO_PF | GPIO_OUT | 2) | ||
72 | #define PE24_PF_USBOTG_CLK (GPIO_PORTE | GPIO_PF | GPIO_OUT | 24) | ||
73 | #define PE25_PF_USBOTG_DATA7 (GPIO_PORTE | GPIO_PF | GPIO_OUT | 25) | ||
74 | #define PF1_PF_NFCLE (GPIO_PORTF | GPIO_PF | 1) | ||
75 | #define PF3_PF_NFCE (GPIO_PORTF | GPIO_PF | 3) | ||
76 | #define PF7_PF_PC_POE (GPIO_PORTF | GPIO_PF | 7) | ||
77 | #define PF8_PF_PC_RW (GPIO_PORTF | GPIO_PF | 8) | ||
78 | #define PF9_PF_PC_IOIS16 (GPIO_PORTF | GPIO_PF | 9) | ||
79 | #define PF10_PF_PC_RST (GPIO_PORTF | GPIO_PF | 10) | ||
80 | #define PF11_PF_PC_BVD2 (GPIO_PORTF | GPIO_PF | 11) | ||
81 | #define PF12_PF_PC_BVD1 (GPIO_PORTF | GPIO_PF | 12) | ||
82 | #define PF13_PF_PC_VS2 (GPIO_PORTF | GPIO_PF | 13) | ||
83 | #define PF14_PF_PC_VS1 (GPIO_PORTF | GPIO_PF | 14) | ||
84 | #define PF16_PF_PC_PWRON (GPIO_PORTF | GPIO_PF | 16) | ||
85 | #define PF17_PF_PC_READY (GPIO_PORTF | GPIO_PF | 17) | ||
86 | #define PF18_PF_PC_WAIT (GPIO_PORTF | GPIO_PF | 18) | ||
87 | #define PF19_PF_PC_CD2 (GPIO_PORTF | GPIO_PF | 19) | ||
88 | #define PF20_PF_PC_CD1 (GPIO_PORTF | GPIO_PF | 20) | ||
89 | #define PF23_PF_ATA_DATA15 (GPIO_PORTF | GPIO_PF | 23) | ||
90 | |||
91 | /* Alternate GPIO pin functions */ | ||
92 | |||
93 | #define PB4_AF_MSHC_DATA0 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 4) | ||
94 | #define PB5_AF_MSHC_DATA1 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 5) | ||
95 | #define PB6_AF_MSHC_DATA2 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 6) | ||
96 | #define PB7_AF_MSHC_DATA4 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 7) | ||
97 | #define PB8_AF_MSHC_BS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 8) | ||
98 | #define PB9_AF_MSHC_SCLK (GPIO_PORTB | GPIO_AF | GPIO_OUT | 9) | ||
99 | #define PB10_AF_UART6_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 10) | ||
100 | #define PB11_AF_UART6_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 11) | ||
101 | #define PB12_AF_UART6_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 12) | ||
102 | #define PB13_AF_UART6_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 13) | ||
103 | #define PB18_AF_UART5_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 18) | ||
104 | #define PB19_AF_UART5_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 19) | ||
105 | #define PB20_AF_UART5_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 20) | ||
106 | #define PB21_AF_UART5_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 21) | ||
107 | #define PC8_AF_FEC_MDIO (GPIO_PORTC | GPIO_AF | GPIO_IN | 8) | ||
108 | #define PC24_AF_GPT5_TOUT (GPIO_PORTC | GPIO_AF | 24) | ||
109 | #define PC26_AF_GPT4_TOUT (GPIO_PORTC | GPIO_AF | 26) | ||
110 | #define PD1_AF_ETMTRACE_PKT15 (GPIO_PORTD | GPIO_AF | 1) | ||
111 | #define PD6_AF_ETMTRACE_PKT14 (GPIO_PORTD | GPIO_AF | 6) | ||
112 | #define PD7_AF_ETMTRACE_PKT13 (GPIO_PORTD | GPIO_AF | 7) | ||
113 | #define PD9_AF_ETMTRACE_PKT12 (GPIO_PORTD | GPIO_AF | 9) | ||
114 | #define PD2_AF_SD3_D0 (GPIO_PORTD | GPIO_AF | 2) | ||
115 | #define PD3_AF_SD3_D1 (GPIO_PORTD | GPIO_AF | 3) | ||
116 | #define PD4_AF_SD3_D2 (GPIO_PORTD | GPIO_AF | 4) | ||
117 | #define PD5_AF_SD3_D3 (GPIO_PORTD | GPIO_AF | 5) | ||
118 | #define PD8_AF_FEC_MDIO (GPIO_PORTD | GPIO_AF | GPIO_IN | 8) | ||
119 | #define PD10_AF_ETMTRACE_PKT11 (GPIO_PORTD | GPIO_AF | 10) | ||
120 | #define PD11_AF_ETMTRACE_PKT10 (GPIO_PORTD | GPIO_AF | 11) | ||
121 | #define PD12_AF_ETMTRACE_PKT9 (GPIO_PORTD | GPIO_AF | 12) | ||
122 | #define PD13_AF_ETMTRACE_PKT8 (GPIO_PORTD | GPIO_AF | 13) | ||
123 | #define PD14_AF_ETMTRACE_PKT7 (GPIO_PORTD | GPIO_AF | 14) | ||
124 | #define PD15_AF_ETMTRACE_PKT6 (GPIO_PORTD | GPIO_AF | 15) | ||
125 | #define PD16_AF_ETMTRACE_PKT5 (GPIO_PORTD | GPIO_AF | 16) | ||
126 | #define PF1_AF_ETMTRACE_PKT0 (GPIO_PORTF | GPIO_AF | 1) | ||
127 | #define PF3_AF_ETMTRACE_PKT2 (GPIO_PORTF | GPIO_AF | 3) | ||
128 | #define PF5_AF_ETMPIPESTAT11 (GPIO_PORTF | GPIO_AF | 5) | ||
129 | #define PF7_AF_ATA_BUFFER_EN (GPIO_PORTF | GPIO_AF | 7) | ||
130 | #define PF8_AF_ATA_IORDY (GPIO_PORTF | GPIO_AF | 8) | ||
131 | #define PF9_AF_ATA_INTRQ (GPIO_PORTF | GPIO_AF | 9) | ||
132 | #define PF10_AF_ATA_RESET (GPIO_PORTF | GPIO_AF | 10) | ||
133 | #define PF11_AF_ATA_DMACK (GPIO_PORTF | GPIO_AF | 11) | ||
134 | #define PF12_AF_ATA_DMAREQ (GPIO_PORTF | GPIO_AF | 12) | ||
135 | #define PF13_AF_ATA_DA0 (GPIO_PORTF | GPIO_AF | 13) | ||
136 | #define PF14_AF_ATA_DA1 (GPIO_PORTF | GPIO_AF | 14) | ||
137 | #define PF15_AF_ETMTRACE_SYNC (GPIO_PORTF | GPIO_AF | 15) | ||
138 | #define PF16_AF_ATA_DA2 (GPIO_PORTF | GPIO_AF | 16) | ||
139 | #define PF17_AF_ATA_CS0 (GPIO_PORTF | GPIO_AF | 17) | ||
140 | #define PF18_AF_ATA_CS1 (GPIO_PORTF | GPIO_AF | 18) | ||
141 | #define PF19_AF_ATA_DIOW (GPIO_PORTF | GPIO_AF | 19) | ||
142 | #define PF20_AF_ATA_DIOR (GPIO_PORTF | GPIO_AF | 20) | ||
143 | #define PF22_AF_ETMTRACE_CLK (GPIO_PORTF | GPIO_AF | 22) | ||
144 | #define PF23_AF_ETMTRACE_PKT4 (GPIO_PORTF | GPIO_AF | 23) | ||
145 | |||
146 | /* AIN GPIO pin functions */ | ||
147 | |||
148 | #define PC14_AIN_SSI1_MCLK (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 14) | ||
149 | #define PC15_AIN_GPT6_TOUT (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 15) | ||
150 | #define PD0_AIN_FEC_TXD0 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 0) | ||
151 | #define PD1_AIN_FEC_TXD1 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 1) | ||
152 | #define PD2_AIN_FEC_TXD2 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 2) | ||
153 | #define PD3_AIN_FEC_TXD3 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 3) | ||
154 | #define PD9_AIN_FEC_MDC (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 9) | ||
155 | #define PD16_AIN_FEC_TX_ER (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 16) | ||
156 | #define PD27_AIN_EXT_DMA_GRANT (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 27) | ||
157 | #define PF23_AIN_FEC_TX_EN (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 23) | ||
158 | |||
159 | /* BIN GPIO pin functions */ | ||
160 | |||
161 | #define PC14_BIN_SSI2_MCLK (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 14) | ||
162 | |||
163 | /* CIN GPIO pin functions */ | ||
164 | |||
165 | #define PD2_CIN_SLCDC1_DAT0 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 2) | ||
166 | #define PD3_CIN_SLCDC1_DAT1 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 3) | ||
167 | #define PD4_CIN_SLCDC1_DAT2 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 4) | ||
168 | #define PD5_CIN_SLCDC1_DAT3 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 5) | ||
169 | #define PD6_CIN_SLCDC1_DAT4 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 6) | ||
170 | #define PD7_CIN_SLCDC1_DAT5 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 7) | ||
171 | #define PD8_CIN_SLCDC1_DAT6 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 8) | ||
172 | #define PD9_CIN_SLCDC1_DAT7 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 9) | ||
173 | #define PD10_CIN_SLCDC1_DAT8 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 10) | ||
174 | #define PD11_CIN_SLCDC1_DAT9 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 11) | ||
175 | #define PD12_CIN_SLCDC1_DAT10 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 12) | ||
176 | #define PD13_CIN_SLCDC1_DAT11 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 13) | ||
177 | #define PD14_CIN_SLCDC1_DAT12 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 14) | ||
178 | #define PD15_CIN_SLCDC1_DAT13 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 15) | ||
179 | #define PD16_CIN_SLCDC1_DAT14 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 16) | ||
180 | #define PD23_CIN_SLCDC1_DAT15 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 23) | ||
181 | #define PF27_CIN_EXT_DMA_GRANT (GPIO_PORTF | GPIO_CIN | GPIO_OUT | 27) | ||
182 | /* LCDC_TESTx on PBxx omitted, because it's not clear what they do */ | ||
183 | |||
184 | /* AOUT GPIO pin functions */ | ||
185 | |||
186 | #define PC14_AOUT_GPT6_TIN (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 14) | ||
187 | #define PD4_AOUT_FEC_RX_ER (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 4) | ||
188 | #define PD5_AOUT_FEC_RXD1 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 5) | ||
189 | #define PD6_AOUT_FEC_RXD2 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 6) | ||
190 | #define PD7_AOUT_FEC_RXD3 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 7) | ||
191 | #define PD10_AOUT_FEC_CRS (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 10) | ||
192 | #define PD11_AOUT_FEC_TX_CLK (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 11) | ||
193 | #define PD12_AOUT_FEC_RXD0 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 12) | ||
194 | #define PD13_AOUT_FEC_RX_DV (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 13) | ||
195 | #define PD14_AOUT_FEC_RX_CLK (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 14) | ||
196 | #define PD15_AOUT_FEC_COL (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 15) | ||
197 | |||
198 | #define PC17_BOUT_PC_IOIS16 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 17) | ||
199 | #define PC18_BOUT_PC_BVD2 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 18) | ||
200 | #define PC19_BOUT_PC_BVD1 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 19) | ||
201 | #define PC28_BOUT_PC_BVD2 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 28) | ||
202 | #define PC29_BOUT_PC_VS1 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 29) | ||
203 | #define PC30_BOUT_PC_READY (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 30) | ||
204 | #define PC31_BOUT_PC_WAIT (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 31) | ||
205 | |||
206 | |||
207 | #endif /* _MXC_GPIO_MX1_MX2_H */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx2x.h b/arch/arm/plat-mxc/include/mach/iomux-mx2x.h new file mode 100644 index 000000000000..fb5ae638e79f --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/iomux-mx2x.h | |||
@@ -0,0 +1,237 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> | ||
3 | * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
17 | * MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef _MXC_IOMUX_MX2x_H | ||
21 | #define _MXC_IOMUX_MX2x_H | ||
22 | |||
23 | #ifndef GPIO_PORTA | ||
24 | #error Please include mach/iomux.h | ||
25 | #endif | ||
26 | |||
27 | |||
28 | /* Primary GPIO pin functions */ | ||
29 | |||
30 | #define PA5_PF_LSCLK (GPIO_PORTA | GPIO_PF | GPIO_OUT | 5) | ||
31 | #define PA6_PF_LD0 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 6) | ||
32 | #define PA7_PF_LD1 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 7) | ||
33 | #define PA8_PF_LD2 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 8) | ||
34 | #define PA9_PF_LD3 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 9) | ||
35 | #define PA10_PF_LD4 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 10) | ||
36 | #define PA11_PF_LD5 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 11) | ||
37 | #define PA12_PF_LD6 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 12) | ||
38 | #define PA13_PF_LD7 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 13) | ||
39 | #define PA14_PF_LD8 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 14) | ||
40 | #define PA15_PF_LD9 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 15) | ||
41 | #define PA16_PF_LD10 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 16) | ||
42 | #define PA17_PF_LD11 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 17) | ||
43 | #define PA18_PF_LD12 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 18) | ||
44 | #define PA19_PF_LD13 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 19) | ||
45 | #define PA20_PF_LD14 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 20) | ||
46 | #define PA21_PF_LD15 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 21) | ||
47 | #define PA22_PF_LD16 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 22) | ||
48 | #define PA23_PF_LD17 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 23) | ||
49 | #define PA24_PF_REV (GPIO_PORTA | GPIO_PF | GPIO_OUT | 24) | ||
50 | #define PA25_PF_CLS (GPIO_PORTA | GPIO_PF | GPIO_OUT | 25) | ||
51 | #define PA26_PF_PS (GPIO_PORTA | GPIO_PF | GPIO_OUT | 26) | ||
52 | #define PA27_PF_SPL_SPR (GPIO_PORTA | GPIO_PF | GPIO_OUT | 27) | ||
53 | #define PA28_PF_HSYNC (GPIO_PORTA | GPIO_PF | GPIO_OUT | 28) | ||
54 | #define PA29_PF_VSYNC (GPIO_PORTA | GPIO_PF | GPIO_OUT | 29) | ||
55 | #define PA30_PF_CONTRAST (GPIO_PORTA | GPIO_PF | GPIO_OUT | 30) | ||
56 | #define PA31_PF_OE_ACD (GPIO_PORTA | GPIO_PF | GPIO_OUT | 31) | ||
57 | #define PB4_PF_SD2_D0 (GPIO_PORTB | GPIO_PF | 4) | ||
58 | #define PB5_PF_SD2_D1 (GPIO_PORTB | GPIO_PF | 5) | ||
59 | #define PB6_PF_SD2_D2 (GPIO_PORTB | GPIO_PF | 6) | ||
60 | #define PB7_PF_SD2_D3 (GPIO_PORTB | GPIO_PF | 7) | ||
61 | #define PB8_PF_SD2_CMD (GPIO_PORTB | GPIO_PF | 8) | ||
62 | #define PB9_PF_SD2_CLK (GPIO_PORTB | GPIO_PF | 9) | ||
63 | #define PB10_PF_CSI_D0 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 10) | ||
64 | #define PB11_PF_CSI_D1 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 11) | ||
65 | #define PB12_PF_CSI_D2 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 12) | ||
66 | #define PB13_PF_CSI_D3 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 13) | ||
67 | #define PB14_PF_CSI_D4 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 14) | ||
68 | #define PB15_PF_CSI_MCLK (GPIO_PORTB | GPIO_PF | GPIO_OUT | 15) | ||
69 | #define PB16_PF_CSI_PIXCLK (GPIO_PORTB | GPIO_PF | GPIO_OUT | 16) | ||
70 | #define PB17_PF_CSI_D5 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 17) | ||
71 | #define PB18_PF_CSI_D6 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 18) | ||
72 | #define PB19_PF_CSI_D7 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 19) | ||
73 | #define PB20_PF_CSI_VSYNC (GPIO_PORTB | GPIO_PF | GPIO_OUT | 20) | ||
74 | #define PB21_PF_CSI_HSYNC (GPIO_PORTB | GPIO_PF | GPIO_OUT | 21) | ||
75 | #define PB23_PF_USB_PWR (GPIO_PORTB | GPIO_PF | 23) | ||
76 | #define PB24_PF_USB_OC (GPIO_PORTB | GPIO_PF | 24) | ||
77 | #define PB26_PF_USBH1_FS (GPIO_PORTB | GPIO_PF | 26) | ||
78 | #define PB27_PF_USBH1_OE (GPIO_PORTB | GPIO_PF | 27) | ||
79 | #define PB28_PF_USBH1_TXDM (GPIO_PORTB | GPIO_PF | 28) | ||
80 | #define PB29_PF_USBH1_TXDP (GPIO_PORTB | GPIO_PF | 29) | ||
81 | #define PB30_PF_USBH1_RXDM (GPIO_PORTB | GPIO_PF | 30) | ||
82 | #define PB31_PF_USBH1_RXDP (GPIO_PORTB | GPIO_PF | 31) | ||
83 | #define PC14_PF_TOUT (GPIO_PORTC | GPIO_PF | 14) | ||
84 | #define PC15_PF_TIN (GPIO_PORTC | GPIO_PF | 15) | ||
85 | #define PC20_PF_SSI1_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 20) | ||
86 | #define PC21_PF_SSI1_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 21) | ||
87 | #define PC22_PF_SSI1_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 22) | ||
88 | #define PC23_PF_SSI1_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 23) | ||
89 | #define PC24_PF_SSI2_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 24) | ||
90 | #define PC25_PF_SSI2_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 25) | ||
91 | #define PC26_PF_SSI2_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 26) | ||
92 | #define PC27_PF_SSI2_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 27) | ||
93 | #define PC28_PF_SSI3_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 28) | ||
94 | #define PC29_PF_SSI3_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 29) | ||
95 | #define PC30_PF_SSI3_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 30) | ||
96 | #define PC31_PF_SSI3_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 31) | ||
97 | #define PD17_PF_I2C_DATA (GPIO_PORTD | GPIO_PF | GPIO_OUT | 17) | ||
98 | #define PD18_PF_I2C_CLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 18) | ||
99 | #define PD19_PF_CSPI2_SS2 (GPIO_PORTD | GPIO_PF | 19) | ||
100 | #define PD20_PF_CSPI2_SS1 (GPIO_PORTD | GPIO_PF | 20) | ||
101 | #define PD21_PF_CSPI2_SS0 (GPIO_PORTD | GPIO_PF | 21) | ||
102 | #define PD22_PF_CSPI2_SCLK (GPIO_PORTD | GPIO_PF | 22) | ||
103 | #define PD23_PF_CSPI2_MISO (GPIO_PORTD | GPIO_PF | 23) | ||
104 | #define PD24_PF_CSPI2_MOSI (GPIO_PORTD | GPIO_PF | 24) | ||
105 | #define PD25_PF_CSPI1_RDY (GPIO_PORTD | GPIO_PF | GPIO_OUT | 25) | ||
106 | #define PD26_PF_CSPI1_SS2 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 26) | ||
107 | #define PD27_PF_CSPI1_SS1 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 27) | ||
108 | #define PD28_PF_CSPI1_SS0 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 28) | ||
109 | #define PD29_PF_CSPI1_SCLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 29) | ||
110 | #define PD30_PF_CSPI1_MISO (GPIO_PORTD | GPIO_PF | GPIO_IN | 30) | ||
111 | #define PD31_PF_CSPI1_MOSI (GPIO_PORTD | GPIO_PF | GPIO_OUT | 31) | ||
112 | #define PE3_PF_UART2_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 3) | ||
113 | #define PE4_PF_UART2_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 4) | ||
114 | #define PE5_PF_PWMO (GPIO_PORTE | GPIO_PF | 5) | ||
115 | #define PE6_PF_UART2_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 6) | ||
116 | #define PE7_PF_UART2_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 7) | ||
117 | #define PE8_PF_UART3_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 8) | ||
118 | #define PE9_PF_UART3_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 9) | ||
119 | #define PE10_PF_UART3_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 10) | ||
120 | #define PE11_PF_UART3_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 11) | ||
121 | #define PE12_PF_UART1_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 12) | ||
122 | #define PE13_PF_UART1_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 13) | ||
123 | #define PE14_PF_UART1_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 14) | ||
124 | #define PE15_PF_UART1_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 15) | ||
125 | #define PE16_PF_RTCK (GPIO_PORTE | GPIO_PF | GPIO_OUT | 16) | ||
126 | #define PE17_PF_RESET_OUT (GPIO_PORTE | GPIO_PF | 17) | ||
127 | #define PE18_PF_SD1_D0 (GPIO_PORTE | GPIO_PF | 18) | ||
128 | #define PE19_PF_SD1_D1 (GPIO_PORTE | GPIO_PF | 19) | ||
129 | #define PE20_PF_SD1_D2 (GPIO_PORTE | GPIO_PF | 20) | ||
130 | #define PE21_PF_SD1_D3 (GPIO_PORTE | GPIO_PF | 21) | ||
131 | #define PE22_PF_SD1_CMD (GPIO_PORTE | GPIO_PF | 22) | ||
132 | #define PE23_PF_SD1_CLK (GPIO_PORTE | GPIO_PF | 23) | ||
133 | #define PF0_PF_NRFB (GPIO_PORTF | GPIO_PF | 0) | ||
134 | #define PF2_PF_NFWP (GPIO_PORTF | GPIO_PF | 2) | ||
135 | #define PF4_PF_NFALE (GPIO_PORTF | GPIO_PF | 4) | ||
136 | #define PF5_PF_NFRE (GPIO_PORTF | GPIO_PF | 5) | ||
137 | #define PF6_PF_NFWE (GPIO_PORTF | GPIO_PF | 6) | ||
138 | #define PF15_PF_CLKO (GPIO_PORTF | GPIO_PF | 15) | ||
139 | #define PF21_PF_CS4 (GPIO_PORTF | GPIO_PF | 21) | ||
140 | #define PF22_PF_CS5 (GPIO_PORTF | GPIO_PF | 22) | ||
141 | |||
142 | /* Alternate GPIO pin functions */ | ||
143 | |||
144 | #define PB26_AF_UART4_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 26) | ||
145 | #define PB28_AF_UART4_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 28) | ||
146 | #define PB29_AF_UART4_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 29) | ||
147 | #define PB31_AF_UART4_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 31) | ||
148 | #define PC28_AF_SLCDC2_D0 (GPIO_PORTC | GPIO_AF | 28) | ||
149 | #define PC29_AF_SLCDC2_RS (GPIO_PORTC | GPIO_AF | 29) | ||
150 | #define PC30_AF_SLCDC2_CS (GPIO_PORTC | GPIO_AF | 30) | ||
151 | #define PC31_AF_SLCDC2_CLK (GPIO_PORTC | GPIO_AF | 31) | ||
152 | #define PD19_AF_USBH2_DATA4 (GPIO_PORTD | GPIO_AF | 19) | ||
153 | #define PD20_AF_USBH2_DATA3 (GPIO_PORTD | GPIO_AF | 20) | ||
154 | #define PD21_AF_USBH2_DATA6 (GPIO_PORTD | GPIO_AF | 21) | ||
155 | #define PD22_AF_USBH2_DATA0 (GPIO_PORTD | GPIO_AF | 22) | ||
156 | #define PD23_AF_USBH2_DATA2 (GPIO_PORTD | GPIO_AF | 23) | ||
157 | #define PD24_AF_USBH2_DATA1 (GPIO_PORTD | GPIO_AF | 24) | ||
158 | #define PD26_AF_USBH2_DATA5 (GPIO_PORTD | GPIO_AF | 26) | ||
159 | #define PE0_AF_KP_COL6 (GPIO_PORTE | GPIO_AF | 0) | ||
160 | #define PE1_AF_KP_ROW6 (GPIO_PORTE | GPIO_AF | 1) | ||
161 | #define PE2_AF_KP_ROW7 (GPIO_PORTE | GPIO_AF | 2) | ||
162 | #define PE3_AF_KP_COL7 (GPIO_PORTE | GPIO_AF | 3) | ||
163 | #define PE4_AF_KP_ROW7 (GPIO_PORTE | GPIO_AF | 4) | ||
164 | #define PE6_AF_KP_COL6 (GPIO_PORTE | GPIO_AF | 6) | ||
165 | #define PE7_AF_KP_ROW6 (GPIO_PORTE | GPIO_AF | 7) | ||
166 | #define PE16_AF_OWIRE (GPIO_PORTE | GPIO_AF | 16) | ||
167 | #define PE18_AF_CSPI3_MISO (GPIO_PORTE | GPIO_AF | GPIO_IN | 18) | ||
168 | #define PE21_AF_CSPI3_SS (GPIO_PORTE | GPIO_AF | GPIO_OUT | 21) | ||
169 | #define PE22_AF_CSPI3_MOSI (GPIO_PORTE | GPIO_AF | GPIO_OUT | 22) | ||
170 | #define PE23_AF_CSPI3_SCLK (GPIO_PORTE | GPIO_AF | GPIO_OUT | 23) | ||
171 | |||
172 | /* AIN GPIO pin functions */ | ||
173 | |||
174 | #define PA6_AIN_SLCDC1_DAT0 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 6) | ||
175 | #define PA7_AIN_SLCDC1_DAT1 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 7) | ||
176 | #define PA8_AIN_SLCDC1_DAT2 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 8) | ||
177 | #define PA0_AIN_SLCDC1_DAT3 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0) | ||
178 | #define PA11_AIN_SLCDC1_DAT5 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 11) | ||
179 | #define PA13_AIN_SLCDC1_DAT7 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 13) | ||
180 | #define PA15_AIN_SLCDC1_DAT9 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 15) | ||
181 | #define PA17_AIN_SLCDC1_DAT11 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 17) | ||
182 | #define PA19_AIN_SLCDC1_DAT13 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 19) | ||
183 | #define PA21_AIN_SLCDC1_DAT15 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 21) | ||
184 | #define PA22_AIN_EXT_DMAGRANT (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 22) | ||
185 | #define PA24_AIN_SLCDC1_D0 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 24) | ||
186 | #define PA25_AIN_SLCDC1_RS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 25) | ||
187 | #define PA26_AIN_SLCDC1_CS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 26) | ||
188 | #define PA27_AIN_SLCDC1_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 27) | ||
189 | #define PB6_AIN_SLCDC1_D0 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 6) | ||
190 | #define PB7_AIN_SLCDC1_RS (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 7) | ||
191 | #define PB8_AIN_SLCDC1_CS (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 8) | ||
192 | #define PB9_AIN_SLCDC1_CLK (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 9) | ||
193 | #define PB25_AIN_SLCDC1_DAT0 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 25) | ||
194 | #define PB26_AIN_SLCDC1_DAT1 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 26) | ||
195 | #define PB27_AIN_SLCDC1_DAT2 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 27) | ||
196 | #define PB28_AIN_SLCDC1_DAT3 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 28) | ||
197 | #define PB29_AIN_SLCDC1_DAT4 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 29) | ||
198 | #define PB30_AIN_SLCDC1_DAT5 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 30) | ||
199 | #define PB31_AIN_SLCDC1_DAT6 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 31) | ||
200 | #define PC5_AIN_SLCDC1_DAT7 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 5) | ||
201 | #define PC6_AIN_SLCDC1_DAT8 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 6) | ||
202 | #define PC7_AIN_SLCDC1_DAT9 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 7) | ||
203 | #define PC8_AIN_SLCDC1_DAT10 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 8) | ||
204 | #define PC9_AIN_SLCDC1_DAT11 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 9) | ||
205 | #define PC10_AIN_SLCDC1_DAT12 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 10) | ||
206 | #define PC11_AIN_SLCDC1_DAT13 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 11) | ||
207 | #define PC12_AIN_SLCDC1_DAT14 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 12) | ||
208 | #define PC13_AIN_SLCDC1_DAT15 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 13) | ||
209 | #define PE5_AIN_PC_SPKOUT (GPIO_PORTE | GPIO_AIN | GPIO_OUT | 5) | ||
210 | |||
211 | /* BIN GPIO pin functions */ | ||
212 | |||
213 | #define PE5_BIN_TOUT2 (GPIO_PORTE | GPIO_BIN | GPIO_OUT | 5) | ||
214 | |||
215 | /* CIN GPIO pin functions */ | ||
216 | |||
217 | #define PA14_CIN_SLCDC1_DAT0 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 14) | ||
218 | #define PA15_CIN_SLCDC1_DAT1 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 15) | ||
219 | #define PA16_CIN_SLCDC1_DAT2 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 16) | ||
220 | #define PA17_CIN_SLCDC1_DAT3 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 17) | ||
221 | #define PA18_CIN_SLCDC1_DAT4 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 18) | ||
222 | #define PA19_CIN_SLCDC1_DAT5 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 19) | ||
223 | #define PA20_CIN_SLCDC1_DAT6 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 20) | ||
224 | #define PA21_CIN_SLCDC1_DAT7 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 21) | ||
225 | #define PB30_CIN_UART4_CTS (GPIO_PORTB | GPIO_CIN | GPIO_OUT | 30) | ||
226 | #define PE5_CIN_TOUT3 (GPIO_PORTE | GPIO_CIN | GPIO_OUT | 5) | ||
227 | |||
228 | /* AOUT GPIO pin functions */ | ||
229 | |||
230 | #define PB29_AOUT_UART4_RXD (GPIO_PORTB | GPIO_AOUT | GPIO_IN | 29) | ||
231 | #define PB31_AOUT_UART4_RTS (GPIO_PORTB | GPIO_AOUT | GPIO_IN | 31) | ||
232 | #define PC8_AOUT_USBOTG_TXR_INT (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 8) | ||
233 | #define PC15_AOUT_WKGD (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 15) | ||
234 | #define PF21_AOUT_DTACK (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 21) | ||
235 | |||
236 | |||
237 | #endif | ||
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h index c9198c0aea18..ab838cfe94f9 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h +++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h | |||
@@ -92,7 +92,7 @@ enum iomux_gp_func { | |||
92 | MUX_EXTDMAREQ2_MBX_SEL = 1 << 15, | 92 | MUX_EXTDMAREQ2_MBX_SEL = 1 << 15, |
93 | MUX_TAMPER_DETECT_EN = 1 << 16, | 93 | MUX_TAMPER_DETECT_EN = 1 << 16, |
94 | MUX_PGP_USB_4WIRE = 1 << 17, | 94 | MUX_PGP_USB_4WIRE = 1 << 17, |
95 | MUX_PGB_USB_COMMON = 1 << 18, | 95 | MUX_PGP_USB_COMMON = 1 << 18, |
96 | MUX_SDHC_MEMSTICK1 = 1 << 19, | 96 | MUX_SDHC_MEMSTICK1 = 1 << 19, |
97 | MUX_SDHC_MEMSTICK2 = 1 << 20, | 97 | MUX_SDHC_MEMSTICK2 = 1 << 20, |
98 | MUX_PGP_SPLL_BYP = 1 << 21, | 98 | MUX_PGP_SPLL_BYP = 1 << 21, |
@@ -109,21 +109,44 @@ enum iomux_gp_func { | |||
109 | }; | 109 | }; |
110 | 110 | ||
111 | /* | 111 | /* |
112 | * This function enables/disables the general purpose function for a particular | 112 | * setups a single pin: |
113 | * signal. | 113 | * - reserves the pin so that it is not claimed by another driver |
114 | * - setups the iomux according to the configuration | ||
115 | * - if the pin is configured as a GPIO, we claim it throug kernel gpiolib | ||
116 | */ | ||
117 | int mxc_iomux_setup_pin(const unsigned int pin, const char *label); | ||
118 | /* | ||
119 | * setups mutliple pins | ||
120 | * convenient way to call the above function with tables | ||
114 | */ | 121 | */ |
115 | void iomux_config_gpr(enum iomux_gp_func , bool); | 122 | int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count, |
123 | const char *label); | ||
116 | 124 | ||
117 | /* | 125 | /* |
118 | * set the mode for a IOMUX pin. | 126 | * releases a single pin: |
127 | * - make it available for a future use by another driver | ||
128 | * - frees the GPIO if the pin was configured as GPIO | ||
129 | * - DOES NOT reconfigure the IOMUX in its reset state | ||
119 | */ | 130 | */ |
120 | int mxc_iomux_mode(unsigned int); | 131 | void mxc_iomux_release_pin(const unsigned int pin); |
132 | /* | ||
133 | * releases multiple pins | ||
134 | * convenvient way to call the above function with tables | ||
135 | */ | ||
136 | void mxc_iomux_release_multiple_pins(unsigned int *pin_list, int count); | ||
121 | 137 | ||
122 | /* | 138 | /* |
123 | * This function enables/disables the general purpose function for a particular | 139 | * This function enables/disables the general purpose function for a particular |
124 | * signal. | 140 | * signal. |
125 | */ | 141 | */ |
126 | void mxc_iomux_set_gpr(enum iomux_gp_func, bool); | 142 | void mxc_iomux_set_gpr(enum iomux_gp_func, bool en); |
143 | |||
144 | /* | ||
145 | * This function only configures the iomux hardware. | ||
146 | * It is called by the setup functions and should not be called directly anymore. | ||
147 | * It is here visible for backward compatibility | ||
148 | */ | ||
149 | int mxc_iomux_mode(unsigned int pin_mode); | ||
127 | 150 | ||
128 | #define IOMUX_PADNUM_MASK 0x1ff | 151 | #define IOMUX_PADNUM_MASK 0x1ff |
129 | #define IOMUX_GPIONUM_SHIFT 9 | 152 | #define IOMUX_GPIONUM_SHIFT 9 |
@@ -144,6 +167,11 @@ void mxc_iomux_set_gpr(enum iomux_gp_func, bool); | |||
144 | MXC_GPIO_IRQ_START) | 167 | MXC_GPIO_IRQ_START) |
145 | 168 | ||
146 | /* | 169 | /* |
170 | * The number of gpio devices among the pads | ||
171 | */ | ||
172 | #define GPIO_PORT_MAX 3 | ||
173 | |||
174 | /* | ||
147 | * This enumeration is constructed based on the Section | 175 | * This enumeration is constructed based on the Section |
148 | * "sw_pad_ctl & sw_mux_ctl details" of the MX31 IC Spec. Each enumerated | 176 | * "sw_pad_ctl & sw_mux_ctl details" of the MX31 IC Spec. Each enumerated |
149 | * value is constructed based on the rules described above. | 177 | * value is constructed based on the rules described above. |
@@ -480,6 +508,9 @@ enum iomux_pins { | |||
480 | MX31_PIN_CAPTURE = IOMUX_PIN( 7, 327), | 508 | MX31_PIN_CAPTURE = IOMUX_PIN( 7, 327), |
481 | }; | 509 | }; |
482 | 510 | ||
511 | #define PIN_MAX 327 | ||
512 | #define NB_PORTS 12 /* NB_PINS/32, we chose 32 pins per "PORT" */ | ||
513 | |||
483 | /* | 514 | /* |
484 | * Convenience values for use with mxc_iomux_mode() | 515 | * Convenience values for use with mxc_iomux_mode() |
485 | * | 516 | * |
@@ -507,7 +538,9 @@ enum iomux_pins { | |||
507 | #define MX31_PIN_CSPI1_SS1__SS1 IOMUX_MODE(MX31_PIN_CSPI1_SS1, IOMUX_CONFIG_FUNC) | 538 | #define MX31_PIN_CSPI1_SS1__SS1 IOMUX_MODE(MX31_PIN_CSPI1_SS1, IOMUX_CONFIG_FUNC) |
508 | #define MX31_PIN_CSPI1_SS2__SS2 IOMUX_MODE(MX31_PIN_CSPI1_SS2, IOMUX_CONFIG_FUNC) | 539 | #define MX31_PIN_CSPI1_SS2__SS2 IOMUX_MODE(MX31_PIN_CSPI1_SS2, IOMUX_CONFIG_FUNC) |
509 | #define MX31_PIN_CSPI2_MOSI__MOSI IOMUX_MODE(MX31_PIN_CSPI2_MOSI, IOMUX_CONFIG_FUNC) | 540 | #define MX31_PIN_CSPI2_MOSI__MOSI IOMUX_MODE(MX31_PIN_CSPI2_MOSI, IOMUX_CONFIG_FUNC) |
541 | #define MX31_PIN_CSPI2_MOSI__SCL IOMUX_MODE(MX31_PIN_CSPI2_MOSI, IOMUX_CONFIG_ALT1) | ||
510 | #define MX31_PIN_CSPI2_MISO__MISO IOMUX_MODE(MX31_PIN_CSPI2_MISO, IOMUX_CONFIG_FUNC) | 542 | #define MX31_PIN_CSPI2_MISO__MISO IOMUX_MODE(MX31_PIN_CSPI2_MISO, IOMUX_CONFIG_FUNC) |
543 | #define MX31_PIN_CSPI2_MISO__SDA IOMUX_MODE(MX31_PIN_CSPI2_MISO, IOMUX_CONFIG_ALT1) | ||
511 | #define MX31_PIN_CSPI2_SCLK__SCLK IOMUX_MODE(MX31_PIN_CSPI2_SCLK, IOMUX_CONFIG_FUNC) | 544 | #define MX31_PIN_CSPI2_SCLK__SCLK IOMUX_MODE(MX31_PIN_CSPI2_SCLK, IOMUX_CONFIG_FUNC) |
512 | #define MX31_PIN_CSPI2_SPI_RDY__SPI_RDY IOMUX_MODE(MX31_PIN_CSPI2_SPI_RDY, IOMUX_CONFIG_FUNC) | 545 | #define MX31_PIN_CSPI2_SPI_RDY__SPI_RDY IOMUX_MODE(MX31_PIN_CSPI2_SPI_RDY, IOMUX_CONFIG_FUNC) |
513 | #define MX31_PIN_CSPI2_SS0__SS0 IOMUX_MODE(MX31_PIN_CSPI2_SS0, IOMUX_CONFIG_FUNC) | 546 | #define MX31_PIN_CSPI2_SS0__SS0 IOMUX_MODE(MX31_PIN_CSPI2_SS0, IOMUX_CONFIG_FUNC) |
@@ -525,6 +558,33 @@ enum iomux_pins { | |||
525 | #define MX31_PIN_SD1_DATA0__SD1_DATA0 IOMUX_MODE(MX31_PIN_SD1_DATA0, IOMUX_CONFIG_FUNC) | 558 | #define MX31_PIN_SD1_DATA0__SD1_DATA0 IOMUX_MODE(MX31_PIN_SD1_DATA0, IOMUX_CONFIG_FUNC) |
526 | #define MX31_PIN_SD1_CLK__SD1_CLK IOMUX_MODE(MX31_PIN_SD1_CLK, IOMUX_CONFIG_FUNC) | 559 | #define MX31_PIN_SD1_CLK__SD1_CLK IOMUX_MODE(MX31_PIN_SD1_CLK, IOMUX_CONFIG_FUNC) |
527 | #define MX31_PIN_SD1_CMD__SD1_CMD IOMUX_MODE(MX31_PIN_SD1_CMD, IOMUX_CONFIG_FUNC) | 560 | #define MX31_PIN_SD1_CMD__SD1_CMD IOMUX_MODE(MX31_PIN_SD1_CMD, IOMUX_CONFIG_FUNC) |
561 | #define MX31_PIN_LD0__LD0 IOMUX_MODE(MX31_PIN_LD0, IOMUX_CONFIG_FUNC) | ||
562 | #define MX31_PIN_LD1__LD1 IOMUX_MODE(MX31_PIN_LD1, IOMUX_CONFIG_FUNC) | ||
563 | #define MX31_PIN_LD2__LD2 IOMUX_MODE(MX31_PIN_LD2, IOMUX_CONFIG_FUNC) | ||
564 | #define MX31_PIN_LD3__LD3 IOMUX_MODE(MX31_PIN_LD3, IOMUX_CONFIG_FUNC) | ||
565 | #define MX31_PIN_LD4__LD4 IOMUX_MODE(MX31_PIN_LD4, IOMUX_CONFIG_FUNC) | ||
566 | #define MX31_PIN_LD5__LD5 IOMUX_MODE(MX31_PIN_LD5, IOMUX_CONFIG_FUNC) | ||
567 | #define MX31_PIN_LD6__LD6 IOMUX_MODE(MX31_PIN_LD6, IOMUX_CONFIG_FUNC) | ||
568 | #define MX31_PIN_LD7__LD7 IOMUX_MODE(MX31_PIN_LD7, IOMUX_CONFIG_FUNC) | ||
569 | #define MX31_PIN_LD8__LD8 IOMUX_MODE(MX31_PIN_LD8, IOMUX_CONFIG_FUNC) | ||
570 | #define MX31_PIN_LD9__LD9 IOMUX_MODE(MX31_PIN_LD9, IOMUX_CONFIG_FUNC) | ||
571 | #define MX31_PIN_LD10__LD10 IOMUX_MODE(MX31_PIN_LD10, IOMUX_CONFIG_FUNC) | ||
572 | #define MX31_PIN_LD11__LD11 IOMUX_MODE(MX31_PIN_LD11, IOMUX_CONFIG_FUNC) | ||
573 | #define MX31_PIN_LD12__LD12 IOMUX_MODE(MX31_PIN_LD12, IOMUX_CONFIG_FUNC) | ||
574 | #define MX31_PIN_LD13__LD13 IOMUX_MODE(MX31_PIN_LD13, IOMUX_CONFIG_FUNC) | ||
575 | #define MX31_PIN_LD14__LD14 IOMUX_MODE(MX31_PIN_LD14, IOMUX_CONFIG_FUNC) | ||
576 | #define MX31_PIN_LD15__LD15 IOMUX_MODE(MX31_PIN_LD15, IOMUX_CONFIG_FUNC) | ||
577 | #define MX31_PIN_LD16__LD16 IOMUX_MODE(MX31_PIN_LD16, IOMUX_CONFIG_FUNC) | ||
578 | #define MX31_PIN_LD17__LD17 IOMUX_MODE(MX31_PIN_LD17, IOMUX_CONFIG_FUNC) | ||
579 | #define MX31_PIN_VSYNC3__VSYNC3 IOMUX_MODE(MX31_PIN_VSYNC3, IOMUX_CONFIG_FUNC) | ||
580 | #define MX31_PIN_HSYNC__HSYNC IOMUX_MODE(MX31_PIN_HSYNC, IOMUX_CONFIG_FUNC) | ||
581 | #define MX31_PIN_FPSHIFT__FPSHIFT IOMUX_MODE(MX31_PIN_FPSHIFT, IOMUX_CONFIG_FUNC) | ||
582 | #define MX31_PIN_DRDY0__DRDY0 IOMUX_MODE(MX31_PIN_DRDY0, IOMUX_CONFIG_FUNC) | ||
583 | #define MX31_PIN_D3_REV__D3_REV IOMUX_MODE(MX31_PIN_D3_REV, IOMUX_CONFIG_FUNC) | ||
584 | #define MX31_PIN_CONTRAST__CONTRAST IOMUX_MODE(MX31_PIN_CONTRAST, IOMUX_CONFIG_FUNC) | ||
585 | #define MX31_PIN_D3_SPL__D3_SPL IOMUX_MODE(MX31_PIN_D3_SPL, IOMUX_CONFIG_FUNC) | ||
586 | #define MX31_PIN_D3_CLS__D3_CLS IOMUX_MODE(MX31_PIN_D3_CLS, IOMUX_CONFIG_FUNC) | ||
587 | #define MX31_PIN_LCS0__GPI03_23 IOMUX_MODE(MX31_PIN_LCS0, IOMUX_CONFIG_GPIO) | ||
528 | 588 | ||
529 | /*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0 | 589 | /*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0 |
530 | * cspi1_ss1*/ | 590 | * cspi1_ss1*/ |
diff --git a/arch/arm/plat-mxc/include/mach/iomux.h b/arch/arm/plat-mxc/include/mach/iomux.h new file mode 100644 index 000000000000..171f8adc1109 --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/iomux.h | |||
@@ -0,0 +1,127 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> | ||
3 | * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
17 | * MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef _MXC_IOMUX_H | ||
21 | #define _MXC_IOMUX_H | ||
22 | |||
23 | /* | ||
24 | * GPIO Module and I/O Multiplexer | ||
25 | * x = 0..3 for reg_A, reg_B, reg_C, reg_D | ||
26 | */ | ||
27 | #define VA_GPIO_BASE IO_ADDRESS(GPIO_BASE_ADDR) | ||
28 | #define MXC_DDIR(x) (0x00 + ((x) << 8)) | ||
29 | #define MXC_OCR1(x) (0x04 + ((x) << 8)) | ||
30 | #define MXC_OCR2(x) (0x08 + ((x) << 8)) | ||
31 | #define MXC_ICONFA1(x) (0x0c + ((x) << 8)) | ||
32 | #define MXC_ICONFA2(x) (0x10 + ((x) << 8)) | ||
33 | #define MXC_ICONFB1(x) (0x14 + ((x) << 8)) | ||
34 | #define MXC_ICONFB2(x) (0x18 + ((x) << 8)) | ||
35 | #define MXC_DR(x) (0x1c + ((x) << 8)) | ||
36 | #define MXC_GIUS(x) (0x20 + ((x) << 8)) | ||
37 | #define MXC_SSR(x) (0x24 + ((x) << 8)) | ||
38 | #define MXC_ICR1(x) (0x28 + ((x) << 8)) | ||
39 | #define MXC_ICR2(x) (0x2c + ((x) << 8)) | ||
40 | #define MXC_IMR(x) (0x30 + ((x) << 8)) | ||
41 | #define MXC_ISR(x) (0x34 + ((x) << 8)) | ||
42 | #define MXC_GPR(x) (0x38 + ((x) << 8)) | ||
43 | #define MXC_SWR(x) (0x3c + ((x) << 8)) | ||
44 | #define MXC_PUEN(x) (0x40 + ((x) << 8)) | ||
45 | |||
46 | #ifdef CONFIG_ARCH_MX1 | ||
47 | # define GPIO_PORT_MAX 3 | ||
48 | #endif | ||
49 | #ifdef CONFIG_ARCH_MX2 | ||
50 | # define GPIO_PORT_MAX 5 | ||
51 | #endif | ||
52 | |||
53 | #ifndef GPIO_PORT_MAX | ||
54 | # error "GPIO config port count unknown!" | ||
55 | #endif | ||
56 | |||
57 | #define GPIO_PIN_MASK 0x1f | ||
58 | |||
59 | #define GPIO_PORT_SHIFT 5 | ||
60 | #define GPIO_PORT_MASK (0x7 << GPIO_PORT_SHIFT) | ||
61 | |||
62 | #define GPIO_PORTA (0 << GPIO_PORT_SHIFT) | ||
63 | #define GPIO_PORTB (1 << GPIO_PORT_SHIFT) | ||
64 | #define GPIO_PORTC (2 << GPIO_PORT_SHIFT) | ||
65 | #define GPIO_PORTD (3 << GPIO_PORT_SHIFT) | ||
66 | #define GPIO_PORTE (4 << GPIO_PORT_SHIFT) | ||
67 | #define GPIO_PORTF (5 << GPIO_PORT_SHIFT) | ||
68 | |||
69 | #define GPIO_OUT (1 << 8) | ||
70 | #define GPIO_IN (0 << 8) | ||
71 | #define GPIO_PUEN (1 << 9) | ||
72 | |||
73 | #define GPIO_PF (1 << 10) | ||
74 | #define GPIO_AF (1 << 11) | ||
75 | |||
76 | #define GPIO_OCR_SHIFT 12 | ||
77 | #define GPIO_OCR_MASK (3 << GPIO_OCR_SHIFT) | ||
78 | #define GPIO_AIN (0 << GPIO_OCR_SHIFT) | ||
79 | #define GPIO_BIN (1 << GPIO_OCR_SHIFT) | ||
80 | #define GPIO_CIN (2 << GPIO_OCR_SHIFT) | ||
81 | #define GPIO_GPIO (3 << GPIO_OCR_SHIFT) | ||
82 | |||
83 | #define GPIO_AOUT_SHIFT 14 | ||
84 | #define GPIO_AOUT_MASK (3 << GPIO_AOUT_SHIFT) | ||
85 | #define GPIO_AOUT (0 << GPIO_AOUT_SHIFT) | ||
86 | #define GPIO_AOUT_ISR (1 << GPIO_AOUT_SHIFT) | ||
87 | #define GPIO_AOUT_0 (2 << GPIO_AOUT_SHIFT) | ||
88 | #define GPIO_AOUT_1 (3 << GPIO_AOUT_SHIFT) | ||
89 | |||
90 | #define GPIO_BOUT_SHIFT 16 | ||
91 | #define GPIO_BOUT_MASK (3 << GPIO_BOUT_SHIFT) | ||
92 | #define GPIO_BOUT (0 << GPIO_BOUT_SHIFT) | ||
93 | #define GPIO_BOUT_ISR (1 << GPIO_BOUT_SHIFT) | ||
94 | #define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT) | ||
95 | #define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT) | ||
96 | |||
97 | |||
98 | #ifdef CONFIG_ARCH_MX1 | ||
99 | #include <mach/iomux-mx1.h> | ||
100 | #endif | ||
101 | #ifdef CONFIG_ARCH_MX2 | ||
102 | #include <mach/iomux-mx2x.h> | ||
103 | #ifdef CONFIG_MACH_MX21 | ||
104 | #include <mach/iomux-mx21.h> | ||
105 | #endif | ||
106 | #ifdef CONFIG_MACH_MX27 | ||
107 | #include <mach/iomux-mx27.h> | ||
108 | #endif | ||
109 | #endif | ||
110 | |||
111 | |||
112 | /* decode irq number to use with IMR(x), ISR(x) and friends */ | ||
113 | #define IRQ_TO_REG(irq) ((irq - MXC_INTERNAL_IRQS) >> 5) | ||
114 | |||
115 | #define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x) | ||
116 | #define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x) | ||
117 | #define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x) | ||
118 | #define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x) | ||
119 | #define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x) | ||
120 | |||
121 | |||
122 | extern void mxc_gpio_mode(int gpio_mode); | ||
123 | extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count, | ||
124 | const char *label); | ||
125 | extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count); | ||
126 | |||
127 | #endif | ||
diff --git a/arch/arm/plat-mxc/include/mach/memory.h b/arch/arm/plat-mxc/include/mach/memory.h index 0b808399097f..e0783e619580 100644 --- a/arch/arm/plat-mxc/include/mach/memory.h +++ b/arch/arm/plat-mxc/include/mach/memory.h | |||
@@ -14,7 +14,12 @@ | |||
14 | #if defined CONFIG_ARCH_MX1 | 14 | #if defined CONFIG_ARCH_MX1 |
15 | #define PHYS_OFFSET UL(0x08000000) | 15 | #define PHYS_OFFSET UL(0x08000000) |
16 | #elif defined CONFIG_ARCH_MX2 | 16 | #elif defined CONFIG_ARCH_MX2 |
17 | #ifdef CONFIG_MACH_MX21 | ||
18 | #define PHYS_OFFSET UL(0xC0000000) | ||
19 | #endif | ||
20 | #ifdef CONFIG_MACH_MX27 | ||
17 | #define PHYS_OFFSET UL(0xA0000000) | 21 | #define PHYS_OFFSET UL(0xA0000000) |
22 | #endif | ||
18 | #elif defined CONFIG_ARCH_MX3 | 23 | #elif defined CONFIG_ARCH_MX3 |
19 | #define PHYS_OFFSET UL(0x80000000) | 24 | #define PHYS_OFFSET UL(0x80000000) |
20 | #endif | 25 | #endif |
diff --git a/arch/arm/plat-mxc/include/mach/mx21.h b/arch/arm/plat-mxc/include/mach/mx21.h new file mode 100644 index 000000000000..e8c4cf56c24e --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/mx21.h | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
4 | * Copyright 2009 Holger Schurig, hs4233@mail.mn-solutions.de | ||
5 | * | ||
6 | * This contains i.MX21-specific hardware definitions. For those | ||
7 | * hardware pieces that are common between i.MX21 and i.MX27, have a | ||
8 | * look at mx2x.h. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version 2 | ||
13 | * of the License, or (at your option) any later version. | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
22 | * MA 02110-1301, USA. | ||
23 | */ | ||
24 | |||
25 | #ifndef __ASM_ARCH_MXC_MX21_H__ | ||
26 | #define __ASM_ARCH_MXC_MX21_H__ | ||
27 | |||
28 | #ifndef __ASM_ARCH_MXC_HARDWARE_H__ | ||
29 | #error "Do not include directly." | ||
30 | #endif | ||
31 | |||
32 | |||
33 | /* Memory regions and CS */ | ||
34 | #define SDRAM_BASE_ADDR 0xC0000000 | ||
35 | #define CSD1_BASE_ADDR 0xC4000000 | ||
36 | |||
37 | #define CS0_BASE_ADDR 0xC8000000 | ||
38 | #define CS1_BASE_ADDR 0xCC000000 | ||
39 | #define CS2_BASE_ADDR 0xD0000000 | ||
40 | #define CS3_BASE_ADDR 0xD1000000 | ||
41 | #define CS4_BASE_ADDR 0xD2000000 | ||
42 | #define CS5_BASE_ADDR 0xDD000000 | ||
43 | #define PCMCIA_MEM_BASE_ADDR 0xD4000000 | ||
44 | |||
45 | /* NAND, SDRAM, WEIM etc controllers */ | ||
46 | #define X_MEMC_BASE_ADDR 0xDF000000 | ||
47 | #define X_MEMC_BASE_ADDR_VIRT 0xF4200000 | ||
48 | #define X_MEMC_SIZE SZ_256K | ||
49 | |||
50 | #define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000) | ||
51 | #define EIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) | ||
52 | #define PCMCIA_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) | ||
53 | #define NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) | ||
54 | |||
55 | #define IRAM_BASE_ADDR 0xFFFFE800 /* internal ram */ | ||
56 | |||
57 | /* this CPU supports up to 192 GPIOs (don't forget the baseboard!) */ | ||
58 | #define ARCH_NR_GPIOS (6*32 + 16) | ||
59 | |||
60 | /* fixed interrupt numbers */ | ||
61 | #define MXC_INT_USBCTRL 58 | ||
62 | #define MXC_INT_USBCTRL 58 | ||
63 | #define MXC_INT_USBMNP 57 | ||
64 | #define MXC_INT_USBFUNC 56 | ||
65 | #define MXC_INT_USBHOST 55 | ||
66 | #define MXC_INT_USBDMA 54 | ||
67 | #define MXC_INT_USBWKUP 53 | ||
68 | #define MXC_INT_EMMADEC 50 | ||
69 | #define MXC_INT_EMMAENC 49 | ||
70 | #define MXC_INT_BMI 30 | ||
71 | #define MXC_INT_FIRI 9 | ||
72 | |||
73 | /* fixed DMA request numbers */ | ||
74 | #define DMA_REQ_BMI_RX 29 | ||
75 | #define DMA_REQ_BMI_TX 28 | ||
76 | #define DMA_REQ_FIRI_RX 4 | ||
77 | |||
78 | #endif /* __ASM_ARCH_MXC_MX21_H__ */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h index 0313be720552..6e93f2c0b7bb 100644 --- a/arch/arm/plat-mxc/include/mach/mx27.h +++ b/arch/arm/plat-mxc/include/mach/mx27.h | |||
@@ -2,6 +2,10 @@ | |||
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | 2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. |
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | 3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de |
4 | * | 4 | * |
5 | * This contains i.MX27-specific hardware definitions. For those | ||
6 | * hardware pieces that are common between i.MX21 and i.MX27, have a | ||
7 | * look at mx2x.h. | ||
8 | * | ||
5 | * This program is free software; you can redistribute it and/or | 9 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License | 10 | * modify it under the terms of the GNU General Public License |
7 | * as published by the Free Software Foundation; either version 2 | 11 | * as published by the Free Software Foundation; either version 2 |
@@ -27,35 +31,6 @@ | |||
27 | /* IRAM */ | 31 | /* IRAM */ |
28 | #define IRAM_BASE_ADDR 0xFFFF4C00 /* internal ram */ | 32 | #define IRAM_BASE_ADDR 0xFFFF4C00 /* internal ram */ |
29 | 33 | ||
30 | /* Register offests */ | ||
31 | #define AIPI_BASE_ADDR 0x10000000 | ||
32 | #define AIPI_BASE_ADDR_VIRT 0xF4000000 | ||
33 | #define AIPI_SIZE SZ_1M | ||
34 | |||
35 | #define DMA_BASE_ADDR (AIPI_BASE_ADDR + 0x01000) | ||
36 | #define WDOG_BASE_ADDR (AIPI_BASE_ADDR + 0x02000) | ||
37 | #define GPT1_BASE_ADDR (AIPI_BASE_ADDR + 0x03000) | ||
38 | #define GPT2_BASE_ADDR (AIPI_BASE_ADDR + 0x04000) | ||
39 | #define GPT3_BASE_ADDR (AIPI_BASE_ADDR + 0x05000) | ||
40 | #define PWM_BASE_ADDR (AIPI_BASE_ADDR + 0x06000) | ||
41 | #define RTC_BASE_ADDR (AIPI_BASE_ADDR + 0x07000) | ||
42 | #define KPP_BASE_ADDR (AIPI_BASE_ADDR + 0x08000) | ||
43 | #define OWIRE_BASE_ADDR (AIPI_BASE_ADDR + 0x09000) | ||
44 | #define UART1_BASE_ADDR (AIPI_BASE_ADDR + 0x0A000) | ||
45 | #define UART2_BASE_ADDR (AIPI_BASE_ADDR + 0x0B000) | ||
46 | #define UART3_BASE_ADDR (AIPI_BASE_ADDR + 0x0C000) | ||
47 | #define UART4_BASE_ADDR (AIPI_BASE_ADDR + 0x0D000) | ||
48 | #define CSPI1_BASE_ADDR (AIPI_BASE_ADDR + 0x0E000) | ||
49 | #define CSPI2_BASE_ADDR (AIPI_BASE_ADDR + 0x0F000) | ||
50 | #define SSI1_BASE_ADDR (AIPI_BASE_ADDR + 0x10000) | ||
51 | #define SSI2_BASE_ADDR (AIPI_BASE_ADDR + 0x11000) | ||
52 | #define I2C_BASE_ADDR (AIPI_BASE_ADDR + 0x12000) | ||
53 | #define SDHC1_BASE_ADDR (AIPI_BASE_ADDR + 0x13000) | ||
54 | #define SDHC2_BASE_ADDR (AIPI_BASE_ADDR + 0x14000) | ||
55 | #define GPIO_BASE_ADDR (AIPI_BASE_ADDR + 0x15000) | ||
56 | #define AUDMUX_BASE_ADDR (AIPI_BASE_ADDR + 0x16000) | ||
57 | |||
58 | #define CSPI3_BASE_ADDR (AIPI_BASE_ADDR + 0x17000) | ||
59 | #define MSHC_BASE_ADDR (AIPI_BASE_ADDR + 0x18000) | 34 | #define MSHC_BASE_ADDR (AIPI_BASE_ADDR + 0x18000) |
60 | #define GPT5_BASE_ADDR (AIPI_BASE_ADDR + 0x19000) | 35 | #define GPT5_BASE_ADDR (AIPI_BASE_ADDR + 0x19000) |
61 | #define GPT4_BASE_ADDR (AIPI_BASE_ADDR + 0x1A000) | 36 | #define GPT4_BASE_ADDR (AIPI_BASE_ADDR + 0x1A000) |
@@ -64,55 +39,24 @@ | |||
64 | #define I2C2_BASE_ADDR (AIPI_BASE_ADDR + 0x1D000) | 39 | #define I2C2_BASE_ADDR (AIPI_BASE_ADDR + 0x1D000) |
65 | #define SDHC3_BASE_ADDR (AIPI_BASE_ADDR + 0x1E000) | 40 | #define SDHC3_BASE_ADDR (AIPI_BASE_ADDR + 0x1E000) |
66 | #define GPT6_BASE_ADDR (AIPI_BASE_ADDR + 0x1F000) | 41 | #define GPT6_BASE_ADDR (AIPI_BASE_ADDR + 0x1F000) |
67 | |||
68 | #define LCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x21000) | ||
69 | #define SLCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x22000) | ||
70 | #define VPU_BASE_ADDR (AIPI_BASE_ADDR + 0x23000) | 42 | #define VPU_BASE_ADDR (AIPI_BASE_ADDR + 0x23000) |
71 | #define USBOTG_BASE_ADDR (AIPI_BASE_ADDR + 0x24000) | ||
72 | /* for mx27*/ | ||
73 | #define OTG_BASE_ADDR USBOTG_BASE_ADDR | 43 | #define OTG_BASE_ADDR USBOTG_BASE_ADDR |
74 | #define SAHARA_BASE_ADDR (AIPI_BASE_ADDR + 0x25000) | 44 | #define SAHARA_BASE_ADDR (AIPI_BASE_ADDR + 0x25000) |
75 | #define EMMA_PP_BASE_ADDR (AIPI_BASE_ADDR + 0x26000) | ||
76 | #define EMMA_PRP_BASE_ADDR (AIPI_BASE_ADDR + 0x26400) | ||
77 | #define CCM_BASE_ADDR (AIPI_BASE_ADDR + 0x27000) | ||
78 | #define SYSCTRL_BASE_ADDR (AIPI_BASE_ADDR + 0x27800) | ||
79 | #define IIM_BASE_ADDR (AIPI_BASE_ADDR + 0x28000) | 45 | #define IIM_BASE_ADDR (AIPI_BASE_ADDR + 0x28000) |
80 | |||
81 | #define RTIC_BASE_ADDR (AIPI_BASE_ADDR + 0x2A000) | 46 | #define RTIC_BASE_ADDR (AIPI_BASE_ADDR + 0x2A000) |
82 | #define FEC_BASE_ADDR (AIPI_BASE_ADDR + 0x2B000) | 47 | #define FEC_BASE_ADDR (AIPI_BASE_ADDR + 0x2B000) |
83 | #define SCC_BASE_ADDR (AIPI_BASE_ADDR + 0x2C000) | 48 | #define SCC_BASE_ADDR (AIPI_BASE_ADDR + 0x2C000) |
84 | #define ETB_BASE_ADDR (AIPI_BASE_ADDR + 0x3B000) | 49 | #define ETB_BASE_ADDR (AIPI_BASE_ADDR + 0x3B000) |
85 | #define ETB_RAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3C000) | 50 | #define ETB_RAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3C000) |
86 | 51 | ||
87 | #define JAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3E000) | 52 | /* ROM patch */ |
88 | #define MAX_BASE_ADDR (AIPI_BASE_ADDR + 0x3F000) | ||
89 | |||
90 | /* ROMP and AVIC */ | ||
91 | #define ROMP_BASE_ADDR 0x10041000 | 53 | #define ROMP_BASE_ADDR 0x10041000 |
92 | 54 | ||
93 | #define AVIC_BASE_ADDR 0x10040000 | ||
94 | |||
95 | #define SAHB1_BASE_ADDR 0x80000000 | ||
96 | #define SAHB1_BASE_ADDR_VIRT 0xF4100000 | ||
97 | #define SAHB1_SIZE SZ_1M | ||
98 | |||
99 | #define CSI_BASE_ADDR (SAHB1_BASE_ADDR + 0x0000) | ||
100 | #define ATA_BASE_ADDR (SAHB1_BASE_ADDR + 0x1000) | 55 | #define ATA_BASE_ADDR (SAHB1_BASE_ADDR + 0x1000) |
101 | 56 | ||
102 | /* NAND, SDRAM, WEIM, M3IF, EMI controllers */ | ||
103 | #define X_MEMC_BASE_ADDR 0xD8000000 | ||
104 | #define X_MEMC_BASE_ADDR_VIRT 0xF4200000 | ||
105 | #define X_MEMC_SIZE SZ_1M | ||
106 | |||
107 | #define NFC_BASE_ADDR (X_MEMC_BASE_ADDR) | ||
108 | #define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) | ||
109 | #define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) | ||
110 | #define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) | ||
111 | #define PCMCIA_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) | ||
112 | |||
113 | /* Memory regions and CS */ | 57 | /* Memory regions and CS */ |
114 | #define SDRAM_BASE_ADDR 0xA0000000 | 58 | #define SDRAM_BASE_ADDR 0xA0000000 |
115 | #define CSD1_BASE_ADDR 0xB0000000 | 59 | #define CSD1_BASE_ADDR 0xB0000000 |
116 | 60 | ||
117 | #define CS0_BASE_ADDR 0xC0000000 | 61 | #define CS0_BASE_ADDR 0xC0000000 |
118 | #define CS1_BASE_ADDR 0xC8000000 | 62 | #define CS1_BASE_ADDR 0xC8000000 |
@@ -122,44 +66,20 @@ | |||
122 | #define CS5_BASE_ADDR 0xD6000000 | 66 | #define CS5_BASE_ADDR 0xD6000000 |
123 | #define PCMCIA_MEM_BASE_ADDR 0xDC000000 | 67 | #define PCMCIA_MEM_BASE_ADDR 0xDC000000 |
124 | 68 | ||
125 | /* | 69 | /* NAND, SDRAM, WEIM, M3IF, EMI controllers */ |
126 | * This macro defines the physical to virtual address mapping for all the | 70 | #define X_MEMC_BASE_ADDR 0xD8000000 |
127 | * peripheral modules. It is used by passing in the physical address as x | 71 | #define X_MEMC_BASE_ADDR_VIRT 0xF4200000 |
128 | * and returning the virtual address. If the physical address is not mapped, | 72 | #define X_MEMC_SIZE SZ_1M |
129 | * it returns 0xDEADBEEF | ||
130 | */ | ||
131 | #define IO_ADDRESS(x) \ | ||
132 | (void __iomem *) \ | ||
133 | (((x >= AIPI_BASE_ADDR) && (x < (AIPI_BASE_ADDR + AIPI_SIZE))) ? \ | ||
134 | AIPI_IO_ADDRESS(x) : \ | ||
135 | ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \ | ||
136 | SAHB1_IO_ADDRESS(x) : \ | ||
137 | ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \ | ||
138 | X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF) | ||
139 | |||
140 | /* define the address mapping macros: in physical address order */ | ||
141 | #define AIPI_IO_ADDRESS(x) \ | ||
142 | (((x) - AIPI_BASE_ADDR) + AIPI_BASE_ADDR_VIRT) | ||
143 | |||
144 | #define AVIC_IO_ADDRESS(x) AIPI_IO_ADDRESS(x) | ||
145 | |||
146 | #define SAHB1_IO_ADDRESS(x) \ | ||
147 | (((x) - SAHB1_BASE_ADDR) + SAHB1_BASE_ADDR_VIRT) | ||
148 | |||
149 | #define CS4_IO_ADDRESS(x) \ | ||
150 | (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT) | ||
151 | |||
152 | #define X_MEMC_IO_ADDRESS(x) \ | ||
153 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | ||
154 | 73 | ||
155 | #define PCMCIA_IO_ADDRESS(x) \ | 74 | #define NFC_BASE_ADDR (X_MEMC_BASE_ADDR) |
156 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | 75 | #define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) |
76 | #define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) | ||
77 | #define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) | ||
78 | #define PCMCIA_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) | ||
157 | 79 | ||
158 | /* fixed interrput numbers */ | 80 | /* fixed interrupt numbers */ |
159 | #define MXC_INT_CCM 63 | 81 | #define MXC_INT_CCM 63 |
160 | #define MXC_INT_IIM 62 | 82 | #define MXC_INT_IIM 62 |
161 | #define MXC_INT_LCDC 61 | ||
162 | #define MXC_INT_SLCDC 60 | ||
163 | #define MXC_INT_SAHARA 59 | 83 | #define MXC_INT_SAHARA 59 |
164 | #define MXC_INT_SCC_SCM 58 | 84 | #define MXC_INT_SCC_SCM 58 |
165 | #define MXC_INT_SCC_SMN 57 | 85 | #define MXC_INT_SCC_SMN 57 |
@@ -167,54 +87,12 @@ | |||
167 | #define MXC_INT_USB2 55 | 87 | #define MXC_INT_USB2 55 |
168 | #define MXC_INT_USB1 54 | 88 | #define MXC_INT_USB1 54 |
169 | #define MXC_INT_VPU 53 | 89 | #define MXC_INT_VPU 53 |
170 | #define MXC_INT_EMMAPP 52 | ||
171 | #define MXC_INT_EMMAPRP 51 | ||
172 | #define MXC_INT_FEC 50 | 90 | #define MXC_INT_FEC 50 |
173 | #define MXC_INT_UART5 49 | 91 | #define MXC_INT_UART5 49 |
174 | #define MXC_INT_UART6 48 | 92 | #define MXC_INT_UART6 48 |
175 | #define MXC_INT_DMACH15 47 | ||
176 | #define MXC_INT_DMACH14 46 | ||
177 | #define MXC_INT_DMACH13 45 | ||
178 | #define MXC_INT_DMACH12 44 | ||
179 | #define MXC_INT_DMACH11 43 | ||
180 | #define MXC_INT_DMACH10 42 | ||
181 | #define MXC_INT_DMACH9 41 | ||
182 | #define MXC_INT_DMACH8 40 | ||
183 | #define MXC_INT_DMACH7 39 | ||
184 | #define MXC_INT_DMACH6 38 | ||
185 | #define MXC_INT_DMACH5 37 | ||
186 | #define MXC_INT_DMACH4 36 | ||
187 | #define MXC_INT_DMACH3 35 | ||
188 | #define MXC_INT_DMACH2 34 | ||
189 | #define MXC_INT_DMACH1 33 | ||
190 | #define MXC_INT_DMACH0 32 | ||
191 | #define MXC_INT_CSI 31 | ||
192 | #define MXC_INT_ATA 30 | 93 | #define MXC_INT_ATA 30 |
193 | #define MXC_INT_NANDFC 29 | ||
194 | #define MXC_INT_PCMCIA 28 | ||
195 | #define MXC_INT_WDOG 27 | ||
196 | #define MXC_INT_GPT1 26 | ||
197 | #define MXC_INT_GPT2 25 | ||
198 | #define MXC_INT_GPT3 24 | ||
199 | #define MXC_INT_GPT INT_GPT1 | ||
200 | #define MXC_INT_PWM 23 | ||
201 | #define MXC_INT_RTC 22 | ||
202 | #define MXC_INT_KPP 21 | ||
203 | #define MXC_INT_UART1 20 | ||
204 | #define MXC_INT_UART2 19 | ||
205 | #define MXC_INT_UART3 18 | ||
206 | #define MXC_INT_UART4 17 | ||
207 | #define MXC_INT_CSPI1 16 | ||
208 | #define MXC_INT_CSPI2 15 | ||
209 | #define MXC_INT_SSI1 14 | ||
210 | #define MXC_INT_SSI2 13 | ||
211 | #define MXC_INT_I2C 12 | ||
212 | #define MXC_INT_SDHC1 11 | ||
213 | #define MXC_INT_SDHC2 10 | ||
214 | #define MXC_INT_SDHC3 9 | 94 | #define MXC_INT_SDHC3 9 |
215 | #define MXC_INT_GPIO 8 | ||
216 | #define MXC_INT_SDHC 7 | 95 | #define MXC_INT_SDHC 7 |
217 | #define MXC_INT_CSPI3 6 | ||
218 | #define MXC_INT_RTIC 5 | 96 | #define MXC_INT_RTIC 5 |
219 | #define MXC_INT_GPT4 4 | 97 | #define MXC_INT_GPT4 4 |
220 | #define MXC_INT_GPT5 3 | 98 | #define MXC_INT_GPT5 3 |
@@ -228,36 +106,9 @@ | |||
228 | #define DMA_REQ_UART6_TX 34 | 106 | #define DMA_REQ_UART6_TX 34 |
229 | #define DMA_REQ_UART5_RX 33 | 107 | #define DMA_REQ_UART5_RX 33 |
230 | #define DMA_REQ_UART5_TX 32 | 108 | #define DMA_REQ_UART5_TX 32 |
231 | #define DMA_REQ_CSI_RX 31 | ||
232 | #define DMA_REQ_CSI_STAT 30 | ||
233 | #define DMA_REQ_ATA_RCV 29 | 109 | #define DMA_REQ_ATA_RCV 29 |
234 | #define DMA_REQ_ATA_TX 28 | 110 | #define DMA_REQ_ATA_TX 28 |
235 | #define DMA_REQ_UART1_TX 27 | ||
236 | #define DMA_REQ_UART1_RX 26 | ||
237 | #define DMA_REQ_UART2_TX 25 | ||
238 | #define DMA_REQ_UART2_RX 24 | ||
239 | #define DMA_REQ_UART3_TX 23 | ||
240 | #define DMA_REQ_UART3_RX 22 | ||
241 | #define DMA_REQ_UART4_TX 21 | ||
242 | #define DMA_REQ_UART4_RX 20 | ||
243 | #define DMA_REQ_CSPI1_TX 19 | ||
244 | #define DMA_REQ_CSPI1_RX 18 | ||
245 | #define DMA_REQ_CSPI2_TX 17 | ||
246 | #define DMA_REQ_CSPI2_RX 16 | ||
247 | #define DMA_REQ_SSI1_TX1 15 | ||
248 | #define DMA_REQ_SSI1_RX1 14 | ||
249 | #define DMA_REQ_SSI1_TX0 13 | ||
250 | #define DMA_REQ_SSI1_RX0 12 | ||
251 | #define DMA_REQ_SSI2_TX1 11 | ||
252 | #define DMA_REQ_SSI2_RX1 10 | ||
253 | #define DMA_REQ_SSI2_TX0 9 | ||
254 | #define DMA_REQ_SSI2_RX0 8 | ||
255 | #define DMA_REQ_SDHC1 7 | ||
256 | #define DMA_REQ_SDHC2 6 | ||
257 | #define DMA_REQ_MSHC 4 | 111 | #define DMA_REQ_MSHC 4 |
258 | #define DMA_REQ_EXT 3 | ||
259 | #define DMA_REQ_CSPI3_TX 2 | ||
260 | #define DMA_REQ_CSPI3_RX 1 | ||
261 | 112 | ||
262 | /* silicon revisions specific to i.MX27 */ | 113 | /* silicon revisions specific to i.MX27 */ |
263 | #define CHIP_REV_1_0 0x00 | 114 | #define CHIP_REV_1_0 0x00 |
@@ -267,25 +118,8 @@ | |||
267 | extern int mx27_revision(void); | 118 | extern int mx27_revision(void); |
268 | #endif | 119 | #endif |
269 | 120 | ||
270 | /* gpio and gpio based interrupt handling */ | ||
271 | #define GPIO_DR 0x1C | ||
272 | #define GPIO_GDIR 0x00 | ||
273 | #define GPIO_PSR 0x24 | ||
274 | #define GPIO_ICR1 0x28 | ||
275 | #define GPIO_ICR2 0x2C | ||
276 | #define GPIO_IMR 0x30 | ||
277 | #define GPIO_ISR 0x34 | ||
278 | #define GPIO_INT_LOW_LEV 0x3 | ||
279 | #define GPIO_INT_HIGH_LEV 0x2 | ||
280 | #define GPIO_INT_RISE_EDGE 0x0 | ||
281 | #define GPIO_INT_FALL_EDGE 0x1 | ||
282 | #define GPIO_INT_NONE 0x4 | ||
283 | |||
284 | /* Mandatory defines used globally */ | 121 | /* Mandatory defines used globally */ |
285 | 122 | ||
286 | /* this is an i.MX27 CPU */ | ||
287 | #define cpu_is_mx27() (1) | ||
288 | |||
289 | /* this CPU supports up to 192 GPIOs (don't forget the baseboard!) */ | 123 | /* this CPU supports up to 192 GPIOs (don't forget the baseboard!) */ |
290 | #define ARCH_NR_GPIOS (192 + 16) | 124 | #define ARCH_NR_GPIOS (192 + 16) |
291 | 125 | ||
diff --git a/arch/arm/plat-mxc/include/mach/mx2x.h b/arch/arm/plat-mxc/include/mach/mx2x.h new file mode 100644 index 000000000000..fc40d3ab8c5b --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/mx2x.h | |||
@@ -0,0 +1,200 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
4 | * | ||
5 | * This contains hardware definitions that are common between i.MX21 and | ||
6 | * i.MX27. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version 2 | ||
11 | * of the License, or (at your option) any later version. | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
20 | * MA 02110-1301, USA. | ||
21 | */ | ||
22 | |||
23 | #ifndef __ASM_ARCH_MXC_MX2x_H__ | ||
24 | #define __ASM_ARCH_MXC_MX2x_H__ | ||
25 | |||
26 | #ifndef __ASM_ARCH_MXC_HARDWARE_H__ | ||
27 | #error "Do not include directly." | ||
28 | #endif | ||
29 | |||
30 | /* The following addresses are common between i.MX21 and i.MX27 */ | ||
31 | |||
32 | /* Register offests */ | ||
33 | #define AIPI_BASE_ADDR 0x10000000 | ||
34 | #define AIPI_BASE_ADDR_VIRT 0xF4000000 | ||
35 | #define AIPI_SIZE SZ_1M | ||
36 | |||
37 | #define DMA_BASE_ADDR (AIPI_BASE_ADDR + 0x01000) | ||
38 | #define WDOG_BASE_ADDR (AIPI_BASE_ADDR + 0x02000) | ||
39 | #define GPT1_BASE_ADDR (AIPI_BASE_ADDR + 0x03000) | ||
40 | #define GPT2_BASE_ADDR (AIPI_BASE_ADDR + 0x04000) | ||
41 | #define GPT3_BASE_ADDR (AIPI_BASE_ADDR + 0x05000) | ||
42 | #define PWM_BASE_ADDR (AIPI_BASE_ADDR + 0x06000) | ||
43 | #define RTC_BASE_ADDR (AIPI_BASE_ADDR + 0x07000) | ||
44 | #define KPP_BASE_ADDR (AIPI_BASE_ADDR + 0x08000) | ||
45 | #define OWIRE_BASE_ADDR (AIPI_BASE_ADDR + 0x09000) | ||
46 | #define UART1_BASE_ADDR (AIPI_BASE_ADDR + 0x0A000) | ||
47 | #define UART2_BASE_ADDR (AIPI_BASE_ADDR + 0x0B000) | ||
48 | #define UART3_BASE_ADDR (AIPI_BASE_ADDR + 0x0C000) | ||
49 | #define UART4_BASE_ADDR (AIPI_BASE_ADDR + 0x0D000) | ||
50 | #define CSPI1_BASE_ADDR (AIPI_BASE_ADDR + 0x0E000) | ||
51 | #define CSPI2_BASE_ADDR (AIPI_BASE_ADDR + 0x0F000) | ||
52 | #define SSI1_BASE_ADDR (AIPI_BASE_ADDR + 0x10000) | ||
53 | #define SSI2_BASE_ADDR (AIPI_BASE_ADDR + 0x11000) | ||
54 | #define I2C_BASE_ADDR (AIPI_BASE_ADDR + 0x12000) | ||
55 | #define SDHC1_BASE_ADDR (AIPI_BASE_ADDR + 0x13000) | ||
56 | #define SDHC2_BASE_ADDR (AIPI_BASE_ADDR + 0x14000) | ||
57 | #define GPIO_BASE_ADDR (AIPI_BASE_ADDR + 0x15000) | ||
58 | #define AUDMUX_BASE_ADDR (AIPI_BASE_ADDR + 0x16000) | ||
59 | #define CSPI3_BASE_ADDR (AIPI_BASE_ADDR + 0x17000) | ||
60 | #define LCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x21000) | ||
61 | #define SLCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x22000) | ||
62 | #define USBOTG_BASE_ADDR (AIPI_BASE_ADDR + 0x24000) | ||
63 | #define EMMA_PP_BASE_ADDR (AIPI_BASE_ADDR + 0x26000) | ||
64 | #define EMMA_PRP_BASE_ADDR (AIPI_BASE_ADDR + 0x26400) | ||
65 | #define CCM_BASE_ADDR (AIPI_BASE_ADDR + 0x27000) | ||
66 | #define SYSCTRL_BASE_ADDR (AIPI_BASE_ADDR + 0x27800) | ||
67 | #define JAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3E000) | ||
68 | #define MAX_BASE_ADDR (AIPI_BASE_ADDR + 0x3F000) | ||
69 | |||
70 | #define AVIC_BASE_ADDR 0x10040000 | ||
71 | |||
72 | #define SAHB1_BASE_ADDR 0x80000000 | ||
73 | #define SAHB1_BASE_ADDR_VIRT 0xF4100000 | ||
74 | #define SAHB1_SIZE SZ_1M | ||
75 | |||
76 | #define CSI_BASE_ADDR (SAHB1_BASE_ADDR + 0x0000) | ||
77 | |||
78 | /* | ||
79 | * This macro defines the physical to virtual address mapping for all the | ||
80 | * peripheral modules. It is used by passing in the physical address as x | ||
81 | * and returning the virtual address. If the physical address is not mapped, | ||
82 | * it returns 0xDEADBEEF | ||
83 | */ | ||
84 | #define IO_ADDRESS(x) \ | ||
85 | (void __force __iomem *) \ | ||
86 | (((x >= AIPI_BASE_ADDR) && (x < (AIPI_BASE_ADDR + AIPI_SIZE))) ? \ | ||
87 | AIPI_IO_ADDRESS(x) : \ | ||
88 | ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \ | ||
89 | SAHB1_IO_ADDRESS(x) : \ | ||
90 | ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \ | ||
91 | X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF) | ||
92 | |||
93 | /* define the address mapping macros: in physical address order */ | ||
94 | #define AIPI_IO_ADDRESS(x) \ | ||
95 | (((x) - AIPI_BASE_ADDR) + AIPI_BASE_ADDR_VIRT) | ||
96 | |||
97 | #define AVIC_IO_ADDRESS(x) AIPI_IO_ADDRESS(x) | ||
98 | |||
99 | #define SAHB1_IO_ADDRESS(x) \ | ||
100 | (((x) - SAHB1_BASE_ADDR) + SAHB1_BASE_ADDR_VIRT) | ||
101 | |||
102 | #define CS4_IO_ADDRESS(x) \ | ||
103 | (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT) | ||
104 | |||
105 | #define X_MEMC_IO_ADDRESS(x) \ | ||
106 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | ||
107 | |||
108 | #define PCMCIA_IO_ADDRESS(x) \ | ||
109 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | ||
110 | |||
111 | /* fixed interrupt numbers */ | ||
112 | #define MXC_INT_LCDC 61 | ||
113 | #define MXC_INT_SLCDC 60 | ||
114 | #define MXC_INT_EMMAPP 52 | ||
115 | #define MXC_INT_EMMAPRP 51 | ||
116 | #define MXC_INT_DMACH15 47 | ||
117 | #define MXC_INT_DMACH14 46 | ||
118 | #define MXC_INT_DMACH13 45 | ||
119 | #define MXC_INT_DMACH12 44 | ||
120 | #define MXC_INT_DMACH11 43 | ||
121 | #define MXC_INT_DMACH10 42 | ||
122 | #define MXC_INT_DMACH9 41 | ||
123 | #define MXC_INT_DMACH8 40 | ||
124 | #define MXC_INT_DMACH7 39 | ||
125 | #define MXC_INT_DMACH6 38 | ||
126 | #define MXC_INT_DMACH5 37 | ||
127 | #define MXC_INT_DMACH4 36 | ||
128 | #define MXC_INT_DMACH3 35 | ||
129 | #define MXC_INT_DMACH2 34 | ||
130 | #define MXC_INT_DMACH1 33 | ||
131 | #define MXC_INT_DMACH0 32 | ||
132 | #define MXC_INT_CSI 31 | ||
133 | #define MXC_INT_NANDFC 29 | ||
134 | #define MXC_INT_PCMCIA 28 | ||
135 | #define MXC_INT_WDOG 27 | ||
136 | #define MXC_INT_GPT1 26 | ||
137 | #define MXC_INT_GPT2 25 | ||
138 | #define MXC_INT_GPT3 24 | ||
139 | #define MXC_INT_GPT INT_GPT1 | ||
140 | #define MXC_INT_PWM 23 | ||
141 | #define MXC_INT_RTC 22 | ||
142 | #define MXC_INT_KPP 21 | ||
143 | #define MXC_INT_UART1 20 | ||
144 | #define MXC_INT_UART2 19 | ||
145 | #define MXC_INT_UART3 18 | ||
146 | #define MXC_INT_UART4 17 | ||
147 | #define MXC_INT_CSPI1 16 | ||
148 | #define MXC_INT_CSPI2 15 | ||
149 | #define MXC_INT_SSI1 14 | ||
150 | #define MXC_INT_SSI2 13 | ||
151 | #define MXC_INT_I2C 12 | ||
152 | #define MXC_INT_SDHC1 11 | ||
153 | #define MXC_INT_SDHC2 10 | ||
154 | #define MXC_INT_GPIO 8 | ||
155 | #define MXC_INT_CSPI3 6 | ||
156 | |||
157 | /* gpio and gpio based interrupt handling */ | ||
158 | #define GPIO_DR 0x1C | ||
159 | #define GPIO_GDIR 0x00 | ||
160 | #define GPIO_PSR 0x24 | ||
161 | #define GPIO_ICR1 0x28 | ||
162 | #define GPIO_ICR2 0x2C | ||
163 | #define GPIO_IMR 0x30 | ||
164 | #define GPIO_ISR 0x34 | ||
165 | #define GPIO_INT_LOW_LEV 0x3 | ||
166 | #define GPIO_INT_HIGH_LEV 0x2 | ||
167 | #define GPIO_INT_RISE_EDGE 0x0 | ||
168 | #define GPIO_INT_FALL_EDGE 0x1 | ||
169 | #define GPIO_INT_NONE 0x4 | ||
170 | |||
171 | /* fixed DMA request numbers */ | ||
172 | #define DMA_REQ_CSI_RX 31 | ||
173 | #define DMA_REQ_CSI_STAT 30 | ||
174 | #define DMA_REQ_UART1_TX 27 | ||
175 | #define DMA_REQ_UART1_RX 26 | ||
176 | #define DMA_REQ_UART2_TX 25 | ||
177 | #define DMA_REQ_UART2_RX 24 | ||
178 | #define DMA_REQ_UART3_TX 23 | ||
179 | #define DMA_REQ_UART3_RX 22 | ||
180 | #define DMA_REQ_UART4_TX 21 | ||
181 | #define DMA_REQ_UART4_RX 20 | ||
182 | #define DMA_REQ_CSPI1_TX 19 | ||
183 | #define DMA_REQ_CSPI1_RX 18 | ||
184 | #define DMA_REQ_CSPI2_TX 17 | ||
185 | #define DMA_REQ_CSPI2_RX 16 | ||
186 | #define DMA_REQ_SSI1_TX1 15 | ||
187 | #define DMA_REQ_SSI1_RX1 14 | ||
188 | #define DMA_REQ_SSI1_TX0 13 | ||
189 | #define DMA_REQ_SSI1_RX0 12 | ||
190 | #define DMA_REQ_SSI2_TX1 11 | ||
191 | #define DMA_REQ_SSI2_RX1 10 | ||
192 | #define DMA_REQ_SSI2_TX0 9 | ||
193 | #define DMA_REQ_SSI2_RX0 8 | ||
194 | #define DMA_REQ_SDHC1 7 | ||
195 | #define DMA_REQ_SDHC2 6 | ||
196 | #define DMA_REQ_EXT 3 | ||
197 | #define DMA_REQ_CSPI3_TX 2 | ||
198 | #define DMA_REQ_CSPI3_RX 1 | ||
199 | |||
200 | #endif /* __ASM_ARCH_MXC_MX2x_H__ */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h index de026654b00e..0b06941b6139 100644 --- a/arch/arm/plat-mxc/include/mach/mx31.h +++ b/arch/arm/plat-mxc/include/mach/mx31.h | |||
@@ -1,360 +1,45 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | */ | ||
4 | |||
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 | #ifndef __ASM_ARCH_MXC_MX31_H__ | ||
12 | #define __ASM_ARCH_MXC_MX31_H__ | ||
13 | |||
14 | #ifndef __ASM_ARCH_MXC_HARDWARE_H__ | ||
15 | #error "Do not include directly." | ||
16 | #endif | ||
17 | |||
18 | /* | ||
19 | * MX31 memory map: | ||
20 | * | ||
21 | * Virt Phys Size What | ||
22 | * --------------------------------------------------------------------------- | ||
23 | * F8000000 1FFC0000 16K IRAM | ||
24 | * F9000000 30000000 256M L2CC | ||
25 | * FC000000 43F00000 1M AIPS 1 | ||
26 | * FC100000 50000000 1M SPBA | ||
27 | * FC200000 53F00000 1M AIPS 2 | ||
28 | * FC500000 60000000 128M ROMPATCH | ||
29 | * FC400000 68000000 128M AVIC | ||
30 | * 70000000 256M IPU (MAX M2) | ||
31 | * 80000000 256M CSD0 SDRAM/DDR | ||
32 | * 90000000 256M CSD1 SDRAM/DDR | ||
33 | * A0000000 128M CS0 Flash | ||
34 | * A8000000 128M CS1 Flash | ||
35 | * B0000000 32M CS2 | ||
36 | * B2000000 32M CS3 | ||
37 | * F4000000 B4000000 32M CS4 | ||
38 | * B6000000 32M CS5 | ||
39 | * FC320000 B8000000 64K NAND, SDRAM, WEIM, M3IF, EMI controllers | ||
40 | * C0000000 64M PCMCIA/CF | ||
41 | */ | ||
42 | |||
43 | #define CS0_BASE_ADDR 0xA0000000 | ||
44 | #define CS1_BASE_ADDR 0xA8000000 | ||
45 | #define CS2_BASE_ADDR 0xB0000000 | ||
46 | #define CS3_BASE_ADDR 0xB2000000 | ||
47 | |||
48 | #define CS4_BASE_ADDR 0xB4000000 | ||
49 | #define CS4_BASE_ADDR_VIRT 0xF4000000 | ||
50 | #define CS4_SIZE SZ_32M | ||
51 | |||
52 | #define CS5_BASE_ADDR 0xB6000000 | ||
53 | #define PCMCIA_MEM_BASE_ADDR 0xBC000000 | ||
54 | |||
55 | /* | ||
56 | * IRAM | 2 | * IRAM |
57 | */ | 3 | */ |
58 | #define IRAM_BASE_ADDR 0x1FFC0000 /* internal ram */ | 4 | #define MX31_IRAM_BASE_ADDR 0x1FFC0000 /* internal ram */ |
59 | #define IRAM_BASE_ADDR_VIRT 0xF8000000 | 5 | #define MX31_IRAM_SIZE SZ_16K |
60 | #define IRAM_SIZE SZ_16K | ||
61 | |||
62 | /* | ||
63 | * L2CC | ||
64 | */ | ||
65 | #define L2CC_BASE_ADDR 0x30000000 | ||
66 | #define L2CC_BASE_ADDR_VIRT 0xF9000000 | ||
67 | #define L2CC_SIZE SZ_1M | ||
68 | |||
69 | /* | ||
70 | * AIPS 1 | ||
71 | */ | ||
72 | #define AIPS1_BASE_ADDR 0x43F00000 | ||
73 | #define AIPS1_BASE_ADDR_VIRT 0xFC000000 | ||
74 | #define AIPS1_SIZE SZ_1M | ||
75 | 6 | ||
76 | #define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000) | ||
77 | #define EVTMON_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000) | ||
78 | #define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000) | ||
79 | #define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000) | ||
80 | #define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000) | ||
81 | #define ECT_CTIO_BASE_ADDR (AIPS1_BASE_ADDR + 0x00018000) | ||
82 | #define I2C_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000) | ||
83 | #define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000) | ||
84 | #define OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000) | 7 | #define OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000) |
85 | #define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000) | 8 | #define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000) |
86 | #define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000) | ||
87 | #define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000) | ||
88 | #define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000) | ||
89 | #define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000) | ||
90 | #define SSI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000) | ||
91 | #define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000) | ||
92 | #define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000) | ||
93 | #define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000) | ||
94 | #define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000) | 9 | #define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000) |
95 | #define UART5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000) | 10 | #define UART5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000) |
96 | #define ECT_IP1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000) | ||
97 | #define ECT_IP2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000) | ||
98 | |||
99 | /* | ||
100 | * SPBA global module enabled #0 | ||
101 | */ | ||
102 | #define SPBA0_BASE_ADDR 0x50000000 | ||
103 | #define SPBA0_BASE_ADDR_VIRT 0xFC100000 | ||
104 | #define SPBA0_SIZE SZ_1M | ||
105 | 11 | ||
106 | #define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) | 12 | #define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) |
107 | #define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) | 13 | #define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) |
108 | #define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000) | ||
109 | #define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000) | ||
110 | #define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000) | ||
111 | #define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000) | 14 | #define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000) |
112 | #define IIM_BASE_ADDR (SPBA0_BASE_ADDR + 0x0001C000) | 15 | #define IIM_BASE_ADDR (SPBA0_BASE_ADDR + 0x0001C000) |
113 | #define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000) | ||
114 | #define MSHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) | ||
115 | #define MSHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) | ||
116 | #define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000) | ||
117 | 16 | ||
118 | /* | ||
119 | * AIPS 2 | ||
120 | */ | ||
121 | #define AIPS2_BASE_ADDR 0x53F00000 | ||
122 | #define AIPS2_BASE_ADDR_VIRT 0xFC200000 | ||
123 | #define AIPS2_SIZE SZ_1M | ||
124 | #define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000) | ||
125 | #define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) | 17 | #define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) |
126 | #define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000) | 18 | #define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000) |
127 | #define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000) | ||
128 | #define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000) | ||
129 | #define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000) | ||
130 | #define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000) | ||
131 | #define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000) | ||
132 | #define SCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AE000) | 19 | #define SCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AE000) |
133 | #define SMN_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AF000) | 20 | #define SMN_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AF000) |
134 | #define RNGA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000) | ||
135 | #define IPU_CTRL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000) | ||
136 | #define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000) | ||
137 | #define MPEG4_ENC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) | 21 | #define MPEG4_ENC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) |
138 | #define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000) | ||
139 | #define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000) | ||
140 | #define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000) | ||
141 | #define RTC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000) | ||
142 | #define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000) | ||
143 | #define PWM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000) | ||
144 | #define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000) | ||
145 | |||
146 | /* | ||
147 | * ROMP and AVIC | ||
148 | */ | ||
149 | #define ROMP_BASE_ADDR 0x60000000 | ||
150 | #define ROMP_BASE_ADDR_VIRT 0xFC500000 | ||
151 | #define ROMP_SIZE SZ_1M | ||
152 | |||
153 | #define AVIC_BASE_ADDR 0x68000000 | ||
154 | #define AVIC_BASE_ADDR_VIRT 0xFC400000 | ||
155 | #define AVIC_SIZE SZ_1M | ||
156 | |||
157 | /* | ||
158 | * NAND, SDRAM, WEIM, M3IF, EMI controllers | ||
159 | */ | ||
160 | #define X_MEMC_BASE_ADDR 0xB8000000 | ||
161 | #define X_MEMC_BASE_ADDR_VIRT 0xFC320000 | ||
162 | #define X_MEMC_SIZE SZ_64K | ||
163 | 22 | ||
164 | #define NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000) | 23 | #define MX31_NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000) |
165 | #define ESDCTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) | ||
166 | #define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) | ||
167 | #define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) | ||
168 | #define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) | ||
169 | #define PCMCIA_CTL_BASE_ADDR EMI_CTL_BASE_ADDR | ||
170 | 24 | ||
171 | /* | ||
172 | * Memory regions and CS | ||
173 | */ | ||
174 | #define IPU_MEM_BASE_ADDR 0x70000000 | ||
175 | #define CSD0_BASE_ADDR 0x80000000 | ||
176 | #define CSD1_BASE_ADDR 0x90000000 | ||
177 | #define CS0_BASE_ADDR 0xA0000000 | ||
178 | #define CS1_BASE_ADDR 0xA8000000 | ||
179 | #define CS2_BASE_ADDR 0xB0000000 | ||
180 | #define CS3_BASE_ADDR 0xB2000000 | ||
181 | |||
182 | #define CS4_BASE_ADDR 0xB4000000 | ||
183 | #define CS4_BASE_ADDR_VIRT 0xF4000000 | ||
184 | #define CS4_SIZE SZ_32M | ||
185 | |||
186 | #define CS5_BASE_ADDR 0xB6000000 | ||
187 | #define PCMCIA_MEM_BASE_ADDR 0xBC000000 | ||
188 | |||
189 | /*! | ||
190 | * This macro defines the physical to virtual address mapping for all the | ||
191 | * peripheral modules. It is used by passing in the physical address as x | ||
192 | * and returning the virtual address. If the physical address is not mapped, | ||
193 | * it returns 0xDEADBEEF | ||
194 | */ | ||
195 | #define IO_ADDRESS(x) \ | ||
196 | (void __iomem *) \ | ||
197 | (((x >= IRAM_BASE_ADDR) && (x < (IRAM_BASE_ADDR + IRAM_SIZE))) ? IRAM_IO_ADDRESS(x):\ | ||
198 | ((x >= L2CC_BASE_ADDR) && (x < (L2CC_BASE_ADDR + L2CC_SIZE))) ? L2CC_IO_ADDRESS(x):\ | ||
199 | ((x >= AIPS1_BASE_ADDR) && (x < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x):\ | ||
200 | ((x >= SPBA0_BASE_ADDR) && (x < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x):\ | ||
201 | ((x >= AIPS2_BASE_ADDR) && (x < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x):\ | ||
202 | ((x >= ROMP_BASE_ADDR) && (x < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x):\ | ||
203 | ((x >= AVIC_BASE_ADDR) && (x < (AVIC_BASE_ADDR + AVIC_SIZE))) ? AVIC_IO_ADDRESS(x):\ | ||
204 | ((x >= CS4_BASE_ADDR) && (x < (CS4_BASE_ADDR + CS4_SIZE))) ? CS4_IO_ADDRESS(x):\ | ||
205 | ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x):\ | ||
206 | 0xDEADBEEF) | ||
207 | |||
208 | /* | ||
209 | * define the address mapping macros: in physical address order | ||
210 | */ | ||
211 | |||
212 | #define IRAM_IO_ADDRESS(x) \ | ||
213 | (((x) - IRAM_BASE_ADDR) + IRAM_BASE_ADDR_VIRT) | ||
214 | |||
215 | #define L2CC_IO_ADDRESS(x) \ | ||
216 | (((x) - L2CC_BASE_ADDR) + L2CC_BASE_ADDR_VIRT) | ||
217 | |||
218 | #define AIPS1_IO_ADDRESS(x) \ | ||
219 | (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT) | ||
220 | |||
221 | #define SPBA0_IO_ADDRESS(x) \ | ||
222 | (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT) | ||
223 | |||
224 | #define AIPS2_IO_ADDRESS(x) \ | ||
225 | (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT) | ||
226 | |||
227 | #define ROMP_IO_ADDRESS(x) \ | ||
228 | (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT) | ||
229 | |||
230 | #define AVIC_IO_ADDRESS(x) \ | ||
231 | (((x) - AVIC_BASE_ADDR) + AVIC_BASE_ADDR_VIRT) | ||
232 | |||
233 | #define CS4_IO_ADDRESS(x) \ | ||
234 | (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT) | ||
235 | |||
236 | #define X_MEMC_IO_ADDRESS(x) \ | ||
237 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | ||
238 | |||
239 | #define PCMCIA_IO_ADDRESS(x) \ | ||
240 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | ||
241 | |||
242 | /* | ||
243 | * Interrupt numbers | ||
244 | */ | ||
245 | #define MXC_INT_PEN_ADS7843 0 | ||
246 | #define MXC_INT_RESV1 1 | ||
247 | #define MXC_INT_CS8900A 2 | ||
248 | #define MXC_INT_I2C3 3 | ||
249 | #define MXC_INT_I2C2 4 | ||
250 | #define MXC_INT_MPEG4_ENCODER 5 | 25 | #define MXC_INT_MPEG4_ENCODER 5 |
251 | #define MXC_INT_RTIC 6 | ||
252 | #define MXC_INT_FIRI 7 | 26 | #define MXC_INT_FIRI 7 |
253 | #define MXC_INT_MMC_SDHC2 8 | 27 | #define MX31_INT_MMC_SDHC2 8 |
254 | #define MXC_INT_MMC_SDHC1 9 | 28 | #define MXC_INT_MMC_SDHC1 9 |
255 | #define MXC_INT_I2C 10 | 29 | #define MX31_INT_SSI2 11 |
256 | #define MXC_INT_SSI2 11 | 30 | #define MX31_INT_SSI1 12 |
257 | #define MXC_INT_SSI1 12 | ||
258 | #define MXC_INT_CSPI2 13 | ||
259 | #define MXC_INT_CSPI1 14 | ||
260 | #define MXC_INT_ATA 15 | ||
261 | #define MXC_INT_MBX 16 | 31 | #define MXC_INT_MBX 16 |
262 | #define MXC_INT_CSPI3 17 | 32 | #define MXC_INT_CSPI3 17 |
263 | #define MXC_INT_UART3 18 | ||
264 | #define MXC_INT_IIM 19 | ||
265 | #define MXC_INT_SIM2 20 | 33 | #define MXC_INT_SIM2 20 |
266 | #define MXC_INT_SIM1 21 | 34 | #define MXC_INT_SIM1 21 |
267 | #define MXC_INT_RNGA 22 | 35 | #define MXC_INT_CCM_DVFS 31 |
268 | #define MXC_INT_EVTMON 23 | ||
269 | #define MXC_INT_KPP 24 | ||
270 | #define MXC_INT_RTC 25 | ||
271 | #define MXC_INT_PWM 26 | ||
272 | #define MXC_INT_EPIT2 27 | ||
273 | #define MXC_INT_EPIT1 28 | ||
274 | #define MXC_INT_GPT 29 | ||
275 | #define MXC_INT_RESV30 30 | ||
276 | #define MXC_INT_RESV31 31 | ||
277 | #define MXC_INT_UART2 32 | ||
278 | #define MXC_INT_NANDFC 33 | ||
279 | #define MXC_INT_SDMA 34 | ||
280 | #define MXC_INT_USB1 35 | 36 | #define MXC_INT_USB1 35 |
281 | #define MXC_INT_USB2 36 | 37 | #define MXC_INT_USB2 36 |
282 | #define MXC_INT_USB3 37 | 38 | #define MXC_INT_USB3 37 |
283 | #define MXC_INT_USB4 38 | 39 | #define MXC_INT_USB4 38 |
284 | #define MXC_INT_MSHC1 39 | ||
285 | #define MXC_INT_MSHC2 40 | 40 | #define MXC_INT_MSHC2 40 |
286 | #define MXC_INT_IPU_ERR 41 | ||
287 | #define MXC_INT_IPU_SYN 42 | ||
288 | #define MXC_INT_RESV43 43 | ||
289 | #define MXC_INT_RESV44 44 | ||
290 | #define MXC_INT_UART1 45 | ||
291 | #define MXC_INT_UART4 46 | 41 | #define MXC_INT_UART4 46 |
292 | #define MXC_INT_UART5 47 | 42 | #define MXC_INT_UART5 47 |
293 | #define MXC_INT_ECT 48 | ||
294 | #define MXC_INT_SCC_SCM 49 | ||
295 | #define MXC_INT_SCC_SMN 50 | ||
296 | #define MXC_INT_GPIO2 51 | ||
297 | #define MXC_INT_GPIO1 52 | ||
298 | #define MXC_INT_CCM 53 | 43 | #define MXC_INT_CCM 53 |
299 | #define MXC_INT_PCMCIA 54 | 44 | #define MXC_INT_PCMCIA 54 |
300 | #define MXC_INT_WDOG 55 | ||
301 | #define MXC_INT_GPIO3 56 | ||
302 | #define MXC_INT_RESV57 57 | ||
303 | #define MXC_INT_EXT_POWER 58 | ||
304 | #define MXC_INT_EXT_TEMPER 59 | ||
305 | #define MXC_INT_EXT_SENSOR60 60 | ||
306 | #define MXC_INT_EXT_SENSOR61 61 | ||
307 | #define MXC_INT_EXT_WDOG 62 | ||
308 | #define MXC_INT_EXT_TV 63 | ||
309 | |||
310 | #define PROD_SIGNATURE 0x1 /* For MX31 */ | ||
311 | |||
312 | /* silicon revisions specific to i.MX31 */ | ||
313 | #define CHIP_REV_1_0 0x10 | ||
314 | #define CHIP_REV_1_1 0x11 | ||
315 | #define CHIP_REV_1_2 0x12 | ||
316 | #define CHIP_REV_1_3 0x13 | ||
317 | #define CHIP_REV_2_0 0x20 | ||
318 | #define CHIP_REV_2_1 0x21 | ||
319 | #define CHIP_REV_2_2 0x22 | ||
320 | #define CHIP_REV_2_3 0x23 | ||
321 | #define CHIP_REV_3_0 0x30 | ||
322 | #define CHIP_REV_3_1 0x31 | ||
323 | #define CHIP_REV_3_2 0x32 | ||
324 | |||
325 | #define SYSTEM_REV_MIN CHIP_REV_1_0 | ||
326 | #define SYSTEM_REV_NUM 3 | ||
327 | |||
328 | /* gpio and gpio based interrupt handling */ | ||
329 | #define GPIO_DR 0x00 | ||
330 | #define GPIO_GDIR 0x04 | ||
331 | #define GPIO_PSR 0x08 | ||
332 | #define GPIO_ICR1 0x0C | ||
333 | #define GPIO_ICR2 0x10 | ||
334 | #define GPIO_IMR 0x14 | ||
335 | #define GPIO_ISR 0x18 | ||
336 | #define GPIO_INT_LOW_LEV 0x0 | ||
337 | #define GPIO_INT_HIGH_LEV 0x1 | ||
338 | #define GPIO_INT_RISE_EDGE 0x2 | ||
339 | #define GPIO_INT_FALL_EDGE 0x3 | ||
340 | #define GPIO_INT_NONE 0x4 | ||
341 | |||
342 | /* Mandatory defines used globally */ | ||
343 | |||
344 | /* this CPU supports up to 96 GPIOs */ | ||
345 | #define ARCH_NR_GPIOS 96 | ||
346 | |||
347 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) | ||
348 | |||
349 | /* this is a i.MX31 CPU */ | ||
350 | #define cpu_is_mx31() (1) | ||
351 | |||
352 | extern unsigned int system_rev; | ||
353 | |||
354 | static inline int mx31_revision(void) | ||
355 | { | ||
356 | return system_rev; | ||
357 | } | ||
358 | #endif | ||
359 | 45 | ||
360 | #endif /* __ASM_ARCH_MXC_MX31_H__ */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h new file mode 100644 index 000000000000..6465fefb42e3 --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/mx35.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * IRAM | ||
3 | */ | ||
4 | #define MX35_IRAM_BASE_ADDR 0x10000000 /* internal ram */ | ||
5 | #define MX35_IRAM_SIZE SZ_128K | ||
6 | |||
7 | #define MXC_FEC_BASE_ADDR 0x50038000 | ||
8 | #define MX35_NFC_BASE_ADDR 0xBB000000 | ||
9 | |||
10 | /* | ||
11 | * Interrupt numbers | ||
12 | */ | ||
13 | #define MXC_INT_OWIRE 2 | ||
14 | #define MX35_INT_MMC_SDHC1 7 | ||
15 | #define MXC_INT_MMC_SDHC2 8 | ||
16 | #define MXC_INT_MMC_SDHC3 9 | ||
17 | #define MX35_INT_SSI1 11 | ||
18 | #define MX35_INT_SSI2 12 | ||
19 | #define MXC_INT_GPU2D 16 | ||
20 | #define MXC_INT_ASRC 17 | ||
21 | #define MXC_INT_USBHS 35 | ||
22 | #define MXC_INT_USBOTG 37 | ||
23 | #define MXC_INT_ESAI 40 | ||
24 | #define MXC_INT_CAN1 43 | ||
25 | #define MXC_INT_CAN2 44 | ||
26 | #define MXC_INT_MLB 46 | ||
27 | #define MXC_INT_SPDIF 47 | ||
28 | #define MXC_INT_FEC 57 | ||
29 | |||
diff --git a/arch/arm/plat-mxc/include/mach/mx3fb.h b/arch/arm/plat-mxc/include/mach/mx3fb.h index e391a76ca87d..ac24c5c4bc83 100644 --- a/arch/arm/plat-mxc/include/mach/mx3fb.h +++ b/arch/arm/plat-mxc/include/mach/mx3fb.h | |||
@@ -14,25 +14,25 @@ | |||
14 | #include <linux/fb.h> | 14 | #include <linux/fb.h> |
15 | 15 | ||
16 | /* Proprietary FB_SYNC_ flags */ | 16 | /* Proprietary FB_SYNC_ flags */ |
17 | #define FB_SYNC_OE_ACT_HIGH 0x80000000 | 17 | #define FB_SYNC_OE_ACT_HIGH 0x80000000 |
18 | #define FB_SYNC_CLK_INVERT 0x40000000 | 18 | #define FB_SYNC_CLK_INVERT 0x40000000 |
19 | #define FB_SYNC_DATA_INVERT 0x20000000 | 19 | #define FB_SYNC_DATA_INVERT 0x20000000 |
20 | #define FB_SYNC_CLK_IDLE_EN 0x10000000 | 20 | #define FB_SYNC_CLK_IDLE_EN 0x10000000 |
21 | #define FB_SYNC_SHARP_MODE 0x08000000 | 21 | #define FB_SYNC_SHARP_MODE 0x08000000 |
22 | #define FB_SYNC_SWAP_RGB 0x04000000 | 22 | #define FB_SYNC_SWAP_RGB 0x04000000 |
23 | #define FB_SYNC_CLK_SEL_EN 0x02000000 | 23 | #define FB_SYNC_CLK_SEL_EN 0x02000000 |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * struct mx3fb_platform_data - mx3fb platform data | 26 | * struct mx3fb_platform_data - mx3fb platform data |
27 | * | 27 | * |
28 | * @dma_dev: pointer to the dma-device, used for dma-slave connection | 28 | * @dma_dev: pointer to the dma-device, used for dma-slave connection |
29 | * @mode: pointer to a platform-provided per mxc_register_fb() videomode | 29 | * @mode: pointer to a platform-provided per mxc_register_fb() videomode |
30 | */ | 30 | */ |
31 | struct mx3fb_platform_data { | 31 | struct mx3fb_platform_data { |
32 | struct device *dma_dev; | 32 | struct device *dma_dev; |
33 | const char *name; | 33 | const char *name; |
34 | const struct fb_videomode *mode; | 34 | const struct fb_videomode *mode; |
35 | int num_modes; | 35 | int num_modes; |
36 | }; | 36 | }; |
37 | 37 | ||
38 | #endif | 38 | #endif |
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/plat-mxc/include/mach/mx3x.h new file mode 100644 index 000000000000..3878c6085d5c --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/mx3x.h | |||
@@ -0,0 +1,290 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | */ | ||
4 | |||
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 | #ifndef __ASM_ARCH_MXC_MX31_H__ | ||
12 | #define __ASM_ARCH_MXC_MX31_H__ | ||
13 | |||
14 | #ifndef __ASM_ARCH_MXC_HARDWARE_H__ | ||
15 | #error "Do not include directly." | ||
16 | #endif | ||
17 | |||
18 | /* | ||
19 | * MX31 memory map: | ||
20 | * | ||
21 | * Virt Phys Size What | ||
22 | * --------------------------------------------------------------------------- | ||
23 | * FC000000 43F00000 1M AIPS 1 | ||
24 | * FC100000 50000000 1M SPBA | ||
25 | * FC200000 53F00000 1M AIPS 2 | ||
26 | * FC500000 60000000 128M ROMPATCH | ||
27 | * FC400000 68000000 128M AVIC | ||
28 | * 70000000 256M IPU (MAX M2) | ||
29 | * 80000000 256M CSD0 SDRAM/DDR | ||
30 | * 90000000 256M CSD1 SDRAM/DDR | ||
31 | * A0000000 128M CS0 Flash | ||
32 | * A8000000 128M CS1 Flash | ||
33 | * B0000000 32M CS2 | ||
34 | * B2000000 32M CS3 | ||
35 | * F4000000 B4000000 32M CS4 | ||
36 | * B6000000 32M CS5 | ||
37 | * FC320000 B8000000 64K NAND, SDRAM, WEIM, M3IF, EMI controllers | ||
38 | * C0000000 64M PCMCIA/CF | ||
39 | */ | ||
40 | |||
41 | #define CS0_BASE_ADDR 0xA0000000 | ||
42 | #define CS1_BASE_ADDR 0xA8000000 | ||
43 | #define CS2_BASE_ADDR 0xB0000000 | ||
44 | #define CS3_BASE_ADDR 0xB2000000 | ||
45 | |||
46 | #define CS4_BASE_ADDR 0xB4000000 | ||
47 | #define CS4_BASE_ADDR_VIRT 0xF4000000 | ||
48 | #define CS4_SIZE SZ_32M | ||
49 | |||
50 | #define CS5_BASE_ADDR 0xB6000000 | ||
51 | #define PCMCIA_MEM_BASE_ADDR 0xBC000000 | ||
52 | |||
53 | /* | ||
54 | * L2CC | ||
55 | */ | ||
56 | #define L2CC_BASE_ADDR 0x30000000 | ||
57 | #define L2CC_SIZE SZ_1M | ||
58 | |||
59 | /* | ||
60 | * AIPS 1 | ||
61 | */ | ||
62 | #define AIPS1_BASE_ADDR 0x43F00000 | ||
63 | #define AIPS1_BASE_ADDR_VIRT 0xFC000000 | ||
64 | #define AIPS1_SIZE SZ_1M | ||
65 | |||
66 | #define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000) | ||
67 | #define EVTMON_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000) | ||
68 | #define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000) | ||
69 | #define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000) | ||
70 | #define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000) | ||
71 | #define ECT_CTIO_BASE_ADDR (AIPS1_BASE_ADDR + 0x00018000) | ||
72 | #define I2C_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000) | ||
73 | #define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000) | ||
74 | #define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000) | ||
75 | #define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000) | ||
76 | #define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000) | ||
77 | #define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000) | ||
78 | #define SSI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000) | ||
79 | #define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000) | ||
80 | #define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000) | ||
81 | #define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000) | ||
82 | #define ECT_IP1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000) | ||
83 | #define ECT_IP2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000) | ||
84 | |||
85 | /* | ||
86 | * SPBA global module enabled #0 | ||
87 | */ | ||
88 | #define SPBA0_BASE_ADDR 0x50000000 | ||
89 | #define SPBA0_BASE_ADDR_VIRT 0xFC100000 | ||
90 | #define SPBA0_SIZE SZ_1M | ||
91 | |||
92 | #define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000) | ||
93 | #define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000) | ||
94 | #define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000) | ||
95 | #define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000) | ||
96 | #define MSHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) | ||
97 | #define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000) | ||
98 | |||
99 | /* | ||
100 | * AIPS 2 | ||
101 | */ | ||
102 | #define AIPS2_BASE_ADDR 0x53F00000 | ||
103 | #define AIPS2_BASE_ADDR_VIRT 0xFC200000 | ||
104 | #define AIPS2_SIZE SZ_1M | ||
105 | #define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000) | ||
106 | #define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000) | ||
107 | #define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000) | ||
108 | #define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000) | ||
109 | #define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000) | ||
110 | #define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000) | ||
111 | #define RNGA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000) | ||
112 | #define IPU_CTRL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000) | ||
113 | #define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000) | ||
114 | #define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000) | ||
115 | #define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000) | ||
116 | #define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000) | ||
117 | #define RTC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000) | ||
118 | #define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000) | ||
119 | #define PWM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000) | ||
120 | #define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000) | ||
121 | |||
122 | /* | ||
123 | * ROMP and AVIC | ||
124 | */ | ||
125 | #define ROMP_BASE_ADDR 0x60000000 | ||
126 | #define ROMP_BASE_ADDR_VIRT 0xFC500000 | ||
127 | #define ROMP_SIZE SZ_1M | ||
128 | |||
129 | #define AVIC_BASE_ADDR 0x68000000 | ||
130 | #define AVIC_BASE_ADDR_VIRT 0xFC400000 | ||
131 | #define AVIC_SIZE SZ_1M | ||
132 | |||
133 | /* | ||
134 | * NAND, SDRAM, WEIM, M3IF, EMI controllers | ||
135 | */ | ||
136 | #define X_MEMC_BASE_ADDR 0xB8000000 | ||
137 | #define X_MEMC_BASE_ADDR_VIRT 0xFC320000 | ||
138 | #define X_MEMC_SIZE SZ_64K | ||
139 | |||
140 | #define ESDCTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) | ||
141 | #define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) | ||
142 | #define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) | ||
143 | #define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) | ||
144 | #define PCMCIA_CTL_BASE_ADDR EMI_CTL_BASE_ADDR | ||
145 | |||
146 | /* | ||
147 | * Memory regions and CS | ||
148 | */ | ||
149 | #define IPU_MEM_BASE_ADDR 0x70000000 | ||
150 | #define CSD0_BASE_ADDR 0x80000000 | ||
151 | #define CSD1_BASE_ADDR 0x90000000 | ||
152 | |||
153 | /*! | ||
154 | * This macro defines the physical to virtual address mapping for all the | ||
155 | * peripheral modules. It is used by passing in the physical address as x | ||
156 | * and returning the virtual address. If the physical address is not mapped, | ||
157 | * it returns 0xDEADBEEF | ||
158 | */ | ||
159 | #define IO_ADDRESS(x) \ | ||
160 | (void __force __iomem *) \ | ||
161 | (((x >= AIPS1_BASE_ADDR) && (x < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x):\ | ||
162 | ((x >= SPBA0_BASE_ADDR) && (x < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x):\ | ||
163 | ((x >= AIPS2_BASE_ADDR) && (x < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x):\ | ||
164 | ((x >= ROMP_BASE_ADDR) && (x < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x):\ | ||
165 | ((x >= AVIC_BASE_ADDR) && (x < (AVIC_BASE_ADDR + AVIC_SIZE))) ? AVIC_IO_ADDRESS(x):\ | ||
166 | ((x >= CS4_BASE_ADDR) && (x < (CS4_BASE_ADDR + CS4_SIZE))) ? CS4_IO_ADDRESS(x):\ | ||
167 | ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x):\ | ||
168 | 0xDEADBEEF) | ||
169 | |||
170 | /* | ||
171 | * define the address mapping macros: in physical address order | ||
172 | */ | ||
173 | #define L2CC_IO_ADDRESS(x) \ | ||
174 | (((x) - L2CC_BASE_ADDR) + L2CC_BASE_ADDR_VIRT) | ||
175 | |||
176 | #define AIPS1_IO_ADDRESS(x) \ | ||
177 | (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT) | ||
178 | |||
179 | #define SPBA0_IO_ADDRESS(x) \ | ||
180 | (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT) | ||
181 | |||
182 | #define AIPS2_IO_ADDRESS(x) \ | ||
183 | (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT) | ||
184 | |||
185 | #define ROMP_IO_ADDRESS(x) \ | ||
186 | (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT) | ||
187 | |||
188 | #define AVIC_IO_ADDRESS(x) \ | ||
189 | (((x) - AVIC_BASE_ADDR) + AVIC_BASE_ADDR_VIRT) | ||
190 | |||
191 | #define CS4_IO_ADDRESS(x) \ | ||
192 | (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT) | ||
193 | |||
194 | #define X_MEMC_IO_ADDRESS(x) \ | ||
195 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | ||
196 | |||
197 | #define PCMCIA_IO_ADDRESS(x) \ | ||
198 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | ||
199 | |||
200 | /* | ||
201 | * Interrupt numbers | ||
202 | */ | ||
203 | #define MXC_INT_I2C3 3 | ||
204 | #define MXC_INT_I2C2 4 | ||
205 | #define MXC_INT_RTIC 6 | ||
206 | #define MXC_INT_I2C 10 | ||
207 | #define MXC_INT_CSPI2 13 | ||
208 | #define MXC_INT_CSPI1 14 | ||
209 | #define MXC_INT_ATA 15 | ||
210 | #define MXC_INT_UART3 18 | ||
211 | #define MXC_INT_IIM 19 | ||
212 | #define MXC_INT_RNGA 22 | ||
213 | #define MXC_INT_EVTMON 23 | ||
214 | #define MXC_INT_KPP 24 | ||
215 | #define MXC_INT_RTC 25 | ||
216 | #define MXC_INT_PWM 26 | ||
217 | #define MXC_INT_EPIT2 27 | ||
218 | #define MXC_INT_EPIT1 28 | ||
219 | #define MXC_INT_GPT 29 | ||
220 | #define MXC_INT_POWER_FAIL 30 | ||
221 | #define MXC_INT_UART2 32 | ||
222 | #define MXC_INT_NANDFC 33 | ||
223 | #define MXC_INT_SDMA 34 | ||
224 | #define MXC_INT_MSHC1 39 | ||
225 | #define MXC_INT_IPU_ERR 41 | ||
226 | #define MXC_INT_IPU_SYN 42 | ||
227 | #define MXC_INT_UART1 45 | ||
228 | #define MXC_INT_ECT 48 | ||
229 | #define MXC_INT_SCC_SCM 49 | ||
230 | #define MXC_INT_SCC_SMN 50 | ||
231 | #define MXC_INT_GPIO2 51 | ||
232 | #define MXC_INT_GPIO1 52 | ||
233 | #define MXC_INT_WDOG 55 | ||
234 | #define MXC_INT_GPIO3 56 | ||
235 | #define MXC_INT_EXT_POWER 58 | ||
236 | #define MXC_INT_EXT_TEMPER 59 | ||
237 | #define MXC_INT_EXT_SENSOR60 60 | ||
238 | #define MXC_INT_EXT_SENSOR61 61 | ||
239 | #define MXC_INT_EXT_WDOG 62 | ||
240 | #define MXC_INT_EXT_TV 63 | ||
241 | |||
242 | #define PROD_SIGNATURE 0x1 /* For MX31 */ | ||
243 | |||
244 | /* silicon revisions specific to i.MX31 */ | ||
245 | #define CHIP_REV_1_0 0x10 | ||
246 | #define CHIP_REV_1_1 0x11 | ||
247 | #define CHIP_REV_1_2 0x12 | ||
248 | #define CHIP_REV_1_3 0x13 | ||
249 | #define CHIP_REV_2_0 0x20 | ||
250 | #define CHIP_REV_2_1 0x21 | ||
251 | #define CHIP_REV_2_2 0x22 | ||
252 | #define CHIP_REV_2_3 0x23 | ||
253 | #define CHIP_REV_3_0 0x30 | ||
254 | #define CHIP_REV_3_1 0x31 | ||
255 | #define CHIP_REV_3_2 0x32 | ||
256 | |||
257 | #define SYSTEM_REV_MIN CHIP_REV_1_0 | ||
258 | #define SYSTEM_REV_NUM 3 | ||
259 | |||
260 | /* gpio and gpio based interrupt handling */ | ||
261 | #define GPIO_DR 0x00 | ||
262 | #define GPIO_GDIR 0x04 | ||
263 | #define GPIO_PSR 0x08 | ||
264 | #define GPIO_ICR1 0x0C | ||
265 | #define GPIO_ICR2 0x10 | ||
266 | #define GPIO_IMR 0x14 | ||
267 | #define GPIO_ISR 0x18 | ||
268 | #define GPIO_INT_LOW_LEV 0x0 | ||
269 | #define GPIO_INT_HIGH_LEV 0x1 | ||
270 | #define GPIO_INT_RISE_EDGE 0x2 | ||
271 | #define GPIO_INT_FALL_EDGE 0x3 | ||
272 | #define GPIO_INT_NONE 0x4 | ||
273 | |||
274 | /* Mandatory defines used globally */ | ||
275 | |||
276 | /* this CPU supports up to 96 GPIOs */ | ||
277 | #define ARCH_NR_GPIOS 96 | ||
278 | |||
279 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) | ||
280 | |||
281 | extern unsigned int system_rev; | ||
282 | |||
283 | static inline int mx31_revision(void) | ||
284 | { | ||
285 | return system_rev; | ||
286 | } | ||
287 | #endif | ||
288 | |||
289 | #endif /* __ASM_ARCH_MXC_MX31_H__ */ | ||
290 | |||
diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h index f6caab062131..5fa2a07f4eaf 100644 --- a/arch/arm/plat-mxc/include/mach/mxc.h +++ b/arch/arm/plat-mxc/include/mach/mxc.h | |||
@@ -24,13 +24,74 @@ | |||
24 | #error "Do not include directly." | 24 | #error "Do not include directly." |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | /* clean up all things that are not used */ | 27 | #define MXC_CPU_MX1 1 |
28 | #ifndef CONFIG_ARCH_MX3 | 28 | #define MXC_CPU_MX21 21 |
29 | # define cpu_is_mx31() (0) | 29 | #define MXC_CPU_MX27 27 |
30 | #define MXC_CPU_MX31 31 | ||
31 | #define MXC_CPU_MX35 35 | ||
32 | |||
33 | #ifndef __ASSEMBLY__ | ||
34 | extern unsigned int __mxc_cpu_type; | ||
35 | #endif | ||
36 | |||
37 | #ifdef CONFIG_ARCH_MX1 | ||
38 | # ifdef mxc_cpu_type | ||
39 | # undef mxc_cpu_type | ||
40 | # define mxc_cpu_type __mxc_cpu_type | ||
41 | # else | ||
42 | # define mxc_cpu_type MXC_CPU_MX1 | ||
43 | # endif | ||
44 | # define cpu_is_mx1() (mxc_cpu_type == MXC_CPU_MX1) | ||
45 | #else | ||
46 | # define cpu_is_mx1() (0) | ||
47 | #endif | ||
48 | |||
49 | #ifdef CONFIG_MACH_MX21 | ||
50 | # ifdef mxc_cpu_type | ||
51 | # undef mxc_cpu_type | ||
52 | # define mxc_cpu_type __mxc_cpu_type | ||
53 | # else | ||
54 | # define mxc_cpu_type MXC_CPU_MX21 | ||
55 | # endif | ||
56 | # define cpu_is_mx21() (mxc_cpu_type == MXC_CPU_MX21) | ||
57 | #else | ||
58 | # define cpu_is_mx21() (0) | ||
30 | #endif | 59 | #endif |
31 | 60 | ||
32 | #ifndef CONFIG_MACH_MX27 | 61 | #ifdef CONFIG_MACH_MX27 |
33 | # define cpu_is_mx27() (0) | 62 | # ifdef mxc_cpu_type |
63 | # undef mxc_cpu_type | ||
64 | # define mxc_cpu_type __mxc_cpu_type | ||
65 | # else | ||
66 | # define mxc_cpu_type MXC_CPU_MX27 | ||
67 | # endif | ||
68 | # define cpu_is_mx27() (mxc_cpu_type == MXC_CPU_MX27) | ||
69 | #else | ||
70 | # define cpu_is_mx27() (0) | ||
71 | #endif | ||
72 | |||
73 | #ifdef CONFIG_ARCH_MX31 | ||
74 | # ifdef mxc_cpu_type | ||
75 | # undef mxc_cpu_type | ||
76 | # define mxc_cpu_type __mxc_cpu_type | ||
77 | # else | ||
78 | # define mxc_cpu_type MXC_CPU_MX31 | ||
79 | # endif | ||
80 | # define cpu_is_mx31() (mxc_cpu_type == MXC_CPU_MX31) | ||
81 | #else | ||
82 | # define cpu_is_mx31() (0) | ||
83 | #endif | ||
84 | |||
85 | #ifdef CONFIG_ARCH_MX35 | ||
86 | # ifdef mxc_cpu_type | ||
87 | # undef mxc_cpu_type | ||
88 | # define mxc_cpu_type __mxc_cpu_type | ||
89 | # else | ||
90 | # define mxc_cpu_type MXC_CPU_MX35 | ||
91 | # endif | ||
92 | # define cpu_is_mx35() (mxc_cpu_type == MXC_CPU_MX35) | ||
93 | #else | ||
94 | # define cpu_is_mx35() (0) | ||
34 | #endif | 95 | #endif |
35 | 96 | ||
36 | #if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX2) | 97 | #if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX2) |
@@ -39,4 +100,7 @@ | |||
39 | #define CSCR_A(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x8) | 100 | #define CSCR_A(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x8) |
40 | #endif | 101 | #endif |
41 | 102 | ||
103 | #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35()) | ||
104 | #define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27()) | ||
105 | |||
42 | #endif /* __ASM_ARCH_MXC_H__ */ | 106 | #endif /* __ASM_ARCH_MXC_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/system.h b/arch/arm/plat-mxc/include/mach/system.h index bbfc37465fc5..cd03ebaa49bc 100644 --- a/arch/arm/plat-mxc/include/mach/system.h +++ b/arch/arm/plat-mxc/include/mach/system.h | |||
@@ -26,7 +26,7 @@ static inline void arch_idle(void) | |||
26 | cpu_do_idle(); | 26 | cpu_do_idle(); |
27 | } | 27 | } |
28 | 28 | ||
29 | static inline void arch_reset(char mode) | 29 | static inline void arch_reset(char mode, const char *cmd) |
30 | { | 30 | { |
31 | cpu_reset(0); | 31 | cpu_reset(0); |
32 | } | 32 | } |
diff --git a/arch/arm/plat-mxc/iomux-mx1-mx2.c b/arch/arm/plat-mxc/iomux-mx1-mx2.c index df6f18395686..a37163ce280b 100644 --- a/arch/arm/plat-mxc/iomux-mx1-mx2.c +++ b/arch/arm/plat-mxc/iomux-mx1-mx2.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | #include <mach/hardware.h> | 33 | #include <mach/hardware.h> |
34 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
35 | #include <mach/iomux-mx1-mx2.h> | 35 | #include <mach/iomux.h> |
36 | 36 | ||
37 | void mxc_gpio_mode(int gpio_mode) | 37 | void mxc_gpio_mode(int gpio_mode) |
38 | { | 38 | { |
diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c new file mode 100644 index 000000000000..9bffbc507cc2 --- /dev/null +++ b/arch/arm/plat-mxc/pwm.c | |||
@@ -0,0 +1,300 @@ | |||
1 | /* | ||
2 | * simple driver for PWM (Pulse Width Modulator) controller | ||
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 | * Derived from pxa PWM driver by eric miao <eric.miao@marvell.com> | ||
9 | */ | ||
10 | |||
11 | #include <linux/module.h> | ||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/err.h> | ||
15 | #include <linux/clk.h> | ||
16 | #include <linux/io.h> | ||
17 | #include <linux/pwm.h> | ||
18 | |||
19 | #if defined CONFIG_ARCH_MX1 || defined CONFIG_ARCH_MX21 | ||
20 | #define PWM_VER_1 | ||
21 | |||
22 | #define PWMCR 0x00 /* PWM Control Register */ | ||
23 | #define PWMSR 0x04 /* PWM Sample Register */ | ||
24 | #define PWMPR 0x08 /* PWM Period Register */ | ||
25 | #define PWMCNR 0x0C /* PWM Counter Register */ | ||
26 | |||
27 | #define PWMCR_HCTR (1 << 18) /* Halfword FIFO Data Swapping */ | ||
28 | #define PWMCR_BCTR (1 << 17) /* Byte FIFO Data Swapping */ | ||
29 | #define PWMCR_SWR (1 << 16) /* Software Reset */ | ||
30 | #define PWMCR_CLKSRC_PERCLK (0 << 15) /* PERCLK Clock Source */ | ||
31 | #define PWMCR_CLKSRC_CLK32 (1 << 15) /* 32KHz Clock Source */ | ||
32 | #define PWMCR_PRESCALER(x) (((x - 1) & 0x7F) << 8) /* PRESCALER */ | ||
33 | #define PWMCR_IRQ (1 << 7) /* Interrupt Request */ | ||
34 | #define PWMCR_IRQEN (1 << 6) /* Interrupt Request Enable */ | ||
35 | #define PWMCR_FIFOAV (1 << 5) /* FIFO Available */ | ||
36 | #define PWMCR_EN (1 << 4) /* Enables/Disables the PWM */ | ||
37 | #define PWMCR_REPEAT(x) (((x) & 0x03) << 2) /* Sample Repeats */ | ||
38 | #define PWMCR_DIV(x) (((x) & 0x03) << 0) /* Clock divider 2/4/8/16 */ | ||
39 | |||
40 | #define MAX_DIV (128 * 16) | ||
41 | #endif | ||
42 | |||
43 | #if defined CONFIG_MACH_MX27 || defined CONFIG_ARCH_MX31 | ||
44 | #define PWM_VER_2 | ||
45 | |||
46 | #define PWMCR 0x00 /* PWM Control Register */ | ||
47 | #define PWMSR 0x04 /* PWM Status Register */ | ||
48 | #define PWMIR 0x08 /* PWM Interrupt Register */ | ||
49 | #define PWMSAR 0x0C /* PWM Sample Register */ | ||
50 | #define PWMPR 0x10 /* PWM Period Register */ | ||
51 | #define PWMCNR 0x14 /* PWM Counter Register */ | ||
52 | |||
53 | #define PWMCR_EN (1 << 0) /* Enables/Disables the PWM */ | ||
54 | #define PWMCR_REPEAT(x) (((x) & 0x03) << 1) /* Sample Repeats */ | ||
55 | #define PWMCR_SWR (1 << 3) /* Software Reset */ | ||
56 | #define PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4)/* PRESCALER */ | ||
57 | #define PWMCR_CLKSRC(x) (((x) & 0x3) << 16) | ||
58 | #define PWMCR_CLKSRC_OFF (0 << 16) | ||
59 | #define PWMCR_CLKSRC_IPG (1 << 16) | ||
60 | #define PWMCR_CLKSRC_IPG_HIGH (2 << 16) | ||
61 | #define PWMCR_CLKSRC_CLK32 (3 << 16) | ||
62 | #define PWMCR_POUTC | ||
63 | #define PWMCR_HCTR (1 << 20) /* Halfword FIFO Data Swapping */ | ||
64 | #define PWMCR_BCTR (1 << 21) /* Byte FIFO Data Swapping */ | ||
65 | #define PWMCR_DBGEN (1 << 22) /* Debug Mode */ | ||
66 | #define PWMCR_WAITEN (1 << 23) /* Wait Mode */ | ||
67 | #define PWMCR_DOZEN (1 << 24) /* Doze Mode */ | ||
68 | #define PWMCR_STOPEN (1 << 25) /* Stop Mode */ | ||
69 | #define PWMCR_FWM(x) (((x) & 0x3) << 26) /* FIFO Water Mark */ | ||
70 | |||
71 | #define MAX_DIV 4096 | ||
72 | #endif | ||
73 | |||
74 | #define PWMS_SAMPLE(x) ((x) & 0xFFFF) /* Contains a two-sample word */ | ||
75 | #define PWMP_PERIOD(x) ((x) & 0xFFFF) /* Represents the PWM's period */ | ||
76 | #define PWMC_COUNTER(x) ((x) & 0xFFFF) /* Represents the current count value */ | ||
77 | |||
78 | struct pwm_device { | ||
79 | struct list_head node; | ||
80 | struct platform_device *pdev; | ||
81 | |||
82 | const char *label; | ||
83 | struct clk *clk; | ||
84 | |||
85 | int clk_enabled; | ||
86 | void __iomem *mmio_base; | ||
87 | |||
88 | unsigned int use_count; | ||
89 | unsigned int pwm_id; | ||
90 | }; | ||
91 | |||
92 | int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) | ||
93 | { | ||
94 | unsigned long long c; | ||
95 | unsigned long period_cycles, duty_cycles, prescale; | ||
96 | |||
97 | if (pwm == NULL || period_ns == 0 || duty_ns > period_ns) | ||
98 | return -EINVAL; | ||
99 | |||
100 | c = clk_get_rate(pwm->clk); | ||
101 | c = c * period_ns; | ||
102 | do_div(c, 1000000000); | ||
103 | period_cycles = c; | ||
104 | |||
105 | prescale = period_cycles / 0x10000 + 1; | ||
106 | |||
107 | period_cycles /= prescale; | ||
108 | c = (unsigned long long)period_cycles * duty_ns; | ||
109 | do_div(c, period_ns); | ||
110 | duty_cycles = c; | ||
111 | |||
112 | #ifdef PWM_VER_2 | ||
113 | writel(duty_cycles, pwm->mmio_base + PWMSAR); | ||
114 | writel(period_cycles, pwm->mmio_base + PWMPR); | ||
115 | writel(PWMCR_PRESCALER(prescale - 1) | PWMCR_CLKSRC_IPG_HIGH | PWMCR_EN, | ||
116 | pwm->mmio_base + PWMCR); | ||
117 | #elif defined PWM_VER_1 | ||
118 | #error PWM not yet working on MX1 / MX21 | ||
119 | #endif | ||
120 | |||
121 | return 0; | ||
122 | } | ||
123 | EXPORT_SYMBOL(pwm_config); | ||
124 | |||
125 | int pwm_enable(struct pwm_device *pwm) | ||
126 | { | ||
127 | int rc = 0; | ||
128 | |||
129 | if (!pwm->clk_enabled) { | ||
130 | rc = clk_enable(pwm->clk); | ||
131 | if (!rc) | ||
132 | pwm->clk_enabled = 1; | ||
133 | } | ||
134 | return rc; | ||
135 | } | ||
136 | EXPORT_SYMBOL(pwm_enable); | ||
137 | |||
138 | void pwm_disable(struct pwm_device *pwm) | ||
139 | { | ||
140 | if (pwm->clk_enabled) { | ||
141 | clk_disable(pwm->clk); | ||
142 | pwm->clk_enabled = 0; | ||
143 | } | ||
144 | } | ||
145 | EXPORT_SYMBOL(pwm_disable); | ||
146 | |||
147 | static DEFINE_MUTEX(pwm_lock); | ||
148 | static LIST_HEAD(pwm_list); | ||
149 | |||
150 | struct pwm_device *pwm_request(int pwm_id, const char *label) | ||
151 | { | ||
152 | struct pwm_device *pwm; | ||
153 | int found = 0; | ||
154 | |||
155 | mutex_lock(&pwm_lock); | ||
156 | |||
157 | list_for_each_entry(pwm, &pwm_list, node) { | ||
158 | if (pwm->pwm_id == pwm_id) { | ||
159 | found = 1; | ||
160 | break; | ||
161 | } | ||
162 | } | ||
163 | |||
164 | if (found) { | ||
165 | if (pwm->use_count == 0) { | ||
166 | pwm->use_count++; | ||
167 | pwm->label = label; | ||
168 | } else | ||
169 | pwm = ERR_PTR(-EBUSY); | ||
170 | } else | ||
171 | pwm = ERR_PTR(-ENOENT); | ||
172 | |||
173 | mutex_unlock(&pwm_lock); | ||
174 | return pwm; | ||
175 | } | ||
176 | EXPORT_SYMBOL(pwm_request); | ||
177 | |||
178 | void pwm_free(struct pwm_device *pwm) | ||
179 | { | ||
180 | mutex_lock(&pwm_lock); | ||
181 | |||
182 | if (pwm->use_count) { | ||
183 | pwm->use_count--; | ||
184 | pwm->label = NULL; | ||
185 | } else | ||
186 | pr_warning("PWM device already freed\n"); | ||
187 | |||
188 | mutex_unlock(&pwm_lock); | ||
189 | } | ||
190 | EXPORT_SYMBOL(pwm_free); | ||
191 | |||
192 | static int __devinit mxc_pwm_probe(struct platform_device *pdev) | ||
193 | { | ||
194 | struct pwm_device *pwm; | ||
195 | struct resource *r; | ||
196 | int ret = 0; | ||
197 | |||
198 | pwm = kzalloc(sizeof(struct pwm_device), GFP_KERNEL); | ||
199 | if (pwm == NULL) { | ||
200 | dev_err(&pdev->dev, "failed to allocate memory\n"); | ||
201 | return -ENOMEM; | ||
202 | } | ||
203 | |||
204 | pwm->clk = clk_get(&pdev->dev, "pwm"); | ||
205 | |||
206 | if (IS_ERR(pwm->clk)) { | ||
207 | ret = PTR_ERR(pwm->clk); | ||
208 | goto err_free; | ||
209 | } | ||
210 | |||
211 | pwm->clk_enabled = 0; | ||
212 | |||
213 | pwm->use_count = 0; | ||
214 | pwm->pwm_id = pdev->id; | ||
215 | pwm->pdev = pdev; | ||
216 | |||
217 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
218 | if (r == NULL) { | ||
219 | dev_err(&pdev->dev, "no memory resource defined\n"); | ||
220 | ret = -ENODEV; | ||
221 | goto err_free_clk; | ||
222 | } | ||
223 | |||
224 | r = request_mem_region(r->start, r->end - r->start + 1, pdev->name); | ||
225 | if (r == NULL) { | ||
226 | dev_err(&pdev->dev, "failed to request memory resource\n"); | ||
227 | ret = -EBUSY; | ||
228 | goto err_free_clk; | ||
229 | } | ||
230 | |||
231 | pwm->mmio_base = ioremap(r->start, r->end - r->start + 1); | ||
232 | if (pwm->mmio_base == NULL) { | ||
233 | dev_err(&pdev->dev, "failed to ioremap() registers\n"); | ||
234 | ret = -ENODEV; | ||
235 | goto err_free_mem; | ||
236 | } | ||
237 | |||
238 | mutex_lock(&pwm_lock); | ||
239 | list_add_tail(&pwm->node, &pwm_list); | ||
240 | mutex_unlock(&pwm_lock); | ||
241 | |||
242 | platform_set_drvdata(pdev, pwm); | ||
243 | return 0; | ||
244 | |||
245 | err_free_mem: | ||
246 | release_mem_region(r->start, r->end - r->start + 1); | ||
247 | err_free_clk: | ||
248 | clk_put(pwm->clk); | ||
249 | err_free: | ||
250 | kfree(pwm); | ||
251 | return ret; | ||
252 | } | ||
253 | |||
254 | static int __devexit mxc_pwm_remove(struct platform_device *pdev) | ||
255 | { | ||
256 | struct pwm_device *pwm; | ||
257 | struct resource *r; | ||
258 | |||
259 | pwm = platform_get_drvdata(pdev); | ||
260 | if (pwm == NULL) | ||
261 | return -ENODEV; | ||
262 | |||
263 | mutex_lock(&pwm_lock); | ||
264 | list_del(&pwm->node); | ||
265 | mutex_unlock(&pwm_lock); | ||
266 | |||
267 | iounmap(pwm->mmio_base); | ||
268 | |||
269 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
270 | release_mem_region(r->start, r->end - r->start + 1); | ||
271 | |||
272 | clk_put(pwm->clk); | ||
273 | |||
274 | kfree(pwm); | ||
275 | return 0; | ||
276 | } | ||
277 | |||
278 | static struct platform_driver mxc_pwm_driver = { | ||
279 | .driver = { | ||
280 | .name = "mxc_pwm", | ||
281 | }, | ||
282 | .probe = mxc_pwm_probe, | ||
283 | .remove = __devexit_p(mxc_pwm_remove), | ||
284 | }; | ||
285 | |||
286 | static int __init mxc_pwm_init(void) | ||
287 | { | ||
288 | return platform_driver_register(&mxc_pwm_driver); | ||
289 | } | ||
290 | arch_initcall(mxc_pwm_init); | ||
291 | |||
292 | static void __exit mxc_pwm_exit(void) | ||
293 | { | ||
294 | platform_driver_unregister(&mxc_pwm_driver); | ||
295 | } | ||
296 | module_exit(mxc_pwm_exit); | ||
297 | |||
298 | MODULE_LICENSE("GPL v2"); | ||
299 | MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>"); | ||
300 | |||
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c index 758a1293bcfa..ef1b3cd85bd3 100644 --- a/arch/arm/plat-mxc/time.c +++ b/arch/arm/plat-mxc/time.c | |||
@@ -34,9 +34,6 @@ | |||
34 | static struct clock_event_device clockevent_mxc; | 34 | static struct clock_event_device clockevent_mxc; |
35 | static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED; | 35 | static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED; |
36 | 36 | ||
37 | /* clock source for the timer */ | ||
38 | static struct clk *timer_clk; | ||
39 | |||
40 | /* clock source */ | 37 | /* clock source */ |
41 | 38 | ||
42 | static cycle_t mxc_get_cycles(void) | 39 | static cycle_t mxc_get_cycles(void) |
@@ -53,13 +50,11 @@ static struct clocksource clocksource_mxc = { | |||
53 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 50 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
54 | }; | 51 | }; |
55 | 52 | ||
56 | static int __init mxc_clocksource_init(void) | 53 | static int __init mxc_clocksource_init(struct clk *timer_clk) |
57 | { | 54 | { |
58 | unsigned int clock; | 55 | unsigned int c = clk_get_rate(timer_clk); |
59 | |||
60 | clock = clk_get_rate(timer_clk); | ||
61 | 56 | ||
62 | clocksource_mxc.mult = clocksource_hz2mult(clock, | 57 | clocksource_mxc.mult = clocksource_hz2mult(c, |
63 | clocksource_mxc.shift); | 58 | clocksource_mxc.shift); |
64 | clocksource_register(&clocksource_mxc); | 59 | clocksource_register(&clocksource_mxc); |
65 | 60 | ||
@@ -177,13 +172,11 @@ static struct clock_event_device clockevent_mxc = { | |||
177 | .rating = 200, | 172 | .rating = 200, |
178 | }; | 173 | }; |
179 | 174 | ||
180 | static int __init mxc_clockevent_init(void) | 175 | static int __init mxc_clockevent_init(struct clk *timer_clk) |
181 | { | 176 | { |
182 | unsigned int clock; | 177 | unsigned int c = clk_get_rate(timer_clk); |
183 | |||
184 | clock = clk_get_rate(timer_clk); | ||
185 | 178 | ||
186 | clockevent_mxc.mult = div_sc(clock, NSEC_PER_SEC, | 179 | clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC, |
187 | clockevent_mxc.shift); | 180 | clockevent_mxc.shift); |
188 | clockevent_mxc.max_delta_ns = | 181 | clockevent_mxc.max_delta_ns = |
189 | clockevent_delta2ns(0xfffffffe, &clockevent_mxc); | 182 | clockevent_delta2ns(0xfffffffe, &clockevent_mxc); |
@@ -197,14 +190,8 @@ static int __init mxc_clockevent_init(void) | |||
197 | return 0; | 190 | return 0; |
198 | } | 191 | } |
199 | 192 | ||
200 | void __init mxc_timer_init(const char *clk_timer) | 193 | void __init mxc_timer_init(struct clk *timer_clk) |
201 | { | 194 | { |
202 | timer_clk = clk_get(NULL, clk_timer); | ||
203 | if (!timer_clk) { | ||
204 | printk(KERN_ERR"Cannot determine timer clock. Giving up.\n"); | ||
205 | return; | ||
206 | } | ||
207 | |||
208 | clk_enable(timer_clk); | 195 | clk_enable(timer_clk); |
209 | 196 | ||
210 | /* | 197 | /* |
@@ -219,10 +206,9 @@ void __init mxc_timer_init(const char *clk_timer) | |||
219 | TIMER_BASE + MXC_TCTL); | 206 | TIMER_BASE + MXC_TCTL); |
220 | 207 | ||
221 | /* init and register the timer to the framework */ | 208 | /* init and register the timer to the framework */ |
222 | mxc_clocksource_init(); | 209 | mxc_clocksource_init(timer_clk); |
223 | mxc_clockevent_init(); | 210 | mxc_clockevent_init(timer_clk); |
224 | 211 | ||
225 | /* Make irqs happen */ | 212 | /* Make irqs happen */ |
226 | setup_irq(TIMER_INTERRUPT, &mxc_timer_irq); | 213 | setup_irq(TIMER_INTERRUPT, &mxc_timer_irq); |
227 | } | 214 | } |
228 | |||
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index 46d3b0b9ce69..e25e1ac64fc1 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
@@ -11,14 +11,17 @@ choice | |||
11 | 11 | ||
12 | config ARCH_OMAP1 | 12 | config ARCH_OMAP1 |
13 | bool "TI OMAP1" | 13 | bool "TI OMAP1" |
14 | select COMMON_CLKDEV | ||
14 | 15 | ||
15 | config ARCH_OMAP2 | 16 | config ARCH_OMAP2 |
16 | bool "TI OMAP2" | 17 | bool "TI OMAP2" |
17 | select CPU_V6 | 18 | select CPU_V6 |
19 | select COMMON_CLKDEV | ||
18 | 20 | ||
19 | config ARCH_OMAP3 | 21 | config ARCH_OMAP3 |
20 | bool "TI OMAP3" | 22 | bool "TI OMAP3" |
21 | select CPU_V7 | 23 | select CPU_V7 |
24 | select COMMON_CLKDEV | ||
22 | 25 | ||
23 | endchoice | 26 | endchoice |
24 | 27 | ||
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile index deaff58878a2..04a100cfb8e5 100644 --- a/arch/arm/plat-omap/Makefile +++ b/arch/arm/plat-omap/Makefile | |||
@@ -18,7 +18,8 @@ obj-$(CONFIG_CPU_FREQ) += cpu-omap.o | |||
18 | obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o | 18 | obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o |
19 | obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o | 19 | obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o |
20 | obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o | 20 | obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o |
21 | obj-$(CONFIG_I2C_OMAP) += i2c.o | 21 | i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o |
22 | obj-y += $(i2c-omap-m) $(i2c-omap-y) | ||
22 | 23 | ||
23 | # OMAP mailbox framework | 24 | # OMAP mailbox framework |
24 | obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o | 25 | obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o |
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index be6aab9c6834..2e0614552ac8 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -36,44 +36,6 @@ static struct clk_functions *arch_clock; | |||
36 | * Standard clock functions defined in include/linux/clk.h | 36 | * Standard clock functions defined in include/linux/clk.h |
37 | *-------------------------------------------------------------------------*/ | 37 | *-------------------------------------------------------------------------*/ |
38 | 38 | ||
39 | /* | ||
40 | * Returns a clock. Note that we first try to use device id on the bus | ||
41 | * and clock name. If this fails, we try to use clock name only. | ||
42 | */ | ||
43 | struct clk * clk_get(struct device *dev, const char *id) | ||
44 | { | ||
45 | struct clk *p, *clk = ERR_PTR(-ENOENT); | ||
46 | int idno; | ||
47 | |||
48 | if (dev == NULL || dev->bus != &platform_bus_type) | ||
49 | idno = -1; | ||
50 | else | ||
51 | idno = to_platform_device(dev)->id; | ||
52 | |||
53 | mutex_lock(&clocks_mutex); | ||
54 | |||
55 | list_for_each_entry(p, &clocks, node) { | ||
56 | if (p->id == idno && | ||
57 | strcmp(id, p->name) == 0 && try_module_get(p->owner)) { | ||
58 | clk = p; | ||
59 | goto found; | ||
60 | } | ||
61 | } | ||
62 | |||
63 | list_for_each_entry(p, &clocks, node) { | ||
64 | if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { | ||
65 | clk = p; | ||
66 | break; | ||
67 | } | ||
68 | } | ||
69 | |||
70 | found: | ||
71 | mutex_unlock(&clocks_mutex); | ||
72 | |||
73 | return clk; | ||
74 | } | ||
75 | EXPORT_SYMBOL(clk_get); | ||
76 | |||
77 | int clk_enable(struct clk *clk) | 39 | int clk_enable(struct clk *clk) |
78 | { | 40 | { |
79 | unsigned long flags; | 41 | unsigned long flags; |
@@ -114,22 +76,6 @@ out: | |||
114 | } | 76 | } |
115 | EXPORT_SYMBOL(clk_disable); | 77 | EXPORT_SYMBOL(clk_disable); |
116 | 78 | ||
117 | int clk_get_usecount(struct clk *clk) | ||
118 | { | ||
119 | unsigned long flags; | ||
120 | int ret = 0; | ||
121 | |||
122 | if (clk == NULL || IS_ERR(clk)) | ||
123 | return 0; | ||
124 | |||
125 | spin_lock_irqsave(&clockfw_lock, flags); | ||
126 | ret = clk->usecount; | ||
127 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
128 | |||
129 | return ret; | ||
130 | } | ||
131 | EXPORT_SYMBOL(clk_get_usecount); | ||
132 | |||
133 | unsigned long clk_get_rate(struct clk *clk) | 79 | unsigned long clk_get_rate(struct clk *clk) |
134 | { | 80 | { |
135 | unsigned long flags; | 81 | unsigned long flags; |
@@ -146,13 +92,6 @@ unsigned long clk_get_rate(struct clk *clk) | |||
146 | } | 92 | } |
147 | EXPORT_SYMBOL(clk_get_rate); | 93 | EXPORT_SYMBOL(clk_get_rate); |
148 | 94 | ||
149 | void clk_put(struct clk *clk) | ||
150 | { | ||
151 | if (clk && !IS_ERR(clk)) | ||
152 | module_put(clk->owner); | ||
153 | } | ||
154 | EXPORT_SYMBOL(clk_put); | ||
155 | |||
156 | /*------------------------------------------------------------------------- | 95 | /*------------------------------------------------------------------------- |
157 | * Optional clock functions defined in include/linux/clk.h | 96 | * Optional clock functions defined in include/linux/clk.h |
158 | *-------------------------------------------------------------------------*/ | 97 | *-------------------------------------------------------------------------*/ |
@@ -185,6 +124,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
185 | spin_lock_irqsave(&clockfw_lock, flags); | 124 | spin_lock_irqsave(&clockfw_lock, flags); |
186 | if (arch_clock->clk_set_rate) | 125 | if (arch_clock->clk_set_rate) |
187 | ret = arch_clock->clk_set_rate(clk, rate); | 126 | ret = arch_clock->clk_set_rate(clk, rate); |
127 | if (ret == 0) { | ||
128 | if (clk->recalc) | ||
129 | clk->rate = clk->recalc(clk); | ||
130 | propagate_rate(clk); | ||
131 | } | ||
188 | spin_unlock_irqrestore(&clockfw_lock, flags); | 132 | spin_unlock_irqrestore(&clockfw_lock, flags); |
189 | 133 | ||
190 | return ret; | 134 | return ret; |
@@ -200,8 +144,16 @@ int clk_set_parent(struct clk *clk, struct clk *parent) | |||
200 | return ret; | 144 | return ret; |
201 | 145 | ||
202 | spin_lock_irqsave(&clockfw_lock, flags); | 146 | spin_lock_irqsave(&clockfw_lock, flags); |
203 | if (arch_clock->clk_set_parent) | 147 | if (clk->usecount == 0) { |
204 | ret = arch_clock->clk_set_parent(clk, parent); | 148 | if (arch_clock->clk_set_parent) |
149 | ret = arch_clock->clk_set_parent(clk, parent); | ||
150 | if (ret == 0) { | ||
151 | if (clk->recalc) | ||
152 | clk->rate = clk->recalc(clk); | ||
153 | propagate_rate(clk); | ||
154 | } | ||
155 | } else | ||
156 | ret = -EBUSY; | ||
205 | spin_unlock_irqrestore(&clockfw_lock, flags); | 157 | spin_unlock_irqrestore(&clockfw_lock, flags); |
206 | 158 | ||
207 | return ret; | 159 | return ret; |
@@ -210,18 +162,7 @@ EXPORT_SYMBOL(clk_set_parent); | |||
210 | 162 | ||
211 | struct clk *clk_get_parent(struct clk *clk) | 163 | struct clk *clk_get_parent(struct clk *clk) |
212 | { | 164 | { |
213 | unsigned long flags; | 165 | return clk->parent; |
214 | struct clk * ret = NULL; | ||
215 | |||
216 | if (clk == NULL || IS_ERR(clk)) | ||
217 | return ret; | ||
218 | |||
219 | spin_lock_irqsave(&clockfw_lock, flags); | ||
220 | if (arch_clock->clk_get_parent) | ||
221 | ret = arch_clock->clk_get_parent(clk); | ||
222 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
223 | |||
224 | return ret; | ||
225 | } | 166 | } |
226 | EXPORT_SYMBOL(clk_get_parent); | 167 | EXPORT_SYMBOL(clk_get_parent); |
227 | 168 | ||
@@ -250,14 +191,20 @@ static int __init omap_clk_setup(char *str) | |||
250 | __setup("mpurate=", omap_clk_setup); | 191 | __setup("mpurate=", omap_clk_setup); |
251 | 192 | ||
252 | /* Used for clocks that always have same value as the parent clock */ | 193 | /* Used for clocks that always have same value as the parent clock */ |
253 | void followparent_recalc(struct clk *clk) | 194 | unsigned long followparent_recalc(struct clk *clk) |
254 | { | 195 | { |
255 | if (clk == NULL || IS_ERR(clk)) | 196 | return clk->parent->rate; |
256 | return; | 197 | } |
257 | 198 | ||
258 | clk->rate = clk->parent->rate; | 199 | void clk_reparent(struct clk *child, struct clk *parent) |
259 | if (unlikely(clk->flags & RATE_PROPAGATES)) | 200 | { |
260 | propagate_rate(clk); | 201 | list_del_init(&child->sibling); |
202 | if (parent) | ||
203 | list_add(&child->sibling, &parent->children); | ||
204 | child->parent = parent; | ||
205 | |||
206 | /* now do the debugfs renaming to reattach the child | ||
207 | to the proper parent */ | ||
261 | } | 208 | } |
262 | 209 | ||
263 | /* Propagate rate to children */ | 210 | /* Propagate rate to children */ |
@@ -265,17 +212,15 @@ void propagate_rate(struct clk * tclk) | |||
265 | { | 212 | { |
266 | struct clk *clkp; | 213 | struct clk *clkp; |
267 | 214 | ||
268 | if (tclk == NULL || IS_ERR(tclk)) | 215 | list_for_each_entry(clkp, &tclk->children, sibling) { |
269 | return; | 216 | if (clkp->recalc) |
270 | 217 | clkp->rate = clkp->recalc(clkp); | |
271 | list_for_each_entry(clkp, &clocks, node) { | 218 | propagate_rate(clkp); |
272 | if (likely(clkp->parent != tclk)) | ||
273 | continue; | ||
274 | if (likely((u32)clkp->recalc)) | ||
275 | clkp->recalc(clkp); | ||
276 | } | 219 | } |
277 | } | 220 | } |
278 | 221 | ||
222 | static LIST_HEAD(root_clks); | ||
223 | |||
279 | /** | 224 | /** |
280 | * recalculate_root_clocks - recalculate and propagate all root clocks | 225 | * recalculate_root_clocks - recalculate and propagate all root clocks |
281 | * | 226 | * |
@@ -287,18 +232,35 @@ void recalculate_root_clocks(void) | |||
287 | { | 232 | { |
288 | struct clk *clkp; | 233 | struct clk *clkp; |
289 | 234 | ||
290 | list_for_each_entry(clkp, &clocks, node) { | 235 | list_for_each_entry(clkp, &root_clks, sibling) { |
291 | if (unlikely(!clkp->parent) && likely((u32)clkp->recalc)) | 236 | if (clkp->recalc) |
292 | clkp->recalc(clkp); | 237 | clkp->rate = clkp->recalc(clkp); |
238 | propagate_rate(clkp); | ||
293 | } | 239 | } |
294 | } | 240 | } |
295 | 241 | ||
242 | void clk_init_one(struct clk *clk) | ||
243 | { | ||
244 | INIT_LIST_HEAD(&clk->children); | ||
245 | } | ||
246 | |||
296 | int clk_register(struct clk *clk) | 247 | int clk_register(struct clk *clk) |
297 | { | 248 | { |
298 | if (clk == NULL || IS_ERR(clk)) | 249 | if (clk == NULL || IS_ERR(clk)) |
299 | return -EINVAL; | 250 | return -EINVAL; |
300 | 251 | ||
252 | /* | ||
253 | * trap out already registered clocks | ||
254 | */ | ||
255 | if (clk->node.next || clk->node.prev) | ||
256 | return 0; | ||
257 | |||
301 | mutex_lock(&clocks_mutex); | 258 | mutex_lock(&clocks_mutex); |
259 | if (clk->parent) | ||
260 | list_add(&clk->sibling, &clk->parent->children); | ||
261 | else | ||
262 | list_add(&clk->sibling, &root_clks); | ||
263 | |||
302 | list_add(&clk->node, &clocks); | 264 | list_add(&clk->node, &clocks); |
303 | if (clk->init) | 265 | if (clk->init) |
304 | clk->init(clk); | 266 | clk->init(clk); |
@@ -314,39 +276,12 @@ void clk_unregister(struct clk *clk) | |||
314 | return; | 276 | return; |
315 | 277 | ||
316 | mutex_lock(&clocks_mutex); | 278 | mutex_lock(&clocks_mutex); |
279 | list_del(&clk->sibling); | ||
317 | list_del(&clk->node); | 280 | list_del(&clk->node); |
318 | mutex_unlock(&clocks_mutex); | 281 | mutex_unlock(&clocks_mutex); |
319 | } | 282 | } |
320 | EXPORT_SYMBOL(clk_unregister); | 283 | EXPORT_SYMBOL(clk_unregister); |
321 | 284 | ||
322 | void clk_deny_idle(struct clk *clk) | ||
323 | { | ||
324 | unsigned long flags; | ||
325 | |||
326 | if (clk == NULL || IS_ERR(clk)) | ||
327 | return; | ||
328 | |||
329 | spin_lock_irqsave(&clockfw_lock, flags); | ||
330 | if (arch_clock->clk_deny_idle) | ||
331 | arch_clock->clk_deny_idle(clk); | ||
332 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
333 | } | ||
334 | EXPORT_SYMBOL(clk_deny_idle); | ||
335 | |||
336 | void clk_allow_idle(struct clk *clk) | ||
337 | { | ||
338 | unsigned long flags; | ||
339 | |||
340 | if (clk == NULL || IS_ERR(clk)) | ||
341 | return; | ||
342 | |||
343 | spin_lock_irqsave(&clockfw_lock, flags); | ||
344 | if (arch_clock->clk_allow_idle) | ||
345 | arch_clock->clk_allow_idle(clk); | ||
346 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
347 | } | ||
348 | EXPORT_SYMBOL(clk_allow_idle); | ||
349 | |||
350 | void clk_enable_init_clocks(void) | 285 | void clk_enable_init_clocks(void) |
351 | { | 286 | { |
352 | struct clk *clkp; | 287 | struct clk *clkp; |
@@ -358,6 +293,23 @@ void clk_enable_init_clocks(void) | |||
358 | } | 293 | } |
359 | EXPORT_SYMBOL(clk_enable_init_clocks); | 294 | EXPORT_SYMBOL(clk_enable_init_clocks); |
360 | 295 | ||
296 | /* | ||
297 | * Low level helpers | ||
298 | */ | ||
299 | static int clkll_enable_null(struct clk *clk) | ||
300 | { | ||
301 | return 0; | ||
302 | } | ||
303 | |||
304 | static void clkll_disable_null(struct clk *clk) | ||
305 | { | ||
306 | } | ||
307 | |||
308 | const struct clkops clkops_null = { | ||
309 | .enable = clkll_enable_null, | ||
310 | .disable = clkll_disable_null, | ||
311 | }; | ||
312 | |||
361 | #ifdef CONFIG_CPU_FREQ | 313 | #ifdef CONFIG_CPU_FREQ |
362 | void clk_init_cpufreq_table(struct cpufreq_frequency_table **table) | 314 | void clk_init_cpufreq_table(struct cpufreq_frequency_table **table) |
363 | { | 315 | { |
@@ -383,8 +335,10 @@ static int __init clk_disable_unused(void) | |||
383 | unsigned long flags; | 335 | unsigned long flags; |
384 | 336 | ||
385 | list_for_each_entry(ck, &clocks, node) { | 337 | list_for_each_entry(ck, &clocks, node) { |
386 | if (ck->usecount > 0 || (ck->flags & ALWAYS_ENABLED) || | 338 | if (ck->ops == &clkops_null) |
387 | ck->enable_reg == 0) | 339 | continue; |
340 | |||
341 | if (ck->usecount > 0 || ck->enable_reg == 0) | ||
388 | continue; | 342 | continue; |
389 | 343 | ||
390 | spin_lock_irqsave(&clockfw_lock, flags); | 344 | spin_lock_irqsave(&clockfw_lock, flags); |
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c index 0843b8882f93..d1797147732f 100644 --- a/arch/arm/plat-omap/common.c +++ b/arch/arm/plat-omap/common.c | |||
@@ -200,20 +200,16 @@ static struct clocksource clocksource_32k = { | |||
200 | }; | 200 | }; |
201 | 201 | ||
202 | /* | 202 | /* |
203 | * Rounds down to nearest nsec. | ||
204 | */ | ||
205 | unsigned long long omap_32k_ticks_to_nsecs(unsigned long ticks_32k) | ||
206 | { | ||
207 | return cyc2ns(&clocksource_32k, ticks_32k); | ||
208 | } | ||
209 | |||
210 | /* | ||
211 | * Returns current time from boot in nsecs. It's OK for this to wrap | 203 | * Returns current time from boot in nsecs. It's OK for this to wrap |
212 | * around for now, as it's just a relative time stamp. | 204 | * around for now, as it's just a relative time stamp. |
213 | */ | 205 | */ |
214 | unsigned long long sched_clock(void) | 206 | unsigned long long sched_clock(void) |
215 | { | 207 | { |
216 | return omap_32k_ticks_to_nsecs(omap_32k_read()); | 208 | unsigned long long ret; |
209 | |||
210 | ret = (unsigned long long)omap_32k_read(); | ||
211 | ret = (ret * clocksource_32k.mult_orig) >> clocksource_32k.shift; | ||
212 | return ret; | ||
217 | } | 213 | } |
218 | 214 | ||
219 | static int __init omap_init_clocksource_32k(void) | 215 | static int __init omap_init_clocksource_32k(void) |
@@ -249,7 +245,7 @@ static struct omap_globals *omap2_globals; | |||
249 | static void __init __omap2_set_globals(void) | 245 | static void __init __omap2_set_globals(void) |
250 | { | 246 | { |
251 | omap2_set_globals_tap(omap2_globals); | 247 | omap2_set_globals_tap(omap2_globals); |
252 | omap2_set_globals_memory(omap2_globals); | 248 | omap2_set_globals_sdrc(omap2_globals); |
253 | omap2_set_globals_control(omap2_globals); | 249 | omap2_set_globals_control(omap2_globals); |
254 | omap2_set_globals_prcm(omap2_globals); | 250 | omap2_set_globals_prcm(omap2_globals); |
255 | } | 251 | } |
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c index b2690242a390..843e8af64066 100644 --- a/arch/arm/plat-omap/cpu-omap.c +++ b/arch/arm/plat-omap/cpu-omap.c | |||
@@ -23,10 +23,13 @@ | |||
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | 24 | ||
25 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
26 | #include <mach/clock.h> | ||
26 | #include <asm/system.h> | 27 | #include <asm/system.h> |
27 | 28 | ||
28 | #define VERY_HI_RATE 900000000 | 29 | #define VERY_HI_RATE 900000000 |
29 | 30 | ||
31 | static struct cpufreq_frequency_table *freq_table; | ||
32 | |||
30 | #ifdef CONFIG_ARCH_OMAP1 | 33 | #ifdef CONFIG_ARCH_OMAP1 |
31 | #define MPU_CLK "mpu" | 34 | #define MPU_CLK "mpu" |
32 | #else | 35 | #else |
@@ -39,6 +42,9 @@ static struct clk *mpu_clk; | |||
39 | 42 | ||
40 | int omap_verify_speed(struct cpufreq_policy *policy) | 43 | int omap_verify_speed(struct cpufreq_policy *policy) |
41 | { | 44 | { |
45 | if (freq_table) | ||
46 | return cpufreq_frequency_table_verify(policy, freq_table); | ||
47 | |||
42 | if (policy->cpu) | 48 | if (policy->cpu) |
43 | return -EINVAL; | 49 | return -EINVAL; |
44 | 50 | ||
@@ -70,12 +76,26 @@ static int omap_target(struct cpufreq_policy *policy, | |||
70 | struct cpufreq_freqs freqs; | 76 | struct cpufreq_freqs freqs; |
71 | int ret = 0; | 77 | int ret = 0; |
72 | 78 | ||
79 | /* Ensure desired rate is within allowed range. Some govenors | ||
80 | * (ondemand) will just pass target_freq=0 to get the minimum. */ | ||
81 | if (target_freq < policy->cpuinfo.min_freq) | ||
82 | target_freq = policy->cpuinfo.min_freq; | ||
83 | if (target_freq > policy->cpuinfo.max_freq) | ||
84 | target_freq = policy->cpuinfo.max_freq; | ||
85 | |||
73 | freqs.old = omap_getspeed(0); | 86 | freqs.old = omap_getspeed(0); |
74 | freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000; | 87 | freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000; |
75 | freqs.cpu = 0; | 88 | freqs.cpu = 0; |
76 | 89 | ||
90 | if (freqs.old == freqs.new) | ||
91 | return ret; | ||
92 | |||
77 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | 93 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); |
78 | ret = clk_set_rate(mpu_clk, target_freq * 1000); | 94 | #ifdef CONFIG_CPU_FREQ_DEBUG |
95 | printk(KERN_DEBUG "cpufreq-omap: transition: %u --> %u\n", | ||
96 | freqs.old, freqs.new); | ||
97 | #endif | ||
98 | ret = clk_set_rate(mpu_clk, freqs.new * 1000); | ||
79 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 99 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); |
80 | 100 | ||
81 | return ret; | 101 | return ret; |
@@ -83,16 +103,31 @@ static int omap_target(struct cpufreq_policy *policy, | |||
83 | 103 | ||
84 | static int __init omap_cpu_init(struct cpufreq_policy *policy) | 104 | static int __init omap_cpu_init(struct cpufreq_policy *policy) |
85 | { | 105 | { |
106 | int result = 0; | ||
107 | |||
86 | mpu_clk = clk_get(NULL, MPU_CLK); | 108 | mpu_clk = clk_get(NULL, MPU_CLK); |
87 | if (IS_ERR(mpu_clk)) | 109 | if (IS_ERR(mpu_clk)) |
88 | return PTR_ERR(mpu_clk); | 110 | return PTR_ERR(mpu_clk); |
89 | 111 | ||
90 | if (policy->cpu != 0) | 112 | if (policy->cpu != 0) |
91 | return -EINVAL; | 113 | return -EINVAL; |
114 | |||
92 | policy->cur = policy->min = policy->max = omap_getspeed(0); | 115 | policy->cur = policy->min = policy->max = omap_getspeed(0); |
93 | policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000; | 116 | |
94 | policy->cpuinfo.max_freq = clk_round_rate(mpu_clk, VERY_HI_RATE) / 1000; | 117 | clk_init_cpufreq_table(&freq_table); |
95 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; | 118 | if (freq_table) { |
119 | result = cpufreq_frequency_table_cpuinfo(policy, freq_table); | ||
120 | if (!result) | ||
121 | cpufreq_frequency_table_get_attr(freq_table, | ||
122 | policy->cpu); | ||
123 | } else { | ||
124 | policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000; | ||
125 | policy->cpuinfo.max_freq = clk_round_rate(mpu_clk, | ||
126 | VERY_HI_RATE) / 1000; | ||
127 | } | ||
128 | |||
129 | /* FIXME: what's the actual transition time? */ | ||
130 | policy->cpuinfo.transition_latency = 10 * 1000 * 1000; | ||
96 | 131 | ||
97 | return 0; | 132 | return 0; |
98 | } | 133 | } |
@@ -103,6 +138,11 @@ static int omap_cpu_exit(struct cpufreq_policy *policy) | |||
103 | return 0; | 138 | return 0; |
104 | } | 139 | } |
105 | 140 | ||
141 | static struct freq_attr *omap_cpufreq_attr[] = { | ||
142 | &cpufreq_freq_attr_scaling_available_freqs, | ||
143 | NULL, | ||
144 | }; | ||
145 | |||
106 | static struct cpufreq_driver omap_driver = { | 146 | static struct cpufreq_driver omap_driver = { |
107 | .flags = CPUFREQ_STICKY, | 147 | .flags = CPUFREQ_STICKY, |
108 | .verify = omap_verify_speed, | 148 | .verify = omap_verify_speed, |
@@ -111,6 +151,7 @@ static struct cpufreq_driver omap_driver = { | |||
111 | .init = omap_cpu_init, | 151 | .init = omap_cpu_init, |
112 | .exit = omap_cpu_exit, | 152 | .exit = omap_cpu_exit, |
113 | .name = "omap", | 153 | .name = "omap", |
154 | .attr = omap_cpufreq_attr, | ||
114 | }; | 155 | }; |
115 | 156 | ||
116 | static int __init omap_cpufreq_init(void) | 157 | static int __init omap_cpufreq_init(void) |
@@ -119,3 +160,11 @@ static int __init omap_cpufreq_init(void) | |||
119 | } | 160 | } |
120 | 161 | ||
121 | arch_initcall(omap_cpufreq_init); | 162 | arch_initcall(omap_cpufreq_init); |
163 | |||
164 | /* | ||
165 | * if ever we want to remove this, upon cleanup call: | ||
166 | * | ||
167 | * cpufreq_unregister_driver() | ||
168 | * cpufreq_frequency_table_put_attr() | ||
169 | */ | ||
170 | |||
diff --git a/arch/arm/plat-omap/include/mach/clkdev.h b/arch/arm/plat-omap/include/mach/clkdev.h new file mode 100644 index 000000000000..730c49d1ebd8 --- /dev/null +++ b/arch/arm/plat-omap/include/mach/clkdev.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef __MACH_CLKDEV_H | ||
2 | #define __MACH_CLKDEV_H | ||
3 | |||
4 | static inline int __clk_get(struct clk *clk) | ||
5 | { | ||
6 | return 1; | ||
7 | } | ||
8 | |||
9 | static inline void __clk_put(struct clk *clk) | ||
10 | { | ||
11 | } | ||
12 | |||
13 | #endif | ||
diff --git a/arch/arm/plat-omap/include/mach/clock.h b/arch/arm/plat-omap/include/mach/clock.h index 719298554ed7..073a2c5569f0 100644 --- a/arch/arm/plat-omap/include/mach/clock.h +++ b/arch/arm/plat-omap/include/mach/clock.h | |||
@@ -17,11 +17,16 @@ struct module; | |||
17 | struct clk; | 17 | struct clk; |
18 | struct clockdomain; | 18 | struct clockdomain; |
19 | 19 | ||
20 | struct clkops { | ||
21 | int (*enable)(struct clk *); | ||
22 | void (*disable)(struct clk *); | ||
23 | }; | ||
24 | |||
20 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | 25 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) |
21 | 26 | ||
22 | struct clksel_rate { | 27 | struct clksel_rate { |
23 | u8 div; | ||
24 | u32 val; | 28 | u32 val; |
29 | u8 div; | ||
25 | u8 flags; | 30 | u8 flags; |
26 | }; | 31 | }; |
27 | 32 | ||
@@ -34,24 +39,28 @@ struct dpll_data { | |||
34 | void __iomem *mult_div1_reg; | 39 | void __iomem *mult_div1_reg; |
35 | u32 mult_mask; | 40 | u32 mult_mask; |
36 | u32 div1_mask; | 41 | u32 div1_mask; |
42 | struct clk *clk_bypass; | ||
43 | struct clk *clk_ref; | ||
44 | void __iomem *control_reg; | ||
45 | u32 enable_mask; | ||
46 | unsigned int rate_tolerance; | ||
47 | unsigned long last_rounded_rate; | ||
37 | u16 last_rounded_m; | 48 | u16 last_rounded_m; |
38 | u8 last_rounded_n; | 49 | u8 last_rounded_n; |
39 | unsigned long last_rounded_rate; | 50 | u8 min_divider; |
40 | unsigned int rate_tolerance; | ||
41 | u16 max_multiplier; | ||
42 | u8 max_divider; | 51 | u8 max_divider; |
43 | u32 max_tolerance; | 52 | u32 max_tolerance; |
53 | u16 max_multiplier; | ||
44 | # if defined(CONFIG_ARCH_OMAP3) | 54 | # if defined(CONFIG_ARCH_OMAP3) |
45 | u8 modes; | 55 | u8 modes; |
46 | void __iomem *control_reg; | 56 | void __iomem *autoidle_reg; |
47 | u32 enable_mask; | 57 | void __iomem *idlest_reg; |
58 | u32 autoidle_mask; | ||
59 | u32 freqsel_mask; | ||
60 | u32 idlest_mask; | ||
48 | u8 auto_recal_bit; | 61 | u8 auto_recal_bit; |
49 | u8 recal_en_bit; | 62 | u8 recal_en_bit; |
50 | u8 recal_st_bit; | 63 | u8 recal_st_bit; |
51 | void __iomem *autoidle_reg; | ||
52 | u32 autoidle_mask; | ||
53 | void __iomem *idlest_reg; | ||
54 | u8 idlest_bit; | ||
55 | # endif | 64 | # endif |
56 | }; | 65 | }; |
57 | 66 | ||
@@ -59,21 +68,21 @@ struct dpll_data { | |||
59 | 68 | ||
60 | struct clk { | 69 | struct clk { |
61 | struct list_head node; | 70 | struct list_head node; |
62 | struct module *owner; | 71 | const struct clkops *ops; |
63 | const char *name; | 72 | const char *name; |
64 | int id; | 73 | int id; |
65 | struct clk *parent; | 74 | struct clk *parent; |
75 | struct list_head children; | ||
76 | struct list_head sibling; /* node for children */ | ||
66 | unsigned long rate; | 77 | unsigned long rate; |
67 | __u32 flags; | 78 | __u32 flags; |
68 | void __iomem *enable_reg; | 79 | void __iomem *enable_reg; |
69 | __u8 enable_bit; | 80 | unsigned long (*recalc)(struct clk *); |
70 | __s8 usecount; | ||
71 | void (*recalc)(struct clk *); | ||
72 | int (*set_rate)(struct clk *, unsigned long); | 81 | int (*set_rate)(struct clk *, unsigned long); |
73 | long (*round_rate)(struct clk *, unsigned long); | 82 | long (*round_rate)(struct clk *, unsigned long); |
74 | void (*init)(struct clk *); | 83 | void (*init)(struct clk *); |
75 | int (*enable)(struct clk *); | 84 | __u8 enable_bit; |
76 | void (*disable)(struct clk *); | 85 | __s8 usecount; |
77 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | 86 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) |
78 | u8 fixed_div; | 87 | u8 fixed_div; |
79 | void __iomem *clksel_reg; | 88 | void __iomem *clksel_reg; |
@@ -99,7 +108,6 @@ struct clk_functions { | |||
99 | long (*clk_round_rate)(struct clk *clk, unsigned long rate); | 108 | long (*clk_round_rate)(struct clk *clk, unsigned long rate); |
100 | int (*clk_set_rate)(struct clk *clk, unsigned long rate); | 109 | int (*clk_set_rate)(struct clk *clk, unsigned long rate); |
101 | int (*clk_set_parent)(struct clk *clk, struct clk *parent); | 110 | int (*clk_set_parent)(struct clk *clk, struct clk *parent); |
102 | struct clk * (*clk_get_parent)(struct clk *clk); | ||
103 | void (*clk_allow_idle)(struct clk *clk); | 111 | void (*clk_allow_idle)(struct clk *clk); |
104 | void (*clk_deny_idle)(struct clk *clk); | 112 | void (*clk_deny_idle)(struct clk *clk); |
105 | void (*clk_disable_unused)(struct clk *clk); | 113 | void (*clk_disable_unused)(struct clk *clk); |
@@ -110,42 +118,33 @@ struct clk_functions { | |||
110 | 118 | ||
111 | extern unsigned int mpurate; | 119 | extern unsigned int mpurate; |
112 | 120 | ||
113 | extern int clk_init(struct clk_functions * custom_clocks); | 121 | extern int clk_init(struct clk_functions *custom_clocks); |
122 | extern void clk_init_one(struct clk *clk); | ||
114 | extern int clk_register(struct clk *clk); | 123 | extern int clk_register(struct clk *clk); |
124 | extern void clk_reparent(struct clk *child, struct clk *parent); | ||
115 | extern void clk_unregister(struct clk *clk); | 125 | extern void clk_unregister(struct clk *clk); |
116 | extern void propagate_rate(struct clk *clk); | 126 | extern void propagate_rate(struct clk *clk); |
117 | extern void recalculate_root_clocks(void); | 127 | extern void recalculate_root_clocks(void); |
118 | extern void followparent_recalc(struct clk * clk); | 128 | extern unsigned long followparent_recalc(struct clk *clk); |
119 | extern void clk_allow_idle(struct clk *clk); | ||
120 | extern void clk_deny_idle(struct clk *clk); | ||
121 | extern int clk_get_usecount(struct clk *clk); | ||
122 | extern void clk_enable_init_clocks(void); | 129 | extern void clk_enable_init_clocks(void); |
130 | #ifdef CONFIG_CPU_FREQ | ||
131 | extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); | ||
132 | #endif | ||
133 | |||
134 | extern const struct clkops clkops_null; | ||
123 | 135 | ||
124 | /* Clock flags */ | 136 | /* Clock flags */ |
125 | #define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ | 137 | /* bit 0 is free */ |
126 | #define RATE_FIXED (1 << 1) /* Fixed clock rate */ | 138 | #define RATE_FIXED (1 << 1) /* Fixed clock rate */ |
127 | #define RATE_PROPAGATES (1 << 2) /* Program children too */ | 139 | /* bits 2-4 are free */ |
128 | #define VIRTUAL_CLOCK (1 << 3) /* Composite clock from table */ | ||
129 | #define ALWAYS_ENABLED (1 << 4) /* Clock cannot be disabled */ | ||
130 | #define ENABLE_REG_32BIT (1 << 5) /* Use 32-bit access */ | 140 | #define ENABLE_REG_32BIT (1 << 5) /* Use 32-bit access */ |
131 | #define VIRTUAL_IO_ADDRESS (1 << 6) /* Clock in virtual address */ | ||
132 | #define CLOCK_IDLE_CONTROL (1 << 7) | 141 | #define CLOCK_IDLE_CONTROL (1 << 7) |
133 | #define CLOCK_NO_IDLE_PARENT (1 << 8) | 142 | #define CLOCK_NO_IDLE_PARENT (1 << 8) |
134 | #define DELAYED_APP (1 << 9) /* Delay application of clock */ | 143 | #define DELAYED_APP (1 << 9) /* Delay application of clock */ |
135 | #define CONFIG_PARTICIPANT (1 << 10) /* Fundamental clock */ | 144 | #define CONFIG_PARTICIPANT (1 << 10) /* Fundamental clock */ |
136 | #define ENABLE_ON_INIT (1 << 11) /* Enable upon framework init */ | 145 | #define ENABLE_ON_INIT (1 << 11) /* Enable upon framework init */ |
137 | #define INVERT_ENABLE (1 << 12) /* 0 enables, 1 disables */ | 146 | #define INVERT_ENABLE (1 << 12) /* 0 enables, 1 disables */ |
138 | /* bits 13-20 are currently free */ | 147 | /* bits 13-31 are currently free */ |
139 | #define CLOCK_IN_OMAP310 (1 << 21) | ||
140 | #define CLOCK_IN_OMAP730 (1 << 22) | ||
141 | #define CLOCK_IN_OMAP1510 (1 << 23) | ||
142 | #define CLOCK_IN_OMAP16XX (1 << 24) | ||
143 | #define CLOCK_IN_OMAP242X (1 << 25) | ||
144 | #define CLOCK_IN_OMAP243X (1 << 26) | ||
145 | #define CLOCK_IN_OMAP343X (1 << 27) /* clocks common to all 343X */ | ||
146 | #define PARENT_CONTROLS_CLOCK (1 << 28) | ||
147 | #define CLOCK_IN_OMAP3430ES1 (1 << 29) /* 3430ES1 clocks only */ | ||
148 | #define CLOCK_IN_OMAP3430ES2 (1 << 30) /* 3430ES2 clocks only */ | ||
149 | 148 | ||
150 | /* Clksel_rate flags */ | 149 | /* Clksel_rate flags */ |
151 | #define DEFAULT_RATE (1 << 0) | 150 | #define DEFAULT_RATE (1 << 0) |
@@ -157,9 +156,4 @@ extern void clk_enable_init_clocks(void); | |||
157 | #define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) | 156 | #define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) |
158 | 157 | ||
159 | 158 | ||
160 | /* CM_CLKSEL2_PLL.CORE_CLK_SRC options (24XX) */ | ||
161 | #define CORE_CLK_SRC_32K 0 | ||
162 | #define CORE_CLK_SRC_DPLL 1 | ||
163 | #define CORE_CLK_SRC_DPLL_X2 2 | ||
164 | |||
165 | #endif | 159 | #endif |
diff --git a/arch/arm/plat-omap/include/mach/clockdomain.h b/arch/arm/plat-omap/include/mach/clockdomain.h index 1f51f0173784..b9d0dd2da89b 100644 --- a/arch/arm/plat-omap/include/mach/clockdomain.h +++ b/arch/arm/plat-omap/include/mach/clockdomain.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm-arm/arch-omap/clockdomain.h | 2 | * arch/arm/plat-omap/include/mach/clockdomain.h |
3 | * | 3 | * |
4 | * OMAP2/3 clockdomain framework functions | 4 | * OMAP2/3 clockdomain framework functions |
5 | * | 5 | * |
@@ -48,11 +48,13 @@ | |||
48 | */ | 48 | */ |
49 | struct clkdm_pwrdm_autodep { | 49 | struct clkdm_pwrdm_autodep { |
50 | 50 | ||
51 | /* Name of the powerdomain to add a wkdep/sleepdep on */ | 51 | union { |
52 | const char *pwrdm_name; | 52 | /* Name of the powerdomain to add a wkdep/sleepdep on */ |
53 | const char *name; | ||
53 | 54 | ||
54 | /* Powerdomain pointer (looked up at clkdm_init() time) */ | 55 | /* Powerdomain pointer (looked up at clkdm_init() time) */ |
55 | struct powerdomain *pwrdm; | 56 | struct powerdomain *ptr; |
57 | } pwrdm; | ||
56 | 58 | ||
57 | /* OMAP chip types that this clockdomain dep is valid on */ | 59 | /* OMAP chip types that this clockdomain dep is valid on */ |
58 | const struct omap_chip_id omap_chip; | 60 | const struct omap_chip_id omap_chip; |
@@ -64,8 +66,13 @@ struct clockdomain { | |||
64 | /* Clockdomain name */ | 66 | /* Clockdomain name */ |
65 | const char *name; | 67 | const char *name; |
66 | 68 | ||
67 | /* Powerdomain enclosing this clockdomain */ | 69 | union { |
68 | const char *pwrdm_name; | 70 | /* Powerdomain enclosing this clockdomain */ |
71 | const char *name; | ||
72 | |||
73 | /* Powerdomain pointer assigned at clkdm_register() */ | ||
74 | struct powerdomain *ptr; | ||
75 | } pwrdm; | ||
69 | 76 | ||
70 | /* CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg */ | 77 | /* CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg */ |
71 | const u16 clktrctrl_mask; | 78 | const u16 clktrctrl_mask; |
@@ -79,9 +86,6 @@ struct clockdomain { | |||
79 | /* Usecount tracking */ | 86 | /* Usecount tracking */ |
80 | atomic_t usecount; | 87 | atomic_t usecount; |
81 | 88 | ||
82 | /* Powerdomain pointer assigned at clkdm_register() */ | ||
83 | struct powerdomain *pwrdm; | ||
84 | |||
85 | struct list_head node; | 89 | struct list_head node; |
86 | 90 | ||
87 | }; | 91 | }; |
diff --git a/arch/arm/plat-omap/include/mach/common.h b/arch/arm/plat-omap/include/mach/common.h index ef70e2b0f054..0ecf36deb17b 100644 --- a/arch/arm/plat-omap/include/mach/common.h +++ b/arch/arm/plat-omap/include/mach/common.h | |||
@@ -35,7 +35,7 @@ extern void omap_map_common_io(void); | |||
35 | extern struct sys_timer omap_timer; | 35 | extern struct sys_timer omap_timer; |
36 | extern void omap_serial_init(void); | 36 | extern void omap_serial_init(void); |
37 | extern void omap_serial_enable_clocks(int enable); | 37 | extern void omap_serial_enable_clocks(int enable); |
38 | #ifdef CONFIG_I2C_OMAP | 38 | #if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE) |
39 | extern int omap_register_i2c_bus(int bus_id, u32 clkrate, | 39 | extern int omap_register_i2c_bus(int bus_id, u32 clkrate, |
40 | struct i2c_board_info const *info, | 40 | struct i2c_board_info const *info, |
41 | unsigned len); | 41 | unsigned len); |
@@ -65,7 +65,7 @@ void omap2_set_globals_343x(void); | |||
65 | 65 | ||
66 | /* These get called from omap2_set_globals_xxxx(), do not call these */ | 66 | /* These get called from omap2_set_globals_xxxx(), do not call these */ |
67 | void omap2_set_globals_tap(struct omap_globals *); | 67 | void omap2_set_globals_tap(struct omap_globals *); |
68 | void omap2_set_globals_memory(struct omap_globals *); | 68 | void omap2_set_globals_sdrc(struct omap_globals *); |
69 | void omap2_set_globals_control(struct omap_globals *); | 69 | void omap2_set_globals_control(struct omap_globals *); |
70 | void omap2_set_globals_prcm(struct omap_globals *); | 70 | void omap2_set_globals_prcm(struct omap_globals *); |
71 | 71 | ||
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h index a8e1178a9468..4166a970daa4 100644 --- a/arch/arm/plat-omap/include/mach/cpu.h +++ b/arch/arm/plat-omap/include/mach/cpu.h | |||
@@ -355,13 +355,27 @@ IS_OMAP_TYPE(3430, 0x3430) | |||
355 | * use omap_chip_is(). | 355 | * use omap_chip_is(). |
356 | * | 356 | * |
357 | */ | 357 | */ |
358 | #define CHIP_IS_OMAP2420 (1 << 0) | 358 | #define CHIP_IS_OMAP2420 (1 << 0) |
359 | #define CHIP_IS_OMAP2430 (1 << 1) | 359 | #define CHIP_IS_OMAP2430 (1 << 1) |
360 | #define CHIP_IS_OMAP3430 (1 << 2) | 360 | #define CHIP_IS_OMAP3430 (1 << 2) |
361 | #define CHIP_IS_OMAP3430ES1 (1 << 3) | 361 | #define CHIP_IS_OMAP3430ES1 (1 << 3) |
362 | #define CHIP_IS_OMAP3430ES2 (1 << 4) | 362 | #define CHIP_IS_OMAP3430ES2 (1 << 4) |
363 | #define CHIP_IS_OMAP3430ES3_0 (1 << 5) | ||
364 | #define CHIP_IS_OMAP3430ES3_1 (1 << 6) | ||
365 | |||
366 | #define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) | ||
367 | |||
368 | /* | ||
369 | * "GE" here represents "greater than or equal to" in terms of ES | ||
370 | * levels. So CHIP_GE_OMAP3430ES2 is intended to match all OMAP3430 | ||
371 | * chips at ES2 and beyond, but not, for example, any OMAP lines after | ||
372 | * OMAP3. | ||
373 | */ | ||
374 | #define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ | ||
375 | CHIP_IS_OMAP3430ES3_0 | \ | ||
376 | CHIP_IS_OMAP3430ES3_1) | ||
377 | #define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1) | ||
363 | 378 | ||
364 | #define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) | ||
365 | 379 | ||
366 | int omap_chip_is(struct omap_chip_id oci); | 380 | int omap_chip_is(struct omap_chip_id oci); |
367 | int omap_type(void); | 381 | int omap_type(void); |
diff --git a/arch/arm/plat-omap/include/mach/gpmc.h b/arch/arm/plat-omap/include/mach/gpmc.h index 45b678439bb7..921b16532ff5 100644 --- a/arch/arm/plat-omap/include/mach/gpmc.h +++ b/arch/arm/plat-omap/include/mach/gpmc.h | |||
@@ -103,6 +103,6 @@ extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base); | |||
103 | extern void gpmc_cs_free(int cs); | 103 | extern void gpmc_cs_free(int cs); |
104 | extern int gpmc_cs_set_reserved(int cs, int reserved); | 104 | extern int gpmc_cs_set_reserved(int cs, int reserved); |
105 | extern int gpmc_cs_reserved(int cs); | 105 | extern int gpmc_cs_reserved(int cs); |
106 | extern void gpmc_init(void); | 106 | extern void __init gpmc_init(void); |
107 | 107 | ||
108 | #endif | 108 | #endif |
diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h index d92bf7964481..0610d7e2b3d7 100644 --- a/arch/arm/plat-omap/include/mach/io.h +++ b/arch/arm/plat-omap/include/mach/io.h | |||
@@ -185,11 +185,13 @@ | |||
185 | #define omap_writew(v,a) __raw_writew(v, IO_ADDRESS(a)) | 185 | #define omap_writew(v,a) __raw_writew(v, IO_ADDRESS(a)) |
186 | #define omap_writel(v,a) __raw_writel(v, IO_ADDRESS(a)) | 186 | #define omap_writel(v,a) __raw_writel(v, IO_ADDRESS(a)) |
187 | 187 | ||
188 | struct omap_sdrc_params; | ||
189 | |||
188 | extern void omap1_map_common_io(void); | 190 | extern void omap1_map_common_io(void); |
189 | extern void omap1_init_common_hw(void); | 191 | extern void omap1_init_common_hw(void); |
190 | 192 | ||
191 | extern void omap2_map_common_io(void); | 193 | extern void omap2_map_common_io(void); |
192 | extern void omap2_init_common_hw(void); | 194 | extern void omap2_init_common_hw(struct omap_sdrc_params *sp); |
193 | 195 | ||
194 | #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) | 196 | #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) |
195 | #define __arch_iounmap(v) omap_iounmap(v) | 197 | #define __arch_iounmap(v) omap_iounmap(v) |
diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/mach/mcbsp.h index 113c2466c86a..bb154ea76769 100644 --- a/arch/arm/plat-omap/include/mach/mcbsp.h +++ b/arch/arm/plat-omap/include/mach/mcbsp.h | |||
@@ -344,8 +344,6 @@ struct omap_mcbsp_platform_data { | |||
344 | u8 dma_rx_sync, dma_tx_sync; | 344 | u8 dma_rx_sync, dma_tx_sync; |
345 | u16 rx_irq, tx_irq; | 345 | u16 rx_irq, tx_irq; |
346 | struct omap_mcbsp_ops *ops; | 346 | struct omap_mcbsp_ops *ops; |
347 | char const **clk_names; | ||
348 | int num_clks; | ||
349 | }; | 347 | }; |
350 | 348 | ||
351 | struct omap_mcbsp { | 349 | struct omap_mcbsp { |
@@ -377,8 +375,8 @@ struct omap_mcbsp { | |||
377 | /* Protect the field .free, while checking if the mcbsp is in use */ | 375 | /* Protect the field .free, while checking if the mcbsp is in use */ |
378 | spinlock_t lock; | 376 | spinlock_t lock; |
379 | struct omap_mcbsp_platform_data *pdata; | 377 | struct omap_mcbsp_platform_data *pdata; |
380 | struct clk **clks; | 378 | struct clk *iclk; |
381 | int num_clks; | 379 | struct clk *fclk; |
382 | }; | 380 | }; |
383 | extern struct omap_mcbsp **mcbsp_ptr; | 381 | extern struct omap_mcbsp **mcbsp_ptr; |
384 | extern int omap_mcbsp_count; | 382 | extern int omap_mcbsp_count; |
diff --git a/arch/arm/plat-omap/include/mach/pm.h b/arch/arm/plat-omap/include/mach/pm.h index 2a9c27ad4c37..ce6ee7927537 100644 --- a/arch/arm/plat-omap/include/mach/pm.h +++ b/arch/arm/plat-omap/include/mach/pm.h | |||
@@ -108,7 +108,7 @@ | |||
108 | !defined(CONFIG_ARCH_OMAP15XX) && \ | 108 | !defined(CONFIG_ARCH_OMAP15XX) && \ |
109 | !defined(CONFIG_ARCH_OMAP16XX) && \ | 109 | !defined(CONFIG_ARCH_OMAP16XX) && \ |
110 | !defined(CONFIG_ARCH_OMAP24XX) | 110 | !defined(CONFIG_ARCH_OMAP24XX) |
111 | #error "Power management for this processor not implemented yet" | 111 | #warning "Power management for this processor not implemented yet" |
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | #ifndef __ASSEMBLER__ | 114 | #ifndef __ASSEMBLER__ |
@@ -118,18 +118,6 @@ | |||
118 | extern void prevent_idle_sleep(void); | 118 | extern void prevent_idle_sleep(void); |
119 | extern void allow_idle_sleep(void); | 119 | extern void allow_idle_sleep(void); |
120 | 120 | ||
121 | /** | ||
122 | * clk_deny_idle - Prevents the clock from being idled during MPU idle | ||
123 | * @clk: clock signal handle | ||
124 | */ | ||
125 | void clk_deny_idle(struct clk *clk); | ||
126 | |||
127 | /** | ||
128 | * clk_allow_idle - Counters previous clk_deny_idle | ||
129 | * @clk: clock signal handle | ||
130 | */ | ||
131 | void clk_allow_idle(struct clk *clk); | ||
132 | |||
133 | extern void omap_pm_idle(void); | 121 | extern void omap_pm_idle(void); |
134 | extern void omap_pm_suspend(void); | 122 | extern void omap_pm_suspend(void); |
135 | extern void omap730_cpu_suspend(unsigned short, unsigned short); | 123 | extern void omap730_cpu_suspend(unsigned short, unsigned short); |
diff --git a/arch/arm/plat-omap/include/mach/powerdomain.h b/arch/arm/plat-omap/include/mach/powerdomain.h index 2806a9c8e4d7..69c9e675d8ee 100644 --- a/arch/arm/plat-omap/include/mach/powerdomain.h +++ b/arch/arm/plat-omap/include/mach/powerdomain.h | |||
@@ -50,9 +50,9 @@ | |||
50 | 50 | ||
51 | /* | 51 | /* |
52 | * Maximum number of clockdomains that can be associated with a powerdomain. | 52 | * Maximum number of clockdomains that can be associated with a powerdomain. |
53 | * CORE powerdomain is probably the worst case. | 53 | * CORE powerdomain on OMAP3 is the worst case |
54 | */ | 54 | */ |
55 | #define PWRDM_MAX_CLKDMS 3 | 55 | #define PWRDM_MAX_CLKDMS 4 |
56 | 56 | ||
57 | /* XXX A completely arbitrary number. What is reasonable here? */ | 57 | /* XXX A completely arbitrary number. What is reasonable here? */ |
58 | #define PWRDM_TRANSITION_BAILOUT 100000 | 58 | #define PWRDM_TRANSITION_BAILOUT 100000 |
@@ -145,6 +145,7 @@ int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm); | |||
145 | 145 | ||
146 | int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst); | 146 | int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst); |
147 | int pwrdm_read_next_pwrst(struct powerdomain *pwrdm); | 147 | int pwrdm_read_next_pwrst(struct powerdomain *pwrdm); |
148 | int pwrdm_read_pwrst(struct powerdomain *pwrdm); | ||
148 | int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm); | 149 | int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm); |
149 | int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm); | 150 | int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm); |
150 | 151 | ||
diff --git a/arch/arm/plat-omap/include/mach/prcm.h b/arch/arm/plat-omap/include/mach/prcm.h index 56eba0fd6f6a..24ac3c715912 100644 --- a/arch/arm/plat-omap/include/mach/prcm.h +++ b/arch/arm/plat-omap/include/mach/prcm.h | |||
@@ -20,10 +20,11 @@ | |||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #ifndef __ASM_ARM_ARCH_DPM_PRCM_H | 23 | #ifndef __ASM_ARM_ARCH_OMAP_PRCM_H |
24 | #define __ASM_ARM_ARCH_DPM_PRCM_H | 24 | #define __ASM_ARM_ARCH_OMAP_PRCM_H |
25 | 25 | ||
26 | u32 omap_prcm_get_reset_sources(void); | 26 | u32 omap_prcm_get_reset_sources(void); |
27 | void omap_prcm_arch_reset(char mode); | ||
27 | 28 | ||
28 | #endif | 29 | #endif |
29 | 30 | ||
diff --git a/arch/arm/plat-omap/include/mach/sdrc.h b/arch/arm/plat-omap/include/mach/sdrc.h index a98c6c3beb2c..adc73522491f 100644 --- a/arch/arm/plat-omap/include/mach/sdrc.h +++ b/arch/arm/plat-omap/include/mach/sdrc.h | |||
@@ -4,10 +4,12 @@ | |||
4 | /* | 4 | /* |
5 | * OMAP2/3 SDRC/SMS register definitions | 5 | * OMAP2/3 SDRC/SMS register definitions |
6 | * | 6 | * |
7 | * Copyright (C) 2007 Texas Instruments, Inc. | 7 | * Copyright (C) 2007-2008 Texas Instruments, Inc. |
8 | * Copyright (C) 2007 Nokia Corporation | 8 | * Copyright (C) 2007-2008 Nokia Corporation |
9 | * | 9 | * |
10 | * Written by Paul Walmsley | 10 | * Tony Lindgren |
11 | * Paul Walmsley | ||
12 | * Richard Woodruff | ||
11 | * | 13 | * |
12 | * This program is free software; you can redistribute it and/or modify | 14 | * This program is free software; you can redistribute it and/or modify |
13 | * it under the terms of the GNU General Public License version 2 as | 15 | * it under the terms of the GNU General Public License version 2 as |
@@ -64,14 +66,62 @@ | |||
64 | * SMS register access | 66 | * SMS register access |
65 | */ | 67 | */ |
66 | 68 | ||
67 | 69 | #define OMAP242X_SMS_REGADDR(reg) \ | |
68 | #define OMAP242X_SMS_REGADDR(reg) IO_ADDRESS(OMAP2420_SMS_BASE + reg) | 70 | (void __iomem *)IO_ADDRESS(OMAP2420_SMS_BASE + reg) |
69 | #define OMAP243X_SMS_REGADDR(reg) IO_ADDRESS(OMAP243X_SMS_BASE + reg) | 71 | #define OMAP243X_SMS_REGADDR(reg) \ |
70 | #define OMAP343X_SMS_REGADDR(reg) IO_ADDRESS(OMAP343X_SMS_BASE + reg) | 72 | (void __iomem *)IO_ADDRESS(OMAP243X_SMS_BASE + reg) |
73 | #define OMAP343X_SMS_REGADDR(reg) \ | ||
74 | (void __iomem *)IO_ADDRESS(OMAP343X_SMS_BASE + reg) | ||
71 | 75 | ||
72 | /* SMS register offsets - read/write with sms_{read,write}_reg() */ | 76 | /* SMS register offsets - read/write with sms_{read,write}_reg() */ |
73 | 77 | ||
74 | #define SMS_SYSCONFIG 0x010 | 78 | #define SMS_SYSCONFIG 0x010 |
75 | /* REVISIT: fill in other SMS registers here */ | 79 | /* REVISIT: fill in other SMS registers here */ |
76 | 80 | ||
81 | |||
82 | #ifndef __ASSEMBLER__ | ||
83 | |||
84 | /** | ||
85 | * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate | ||
86 | * @rate: SDRC clock rate (in Hz) | ||
87 | * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate | ||
88 | * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate | ||
89 | * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate | ||
90 | * @mr: Value to program to SDRC_MR for this rate | ||
91 | * | ||
92 | * This structure holds a pre-computed set of register values for the | ||
93 | * SDRC for a given SDRC clock rate and SDRAM chip. These are | ||
94 | * intended to be pre-computed and specified in an array in the board-*.c | ||
95 | * files. The structure is keyed off the 'rate' field. | ||
96 | */ | ||
97 | struct omap_sdrc_params { | ||
98 | unsigned long rate; | ||
99 | u32 actim_ctrla; | ||
100 | u32 actim_ctrlb; | ||
101 | u32 rfr_ctrl; | ||
102 | u32 mr; | ||
103 | }; | ||
104 | |||
105 | void __init omap2_sdrc_init(struct omap_sdrc_params *sp); | ||
106 | struct omap_sdrc_params *omap2_sdrc_get_params(unsigned long r); | ||
107 | |||
108 | #ifdef CONFIG_ARCH_OMAP2 | ||
109 | |||
110 | struct memory_timings { | ||
111 | u32 m_type; /* ddr = 1, sdr = 0 */ | ||
112 | u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */ | ||
113 | u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */ | ||
114 | u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */ | ||
115 | u32 base_cs; /* base chip select to use for calculations */ | ||
116 | }; | ||
117 | |||
118 | extern void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode); | ||
119 | |||
120 | u32 omap2xxx_sdrc_dll_is_unlocked(void); | ||
121 | u32 omap2xxx_sdrc_reprogram(u32 level, u32 force); | ||
122 | |||
123 | #endif /* CONFIG_ARCH_OMAP2 */ | ||
124 | |||
125 | #endif /* __ASSEMBLER__ */ | ||
126 | |||
77 | #endif | 127 | #endif |
diff --git a/arch/arm/plat-omap/include/mach/system.h b/arch/arm/plat-omap/include/mach/system.h index 06923f261545..cb8c0ef30fba 100644 --- a/arch/arm/plat-omap/include/mach/system.h +++ b/arch/arm/plat-omap/include/mach/system.h | |||
@@ -9,12 +9,12 @@ | |||
9 | #include <asm/mach-types.h> | 9 | #include <asm/mach-types.h> |
10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
11 | 11 | ||
12 | #include <mach/prcm.h> | ||
13 | |||
12 | #ifndef CONFIG_MACH_VOICEBLUE | 14 | #ifndef CONFIG_MACH_VOICEBLUE |
13 | #define voiceblue_reset() do {} while (0) | 15 | #define voiceblue_reset() do {} while (0) |
14 | #endif | 16 | #endif |
15 | 17 | ||
16 | extern void omap_prcm_arch_reset(char mode); | ||
17 | |||
18 | static inline void arch_idle(void) | 18 | static inline void arch_idle(void) |
19 | { | 19 | { |
20 | cpu_do_idle(); | 20 | cpu_do_idle(); |
@@ -38,7 +38,7 @@ static inline void omap1_arch_reset(char mode) | |||
38 | omap_writew(1, ARM_RSTCT1); | 38 | omap_writew(1, ARM_RSTCT1); |
39 | } | 39 | } |
40 | 40 | ||
41 | static inline void arch_reset(char mode) | 41 | static inline void arch_reset(char mode, const char *cmd) |
42 | { | 42 | { |
43 | if (!cpu_class_is_omap2()) | 43 | if (!cpu_class_is_omap2()) |
44 | omap1_arch_reset(mode); | 44 | omap1_arch_reset(mode); |
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index e5842e30e534..28b0a824b8cf 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -214,7 +214,6 @@ EXPORT_SYMBOL(omap_mcbsp_set_io_type); | |||
214 | int omap_mcbsp_request(unsigned int id) | 214 | int omap_mcbsp_request(unsigned int id) |
215 | { | 215 | { |
216 | struct omap_mcbsp *mcbsp; | 216 | struct omap_mcbsp *mcbsp; |
217 | int i; | ||
218 | int err; | 217 | int err; |
219 | 218 | ||
220 | if (!omap_mcbsp_check_valid_id(id)) { | 219 | if (!omap_mcbsp_check_valid_id(id)) { |
@@ -223,23 +222,23 @@ int omap_mcbsp_request(unsigned int id) | |||
223 | } | 222 | } |
224 | mcbsp = id_to_mcbsp_ptr(id); | 223 | mcbsp = id_to_mcbsp_ptr(id); |
225 | 224 | ||
226 | if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request) | ||
227 | mcbsp->pdata->ops->request(id); | ||
228 | |||
229 | for (i = 0; i < mcbsp->num_clks; i++) | ||
230 | clk_enable(mcbsp->clks[i]); | ||
231 | |||
232 | spin_lock(&mcbsp->lock); | 225 | spin_lock(&mcbsp->lock); |
233 | if (!mcbsp->free) { | 226 | if (!mcbsp->free) { |
234 | dev_err(mcbsp->dev, "McBSP%d is currently in use\n", | 227 | dev_err(mcbsp->dev, "McBSP%d is currently in use\n", |
235 | mcbsp->id); | 228 | mcbsp->id); |
236 | spin_unlock(&mcbsp->lock); | 229 | spin_unlock(&mcbsp->lock); |
237 | return -1; | 230 | return -EBUSY; |
238 | } | 231 | } |
239 | 232 | ||
240 | mcbsp->free = 0; | 233 | mcbsp->free = 0; |
241 | spin_unlock(&mcbsp->lock); | 234 | spin_unlock(&mcbsp->lock); |
242 | 235 | ||
236 | if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request) | ||
237 | mcbsp->pdata->ops->request(id); | ||
238 | |||
239 | clk_enable(mcbsp->iclk); | ||
240 | clk_enable(mcbsp->fclk); | ||
241 | |||
243 | /* | 242 | /* |
244 | * Make sure that transmitter, receiver and sample-rate generator are | 243 | * Make sure that transmitter, receiver and sample-rate generator are |
245 | * not running before activating IRQs. | 244 | * not running before activating IRQs. |
@@ -278,7 +277,6 @@ EXPORT_SYMBOL(omap_mcbsp_request); | |||
278 | void omap_mcbsp_free(unsigned int id) | 277 | void omap_mcbsp_free(unsigned int id) |
279 | { | 278 | { |
280 | struct omap_mcbsp *mcbsp; | 279 | struct omap_mcbsp *mcbsp; |
281 | int i; | ||
282 | 280 | ||
283 | if (!omap_mcbsp_check_valid_id(id)) { | 281 | if (!omap_mcbsp_check_valid_id(id)) { |
284 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | 282 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); |
@@ -289,8 +287,14 @@ void omap_mcbsp_free(unsigned int id) | |||
289 | if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free) | 287 | if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free) |
290 | mcbsp->pdata->ops->free(id); | 288 | mcbsp->pdata->ops->free(id); |
291 | 289 | ||
292 | for (i = mcbsp->num_clks - 1; i >= 0; i--) | 290 | clk_disable(mcbsp->fclk); |
293 | clk_disable(mcbsp->clks[i]); | 291 | clk_disable(mcbsp->iclk); |
292 | |||
293 | if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) { | ||
294 | /* Free IRQs */ | ||
295 | free_irq(mcbsp->rx_irq, (void *)mcbsp); | ||
296 | free_irq(mcbsp->tx_irq, (void *)mcbsp); | ||
297 | } | ||
294 | 298 | ||
295 | spin_lock(&mcbsp->lock); | 299 | spin_lock(&mcbsp->lock); |
296 | if (mcbsp->free) { | 300 | if (mcbsp->free) { |
@@ -302,12 +306,6 @@ void omap_mcbsp_free(unsigned int id) | |||
302 | 306 | ||
303 | mcbsp->free = 1; | 307 | mcbsp->free = 1; |
304 | spin_unlock(&mcbsp->lock); | 308 | spin_unlock(&mcbsp->lock); |
305 | |||
306 | if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) { | ||
307 | /* Free IRQs */ | ||
308 | free_irq(mcbsp->rx_irq, (void *)mcbsp); | ||
309 | free_irq(mcbsp->tx_irq, (void *)mcbsp); | ||
310 | } | ||
311 | } | 309 | } |
312 | EXPORT_SYMBOL(omap_mcbsp_free); | 310 | EXPORT_SYMBOL(omap_mcbsp_free); |
313 | 311 | ||
@@ -876,7 +874,6 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev) | |||
876 | struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data; | 874 | struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data; |
877 | struct omap_mcbsp *mcbsp; | 875 | struct omap_mcbsp *mcbsp; |
878 | int id = pdev->id - 1; | 876 | int id = pdev->id - 1; |
879 | int i; | ||
880 | int ret = 0; | 877 | int ret = 0; |
881 | 878 | ||
882 | if (!pdata) { | 879 | if (!pdata) { |
@@ -899,7 +896,6 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev) | |||
899 | ret = -ENOMEM; | 896 | ret = -ENOMEM; |
900 | goto exit; | 897 | goto exit; |
901 | } | 898 | } |
902 | mcbsp_ptr[id] = mcbsp; | ||
903 | 899 | ||
904 | spin_lock_init(&mcbsp->lock); | 900 | spin_lock_init(&mcbsp->lock); |
905 | mcbsp->id = id + 1; | 901 | mcbsp->id = id + 1; |
@@ -921,39 +917,32 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev) | |||
921 | mcbsp->dma_rx_sync = pdata->dma_rx_sync; | 917 | mcbsp->dma_rx_sync = pdata->dma_rx_sync; |
922 | mcbsp->dma_tx_sync = pdata->dma_tx_sync; | 918 | mcbsp->dma_tx_sync = pdata->dma_tx_sync; |
923 | 919 | ||
924 | if (pdata->num_clks) { | 920 | mcbsp->iclk = clk_get(&pdev->dev, "ick"); |
925 | mcbsp->num_clks = pdata->num_clks; | 921 | if (IS_ERR(mcbsp->iclk)) { |
926 | mcbsp->clks = kzalloc(mcbsp->num_clks * sizeof(struct clk *), | 922 | ret = PTR_ERR(mcbsp->iclk); |
927 | GFP_KERNEL); | 923 | dev_err(&pdev->dev, "unable to get ick: %d\n", ret); |
928 | if (!mcbsp->clks) { | 924 | goto err_iclk; |
929 | ret = -ENOMEM; | 925 | } |
930 | goto exit; | ||
931 | } | ||
932 | for (i = 0; i < mcbsp->num_clks; i++) { | ||
933 | mcbsp->clks[i] = clk_get(&pdev->dev, pdata->clk_names[i]); | ||
934 | if (IS_ERR(mcbsp->clks[i])) { | ||
935 | dev_err(&pdev->dev, | ||
936 | "Invalid %s configuration for McBSP%d.\n", | ||
937 | pdata->clk_names[i], mcbsp->id); | ||
938 | ret = PTR_ERR(mcbsp->clks[i]); | ||
939 | goto err_clk; | ||
940 | } | ||
941 | } | ||
942 | 926 | ||
927 | mcbsp->fclk = clk_get(&pdev->dev, "fck"); | ||
928 | if (IS_ERR(mcbsp->fclk)) { | ||
929 | ret = PTR_ERR(mcbsp->fclk); | ||
930 | dev_err(&pdev->dev, "unable to get fck: %d\n", ret); | ||
931 | goto err_fclk; | ||
943 | } | 932 | } |
944 | 933 | ||
945 | mcbsp->pdata = pdata; | 934 | mcbsp->pdata = pdata; |
946 | mcbsp->dev = &pdev->dev; | 935 | mcbsp->dev = &pdev->dev; |
936 | mcbsp_ptr[id] = mcbsp; | ||
947 | platform_set_drvdata(pdev, mcbsp); | 937 | platform_set_drvdata(pdev, mcbsp); |
948 | return 0; | 938 | return 0; |
949 | 939 | ||
950 | err_clk: | 940 | err_fclk: |
951 | while (i--) | 941 | clk_put(mcbsp->iclk); |
952 | clk_put(mcbsp->clks[i]); | 942 | err_iclk: |
953 | kfree(mcbsp->clks); | ||
954 | iounmap(mcbsp->io_base); | 943 | iounmap(mcbsp->io_base); |
955 | err_ioremap: | 944 | err_ioremap: |
956 | mcbsp->free = 0; | 945 | kfree(mcbsp); |
957 | exit: | 946 | exit: |
958 | return ret; | 947 | return ret; |
959 | } | 948 | } |
@@ -961,7 +950,6 @@ exit: | |||
961 | static int __devexit omap_mcbsp_remove(struct platform_device *pdev) | 950 | static int __devexit omap_mcbsp_remove(struct platform_device *pdev) |
962 | { | 951 | { |
963 | struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev); | 952 | struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev); |
964 | int i; | ||
965 | 953 | ||
966 | platform_set_drvdata(pdev, NULL); | 954 | platform_set_drvdata(pdev, NULL); |
967 | if (mcbsp) { | 955 | if (mcbsp) { |
@@ -970,18 +958,15 @@ static int __devexit omap_mcbsp_remove(struct platform_device *pdev) | |||
970 | mcbsp->pdata->ops->free) | 958 | mcbsp->pdata->ops->free) |
971 | mcbsp->pdata->ops->free(mcbsp->id); | 959 | mcbsp->pdata->ops->free(mcbsp->id); |
972 | 960 | ||
973 | for (i = mcbsp->num_clks - 1; i >= 0; i--) { | 961 | clk_disable(mcbsp->fclk); |
974 | clk_disable(mcbsp->clks[i]); | 962 | clk_disable(mcbsp->iclk); |
975 | clk_put(mcbsp->clks[i]); | 963 | clk_put(mcbsp->fclk); |
976 | } | 964 | clk_put(mcbsp->iclk); |
977 | 965 | ||
978 | iounmap(mcbsp->io_base); | 966 | iounmap(mcbsp->io_base); |
979 | 967 | ||
980 | if (mcbsp->num_clks) { | 968 | mcbsp->fclk = NULL; |
981 | kfree(mcbsp->clks); | 969 | mcbsp->iclk = NULL; |
982 | mcbsp->clks = NULL; | ||
983 | mcbsp->num_clks = 0; | ||
984 | } | ||
985 | mcbsp->free = 0; | 970 | mcbsp->free = 0; |
986 | mcbsp->dev = NULL; | 971 | mcbsp->dev = NULL; |
987 | } | 972 | } |
@@ -1002,4 +987,3 @@ int __init omap_mcbsp_init(void) | |||
1002 | /* Register the McBSP driver */ | 987 | /* Register the McBSP driver */ |
1003 | return platform_driver_register(&omap_mcbsp_driver); | 988 | return platform_driver_register(&omap_mcbsp_driver); |
1004 | } | 989 | } |
1005 | |||
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c index 967186425ca1..32eb9e33bebb 100644 --- a/arch/arm/plat-orion/gpio.c +++ b/arch/arm/plat-orion/gpio.c | |||
@@ -19,7 +19,8 @@ | |||
19 | 19 | ||
20 | static DEFINE_SPINLOCK(gpio_lock); | 20 | static DEFINE_SPINLOCK(gpio_lock); |
21 | static const char *gpio_label[GPIO_MAX]; /* non null for allocated GPIOs */ | 21 | static const char *gpio_label[GPIO_MAX]; /* non null for allocated GPIOs */ |
22 | static unsigned long gpio_valid[BITS_TO_LONGS(GPIO_MAX)]; | 22 | static unsigned long gpio_valid_input[BITS_TO_LONGS(GPIO_MAX)]; |
23 | static unsigned long gpio_valid_output[BITS_TO_LONGS(GPIO_MAX)]; | ||
23 | 24 | ||
24 | static inline void __set_direction(unsigned pin, int input) | 25 | static inline void __set_direction(unsigned pin, int input) |
25 | { | 26 | { |
@@ -53,7 +54,7 @@ int gpio_direction_input(unsigned pin) | |||
53 | { | 54 | { |
54 | unsigned long flags; | 55 | unsigned long flags; |
55 | 56 | ||
56 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { | 57 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid_input)) { |
57 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); | 58 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); |
58 | return -EINVAL; | 59 | return -EINVAL; |
59 | } | 60 | } |
@@ -83,7 +84,7 @@ int gpio_direction_output(unsigned pin, int value) | |||
83 | unsigned long flags; | 84 | unsigned long flags; |
84 | u32 u; | 85 | u32 u; |
85 | 86 | ||
86 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { | 87 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid_output)) { |
87 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); | 88 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); |
88 | return -EINVAL; | 89 | return -EINVAL; |
89 | } | 90 | } |
@@ -161,7 +162,9 @@ int gpio_request(unsigned pin, const char *label) | |||
161 | unsigned long flags; | 162 | unsigned long flags; |
162 | int ret; | 163 | int ret; |
163 | 164 | ||
164 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { | 165 | if (pin >= GPIO_MAX || |
166 | !(test_bit(pin, gpio_valid_input) || | ||
167 | test_bit(pin, gpio_valid_output))) { | ||
165 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); | 168 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); |
166 | return -EINVAL; | 169 | return -EINVAL; |
167 | } | 170 | } |
@@ -183,7 +186,9 @@ EXPORT_SYMBOL(gpio_request); | |||
183 | 186 | ||
184 | void gpio_free(unsigned pin) | 187 | void gpio_free(unsigned pin) |
185 | { | 188 | { |
186 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { | 189 | if (pin >= GPIO_MAX || |
190 | !(test_bit(pin, gpio_valid_input) || | ||
191 | test_bit(pin, gpio_valid_output))) { | ||
187 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); | 192 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); |
188 | return; | 193 | return; |
189 | } | 194 | } |
@@ -208,12 +213,18 @@ void __init orion_gpio_set_unused(unsigned pin) | |||
208 | __set_direction(pin, 0); | 213 | __set_direction(pin, 0); |
209 | } | 214 | } |
210 | 215 | ||
211 | void __init orion_gpio_set_valid(unsigned pin, int valid) | 216 | void __init orion_gpio_set_valid(unsigned pin, int mode) |
212 | { | 217 | { |
213 | if (valid) | 218 | if (mode == 1) |
214 | __set_bit(pin, gpio_valid); | 219 | mode = GPIO_INPUT_OK | GPIO_OUTPUT_OK; |
220 | if (mode & GPIO_INPUT_OK) | ||
221 | __set_bit(pin, gpio_valid_input); | ||
215 | else | 222 | else |
216 | __clear_bit(pin, gpio_valid); | 223 | __clear_bit(pin, gpio_valid_input); |
224 | if (mode & GPIO_OUTPUT_OK) | ||
225 | __set_bit(pin, gpio_valid_output); | ||
226 | else | ||
227 | __clear_bit(pin, gpio_valid_output); | ||
217 | } | 228 | } |
218 | 229 | ||
219 | void orion_gpio_set_blink(unsigned pin, int blink) | 230 | void orion_gpio_set_blink(unsigned pin, int blink) |
@@ -265,51 +276,36 @@ EXPORT_SYMBOL(orion_gpio_set_blink); | |||
265 | * polarity LEVEL mask | 276 | * polarity LEVEL mask |
266 | * | 277 | * |
267 | ****************************************************************************/ | 278 | ****************************************************************************/ |
268 | static void gpio_irq_edge_ack(u32 irq) | ||
269 | { | ||
270 | int pin = irq_to_gpio(irq); | ||
271 | 279 | ||
272 | writel(~(1 << (pin & 31)), GPIO_EDGE_CAUSE(pin)); | 280 | static void gpio_irq_ack(u32 irq) |
273 | } | ||
274 | |||
275 | static void gpio_irq_edge_mask(u32 irq) | ||
276 | { | 281 | { |
277 | int pin = irq_to_gpio(irq); | 282 | int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; |
278 | u32 u; | 283 | if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { |
279 | 284 | int pin = irq_to_gpio(irq); | |
280 | u = readl(GPIO_EDGE_MASK(pin)); | 285 | writel(~(1 << (pin & 31)), GPIO_EDGE_CAUSE(pin)); |
281 | u &= ~(1 << (pin & 31)); | 286 | } |
282 | writel(u, GPIO_EDGE_MASK(pin)); | ||
283 | } | ||
284 | |||
285 | static void gpio_irq_edge_unmask(u32 irq) | ||
286 | { | ||
287 | int pin = irq_to_gpio(irq); | ||
288 | u32 u; | ||
289 | |||
290 | u = readl(GPIO_EDGE_MASK(pin)); | ||
291 | u |= 1 << (pin & 31); | ||
292 | writel(u, GPIO_EDGE_MASK(pin)); | ||
293 | } | 287 | } |
294 | 288 | ||
295 | static void gpio_irq_level_mask(u32 irq) | 289 | static void gpio_irq_mask(u32 irq) |
296 | { | 290 | { |
297 | int pin = irq_to_gpio(irq); | 291 | int pin = irq_to_gpio(irq); |
298 | u32 u; | 292 | int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; |
299 | 293 | u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? | |
300 | u = readl(GPIO_LEVEL_MASK(pin)); | 294 | GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); |
295 | u32 u = readl(reg); | ||
301 | u &= ~(1 << (pin & 31)); | 296 | u &= ~(1 << (pin & 31)); |
302 | writel(u, GPIO_LEVEL_MASK(pin)); | 297 | writel(u, reg); |
303 | } | 298 | } |
304 | 299 | ||
305 | static void gpio_irq_level_unmask(u32 irq) | 300 | static void gpio_irq_unmask(u32 irq) |
306 | { | 301 | { |
307 | int pin = irq_to_gpio(irq); | 302 | int pin = irq_to_gpio(irq); |
308 | u32 u; | 303 | int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; |
309 | 304 | u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? | |
310 | u = readl(GPIO_LEVEL_MASK(pin)); | 305 | GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); |
306 | u32 u = readl(reg); | ||
311 | u |= 1 << (pin & 31); | 307 | u |= 1 << (pin & 31); |
312 | writel(u, GPIO_LEVEL_MASK(pin)); | 308 | writel(u, reg); |
313 | } | 309 | } |
314 | 310 | ||
315 | static int gpio_irq_set_type(u32 irq, u32 type) | 311 | static int gpio_irq_set_type(u32 irq, u32 type) |
@@ -331,9 +327,9 @@ static int gpio_irq_set_type(u32 irq, u32 type) | |||
331 | * Set edge/level type. | 327 | * Set edge/level type. |
332 | */ | 328 | */ |
333 | if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { | 329 | if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { |
334 | desc->chip = &orion_gpio_irq_edge_chip; | 330 | desc->handle_irq = handle_edge_irq; |
335 | } else if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { | 331 | } else if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { |
336 | desc->chip = &orion_gpio_irq_level_chip; | 332 | desc->handle_irq = handle_level_irq; |
337 | } else { | 333 | } else { |
338 | printk(KERN_ERR "failed to set irq=%d (type=%d)\n", irq, type); | 334 | printk(KERN_ERR "failed to set irq=%d (type=%d)\n", irq, type); |
339 | return -EINVAL; | 335 | return -EINVAL; |
@@ -371,19 +367,11 @@ static int gpio_irq_set_type(u32 irq, u32 type) | |||
371 | return 0; | 367 | return 0; |
372 | } | 368 | } |
373 | 369 | ||
374 | struct irq_chip orion_gpio_irq_edge_chip = { | 370 | struct irq_chip orion_gpio_irq_chip = { |
375 | .name = "orion_gpio_irq_edge", | 371 | .name = "orion_gpio", |
376 | .ack = gpio_irq_edge_ack, | 372 | .ack = gpio_irq_ack, |
377 | .mask = gpio_irq_edge_mask, | 373 | .mask = gpio_irq_mask, |
378 | .unmask = gpio_irq_edge_unmask, | 374 | .unmask = gpio_irq_unmask, |
379 | .set_type = gpio_irq_set_type, | ||
380 | }; | ||
381 | |||
382 | struct irq_chip orion_gpio_irq_level_chip = { | ||
383 | .name = "orion_gpio_irq_level", | ||
384 | .mask = gpio_irq_level_mask, | ||
385 | .mask_ack = gpio_irq_level_mask, | ||
386 | .unmask = gpio_irq_level_unmask, | ||
387 | .set_type = gpio_irq_set_type, | 375 | .set_type = gpio_irq_set_type, |
388 | }; | 376 | }; |
389 | 377 | ||
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h index 54deaf274b52..33f6c6aec185 100644 --- a/arch/arm/plat-orion/include/plat/gpio.h +++ b/arch/arm/plat-orion/include/plat/gpio.h | |||
@@ -25,14 +25,17 @@ void gpio_set_value(unsigned pin, int value); | |||
25 | * Orion-specific GPIO API extensions. | 25 | * Orion-specific GPIO API extensions. |
26 | */ | 26 | */ |
27 | void orion_gpio_set_unused(unsigned pin); | 27 | void orion_gpio_set_unused(unsigned pin); |
28 | void orion_gpio_set_valid(unsigned pin, int valid); | ||
29 | void orion_gpio_set_blink(unsigned pin, int blink); | 28 | void orion_gpio_set_blink(unsigned pin, int blink); |
30 | 29 | ||
30 | #define GPIO_BIDI_OK (1 << 0) | ||
31 | #define GPIO_INPUT_OK (1 << 1) | ||
32 | #define GPIO_OUTPUT_OK (1 << 2) | ||
33 | void orion_gpio_set_valid(unsigned pin, int mode); | ||
34 | |||
31 | /* | 35 | /* |
32 | * GPIO interrupt handling. | 36 | * GPIO interrupt handling. |
33 | */ | 37 | */ |
34 | extern struct irq_chip orion_gpio_irq_edge_chip; | 38 | extern struct irq_chip orion_gpio_irq_chip; |
35 | extern struct irq_chip orion_gpio_irq_level_chip; | ||
36 | void orion_gpio_irq_handler(int irqoff); | 39 | void orion_gpio_irq_handler(int irqoff); |
37 | 40 | ||
38 | 41 | ||
diff --git a/arch/arm/plat-orion/include/plat/mvsdio.h b/arch/arm/plat-orion/include/plat/mvsdio.h new file mode 100644 index 000000000000..14ca88676002 --- /dev/null +++ b/arch/arm/plat-orion/include/plat/mvsdio.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-orion/include/plat/mvsdio.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 __MACH_MVSDIO_H | ||
10 | #define __MACH_MVSDIO_H | ||
11 | |||
12 | #include <linux/mbus.h> | ||
13 | |||
14 | struct mvsdio_platform_data { | ||
15 | struct mbus_dram_target_info *dram; | ||
16 | unsigned int clock; | ||
17 | int gpio_card_detect; | ||
18 | int gpio_write_protect; | ||
19 | }; | ||
20 | |||
21 | #endif | ||
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c index 542062f8cbc1..1932b7e0da15 100644 --- a/arch/arm/plat-s3c24xx/cpu.c +++ b/arch/arm/plat-s3c24xx/cpu.c | |||
@@ -182,7 +182,7 @@ static unsigned long s3c24xx_read_idcode_v4(void) | |||
182 | * with the caches enabled. It seems at least the S3C2440 has a problem | 182 | * with the caches enabled. It seems at least the S3C2440 has a problem |
183 | * resetting if there is bus activity interrupted by the reset. | 183 | * resetting if there is bus activity interrupted by the reset. |
184 | */ | 184 | */ |
185 | static void s3c24xx_pm_restart(char mode) | 185 | static void s3c24xx_pm_restart(char mode, const char *cmd) |
186 | { | 186 | { |
187 | if (mode != 's') { | 187 | if (mode != 's') { |
188 | unsigned long flags; | 188 | unsigned long flags; |
@@ -191,12 +191,12 @@ static void s3c24xx_pm_restart(char mode) | |||
191 | __cpuc_flush_kern_all(); | 191 | __cpuc_flush_kern_all(); |
192 | __cpuc_flush_user_all(); | 192 | __cpuc_flush_user_all(); |
193 | 193 | ||
194 | arch_reset(mode); | 194 | arch_reset(mode, cmd); |
195 | local_irq_restore(flags); | 195 | local_irq_restore(flags); |
196 | } | 196 | } |
197 | 197 | ||
198 | /* fallback, or unhandled */ | 198 | /* fallback, or unhandled */ |
199 | arm_machine_restart(mode); | 199 | arm_machine_restart(mode, cmd); |
200 | } | 200 | } |
201 | 201 | ||
202 | void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) | 202 | void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) |
diff --git a/arch/arm/plat-s3c64xx/clock.c b/arch/arm/plat-s3c64xx/clock.c index 136c982c68e1..ad1b9682c9c3 100644 --- a/arch/arm/plat-s3c64xx/clock.c +++ b/arch/arm/plat-s3c64xx/clock.c | |||
@@ -248,7 +248,7 @@ static struct clk *clks[] __initdata = { | |||
248 | &clk_48m, | 248 | &clk_48m, |
249 | }; | 249 | }; |
250 | 250 | ||
251 | void s3c64xx_register_clocks(void) | 251 | void __init s3c64xx_register_clocks(void) |
252 | { | 252 | { |
253 | struct clk *clkp; | 253 | struct clk *clkp; |
254 | int ret; | 254 | int ret; |
diff --git a/arch/arm/plat-s3c64xx/gpiolib.c b/arch/arm/plat-s3c64xx/gpiolib.c index cc62941d7b5c..ee9188add8fb 100644 --- a/arch/arm/plat-s3c64xx/gpiolib.c +++ b/arch/arm/plat-s3c64xx/gpiolib.c | |||
@@ -417,4 +417,4 @@ static __init int s3c64xx_gpiolib_init(void) | |||
417 | return 0; | 417 | return 0; |
418 | } | 418 | } |
419 | 419 | ||
420 | arch_initcall(s3c64xx_gpiolib_init); | 420 | core_initcall(s3c64xx_gpiolib_init); |
diff --git a/arch/arm/plat-s3c64xx/include/plat/irqs.h b/arch/arm/plat-s3c64xx/include/plat/irqs.h index 2846f550b727..f865bf4d709e 100644 --- a/arch/arm/plat-s3c64xx/include/plat/irqs.h +++ b/arch/arm/plat-s3c64xx/include/plat/irqs.h | |||
@@ -117,7 +117,7 @@ | |||
117 | #define IRQ_ONENAND1 S3C64XX_IRQ_VIC1(12) | 117 | #define IRQ_ONENAND1 S3C64XX_IRQ_VIC1(12) |
118 | #define IRQ_NFC S3C64XX_IRQ_VIC1(13) | 118 | #define IRQ_NFC S3C64XX_IRQ_VIC1(13) |
119 | #define IRQ_CFCON S3C64XX_IRQ_VIC1(14) | 119 | #define IRQ_CFCON S3C64XX_IRQ_VIC1(14) |
120 | #define IRQ_UHOST S3C64XX_IRQ_VIC1(15) | 120 | #define IRQ_USBH S3C64XX_IRQ_VIC1(15) |
121 | #define IRQ_SPI0 S3C64XX_IRQ_VIC1(16) | 121 | #define IRQ_SPI0 S3C64XX_IRQ_VIC1(16) |
122 | #define IRQ_SPI1 S3C64XX_IRQ_VIC1(17) | 122 | #define IRQ_SPI1 S3C64XX_IRQ_VIC1(17) |
123 | #define IRQ_IIC S3C64XX_IRQ_VIC1(18) | 123 | #define IRQ_IIC S3C64XX_IRQ_VIC1(18) |
diff --git a/arch/arm/plat-s3c64xx/irq-eint.c b/arch/arm/plat-s3c64xx/irq-eint.c index 1f7cc0067f5c..cf524826c93a 100644 --- a/arch/arm/plat-s3c64xx/irq-eint.c +++ b/arch/arm/plat-s3c64xx/irq-eint.c | |||
@@ -14,12 +14,15 @@ | |||
14 | 14 | ||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/gpio.h> | ||
17 | #include <linux/irq.h> | 18 | #include <linux/irq.h> |
18 | #include <linux/io.h> | 19 | #include <linux/io.h> |
19 | 20 | ||
20 | #include <asm/hardware/vic.h> | 21 | #include <asm/hardware/vic.h> |
21 | 22 | ||
22 | #include <plat/regs-irqtype.h> | 23 | #include <plat/regs-irqtype.h> |
24 | #include <plat/regs-gpio.h> | ||
25 | #include <plat/gpio-cfg.h> | ||
23 | 26 | ||
24 | #include <mach/map.h> | 27 | #include <mach/map.h> |
25 | #include <plat/cpu.h> | 28 | #include <plat/cpu.h> |
@@ -55,7 +58,7 @@ static void s3c_irq_eint_unmask(unsigned int irq) | |||
55 | u32 mask; | 58 | u32 mask; |
56 | 59 | ||
57 | mask = __raw_readl(S3C64XX_EINT0MASK); | 60 | mask = __raw_readl(S3C64XX_EINT0MASK); |
58 | mask |= eint_irq_to_bit(irq); | 61 | mask &= ~eint_irq_to_bit(irq); |
59 | __raw_writel(mask, S3C64XX_EINT0MASK); | 62 | __raw_writel(mask, S3C64XX_EINT0MASK); |
60 | } | 63 | } |
61 | 64 | ||
@@ -74,6 +77,7 @@ static void s3c_irq_eint_maskack(unsigned int irq) | |||
74 | static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) | 77 | static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) |
75 | { | 78 | { |
76 | int offs = eint_offset(irq); | 79 | int offs = eint_offset(irq); |
80 | int pin; | ||
77 | int shift; | 81 | int shift; |
78 | u32 ctrl, mask; | 82 | u32 ctrl, mask; |
79 | u32 newvalue = 0; | 83 | u32 newvalue = 0; |
@@ -125,6 +129,15 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) | |||
125 | ctrl |= newvalue << shift; | 129 | ctrl |= newvalue << shift; |
126 | __raw_writel(ctrl, reg); | 130 | __raw_writel(ctrl, reg); |
127 | 131 | ||
132 | /* set the GPIO pin appropriately */ | ||
133 | |||
134 | if (offs < 23) | ||
135 | pin = S3C64XX_GPN(offs); | ||
136 | else | ||
137 | pin = S3C64XX_GPM(offs - 23); | ||
138 | |||
139 | s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(2)); | ||
140 | |||
128 | return 0; | 141 | return 0; |
129 | } | 142 | } |
130 | 143 | ||
@@ -181,7 +194,7 @@ static void s3c_irq_demux_eint20_27(unsigned int irq, struct irq_desc *desc) | |||
181 | s3c_irq_demux_eint(20, 27); | 194 | s3c_irq_demux_eint(20, 27); |
182 | } | 195 | } |
183 | 196 | ||
184 | int __init s3c64xx_init_irq_eint(void) | 197 | static int __init s3c64xx_init_irq_eint(void) |
185 | { | 198 | { |
186 | int irq; | 199 | int irq; |
187 | 200 | ||
diff --git a/arch/arm/plat-s3c64xx/irq.c b/arch/arm/plat-s3c64xx/irq.c index a94f1d5e819d..f22edf7c2d2d 100644 --- a/arch/arm/plat-s3c64xx/irq.c +++ b/arch/arm/plat-s3c64xx/irq.c | |||
@@ -207,7 +207,7 @@ static struct irq_chip s3c_irq_uart = { | |||
207 | 207 | ||
208 | static void __init s3c64xx_uart_irq(struct uart_irq *uirq) | 208 | static void __init s3c64xx_uart_irq(struct uart_irq *uirq) |
209 | { | 209 | { |
210 | void *reg_base = uirq->regs; | 210 | void __iomem *reg_base = uirq->regs; |
211 | unsigned int irq; | 211 | unsigned int irq; |
212 | int offs; | 212 | int offs; |
213 | 213 | ||
diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c index 8d9a0cada668..05b17528041e 100644 --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c | |||
@@ -36,7 +36,7 @@ | |||
36 | * ext_xtal_mux for want of an actual name from the manual. | 36 | * ext_xtal_mux for want of an actual name from the manual. |
37 | */ | 37 | */ |
38 | 38 | ||
39 | struct clk clk_ext_xtal_mux = { | 39 | static struct clk clk_ext_xtal_mux = { |
40 | .name = "ext_xtal", | 40 | .name = "ext_xtal", |
41 | .id = -1, | 41 | .id = -1, |
42 | }; | 42 | }; |
@@ -63,7 +63,7 @@ struct clksrc_clk { | |||
63 | void __iomem *reg_divider; | 63 | void __iomem *reg_divider; |
64 | }; | 64 | }; |
65 | 65 | ||
66 | struct clk clk_fout_apll = { | 66 | static struct clk clk_fout_apll = { |
67 | .name = "fout_apll", | 67 | .name = "fout_apll", |
68 | .id = -1, | 68 | .id = -1, |
69 | }; | 69 | }; |
@@ -78,7 +78,7 @@ static struct clk_sources clk_src_apll = { | |||
78 | .nr_sources = ARRAY_SIZE(clk_src_apll_list), | 78 | .nr_sources = ARRAY_SIZE(clk_src_apll_list), |
79 | }; | 79 | }; |
80 | 80 | ||
81 | struct clksrc_clk clk_mout_apll = { | 81 | static struct clksrc_clk clk_mout_apll = { |
82 | .clk = { | 82 | .clk = { |
83 | .name = "mout_apll", | 83 | .name = "mout_apll", |
84 | .id = -1, | 84 | .id = -1, |
@@ -88,7 +88,7 @@ struct clksrc_clk clk_mout_apll = { | |||
88 | .sources = &clk_src_apll, | 88 | .sources = &clk_src_apll, |
89 | }; | 89 | }; |
90 | 90 | ||
91 | struct clk clk_fout_epll = { | 91 | static struct clk clk_fout_epll = { |
92 | .name = "fout_epll", | 92 | .name = "fout_epll", |
93 | .id = -1, | 93 | .id = -1, |
94 | }; | 94 | }; |
@@ -103,7 +103,7 @@ static struct clk_sources clk_src_epll = { | |||
103 | .nr_sources = ARRAY_SIZE(clk_src_epll_list), | 103 | .nr_sources = ARRAY_SIZE(clk_src_epll_list), |
104 | }; | 104 | }; |
105 | 105 | ||
106 | struct clksrc_clk clk_mout_epll = { | 106 | static struct clksrc_clk clk_mout_epll = { |
107 | .clk = { | 107 | .clk = { |
108 | .name = "mout_epll", | 108 | .name = "mout_epll", |
109 | .id = -1, | 109 | .id = -1, |
@@ -123,7 +123,7 @@ static struct clk_sources clk_src_mpll = { | |||
123 | .nr_sources = ARRAY_SIZE(clk_src_mpll_list), | 123 | .nr_sources = ARRAY_SIZE(clk_src_mpll_list), |
124 | }; | 124 | }; |
125 | 125 | ||
126 | struct clksrc_clk clk_mout_mpll = { | 126 | static struct clksrc_clk clk_mout_mpll = { |
127 | .clk = { | 127 | .clk = { |
128 | .name = "mout_mpll", | 128 | .name = "mout_mpll", |
129 | .id = -1, | 129 | .id = -1, |
@@ -145,7 +145,7 @@ static unsigned long s3c64xx_clk_doutmpll_get_rate(struct clk *clk) | |||
145 | return rate; | 145 | return rate; |
146 | } | 146 | } |
147 | 147 | ||
148 | struct clk clk_dout_mpll = { | 148 | static struct clk clk_dout_mpll = { |
149 | .name = "dout_mpll", | 149 | .name = "dout_mpll", |
150 | .id = -1, | 150 | .id = -1, |
151 | .parent = &clk_mout_mpll.clk, | 151 | .parent = &clk_mout_mpll.clk, |
@@ -189,10 +189,10 @@ static struct clk_sources clkset_uart = { | |||
189 | }; | 189 | }; |
190 | 190 | ||
191 | static struct clk *clkset_uhost_list[] = { | 191 | static struct clk *clkset_uhost_list[] = { |
192 | &clk_48m, | ||
192 | &clk_mout_epll.clk, | 193 | &clk_mout_epll.clk, |
193 | &clk_dout_mpll, | 194 | &clk_dout_mpll, |
194 | &clk_fin_epll, | 195 | &clk_fin_epll, |
195 | &clk_48m, | ||
196 | }; | 196 | }; |
197 | 197 | ||
198 | static struct clk_sources clkset_uhost = { | 198 | static struct clk_sources clkset_uhost = { |
@@ -239,10 +239,12 @@ static int s3c64xx_setrate_clksrc(struct clk *clk, unsigned long rate) | |||
239 | 239 | ||
240 | rate = clk_round_rate(clk, rate); | 240 | rate = clk_round_rate(clk, rate); |
241 | div = clk_get_rate(clk->parent) / rate; | 241 | div = clk_get_rate(clk->parent) / rate; |
242 | if (div > 16) | ||
243 | return -EINVAL; | ||
242 | 244 | ||
243 | val = __raw_readl(reg); | 245 | val = __raw_readl(reg); |
244 | val &= ~sclk->mask; | 246 | val &= ~(0xf << sclk->shift); |
245 | val |= (rate - 1) << sclk->shift; | 247 | val |= (div - 1) << sclk->shift; |
246 | __raw_writel(val, reg); | 248 | __raw_writel(val, reg); |
247 | 249 | ||
248 | return 0; | 250 | return 0; |
@@ -351,7 +353,7 @@ static struct clksrc_clk clk_mmc2 = { | |||
351 | 353 | ||
352 | static struct clksrc_clk clk_usbhost = { | 354 | static struct clksrc_clk clk_usbhost = { |
353 | .clk = { | 355 | .clk = { |
354 | .name = "usb-host-bus", | 356 | .name = "usb-bus-host", |
355 | .id = -1, | 357 | .id = -1, |
356 | .ctrlbit = S3C_CLKCON_SCLK_UHOST, | 358 | .ctrlbit = S3C_CLKCON_SCLK_UHOST, |
357 | .enable = s3c64xx_sclk_ctrl, | 359 | .enable = s3c64xx_sclk_ctrl, |
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index fd23c0e9e698..b4211d8b2ac7 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types | |||
@@ -12,7 +12,7 @@ | |||
12 | # | 12 | # |
13 | # http://www.arm.linux.org.uk/developer/machines/?action=new | 13 | # http://www.arm.linux.org.uk/developer/machines/?action=new |
14 | # | 14 | # |
15 | # Last update: Sun Nov 30 16:39:36 2008 | 15 | # Last update: Thu Mar 12 18:01:45 2009 |
16 | # | 16 | # |
17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number | 17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number |
18 | # | 18 | # |
@@ -1811,7 +1811,7 @@ pilz_pmi5 MACH_PILZ_PMI5 PILZ_PMI5 1820 | |||
1811 | jade MACH_JADE JADE 1821 | 1811 | jade MACH_JADE JADE 1821 |
1812 | ks8695_softplc MACH_KS8695_SOFTPLC KS8695_SOFTPLC 1822 | 1812 | ks8695_softplc MACH_KS8695_SOFTPLC KS8695_SOFTPLC 1822 |
1813 | gprisc3 MACH_GPRISC3 GPRISC3 1823 | 1813 | gprisc3 MACH_GPRISC3 GPRISC3 1823 |
1814 | stamp9260 MACH_STAMP9260 STAMP9260 1824 | 1814 | stamp9g20 MACH_STAMP9G20 STAMP9G20 1824 |
1815 | smdk6430 MACH_SMDK6430 SMDK6430 1825 | 1815 | smdk6430 MACH_SMDK6430 SMDK6430 1825 |
1816 | smdkc100 MACH_SMDKC100 SMDKC100 1826 | 1816 | smdkc100 MACH_SMDKC100 SMDKC100 1826 |
1817 | tavorevb MACH_TAVOREVB TAVOREVB 1827 | 1817 | tavorevb MACH_TAVOREVB TAVOREVB 1827 |
@@ -1993,4 +1993,134 @@ spark MACH_SPARK SPARK 2002 | |||
1993 | benzina MACH_BENZINA BENZINA 2003 | 1993 | benzina MACH_BENZINA BENZINA 2003 |
1994 | blaze MACH_BLAZE BLAZE 2004 | 1994 | blaze MACH_BLAZE BLAZE 2004 |
1995 | linkstation_ls_hgl MACH_LINKSTATION_LS_HGL LINKSTATION_LS_HGL 2005 | 1995 | linkstation_ls_hgl MACH_LINKSTATION_LS_HGL LINKSTATION_LS_HGL 2005 |
1996 | htcvenus MACH_HTCVENUS HTCVENUS 2006 | 1996 | htckovsky MACH_HTCVENUS HTCVENUS 2006 |
1997 | sony_prs505 MACH_SONY_PRS505 SONY_PRS505 2007 | ||
1998 | hanlin_v3 MACH_HANLIN_V3 HANLIN_V3 2008 | ||
1999 | sapphira MACH_SAPPHIRA SAPPHIRA 2009 | ||
2000 | dack_sda_01 MACH_DACK_SDA_01 DACK_SDA_01 2010 | ||
2001 | armbox MACH_ARMBOX ARMBOX 2011 | ||
2002 | harris_rvp MACH_HARRIS_RVP HARRIS_RVP 2012 | ||
2003 | ribaldo MACH_RIBALDO RIBALDO 2013 | ||
2004 | agora MACH_AGORA AGORA 2014 | ||
2005 | omap3_mini MACH_OMAP3_MINI OMAP3_MINI 2015 | ||
2006 | a9sam6432_b MACH_A9SAM6432_B A9SAM6432_B 2016 | ||
2007 | usg2410 MACH_USG2410 USG2410 2017 | ||
2008 | pc72052_i10_revb MACH_PC72052_I10_REVB PC72052_I10_REVB 2018 | ||
2009 | mx35_exm32 MACH_MX35_EXM32 MX35_EXM32 2019 | ||
2010 | topas910 MACH_TOPAS910 TOPAS910 2020 | ||
2011 | hyena MACH_HYENA HYENA 2021 | ||
2012 | pospax MACH_POSPAX POSPAX 2022 | ||
2013 | hdl_gx MACH_HDL_GX HDL_GX 2023 | ||
2014 | ctera_4bay MACH_CTERA_4BAY CTERA_4BAY 2024 | ||
2015 | ctera_plug_c MACH_CTERA_PLUG_C CTERA_PLUG_C 2025 | ||
2016 | crwea_plug_i MACH_CRWEA_PLUG_I CRWEA_PLUG_I 2026 | ||
2017 | egauge2 MACH_EGAUGE2 EGAUGE2 2027 | ||
2018 | didj MACH_DIDJ DIDJ 2028 | ||
2019 | m_s3c2443 MACH_MEISTER MEISTER 2029 | ||
2020 | htcblackstone MACH_HTCBLACKSTONE HTCBLACKSTONE 2030 | ||
2021 | cpuat9g20 MACH_CPUAT9G20 CPUAT9G20 2031 | ||
2022 | smdk6440 MACH_SMDK6440 SMDK6440 2032 | ||
2023 | omap_35xx_mvp MACH_OMAP_35XX_MVP OMAP_35XX_MVP 2033 | ||
2024 | ctera_plug_i MACH_CTERA_PLUG_I CTERA_PLUG_I 2034 | ||
2025 | pvg610_100 MACH_PVG610 PVG610 2035 | ||
2026 | hprw6815 MACH_HPRW6815 HPRW6815 2036 | ||
2027 | omap3_oswald MACH_OMAP3_OSWALD OMAP3_OSWALD 2037 | ||
2028 | nas4220b MACH_NAS4220B NAS4220B 2038 | ||
2029 | htcraphael_cdma MACH_HTCRAPHAEL_CDMA HTCRAPHAEL_CDMA 2039 | ||
2030 | htcdiamond_cdma MACH_HTCDIAMOND_CDMA HTCDIAMOND_CDMA 2040 | ||
2031 | scaler MACH_SCALER SCALER 2041 | ||
2032 | zylonite2 MACH_ZYLONITE2 ZYLONITE2 2042 | ||
2033 | aspenite MACH_ASPENITE ASPENITE 2043 | ||
2034 | teton MACH_TETON TETON 2044 | ||
2035 | ttc_dkb MACH_TTC_DKB TTC_DKB 2045 | ||
2036 | bishop2 MACH_BISHOP2 BISHOP2 2046 | ||
2037 | ippv5 MACH_IPPV5 IPPV5 2047 | ||
2038 | farm926 MACH_FARM926 FARM926 2048 | ||
2039 | mmccpu MACH_MMCCPU MMCCPU 2049 | ||
2040 | sgmsfl MACH_SGMSFL SGMSFL 2050 | ||
2041 | tt8000 MACH_TT8000 TT8000 2051 | ||
2042 | zrn4300lp MACH_ZRN4300LP ZRN4300LP 2052 | ||
2043 | mptc MACH_MPTC MPTC 2053 | ||
2044 | h6051 MACH_H6051 H6051 2054 | ||
2045 | pvg610_101 MACH_PVG610_101 PVG610_101 2055 | ||
2046 | stamp9261_pc_evb MACH_STAMP9261_PC_EVB STAMP9261_PC_EVB 2056 | ||
2047 | pelco_odysseus MACH_PELCO_ODYSSEUS PELCO_ODYSSEUS 2057 | ||
2048 | tny_a9260 MACH_TNY_A9260 TNY_A9260 2058 | ||
2049 | tny_a9g20 MACH_TNY_A9G20 TNY_A9G20 2059 | ||
2050 | aesop_mp2530f MACH_AESOP_MP2530F AESOP_MP2530F 2060 | ||
2051 | dx900 MACH_DX900 DX900 2061 | ||
2052 | cpodc2 MACH_CPODC2 CPODC2 2062 | ||
2053 | tilt_8925 MACH_TILT_8925 TILT_8925 2063 | ||
2054 | davinci_dm357_evm MACH_DAVINCI_DM357_EVM DAVINCI_DM357_EVM 2064 | ||
2055 | swordfish MACH_SWORDFISH SWORDFISH 2065 | ||
2056 | corvus MACH_CORVUS CORVUS 2066 | ||
2057 | taurus MACH_TAURUS TAURUS 2067 | ||
2058 | axm MACH_AXM AXM 2068 | ||
2059 | axc MACH_AXC AXC 2069 | ||
2060 | baby MACH_BABY BABY 2070 | ||
2061 | mp200 MACH_MP200 MP200 2071 | ||
2062 | pcm043 MACH_PCM043 PCM043 2072 | ||
2063 | hanlin_v3c MACH_HANLIN_V3C HANLIN_V3C 2073 | ||
2064 | kbk9g20 MACH_KBK9G20 KBK9G20 2074 | ||
2065 | adsturbog5 MACH_ADSTURBOG5 ADSTURBOG5 2075 | ||
2066 | avenger_lite1 MACH_AVENGER_LITE1 AVENGER_LITE1 2076 | ||
2067 | suc82x MACH_SUC SUC 2077 | ||
2068 | at91sam7s256 MACH_AT91SAM7S256 AT91SAM7S256 2078 | ||
2069 | mendoza MACH_MENDOZA MENDOZA 2079 | ||
2070 | kira MACH_KIRA KIRA 2080 | ||
2071 | mx1hbm MACH_MX1HBM MX1HBM 2081 | ||
2072 | quatro43xx MACH_QUATRO43XX QUATRO43XX 2082 | ||
2073 | quatro4230 MACH_QUATRO4230 QUATRO4230 2083 | ||
2074 | nsb400 MACH_NSB400 NSB400 2084 | ||
2075 | drp255 MACH_DRP255 DRP255 2085 | ||
2076 | thoth MACH_THOTH THOTH 2086 | ||
2077 | firestone MACH_FIRESTONE FIRESTONE 2087 | ||
2078 | asusp750 MACH_ASUSP750 ASUSP750 2088 | ||
2079 | ctera_dl MACH_CTERA_DL CTERA_DL 2089 | ||
2080 | socr MACH_SOCR SOCR 2090 | ||
2081 | htcoxygen MACH_HTCOXYGEN HTCOXYGEN 2091 | ||
2082 | heroc MACH_HEROC HEROC 2092 | ||
2083 | zeno6800 MACH_ZENO6800 ZENO6800 2093 | ||
2084 | sc2mcs MACH_SC2MCS SC2MCS 2094 | ||
2085 | gene100 MACH_GENE100 GENE100 2095 | ||
2086 | as353x MACH_AS353X AS353X 2096 | ||
2087 | sheevaplug MACH_SHEEVAPLUG SHEEVAPLUG 2097 | ||
2088 | at91sam9g20 MACH_AT91SAM9G20 AT91SAM9G20 2098 | ||
2089 | mv88f6192gtw_fe MACH_MV88F6192GTW_FE MV88F6192GTW_FE 2099 | ||
2090 | cc9200 MACH_CC9200 CC9200 2100 | ||
2091 | sm9200 MACH_SM9200 SM9200 2101 | ||
2092 | tp9200 MACH_TP9200 TP9200 2102 | ||
2093 | snapperdv MACH_SNAPPERDV SNAPPERDV 2103 | ||
2094 | avengers_lite MACH_AVENGERS_LITE AVENGERS_LITE 2104 | ||
2095 | avengers_lite1 MACH_AVENGERS_LITE1 AVENGERS_LITE1 2105 | ||
2096 | omap3axon MACH_OMAP3AXON OMAP3AXON 2106 | ||
2097 | ma8xx MACH_MA8XX MA8XX 2107 | ||
2098 | mp201ek MACH_MP201EK MP201EK 2108 | ||
2099 | davinci_tux MACH_DAVINCI_TUX DAVINCI_TUX 2109 | ||
2100 | mpa1600 MACH_MPA1600 MPA1600 2110 | ||
2101 | pelco_troy MACH_PELCO_TROY PELCO_TROY 2111 | ||
2102 | nsb667 MACH_NSB667 NSB667 2112 | ||
2103 | rovers5_4mpix MACH_ROVERS5_4MPIX ROVERS5_4MPIX 2113 | ||
2104 | twocom MACH_TWOCOM TWOCOM 2114 | ||
2105 | ubisys_p9_rcu3r2 MACH_UBISYS_P9_RCU3R2 UBISYS_P9_RCU3R2 2115 | ||
2106 | hero_espresso MACH_HERO_ESPRESSO HERO_ESPRESSO 2116 | ||
2107 | afeusb MACH_AFEUSB AFEUSB 2117 | ||
2108 | t830 MACH_T830 T830 2118 | ||
2109 | spd8020_cc MACH_SPD8020_CC SPD8020_CC 2119 | ||
2110 | om_3d7k MACH_OM_3D7K OM_3D7K 2120 | ||
2111 | picocom2 MACH_PICOCOM2 PICOCOM2 2121 | ||
2112 | uwg4mx27 MACH_UWG4MX27 UWG4MX27 2122 | ||
2113 | uwg4mx31 MACH_UWG4MX31 UWG4MX31 2123 | ||
2114 | cherry MACH_CHERRY CHERRY 2124 | ||
2115 | mx51_babbage MACH_MX51_BABBAGE MX51_BABBAGE 2125 | ||
2116 | s3c2440turkiye MACH_S3C2440TURKIYE S3C2440TURKIYE 2126 | ||
2117 | tx37 MACH_TX37 TX37 2127 | ||
2118 | sbc2800_9g20 MACH_SBC2800_9G20 SBC2800_9G20 2128 | ||
2119 | benzglb MACH_BENZGLB BENZGLB 2129 | ||
2120 | benztd MACH_BENZTD BENZTD 2130 | ||
2121 | cartesio_plus MACH_CARTESIO_PLUS CARTESIO_PLUS 2131 | ||
2122 | solrad_g20 MACH_SOLRAD_G20 SOLRAD_G20 2132 | ||
2123 | mx27wallace MACH_MX27WALLACE MX27WALLACE 2133 | ||
2124 | fmzwebmodul MACH_FMZWEBMODUL FMZWEBMODUL 2134 | ||
2125 | rd78x00_masa MACH_RD78X00_MASA RD78X00_MASA 2135 | ||
2126 | smallogger MACH_SMALLOGGER SMALLOGGER 2136 | ||
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h index aafaf7a78886..cff8e84f78f2 100644 --- a/arch/avr32/mach-at32ap/include/mach/board.h +++ b/arch/avr32/mach-at32ap/include/mach/board.h | |||
@@ -116,6 +116,7 @@ struct atmel_nand_data { | |||
116 | int enable_pin; /* chip enable */ | 116 | int enable_pin; /* chip enable */ |
117 | int det_pin; /* card detect */ | 117 | int det_pin; /* card detect */ |
118 | int rdy_pin; /* ready/busy */ | 118 | int rdy_pin; /* ready/busy */ |
119 | u8 rdy_pin_active_low; /* rdy_pin value is inverted */ | ||
119 | u8 ale; /* address line number connected to ALE */ | 120 | u8 ale; /* address line number connected to ALE */ |
120 | u8 cle; /* address line number connected to CLE */ | 121 | u8 cle; /* address line number connected to CLE */ |
121 | u8 bus_width_16; /* buswidth is 16 bit */ | 122 | u8 bus_width_16; /* buswidth is 16 bit */ |
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index 8f1f97d56e1e..0c1f86e3e44a 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -1129,6 +1129,7 @@ endchoice | |||
1129 | 1129 | ||
1130 | config PM_WAKEUP_BY_GPIO | 1130 | config PM_WAKEUP_BY_GPIO |
1131 | bool "Allow Wakeup from Standby by GPIO" | 1131 | bool "Allow Wakeup from Standby by GPIO" |
1132 | depends on PM && !BF54x | ||
1132 | 1133 | ||
1133 | config PM_WAKEUP_GPIO_NUMBER | 1134 | config PM_WAKEUP_GPIO_NUMBER |
1134 | int "GPIO number" | 1135 | int "GPIO number" |
@@ -1168,6 +1169,12 @@ config PM_BFIN_WAKE_GP | |||
1168 | default n | 1169 | default n |
1169 | help | 1170 | help |
1170 | Enable General-Purpose Wake-Up (Voltage Regulator Power-Up) | 1171 | Enable General-Purpose Wake-Up (Voltage Regulator Power-Up) |
1172 | (all processors, except ADSP-BF549). This option sets | ||
1173 | the general-purpose wake-up enable (GPWE) control bit to enable | ||
1174 | wake-up upon detection of an active low signal on the /GPW (PH7) pin. | ||
1175 | On ADSP-BF549 this option enables the the same functionality on the | ||
1176 | /MRXON pin also PH7. | ||
1177 | |||
1171 | endmenu | 1178 | endmenu |
1172 | 1179 | ||
1173 | menu "CPU Frequency scaling" | 1180 | menu "CPU Frequency scaling" |
diff --git a/arch/blackfin/Kconfig.debug b/arch/blackfin/Kconfig.debug index 5f981d9ca625..79e7e63ab709 100644 --- a/arch/blackfin/Kconfig.debug +++ b/arch/blackfin/Kconfig.debug | |||
@@ -21,12 +21,6 @@ config DEBUG_STACK_USAGE | |||
21 | config HAVE_ARCH_KGDB | 21 | config HAVE_ARCH_KGDB |
22 | def_bool y | 22 | def_bool y |
23 | 23 | ||
24 | config KGDB_TESTCASE | ||
25 | tristate "KGDB: for test case in expect" | ||
26 | default n | ||
27 | help | ||
28 | This is a kgdb test case for automated testing. | ||
29 | |||
30 | config DEBUG_VERBOSE | 24 | config DEBUG_VERBOSE |
31 | bool "Verbose fault messages" | 25 | bool "Verbose fault messages" |
32 | default y | 26 | default y |
diff --git a/arch/blackfin/configs/BF518F-EZBRD_defconfig b/arch/blackfin/configs/BF518F-EZBRD_defconfig index 4fdb9e04759f..281f4b60e603 100644 --- a/arch/blackfin/configs/BF518F-EZBRD_defconfig +++ b/arch/blackfin/configs/BF518F-EZBRD_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.28-rc2 | 3 | # Linux kernel version: 2.6.28 |
4 | # Fri Jan 9 17:58:41 2009 | 4 | # Fri Feb 20 10:01:44 2009 |
5 | # | 5 | # |
6 | # CONFIG_MMU is not set | 6 | # CONFIG_MMU is not set |
7 | # CONFIG_FPU is not set | 7 | # CONFIG_FPU is not set |
@@ -133,10 +133,15 @@ CONFIG_BF518=y | |||
133 | # CONFIG_BF538 is not set | 133 | # CONFIG_BF538 is not set |
134 | # CONFIG_BF539 is not set | 134 | # CONFIG_BF539 is not set |
135 | # CONFIG_BF542 is not set | 135 | # CONFIG_BF542 is not set |
136 | # CONFIG_BF542M is not set | ||
136 | # CONFIG_BF544 is not set | 137 | # CONFIG_BF544 is not set |
138 | # CONFIG_BF544M is not set | ||
137 | # CONFIG_BF547 is not set | 139 | # CONFIG_BF547 is not set |
140 | # CONFIG_BF547M is not set | ||
138 | # CONFIG_BF548 is not set | 141 | # CONFIG_BF548 is not set |
142 | # CONFIG_BF548M is not set | ||
139 | # CONFIG_BF549 is not set | 143 | # CONFIG_BF549 is not set |
144 | # CONFIG_BF549M is not set | ||
140 | # CONFIG_BF561 is not set | 145 | # CONFIG_BF561 is not set |
141 | CONFIG_BF_REV_MIN=0 | 146 | CONFIG_BF_REV_MIN=0 |
142 | CONFIG_BF_REV_MAX=2 | 147 | CONFIG_BF_REV_MAX=2 |
@@ -426,7 +431,17 @@ CONFIG_DEFAULT_TCP_CONG="cubic" | |||
426 | # CONFIG_TIPC is not set | 431 | # CONFIG_TIPC is not set |
427 | # CONFIG_ATM is not set | 432 | # CONFIG_ATM is not set |
428 | # CONFIG_BRIDGE is not set | 433 | # CONFIG_BRIDGE is not set |
429 | # CONFIG_NET_DSA is not set | 434 | CONFIG_NET_DSA=y |
435 | # CONFIG_NET_DSA_TAG_DSA is not set | ||
436 | # CONFIG_NET_DSA_TAG_EDSA is not set | ||
437 | # CONFIG_NET_DSA_TAG_TRAILER is not set | ||
438 | CONFIG_NET_DSA_TAG_STPID=y | ||
439 | # CONFIG_NET_DSA_MV88E6XXX is not set | ||
440 | # CONFIG_NET_DSA_MV88E6060 is not set | ||
441 | # CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set | ||
442 | # CONFIG_NET_DSA_MV88E6131 is not set | ||
443 | # CONFIG_NET_DSA_MV88E6123_61_65 is not set | ||
444 | CONFIG_NET_DSA_KSZ8893M=y | ||
430 | # CONFIG_VLAN_8021Q is not set | 445 | # CONFIG_VLAN_8021Q is not set |
431 | # CONFIG_DECNET is not set | 446 | # CONFIG_DECNET is not set |
432 | # CONFIG_LLC2 is not set | 447 | # CONFIG_LLC2 is not set |
@@ -529,6 +544,8 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y | |||
529 | # | 544 | # |
530 | # Self-contained MTD device drivers | 545 | # Self-contained MTD device drivers |
531 | # | 546 | # |
547 | # CONFIG_MTD_DATAFLASH is not set | ||
548 | # CONFIG_MTD_M25P80 is not set | ||
532 | # CONFIG_MTD_SLRAM is not set | 549 | # CONFIG_MTD_SLRAM is not set |
533 | # CONFIG_MTD_PHRAM is not set | 550 | # CONFIG_MTD_PHRAM is not set |
534 | # CONFIG_MTD_MTDRAM is not set | 551 | # CONFIG_MTD_MTDRAM is not set |
@@ -561,7 +578,9 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 | |||
561 | # CONFIG_BLK_DEV_HD is not set | 578 | # CONFIG_BLK_DEV_HD is not set |
562 | CONFIG_MISC_DEVICES=y | 579 | CONFIG_MISC_DEVICES=y |
563 | # CONFIG_EEPROM_93CX6 is not set | 580 | # CONFIG_EEPROM_93CX6 is not set |
581 | # CONFIG_ICS932S401 is not set | ||
564 | # CONFIG_ENCLOSURE_SERVICES is not set | 582 | # CONFIG_ENCLOSURE_SERVICES is not set |
583 | # CONFIG_C2PORT is not set | ||
565 | CONFIG_HAVE_IDE=y | 584 | CONFIG_HAVE_IDE=y |
566 | # CONFIG_IDE is not set | 585 | # CONFIG_IDE is not set |
567 | 586 | ||
@@ -607,6 +626,7 @@ CONFIG_BFIN_RX_DESC_NUM=20 | |||
607 | # CONFIG_SMC91X is not set | 626 | # CONFIG_SMC91X is not set |
608 | # CONFIG_SMSC911X is not set | 627 | # CONFIG_SMSC911X is not set |
609 | # CONFIG_DM9000 is not set | 628 | # CONFIG_DM9000 is not set |
629 | # CONFIG_ENC28J60 is not set | ||
610 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | 630 | # CONFIG_IBM_NEW_EMAC_ZMII is not set |
611 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | 631 | # CONFIG_IBM_NEW_EMAC_RGMII is not set |
612 | # CONFIG_IBM_NEW_EMAC_TAH is not set | 632 | # CONFIG_IBM_NEW_EMAC_TAH is not set |
@@ -764,7 +784,23 @@ CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100 | |||
764 | # CONFIG_I2C_DEBUG_ALGO is not set | 784 | # CONFIG_I2C_DEBUG_ALGO is not set |
765 | # CONFIG_I2C_DEBUG_BUS is not set | 785 | # CONFIG_I2C_DEBUG_BUS is not set |
766 | # CONFIG_I2C_DEBUG_CHIP is not set | 786 | # CONFIG_I2C_DEBUG_CHIP is not set |
767 | # CONFIG_SPI is not set | 787 | CONFIG_SPI=y |
788 | # CONFIG_SPI_DEBUG is not set | ||
789 | CONFIG_SPI_MASTER=y | ||
790 | |||
791 | # | ||
792 | # SPI Master Controller Drivers | ||
793 | # | ||
794 | CONFIG_SPI_BFIN=y | ||
795 | # CONFIG_SPI_BFIN_LOCK is not set | ||
796 | # CONFIG_SPI_BITBANG is not set | ||
797 | |||
798 | # | ||
799 | # SPI Protocol Masters | ||
800 | # | ||
801 | # CONFIG_SPI_AT25 is not set | ||
802 | # CONFIG_SPI_SPIDEV is not set | ||
803 | # CONFIG_SPI_TLE62X0 is not set | ||
768 | CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y | 804 | CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y |
769 | # CONFIG_GPIOLIB is not set | 805 | # CONFIG_GPIOLIB is not set |
770 | # CONFIG_W1 is not set | 806 | # CONFIG_W1 is not set |
@@ -788,8 +824,10 @@ CONFIG_BFIN_WDT=y | |||
788 | # CONFIG_MFD_SM501 is not set | 824 | # CONFIG_MFD_SM501 is not set |
789 | # CONFIG_HTC_PASIC3 is not set | 825 | # CONFIG_HTC_PASIC3 is not set |
790 | # CONFIG_MFD_TMIO is not set | 826 | # CONFIG_MFD_TMIO is not set |
827 | # CONFIG_PMIC_DA903X is not set | ||
791 | # CONFIG_MFD_WM8400 is not set | 828 | # CONFIG_MFD_WM8400 is not set |
792 | # CONFIG_MFD_WM8350_I2C is not set | 829 | # CONFIG_MFD_WM8350_I2C is not set |
830 | # CONFIG_REGULATOR is not set | ||
793 | 831 | ||
794 | # | 832 | # |
795 | # Multimedia devices | 833 | # Multimedia devices |
@@ -861,10 +899,18 @@ CONFIG_RTC_INTF_DEV=y | |||
861 | # CONFIG_RTC_DRV_M41T80 is not set | 899 | # CONFIG_RTC_DRV_M41T80 is not set |
862 | # CONFIG_RTC_DRV_S35390A is not set | 900 | # CONFIG_RTC_DRV_S35390A is not set |
863 | # CONFIG_RTC_DRV_FM3130 is not set | 901 | # CONFIG_RTC_DRV_FM3130 is not set |
902 | # CONFIG_RTC_DRV_RX8581 is not set | ||
864 | 903 | ||
865 | # | 904 | # |
866 | # SPI RTC drivers | 905 | # SPI RTC drivers |
867 | # | 906 | # |
907 | # CONFIG_RTC_DRV_M41T94 is not set | ||
908 | # CONFIG_RTC_DRV_DS1305 is not set | ||
909 | # CONFIG_RTC_DRV_DS1390 is not set | ||
910 | # CONFIG_RTC_DRV_MAX6902 is not set | ||
911 | # CONFIG_RTC_DRV_R9701 is not set | ||
912 | # CONFIG_RTC_DRV_RS5C348 is not set | ||
913 | # CONFIG_RTC_DRV_DS3234 is not set | ||
868 | 914 | ||
869 | # | 915 | # |
870 | # Platform RTC drivers | 916 | # Platform RTC drivers |
@@ -1062,12 +1108,20 @@ CONFIG_DEBUG_INFO=y | |||
1062 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | 1108 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set |
1063 | # CONFIG_FAULT_INJECTION is not set | 1109 | # CONFIG_FAULT_INJECTION is not set |
1064 | CONFIG_SYSCTL_SYSCALL_CHECK=y | 1110 | CONFIG_SYSCTL_SYSCALL_CHECK=y |
1111 | |||
1112 | # | ||
1113 | # Tracers | ||
1114 | # | ||
1115 | # CONFIG_SCHED_TRACER is not set | ||
1116 | # CONFIG_CONTEXT_SWITCH_TRACER is not set | ||
1117 | # CONFIG_BOOT_TRACER is not set | ||
1065 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set | 1118 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set |
1066 | # CONFIG_SAMPLES is not set | 1119 | # CONFIG_SAMPLES is not set |
1067 | CONFIG_HAVE_ARCH_KGDB=y | 1120 | CONFIG_HAVE_ARCH_KGDB=y |
1068 | # CONFIG_KGDB is not set | 1121 | # CONFIG_KGDB is not set |
1069 | # CONFIG_DEBUG_STACKOVERFLOW is not set | 1122 | # CONFIG_DEBUG_STACKOVERFLOW is not set |
1070 | # CONFIG_DEBUG_STACK_USAGE is not set | 1123 | # CONFIG_DEBUG_STACK_USAGE is not set |
1124 | # CONFIG_KGDB_TESTCASE is not set | ||
1071 | CONFIG_DEBUG_VERBOSE=y | 1125 | CONFIG_DEBUG_VERBOSE=y |
1072 | CONFIG_DEBUG_MMRS=y | 1126 | CONFIG_DEBUG_MMRS=y |
1073 | # CONFIG_DEBUG_HWERR is not set | 1127 | # CONFIG_DEBUG_HWERR is not set |
@@ -1100,6 +1154,7 @@ CONFIG_CRYPTO=y | |||
1100 | # | 1154 | # |
1101 | # CONFIG_CRYPTO_FIPS is not set | 1155 | # CONFIG_CRYPTO_FIPS is not set |
1102 | # CONFIG_CRYPTO_MANAGER is not set | 1156 | # CONFIG_CRYPTO_MANAGER is not set |
1157 | # CONFIG_CRYPTO_MANAGER2 is not set | ||
1103 | # CONFIG_CRYPTO_GF128MUL is not set | 1158 | # CONFIG_CRYPTO_GF128MUL is not set |
1104 | # CONFIG_CRYPTO_NULL is not set | 1159 | # CONFIG_CRYPTO_NULL is not set |
1105 | # CONFIG_CRYPTO_CRYPTD is not set | 1160 | # CONFIG_CRYPTO_CRYPTD is not set |
diff --git a/arch/blackfin/configs/BF527-EZKIT_defconfig b/arch/blackfin/configs/BF527-EZKIT_defconfig index 833128b39724..a50050f17706 100644 --- a/arch/blackfin/configs/BF527-EZKIT_defconfig +++ b/arch/blackfin/configs/BF527-EZKIT_defconfig | |||
@@ -327,8 +327,8 @@ CONFIG_BFIN_ICACHE=y | |||
327 | CONFIG_BFIN_DCACHE=y | 327 | CONFIG_BFIN_DCACHE=y |
328 | # CONFIG_BFIN_DCACHE_BANKA is not set | 328 | # CONFIG_BFIN_DCACHE_BANKA is not set |
329 | # CONFIG_BFIN_ICACHE_LOCK is not set | 329 | # CONFIG_BFIN_ICACHE_LOCK is not set |
330 | # CONFIG_BFIN_WB is not set | 330 | CONFIG_BFIN_WB=y |
331 | CONFIG_BFIN_WT=y | 331 | # CONFIG_BFIN_WT is not set |
332 | # CONFIG_MPU is not set | 332 | # CONFIG_MPU is not set |
333 | 333 | ||
334 | # | 334 | # |
diff --git a/arch/blackfin/configs/BF533-EZKIT_defconfig b/arch/blackfin/configs/BF533-EZKIT_defconfig index 334c94b51c40..0a2a00d63887 100644 --- a/arch/blackfin/configs/BF533-EZKIT_defconfig +++ b/arch/blackfin/configs/BF533-EZKIT_defconfig | |||
@@ -290,8 +290,8 @@ CONFIG_BFIN_ICACHE=y | |||
290 | CONFIG_BFIN_DCACHE=y | 290 | CONFIG_BFIN_DCACHE=y |
291 | # CONFIG_BFIN_DCACHE_BANKA is not set | 291 | # CONFIG_BFIN_DCACHE_BANKA is not set |
292 | # CONFIG_BFIN_ICACHE_LOCK is not set | 292 | # CONFIG_BFIN_ICACHE_LOCK is not set |
293 | # CONFIG_BFIN_WB is not set | 293 | CONFIG_BFIN_WB=y |
294 | CONFIG_BFIN_WT=y | 294 | # CONFIG_BFIN_WT is not set |
295 | # CONFIG_MPU is not set | 295 | # CONFIG_MPU is not set |
296 | 296 | ||
297 | # | 297 | # |
diff --git a/arch/blackfin/configs/BF533-STAMP_defconfig b/arch/blackfin/configs/BF533-STAMP_defconfig index 9d733436e300..eb027587a355 100644 --- a/arch/blackfin/configs/BF533-STAMP_defconfig +++ b/arch/blackfin/configs/BF533-STAMP_defconfig | |||
@@ -290,8 +290,8 @@ CONFIG_BFIN_ICACHE=y | |||
290 | CONFIG_BFIN_DCACHE=y | 290 | CONFIG_BFIN_DCACHE=y |
291 | # CONFIG_BFIN_DCACHE_BANKA is not set | 291 | # CONFIG_BFIN_DCACHE_BANKA is not set |
292 | # CONFIG_BFIN_ICACHE_LOCK is not set | 292 | # CONFIG_BFIN_ICACHE_LOCK is not set |
293 | # CONFIG_BFIN_WB is not set | 293 | CONFIG_BFIN_WB=y |
294 | CONFIG_BFIN_WT=y | 294 | # CONFIG_BFIN_WT is not set |
295 | # CONFIG_MPU is not set | 295 | # CONFIG_MPU is not set |
296 | 296 | ||
297 | # | 297 | # |
diff --git a/arch/blackfin/configs/BF537-STAMP_defconfig b/arch/blackfin/configs/BF537-STAMP_defconfig index 4fb4108d3103..9e62b9f40eb1 100644 --- a/arch/blackfin/configs/BF537-STAMP_defconfig +++ b/arch/blackfin/configs/BF537-STAMP_defconfig | |||
@@ -298,8 +298,8 @@ CONFIG_BFIN_ICACHE=y | |||
298 | CONFIG_BFIN_DCACHE=y | 298 | CONFIG_BFIN_DCACHE=y |
299 | # CONFIG_BFIN_DCACHE_BANKA is not set | 299 | # CONFIG_BFIN_DCACHE_BANKA is not set |
300 | # CONFIG_BFIN_ICACHE_LOCK is not set | 300 | # CONFIG_BFIN_ICACHE_LOCK is not set |
301 | # CONFIG_BFIN_WB is not set | 301 | CONFIG_BFIN_WB=y |
302 | CONFIG_BFIN_WT=y | 302 | # CONFIG_BFIN_WT is not set |
303 | # CONFIG_MPU is not set | 303 | # CONFIG_MPU is not set |
304 | 304 | ||
305 | # | 305 | # |
@@ -568,15 +568,7 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2 | |||
568 | # CONFIG_MTD_DOC2000 is not set | 568 | # CONFIG_MTD_DOC2000 is not set |
569 | # CONFIG_MTD_DOC2001 is not set | 569 | # CONFIG_MTD_DOC2001 is not set |
570 | # CONFIG_MTD_DOC2001PLUS is not set | 570 | # CONFIG_MTD_DOC2001PLUS is not set |
571 | CONFIG_MTD_NAND=m | 571 | # CONFIG_MTD_NAND is not set |
572 | # CONFIG_MTD_NAND_VERIFY_WRITE is not set | ||
573 | # CONFIG_MTD_NAND_ECC_SMC is not set | ||
574 | # CONFIG_MTD_NAND_MUSEUM_IDS is not set | ||
575 | # CONFIG_MTD_NAND_BFIN is not set | ||
576 | CONFIG_MTD_NAND_IDS=m | ||
577 | # CONFIG_MTD_NAND_DISKONCHIP is not set | ||
578 | # CONFIG_MTD_NAND_NANDSIM is not set | ||
579 | CONFIG_MTD_NAND_PLATFORM=m | ||
580 | # CONFIG_MTD_ONENAND is not set | 572 | # CONFIG_MTD_ONENAND is not set |
581 | 573 | ||
582 | # | 574 | # |
diff --git a/arch/blackfin/configs/BF538-EZKIT_defconfig b/arch/blackfin/configs/BF538-EZKIT_defconfig index cb32f5624a1b..dd6ad6be1c87 100644 --- a/arch/blackfin/configs/BF538-EZKIT_defconfig +++ b/arch/blackfin/configs/BF538-EZKIT_defconfig | |||
@@ -306,8 +306,8 @@ CONFIG_BFIN_ICACHE=y | |||
306 | CONFIG_BFIN_DCACHE=y | 306 | CONFIG_BFIN_DCACHE=y |
307 | # CONFIG_BFIN_DCACHE_BANKA is not set | 307 | # CONFIG_BFIN_DCACHE_BANKA is not set |
308 | # CONFIG_BFIN_ICACHE_LOCK is not set | 308 | # CONFIG_BFIN_ICACHE_LOCK is not set |
309 | # CONFIG_BFIN_WB is not set | 309 | CONFIG_BFIN_WB=y |
310 | CONFIG_BFIN_WT=y | 310 | # CONFIG_BFIN_WT is not set |
311 | # CONFIG_MPU is not set | 311 | # CONFIG_MPU is not set |
312 | 312 | ||
313 | # | 313 | # |
diff --git a/arch/blackfin/configs/BF548-EZKIT_defconfig b/arch/blackfin/configs/BF548-EZKIT_defconfig index 0f8697618aa5..6bc2fb1b2a70 100644 --- a/arch/blackfin/configs/BF548-EZKIT_defconfig +++ b/arch/blackfin/configs/BF548-EZKIT_defconfig | |||
@@ -361,8 +361,8 @@ CONFIG_BFIN_ICACHE=y | |||
361 | CONFIG_BFIN_DCACHE=y | 361 | CONFIG_BFIN_DCACHE=y |
362 | # CONFIG_BFIN_DCACHE_BANKA is not set | 362 | # CONFIG_BFIN_DCACHE_BANKA is not set |
363 | # CONFIG_BFIN_ICACHE_LOCK is not set | 363 | # CONFIG_BFIN_ICACHE_LOCK is not set |
364 | # CONFIG_BFIN_WB is not set | 364 | CONFIG_BFIN_WB=y |
365 | CONFIG_BFIN_WT=y | 365 | # CONFIG_BFIN_WT is not set |
366 | # CONFIG_BFIN_L2_CACHEABLE is not set | 366 | # CONFIG_BFIN_L2_CACHEABLE is not set |
367 | # CONFIG_MPU is not set | 367 | # CONFIG_MPU is not set |
368 | 368 | ||
@@ -680,7 +680,7 @@ CONFIG_SCSI=y | |||
680 | CONFIG_SCSI_DMA=y | 680 | CONFIG_SCSI_DMA=y |
681 | # CONFIG_SCSI_TGT is not set | 681 | # CONFIG_SCSI_TGT is not set |
682 | # CONFIG_SCSI_NETLINK is not set | 682 | # CONFIG_SCSI_NETLINK is not set |
683 | CONFIG_SCSI_PROC_FS=y | 683 | # CONFIG_SCSI_PROC_FS is not set |
684 | 684 | ||
685 | # | 685 | # |
686 | # SCSI support type (disk, tape, CD-ROM) | 686 | # SCSI support type (disk, tape, CD-ROM) |
diff --git a/arch/blackfin/configs/BF561-EZKIT_defconfig b/arch/blackfin/configs/BF561-EZKIT_defconfig index 042c7adfccfa..69714fb3e608 100644 --- a/arch/blackfin/configs/BF561-EZKIT_defconfig +++ b/arch/blackfin/configs/BF561-EZKIT_defconfig | |||
@@ -329,8 +329,8 @@ CONFIG_BFIN_ICACHE=y | |||
329 | CONFIG_BFIN_DCACHE=y | 329 | CONFIG_BFIN_DCACHE=y |
330 | # CONFIG_BFIN_DCACHE_BANKA is not set | 330 | # CONFIG_BFIN_DCACHE_BANKA is not set |
331 | # CONFIG_BFIN_ICACHE_LOCK is not set | 331 | # CONFIG_BFIN_ICACHE_LOCK is not set |
332 | # CONFIG_BFIN_WB is not set | 332 | CONFIG_BFIN_WB=y |
333 | CONFIG_BFIN_WT=y | 333 | # CONFIG_BFIN_WT is not set |
334 | # CONFIG_BFIN_L2_CACHEABLE is not set | 334 | # CONFIG_BFIN_L2_CACHEABLE is not set |
335 | # CONFIG_MPU is not set | 335 | # CONFIG_MPU is not set |
336 | 336 | ||
diff --git a/arch/blackfin/configs/BlackStamp_defconfig b/arch/blackfin/configs/BlackStamp_defconfig index 3a20e281d23c..017c6ea071b5 100644 --- a/arch/blackfin/configs/BlackStamp_defconfig +++ b/arch/blackfin/configs/BlackStamp_defconfig | |||
@@ -288,8 +288,8 @@ CONFIG_BFIN_ICACHE=y | |||
288 | CONFIG_BFIN_DCACHE=y | 288 | CONFIG_BFIN_DCACHE=y |
289 | # CONFIG_BFIN_DCACHE_BANKA is not set | 289 | # CONFIG_BFIN_DCACHE_BANKA is not set |
290 | # CONFIG_BFIN_ICACHE_LOCK is not set | 290 | # CONFIG_BFIN_ICACHE_LOCK is not set |
291 | # CONFIG_BFIN_WB is not set | 291 | CONFIG_BFIN_WB=y |
292 | CONFIG_BFIN_WT=y | 292 | # CONFIG_BFIN_WT is not set |
293 | # CONFIG_MPU is not set | 293 | # CONFIG_MPU is not set |
294 | 294 | ||
295 | # | 295 | # |
diff --git a/arch/blackfin/configs/CM-BF527_defconfig b/arch/blackfin/configs/CM-BF527_defconfig index 865ed85a5760..d880ef786770 100644 --- a/arch/blackfin/configs/CM-BF527_defconfig +++ b/arch/blackfin/configs/CM-BF527_defconfig | |||
@@ -332,8 +332,8 @@ CONFIG_BFIN_ICACHE=y | |||
332 | CONFIG_BFIN_DCACHE=y | 332 | CONFIG_BFIN_DCACHE=y |
333 | # CONFIG_BFIN_DCACHE_BANKA is not set | 333 | # CONFIG_BFIN_DCACHE_BANKA is not set |
334 | # CONFIG_BFIN_ICACHE_LOCK is not set | 334 | # CONFIG_BFIN_ICACHE_LOCK is not set |
335 | # CONFIG_BFIN_WB is not set | 335 | CONFIG_BFIN_WB=y |
336 | CONFIG_BFIN_WT=y | 336 | # CONFIG_BFIN_WT is not set |
337 | # CONFIG_MPU is not set | 337 | # CONFIG_MPU is not set |
338 | 338 | ||
339 | # | 339 | # |
diff --git a/arch/blackfin/configs/CM-BF548_defconfig b/arch/blackfin/configs/CM-BF548_defconfig index efe9741b1f14..f410430b4e3d 100644 --- a/arch/blackfin/configs/CM-BF548_defconfig +++ b/arch/blackfin/configs/CM-BF548_defconfig | |||
@@ -336,8 +336,8 @@ CONFIG_BFIN_ICACHE=y | |||
336 | CONFIG_BFIN_DCACHE=y | 336 | CONFIG_BFIN_DCACHE=y |
337 | # CONFIG_BFIN_DCACHE_BANKA is not set | 337 | # CONFIG_BFIN_DCACHE_BANKA is not set |
338 | # CONFIG_BFIN_ICACHE_LOCK is not set | 338 | # CONFIG_BFIN_ICACHE_LOCK is not set |
339 | # CONFIG_BFIN_WB is not set | 339 | CONFIG_BFIN_WB=y |
340 | CONFIG_BFIN_WT=y | 340 | # CONFIG_BFIN_WT is not set |
341 | CONFIG_L1_MAX_PIECE=16 | 341 | CONFIG_L1_MAX_PIECE=16 |
342 | # CONFIG_MPU is not set | 342 | # CONFIG_MPU is not set |
343 | 343 | ||
@@ -595,7 +595,7 @@ CONFIG_SCSI=y | |||
595 | CONFIG_SCSI_DMA=y | 595 | CONFIG_SCSI_DMA=y |
596 | # CONFIG_SCSI_TGT is not set | 596 | # CONFIG_SCSI_TGT is not set |
597 | # CONFIG_SCSI_NETLINK is not set | 597 | # CONFIG_SCSI_NETLINK is not set |
598 | CONFIG_SCSI_PROC_FS=y | 598 | # CONFIG_SCSI_PROC_FS is not set |
599 | 599 | ||
600 | # | 600 | # |
601 | # SCSI support type (disk, tape, CD-ROM) | 601 | # SCSI support type (disk, tape, CD-ROM) |
diff --git a/arch/blackfin/configs/IP0X_defconfig b/arch/blackfin/configs/IP0X_defconfig index eae83b5de92f..7db93874c987 100644 --- a/arch/blackfin/configs/IP0X_defconfig +++ b/arch/blackfin/configs/IP0X_defconfig | |||
@@ -612,7 +612,7 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 | |||
612 | CONFIG_SCSI=y | 612 | CONFIG_SCSI=y |
613 | # CONFIG_SCSI_TGT is not set | 613 | # CONFIG_SCSI_TGT is not set |
614 | # CONFIG_SCSI_NETLINK is not set | 614 | # CONFIG_SCSI_NETLINK is not set |
615 | CONFIG_SCSI_PROC_FS=y | 615 | # CONFIG_SCSI_PROC_FS is not set |
616 | 616 | ||
617 | # | 617 | # |
618 | # SCSI support type (disk, tape, CD-ROM) | 618 | # SCSI support type (disk, tape, CD-ROM) |
diff --git a/arch/blackfin/configs/SRV1_defconfig b/arch/blackfin/configs/SRV1_defconfig index fa580affc9d6..a46529c6ade3 100644 --- a/arch/blackfin/configs/SRV1_defconfig +++ b/arch/blackfin/configs/SRV1_defconfig | |||
@@ -282,8 +282,8 @@ CONFIG_BFIN_ICACHE=y | |||
282 | CONFIG_BFIN_DCACHE=y | 282 | CONFIG_BFIN_DCACHE=y |
283 | # CONFIG_BFIN_DCACHE_BANKA is not set | 283 | # CONFIG_BFIN_DCACHE_BANKA is not set |
284 | # CONFIG_BFIN_ICACHE_LOCK is not set | 284 | # CONFIG_BFIN_ICACHE_LOCK is not set |
285 | # CONFIG_BFIN_WB is not set | 285 | CONFIG_BFIN_WB=y |
286 | CONFIG_BFIN_WT=y | 286 | # CONFIG_BFIN_WT is not set |
287 | CONFIG_L1_MAX_PIECE=16 | 287 | CONFIG_L1_MAX_PIECE=16 |
288 | 288 | ||
289 | # | 289 | # |
diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild index 606ecfdcc962..09c31418cc08 100644 --- a/arch/blackfin/include/asm/Kbuild +++ b/arch/blackfin/include/asm/Kbuild | |||
@@ -1,3 +1,4 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | unifdef-y += bfin_sport.h | ||
3 | unifdef-y += fixed_code.h | 4 | unifdef-y += fixed_code.h |
diff --git a/arch/blackfin/include/asm/bfin_sport.h b/arch/blackfin/include/asm/bfin_sport.h index fe88a2c19213..65a651db5b07 100644 --- a/arch/blackfin/include/asm/bfin_sport.h +++ b/arch/blackfin/include/asm/bfin_sport.h | |||
@@ -1,30 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * File: include/asm-blackfin/bfin_sport.h | 2 | * bfin_sport.h - userspace header for bfin sport driver |
3 | * Based on: | ||
4 | * Author: Roy Huang (roy.huang@analog.com) | ||
5 | * | 3 | * |
6 | * Created: Thu Aug. 24 2006 | 4 | * Copyright 2004-2008 Analog Devices Inc. |
7 | * Description: | ||
8 | * | 5 | * |
9 | * Modified: | 6 | * Licensed under the GPL-2 or later. |
10 | * Copyright 2004-2006 Analog Devices Inc. | ||
11 | * | ||
12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License as published by | ||
16 | * the Free Software Foundation; either version 2 of the License, or | ||
17 | * (at your option) any later version. | ||
18 | * | ||
19 | * This program is distributed in the hope that it will be useful, | ||
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
22 | * GNU General Public License for more details. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License | ||
25 | * along with this program; if not, see the file COPYING, or write | ||
26 | * to the Free Software Foundation, Inc., | ||
27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
28 | */ | 7 | */ |
29 | 8 | ||
30 | #ifndef __BFIN_SPORT_H__ | 9 | #ifndef __BFIN_SPORT_H__ |
@@ -42,11 +21,10 @@ | |||
42 | #define NORM_FORMAT 0x0 | 21 | #define NORM_FORMAT 0x0 |
43 | #define ALAW_FORMAT 0x2 | 22 | #define ALAW_FORMAT 0x2 |
44 | #define ULAW_FORMAT 0x3 | 23 | #define ULAW_FORMAT 0x3 |
45 | struct sport_register; | ||
46 | 24 | ||
47 | /* Function driver which use sport must initialize the structure */ | 25 | /* Function driver which use sport must initialize the structure */ |
48 | struct sport_config { | 26 | struct sport_config { |
49 | /*TDM (multichannels), I2S or other mode */ | 27 | /* TDM (multichannels), I2S or other mode */ |
50 | unsigned int mode:3; | 28 | unsigned int mode:3; |
51 | 29 | ||
52 | /* if TDM mode is selected, channels must be set */ | 30 | /* if TDM mode is selected, channels must be set */ |
@@ -72,12 +50,18 @@ struct sport_config { | |||
72 | int serial_clk; | 50 | int serial_clk; |
73 | int fsync_clk; | 51 | int fsync_clk; |
74 | 52 | ||
75 | unsigned int data_format:2; /*Normal, u-law or a-law */ | 53 | unsigned int data_format:2; /* Normal, u-law or a-law */ |
76 | 54 | ||
77 | int word_len; /* How length of the word in bits, 3-32 bits */ | 55 | int word_len; /* How length of the word in bits, 3-32 bits */ |
78 | int dma_enabled; | 56 | int dma_enabled; |
79 | }; | 57 | }; |
80 | 58 | ||
59 | /* Userspace interface */ | ||
60 | #define SPORT_IOC_MAGIC 'P' | ||
61 | #define SPORT_IOC_CONFIG _IOWR('P', 0x01, struct sport_config) | ||
62 | |||
63 | #ifdef __KERNEL__ | ||
64 | |||
81 | struct sport_register { | 65 | struct sport_register { |
82 | unsigned short tcr1; | 66 | unsigned short tcr1; |
83 | unsigned short reserved0; | 67 | unsigned short reserved0; |
@@ -117,9 +101,6 @@ struct sport_register { | |||
117 | unsigned long mrcs3; | 101 | unsigned long mrcs3; |
118 | }; | 102 | }; |
119 | 103 | ||
120 | #define SPORT_IOC_MAGIC 'P' | ||
121 | #define SPORT_IOC_CONFIG _IOWR('P', 0x01, struct sport_config) | ||
122 | |||
123 | struct sport_dev { | 104 | struct sport_dev { |
124 | struct cdev cdev; /* Char device structure */ | 105 | struct cdev cdev; /* Char device structure */ |
125 | 106 | ||
@@ -149,6 +130,8 @@ struct sport_dev { | |||
149 | struct sport_config config; | 130 | struct sport_config config; |
150 | }; | 131 | }; |
151 | 132 | ||
133 | #endif | ||
134 | |||
152 | #define SPORT_TCR1 0 | 135 | #define SPORT_TCR1 0 |
153 | #define SPORT_TCR2 1 | 136 | #define SPORT_TCR2 1 |
154 | #define SPORT_TCLKDIV 2 | 137 | #define SPORT_TCLKDIV 2 |
@@ -169,4 +152,4 @@ struct sport_dev { | |||
169 | #define SPORT_MRCS2 22 | 152 | #define SPORT_MRCS2 22 |
170 | #define SPORT_MRCS3 23 | 153 | #define SPORT_MRCS3 23 |
171 | 154 | ||
172 | #endif /*__BFIN_SPORT_H__*/ | 155 | #endif |
diff --git a/arch/blackfin/include/asm/ipipe.h b/arch/blackfin/include/asm/ipipe.h index 76f53d8b9a0d..343b56361ec9 100644 --- a/arch/blackfin/include/asm/ipipe.h +++ b/arch/blackfin/include/asm/ipipe.h | |||
@@ -35,9 +35,9 @@ | |||
35 | #include <asm/atomic.h> | 35 | #include <asm/atomic.h> |
36 | #include <asm/traps.h> | 36 | #include <asm/traps.h> |
37 | 37 | ||
38 | #define IPIPE_ARCH_STRING "1.8-00" | 38 | #define IPIPE_ARCH_STRING "1.9-00" |
39 | #define IPIPE_MAJOR_NUMBER 1 | 39 | #define IPIPE_MAJOR_NUMBER 1 |
40 | #define IPIPE_MINOR_NUMBER 8 | 40 | #define IPIPE_MINOR_NUMBER 9 |
41 | #define IPIPE_PATCH_NUMBER 0 | 41 | #define IPIPE_PATCH_NUMBER 0 |
42 | 42 | ||
43 | #ifdef CONFIG_SMP | 43 | #ifdef CONFIG_SMP |
@@ -83,9 +83,9 @@ struct ipipe_sysinfo { | |||
83 | "%2 = CYCLES2\n" \ | 83 | "%2 = CYCLES2\n" \ |
84 | "CC = %2 == %0\n" \ | 84 | "CC = %2 == %0\n" \ |
85 | "if ! CC jump 1b\n" \ | 85 | "if ! CC jump 1b\n" \ |
86 | : "=r" (((unsigned long *)&t)[1]), \ | 86 | : "=d,a" (((unsigned long *)&t)[1]), \ |
87 | "=r" (((unsigned long *)&t)[0]), \ | 87 | "=d,a" (((unsigned long *)&t)[0]), \ |
88 | "=r" (__cy2) \ | 88 | "=d,a" (__cy2) \ |
89 | : /*no input*/ : "CC"); \ | 89 | : /*no input*/ : "CC"); \ |
90 | t; \ | 90 | t; \ |
91 | }) | 91 | }) |
@@ -118,35 +118,40 @@ void __ipipe_disable_irqdesc(struct ipipe_domain *ipd, | |||
118 | 118 | ||
119 | #define __ipipe_disable_irq(irq) (irq_desc[irq].chip->mask(irq)) | 119 | #define __ipipe_disable_irq(irq) (irq_desc[irq].chip->mask(irq)) |
120 | 120 | ||
121 | #define __ipipe_lock_root() \ | 121 | static inline int __ipipe_check_tickdev(const char *devname) |
122 | set_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags) | 122 | { |
123 | return 1; | ||
124 | } | ||
123 | 125 | ||
124 | #define __ipipe_unlock_root() \ | 126 | static inline void __ipipe_lock_root(void) |
125 | clear_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags) | 127 | { |
128 | set_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status)); | ||
129 | } | ||
130 | |||
131 | static inline void __ipipe_unlock_root(void) | ||
132 | { | ||
133 | clear_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status)); | ||
134 | } | ||
126 | 135 | ||
127 | void __ipipe_enable_pipeline(void); | 136 | void __ipipe_enable_pipeline(void); |
128 | 137 | ||
129 | #define __ipipe_hook_critical_ipi(ipd) do { } while (0) | 138 | #define __ipipe_hook_critical_ipi(ipd) do { } while (0) |
130 | 139 | ||
131 | #define __ipipe_sync_pipeline(syncmask) \ | 140 | #define __ipipe_sync_pipeline ___ipipe_sync_pipeline |
132 | do { \ | 141 | void ___ipipe_sync_pipeline(unsigned long syncmask); |
133 | struct ipipe_domain *ipd = ipipe_current_domain; \ | ||
134 | if (likely(ipd != ipipe_root_domain || !test_bit(IPIPE_ROOTLOCK_FLAG, &ipd->flags))) \ | ||
135 | __ipipe_sync_stage(syncmask); \ | ||
136 | } while (0) | ||
137 | 142 | ||
138 | void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs); | 143 | void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs); |
139 | 144 | ||
140 | int __ipipe_get_irq_priority(unsigned irq); | 145 | int __ipipe_get_irq_priority(unsigned irq); |
141 | 146 | ||
142 | int __ipipe_get_irqthread_priority(unsigned irq); | ||
143 | |||
144 | void __ipipe_stall_root_raw(void); | 147 | void __ipipe_stall_root_raw(void); |
145 | 148 | ||
146 | void __ipipe_unstall_root_raw(void); | 149 | void __ipipe_unstall_root_raw(void); |
147 | 150 | ||
148 | void __ipipe_serial_debug(const char *fmt, ...); | 151 | void __ipipe_serial_debug(const char *fmt, ...); |
149 | 152 | ||
153 | asmlinkage void __ipipe_call_irqtail(unsigned long addr); | ||
154 | |||
150 | DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs); | 155 | DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs); |
151 | 156 | ||
152 | extern unsigned long __ipipe_core_clock; | 157 | extern unsigned long __ipipe_core_clock; |
@@ -162,42 +167,25 @@ static inline unsigned long __ipipe_ffnz(unsigned long ul) | |||
162 | 167 | ||
163 | #define __ipipe_run_irqtail() /* Must be a macro */ \ | 168 | #define __ipipe_run_irqtail() /* Must be a macro */ \ |
164 | do { \ | 169 | do { \ |
165 | asmlinkage void __ipipe_call_irqtail(void); \ | ||
166 | unsigned long __pending; \ | 170 | unsigned long __pending; \ |
167 | CSYNC(); \ | 171 | CSYNC(); \ |
168 | __pending = bfin_read_IPEND(); \ | 172 | __pending = bfin_read_IPEND(); \ |
169 | if (__pending & 0x8000) { \ | 173 | if (__pending & 0x8000) { \ |
170 | __pending &= ~0x8010; \ | 174 | __pending &= ~0x8010; \ |
171 | if (__pending && (__pending & (__pending - 1)) == 0) \ | 175 | if (__pending && (__pending & (__pending - 1)) == 0) \ |
172 | __ipipe_call_irqtail(); \ | 176 | __ipipe_call_irqtail(__ipipe_irq_tail_hook); \ |
173 | } \ | 177 | } \ |
174 | } while (0) | 178 | } while (0) |
175 | 179 | ||
176 | #define __ipipe_run_isr(ipd, irq) \ | 180 | #define __ipipe_run_isr(ipd, irq) \ |
177 | do { \ | 181 | do { \ |
178 | if (ipd == ipipe_root_domain) { \ | 182 | if (ipd == ipipe_root_domain) { \ |
179 | /* \ | 183 | local_irq_enable_hw(); \ |
180 | * Note: the I-pipe implements a threaded interrupt model on \ | 184 | if (ipipe_virtual_irq_p(irq)) \ |
181 | * this arch for Linux external IRQs. The interrupt handler we \ | ||
182 | * call here only wakes up the associated IRQ thread. \ | ||
183 | */ \ | ||
184 | if (ipipe_virtual_irq_p(irq)) { \ | ||
185 | /* No irqtail here; virtual interrupts have no effect \ | ||
186 | on IPEND so there is no need for processing \ | ||
187 | deferral. */ \ | ||
188 | local_irq_enable_nohead(ipd); \ | ||
189 | ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \ | 185 | ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \ |
190 | local_irq_disable_nohead(ipd); \ | 186 | else \ |
191 | } else \ | ||
192 | /* \ | ||
193 | * No need to run the irqtail here either; \ | ||
194 | * we can't be preempted by hw IRQs, so \ | ||
195 | * non-Linux IRQs cannot stack over the short \ | ||
196 | * thread wakeup code. Which in turn means \ | ||
197 | * that no irqtail condition could be pending \ | ||
198 | * for domains above Linux in the pipeline. \ | ||
199 | */ \ | ||
200 | ipd->irqs[irq].handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs)); \ | 187 | ipd->irqs[irq].handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs)); \ |
188 | local_irq_disable_hw(); \ | ||
201 | } else { \ | 189 | } else { \ |
202 | __clear_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \ | 190 | __clear_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \ |
203 | local_irq_enable_nohead(ipd); \ | 191 | local_irq_enable_nohead(ipd); \ |
@@ -217,42 +205,24 @@ void ipipe_init_irq_threads(void); | |||
217 | 205 | ||
218 | int ipipe_start_irq_thread(unsigned irq, struct irq_desc *desc); | 206 | int ipipe_start_irq_thread(unsigned irq, struct irq_desc *desc); |
219 | 207 | ||
220 | #define IS_SYSIRQ(irq) ((irq) > IRQ_CORETMR && (irq) <= SYS_IRQS) | 208 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
221 | #define IS_GPIOIRQ(irq) ((irq) >= GPIO_IRQ_BASE && (irq) < NR_IRQS) | 209 | #define IRQ_SYSTMR IRQ_CORETMR |
222 | 210 | #define IRQ_PRIOTMR IRQ_CORETMR | |
211 | #else | ||
223 | #define IRQ_SYSTMR IRQ_TIMER0 | 212 | #define IRQ_SYSTMR IRQ_TIMER0 |
224 | #define IRQ_PRIOTMR CONFIG_IRQ_TIMER0 | 213 | #define IRQ_PRIOTMR CONFIG_IRQ_TIMER0 |
214 | #endif | ||
225 | 215 | ||
226 | #if defined(CONFIG_BF531) || defined(CONFIG_BF532) || defined(CONFIG_BF533) | 216 | #ifdef CONFIG_BF561 |
227 | #define PRIO_GPIODEMUX(irq) CONFIG_PFA | ||
228 | #elif defined(CONFIG_BF534) || defined(CONFIG_BF536) || defined(CONFIG_BF537) | ||
229 | #define PRIO_GPIODEMUX(irq) CONFIG_IRQ_PROG_INTA | ||
230 | #elif defined(CONFIG_BF52x) | ||
231 | #define PRIO_GPIODEMUX(irq) ((irq) == IRQ_PORTF_INTA ? CONFIG_IRQ_PORTF_INTA : \ | ||
232 | (irq) == IRQ_PORTG_INTA ? CONFIG_IRQ_PORTG_INTA : \ | ||
233 | (irq) == IRQ_PORTH_INTA ? CONFIG_IRQ_PORTH_INTA : \ | ||
234 | -1) | ||
235 | #elif defined(CONFIG_BF561) | ||
236 | #define PRIO_GPIODEMUX(irq) ((irq) == IRQ_PROG0_INTA ? CONFIG_IRQ_PROG0_INTA : \ | ||
237 | (irq) == IRQ_PROG1_INTA ? CONFIG_IRQ_PROG1_INTA : \ | ||
238 | (irq) == IRQ_PROG2_INTA ? CONFIG_IRQ_PROG2_INTA : \ | ||
239 | -1) | ||
240 | #define bfin_write_TIMER_DISABLE(val) bfin_write_TMRS8_DISABLE(val) | 217 | #define bfin_write_TIMER_DISABLE(val) bfin_write_TMRS8_DISABLE(val) |
241 | #define bfin_write_TIMER_ENABLE(val) bfin_write_TMRS8_ENABLE(val) | 218 | #define bfin_write_TIMER_ENABLE(val) bfin_write_TMRS8_ENABLE(val) |
242 | #define bfin_write_TIMER_STATUS(val) bfin_write_TMRS8_STATUS(val) | 219 | #define bfin_write_TIMER_STATUS(val) bfin_write_TMRS8_STATUS(val) |
243 | #define bfin_read_TIMER_STATUS() bfin_read_TMRS8_STATUS() | 220 | #define bfin_read_TIMER_STATUS() bfin_read_TMRS8_STATUS() |
244 | #elif defined(CONFIG_BF54x) | 221 | #elif defined(CONFIG_BF54x) |
245 | #define PRIO_GPIODEMUX(irq) ((irq) == IRQ_PINT0 ? CONFIG_IRQ_PINT0 : \ | ||
246 | (irq) == IRQ_PINT1 ? CONFIG_IRQ_PINT1 : \ | ||
247 | (irq) == IRQ_PINT2 ? CONFIG_IRQ_PINT2 : \ | ||
248 | (irq) == IRQ_PINT3 ? CONFIG_IRQ_PINT3 : \ | ||
249 | -1) | ||
250 | #define bfin_write_TIMER_DISABLE(val) bfin_write_TIMER_DISABLE0(val) | 222 | #define bfin_write_TIMER_DISABLE(val) bfin_write_TIMER_DISABLE0(val) |
251 | #define bfin_write_TIMER_ENABLE(val) bfin_write_TIMER_ENABLE0(val) | 223 | #define bfin_write_TIMER_ENABLE(val) bfin_write_TIMER_ENABLE0(val) |
252 | #define bfin_write_TIMER_STATUS(val) bfin_write_TIMER_STATUS0(val) | 224 | #define bfin_write_TIMER_STATUS(val) bfin_write_TIMER_STATUS0(val) |
253 | #define bfin_read_TIMER_STATUS(val) bfin_read_TIMER_STATUS0(val) | 225 | #define bfin_read_TIMER_STATUS(val) bfin_read_TIMER_STATUS0(val) |
254 | #else | ||
255 | # error "no PRIO_GPIODEMUX() for this part" | ||
256 | #endif | 226 | #endif |
257 | 227 | ||
258 | #define __ipipe_root_tick_p(regs) ((regs->ipend & 0x10) != 0) | 228 | #define __ipipe_root_tick_p(regs) ((regs->ipend & 0x10) != 0) |
@@ -275,4 +245,6 @@ int ipipe_start_irq_thread(unsigned irq, struct irq_desc *desc); | |||
275 | 245 | ||
276 | #endif /* !CONFIG_IPIPE */ | 246 | #endif /* !CONFIG_IPIPE */ |
277 | 247 | ||
248 | #define ipipe_update_tick_evtdev(evtdev) do { } while (0) | ||
249 | |||
278 | #endif /* !__ASM_BLACKFIN_IPIPE_H */ | 250 | #endif /* !__ASM_BLACKFIN_IPIPE_H */ |
diff --git a/arch/blackfin/include/asm/ipipe_base.h b/arch/blackfin/include/asm/ipipe_base.h index cb1025aeabcf..3e8acbd1a3be 100644 --- a/arch/blackfin/include/asm/ipipe_base.h +++ b/arch/blackfin/include/asm/ipipe_base.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* -*- linux-c -*- | 1 | /* -*- linux-c -*- |
2 | * include/asm-blackfin/_baseipipe.h | 2 | * include/asm-blackfin/ipipe_base.h |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Philippe Gerum. | 4 | * Copyright (C) 2007 Philippe Gerum. |
5 | * | 5 | * |
@@ -27,8 +27,9 @@ | |||
27 | #define IPIPE_NR_XIRQS NR_IRQS | 27 | #define IPIPE_NR_XIRQS NR_IRQS |
28 | #define IPIPE_IRQ_ISHIFT 5 /* 2^5 for 32bits arch. */ | 28 | #define IPIPE_IRQ_ISHIFT 5 /* 2^5 for 32bits arch. */ |
29 | 29 | ||
30 | /* Blackfin-specific, global domain flags */ | 30 | /* Blackfin-specific, per-cpu pipeline status */ |
31 | #define IPIPE_ROOTLOCK_FLAG 1 /* Lock pipeline for root */ | 31 | #define IPIPE_SYNCDEFER_FLAG 15 |
32 | #define IPIPE_SYNCDEFER_MASK (1L << IPIPE_SYNCDEFER_MASK) | ||
32 | 33 | ||
33 | /* Blackfin traps -- i.e. exception vector numbers */ | 34 | /* Blackfin traps -- i.e. exception vector numbers */ |
34 | #define IPIPE_NR_FAULTS 52 /* We leave a gap after VEC_ILL_RES. */ | 35 | #define IPIPE_NR_FAULTS 52 /* We leave a gap after VEC_ILL_RES. */ |
@@ -48,11 +49,6 @@ | |||
48 | 49 | ||
49 | #ifndef __ASSEMBLY__ | 50 | #ifndef __ASSEMBLY__ |
50 | 51 | ||
51 | #include <linux/bitops.h> | ||
52 | |||
53 | extern int test_bit(int nr, const void *addr); | ||
54 | |||
55 | |||
56 | extern unsigned long __ipipe_root_status; /* Alias to ipipe_root_cpudom_var(status) */ | 52 | extern unsigned long __ipipe_root_status; /* Alias to ipipe_root_cpudom_var(status) */ |
57 | 53 | ||
58 | static inline void __ipipe_stall_root(void) | 54 | static inline void __ipipe_stall_root(void) |
diff --git a/arch/blackfin/include/asm/irq.h b/arch/blackfin/include/asm/irq.h index 3d977909ce7d..7645e85a5f6f 100644 --- a/arch/blackfin/include/asm/irq.h +++ b/arch/blackfin/include/asm/irq.h | |||
@@ -61,20 +61,38 @@ void __ipipe_restore_root(unsigned long flags); | |||
61 | #define raw_irqs_disabled_flags(flags) (!irqs_enabled_from_flags_hw(flags)) | 61 | #define raw_irqs_disabled_flags(flags) (!irqs_enabled_from_flags_hw(flags)) |
62 | #define local_test_iflag_hw(x) irqs_enabled_from_flags_hw(x) | 62 | #define local_test_iflag_hw(x) irqs_enabled_from_flags_hw(x) |
63 | 63 | ||
64 | #define local_save_flags(x) \ | 64 | #define local_save_flags(x) \ |
65 | do { \ | 65 | do { \ |
66 | (x) = __ipipe_test_root() ? \ | 66 | (x) = __ipipe_test_root() ? \ |
67 | __all_masked_irq_flags : bfin_irq_flags; \ | 67 | __all_masked_irq_flags : bfin_irq_flags; \ |
68 | barrier(); \ | ||
68 | } while (0) | 69 | } while (0) |
69 | 70 | ||
70 | #define local_irq_save(x) \ | 71 | #define local_irq_save(x) \ |
71 | do { \ | 72 | do { \ |
72 | (x) = __ipipe_test_and_stall_root(); \ | 73 | (x) = __ipipe_test_and_stall_root() ? \ |
74 | __all_masked_irq_flags : bfin_irq_flags; \ | ||
75 | barrier(); \ | ||
76 | } while (0) | ||
77 | |||
78 | static inline void local_irq_restore(unsigned long x) | ||
79 | { | ||
80 | barrier(); | ||
81 | __ipipe_restore_root(x == __all_masked_irq_flags); | ||
82 | } | ||
83 | |||
84 | #define local_irq_disable() \ | ||
85 | do { \ | ||
86 | __ipipe_stall_root(); \ | ||
87 | barrier(); \ | ||
73 | } while (0) | 88 | } while (0) |
74 | 89 | ||
75 | #define local_irq_restore(x) __ipipe_restore_root(x) | 90 | static inline void local_irq_enable(void) |
76 | #define local_irq_disable() __ipipe_stall_root() | 91 | { |
77 | #define local_irq_enable() __ipipe_unstall_root() | 92 | barrier(); |
93 | __ipipe_unstall_root(); | ||
94 | } | ||
95 | |||
78 | #define irqs_disabled() __ipipe_test_root() | 96 | #define irqs_disabled() __ipipe_test_root() |
79 | 97 | ||
80 | #define local_save_flags_hw(x) \ | 98 | #define local_save_flags_hw(x) \ |
diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h index e721ce55956c..2920087516f2 100644 --- a/arch/blackfin/include/asm/thread_info.h +++ b/arch/blackfin/include/asm/thread_info.h | |||
@@ -122,6 +122,7 @@ static inline struct thread_info *current_thread_info(void) | |||
122 | #define TIF_MEMDIE 4 | 122 | #define TIF_MEMDIE 4 |
123 | #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ | 123 | #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ |
124 | #define TIF_FREEZE 6 /* is freezing for suspend */ | 124 | #define TIF_FREEZE 6 /* is freezing for suspend */ |
125 | #define TIF_IRQ_SYNC 7 /* sync pipeline stage */ | ||
125 | 126 | ||
126 | /* as above, but as bit values */ | 127 | /* as above, but as bit values */ |
127 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 128 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
@@ -130,6 +131,7 @@ static inline struct thread_info *current_thread_info(void) | |||
130 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 131 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
131 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 132 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) |
132 | #define _TIF_FREEZE (1<<TIF_FREEZE) | 133 | #define _TIF_FREEZE (1<<TIF_FREEZE) |
134 | #define _TIF_IRQ_SYNC (1<<TIF_IRQ_SYNC) | ||
133 | 135 | ||
134 | #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ | 136 | #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ |
135 | 137 | ||
diff --git a/arch/blackfin/kernel/Makefile b/arch/blackfin/kernel/Makefile index 4a92a86824b7..fd4d4328a0f2 100644 --- a/arch/blackfin/kernel/Makefile +++ b/arch/blackfin/kernel/Makefile | |||
@@ -15,13 +15,15 @@ else | |||
15 | obj-y += time.o | 15 | obj-y += time.o |
16 | endif | 16 | endif |
17 | 17 | ||
18 | CFLAGS_kgdb_test.o := -mlong-calls -O0 | ||
19 | |||
20 | obj-$(CONFIG_IPIPE) += ipipe.o | 18 | obj-$(CONFIG_IPIPE) += ipipe.o |
21 | obj-$(CONFIG_IPIPE_TRACE_MCOUNT) += mcount.o | 19 | obj-$(CONFIG_IPIPE_TRACE_MCOUNT) += mcount.o |
22 | obj-$(CONFIG_BFIN_GPTIMERS) += gptimers.o | 20 | obj-$(CONFIG_BFIN_GPTIMERS) += gptimers.o |
23 | obj-$(CONFIG_CPLB_INFO) += cplbinfo.o | 21 | obj-$(CONFIG_CPLB_INFO) += cplbinfo.o |
24 | obj-$(CONFIG_MODULES) += module.o | 22 | obj-$(CONFIG_MODULES) += module.o |
25 | obj-$(CONFIG_KGDB) += kgdb.o | 23 | obj-$(CONFIG_KGDB) += kgdb.o |
26 | obj-$(CONFIG_KGDB_TESTCASE) += kgdb_test.o | 24 | obj-$(CONFIG_KGDB_TESTS) += kgdb_test.o |
27 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 25 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
26 | |||
27 | # the kgdb test puts code into L2 and without linker | ||
28 | # relaxation, we need to force long calls to/from it | ||
29 | CFLAGS_kgdb_test.o := -mlong-calls -O0 | ||
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c index 0e28f7595733..d6c067782e63 100644 --- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c +++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c | |||
@@ -53,9 +53,13 @@ void __init generate_cplb_tables_cpu(unsigned int cpu) | |||
53 | 53 | ||
54 | i_d = i_i = 0; | 54 | i_d = i_i = 0; |
55 | 55 | ||
56 | #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO | ||
56 | /* Set up the zero page. */ | 57 | /* Set up the zero page. */ |
57 | d_tbl[i_d].addr = 0; | 58 | d_tbl[i_d].addr = 0; |
58 | d_tbl[i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB; | 59 | d_tbl[i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB; |
60 | i_tbl[i_i].addr = 0; | ||
61 | i_tbl[i_i++].data = SDRAM_OOPS | PAGE_SIZE_1KB; | ||
62 | #endif | ||
59 | 63 | ||
60 | /* Cover kernel memory with 4M pages. */ | 64 | /* Cover kernel memory with 4M pages. */ |
61 | addr = 0; | 65 | addr = 0; |
diff --git a/arch/blackfin/kernel/ipipe.c b/arch/blackfin/kernel/ipipe.c index 339be5a3ae6a..a5de8d45424c 100644 --- a/arch/blackfin/kernel/ipipe.c +++ b/arch/blackfin/kernel/ipipe.c | |||
@@ -35,14 +35,8 @@ | |||
35 | #include <asm/atomic.h> | 35 | #include <asm/atomic.h> |
36 | #include <asm/io.h> | 36 | #include <asm/io.h> |
37 | 37 | ||
38 | static int create_irq_threads; | ||
39 | |||
40 | DEFINE_PER_CPU(struct pt_regs, __ipipe_tick_regs); | 38 | DEFINE_PER_CPU(struct pt_regs, __ipipe_tick_regs); |
41 | 39 | ||
42 | static DEFINE_PER_CPU(unsigned long, pending_irqthread_mask); | ||
43 | |||
44 | static DEFINE_PER_CPU(int [IVG13 + 1], pending_irq_count); | ||
45 | |||
46 | asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs); | 40 | asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs); |
47 | 41 | ||
48 | static void __ipipe_no_irqtail(void); | 42 | static void __ipipe_no_irqtail(void); |
@@ -93,6 +87,7 @@ void __ipipe_enable_pipeline(void) | |||
93 | */ | 87 | */ |
94 | void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs) | 88 | void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs) |
95 | { | 89 | { |
90 | struct ipipe_percpu_domain_data *p = ipipe_root_cpudom_ptr(); | ||
96 | struct ipipe_domain *this_domain, *next_domain; | 91 | struct ipipe_domain *this_domain, *next_domain; |
97 | struct list_head *head, *pos; | 92 | struct list_head *head, *pos; |
98 | int m_ack, s = -1; | 93 | int m_ack, s = -1; |
@@ -104,7 +99,6 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs) | |||
104 | * interrupt. | 99 | * interrupt. |
105 | */ | 100 | */ |
106 | m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR); | 101 | m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR); |
107 | |||
108 | this_domain = ipipe_current_domain; | 102 | this_domain = ipipe_current_domain; |
109 | 103 | ||
110 | if (unlikely(test_bit(IPIPE_STICKY_FLAG, &this_domain->irqs[irq].control))) | 104 | if (unlikely(test_bit(IPIPE_STICKY_FLAG, &this_domain->irqs[irq].control))) |
@@ -114,49 +108,28 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs) | |||
114 | next_domain = list_entry(head, struct ipipe_domain, p_link); | 108 | next_domain = list_entry(head, struct ipipe_domain, p_link); |
115 | if (likely(test_bit(IPIPE_WIRED_FLAG, &next_domain->irqs[irq].control))) { | 109 | if (likely(test_bit(IPIPE_WIRED_FLAG, &next_domain->irqs[irq].control))) { |
116 | if (!m_ack && next_domain->irqs[irq].acknowledge != NULL) | 110 | if (!m_ack && next_domain->irqs[irq].acknowledge != NULL) |
117 | next_domain->irqs[irq].acknowledge(irq, irq_desc + irq); | 111 | next_domain->irqs[irq].acknowledge(irq, irq_to_desc(irq)); |
118 | if (test_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags)) | 112 | if (test_bit(IPIPE_SYNCDEFER_FLAG, &p->status)) |
119 | s = __test_and_set_bit(IPIPE_STALL_FLAG, | 113 | s = __test_and_set_bit(IPIPE_STALL_FLAG, &p->status); |
120 | &ipipe_root_cpudom_var(status)); | ||
121 | __ipipe_dispatch_wired(next_domain, irq); | 114 | __ipipe_dispatch_wired(next_domain, irq); |
122 | goto finalize; | 115 | goto out; |
123 | return; | ||
124 | } | 116 | } |
125 | } | 117 | } |
126 | 118 | ||
127 | /* Ack the interrupt. */ | 119 | /* Ack the interrupt. */ |
128 | 120 | ||
129 | pos = head; | 121 | pos = head; |
130 | |||
131 | while (pos != &__ipipe_pipeline) { | 122 | while (pos != &__ipipe_pipeline) { |
132 | next_domain = list_entry(pos, struct ipipe_domain, p_link); | 123 | next_domain = list_entry(pos, struct ipipe_domain, p_link); |
133 | /* | ||
134 | * For each domain handling the incoming IRQ, mark it | ||
135 | * as pending in its log. | ||
136 | */ | ||
137 | if (test_bit(IPIPE_HANDLE_FLAG, &next_domain->irqs[irq].control)) { | 124 | if (test_bit(IPIPE_HANDLE_FLAG, &next_domain->irqs[irq].control)) { |
138 | /* | ||
139 | * Domains that handle this IRQ are polled for | ||
140 | * acknowledging it by decreasing priority | ||
141 | * order. The interrupt must be made pending | ||
142 | * _first_ in the domain's status flags before | ||
143 | * the PIC is unlocked. | ||
144 | */ | ||
145 | __ipipe_set_irq_pending(next_domain, irq); | 125 | __ipipe_set_irq_pending(next_domain, irq); |
146 | |||
147 | if (!m_ack && next_domain->irqs[irq].acknowledge != NULL) { | 126 | if (!m_ack && next_domain->irqs[irq].acknowledge != NULL) { |
148 | next_domain->irqs[irq].acknowledge(irq, irq_desc + irq); | 127 | next_domain->irqs[irq].acknowledge(irq, irq_to_desc(irq)); |
149 | m_ack = 1; | 128 | m_ack = 1; |
150 | } | 129 | } |
151 | } | 130 | } |
152 | |||
153 | /* | ||
154 | * If the domain does not want the IRQ to be passed | ||
155 | * down the interrupt pipe, exit the loop now. | ||
156 | */ | ||
157 | if (!test_bit(IPIPE_PASS_FLAG, &next_domain->irqs[irq].control)) | 131 | if (!test_bit(IPIPE_PASS_FLAG, &next_domain->irqs[irq].control)) |
158 | break; | 132 | break; |
159 | |||
160 | pos = next_domain->p_link.next; | 133 | pos = next_domain->p_link.next; |
161 | } | 134 | } |
162 | 135 | ||
@@ -166,18 +139,24 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs) | |||
166 | * immediately to the current domain if the interrupt has been | 139 | * immediately to the current domain if the interrupt has been |
167 | * marked as 'sticky'. This search does not go beyond the | 140 | * marked as 'sticky'. This search does not go beyond the |
168 | * current domain in the pipeline. We also enforce the | 141 | * current domain in the pipeline. We also enforce the |
169 | * additional root stage lock (blackfin-specific). */ | 142 | * additional root stage lock (blackfin-specific). |
143 | */ | ||
144 | if (test_bit(IPIPE_SYNCDEFER_FLAG, &p->status)) | ||
145 | s = __test_and_set_bit(IPIPE_STALL_FLAG, &p->status); | ||
170 | 146 | ||
171 | if (test_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags)) | 147 | /* |
172 | s = __test_and_set_bit(IPIPE_STALL_FLAG, | 148 | * If the interrupt preempted the head domain, then do not |
173 | &ipipe_root_cpudom_var(status)); | 149 | * even try to walk the pipeline, unless an interrupt is |
174 | finalize: | 150 | * pending for it. |
151 | */ | ||
152 | if (test_bit(IPIPE_AHEAD_FLAG, &this_domain->flags) && | ||
153 | ipipe_head_cpudom_var(irqpend_himask) == 0) | ||
154 | goto out; | ||
175 | 155 | ||
176 | __ipipe_walk_pipeline(head); | 156 | __ipipe_walk_pipeline(head); |
177 | 157 | out: | |
178 | if (!s) | 158 | if (!s) |
179 | __clear_bit(IPIPE_STALL_FLAG, | 159 | __clear_bit(IPIPE_STALL_FLAG, &p->status); |
180 | &ipipe_root_cpudom_var(status)); | ||
181 | } | 160 | } |
182 | 161 | ||
183 | int __ipipe_check_root(void) | 162 | int __ipipe_check_root(void) |
@@ -187,7 +166,7 @@ int __ipipe_check_root(void) | |||
187 | 166 | ||
188 | void __ipipe_enable_irqdesc(struct ipipe_domain *ipd, unsigned irq) | 167 | void __ipipe_enable_irqdesc(struct ipipe_domain *ipd, unsigned irq) |
189 | { | 168 | { |
190 | struct irq_desc *desc = irq_desc + irq; | 169 | struct irq_desc *desc = irq_to_desc(irq); |
191 | int prio = desc->ic_prio; | 170 | int prio = desc->ic_prio; |
192 | 171 | ||
193 | desc->depth = 0; | 172 | desc->depth = 0; |
@@ -199,7 +178,7 @@ EXPORT_SYMBOL(__ipipe_enable_irqdesc); | |||
199 | 178 | ||
200 | void __ipipe_disable_irqdesc(struct ipipe_domain *ipd, unsigned irq) | 179 | void __ipipe_disable_irqdesc(struct ipipe_domain *ipd, unsigned irq) |
201 | { | 180 | { |
202 | struct irq_desc *desc = irq_desc + irq; | 181 | struct irq_desc *desc = irq_to_desc(irq); |
203 | int prio = desc->ic_prio; | 182 | int prio = desc->ic_prio; |
204 | 183 | ||
205 | if (ipd != &ipipe_root && | 184 | if (ipd != &ipipe_root && |
@@ -236,15 +215,18 @@ int __ipipe_syscall_root(struct pt_regs *regs) | |||
236 | { | 215 | { |
237 | unsigned long flags; | 216 | unsigned long flags; |
238 | 217 | ||
239 | /* We need to run the IRQ tail hook whenever we don't | 218 | /* |
219 | * We need to run the IRQ tail hook whenever we don't | ||
240 | * propagate a syscall to higher domains, because we know that | 220 | * propagate a syscall to higher domains, because we know that |
241 | * important operations might be pending there (e.g. Xenomai | 221 | * important operations might be pending there (e.g. Xenomai |
242 | * deferred rescheduling). */ | 222 | * deferred rescheduling). |
223 | */ | ||
243 | 224 | ||
244 | if (!__ipipe_syscall_watched_p(current, regs->orig_p0)) { | 225 | if (regs->orig_p0 < NR_syscalls) { |
245 | void (*hook)(void) = (void (*)(void))__ipipe_irq_tail_hook; | 226 | void (*hook)(void) = (void (*)(void))__ipipe_irq_tail_hook; |
246 | hook(); | 227 | hook(); |
247 | return 0; | 228 | if ((current->flags & PF_EVNOTIFY) == 0) |
229 | return 0; | ||
248 | } | 230 | } |
249 | 231 | ||
250 | /* | 232 | /* |
@@ -312,112 +294,46 @@ int ipipe_trigger_irq(unsigned irq) | |||
312 | { | 294 | { |
313 | unsigned long flags; | 295 | unsigned long flags; |
314 | 296 | ||
297 | #ifdef CONFIG_IPIPE_DEBUG | ||
315 | if (irq >= IPIPE_NR_IRQS || | 298 | if (irq >= IPIPE_NR_IRQS || |
316 | (ipipe_virtual_irq_p(irq) | 299 | (ipipe_virtual_irq_p(irq) |
317 | && !test_bit(irq - IPIPE_VIRQ_BASE, &__ipipe_virtual_irq_map))) | 300 | && !test_bit(irq - IPIPE_VIRQ_BASE, &__ipipe_virtual_irq_map))) |
318 | return -EINVAL; | 301 | return -EINVAL; |
302 | #endif | ||
319 | 303 | ||
320 | local_irq_save_hw(flags); | 304 | local_irq_save_hw(flags); |
321 | |||
322 | __ipipe_handle_irq(irq, NULL); | 305 | __ipipe_handle_irq(irq, NULL); |
323 | |||
324 | local_irq_restore_hw(flags); | 306 | local_irq_restore_hw(flags); |
325 | 307 | ||
326 | return 1; | 308 | return 1; |
327 | } | 309 | } |
328 | 310 | ||
329 | /* Move Linux IRQ to threads. */ | 311 | asmlinkage void __ipipe_sync_root(void) |
330 | |||
331 | static int do_irqd(void *__desc) | ||
332 | { | 312 | { |
333 | struct irq_desc *desc = __desc; | 313 | unsigned long flags; |
334 | unsigned irq = desc - irq_desc; | ||
335 | int thrprio = desc->thr_prio; | ||
336 | int thrmask = 1 << thrprio; | ||
337 | int cpu = smp_processor_id(); | ||
338 | cpumask_t cpumask; | ||
339 | |||
340 | sigfillset(¤t->blocked); | ||
341 | current->flags |= PF_NOFREEZE; | ||
342 | cpumask = cpumask_of_cpu(cpu); | ||
343 | set_cpus_allowed(current, cpumask); | ||
344 | ipipe_setscheduler_root(current, SCHED_FIFO, 50 + thrprio); | ||
345 | |||
346 | while (!kthread_should_stop()) { | ||
347 | local_irq_disable(); | ||
348 | if (!(desc->status & IRQ_SCHEDULED)) { | ||
349 | set_current_state(TASK_INTERRUPTIBLE); | ||
350 | resched: | ||
351 | local_irq_enable(); | ||
352 | schedule(); | ||
353 | local_irq_disable(); | ||
354 | } | ||
355 | __set_current_state(TASK_RUNNING); | ||
356 | /* | ||
357 | * If higher priority interrupt servers are ready to | ||
358 | * run, reschedule immediately. We need this for the | ||
359 | * GPIO demux IRQ handler to unmask the interrupt line | ||
360 | * _last_, after all GPIO IRQs have run. | ||
361 | */ | ||
362 | if (per_cpu(pending_irqthread_mask, cpu) & ~(thrmask|(thrmask-1))) | ||
363 | goto resched; | ||
364 | if (--per_cpu(pending_irq_count[thrprio], cpu) == 0) | ||
365 | per_cpu(pending_irqthread_mask, cpu) &= ~thrmask; | ||
366 | desc->status &= ~IRQ_SCHEDULED; | ||
367 | desc->thr_handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs)); | ||
368 | local_irq_enable(); | ||
369 | } | ||
370 | __set_current_state(TASK_RUNNING); | ||
371 | return 0; | ||
372 | } | ||
373 | 314 | ||
374 | static void kick_irqd(unsigned irq, void *cookie) | 315 | BUG_ON(irqs_disabled()); |
375 | { | ||
376 | struct irq_desc *desc = irq_desc + irq; | ||
377 | int thrprio = desc->thr_prio; | ||
378 | int thrmask = 1 << thrprio; | ||
379 | int cpu = smp_processor_id(); | ||
380 | |||
381 | if (!(desc->status & IRQ_SCHEDULED)) { | ||
382 | desc->status |= IRQ_SCHEDULED; | ||
383 | per_cpu(pending_irqthread_mask, cpu) |= thrmask; | ||
384 | ++per_cpu(pending_irq_count[thrprio], cpu); | ||
385 | wake_up_process(desc->thread); | ||
386 | } | ||
387 | } | ||
388 | 316 | ||
389 | int ipipe_start_irq_thread(unsigned irq, struct irq_desc *desc) | 317 | local_irq_save_hw(flags); |
390 | { | ||
391 | if (desc->thread || !create_irq_threads) | ||
392 | return 0; | ||
393 | |||
394 | desc->thread = kthread_create(do_irqd, desc, "IRQ %d", irq); | ||
395 | if (desc->thread == NULL) { | ||
396 | printk(KERN_ERR "irqd: could not create IRQ thread %d!\n", irq); | ||
397 | return -ENOMEM; | ||
398 | } | ||
399 | 318 | ||
400 | wake_up_process(desc->thread); | 319 | clear_thread_flag(TIF_IRQ_SYNC); |
401 | 320 | ||
402 | desc->thr_handler = ipipe_root_domain->irqs[irq].handler; | 321 | if (ipipe_root_cpudom_var(irqpend_himask) != 0) |
403 | ipipe_root_domain->irqs[irq].handler = &kick_irqd; | 322 | __ipipe_sync_pipeline(IPIPE_IRQMASK_ANY); |
404 | 323 | ||
405 | return 0; | 324 | local_irq_restore_hw(flags); |
406 | } | 325 | } |
407 | 326 | ||
408 | void __init ipipe_init_irq_threads(void) | 327 | void ___ipipe_sync_pipeline(unsigned long syncmask) |
409 | { | 328 | { |
410 | unsigned irq; | 329 | struct ipipe_domain *ipd = ipipe_current_domain; |
411 | struct irq_desc *desc; | ||
412 | |||
413 | create_irq_threads = 1; | ||
414 | 330 | ||
415 | for (irq = 0; irq < NR_IRQS; irq++) { | 331 | if (ipd == ipipe_root_domain) { |
416 | desc = irq_desc + irq; | 332 | if (test_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status))) |
417 | if (desc->action != NULL || | 333 | return; |
418 | (desc->status & IRQ_NOREQUEST) != 0) | ||
419 | ipipe_start_irq_thread(irq, desc); | ||
420 | } | 334 | } |
335 | |||
336 | __ipipe_sync_stage(syncmask); | ||
421 | } | 337 | } |
422 | 338 | ||
423 | EXPORT_SYMBOL(show_stack); | 339 | EXPORT_SYMBOL(show_stack); |
diff --git a/arch/blackfin/kernel/irqchip.c b/arch/blackfin/kernel/irqchip.c index 75724eee6494..7fd126564846 100644 --- a/arch/blackfin/kernel/irqchip.c +++ b/arch/blackfin/kernel/irqchip.c | |||
@@ -144,11 +144,15 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) | |||
144 | #endif | 144 | #endif |
145 | generic_handle_irq(irq); | 145 | generic_handle_irq(irq); |
146 | 146 | ||
147 | #ifndef CONFIG_IPIPE /* Useless and bugous over the I-pipe: IRQs are threaded. */ | 147 | #ifndef CONFIG_IPIPE |
148 | /* If we're the only interrupt running (ignoring IRQ15 which is for | 148 | /* |
149 | syscalls), lower our priority to IRQ14 so that softirqs run at | 149 | * If we're the only interrupt running (ignoring IRQ15 which |
150 | that level. If there's another, lower-level interrupt, irq_exit | 150 | * is for syscalls), lower our priority to IRQ14 so that |
151 | will defer softirqs to that. */ | 151 | * softirqs run at that level. If there's another, |
152 | * lower-level interrupt, irq_exit will defer softirqs to | ||
153 | * that. If the interrupt pipeline is enabled, we are already | ||
154 | * running at IRQ14 priority, so we don't need this code. | ||
155 | */ | ||
152 | CSYNC(); | 156 | CSYNC(); |
153 | pending = bfin_read_IPEND() & ~0x8000; | 157 | pending = bfin_read_IPEND() & ~0x8000; |
154 | other_ints = pending & (pending - 1); | 158 | other_ints = pending & (pending - 1); |
diff --git a/arch/blackfin/kernel/kgdb_test.c b/arch/blackfin/kernel/kgdb_test.c index 3dba9c17304a..dbcf3e45cb0b 100644 --- a/arch/blackfin/kernel/kgdb_test.c +++ b/arch/blackfin/kernel/kgdb_test.c | |||
@@ -20,6 +20,7 @@ | |||
20 | static char cmdline[256]; | 20 | static char cmdline[256]; |
21 | static unsigned long len; | 21 | static unsigned long len; |
22 | 22 | ||
23 | #ifndef CONFIG_SMP | ||
23 | static int num1 __attribute__((l1_data)); | 24 | static int num1 __attribute__((l1_data)); |
24 | 25 | ||
25 | void kgdb_l1_test(void) __attribute__((l1_text)); | 26 | void kgdb_l1_test(void) __attribute__((l1_text)); |
@@ -32,6 +33,8 @@ void kgdb_l1_test(void) | |||
32 | printk(KERN_ALERT "L1(after change) : data variable addr = 0x%p, data value is %d\n", &num1, num1); | 33 | printk(KERN_ALERT "L1(after change) : data variable addr = 0x%p, data value is %d\n", &num1, num1); |
33 | return ; | 34 | return ; |
34 | } | 35 | } |
36 | #endif | ||
37 | |||
35 | #if L2_LENGTH | 38 | #if L2_LENGTH |
36 | 39 | ||
37 | static int num2 __attribute__((l2)); | 40 | static int num2 __attribute__((l2)); |
@@ -59,10 +62,12 @@ int kgdb_test(char *name, int len, int count, int z) | |||
59 | static int test_proc_output(char *buf) | 62 | static int test_proc_output(char *buf) |
60 | { | 63 | { |
61 | kgdb_test("hello world!", 12, 0x55, 0x10); | 64 | kgdb_test("hello world!", 12, 0x55, 0x10); |
65 | #ifndef CONFIG_SMP | ||
62 | kgdb_l1_test(); | 66 | kgdb_l1_test(); |
63 | #if L2_LENGTH | 67 | #endif |
68 | #if L2_LENGTH | ||
64 | kgdb_l2_test(); | 69 | kgdb_l2_test(); |
65 | #endif | 70 | #endif |
66 | 71 | ||
67 | return 0; | 72 | return 0; |
68 | } | 73 | } |
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c index 594e325b40e4..d76618db50df 100644 --- a/arch/blackfin/kernel/ptrace.c +++ b/arch/blackfin/kernel/ptrace.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <asm/asm-offsets.h> | 45 | #include <asm/asm-offsets.h> |
46 | #include <asm/dma.h> | 46 | #include <asm/dma.h> |
47 | #include <asm/fixed_code.h> | 47 | #include <asm/fixed_code.h> |
48 | #include <asm/cacheflush.h> | ||
48 | #include <asm/mem_map.h> | 49 | #include <asm/mem_map.h> |
49 | 50 | ||
50 | #define TEXT_OFFSET 0 | 51 | #define TEXT_OFFSET 0 |
@@ -240,7 +241,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
240 | 241 | ||
241 | } else if (addr >= FIXED_CODE_START | 242 | } else if (addr >= FIXED_CODE_START |
242 | && addr + sizeof(tmp) <= FIXED_CODE_END) { | 243 | && addr + sizeof(tmp) <= FIXED_CODE_END) { |
243 | memcpy(&tmp, (const void *)(addr), sizeof(tmp)); | 244 | copy_from_user_page(0, 0, 0, &tmp, (const void *)(addr), sizeof(tmp)); |
244 | copied = sizeof(tmp); | 245 | copied = sizeof(tmp); |
245 | 246 | ||
246 | } else | 247 | } else |
@@ -320,7 +321,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
320 | 321 | ||
321 | } else if (addr >= FIXED_CODE_START | 322 | } else if (addr >= FIXED_CODE_START |
322 | && addr + sizeof(data) <= FIXED_CODE_END) { | 323 | && addr + sizeof(data) <= FIXED_CODE_END) { |
323 | memcpy((void *)(addr), &data, sizeof(data)); | 324 | copy_to_user_page(0, 0, 0, (void *)(addr), &data, sizeof(data)); |
324 | copied = sizeof(data); | 325 | copied = sizeof(data); |
325 | 326 | ||
326 | } else | 327 | } else |
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index e5c116230800..a58687bdee6a 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c | |||
@@ -889,6 +889,10 @@ void __init setup_arch(char **cmdline_p) | |||
889 | CPU, bfin_revid()); | 889 | CPU, bfin_revid()); |
890 | } | 890 | } |
891 | 891 | ||
892 | /* We can't run on BF548-0.1 due to ANOMALY 05000448 */ | ||
893 | if (bfin_cpuid() == 0x27de && bfin_revid() == 1) | ||
894 | panic("You can't run on this processor due to 05000448\n"); | ||
895 | |||
892 | printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); | 896 | printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); |
893 | 897 | ||
894 | printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n", | 898 | printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n", |
@@ -1141,12 +1145,12 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
1141 | icache_size = 0; | 1145 | icache_size = 0; |
1142 | 1146 | ||
1143 | seq_printf(m, "cache size\t: %d KB(L1 icache) " | 1147 | seq_printf(m, "cache size\t: %d KB(L1 icache) " |
1144 | "%d KB(L1 dcache-%s) %d KB(L2 cache)\n", | 1148 | "%d KB(L1 dcache%s) %d KB(L2 cache)\n", |
1145 | icache_size, dcache_size, | 1149 | icache_size, dcache_size, |
1146 | #if defined CONFIG_BFIN_WB | 1150 | #if defined CONFIG_BFIN_WB |
1147 | "wb" | 1151 | "-wb" |
1148 | #elif defined CONFIG_BFIN_WT | 1152 | #elif defined CONFIG_BFIN_WT |
1149 | "wt" | 1153 | "-wt" |
1150 | #endif | 1154 | #endif |
1151 | "", 0); | 1155 | "", 0); |
1152 | 1156 | ||
diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c index 172b4c588467..1bbacfbd4c5d 100644 --- a/arch/blackfin/kernel/time.c +++ b/arch/blackfin/kernel/time.c | |||
@@ -134,7 +134,10 @@ irqreturn_t timer_interrupt(int irq, void *dummy) | |||
134 | 134 | ||
135 | write_seqlock(&xtime_lock); | 135 | write_seqlock(&xtime_lock); |
136 | #if defined(CONFIG_TICK_SOURCE_SYSTMR0) && !defined(CONFIG_IPIPE) | 136 | #if defined(CONFIG_TICK_SOURCE_SYSTMR0) && !defined(CONFIG_IPIPE) |
137 | /* FIXME: Here TIMIL0 is not set when IPIPE enabled, why? */ | 137 | /* |
138 | * TIMIL0 is latched in __ipipe_grab_irq() when the I-Pipe is | ||
139 | * enabled. | ||
140 | */ | ||
138 | if (get_gptimer_status(0) & TIMER_STATUS_TIMIL0) { | 141 | if (get_gptimer_status(0) & TIMER_STATUS_TIMIL0) { |
139 | #endif | 142 | #endif |
140 | do_timer(1); | 143 | do_timer(1); |
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c index 0e175342112e..41f2eacfef20 100644 --- a/arch/blackfin/mach-bf518/boards/ezbrd.c +++ b/arch/blackfin/mach-bf518/boards/ezbrd.c | |||
@@ -113,7 +113,6 @@ static struct platform_device bfin_mac_device = { | |||
113 | .name = "bfin_mac", | 113 | .name = "bfin_mac", |
114 | .dev.platform_data = &bfin_mii_bus, | 114 | .dev.platform_data = &bfin_mii_bus, |
115 | }; | 115 | }; |
116 | #endif | ||
117 | 116 | ||
118 | #if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) | 117 | #if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) |
119 | static struct dsa_platform_data ksz8893m_switch_data = { | 118 | static struct dsa_platform_data ksz8893m_switch_data = { |
@@ -132,6 +131,7 @@ static struct platform_device ksz8893m_switch_device = { | |||
132 | .dev.platform_data = &ksz8893m_switch_data, | 131 | .dev.platform_data = &ksz8893m_switch_data, |
133 | }; | 132 | }; |
134 | #endif | 133 | #endif |
134 | #endif | ||
135 | 135 | ||
136 | #if defined(CONFIG_MTD_M25P80) \ | 136 | #if defined(CONFIG_MTD_M25P80) \ |
137 | || defined(CONFIG_MTD_M25P80_MODULE) | 137 | || defined(CONFIG_MTD_M25P80_MODULE) |
@@ -171,6 +171,7 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = { | |||
171 | }; | 171 | }; |
172 | #endif | 172 | #endif |
173 | 173 | ||
174 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | ||
174 | #if defined(CONFIG_NET_DSA_KSZ8893M) \ | 175 | #if defined(CONFIG_NET_DSA_KSZ8893M) \ |
175 | || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) | 176 | || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) |
176 | /* SPI SWITCH CHIP */ | 177 | /* SPI SWITCH CHIP */ |
@@ -179,10 +180,11 @@ static struct bfin5xx_spi_chip spi_switch_info = { | |||
179 | .bits_per_word = 8, | 180 | .bits_per_word = 8, |
180 | }; | 181 | }; |
181 | #endif | 182 | #endif |
183 | #endif | ||
182 | 184 | ||
183 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 185 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
184 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | 186 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
185 | .enable_dma = 1, | 187 | .enable_dma = 0, |
186 | .bits_per_word = 8, | 188 | .bits_per_word = 8, |
187 | }; | 189 | }; |
188 | #endif | 190 | #endif |
@@ -259,6 +261,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
259 | }, | 261 | }, |
260 | #endif | 262 | #endif |
261 | 263 | ||
264 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | ||
262 | #if defined(CONFIG_NET_DSA_KSZ8893M) \ | 265 | #if defined(CONFIG_NET_DSA_KSZ8893M) \ |
263 | || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) | 266 | || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) |
264 | { | 267 | { |
@@ -271,24 +274,15 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
271 | .mode = SPI_MODE_3, | 274 | .mode = SPI_MODE_3, |
272 | }, | 275 | }, |
273 | #endif | 276 | #endif |
277 | #endif | ||
274 | 278 | ||
275 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 279 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
276 | { | 280 | { |
277 | .modalias = "spi_mmc_dummy", | 281 | .modalias = "mmc_spi", |
278 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 282 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
279 | .bus_num = 0, | 283 | .bus_num = 0, |
280 | .chip_select = 0, | 284 | .chip_select = 5, |
281 | .platform_data = NULL, | 285 | .controller_data = &mmc_spi_chip_info, |
282 | .controller_data = &spi_mmc_chip_info, | ||
283 | .mode = SPI_MODE_3, | ||
284 | }, | ||
285 | { | ||
286 | .modalias = "spi_mmc", | ||
287 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
288 | .bus_num = 0, | ||
289 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | ||
290 | .platform_data = NULL, | ||
291 | .controller_data = &spi_mmc_chip_info, | ||
292 | .mode = SPI_MODE_3, | 286 | .mode = SPI_MODE_3, |
293 | }, | 287 | }, |
294 | #endif | 288 | #endif |
@@ -630,11 +624,10 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
630 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | 624 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
631 | &bfin_mii_bus, | 625 | &bfin_mii_bus, |
632 | &bfin_mac_device, | 626 | &bfin_mac_device, |
633 | #endif | ||
634 | |||
635 | #if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) | 627 | #if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) |
636 | &ksz8893m_switch_device, | 628 | &ksz8893m_switch_device, |
637 | #endif | 629 | #endif |
630 | #endif | ||
638 | 631 | ||
639 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 632 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
640 | &bfin_spi0_device, | 633 | &bfin_spi0_device, |
diff --git a/arch/blackfin/mach-bf518/include/mach/anomaly.h b/arch/blackfin/mach-bf518/include/mach/anomaly.h index e5b4bef0edae..c847bb101076 100644 --- a/arch/blackfin/mach-bf518/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf518/include/mach/anomaly.h | |||
@@ -2,12 +2,12 @@ | |||
2 | * File: include/asm-blackfin/mach-bf518/anomaly.h | 2 | * File: include/asm-blackfin/mach-bf518/anomaly.h |
3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
4 | * | 4 | * |
5 | * Copyright (C) 2004-2008 Analog Devices Inc. | 5 | * Copyright (C) 2004-2009 Analog Devices Inc. |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | /* This file shoule be up to date with: | 9 | /* This file shoule be up to date with: |
10 | * - ???? | 10 | * - Revision B, 02/03/2009; ADSP-BF512/BF514/BF516/BF518 Blackfin Processor Anomaly List |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef _MACH_ANOMALY_H_ | 13 | #ifndef _MACH_ANOMALY_H_ |
@@ -19,6 +19,8 @@ | |||
19 | #define ANOMALY_05000122 (1) | 19 | #define ANOMALY_05000122 (1) |
20 | /* False Hardware Error from an Access in the Shadow of a Conditional Branch */ | 20 | /* False Hardware Error from an Access in the Shadow of a Conditional Branch */ |
21 | #define ANOMALY_05000245 (1) | 21 | #define ANOMALY_05000245 (1) |
22 | /* Incorrect Timer Pulse Width in Single-Shot PWM_OUT Mode with External Clock */ | ||
23 | #define ANOMALY_05000254 (1) | ||
22 | /* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */ | 24 | /* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */ |
23 | #define ANOMALY_05000265 (1) | 25 | #define ANOMALY_05000265 (1) |
24 | /* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */ | 26 | /* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */ |
@@ -53,6 +55,12 @@ | |||
53 | #define ANOMALY_05000443 (1) | 55 | #define ANOMALY_05000443 (1) |
54 | /* Incorrect L1 Instruction Bank B Memory Map Location */ | 56 | /* Incorrect L1 Instruction Bank B Memory Map Location */ |
55 | #define ANOMALY_05000444 (1) | 57 | #define ANOMALY_05000444 (1) |
58 | /* Incorrect Default Hysteresis Setting for RESET, NMI, and BMODE Signals */ | ||
59 | #define ANOMALY_05000452 (1) | ||
60 | /* PWM_TRIPB Signal Not Available on PG10 */ | ||
61 | #define ANOMALY_05000453 (1) | ||
62 | /* PPI_FS3 is Driven One Half Cycle Later Than PPI Data */ | ||
63 | #define ANOMALY_05000455 (1) | ||
56 | 64 | ||
57 | /* Anomalies that don't exist on this proc */ | 65 | /* Anomalies that don't exist on this proc */ |
58 | #define ANOMALY_05000125 (0) | 66 | #define ANOMALY_05000125 (0) |
@@ -65,15 +73,20 @@ | |||
65 | #define ANOMALY_05000263 (0) | 73 | #define ANOMALY_05000263 (0) |
66 | #define ANOMALY_05000266 (0) | 74 | #define ANOMALY_05000266 (0) |
67 | #define ANOMALY_05000273 (0) | 75 | #define ANOMALY_05000273 (0) |
76 | #define ANOMALY_05000278 (0) | ||
68 | #define ANOMALY_05000285 (0) | 77 | #define ANOMALY_05000285 (0) |
78 | #define ANOMALY_05000305 (0) | ||
69 | #define ANOMALY_05000307 (0) | 79 | #define ANOMALY_05000307 (0) |
70 | #define ANOMALY_05000311 (0) | 80 | #define ANOMALY_05000311 (0) |
71 | #define ANOMALY_05000312 (0) | 81 | #define ANOMALY_05000312 (0) |
72 | #define ANOMALY_05000323 (0) | 82 | #define ANOMALY_05000323 (0) |
73 | #define ANOMALY_05000353 (0) | 83 | #define ANOMALY_05000353 (0) |
74 | #define ANOMALY_05000363 (0) | 84 | #define ANOMALY_05000363 (0) |
85 | #define ANOMALY_05000380 (0) | ||
75 | #define ANOMALY_05000386 (0) | 86 | #define ANOMALY_05000386 (0) |
76 | #define ANOMALY_05000412 (0) | 87 | #define ANOMALY_05000412 (0) |
77 | #define ANOMALY_05000432 (0) | 88 | #define ANOMALY_05000432 (0) |
89 | #define ANOMALY_05000447 (0) | ||
90 | #define ANOMALY_05000448 (0) | ||
78 | 91 | ||
79 | #endif | 92 | #endif |
diff --git a/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h index b50a63b975a2..e21c1c3e4ec7 100644 --- a/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h +++ b/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h | |||
@@ -144,7 +144,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
144 | CH_UART0_TX, | 144 | CH_UART0_TX, |
145 | CH_UART0_RX, | 145 | CH_UART0_RX, |
146 | #endif | 146 | #endif |
147 | #ifdef CONFIG_BFIN_UART0_CTSRTS | 147 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
148 | CONFIG_UART0_CTS_PIN, | 148 | CONFIG_UART0_CTS_PIN, |
149 | CONFIG_UART0_RTS_PIN, | 149 | CONFIG_UART0_RTS_PIN, |
150 | #endif | 150 | #endif |
@@ -158,7 +158,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
158 | CH_UART1_TX, | 158 | CH_UART1_TX, |
159 | CH_UART1_RX, | 159 | CH_UART1_RX, |
160 | #endif | 160 | #endif |
161 | #ifdef CONFIG_BFIN_UART1_CTSRTS | 161 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
162 | CONFIG_UART1_CTS_PIN, | 162 | CONFIG_UART1_CTS_PIN, |
163 | CONFIG_UART1_RTS_PIN, | 163 | CONFIG_UART1_RTS_PIN, |
164 | #endif | 164 | #endif |
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c index 856c097b5317..48e69eecdba4 100644 --- a/arch/blackfin/mach-bf527/boards/cm_bf527.c +++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c | |||
@@ -487,9 +487,9 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = { | |||
487 | }; | 487 | }; |
488 | #endif | 488 | #endif |
489 | 489 | ||
490 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 490 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
491 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | 491 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
492 | .enable_dma = 1, | 492 | .enable_dma = 0, |
493 | .bits_per_word = 8, | 493 | .bits_per_word = 8, |
494 | }; | 494 | }; |
495 | #endif | 495 | #endif |
@@ -585,23 +585,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
585 | .controller_data = &ad9960_spi_chip_info, | 585 | .controller_data = &ad9960_spi_chip_info, |
586 | }, | 586 | }, |
587 | #endif | 587 | #endif |
588 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 588 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
589 | { | 589 | { |
590 | .modalias = "spi_mmc_dummy", | 590 | .modalias = "mmc_spi", |
591 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 591 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
592 | .bus_num = 0, | ||
593 | .chip_select = 0, | ||
594 | .platform_data = NULL, | ||
595 | .controller_data = &spi_mmc_chip_info, | ||
596 | .mode = SPI_MODE_3, | ||
597 | }, | ||
598 | { | ||
599 | .modalias = "spi_mmc", | ||
600 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
601 | .bus_num = 0, | 592 | .bus_num = 0, |
602 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 593 | .chip_select = 5, |
603 | .platform_data = NULL, | 594 | .controller_data = &mmc_spi_chip_info, |
604 | .controller_data = &spi_mmc_chip_info, | ||
605 | .mode = SPI_MODE_3, | 595 | .mode = SPI_MODE_3, |
606 | }, | 596 | }, |
607 | #endif | 597 | #endif |
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c index 83606fcdde27..7fe480e4ebe8 100644 --- a/arch/blackfin/mach-bf527/boards/ezbrd.c +++ b/arch/blackfin/mach-bf527/boards/ezbrd.c | |||
@@ -256,9 +256,9 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = { | |||
256 | }; | 256 | }; |
257 | #endif | 257 | #endif |
258 | 258 | ||
259 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 259 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
260 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | 260 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
261 | .enable_dma = 1, | 261 | .enable_dma = 0, |
262 | .bits_per_word = 8, | 262 | .bits_per_word = 8, |
263 | }; | 263 | }; |
264 | #endif | 264 | #endif |
@@ -366,23 +366,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
366 | }, | 366 | }, |
367 | #endif | 367 | #endif |
368 | 368 | ||
369 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 369 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
370 | { | 370 | { |
371 | .modalias = "spi_mmc_dummy", | 371 | .modalias = "mmc_spi", |
372 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 372 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
373 | .bus_num = 0, | 373 | .bus_num = 0, |
374 | .chip_select = 0, | 374 | .chip_select = 5, |
375 | .platform_data = NULL, | 375 | .controller_data = &mmc_spi_chip_info, |
376 | .controller_data = &spi_mmc_chip_info, | ||
377 | .mode = SPI_MODE_3, | ||
378 | }, | ||
379 | { | ||
380 | .modalias = "spi_mmc", | ||
381 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
382 | .bus_num = 0, | ||
383 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | ||
384 | .platform_data = NULL, | ||
385 | .controller_data = &spi_mmc_chip_info, | ||
386 | .mode = SPI_MODE_3, | 376 | .mode = SPI_MODE_3, |
387 | }, | 377 | }, |
388 | #endif | 378 | #endif |
diff --git a/arch/blackfin/mach-bf527/include/mach/anomaly.h b/arch/blackfin/mach-bf527/include/mach/anomaly.h index 035e8d835058..df6808d8a6ef 100644 --- a/arch/blackfin/mach-bf527/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf527/include/mach/anomaly.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * File: include/asm-blackfin/mach-bf527/anomaly.h | 2 | * File: include/asm-blackfin/mach-bf527/anomaly.h |
3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
4 | * | 4 | * |
5 | * Copyright (C) 2004-2008 Analog Devices Inc. | 5 | * Copyright (C) 2004-2009 Analog Devices Inc. |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
8 | 8 | ||
@@ -167,12 +167,16 @@ | |||
167 | #define ANOMALY_05000263 (0) | 167 | #define ANOMALY_05000263 (0) |
168 | #define ANOMALY_05000266 (0) | 168 | #define ANOMALY_05000266 (0) |
169 | #define ANOMALY_05000273 (0) | 169 | #define ANOMALY_05000273 (0) |
170 | #define ANOMALY_05000278 (0) | ||
170 | #define ANOMALY_05000285 (0) | 171 | #define ANOMALY_05000285 (0) |
172 | #define ANOMALY_05000305 (0) | ||
171 | #define ANOMALY_05000307 (0) | 173 | #define ANOMALY_05000307 (0) |
172 | #define ANOMALY_05000311 (0) | 174 | #define ANOMALY_05000311 (0) |
173 | #define ANOMALY_05000312 (0) | 175 | #define ANOMALY_05000312 (0) |
174 | #define ANOMALY_05000323 (0) | 176 | #define ANOMALY_05000323 (0) |
175 | #define ANOMALY_05000363 (0) | 177 | #define ANOMALY_05000363 (0) |
176 | #define ANOMALY_05000412 (0) | 178 | #define ANOMALY_05000412 (0) |
179 | #define ANOMALY_05000447 (0) | ||
180 | #define ANOMALY_05000448 (0) | ||
177 | 181 | ||
178 | #endif | 182 | #endif |
diff --git a/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h index 75722d6008b0..e8c41fd842b5 100644 --- a/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h +++ b/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h | |||
@@ -144,7 +144,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
144 | CH_UART0_TX, | 144 | CH_UART0_TX, |
145 | CH_UART0_RX, | 145 | CH_UART0_RX, |
146 | #endif | 146 | #endif |
147 | #ifdef CONFIG_BFIN_UART0_CTSRTS | 147 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
148 | CONFIG_UART0_CTS_PIN, | 148 | CONFIG_UART0_CTS_PIN, |
149 | CONFIG_UART0_RTS_PIN, | 149 | CONFIG_UART0_RTS_PIN, |
150 | #endif | 150 | #endif |
@@ -158,7 +158,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
158 | CH_UART1_TX, | 158 | CH_UART1_TX, |
159 | CH_UART1_RX, | 159 | CH_UART1_RX, |
160 | #endif | 160 | #endif |
161 | #ifdef CONFIG_BFIN_UART1_CTSRTS | 161 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
162 | CONFIG_UART1_CTS_PIN, | 162 | CONFIG_UART1_CTS_PIN, |
163 | CONFIG_UART1_RTS_PIN, | 163 | CONFIG_UART1_RTS_PIN, |
164 | #endif | 164 | #endif |
diff --git a/arch/blackfin/mach-bf533/boards/Kconfig b/arch/blackfin/mach-bf533/boards/Kconfig index 308c98dc5aba..8d8b3e7321e6 100644 --- a/arch/blackfin/mach-bf533/boards/Kconfig +++ b/arch/blackfin/mach-bf533/boards/Kconfig | |||
@@ -38,9 +38,4 @@ config BFIN532_IP0X | |||
38 | help | 38 | help |
39 | Core support for IP04/IP04 open hardware IP-PBX. | 39 | Core support for IP04/IP04 open hardware IP-PBX. |
40 | 40 | ||
41 | config GENERIC_BF533_BOARD | ||
42 | bool "Generic" | ||
43 | help | ||
44 | Generic or Custom board support. | ||
45 | |||
46 | endchoice | 41 | endchoice |
diff --git a/arch/blackfin/mach-bf533/boards/Makefile b/arch/blackfin/mach-bf533/boards/Makefile index 9afbe72b484f..ff1e832f80d2 100644 --- a/arch/blackfin/mach-bf533/boards/Makefile +++ b/arch/blackfin/mach-bf533/boards/Makefile | |||
@@ -2,7 +2,6 @@ | |||
2 | # arch/blackfin/mach-bf533/boards/Makefile | 2 | # arch/blackfin/mach-bf533/boards/Makefile |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_GENERIC_BF533_BOARD) += generic_board.o | ||
6 | obj-$(CONFIG_BFIN533_STAMP) += stamp.o | 5 | obj-$(CONFIG_BFIN533_STAMP) += stamp.o |
7 | obj-$(CONFIG_BFIN532_IP0X) += ip0x.o | 6 | obj-$(CONFIG_BFIN532_IP0X) += ip0x.o |
8 | obj-$(CONFIG_BFIN533_EZKIT) += ezkit.o | 7 | obj-$(CONFIG_BFIN533_EZKIT) += ezkit.o |
diff --git a/arch/blackfin/mach-bf533/boards/blackstamp.c b/arch/blackfin/mach-bf533/boards/blackstamp.c index 015c18f85e7f..0765872a8ada 100644 --- a/arch/blackfin/mach-bf533/boards/blackstamp.c +++ b/arch/blackfin/mach-bf533/boards/blackstamp.c | |||
@@ -101,9 +101,9 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { | |||
101 | }; | 101 | }; |
102 | #endif | 102 | #endif |
103 | 103 | ||
104 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 104 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
105 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | 105 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
106 | .enable_dma = 1, | 106 | .enable_dma = 0, |
107 | .bits_per_word = 8, | 107 | .bits_per_word = 8, |
108 | }; | 108 | }; |
109 | #endif | 109 | #endif |
@@ -129,23 +129,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
129 | }, | 129 | }, |
130 | #endif | 130 | #endif |
131 | 131 | ||
132 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 132 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
133 | { | ||
134 | .modalias = "spi_mmc_dummy", | ||
135 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ | ||
136 | .bus_num = 0, | ||
137 | .chip_select = 0, | ||
138 | .platform_data = NULL, | ||
139 | .controller_data = &spi_mmc_chip_info, | ||
140 | .mode = SPI_MODE_3, | ||
141 | }, | ||
142 | { | 133 | { |
143 | .modalias = "spi_mmc", | 134 | .modalias = "mmc_spi", |
144 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ | 135 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
145 | .bus_num = 0, | 136 | .bus_num = 0, |
146 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 137 | .chip_select = 5, |
147 | .platform_data = NULL, | 138 | .controller_data = &mmc_spi_chip_info, |
148 | .controller_data = &spi_mmc_chip_info, | ||
149 | .mode = SPI_MODE_3, | 139 | .mode = SPI_MODE_3, |
150 | }, | 140 | }, |
151 | #endif | 141 | #endif |
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c index e7061c7e8c42..e8974878d8c2 100644 --- a/arch/blackfin/mach-bf533/boards/cm_bf533.c +++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c | |||
@@ -96,9 +96,9 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | |||
96 | }; | 96 | }; |
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 99 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
100 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | 100 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
101 | .enable_dma = 1, | 101 | .enable_dma = 0, |
102 | .bits_per_word = 8, | 102 | .bits_per_word = 8, |
103 | }; | 103 | }; |
104 | #endif | 104 | #endif |
@@ -138,23 +138,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
138 | }, | 138 | }, |
139 | #endif | 139 | #endif |
140 | 140 | ||
141 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 141 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
142 | { | ||
143 | .modalias = "spi_mmc_dummy", | ||
144 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
145 | .bus_num = 0, | ||
146 | .chip_select = 0, | ||
147 | .platform_data = NULL, | ||
148 | .controller_data = &spi_mmc_chip_info, | ||
149 | .mode = SPI_MODE_3, | ||
150 | }, | ||
151 | { | 142 | { |
152 | .modalias = "spi_mmc", | 143 | .modalias = "mmc_spi", |
153 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 144 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
154 | .bus_num = 0, | 145 | .bus_num = 0, |
155 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 146 | .chip_select = 5, |
156 | .platform_data = NULL, | 147 | .controller_data = &mmc_spi_chip_info, |
157 | .controller_data = &spi_mmc_chip_info, | ||
158 | .mode = SPI_MODE_3, | 148 | .mode = SPI_MODE_3, |
159 | }, | 149 | }, |
160 | #endif | 150 | #endif |
diff --git a/arch/blackfin/mach-bf533/boards/generic_board.c b/arch/blackfin/mach-bf533/boards/generic_board.c deleted file mode 100644 index 986eeec53b1f..000000000000 --- a/arch/blackfin/mach-bf533/boards/generic_board.c +++ /dev/null | |||
@@ -1,126 +0,0 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf533/generic_board.c | ||
3 | * Based on: arch/blackfin/mach-bf533/ezkit.c | ||
4 | * Author: Aidan Williams <aidan@nicta.com.au> | ||
5 | * | ||
6 | * Created: 2005 | ||
7 | * Description: | ||
8 | * | ||
9 | * Modified: | ||
10 | * Copyright 2005 National ICT Australia (NICTA) | ||
11 | * Copyright 2004-2006 Analog Devices Inc. | ||
12 | * | ||
13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License as published by | ||
17 | * the Free Software Foundation; either version 2 of the License, or | ||
18 | * (at your option) any later version. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, see the file COPYING, or write | ||
27 | * to the Free Software Foundation, Inc., | ||
28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
29 | */ | ||
30 | |||
31 | #include <linux/device.h> | ||
32 | #include <linux/platform_device.h> | ||
33 | #include <linux/irq.h> | ||
34 | |||
35 | /* | ||
36 | * Name the Board for the /proc/cpuinfo | ||
37 | */ | ||
38 | const char bfin_board_name[] = "UNKNOWN BOARD"; | ||
39 | |||
40 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
41 | static struct platform_device rtc_device = { | ||
42 | .name = "rtc-bfin", | ||
43 | .id = -1, | ||
44 | }; | ||
45 | #endif | ||
46 | |||
47 | /* | ||
48 | * Driver needs to know address, irq and flag pin. | ||
49 | */ | ||
50 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
51 | static struct resource smc91x_resources[] = { | ||
52 | { | ||
53 | .start = 0x20300300, | ||
54 | .end = 0x20300300 + 16, | ||
55 | .flags = IORESOURCE_MEM, | ||
56 | }, { | ||
57 | .start = IRQ_PROG_INTB, | ||
58 | .end = IRQ_PROG_INTB, | ||
59 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
60 | }, { | ||
61 | .start = IRQ_PF7, | ||
62 | .end = IRQ_PF7, | ||
63 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
64 | }, | ||
65 | }; | ||
66 | |||
67 | static struct platform_device smc91x_device = { | ||
68 | .name = "smc91x", | ||
69 | .id = 0, | ||
70 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
71 | .resource = smc91x_resources, | ||
72 | }; | ||
73 | #endif | ||
74 | |||
75 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
76 | #ifdef CONFIG_BFIN_SIR0 | ||
77 | static struct resource bfin_sir0_resources[] = { | ||
78 | { | ||
79 | .start = 0xFFC00400, | ||
80 | .end = 0xFFC004FF, | ||
81 | .flags = IORESOURCE_MEM, | ||
82 | }, | ||
83 | { | ||
84 | .start = IRQ_UART0_RX, | ||
85 | .end = IRQ_UART0_RX+1, | ||
86 | .flags = IORESOURCE_IRQ, | ||
87 | }, | ||
88 | { | ||
89 | .start = CH_UART0_RX, | ||
90 | .end = CH_UART0_RX+1, | ||
91 | .flags = IORESOURCE_DMA, | ||
92 | }, | ||
93 | }; | ||
94 | |||
95 | static struct platform_device bfin_sir0_device = { | ||
96 | .name = "bfin_sir", | ||
97 | .id = 0, | ||
98 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), | ||
99 | .resource = bfin_sir0_resources, | ||
100 | }; | ||
101 | #endif | ||
102 | #endif | ||
103 | |||
104 | static struct platform_device *generic_board_devices[] __initdata = { | ||
105 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
106 | &rtc_device, | ||
107 | #endif | ||
108 | |||
109 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
110 | &smc91x_device, | ||
111 | #endif | ||
112 | |||
113 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
114 | #ifdef CONFIG_BFIN_SIR0 | ||
115 | &bfin_sir0_device, | ||
116 | #endif | ||
117 | #endif | ||
118 | }; | ||
119 | |||
120 | static int __init generic_board_init(void) | ||
121 | { | ||
122 | printk(KERN_INFO "%s(): registering device resources\n", __func__); | ||
123 | return platform_add_devices(generic_board_devices, ARRAY_SIZE(generic_board_devices)); | ||
124 | } | ||
125 | |||
126 | arch_initcall(generic_board_init); | ||
diff --git a/arch/blackfin/mach-bf533/boards/ip0x.c b/arch/blackfin/mach-bf533/boards/ip0x.c index e30b1b7d1442..f19b63378b12 100644 --- a/arch/blackfin/mach-bf533/boards/ip0x.c +++ b/arch/blackfin/mach-bf533/boards/ip0x.c | |||
@@ -127,8 +127,8 @@ static struct platform_device dm9000_device2 = { | |||
127 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 127 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
128 | /* all SPI peripherals info goes here */ | 128 | /* all SPI peripherals info goes here */ |
129 | 129 | ||
130 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 130 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
131 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | 131 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
132 | /* | 132 | /* |
133 | * CPOL (Clock Polarity) | 133 | * CPOL (Clock Polarity) |
134 | * 0 - Active high SCK | 134 | * 0 - Active high SCK |
@@ -152,14 +152,13 @@ static struct bfin5xx_spi_chip spi_mmc_chip_info = { | |||
152 | /* Notice: for blackfin, the speed_hz is the value of register | 152 | /* Notice: for blackfin, the speed_hz is the value of register |
153 | * SPI_BAUD, not the real baudrate */ | 153 | * SPI_BAUD, not the real baudrate */ |
154 | static struct spi_board_info bfin_spi_board_info[] __initdata = { | 154 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
155 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 155 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
156 | { | 156 | { |
157 | .modalias = "spi_mmc", | 157 | .modalias = "mmc_spi", |
158 | .max_speed_hz = 2, | 158 | .max_speed_hz = 2, |
159 | .bus_num = 1, | 159 | .bus_num = 1, |
160 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 160 | .chip_select = 5, |
161 | .platform_data = NULL, | 161 | .controller_data = &mmc_spi_chip_info, |
162 | .controller_data = &spi_mmc_chip_info, | ||
163 | }, | 162 | }, |
164 | #endif | 163 | #endif |
165 | }; | 164 | }; |
diff --git a/arch/blackfin/mach-bf533/include/mach/anomaly.h b/arch/blackfin/mach-bf533/include/mach/anomaly.h index 0d3a03429fb9..1cf893e2e55b 100644 --- a/arch/blackfin/mach-bf533/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf533/include/mach/anomaly.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * File: include/asm-blackfin/mach-bf533/anomaly.h | 2 | * File: include/asm-blackfin/mach-bf533/anomaly.h |
3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
4 | * | 4 | * |
5 | * Copyright (C) 2004-2008 Analog Devices Inc. | 5 | * Copyright (C) 2004-2009 Analog Devices Inc. |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
8 | 8 | ||
@@ -160,7 +160,7 @@ | |||
160 | #define ANOMALY_05000301 (__SILICON_REVISION__ < 6) | 160 | #define ANOMALY_05000301 (__SILICON_REVISION__ < 6) |
161 | /* SSYNCs After Writes To DMA MMR Registers May Not Be Handled Correctly */ | 161 | /* SSYNCs After Writes To DMA MMR Registers May Not Be Handled Correctly */ |
162 | #define ANOMALY_05000302 (__SILICON_REVISION__ < 5) | 162 | #define ANOMALY_05000302 (__SILICON_REVISION__ < 5) |
163 | /* New Feature: Additional Hysteresis on SPORT Input Pins (Not Available On Older Silicon) */ | 163 | /* SPORT_HYS Bit in PLL_CTL Register Is Not Functional */ |
164 | #define ANOMALY_05000305 (__SILICON_REVISION__ < 5) | 164 | #define ANOMALY_05000305 (__SILICON_REVISION__ < 5) |
165 | /* New Feature: Additional PPI Frame Sync Sampling Options (Not Available On Older Silicon) */ | 165 | /* New Feature: Additional PPI Frame Sync Sampling Options (Not Available On Older Silicon) */ |
166 | #define ANOMALY_05000306 (__SILICON_REVISION__ < 5) | 166 | #define ANOMALY_05000306 (__SILICON_REVISION__ < 5) |
@@ -278,9 +278,12 @@ | |||
278 | #define ANOMALY_05000266 (0) | 278 | #define ANOMALY_05000266 (0) |
279 | #define ANOMALY_05000323 (0) | 279 | #define ANOMALY_05000323 (0) |
280 | #define ANOMALY_05000353 (1) | 280 | #define ANOMALY_05000353 (1) |
281 | #define ANOMALY_05000380 (0) | ||
281 | #define ANOMALY_05000386 (1) | 282 | #define ANOMALY_05000386 (1) |
282 | #define ANOMALY_05000412 (0) | 283 | #define ANOMALY_05000412 (0) |
283 | #define ANOMALY_05000432 (0) | 284 | #define ANOMALY_05000432 (0) |
284 | #define ANOMALY_05000435 (0) | 285 | #define ANOMALY_05000435 (0) |
286 | #define ANOMALY_05000447 (0) | ||
287 | #define ANOMALY_05000448 (0) | ||
285 | 288 | ||
286 | #endif | 289 | #endif |
diff --git a/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h index f3d9e495230c..5f517f53b0fd 100644 --- a/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h +++ b/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h | |||
@@ -134,7 +134,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
134 | CH_UART_TX, | 134 | CH_UART_TX, |
135 | CH_UART_RX, | 135 | CH_UART_RX, |
136 | #endif | 136 | #endif |
137 | #ifdef CONFIG_BFIN_UART0_CTSRTS | 137 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
138 | CONFIG_UART0_CTS_PIN, | 138 | CONFIG_UART0_CTS_PIN, |
139 | CONFIG_UART0_RTS_PIN, | 139 | CONFIG_UART0_RTS_PIN, |
140 | #endif | 140 | #endif |
diff --git a/arch/blackfin/mach-bf537/boards/Kconfig b/arch/blackfin/mach-bf537/boards/Kconfig index 42a57b0acb29..77c59da87e85 100644 --- a/arch/blackfin/mach-bf537/boards/Kconfig +++ b/arch/blackfin/mach-bf537/boards/Kconfig | |||
@@ -33,9 +33,4 @@ config CAMSIG_MINOTAUR | |||
33 | help | 33 | help |
34 | Board supply package for CSP Minotaur | 34 | Board supply package for CSP Minotaur |
35 | 35 | ||
36 | config GENERIC_BF537_BOARD | ||
37 | bool "Generic" | ||
38 | help | ||
39 | Generic or Custom board support. | ||
40 | |||
41 | endchoice | 36 | endchoice |
diff --git a/arch/blackfin/mach-bf537/boards/Makefile b/arch/blackfin/mach-bf537/boards/Makefile index 7168cc14afd8..68b98a7af6a6 100644 --- a/arch/blackfin/mach-bf537/boards/Makefile +++ b/arch/blackfin/mach-bf537/boards/Makefile | |||
@@ -2,7 +2,6 @@ | |||
2 | # arch/blackfin/mach-bf537/boards/Makefile | 2 | # arch/blackfin/mach-bf537/boards/Makefile |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_GENERIC_BF537_BOARD) += generic_board.o | ||
6 | obj-$(CONFIG_BFIN537_STAMP) += stamp.o | 5 | obj-$(CONFIG_BFIN537_STAMP) += stamp.o |
7 | obj-$(CONFIG_BFIN537_BLUETECHNIX_CM) += cm_bf537.o | 6 | obj-$(CONFIG_BFIN537_BLUETECHNIX_CM) += cm_bf537.o |
8 | obj-$(CONFIG_BFIN537_BLUETECHNIX_TCM) += tcm_bf537.o | 7 | obj-$(CONFIG_BFIN537_BLUETECHNIX_TCM) += tcm_bf537.o |
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537.c b/arch/blackfin/mach-bf537/boards/cm_bf537.c index 9cd8fb2a30d3..41c75b9bfac0 100644 --- a/arch/blackfin/mach-bf537/boards/cm_bf537.c +++ b/arch/blackfin/mach-bf537/boards/cm_bf537.c | |||
@@ -108,9 +108,9 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = { | |||
108 | }; | 108 | }; |
109 | #endif | 109 | #endif |
110 | 110 | ||
111 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 111 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
112 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | 112 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
113 | .enable_dma = 1, | 113 | .enable_dma = 0, |
114 | .bits_per_word = 8, | 114 | .bits_per_word = 8, |
115 | }; | 115 | }; |
116 | #endif | 116 | #endif |
@@ -160,23 +160,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
160 | }, | 160 | }, |
161 | #endif | 161 | #endif |
162 | 162 | ||
163 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 163 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
164 | { | ||
165 | .modalias = "spi_mmc_dummy", | ||
166 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
167 | .bus_num = 0, | ||
168 | .chip_select = 7, | ||
169 | .platform_data = NULL, | ||
170 | .controller_data = &spi_mmc_chip_info, | ||
171 | .mode = SPI_MODE_3, | ||
172 | }, | ||
173 | { | 164 | { |
174 | .modalias = "spi_mmc", | 165 | .modalias = "mmc_spi", |
175 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 166 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
176 | .bus_num = 0, | 167 | .bus_num = 0, |
177 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 168 | .chip_select = 1, |
178 | .platform_data = NULL, | 169 | .controller_data = &mmc_spi_chip_info, |
179 | .controller_data = &spi_mmc_chip_info, | ||
180 | .mode = SPI_MODE_3, | 170 | .mode = SPI_MODE_3, |
181 | }, | 171 | }, |
182 | #endif | 172 | #endif |
diff --git a/arch/blackfin/mach-bf537/boards/generic_board.c b/arch/blackfin/mach-bf537/boards/generic_board.c deleted file mode 100644 index da710fdc4569..000000000000 --- a/arch/blackfin/mach-bf537/boards/generic_board.c +++ /dev/null | |||
@@ -1,745 +0,0 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf537/boards/generic_board.c | ||
3 | * Based on: arch/blackfin/mach-bf533/boards/ezkit.c | ||
4 | * Author: Aidan Williams <aidan@nicta.com.au> | ||
5 | * | ||
6 | * Created: | ||
7 | * Description: | ||
8 | * | ||
9 | * Modified: | ||
10 | * Copyright 2005 National ICT Australia (NICTA) | ||
11 | * Copyright 2004-2008 Analog Devices Inc. | ||
12 | * | ||
13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License as published by | ||
17 | * the Free Software Foundation; either version 2 of the License, or | ||
18 | * (at your option) any later version. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, see the file COPYING, or write | ||
27 | * to the Free Software Foundation, Inc., | ||
28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
29 | */ | ||
30 | |||
31 | #include <linux/device.h> | ||
32 | #include <linux/etherdevice.h> | ||
33 | #include <linux/platform_device.h> | ||
34 | #include <linux/mtd/mtd.h> | ||
35 | #include <linux/mtd/partitions.h> | ||
36 | #include <linux/spi/spi.h> | ||
37 | #include <linux/spi/flash.h> | ||
38 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | ||
39 | #include <linux/usb/isp1362.h> | ||
40 | #endif | ||
41 | #include <linux/irq.h> | ||
42 | #include <linux/interrupt.h> | ||
43 | #include <linux/usb/sl811.h> | ||
44 | #include <asm/dma.h> | ||
45 | #include <asm/bfin5xx_spi.h> | ||
46 | #include <asm/reboot.h> | ||
47 | #include <asm/portmux.h> | ||
48 | #include <linux/spi/ad7877.h> | ||
49 | |||
50 | /* | ||
51 | * Name the Board for the /proc/cpuinfo | ||
52 | */ | ||
53 | const char bfin_board_name[] = "UNKNOWN BOARD"; | ||
54 | |||
55 | /* | ||
56 | * Driver needs to know address, irq and flag pin. | ||
57 | */ | ||
58 | |||
59 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) | ||
60 | #include <linux/usb/isp1760.h> | ||
61 | static struct resource bfin_isp1760_resources[] = { | ||
62 | [0] = { | ||
63 | .start = 0x203C0000, | ||
64 | .end = 0x203C0000 + 0x000fffff, | ||
65 | .flags = IORESOURCE_MEM, | ||
66 | }, | ||
67 | [1] = { | ||
68 | .start = IRQ_PF7, | ||
69 | .end = IRQ_PF7, | ||
70 | .flags = IORESOURCE_IRQ, | ||
71 | }, | ||
72 | }; | ||
73 | |||
74 | static struct isp1760_platform_data isp1760_priv = { | ||
75 | .is_isp1761 = 0, | ||
76 | .port1_disable = 0, | ||
77 | .bus_width_16 = 1, | ||
78 | .port1_otg = 0, | ||
79 | .analog_oc = 0, | ||
80 | .dack_polarity_high = 0, | ||
81 | .dreq_polarity_high = 0, | ||
82 | }; | ||
83 | |||
84 | static struct platform_device bfin_isp1760_device = { | ||
85 | .name = "isp1760-hcd", | ||
86 | .id = 0, | ||
87 | .dev = { | ||
88 | .platform_data = &isp1760_priv, | ||
89 | }, | ||
90 | .num_resources = ARRAY_SIZE(bfin_isp1760_resources), | ||
91 | .resource = bfin_isp1760_resources, | ||
92 | }; | ||
93 | #endif | ||
94 | |||
95 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) | ||
96 | static struct resource bfin_pcmcia_cf_resources[] = { | ||
97 | { | ||
98 | .start = 0x20310000, /* IO PORT */ | ||
99 | .end = 0x20312000, | ||
100 | .flags = IORESOURCE_MEM, | ||
101 | }, { | ||
102 | .start = 0x20311000, /* Attribute Memory */ | ||
103 | .end = 0x20311FFF, | ||
104 | .flags = IORESOURCE_MEM, | ||
105 | }, { | ||
106 | .start = IRQ_PF4, | ||
107 | .end = IRQ_PF4, | ||
108 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | ||
109 | }, { | ||
110 | .start = 6, /* Card Detect PF6 */ | ||
111 | .end = 6, | ||
112 | .flags = IORESOURCE_IRQ, | ||
113 | }, | ||
114 | }; | ||
115 | |||
116 | static struct platform_device bfin_pcmcia_cf_device = { | ||
117 | .name = "bfin_cf_pcmcia", | ||
118 | .id = -1, | ||
119 | .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources), | ||
120 | .resource = bfin_pcmcia_cf_resources, | ||
121 | }; | ||
122 | #endif | ||
123 | |||
124 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
125 | static struct platform_device rtc_device = { | ||
126 | .name = "rtc-bfin", | ||
127 | .id = -1, | ||
128 | }; | ||
129 | #endif | ||
130 | |||
131 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
132 | static struct resource smc91x_resources[] = { | ||
133 | { | ||
134 | .name = "smc91x-regs", | ||
135 | .start = 0x20300300, | ||
136 | .end = 0x20300300 + 16, | ||
137 | .flags = IORESOURCE_MEM, | ||
138 | }, { | ||
139 | |||
140 | .start = IRQ_PF7, | ||
141 | .end = IRQ_PF7, | ||
142 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
143 | }, | ||
144 | }; | ||
145 | static struct platform_device smc91x_device = { | ||
146 | .name = "smc91x", | ||
147 | .id = 0, | ||
148 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
149 | .resource = smc91x_resources, | ||
150 | }; | ||
151 | #endif | ||
152 | |||
153 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) | ||
154 | static struct resource dm9000_resources[] = { | ||
155 | [0] = { | ||
156 | .start = 0x203FB800, | ||
157 | .end = 0x203FB800 + 1, | ||
158 | .flags = IORESOURCE_MEM, | ||
159 | }, | ||
160 | [1] = { | ||
161 | .start = 0x203FB800 + 4, | ||
162 | .end = 0x203FB800 + 5, | ||
163 | .flags = IORESOURCE_MEM, | ||
164 | }, | ||
165 | [2] = { | ||
166 | .start = IRQ_PF9, | ||
167 | .end = IRQ_PF9, | ||
168 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE), | ||
169 | }, | ||
170 | }; | ||
171 | |||
172 | static struct platform_device dm9000_device = { | ||
173 | .name = "dm9000", | ||
174 | .id = -1, | ||
175 | .num_resources = ARRAY_SIZE(dm9000_resources), | ||
176 | .resource = dm9000_resources, | ||
177 | }; | ||
178 | #endif | ||
179 | |||
180 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) | ||
181 | static struct resource sl811_hcd_resources[] = { | ||
182 | { | ||
183 | .start = 0x20340000, | ||
184 | .end = 0x20340000, | ||
185 | .flags = IORESOURCE_MEM, | ||
186 | }, { | ||
187 | .start = 0x20340004, | ||
188 | .end = 0x20340004, | ||
189 | .flags = IORESOURCE_MEM, | ||
190 | }, { | ||
191 | .start = CONFIG_USB_SL811_BFIN_IRQ, | ||
192 | .end = CONFIG_USB_SL811_BFIN_IRQ, | ||
193 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
194 | }, | ||
195 | }; | ||
196 | |||
197 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | ||
198 | void sl811_port_power(struct device *dev, int is_on) | ||
199 | { | ||
200 | gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS"); | ||
201 | gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on); | ||
202 | |||
203 | } | ||
204 | #endif | ||
205 | |||
206 | static struct sl811_platform_data sl811_priv = { | ||
207 | .potpg = 10, | ||
208 | .power = 250, /* == 500mA */ | ||
209 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | ||
210 | .port_power = &sl811_port_power, | ||
211 | #endif | ||
212 | }; | ||
213 | |||
214 | static struct platform_device sl811_hcd_device = { | ||
215 | .name = "sl811-hcd", | ||
216 | .id = 0, | ||
217 | .dev = { | ||
218 | .platform_data = &sl811_priv, | ||
219 | }, | ||
220 | .num_resources = ARRAY_SIZE(sl811_hcd_resources), | ||
221 | .resource = sl811_hcd_resources, | ||
222 | }; | ||
223 | #endif | ||
224 | |||
225 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | ||
226 | static struct resource isp1362_hcd_resources[] = { | ||
227 | { | ||
228 | .start = 0x20360000, | ||
229 | .end = 0x20360000, | ||
230 | .flags = IORESOURCE_MEM, | ||
231 | }, { | ||
232 | .start = 0x20360004, | ||
233 | .end = 0x20360004, | ||
234 | .flags = IORESOURCE_MEM, | ||
235 | }, { | ||
236 | .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, | ||
237 | .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, | ||
238 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
239 | }, | ||
240 | }; | ||
241 | |||
242 | static struct isp1362_platform_data isp1362_priv = { | ||
243 | .sel15Kres = 1, | ||
244 | .clknotstop = 0, | ||
245 | .oc_enable = 0, | ||
246 | .int_act_high = 0, | ||
247 | .int_edge_triggered = 0, | ||
248 | .remote_wakeup_connected = 0, | ||
249 | .no_power_switching = 1, | ||
250 | .power_switching_mode = 0, | ||
251 | }; | ||
252 | |||
253 | static struct platform_device isp1362_hcd_device = { | ||
254 | .name = "isp1362-hcd", | ||
255 | .id = 0, | ||
256 | .dev = { | ||
257 | .platform_data = &isp1362_priv, | ||
258 | }, | ||
259 | .num_resources = ARRAY_SIZE(isp1362_hcd_resources), | ||
260 | .resource = isp1362_hcd_resources, | ||
261 | }; | ||
262 | #endif | ||
263 | |||
264 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | ||
265 | static struct platform_device bfin_mii_bus = { | ||
266 | .name = "bfin_mii_bus", | ||
267 | }; | ||
268 | |||
269 | static struct platform_device bfin_mac_device = { | ||
270 | .name = "bfin_mac", | ||
271 | .dev.platform_data = &bfin_mii_bus, | ||
272 | }; | ||
273 | #endif | ||
274 | |||
275 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) | ||
276 | static struct resource net2272_bfin_resources[] = { | ||
277 | { | ||
278 | .start = 0x20300000, | ||
279 | .end = 0x20300000 + 0x100, | ||
280 | .flags = IORESOURCE_MEM, | ||
281 | }, { | ||
282 | .start = IRQ_PF7, | ||
283 | .end = IRQ_PF7, | ||
284 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
285 | }, | ||
286 | }; | ||
287 | |||
288 | static struct platform_device net2272_bfin_device = { | ||
289 | .name = "net2272", | ||
290 | .id = -1, | ||
291 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), | ||
292 | .resource = net2272_bfin_resources, | ||
293 | }; | ||
294 | #endif | ||
295 | |||
296 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
297 | /* all SPI peripherals info goes here */ | ||
298 | |||
299 | #if defined(CONFIG_MTD_M25P80) \ | ||
300 | || defined(CONFIG_MTD_M25P80_MODULE) | ||
301 | static struct mtd_partition bfin_spi_flash_partitions[] = { | ||
302 | { | ||
303 | .name = "bootloader(spi)", | ||
304 | .size = 0x00020000, | ||
305 | .offset = 0, | ||
306 | .mask_flags = MTD_CAP_ROM | ||
307 | }, { | ||
308 | .name = "linux kernel(spi)", | ||
309 | .size = 0xe0000, | ||
310 | .offset = 0x20000 | ||
311 | }, { | ||
312 | .name = "file system(spi)", | ||
313 | .size = 0x700000, | ||
314 | .offset = 0x00100000, | ||
315 | } | ||
316 | }; | ||
317 | |||
318 | static struct flash_platform_data bfin_spi_flash_data = { | ||
319 | .name = "m25p80", | ||
320 | .parts = bfin_spi_flash_partitions, | ||
321 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), | ||
322 | .type = "m25p64", | ||
323 | }; | ||
324 | |||
325 | /* SPI flash chip (m25p64) */ | ||
326 | static struct bfin5xx_spi_chip spi_flash_chip_info = { | ||
327 | .enable_dma = 0, /* use dma transfer with this chip*/ | ||
328 | .bits_per_word = 8, | ||
329 | }; | ||
330 | #endif | ||
331 | |||
332 | #if defined(CONFIG_SPI_ADC_BF533) \ | ||
333 | || defined(CONFIG_SPI_ADC_BF533_MODULE) | ||
334 | /* SPI ADC chip */ | ||
335 | static struct bfin5xx_spi_chip spi_adc_chip_info = { | ||
336 | .enable_dma = 1, /* use dma transfer with this chip*/ | ||
337 | .bits_per_word = 16, | ||
338 | }; | ||
339 | #endif | ||
340 | |||
341 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | ||
342 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | ||
343 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | ||
344 | .enable_dma = 0, | ||
345 | .bits_per_word = 16, | ||
346 | }; | ||
347 | #endif | ||
348 | |||
349 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) | ||
350 | static struct bfin5xx_spi_chip ad9960_spi_chip_info = { | ||
351 | .enable_dma = 0, | ||
352 | .bits_per_word = 16, | ||
353 | }; | ||
354 | #endif | ||
355 | |||
356 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | ||
357 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | ||
358 | .enable_dma = 1, | ||
359 | .bits_per_word = 8, | ||
360 | }; | ||
361 | #endif | ||
362 | |||
363 | #if defined(CONFIG_PBX) | ||
364 | static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { | ||
365 | .ctl_reg = 0x4, /* send zero */ | ||
366 | .enable_dma = 0, | ||
367 | .bits_per_word = 8, | ||
368 | .cs_change_per_word = 1, | ||
369 | }; | ||
370 | #endif | ||
371 | |||
372 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) | ||
373 | static struct bfin5xx_spi_chip spi_ad7877_chip_info = { | ||
374 | .enable_dma = 0, | ||
375 | .bits_per_word = 16, | ||
376 | }; | ||
377 | |||
378 | static const struct ad7877_platform_data bfin_ad7877_ts_info = { | ||
379 | .model = 7877, | ||
380 | .vref_delay_usecs = 50, /* internal, no capacitor */ | ||
381 | .x_plate_ohms = 419, | ||
382 | .y_plate_ohms = 486, | ||
383 | .pressure_max = 1000, | ||
384 | .pressure_min = 0, | ||
385 | .stopacq_polarity = 1, | ||
386 | .first_conversion_delay = 3, | ||
387 | .acquisition_time = 1, | ||
388 | .averaging = 1, | ||
389 | .pen_down_acc_interval = 1, | ||
390 | }; | ||
391 | #endif | ||
392 | |||
393 | static struct spi_board_info bfin_spi_board_info[] __initdata = { | ||
394 | #if defined(CONFIG_MTD_M25P80) \ | ||
395 | || defined(CONFIG_MTD_M25P80_MODULE) | ||
396 | { | ||
397 | /* the modalias must be the same as spi device driver name */ | ||
398 | .modalias = "m25p80", /* Name of spi_driver for this device */ | ||
399 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
400 | .bus_num = 0, /* Framework bus number */ | ||
401 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ | ||
402 | .platform_data = &bfin_spi_flash_data, | ||
403 | .controller_data = &spi_flash_chip_info, | ||
404 | .mode = SPI_MODE_3, | ||
405 | }, | ||
406 | #endif | ||
407 | |||
408 | #if defined(CONFIG_SPI_ADC_BF533) \ | ||
409 | || defined(CONFIG_SPI_ADC_BF533_MODULE) | ||
410 | { | ||
411 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ | ||
412 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ | ||
413 | .bus_num = 0, /* Framework bus number */ | ||
414 | .chip_select = 1, /* Framework chip select. */ | ||
415 | .platform_data = NULL, /* No spi_driver specific config */ | ||
416 | .controller_data = &spi_adc_chip_info, | ||
417 | }, | ||
418 | #endif | ||
419 | |||
420 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | ||
421 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | ||
422 | { | ||
423 | .modalias = "ad1836-spi", | ||
424 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | ||
425 | .bus_num = 0, | ||
426 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | ||
427 | .controller_data = &ad1836_spi_chip_info, | ||
428 | }, | ||
429 | #endif | ||
430 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) | ||
431 | { | ||
432 | .modalias = "ad9960-spi", | ||
433 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ | ||
434 | .bus_num = 0, | ||
435 | .chip_select = 1, | ||
436 | .controller_data = &ad9960_spi_chip_info, | ||
437 | }, | ||
438 | #endif | ||
439 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | ||
440 | { | ||
441 | .modalias = "spi_mmc_dummy", | ||
442 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
443 | .bus_num = 0, | ||
444 | .chip_select = 0, | ||
445 | .platform_data = NULL, | ||
446 | .controller_data = &spi_mmc_chip_info, | ||
447 | .mode = SPI_MODE_3, | ||
448 | }, | ||
449 | { | ||
450 | .modalias = "spi_mmc", | ||
451 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
452 | .bus_num = 0, | ||
453 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | ||
454 | .platform_data = NULL, | ||
455 | .controller_data = &spi_mmc_chip_info, | ||
456 | .mode = SPI_MODE_3, | ||
457 | }, | ||
458 | #endif | ||
459 | #if defined(CONFIG_PBX) | ||
460 | { | ||
461 | .modalias = "fxs-spi", | ||
462 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | ||
463 | .bus_num = 0, | ||
464 | .chip_select = 8 - CONFIG_J11_JUMPER, | ||
465 | .controller_data = &spi_si3xxx_chip_info, | ||
466 | .mode = SPI_MODE_3, | ||
467 | }, | ||
468 | { | ||
469 | .modalias = "fxo-spi", | ||
470 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | ||
471 | .bus_num = 0, | ||
472 | .chip_select = 8 - CONFIG_J19_JUMPER, | ||
473 | .controller_data = &spi_si3xxx_chip_info, | ||
474 | .mode = SPI_MODE_3, | ||
475 | }, | ||
476 | #endif | ||
477 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) | ||
478 | { | ||
479 | .modalias = "ad7877", | ||
480 | .platform_data = &bfin_ad7877_ts_info, | ||
481 | .irq = IRQ_PF6, | ||
482 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | ||
483 | .bus_num = 0, | ||
484 | .chip_select = 1, | ||
485 | .controller_data = &spi_ad7877_chip_info, | ||
486 | }, | ||
487 | #endif | ||
488 | }; | ||
489 | |||
490 | /* SPI controller data */ | ||
491 | static struct bfin5xx_spi_master bfin_spi0_info = { | ||
492 | .num_chipselect = 8, | ||
493 | .enable_dma = 1, /* master has the ability to do dma transfer */ | ||
494 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
495 | }; | ||
496 | |||
497 | /* SPI (0) */ | ||
498 | static struct resource bfin_spi0_resource[] = { | ||
499 | [0] = { | ||
500 | .start = SPI0_REGBASE, | ||
501 | .end = SPI0_REGBASE + 0xFF, | ||
502 | .flags = IORESOURCE_MEM, | ||
503 | }, | ||
504 | [1] = { | ||
505 | .start = CH_SPI, | ||
506 | .end = CH_SPI, | ||
507 | .flags = IORESOURCE_IRQ, | ||
508 | }, | ||
509 | }; | ||
510 | |||
511 | static struct platform_device bfin_spi0_device = { | ||
512 | .name = "bfin-spi", | ||
513 | .id = 0, /* Bus number */ | ||
514 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | ||
515 | .resource = bfin_spi0_resource, | ||
516 | .dev = { | ||
517 | .platform_data = &bfin_spi0_info, /* Passed to driver */ | ||
518 | }, | ||
519 | }; | ||
520 | #endif /* spi master and devices */ | ||
521 | |||
522 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) | ||
523 | static struct platform_device bfin_fb_device = { | ||
524 | .name = "bf537-lq035", | ||
525 | }; | ||
526 | #endif | ||
527 | |||
528 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) | ||
529 | static struct platform_device bfin_fb_adv7393_device = { | ||
530 | .name = "bfin-adv7393", | ||
531 | }; | ||
532 | #endif | ||
533 | |||
534 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | ||
535 | static struct resource bfin_uart_resources[] = { | ||
536 | { | ||
537 | .start = 0xFFC00400, | ||
538 | .end = 0xFFC004FF, | ||
539 | .flags = IORESOURCE_MEM, | ||
540 | }, { | ||
541 | .start = 0xFFC02000, | ||
542 | .end = 0xFFC020FF, | ||
543 | .flags = IORESOURCE_MEM, | ||
544 | }, | ||
545 | }; | ||
546 | |||
547 | static struct platform_device bfin_uart_device = { | ||
548 | .name = "bfin-uart", | ||
549 | .id = 1, | ||
550 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | ||
551 | .resource = bfin_uart_resources, | ||
552 | }; | ||
553 | #endif | ||
554 | |||
555 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
556 | #ifdef CONFIG_BFIN_SIR0 | ||
557 | static struct resource bfin_sir0_resources[] = { | ||
558 | { | ||
559 | .start = 0xFFC00400, | ||
560 | .end = 0xFFC004FF, | ||
561 | .flags = IORESOURCE_MEM, | ||
562 | }, | ||
563 | { | ||
564 | .start = IRQ_UART0_RX, | ||
565 | .end = IRQ_UART0_RX+1, | ||
566 | .flags = IORESOURCE_IRQ, | ||
567 | }, | ||
568 | { | ||
569 | .start = CH_UART0_RX, | ||
570 | .end = CH_UART0_RX+1, | ||
571 | .flags = IORESOURCE_DMA, | ||
572 | }, | ||
573 | }; | ||
574 | |||
575 | static struct platform_device bfin_sir0_device = { | ||
576 | .name = "bfin_sir", | ||
577 | .id = 0, | ||
578 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), | ||
579 | .resource = bfin_sir0_resources, | ||
580 | }; | ||
581 | #endif | ||
582 | #ifdef CONFIG_BFIN_SIR1 | ||
583 | static struct resource bfin_sir1_resources[] = { | ||
584 | { | ||
585 | .start = 0xFFC02000, | ||
586 | .end = 0xFFC020FF, | ||
587 | .flags = IORESOURCE_MEM, | ||
588 | }, | ||
589 | { | ||
590 | .start = IRQ_UART1_RX, | ||
591 | .end = IRQ_UART1_RX+1, | ||
592 | .flags = IORESOURCE_IRQ, | ||
593 | }, | ||
594 | { | ||
595 | .start = CH_UART1_RX, | ||
596 | .end = CH_UART1_RX+1, | ||
597 | .flags = IORESOURCE_DMA, | ||
598 | }, | ||
599 | }; | ||
600 | |||
601 | static struct platform_device bfin_sir1_device = { | ||
602 | .name = "bfin_sir", | ||
603 | .id = 1, | ||
604 | .num_resources = ARRAY_SIZE(bfin_sir1_resources), | ||
605 | .resource = bfin_sir1_resources, | ||
606 | }; | ||
607 | #endif | ||
608 | #endif | ||
609 | |||
610 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) | ||
611 | static struct resource bfin_twi0_resource[] = { | ||
612 | [0] = { | ||
613 | .start = TWI0_REGBASE, | ||
614 | .end = TWI0_REGBASE + 0xFF, | ||
615 | .flags = IORESOURCE_MEM, | ||
616 | }, | ||
617 | [1] = { | ||
618 | .start = IRQ_TWI, | ||
619 | .end = IRQ_TWI, | ||
620 | .flags = IORESOURCE_IRQ, | ||
621 | }, | ||
622 | }; | ||
623 | |||
624 | static struct platform_device i2c_bfin_twi_device = { | ||
625 | .name = "i2c-bfin-twi", | ||
626 | .id = 0, | ||
627 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), | ||
628 | .resource = bfin_twi0_resource, | ||
629 | }; | ||
630 | #endif | ||
631 | |||
632 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | ||
633 | static struct platform_device bfin_sport0_uart_device = { | ||
634 | .name = "bfin-sport-uart", | ||
635 | .id = 0, | ||
636 | }; | ||
637 | |||
638 | static struct platform_device bfin_sport1_uart_device = { | ||
639 | .name = "bfin-sport-uart", | ||
640 | .id = 1, | ||
641 | }; | ||
642 | #endif | ||
643 | |||
644 | static struct platform_device *stamp_devices[] __initdata = { | ||
645 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) | ||
646 | &bfin_pcmcia_cf_device, | ||
647 | #endif | ||
648 | |||
649 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
650 | &rtc_device, | ||
651 | #endif | ||
652 | |||
653 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) | ||
654 | &sl811_hcd_device, | ||
655 | #endif | ||
656 | |||
657 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | ||
658 | &isp1362_hcd_device, | ||
659 | #endif | ||
660 | |||
661 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
662 | &smc91x_device, | ||
663 | #endif | ||
664 | |||
665 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) | ||
666 | &dm9000_device, | ||
667 | #endif | ||
668 | |||
669 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | ||
670 | &bfin_mii_bus, | ||
671 | &bfin_mac_device, | ||
672 | #endif | ||
673 | |||
674 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) | ||
675 | &net2272_bfin_device, | ||
676 | #endif | ||
677 | |||
678 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) | ||
679 | &bfin_isp1760_device, | ||
680 | #endif | ||
681 | |||
682 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
683 | &bfin_spi0_device, | ||
684 | #endif | ||
685 | |||
686 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) | ||
687 | &bfin_fb_device, | ||
688 | #endif | ||
689 | |||
690 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) | ||
691 | &bfin_fb_adv7393_device, | ||
692 | #endif | ||
693 | |||
694 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | ||
695 | &bfin_uart_device, | ||
696 | #endif | ||
697 | |||
698 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
699 | #ifdef CONFIG_BFIN_SIR0 | ||
700 | &bfin_sir0_device, | ||
701 | #endif | ||
702 | #ifdef CONFIG_BFIN_SIR1 | ||
703 | &bfin_sir1_device, | ||
704 | #endif | ||
705 | #endif | ||
706 | |||
707 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) | ||
708 | &i2c_bfin_twi_device, | ||
709 | #endif | ||
710 | |||
711 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | ||
712 | &bfin_sport0_uart_device, | ||
713 | &bfin_sport1_uart_device, | ||
714 | #endif | ||
715 | }; | ||
716 | |||
717 | static int __init generic_init(void) | ||
718 | { | ||
719 | printk(KERN_INFO "%s(): registering device resources\n", __func__); | ||
720 | platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); | ||
721 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
722 | spi_register_board_info(bfin_spi_board_info, | ||
723 | ARRAY_SIZE(bfin_spi_board_info)); | ||
724 | #endif | ||
725 | |||
726 | return 0; | ||
727 | } | ||
728 | |||
729 | arch_initcall(generic_init); | ||
730 | |||
731 | void native_machine_restart(char *cmd) | ||
732 | { | ||
733 | /* workaround reboot hang when booting from SPI */ | ||
734 | if ((bfin_read_SYSCR() & 0x7) == 0x3) | ||
735 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); | ||
736 | } | ||
737 | |||
738 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | ||
739 | void bfin_get_ether_addr(char *addr) | ||
740 | { | ||
741 | random_ether_addr(addr); | ||
742 | printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__); | ||
743 | } | ||
744 | EXPORT_SYMBOL(bfin_get_ether_addr); | ||
745 | #endif | ||
diff --git a/arch/blackfin/mach-bf537/boards/minotaur.c b/arch/blackfin/mach-bf537/boards/minotaur.c index db7d3a385e4b..3c159819e555 100644 --- a/arch/blackfin/mach-bf537/boards/minotaur.c +++ b/arch/blackfin/mach-bf537/boards/minotaur.c | |||
@@ -134,9 +134,9 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { | |||
134 | }; | 134 | }; |
135 | #endif | 135 | #endif |
136 | 136 | ||
137 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 137 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
138 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | 138 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
139 | .enable_dma = 1, | 139 | .enable_dma = 0, |
140 | .bits_per_word = 8, | 140 | .bits_per_word = 8, |
141 | }; | 141 | }; |
142 | #endif | 142 | #endif |
@@ -156,23 +156,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
156 | }, | 156 | }, |
157 | #endif | 157 | #endif |
158 | 158 | ||
159 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 159 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
160 | { | 160 | { |
161 | .modalias = "spi_mmc_dummy", | 161 | .modalias = "mmc_spi", |
162 | .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ | 162 | .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ |
163 | .bus_num = 0, | 163 | .bus_num = 0, |
164 | .chip_select = 0, | 164 | .chip_select = 5, |
165 | .platform_data = NULL, | 165 | .controller_data = &mmc_spi_chip_info, |
166 | .controller_data = &spi_mmc_chip_info, | ||
167 | .mode = SPI_MODE_3, | ||
168 | }, | ||
169 | { | ||
170 | .modalias = "spi_mmc", | ||
171 | .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ | ||
172 | .bus_num = 0, | ||
173 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | ||
174 | .platform_data = NULL, | ||
175 | .controller_data = &spi_mmc_chip_info, | ||
176 | .mode = SPI_MODE_3, | 166 | .mode = SPI_MODE_3, |
177 | }, | 167 | }, |
178 | #endif | 168 | #endif |
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c index 590eb3a139b7..4e1de1e53f89 100644 --- a/arch/blackfin/mach-bf537/boards/pnav10.c +++ b/arch/blackfin/mach-bf537/boards/pnav10.c | |||
@@ -289,9 +289,9 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = { | |||
289 | }; | 289 | }; |
290 | #endif | 290 | #endif |
291 | 291 | ||
292 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 292 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
293 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | 293 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
294 | .enable_dma = 1, | 294 | .enable_dma = 0, |
295 | .bits_per_word = 8, | 295 | .bits_per_word = 8, |
296 | }; | 296 | }; |
297 | #endif | 297 | #endif |
@@ -364,23 +364,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
364 | .controller_data = &ad9960_spi_chip_info, | 364 | .controller_data = &ad9960_spi_chip_info, |
365 | }, | 365 | }, |
366 | #endif | 366 | #endif |
367 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 367 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
368 | { | ||
369 | .modalias = "spi_mmc_dummy", | ||
370 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
371 | .bus_num = 0, | ||
372 | .chip_select = 7, | ||
373 | .platform_data = NULL, | ||
374 | .controller_data = &spi_mmc_chip_info, | ||
375 | .mode = SPI_MODE_3, | ||
376 | }, | ||
377 | { | 368 | { |
378 | .modalias = "spi_mmc", | 369 | .modalias = "mmc_spi", |
379 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 370 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
380 | .bus_num = 0, | 371 | .bus_num = 0, |
381 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 372 | .chip_select = 5, |
382 | .platform_data = NULL, | 373 | .controller_data = &mmc_spi_chip_info, |
383 | .controller_data = &spi_mmc_chip_info, | ||
384 | .mode = SPI_MODE_3, | 374 | .mode = SPI_MODE_3, |
385 | }, | 375 | }, |
386 | #endif | 376 | #endif |
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c index 3f4f203a06ec..53ad10f3cd76 100644 --- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c +++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c | |||
@@ -108,9 +108,9 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = { | |||
108 | }; | 108 | }; |
109 | #endif | 109 | #endif |
110 | 110 | ||
111 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 111 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
112 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | 112 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
113 | .enable_dma = 1, | 113 | .enable_dma = 0, |
114 | .bits_per_word = 8, | 114 | .bits_per_word = 8, |
115 | }; | 115 | }; |
116 | #endif | 116 | #endif |
@@ -160,23 +160,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
160 | }, | 160 | }, |
161 | #endif | 161 | #endif |
162 | 162 | ||
163 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 163 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
164 | { | ||
165 | .modalias = "spi_mmc_dummy", | ||
166 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
167 | .bus_num = 0, | ||
168 | .chip_select = 7, | ||
169 | .platform_data = NULL, | ||
170 | .controller_data = &spi_mmc_chip_info, | ||
171 | .mode = SPI_MODE_3, | ||
172 | }, | ||
173 | { | 164 | { |
174 | .modalias = "spi_mmc", | 165 | .modalias = "mmc_spi", |
175 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 166 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
176 | .bus_num = 0, | 167 | .bus_num = 0, |
177 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 168 | .chip_select = 5, |
178 | .platform_data = NULL, | 169 | .controller_data = &mmc_spi_chip_info, |
179 | .controller_data = &spi_mmc_chip_info, | ||
180 | .mode = SPI_MODE_3, | 170 | .mode = SPI_MODE_3, |
181 | }, | 171 | }, |
182 | #endif | 172 | #endif |
diff --git a/arch/blackfin/mach-bf537/include/mach/anomaly.h b/arch/blackfin/mach-bf537/include/mach/anomaly.h index 9cb39121d1cb..1bfd80c26c90 100644 --- a/arch/blackfin/mach-bf537/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf537/include/mach/anomaly.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * File: include/asm-blackfin/mach-bf537/anomaly.h | 2 | * File: include/asm-blackfin/mach-bf537/anomaly.h |
3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
4 | * | 4 | * |
5 | * Copyright (C) 2004-2008 Analog Devices Inc. | 5 | * Copyright (C) 2004-2009 Analog Devices Inc. |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
8 | 8 | ||
@@ -110,7 +110,7 @@ | |||
110 | #define ANOMALY_05000301 (1) | 110 | #define ANOMALY_05000301 (1) |
111 | /* SSYNCs After Writes To CAN/DMA MMR Registers Are Not Always Handled Correctly */ | 111 | /* SSYNCs After Writes To CAN/DMA MMR Registers Are Not Always Handled Correctly */ |
112 | #define ANOMALY_05000304 (__SILICON_REVISION__ < 3) | 112 | #define ANOMALY_05000304 (__SILICON_REVISION__ < 3) |
113 | /* New Feature: Additional Hysteresis on SPORT Input Pins (Not Available On Older Silicon) */ | 113 | /* SPORT_HYS Bit in PLL_CTL Register Is Not Functional */ |
114 | #define ANOMALY_05000305 (__SILICON_REVISION__ < 3) | 114 | #define ANOMALY_05000305 (__SILICON_REVISION__ < 3) |
115 | /* SCKELOW Bit Does Not Maintain State Through Hibernate */ | 115 | /* SCKELOW Bit Does Not Maintain State Through Hibernate */ |
116 | #define ANOMALY_05000307 (__SILICON_REVISION__ < 3) | 116 | #define ANOMALY_05000307 (__SILICON_REVISION__ < 3) |
@@ -168,9 +168,12 @@ | |||
168 | #define ANOMALY_05000323 (0) | 168 | #define ANOMALY_05000323 (0) |
169 | #define ANOMALY_05000353 (1) | 169 | #define ANOMALY_05000353 (1) |
170 | #define ANOMALY_05000363 (0) | 170 | #define ANOMALY_05000363 (0) |
171 | #define ANOMALY_05000380 (0) | ||
171 | #define ANOMALY_05000386 (1) | 172 | #define ANOMALY_05000386 (1) |
172 | #define ANOMALY_05000412 (0) | 173 | #define ANOMALY_05000412 (0) |
173 | #define ANOMALY_05000432 (0) | 174 | #define ANOMALY_05000432 (0) |
174 | #define ANOMALY_05000435 (0) | 175 | #define ANOMALY_05000435 (0) |
176 | #define ANOMALY_05000447 (0) | ||
177 | #define ANOMALY_05000448 (0) | ||
175 | 178 | ||
176 | #endif | 179 | #endif |
diff --git a/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h index b3f87e1d16a2..9e34700844a2 100644 --- a/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h +++ b/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h | |||
@@ -144,7 +144,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
144 | CH_UART0_TX, | 144 | CH_UART0_TX, |
145 | CH_UART0_RX, | 145 | CH_UART0_RX, |
146 | #endif | 146 | #endif |
147 | #ifdef CONFIG_BFIN_UART0_CTSRTS | 147 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
148 | CONFIG_UART0_CTS_PIN, | 148 | CONFIG_UART0_CTS_PIN, |
149 | CONFIG_UART0_RTS_PIN, | 149 | CONFIG_UART0_RTS_PIN, |
150 | #endif | 150 | #endif |
@@ -158,7 +158,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
158 | CH_UART1_TX, | 158 | CH_UART1_TX, |
159 | CH_UART1_RX, | 159 | CH_UART1_RX, |
160 | #endif | 160 | #endif |
161 | #ifdef CONFIG_BFIN_UART1_CTSRTS | 161 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
162 | CONFIG_UART1_CTS_PIN, | 162 | CONFIG_UART1_CTS_PIN, |
163 | CONFIG_UART1_RTS_PIN, | 163 | CONFIG_UART1_RTS_PIN, |
164 | #endif | 164 | #endif |
diff --git a/arch/blackfin/mach-bf538/include/mach/anomaly.h b/arch/blackfin/mach-bf538/include/mach/anomaly.h index e130b4f8a05d..3a5699827363 100644 --- a/arch/blackfin/mach-bf538/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf538/include/mach/anomaly.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * File: include/asm-blackfin/mach-bf538/anomaly.h | 2 | * File: include/asm-blackfin/mach-bf538/anomaly.h |
3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
4 | * | 4 | * |
5 | * Copyright (C) 2004-2008 Analog Devices Inc. | 5 | * Copyright (C) 2004-2009 Analog Devices Inc. |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
8 | 8 | ||
@@ -120,13 +120,17 @@ | |||
120 | #define ANOMALY_05000198 (0) | 120 | #define ANOMALY_05000198 (0) |
121 | #define ANOMALY_05000230 (0) | 121 | #define ANOMALY_05000230 (0) |
122 | #define ANOMALY_05000263 (0) | 122 | #define ANOMALY_05000263 (0) |
123 | #define ANOMALY_05000305 (0) | ||
123 | #define ANOMALY_05000311 (0) | 124 | #define ANOMALY_05000311 (0) |
124 | #define ANOMALY_05000323 (0) | 125 | #define ANOMALY_05000323 (0) |
125 | #define ANOMALY_05000353 (1) | 126 | #define ANOMALY_05000353 (1) |
126 | #define ANOMALY_05000363 (0) | 127 | #define ANOMALY_05000363 (0) |
128 | #define ANOMALY_05000380 (0) | ||
127 | #define ANOMALY_05000386 (1) | 129 | #define ANOMALY_05000386 (1) |
128 | #define ANOMALY_05000412 (0) | 130 | #define ANOMALY_05000412 (0) |
129 | #define ANOMALY_05000432 (0) | 131 | #define ANOMALY_05000432 (0) |
130 | #define ANOMALY_05000435 (0) | 132 | #define ANOMALY_05000435 (0) |
133 | #define ANOMALY_05000447 (0) | ||
134 | #define ANOMALY_05000448 (0) | ||
131 | 135 | ||
132 | #endif | 136 | #endif |
diff --git a/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h index 40503b6b89a3..3c2811ebecdd 100644 --- a/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h +++ b/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h | |||
@@ -144,7 +144,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
144 | CH_UART0_TX, | 144 | CH_UART0_TX, |
145 | CH_UART0_RX, | 145 | CH_UART0_RX, |
146 | #endif | 146 | #endif |
147 | #ifdef CONFIG_BFIN_UART0_CTSRTS | 147 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
148 | CONFIG_UART0_CTS_PIN, | 148 | CONFIG_UART0_CTS_PIN, |
149 | CONFIG_UART0_RTS_PIN, | 149 | CONFIG_UART0_RTS_PIN, |
150 | #endif | 150 | #endif |
@@ -158,7 +158,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
158 | CH_UART1_TX, | 158 | CH_UART1_TX, |
159 | CH_UART1_RX, | 159 | CH_UART1_RX, |
160 | #endif | 160 | #endif |
161 | #ifdef CONFIG_BFIN_UART1_CTSRTS | 161 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
162 | CONFIG_UART1_CTS_PIN, | 162 | CONFIG_UART1_CTS_PIN, |
163 | CONFIG_UART1_RTS_PIN, | 163 | CONFIG_UART1_RTS_PIN, |
164 | #endif | 164 | #endif |
diff --git a/arch/blackfin/mach-bf548/include/mach/anomaly.h b/arch/blackfin/mach-bf548/include/mach/anomaly.h index 23d03c52f4b4..882e40ccf0d1 100644 --- a/arch/blackfin/mach-bf548/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf548/include/mach/anomaly.h | |||
@@ -2,12 +2,12 @@ | |||
2 | * File: include/asm-blackfin/mach-bf548/anomaly.h | 2 | * File: include/asm-blackfin/mach-bf548/anomaly.h |
3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
4 | * | 4 | * |
5 | * Copyright (C) 2004-2008 Analog Devices Inc. | 5 | * Copyright (C) 2004-2009 Analog Devices Inc. |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | /* This file shoule be up to date with: | 9 | /* This file shoule be up to date with: |
10 | * - Revision G, 08/07/2008; ADSP-BF542/BF544/BF547/BF548/BF549 Blackfin Processor Anomaly List | 10 | * - Revision H, 01/16/2009; ADSP-BF542/BF544/BF547/BF548/BF549 Blackfin Processor Anomaly List |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef _MACH_ANOMALY_H_ | 13 | #ifndef _MACH_ANOMALY_H_ |
@@ -91,8 +91,6 @@ | |||
91 | #define ANOMALY_05000371 (__SILICON_REVISION__ < 2) | 91 | #define ANOMALY_05000371 (__SILICON_REVISION__ < 2) |
92 | /* USB DP/DM Data Pins May Lose State When Entering Hibernate */ | 92 | /* USB DP/DM Data Pins May Lose State When Entering Hibernate */ |
93 | #define ANOMALY_05000372 (__SILICON_REVISION__ < 1) | 93 | #define ANOMALY_05000372 (__SILICON_REVISION__ < 1) |
94 | /* Mobile DDR Operation Not Functional */ | ||
95 | #define ANOMALY_05000377 (1) | ||
96 | /* Security/Authentication Speedpath Causes Authentication To Fail To Initiate */ | 94 | /* Security/Authentication Speedpath Causes Authentication To Fail To Initiate */ |
97 | #define ANOMALY_05000378 (__SILICON_REVISION__ < 2) | 95 | #define ANOMALY_05000378 (__SILICON_REVISION__ < 2) |
98 | /* 16-Bit NAND FLASH Boot Mode Is Not Functional */ | 96 | /* 16-Bit NAND FLASH Boot Mode Is Not Functional */ |
@@ -157,8 +155,22 @@ | |||
157 | #define ANOMALY_05000429 (__SILICON_REVISION__ < 2) | 155 | #define ANOMALY_05000429 (__SILICON_REVISION__ < 2) |
158 | /* Software System Reset Corrupts PLL_LOCKCNT Register */ | 156 | /* Software System Reset Corrupts PLL_LOCKCNT Register */ |
159 | #define ANOMALY_05000430 (__SILICON_REVISION__ >= 2) | 157 | #define ANOMALY_05000430 (__SILICON_REVISION__ >= 2) |
158 | /* Incorrect Use of Stack in Lockbox Firmware During Authentication */ | ||
159 | #define ANOMALY_05000431 (__SILICON_REVISION__ < 3) | ||
160 | /* OTP Write Accesses Not Supported */ | ||
161 | #define ANOMALY_05000442 (__SILICON_REVISION__ < 1) | ||
160 | /* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */ | 162 | /* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */ |
161 | #define ANOMALY_05000443 (1) | 163 | #define ANOMALY_05000443 (1) |
164 | /* CDMAPRIO and L2DMAPRIO Bits in the SYSCR Register Are Not Functional */ | ||
165 | #define ANOMALY_05000446 (1) | ||
166 | /* UART IrDA Receiver Fails on Extended Bit Pulses */ | ||
167 | #define ANOMALY_05000447 (1) | ||
168 | /* DDR Clock Duty Cycle Spec Violation (tCH, tCL) */ | ||
169 | #define ANOMALY_05000448 (__SILICON_REVISION__ == 1) | ||
170 | /* Reduced Timing Margins on DDR Output Setup and Hold (tDS and tDH) */ | ||
171 | #define ANOMALY_05000449 (__SILICON_REVISION__ == 1) | ||
172 | /* USB DMA Mode 1 Short Packet Data Corruption */ | ||
173 | #define ANOMALY_05000450 (1 | ||
162 | 174 | ||
163 | /* Anomalies that don't exist on this proc */ | 175 | /* Anomalies that don't exist on this proc */ |
164 | #define ANOMALY_05000125 (0) | 176 | #define ANOMALY_05000125 (0) |
@@ -171,6 +183,8 @@ | |||
171 | #define ANOMALY_05000263 (0) | 183 | #define ANOMALY_05000263 (0) |
172 | #define ANOMALY_05000266 (0) | 184 | #define ANOMALY_05000266 (0) |
173 | #define ANOMALY_05000273 (0) | 185 | #define ANOMALY_05000273 (0) |
186 | #define ANOMALY_05000278 (0) | ||
187 | #define ANOMALY_05000305 (0) | ||
174 | #define ANOMALY_05000307 (0) | 188 | #define ANOMALY_05000307 (0) |
175 | #define ANOMALY_05000311 (0) | 189 | #define ANOMALY_05000311 (0) |
176 | #define ANOMALY_05000323 (0) | 190 | #define ANOMALY_05000323 (0) |
diff --git a/arch/blackfin/mach-bf548/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf548/include/mach/bfin_serial_5xx.h index e4cf35e7ab9f..c05e79cba257 100644 --- a/arch/blackfin/mach-bf548/include/mach/bfin_serial_5xx.h +++ b/arch/blackfin/mach-bf548/include/mach/bfin_serial_5xx.h | |||
@@ -63,7 +63,7 @@ | |||
63 | #define UART_ENABLE_INTS(x, v) UART_SET_IER(x, v) | 63 | #define UART_ENABLE_INTS(x, v) UART_SET_IER(x, v) |
64 | #define UART_DISABLE_INTS(x) UART_CLEAR_IER(x, 0xF) | 64 | #define UART_DISABLE_INTS(x) UART_CLEAR_IER(x, 0xF) |
65 | 65 | ||
66 | #if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS) | 66 | #if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART2_CTSRTS) |
67 | # define CONFIG_SERIAL_BFIN_CTSRTS | 67 | # define CONFIG_SERIAL_BFIN_CTSRTS |
68 | 68 | ||
69 | # ifndef CONFIG_UART0_CTS_PIN | 69 | # ifndef CONFIG_UART0_CTS_PIN |
@@ -74,12 +74,12 @@ | |||
74 | # define CONFIG_UART0_RTS_PIN -1 | 74 | # define CONFIG_UART0_RTS_PIN -1 |
75 | # endif | 75 | # endif |
76 | 76 | ||
77 | # ifndef CONFIG_UART1_CTS_PIN | 77 | # ifndef CONFIG_UART2_CTS_PIN |
78 | # define CONFIG_UART1_CTS_PIN -1 | 78 | # define CONFIG_UART2_CTS_PIN -1 |
79 | # endif | 79 | # endif |
80 | 80 | ||
81 | # ifndef CONFIG_UART1_RTS_PIN | 81 | # ifndef CONFIG_UART2_RTS_PIN |
82 | # define CONFIG_UART1_RTS_PIN -1 | 82 | # define CONFIG_UART2_RTS_PIN -1 |
83 | # endif | 83 | # endif |
84 | #endif | 84 | #endif |
85 | 85 | ||
@@ -130,7 +130,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
130 | CH_UART0_TX, | 130 | CH_UART0_TX, |
131 | CH_UART0_RX, | 131 | CH_UART0_RX, |
132 | #endif | 132 | #endif |
133 | #ifdef CONFIG_BFIN_UART0_CTSRTS | 133 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
134 | CONFIG_UART0_CTS_PIN, | 134 | CONFIG_UART0_CTS_PIN, |
135 | CONFIG_UART0_RTS_PIN, | 135 | CONFIG_UART0_RTS_PIN, |
136 | #endif | 136 | #endif |
@@ -144,6 +144,10 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
144 | CH_UART1_TX, | 144 | CH_UART1_TX, |
145 | CH_UART1_RX, | 145 | CH_UART1_RX, |
146 | #endif | 146 | #endif |
147 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS | ||
148 | 0, | ||
149 | 0, | ||
150 | #endif | ||
147 | }, | 151 | }, |
148 | #endif | 152 | #endif |
149 | #ifdef CONFIG_SERIAL_BFIN_UART2 | 153 | #ifdef CONFIG_SERIAL_BFIN_UART2 |
@@ -154,7 +158,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
154 | CH_UART2_TX, | 158 | CH_UART2_TX, |
155 | CH_UART2_RX, | 159 | CH_UART2_RX, |
156 | #endif | 160 | #endif |
157 | #ifdef CONFIG_BFIN_UART2_CTSRTS | 161 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
158 | CONFIG_UART2_CTS_PIN, | 162 | CONFIG_UART2_CTS_PIN, |
159 | CONFIG_UART2_RTS_PIN, | 163 | CONFIG_UART2_RTS_PIN, |
160 | #endif | 164 | #endif |
@@ -168,6 +172,10 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
168 | CH_UART3_TX, | 172 | CH_UART3_TX, |
169 | CH_UART3_RX, | 173 | CH_UART3_RX, |
170 | #endif | 174 | #endif |
175 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS | ||
176 | 0, | ||
177 | 0, | ||
178 | #endif | ||
171 | }, | 179 | }, |
172 | #endif | 180 | #endif |
173 | }; | 181 | }; |
diff --git a/arch/blackfin/mach-bf548/include/mach/irq.h b/arch/blackfin/mach-bf548/include/mach/irq.h index 60299a71e090..f194625f6821 100644 --- a/arch/blackfin/mach-bf548/include/mach/irq.h +++ b/arch/blackfin/mach-bf548/include/mach/irq.h | |||
@@ -123,8 +123,8 @@ Events (highest priority) EMU 0 | |||
123 | #define IRQ_MXVR_ERROR BFIN_IRQ(51) /* MXVR Status (Error) Interrupt */ | 123 | #define IRQ_MXVR_ERROR BFIN_IRQ(51) /* MXVR Status (Error) Interrupt */ |
124 | #define IRQ_MXVR_MSG BFIN_IRQ(52) /* MXVR Message Interrupt */ | 124 | #define IRQ_MXVR_MSG BFIN_IRQ(52) /* MXVR Message Interrupt */ |
125 | #define IRQ_MXVR_PKT BFIN_IRQ(53) /* MXVR Packet Interrupt */ | 125 | #define IRQ_MXVR_PKT BFIN_IRQ(53) /* MXVR Packet Interrupt */ |
126 | #define IRQ_EPP1_ERROR BFIN_IRQ(54) /* EPPI1 Error Interrupt */ | 126 | #define IRQ_EPPI1_ERROR BFIN_IRQ(54) /* EPPI1 Error Interrupt */ |
127 | #define IRQ_EPP2_ERROR BFIN_IRQ(55) /* EPPI2 Error Interrupt */ | 127 | #define IRQ_EPPI2_ERROR BFIN_IRQ(55) /* EPPI2 Error Interrupt */ |
128 | #define IRQ_UART3_ERROR BFIN_IRQ(56) /* UART3 Status (Error) Interrupt */ | 128 | #define IRQ_UART3_ERROR BFIN_IRQ(56) /* UART3 Status (Error) Interrupt */ |
129 | #define IRQ_HOST_ERROR BFIN_IRQ(57) /* HOST Status (Error) Interrupt */ | 129 | #define IRQ_HOST_ERROR BFIN_IRQ(57) /* HOST Status (Error) Interrupt */ |
130 | #define IRQ_PIXC_ERROR BFIN_IRQ(59) /* PIXC Status (Error) Interrupt */ | 130 | #define IRQ_PIXC_ERROR BFIN_IRQ(59) /* PIXC Status (Error) Interrupt */ |
@@ -361,8 +361,8 @@ Events (highest priority) EMU 0 | |||
361 | #define IRQ_UART2_ERR IRQ_UART2_ERROR | 361 | #define IRQ_UART2_ERR IRQ_UART2_ERROR |
362 | #define IRQ_CAN0_ERR IRQ_CAN0_ERROR | 362 | #define IRQ_CAN0_ERR IRQ_CAN0_ERROR |
363 | #define IRQ_MXVR_ERR IRQ_MXVR_ERROR | 363 | #define IRQ_MXVR_ERR IRQ_MXVR_ERROR |
364 | #define IRQ_EPP1_ERR IRQ_EPP1_ERROR | 364 | #define IRQ_EPPI1_ERR IRQ_EPPI1_ERROR |
365 | #define IRQ_EPP2_ERR IRQ_EPP2_ERROR | 365 | #define IRQ_EPPI2_ERR IRQ_EPPI2_ERROR |
366 | #define IRQ_UART3_ERR IRQ_UART3_ERROR | 366 | #define IRQ_UART3_ERR IRQ_UART3_ERROR |
367 | #define IRQ_HOST_ERR IRQ_HOST_ERROR | 367 | #define IRQ_HOST_ERR IRQ_HOST_ERROR |
368 | #define IRQ_PIXC_ERR IRQ_PIXC_ERROR | 368 | #define IRQ_PIXC_ERR IRQ_PIXC_ERROR |
diff --git a/arch/blackfin/mach-bf561/boards/Kconfig b/arch/blackfin/mach-bf561/boards/Kconfig index e41a67b1fb53..e4bc6d7c5a6a 100644 --- a/arch/blackfin/mach-bf561/boards/Kconfig +++ b/arch/blackfin/mach-bf561/boards/Kconfig | |||
@@ -19,9 +19,4 @@ config BFIN561_BLUETECHNIX_CM | |||
19 | help | 19 | help |
20 | CM-BF561 support for EVAL- and DEV-Board. | 20 | CM-BF561 support for EVAL- and DEV-Board. |
21 | 21 | ||
22 | config GENERIC_BF561_BOARD | ||
23 | bool "Generic" | ||
24 | help | ||
25 | Generic or Custom board support. | ||
26 | |||
27 | endchoice | 22 | endchoice |
diff --git a/arch/blackfin/mach-bf561/boards/Makefile b/arch/blackfin/mach-bf561/boards/Makefile index 04add010b568..3a152559e957 100644 --- a/arch/blackfin/mach-bf561/boards/Makefile +++ b/arch/blackfin/mach-bf561/boards/Makefile | |||
@@ -2,7 +2,6 @@ | |||
2 | # arch/blackfin/mach-bf561/boards/Makefile | 2 | # arch/blackfin/mach-bf561/boards/Makefile |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_GENERIC_BF561_BOARD) += generic_board.o | ||
6 | obj-$(CONFIG_BFIN561_BLUETECHNIX_CM) += cm_bf561.o | 5 | obj-$(CONFIG_BFIN561_BLUETECHNIX_CM) += cm_bf561.o |
7 | obj-$(CONFIG_BFIN561_EZKIT) += ezkit.o | 6 | obj-$(CONFIG_BFIN561_EZKIT) += ezkit.o |
8 | obj-$(CONFIG_BFIN561_TEPLA) += tepla.o | 7 | obj-$(CONFIG_BFIN561_TEPLA) += tepla.o |
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c index 6880d1ebfe60..f623c6b0719f 100644 --- a/arch/blackfin/mach-bf561/boards/cm_bf561.c +++ b/arch/blackfin/mach-bf561/boards/cm_bf561.c | |||
@@ -105,9 +105,9 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = { | |||
105 | }; | 105 | }; |
106 | #endif | 106 | #endif |
107 | 107 | ||
108 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 108 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
109 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | 109 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
110 | .enable_dma = 1, | 110 | .enable_dma = 0, |
111 | .bits_per_word = 8, | 111 | .bits_per_word = 8, |
112 | }; | 112 | }; |
113 | #endif | 113 | #endif |
@@ -155,14 +155,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
155 | .controller_data = &ad9960_spi_chip_info, | 155 | .controller_data = &ad9960_spi_chip_info, |
156 | }, | 156 | }, |
157 | #endif | 157 | #endif |
158 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | 158 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
159 | { | 159 | { |
160 | .modalias = "spi_mmc", | 160 | .modalias = "mmc_spi", |
161 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 161 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
162 | .bus_num = 0, | 162 | .bus_num = 0, |
163 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 163 | .chip_select = 5, |
164 | .platform_data = NULL, | 164 | .controller_data = &mmc_spi_chip_info, |
165 | .controller_data = &spi_mmc_chip_info, | ||
166 | .mode = SPI_MODE_3, | 165 | .mode = SPI_MODE_3, |
167 | }, | 166 | }, |
168 | #endif | 167 | #endif |
diff --git a/arch/blackfin/mach-bf561/boards/generic_board.c b/arch/blackfin/mach-bf561/boards/generic_board.c deleted file mode 100644 index 0ba366a0e696..000000000000 --- a/arch/blackfin/mach-bf561/boards/generic_board.c +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf561/generic_board.c | ||
3 | * Based on: arch/blackfin/mach-bf533/ezkit.c | ||
4 | * Author: Aidan Williams <aidan@nicta.com.au> | ||
5 | * | ||
6 | * Created: | ||
7 | * Description: | ||
8 | * | ||
9 | * Modified: | ||
10 | * Copyright 2005 National ICT Australia (NICTA) | ||
11 | * Copyright 2004-2006 Analog Devices Inc. | ||
12 | * | ||
13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License as published by | ||
17 | * the Free Software Foundation; either version 2 of the License, or | ||
18 | * (at your option) any later version. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, see the file COPYING, or write | ||
27 | * to the Free Software Foundation, Inc., | ||
28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
29 | */ | ||
30 | |||
31 | #include <linux/device.h> | ||
32 | #include <linux/platform_device.h> | ||
33 | #include <linux/irq.h> | ||
34 | |||
35 | const char bfin_board_name[] = "UNKNOWN BOARD"; | ||
36 | |||
37 | /* | ||
38 | * Driver needs to know address, irq and flag pin. | ||
39 | */ | ||
40 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
41 | static struct resource smc91x_resources[] = { | ||
42 | { | ||
43 | .start = 0x2C010300, | ||
44 | .end = 0x2C010300 + 16, | ||
45 | .flags = IORESOURCE_MEM, | ||
46 | }, { | ||
47 | .start = IRQ_PROG_INTB, | ||
48 | .end = IRQ_PROG_INTB, | ||
49 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
50 | }, { | ||
51 | .start = IRQ_PF9, | ||
52 | .end = IRQ_PF9, | ||
53 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
54 | }, | ||
55 | }; | ||
56 | |||
57 | static struct platform_device smc91x_device = { | ||
58 | .name = "smc91x", | ||
59 | .id = 0, | ||
60 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
61 | .resource = smc91x_resources, | ||
62 | }; | ||
63 | #endif | ||
64 | |||
65 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
66 | #ifdef CONFIG_BFIN_SIR0 | ||
67 | static struct resource bfin_sir0_resources[] = { | ||
68 | { | ||
69 | .start = 0xFFC00400, | ||
70 | .end = 0xFFC004FF, | ||
71 | .flags = IORESOURCE_MEM, | ||
72 | }, | ||
73 | { | ||
74 | .start = IRQ_UART0_RX, | ||
75 | .end = IRQ_UART0_RX+1, | ||
76 | .flags = IORESOURCE_IRQ, | ||
77 | }, | ||
78 | { | ||
79 | .start = CH_UART0_RX, | ||
80 | .end = CH_UART0_RX+1, | ||
81 | .flags = IORESOURCE_DMA, | ||
82 | }, | ||
83 | }; | ||
84 | |||
85 | static struct platform_device bfin_sir0_device = { | ||
86 | .name = "bfin_sir", | ||
87 | .id = 0, | ||
88 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), | ||
89 | .resource = bfin_sir0_resources, | ||
90 | }; | ||
91 | #endif | ||
92 | #endif | ||
93 | |||
94 | static struct platform_device *generic_board_devices[] __initdata = { | ||
95 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
96 | &smc91x_device, | ||
97 | #endif | ||
98 | |||
99 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
100 | #ifdef CONFIG_BFIN_SIR0 | ||
101 | &bfin_sir0_device, | ||
102 | #endif | ||
103 | #endif | ||
104 | }; | ||
105 | |||
106 | static int __init generic_board_init(void) | ||
107 | { | ||
108 | printk(KERN_INFO "%s(): registering device resources\n", __func__); | ||
109 | return platform_add_devices(generic_board_devices, | ||
110 | ARRAY_SIZE(generic_board_devices)); | ||
111 | } | ||
112 | |||
113 | arch_initcall(generic_board_init); | ||
diff --git a/arch/blackfin/mach-bf561/include/mach/anomaly.h b/arch/blackfin/mach-bf561/include/mach/anomaly.h index 1a9e17562821..d0b0b3506440 100644 --- a/arch/blackfin/mach-bf561/include/mach/anomaly.h +++ b/arch/blackfin/mach-bf561/include/mach/anomaly.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * File: include/asm-blackfin/mach-bf561/anomaly.h | 2 | * File: include/asm-blackfin/mach-bf561/anomaly.h |
3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 3 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
4 | * | 4 | * |
5 | * Copyright (C) 2004-2008 Analog Devices Inc. | 5 | * Copyright (C) 2004-2009 Analog Devices Inc. |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
8 | 8 | ||
@@ -224,7 +224,7 @@ | |||
224 | #define ANOMALY_05000301 (1) | 224 | #define ANOMALY_05000301 (1) |
225 | /* SSYNCs After Writes To DMA MMR Registers May Not Be Handled Correctly */ | 225 | /* SSYNCs After Writes To DMA MMR Registers May Not Be Handled Correctly */ |
226 | #define ANOMALY_05000302 (1) | 226 | #define ANOMALY_05000302 (1) |
227 | /* New Feature: Additional Hysteresis on SPORT Input Pins (Not Available On Older Silicon) */ | 227 | /* SPORT_HYS Bit in PLL_CTL Register Is Not Functional */ |
228 | #define ANOMALY_05000305 (__SILICON_REVISION__ < 5) | 228 | #define ANOMALY_05000305 (__SILICON_REVISION__ < 5) |
229 | /* SCKELOW Bit Does Not Maintain State Through Hibernate */ | 229 | /* SCKELOW Bit Does Not Maintain State Through Hibernate */ |
230 | #define ANOMALY_05000307 (__SILICON_REVISION__ < 5) | 230 | #define ANOMALY_05000307 (__SILICON_REVISION__ < 5) |
@@ -283,8 +283,11 @@ | |||
283 | #define ANOMALY_05000273 (0) | 283 | #define ANOMALY_05000273 (0) |
284 | #define ANOMALY_05000311 (0) | 284 | #define ANOMALY_05000311 (0) |
285 | #define ANOMALY_05000353 (1) | 285 | #define ANOMALY_05000353 (1) |
286 | #define ANOMALY_05000380 (0) | ||
286 | #define ANOMALY_05000386 (1) | 287 | #define ANOMALY_05000386 (1) |
287 | #define ANOMALY_05000432 (0) | 288 | #define ANOMALY_05000432 (0) |
288 | #define ANOMALY_05000435 (0) | 289 | #define ANOMALY_05000435 (0) |
290 | #define ANOMALY_05000447 (0) | ||
291 | #define ANOMALY_05000448 (0) | ||
289 | 292 | ||
290 | #endif | 293 | #endif |
diff --git a/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h index 043bfcf26c52..ca8c5f645209 100644 --- a/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h +++ b/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h | |||
@@ -134,7 +134,7 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
134 | CH_UART_TX, | 134 | CH_UART_TX, |
135 | CH_UART_RX, | 135 | CH_UART_RX, |
136 | #endif | 136 | #endif |
137 | #ifdef CONFIG_BFIN_UART0_CTSRTS | 137 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
138 | CONFIG_UART0_CTS_PIN, | 138 | CONFIG_UART0_CTS_PIN, |
139 | CONFIG_UART0_RTS_PIN, | 139 | CONFIG_UART0_RTS_PIN, |
140 | #endif | 140 | #endif |
diff --git a/arch/blackfin/mach-common/arch_checks.c b/arch/blackfin/mach-common/arch_checks.c index 98133b968f7b..80d39b2f9db2 100644 --- a/arch/blackfin/mach-common/arch_checks.c +++ b/arch/blackfin/mach-common/arch_checks.c | |||
@@ -62,3 +62,12 @@ | |||
62 | #if (CONFIG_BOOT_LOAD & 0x3) | 62 | #if (CONFIG_BOOT_LOAD & 0x3) |
63 | # error "The kernel load address must be 4 byte aligned" | 63 | # error "The kernel load address must be 4 byte aligned" |
64 | #endif | 64 | #endif |
65 | |||
66 | /* The entire kernel must be able to make a 24bit pcrel call to start of L1 */ | ||
67 | #if ((0xffffffff - L1_CODE_START + 1) + CONFIG_BOOT_LOAD) > 0x1000000 | ||
68 | # error "The kernel load address is too high; keep it below 10meg for safety" | ||
69 | #endif | ||
70 | |||
71 | #if ANOMALY_05000448 | ||
72 | # error You are using a part with anomaly 05000448, this issue causes random memory read/write failures - that means random crashes. | ||
73 | #endif | ||
diff --git a/arch/blackfin/mach-common/cache.S b/arch/blackfin/mach-common/cache.S index 3c98dacbf289..aa0648c6a9fe 100644 --- a/arch/blackfin/mach-common/cache.S +++ b/arch/blackfin/mach-common/cache.S | |||
@@ -66,11 +66,33 @@ | |||
66 | 66 | ||
67 | /* Invalidate all instruction cache lines assocoiated with this memory area */ | 67 | /* Invalidate all instruction cache lines assocoiated with this memory area */ |
68 | ENTRY(_blackfin_icache_flush_range) | 68 | ENTRY(_blackfin_icache_flush_range) |
69 | /* | ||
70 | * Walkaround to avoid loading wrong instruction after invalidating icache | ||
71 | * and following sequence is met. | ||
72 | * | ||
73 | * 1) One instruction address is cached in the instruction cache. | ||
74 | * 2) This instruction in SDRAM is changed. | ||
75 | * 3) IFLASH[P0] is executed only once in blackfin_icache_flush_range(). | ||
76 | * 4) This instruction is executed again, but the old one is loaded. | ||
77 | */ | ||
78 | P0 = R0; | ||
79 | IFLUSH[P0]; | ||
69 | do_flush IFLUSH, , nop | 80 | do_flush IFLUSH, , nop |
70 | ENDPROC(_blackfin_icache_flush_range) | 81 | ENDPROC(_blackfin_icache_flush_range) |
71 | 82 | ||
72 | /* Flush all cache lines assocoiated with this area of memory. */ | 83 | /* Flush all cache lines assocoiated with this area of memory. */ |
73 | ENTRY(_blackfin_icache_dcache_flush_range) | 84 | ENTRY(_blackfin_icache_dcache_flush_range) |
85 | /* | ||
86 | * Walkaround to avoid loading wrong instruction after invalidating icache | ||
87 | * and following sequence is met. | ||
88 | * | ||
89 | * 1) One instruction address is cached in the instruction cache. | ||
90 | * 2) This instruction in SDRAM is changed. | ||
91 | * 3) IFLASH[P0] is executed only once in blackfin_icache_flush_range(). | ||
92 | * 4) This instruction is executed again, but the old one is loaded. | ||
93 | */ | ||
94 | P0 = R0; | ||
95 | IFLUSH[P0]; | ||
74 | do_flush FLUSH, IFLUSH | 96 | do_flush FLUSH, IFLUSH |
75 | ENDPROC(_blackfin_icache_dcache_flush_range) | 97 | ENDPROC(_blackfin_icache_dcache_flush_range) |
76 | 98 | ||
diff --git a/arch/blackfin/mach-common/clocks-init.c b/arch/blackfin/mach-common/clocks-init.c index 9dddb6f8cc85..35393651359b 100644 --- a/arch/blackfin/mach-common/clocks-init.c +++ b/arch/blackfin/mach-common/clocks-init.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #define SDGCTL_WIDTH (1 << 31) /* SDRAM external data path width */ | 17 | #define SDGCTL_WIDTH (1 << 31) /* SDRAM external data path width */ |
18 | #define PLL_CTL_VAL \ | 18 | #define PLL_CTL_VAL \ |
19 | (((CONFIG_VCO_MULT & 63) << 9) | CLKIN_HALF | \ | 19 | (((CONFIG_VCO_MULT & 63) << 9) | CLKIN_HALF | \ |
20 | (PLL_BYPASS << 8) | (ANOMALY_05000265 ? 0x8000 : 0)) | 20 | (PLL_BYPASS << 8) | (ANOMALY_05000305 ? 0 : 0x8000)) |
21 | 21 | ||
22 | __attribute__((l1_text)) | 22 | __attribute__((l1_text)) |
23 | static void do_sync(void) | 23 | static void do_sync(void) |
diff --git a/arch/blackfin/mach-common/dpmc_modes.S b/arch/blackfin/mach-common/dpmc_modes.S index 4da50bcd9300..8009a512fb11 100644 --- a/arch/blackfin/mach-common/dpmc_modes.S +++ b/arch/blackfin/mach-common/dpmc_modes.S | |||
@@ -376,10 +376,22 @@ ENTRY(_do_hibernate) | |||
376 | #endif | 376 | #endif |
377 | 377 | ||
378 | #ifdef PINT0_ASSIGN | 378 | #ifdef PINT0_ASSIGN |
379 | PM_SYS_PUSH(PINT0_MASK_SET) | ||
380 | PM_SYS_PUSH(PINT1_MASK_SET) | ||
381 | PM_SYS_PUSH(PINT2_MASK_SET) | ||
382 | PM_SYS_PUSH(PINT3_MASK_SET) | ||
379 | PM_SYS_PUSH(PINT0_ASSIGN) | 383 | PM_SYS_PUSH(PINT0_ASSIGN) |
380 | PM_SYS_PUSH(PINT1_ASSIGN) | 384 | PM_SYS_PUSH(PINT1_ASSIGN) |
381 | PM_SYS_PUSH(PINT2_ASSIGN) | 385 | PM_SYS_PUSH(PINT2_ASSIGN) |
382 | PM_SYS_PUSH(PINT3_ASSIGN) | 386 | PM_SYS_PUSH(PINT3_ASSIGN) |
387 | PM_SYS_PUSH(PINT0_INVERT_SET) | ||
388 | PM_SYS_PUSH(PINT1_INVERT_SET) | ||
389 | PM_SYS_PUSH(PINT2_INVERT_SET) | ||
390 | PM_SYS_PUSH(PINT3_INVERT_SET) | ||
391 | PM_SYS_PUSH(PINT0_EDGE_SET) | ||
392 | PM_SYS_PUSH(PINT1_EDGE_SET) | ||
393 | PM_SYS_PUSH(PINT2_EDGE_SET) | ||
394 | PM_SYS_PUSH(PINT3_EDGE_SET) | ||
383 | #endif | 395 | #endif |
384 | 396 | ||
385 | PM_SYS_PUSH(EBIU_AMBCTL0) | 397 | PM_SYS_PUSH(EBIU_AMBCTL0) |
@@ -714,10 +726,22 @@ ENTRY(_do_hibernate) | |||
714 | PM_SYS_POP(EBIU_AMBCTL0) | 726 | PM_SYS_POP(EBIU_AMBCTL0) |
715 | 727 | ||
716 | #ifdef PINT0_ASSIGN | 728 | #ifdef PINT0_ASSIGN |
729 | PM_SYS_POP(PINT3_EDGE_SET) | ||
730 | PM_SYS_POP(PINT2_EDGE_SET) | ||
731 | PM_SYS_POP(PINT1_EDGE_SET) | ||
732 | PM_SYS_POP(PINT0_EDGE_SET) | ||
733 | PM_SYS_POP(PINT3_INVERT_SET) | ||
734 | PM_SYS_POP(PINT2_INVERT_SET) | ||
735 | PM_SYS_POP(PINT1_INVERT_SET) | ||
736 | PM_SYS_POP(PINT0_INVERT_SET) | ||
717 | PM_SYS_POP(PINT3_ASSIGN) | 737 | PM_SYS_POP(PINT3_ASSIGN) |
718 | PM_SYS_POP(PINT2_ASSIGN) | 738 | PM_SYS_POP(PINT2_ASSIGN) |
719 | PM_SYS_POP(PINT1_ASSIGN) | 739 | PM_SYS_POP(PINT1_ASSIGN) |
720 | PM_SYS_POP(PINT0_ASSIGN) | 740 | PM_SYS_POP(PINT0_ASSIGN) |
741 | PM_SYS_POP(PINT3_MASK_SET) | ||
742 | PM_SYS_POP(PINT2_MASK_SET) | ||
743 | PM_SYS_POP(PINT1_MASK_SET) | ||
744 | PM_SYS_POP(PINT0_MASK_SET) | ||
721 | #endif | 745 | #endif |
722 | 746 | ||
723 | #ifdef SICA_IWR1 | 747 | #ifdef SICA_IWR1 |
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S index 88de053bbe8e..21e65a339a22 100644 --- a/arch/blackfin/mach-common/entry.S +++ b/arch/blackfin/mach-common/entry.S | |||
@@ -600,6 +600,19 @@ ENTRY(_system_call) | |||
600 | p2 = [p2]; | 600 | p2 = [p2]; |
601 | 601 | ||
602 | [p2+(TASK_THREAD+THREAD_KSP)] = sp; | 602 | [p2+(TASK_THREAD+THREAD_KSP)] = sp; |
603 | #ifdef CONFIG_IPIPE | ||
604 | r0 = sp; | ||
605 | SP += -12; | ||
606 | call ___ipipe_syscall_root; | ||
607 | SP += 12; | ||
608 | cc = r0 == 1; | ||
609 | if cc jump .Lsyscall_really_exit; | ||
610 | cc = r0 == -1; | ||
611 | if cc jump .Lresume_userspace; | ||
612 | r3 = [sp + PT_R3]; | ||
613 | r4 = [sp + PT_R4]; | ||
614 | p0 = [sp + PT_ORIG_P0]; | ||
615 | #endif /* CONFIG_IPIPE */ | ||
603 | 616 | ||
604 | /* Check the System Call */ | 617 | /* Check the System Call */ |
605 | r7 = __NR_syscall; | 618 | r7 = __NR_syscall; |
@@ -654,6 +667,17 @@ ENTRY(_system_call) | |||
654 | r7 = r7 & r4; | 667 | r7 = r7 & r4; |
655 | 668 | ||
656 | .Lsyscall_resched: | 669 | .Lsyscall_resched: |
670 | #ifdef CONFIG_IPIPE | ||
671 | cc = BITTST(r7, TIF_IRQ_SYNC); | ||
672 | if !cc jump .Lsyscall_no_irqsync; | ||
673 | [--sp] = reti; | ||
674 | r0 = [sp++]; | ||
675 | SP += -12; | ||
676 | call ___ipipe_sync_root; | ||
677 | SP += 12; | ||
678 | jump .Lresume_userspace_1; | ||
679 | .Lsyscall_no_irqsync: | ||
680 | #endif | ||
657 | cc = BITTST(r7, TIF_NEED_RESCHED); | 681 | cc = BITTST(r7, TIF_NEED_RESCHED); |
658 | if !cc jump .Lsyscall_sigpending; | 682 | if !cc jump .Lsyscall_sigpending; |
659 | 683 | ||
@@ -685,6 +709,10 @@ ENTRY(_system_call) | |||
685 | .Lsyscall_really_exit: | 709 | .Lsyscall_really_exit: |
686 | r5 = [sp + PT_RESERVED]; | 710 | r5 = [sp + PT_RESERVED]; |
687 | rets = r5; | 711 | rets = r5; |
712 | #ifdef CONFIG_IPIPE | ||
713 | [--sp] = reti; | ||
714 | r5 = [sp++]; | ||
715 | #endif /* CONFIG_IPIPE */ | ||
688 | rts; | 716 | rts; |
689 | ENDPROC(_system_call) | 717 | ENDPROC(_system_call) |
690 | 718 | ||
@@ -771,6 +799,15 @@ _new_old_task: | |||
771 | ENDPROC(_resume) | 799 | ENDPROC(_resume) |
772 | 800 | ||
773 | ENTRY(_ret_from_exception) | 801 | ENTRY(_ret_from_exception) |
802 | #ifdef CONFIG_IPIPE | ||
803 | [--sp] = rets; | ||
804 | SP += -12; | ||
805 | call ___ipipe_check_root | ||
806 | SP += 12 | ||
807 | rets = [sp++]; | ||
808 | cc = r0 == 0; | ||
809 | if cc jump 4f; /* not on behalf of Linux, get out */ | ||
810 | #endif /* CONFIG_IPIPE */ | ||
774 | p2.l = lo(IPEND); | 811 | p2.l = lo(IPEND); |
775 | p2.h = hi(IPEND); | 812 | p2.h = hi(IPEND); |
776 | 813 | ||
@@ -827,6 +864,28 @@ ENTRY(_ret_from_exception) | |||
827 | rts; | 864 | rts; |
828 | ENDPROC(_ret_from_exception) | 865 | ENDPROC(_ret_from_exception) |
829 | 866 | ||
867 | #ifdef CONFIG_IPIPE | ||
868 | |||
869 | _sync_root_irqs: | ||
870 | [--sp] = reti; /* Reenable interrupts */ | ||
871 | r0 = [sp++]; | ||
872 | jump.l ___ipipe_sync_root | ||
873 | |||
874 | _resume_kernel_from_int: | ||
875 | r0.l = _sync_root_irqs | ||
876 | r0.h = _sync_root_irqs | ||
877 | [--sp] = rets; | ||
878 | [--sp] = ( r7:4, p5:3 ); | ||
879 | SP += -12; | ||
880 | call ___ipipe_call_irqtail | ||
881 | SP += 12; | ||
882 | ( r7:4, p5:3 ) = [sp++]; | ||
883 | rets = [sp++]; | ||
884 | rts | ||
885 | #else | ||
886 | #define _resume_kernel_from_int 2f | ||
887 | #endif | ||
888 | |||
830 | ENTRY(_return_from_int) | 889 | ENTRY(_return_from_int) |
831 | /* If someone else already raised IRQ 15, do nothing. */ | 890 | /* If someone else already raised IRQ 15, do nothing. */ |
832 | csync; | 891 | csync; |
@@ -848,7 +907,7 @@ ENTRY(_return_from_int) | |||
848 | r1 = r0 - r1; | 907 | r1 = r0 - r1; |
849 | r2 = r0 & r1; | 908 | r2 = r0 & r1; |
850 | cc = r2 == 0; | 909 | cc = r2 == 0; |
851 | if !cc jump 2f; | 910 | if !cc jump _resume_kernel_from_int; |
852 | 911 | ||
853 | /* Lower the interrupt level to 15. */ | 912 | /* Lower the interrupt level to 15. */ |
854 | p0.l = lo(EVT15); | 913 | p0.l = lo(EVT15); |
diff --git a/arch/blackfin/mach-common/interrupt.S b/arch/blackfin/mach-common/interrupt.S index 43c4eb9acb65..0069c2dd4625 100644 --- a/arch/blackfin/mach-common/interrupt.S +++ b/arch/blackfin/mach-common/interrupt.S | |||
@@ -235,6 +235,7 @@ ENDPROC(_evt_system_call) | |||
235 | 235 | ||
236 | #ifdef CONFIG_IPIPE | 236 | #ifdef CONFIG_IPIPE |
237 | ENTRY(___ipipe_call_irqtail) | 237 | ENTRY(___ipipe_call_irqtail) |
238 | p0 = r0; | ||
238 | r0.l = 1f; | 239 | r0.l = 1f; |
239 | r0.h = 1f; | 240 | r0.h = 1f; |
240 | reti = r0; | 241 | reti = r0; |
@@ -242,9 +243,6 @@ ENTRY(___ipipe_call_irqtail) | |||
242 | 1: | 243 | 1: |
243 | [--sp] = rets; | 244 | [--sp] = rets; |
244 | [--sp] = ( r7:4, p5:3 ); | 245 | [--sp] = ( r7:4, p5:3 ); |
245 | p0.l = ___ipipe_irq_tail_hook; | ||
246 | p0.h = ___ipipe_irq_tail_hook; | ||
247 | p0 = [p0]; | ||
248 | sp += -12; | 246 | sp += -12; |
249 | call (p0); | 247 | call (p0); |
250 | sp += 12; | 248 | sp += 12; |
@@ -259,7 +257,7 @@ ENTRY(___ipipe_call_irqtail) | |||
259 | p0.h = hi(EVT14); | 257 | p0.h = hi(EVT14); |
260 | [p0] = r0; | 258 | [p0] = r0; |
261 | csync; | 259 | csync; |
262 | r0 = 0x401f; | 260 | r0 = 0x401f (z); |
263 | sti r0; | 261 | sti r0; |
264 | raise 14; | 262 | raise 14; |
265 | [--sp] = reti; /* IRQs on. */ | 263 | [--sp] = reti; /* IRQs on. */ |
@@ -277,11 +275,7 @@ ENTRY(___ipipe_call_irqtail) | |||
277 | p0.h = _bfin_irq_flags; | 275 | p0.h = _bfin_irq_flags; |
278 | r0 = [p0]; | 276 | r0 = [p0]; |
279 | sti r0; | 277 | sti r0; |
280 | #if 0 /* FIXME: this actually raises scheduling latencies */ | ||
281 | /* Reenable interrupts */ | ||
282 | [--sp] = reti; | ||
283 | r0 = [sp++]; | ||
284 | #endif | ||
285 | rts; | 278 | rts; |
286 | ENDPROC(___ipipe_call_irqtail) | 279 | ENDPROC(___ipipe_call_irqtail) |
280 | |||
287 | #endif /* CONFIG_IPIPE */ | 281 | #endif /* CONFIG_IPIPE */ |
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index 202494568c6c..a7d7b2dd4059 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c | |||
@@ -161,11 +161,15 @@ static void bfin_core_unmask_irq(unsigned int irq) | |||
161 | 161 | ||
162 | static void bfin_internal_mask_irq(unsigned int irq) | 162 | static void bfin_internal_mask_irq(unsigned int irq) |
163 | { | 163 | { |
164 | unsigned long flags; | ||
165 | |||
164 | #ifdef CONFIG_BF53x | 166 | #ifdef CONFIG_BF53x |
167 | local_irq_save_hw(flags); | ||
165 | bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() & | 168 | bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() & |
166 | ~(1 << SIC_SYSIRQ(irq))); | 169 | ~(1 << SIC_SYSIRQ(irq))); |
167 | #else | 170 | #else |
168 | unsigned mask_bank, mask_bit; | 171 | unsigned mask_bank, mask_bit; |
172 | local_irq_save_hw(flags); | ||
169 | mask_bank = SIC_SYSIRQ(irq) / 32; | 173 | mask_bank = SIC_SYSIRQ(irq) / 32; |
170 | mask_bit = SIC_SYSIRQ(irq) % 32; | 174 | mask_bit = SIC_SYSIRQ(irq) % 32; |
171 | bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) & | 175 | bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) & |
@@ -175,15 +179,20 @@ static void bfin_internal_mask_irq(unsigned int irq) | |||
175 | ~(1 << mask_bit)); | 179 | ~(1 << mask_bit)); |
176 | #endif | 180 | #endif |
177 | #endif | 181 | #endif |
182 | local_irq_restore_hw(flags); | ||
178 | } | 183 | } |
179 | 184 | ||
180 | static void bfin_internal_unmask_irq(unsigned int irq) | 185 | static void bfin_internal_unmask_irq(unsigned int irq) |
181 | { | 186 | { |
187 | unsigned long flags; | ||
188 | |||
182 | #ifdef CONFIG_BF53x | 189 | #ifdef CONFIG_BF53x |
190 | local_irq_save_hw(flags); | ||
183 | bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() | | 191 | bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() | |
184 | (1 << SIC_SYSIRQ(irq))); | 192 | (1 << SIC_SYSIRQ(irq))); |
185 | #else | 193 | #else |
186 | unsigned mask_bank, mask_bit; | 194 | unsigned mask_bank, mask_bit; |
195 | local_irq_save_hw(flags); | ||
187 | mask_bank = SIC_SYSIRQ(irq) / 32; | 196 | mask_bank = SIC_SYSIRQ(irq) / 32; |
188 | mask_bit = SIC_SYSIRQ(irq) % 32; | 197 | mask_bit = SIC_SYSIRQ(irq) % 32; |
189 | bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) | | 198 | bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) | |
@@ -193,6 +202,7 @@ static void bfin_internal_unmask_irq(unsigned int irq) | |||
193 | (1 << mask_bit)); | 202 | (1 << mask_bit)); |
194 | #endif | 203 | #endif |
195 | #endif | 204 | #endif |
205 | local_irq_restore_hw(flags); | ||
196 | } | 206 | } |
197 | 207 | ||
198 | #ifdef CONFIG_PM | 208 | #ifdef CONFIG_PM |
@@ -390,7 +400,7 @@ static void bfin_demux_error_irq(unsigned int int_err_irq, | |||
390 | static inline void bfin_set_irq_handler(unsigned irq, irq_flow_handler_t handle) | 400 | static inline void bfin_set_irq_handler(unsigned irq, irq_flow_handler_t handle) |
391 | { | 401 | { |
392 | #ifdef CONFIG_IPIPE | 402 | #ifdef CONFIG_IPIPE |
393 | _set_irq_handler(irq, handle_edge_irq); | 403 | _set_irq_handler(irq, handle_level_irq); |
394 | #else | 404 | #else |
395 | struct irq_desc *desc = irq_desc + irq; | 405 | struct irq_desc *desc = irq_desc + irq; |
396 | /* May not call generic set_irq_handler() due to spinlock | 406 | /* May not call generic set_irq_handler() due to spinlock |
@@ -1055,13 +1065,18 @@ int __init init_arch_irq(void) | |||
1055 | #endif | 1065 | #endif |
1056 | default: | 1066 | default: |
1057 | #ifdef CONFIG_IPIPE | 1067 | #ifdef CONFIG_IPIPE |
1058 | /* | 1068 | /* |
1059 | * We want internal interrupt sources to be masked, because | 1069 | * We want internal interrupt sources to be |
1060 | * ISRs may trigger interrupts recursively (e.g. DMA), but | 1070 | * masked, because ISRs may trigger interrupts |
1061 | * interrupts are _not_ masked at CPU level. So let's handle | 1071 | * recursively (e.g. DMA), but interrupts are |
1062 | * them as level interrupts. | 1072 | * _not_ masked at CPU level. So let's handle |
1063 | */ | 1073 | * most of them as level interrupts, except |
1064 | set_irq_handler(irq, handle_level_irq); | 1074 | * the timer interrupt which is special. |
1075 | */ | ||
1076 | if (irq == IRQ_SYSTMR || irq == IRQ_CORETMR) | ||
1077 | set_irq_handler(irq, handle_simple_irq); | ||
1078 | else | ||
1079 | set_irq_handler(irq, handle_level_irq); | ||
1065 | #else /* !CONFIG_IPIPE */ | 1080 | #else /* !CONFIG_IPIPE */ |
1066 | set_irq_handler(irq, handle_simple_irq); | 1081 | set_irq_handler(irq, handle_simple_irq); |
1067 | #endif /* !CONFIG_IPIPE */ | 1082 | #endif /* !CONFIG_IPIPE */ |
@@ -1123,9 +1138,8 @@ int __init init_arch_irq(void) | |||
1123 | 1138 | ||
1124 | #ifdef CONFIG_IPIPE | 1139 | #ifdef CONFIG_IPIPE |
1125 | for (irq = 0; irq < NR_IRQS; irq++) { | 1140 | for (irq = 0; irq < NR_IRQS; irq++) { |
1126 | struct irq_desc *desc = irq_desc + irq; | 1141 | struct irq_desc *desc = irq_to_desc(irq); |
1127 | desc->ic_prio = __ipipe_get_irq_priority(irq); | 1142 | desc->ic_prio = __ipipe_get_irq_priority(irq); |
1128 | desc->thr_prio = __ipipe_get_irqthread_priority(irq); | ||
1129 | } | 1143 | } |
1130 | #endif /* CONFIG_IPIPE */ | 1144 | #endif /* CONFIG_IPIPE */ |
1131 | 1145 | ||
@@ -1208,76 +1222,21 @@ int __ipipe_get_irq_priority(unsigned irq) | |||
1208 | return IVG15; | 1222 | return IVG15; |
1209 | } | 1223 | } |
1210 | 1224 | ||
1211 | int __ipipe_get_irqthread_priority(unsigned irq) | ||
1212 | { | ||
1213 | int ient, prio; | ||
1214 | int demux_irq; | ||
1215 | |||
1216 | /* The returned priority value is rescaled to [0..IVG13+1] | ||
1217 | * with 0 being the lowest effective priority level. */ | ||
1218 | |||
1219 | if (irq <= IRQ_CORETMR) | ||
1220 | return IVG13 - irq + 1; | ||
1221 | |||
1222 | /* GPIO IRQs are given the priority of the demux | ||
1223 | * interrupt. */ | ||
1224 | if (IS_GPIOIRQ(irq)) { | ||
1225 | #if defined(CONFIG_BF54x) | ||
1226 | u32 bank = PINT_2_BANK(irq2pint_lut[irq - SYS_IRQS]); | ||
1227 | demux_irq = (bank == 0 ? IRQ_PINT0 : | ||
1228 | bank == 1 ? IRQ_PINT1 : | ||
1229 | bank == 2 ? IRQ_PINT2 : | ||
1230 | IRQ_PINT3); | ||
1231 | #elif defined(CONFIG_BF561) | ||
1232 | demux_irq = (irq >= IRQ_PF32 ? IRQ_PROG2_INTA : | ||
1233 | irq >= IRQ_PF16 ? IRQ_PROG1_INTA : | ||
1234 | IRQ_PROG0_INTA); | ||
1235 | #elif defined(CONFIG_BF52x) | ||
1236 | demux_irq = (irq >= IRQ_PH0 ? IRQ_PORTH_INTA : | ||
1237 | irq >= IRQ_PG0 ? IRQ_PORTG_INTA : | ||
1238 | IRQ_PORTF_INTA); | ||
1239 | #else | ||
1240 | demux_irq = irq; | ||
1241 | #endif | ||
1242 | return IVG13 - PRIO_GPIODEMUX(demux_irq) + 1; | ||
1243 | } | ||
1244 | |||
1245 | /* The GPIO demux interrupt is given a lower priority | ||
1246 | * than the GPIO IRQs, so that its threaded handler | ||
1247 | * unmasks the interrupt line after the decoded IRQs | ||
1248 | * have been processed. */ | ||
1249 | prio = PRIO_GPIODEMUX(irq); | ||
1250 | /* demux irq? */ | ||
1251 | if (prio != -1) | ||
1252 | return IVG13 - prio; | ||
1253 | |||
1254 | for (ient = 0; ient < NR_PERI_INTS; ient++) { | ||
1255 | struct ivgx *ivg = ivg_table + ient; | ||
1256 | if (ivg->irqno == irq) { | ||
1257 | for (prio = 0; prio <= IVG13-IVG7; prio++) { | ||
1258 | if (ivg7_13[prio].ifirst <= ivg && | ||
1259 | ivg7_13[prio].istop > ivg) | ||
1260 | return IVG7 - prio; | ||
1261 | } | ||
1262 | } | ||
1263 | } | ||
1264 | |||
1265 | return 0; | ||
1266 | } | ||
1267 | |||
1268 | /* Hw interrupts are disabled on entry (check SAVE_CONTEXT). */ | 1225 | /* Hw interrupts are disabled on entry (check SAVE_CONTEXT). */ |
1269 | #ifdef CONFIG_DO_IRQ_L1 | 1226 | #ifdef CONFIG_DO_IRQ_L1 |
1270 | __attribute__((l1_text)) | 1227 | __attribute__((l1_text)) |
1271 | #endif | 1228 | #endif |
1272 | asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs) | 1229 | asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs) |
1273 | { | 1230 | { |
1231 | struct ipipe_percpu_domain_data *p = ipipe_root_cpudom_ptr(); | ||
1232 | struct ipipe_domain *this_domain = ipipe_current_domain; | ||
1274 | struct ivgx *ivg_stop = ivg7_13[vec-IVG7].istop; | 1233 | struct ivgx *ivg_stop = ivg7_13[vec-IVG7].istop; |
1275 | struct ivgx *ivg = ivg7_13[vec-IVG7].ifirst; | 1234 | struct ivgx *ivg = ivg7_13[vec-IVG7].ifirst; |
1276 | int irq; | 1235 | int irq, s; |
1277 | 1236 | ||
1278 | if (likely(vec == EVT_IVTMR_P)) { | 1237 | if (likely(vec == EVT_IVTMR_P)) { |
1279 | irq = IRQ_CORETMR; | 1238 | irq = IRQ_CORETMR; |
1280 | goto handle_irq; | 1239 | goto core_tick; |
1281 | } | 1240 | } |
1282 | 1241 | ||
1283 | SSYNC(); | 1242 | SSYNC(); |
@@ -1319,24 +1278,39 @@ asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs) | |||
1319 | irq = ivg->irqno; | 1278 | irq = ivg->irqno; |
1320 | 1279 | ||
1321 | if (irq == IRQ_SYSTMR) { | 1280 | if (irq == IRQ_SYSTMR) { |
1281 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | ||
1282 | core_tick: | ||
1283 | #else | ||
1322 | bfin_write_TIMER_STATUS(1); /* Latch TIMIL0 */ | 1284 | bfin_write_TIMER_STATUS(1); /* Latch TIMIL0 */ |
1285 | #endif | ||
1323 | /* This is basically what we need from the register frame. */ | 1286 | /* This is basically what we need from the register frame. */ |
1324 | __raw_get_cpu_var(__ipipe_tick_regs).ipend = regs->ipend; | 1287 | __raw_get_cpu_var(__ipipe_tick_regs).ipend = regs->ipend; |
1325 | __raw_get_cpu_var(__ipipe_tick_regs).pc = regs->pc; | 1288 | __raw_get_cpu_var(__ipipe_tick_regs).pc = regs->pc; |
1326 | if (!ipipe_root_domain_p) | 1289 | if (this_domain != ipipe_root_domain) |
1327 | __raw_get_cpu_var(__ipipe_tick_regs).ipend |= 0x10; | ||
1328 | else | ||
1329 | __raw_get_cpu_var(__ipipe_tick_regs).ipend &= ~0x10; | 1290 | __raw_get_cpu_var(__ipipe_tick_regs).ipend &= ~0x10; |
1291 | else | ||
1292 | __raw_get_cpu_var(__ipipe_tick_regs).ipend |= 0x10; | ||
1330 | } | 1293 | } |
1331 | 1294 | ||
1332 | handle_irq: | 1295 | #ifndef CONFIG_GENERIC_CLOCKEVENTS |
1296 | core_tick: | ||
1297 | #endif | ||
1298 | if (this_domain == ipipe_root_domain) { | ||
1299 | s = __test_and_set_bit(IPIPE_SYNCDEFER_FLAG, &p->status); | ||
1300 | barrier(); | ||
1301 | } | ||
1333 | 1302 | ||
1334 | ipipe_trace_irq_entry(irq); | 1303 | ipipe_trace_irq_entry(irq); |
1335 | __ipipe_handle_irq(irq, regs); | 1304 | __ipipe_handle_irq(irq, regs); |
1336 | ipipe_trace_irq_exit(irq); | 1305 | ipipe_trace_irq_exit(irq); |
1337 | 1306 | ||
1338 | if (ipipe_root_domain_p) | 1307 | if (this_domain == ipipe_root_domain) { |
1339 | return !test_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status)); | 1308 | set_thread_flag(TIF_IRQ_SYNC); |
1309 | if (!s) { | ||
1310 | __clear_bit(IPIPE_SYNCDEFER_FLAG, &p->status); | ||
1311 | return !test_bit(IPIPE_STALL_FLAG, &p->status); | ||
1312 | } | ||
1313 | } | ||
1340 | 1314 | ||
1341 | return 0; | 1315 | return 0; |
1342 | } | 1316 | } |
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c index 77c992847094..93eab6146079 100644 --- a/arch/blackfin/mach-common/smp.c +++ b/arch/blackfin/mach-common/smp.c | |||
@@ -158,10 +158,14 @@ static irqreturn_t ipi_handler(int irq, void *dev_instance) | |||
158 | kfree(msg); | 158 | kfree(msg); |
159 | break; | 159 | break; |
160 | case BFIN_IPI_CALL_FUNC: | 160 | case BFIN_IPI_CALL_FUNC: |
161 | spin_unlock(&msg_queue->lock); | ||
161 | ipi_call_function(cpu, msg); | 162 | ipi_call_function(cpu, msg); |
163 | spin_lock(&msg_queue->lock); | ||
162 | break; | 164 | break; |
163 | case BFIN_IPI_CPU_STOP: | 165 | case BFIN_IPI_CPU_STOP: |
166 | spin_unlock(&msg_queue->lock); | ||
164 | ipi_cpu_stop(cpu); | 167 | ipi_cpu_stop(cpu); |
168 | spin_lock(&msg_queue->lock); | ||
165 | kfree(msg); | 169 | kfree(msg); |
166 | break; | 170 | break; |
167 | default: | 171 | default: |
@@ -457,7 +461,7 @@ void smp_icache_flush_range_others(unsigned long start, unsigned long end) | |||
457 | smp_flush_data.start = start; | 461 | smp_flush_data.start = start; |
458 | smp_flush_data.end = end; | 462 | smp_flush_data.end = end; |
459 | 463 | ||
460 | if (smp_call_function(&ipi_flush_icache, &smp_flush_data, 1)) | 464 | if (smp_call_function(&ipi_flush_icache, &smp_flush_data, 0)) |
461 | printk(KERN_WARNING "SMP: failed to run I-cache flush request on other CPUs\n"); | 465 | printk(KERN_WARNING "SMP: failed to run I-cache flush request on other CPUs\n"); |
462 | } | 466 | } |
463 | EXPORT_SYMBOL_GPL(smp_icache_flush_range_others); | 467 | EXPORT_SYMBOL_GPL(smp_icache_flush_range_others); |
diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c index d0532b72bba5..9c3629b9a689 100644 --- a/arch/blackfin/mm/init.c +++ b/arch/blackfin/mm/init.c | |||
@@ -104,7 +104,7 @@ void __init paging_init(void) | |||
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | asmlinkage void init_pda(void) | 107 | asmlinkage void __init init_pda(void) |
108 | { | 108 | { |
109 | unsigned int cpu = raw_smp_processor_id(); | 109 | unsigned int cpu = raw_smp_processor_id(); |
110 | 110 | ||
diff --git a/arch/frv/mm/dma-alloc.c b/arch/frv/mm/dma-alloc.c index dc6522c464d4..44840e73e907 100644 --- a/arch/frv/mm/dma-alloc.c +++ b/arch/frv/mm/dma-alloc.c | |||
@@ -36,10 +36,10 @@ | |||
36 | #include <linux/vmalloc.h> | 36 | #include <linux/vmalloc.h> |
37 | #include <linux/init.h> | 37 | #include <linux/init.h> |
38 | #include <linux/pci.h> | 38 | #include <linux/pci.h> |
39 | #include <linux/hardirq.h> | ||
39 | 40 | ||
40 | #include <asm/pgalloc.h> | 41 | #include <asm/pgalloc.h> |
41 | #include <asm/io.h> | 42 | #include <asm/io.h> |
42 | #include <asm/hardirq.h> | ||
43 | #include <asm/mmu_context.h> | 43 | #include <asm/mmu_context.h> |
44 | #include <asm/pgtable.h> | 44 | #include <asm/pgtable.h> |
45 | #include <asm/mmu.h> | 45 | #include <asm/mmu.h> |
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 6183aeccecf1..153e727a6e8e 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -221,7 +221,11 @@ config IA64_HP_SIM | |||
221 | 221 | ||
222 | config IA64_XEN_GUEST | 222 | config IA64_XEN_GUEST |
223 | bool "Xen guest" | 223 | bool "Xen guest" |
224 | select SWIOTLB | ||
224 | depends on XEN | 225 | depends on XEN |
226 | help | ||
227 | Build a kernel that runs on Xen guest domain. At this moment only | ||
228 | 16KB page size in supported. | ||
225 | 229 | ||
226 | endchoice | 230 | endchoice |
227 | 231 | ||
@@ -479,8 +483,7 @@ config HOLES_IN_ZONE | |||
479 | default y if VIRTUAL_MEM_MAP | 483 | default y if VIRTUAL_MEM_MAP |
480 | 484 | ||
481 | config HAVE_ARCH_EARLY_PFN_TO_NID | 485 | config HAVE_ARCH_EARLY_PFN_TO_NID |
482 | def_bool y | 486 | def_bool NUMA && SPARSEMEM |
483 | depends on NEED_MULTIPLE_NODES | ||
484 | 487 | ||
485 | config HAVE_ARCH_NODEDATA_EXTENSION | 488 | config HAVE_ARCH_NODEDATA_EXTENSION |
486 | def_bool y | 489 | def_bool y |
@@ -635,6 +638,17 @@ config DMAR | |||
635 | and include PCI device scope covered by these DMA | 638 | and include PCI device scope covered by these DMA |
636 | remapping devices. | 639 | remapping devices. |
637 | 640 | ||
641 | config DMAR_DEFAULT_ON | ||
642 | def_bool y | ||
643 | prompt "Enable DMA Remapping Devices by default" | ||
644 | depends on DMAR | ||
645 | help | ||
646 | Selecting this option will enable a DMAR device at boot time if | ||
647 | one is found. If this option is not selected, DMAR support can | ||
648 | be enabled by passing intel_iommu=on to the kernel. It is | ||
649 | recommended you say N here while the DMAR code remains | ||
650 | experimental. | ||
651 | |||
638 | endmenu | 652 | endmenu |
639 | 653 | ||
640 | endif | 654 | endif |
diff --git a/arch/ia64/configs/xen_domu_defconfig b/arch/ia64/configs/xen_domu_defconfig new file mode 100644 index 000000000000..0bb0714dc19d --- /dev/null +++ b/arch/ia64/configs/xen_domu_defconfig | |||
@@ -0,0 +1,1601 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.29-rc1 | ||
4 | # Fri Jan 16 11:49:59 2009 | ||
5 | # | ||
6 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
7 | |||
8 | # | ||
9 | # General setup | ||
10 | # | ||
11 | CONFIG_EXPERIMENTAL=y | ||
12 | CONFIG_LOCK_KERNEL=y | ||
13 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
14 | CONFIG_LOCALVERSION="" | ||
15 | CONFIG_LOCALVERSION_AUTO=y | ||
16 | CONFIG_SWAP=y | ||
17 | CONFIG_SYSVIPC=y | ||
18 | CONFIG_SYSVIPC_SYSCTL=y | ||
19 | CONFIG_POSIX_MQUEUE=y | ||
20 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
21 | # CONFIG_TASKSTATS is not set | ||
22 | # CONFIG_AUDIT is not set | ||
23 | CONFIG_IKCONFIG=y | ||
24 | CONFIG_IKCONFIG_PROC=y | ||
25 | CONFIG_LOG_BUF_SHIFT=20 | ||
26 | CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y | ||
27 | # CONFIG_GROUP_SCHED is not set | ||
28 | |||
29 | # | ||
30 | # Control Group support | ||
31 | # | ||
32 | # CONFIG_CGROUPS is not set | ||
33 | CONFIG_SYSFS_DEPRECATED=y | ||
34 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
35 | # CONFIG_RELAY is not set | ||
36 | CONFIG_NAMESPACES=y | ||
37 | # CONFIG_UTS_NS is not set | ||
38 | # CONFIG_IPC_NS is not set | ||
39 | # CONFIG_USER_NS is not set | ||
40 | # CONFIG_PID_NS is not set | ||
41 | CONFIG_BLK_DEV_INITRD=y | ||
42 | CONFIG_INITRAMFS_SOURCE="" | ||
43 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
44 | CONFIG_SYSCTL=y | ||
45 | # CONFIG_EMBEDDED is not set | ||
46 | CONFIG_SYSCTL_SYSCALL=y | ||
47 | CONFIG_KALLSYMS=y | ||
48 | CONFIG_KALLSYMS_ALL=y | ||
49 | CONFIG_KALLSYMS_STRIP_GENERATED=y | ||
50 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
51 | CONFIG_HOTPLUG=y | ||
52 | CONFIG_PRINTK=y | ||
53 | CONFIG_BUG=y | ||
54 | CONFIG_ELF_CORE=y | ||
55 | CONFIG_COMPAT_BRK=y | ||
56 | CONFIG_BASE_FULL=y | ||
57 | CONFIG_FUTEX=y | ||
58 | CONFIG_ANON_INODES=y | ||
59 | CONFIG_EPOLL=y | ||
60 | CONFIG_SIGNALFD=y | ||
61 | CONFIG_TIMERFD=y | ||
62 | CONFIG_EVENTFD=y | ||
63 | CONFIG_SHMEM=y | ||
64 | CONFIG_AIO=y | ||
65 | CONFIG_VM_EVENT_COUNTERS=y | ||
66 | CONFIG_PCI_QUIRKS=y | ||
67 | CONFIG_SLUB_DEBUG=y | ||
68 | # CONFIG_SLAB is not set | ||
69 | CONFIG_SLUB=y | ||
70 | # CONFIG_SLOB is not set | ||
71 | # CONFIG_PROFILING is not set | ||
72 | CONFIG_HAVE_OPROFILE=y | ||
73 | # CONFIG_KPROBES is not set | ||
74 | CONFIG_HAVE_KPROBES=y | ||
75 | CONFIG_HAVE_KRETPROBES=y | ||
76 | CONFIG_HAVE_ARCH_TRACEHOOK=y | ||
77 | CONFIG_HAVE_DMA_ATTRS=y | ||
78 | CONFIG_USE_GENERIC_SMP_HELPERS=y | ||
79 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
80 | CONFIG_SLABINFO=y | ||
81 | CONFIG_RT_MUTEXES=y | ||
82 | CONFIG_BASE_SMALL=0 | ||
83 | CONFIG_MODULES=y | ||
84 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
85 | CONFIG_MODULE_UNLOAD=y | ||
86 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
87 | CONFIG_MODVERSIONS=y | ||
88 | CONFIG_MODULE_SRCVERSION_ALL=y | ||
89 | CONFIG_STOP_MACHINE=y | ||
90 | CONFIG_BLOCK=y | ||
91 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
92 | # CONFIG_BLK_DEV_BSG is not set | ||
93 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
94 | |||
95 | # | ||
96 | # IO Schedulers | ||
97 | # | ||
98 | CONFIG_IOSCHED_NOOP=y | ||
99 | CONFIG_IOSCHED_AS=y | ||
100 | CONFIG_IOSCHED_DEADLINE=y | ||
101 | CONFIG_IOSCHED_CFQ=y | ||
102 | CONFIG_DEFAULT_AS=y | ||
103 | # CONFIG_DEFAULT_DEADLINE is not set | ||
104 | # CONFIG_DEFAULT_CFQ is not set | ||
105 | # CONFIG_DEFAULT_NOOP is not set | ||
106 | CONFIG_DEFAULT_IOSCHED="anticipatory" | ||
107 | CONFIG_CLASSIC_RCU=y | ||
108 | # CONFIG_TREE_RCU is not set | ||
109 | # CONFIG_PREEMPT_RCU is not set | ||
110 | # CONFIG_TREE_RCU_TRACE is not set | ||
111 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
112 | CONFIG_FREEZER=y | ||
113 | |||
114 | # | ||
115 | # Processor type and features | ||
116 | # | ||
117 | CONFIG_IA64=y | ||
118 | CONFIG_64BIT=y | ||
119 | CONFIG_ZONE_DMA=y | ||
120 | CONFIG_QUICKLIST=y | ||
121 | CONFIG_MMU=y | ||
122 | CONFIG_SWIOTLB=y | ||
123 | CONFIG_IOMMU_HELPER=y | ||
124 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | ||
125 | CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y | ||
126 | CONFIG_GENERIC_FIND_NEXT_BIT=y | ||
127 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
128 | CONFIG_GENERIC_TIME=y | ||
129 | CONFIG_GENERIC_TIME_VSYSCALL=y | ||
130 | CONFIG_HAVE_SETUP_PER_CPU_AREA=y | ||
131 | CONFIG_DMI=y | ||
132 | CONFIG_EFI=y | ||
133 | CONFIG_GENERIC_IOMAP=y | ||
134 | CONFIG_SCHED_OMIT_FRAME_POINTER=y | ||
135 | CONFIG_AUDIT_ARCH=y | ||
136 | CONFIG_PARAVIRT_GUEST=y | ||
137 | CONFIG_PARAVIRT=y | ||
138 | CONFIG_XEN=y | ||
139 | CONFIG_XEN_XENCOMM=y | ||
140 | CONFIG_NO_IDLE_HZ=y | ||
141 | # CONFIG_IA64_GENERIC is not set | ||
142 | # CONFIG_IA64_DIG is not set | ||
143 | # CONFIG_IA64_DIG_VTD is not set | ||
144 | # CONFIG_IA64_HP_ZX1 is not set | ||
145 | # CONFIG_IA64_HP_ZX1_SWIOTLB is not set | ||
146 | # CONFIG_IA64_SGI_SN2 is not set | ||
147 | # CONFIG_IA64_SGI_UV is not set | ||
148 | # CONFIG_IA64_HP_SIM is not set | ||
149 | CONFIG_IA64_XEN_GUEST=y | ||
150 | # CONFIG_ITANIUM is not set | ||
151 | CONFIG_MCKINLEY=y | ||
152 | # CONFIG_IA64_PAGE_SIZE_4KB is not set | ||
153 | # CONFIG_IA64_PAGE_SIZE_8KB is not set | ||
154 | CONFIG_IA64_PAGE_SIZE_16KB=y | ||
155 | # CONFIG_IA64_PAGE_SIZE_64KB is not set | ||
156 | CONFIG_PGTABLE_3=y | ||
157 | # CONFIG_PGTABLE_4 is not set | ||
158 | CONFIG_HZ=250 | ||
159 | # CONFIG_HZ_100 is not set | ||
160 | CONFIG_HZ_250=y | ||
161 | # CONFIG_HZ_300 is not set | ||
162 | # CONFIG_HZ_1000 is not set | ||
163 | # CONFIG_SCHED_HRTICK is not set | ||
164 | CONFIG_IA64_L1_CACHE_SHIFT=7 | ||
165 | CONFIG_IA64_CYCLONE=y | ||
166 | CONFIG_IOSAPIC=y | ||
167 | CONFIG_FORCE_MAX_ZONEORDER=17 | ||
168 | # CONFIG_VIRT_CPU_ACCOUNTING is not set | ||
169 | CONFIG_SMP=y | ||
170 | CONFIG_NR_CPUS=16 | ||
171 | CONFIG_HOTPLUG_CPU=y | ||
172 | CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y | ||
173 | CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y | ||
174 | # CONFIG_SCHED_SMT is not set | ||
175 | CONFIG_PERMIT_BSP_REMOVE=y | ||
176 | CONFIG_FORCE_CPEI_RETARGET=y | ||
177 | CONFIG_PREEMPT_NONE=y | ||
178 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
179 | # CONFIG_PREEMPT is not set | ||
180 | CONFIG_SELECT_MEMORY_MODEL=y | ||
181 | CONFIG_FLATMEM_MANUAL=y | ||
182 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
183 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
184 | CONFIG_FLATMEM=y | ||
185 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
186 | CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y | ||
187 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
188 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
189 | CONFIG_MIGRATION=y | ||
190 | CONFIG_PHYS_ADDR_T_64BIT=y | ||
191 | CONFIG_ZONE_DMA_FLAG=1 | ||
192 | CONFIG_BOUNCE=y | ||
193 | CONFIG_NR_QUICK=1 | ||
194 | CONFIG_VIRT_TO_BUS=y | ||
195 | CONFIG_UNEVICTABLE_LRU=y | ||
196 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | ||
197 | CONFIG_ARCH_DISCONTIGMEM_ENABLE=y | ||
198 | CONFIG_ARCH_FLATMEM_ENABLE=y | ||
199 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | ||
200 | CONFIG_ARCH_POPULATES_NODE_MAP=y | ||
201 | CONFIG_VIRTUAL_MEM_MAP=y | ||
202 | CONFIG_HOLES_IN_ZONE=y | ||
203 | # CONFIG_IA32_SUPPORT is not set | ||
204 | # CONFIG_COMPAT_FOR_U64_ALIGNMENT is not set | ||
205 | CONFIG_IA64_MCA_RECOVERY=y | ||
206 | CONFIG_PERFMON=y | ||
207 | CONFIG_IA64_PALINFO=y | ||
208 | # CONFIG_IA64_MC_ERR_INJECT is not set | ||
209 | # CONFIG_IA64_ESI is not set | ||
210 | # CONFIG_IA64_HP_AML_NFW is not set | ||
211 | CONFIG_KEXEC=y | ||
212 | # CONFIG_CRASH_DUMP is not set | ||
213 | |||
214 | # | ||
215 | # Firmware Drivers | ||
216 | # | ||
217 | # CONFIG_FIRMWARE_MEMMAP is not set | ||
218 | CONFIG_EFI_VARS=y | ||
219 | CONFIG_EFI_PCDP=y | ||
220 | CONFIG_DMIID=y | ||
221 | CONFIG_BINFMT_ELF=y | ||
222 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
223 | # CONFIG_HAVE_AOUT is not set | ||
224 | CONFIG_BINFMT_MISC=m | ||
225 | |||
226 | # | ||
227 | # Power management and ACPI options | ||
228 | # | ||
229 | CONFIG_PM=y | ||
230 | # CONFIG_PM_DEBUG is not set | ||
231 | CONFIG_PM_SLEEP=y | ||
232 | CONFIG_SUSPEND=y | ||
233 | CONFIG_SUSPEND_FREEZER=y | ||
234 | CONFIG_ACPI=y | ||
235 | CONFIG_ACPI_SLEEP=y | ||
236 | CONFIG_ACPI_PROCFS=y | ||
237 | CONFIG_ACPI_PROCFS_POWER=y | ||
238 | CONFIG_ACPI_SYSFS_POWER=y | ||
239 | CONFIG_ACPI_PROC_EVENT=y | ||
240 | CONFIG_ACPI_BUTTON=m | ||
241 | CONFIG_ACPI_FAN=m | ||
242 | # CONFIG_ACPI_DOCK is not set | ||
243 | CONFIG_ACPI_PROCESSOR=m | ||
244 | CONFIG_ACPI_HOTPLUG_CPU=y | ||
245 | CONFIG_ACPI_THERMAL=m | ||
246 | # CONFIG_ACPI_CUSTOM_DSDT is not set | ||
247 | CONFIG_ACPI_BLACKLIST_YEAR=0 | ||
248 | # CONFIG_ACPI_DEBUG is not set | ||
249 | # CONFIG_ACPI_PCI_SLOT is not set | ||
250 | CONFIG_ACPI_SYSTEM=y | ||
251 | CONFIG_ACPI_CONTAINER=m | ||
252 | |||
253 | # | ||
254 | # CPU Frequency scaling | ||
255 | # | ||
256 | # CONFIG_CPU_FREQ is not set | ||
257 | |||
258 | # | ||
259 | # Bus options (PCI, PCMCIA) | ||
260 | # | ||
261 | CONFIG_PCI=y | ||
262 | CONFIG_PCI_DOMAINS=y | ||
263 | CONFIG_PCI_SYSCALL=y | ||
264 | # CONFIG_PCIEPORTBUS is not set | ||
265 | CONFIG_ARCH_SUPPORTS_MSI=y | ||
266 | # CONFIG_PCI_MSI is not set | ||
267 | CONFIG_PCI_LEGACY=y | ||
268 | # CONFIG_PCI_DEBUG is not set | ||
269 | # CONFIG_PCI_STUB is not set | ||
270 | CONFIG_HOTPLUG_PCI=m | ||
271 | # CONFIG_HOTPLUG_PCI_FAKE is not set | ||
272 | CONFIG_HOTPLUG_PCI_ACPI=m | ||
273 | # CONFIG_HOTPLUG_PCI_ACPI_IBM is not set | ||
274 | # CONFIG_HOTPLUG_PCI_CPCI is not set | ||
275 | # CONFIG_HOTPLUG_PCI_SHPC is not set | ||
276 | # CONFIG_PCCARD is not set | ||
277 | CONFIG_NET=y | ||
278 | |||
279 | # | ||
280 | # Networking options | ||
281 | # | ||
282 | # CONFIG_NET_NS is not set | ||
283 | CONFIG_COMPAT_NET_DEV_OPS=y | ||
284 | CONFIG_PACKET=y | ||
285 | # CONFIG_PACKET_MMAP is not set | ||
286 | CONFIG_UNIX=y | ||
287 | CONFIG_XFRM=y | ||
288 | # CONFIG_XFRM_USER is not set | ||
289 | # CONFIG_XFRM_SUB_POLICY is not set | ||
290 | # CONFIG_XFRM_MIGRATE is not set | ||
291 | # CONFIG_XFRM_STATISTICS is not set | ||
292 | # CONFIG_NET_KEY is not set | ||
293 | CONFIG_INET=y | ||
294 | CONFIG_IP_MULTICAST=y | ||
295 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
296 | CONFIG_IP_FIB_HASH=y | ||
297 | # CONFIG_IP_PNP is not set | ||
298 | # CONFIG_NET_IPIP is not set | ||
299 | # CONFIG_NET_IPGRE is not set | ||
300 | # CONFIG_IP_MROUTE is not set | ||
301 | CONFIG_ARPD=y | ||
302 | CONFIG_SYN_COOKIES=y | ||
303 | # CONFIG_INET_AH is not set | ||
304 | # CONFIG_INET_ESP is not set | ||
305 | # CONFIG_INET_IPCOMP is not set | ||
306 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
307 | # CONFIG_INET_TUNNEL is not set | ||
308 | CONFIG_INET_XFRM_MODE_TRANSPORT=y | ||
309 | CONFIG_INET_XFRM_MODE_TUNNEL=y | ||
310 | CONFIG_INET_XFRM_MODE_BEET=y | ||
311 | # CONFIG_INET_LRO is not set | ||
312 | CONFIG_INET_DIAG=y | ||
313 | CONFIG_INET_TCP_DIAG=y | ||
314 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
315 | CONFIG_TCP_CONG_CUBIC=y | ||
316 | CONFIG_DEFAULT_TCP_CONG="cubic" | ||
317 | # CONFIG_TCP_MD5SIG is not set | ||
318 | # CONFIG_IPV6 is not set | ||
319 | # CONFIG_NETWORK_SECMARK is not set | ||
320 | # CONFIG_NETFILTER is not set | ||
321 | # CONFIG_IP_DCCP is not set | ||
322 | # CONFIG_IP_SCTP is not set | ||
323 | # CONFIG_TIPC is not set | ||
324 | # CONFIG_ATM is not set | ||
325 | # CONFIG_BRIDGE is not set | ||
326 | # CONFIG_NET_DSA is not set | ||
327 | # CONFIG_VLAN_8021Q is not set | ||
328 | # CONFIG_DECNET is not set | ||
329 | # CONFIG_LLC2 is not set | ||
330 | # CONFIG_IPX is not set | ||
331 | # CONFIG_ATALK is not set | ||
332 | # CONFIG_X25 is not set | ||
333 | # CONFIG_LAPB is not set | ||
334 | # CONFIG_ECONET is not set | ||
335 | # CONFIG_WAN_ROUTER is not set | ||
336 | # CONFIG_NET_SCHED is not set | ||
337 | # CONFIG_DCB is not set | ||
338 | |||
339 | # | ||
340 | # Network testing | ||
341 | # | ||
342 | # CONFIG_NET_PKTGEN is not set | ||
343 | # CONFIG_HAMRADIO is not set | ||
344 | # CONFIG_CAN is not set | ||
345 | # CONFIG_IRDA is not set | ||
346 | # CONFIG_BT is not set | ||
347 | # CONFIG_AF_RXRPC is not set | ||
348 | # CONFIG_PHONET is not set | ||
349 | # CONFIG_WIRELESS is not set | ||
350 | # CONFIG_WIMAX is not set | ||
351 | # CONFIG_RFKILL is not set | ||
352 | # CONFIG_NET_9P is not set | ||
353 | |||
354 | # | ||
355 | # Device Drivers | ||
356 | # | ||
357 | |||
358 | # | ||
359 | # Generic Driver Options | ||
360 | # | ||
361 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
362 | CONFIG_STANDALONE=y | ||
363 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
364 | CONFIG_FW_LOADER=y | ||
365 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
366 | CONFIG_EXTRA_FIRMWARE="" | ||
367 | # CONFIG_DEBUG_DRIVER is not set | ||
368 | # CONFIG_DEBUG_DEVRES is not set | ||
369 | # CONFIG_SYS_HYPERVISOR is not set | ||
370 | # CONFIG_CONNECTOR is not set | ||
371 | # CONFIG_MTD is not set | ||
372 | # CONFIG_PARPORT is not set | ||
373 | CONFIG_PNP=y | ||
374 | CONFIG_PNP_DEBUG_MESSAGES=y | ||
375 | |||
376 | # | ||
377 | # Protocols | ||
378 | # | ||
379 | CONFIG_PNPACPI=y | ||
380 | CONFIG_BLK_DEV=y | ||
381 | # CONFIG_BLK_CPQ_DA is not set | ||
382 | # CONFIG_BLK_CPQ_CISS_DA is not set | ||
383 | # CONFIG_BLK_DEV_DAC960 is not set | ||
384 | # CONFIG_BLK_DEV_UMEM is not set | ||
385 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
386 | CONFIG_BLK_DEV_LOOP=m | ||
387 | CONFIG_BLK_DEV_CRYPTOLOOP=m | ||
388 | CONFIG_BLK_DEV_NBD=m | ||
389 | # CONFIG_BLK_DEV_SX8 is not set | ||
390 | # CONFIG_BLK_DEV_UB is not set | ||
391 | CONFIG_BLK_DEV_RAM=y | ||
392 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
393 | CONFIG_BLK_DEV_RAM_SIZE=4096 | ||
394 | # CONFIG_BLK_DEV_XIP is not set | ||
395 | # CONFIG_CDROM_PKTCDVD is not set | ||
396 | # CONFIG_ATA_OVER_ETH is not set | ||
397 | CONFIG_XEN_BLKDEV_FRONTEND=y | ||
398 | # CONFIG_BLK_DEV_HD is not set | ||
399 | CONFIG_MISC_DEVICES=y | ||
400 | # CONFIG_PHANTOM is not set | ||
401 | # CONFIG_EEPROM_93CX6 is not set | ||
402 | # CONFIG_SGI_IOC4 is not set | ||
403 | # CONFIG_TIFM_CORE is not set | ||
404 | # CONFIG_ICS932S401 is not set | ||
405 | # CONFIG_ENCLOSURE_SERVICES is not set | ||
406 | # CONFIG_HP_ILO is not set | ||
407 | # CONFIG_C2PORT is not set | ||
408 | CONFIG_HAVE_IDE=y | ||
409 | CONFIG_IDE=y | ||
410 | |||
411 | # | ||
412 | # Please see Documentation/ide/ide.txt for help/info on IDE drives | ||
413 | # | ||
414 | CONFIG_IDE_TIMINGS=y | ||
415 | CONFIG_IDE_ATAPI=y | ||
416 | # CONFIG_BLK_DEV_IDE_SATA is not set | ||
417 | CONFIG_IDE_GD=y | ||
418 | CONFIG_IDE_GD_ATA=y | ||
419 | # CONFIG_IDE_GD_ATAPI is not set | ||
420 | CONFIG_BLK_DEV_IDECD=y | ||
421 | CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y | ||
422 | # CONFIG_BLK_DEV_IDETAPE is not set | ||
423 | # CONFIG_BLK_DEV_IDEACPI is not set | ||
424 | # CONFIG_IDE_TASK_IOCTL is not set | ||
425 | CONFIG_IDE_PROC_FS=y | ||
426 | |||
427 | # | ||
428 | # IDE chipset support/bugfixes | ||
429 | # | ||
430 | # CONFIG_IDE_GENERIC is not set | ||
431 | # CONFIG_BLK_DEV_PLATFORM is not set | ||
432 | # CONFIG_BLK_DEV_IDEPNP is not set | ||
433 | CONFIG_BLK_DEV_IDEDMA_SFF=y | ||
434 | |||
435 | # | ||
436 | # PCI IDE chipsets support | ||
437 | # | ||
438 | CONFIG_BLK_DEV_IDEPCI=y | ||
439 | CONFIG_IDEPCI_PCIBUS_ORDER=y | ||
440 | # CONFIG_BLK_DEV_OFFBOARD is not set | ||
441 | CONFIG_BLK_DEV_GENERIC=y | ||
442 | # CONFIG_BLK_DEV_OPTI621 is not set | ||
443 | CONFIG_BLK_DEV_IDEDMA_PCI=y | ||
444 | # CONFIG_BLK_DEV_AEC62XX is not set | ||
445 | # CONFIG_BLK_DEV_ALI15X3 is not set | ||
446 | # CONFIG_BLK_DEV_AMD74XX is not set | ||
447 | CONFIG_BLK_DEV_CMD64X=y | ||
448 | # CONFIG_BLK_DEV_TRIFLEX is not set | ||
449 | # CONFIG_BLK_DEV_CS5520 is not set | ||
450 | # CONFIG_BLK_DEV_CS5530 is not set | ||
451 | # CONFIG_BLK_DEV_HPT366 is not set | ||
452 | # CONFIG_BLK_DEV_JMICRON is not set | ||
453 | # CONFIG_BLK_DEV_SC1200 is not set | ||
454 | CONFIG_BLK_DEV_PIIX=y | ||
455 | # CONFIG_BLK_DEV_IT8172 is not set | ||
456 | # CONFIG_BLK_DEV_IT8213 is not set | ||
457 | # CONFIG_BLK_DEV_IT821X is not set | ||
458 | # CONFIG_BLK_DEV_NS87415 is not set | ||
459 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | ||
460 | # CONFIG_BLK_DEV_PDC202XX_NEW is not set | ||
461 | # CONFIG_BLK_DEV_SVWKS is not set | ||
462 | # CONFIG_BLK_DEV_SIIMAGE is not set | ||
463 | # CONFIG_BLK_DEV_SLC90E66 is not set | ||
464 | # CONFIG_BLK_DEV_TRM290 is not set | ||
465 | # CONFIG_BLK_DEV_VIA82CXXX is not set | ||
466 | # CONFIG_BLK_DEV_TC86C001 is not set | ||
467 | CONFIG_BLK_DEV_IDEDMA=y | ||
468 | |||
469 | # | ||
470 | # SCSI device support | ||
471 | # | ||
472 | # CONFIG_RAID_ATTRS is not set | ||
473 | CONFIG_SCSI=y | ||
474 | CONFIG_SCSI_DMA=y | ||
475 | # CONFIG_SCSI_TGT is not set | ||
476 | CONFIG_SCSI_NETLINK=y | ||
477 | CONFIG_SCSI_PROC_FS=y | ||
478 | |||
479 | # | ||
480 | # SCSI support type (disk, tape, CD-ROM) | ||
481 | # | ||
482 | CONFIG_BLK_DEV_SD=y | ||
483 | CONFIG_CHR_DEV_ST=m | ||
484 | # CONFIG_CHR_DEV_OSST is not set | ||
485 | CONFIG_BLK_DEV_SR=m | ||
486 | # CONFIG_BLK_DEV_SR_VENDOR is not set | ||
487 | CONFIG_CHR_DEV_SG=m | ||
488 | # CONFIG_CHR_DEV_SCH is not set | ||
489 | |||
490 | # | ||
491 | # Some SCSI devices (e.g. CD jukebox) support multiple LUNs | ||
492 | # | ||
493 | # CONFIG_SCSI_MULTI_LUN is not set | ||
494 | # CONFIG_SCSI_CONSTANTS is not set | ||
495 | # CONFIG_SCSI_LOGGING is not set | ||
496 | # CONFIG_SCSI_SCAN_ASYNC is not set | ||
497 | CONFIG_SCSI_WAIT_SCAN=m | ||
498 | |||
499 | # | ||
500 | # SCSI Transports | ||
501 | # | ||
502 | CONFIG_SCSI_SPI_ATTRS=y | ||
503 | CONFIG_SCSI_FC_ATTRS=y | ||
504 | # CONFIG_SCSI_ISCSI_ATTRS is not set | ||
505 | # CONFIG_SCSI_SAS_LIBSAS is not set | ||
506 | # CONFIG_SCSI_SRP_ATTRS is not set | ||
507 | CONFIG_SCSI_LOWLEVEL=y | ||
508 | # CONFIG_ISCSI_TCP is not set | ||
509 | # CONFIG_SCSI_CXGB3_ISCSI is not set | ||
510 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set | ||
511 | # CONFIG_SCSI_3W_9XXX is not set | ||
512 | # CONFIG_SCSI_ACARD is not set | ||
513 | # CONFIG_SCSI_AACRAID is not set | ||
514 | # CONFIG_SCSI_AIC7XXX is not set | ||
515 | # CONFIG_SCSI_AIC7XXX_OLD is not set | ||
516 | # CONFIG_SCSI_AIC79XX is not set | ||
517 | # CONFIG_SCSI_AIC94XX is not set | ||
518 | # CONFIG_SCSI_DPT_I2O is not set | ||
519 | # CONFIG_SCSI_ADVANSYS is not set | ||
520 | # CONFIG_SCSI_ARCMSR is not set | ||
521 | # CONFIG_MEGARAID_NEWGEN is not set | ||
522 | # CONFIG_MEGARAID_LEGACY is not set | ||
523 | # CONFIG_MEGARAID_SAS is not set | ||
524 | # CONFIG_SCSI_HPTIOP is not set | ||
525 | # CONFIG_LIBFC is not set | ||
526 | # CONFIG_FCOE is not set | ||
527 | # CONFIG_SCSI_DMX3191D is not set | ||
528 | # CONFIG_SCSI_FUTURE_DOMAIN is not set | ||
529 | # CONFIG_SCSI_IPS is not set | ||
530 | # CONFIG_SCSI_INITIO is not set | ||
531 | # CONFIG_SCSI_INIA100 is not set | ||
532 | # CONFIG_SCSI_MVSAS is not set | ||
533 | # CONFIG_SCSI_STEX is not set | ||
534 | CONFIG_SCSI_SYM53C8XX_2=y | ||
535 | CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 | ||
536 | CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 | ||
537 | CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 | ||
538 | CONFIG_SCSI_SYM53C8XX_MMIO=y | ||
539 | CONFIG_SCSI_QLOGIC_1280=y | ||
540 | # CONFIG_SCSI_QLA_FC is not set | ||
541 | # CONFIG_SCSI_QLA_ISCSI is not set | ||
542 | # CONFIG_SCSI_LPFC is not set | ||
543 | # CONFIG_SCSI_DC395x is not set | ||
544 | # CONFIG_SCSI_DC390T is not set | ||
545 | # CONFIG_SCSI_DEBUG is not set | ||
546 | # CONFIG_SCSI_SRP is not set | ||
547 | # CONFIG_SCSI_DH is not set | ||
548 | # CONFIG_ATA is not set | ||
549 | CONFIG_MD=y | ||
550 | CONFIG_BLK_DEV_MD=m | ||
551 | CONFIG_MD_LINEAR=m | ||
552 | CONFIG_MD_RAID0=m | ||
553 | CONFIG_MD_RAID1=m | ||
554 | # CONFIG_MD_RAID10 is not set | ||
555 | # CONFIG_MD_RAID456 is not set | ||
556 | CONFIG_MD_MULTIPATH=m | ||
557 | # CONFIG_MD_FAULTY is not set | ||
558 | CONFIG_BLK_DEV_DM=m | ||
559 | # CONFIG_DM_DEBUG is not set | ||
560 | CONFIG_DM_CRYPT=m | ||
561 | CONFIG_DM_SNAPSHOT=m | ||
562 | CONFIG_DM_MIRROR=m | ||
563 | CONFIG_DM_ZERO=m | ||
564 | # CONFIG_DM_MULTIPATH is not set | ||
565 | # CONFIG_DM_DELAY is not set | ||
566 | # CONFIG_DM_UEVENT is not set | ||
567 | CONFIG_FUSION=y | ||
568 | CONFIG_FUSION_SPI=y | ||
569 | CONFIG_FUSION_FC=y | ||
570 | # CONFIG_FUSION_SAS is not set | ||
571 | CONFIG_FUSION_MAX_SGE=128 | ||
572 | CONFIG_FUSION_CTL=y | ||
573 | # CONFIG_FUSION_LOGGING is not set | ||
574 | |||
575 | # | ||
576 | # IEEE 1394 (FireWire) support | ||
577 | # | ||
578 | |||
579 | # | ||
580 | # Enable only one of the two stacks, unless you know what you are doing | ||
581 | # | ||
582 | # CONFIG_FIREWIRE is not set | ||
583 | # CONFIG_IEEE1394 is not set | ||
584 | # CONFIG_I2O is not set | ||
585 | CONFIG_NETDEVICES=y | ||
586 | CONFIG_DUMMY=m | ||
587 | # CONFIG_BONDING is not set | ||
588 | # CONFIG_MACVLAN is not set | ||
589 | # CONFIG_EQUALIZER is not set | ||
590 | # CONFIG_TUN is not set | ||
591 | # CONFIG_VETH is not set | ||
592 | # CONFIG_NET_SB1000 is not set | ||
593 | # CONFIG_ARCNET is not set | ||
594 | CONFIG_PHYLIB=y | ||
595 | |||
596 | # | ||
597 | # MII PHY device drivers | ||
598 | # | ||
599 | # CONFIG_MARVELL_PHY is not set | ||
600 | # CONFIG_DAVICOM_PHY is not set | ||
601 | # CONFIG_QSEMI_PHY is not set | ||
602 | # CONFIG_LXT_PHY is not set | ||
603 | # CONFIG_CICADA_PHY is not set | ||
604 | # CONFIG_VITESSE_PHY is not set | ||
605 | # CONFIG_SMSC_PHY is not set | ||
606 | # CONFIG_BROADCOM_PHY is not set | ||
607 | # CONFIG_ICPLUS_PHY is not set | ||
608 | # CONFIG_REALTEK_PHY is not set | ||
609 | # CONFIG_NATIONAL_PHY is not set | ||
610 | # CONFIG_STE10XP is not set | ||
611 | # CONFIG_LSI_ET1011C_PHY is not set | ||
612 | # CONFIG_FIXED_PHY is not set | ||
613 | # CONFIG_MDIO_BITBANG is not set | ||
614 | CONFIG_NET_ETHERNET=y | ||
615 | CONFIG_MII=m | ||
616 | # CONFIG_HAPPYMEAL is not set | ||
617 | # CONFIG_SUNGEM is not set | ||
618 | # CONFIG_CASSINI is not set | ||
619 | # CONFIG_NET_VENDOR_3COM is not set | ||
620 | CONFIG_NET_TULIP=y | ||
621 | # CONFIG_DE2104X is not set | ||
622 | CONFIG_TULIP=m | ||
623 | # CONFIG_TULIP_MWI is not set | ||
624 | # CONFIG_TULIP_MMIO is not set | ||
625 | # CONFIG_TULIP_NAPI is not set | ||
626 | # CONFIG_DE4X5 is not set | ||
627 | # CONFIG_WINBOND_840 is not set | ||
628 | # CONFIG_DM9102 is not set | ||
629 | # CONFIG_ULI526X is not set | ||
630 | # CONFIG_HP100 is not set | ||
631 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | ||
632 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | ||
633 | # CONFIG_IBM_NEW_EMAC_TAH is not set | ||
634 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | ||
635 | # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set | ||
636 | # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set | ||
637 | # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set | ||
638 | CONFIG_NET_PCI=y | ||
639 | # CONFIG_PCNET32 is not set | ||
640 | # CONFIG_AMD8111_ETH is not set | ||
641 | # CONFIG_ADAPTEC_STARFIRE is not set | ||
642 | # CONFIG_B44 is not set | ||
643 | # CONFIG_FORCEDETH is not set | ||
644 | CONFIG_E100=m | ||
645 | # CONFIG_FEALNX is not set | ||
646 | # CONFIG_NATSEMI is not set | ||
647 | # CONFIG_NE2K_PCI is not set | ||
648 | # CONFIG_8139CP is not set | ||
649 | # CONFIG_8139TOO is not set | ||
650 | # CONFIG_R6040 is not set | ||
651 | # CONFIG_SIS900 is not set | ||
652 | # CONFIG_EPIC100 is not set | ||
653 | # CONFIG_SMSC9420 is not set | ||
654 | # CONFIG_SUNDANCE is not set | ||
655 | # CONFIG_TLAN is not set | ||
656 | # CONFIG_VIA_RHINE is not set | ||
657 | # CONFIG_SC92031 is not set | ||
658 | # CONFIG_ATL2 is not set | ||
659 | CONFIG_NETDEV_1000=y | ||
660 | # CONFIG_ACENIC is not set | ||
661 | # CONFIG_DL2K is not set | ||
662 | CONFIG_E1000=y | ||
663 | # CONFIG_E1000E is not set | ||
664 | # CONFIG_IP1000 is not set | ||
665 | # CONFIG_IGB is not set | ||
666 | # CONFIG_NS83820 is not set | ||
667 | # CONFIG_HAMACHI is not set | ||
668 | # CONFIG_YELLOWFIN is not set | ||
669 | # CONFIG_R8169 is not set | ||
670 | # CONFIG_SIS190 is not set | ||
671 | # CONFIG_SKGE is not set | ||
672 | # CONFIG_SKY2 is not set | ||
673 | # CONFIG_VIA_VELOCITY is not set | ||
674 | CONFIG_TIGON3=y | ||
675 | # CONFIG_BNX2 is not set | ||
676 | # CONFIG_QLA3XXX is not set | ||
677 | # CONFIG_ATL1 is not set | ||
678 | # CONFIG_ATL1E is not set | ||
679 | # CONFIG_JME is not set | ||
680 | CONFIG_NETDEV_10000=y | ||
681 | # CONFIG_CHELSIO_T1 is not set | ||
682 | CONFIG_CHELSIO_T3_DEPENDS=y | ||
683 | # CONFIG_CHELSIO_T3 is not set | ||
684 | # CONFIG_ENIC is not set | ||
685 | # CONFIG_IXGBE is not set | ||
686 | # CONFIG_IXGB is not set | ||
687 | # CONFIG_S2IO is not set | ||
688 | # CONFIG_MYRI10GE is not set | ||
689 | # CONFIG_NETXEN_NIC is not set | ||
690 | # CONFIG_NIU is not set | ||
691 | # CONFIG_MLX4_EN is not set | ||
692 | # CONFIG_MLX4_CORE is not set | ||
693 | # CONFIG_TEHUTI is not set | ||
694 | # CONFIG_BNX2X is not set | ||
695 | # CONFIG_QLGE is not set | ||
696 | # CONFIG_SFC is not set | ||
697 | # CONFIG_TR is not set | ||
698 | |||
699 | # | ||
700 | # Wireless LAN | ||
701 | # | ||
702 | # CONFIG_WLAN_PRE80211 is not set | ||
703 | # CONFIG_WLAN_80211 is not set | ||
704 | # CONFIG_IWLWIFI_LEDS is not set | ||
705 | |||
706 | # | ||
707 | # Enable WiMAX (Networking options) to see the WiMAX drivers | ||
708 | # | ||
709 | |||
710 | # | ||
711 | # USB Network Adapters | ||
712 | # | ||
713 | # CONFIG_USB_CATC is not set | ||
714 | # CONFIG_USB_KAWETH is not set | ||
715 | # CONFIG_USB_PEGASUS is not set | ||
716 | # CONFIG_USB_RTL8150 is not set | ||
717 | # CONFIG_USB_USBNET is not set | ||
718 | # CONFIG_WAN is not set | ||
719 | CONFIG_XEN_NETDEV_FRONTEND=y | ||
720 | # CONFIG_FDDI is not set | ||
721 | # CONFIG_HIPPI is not set | ||
722 | # CONFIG_PPP is not set | ||
723 | # CONFIG_SLIP is not set | ||
724 | # CONFIG_NET_FC is not set | ||
725 | CONFIG_NETCONSOLE=y | ||
726 | # CONFIG_NETCONSOLE_DYNAMIC is not set | ||
727 | CONFIG_NETPOLL=y | ||
728 | # CONFIG_NETPOLL_TRAP is not set | ||
729 | CONFIG_NET_POLL_CONTROLLER=y | ||
730 | # CONFIG_ISDN is not set | ||
731 | # CONFIG_PHONE is not set | ||
732 | |||
733 | # | ||
734 | # Input device support | ||
735 | # | ||
736 | CONFIG_INPUT=y | ||
737 | # CONFIG_INPUT_FF_MEMLESS is not set | ||
738 | # CONFIG_INPUT_POLLDEV is not set | ||
739 | |||
740 | # | ||
741 | # Userland interfaces | ||
742 | # | ||
743 | CONFIG_INPUT_MOUSEDEV=y | ||
744 | CONFIG_INPUT_MOUSEDEV_PSAUX=y | ||
745 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
746 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
747 | # CONFIG_INPUT_JOYDEV is not set | ||
748 | # CONFIG_INPUT_EVDEV is not set | ||
749 | # CONFIG_INPUT_EVBUG is not set | ||
750 | |||
751 | # | ||
752 | # Input Device Drivers | ||
753 | # | ||
754 | CONFIG_INPUT_KEYBOARD=y | ||
755 | CONFIG_KEYBOARD_ATKBD=y | ||
756 | # CONFIG_KEYBOARD_SUNKBD is not set | ||
757 | # CONFIG_KEYBOARD_LKKBD is not set | ||
758 | # CONFIG_KEYBOARD_XTKBD is not set | ||
759 | # CONFIG_KEYBOARD_NEWTON is not set | ||
760 | # CONFIG_KEYBOARD_STOWAWAY is not set | ||
761 | CONFIG_INPUT_MOUSE=y | ||
762 | CONFIG_MOUSE_PS2=y | ||
763 | CONFIG_MOUSE_PS2_ALPS=y | ||
764 | CONFIG_MOUSE_PS2_LOGIPS2PP=y | ||
765 | CONFIG_MOUSE_PS2_SYNAPTICS=y | ||
766 | CONFIG_MOUSE_PS2_LIFEBOOK=y | ||
767 | CONFIG_MOUSE_PS2_TRACKPOINT=y | ||
768 | # CONFIG_MOUSE_PS2_ELANTECH is not set | ||
769 | # CONFIG_MOUSE_PS2_TOUCHKIT is not set | ||
770 | # CONFIG_MOUSE_SERIAL is not set | ||
771 | # CONFIG_MOUSE_APPLETOUCH is not set | ||
772 | # CONFIG_MOUSE_BCM5974 is not set | ||
773 | # CONFIG_MOUSE_VSXXXAA is not set | ||
774 | # CONFIG_INPUT_JOYSTICK is not set | ||
775 | # CONFIG_INPUT_TABLET is not set | ||
776 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
777 | # CONFIG_INPUT_MISC is not set | ||
778 | |||
779 | # | ||
780 | # Hardware I/O ports | ||
781 | # | ||
782 | CONFIG_SERIO=y | ||
783 | CONFIG_SERIO_I8042=y | ||
784 | # CONFIG_SERIO_SERPORT is not set | ||
785 | # CONFIG_SERIO_PCIPS2 is not set | ||
786 | CONFIG_SERIO_LIBPS2=y | ||
787 | # CONFIG_SERIO_RAW is not set | ||
788 | CONFIG_GAMEPORT=m | ||
789 | # CONFIG_GAMEPORT_NS558 is not set | ||
790 | # CONFIG_GAMEPORT_L4 is not set | ||
791 | # CONFIG_GAMEPORT_EMU10K1 is not set | ||
792 | # CONFIG_GAMEPORT_FM801 is not set | ||
793 | |||
794 | # | ||
795 | # Character devices | ||
796 | # | ||
797 | CONFIG_VT=y | ||
798 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
799 | CONFIG_VT_CONSOLE=y | ||
800 | CONFIG_HW_CONSOLE=y | ||
801 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
802 | CONFIG_DEVKMEM=y | ||
803 | CONFIG_SERIAL_NONSTANDARD=y | ||
804 | # CONFIG_COMPUTONE is not set | ||
805 | # CONFIG_ROCKETPORT is not set | ||
806 | # CONFIG_CYCLADES is not set | ||
807 | # CONFIG_DIGIEPCA is not set | ||
808 | # CONFIG_MOXA_INTELLIO is not set | ||
809 | # CONFIG_MOXA_SMARTIO is not set | ||
810 | # CONFIG_ISI is not set | ||
811 | # CONFIG_SYNCLINKMP is not set | ||
812 | # CONFIG_SYNCLINK_GT is not set | ||
813 | # CONFIG_N_HDLC is not set | ||
814 | # CONFIG_RISCOM8 is not set | ||
815 | # CONFIG_SPECIALIX is not set | ||
816 | # CONFIG_SX is not set | ||
817 | # CONFIG_RIO is not set | ||
818 | # CONFIG_STALDRV is not set | ||
819 | # CONFIG_NOZOMI is not set | ||
820 | |||
821 | # | ||
822 | # Serial drivers | ||
823 | # | ||
824 | CONFIG_SERIAL_8250=y | ||
825 | CONFIG_SERIAL_8250_CONSOLE=y | ||
826 | CONFIG_SERIAL_8250_PCI=y | ||
827 | CONFIG_SERIAL_8250_PNP=y | ||
828 | CONFIG_SERIAL_8250_NR_UARTS=6 | ||
829 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | ||
830 | CONFIG_SERIAL_8250_EXTENDED=y | ||
831 | CONFIG_SERIAL_8250_SHARE_IRQ=y | ||
832 | # CONFIG_SERIAL_8250_DETECT_IRQ is not set | ||
833 | # CONFIG_SERIAL_8250_RSA is not set | ||
834 | |||
835 | # | ||
836 | # Non-8250 serial port support | ||
837 | # | ||
838 | CONFIG_SERIAL_CORE=y | ||
839 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
840 | # CONFIG_SERIAL_JSM is not set | ||
841 | CONFIG_UNIX98_PTYS=y | ||
842 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
843 | CONFIG_LEGACY_PTYS=y | ||
844 | CONFIG_LEGACY_PTY_COUNT=256 | ||
845 | CONFIG_HVC_DRIVER=y | ||
846 | CONFIG_HVC_IRQ=y | ||
847 | CONFIG_HVC_XEN=y | ||
848 | # CONFIG_IPMI_HANDLER is not set | ||
849 | # CONFIG_HW_RANDOM is not set | ||
850 | CONFIG_EFI_RTC=y | ||
851 | # CONFIG_R3964 is not set | ||
852 | # CONFIG_APPLICOM is not set | ||
853 | CONFIG_RAW_DRIVER=m | ||
854 | CONFIG_MAX_RAW_DEVS=256 | ||
855 | CONFIG_HPET=y | ||
856 | CONFIG_HPET_MMAP=y | ||
857 | # CONFIG_HANGCHECK_TIMER is not set | ||
858 | # CONFIG_TCG_TPM is not set | ||
859 | CONFIG_DEVPORT=y | ||
860 | CONFIG_I2C=m | ||
861 | CONFIG_I2C_BOARDINFO=y | ||
862 | # CONFIG_I2C_CHARDEV is not set | ||
863 | CONFIG_I2C_HELPER_AUTO=y | ||
864 | CONFIG_I2C_ALGOBIT=m | ||
865 | |||
866 | # | ||
867 | # I2C Hardware Bus support | ||
868 | # | ||
869 | |||
870 | # | ||
871 | # PC SMBus host controller drivers | ||
872 | # | ||
873 | # CONFIG_I2C_ALI1535 is not set | ||
874 | # CONFIG_I2C_ALI1563 is not set | ||
875 | # CONFIG_I2C_ALI15X3 is not set | ||
876 | # CONFIG_I2C_AMD756 is not set | ||
877 | # CONFIG_I2C_AMD8111 is not set | ||
878 | # CONFIG_I2C_I801 is not set | ||
879 | # CONFIG_I2C_ISCH is not set | ||
880 | # CONFIG_I2C_PIIX4 is not set | ||
881 | # CONFIG_I2C_NFORCE2 is not set | ||
882 | # CONFIG_I2C_SIS5595 is not set | ||
883 | # CONFIG_I2C_SIS630 is not set | ||
884 | # CONFIG_I2C_SIS96X is not set | ||
885 | # CONFIG_I2C_VIA is not set | ||
886 | # CONFIG_I2C_VIAPRO is not set | ||
887 | |||
888 | # | ||
889 | # I2C system bus drivers (mostly embedded / system-on-chip) | ||
890 | # | ||
891 | # CONFIG_I2C_OCORES is not set | ||
892 | # CONFIG_I2C_SIMTEC is not set | ||
893 | |||
894 | # | ||
895 | # External I2C/SMBus adapter drivers | ||
896 | # | ||
897 | # CONFIG_I2C_PARPORT_LIGHT is not set | ||
898 | # CONFIG_I2C_TAOS_EVM is not set | ||
899 | # CONFIG_I2C_TINY_USB is not set | ||
900 | |||
901 | # | ||
902 | # Graphics adapter I2C/DDC channel drivers | ||
903 | # | ||
904 | # CONFIG_I2C_VOODOO3 is not set | ||
905 | |||
906 | # | ||
907 | # Other I2C/SMBus bus drivers | ||
908 | # | ||
909 | # CONFIG_I2C_PCA_PLATFORM is not set | ||
910 | # CONFIG_I2C_STUB is not set | ||
911 | |||
912 | # | ||
913 | # Miscellaneous I2C Chip support | ||
914 | # | ||
915 | # CONFIG_DS1682 is not set | ||
916 | # CONFIG_AT24 is not set | ||
917 | # CONFIG_SENSORS_EEPROM is not set | ||
918 | # CONFIG_SENSORS_PCF8574 is not set | ||
919 | # CONFIG_PCF8575 is not set | ||
920 | # CONFIG_SENSORS_PCA9539 is not set | ||
921 | # CONFIG_SENSORS_PCF8591 is not set | ||
922 | # CONFIG_SENSORS_MAX6875 is not set | ||
923 | # CONFIG_SENSORS_TSL2550 is not set | ||
924 | # CONFIG_I2C_DEBUG_CORE is not set | ||
925 | # CONFIG_I2C_DEBUG_ALGO is not set | ||
926 | # CONFIG_I2C_DEBUG_BUS is not set | ||
927 | # CONFIG_I2C_DEBUG_CHIP is not set | ||
928 | # CONFIG_SPI is not set | ||
929 | # CONFIG_W1 is not set | ||
930 | CONFIG_POWER_SUPPLY=y | ||
931 | # CONFIG_POWER_SUPPLY_DEBUG is not set | ||
932 | # CONFIG_PDA_POWER is not set | ||
933 | # CONFIG_BATTERY_DS2760 is not set | ||
934 | # CONFIG_BATTERY_BQ27x00 is not set | ||
935 | CONFIG_HWMON=y | ||
936 | # CONFIG_HWMON_VID is not set | ||
937 | # CONFIG_SENSORS_AD7414 is not set | ||
938 | # CONFIG_SENSORS_AD7418 is not set | ||
939 | # CONFIG_SENSORS_ADM1021 is not set | ||
940 | # CONFIG_SENSORS_ADM1025 is not set | ||
941 | # CONFIG_SENSORS_ADM1026 is not set | ||
942 | # CONFIG_SENSORS_ADM1029 is not set | ||
943 | # CONFIG_SENSORS_ADM1031 is not set | ||
944 | # CONFIG_SENSORS_ADM9240 is not set | ||
945 | # CONFIG_SENSORS_ADT7462 is not set | ||
946 | # CONFIG_SENSORS_ADT7470 is not set | ||
947 | # CONFIG_SENSORS_ADT7473 is not set | ||
948 | # CONFIG_SENSORS_ATXP1 is not set | ||
949 | # CONFIG_SENSORS_DS1621 is not set | ||
950 | # CONFIG_SENSORS_I5K_AMB is not set | ||
951 | # CONFIG_SENSORS_F71805F is not set | ||
952 | # CONFIG_SENSORS_F71882FG is not set | ||
953 | # CONFIG_SENSORS_F75375S is not set | ||
954 | # CONFIG_SENSORS_GL518SM is not set | ||
955 | # CONFIG_SENSORS_GL520SM is not set | ||
956 | # CONFIG_SENSORS_IT87 is not set | ||
957 | # CONFIG_SENSORS_LM63 is not set | ||
958 | # CONFIG_SENSORS_LM75 is not set | ||
959 | # CONFIG_SENSORS_LM77 is not set | ||
960 | # CONFIG_SENSORS_LM78 is not set | ||
961 | # CONFIG_SENSORS_LM80 is not set | ||
962 | # CONFIG_SENSORS_LM83 is not set | ||
963 | # CONFIG_SENSORS_LM85 is not set | ||
964 | # CONFIG_SENSORS_LM87 is not set | ||
965 | # CONFIG_SENSORS_LM90 is not set | ||
966 | # CONFIG_SENSORS_LM92 is not set | ||
967 | # CONFIG_SENSORS_LM93 is not set | ||
968 | # CONFIG_SENSORS_LTC4245 is not set | ||
969 | # CONFIG_SENSORS_MAX1619 is not set | ||
970 | # CONFIG_SENSORS_MAX6650 is not set | ||
971 | # CONFIG_SENSORS_PC87360 is not set | ||
972 | # CONFIG_SENSORS_PC87427 is not set | ||
973 | # CONFIG_SENSORS_SIS5595 is not set | ||
974 | # CONFIG_SENSORS_DME1737 is not set | ||
975 | # CONFIG_SENSORS_SMSC47M1 is not set | ||
976 | # CONFIG_SENSORS_SMSC47M192 is not set | ||
977 | # CONFIG_SENSORS_SMSC47B397 is not set | ||
978 | # CONFIG_SENSORS_ADS7828 is not set | ||
979 | # CONFIG_SENSORS_THMC50 is not set | ||
980 | # CONFIG_SENSORS_VIA686A is not set | ||
981 | # CONFIG_SENSORS_VT1211 is not set | ||
982 | # CONFIG_SENSORS_VT8231 is not set | ||
983 | # CONFIG_SENSORS_W83781D is not set | ||
984 | # CONFIG_SENSORS_W83791D is not set | ||
985 | # CONFIG_SENSORS_W83792D is not set | ||
986 | # CONFIG_SENSORS_W83793 is not set | ||
987 | # CONFIG_SENSORS_W83L785TS is not set | ||
988 | # CONFIG_SENSORS_W83L786NG is not set | ||
989 | # CONFIG_SENSORS_W83627HF is not set | ||
990 | # CONFIG_SENSORS_W83627EHF is not set | ||
991 | # CONFIG_SENSORS_LIS3LV02D is not set | ||
992 | # CONFIG_HWMON_DEBUG_CHIP is not set | ||
993 | CONFIG_THERMAL=m | ||
994 | # CONFIG_THERMAL_HWMON is not set | ||
995 | # CONFIG_WATCHDOG is not set | ||
996 | CONFIG_SSB_POSSIBLE=y | ||
997 | |||
998 | # | ||
999 | # Sonics Silicon Backplane | ||
1000 | # | ||
1001 | # CONFIG_SSB is not set | ||
1002 | |||
1003 | # | ||
1004 | # Multifunction device drivers | ||
1005 | # | ||
1006 | # CONFIG_MFD_CORE is not set | ||
1007 | # CONFIG_MFD_SM501 is not set | ||
1008 | # CONFIG_HTC_PASIC3 is not set | ||
1009 | # CONFIG_MFD_TMIO is not set | ||
1010 | # CONFIG_MFD_WM8400 is not set | ||
1011 | # CONFIG_MFD_WM8350_I2C is not set | ||
1012 | # CONFIG_MFD_PCF50633 is not set | ||
1013 | # CONFIG_REGULATOR is not set | ||
1014 | |||
1015 | # | ||
1016 | # Multimedia devices | ||
1017 | # | ||
1018 | |||
1019 | # | ||
1020 | # Multimedia core support | ||
1021 | # | ||
1022 | # CONFIG_VIDEO_DEV is not set | ||
1023 | # CONFIG_DVB_CORE is not set | ||
1024 | # CONFIG_VIDEO_MEDIA is not set | ||
1025 | |||
1026 | # | ||
1027 | # Multimedia drivers | ||
1028 | # | ||
1029 | CONFIG_DAB=y | ||
1030 | # CONFIG_USB_DABUSB is not set | ||
1031 | |||
1032 | # | ||
1033 | # Graphics support | ||
1034 | # | ||
1035 | CONFIG_AGP=m | ||
1036 | CONFIG_DRM=m | ||
1037 | CONFIG_DRM_TDFX=m | ||
1038 | CONFIG_DRM_R128=m | ||
1039 | CONFIG_DRM_RADEON=m | ||
1040 | CONFIG_DRM_MGA=m | ||
1041 | CONFIG_DRM_SIS=m | ||
1042 | # CONFIG_DRM_VIA is not set | ||
1043 | # CONFIG_DRM_SAVAGE is not set | ||
1044 | # CONFIG_VGASTATE is not set | ||
1045 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
1046 | # CONFIG_FB is not set | ||
1047 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
1048 | |||
1049 | # | ||
1050 | # Display device support | ||
1051 | # | ||
1052 | # CONFIG_DISPLAY_SUPPORT is not set | ||
1053 | |||
1054 | # | ||
1055 | # Console display driver support | ||
1056 | # | ||
1057 | CONFIG_VGA_CONSOLE=y | ||
1058 | # CONFIG_VGACON_SOFT_SCROLLBACK is not set | ||
1059 | CONFIG_DUMMY_CONSOLE=y | ||
1060 | # CONFIG_SOUND is not set | ||
1061 | CONFIG_HID_SUPPORT=y | ||
1062 | CONFIG_HID=y | ||
1063 | # CONFIG_HID_DEBUG is not set | ||
1064 | # CONFIG_HIDRAW is not set | ||
1065 | |||
1066 | # | ||
1067 | # USB Input Devices | ||
1068 | # | ||
1069 | CONFIG_USB_HID=y | ||
1070 | # CONFIG_HID_PID is not set | ||
1071 | # CONFIG_USB_HIDDEV is not set | ||
1072 | |||
1073 | # | ||
1074 | # Special HID drivers | ||
1075 | # | ||
1076 | CONFIG_HID_COMPAT=y | ||
1077 | CONFIG_HID_A4TECH=y | ||
1078 | CONFIG_HID_APPLE=y | ||
1079 | CONFIG_HID_BELKIN=y | ||
1080 | CONFIG_HID_CHERRY=y | ||
1081 | CONFIG_HID_CHICONY=y | ||
1082 | CONFIG_HID_CYPRESS=y | ||
1083 | CONFIG_HID_EZKEY=y | ||
1084 | CONFIG_HID_GYRATION=y | ||
1085 | CONFIG_HID_LOGITECH=y | ||
1086 | # CONFIG_LOGITECH_FF is not set | ||
1087 | # CONFIG_LOGIRUMBLEPAD2_FF is not set | ||
1088 | CONFIG_HID_MICROSOFT=y | ||
1089 | CONFIG_HID_MONTEREY=y | ||
1090 | CONFIG_HID_NTRIG=y | ||
1091 | CONFIG_HID_PANTHERLORD=y | ||
1092 | # CONFIG_PANTHERLORD_FF is not set | ||
1093 | CONFIG_HID_PETALYNX=y | ||
1094 | CONFIG_HID_SAMSUNG=y | ||
1095 | CONFIG_HID_SONY=y | ||
1096 | CONFIG_HID_SUNPLUS=y | ||
1097 | # CONFIG_GREENASIA_FF is not set | ||
1098 | CONFIG_HID_TOPSEED=y | ||
1099 | # CONFIG_THRUSTMASTER_FF is not set | ||
1100 | # CONFIG_ZEROPLUS_FF is not set | ||
1101 | CONFIG_USB_SUPPORT=y | ||
1102 | CONFIG_USB_ARCH_HAS_HCD=y | ||
1103 | CONFIG_USB_ARCH_HAS_OHCI=y | ||
1104 | CONFIG_USB_ARCH_HAS_EHCI=y | ||
1105 | CONFIG_USB=y | ||
1106 | # CONFIG_USB_DEBUG is not set | ||
1107 | # CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set | ||
1108 | |||
1109 | # | ||
1110 | # Miscellaneous USB options | ||
1111 | # | ||
1112 | CONFIG_USB_DEVICEFS=y | ||
1113 | CONFIG_USB_DEVICE_CLASS=y | ||
1114 | # CONFIG_USB_DYNAMIC_MINORS is not set | ||
1115 | # CONFIG_USB_SUSPEND is not set | ||
1116 | # CONFIG_USB_OTG is not set | ||
1117 | # CONFIG_USB_MON is not set | ||
1118 | # CONFIG_USB_WUSB is not set | ||
1119 | # CONFIG_USB_WUSB_CBAF is not set | ||
1120 | |||
1121 | # | ||
1122 | # USB Host Controller Drivers | ||
1123 | # | ||
1124 | # CONFIG_USB_C67X00_HCD is not set | ||
1125 | CONFIG_USB_EHCI_HCD=m | ||
1126 | # CONFIG_USB_EHCI_ROOT_HUB_TT is not set | ||
1127 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set | ||
1128 | # CONFIG_USB_OXU210HP_HCD is not set | ||
1129 | # CONFIG_USB_ISP116X_HCD is not set | ||
1130 | # CONFIG_USB_ISP1760_HCD is not set | ||
1131 | CONFIG_USB_OHCI_HCD=m | ||
1132 | # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set | ||
1133 | # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set | ||
1134 | CONFIG_USB_OHCI_LITTLE_ENDIAN=y | ||
1135 | CONFIG_USB_UHCI_HCD=y | ||
1136 | # CONFIG_USB_SL811_HCD is not set | ||
1137 | # CONFIG_USB_R8A66597_HCD is not set | ||
1138 | # CONFIG_USB_WHCI_HCD is not set | ||
1139 | # CONFIG_USB_HWA_HCD is not set | ||
1140 | |||
1141 | # | ||
1142 | # USB Device Class drivers | ||
1143 | # | ||
1144 | # CONFIG_USB_ACM is not set | ||
1145 | # CONFIG_USB_PRINTER is not set | ||
1146 | # CONFIG_USB_WDM is not set | ||
1147 | # CONFIG_USB_TMC is not set | ||
1148 | |||
1149 | # | ||
1150 | # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; | ||
1151 | # | ||
1152 | |||
1153 | # | ||
1154 | # see USB_STORAGE Help for more information | ||
1155 | # | ||
1156 | CONFIG_USB_STORAGE=m | ||
1157 | # CONFIG_USB_STORAGE_DEBUG is not set | ||
1158 | # CONFIG_USB_STORAGE_DATAFAB is not set | ||
1159 | # CONFIG_USB_STORAGE_FREECOM is not set | ||
1160 | # CONFIG_USB_STORAGE_ISD200 is not set | ||
1161 | # CONFIG_USB_STORAGE_USBAT is not set | ||
1162 | # CONFIG_USB_STORAGE_SDDR09 is not set | ||
1163 | # CONFIG_USB_STORAGE_SDDR55 is not set | ||
1164 | # CONFIG_USB_STORAGE_JUMPSHOT is not set | ||
1165 | # CONFIG_USB_STORAGE_ALAUDA is not set | ||
1166 | # CONFIG_USB_STORAGE_ONETOUCH is not set | ||
1167 | # CONFIG_USB_STORAGE_KARMA is not set | ||
1168 | # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set | ||
1169 | # CONFIG_USB_LIBUSUAL is not set | ||
1170 | |||
1171 | # | ||
1172 | # USB Imaging devices | ||
1173 | # | ||
1174 | # CONFIG_USB_MDC800 is not set | ||
1175 | # CONFIG_USB_MICROTEK is not set | ||
1176 | |||
1177 | # | ||
1178 | # USB port drivers | ||
1179 | # | ||
1180 | # CONFIG_USB_SERIAL is not set | ||
1181 | |||
1182 | # | ||
1183 | # USB Miscellaneous drivers | ||
1184 | # | ||
1185 | # CONFIG_USB_EMI62 is not set | ||
1186 | # CONFIG_USB_EMI26 is not set | ||
1187 | # CONFIG_USB_ADUTUX is not set | ||
1188 | # CONFIG_USB_SEVSEG is not set | ||
1189 | # CONFIG_USB_RIO500 is not set | ||
1190 | # CONFIG_USB_LEGOTOWER is not set | ||
1191 | # CONFIG_USB_LCD is not set | ||
1192 | # CONFIG_USB_BERRY_CHARGE is not set | ||
1193 | # CONFIG_USB_LED is not set | ||
1194 | # CONFIG_USB_CYPRESS_CY7C63 is not set | ||
1195 | # CONFIG_USB_CYTHERM is not set | ||
1196 | # CONFIG_USB_PHIDGET is not set | ||
1197 | # CONFIG_USB_IDMOUSE is not set | ||
1198 | # CONFIG_USB_FTDI_ELAN is not set | ||
1199 | # CONFIG_USB_APPLEDISPLAY is not set | ||
1200 | # CONFIG_USB_SISUSBVGA is not set | ||
1201 | # CONFIG_USB_LD is not set | ||
1202 | # CONFIG_USB_TRANCEVIBRATOR is not set | ||
1203 | # CONFIG_USB_IOWARRIOR is not set | ||
1204 | # CONFIG_USB_TEST is not set | ||
1205 | # CONFIG_USB_ISIGHTFW is not set | ||
1206 | # CONFIG_USB_VST is not set | ||
1207 | # CONFIG_USB_GADGET is not set | ||
1208 | |||
1209 | # | ||
1210 | # OTG and related infrastructure | ||
1211 | # | ||
1212 | # CONFIG_UWB is not set | ||
1213 | # CONFIG_MMC is not set | ||
1214 | # CONFIG_MEMSTICK is not set | ||
1215 | # CONFIG_NEW_LEDS is not set | ||
1216 | # CONFIG_ACCESSIBILITY is not set | ||
1217 | # CONFIG_INFINIBAND is not set | ||
1218 | # CONFIG_RTC_CLASS is not set | ||
1219 | # CONFIG_DMADEVICES is not set | ||
1220 | # CONFIG_UIO is not set | ||
1221 | CONFIG_XEN_BALLOON=y | ||
1222 | CONFIG_XEN_SCRUB_PAGES=y | ||
1223 | CONFIG_XENFS=y | ||
1224 | CONFIG_XEN_COMPAT_XENFS=y | ||
1225 | # CONFIG_STAGING is not set | ||
1226 | # CONFIG_MSPEC is not set | ||
1227 | |||
1228 | # | ||
1229 | # File systems | ||
1230 | # | ||
1231 | CONFIG_EXT2_FS=y | ||
1232 | CONFIG_EXT2_FS_XATTR=y | ||
1233 | CONFIG_EXT2_FS_POSIX_ACL=y | ||
1234 | CONFIG_EXT2_FS_SECURITY=y | ||
1235 | # CONFIG_EXT2_FS_XIP is not set | ||
1236 | CONFIG_EXT3_FS=y | ||
1237 | CONFIG_EXT3_FS_XATTR=y | ||
1238 | CONFIG_EXT3_FS_POSIX_ACL=y | ||
1239 | CONFIG_EXT3_FS_SECURITY=y | ||
1240 | # CONFIG_EXT4_FS is not set | ||
1241 | CONFIG_JBD=y | ||
1242 | CONFIG_FS_MBCACHE=y | ||
1243 | CONFIG_REISERFS_FS=y | ||
1244 | # CONFIG_REISERFS_CHECK is not set | ||
1245 | # CONFIG_REISERFS_PROC_INFO is not set | ||
1246 | CONFIG_REISERFS_FS_XATTR=y | ||
1247 | CONFIG_REISERFS_FS_POSIX_ACL=y | ||
1248 | CONFIG_REISERFS_FS_SECURITY=y | ||
1249 | # CONFIG_JFS_FS is not set | ||
1250 | CONFIG_FS_POSIX_ACL=y | ||
1251 | CONFIG_FILE_LOCKING=y | ||
1252 | CONFIG_XFS_FS=y | ||
1253 | # CONFIG_XFS_QUOTA is not set | ||
1254 | # CONFIG_XFS_POSIX_ACL is not set | ||
1255 | # CONFIG_XFS_RT is not set | ||
1256 | # CONFIG_XFS_DEBUG is not set | ||
1257 | # CONFIG_GFS2_FS is not set | ||
1258 | # CONFIG_OCFS2_FS is not set | ||
1259 | # CONFIG_BTRFS_FS is not set | ||
1260 | CONFIG_DNOTIFY=y | ||
1261 | CONFIG_INOTIFY=y | ||
1262 | CONFIG_INOTIFY_USER=y | ||
1263 | # CONFIG_QUOTA is not set | ||
1264 | CONFIG_AUTOFS_FS=y | ||
1265 | CONFIG_AUTOFS4_FS=y | ||
1266 | # CONFIG_FUSE_FS is not set | ||
1267 | |||
1268 | # | ||
1269 | # CD-ROM/DVD Filesystems | ||
1270 | # | ||
1271 | CONFIG_ISO9660_FS=m | ||
1272 | CONFIG_JOLIET=y | ||
1273 | # CONFIG_ZISOFS is not set | ||
1274 | CONFIG_UDF_FS=m | ||
1275 | CONFIG_UDF_NLS=y | ||
1276 | |||
1277 | # | ||
1278 | # DOS/FAT/NT Filesystems | ||
1279 | # | ||
1280 | CONFIG_FAT_FS=y | ||
1281 | # CONFIG_MSDOS_FS is not set | ||
1282 | CONFIG_VFAT_FS=y | ||
1283 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
1284 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | ||
1285 | CONFIG_NTFS_FS=m | ||
1286 | # CONFIG_NTFS_DEBUG is not set | ||
1287 | # CONFIG_NTFS_RW is not set | ||
1288 | |||
1289 | # | ||
1290 | # Pseudo filesystems | ||
1291 | # | ||
1292 | CONFIG_PROC_FS=y | ||
1293 | CONFIG_PROC_KCORE=y | ||
1294 | CONFIG_PROC_SYSCTL=y | ||
1295 | CONFIG_PROC_PAGE_MONITOR=y | ||
1296 | CONFIG_SYSFS=y | ||
1297 | CONFIG_TMPFS=y | ||
1298 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
1299 | CONFIG_HUGETLBFS=y | ||
1300 | CONFIG_HUGETLB_PAGE=y | ||
1301 | # CONFIG_CONFIGFS_FS is not set | ||
1302 | CONFIG_MISC_FILESYSTEMS=y | ||
1303 | # CONFIG_ADFS_FS is not set | ||
1304 | # CONFIG_AFFS_FS is not set | ||
1305 | # CONFIG_HFS_FS is not set | ||
1306 | # CONFIG_HFSPLUS_FS is not set | ||
1307 | # CONFIG_BEFS_FS is not set | ||
1308 | # CONFIG_BFS_FS is not set | ||
1309 | # CONFIG_EFS_FS is not set | ||
1310 | # CONFIG_CRAMFS is not set | ||
1311 | # CONFIG_SQUASHFS is not set | ||
1312 | # CONFIG_VXFS_FS is not set | ||
1313 | # CONFIG_MINIX_FS is not set | ||
1314 | # CONFIG_OMFS_FS is not set | ||
1315 | # CONFIG_HPFS_FS is not set | ||
1316 | # CONFIG_QNX4FS_FS is not set | ||
1317 | # CONFIG_ROMFS_FS is not set | ||
1318 | # CONFIG_SYSV_FS is not set | ||
1319 | # CONFIG_UFS_FS is not set | ||
1320 | CONFIG_NETWORK_FILESYSTEMS=y | ||
1321 | CONFIG_NFS_FS=m | ||
1322 | CONFIG_NFS_V3=y | ||
1323 | # CONFIG_NFS_V3_ACL is not set | ||
1324 | CONFIG_NFS_V4=y | ||
1325 | CONFIG_NFSD=m | ||
1326 | CONFIG_NFSD_V3=y | ||
1327 | # CONFIG_NFSD_V3_ACL is not set | ||
1328 | CONFIG_NFSD_V4=y | ||
1329 | CONFIG_LOCKD=m | ||
1330 | CONFIG_LOCKD_V4=y | ||
1331 | CONFIG_EXPORTFS=m | ||
1332 | CONFIG_NFS_COMMON=y | ||
1333 | CONFIG_SUNRPC=m | ||
1334 | CONFIG_SUNRPC_GSS=m | ||
1335 | # CONFIG_SUNRPC_REGISTER_V4 is not set | ||
1336 | CONFIG_RPCSEC_GSS_KRB5=m | ||
1337 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | ||
1338 | CONFIG_SMB_FS=m | ||
1339 | CONFIG_SMB_NLS_DEFAULT=y | ||
1340 | CONFIG_SMB_NLS_REMOTE="cp437" | ||
1341 | CONFIG_CIFS=m | ||
1342 | # CONFIG_CIFS_STATS is not set | ||
1343 | # CONFIG_CIFS_WEAK_PW_HASH is not set | ||
1344 | # CONFIG_CIFS_XATTR is not set | ||
1345 | # CONFIG_CIFS_DEBUG2 is not set | ||
1346 | # CONFIG_CIFS_EXPERIMENTAL is not set | ||
1347 | # CONFIG_NCP_FS is not set | ||
1348 | # CONFIG_CODA_FS is not set | ||
1349 | # CONFIG_AFS_FS is not set | ||
1350 | |||
1351 | # | ||
1352 | # Partition Types | ||
1353 | # | ||
1354 | CONFIG_PARTITION_ADVANCED=y | ||
1355 | # CONFIG_ACORN_PARTITION is not set | ||
1356 | # CONFIG_OSF_PARTITION is not set | ||
1357 | # CONFIG_AMIGA_PARTITION is not set | ||
1358 | # CONFIG_ATARI_PARTITION is not set | ||
1359 | # CONFIG_MAC_PARTITION is not set | ||
1360 | CONFIG_MSDOS_PARTITION=y | ||
1361 | # CONFIG_BSD_DISKLABEL is not set | ||
1362 | # CONFIG_MINIX_SUBPARTITION is not set | ||
1363 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
1364 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
1365 | # CONFIG_LDM_PARTITION is not set | ||
1366 | CONFIG_SGI_PARTITION=y | ||
1367 | # CONFIG_ULTRIX_PARTITION is not set | ||
1368 | # CONFIG_SUN_PARTITION is not set | ||
1369 | # CONFIG_KARMA_PARTITION is not set | ||
1370 | CONFIG_EFI_PARTITION=y | ||
1371 | # CONFIG_SYSV68_PARTITION is not set | ||
1372 | CONFIG_NLS=y | ||
1373 | CONFIG_NLS_DEFAULT="iso8859-1" | ||
1374 | CONFIG_NLS_CODEPAGE_437=y | ||
1375 | CONFIG_NLS_CODEPAGE_737=m | ||
1376 | CONFIG_NLS_CODEPAGE_775=m | ||
1377 | CONFIG_NLS_CODEPAGE_850=m | ||
1378 | CONFIG_NLS_CODEPAGE_852=m | ||
1379 | CONFIG_NLS_CODEPAGE_855=m | ||
1380 | CONFIG_NLS_CODEPAGE_857=m | ||
1381 | CONFIG_NLS_CODEPAGE_860=m | ||
1382 | CONFIG_NLS_CODEPAGE_861=m | ||
1383 | CONFIG_NLS_CODEPAGE_862=m | ||
1384 | CONFIG_NLS_CODEPAGE_863=m | ||
1385 | CONFIG_NLS_CODEPAGE_864=m | ||
1386 | CONFIG_NLS_CODEPAGE_865=m | ||
1387 | CONFIG_NLS_CODEPAGE_866=m | ||
1388 | CONFIG_NLS_CODEPAGE_869=m | ||
1389 | CONFIG_NLS_CODEPAGE_936=m | ||
1390 | CONFIG_NLS_CODEPAGE_950=m | ||
1391 | CONFIG_NLS_CODEPAGE_932=m | ||
1392 | CONFIG_NLS_CODEPAGE_949=m | ||
1393 | CONFIG_NLS_CODEPAGE_874=m | ||
1394 | CONFIG_NLS_ISO8859_8=m | ||
1395 | CONFIG_NLS_CODEPAGE_1250=m | ||
1396 | CONFIG_NLS_CODEPAGE_1251=m | ||
1397 | # CONFIG_NLS_ASCII is not set | ||
1398 | CONFIG_NLS_ISO8859_1=y | ||
1399 | CONFIG_NLS_ISO8859_2=m | ||
1400 | CONFIG_NLS_ISO8859_3=m | ||
1401 | CONFIG_NLS_ISO8859_4=m | ||
1402 | CONFIG_NLS_ISO8859_5=m | ||
1403 | CONFIG_NLS_ISO8859_6=m | ||
1404 | CONFIG_NLS_ISO8859_7=m | ||
1405 | CONFIG_NLS_ISO8859_9=m | ||
1406 | CONFIG_NLS_ISO8859_13=m | ||
1407 | CONFIG_NLS_ISO8859_14=m | ||
1408 | CONFIG_NLS_ISO8859_15=m | ||
1409 | CONFIG_NLS_KOI8_R=m | ||
1410 | CONFIG_NLS_KOI8_U=m | ||
1411 | CONFIG_NLS_UTF8=m | ||
1412 | # CONFIG_DLM is not set | ||
1413 | |||
1414 | # | ||
1415 | # Kernel hacking | ||
1416 | # | ||
1417 | # CONFIG_PRINTK_TIME is not set | ||
1418 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
1419 | CONFIG_ENABLE_MUST_CHECK=y | ||
1420 | CONFIG_FRAME_WARN=2048 | ||
1421 | CONFIG_MAGIC_SYSRQ=y | ||
1422 | # CONFIG_UNUSED_SYMBOLS is not set | ||
1423 | # CONFIG_DEBUG_FS is not set | ||
1424 | # CONFIG_HEADERS_CHECK is not set | ||
1425 | CONFIG_DEBUG_KERNEL=y | ||
1426 | # CONFIG_DEBUG_SHIRQ is not set | ||
1427 | CONFIG_DETECT_SOFTLOCKUP=y | ||
1428 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
1429 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
1430 | CONFIG_SCHED_DEBUG=y | ||
1431 | # CONFIG_SCHEDSTATS is not set | ||
1432 | # CONFIG_TIMER_STATS is not set | ||
1433 | # CONFIG_DEBUG_OBJECTS is not set | ||
1434 | # CONFIG_SLUB_DEBUG_ON is not set | ||
1435 | # CONFIG_SLUB_STATS is not set | ||
1436 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
1437 | # CONFIG_RT_MUTEX_TESTER is not set | ||
1438 | # CONFIG_DEBUG_SPINLOCK is not set | ||
1439 | CONFIG_DEBUG_MUTEXES=y | ||
1440 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | ||
1441 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
1442 | # CONFIG_DEBUG_KOBJECT is not set | ||
1443 | # CONFIG_DEBUG_INFO is not set | ||
1444 | # CONFIG_DEBUG_VM is not set | ||
1445 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
1446 | CONFIG_DEBUG_MEMORY_INIT=y | ||
1447 | # CONFIG_DEBUG_LIST is not set | ||
1448 | # CONFIG_DEBUG_SG is not set | ||
1449 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
1450 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
1451 | # CONFIG_RCU_TORTURE_TEST is not set | ||
1452 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
1453 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
1454 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
1455 | # CONFIG_FAULT_INJECTION is not set | ||
1456 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
1457 | |||
1458 | # | ||
1459 | # Tracers | ||
1460 | # | ||
1461 | # CONFIG_SCHED_TRACER is not set | ||
1462 | # CONFIG_CONTEXT_SWITCH_TRACER is not set | ||
1463 | # CONFIG_BOOT_TRACER is not set | ||
1464 | # CONFIG_TRACE_BRANCH_PROFILING is not set | ||
1465 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set | ||
1466 | # CONFIG_SAMPLES is not set | ||
1467 | CONFIG_IA64_GRANULE_16MB=y | ||
1468 | # CONFIG_IA64_GRANULE_64MB is not set | ||
1469 | # CONFIG_IA64_PRINT_HAZARDS is not set | ||
1470 | # CONFIG_DISABLE_VHPT is not set | ||
1471 | # CONFIG_IA64_DEBUG_CMPXCHG is not set | ||
1472 | # CONFIG_IA64_DEBUG_IRQ is not set | ||
1473 | |||
1474 | # | ||
1475 | # Security options | ||
1476 | # | ||
1477 | # CONFIG_KEYS is not set | ||
1478 | # CONFIG_SECURITY is not set | ||
1479 | # CONFIG_SECURITYFS is not set | ||
1480 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
1481 | CONFIG_CRYPTO=y | ||
1482 | |||
1483 | # | ||
1484 | # Crypto core or helper | ||
1485 | # | ||
1486 | # CONFIG_CRYPTO_FIPS is not set | ||
1487 | CONFIG_CRYPTO_ALGAPI=y | ||
1488 | CONFIG_CRYPTO_ALGAPI2=y | ||
1489 | CONFIG_CRYPTO_AEAD2=y | ||
1490 | CONFIG_CRYPTO_BLKCIPHER=m | ||
1491 | CONFIG_CRYPTO_BLKCIPHER2=y | ||
1492 | CONFIG_CRYPTO_HASH=y | ||
1493 | CONFIG_CRYPTO_HASH2=y | ||
1494 | CONFIG_CRYPTO_RNG2=y | ||
1495 | CONFIG_CRYPTO_MANAGER=m | ||
1496 | CONFIG_CRYPTO_MANAGER2=y | ||
1497 | # CONFIG_CRYPTO_GF128MUL is not set | ||
1498 | # CONFIG_CRYPTO_NULL is not set | ||
1499 | # CONFIG_CRYPTO_CRYPTD is not set | ||
1500 | # CONFIG_CRYPTO_AUTHENC is not set | ||
1501 | # CONFIG_CRYPTO_TEST is not set | ||
1502 | |||
1503 | # | ||
1504 | # Authenticated Encryption with Associated Data | ||
1505 | # | ||
1506 | # CONFIG_CRYPTO_CCM is not set | ||
1507 | # CONFIG_CRYPTO_GCM is not set | ||
1508 | # CONFIG_CRYPTO_SEQIV is not set | ||
1509 | |||
1510 | # | ||
1511 | # Block modes | ||
1512 | # | ||
1513 | CONFIG_CRYPTO_CBC=m | ||
1514 | # CONFIG_CRYPTO_CTR is not set | ||
1515 | # CONFIG_CRYPTO_CTS is not set | ||
1516 | CONFIG_CRYPTO_ECB=m | ||
1517 | # CONFIG_CRYPTO_LRW is not set | ||
1518 | CONFIG_CRYPTO_PCBC=m | ||
1519 | # CONFIG_CRYPTO_XTS is not set | ||
1520 | |||
1521 | # | ||
1522 | # Hash modes | ||
1523 | # | ||
1524 | # CONFIG_CRYPTO_HMAC is not set | ||
1525 | # CONFIG_CRYPTO_XCBC is not set | ||
1526 | |||
1527 | # | ||
1528 | # Digest | ||
1529 | # | ||
1530 | # CONFIG_CRYPTO_CRC32C is not set | ||
1531 | # CONFIG_CRYPTO_MD4 is not set | ||
1532 | CONFIG_CRYPTO_MD5=y | ||
1533 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | ||
1534 | # CONFIG_CRYPTO_RMD128 is not set | ||
1535 | # CONFIG_CRYPTO_RMD160 is not set | ||
1536 | # CONFIG_CRYPTO_RMD256 is not set | ||
1537 | # CONFIG_CRYPTO_RMD320 is not set | ||
1538 | # CONFIG_CRYPTO_SHA1 is not set | ||
1539 | # CONFIG_CRYPTO_SHA256 is not set | ||
1540 | # CONFIG_CRYPTO_SHA512 is not set | ||
1541 | # CONFIG_CRYPTO_TGR192 is not set | ||
1542 | # CONFIG_CRYPTO_WP512 is not set | ||
1543 | |||
1544 | # | ||
1545 | # Ciphers | ||
1546 | # | ||
1547 | # CONFIG_CRYPTO_AES is not set | ||
1548 | # CONFIG_CRYPTO_ANUBIS is not set | ||
1549 | # CONFIG_CRYPTO_ARC4 is not set | ||
1550 | # CONFIG_CRYPTO_BLOWFISH is not set | ||
1551 | # CONFIG_CRYPTO_CAMELLIA is not set | ||
1552 | # CONFIG_CRYPTO_CAST5 is not set | ||
1553 | # CONFIG_CRYPTO_CAST6 is not set | ||
1554 | CONFIG_CRYPTO_DES=m | ||
1555 | # CONFIG_CRYPTO_FCRYPT is not set | ||
1556 | # CONFIG_CRYPTO_KHAZAD is not set | ||
1557 | # CONFIG_CRYPTO_SALSA20 is not set | ||
1558 | # CONFIG_CRYPTO_SEED is not set | ||
1559 | # CONFIG_CRYPTO_SERPENT is not set | ||
1560 | # CONFIG_CRYPTO_TEA is not set | ||
1561 | # CONFIG_CRYPTO_TWOFISH is not set | ||
1562 | |||
1563 | # | ||
1564 | # Compression | ||
1565 | # | ||
1566 | # CONFIG_CRYPTO_DEFLATE is not set | ||
1567 | # CONFIG_CRYPTO_LZO is not set | ||
1568 | |||
1569 | # | ||
1570 | # Random Number Generation | ||
1571 | # | ||
1572 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | ||
1573 | CONFIG_CRYPTO_HW=y | ||
1574 | # CONFIG_CRYPTO_DEV_HIFN_795X is not set | ||
1575 | CONFIG_HAVE_KVM=y | ||
1576 | CONFIG_VIRTUALIZATION=y | ||
1577 | # CONFIG_KVM is not set | ||
1578 | # CONFIG_VIRTIO_PCI is not set | ||
1579 | # CONFIG_VIRTIO_BALLOON is not set | ||
1580 | |||
1581 | # | ||
1582 | # Library routines | ||
1583 | # | ||
1584 | CONFIG_BITREVERSE=y | ||
1585 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
1586 | # CONFIG_CRC_CCITT is not set | ||
1587 | # CONFIG_CRC16 is not set | ||
1588 | # CONFIG_CRC_T10DIF is not set | ||
1589 | CONFIG_CRC_ITU_T=m | ||
1590 | CONFIG_CRC32=y | ||
1591 | # CONFIG_CRC7 is not set | ||
1592 | # CONFIG_LIBCRC32C is not set | ||
1593 | CONFIG_PLIST=y | ||
1594 | CONFIG_HAS_IOMEM=y | ||
1595 | CONFIG_HAS_IOPORT=y | ||
1596 | CONFIG_HAS_DMA=y | ||
1597 | CONFIG_GENERIC_HARDIRQS=y | ||
1598 | CONFIG_GENERIC_IRQ_PROBE=y | ||
1599 | CONFIG_GENERIC_PENDING_IRQ=y | ||
1600 | CONFIG_IRQ_PER_CPU=y | ||
1601 | # CONFIG_IOMMU_API is not set | ||
diff --git a/arch/ia64/include/asm/kvm.h b/arch/ia64/include/asm/kvm.h index 68aa6da807c1..bfa86b6af7cd 100644 --- a/arch/ia64/include/asm/kvm.h +++ b/arch/ia64/include/asm/kvm.h | |||
@@ -25,6 +25,10 @@ | |||
25 | 25 | ||
26 | #include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | 27 | ||
28 | /* Select x86 specific features in <linux/kvm.h> */ | ||
29 | #define __KVM_HAVE_IOAPIC | ||
30 | #define __KVM_HAVE_DEVICE_ASSIGNMENT | ||
31 | |||
28 | /* Architectural interrupt line count. */ | 32 | /* Architectural interrupt line count. */ |
29 | #define KVM_NR_INTERRUPTS 256 | 33 | #define KVM_NR_INTERRUPTS 256 |
30 | 34 | ||
diff --git a/arch/ia64/include/asm/mmzone.h b/arch/ia64/include/asm/mmzone.h index 34efe88eb849..f2ca32069b3f 100644 --- a/arch/ia64/include/asm/mmzone.h +++ b/arch/ia64/include/asm/mmzone.h | |||
@@ -31,10 +31,6 @@ static inline int pfn_to_nid(unsigned long pfn) | |||
31 | #endif | 31 | #endif |
32 | } | 32 | } |
33 | 33 | ||
34 | #ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | ||
35 | extern int early_pfn_to_nid(unsigned long pfn); | ||
36 | #endif | ||
37 | |||
38 | #ifdef CONFIG_IA64_DIG /* DIG systems are small */ | 34 | #ifdef CONFIG_IA64_DIG /* DIG systems are small */ |
39 | # define MAX_PHYSNODE_ID 8 | 35 | # define MAX_PHYSNODE_ID 8 |
40 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 8) | 36 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 8) |
diff --git a/arch/ia64/include/asm/sn/bte.h b/arch/ia64/include/asm/sn/bte.h index 5efecf06c9a4..96798d2da7c2 100644 --- a/arch/ia64/include/asm/sn/bte.h +++ b/arch/ia64/include/asm/sn/bte.h | |||
@@ -39,7 +39,7 @@ | |||
39 | /* BTE status register only supports 16 bits for length field */ | 39 | /* BTE status register only supports 16 bits for length field */ |
40 | #define BTE_LEN_BITS (16) | 40 | #define BTE_LEN_BITS (16) |
41 | #define BTE_LEN_MASK ((1 << BTE_LEN_BITS) - 1) | 41 | #define BTE_LEN_MASK ((1 << BTE_LEN_BITS) - 1) |
42 | #define BTE_MAX_XFER ((1 << BTE_LEN_BITS) * L1_CACHE_BYTES) | 42 | #define BTE_MAX_XFER (BTE_LEN_MASK << L1_CACHE_SHIFT) |
43 | 43 | ||
44 | 44 | ||
45 | /* Define hardware */ | 45 | /* Define hardware */ |
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index 5cfd3d91001a..e13125058bed 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c | |||
@@ -507,7 +507,7 @@ static int iosapic_find_sharable_irq(unsigned long trigger, unsigned long pol) | |||
507 | if (trigger == IOSAPIC_EDGE) | 507 | if (trigger == IOSAPIC_EDGE) |
508 | return -EINVAL; | 508 | return -EINVAL; |
509 | 509 | ||
510 | for (i = 0; i <= NR_IRQS; i++) { | 510 | for (i = 0; i < NR_IRQS; i++) { |
511 | info = &iosapic_intr_info[i]; | 511 | info = &iosapic_intr_info[i]; |
512 | if (info->trigger == trigger && info->polarity == pol && | 512 | if (info->trigger == trigger && info->polarity == pol && |
513 | (info->dmode == IOSAPIC_FIXED || | 513 | (info->dmode == IOSAPIC_FIXED || |
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index 11463994a7d5..52290547c85b 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
@@ -736,14 +736,15 @@ int __cpu_disable(void) | |||
736 | return -EBUSY; | 736 | return -EBUSY; |
737 | } | 737 | } |
738 | 738 | ||
739 | cpu_clear(cpu, cpu_online_map); | ||
740 | |||
739 | if (migrate_platform_irqs(cpu)) { | 741 | if (migrate_platform_irqs(cpu)) { |
740 | cpu_set(cpu, cpu_online_map); | 742 | cpu_set(cpu, cpu_online_map); |
741 | return (-EBUSY); | 743 | return -EBUSY; |
742 | } | 744 | } |
743 | 745 | ||
744 | remove_siblinginfo(cpu); | 746 | remove_siblinginfo(cpu); |
745 | fixup_irqs(); | 747 | fixup_irqs(); |
746 | cpu_clear(cpu, cpu_online_map); | ||
747 | local_flush_tlb_all(); | 748 | local_flush_tlb_all(); |
748 | cpu_clear(cpu, cpu_callin_map); | 749 | cpu_clear(cpu, cpu_callin_map); |
749 | return 0; | 750 | return 0; |
diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c index 67810b77d998..b6c0e63a0bf6 100644 --- a/arch/ia64/kernel/unwind.c +++ b/arch/ia64/kernel/unwind.c | |||
@@ -2149,7 +2149,7 @@ unw_remove_unwind_table (void *handle) | |||
2149 | 2149 | ||
2150 | /* next, remove hash table entries for this table */ | 2150 | /* next, remove hash table entries for this table */ |
2151 | 2151 | ||
2152 | for (index = 0; index <= UNW_HASH_SIZE; ++index) { | 2152 | for (index = 0; index < UNW_HASH_SIZE; ++index) { |
2153 | tmp = unw.cache + unw.hash[index]; | 2153 | tmp = unw.cache + unw.hash[index]; |
2154 | if (unw.hash[index] >= UNW_CACHE_SIZE | 2154 | if (unw.hash[index] >= UNW_CACHE_SIZE |
2155 | || tmp->ip < table->start || tmp->ip >= table->end) | 2155 | || tmp->ip < table->start || tmp->ip >= table->end) |
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index 4e586f6110aa..28f982045f29 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -1337,6 +1337,10 @@ static void kvm_release_vm_pages(struct kvm *kvm) | |||
1337 | } | 1337 | } |
1338 | } | 1338 | } |
1339 | 1339 | ||
1340 | void kvm_arch_sync_events(struct kvm *kvm) | ||
1341 | { | ||
1342 | } | ||
1343 | |||
1340 | void kvm_arch_destroy_vm(struct kvm *kvm) | 1344 | void kvm_arch_destroy_vm(struct kvm *kvm) |
1341 | { | 1345 | { |
1342 | kvm_iommu_unmap_guest(kvm); | 1346 | kvm_iommu_unmap_guest(kvm); |
diff --git a/arch/ia64/kvm/process.c b/arch/ia64/kvm/process.c index 552d07724207..230eae482f32 100644 --- a/arch/ia64/kvm/process.c +++ b/arch/ia64/kvm/process.c | |||
@@ -455,13 +455,18 @@ fpswa_ret_t vmm_fp_emulate(int fp_fault, void *bundle, unsigned long *ipsr, | |||
455 | if (!vmm_fpswa_interface) | 455 | if (!vmm_fpswa_interface) |
456 | return (fpswa_ret_t) {-1, 0, 0, 0}; | 456 | return (fpswa_ret_t) {-1, 0, 0, 0}; |
457 | 457 | ||
458 | /* | ||
459 | * Just let fpswa driver to use hardware fp registers. | ||
460 | * No fp register is valid in memory. | ||
461 | */ | ||
462 | memset(&fp_state, 0, sizeof(fp_state_t)); | 458 | memset(&fp_state, 0, sizeof(fp_state_t)); |
463 | 459 | ||
464 | /* | 460 | /* |
461 | * compute fp_state. only FP registers f6 - f11 are used by the | ||
462 | * vmm, so set those bits in the mask and set the low volatile | ||
463 | * pointer to point to these registers. | ||
464 | */ | ||
465 | fp_state.bitmask_low64 = 0xfc0; /* bit6..bit11 */ | ||
466 | |||
467 | fp_state.fp_state_low_volatile = (fp_state_low_volatile_t *) ®s->f6; | ||
468 | |||
469 | /* | ||
465 | * unsigned long (*EFI_FPSWA) ( | 470 | * unsigned long (*EFI_FPSWA) ( |
466 | * unsigned long trap_type, | 471 | * unsigned long trap_type, |
467 | * void *Bundle, | 472 | * void *Bundle, |
@@ -545,10 +550,6 @@ void reflect_interruption(u64 ifa, u64 isr, u64 iim, | |||
545 | status = vmm_handle_fpu_swa(0, regs, isr); | 550 | status = vmm_handle_fpu_swa(0, regs, isr); |
546 | if (!status) | 551 | if (!status) |
547 | return ; | 552 | return ; |
548 | else if (-EAGAIN == status) { | ||
549 | vcpu_decrement_iip(vcpu); | ||
550 | return ; | ||
551 | } | ||
552 | break; | 553 | break; |
553 | } | 554 | } |
554 | 555 | ||
diff --git a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c index b73bf1838e57..3efea7d0a351 100644 --- a/arch/ia64/mm/numa.c +++ b/arch/ia64/mm/numa.c | |||
@@ -58,7 +58,7 @@ paddr_to_nid(unsigned long paddr) | |||
58 | * SPARSEMEM to allocate the SPARSEMEM sectionmap on the NUMA node where | 58 | * SPARSEMEM to allocate the SPARSEMEM sectionmap on the NUMA node where |
59 | * the section resides. | 59 | * the section resides. |
60 | */ | 60 | */ |
61 | int early_pfn_to_nid(unsigned long pfn) | 61 | int __meminit __early_pfn_to_nid(unsigned long pfn) |
62 | { | 62 | { |
63 | int i, section = pfn >> PFN_SECTION_SHIFT, ssec, esec; | 63 | int i, section = pfn >> PFN_SECTION_SHIFT, ssec, esec; |
64 | 64 | ||
@@ -70,7 +70,7 @@ int early_pfn_to_nid(unsigned long pfn) | |||
70 | return node_memblk[i].nid; | 70 | return node_memblk[i].nid; |
71 | } | 71 | } |
72 | 72 | ||
73 | return 0; | 73 | return -1; |
74 | } | 74 | } |
75 | 75 | ||
76 | #ifdef CONFIG_MEMORY_HOTPLUG | 76 | #ifdef CONFIG_MEMORY_HOTPLUG |
diff --git a/arch/ia64/sn/kernel/bte.c b/arch/ia64/sn/kernel/bte.c index 9456d4034024..c6d6b62db66c 100644 --- a/arch/ia64/sn/kernel/bte.c +++ b/arch/ia64/sn/kernel/bte.c | |||
@@ -97,9 +97,10 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) | |||
97 | return BTE_SUCCESS; | 97 | return BTE_SUCCESS; |
98 | } | 98 | } |
99 | 99 | ||
100 | BUG_ON((len & L1_CACHE_MASK) || | 100 | BUG_ON(len & L1_CACHE_MASK); |
101 | (src & L1_CACHE_MASK) || (dest & L1_CACHE_MASK)); | 101 | BUG_ON(src & L1_CACHE_MASK); |
102 | BUG_ON(!(len < ((BTE_LEN_MASK + 1) << L1_CACHE_SHIFT))); | 102 | BUG_ON(dest & L1_CACHE_MASK); |
103 | BUG_ON(len > BTE_MAX_XFER); | ||
103 | 104 | ||
104 | /* | 105 | /* |
105 | * Start with interface corresponding to cpu number | 106 | * Start with interface corresponding to cpu number |
diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c index c5a214026a77..d0223abbbbd4 100644 --- a/arch/ia64/sn/kernel/io_acpi_init.c +++ b/arch/ia64/sn/kernel/io_acpi_init.c | |||
@@ -443,7 +443,7 @@ sn_acpi_slot_fixup(struct pci_dev *dev) | |||
443 | size = pci_resource_len(dev, PCI_ROM_RESOURCE); | 443 | size = pci_resource_len(dev, PCI_ROM_RESOURCE); |
444 | addr = ioremap(pcidev_info->pdi_pio_mapped_addr[PCI_ROM_RESOURCE], | 444 | addr = ioremap(pcidev_info->pdi_pio_mapped_addr[PCI_ROM_RESOURCE], |
445 | size); | 445 | size); |
446 | image_size = pci_get_rom_size(addr, size); | 446 | image_size = pci_get_rom_size(dev, addr, size); |
447 | dev->resource[PCI_ROM_RESOURCE].start = (unsigned long) addr; | 447 | dev->resource[PCI_ROM_RESOURCE].start = (unsigned long) addr; |
448 | dev->resource[PCI_ROM_RESOURCE].end = | 448 | dev->resource[PCI_ROM_RESOURCE].end = |
449 | (unsigned long) addr + image_size - 1; | 449 | (unsigned long) addr + image_size - 1; |
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index 4e1801bad83a..e2eb2da60f96 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c | |||
@@ -269,7 +269,7 @@ sn_io_slot_fixup(struct pci_dev *dev) | |||
269 | 269 | ||
270 | rom = ioremap(pci_resource_start(dev, PCI_ROM_RESOURCE), | 270 | rom = ioremap(pci_resource_start(dev, PCI_ROM_RESOURCE), |
271 | size + 1); | 271 | size + 1); |
272 | image_size = pci_get_rom_size(rom, size + 1); | 272 | image_size = pci_get_rom_size(dev, rom, size + 1); |
273 | dev->resource[PCI_ROM_RESOURCE].end = | 273 | dev->resource[PCI_ROM_RESOURCE].end = |
274 | dev->resource[PCI_ROM_RESOURCE].start + | 274 | dev->resource[PCI_ROM_RESOURCE].start + |
275 | image_size - 1; | 275 | image_size - 1; |
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_dma.c b/arch/ia64/sn/pci/pcibr/pcibr_dma.c index e626e50a938a..060df4aa9916 100644 --- a/arch/ia64/sn/pci/pcibr/pcibr_dma.c +++ b/arch/ia64/sn/pci/pcibr/pcibr_dma.c | |||
@@ -135,11 +135,10 @@ pcibr_dmatrans_direct64(struct pcidev_info * info, u64 paddr, | |||
135 | if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) | 135 | if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) |
136 | pci_addr = IS_PIC_SOFT(pcibus_info) ? | 136 | pci_addr = IS_PIC_SOFT(pcibus_info) ? |
137 | PHYS_TO_DMA(paddr) : | 137 | PHYS_TO_DMA(paddr) : |
138 | PHYS_TO_TIODMA(paddr) | dma_attributes; | 138 | PHYS_TO_TIODMA(paddr); |
139 | else | 139 | else |
140 | pci_addr = IS_PIC_SOFT(pcibus_info) ? | 140 | pci_addr = paddr; |
141 | paddr : | 141 | pci_addr |= dma_attributes; |
142 | paddr | dma_attributes; | ||
143 | 142 | ||
144 | /* Handle Bus mode */ | 143 | /* Handle Bus mode */ |
145 | if (IS_PCIX(pcibus_info)) | 144 | if (IS_PCIX(pcibus_info)) |
diff --git a/arch/ia64/xen/Kconfig b/arch/ia64/xen/Kconfig index f1683a20275b..515e0826803a 100644 --- a/arch/ia64/xen/Kconfig +++ b/arch/ia64/xen/Kconfig | |||
@@ -8,8 +8,7 @@ config XEN | |||
8 | depends on PARAVIRT && MCKINLEY && IA64_PAGE_SIZE_16KB && EXPERIMENTAL | 8 | depends on PARAVIRT && MCKINLEY && IA64_PAGE_SIZE_16KB && EXPERIMENTAL |
9 | select XEN_XENCOMM | 9 | select XEN_XENCOMM |
10 | select NO_IDLE_HZ | 10 | select NO_IDLE_HZ |
11 | 11 | # followings are required to save/restore. | |
12 | # those are required to save/restore. | ||
13 | select ARCH_SUSPEND_POSSIBLE | 12 | select ARCH_SUSPEND_POSSIBLE |
14 | select SUSPEND | 13 | select SUSPEND |
15 | select PM_SLEEP | 14 | select PM_SLEEP |
diff --git a/arch/ia64/xen/xen_pv_ops.c b/arch/ia64/xen/xen_pv_ops.c index 04cd12350455..936cff3c96e0 100644 --- a/arch/ia64/xen/xen_pv_ops.c +++ b/arch/ia64/xen/xen_pv_ops.c | |||
@@ -153,7 +153,7 @@ xen_post_smp_prepare_boot_cpu(void) | |||
153 | xen_setup_vcpu_info_placement(); | 153 | xen_setup_vcpu_info_placement(); |
154 | } | 154 | } |
155 | 155 | ||
156 | static const struct pv_init_ops xen_init_ops __initdata = { | 156 | static const struct pv_init_ops xen_init_ops __initconst = { |
157 | .banner = xen_banner, | 157 | .banner = xen_banner, |
158 | 158 | ||
159 | .reserve_memory = xen_reserve_memory, | 159 | .reserve_memory = xen_reserve_memory, |
@@ -337,7 +337,7 @@ xen_iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) | |||
337 | HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op); | 337 | HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op); |
338 | } | 338 | } |
339 | 339 | ||
340 | static const struct pv_iosapic_ops xen_iosapic_ops __initdata = { | 340 | static const struct pv_iosapic_ops xen_iosapic_ops __initconst = { |
341 | .pcat_compat_init = xen_pcat_compat_init, | 341 | .pcat_compat_init = xen_pcat_compat_init, |
342 | .__get_irq_chip = xen_iosapic_get_irq_chip, | 342 | .__get_irq_chip = xen_iosapic_get_irq_chip, |
343 | 343 | ||
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index dba4afabb444..39478dd08e67 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c | |||
@@ -187,8 +187,8 @@ __asm__ (__ALIGN_STR "\n" \ | |||
187 | " jbra ret_from_interrupt\n" \ | 187 | " jbra ret_from_interrupt\n" \ |
188 | : : "i" (&kstat_cpu(0).irqs[n+8]), "i" (&irq_handler[n+8]), \ | 188 | : : "i" (&kstat_cpu(0).irqs[n+8]), "i" (&irq_handler[n+8]), \ |
189 | "n" (PT_OFF_SR), "n" (n), \ | 189 | "n" (PT_OFF_SR), "n" (n), \ |
190 | "i" (n & 8 ? (n & 16 ? &tt_mfp.int_mk_a : &mfp.int_mk_a) \ | 190 | "i" (n & 8 ? (n & 16 ? &tt_mfp.int_mk_a : &st_mfp.int_mk_a) \ |
191 | : (n & 16 ? &tt_mfp.int_mk_b : &mfp.int_mk_b)), \ | 191 | : (n & 16 ? &tt_mfp.int_mk_b : &st_mfp.int_mk_b)), \ |
192 | "m" (preempt_count()), "di" (HARDIRQ_OFFSET) \ | 192 | "m" (preempt_count()), "di" (HARDIRQ_OFFSET) \ |
193 | ); \ | 193 | ); \ |
194 | for (;;); /* fake noreturn */ \ | 194 | for (;;); /* fake noreturn */ \ |
@@ -366,14 +366,14 @@ void __init atari_init_IRQ(void) | |||
366 | /* Initialize the MFP(s) */ | 366 | /* Initialize the MFP(s) */ |
367 | 367 | ||
368 | #ifdef ATARI_USE_SOFTWARE_EOI | 368 | #ifdef ATARI_USE_SOFTWARE_EOI |
369 | mfp.vec_adr = 0x48; /* Software EOI-Mode */ | 369 | st_mfp.vec_adr = 0x48; /* Software EOI-Mode */ |
370 | #else | 370 | #else |
371 | mfp.vec_adr = 0x40; /* Automatic EOI-Mode */ | 371 | st_mfp.vec_adr = 0x40; /* Automatic EOI-Mode */ |
372 | #endif | 372 | #endif |
373 | mfp.int_en_a = 0x00; /* turn off MFP-Ints */ | 373 | st_mfp.int_en_a = 0x00; /* turn off MFP-Ints */ |
374 | mfp.int_en_b = 0x00; | 374 | st_mfp.int_en_b = 0x00; |
375 | mfp.int_mk_a = 0xff; /* no Masking */ | 375 | st_mfp.int_mk_a = 0xff; /* no Masking */ |
376 | mfp.int_mk_b = 0xff; | 376 | st_mfp.int_mk_b = 0xff; |
377 | 377 | ||
378 | if (ATARIHW_PRESENT(TT_MFP)) { | 378 | if (ATARIHW_PRESENT(TT_MFP)) { |
379 | #ifdef ATARI_USE_SOFTWARE_EOI | 379 | #ifdef ATARI_USE_SOFTWARE_EOI |
diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c index a5f33c059979..4add96d13b19 100644 --- a/arch/m68k/atari/atakeyb.c +++ b/arch/m68k/atari/atakeyb.c | |||
@@ -609,10 +609,10 @@ int atari_keyb_init(void) | |||
609 | ACIA_RHTID : 0); | 609 | ACIA_RHTID : 0); |
610 | 610 | ||
611 | /* make sure the interrupt line is up */ | 611 | /* make sure the interrupt line is up */ |
612 | } while ((mfp.par_dt_reg & 0x10) == 0); | 612 | } while ((st_mfp.par_dt_reg & 0x10) == 0); |
613 | 613 | ||
614 | /* enable ACIA Interrupts */ | 614 | /* enable ACIA Interrupts */ |
615 | mfp.active_edge &= ~0x10; | 615 | st_mfp.active_edge &= ~0x10; |
616 | atari_turnon_irq(IRQ_MFP_ACIA); | 616 | atari_turnon_irq(IRQ_MFP_ACIA); |
617 | 617 | ||
618 | ikbd_self_test = 1; | 618 | ikbd_self_test = 1; |
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index 49c28cdbea5c..ae2d96e5d618 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c | |||
@@ -258,7 +258,7 @@ void __init config_atari(void) | |||
258 | printk("STND_SHIFTER "); | 258 | printk("STND_SHIFTER "); |
259 | } | 259 | } |
260 | } | 260 | } |
261 | if (hwreg_present(&mfp.par_dt_reg)) { | 261 | if (hwreg_present(&st_mfp.par_dt_reg)) { |
262 | ATARIHW_SET(ST_MFP); | 262 | ATARIHW_SET(ST_MFP); |
263 | printk("ST_MFP "); | 263 | printk("ST_MFP "); |
264 | } | 264 | } |
diff --git a/arch/m68k/atari/debug.c b/arch/m68k/atari/debug.c index 702b15ccfab7..28efdc33c1ae 100644 --- a/arch/m68k/atari/debug.c +++ b/arch/m68k/atari/debug.c | |||
@@ -34,9 +34,9 @@ static struct console atari_console_driver = { | |||
34 | 34 | ||
35 | static inline void ata_mfp_out(char c) | 35 | static inline void ata_mfp_out(char c) |
36 | { | 36 | { |
37 | while (!(mfp.trn_stat & 0x80)) /* wait for tx buf empty */ | 37 | while (!(st_mfp.trn_stat & 0x80)) /* wait for tx buf empty */ |
38 | barrier(); | 38 | barrier(); |
39 | mfp.usart_dta = c; | 39 | st_mfp.usart_dta = c; |
40 | } | 40 | } |
41 | 41 | ||
42 | static void atari_mfp_console_write(struct console *co, const char *str, | 42 | static void atari_mfp_console_write(struct console *co, const char *str, |
@@ -91,7 +91,7 @@ static int ata_par_out(char c) | |||
91 | /* This a some-seconds timeout in case no printer is connected */ | 91 | /* This a some-seconds timeout in case no printer is connected */ |
92 | unsigned long i = loops_per_jiffy > 1 ? loops_per_jiffy : 10000000/HZ; | 92 | unsigned long i = loops_per_jiffy > 1 ? loops_per_jiffy : 10000000/HZ; |
93 | 93 | ||
94 | while ((mfp.par_dt_reg & 1) && --i) /* wait for BUSY == L */ | 94 | while ((st_mfp.par_dt_reg & 1) && --i) /* wait for BUSY == L */ |
95 | ; | 95 | ; |
96 | if (!i) | 96 | if (!i) |
97 | return 0; | 97 | return 0; |
@@ -131,9 +131,9 @@ static void atari_par_console_write(struct console *co, const char *str, | |||
131 | #if 0 | 131 | #if 0 |
132 | int atari_mfp_console_wait_key(struct console *co) | 132 | int atari_mfp_console_wait_key(struct console *co) |
133 | { | 133 | { |
134 | while (!(mfp.rcv_stat & 0x80)) /* wait for rx buf filled */ | 134 | while (!(st_mfp.rcv_stat & 0x80)) /* wait for rx buf filled */ |
135 | barrier(); | 135 | barrier(); |
136 | return mfp.usart_dta; | 136 | return st_mfp.usart_dta; |
137 | } | 137 | } |
138 | 138 | ||
139 | int atari_scc_console_wait_key(struct console *co) | 139 | int atari_scc_console_wait_key(struct console *co) |
@@ -175,12 +175,12 @@ static void __init atari_init_mfp_port(int cflag) | |||
175 | baud = B9600; /* use default 9600bps for non-implemented rates */ | 175 | baud = B9600; /* use default 9600bps for non-implemented rates */ |
176 | baud -= B1200; /* baud_table[] starts at 1200bps */ | 176 | baud -= B1200; /* baud_table[] starts at 1200bps */ |
177 | 177 | ||
178 | mfp.trn_stat &= ~0x01; /* disable TX */ | 178 | st_mfp.trn_stat &= ~0x01; /* disable TX */ |
179 | mfp.usart_ctr = parity | csize | 0x88; /* 1:16 clk mode, 1 stop bit */ | 179 | st_mfp.usart_ctr = parity | csize | 0x88; /* 1:16 clk mode, 1 stop bit */ |
180 | mfp.tim_ct_cd &= 0x70; /* stop timer D */ | 180 | st_mfp.tim_ct_cd &= 0x70; /* stop timer D */ |
181 | mfp.tim_dt_d = baud_table[baud]; | 181 | st_mfp.tim_dt_d = baud_table[baud]; |
182 | mfp.tim_ct_cd |= 0x01; /* start timer D, 1:4 */ | 182 | st_mfp.tim_ct_cd |= 0x01; /* start timer D, 1:4 */ |
183 | mfp.trn_stat |= 0x01; /* enable TX */ | 183 | st_mfp.trn_stat |= 0x01; /* enable TX */ |
184 | } | 184 | } |
185 | 185 | ||
186 | #define SCC_WRITE(reg, val) \ | 186 | #define SCC_WRITE(reg, val) \ |
diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c index d076ff8d1b39..a0531f34c617 100644 --- a/arch/m68k/atari/time.c +++ b/arch/m68k/atari/time.c | |||
@@ -27,9 +27,9 @@ void __init | |||
27 | atari_sched_init(irq_handler_t timer_routine) | 27 | atari_sched_init(irq_handler_t timer_routine) |
28 | { | 28 | { |
29 | /* set Timer C data Register */ | 29 | /* set Timer C data Register */ |
30 | mfp.tim_dt_c = INT_TICKS; | 30 | st_mfp.tim_dt_c = INT_TICKS; |
31 | /* start timer C, div = 1:100 */ | 31 | /* start timer C, div = 1:100 */ |
32 | mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60; | 32 | st_mfp.tim_ct_cd = (st_mfp.tim_ct_cd & 15) | 0x60; |
33 | /* install interrupt service routine for MFP Timer C */ | 33 | /* install interrupt service routine for MFP Timer C */ |
34 | if (request_irq(IRQ_MFP_TIMC, timer_routine, IRQ_TYPE_SLOW, | 34 | if (request_irq(IRQ_MFP_TIMC, timer_routine, IRQ_TYPE_SLOW, |
35 | "timer", timer_routine)) | 35 | "timer", timer_routine)) |
@@ -46,11 +46,11 @@ unsigned long atari_gettimeoffset (void) | |||
46 | unsigned long ticks, offset = 0; | 46 | unsigned long ticks, offset = 0; |
47 | 47 | ||
48 | /* read MFP timer C current value */ | 48 | /* read MFP timer C current value */ |
49 | ticks = mfp.tim_dt_c; | 49 | ticks = st_mfp.tim_dt_c; |
50 | /* The probability of underflow is less than 2% */ | 50 | /* The probability of underflow is less than 2% */ |
51 | if (ticks > INT_TICKS - INT_TICKS / 50) | 51 | if (ticks > INT_TICKS - INT_TICKS / 50) |
52 | /* Check for pending timer interrupt */ | 52 | /* Check for pending timer interrupt */ |
53 | if (mfp.int_pn_b & (1 << 5)) | 53 | if (st_mfp.int_pn_b & (1 << 5)) |
54 | offset = TICK_SIZE; | 54 | offset = TICK_SIZE; |
55 | 55 | ||
56 | ticks = INT_TICKS - ticks; | 56 | ticks = INT_TICKS - ticks; |
diff --git a/arch/m68k/include/asm/atarihw.h b/arch/m68k/include/asm/atarihw.h index 1412b4ab202f..a714e1aa072a 100644 --- a/arch/m68k/include/asm/atarihw.h +++ b/arch/m68k/include/asm/atarihw.h | |||
@@ -113,7 +113,7 @@ extern struct atari_hw_present atari_hw_present; | |||
113 | * of nops on various machines. Somebody claimed that the tstb takes 600 ns. | 113 | * of nops on various machines. Somebody claimed that the tstb takes 600 ns. |
114 | */ | 114 | */ |
115 | #define MFPDELAY() \ | 115 | #define MFPDELAY() \ |
116 | __asm__ __volatile__ ( "tstb %0" : : "m" (mfp.par_dt_reg) : "cc" ); | 116 | __asm__ __volatile__ ( "tstb %0" : : "m" (st_mfp.par_dt_reg) : "cc" ); |
117 | 117 | ||
118 | /* Do cache push/invalidate for DMA read/write. This function obeys the | 118 | /* Do cache push/invalidate for DMA read/write. This function obeys the |
119 | * snooping on some machines (Medusa) and processors: The Medusa itself can | 119 | * snooping on some machines (Medusa) and processors: The Medusa itself can |
@@ -565,7 +565,7 @@ struct MFP | |||
565 | u_char char_dummy23; | 565 | u_char char_dummy23; |
566 | u_char usart_dta; | 566 | u_char usart_dta; |
567 | }; | 567 | }; |
568 | # define mfp ((*(volatile struct MFP*)MFP_BAS)) | 568 | # define st_mfp ((*(volatile struct MFP*)MFP_BAS)) |
569 | 569 | ||
570 | /* TT's second MFP */ | 570 | /* TT's second MFP */ |
571 | 571 | ||
diff --git a/arch/m68k/include/asm/atariints.h b/arch/m68k/include/asm/atariints.h index 5748e99f4e26..f597892e43a0 100644 --- a/arch/m68k/include/asm/atariints.h +++ b/arch/m68k/include/asm/atariints.h | |||
@@ -113,7 +113,7 @@ static inline int get_mfp_bit( unsigned irq, int type ) | |||
113 | { unsigned char mask, *reg; | 113 | { unsigned char mask, *reg; |
114 | 114 | ||
115 | mask = 1 << (irq & 7); | 115 | mask = 1 << (irq & 7); |
116 | reg = (unsigned char *)&mfp.int_en_a + type*4 + | 116 | reg = (unsigned char *)&st_mfp.int_en_a + type*4 + |
117 | ((irq & 8) >> 2) + (((irq-8) & 16) << 3); | 117 | ((irq & 8) >> 2) + (((irq-8) & 16) << 3); |
118 | return( *reg & mask ); | 118 | return( *reg & mask ); |
119 | } | 119 | } |
@@ -123,7 +123,7 @@ static inline void set_mfp_bit( unsigned irq, int type ) | |||
123 | { unsigned char mask, *reg; | 123 | { unsigned char mask, *reg; |
124 | 124 | ||
125 | mask = 1 << (irq & 7); | 125 | mask = 1 << (irq & 7); |
126 | reg = (unsigned char *)&mfp.int_en_a + type*4 + | 126 | reg = (unsigned char *)&st_mfp.int_en_a + type*4 + |
127 | ((irq & 8) >> 2) + (((irq-8) & 16) << 3); | 127 | ((irq & 8) >> 2) + (((irq-8) & 16) << 3); |
128 | __asm__ __volatile__ ( "orb %0,%1" | 128 | __asm__ __volatile__ ( "orb %0,%1" |
129 | : : "di" (mask), "m" (*reg) : "memory" ); | 129 | : : "di" (mask), "m" (*reg) : "memory" ); |
@@ -134,7 +134,7 @@ static inline void clear_mfp_bit( unsigned irq, int type ) | |||
134 | { unsigned char mask, *reg; | 134 | { unsigned char mask, *reg; |
135 | 135 | ||
136 | mask = ~(1 << (irq & 7)); | 136 | mask = ~(1 << (irq & 7)); |
137 | reg = (unsigned char *)&mfp.int_en_a + type*4 + | 137 | reg = (unsigned char *)&st_mfp.int_en_a + type*4 + |
138 | ((irq & 8) >> 2) + (((irq-8) & 16) << 3); | 138 | ((irq & 8) >> 2) + (((irq-8) & 16) << 3); |
139 | if (type == MFP_PENDING || type == MFP_SERVICE) | 139 | if (type == MFP_PENDING || type == MFP_SERVICE) |
140 | __asm__ __volatile__ ( "moveb %0,%1" | 140 | __asm__ __volatile__ ( "moveb %0,%1" |
diff --git a/arch/m68knommu/platform/5206e/config.c b/arch/m68knommu/platform/5206e/config.c index d01a5d2b7557..db902540bf2c 100644 --- a/arch/m68knommu/platform/5206e/config.c +++ b/arch/m68knommu/platform/5206e/config.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/coldfire.h> | 17 | #include <asm/coldfire.h> |
18 | #include <asm/mcfsim.h> | 18 | #include <asm/mcfsim.h> |
19 | #include <asm/mcfdma.h> | 19 | #include <asm/mcfdma.h> |
20 | #include <asm/mcfuart.h> | ||
20 | 21 | ||
21 | /***************************************************************************/ | 22 | /***************************************************************************/ |
22 | 23 | ||
diff --git a/arch/m68knommu/platform/528x/config.c b/arch/m68knommu/platform/528x/config.c index dfdb5c2ed8e6..44baeb225dc7 100644 --- a/arch/m68knommu/platform/528x/config.c +++ b/arch/m68knommu/platform/528x/config.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <asm/coldfire.h> | 24 | #include <asm/coldfire.h> |
25 | #include <asm/mcfsim.h> | 25 | #include <asm/mcfsim.h> |
26 | #include <asm/mcfuart.h> | 26 | #include <asm/mcfuart.h> |
27 | #include <asm/mcfqspi.h> | ||
28 | 27 | ||
29 | #ifdef CONFIG_MTD_PARTITIONS | 28 | #ifdef CONFIG_MTD_PARTITIONS |
30 | #include <linux/mtd/partitions.h> | 29 | #include <linux/mtd/partitions.h> |
@@ -33,233 +32,6 @@ | |||
33 | /***************************************************************************/ | 32 | /***************************************************************************/ |
34 | 33 | ||
35 | void coldfire_reset(void); | 34 | void coldfire_reset(void); |
36 | static void coldfire_qspi_cs_control(u8 cs, u8 command); | ||
37 | |||
38 | /***************************************************************************/ | ||
39 | |||
40 | #if defined(CONFIG_SPI) | ||
41 | |||
42 | #if defined(CONFIG_WILDFIRE) | ||
43 | #define SPI_NUM_CHIPSELECTS 0x02 | ||
44 | #define SPI_PAR_VAL 0x07 /* Enable DIN, DOUT, CLK */ | ||
45 | #define SPI_CS_MASK 0x18 | ||
46 | |||
47 | #define FLASH_BLOCKSIZE (1024*64) | ||
48 | #define FLASH_NUMBLOCKS 16 | ||
49 | #define FLASH_TYPE "m25p80" | ||
50 | |||
51 | #define M25P80_CS 0 | ||
52 | #define MMC_CS 1 | ||
53 | |||
54 | #ifdef CONFIG_MTD_PARTITIONS | ||
55 | static struct mtd_partition stm25p_partitions[] = { | ||
56 | /* sflash */ | ||
57 | [0] = { | ||
58 | .name = "stm25p80", | ||
59 | .offset = 0x00000000, | ||
60 | .size = FLASH_BLOCKSIZE * FLASH_NUMBLOCKS, | ||
61 | .mask_flags = 0 | ||
62 | } | ||
63 | }; | ||
64 | |||
65 | #endif | ||
66 | |||
67 | #elif defined(CONFIG_WILDFIREMOD) | ||
68 | |||
69 | #define SPI_NUM_CHIPSELECTS 0x08 | ||
70 | #define SPI_PAR_VAL 0x07 /* Enable DIN, DOUT, CLK */ | ||
71 | #define SPI_CS_MASK 0x78 | ||
72 | |||
73 | #define FLASH_BLOCKSIZE (1024*64) | ||
74 | #define FLASH_NUMBLOCKS 64 | ||
75 | #define FLASH_TYPE "m25p32" | ||
76 | /* Reserve 1M for the kernel parition */ | ||
77 | #define FLASH_KERNEL_SIZE (1024 * 1024) | ||
78 | |||
79 | #define M25P80_CS 5 | ||
80 | #define MMC_CS 6 | ||
81 | |||
82 | #ifdef CONFIG_MTD_PARTITIONS | ||
83 | static struct mtd_partition stm25p_partitions[] = { | ||
84 | /* sflash */ | ||
85 | [0] = { | ||
86 | .name = "kernel", | ||
87 | .offset = FLASH_BLOCKSIZE * FLASH_NUMBLOCKS - FLASH_KERNEL_SIZE, | ||
88 | .size = FLASH_KERNEL_SIZE, | ||
89 | .mask_flags = 0 | ||
90 | }, | ||
91 | [1] = { | ||
92 | .name = "image", | ||
93 | .offset = 0x00000000, | ||
94 | .size = FLASH_BLOCKSIZE * FLASH_NUMBLOCKS - FLASH_KERNEL_SIZE, | ||
95 | .mask_flags = 0 | ||
96 | }, | ||
97 | [2] = { | ||
98 | .name = "all", | ||
99 | .offset = 0x00000000, | ||
100 | .size = FLASH_BLOCKSIZE * FLASH_NUMBLOCKS, | ||
101 | .mask_flags = 0 | ||
102 | } | ||
103 | }; | ||
104 | #endif | ||
105 | |||
106 | #else | ||
107 | #define SPI_NUM_CHIPSELECTS 0x04 | ||
108 | #define SPI_PAR_VAL 0x7F /* Enable DIN, DOUT, CLK, CS0 - CS4 */ | ||
109 | #endif | ||
110 | |||
111 | #ifdef MMC_CS | ||
112 | static struct coldfire_spi_chip flash_chip_info = { | ||
113 | .mode = SPI_MODE_0, | ||
114 | .bits_per_word = 16, | ||
115 | .del_cs_to_clk = 17, | ||
116 | .del_after_trans = 1, | ||
117 | .void_write_data = 0 | ||
118 | }; | ||
119 | |||
120 | static struct coldfire_spi_chip mmc_chip_info = { | ||
121 | .mode = SPI_MODE_0, | ||
122 | .bits_per_word = 16, | ||
123 | .del_cs_to_clk = 17, | ||
124 | .del_after_trans = 1, | ||
125 | .void_write_data = 0xFFFF | ||
126 | }; | ||
127 | #endif | ||
128 | |||
129 | #ifdef M25P80_CS | ||
130 | static struct flash_platform_data stm25p80_platform_data = { | ||
131 | .name = "ST M25P80 SPI Flash chip", | ||
132 | #ifdef CONFIG_MTD_PARTITIONS | ||
133 | .parts = stm25p_partitions, | ||
134 | .nr_parts = sizeof(stm25p_partitions) / sizeof(*stm25p_partitions), | ||
135 | #endif | ||
136 | .type = FLASH_TYPE | ||
137 | }; | ||
138 | #endif | ||
139 | |||
140 | static struct spi_board_info spi_board_info[] __initdata = { | ||
141 | #ifdef M25P80_CS | ||
142 | { | ||
143 | .modalias = "m25p80", | ||
144 | .max_speed_hz = 16000000, | ||
145 | .bus_num = 1, | ||
146 | .chip_select = M25P80_CS, | ||
147 | .platform_data = &stm25p80_platform_data, | ||
148 | .controller_data = &flash_chip_info | ||
149 | }, | ||
150 | #endif | ||
151 | #ifdef MMC_CS | ||
152 | { | ||
153 | .modalias = "mmc_spi", | ||
154 | .max_speed_hz = 16000000, | ||
155 | .bus_num = 1, | ||
156 | .chip_select = MMC_CS, | ||
157 | .controller_data = &mmc_chip_info | ||
158 | } | ||
159 | #endif | ||
160 | }; | ||
161 | |||
162 | static struct coldfire_spi_master coldfire_master_info = { | ||
163 | .bus_num = 1, | ||
164 | .num_chipselect = SPI_NUM_CHIPSELECTS, | ||
165 | .irq_source = MCF5282_QSPI_IRQ_SOURCE, | ||
166 | .irq_vector = MCF5282_QSPI_IRQ_VECTOR, | ||
167 | .irq_mask = ((0x01 << MCF5282_QSPI_IRQ_SOURCE) | 0x01), | ||
168 | .irq_lp = 0x2B, /* Level 5 and Priority 3 */ | ||
169 | .par_val = SPI_PAR_VAL, | ||
170 | .cs_control = coldfire_qspi_cs_control, | ||
171 | }; | ||
172 | |||
173 | static struct resource coldfire_spi_resources[] = { | ||
174 | [0] = { | ||
175 | .name = "qspi-par", | ||
176 | .start = MCF5282_QSPI_PAR, | ||
177 | .end = MCF5282_QSPI_PAR, | ||
178 | .flags = IORESOURCE_MEM | ||
179 | }, | ||
180 | |||
181 | [1] = { | ||
182 | .name = "qspi-module", | ||
183 | .start = MCF5282_QSPI_QMR, | ||
184 | .end = MCF5282_QSPI_QMR + 0x18, | ||
185 | .flags = IORESOURCE_MEM | ||
186 | }, | ||
187 | |||
188 | [2] = { | ||
189 | .name = "qspi-int-level", | ||
190 | .start = MCF5282_INTC0 + MCFINTC_ICR0 + MCF5282_QSPI_IRQ_SOURCE, | ||
191 | .end = MCF5282_INTC0 + MCFINTC_ICR0 + MCF5282_QSPI_IRQ_SOURCE, | ||
192 | .flags = IORESOURCE_MEM | ||
193 | }, | ||
194 | |||
195 | [3] = { | ||
196 | .name = "qspi-int-mask", | ||
197 | .start = MCF5282_INTC0 + MCFINTC_IMRL, | ||
198 | .end = MCF5282_INTC0 + MCFINTC_IMRL, | ||
199 | .flags = IORESOURCE_MEM | ||
200 | } | ||
201 | }; | ||
202 | |||
203 | static struct platform_device coldfire_spi = { | ||
204 | .name = "spi_coldfire", | ||
205 | .id = -1, | ||
206 | .resource = coldfire_spi_resources, | ||
207 | .num_resources = ARRAY_SIZE(coldfire_spi_resources), | ||
208 | .dev = { | ||
209 | .platform_data = &coldfire_master_info, | ||
210 | } | ||
211 | }; | ||
212 | |||
213 | static void coldfire_qspi_cs_control(u8 cs, u8 command) | ||
214 | { | ||
215 | u8 cs_bit = ((0x01 << cs) << 3) & SPI_CS_MASK; | ||
216 | |||
217 | #if defined(CONFIG_WILDFIRE) | ||
218 | u8 cs_mask = ~(((0x01 << cs) << 3) & SPI_CS_MASK); | ||
219 | #endif | ||
220 | #if defined(CONFIG_WILDFIREMOD) | ||
221 | u8 cs_mask = (cs << 3) & SPI_CS_MASK; | ||
222 | #endif | ||
223 | |||
224 | /* | ||
225 | * Don't do anything if the chip select is not | ||
226 | * one of the port qs pins. | ||
227 | */ | ||
228 | if (command & QSPI_CS_INIT) { | ||
229 | #if defined(CONFIG_WILDFIRE) | ||
230 | MCF5282_GPIO_DDRQS |= cs_bit; | ||
231 | MCF5282_GPIO_PQSPAR &= ~cs_bit; | ||
232 | #endif | ||
233 | |||
234 | #if defined(CONFIG_WILDFIREMOD) | ||
235 | MCF5282_GPIO_DDRQS |= SPI_CS_MASK; | ||
236 | MCF5282_GPIO_PQSPAR &= ~SPI_CS_MASK; | ||
237 | #endif | ||
238 | } | ||
239 | |||
240 | if (command & QSPI_CS_ASSERT) { | ||
241 | MCF5282_GPIO_PORTQS &= ~SPI_CS_MASK; | ||
242 | MCF5282_GPIO_PORTQS |= cs_mask; | ||
243 | } else if (command & QSPI_CS_DROP) { | ||
244 | MCF5282_GPIO_PORTQS |= SPI_CS_MASK; | ||
245 | } | ||
246 | } | ||
247 | |||
248 | static int __init spi_dev_init(void) | ||
249 | { | ||
250 | int retval; | ||
251 | |||
252 | retval = platform_device_register(&coldfire_spi); | ||
253 | if (retval < 0) | ||
254 | return retval; | ||
255 | |||
256 | if (ARRAY_SIZE(spi_board_info)) | ||
257 | retval = spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); | ||
258 | |||
259 | return retval; | ||
260 | } | ||
261 | |||
262 | #endif /* CONFIG_SPI */ | ||
263 | 35 | ||
264 | /***************************************************************************/ | 36 | /***************************************************************************/ |
265 | 37 | ||
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 600eef3f3ac7..e61465a18c7e 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -603,7 +603,7 @@ config CAVIUM_OCTEON_SIMULATOR | |||
603 | select SYS_SUPPORTS_64BIT_KERNEL | 603 | select SYS_SUPPORTS_64BIT_KERNEL |
604 | select SYS_SUPPORTS_BIG_ENDIAN | 604 | select SYS_SUPPORTS_BIG_ENDIAN |
605 | select SYS_SUPPORTS_HIGHMEM | 605 | select SYS_SUPPORTS_HIGHMEM |
606 | select CPU_CAVIUM_OCTEON | 606 | select SYS_HAS_CPU_CAVIUM_OCTEON |
607 | help | 607 | help |
608 | The Octeon simulator is software performance model of the Cavium | 608 | The Octeon simulator is software performance model of the Cavium |
609 | Octeon Processor. It supports simulating Octeon processors on x86 | 609 | Octeon Processor. It supports simulating Octeon processors on x86 |
@@ -618,7 +618,7 @@ config CAVIUM_OCTEON_REFERENCE_BOARD | |||
618 | select SYS_SUPPORTS_BIG_ENDIAN | 618 | select SYS_SUPPORTS_BIG_ENDIAN |
619 | select SYS_SUPPORTS_HIGHMEM | 619 | select SYS_SUPPORTS_HIGHMEM |
620 | select SYS_HAS_EARLY_PRINTK | 620 | select SYS_HAS_EARLY_PRINTK |
621 | select CPU_CAVIUM_OCTEON | 621 | select SYS_HAS_CPU_CAVIUM_OCTEON |
622 | select SWAP_IO_SPACE | 622 | select SWAP_IO_SPACE |
623 | help | 623 | help |
624 | This option supports all of the Octeon reference boards from Cavium | 624 | This option supports all of the Octeon reference boards from Cavium |
@@ -1234,6 +1234,7 @@ config CPU_SB1 | |||
1234 | 1234 | ||
1235 | config CPU_CAVIUM_OCTEON | 1235 | config CPU_CAVIUM_OCTEON |
1236 | bool "Cavium Octeon processor" | 1236 | bool "Cavium Octeon processor" |
1237 | depends on SYS_HAS_CPU_CAVIUM_OCTEON | ||
1237 | select IRQ_CPU | 1238 | select IRQ_CPU |
1238 | select IRQ_CPU_OCTEON | 1239 | select IRQ_CPU_OCTEON |
1239 | select CPU_HAS_PREFETCH | 1240 | select CPU_HAS_PREFETCH |
@@ -1314,6 +1315,9 @@ config SYS_HAS_CPU_RM9000 | |||
1314 | config SYS_HAS_CPU_SB1 | 1315 | config SYS_HAS_CPU_SB1 |
1315 | bool | 1316 | bool |
1316 | 1317 | ||
1318 | config SYS_HAS_CPU_CAVIUM_OCTEON | ||
1319 | bool | ||
1320 | |||
1317 | # | 1321 | # |
1318 | # CPU may reorder R->R, R->W, W->R, W->W | 1322 | # CPU may reorder R->R, R->W, W->R, W->W |
1319 | # Reordering beyond LL and SC is handled in WEAK_REORDERING_BEYOND_LLSC | 1323 | # Reordering beyond LL and SC is handled in WEAK_REORDERING_BEYOND_LLSC |
@@ -1387,6 +1391,7 @@ config 32BIT | |||
1387 | config 64BIT | 1391 | config 64BIT |
1388 | bool "64-bit kernel" | 1392 | bool "64-bit kernel" |
1389 | depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL | 1393 | depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL |
1394 | select HAVE_SYSCALL_WRAPPERS | ||
1390 | help | 1395 | help |
1391 | Select this option if you want to build a 64-bit kernel. | 1396 | Select this option if you want to build a 64-bit kernel. |
1392 | 1397 | ||
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c index 6fd441d16af5..f58d4ffb8945 100644 --- a/arch/mips/alchemy/common/time.c +++ b/arch/mips/alchemy/common/time.c | |||
@@ -118,7 +118,7 @@ void __init plat_time_init(void) | |||
118 | * setup counter 1 (RTC) to tick at full speed | 118 | * setup counter 1 (RTC) to tick at full speed |
119 | */ | 119 | */ |
120 | t = 0xffffff; | 120 | t = 0xffffff; |
121 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && t--) | 121 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && --t) |
122 | asm volatile ("nop"); | 122 | asm volatile ("nop"); |
123 | if (!t) | 123 | if (!t) |
124 | goto cntr_err; | 124 | goto cntr_err; |
@@ -127,7 +127,7 @@ void __init plat_time_init(void) | |||
127 | au_sync(); | 127 | au_sync(); |
128 | 128 | ||
129 | t = 0xffffff; | 129 | t = 0xffffff; |
130 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--) | 130 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t) |
131 | asm volatile ("nop"); | 131 | asm volatile ("nop"); |
132 | if (!t) | 132 | if (!t) |
133 | goto cntr_err; | 133 | goto cntr_err; |
@@ -135,7 +135,7 @@ void __init plat_time_init(void) | |||
135 | au_sync(); | 135 | au_sync(); |
136 | 136 | ||
137 | t = 0xffffff; | 137 | t = 0xffffff; |
138 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--) | 138 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t) |
139 | asm volatile ("nop"); | 139 | asm volatile ("nop"); |
140 | if (!t) | 140 | if (!t) |
141 | goto cntr_err; | 141 | goto cntr_err; |
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h index ac5d541368e9..6c5b40905dd6 100644 --- a/arch/mips/include/asm/compat.h +++ b/arch/mips/include/asm/compat.h | |||
@@ -3,6 +3,8 @@ | |||
3 | /* | 3 | /* |
4 | * Architecture specific compatibility types | 4 | * Architecture specific compatibility types |
5 | */ | 5 | */ |
6 | #include <linux/seccomp.h> | ||
7 | #include <linux/thread_info.h> | ||
6 | #include <linux/types.h> | 8 | #include <linux/types.h> |
7 | #include <asm/page.h> | 9 | #include <asm/page.h> |
8 | #include <asm/ptrace.h> | 10 | #include <asm/ptrace.h> |
@@ -218,4 +220,9 @@ struct compat_shmid64_ds { | |||
218 | compat_ulong_t __unused2; | 220 | compat_ulong_t __unused2; |
219 | }; | 221 | }; |
220 | 222 | ||
223 | static inline int is_compat_task(void) | ||
224 | { | ||
225 | return test_thread_flag(TIF_32BIT); | ||
226 | } | ||
227 | |||
221 | #endif /* _ASM_COMPAT_H */ | 228 | #endif /* _ASM_COMPAT_H */ |
diff --git a/arch/mips/include/asm/seccomp.h b/arch/mips/include/asm/seccomp.h index 36ed44070256..a6772e9507f5 100644 --- a/arch/mips/include/asm/seccomp.h +++ b/arch/mips/include/asm/seccomp.h | |||
@@ -1,6 +1,5 @@ | |||
1 | #ifndef __ASM_SECCOMP_H | 1 | #ifndef __ASM_SECCOMP_H |
2 | 2 | ||
3 | #include <linux/thread_info.h> | ||
4 | #include <linux/unistd.h> | 3 | #include <linux/unistd.h> |
5 | 4 | ||
6 | #define __NR_seccomp_read __NR_read | 5 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h index 1a1f320c30d8..0884947ebe27 100644 --- a/arch/mips/include/asm/spinlock.h +++ b/arch/mips/include/asm/spinlock.h | |||
@@ -51,6 +51,7 @@ static inline int __raw_spin_is_contended(raw_spinlock_t *lock) | |||
51 | 51 | ||
52 | return (((counters >> 14) - counters) & 0x1fff) > 1; | 52 | return (((counters >> 14) - counters) & 0x1fff) > 1; |
53 | } | 53 | } |
54 | #define __raw_spin_is_contended __raw_spin_is_contended | ||
54 | 55 | ||
55 | static inline void __raw_spin_lock(raw_spinlock_t *lock) | 56 | static inline void __raw_spin_lock(raw_spinlock_t *lock) |
56 | { | 57 | { |
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index a0ff2b66e22b..4b4007b3083a 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c | |||
@@ -111,7 +111,6 @@ int show_interrupts(struct seq_file *p, void *v) | |||
111 | seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); | 111 | seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); |
112 | #endif | 112 | #endif |
113 | seq_printf(p, " %14s", irq_desc[i].chip->name); | 113 | seq_printf(p, " %14s", irq_desc[i].chip->name); |
114 | seq_printf(p, "-%-8s", irq_desc[i].name); | ||
115 | seq_printf(p, " %s", action->name); | 114 | seq_printf(p, " %s", action->name); |
116 | 115 | ||
117 | for (action=action->next; action; action = action->next) | 116 | for (action=action->next; action; action = action->next) |
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index aa2c55e3b55f..2f8452b404c7 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
33 | #include <linux/binfmts.h> | 33 | #include <linux/binfmts.h> |
34 | #include <linux/security.h> | 34 | #include <linux/security.h> |
35 | #include <linux/syscalls.h> | ||
35 | #include <linux/compat.h> | 36 | #include <linux/compat.h> |
36 | #include <linux/vfs.h> | 37 | #include <linux/vfs.h> |
37 | #include <linux/ipc.h> | 38 | #include <linux/ipc.h> |
@@ -63,9 +64,9 @@ | |||
63 | #define merge_64(r1, r2) ((((r2) & 0xffffffffUL) << 32) + ((r1) & 0xffffffffUL)) | 64 | #define merge_64(r1, r2) ((((r2) & 0xffffffffUL) << 32) + ((r1) & 0xffffffffUL)) |
64 | #endif | 65 | #endif |
65 | 66 | ||
66 | asmlinkage unsigned long | 67 | SYSCALL_DEFINE6(32_mmap2, unsigned long, addr, unsigned long, len, |
67 | sys32_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | 68 | unsigned long, prot, unsigned long, flags, unsigned long, fd, |
68 | unsigned long flags, unsigned long fd, unsigned long pgoff) | 69 | unsigned long, pgoff) |
69 | { | 70 | { |
70 | struct file * file = NULL; | 71 | struct file * file = NULL; |
71 | unsigned long error; | 72 | unsigned long error; |
@@ -121,21 +122,21 @@ struct rlimit32 { | |||
121 | int rlim_max; | 122 | int rlim_max; |
122 | }; | 123 | }; |
123 | 124 | ||
124 | asmlinkage long sys32_truncate64(const char __user * path, | 125 | SYSCALL_DEFINE4(32_truncate64, const char __user *, path, |
125 | unsigned long __dummy, int a2, int a3) | 126 | unsigned long, __dummy, unsigned long, a2, unsigned long, a3) |
126 | { | 127 | { |
127 | return sys_truncate(path, merge_64(a2, a3)); | 128 | return sys_truncate(path, merge_64(a2, a3)); |
128 | } | 129 | } |
129 | 130 | ||
130 | asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long __dummy, | 131 | SYSCALL_DEFINE4(32_ftruncate64, unsigned long, fd, unsigned long, __dummy, |
131 | int a2, int a3) | 132 | unsigned long, a2, unsigned long, a3) |
132 | { | 133 | { |
133 | return sys_ftruncate(fd, merge_64(a2, a3)); | 134 | return sys_ftruncate(fd, merge_64(a2, a3)); |
134 | } | 135 | } |
135 | 136 | ||
136 | asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high, | 137 | SYSCALL_DEFINE5(32_llseek, unsigned long, fd, unsigned long, offset_high, |
137 | unsigned int offset_low, loff_t __user * result, | 138 | unsigned long, offset_low, loff_t __user *, result, |
138 | unsigned int origin) | 139 | unsigned long, origin) |
139 | { | 140 | { |
140 | return sys_llseek(fd, offset_high, offset_low, result, origin); | 141 | return sys_llseek(fd, offset_high, offset_low, result, origin); |
141 | } | 142 | } |
@@ -144,20 +145,20 @@ asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high, | |||
144 | lseek back to original location. They fail just like lseek does on | 145 | lseek back to original location. They fail just like lseek does on |
145 | non-seekable files. */ | 146 | non-seekable files. */ |
146 | 147 | ||
147 | asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf, | 148 | SYSCALL_DEFINE6(32_pread, unsigned long, fd, char __user *, buf, size_t, count, |
148 | size_t count, u32 unused, u64 a4, u64 a5) | 149 | unsigned long, unused, unsigned long, a4, unsigned long, a5) |
149 | { | 150 | { |
150 | return sys_pread64(fd, buf, count, merge_64(a4, a5)); | 151 | return sys_pread64(fd, buf, count, merge_64(a4, a5)); |
151 | } | 152 | } |
152 | 153 | ||
153 | asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf, | 154 | SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf, |
154 | size_t count, u32 unused, u64 a4, u64 a5) | 155 | size_t, count, u32, unused, u64, a4, u64, a5) |
155 | { | 156 | { |
156 | return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); | 157 | return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); |
157 | } | 158 | } |
158 | 159 | ||
159 | asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, | 160 | SYSCALL_DEFINE2(32_sched_rr_get_interval, compat_pid_t, pid, |
160 | struct compat_timespec __user *interval) | 161 | struct compat_timespec __user *, interval) |
161 | { | 162 | { |
162 | struct timespec t; | 163 | struct timespec t; |
163 | int ret; | 164 | int ret; |
@@ -174,8 +175,8 @@ asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, | |||
174 | 175 | ||
175 | #ifdef CONFIG_SYSVIPC | 176 | #ifdef CONFIG_SYSVIPC |
176 | 177 | ||
177 | asmlinkage long | 178 | SYSCALL_DEFINE6(32_ipc, u32, call, long, first, long, second, long, third, |
178 | sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) | 179 | unsigned long, ptr, unsigned long, fifth) |
179 | { | 180 | { |
180 | int version, err; | 181 | int version, err; |
181 | 182 | ||
@@ -233,8 +234,8 @@ sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) | |||
233 | 234 | ||
234 | #else | 235 | #else |
235 | 236 | ||
236 | asmlinkage long | 237 | SYSCALL_DEFINE6(32_ipc, u32, call, int, first, int, second, int, third, |
237 | sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) | 238 | u32, ptr, u32 fifth) |
238 | { | 239 | { |
239 | return -ENOSYS; | 240 | return -ENOSYS; |
240 | } | 241 | } |
@@ -242,7 +243,7 @@ sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) | |||
242 | #endif /* CONFIG_SYSVIPC */ | 243 | #endif /* CONFIG_SYSVIPC */ |
243 | 244 | ||
244 | #ifdef CONFIG_MIPS32_N32 | 245 | #ifdef CONFIG_MIPS32_N32 |
245 | asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg) | 246 | SYSCALL_DEFINE4(n32_semctl, int, semid, int, semnum, int, cmd, u32, arg) |
246 | { | 247 | { |
247 | /* compat_sys_semctl expects a pointer to union semun */ | 248 | /* compat_sys_semctl expects a pointer to union semun */ |
248 | u32 __user *uptr = compat_alloc_user_space(sizeof(u32)); | 249 | u32 __user *uptr = compat_alloc_user_space(sizeof(u32)); |
@@ -251,13 +252,14 @@ asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg) | |||
251 | return compat_sys_semctl(semid, semnum, cmd, uptr); | 252 | return compat_sys_semctl(semid, semnum, cmd, uptr); |
252 | } | 253 | } |
253 | 254 | ||
254 | asmlinkage long sysn32_msgsnd(int msqid, u32 msgp, unsigned msgsz, int msgflg) | 255 | SYSCALL_DEFINE4(n32_msgsnd, int, msqid, u32, msgp, unsigned int, msgsz, |
256 | int, msgflg) | ||
255 | { | 257 | { |
256 | return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp)); | 258 | return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp)); |
257 | } | 259 | } |
258 | 260 | ||
259 | asmlinkage long sysn32_msgrcv(int msqid, u32 msgp, size_t msgsz, int msgtyp, | 261 | SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz, |
260 | int msgflg) | 262 | int, msgtyp, int, msgflg) |
261 | { | 263 | { |
262 | return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64, | 264 | return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64, |
263 | compat_ptr(msgp)); | 265 | compat_ptr(msgp)); |
@@ -277,7 +279,7 @@ struct sysctl_args32 | |||
277 | 279 | ||
278 | #ifdef CONFIG_SYSCTL_SYSCALL | 280 | #ifdef CONFIG_SYSCTL_SYSCALL |
279 | 281 | ||
280 | asmlinkage long sys32_sysctl(struct sysctl_args32 __user *args) | 282 | SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args) |
281 | { | 283 | { |
282 | struct sysctl_args32 tmp; | 284 | struct sysctl_args32 tmp; |
283 | int error; | 285 | int error; |
@@ -316,9 +318,16 @@ asmlinkage long sys32_sysctl(struct sysctl_args32 __user *args) | |||
316 | return error; | 318 | return error; |
317 | } | 319 | } |
318 | 320 | ||
321 | #else | ||
322 | |||
323 | SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args) | ||
324 | { | ||
325 | return -ENOSYS; | ||
326 | } | ||
327 | |||
319 | #endif /* CONFIG_SYSCTL_SYSCALL */ | 328 | #endif /* CONFIG_SYSCTL_SYSCALL */ |
320 | 329 | ||
321 | asmlinkage long sys32_newuname(struct new_utsname __user * name) | 330 | SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) |
322 | { | 331 | { |
323 | int ret = 0; | 332 | int ret = 0; |
324 | 333 | ||
@@ -334,7 +343,7 @@ asmlinkage long sys32_newuname(struct new_utsname __user * name) | |||
334 | return ret; | 343 | return ret; |
335 | } | 344 | } |
336 | 345 | ||
337 | asmlinkage int sys32_personality(unsigned long personality) | 346 | SYSCALL_DEFINE1(32_personality, unsigned long, personality) |
338 | { | 347 | { |
339 | int ret; | 348 | int ret; |
340 | personality &= 0xffffffff; | 349 | personality &= 0xffffffff; |
@@ -357,7 +366,7 @@ struct ustat32 { | |||
357 | 366 | ||
358 | extern asmlinkage long sys_ustat(dev_t dev, struct ustat __user * ubuf); | 367 | extern asmlinkage long sys_ustat(dev_t dev, struct ustat __user * ubuf); |
359 | 368 | ||
360 | asmlinkage int sys32_ustat(dev_t dev, struct ustat32 __user * ubuf32) | 369 | SYSCALL_DEFINE2(32_ustat, dev_t, dev, struct ustat32 __user *, ubuf32) |
361 | { | 370 | { |
362 | int err; | 371 | int err; |
363 | struct ustat tmp; | 372 | struct ustat tmp; |
@@ -381,8 +390,8 @@ out: | |||
381 | return err; | 390 | return err; |
382 | } | 391 | } |
383 | 392 | ||
384 | asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, | 393 | SYSCALL_DEFINE4(32_sendfile, long, out_fd, long, in_fd, |
385 | s32 count) | 394 | compat_off_t __user *, offset, s32, count) |
386 | { | 395 | { |
387 | mm_segment_t old_fs = get_fs(); | 396 | mm_segment_t old_fs = get_fs(); |
388 | int ret; | 397 | int ret; |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 51d1ba415b90..9ab70c3b5be6 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -399,7 +399,7 @@ einval: li v0, -ENOSYS | |||
399 | sys sys_swapon 2 | 399 | sys sys_swapon 2 |
400 | sys sys_reboot 3 | 400 | sys sys_reboot 3 |
401 | sys sys_old_readdir 3 | 401 | sys sys_old_readdir 3 |
402 | sys old_mmap 6 /* 4090 */ | 402 | sys sys_mips_mmap 6 /* 4090 */ |
403 | sys sys_munmap 2 | 403 | sys sys_munmap 2 |
404 | sys sys_truncate 2 | 404 | sys sys_truncate 2 |
405 | sys sys_ftruncate 2 | 405 | sys sys_ftruncate 2 |
@@ -519,7 +519,7 @@ einval: li v0, -ENOSYS | |||
519 | sys sys_sendfile 4 | 519 | sys sys_sendfile 4 |
520 | sys sys_ni_syscall 0 | 520 | sys sys_ni_syscall 0 |
521 | sys sys_ni_syscall 0 | 521 | sys sys_ni_syscall 0 |
522 | sys sys_mmap2 6 /* 4210 */ | 522 | sys sys_mips_mmap2 6 /* 4210 */ |
523 | sys sys_truncate64 4 | 523 | sys sys_truncate64 4 |
524 | sys sys_ftruncate64 4 | 524 | sys sys_ftruncate64 4 |
525 | sys sys_stat64 2 | 525 | sys sys_stat64 2 |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index a9e171618994..9b4698667154 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -207,7 +207,7 @@ sys_call_table: | |||
207 | PTR sys_newlstat | 207 | PTR sys_newlstat |
208 | PTR sys_poll | 208 | PTR sys_poll |
209 | PTR sys_lseek | 209 | PTR sys_lseek |
210 | PTR old_mmap | 210 | PTR sys_mips_mmap |
211 | PTR sys_mprotect /* 5010 */ | 211 | PTR sys_mprotect /* 5010 */ |
212 | PTR sys_munmap | 212 | PTR sys_munmap |
213 | PTR sys_brk | 213 | PTR sys_brk |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 30f3b6317a83..7438e92f8a01 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -129,12 +129,12 @@ EXPORT(sysn32_call_table) | |||
129 | PTR sys_newlstat | 129 | PTR sys_newlstat |
130 | PTR sys_poll | 130 | PTR sys_poll |
131 | PTR sys_lseek | 131 | PTR sys_lseek |
132 | PTR old_mmap | 132 | PTR sys_mips_mmap |
133 | PTR sys_mprotect /* 6010 */ | 133 | PTR sys_mprotect /* 6010 */ |
134 | PTR sys_munmap | 134 | PTR sys_munmap |
135 | PTR sys_brk | 135 | PTR sys_brk |
136 | PTR sys32_rt_sigaction | 136 | PTR sys_32_rt_sigaction |
137 | PTR sys32_rt_sigprocmask | 137 | PTR sys_32_rt_sigprocmask |
138 | PTR compat_sys_ioctl /* 6015 */ | 138 | PTR compat_sys_ioctl /* 6015 */ |
139 | PTR sys_pread64 | 139 | PTR sys_pread64 |
140 | PTR sys_pwrite64 | 140 | PTR sys_pwrite64 |
@@ -159,7 +159,7 @@ EXPORT(sysn32_call_table) | |||
159 | PTR compat_sys_setitimer | 159 | PTR compat_sys_setitimer |
160 | PTR sys_alarm | 160 | PTR sys_alarm |
161 | PTR sys_getpid | 161 | PTR sys_getpid |
162 | PTR sys32_sendfile | 162 | PTR sys_32_sendfile |
163 | PTR sys_socket /* 6040 */ | 163 | PTR sys_socket /* 6040 */ |
164 | PTR sys_connect | 164 | PTR sys_connect |
165 | PTR sys_accept | 165 | PTR sys_accept |
@@ -181,14 +181,14 @@ EXPORT(sysn32_call_table) | |||
181 | PTR sys_exit | 181 | PTR sys_exit |
182 | PTR compat_sys_wait4 | 182 | PTR compat_sys_wait4 |
183 | PTR sys_kill /* 6060 */ | 183 | PTR sys_kill /* 6060 */ |
184 | PTR sys32_newuname | 184 | PTR sys_32_newuname |
185 | PTR sys_semget | 185 | PTR sys_semget |
186 | PTR sys_semop | 186 | PTR sys_semop |
187 | PTR sysn32_semctl | 187 | PTR sys_n32_semctl |
188 | PTR sys_shmdt /* 6065 */ | 188 | PTR sys_shmdt /* 6065 */ |
189 | PTR sys_msgget | 189 | PTR sys_msgget |
190 | PTR sysn32_msgsnd | 190 | PTR sys_n32_msgsnd |
191 | PTR sysn32_msgrcv | 191 | PTR sys_n32_msgrcv |
192 | PTR compat_sys_msgctl | 192 | PTR compat_sys_msgctl |
193 | PTR compat_sys_fcntl /* 6070 */ | 193 | PTR compat_sys_fcntl /* 6070 */ |
194 | PTR sys_flock | 194 | PTR sys_flock |
@@ -245,15 +245,15 @@ EXPORT(sysn32_call_table) | |||
245 | PTR sys_getsid | 245 | PTR sys_getsid |
246 | PTR sys_capget | 246 | PTR sys_capget |
247 | PTR sys_capset | 247 | PTR sys_capset |
248 | PTR sys32_rt_sigpending /* 6125 */ | 248 | PTR sys_32_rt_sigpending /* 6125 */ |
249 | PTR compat_sys_rt_sigtimedwait | 249 | PTR compat_sys_rt_sigtimedwait |
250 | PTR sys32_rt_sigqueueinfo | 250 | PTR sys_32_rt_sigqueueinfo |
251 | PTR sysn32_rt_sigsuspend | 251 | PTR sysn32_rt_sigsuspend |
252 | PTR sys32_sigaltstack | 252 | PTR sys32_sigaltstack |
253 | PTR compat_sys_utime /* 6130 */ | 253 | PTR compat_sys_utime /* 6130 */ |
254 | PTR sys_mknod | 254 | PTR sys_mknod |
255 | PTR sys32_personality | 255 | PTR sys_32_personality |
256 | PTR sys32_ustat | 256 | PTR sys_32_ustat |
257 | PTR compat_sys_statfs | 257 | PTR compat_sys_statfs |
258 | PTR compat_sys_fstatfs /* 6135 */ | 258 | PTR compat_sys_fstatfs /* 6135 */ |
259 | PTR sys_sysfs | 259 | PTR sys_sysfs |
@@ -265,14 +265,14 @@ EXPORT(sysn32_call_table) | |||
265 | PTR sys_sched_getscheduler | 265 | PTR sys_sched_getscheduler |
266 | PTR sys_sched_get_priority_max | 266 | PTR sys_sched_get_priority_max |
267 | PTR sys_sched_get_priority_min | 267 | PTR sys_sched_get_priority_min |
268 | PTR sys32_sched_rr_get_interval /* 6145 */ | 268 | PTR sys_32_sched_rr_get_interval /* 6145 */ |
269 | PTR sys_mlock | 269 | PTR sys_mlock |
270 | PTR sys_munlock | 270 | PTR sys_munlock |
271 | PTR sys_mlockall | 271 | PTR sys_mlockall |
272 | PTR sys_munlockall | 272 | PTR sys_munlockall |
273 | PTR sys_vhangup /* 6150 */ | 273 | PTR sys_vhangup /* 6150 */ |
274 | PTR sys_pivot_root | 274 | PTR sys_pivot_root |
275 | PTR sys32_sysctl | 275 | PTR sys_32_sysctl |
276 | PTR sys_prctl | 276 | PTR sys_prctl |
277 | PTR compat_sys_adjtimex | 277 | PTR compat_sys_adjtimex |
278 | PTR compat_sys_setrlimit /* 6155 */ | 278 | PTR compat_sys_setrlimit /* 6155 */ |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index fefef4af8595..b0fef4ff9827 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -265,12 +265,12 @@ sys_call_table: | |||
265 | PTR sys_olduname | 265 | PTR sys_olduname |
266 | PTR sys_umask /* 4060 */ | 266 | PTR sys_umask /* 4060 */ |
267 | PTR sys_chroot | 267 | PTR sys_chroot |
268 | PTR sys32_ustat | 268 | PTR sys_32_ustat |
269 | PTR sys_dup2 | 269 | PTR sys_dup2 |
270 | PTR sys_getppid | 270 | PTR sys_getppid |
271 | PTR sys_getpgrp /* 4065 */ | 271 | PTR sys_getpgrp /* 4065 */ |
272 | PTR sys_setsid | 272 | PTR sys_setsid |
273 | PTR sys32_sigaction | 273 | PTR sys_32_sigaction |
274 | PTR sys_sgetmask | 274 | PTR sys_sgetmask |
275 | PTR sys_ssetmask | 275 | PTR sys_ssetmask |
276 | PTR sys_setreuid /* 4070 */ | 276 | PTR sys_setreuid /* 4070 */ |
@@ -293,7 +293,7 @@ sys_call_table: | |||
293 | PTR sys_swapon | 293 | PTR sys_swapon |
294 | PTR sys_reboot | 294 | PTR sys_reboot |
295 | PTR compat_sys_old_readdir | 295 | PTR compat_sys_old_readdir |
296 | PTR old_mmap /* 4090 */ | 296 | PTR sys_mips_mmap /* 4090 */ |
297 | PTR sys_munmap | 297 | PTR sys_munmap |
298 | PTR sys_truncate | 298 | PTR sys_truncate |
299 | PTR sys_ftruncate | 299 | PTR sys_ftruncate |
@@ -320,12 +320,12 @@ sys_call_table: | |||
320 | PTR compat_sys_wait4 | 320 | PTR compat_sys_wait4 |
321 | PTR sys_swapoff /* 4115 */ | 321 | PTR sys_swapoff /* 4115 */ |
322 | PTR compat_sys_sysinfo | 322 | PTR compat_sys_sysinfo |
323 | PTR sys32_ipc | 323 | PTR sys_32_ipc |
324 | PTR sys_fsync | 324 | PTR sys_fsync |
325 | PTR sys32_sigreturn | 325 | PTR sys32_sigreturn |
326 | PTR sys32_clone /* 4120 */ | 326 | PTR sys32_clone /* 4120 */ |
327 | PTR sys_setdomainname | 327 | PTR sys_setdomainname |
328 | PTR sys32_newuname | 328 | PTR sys_32_newuname |
329 | PTR sys_ni_syscall /* sys_modify_ldt */ | 329 | PTR sys_ni_syscall /* sys_modify_ldt */ |
330 | PTR compat_sys_adjtimex | 330 | PTR compat_sys_adjtimex |
331 | PTR sys_mprotect /* 4125 */ | 331 | PTR sys_mprotect /* 4125 */ |
@@ -339,11 +339,11 @@ sys_call_table: | |||
339 | PTR sys_fchdir | 339 | PTR sys_fchdir |
340 | PTR sys_bdflush | 340 | PTR sys_bdflush |
341 | PTR sys_sysfs /* 4135 */ | 341 | PTR sys_sysfs /* 4135 */ |
342 | PTR sys32_personality | 342 | PTR sys_32_personality |
343 | PTR sys_ni_syscall /* for afs_syscall */ | 343 | PTR sys_ni_syscall /* for afs_syscall */ |
344 | PTR sys_setfsuid | 344 | PTR sys_setfsuid |
345 | PTR sys_setfsgid | 345 | PTR sys_setfsgid |
346 | PTR sys32_llseek /* 4140 */ | 346 | PTR sys_32_llseek /* 4140 */ |
347 | PTR compat_sys_getdents | 347 | PTR compat_sys_getdents |
348 | PTR compat_sys_select | 348 | PTR compat_sys_select |
349 | PTR sys_flock | 349 | PTR sys_flock |
@@ -356,7 +356,7 @@ sys_call_table: | |||
356 | PTR sys_ni_syscall /* 4150 */ | 356 | PTR sys_ni_syscall /* 4150 */ |
357 | PTR sys_getsid | 357 | PTR sys_getsid |
358 | PTR sys_fdatasync | 358 | PTR sys_fdatasync |
359 | PTR sys32_sysctl | 359 | PTR sys_32_sysctl |
360 | PTR sys_mlock | 360 | PTR sys_mlock |
361 | PTR sys_munlock /* 4155 */ | 361 | PTR sys_munlock /* 4155 */ |
362 | PTR sys_mlockall | 362 | PTR sys_mlockall |
@@ -368,7 +368,7 @@ sys_call_table: | |||
368 | PTR sys_sched_yield | 368 | PTR sys_sched_yield |
369 | PTR sys_sched_get_priority_max | 369 | PTR sys_sched_get_priority_max |
370 | PTR sys_sched_get_priority_min | 370 | PTR sys_sched_get_priority_min |
371 | PTR sys32_sched_rr_get_interval /* 4165 */ | 371 | PTR sys_32_sched_rr_get_interval /* 4165 */ |
372 | PTR compat_sys_nanosleep | 372 | PTR compat_sys_nanosleep |
373 | PTR sys_mremap | 373 | PTR sys_mremap |
374 | PTR sys_accept | 374 | PTR sys_accept |
@@ -397,25 +397,25 @@ sys_call_table: | |||
397 | PTR sys_getresgid | 397 | PTR sys_getresgid |
398 | PTR sys_prctl | 398 | PTR sys_prctl |
399 | PTR sys32_rt_sigreturn | 399 | PTR sys32_rt_sigreturn |
400 | PTR sys32_rt_sigaction | 400 | PTR sys_32_rt_sigaction |
401 | PTR sys32_rt_sigprocmask /* 4195 */ | 401 | PTR sys_32_rt_sigprocmask /* 4195 */ |
402 | PTR sys32_rt_sigpending | 402 | PTR sys_32_rt_sigpending |
403 | PTR compat_sys_rt_sigtimedwait | 403 | PTR compat_sys_rt_sigtimedwait |
404 | PTR sys32_rt_sigqueueinfo | 404 | PTR sys_32_rt_sigqueueinfo |
405 | PTR sys32_rt_sigsuspend | 405 | PTR sys32_rt_sigsuspend |
406 | PTR sys32_pread /* 4200 */ | 406 | PTR sys_32_pread /* 4200 */ |
407 | PTR sys32_pwrite | 407 | PTR sys_32_pwrite |
408 | PTR sys_chown | 408 | PTR sys_chown |
409 | PTR sys_getcwd | 409 | PTR sys_getcwd |
410 | PTR sys_capget | 410 | PTR sys_capget |
411 | PTR sys_capset /* 4205 */ | 411 | PTR sys_capset /* 4205 */ |
412 | PTR sys32_sigaltstack | 412 | PTR sys32_sigaltstack |
413 | PTR sys32_sendfile | 413 | PTR sys_32_sendfile |
414 | PTR sys_ni_syscall | 414 | PTR sys_ni_syscall |
415 | PTR sys_ni_syscall | 415 | PTR sys_ni_syscall |
416 | PTR sys32_mmap2 /* 4210 */ | 416 | PTR sys_mips_mmap2 /* 4210 */ |
417 | PTR sys32_truncate64 | 417 | PTR sys_32_truncate64 |
418 | PTR sys32_ftruncate64 | 418 | PTR sys_32_ftruncate64 |
419 | PTR sys_newstat | 419 | PTR sys_newstat |
420 | PTR sys_newlstat | 420 | PTR sys_newlstat |
421 | PTR sys_newfstat /* 4215 */ | 421 | PTR sys_newfstat /* 4215 */ |
@@ -481,7 +481,7 @@ sys_call_table: | |||
481 | PTR compat_sys_mq_notify /* 4275 */ | 481 | PTR compat_sys_mq_notify /* 4275 */ |
482 | PTR compat_sys_mq_getsetattr | 482 | PTR compat_sys_mq_getsetattr |
483 | PTR sys_ni_syscall /* sys_vserver */ | 483 | PTR sys_ni_syscall /* sys_vserver */ |
484 | PTR sys32_waitid | 484 | PTR sys_32_waitid |
485 | PTR sys_ni_syscall /* available, was setaltroot */ | 485 | PTR sys_ni_syscall /* available, was setaltroot */ |
486 | PTR sys_add_key /* 4280 */ | 486 | PTR sys_add_key /* 4280 */ |
487 | PTR sys_request_key | 487 | PTR sys_request_key |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index a4e106c56ab5..830c5ef9932b 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/ptrace.h> | 19 | #include <linux/ptrace.h> |
20 | #include <linux/unistd.h> | 20 | #include <linux/unistd.h> |
21 | #include <linux/compiler.h> | 21 | #include <linux/compiler.h> |
22 | #include <linux/syscalls.h> | ||
22 | #include <linux/uaccess.h> | 23 | #include <linux/uaccess.h> |
23 | 24 | ||
24 | #include <asm/abi.h> | 25 | #include <asm/abi.h> |
@@ -338,8 +339,8 @@ asmlinkage int sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
338 | } | 339 | } |
339 | 340 | ||
340 | #ifdef CONFIG_TRAD_SIGNALS | 341 | #ifdef CONFIG_TRAD_SIGNALS |
341 | asmlinkage int sys_sigaction(int sig, const struct sigaction __user *act, | 342 | SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act, |
342 | struct sigaction __user *oact) | 343 | struct sigaction __user *, oact) |
343 | { | 344 | { |
344 | struct k_sigaction new_ka, old_ka; | 345 | struct k_sigaction new_ka, old_ka; |
345 | int ret; | 346 | int ret; |
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index 652709b353ad..2e74075ac0ca 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
@@ -349,8 +349,8 @@ asmlinkage int sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
349 | return -ERESTARTNOHAND; | 349 | return -ERESTARTNOHAND; |
350 | } | 350 | } |
351 | 351 | ||
352 | asmlinkage int sys32_sigaction(int sig, const struct sigaction32 __user *act, | 352 | SYSCALL_DEFINE3(32_sigaction, long, sig, const struct sigaction32 __user *, act, |
353 | struct sigaction32 __user *oact) | 353 | struct sigaction32 __user *, oact) |
354 | { | 354 | { |
355 | struct k_sigaction new_ka, old_ka; | 355 | struct k_sigaction new_ka, old_ka; |
356 | int ret; | 356 | int ret; |
@@ -704,9 +704,9 @@ struct mips_abi mips_abi_32 = { | |||
704 | .restart = __NR_O32_restart_syscall | 704 | .restart = __NR_O32_restart_syscall |
705 | }; | 705 | }; |
706 | 706 | ||
707 | asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, | 707 | SYSCALL_DEFINE4(32_rt_sigaction, int, sig, |
708 | struct sigaction32 __user *oact, | 708 | const struct sigaction32 __user *, act, |
709 | unsigned int sigsetsize) | 709 | struct sigaction32 __user *, oact, unsigned int, sigsetsize) |
710 | { | 710 | { |
711 | struct k_sigaction new_sa, old_sa; | 711 | struct k_sigaction new_sa, old_sa; |
712 | int ret = -EINVAL; | 712 | int ret = -EINVAL; |
@@ -748,8 +748,8 @@ out: | |||
748 | return ret; | 748 | return ret; |
749 | } | 749 | } |
750 | 750 | ||
751 | asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, | 751 | SYSCALL_DEFINE4(32_rt_sigprocmask, int, how, compat_sigset_t __user *, set, |
752 | compat_sigset_t __user *oset, unsigned int sigsetsize) | 752 | compat_sigset_t __user *, oset, unsigned int, sigsetsize) |
753 | { | 753 | { |
754 | sigset_t old_set, new_set; | 754 | sigset_t old_set, new_set; |
755 | int ret; | 755 | int ret; |
@@ -770,8 +770,8 @@ asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, | |||
770 | return ret; | 770 | return ret; |
771 | } | 771 | } |
772 | 772 | ||
773 | asmlinkage int sys32_rt_sigpending(compat_sigset_t __user *uset, | 773 | SYSCALL_DEFINE2(32_rt_sigpending, compat_sigset_t __user *, uset, |
774 | unsigned int sigsetsize) | 774 | unsigned int, sigsetsize) |
775 | { | 775 | { |
776 | int ret; | 776 | int ret; |
777 | sigset_t set; | 777 | sigset_t set; |
@@ -787,7 +787,8 @@ asmlinkage int sys32_rt_sigpending(compat_sigset_t __user *uset, | |||
787 | return ret; | 787 | return ret; |
788 | } | 788 | } |
789 | 789 | ||
790 | asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo) | 790 | SYSCALL_DEFINE3(32_rt_sigqueueinfo, int, pid, int, sig, |
791 | compat_siginfo_t __user *, uinfo) | ||
791 | { | 792 | { |
792 | siginfo_t info; | 793 | siginfo_t info; |
793 | int ret; | 794 | int ret; |
@@ -802,10 +803,9 @@ asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user * | |||
802 | return ret; | 803 | return ret; |
803 | } | 804 | } |
804 | 805 | ||
805 | asmlinkage long | 806 | SYSCALL_DEFINE5(32_waitid, int, which, compat_pid_t, pid, |
806 | sys32_waitid(int which, compat_pid_t pid, | 807 | compat_siginfo_t __user *, uinfo, int, options, |
807 | compat_siginfo_t __user *uinfo, int options, | 808 | struct compat_rusage __user *, uru) |
808 | struct compat_rusage __user *uru) | ||
809 | { | 809 | { |
810 | siginfo_t info; | 810 | siginfo_t info; |
811 | struct rusage ru; | 811 | struct rusage ru; |
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 37970d9b2186..8cf384644040 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c | |||
@@ -152,9 +152,9 @@ out: | |||
152 | return error; | 152 | return error; |
153 | } | 153 | } |
154 | 154 | ||
155 | asmlinkage unsigned long | 155 | SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len, |
156 | old_mmap(unsigned long addr, unsigned long len, int prot, | 156 | unsigned long, prot, unsigned long, flags, unsigned long, |
157 | int flags, int fd, off_t offset) | 157 | fd, off_t, offset) |
158 | { | 158 | { |
159 | unsigned long result; | 159 | unsigned long result; |
160 | 160 | ||
@@ -168,9 +168,9 @@ out: | |||
168 | return result; | 168 | return result; |
169 | } | 169 | } |
170 | 170 | ||
171 | asmlinkage unsigned long | 171 | SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len, |
172 | sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | 172 | unsigned long, prot, unsigned long, flags, unsigned long, fd, |
173 | unsigned long flags, unsigned long fd, unsigned long pgoff) | 173 | unsigned long, pgoff) |
174 | { | 174 | { |
175 | if (pgoff & (~PAGE_MASK >> 12)) | 175 | if (pgoff & (~PAGE_MASK >> 12)) |
176 | return -EINVAL; | 176 | return -EINVAL; |
@@ -240,7 +240,7 @@ out: | |||
240 | /* | 240 | /* |
241 | * Compacrapability ... | 241 | * Compacrapability ... |
242 | */ | 242 | */ |
243 | asmlinkage int sys_uname(struct old_utsname __user * name) | 243 | SYSCALL_DEFINE1(uname, struct old_utsname __user *, name) |
244 | { | 244 | { |
245 | if (name && !copy_to_user(name, utsname(), sizeof (*name))) | 245 | if (name && !copy_to_user(name, utsname(), sizeof (*name))) |
246 | return 0; | 246 | return 0; |
@@ -250,7 +250,7 @@ asmlinkage int sys_uname(struct old_utsname __user * name) | |||
250 | /* | 250 | /* |
251 | * Compacrapability ... | 251 | * Compacrapability ... |
252 | */ | 252 | */ |
253 | asmlinkage int sys_olduname(struct oldold_utsname __user * name) | 253 | SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name) |
254 | { | 254 | { |
255 | int error; | 255 | int error; |
256 | 256 | ||
@@ -279,7 +279,7 @@ asmlinkage int sys_olduname(struct oldold_utsname __user * name) | |||
279 | return error; | 279 | return error; |
280 | } | 280 | } |
281 | 281 | ||
282 | asmlinkage int sys_set_thread_area(unsigned long addr) | 282 | SYSCALL_DEFINE1(set_thread_area, unsigned long, addr) |
283 | { | 283 | { |
284 | struct thread_info *ti = task_thread_info(current); | 284 | struct thread_info *ti = task_thread_info(current); |
285 | 285 | ||
@@ -290,7 +290,7 @@ asmlinkage int sys_set_thread_area(unsigned long addr) | |||
290 | return 0; | 290 | return 0; |
291 | } | 291 | } |
292 | 292 | ||
293 | asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) | 293 | asmlinkage int _sys_sysmips(long cmd, long arg1, long arg2, long arg3) |
294 | { | 294 | { |
295 | switch (cmd) { | 295 | switch (cmd) { |
296 | case MIPS_ATOMIC_SET: | 296 | case MIPS_ATOMIC_SET: |
@@ -325,8 +325,8 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) | |||
325 | * | 325 | * |
326 | * This is really horribly ugly. | 326 | * This is really horribly ugly. |
327 | */ | 327 | */ |
328 | asmlinkage int sys_ipc(unsigned int call, int first, int second, | 328 | SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, int, second, |
329 | unsigned long third, void __user *ptr, long fifth) | 329 | unsigned long, third, void __user *, ptr, long, fifth) |
330 | { | 330 | { |
331 | int version, ret; | 331 | int version, ret; |
332 | 332 | ||
@@ -411,7 +411,7 @@ asmlinkage int sys_ipc(unsigned int call, int first, int second, | |||
411 | /* | 411 | /* |
412 | * No implemented yet ... | 412 | * No implemented yet ... |
413 | */ | 413 | */ |
414 | asmlinkage int sys_cachectl(char *addr, int nbytes, int op) | 414 | SYSCALL_DEFINE3(cachectl, char *, addr, int, nbytes, int, op) |
415 | { | 415 | { |
416 | return -ENOSYS; | 416 | return -ENOSYS; |
417 | } | 417 | } |
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 98ad0a82c29e..694d51f523d1 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/syscalls.h> | ||
16 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
17 | 18 | ||
18 | #include <asm/cacheflush.h> | 19 | #include <asm/cacheflush.h> |
@@ -58,8 +59,8 @@ EXPORT_SYMBOL(_dma_cache_wback_inv); | |||
58 | * We could optimize the case where the cache argument is not BCACHE but | 59 | * We could optimize the case where the cache argument is not BCACHE but |
59 | * that seems very atypical use ... | 60 | * that seems very atypical use ... |
60 | */ | 61 | */ |
61 | asmlinkage int sys_cacheflush(unsigned long addr, | 62 | SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, bytes, |
62 | unsigned long bytes, unsigned int cache) | 63 | unsigned int, cache) |
63 | { | 64 | { |
64 | if (bytes == 0) | 65 | if (bytes == 0) |
65 | return 0; | 66 | return 0; |
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index 9a9f43358879..41d16822e616 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig | |||
@@ -7,6 +7,7 @@ mainmenu "Linux Kernel Configuration" | |||
7 | 7 | ||
8 | config MN10300 | 8 | config MN10300 |
9 | def_bool y | 9 | def_bool y |
10 | select HAVE_OPROFILE | ||
10 | 11 | ||
11 | config AM33 | 12 | config AM33 |
12 | def_bool y | 13 | def_bool y |
diff --git a/arch/mn10300/unit-asb2305/pci.c b/arch/mn10300/unit-asb2305/pci.c index 1a86425fec42..07dbbcda3b2e 100644 --- a/arch/mn10300/unit-asb2305/pci.c +++ b/arch/mn10300/unit-asb2305/pci.c | |||
@@ -173,7 +173,7 @@ static int pci_ampci_write_config_byte(struct pci_bus *bus, unsigned int devfn, | |||
173 | BRIDGEREGB(where) = value; | 173 | BRIDGEREGB(where) = value; |
174 | } else { | 174 | } else { |
175 | if (bus->number == 0 && | 175 | if (bus->number == 0 && |
176 | (devfn == PCI_DEVFN(2, 0) && devfn == PCI_DEVFN(3, 0)) | 176 | (devfn == PCI_DEVFN(2, 0) || devfn == PCI_DEVFN(3, 0)) |
177 | ) | 177 | ) |
178 | __pcidebug("<= %02x", bus, devfn, where, value); | 178 | __pcidebug("<= %02x", bus, devfn, where, value); |
179 | CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); | 179 | CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); |
diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts index 909a89cab9ac..3ebf7ec0484c 100644 --- a/arch/powerpc/boot/dts/mpc8313erdb.dts +++ b/arch/powerpc/boot/dts/mpc8313erdb.dts | |||
@@ -191,7 +191,8 @@ | |||
191 | interrupts = <37 0x8 36 0x8 35 0x8>; | 191 | interrupts = <37 0x8 36 0x8 35 0x8>; |
192 | interrupt-parent = <&ipic>; | 192 | interrupt-parent = <&ipic>; |
193 | tbi-handle = < &tbi0 >; | 193 | tbi-handle = < &tbi0 >; |
194 | phy-handle = < &phy1 >; | 194 | /* Vitesse 7385 isn't on the MDIO bus */ |
195 | fixed-link = <1 1 1000 0 0>; | ||
195 | fsl,magic-packet; | 196 | fsl,magic-packet; |
196 | 197 | ||
197 | mdio@24520 { | 198 | mdio@24520 { |
@@ -199,12 +200,6 @@ | |||
199 | #size-cells = <0>; | 200 | #size-cells = <0>; |
200 | compatible = "fsl,gianfar-mdio"; | 201 | compatible = "fsl,gianfar-mdio"; |
201 | reg = <0x24520 0x20>; | 202 | reg = <0x24520 0x20>; |
202 | phy1: ethernet-phy@1 { | ||
203 | interrupt-parent = <&ipic>; | ||
204 | interrupts = <19 0x8>; | ||
205 | reg = <0x1>; | ||
206 | device_type = "ethernet-phy"; | ||
207 | }; | ||
208 | phy4: ethernet-phy@4 { | 203 | phy4: ethernet-phy@4 { |
209 | interrupt-parent = <&ipic>; | 204 | interrupt-parent = <&ipic>; |
210 | interrupts = <20 0x8>; | 205 | interrupts = <20 0x8>; |
@@ -219,6 +214,8 @@ | |||
219 | }; | 214 | }; |
220 | 215 | ||
221 | enet1: ethernet@25000 { | 216 | enet1: ethernet@25000 { |
217 | #address-cells = <1>; | ||
218 | #size-cells = <1>; | ||
222 | cell-index = <1>; | 219 | cell-index = <1>; |
223 | device_type = "network"; | 220 | device_type = "network"; |
224 | model = "eTSEC"; | 221 | model = "eTSEC"; |
diff --git a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig index 9e47ae957e2e..409d017621a8 100644 --- a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig +++ b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig | |||
@@ -651,7 +651,7 @@ CONFIG_CICADA_PHY=y | |||
651 | # CONFIG_NATIONAL_PHY is not set | 651 | # CONFIG_NATIONAL_PHY is not set |
652 | # CONFIG_STE10XP is not set | 652 | # CONFIG_STE10XP is not set |
653 | # CONFIG_LSI_ET1011C_PHY is not set | 653 | # CONFIG_LSI_ET1011C_PHY is not set |
654 | # CONFIG_FIXED_PHY is not set | 654 | CONFIG_FIXED_PHY=y |
655 | # CONFIG_MDIO_BITBANG is not set | 655 | # CONFIG_MDIO_BITBANG is not set |
656 | CONFIG_NET_ETHERNET=y | 656 | CONFIG_NET_ETHERNET=y |
657 | CONFIG_MII=y | 657 | CONFIG_MII=y |
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index d811a8cd7b58..4774c2f92232 100644 --- a/arch/powerpc/include/asm/compat.h +++ b/arch/powerpc/include/asm/compat.h | |||
@@ -210,5 +210,10 @@ struct compat_shmid64_ds { | |||
210 | compat_ulong_t __unused6; | 210 | compat_ulong_t __unused6; |
211 | }; | 211 | }; |
212 | 212 | ||
213 | static inline int is_compat_task(void) | ||
214 | { | ||
215 | return test_thread_flag(TIF_32BIT); | ||
216 | } | ||
217 | |||
213 | #endif /* __KERNEL__ */ | 218 | #endif /* __KERNEL__ */ |
214 | #endif /* _ASM_POWERPC_COMPAT_H */ | 219 | #endif /* _ASM_POWERPC_COMPAT_H */ |
diff --git a/arch/powerpc/include/asm/pgtable-4k.h b/arch/powerpc/include/asm/pgtable-4k.h index 6b18ba9d2d85..1dbca4e7de67 100644 --- a/arch/powerpc/include/asm/pgtable-4k.h +++ b/arch/powerpc/include/asm/pgtable-4k.h | |||
@@ -60,7 +60,7 @@ | |||
60 | /* It should be preserving the high 48 bits and then specifically */ | 60 | /* It should be preserving the high 48 bits and then specifically */ |
61 | /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */ | 61 | /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */ |
62 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ | 62 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ |
63 | _PAGE_HPTEFLAGS) | 63 | _PAGE_HPTEFLAGS | _PAGE_SPECIAL) |
64 | 64 | ||
65 | /* Bits to mask out from a PMD to get to the PTE page */ | 65 | /* Bits to mask out from a PMD to get to the PTE page */ |
66 | #define PMD_MASKED_BITS 0 | 66 | #define PMD_MASKED_BITS 0 |
diff --git a/arch/powerpc/include/asm/pgtable-64k.h b/arch/powerpc/include/asm/pgtable-64k.h index 07b0d8f09cb6..7389003349a6 100644 --- a/arch/powerpc/include/asm/pgtable-64k.h +++ b/arch/powerpc/include/asm/pgtable-64k.h | |||
@@ -114,7 +114,7 @@ static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd) | |||
114 | * pgprot changes | 114 | * pgprot changes |
115 | */ | 115 | */ |
116 | #define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \ | 116 | #define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \ |
117 | _PAGE_ACCESSED) | 117 | _PAGE_ACCESSED | _PAGE_SPECIAL) |
118 | 118 | ||
119 | /* Bits to mask out from a PMD to get to the PTE page */ | 119 | /* Bits to mask out from a PMD to get to the PTE page */ |
120 | #define PMD_MASKED_BITS 0x1ff | 120 | #define PMD_MASKED_BITS 0x1ff |
diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h index f69a4d977729..820b5f0a35ce 100644 --- a/arch/powerpc/include/asm/pgtable-ppc32.h +++ b/arch/powerpc/include/asm/pgtable-ppc32.h | |||
@@ -429,7 +429,8 @@ extern int icache_44x_need_flush; | |||
429 | #define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE() | 429 | #define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE() |
430 | #endif | 430 | #endif |
431 | 431 | ||
432 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) | 432 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ |
433 | _PAGE_SPECIAL) | ||
433 | 434 | ||
434 | 435 | ||
435 | #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \ | 436 | #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \ |
diff --git a/arch/powerpc/include/asm/seccomp.h b/arch/powerpc/include/asm/seccomp.h index 853765eb1f65..00c1d9133cfe 100644 --- a/arch/powerpc/include/asm/seccomp.h +++ b/arch/powerpc/include/asm/seccomp.h | |||
@@ -1,10 +1,6 @@ | |||
1 | #ifndef _ASM_POWERPC_SECCOMP_H | 1 | #ifndef _ASM_POWERPC_SECCOMP_H |
2 | #define _ASM_POWERPC_SECCOMP_H | 2 | #define _ASM_POWERPC_SECCOMP_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | #include <linux/thread_info.h> | ||
6 | #endif | ||
7 | |||
8 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
9 | 5 | ||
10 | #define __NR_seccomp_read __NR_read | 6 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c index 5af4e9b2dbe2..73cb6a3229ae 100644 --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc/kernel/align.c | |||
@@ -367,27 +367,24 @@ static int emulate_multiple(struct pt_regs *regs, unsigned char __user *addr, | |||
367 | static int emulate_fp_pair(unsigned char __user *addr, unsigned int reg, | 367 | static int emulate_fp_pair(unsigned char __user *addr, unsigned int reg, |
368 | unsigned int flags) | 368 | unsigned int flags) |
369 | { | 369 | { |
370 | char *ptr = (char *) ¤t->thread.TS_FPR(reg); | 370 | char *ptr0 = (char *) ¤t->thread.TS_FPR(reg); |
371 | int i, ret; | 371 | char *ptr1 = (char *) ¤t->thread.TS_FPR(reg+1); |
372 | int i, ret, sw = 0; | ||
372 | 373 | ||
373 | if (!(flags & F)) | 374 | if (!(flags & F)) |
374 | return 0; | 375 | return 0; |
375 | if (reg & 1) | 376 | if (reg & 1) |
376 | return 0; /* invalid form: FRS/FRT must be even */ | 377 | return 0; /* invalid form: FRS/FRT must be even */ |
377 | if (!(flags & SW)) { | 378 | if (flags & SW) |
378 | /* not byte-swapped - easy */ | 379 | sw = 7; |
379 | if (!(flags & ST)) | 380 | ret = 0; |
380 | ret = __copy_from_user(ptr, addr, 16); | 381 | for (i = 0; i < 8; ++i) { |
381 | else | 382 | if (!(flags & ST)) { |
382 | ret = __copy_to_user(addr, ptr, 16); | 383 | ret |= __get_user(ptr0[i^sw], addr + i); |
383 | } else { | 384 | ret |= __get_user(ptr1[i^sw], addr + i + 8); |
384 | /* each FPR value is byte-swapped separately */ | 385 | } else { |
385 | ret = 0; | 386 | ret |= __put_user(ptr0[i^sw], addr + i); |
386 | for (i = 0; i < 16; ++i) { | 387 | ret |= __put_user(ptr1[i^sw], addr + i + 8); |
387 | if (!(flags & ST)) | ||
388 | ret |= __get_user(ptr[i^7], addr + i); | ||
389 | else | ||
390 | ret |= __put_user(ptr[i^7], addr + i); | ||
391 | } | 388 | } |
392 | } | 389 | } |
393 | if (ret) | 390 | if (ret) |
@@ -646,11 +643,16 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg, | |||
646 | unsigned int areg, struct pt_regs *regs, | 643 | unsigned int areg, struct pt_regs *regs, |
647 | unsigned int flags, unsigned int length) | 644 | unsigned int flags, unsigned int length) |
648 | { | 645 | { |
649 | char *ptr = (char *) ¤t->thread.TS_FPR(reg); | 646 | char *ptr; |
650 | int ret = 0; | 647 | int ret = 0; |
651 | 648 | ||
652 | flush_vsx_to_thread(current); | 649 | flush_vsx_to_thread(current); |
653 | 650 | ||
651 | if (reg < 32) | ||
652 | ptr = (char *) ¤t->thread.TS_FPR(reg); | ||
653 | else | ||
654 | ptr = (char *) ¤t->thread.vr[reg - 32]; | ||
655 | |||
654 | if (flags & ST) | 656 | if (flags & ST) |
655 | ret = __copy_to_user(addr, ptr, length); | 657 | ret = __copy_to_user(addr, ptr, length); |
656 | else { | 658 | else { |
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 5355244c99ff..60c60ccf5e3c 100644 --- a/arch/powerpc/kernel/ftrace.c +++ b/arch/powerpc/kernel/ftrace.c | |||
@@ -195,8 +195,9 @@ __ftrace_make_nop(struct module *mod, | |||
195 | return -EINVAL; | 195 | return -EINVAL; |
196 | } | 196 | } |
197 | 197 | ||
198 | offset = (unsigned)((unsigned short)jmp[0]) << 16 | | 198 | /* The bottom half is signed extended */ |
199 | (unsigned)((unsigned short)jmp[1]); | 199 | offset = ((unsigned)((unsigned short)jmp[0]) << 16) + |
200 | (int)((short)jmp[1]); | ||
200 | 201 | ||
201 | DEBUGP(" %x ", offset); | 202 | DEBUGP(" %x ", offset); |
202 | 203 | ||
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 19b12d2cbb4b..0f4181272311 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -561,8 +561,21 @@ int pci_mmap_legacy_page_range(struct pci_bus *bus, | |||
561 | (unsigned long long)(offset + size - 1)); | 561 | (unsigned long long)(offset + size - 1)); |
562 | 562 | ||
563 | if (mmap_state == pci_mmap_mem) { | 563 | if (mmap_state == pci_mmap_mem) { |
564 | if ((offset + size) > hose->isa_mem_size) | 564 | /* Hack alert ! |
565 | return -ENXIO; | 565 | * |
566 | * Because X is lame and can fail starting if it gets an error trying | ||
567 | * to mmap legacy_mem (instead of just moving on without legacy memory | ||
568 | * access) we fake it here by giving it anonymous memory, effectively | ||
569 | * behaving just like /dev/zero | ||
570 | */ | ||
571 | if ((offset + size) > hose->isa_mem_size) { | ||
572 | printk(KERN_DEBUG | ||
573 | "Process %s (pid:%d) mapped non-existing PCI legacy memory for 0%04x:%02x\n", | ||
574 | current->comm, current->pid, pci_domain_nr(bus), bus->number); | ||
575 | if (vma->vm_flags & VM_SHARED) | ||
576 | return shmem_zero_setup(vma); | ||
577 | return 0; | ||
578 | } | ||
566 | offset += hose->isa_mem_phys; | 579 | offset += hose->isa_mem_phys; |
567 | } else { | 580 | } else { |
568 | unsigned long io_offset = (unsigned long)hose->io_base_virt - _IO_BASE; | 581 | unsigned long io_offset = (unsigned long)hose->io_base_virt - _IO_BASE; |
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 2822c8ccfaaf..5f81256287f5 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -125,6 +125,10 @@ static void kvmppc_free_vcpus(struct kvm *kvm) | |||
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | void kvm_arch_sync_events(struct kvm *kvm) | ||
129 | { | ||
130 | } | ||
131 | |||
128 | void kvm_arch_destroy_vm(struct kvm *kvm) | 132 | void kvm_arch_destroy_vm(struct kvm *kvm) |
129 | { | 133 | { |
130 | kvmppc_free_vcpus(kvm); | 134 | kvmppc_free_vcpus(kvm); |
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S index 70693a5c12a1..693b14a778fa 100644 --- a/arch/powerpc/lib/copyuser_64.S +++ b/arch/powerpc/lib/copyuser_64.S | |||
@@ -62,18 +62,19 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
62 | 72: std r8,8(r3) | 62 | 72: std r8,8(r3) |
63 | beq+ 3f | 63 | beq+ 3f |
64 | addi r3,r3,16 | 64 | addi r3,r3,16 |
65 | 23: ld r9,8(r4) | ||
66 | .Ldo_tail: | 65 | .Ldo_tail: |
67 | bf cr7*4+1,1f | 66 | bf cr7*4+1,1f |
68 | rotldi r9,r9,32 | 67 | 23: lwz r9,8(r4) |
68 | addi r4,r4,4 | ||
69 | 73: stw r9,0(r3) | 69 | 73: stw r9,0(r3) |
70 | addi r3,r3,4 | 70 | addi r3,r3,4 |
71 | 1: bf cr7*4+2,2f | 71 | 1: bf cr7*4+2,2f |
72 | rotldi r9,r9,16 | 72 | 44: lhz r9,8(r4) |
73 | addi r4,r4,2 | ||
73 | 74: sth r9,0(r3) | 74 | 74: sth r9,0(r3) |
74 | addi r3,r3,2 | 75 | addi r3,r3,2 |
75 | 2: bf cr7*4+3,3f | 76 | 2: bf cr7*4+3,3f |
76 | rotldi r9,r9,8 | 77 | 45: lbz r9,8(r4) |
77 | 75: stb r9,0(r3) | 78 | 75: stb r9,0(r3) |
78 | 3: li r3,0 | 79 | 3: li r3,0 |
79 | blr | 80 | blr |
@@ -141,11 +142,24 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
141 | 6: cmpwi cr1,r5,8 | 142 | 6: cmpwi cr1,r5,8 |
142 | addi r3,r3,32 | 143 | addi r3,r3,32 |
143 | sld r9,r9,r10 | 144 | sld r9,r9,r10 |
144 | ble cr1,.Ldo_tail | 145 | ble cr1,7f |
145 | 34: ld r0,8(r4) | 146 | 34: ld r0,8(r4) |
146 | srd r7,r0,r11 | 147 | srd r7,r0,r11 |
147 | or r9,r7,r9 | 148 | or r9,r7,r9 |
148 | b .Ldo_tail | 149 | 7: |
150 | bf cr7*4+1,1f | ||
151 | rotldi r9,r9,32 | ||
152 | 94: stw r9,0(r3) | ||
153 | addi r3,r3,4 | ||
154 | 1: bf cr7*4+2,2f | ||
155 | rotldi r9,r9,16 | ||
156 | 95: sth r9,0(r3) | ||
157 | addi r3,r3,2 | ||
158 | 2: bf cr7*4+3,3f | ||
159 | rotldi r9,r9,8 | ||
160 | 96: stb r9,0(r3) | ||
161 | 3: li r3,0 | ||
162 | blr | ||
149 | 163 | ||
150 | .Ldst_unaligned: | 164 | .Ldst_unaligned: |
151 | PPC_MTOCRF 0x01,r6 /* put #bytes to 8B bdry into cr7 */ | 165 | PPC_MTOCRF 0x01,r6 /* put #bytes to 8B bdry into cr7 */ |
@@ -218,7 +232,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
218 | 121: | 232 | 121: |
219 | 132: | 233 | 132: |
220 | addi r3,r3,8 | 234 | addi r3,r3,8 |
221 | 123: | ||
222 | 134: | 235 | 134: |
223 | 135: | 236 | 135: |
224 | 138: | 237 | 138: |
@@ -226,6 +239,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
226 | 140: | 239 | 140: |
227 | 141: | 240 | 141: |
228 | 142: | 241 | 142: |
242 | 123: | ||
243 | 144: | ||
244 | 145: | ||
229 | 245 | ||
230 | /* | 246 | /* |
231 | * here we have had a fault on a load and r3 points to the first | 247 | * here we have had a fault on a load and r3 points to the first |
@@ -309,6 +325,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
309 | 187: | 325 | 187: |
310 | 188: | 326 | 188: |
311 | 189: | 327 | 189: |
328 | 194: | ||
329 | 195: | ||
330 | 196: | ||
312 | 1: | 331 | 1: |
313 | ld r6,-24(r1) | 332 | ld r6,-24(r1) |
314 | ld r5,-8(r1) | 333 | ld r5,-8(r1) |
@@ -329,7 +348,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
329 | .llong 72b,172b | 348 | .llong 72b,172b |
330 | .llong 23b,123b | 349 | .llong 23b,123b |
331 | .llong 73b,173b | 350 | .llong 73b,173b |
351 | .llong 44b,144b | ||
332 | .llong 74b,174b | 352 | .llong 74b,174b |
353 | .llong 45b,145b | ||
333 | .llong 75b,175b | 354 | .llong 75b,175b |
334 | .llong 24b,124b | 355 | .llong 24b,124b |
335 | .llong 25b,125b | 356 | .llong 25b,125b |
@@ -347,6 +368,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
347 | .llong 79b,179b | 368 | .llong 79b,179b |
348 | .llong 80b,180b | 369 | .llong 80b,180b |
349 | .llong 34b,134b | 370 | .llong 34b,134b |
371 | .llong 94b,194b | ||
372 | .llong 95b,195b | ||
373 | .llong 96b,196b | ||
350 | .llong 35b,135b | 374 | .llong 35b,135b |
351 | .llong 81b,181b | 375 | .llong 81b,181b |
352 | .llong 36b,136b | 376 | .llong 36b,136b |
diff --git a/arch/powerpc/lib/memcpy_64.S b/arch/powerpc/lib/memcpy_64.S index fe2d34e5332d..e178922b2c21 100644 --- a/arch/powerpc/lib/memcpy_64.S +++ b/arch/powerpc/lib/memcpy_64.S | |||
@@ -53,18 +53,19 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
53 | 3: std r8,8(r3) | 53 | 3: std r8,8(r3) |
54 | beq 3f | 54 | beq 3f |
55 | addi r3,r3,16 | 55 | addi r3,r3,16 |
56 | ld r9,8(r4) | ||
57 | .Ldo_tail: | 56 | .Ldo_tail: |
58 | bf cr7*4+1,1f | 57 | bf cr7*4+1,1f |
59 | rotldi r9,r9,32 | 58 | lwz r9,8(r4) |
59 | addi r4,r4,4 | ||
60 | stw r9,0(r3) | 60 | stw r9,0(r3) |
61 | addi r3,r3,4 | 61 | addi r3,r3,4 |
62 | 1: bf cr7*4+2,2f | 62 | 1: bf cr7*4+2,2f |
63 | rotldi r9,r9,16 | 63 | lhz r9,8(r4) |
64 | addi r4,r4,2 | ||
64 | sth r9,0(r3) | 65 | sth r9,0(r3) |
65 | addi r3,r3,2 | 66 | addi r3,r3,2 |
66 | 2: bf cr7*4+3,3f | 67 | 2: bf cr7*4+3,3f |
67 | rotldi r9,r9,8 | 68 | lbz r9,8(r4) |
68 | stb r9,0(r3) | 69 | stb r9,0(r3) |
69 | 3: ld r3,48(r1) /* return dest pointer */ | 70 | 3: ld r3,48(r1) /* return dest pointer */ |
70 | blr | 71 | blr |
@@ -133,11 +134,24 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
133 | cmpwi cr1,r5,8 | 134 | cmpwi cr1,r5,8 |
134 | addi r3,r3,32 | 135 | addi r3,r3,32 |
135 | sld r9,r9,r10 | 136 | sld r9,r9,r10 |
136 | ble cr1,.Ldo_tail | 137 | ble cr1,6f |
137 | ld r0,8(r4) | 138 | ld r0,8(r4) |
138 | srd r7,r0,r11 | 139 | srd r7,r0,r11 |
139 | or r9,r7,r9 | 140 | or r9,r7,r9 |
140 | b .Ldo_tail | 141 | 6: |
142 | bf cr7*4+1,1f | ||
143 | rotldi r9,r9,32 | ||
144 | stw r9,0(r3) | ||
145 | addi r3,r3,4 | ||
146 | 1: bf cr7*4+2,2f | ||
147 | rotldi r9,r9,16 | ||
148 | sth r9,0(r3) | ||
149 | addi r3,r3,2 | ||
150 | 2: bf cr7*4+3,3f | ||
151 | rotldi r9,r9,8 | ||
152 | stb r9,0(r3) | ||
153 | 3: ld r3,48(r1) /* return dest pointer */ | ||
154 | blr | ||
141 | 155 | ||
142 | .Ldst_unaligned: | 156 | .Ldst_unaligned: |
143 | PPC_MTOCRF 0x01,r6 # put #bytes to 8B bdry into cr7 | 157 | PPC_MTOCRF 0x01,r6 # put #bytes to 8B bdry into cr7 |
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index 4aae0c387645..13b7d54f185b 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c | |||
@@ -172,6 +172,8 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) | |||
172 | } | 172 | } |
173 | break; | 173 | break; |
174 | case 0x378: /* orx */ | 174 | case 0x378: /* orx */ |
175 | if (instr & 1) | ||
176 | break; | ||
175 | rs = (instr >> 21) & 0x1f; | 177 | rs = (instr >> 21) & 0x1f; |
176 | rb = (instr >> 11) & 0x1f; | 178 | rb = (instr >> 11) & 0x1f; |
177 | if (rs == rb) { /* mr */ | 179 | if (rs == rb) { /* mr */ |
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c index 1971e4ee3d6e..ea6e41e39d9f 100644 --- a/arch/powerpc/mm/fsl_booke_mmu.c +++ b/arch/powerpc/mm/fsl_booke_mmu.c | |||
@@ -73,7 +73,7 @@ extern unsigned int tlbcam_index; | |||
73 | /* | 73 | /* |
74 | * Return PA for this VA if it is mapped by a CAM, or 0 | 74 | * Return PA for this VA if it is mapped by a CAM, or 0 |
75 | */ | 75 | */ |
76 | unsigned long v_mapped_by_tlbcam(unsigned long va) | 76 | phys_addr_t v_mapped_by_tlbcam(unsigned long va) |
77 | { | 77 | { |
78 | int b; | 78 | int b; |
79 | for (b = 0; b < tlbcam_index; ++b) | 79 | for (b = 0; b < tlbcam_index; ++b) |
@@ -85,7 +85,7 @@ unsigned long v_mapped_by_tlbcam(unsigned long va) | |||
85 | /* | 85 | /* |
86 | * Return VA for a given PA or 0 if not mapped | 86 | * Return VA for a given PA or 0 if not mapped |
87 | */ | 87 | */ |
88 | unsigned long p_mapped_by_tlbcam(unsigned long pa) | 88 | unsigned long p_mapped_by_tlbcam(phys_addr_t pa) |
89 | { | 89 | { |
90 | int b; | 90 | int b; |
91 | for (b = 0; b < tlbcam_index; ++b) | 91 | for (b = 0; b < tlbcam_index; ++b) |
diff --git a/arch/powerpc/mm/hash_low_32.S b/arch/powerpc/mm/hash_low_32.S index 67850ec9feb3..14af8cedab70 100644 --- a/arch/powerpc/mm/hash_low_32.S +++ b/arch/powerpc/mm/hash_low_32.S | |||
@@ -320,7 +320,7 @@ _GLOBAL(create_hpte) | |||
320 | and r8,r8,r0 /* writable if _RW & _DIRTY */ | 320 | and r8,r8,r0 /* writable if _RW & _DIRTY */ |
321 | rlwimi r5,r5,32-1,30,30 /* _PAGE_USER -> PP msb */ | 321 | rlwimi r5,r5,32-1,30,30 /* _PAGE_USER -> PP msb */ |
322 | rlwimi r5,r5,32-2,31,31 /* _PAGE_USER -> PP lsb */ | 322 | rlwimi r5,r5,32-2,31,31 /* _PAGE_USER -> PP lsb */ |
323 | ori r8,r8,0xe14 /* clear out reserved bits and M */ | 323 | ori r8,r8,0xe04 /* clear out reserved bits */ |
324 | andc r8,r5,r8 /* PP = user? (rw&dirty? 2: 3): 0 */ | 324 | andc r8,r5,r8 /* PP = user? (rw&dirty? 2: 3): 0 */ |
325 | BEGIN_FTR_SECTION | 325 | BEGIN_FTR_SECTION |
326 | rlwinm r8,r8,0,~_PAGE_COHERENT /* clear M (coherence not required) */ | 326 | rlwinm r8,r8,0,~_PAGE_COHERENT /* clear M (coherence not required) */ |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 7393bd76d698..5ac08b8ab654 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/notifier.h> | 19 | #include <linux/notifier.h> |
20 | #include <linux/lmb.h> | 20 | #include <linux/lmb.h> |
21 | #include <linux/of.h> | 21 | #include <linux/of.h> |
22 | #include <linux/pfn.h> | ||
22 | #include <asm/sparsemem.h> | 23 | #include <asm/sparsemem.h> |
23 | #include <asm/prom.h> | 24 | #include <asm/prom.h> |
24 | #include <asm/system.h> | 25 | #include <asm/system.h> |
@@ -882,7 +883,7 @@ static void mark_reserved_regions_for_nid(int nid) | |||
882 | unsigned long physbase = lmb.reserved.region[i].base; | 883 | unsigned long physbase = lmb.reserved.region[i].base; |
883 | unsigned long size = lmb.reserved.region[i].size; | 884 | unsigned long size = lmb.reserved.region[i].size; |
884 | unsigned long start_pfn = physbase >> PAGE_SHIFT; | 885 | unsigned long start_pfn = physbase >> PAGE_SHIFT; |
885 | unsigned long end_pfn = ((physbase + size) >> PAGE_SHIFT); | 886 | unsigned long end_pfn = PFN_UP(physbase + size); |
886 | struct node_active_region node_ar; | 887 | struct node_active_region node_ar; |
887 | unsigned long node_end_pfn = node->node_start_pfn + | 888 | unsigned long node_end_pfn = node->node_start_pfn + |
888 | node->node_spanned_pages; | 889 | node->node_spanned_pages; |
@@ -908,7 +909,7 @@ static void mark_reserved_regions_for_nid(int nid) | |||
908 | */ | 909 | */ |
909 | if (end_pfn > node_ar.end_pfn) | 910 | if (end_pfn > node_ar.end_pfn) |
910 | reserve_size = (node_ar.end_pfn << PAGE_SHIFT) | 911 | reserve_size = (node_ar.end_pfn << PAGE_SHIFT) |
911 | - (start_pfn << PAGE_SHIFT); | 912 | - physbase; |
912 | /* | 913 | /* |
913 | * Only worry about *this* node, others may not | 914 | * Only worry about *this* node, others may not |
914 | * yet have valid NODE_DATA(). | 915 | * yet have valid NODE_DATA(). |
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index 22972cd83cc9..58bcaeba728d 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtable_32.c | |||
@@ -61,8 +61,8 @@ void setbat(int index, unsigned long virt, phys_addr_t phys, | |||
61 | 61 | ||
62 | #ifdef HAVE_TLBCAM | 62 | #ifdef HAVE_TLBCAM |
63 | extern unsigned int tlbcam_index; | 63 | extern unsigned int tlbcam_index; |
64 | extern unsigned long v_mapped_by_tlbcam(unsigned long va); | 64 | extern phys_addr_t v_mapped_by_tlbcam(unsigned long va); |
65 | extern unsigned long p_mapped_by_tlbcam(unsigned long pa); | 65 | extern unsigned long p_mapped_by_tlbcam(phys_addr_t pa); |
66 | #else /* !HAVE_TLBCAM */ | 66 | #else /* !HAVE_TLBCAM */ |
67 | #define v_mapped_by_tlbcam(x) (0UL) | 67 | #define v_mapped_by_tlbcam(x) (0UL) |
68 | #define p_mapped_by_tlbcam(x) (0UL) | 68 | #define p_mapped_by_tlbcam(x) (0UL) |
diff --git a/arch/powerpc/oprofile/cell/spu_profiler.c b/arch/powerpc/oprofile/cell/spu_profiler.c index 9305ddaac512..b129d007e7fe 100644 --- a/arch/powerpc/oprofile/cell/spu_profiler.c +++ b/arch/powerpc/oprofile/cell/spu_profiler.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <asm/cell-pmu.h> | 18 | #include <asm/cell-pmu.h> |
19 | #include <asm/time.h> | ||
19 | #include "pr_util.h" | 20 | #include "pr_util.h" |
20 | 21 | ||
21 | #define SCALE_SHIFT 14 | 22 | #define SCALE_SHIFT 14 |
diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c index 9876d7e072f4..ddf0bdc0fc8b 100644 --- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c +++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | |||
@@ -186,7 +186,7 @@ out_unmap_regs: | |||
186 | iounmap(priv->regs); | 186 | iounmap(priv->regs); |
187 | out_free_bootmem: | 187 | out_free_bootmem: |
188 | free_bootmem((unsigned long)priv, | 188 | free_bootmem((unsigned long)priv, |
189 | sizeof(sizeof(struct pq2ads_pci_pic))); | 189 | sizeof(struct pq2ads_pci_pic)); |
190 | of_node_put(np); | 190 | of_node_put(np); |
191 | out_unmap_irq: | 191 | out_unmap_irq: |
192 | irq_dispose_mapping(irq); | 192 | irq_dispose_mapping(irq); |
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c index fb371f5ce132..d6b772ba3b8f 100644 --- a/arch/powerpc/platforms/86xx/gef_sbc610.c +++ b/arch/powerpc/platforms/86xx/gef_sbc610.c | |||
@@ -142,6 +142,10 @@ static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev) | |||
142 | { | 142 | { |
143 | unsigned int val; | 143 | unsigned int val; |
144 | 144 | ||
145 | /* Do not do the fixup on other platforms! */ | ||
146 | if (!machine_is(gef_sbc610)) | ||
147 | return; | ||
148 | |||
145 | printk(KERN_INFO "Running NEC uPD720101 Fixup\n"); | 149 | printk(KERN_INFO "Running NEC uPD720101 Fixup\n"); |
146 | 150 | ||
147 | /* Ensure ports 1, 2, 3, 4 & 5 are enabled */ | 151 | /* Ensure ports 1, 2, 3, 4 & 5 are enabled */ |
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c index 67de6bf3db3d..d281cc0bca71 100644 --- a/arch/powerpc/platforms/ps3/mm.c +++ b/arch/powerpc/platforms/ps3/mm.c | |||
@@ -328,7 +328,7 @@ static int __init ps3_mm_add_memory(void) | |||
328 | return result; | 328 | return result; |
329 | } | 329 | } |
330 | 330 | ||
331 | core_initcall(ps3_mm_add_memory); | 331 | device_initcall(ps3_mm_add_memory); |
332 | 332 | ||
333 | /*============================================================================*/ | 333 | /*============================================================================*/ |
334 | /* dma routines */ | 334 | /* dma routines */ |
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index a623ad256e9e..9b21ee68ea50 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/firmware.h> | 14 | #include <asm/firmware.h> |
15 | #include <asm/machdep.h> | 15 | #include <asm/machdep.h> |
16 | #include <asm/pSeries_reconfig.h> | 16 | #include <asm/pSeries_reconfig.h> |
17 | #include <asm/sparsemem.h> | ||
17 | 18 | ||
18 | static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size) | 19 | static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size) |
19 | { | 20 | { |
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c index b16ca3ed65d2..78f1f7cca0a0 100644 --- a/arch/powerpc/sysdev/cpm2_pic.c +++ b/arch/powerpc/sysdev/cpm2_pic.c | |||
@@ -165,7 +165,7 @@ static int cpm2_set_irq_type(unsigned int virq, unsigned int flow_type) | |||
165 | edibit = (14 - (src - CPM2_IRQ_EXT1)); | 165 | edibit = (14 - (src - CPM2_IRQ_EXT1)); |
166 | else | 166 | else |
167 | if (src >= CPM2_IRQ_PORTC15 && src <= CPM2_IRQ_PORTC0) | 167 | if (src >= CPM2_IRQ_PORTC15 && src <= CPM2_IRQ_PORTC0) |
168 | edibit = (31 - (src - CPM2_IRQ_PORTC15)); | 168 | edibit = (31 - (CPM2_IRQ_PORTC0 - src)); |
169 | else | 169 | else |
170 | return (flow_type & IRQ_TYPE_LEVEL_LOW) ? 0 : -EINVAL; | 170 | return (flow_type & IRQ_TYPE_LEVEL_LOW) ? 0 : -EINVAL; |
171 | 171 | ||
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 88a983ece5c9..9a89cd3e80a2 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c | |||
@@ -890,7 +890,7 @@ unsigned int ipic_get_irq(void) | |||
890 | return irq_linear_revmap(primary_ipic->irqhost, irq); | 890 | return irq_linear_revmap(primary_ipic->irqhost, irq); |
891 | } | 891 | } |
892 | 892 | ||
893 | #ifdef CONFIG_PM | 893 | #ifdef CONFIG_SUSPEND |
894 | static struct { | 894 | static struct { |
895 | u32 sicfr; | 895 | u32 sicfr; |
896 | u32 siprr[2]; | 896 | u32 siprr[2]; |
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index 77fae5f64f2e..5558d932b4d5 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/arch/powerpc/sysdev/ppc4xx_pci.c | |||
@@ -204,6 +204,23 @@ static int __init ppc4xx_setup_one_pci_PMM(struct pci_controller *hose, | |||
204 | { | 204 | { |
205 | u32 ma, pcila, pciha; | 205 | u32 ma, pcila, pciha; |
206 | 206 | ||
207 | /* Hack warning ! The "old" PCI 2.x cell only let us configure the low | ||
208 | * 32-bit of incoming PLB addresses. The top 4 bits of the 36-bit | ||
209 | * address are actually hard wired to a value that appears to depend | ||
210 | * on the specific SoC. For example, it's 0 on 440EP and 1 on 440EPx. | ||
211 | * | ||
212 | * The trick here is we just crop those top bits and ignore them when | ||
213 | * programming the chip. That means the device-tree has to be right | ||
214 | * for the specific part used (we don't print a warning if it's wrong | ||
215 | * but on the other hand, you'll crash quickly enough), but at least | ||
216 | * this code should work whatever the hard coded value is | ||
217 | */ | ||
218 | plb_addr &= 0xffffffffull; | ||
219 | |||
220 | /* Note: Due to the above hack, the test below doesn't actually test | ||
221 | * if you address is above 4G, but it tests that address and | ||
222 | * (address + size) are both contained in the same 4G | ||
223 | */ | ||
207 | if ((plb_addr + size) > 0xffffffffull || !is_power_of_2(size) || | 224 | if ((plb_addr + size) > 0xffffffffull || !is_power_of_2(size) || |
208 | size < 0x1000 || (plb_addr & (size - 1)) != 0) { | 225 | size < 0x1000 || (plb_addr & (size - 1)) != 0) { |
209 | printk(KERN_WARNING "%s: Resource out of range\n", | 226 | printk(KERN_WARNING "%s: Resource out of range\n", |
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index c42cd898f68b..6118890c946d 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c | |||
@@ -556,7 +556,7 @@ static void __exit aes_s390_fini(void) | |||
556 | module_init(aes_s390_init); | 556 | module_init(aes_s390_init); |
557 | module_exit(aes_s390_fini); | 557 | module_exit(aes_s390_fini); |
558 | 558 | ||
559 | MODULE_ALIAS("aes"); | 559 | MODULE_ALIAS("aes-all"); |
560 | 560 | ||
561 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); | 561 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); |
562 | MODULE_LICENSE("GPL"); | 562 | MODULE_LICENSE("GPL"); |
diff --git a/arch/s390/defconfig b/arch/s390/defconfig index a0e748da9909..31e809c77790 100644 --- a/arch/s390/defconfig +++ b/arch/s390/defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.28-rc6 | 3 | # Linux kernel version: 2.6.29-rc4 |
4 | # Thu Nov 27 11:00:49 2008 | 4 | # Wed Feb 11 10:07:16 2009 |
5 | # | 5 | # |
6 | CONFIG_SCHED_MC=y | 6 | CONFIG_SCHED_MC=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -14,12 +14,14 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y | |||
14 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | 14 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set |
15 | CONFIG_GENERIC_HWEIGHT=y | 15 | CONFIG_GENERIC_HWEIGHT=y |
16 | CONFIG_GENERIC_TIME=y | 16 | CONFIG_GENERIC_TIME=y |
17 | CONFIG_GENERIC_TIME_VSYSCALL=y | ||
17 | CONFIG_GENERIC_CLOCKEVENTS=y | 18 | CONFIG_GENERIC_CLOCKEVENTS=y |
18 | CONFIG_GENERIC_BUG=y | 19 | CONFIG_GENERIC_BUG=y |
19 | CONFIG_NO_IOMEM=y | 20 | CONFIG_NO_IOMEM=y |
20 | CONFIG_NO_DMA=y | 21 | CONFIG_NO_DMA=y |
21 | CONFIG_GENERIC_LOCKBREAK=y | 22 | CONFIG_GENERIC_LOCKBREAK=y |
22 | CONFIG_PGSTE=y | 23 | CONFIG_PGSTE=y |
24 | CONFIG_VIRT_CPU_ACCOUNTING=y | ||
23 | CONFIG_S390=y | 25 | CONFIG_S390=y |
24 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | 26 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" |
25 | 27 | ||
@@ -39,20 +41,29 @@ CONFIG_POSIX_MQUEUE=y | |||
39 | # CONFIG_TASKSTATS is not set | 41 | # CONFIG_TASKSTATS is not set |
40 | CONFIG_AUDIT=y | 42 | CONFIG_AUDIT=y |
41 | # CONFIG_AUDITSYSCALL is not set | 43 | # CONFIG_AUDITSYSCALL is not set |
44 | |||
45 | # | ||
46 | # RCU Subsystem | ||
47 | # | ||
48 | CONFIG_CLASSIC_RCU=y | ||
49 | # CONFIG_TREE_RCU is not set | ||
50 | # CONFIG_PREEMPT_RCU is not set | ||
51 | # CONFIG_TREE_RCU_TRACE is not set | ||
52 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
42 | CONFIG_IKCONFIG=y | 53 | CONFIG_IKCONFIG=y |
43 | CONFIG_IKCONFIG_PROC=y | 54 | CONFIG_IKCONFIG_PROC=y |
44 | CONFIG_LOG_BUF_SHIFT=17 | 55 | CONFIG_LOG_BUF_SHIFT=17 |
56 | CONFIG_GROUP_SCHED=y | ||
57 | CONFIG_FAIR_GROUP_SCHED=y | ||
58 | # CONFIG_RT_GROUP_SCHED is not set | ||
59 | CONFIG_USER_SCHED=y | ||
60 | # CONFIG_CGROUP_SCHED is not set | ||
45 | CONFIG_CGROUPS=y | 61 | CONFIG_CGROUPS=y |
46 | # CONFIG_CGROUP_DEBUG is not set | 62 | # CONFIG_CGROUP_DEBUG is not set |
47 | CONFIG_CGROUP_NS=y | 63 | CONFIG_CGROUP_NS=y |
48 | # CONFIG_CGROUP_FREEZER is not set | 64 | # CONFIG_CGROUP_FREEZER is not set |
49 | # CONFIG_CGROUP_DEVICE is not set | 65 | # CONFIG_CGROUP_DEVICE is not set |
50 | # CONFIG_CPUSETS is not set | 66 | # CONFIG_CPUSETS is not set |
51 | CONFIG_GROUP_SCHED=y | ||
52 | CONFIG_FAIR_GROUP_SCHED=y | ||
53 | # CONFIG_RT_GROUP_SCHED is not set | ||
54 | CONFIG_USER_SCHED=y | ||
55 | # CONFIG_CGROUP_SCHED is not set | ||
56 | # CONFIG_CGROUP_CPUACCT is not set | 67 | # CONFIG_CGROUP_CPUACCT is not set |
57 | # CONFIG_RESOURCE_COUNTERS is not set | 68 | # CONFIG_RESOURCE_COUNTERS is not set |
58 | CONFIG_SYSFS_DEPRECATED=y | 69 | CONFIG_SYSFS_DEPRECATED=y |
@@ -63,6 +74,7 @@ CONFIG_UTS_NS=y | |||
63 | CONFIG_IPC_NS=y | 74 | CONFIG_IPC_NS=y |
64 | # CONFIG_USER_NS is not set | 75 | # CONFIG_USER_NS is not set |
65 | # CONFIG_PID_NS is not set | 76 | # CONFIG_PID_NS is not set |
77 | # CONFIG_NET_NS is not set | ||
66 | CONFIG_BLK_DEV_INITRD=y | 78 | CONFIG_BLK_DEV_INITRD=y |
67 | CONFIG_INITRAMFS_SOURCE="" | 79 | CONFIG_INITRAMFS_SOURCE="" |
68 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | 80 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set |
@@ -91,17 +103,17 @@ CONFIG_SLAB=y | |||
91 | # CONFIG_SLUB is not set | 103 | # CONFIG_SLUB is not set |
92 | # CONFIG_SLOB is not set | 104 | # CONFIG_SLOB is not set |
93 | # CONFIG_PROFILING is not set | 105 | # CONFIG_PROFILING is not set |
94 | # CONFIG_MARKERS is not set | ||
95 | CONFIG_HAVE_OPROFILE=y | 106 | CONFIG_HAVE_OPROFILE=y |
96 | CONFIG_KPROBES=y | 107 | CONFIG_KPROBES=y |
108 | CONFIG_HAVE_SYSCALL_WRAPPERS=y | ||
97 | CONFIG_KRETPROBES=y | 109 | CONFIG_KRETPROBES=y |
98 | CONFIG_HAVE_KPROBES=y | 110 | CONFIG_HAVE_KPROBES=y |
99 | CONFIG_HAVE_KRETPROBES=y | 111 | CONFIG_HAVE_KRETPROBES=y |
100 | CONFIG_HAVE_ARCH_TRACEHOOK=y | 112 | CONFIG_HAVE_ARCH_TRACEHOOK=y |
113 | CONFIG_USE_GENERIC_SMP_HELPERS=y | ||
101 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | 114 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set |
102 | CONFIG_SLABINFO=y | 115 | CONFIG_SLABINFO=y |
103 | CONFIG_RT_MUTEXES=y | 116 | CONFIG_RT_MUTEXES=y |
104 | # CONFIG_TINY_SHMEM is not set | ||
105 | CONFIG_BASE_SMALL=0 | 117 | CONFIG_BASE_SMALL=0 |
106 | CONFIG_MODULES=y | 118 | CONFIG_MODULES=y |
107 | # CONFIG_MODULE_FORCE_LOAD is not set | 119 | # CONFIG_MODULE_FORCE_LOAD is not set |
@@ -109,7 +121,7 @@ CONFIG_MODULE_UNLOAD=y | |||
109 | # CONFIG_MODULE_FORCE_UNLOAD is not set | 121 | # CONFIG_MODULE_FORCE_UNLOAD is not set |
110 | CONFIG_MODVERSIONS=y | 122 | CONFIG_MODVERSIONS=y |
111 | # CONFIG_MODULE_SRCVERSION_ALL is not set | 123 | # CONFIG_MODULE_SRCVERSION_ALL is not set |
112 | CONFIG_KMOD=y | 124 | CONFIG_INIT_ALL_POSSIBLE=y |
113 | CONFIG_STOP_MACHINE=y | 125 | CONFIG_STOP_MACHINE=y |
114 | CONFIG_BLOCK=y | 126 | CONFIG_BLOCK=y |
115 | # CONFIG_BLK_DEV_IO_TRACE is not set | 127 | # CONFIG_BLK_DEV_IO_TRACE is not set |
@@ -130,7 +142,6 @@ CONFIG_DEFAULT_DEADLINE=y | |||
130 | # CONFIG_DEFAULT_NOOP is not set | 142 | # CONFIG_DEFAULT_NOOP is not set |
131 | CONFIG_DEFAULT_IOSCHED="deadline" | 143 | CONFIG_DEFAULT_IOSCHED="deadline" |
132 | CONFIG_PREEMPT_NOTIFIERS=y | 144 | CONFIG_PREEMPT_NOTIFIERS=y |
133 | CONFIG_CLASSIC_RCU=y | ||
134 | # CONFIG_FREEZER is not set | 145 | # CONFIG_FREEZER is not set |
135 | 146 | ||
136 | # | 147 | # |
@@ -161,6 +172,7 @@ CONFIG_S390_EXEC_PROTECT=y | |||
161 | CONFIG_MARCH_Z900=y | 172 | CONFIG_MARCH_Z900=y |
162 | # CONFIG_MARCH_Z990 is not set | 173 | # CONFIG_MARCH_Z990 is not set |
163 | # CONFIG_MARCH_Z9_109 is not set | 174 | # CONFIG_MARCH_Z9_109 is not set |
175 | # CONFIG_MARCH_Z10 is not set | ||
164 | CONFIG_PACK_STACK=y | 176 | CONFIG_PACK_STACK=y |
165 | # CONFIG_SMALL_STACK is not set | 177 | # CONFIG_SMALL_STACK is not set |
166 | CONFIG_CHECK_STACK=y | 178 | CONFIG_CHECK_STACK=y |
@@ -174,7 +186,6 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y | |||
174 | # CONFIG_PREEMPT_NONE is not set | 186 | # CONFIG_PREEMPT_NONE is not set |
175 | # CONFIG_PREEMPT_VOLUNTARY is not set | 187 | # CONFIG_PREEMPT_VOLUNTARY is not set |
176 | CONFIG_PREEMPT=y | 188 | CONFIG_PREEMPT=y |
177 | # CONFIG_PREEMPT_RCU is not set | ||
178 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | 189 | CONFIG_ARCH_SPARSEMEM_ENABLE=y |
179 | CONFIG_ARCH_SPARSEMEM_DEFAULT=y | 190 | CONFIG_ARCH_SPARSEMEM_DEFAULT=y |
180 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | 191 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y |
@@ -195,7 +206,6 @@ CONFIG_MEMORY_HOTREMOVE=y | |||
195 | CONFIG_PAGEFLAGS_EXTENDED=y | 206 | CONFIG_PAGEFLAGS_EXTENDED=y |
196 | CONFIG_SPLIT_PTLOCK_CPUS=4 | 207 | CONFIG_SPLIT_PTLOCK_CPUS=4 |
197 | CONFIG_MIGRATION=y | 208 | CONFIG_MIGRATION=y |
198 | CONFIG_RESOURCES_64BIT=y | ||
199 | CONFIG_PHYS_ADDR_T_64BIT=y | 209 | CONFIG_PHYS_ADDR_T_64BIT=y |
200 | CONFIG_ZONE_DMA_FLAG=1 | 210 | CONFIG_ZONE_DMA_FLAG=1 |
201 | CONFIG_BOUNCE=y | 211 | CONFIG_BOUNCE=y |
@@ -207,7 +217,6 @@ CONFIG_UNEVICTABLE_LRU=y | |||
207 | # | 217 | # |
208 | CONFIG_MACHCHK_WARNING=y | 218 | CONFIG_MACHCHK_WARNING=y |
209 | CONFIG_QDIO=y | 219 | CONFIG_QDIO=y |
210 | # CONFIG_QDIO_DEBUG is not set | ||
211 | CONFIG_CHSC_SCH=m | 220 | CONFIG_CHSC_SCH=m |
212 | 221 | ||
213 | # | 222 | # |
@@ -227,15 +236,13 @@ CONFIG_PFAULT=y | |||
227 | # CONFIG_SHARED_KERNEL is not set | 236 | # CONFIG_SHARED_KERNEL is not set |
228 | # CONFIG_CMM is not set | 237 | # CONFIG_CMM is not set |
229 | # CONFIG_PAGE_STATES is not set | 238 | # CONFIG_PAGE_STATES is not set |
230 | CONFIG_VIRT_TIMER=y | ||
231 | CONFIG_VIRT_CPU_ACCOUNTING=y | ||
232 | # CONFIG_APPLDATA_BASE is not set | 239 | # CONFIG_APPLDATA_BASE is not set |
233 | CONFIG_HZ_100=y | 240 | CONFIG_HZ_100=y |
234 | # CONFIG_HZ_250 is not set | 241 | # CONFIG_HZ_250 is not set |
235 | # CONFIG_HZ_300 is not set | 242 | # CONFIG_HZ_300 is not set |
236 | # CONFIG_HZ_1000 is not set | 243 | # CONFIG_HZ_1000 is not set |
237 | CONFIG_HZ=100 | 244 | CONFIG_HZ=100 |
238 | # CONFIG_SCHED_HRTICK is not set | 245 | CONFIG_SCHED_HRTICK=y |
239 | CONFIG_S390_HYPFS_FS=y | 246 | CONFIG_S390_HYPFS_FS=y |
240 | CONFIG_KEXEC=y | 247 | CONFIG_KEXEC=y |
241 | # CONFIG_ZFCPDUMP is not set | 248 | # CONFIG_ZFCPDUMP is not set |
@@ -245,6 +252,7 @@ CONFIG_NET=y | |||
245 | # | 252 | # |
246 | # Networking options | 253 | # Networking options |
247 | # | 254 | # |
255 | CONFIG_COMPAT_NET_DEV_OPS=y | ||
248 | CONFIG_PACKET=y | 256 | CONFIG_PACKET=y |
249 | # CONFIG_PACKET_MMAP is not set | 257 | # CONFIG_PACKET_MMAP is not set |
250 | CONFIG_UNIX=y | 258 | CONFIG_UNIX=y |
@@ -383,6 +391,7 @@ CONFIG_NET_SCH_TBF=m | |||
383 | CONFIG_NET_SCH_GRED=m | 391 | CONFIG_NET_SCH_GRED=m |
384 | CONFIG_NET_SCH_DSMARK=m | 392 | CONFIG_NET_SCH_DSMARK=m |
385 | # CONFIG_NET_SCH_NETEM is not set | 393 | # CONFIG_NET_SCH_NETEM is not set |
394 | # CONFIG_NET_SCH_DRR is not set | ||
386 | # CONFIG_NET_SCH_INGRESS is not set | 395 | # CONFIG_NET_SCH_INGRESS is not set |
387 | 396 | ||
388 | # | 397 | # |
@@ -400,6 +409,7 @@ CONFIG_CLS_U32_MARK=y | |||
400 | CONFIG_NET_CLS_RSVP=m | 409 | CONFIG_NET_CLS_RSVP=m |
401 | CONFIG_NET_CLS_RSVP6=m | 410 | CONFIG_NET_CLS_RSVP6=m |
402 | CONFIG_NET_CLS_FLOW=m | 411 | CONFIG_NET_CLS_FLOW=m |
412 | # CONFIG_NET_CLS_CGROUP is not set | ||
403 | # CONFIG_NET_EMATCH is not set | 413 | # CONFIG_NET_EMATCH is not set |
404 | CONFIG_NET_CLS_ACT=y | 414 | CONFIG_NET_CLS_ACT=y |
405 | CONFIG_NET_ACT_POLICE=y | 415 | CONFIG_NET_ACT_POLICE=y |
@@ -411,6 +421,7 @@ CONFIG_NET_ACT_NAT=m | |||
411 | # CONFIG_NET_ACT_SKBEDIT is not set | 421 | # CONFIG_NET_ACT_SKBEDIT is not set |
412 | # CONFIG_NET_CLS_IND is not set | 422 | # CONFIG_NET_CLS_IND is not set |
413 | CONFIG_NET_SCH_FIFO=y | 423 | CONFIG_NET_SCH_FIFO=y |
424 | # CONFIG_DCB is not set | ||
414 | 425 | ||
415 | # | 426 | # |
416 | # Network testing | 427 | # Network testing |
@@ -428,6 +439,7 @@ CONFIG_CAN_VCAN=m | |||
428 | # CONFIG_CAN_DEBUG_DEVICES is not set | 439 | # CONFIG_CAN_DEBUG_DEVICES is not set |
429 | # CONFIG_AF_RXRPC is not set | 440 | # CONFIG_AF_RXRPC is not set |
430 | # CONFIG_PHONET is not set | 441 | # CONFIG_PHONET is not set |
442 | # CONFIG_WIMAX is not set | ||
431 | # CONFIG_RFKILL is not set | 443 | # CONFIG_RFKILL is not set |
432 | # CONFIG_NET_9P is not set | 444 | # CONFIG_NET_9P is not set |
433 | # CONFIG_PCMCIA is not set | 445 | # CONFIG_PCMCIA is not set |
@@ -475,11 +487,15 @@ CONFIG_DASD_DIAG=y | |||
475 | CONFIG_DASD_EER=y | 487 | CONFIG_DASD_EER=y |
476 | CONFIG_VIRTIO_BLK=m | 488 | CONFIG_VIRTIO_BLK=m |
477 | CONFIG_MISC_DEVICES=y | 489 | CONFIG_MISC_DEVICES=y |
478 | # CONFIG_EEPROM_93CX6 is not set | ||
479 | # CONFIG_ENCLOSURE_SERVICES is not set | 490 | # CONFIG_ENCLOSURE_SERVICES is not set |
480 | # CONFIG_C2PORT is not set | 491 | # CONFIG_C2PORT is not set |
481 | 492 | ||
482 | # | 493 | # |
494 | # EEPROM support | ||
495 | # | ||
496 | # CONFIG_EEPROM_93CX6 is not set | ||
497 | |||
498 | # | ||
483 | # SCSI device support | 499 | # SCSI device support |
484 | # | 500 | # |
485 | # CONFIG_RAID_ATTRS is not set | 501 | # CONFIG_RAID_ATTRS is not set |
@@ -520,6 +536,7 @@ CONFIG_SCSI_FC_ATTRS=y | |||
520 | # CONFIG_SCSI_SRP_ATTRS is not set | 536 | # CONFIG_SCSI_SRP_ATTRS is not set |
521 | CONFIG_SCSI_LOWLEVEL=y | 537 | CONFIG_SCSI_LOWLEVEL=y |
522 | # CONFIG_ISCSI_TCP is not set | 538 | # CONFIG_ISCSI_TCP is not set |
539 | # CONFIG_LIBFC is not set | ||
523 | # CONFIG_SCSI_DEBUG is not set | 540 | # CONFIG_SCSI_DEBUG is not set |
524 | CONFIG_ZFCP=y | 541 | CONFIG_ZFCP=y |
525 | CONFIG_SCSI_DH=m | 542 | CONFIG_SCSI_DH=m |
@@ -566,6 +583,10 @@ CONFIG_NET_ETHERNET=y | |||
566 | CONFIG_NETDEV_1000=y | 583 | CONFIG_NETDEV_1000=y |
567 | CONFIG_NETDEV_10000=y | 584 | CONFIG_NETDEV_10000=y |
568 | # CONFIG_TR is not set | 585 | # CONFIG_TR is not set |
586 | |||
587 | # | ||
588 | # Enable WiMAX (Networking options) to see the WiMAX drivers | ||
589 | # | ||
569 | # CONFIG_WAN is not set | 590 | # CONFIG_WAN is not set |
570 | 591 | ||
571 | # | 592 | # |
@@ -593,9 +614,11 @@ CONFIG_VIRTIO_NET=m | |||
593 | # | 614 | # |
594 | CONFIG_DEVKMEM=y | 615 | CONFIG_DEVKMEM=y |
595 | CONFIG_UNIX98_PTYS=y | 616 | CONFIG_UNIX98_PTYS=y |
617 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
596 | CONFIG_LEGACY_PTYS=y | 618 | CONFIG_LEGACY_PTYS=y |
597 | CONFIG_LEGACY_PTY_COUNT=256 | 619 | CONFIG_LEGACY_PTY_COUNT=256 |
598 | CONFIG_HVC_DRIVER=y | 620 | CONFIG_HVC_DRIVER=y |
621 | CONFIG_HVC_IUCV=y | ||
599 | CONFIG_VIRTIO_CONSOLE=y | 622 | CONFIG_VIRTIO_CONSOLE=y |
600 | CONFIG_HW_RANDOM=m | 623 | CONFIG_HW_RANDOM=m |
601 | CONFIG_HW_RANDOM_VIRTIO=m | 624 | CONFIG_HW_RANDOM_VIRTIO=m |
@@ -645,7 +668,6 @@ CONFIG_S390_VMUR=m | |||
645 | # CONFIG_NEW_LEDS is not set | 668 | # CONFIG_NEW_LEDS is not set |
646 | CONFIG_ACCESSIBILITY=y | 669 | CONFIG_ACCESSIBILITY=y |
647 | # CONFIG_STAGING is not set | 670 | # CONFIG_STAGING is not set |
648 | CONFIG_STAGING_EXCLUDE_BUILD=y | ||
649 | 671 | ||
650 | # | 672 | # |
651 | # File systems | 673 | # File systems |
@@ -668,6 +690,7 @@ CONFIG_FILE_LOCKING=y | |||
668 | # CONFIG_XFS_FS is not set | 690 | # CONFIG_XFS_FS is not set |
669 | # CONFIG_GFS2_FS is not set | 691 | # CONFIG_GFS2_FS is not set |
670 | # CONFIG_OCFS2_FS is not set | 692 | # CONFIG_OCFS2_FS is not set |
693 | # CONFIG_BTRFS_FS is not set | ||
671 | CONFIG_DNOTIFY=y | 694 | CONFIG_DNOTIFY=y |
672 | CONFIG_INOTIFY=y | 695 | CONFIG_INOTIFY=y |
673 | CONFIG_INOTIFY_USER=y | 696 | CONFIG_INOTIFY_USER=y |
@@ -703,10 +726,7 @@ CONFIG_TMPFS_POSIX_ACL=y | |||
703 | # CONFIG_HUGETLBFS is not set | 726 | # CONFIG_HUGETLBFS is not set |
704 | # CONFIG_HUGETLB_PAGE is not set | 727 | # CONFIG_HUGETLB_PAGE is not set |
705 | CONFIG_CONFIGFS_FS=m | 728 | CONFIG_CONFIGFS_FS=m |
706 | 729 | CONFIG_MISC_FILESYSTEMS=y | |
707 | # | ||
708 | # Miscellaneous filesystems | ||
709 | # | ||
710 | # CONFIG_ADFS_FS is not set | 730 | # CONFIG_ADFS_FS is not set |
711 | # CONFIG_AFFS_FS is not set | 731 | # CONFIG_AFFS_FS is not set |
712 | # CONFIG_HFS_FS is not set | 732 | # CONFIG_HFS_FS is not set |
@@ -715,6 +735,7 @@ CONFIG_CONFIGFS_FS=m | |||
715 | # CONFIG_BFS_FS is not set | 735 | # CONFIG_BFS_FS is not set |
716 | # CONFIG_EFS_FS is not set | 736 | # CONFIG_EFS_FS is not set |
717 | # CONFIG_CRAMFS is not set | 737 | # CONFIG_CRAMFS is not set |
738 | # CONFIG_SQUASHFS is not set | ||
718 | # CONFIG_VXFS_FS is not set | 739 | # CONFIG_VXFS_FS is not set |
719 | # CONFIG_MINIX_FS is not set | 740 | # CONFIG_MINIX_FS is not set |
720 | # CONFIG_OMFS_FS is not set | 741 | # CONFIG_OMFS_FS is not set |
@@ -808,6 +829,7 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
808 | CONFIG_DEBUG_MEMORY_INIT=y | 829 | CONFIG_DEBUG_MEMORY_INIT=y |
809 | # CONFIG_DEBUG_LIST is not set | 830 | # CONFIG_DEBUG_LIST is not set |
810 | # CONFIG_DEBUG_SG is not set | 831 | # CONFIG_DEBUG_SG is not set |
832 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
811 | # CONFIG_FRAME_POINTER is not set | 833 | # CONFIG_FRAME_POINTER is not set |
812 | # CONFIG_RCU_TORTURE_TEST is not set | 834 | # CONFIG_RCU_TORTURE_TEST is not set |
813 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | 835 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set |
@@ -818,15 +840,19 @@ CONFIG_DEBUG_MEMORY_INIT=y | |||
818 | # CONFIG_FAULT_INJECTION is not set | 840 | # CONFIG_FAULT_INJECTION is not set |
819 | # CONFIG_LATENCYTOP is not set | 841 | # CONFIG_LATENCYTOP is not set |
820 | CONFIG_SYSCTL_SYSCALL_CHECK=y | 842 | CONFIG_SYSCTL_SYSCALL_CHECK=y |
843 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
821 | 844 | ||
822 | # | 845 | # |
823 | # Tracers | 846 | # Tracers |
824 | # | 847 | # |
848 | # CONFIG_FUNCTION_TRACER is not set | ||
825 | # CONFIG_IRQSOFF_TRACER is not set | 849 | # CONFIG_IRQSOFF_TRACER is not set |
826 | # CONFIG_PREEMPT_TRACER is not set | 850 | # CONFIG_PREEMPT_TRACER is not set |
827 | # CONFIG_SCHED_TRACER is not set | 851 | # CONFIG_SCHED_TRACER is not set |
828 | # CONFIG_CONTEXT_SWITCH_TRACER is not set | 852 | # CONFIG_CONTEXT_SWITCH_TRACER is not set |
829 | # CONFIG_BOOT_TRACER is not set | 853 | # CONFIG_BOOT_TRACER is not set |
854 | # CONFIG_TRACE_BRANCH_PROFILING is not set | ||
855 | # CONFIG_STACK_TRACER is not set | ||
830 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set | 856 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set |
831 | CONFIG_SAMPLES=y | 857 | CONFIG_SAMPLES=y |
832 | # CONFIG_SAMPLE_KOBJECT is not set | 858 | # CONFIG_SAMPLE_KOBJECT is not set |
@@ -847,11 +873,17 @@ CONFIG_CRYPTO=y | |||
847 | # | 873 | # |
848 | CONFIG_CRYPTO_FIPS=y | 874 | CONFIG_CRYPTO_FIPS=y |
849 | CONFIG_CRYPTO_ALGAPI=y | 875 | CONFIG_CRYPTO_ALGAPI=y |
850 | CONFIG_CRYPTO_AEAD=y | 876 | CONFIG_CRYPTO_ALGAPI2=y |
877 | CONFIG_CRYPTO_AEAD=m | ||
878 | CONFIG_CRYPTO_AEAD2=y | ||
851 | CONFIG_CRYPTO_BLKCIPHER=y | 879 | CONFIG_CRYPTO_BLKCIPHER=y |
852 | CONFIG_CRYPTO_HASH=y | 880 | CONFIG_CRYPTO_BLKCIPHER2=y |
853 | CONFIG_CRYPTO_RNG=y | 881 | CONFIG_CRYPTO_HASH=m |
882 | CONFIG_CRYPTO_HASH2=y | ||
883 | CONFIG_CRYPTO_RNG=m | ||
884 | CONFIG_CRYPTO_RNG2=y | ||
854 | CONFIG_CRYPTO_MANAGER=y | 885 | CONFIG_CRYPTO_MANAGER=y |
886 | CONFIG_CRYPTO_MANAGER2=y | ||
855 | CONFIG_CRYPTO_GF128MUL=m | 887 | CONFIG_CRYPTO_GF128MUL=m |
856 | # CONFIG_CRYPTO_NULL is not set | 888 | # CONFIG_CRYPTO_NULL is not set |
857 | # CONFIG_CRYPTO_CRYPTD is not set | 889 | # CONFIG_CRYPTO_CRYPTD is not set |
@@ -885,7 +917,7 @@ CONFIG_CRYPTO_HMAC=m | |||
885 | # | 917 | # |
886 | # Digest | 918 | # Digest |
887 | # | 919 | # |
888 | # CONFIG_CRYPTO_CRC32C is not set | 920 | CONFIG_CRYPTO_CRC32C=m |
889 | # CONFIG_CRYPTO_MD4 is not set | 921 | # CONFIG_CRYPTO_MD4 is not set |
890 | CONFIG_CRYPTO_MD5=m | 922 | CONFIG_CRYPTO_MD5=m |
891 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | 923 | # CONFIG_CRYPTO_MICHAEL_MIC is not set |
@@ -942,6 +974,7 @@ CONFIG_S390_PRNG=m | |||
942 | # Library routines | 974 | # Library routines |
943 | # | 975 | # |
944 | CONFIG_BITREVERSE=m | 976 | CONFIG_BITREVERSE=m |
977 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
945 | # CONFIG_CRC_CCITT is not set | 978 | # CONFIG_CRC_CCITT is not set |
946 | # CONFIG_CRC16 is not set | 979 | # CONFIG_CRC16 is not set |
947 | CONFIG_CRC_T10DIF=y | 980 | CONFIG_CRC_T10DIF=y |
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index 521726430afa..95b0f7db3c69 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h | |||
@@ -145,7 +145,7 @@ cputime_to_timeval(const cputime_t cputime, struct timeval *value) | |||
145 | value->tv_usec = rp.subreg.even / 4096; | 145 | value->tv_usec = rp.subreg.even / 4096; |
146 | value->tv_sec = rp.subreg.odd; | 146 | value->tv_sec = rp.subreg.odd; |
147 | #else | 147 | #else |
148 | value->tv_usec = cputime % 4096000000ULL; | 148 | value->tv_usec = (cputime % 4096000000ULL) / 4096; |
149 | value->tv_sec = cputime / 4096000000ULL; | 149 | value->tv_sec = cputime / 4096000000ULL; |
150 | #endif | 150 | #endif |
151 | } | 151 | } |
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h index ffdef5fe8587..f3720defdd16 100644 --- a/arch/s390/include/asm/lowcore.h +++ b/arch/s390/include/asm/lowcore.h | |||
@@ -384,8 +384,8 @@ struct _lowcore | |||
384 | __u32 panic_magic; /* 0xe00 */ | 384 | __u32 panic_magic; /* 0xe00 */ |
385 | 385 | ||
386 | /* Per cpu primary space access list */ | 386 | /* Per cpu primary space access list */ |
387 | __u8 pad_0xe04[0xe3c-0xe04]; /* 0xe04 */ | 387 | __u8 pad_0xe04[0xe38-0xe04]; /* 0xe04 */ |
388 | __u32 vdso_per_cpu_data; /* 0xe3c */ | 388 | __u64 vdso_per_cpu_data; /* 0xe38 */ |
389 | __u32 paste[16]; /* 0xe40 */ | 389 | __u32 paste[16]; /* 0xe40 */ |
390 | 390 | ||
391 | __u8 pad13[0x11b8-0xe80]; /* 0xe80 */ | 391 | __u8 pad13[0x11b8-0xe80]; /* 0xe80 */ |
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h index 2bd9faeb3919..e8bd6ac22c99 100644 --- a/arch/s390/include/asm/setup.h +++ b/arch/s390/include/asm/setup.h | |||
@@ -43,6 +43,8 @@ struct mem_chunk { | |||
43 | 43 | ||
44 | extern struct mem_chunk memory_chunk[]; | 44 | extern struct mem_chunk memory_chunk[]; |
45 | extern unsigned long real_memory_size; | 45 | extern unsigned long real_memory_size; |
46 | extern int memory_end_set; | ||
47 | extern unsigned long memory_end; | ||
46 | 48 | ||
47 | void detect_memory_layout(struct mem_chunk chunk[]); | 49 | void detect_memory_layout(struct mem_chunk chunk[]); |
48 | 50 | ||
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index e7c5bfb7c755..026a37a94fc9 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c | |||
@@ -95,6 +95,7 @@ asmlinkage void do_softirq(void) | |||
95 | local_irq_restore(flags); | 95 | local_irq_restore(flags); |
96 | } | 96 | } |
97 | 97 | ||
98 | #ifdef CONFIG_PROC_FS | ||
98 | void init_irq_proc(void) | 99 | void init_irq_proc(void) |
99 | { | 100 | { |
100 | struct proc_dir_entry *root_irq_dir; | 101 | struct proc_dir_entry *root_irq_dir; |
@@ -102,3 +103,4 @@ void init_irq_proc(void) | |||
102 | root_irq_dir = proc_mkdir("irq", NULL); | 103 | root_irq_dir = proc_mkdir("irq", NULL); |
103 | create_prof_cpu_mask(root_irq_dir); | 104 | create_prof_cpu_mask(root_irq_dir); |
104 | } | 105 | } |
106 | #endif | ||
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index d825f4950e4e..c5cfb6185eac 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -82,7 +82,9 @@ char elf_platform[ELF_PLATFORM_SIZE]; | |||
82 | 82 | ||
83 | struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS]; | 83 | struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS]; |
84 | volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */ | 84 | volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */ |
85 | static unsigned long __initdata memory_end; | 85 | |
86 | int __initdata memory_end_set; | ||
87 | unsigned long __initdata memory_end; | ||
86 | 88 | ||
87 | /* | 89 | /* |
88 | * This is set up by the setup-routine at boot-time | 90 | * This is set up by the setup-routine at boot-time |
@@ -281,6 +283,7 @@ void (*pm_power_off)(void) = machine_power_off; | |||
281 | static int __init early_parse_mem(char *p) | 283 | static int __init early_parse_mem(char *p) |
282 | { | 284 | { |
283 | memory_end = memparse(p, &p); | 285 | memory_end = memparse(p, &p); |
286 | memory_end_set = 1; | ||
284 | return 0; | 287 | return 0; |
285 | } | 288 | } |
286 | early_param("mem", early_parse_mem); | 289 | early_param("mem", early_parse_mem); |
@@ -508,8 +511,10 @@ static void __init setup_memory_end(void) | |||
508 | int i; | 511 | int i; |
509 | 512 | ||
510 | #if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE) | 513 | #if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE) |
511 | if (ipl_info.type == IPL_TYPE_FCP_DUMP) | 514 | if (ipl_info.type == IPL_TYPE_FCP_DUMP) { |
512 | memory_end = ZFCPDUMP_HSA_SIZE; | 515 | memory_end = ZFCPDUMP_HSA_SIZE; |
516 | memory_end_set = 1; | ||
517 | } | ||
513 | #endif | 518 | #endif |
514 | memory_size = 0; | 519 | memory_size = 0; |
515 | memory_end &= PAGE_MASK; | 520 | memory_end &= PAGE_MASK; |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index be8497186b96..0d33893e1e89 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -212,6 +212,10 @@ static void kvm_free_vcpus(struct kvm *kvm) | |||
212 | } | 212 | } |
213 | } | 213 | } |
214 | 214 | ||
215 | void kvm_arch_sync_events(struct kvm *kvm) | ||
216 | { | ||
217 | } | ||
218 | |||
215 | void kvm_arch_destroy_vm(struct kvm *kvm) | 219 | void kvm_arch_destroy_vm(struct kvm *kvm) |
216 | { | 220 | { |
217 | kvm_free_vcpus(kvm); | 221 | kvm_free_vcpus(kvm); |
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 7c35787d29b4..15b6d450fbf0 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/gpio.h> | 22 | #include <linux/gpio.h> |
23 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
24 | #include <linux/spi/spi_gpio.h> | 24 | #include <linux/spi/spi_gpio.h> |
25 | #include <media/ov772x.h> | 25 | #include <media/soc_camera.h> |
26 | #include <media/soc_camera_platform.h> | 26 | #include <media/soc_camera_platform.h> |
27 | #include <media/sh_mobile_ceu.h> | 27 | #include <media/sh_mobile_ceu.h> |
28 | #include <video/sh_mobile_lcdc.h> | 28 | #include <video/sh_mobile_lcdc.h> |
@@ -224,7 +224,6 @@ static void camera_power(int val) | |||
224 | } | 224 | } |
225 | 225 | ||
226 | #ifdef CONFIG_I2C | 226 | #ifdef CONFIG_I2C |
227 | /* support for the old ncm03j camera */ | ||
228 | static unsigned char camera_ncm03j_magic[] = | 227 | static unsigned char camera_ncm03j_magic[] = |
229 | { | 228 | { |
230 | 0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8, | 229 | 0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8, |
@@ -245,23 +244,6 @@ static unsigned char camera_ncm03j_magic[] = | |||
245 | 0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F, | 244 | 0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F, |
246 | }; | 245 | }; |
247 | 246 | ||
248 | static int camera_probe(void) | ||
249 | { | ||
250 | struct i2c_adapter *a = i2c_get_adapter(0); | ||
251 | struct i2c_msg msg; | ||
252 | int ret; | ||
253 | |||
254 | camera_power(1); | ||
255 | msg.addr = 0x6e; | ||
256 | msg.buf = camera_ncm03j_magic; | ||
257 | msg.len = 2; | ||
258 | msg.flags = 0; | ||
259 | ret = i2c_transfer(a, &msg, 1); | ||
260 | camera_power(0); | ||
261 | |||
262 | return ret; | ||
263 | } | ||
264 | |||
265 | static int camera_set_capture(struct soc_camera_platform_info *info, | 247 | static int camera_set_capture(struct soc_camera_platform_info *info, |
266 | int enable) | 248 | int enable) |
267 | { | 249 | { |
@@ -313,35 +295,8 @@ static struct platform_device camera_device = { | |||
313 | .platform_data = &camera_info, | 295 | .platform_data = &camera_info, |
314 | }, | 296 | }, |
315 | }; | 297 | }; |
316 | |||
317 | static int __init camera_setup(void) | ||
318 | { | ||
319 | if (camera_probe() > 0) | ||
320 | platform_device_register(&camera_device); | ||
321 | |||
322 | return 0; | ||
323 | } | ||
324 | late_initcall(camera_setup); | ||
325 | |||
326 | #endif /* CONFIG_I2C */ | 298 | #endif /* CONFIG_I2C */ |
327 | 299 | ||
328 | static int ov7725_power(struct device *dev, int mode) | ||
329 | { | ||
330 | camera_power(0); | ||
331 | if (mode) | ||
332 | camera_power(1); | ||
333 | |||
334 | return 0; | ||
335 | } | ||
336 | |||
337 | static struct ov772x_camera_info ov7725_info = { | ||
338 | .buswidth = SOCAM_DATAWIDTH_8, | ||
339 | .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, | ||
340 | .link = { | ||
341 | .power = ov7725_power, | ||
342 | }, | ||
343 | }; | ||
344 | |||
345 | static struct sh_mobile_ceu_info sh_mobile_ceu_info = { | 300 | static struct sh_mobile_ceu_info sh_mobile_ceu_info = { |
346 | .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | | 301 | .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | |
347 | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, | 302 | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, |
@@ -392,6 +347,9 @@ static struct platform_device *ap325rxa_devices[] __initdata = { | |||
392 | &ap325rxa_nor_flash_device, | 347 | &ap325rxa_nor_flash_device, |
393 | &lcdc_device, | 348 | &lcdc_device, |
394 | &ceu_device, | 349 | &ceu_device, |
350 | #ifdef CONFIG_I2C | ||
351 | &camera_device, | ||
352 | #endif | ||
395 | &nand_flash_device, | 353 | &nand_flash_device, |
396 | &sdcard_cn3_device, | 354 | &sdcard_cn3_device, |
397 | }; | 355 | }; |
@@ -400,10 +358,6 @@ static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { | |||
400 | { | 358 | { |
401 | I2C_BOARD_INFO("pcf8563", 0x51), | 359 | I2C_BOARD_INFO("pcf8563", 0x51), |
402 | }, | 360 | }, |
403 | { | ||
404 | I2C_BOARD_INFO("ov772x", 0x21), | ||
405 | .platform_data = &ov7725_info, | ||
406 | }, | ||
407 | }; | 361 | }; |
408 | 362 | ||
409 | static struct spi_board_info ap325rxa_spi_devices[] = { | 363 | static struct spi_board_info ap325rxa_spi_devices[] = { |
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7201.c b/arch/sh/kernel/cpu/sh2a/clock-sh7201.c index 020a96fe961a..4a5e59732334 100644 --- a/arch/sh/kernel/cpu/sh2a/clock-sh7201.c +++ b/arch/sh/kernel/cpu/sh2a/clock-sh7201.c | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <asm/freq.h> | 18 | #include <asm/freq.h> |
19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
20 | 20 | ||
21 | const static int pll1rate[]={1,2,3,4,6,8}; | 21 | static const int pll1rate[]={1,2,3,4,6,8}; |
22 | const static int pfc_divisors[]={1,2,3,4,6,8,12}; | 22 | static const int pfc_divisors[]={1,2,3,4,6,8,12}; |
23 | #define ifc_divisors pfc_divisors | 23 | #define ifc_divisors pfc_divisors |
24 | 24 | ||
25 | #if (CONFIG_SH_CLK_MD == 0) | 25 | #if (CONFIG_SH_CLK_MD == 0) |
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h index f260b58f5ce9..0e706257918f 100644 --- a/arch/sparc/include/asm/compat.h +++ b/arch/sparc/include/asm/compat.h | |||
@@ -240,4 +240,9 @@ struct compat_shmid64_ds { | |||
240 | unsigned int __unused2; | 240 | unsigned int __unused2; |
241 | }; | 241 | }; |
242 | 242 | ||
243 | static inline int is_compat_task(void) | ||
244 | { | ||
245 | return test_thread_flag(TIF_32BIT); | ||
246 | } | ||
247 | |||
243 | #endif /* _ASM_SPARC64_COMPAT_H */ | 248 | #endif /* _ASM_SPARC64_COMPAT_H */ |
diff --git a/arch/sparc/include/asm/seccomp.h b/arch/sparc/include/asm/seccomp.h index 7fcd9968192b..adca1bce41d4 100644 --- a/arch/sparc/include/asm/seccomp.h +++ b/arch/sparc/include/asm/seccomp.h | |||
@@ -1,11 +1,5 @@ | |||
1 | #ifndef _ASM_SECCOMP_H | 1 | #ifndef _ASM_SECCOMP_H |
2 | 2 | ||
3 | #include <linux/thread_info.h> /* already defines TIF_32BIT */ | ||
4 | |||
5 | #ifndef TIF_32BIT | ||
6 | #error "unexpected TIF_32BIT on sparc64" | ||
7 | #endif | ||
8 | |||
9 | #include <linux/unistd.h> | 3 | #include <linux/unistd.h> |
10 | 4 | ||
11 | #define __NR_seccomp_read __NR_read | 5 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c index 3b9f4d6e14a9..e1a9598e2a4d 100644 --- a/arch/sparc/kernel/chmc.c +++ b/arch/sparc/kernel/chmc.c | |||
@@ -306,6 +306,7 @@ static int jbusmc_print_dimm(int syndrome_code, | |||
306 | buf[1] = '?'; | 306 | buf[1] = '?'; |
307 | buf[2] = '?'; | 307 | buf[2] = '?'; |
308 | buf[3] = '\0'; | 308 | buf[3] = '\0'; |
309 | return 0; | ||
309 | } | 310 | } |
310 | p = dp->controller; | 311 | p = dp->controller; |
311 | prop = &p->layout; | 312 | prop = &p->layout; |
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S index 8ffee714f932..a46c3a21e26d 100644 --- a/arch/sparc/kernel/head_64.S +++ b/arch/sparc/kernel/head_64.S | |||
@@ -891,10 +891,35 @@ prom_tba: .xword 0 | |||
891 | tlb_type: .word 0 /* Must NOT end up in BSS */ | 891 | tlb_type: .word 0 /* Must NOT end up in BSS */ |
892 | .section ".fixup",#alloc,#execinstr | 892 | .section ".fixup",#alloc,#execinstr |
893 | 893 | ||
894 | .globl __ret_efault, __retl_efault | 894 | .globl __ret_efault, __retl_efault, __ret_one, __retl_one |
895 | __ret_efault: | 895 | ENTRY(__ret_efault) |
896 | ret | 896 | ret |
897 | restore %g0, -EFAULT, %o0 | 897 | restore %g0, -EFAULT, %o0 |
898 | __retl_efault: | 898 | ENDPROC(__ret_efault) |
899 | |||
900 | ENTRY(__retl_efault) | ||
899 | retl | 901 | retl |
900 | mov -EFAULT, %o0 | 902 | mov -EFAULT, %o0 |
903 | ENDPROC(__retl_efault) | ||
904 | |||
905 | ENTRY(__retl_one) | ||
906 | retl | ||
907 | mov 1, %o0 | ||
908 | ENDPROC(__retl_one) | ||
909 | |||
910 | ENTRY(__ret_one_asi) | ||
911 | wr %g0, ASI_AIUS, %asi | ||
912 | ret | ||
913 | restore %g0, 1, %o0 | ||
914 | ENDPROC(__ret_one_asi) | ||
915 | |||
916 | ENTRY(__retl_one_asi) | ||
917 | wr %g0, ASI_AIUS, %asi | ||
918 | retl | ||
919 | mov 1, %o0 | ||
920 | ENDPROC(__retl_one_asi) | ||
921 | |||
922 | ENTRY(__retl_o1) | ||
923 | retl | ||
924 | mov %o1, %o0 | ||
925 | ENDPROC(__retl_o1) | ||
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c index 09f088ed4a64..f3577223c863 100644 --- a/arch/sparc/kernel/nmi.c +++ b/arch/sparc/kernel/nmi.c | |||
@@ -70,6 +70,7 @@ static void die_nmi(const char *str, struct pt_regs *regs, int do_panic) | |||
70 | printk(" on CPU%d, ip %08lx, registers:\n", | 70 | printk(" on CPU%d, ip %08lx, registers:\n", |
71 | smp_processor_id(), regs->tpc); | 71 | smp_processor_id(), regs->tpc); |
72 | show_regs(regs); | 72 | show_regs(regs); |
73 | dump_stack(); | ||
73 | 74 | ||
74 | bust_spinlocks(0); | 75 | bust_spinlocks(0); |
75 | 76 | ||
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c index 92e0dda141a4..1ae8cdd7e703 100644 --- a/arch/sparc/kernel/pcr.c +++ b/arch/sparc/kernel/pcr.c | |||
@@ -133,11 +133,16 @@ int __init pcr_arch_init(void) | |||
133 | 133 | ||
134 | case cheetah: | 134 | case cheetah: |
135 | case cheetah_plus: | 135 | case cheetah_plus: |
136 | case spitfire: | ||
137 | pcr_ops = &direct_pcr_ops; | 136 | pcr_ops = &direct_pcr_ops; |
138 | pcr_enable = PCR_SUN4U_ENABLE; | 137 | pcr_enable = PCR_SUN4U_ENABLE; |
139 | break; | 138 | break; |
140 | 139 | ||
140 | case spitfire: | ||
141 | /* UltraSPARC-I/II and derivatives lack a profile | ||
142 | * counter overflow interrupt so we can't make use of | ||
143 | * their hardware currently. | ||
144 | */ | ||
145 | /* fallthrough */ | ||
141 | default: | 146 | default: |
142 | err = -ENODEV; | 147 | err = -ENODEV; |
143 | goto out_unregister; | 148 | goto out_unregister; |
diff --git a/arch/sparc/lib/GENbzero.S b/arch/sparc/lib/GENbzero.S index 6a4f956a2f7a..8e7a843ddd88 100644 --- a/arch/sparc/lib/GENbzero.S +++ b/arch/sparc/lib/GENbzero.S | |||
@@ -6,13 +6,9 @@ | |||
6 | 6 | ||
7 | #define EX_ST(x,y) \ | 7 | #define EX_ST(x,y) \ |
8 | 98: x,y; \ | 8 | 98: x,y; \ |
9 | .section .fixup; \ | ||
10 | .align 4; \ | ||
11 | 99: retl; \ | ||
12 | mov %o1, %o0; \ | ||
13 | .section __ex_table,"a";\ | 9 | .section __ex_table,"a";\ |
14 | .align 4; \ | 10 | .align 4; \ |
15 | .word 98b, 99b; \ | 11 | .word 98b, __retl_o1; \ |
16 | .text; \ | 12 | .text; \ |
17 | .align 4; | 13 | .align 4; |
18 | 14 | ||
diff --git a/arch/sparc/lib/GENcopy_from_user.S b/arch/sparc/lib/GENcopy_from_user.S index 2b9df99e87f9..b7d0bd6b1406 100644 --- a/arch/sparc/lib/GENcopy_from_user.S +++ b/arch/sparc/lib/GENcopy_from_user.S | |||
@@ -5,13 +5,9 @@ | |||
5 | 5 | ||
6 | #define EX_LD(x) \ | 6 | #define EX_LD(x) \ |
7 | 98: x; \ | 7 | 98: x; \ |
8 | .section .fixup; \ | ||
9 | .align 4; \ | ||
10 | 99: retl; \ | ||
11 | mov 1, %o0; \ | ||
12 | .section __ex_table,"a";\ | 8 | .section __ex_table,"a";\ |
13 | .align 4; \ | 9 | .align 4; \ |
14 | .word 98b, 99b; \ | 10 | .word 98b, __retl_one; \ |
15 | .text; \ | 11 | .text; \ |
16 | .align 4; | 12 | .align 4; |
17 | 13 | ||
@@ -27,7 +23,7 @@ | |||
27 | #define PREAMBLE \ | 23 | #define PREAMBLE \ |
28 | rd %asi, %g1; \ | 24 | rd %asi, %g1; \ |
29 | cmp %g1, ASI_AIUS; \ | 25 | cmp %g1, ASI_AIUS; \ |
30 | bne,pn %icc, memcpy_user_stub; \ | 26 | bne,pn %icc, ___copy_in_user; \ |
31 | nop | 27 | nop |
32 | #endif | 28 | #endif |
33 | 29 | ||
diff --git a/arch/sparc/lib/GENcopy_to_user.S b/arch/sparc/lib/GENcopy_to_user.S index bb3f7084daf9..780550e1afc7 100644 --- a/arch/sparc/lib/GENcopy_to_user.S +++ b/arch/sparc/lib/GENcopy_to_user.S | |||
@@ -5,13 +5,9 @@ | |||
5 | 5 | ||
6 | #define EX_ST(x) \ | 6 | #define EX_ST(x) \ |
7 | 98: x; \ | 7 | 98: x; \ |
8 | .section .fixup; \ | ||
9 | .align 4; \ | ||
10 | 99: retl; \ | ||
11 | mov 1, %o0; \ | ||
12 | .section __ex_table,"a";\ | 8 | .section __ex_table,"a";\ |
13 | .align 4; \ | 9 | .align 4; \ |
14 | .word 98b, 99b; \ | 10 | .word 98b, __retl_one; \ |
15 | .text; \ | 11 | .text; \ |
16 | .align 4; | 12 | .align 4; |
17 | 13 | ||
@@ -31,7 +27,7 @@ | |||
31 | #define PREAMBLE \ | 27 | #define PREAMBLE \ |
32 | rd %asi, %g1; \ | 28 | rd %asi, %g1; \ |
33 | cmp %g1, ASI_AIUS; \ | 29 | cmp %g1, ASI_AIUS; \ |
34 | bne,pn %icc, memcpy_user_stub; \ | 30 | bne,pn %icc, ___copy_in_user; \ |
35 | nop | 31 | nop |
36 | #endif | 32 | #endif |
37 | 33 | ||
diff --git a/arch/sparc/lib/NG2copy_from_user.S b/arch/sparc/lib/NG2copy_from_user.S index c77ef5f22102..119ccb9a54f4 100644 --- a/arch/sparc/lib/NG2copy_from_user.S +++ b/arch/sparc/lib/NG2copy_from_user.S | |||
@@ -5,14 +5,9 @@ | |||
5 | 5 | ||
6 | #define EX_LD(x) \ | 6 | #define EX_LD(x) \ |
7 | 98: x; \ | 7 | 98: x; \ |
8 | .section .fixup; \ | ||
9 | .align 4; \ | ||
10 | 99: wr %g0, ASI_AIUS, %asi;\ | ||
11 | retl; \ | ||
12 | mov 1, %o0; \ | ||
13 | .section __ex_table,"a";\ | 8 | .section __ex_table,"a";\ |
14 | .align 4; \ | 9 | .align 4; \ |
15 | .word 98b, 99b; \ | 10 | .word 98b, __retl_one_asi;\ |
16 | .text; \ | 11 | .text; \ |
17 | .align 4; | 12 | .align 4; |
18 | 13 | ||
@@ -33,7 +28,7 @@ | |||
33 | #define PREAMBLE \ | 28 | #define PREAMBLE \ |
34 | rd %asi, %g1; \ | 29 | rd %asi, %g1; \ |
35 | cmp %g1, ASI_AIUS; \ | 30 | cmp %g1, ASI_AIUS; \ |
36 | bne,pn %icc, memcpy_user_stub; \ | 31 | bne,pn %icc, ___copy_in_user; \ |
37 | nop | 32 | nop |
38 | #endif | 33 | #endif |
39 | 34 | ||
diff --git a/arch/sparc/lib/NG2copy_to_user.S b/arch/sparc/lib/NG2copy_to_user.S index 4bd4093acbbd..7fe1ccefd9d0 100644 --- a/arch/sparc/lib/NG2copy_to_user.S +++ b/arch/sparc/lib/NG2copy_to_user.S | |||
@@ -5,14 +5,9 @@ | |||
5 | 5 | ||
6 | #define EX_ST(x) \ | 6 | #define EX_ST(x) \ |
7 | 98: x; \ | 7 | 98: x; \ |
8 | .section .fixup; \ | ||
9 | .align 4; \ | ||
10 | 99: wr %g0, ASI_AIUS, %asi;\ | ||
11 | retl; \ | ||
12 | mov 1, %o0; \ | ||
13 | .section __ex_table,"a";\ | 8 | .section __ex_table,"a";\ |
14 | .align 4; \ | 9 | .align 4; \ |
15 | .word 98b, 99b; \ | 10 | .word 98b, __retl_one_asi;\ |
16 | .text; \ | 11 | .text; \ |
17 | .align 4; | 12 | .align 4; |
18 | 13 | ||
@@ -42,7 +37,7 @@ | |||
42 | #define PREAMBLE \ | 37 | #define PREAMBLE \ |
43 | rd %asi, %g1; \ | 38 | rd %asi, %g1; \ |
44 | cmp %g1, ASI_AIUS; \ | 39 | cmp %g1, ASI_AIUS; \ |
45 | bne,pn %icc, memcpy_user_stub; \ | 40 | bne,pn %icc, ___copy_in_user; \ |
46 | nop | 41 | nop |
47 | #endif | 42 | #endif |
48 | 43 | ||
diff --git a/arch/sparc/lib/NGbzero.S b/arch/sparc/lib/NGbzero.S index 814d5f7a45e1..beab29bf419b 100644 --- a/arch/sparc/lib/NGbzero.S +++ b/arch/sparc/lib/NGbzero.S | |||
@@ -6,13 +6,9 @@ | |||
6 | 6 | ||
7 | #define EX_ST(x,y) \ | 7 | #define EX_ST(x,y) \ |
8 | 98: x,y; \ | 8 | 98: x,y; \ |
9 | .section .fixup; \ | ||
10 | .align 4; \ | ||
11 | 99: retl; \ | ||
12 | mov %o1, %o0; \ | ||
13 | .section __ex_table,"a";\ | 9 | .section __ex_table,"a";\ |
14 | .align 4; \ | 10 | .align 4; \ |
15 | .word 98b, 99b; \ | 11 | .word 98b, __retl_o1; \ |
16 | .text; \ | 12 | .text; \ |
17 | .align 4; | 13 | .align 4; |
18 | 14 | ||
diff --git a/arch/sparc/lib/NGcopy_from_user.S b/arch/sparc/lib/NGcopy_from_user.S index e7f433f71b42..5d1e4d1ac21e 100644 --- a/arch/sparc/lib/NGcopy_from_user.S +++ b/arch/sparc/lib/NGcopy_from_user.S | |||
@@ -5,14 +5,9 @@ | |||
5 | 5 | ||
6 | #define EX_LD(x) \ | 6 | #define EX_LD(x) \ |
7 | 98: x; \ | 7 | 98: x; \ |
8 | .section .fixup; \ | ||
9 | .align 4; \ | ||
10 | 99: wr %g0, ASI_AIUS, %asi;\ | ||
11 | ret; \ | ||
12 | restore %g0, 1, %o0; \ | ||
13 | .section __ex_table,"a";\ | 8 | .section __ex_table,"a";\ |
14 | .align 4; \ | 9 | .align 4; \ |
15 | .word 98b, 99b; \ | 10 | .word 98b, __ret_one_asi;\ |
16 | .text; \ | 11 | .text; \ |
17 | .align 4; | 12 | .align 4; |
18 | 13 | ||
@@ -30,7 +25,7 @@ | |||
30 | #define PREAMBLE \ | 25 | #define PREAMBLE \ |
31 | rd %asi, %g1; \ | 26 | rd %asi, %g1; \ |
32 | cmp %g1, ASI_AIUS; \ | 27 | cmp %g1, ASI_AIUS; \ |
33 | bne,pn %icc, memcpy_user_stub; \ | 28 | bne,pn %icc, ___copy_in_user; \ |
34 | nop | 29 | nop |
35 | #endif | 30 | #endif |
36 | 31 | ||
diff --git a/arch/sparc/lib/NGcopy_to_user.S b/arch/sparc/lib/NGcopy_to_user.S index 6ea01c5532a0..ff630dcb273c 100644 --- a/arch/sparc/lib/NGcopy_to_user.S +++ b/arch/sparc/lib/NGcopy_to_user.S | |||
@@ -5,14 +5,9 @@ | |||
5 | 5 | ||
6 | #define EX_ST(x) \ | 6 | #define EX_ST(x) \ |
7 | 98: x; \ | 7 | 98: x; \ |
8 | .section .fixup; \ | ||
9 | .align 4; \ | ||
10 | 99: wr %g0, ASI_AIUS, %asi;\ | ||
11 | ret; \ | ||
12 | restore %g0, 1, %o0; \ | ||
13 | .section __ex_table,"a";\ | 8 | .section __ex_table,"a";\ |
14 | .align 4; \ | 9 | .align 4; \ |
15 | .word 98b, 99b; \ | 10 | .word 98b, __ret_one_asi;\ |
16 | .text; \ | 11 | .text; \ |
17 | .align 4; | 12 | .align 4; |
18 | 13 | ||
@@ -33,7 +28,7 @@ | |||
33 | #define PREAMBLE \ | 28 | #define PREAMBLE \ |
34 | rd %asi, %g1; \ | 29 | rd %asi, %g1; \ |
35 | cmp %g1, ASI_AIUS; \ | 30 | cmp %g1, ASI_AIUS; \ |
36 | bne,pn %icc, memcpy_user_stub; \ | 31 | bne,pn %icc, ___copy_in_user; \ |
37 | nop | 32 | nop |
38 | #endif | 33 | #endif |
39 | 34 | ||
diff --git a/arch/sparc/lib/U1copy_from_user.S b/arch/sparc/lib/U1copy_from_user.S index 3192b0bf4fab..a6ae2ea04bf5 100644 --- a/arch/sparc/lib/U1copy_from_user.S +++ b/arch/sparc/lib/U1copy_from_user.S | |||
@@ -5,13 +5,9 @@ | |||
5 | 5 | ||
6 | #define EX_LD(x) \ | 6 | #define EX_LD(x) \ |
7 | 98: x; \ | 7 | 98: x; \ |
8 | .section .fixup; \ | ||
9 | .align 4; \ | ||
10 | 99: retl; \ | ||
11 | mov 1, %o0; \ | ||
12 | .section __ex_table,"a";\ | 8 | .section __ex_table,"a";\ |
13 | .align 4; \ | 9 | .align 4; \ |
14 | .word 98b, 99b; \ | 10 | .word 98b, __retl_one; \ |
15 | .text; \ | 11 | .text; \ |
16 | .align 4; | 12 | .align 4; |
17 | 13 | ||
@@ -27,7 +23,7 @@ | |||
27 | #define PREAMBLE \ | 23 | #define PREAMBLE \ |
28 | rd %asi, %g1; \ | 24 | rd %asi, %g1; \ |
29 | cmp %g1, ASI_AIUS; \ | 25 | cmp %g1, ASI_AIUS; \ |
30 | bne,pn %icc, memcpy_user_stub; \ | 26 | bne,pn %icc, ___copy_in_user; \ |
31 | nop; \ | 27 | nop; \ |
32 | 28 | ||
33 | #include "U1memcpy.S" | 29 | #include "U1memcpy.S" |
diff --git a/arch/sparc/lib/U1copy_to_user.S b/arch/sparc/lib/U1copy_to_user.S index d1210ffb0b82..f4b970eeb485 100644 --- a/arch/sparc/lib/U1copy_to_user.S +++ b/arch/sparc/lib/U1copy_to_user.S | |||
@@ -5,13 +5,9 @@ | |||
5 | 5 | ||
6 | #define EX_ST(x) \ | 6 | #define EX_ST(x) \ |
7 | 98: x; \ | 7 | 98: x; \ |
8 | .section .fixup; \ | ||
9 | .align 4; \ | ||
10 | 99: retl; \ | ||
11 | mov 1, %o0; \ | ||
12 | .section __ex_table,"a";\ | 8 | .section __ex_table,"a";\ |
13 | .align 4; \ | 9 | .align 4; \ |
14 | .word 98b, 99b; \ | 10 | .word 98b, __retl_one; \ |
15 | .text; \ | 11 | .text; \ |
16 | .align 4; | 12 | .align 4; |
17 | 13 | ||
@@ -27,7 +23,7 @@ | |||
27 | #define PREAMBLE \ | 23 | #define PREAMBLE \ |
28 | rd %asi, %g1; \ | 24 | rd %asi, %g1; \ |
29 | cmp %g1, ASI_AIUS; \ | 25 | cmp %g1, ASI_AIUS; \ |
30 | bne,pn %icc, memcpy_user_stub; \ | 26 | bne,pn %icc, ___copy_in_user; \ |
31 | nop; \ | 27 | nop; \ |
32 | 28 | ||
33 | #include "U1memcpy.S" | 29 | #include "U1memcpy.S" |
diff --git a/arch/sparc/lib/U3copy_from_user.S b/arch/sparc/lib/U3copy_from_user.S index f5bfc8d9d216..b1acd1331c33 100644 --- a/arch/sparc/lib/U3copy_from_user.S +++ b/arch/sparc/lib/U3copy_from_user.S | |||
@@ -5,13 +5,9 @@ | |||
5 | 5 | ||
6 | #define EX_LD(x) \ | 6 | #define EX_LD(x) \ |
7 | 98: x; \ | 7 | 98: x; \ |
8 | .section .fixup; \ | ||
9 | .align 4; \ | ||
10 | 99: retl; \ | ||
11 | mov 1, %o0; \ | ||
12 | .section __ex_table,"a";\ | 8 | .section __ex_table,"a";\ |
13 | .align 4; \ | 9 | .align 4; \ |
14 | .word 98b, 99b; \ | 10 | .word 98b, __retl_one; \ |
15 | .text; \ | 11 | .text; \ |
16 | .align 4; | 12 | .align 4; |
17 | 13 | ||
diff --git a/arch/sparc/lib/U3copy_to_user.S b/arch/sparc/lib/U3copy_to_user.S index 2334f111bb0c..ef1e493afdfa 100644 --- a/arch/sparc/lib/U3copy_to_user.S +++ b/arch/sparc/lib/U3copy_to_user.S | |||
@@ -5,13 +5,9 @@ | |||
5 | 5 | ||
6 | #define EX_ST(x) \ | 6 | #define EX_ST(x) \ |
7 | 98: x; \ | 7 | 98: x; \ |
8 | .section .fixup; \ | ||
9 | .align 4; \ | ||
10 | 99: retl; \ | ||
11 | mov 1, %o0; \ | ||
12 | .section __ex_table,"a";\ | 8 | .section __ex_table,"a";\ |
13 | .align 4; \ | 9 | .align 4; \ |
14 | .word 98b, 99b; \ | 10 | .word 98b, __retl_one; \ |
15 | .text; \ | 11 | .text; \ |
16 | .align 4; | 12 | .align 4; |
17 | 13 | ||
@@ -27,7 +23,7 @@ | |||
27 | #define PREAMBLE \ | 23 | #define PREAMBLE \ |
28 | rd %asi, %g1; \ | 24 | rd %asi, %g1; \ |
29 | cmp %g1, ASI_AIUS; \ | 25 | cmp %g1, ASI_AIUS; \ |
30 | bne,pn %icc, memcpy_user_stub; \ | 26 | bne,pn %icc, ___copy_in_user; \ |
31 | nop; \ | 27 | nop; \ |
32 | 28 | ||
33 | #include "U3memcpy.S" | 29 | #include "U3memcpy.S" |
diff --git a/arch/sparc/lib/bzero.S b/arch/sparc/lib/bzero.S index c7bbae8c590f..b6557297440f 100644 --- a/arch/sparc/lib/bzero.S +++ b/arch/sparc/lib/bzero.S | |||
@@ -88,13 +88,9 @@ __bzero_done: | |||
88 | 88 | ||
89 | #define EX_ST(x,y) \ | 89 | #define EX_ST(x,y) \ |
90 | 98: x,y; \ | 90 | 98: x,y; \ |
91 | .section .fixup; \ | ||
92 | .align 4; \ | ||
93 | 99: retl; \ | ||
94 | mov %o1, %o0; \ | ||
95 | .section __ex_table,"a";\ | 91 | .section __ex_table,"a";\ |
96 | .align 4; \ | 92 | .align 4; \ |
97 | .word 98b, 99b; \ | 93 | .word 98b, __retl_o1; \ |
98 | .text; \ | 94 | .text; \ |
99 | .align 4; | 95 | .align 4; |
100 | 96 | ||
diff --git a/arch/sparc/lib/copy_in_user.S b/arch/sparc/lib/copy_in_user.S index 650af3f21f78..302c0e60dc2c 100644 --- a/arch/sparc/lib/copy_in_user.S +++ b/arch/sparc/lib/copy_in_user.S | |||
@@ -3,19 +3,16 @@ | |||
3 | * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com) | 3 | * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com) |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <linux/linkage.h> | ||
6 | #include <asm/asi.h> | 7 | #include <asm/asi.h> |
7 | 8 | ||
8 | #define XCC xcc | 9 | #define XCC xcc |
9 | 10 | ||
10 | #define EX(x,y) \ | 11 | #define EX(x,y) \ |
11 | 98: x,y; \ | 12 | 98: x,y; \ |
12 | .section .fixup; \ | ||
13 | .align 4; \ | ||
14 | 99: retl; \ | ||
15 | mov 1, %o0; \ | ||
16 | .section __ex_table,"a";\ | 13 | .section __ex_table,"a";\ |
17 | .align 4; \ | 14 | .align 4; \ |
18 | .word 98b, 99b; \ | 15 | .word 98b, __retl_one; \ |
19 | .text; \ | 16 | .text; \ |
20 | .align 4; | 17 | .align 4; |
21 | 18 | ||
@@ -31,18 +28,7 @@ | |||
31 | * to copy register windows around during thread cloning. | 28 | * to copy register windows around during thread cloning. |
32 | */ | 29 | */ |
33 | 30 | ||
34 | .globl ___copy_in_user | 31 | ENTRY(___copy_in_user) /* %o0=dst, %o1=src, %o2=len */ |
35 | .type ___copy_in_user,#function | ||
36 | ___copy_in_user: /* %o0=dst, %o1=src, %o2=len */ | ||
37 | /* Writing to %asi is _expensive_ so we hardcode it. | ||
38 | * Reading %asi to check for KERNEL_DS is comparatively | ||
39 | * cheap. | ||
40 | */ | ||
41 | rd %asi, %g1 | ||
42 | cmp %g1, ASI_AIUS | ||
43 | bne,pn %icc, memcpy_user_stub | ||
44 | nop | ||
45 | |||
46 | cmp %o2, 0 | 32 | cmp %o2, 0 |
47 | be,pn %XCC, 85f | 33 | be,pn %XCC, 85f |
48 | or %o0, %o1, %o3 | 34 | or %o0, %o1, %o3 |
@@ -53,22 +39,24 @@ ___copy_in_user: /* %o0=dst, %o1=src, %o2=len */ | |||
53 | /* 16 < len <= 64 */ | 39 | /* 16 < len <= 64 */ |
54 | andcc %o3, 0x7, %g0 | 40 | andcc %o3, 0x7, %g0 |
55 | bne,pn %XCC, 90f | 41 | bne,pn %XCC, 90f |
56 | sub %o0, %o1, %o3 | 42 | nop |
57 | 43 | ||
58 | andn %o2, 0x7, %o4 | 44 | andn %o2, 0x7, %o4 |
59 | and %o2, 0x7, %o2 | 45 | and %o2, 0x7, %o2 |
60 | 1: subcc %o4, 0x8, %o4 | 46 | 1: subcc %o4, 0x8, %o4 |
61 | EX(ldxa [%o1] %asi, %o5) | 47 | EX(ldxa [%o1] %asi, %o5) |
62 | EX(stxa %o5, [%o1 + %o3] ASI_AIUS) | 48 | EX(stxa %o5, [%o0] %asi) |
49 | add %o1, 0x8, %o1 | ||
63 | bgu,pt %XCC, 1b | 50 | bgu,pt %XCC, 1b |
64 | add %o1, 0x8, %o1 | 51 | add %o0, 0x8, %o0 |
65 | andcc %o2, 0x4, %g0 | 52 | andcc %o2, 0x4, %g0 |
66 | be,pt %XCC, 1f | 53 | be,pt %XCC, 1f |
67 | nop | 54 | nop |
68 | sub %o2, 0x4, %o2 | 55 | sub %o2, 0x4, %o2 |
69 | EX(lduwa [%o1] %asi, %o5) | 56 | EX(lduwa [%o1] %asi, %o5) |
70 | EX(stwa %o5, [%o1 + %o3] ASI_AIUS) | 57 | EX(stwa %o5, [%o0] %asi) |
71 | add %o1, 0x4, %o1 | 58 | add %o1, 0x4, %o1 |
59 | add %o0, 0x4, %o0 | ||
72 | 1: cmp %o2, 0 | 60 | 1: cmp %o2, 0 |
73 | be,pt %XCC, 85f | 61 | be,pt %XCC, 85f |
74 | nop | 62 | nop |
@@ -78,14 +66,15 @@ ___copy_in_user: /* %o0=dst, %o1=src, %o2=len */ | |||
78 | 80: /* 0 < len <= 16 */ | 66 | 80: /* 0 < len <= 16 */ |
79 | andcc %o3, 0x3, %g0 | 67 | andcc %o3, 0x3, %g0 |
80 | bne,pn %XCC, 90f | 68 | bne,pn %XCC, 90f |
81 | sub %o0, %o1, %o3 | 69 | nop |
82 | 70 | ||
83 | 82: | 71 | 82: |
84 | subcc %o2, 4, %o2 | 72 | subcc %o2, 4, %o2 |
85 | EX(lduwa [%o1] %asi, %g1) | 73 | EX(lduwa [%o1] %asi, %g1) |
86 | EX(stwa %g1, [%o1 + %o3] ASI_AIUS) | 74 | EX(stwa %g1, [%o0] %asi) |
75 | add %o1, 4, %o1 | ||
87 | bgu,pt %XCC, 82b | 76 | bgu,pt %XCC, 82b |
88 | add %o1, 4, %o1 | 77 | add %o0, 4, %o0 |
89 | 78 | ||
90 | 85: retl | 79 | 85: retl |
91 | clr %o0 | 80 | clr %o0 |
@@ -94,26 +83,10 @@ ___copy_in_user: /* %o0=dst, %o1=src, %o2=len */ | |||
94 | 90: | 83 | 90: |
95 | subcc %o2, 1, %o2 | 84 | subcc %o2, 1, %o2 |
96 | EX(lduba [%o1] %asi, %g1) | 85 | EX(lduba [%o1] %asi, %g1) |
97 | EX(stba %g1, [%o1 + %o3] ASI_AIUS) | 86 | EX(stba %g1, [%o0] %asi) |
87 | add %o1, 1, %o1 | ||
98 | bgu,pt %XCC, 90b | 88 | bgu,pt %XCC, 90b |
99 | add %o1, 1, %o1 | 89 | add %o0, 1, %o0 |
100 | retl | 90 | retl |
101 | clr %o0 | 91 | clr %o0 |
102 | 92 | ENDPROC(___copy_in_user) | |
103 | .size ___copy_in_user, .-___copy_in_user | ||
104 | |||
105 | /* Act like copy_{to,in}_user(), ie. return zero instead | ||
106 | * of original destination pointer. This is invoked when | ||
107 | * copy_{to,in}_user() finds that %asi is kernel space. | ||
108 | */ | ||
109 | .globl memcpy_user_stub | ||
110 | .type memcpy_user_stub,#function | ||
111 | memcpy_user_stub: | ||
112 | save %sp, -192, %sp | ||
113 | mov %i0, %o0 | ||
114 | mov %i1, %o1 | ||
115 | call memcpy | ||
116 | mov %i2, %o2 | ||
117 | ret | ||
118 | restore %g0, %g0, %o0 | ||
119 | .size memcpy_user_stub, .-memcpy_user_stub | ||
diff --git a/arch/um/drivers/vde_user.c b/arch/um/drivers/vde_user.c index 56533db25343..c5c43253e6ce 100644 --- a/arch/um/drivers/vde_user.c +++ b/arch/um/drivers/vde_user.c | |||
@@ -78,7 +78,7 @@ void vde_init_libstuff(struct vde_data *vpri, struct vde_init *init) | |||
78 | { | 78 | { |
79 | struct vde_open_args *args; | 79 | struct vde_open_args *args; |
80 | 80 | ||
81 | vpri->args = kmalloc(sizeof(struct vde_open_args), UM_GFP_KERNEL); | 81 | vpri->args = uml_kmalloc(sizeof(struct vde_open_args), UM_GFP_KERNEL); |
82 | if (vpri->args == NULL) { | 82 | if (vpri->args == NULL) { |
83 | printk(UM_KERN_ERR "vde_init_libstuff - vde_open_args " | 83 | printk(UM_KERN_ERR "vde_init_libstuff - vde_open_args " |
84 | "allocation failed"); | 84 | "allocation failed"); |
@@ -91,8 +91,8 @@ void vde_init_libstuff(struct vde_data *vpri, struct vde_init *init) | |||
91 | args->group = init->group; | 91 | args->group = init->group; |
92 | args->mode = init->mode ? init->mode : 0700; | 92 | args->mode = init->mode ? init->mode : 0700; |
93 | 93 | ||
94 | args->port ? printk(UM_KERN_INFO "port %d", args->port) : | 94 | args->port ? printk("port %d", args->port) : |
95 | printk(UM_KERN_INFO "undefined port"); | 95 | printk("undefined port"); |
96 | } | 96 | } |
97 | 97 | ||
98 | int vde_user_read(void *conn, void *buf, int len) | 98 | int vde_user_read(void *conn, void *buf, int len) |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 73f7fe8fd4d1..bc2fbadff9f9 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -1802,6 +1802,17 @@ config DMAR | |||
1802 | and include PCI device scope covered by these DMA | 1802 | and include PCI device scope covered by these DMA |
1803 | remapping devices. | 1803 | remapping devices. |
1804 | 1804 | ||
1805 | config DMAR_DEFAULT_ON | ||
1806 | def_bool y | ||
1807 | prompt "Enable DMA Remapping Devices by default" | ||
1808 | depends on DMAR | ||
1809 | help | ||
1810 | Selecting this option will enable a DMAR device at boot time if | ||
1811 | one is found. If this option is not selected, DMAR support can | ||
1812 | be enabled by passing intel_iommu=on to the kernel. It is | ||
1813 | recommended you say N here while the DMAR code remains | ||
1814 | experimental. | ||
1815 | |||
1805 | config DMAR_GFX_WA | 1816 | config DMAR_GFX_WA |
1806 | def_bool y | 1817 | def_bool y |
1807 | prompt "Support for Graphics workaround" | 1818 | prompt "Support for Graphics workaround" |
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu index 8078955845ae..c98d52e82966 100644 --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu | |||
@@ -167,9 +167,9 @@ config MK7 | |||
167 | config MK8 | 167 | config MK8 |
168 | bool "Opteron/Athlon64/Hammer/K8" | 168 | bool "Opteron/Athlon64/Hammer/K8" |
169 | help | 169 | help |
170 | Select this for an AMD Opteron or Athlon64 Hammer-family processor. Enables | 170 | Select this for an AMD Opteron or Athlon64 Hammer-family processor. |
171 | use of some extended instructions, and passes appropriate optimization | 171 | Enables use of some extended instructions, and passes appropriate |
172 | flags to GCC. | 172 | optimization flags to GCC. |
173 | 173 | ||
174 | config MCRUSOE | 174 | config MCRUSOE |
175 | bool "Crusoe" | 175 | bool "Crusoe" |
@@ -256,9 +256,11 @@ config MPSC | |||
256 | config MCORE2 | 256 | config MCORE2 |
257 | bool "Core 2/newer Xeon" | 257 | bool "Core 2/newer Xeon" |
258 | help | 258 | help |
259 | Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and 53xx) | 259 | |
260 | CPUs. You can distinguish newer from older Xeons by the CPU family | 260 | Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and |
261 | in /proc/cpuinfo. Newer ones have 6 and older ones 15 (not a typo) | 261 | 53xx) CPUs. You can distinguish newer from older Xeons by the CPU |
262 | family in /proc/cpuinfo. Newer ones have 6 and older ones 15 | ||
263 | (not a typo) | ||
262 | 264 | ||
263 | config GENERIC_CPU | 265 | config GENERIC_CPU |
264 | bool "Generic-x86-64" | 266 | bool "Generic-x86-64" |
@@ -320,14 +322,14 @@ config X86_PPRO_FENCE | |||
320 | bool "PentiumPro memory ordering errata workaround" | 322 | bool "PentiumPro memory ordering errata workaround" |
321 | depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1 | 323 | depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1 |
322 | help | 324 | help |
323 | Old PentiumPro multiprocessor systems had errata that could cause memory | 325 | Old PentiumPro multiprocessor systems had errata that could cause |
324 | operations to violate the x86 ordering standard in rare cases. Enabling this | 326 | memory operations to violate the x86 ordering standard in rare cases. |
325 | option will attempt to work around some (but not all) occurances of | 327 | Enabling this option will attempt to work around some (but not all) |
326 | this problem, at the cost of much heavier spinlock and memory barrier | 328 | occurances of this problem, at the cost of much heavier spinlock and |
327 | operations. | 329 | memory barrier operations. |
328 | 330 | ||
329 | If unsure, say n here. Even distro kernels should think twice before enabling | 331 | If unsure, say n here. Even distro kernels should think twice before |
330 | this: there are few systems, and an unlikely bug. | 332 | enabling this: there are few systems, and an unlikely bug. |
331 | 333 | ||
332 | config X86_F00F_BUG | 334 | config X86_F00F_BUG |
333 | def_bool y | 335 | def_bool y |
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 10d6cc3fd052..e1983fa025d2 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug | |||
@@ -174,28 +174,8 @@ config IOMMU_LEAK | |||
174 | Add a simple leak tracer to the IOMMU code. This is useful when you | 174 | Add a simple leak tracer to the IOMMU code. This is useful when you |
175 | are debugging a buggy device driver that leaks IOMMU mappings. | 175 | are debugging a buggy device driver that leaks IOMMU mappings. |
176 | 176 | ||
177 | config MMIOTRACE | 177 | config HAVE_MMIOTRACE_SUPPORT |
178 | bool "Memory mapped IO tracing" | 178 | def_bool y |
179 | depends on DEBUG_KERNEL && PCI | ||
180 | select TRACING | ||
181 | help | ||
182 | Mmiotrace traces Memory Mapped I/O access and is meant for | ||
183 | debugging and reverse engineering. It is called from the ioremap | ||
184 | implementation and works via page faults. Tracing is disabled by | ||
185 | default and can be enabled at run-time. | ||
186 | |||
187 | See Documentation/tracers/mmiotrace.txt. | ||
188 | If you are not helping to develop drivers, say N. | ||
189 | |||
190 | config MMIOTRACE_TEST | ||
191 | tristate "Test module for mmiotrace" | ||
192 | depends on MMIOTRACE && m | ||
193 | help | ||
194 | This is a dumb module for testing mmiotrace. It is very dangerous | ||
195 | as it will write garbage to IO memory starting at a given address. | ||
196 | However, it should be safe to use on e.g. unused portion of VRAM. | ||
197 | |||
198 | Say N, unless you absolutely know what you are doing. | ||
199 | 179 | ||
200 | # | 180 | # |
201 | # IO delay types: | 181 | # IO delay types: |
diff --git a/arch/x86/include/asm/a.out-core.h b/arch/x86/include/asm/a.out-core.h index 37822206083e..3c601f8224be 100644 --- a/arch/x86/include/asm/a.out-core.h +++ b/arch/x86/include/asm/a.out-core.h | |||
@@ -23,8 +23,6 @@ | |||
23 | */ | 23 | */ |
24 | static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump) | 24 | static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump) |
25 | { | 25 | { |
26 | u16 gs; | ||
27 | |||
28 | /* changed the size calculations - should hopefully work better. lbt */ | 26 | /* changed the size calculations - should hopefully work better. lbt */ |
29 | dump->magic = CMAGIC; | 27 | dump->magic = CMAGIC; |
30 | dump->start_code = 0; | 28 | dump->start_code = 0; |
@@ -57,7 +55,7 @@ static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump) | |||
57 | dump->regs.ds = (u16)regs->ds; | 55 | dump->regs.ds = (u16)regs->ds; |
58 | dump->regs.es = (u16)regs->es; | 56 | dump->regs.es = (u16)regs->es; |
59 | dump->regs.fs = (u16)regs->fs; | 57 | dump->regs.fs = (u16)regs->fs; |
60 | savesegment(gs, gs); | 58 | savesegment(gs, dump->regs.gs); |
61 | dump->regs.orig_ax = regs->orig_ax; | 59 | dump->regs.orig_ax = regs->orig_ax; |
62 | dump->regs.ip = regs->ip; | 60 | dump->regs.ip = regs->ip; |
63 | dump->regs.cs = (u16)regs->cs; | 61 | dump->regs.cs = (u16)regs->cs; |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index ea408dcba513..7301e60dc4a8 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -93,6 +93,7 @@ | |||
93 | #define X86_FEATURE_XTOPOLOGY (3*32+22) /* cpu topology enum extensions */ | 93 | #define X86_FEATURE_XTOPOLOGY (3*32+22) /* cpu topology enum extensions */ |
94 | #define X86_FEATURE_TSC_RELIABLE (3*32+23) /* TSC is known to be reliable */ | 94 | #define X86_FEATURE_TSC_RELIABLE (3*32+23) /* TSC is known to be reliable */ |
95 | #define X86_FEATURE_NONSTOP_TSC (3*32+24) /* TSC does not stop in C states */ | 95 | #define X86_FEATURE_NONSTOP_TSC (3*32+24) /* TSC does not stop in C states */ |
96 | #define X86_FEATURE_CLFLUSH_MONITOR (3*32+25) /* "" clflush reqd with monitor */ | ||
96 | 97 | ||
97 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 98 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
98 | #define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */ | 99 | #define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */ |
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index ca5ffb2856b6..edc90f23e708 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
@@ -37,8 +37,6 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); | |||
37 | 37 | ||
38 | #else /* !CONFIG_X86_32 */ | 38 | #else /* !CONFIG_X86_32 */ |
39 | 39 | ||
40 | #define MAX_EFI_IO_PAGES 100 | ||
41 | |||
42 | extern u64 efi_call0(void *fp); | 40 | extern u64 efi_call0(void *fp); |
43 | extern u64 efi_call1(void *fp, u64 arg1); | 41 | extern u64 efi_call1(void *fp, u64 arg1); |
44 | extern u64 efi_call2(void *fp, u64 arg1, u64 arg2); | 42 | extern u64 efi_call2(void *fp, u64 arg1, u64 arg2); |
diff --git a/arch/x86/include/asm/fixmap_64.h b/arch/x86/include/asm/fixmap_64.h index 00a30ab9b1a5..8be740977db8 100644 --- a/arch/x86/include/asm/fixmap_64.h +++ b/arch/x86/include/asm/fixmap_64.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <asm/apicdef.h> | 16 | #include <asm/apicdef.h> |
17 | #include <asm/page.h> | 17 | #include <asm/page.h> |
18 | #include <asm/vsyscall.h> | 18 | #include <asm/vsyscall.h> |
19 | #include <asm/efi.h> | ||
20 | 19 | ||
21 | /* | 20 | /* |
22 | * Here we define all the compile-time 'special' virtual | 21 | * Here we define all the compile-time 'special' virtual |
@@ -43,9 +42,6 @@ enum fixed_addresses { | |||
43 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ | 42 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ |
44 | FIX_IO_APIC_BASE_0, | 43 | FIX_IO_APIC_BASE_0, |
45 | FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1, | 44 | FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1, |
46 | FIX_EFI_IO_MAP_LAST_PAGE, | ||
47 | FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE | ||
48 | + MAX_EFI_IO_PAGES - 1, | ||
49 | #ifdef CONFIG_PARAVIRT | 45 | #ifdef CONFIG_PARAVIRT |
50 | FIX_PARAVIRT_BOOTMAP, | 46 | FIX_PARAVIRT_BOOTMAP, |
51 | #endif | 47 | #endif |
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index 48f0004db8c9..71c9e5183982 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h | |||
@@ -172,7 +172,13 @@ static inline void __save_init_fpu(struct task_struct *tsk) | |||
172 | 172 | ||
173 | #else /* CONFIG_X86_32 */ | 173 | #else /* CONFIG_X86_32 */ |
174 | 174 | ||
175 | extern void finit(void); | 175 | #ifdef CONFIG_MATH_EMULATION |
176 | extern void finit_task(struct task_struct *tsk); | ||
177 | #else | ||
178 | static inline void finit_task(struct task_struct *tsk) | ||
179 | { | ||
180 | } | ||
181 | #endif | ||
176 | 182 | ||
177 | static inline void tolerant_fwait(void) | 183 | static inline void tolerant_fwait(void) |
178 | { | 184 | { |
diff --git a/arch/x86/include/asm/iomap.h b/arch/x86/include/asm/iomap.h index c1f06289b14b..86af26091d6c 100644 --- a/arch/x86/include/asm/iomap.h +++ b/arch/x86/include/asm/iomap.h | |||
@@ -23,6 +23,9 @@ | |||
23 | #include <asm/pgtable.h> | 23 | #include <asm/pgtable.h> |
24 | #include <asm/tlbflush.h> | 24 | #include <asm/tlbflush.h> |
25 | 25 | ||
26 | int | ||
27 | is_io_mapping_possible(resource_size_t base, unsigned long size); | ||
28 | |||
26 | void * | 29 | void * |
27 | iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); | 30 | iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); |
28 | 31 | ||
diff --git a/arch/x86/include/asm/kvm.h b/arch/x86/include/asm/kvm.h index d2e3bf3608af..886c9402ec45 100644 --- a/arch/x86/include/asm/kvm.h +++ b/arch/x86/include/asm/kvm.h | |||
@@ -9,6 +9,13 @@ | |||
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <linux/ioctl.h> | 10 | #include <linux/ioctl.h> |
11 | 11 | ||
12 | /* Select x86 specific features in <linux/kvm.h> */ | ||
13 | #define __KVM_HAVE_PIT | ||
14 | #define __KVM_HAVE_IOAPIC | ||
15 | #define __KVM_HAVE_DEVICE_ASSIGNMENT | ||
16 | #define __KVM_HAVE_MSI | ||
17 | #define __KVM_HAVE_USER_NMI | ||
18 | |||
12 | /* Architectural interrupt line count. */ | 19 | /* Architectural interrupt line count. */ |
13 | #define KVM_NR_INTERRUPTS 256 | 20 | #define KVM_NR_INTERRUPTS 256 |
14 | 21 | ||
diff --git a/arch/x86/include/asm/math_emu.h b/arch/x86/include/asm/math_emu.h index 5a65b107ad58..031f6266f425 100644 --- a/arch/x86/include/asm/math_emu.h +++ b/arch/x86/include/asm/math_emu.h | |||
@@ -1,31 +1,18 @@ | |||
1 | #ifndef _ASM_X86_MATH_EMU_H | 1 | #ifndef _ASM_X86_MATH_EMU_H |
2 | #define _ASM_X86_MATH_EMU_H | 2 | #define _ASM_X86_MATH_EMU_H |
3 | 3 | ||
4 | #include <asm/ptrace.h> | ||
5 | #include <asm/vm86.h> | ||
6 | |||
4 | /* This structure matches the layout of the data saved to the stack | 7 | /* This structure matches the layout of the data saved to the stack |
5 | following a device-not-present interrupt, part of it saved | 8 | following a device-not-present interrupt, part of it saved |
6 | automatically by the 80386/80486. | 9 | automatically by the 80386/80486. |
7 | */ | 10 | */ |
8 | struct info { | 11 | struct math_emu_info { |
9 | long ___orig_eip; | 12 | long ___orig_eip; |
10 | long ___ebx; | 13 | union { |
11 | long ___ecx; | 14 | struct pt_regs *regs; |
12 | long ___edx; | 15 | struct kernel_vm86_regs *vm86; |
13 | long ___esi; | 16 | }; |
14 | long ___edi; | ||
15 | long ___ebp; | ||
16 | long ___eax; | ||
17 | long ___ds; | ||
18 | long ___es; | ||
19 | long ___fs; | ||
20 | long ___orig_eax; | ||
21 | long ___eip; | ||
22 | long ___cs; | ||
23 | long ___eflags; | ||
24 | long ___esp; | ||
25 | long ___ss; | ||
26 | long ___vm86_es; /* This and the following only in vm86 mode */ | ||
27 | long ___vm86_ds; | ||
28 | long ___vm86_fs; | ||
29 | long ___vm86_gs; | ||
30 | }; | 17 | }; |
31 | #endif /* _ASM_X86_MATH_EMU_H */ | 18 | #endif /* _ASM_X86_MATH_EMU_H */ |
diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index 07f1af494ca5..105fb90a0635 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h | |||
@@ -32,8 +32,6 @@ static inline void get_memcfg_numa(void) | |||
32 | get_memcfg_numa_flat(); | 32 | get_memcfg_numa_flat(); |
33 | } | 33 | } |
34 | 34 | ||
35 | extern int early_pfn_to_nid(unsigned long pfn); | ||
36 | |||
37 | extern void resume_map_numa_kva(pgd_t *pgd); | 35 | extern void resume_map_numa_kva(pgd_t *pgd); |
38 | 36 | ||
39 | #else /* !CONFIG_NUMA */ | 37 | #else /* !CONFIG_NUMA */ |
diff --git a/arch/x86/include/asm/mmzone_64.h b/arch/x86/include/asm/mmzone_64.h index a5b3817d4b9e..a29f48c2a322 100644 --- a/arch/x86/include/asm/mmzone_64.h +++ b/arch/x86/include/asm/mmzone_64.h | |||
@@ -40,8 +40,6 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) | |||
40 | #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ | 40 | #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ |
41 | NODE_DATA(nid)->node_spanned_pages) | 41 | NODE_DATA(nid)->node_spanned_pages) |
42 | 42 | ||
43 | extern int early_pfn_to_nid(unsigned long pfn); | ||
44 | |||
45 | #ifdef CONFIG_NUMA_EMU | 43 | #ifdef CONFIG_NUMA_EMU |
46 | #define FAKE_NODE_MIN_SIZE (64 * 1024 * 1024) | 44 | #define FAKE_NODE_MIN_SIZE (64 * 1024 * 1024) |
47 | #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) | 45 | #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) |
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index 62d14ce3cd00..bd22f2a3713f 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h | |||
@@ -60,6 +60,7 @@ extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, | |||
60 | u32 gsi); | 60 | u32 gsi); |
61 | extern void mp_config_acpi_legacy_irqs(void); | 61 | extern void mp_config_acpi_legacy_irqs(void); |
62 | extern int mp_register_gsi(u32 gsi, int edge_level, int active_high_low); | 62 | extern int mp_register_gsi(u32 gsi, int edge_level, int active_high_low); |
63 | extern int acpi_probe_gsi(void); | ||
63 | #ifdef CONFIG_X86_IO_APIC | 64 | #ifdef CONFIG_X86_IO_APIC |
64 | extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, | 65 | extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, |
65 | u32 gsi, int triggering, int polarity); | 66 | u32 gsi, int triggering, int polarity); |
@@ -71,6 +72,11 @@ mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, | |||
71 | return 0; | 72 | return 0; |
72 | } | 73 | } |
73 | #endif | 74 | #endif |
75 | #else /* !CONFIG_ACPI: */ | ||
76 | static inline int acpi_probe_gsi(void) | ||
77 | { | ||
78 | return 0; | ||
79 | } | ||
74 | #endif /* CONFIG_ACPI */ | 80 | #endif /* CONFIG_ACPI */ |
75 | 81 | ||
76 | #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS) | 82 | #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS) |
diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h index e9873a2e8695..776579119a00 100644 --- a/arch/x86/include/asm/page.h +++ b/arch/x86/include/asm/page.h | |||
@@ -57,7 +57,6 @@ typedef struct { pgdval_t pgd; } pgd_t; | |||
57 | typedef struct { pgprotval_t pgprot; } pgprot_t; | 57 | typedef struct { pgprotval_t pgprot; } pgprot_t; |
58 | 58 | ||
59 | extern int page_is_ram(unsigned long pagenr); | 59 | extern int page_is_ram(unsigned long pagenr); |
60 | extern int pagerange_is_ram(unsigned long start, unsigned long end); | ||
61 | extern int devmem_is_allowed(unsigned long pagenr); | 60 | extern int devmem_is_allowed(unsigned long pagenr); |
62 | extern void map_devmem(unsigned long pfn, unsigned long size, | 61 | extern void map_devmem(unsigned long pfn, unsigned long size, |
63 | pgprot_t vma_prot); | 62 | pgprot_t vma_prot); |
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index ba3e2ff6aedc..e299287e8e33 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h | |||
@@ -1352,14 +1352,7 @@ static inline void arch_leave_lazy_cpu_mode(void) | |||
1352 | PVOP_VCALL0(pv_cpu_ops.lazy_mode.leave); | 1352 | PVOP_VCALL0(pv_cpu_ops.lazy_mode.leave); |
1353 | } | 1353 | } |
1354 | 1354 | ||
1355 | static inline void arch_flush_lazy_cpu_mode(void) | 1355 | void arch_flush_lazy_cpu_mode(void); |
1356 | { | ||
1357 | if (unlikely(paravirt_get_lazy_mode() == PARAVIRT_LAZY_CPU)) { | ||
1358 | arch_leave_lazy_cpu_mode(); | ||
1359 | arch_enter_lazy_cpu_mode(); | ||
1360 | } | ||
1361 | } | ||
1362 | |||
1363 | 1356 | ||
1364 | #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE | 1357 | #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE |
1365 | static inline void arch_enter_lazy_mmu_mode(void) | 1358 | static inline void arch_enter_lazy_mmu_mode(void) |
@@ -1372,13 +1365,7 @@ static inline void arch_leave_lazy_mmu_mode(void) | |||
1372 | PVOP_VCALL0(pv_mmu_ops.lazy_mode.leave); | 1365 | PVOP_VCALL0(pv_mmu_ops.lazy_mode.leave); |
1373 | } | 1366 | } |
1374 | 1367 | ||
1375 | static inline void arch_flush_lazy_mmu_mode(void) | 1368 | void arch_flush_lazy_mmu_mode(void); |
1376 | { | ||
1377 | if (unlikely(paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU)) { | ||
1378 | arch_leave_lazy_mmu_mode(); | ||
1379 | arch_enter_lazy_mmu_mode(); | ||
1380 | } | ||
1381 | } | ||
1382 | 1369 | ||
1383 | static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx, | 1370 | static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx, |
1384 | unsigned long phys, pgprot_t flags) | 1371 | unsigned long phys, pgprot_t flags) |
@@ -1402,6 +1389,7 @@ static inline int __raw_spin_is_contended(struct raw_spinlock *lock) | |||
1402 | { | 1389 | { |
1403 | return PVOP_CALL1(int, pv_lock_ops.spin_is_contended, lock); | 1390 | return PVOP_CALL1(int, pv_lock_ops.spin_is_contended, lock); |
1404 | } | 1391 | } |
1392 | #define __raw_spin_is_contended __raw_spin_is_contended | ||
1405 | 1393 | ||
1406 | static __always_inline void __raw_spin_lock(struct raw_spinlock *lock) | 1394 | static __always_inline void __raw_spin_lock(struct raw_spinlock *lock) |
1407 | { | 1395 | { |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 06bbcbd66e9c..4f5af8447d54 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -302,16 +302,30 @@ static inline pte_t pte_mkspecial(pte_t pte) | |||
302 | 302 | ||
303 | extern pteval_t __supported_pte_mask; | 303 | extern pteval_t __supported_pte_mask; |
304 | 304 | ||
305 | /* | ||
306 | * Mask out unsupported bits in a present pgprot. Non-present pgprots | ||
307 | * can use those bits for other purposes, so leave them be. | ||
308 | */ | ||
309 | static inline pgprotval_t massage_pgprot(pgprot_t pgprot) | ||
310 | { | ||
311 | pgprotval_t protval = pgprot_val(pgprot); | ||
312 | |||
313 | if (protval & _PAGE_PRESENT) | ||
314 | protval &= __supported_pte_mask; | ||
315 | |||
316 | return protval; | ||
317 | } | ||
318 | |||
305 | static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) | 319 | static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) |
306 | { | 320 | { |
307 | return __pte((((phys_addr_t)page_nr << PAGE_SHIFT) | | 321 | return __pte(((phys_addr_t)page_nr << PAGE_SHIFT) | |
308 | pgprot_val(pgprot)) & __supported_pte_mask); | 322 | massage_pgprot(pgprot)); |
309 | } | 323 | } |
310 | 324 | ||
311 | static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot) | 325 | static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot) |
312 | { | 326 | { |
313 | return __pmd((((phys_addr_t)page_nr << PAGE_SHIFT) | | 327 | return __pmd(((phys_addr_t)page_nr << PAGE_SHIFT) | |
314 | pgprot_val(pgprot)) & __supported_pte_mask); | 328 | massage_pgprot(pgprot)); |
315 | } | 329 | } |
316 | 330 | ||
317 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 331 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
@@ -323,7 +337,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
323 | * the newprot (if present): | 337 | * the newprot (if present): |
324 | */ | 338 | */ |
325 | val &= _PAGE_CHG_MASK; | 339 | val &= _PAGE_CHG_MASK; |
326 | val |= pgprot_val(newprot) & (~_PAGE_CHG_MASK) & __supported_pte_mask; | 340 | val |= massage_pgprot(newprot) & ~_PAGE_CHG_MASK; |
327 | 341 | ||
328 | return __pte(val); | 342 | return __pte(val); |
329 | } | 343 | } |
@@ -339,7 +353,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) | |||
339 | 353 | ||
340 | #define pte_pgprot(x) __pgprot(pte_flags(x) & PTE_FLAGS_MASK) | 354 | #define pte_pgprot(x) __pgprot(pte_flags(x) & PTE_FLAGS_MASK) |
341 | 355 | ||
342 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) | 356 | #define canon_pgprot(p) __pgprot(massage_pgprot(p)) |
343 | 357 | ||
344 | static inline int is_new_memtype_allowed(unsigned long flags, | 358 | static inline int is_new_memtype_allowed(unsigned long flags, |
345 | unsigned long new_flags) | 359 | unsigned long new_flags) |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 091cd8855f2e..3bfd5235a9eb 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -353,7 +353,7 @@ struct i387_soft_struct { | |||
353 | u8 no_update; | 353 | u8 no_update; |
354 | u8 rm; | 354 | u8 rm; |
355 | u8 alimit; | 355 | u8 alimit; |
356 | struct info *info; | 356 | struct math_emu_info *info; |
357 | u32 entry_eip; | 357 | u32 entry_eip; |
358 | }; | 358 | }; |
359 | 359 | ||
diff --git a/arch/x86/include/asm/seccomp_32.h b/arch/x86/include/asm/seccomp_32.h index a6ad87b352c4..b811d6f5780c 100644 --- a/arch/x86/include/asm/seccomp_32.h +++ b/arch/x86/include/asm/seccomp_32.h | |||
@@ -1,12 +1,6 @@ | |||
1 | #ifndef _ASM_X86_SECCOMP_32_H | 1 | #ifndef _ASM_X86_SECCOMP_32_H |
2 | #define _ASM_X86_SECCOMP_32_H | 2 | #define _ASM_X86_SECCOMP_32_H |
3 | 3 | ||
4 | #include <linux/thread_info.h> | ||
5 | |||
6 | #ifdef TIF_32BIT | ||
7 | #error "unexpected TIF_32BIT on i386" | ||
8 | #endif | ||
9 | |||
10 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
11 | 5 | ||
12 | #define __NR_seccomp_read __NR_read | 6 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/x86/include/asm/seccomp_64.h b/arch/x86/include/asm/seccomp_64.h index 4171bb794e9e..84ec1bd161a5 100644 --- a/arch/x86/include/asm/seccomp_64.h +++ b/arch/x86/include/asm/seccomp_64.h | |||
@@ -1,14 +1,6 @@ | |||
1 | #ifndef _ASM_X86_SECCOMP_64_H | 1 | #ifndef _ASM_X86_SECCOMP_64_H |
2 | #define _ASM_X86_SECCOMP_64_H | 2 | #define _ASM_X86_SECCOMP_64_H |
3 | 3 | ||
4 | #include <linux/thread_info.h> | ||
5 | |||
6 | #ifdef TIF_32BIT | ||
7 | #error "unexpected TIF_32BIT on x86_64" | ||
8 | #else | ||
9 | #define TIF_32BIT TIF_IA32 | ||
10 | #endif | ||
11 | |||
12 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
13 | #include <asm/ia32_unistd.h> | 5 | #include <asm/ia32_unistd.h> |
14 | 6 | ||
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index d17c91981da2..8247e94ac6b1 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h | |||
@@ -245,6 +245,7 @@ static inline int __raw_spin_is_contended(raw_spinlock_t *lock) | |||
245 | { | 245 | { |
246 | return __ticket_spin_is_contended(lock); | 246 | return __ticket_spin_is_contended(lock); |
247 | } | 247 | } |
248 | #define __raw_spin_is_contended __raw_spin_is_contended | ||
248 | 249 | ||
249 | static __always_inline void __raw_spin_lock(raw_spinlock_t *lock) | 250 | static __always_inline void __raw_spin_lock(raw_spinlock_t *lock) |
250 | { | 251 | { |
diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h index 2ee0a3bceedf..cf3bb053da0b 100644 --- a/arch/x86/include/asm/traps.h +++ b/arch/x86/include/asm/traps.h | |||
@@ -41,7 +41,7 @@ dotraplinkage void do_int3(struct pt_regs *, long); | |||
41 | dotraplinkage void do_overflow(struct pt_regs *, long); | 41 | dotraplinkage void do_overflow(struct pt_regs *, long); |
42 | dotraplinkage void do_bounds(struct pt_regs *, long); | 42 | dotraplinkage void do_bounds(struct pt_regs *, long); |
43 | dotraplinkage void do_invalid_op(struct pt_regs *, long); | 43 | dotraplinkage void do_invalid_op(struct pt_regs *, long); |
44 | dotraplinkage void do_device_not_available(struct pt_regs *, long); | 44 | dotraplinkage void do_device_not_available(struct pt_regs); |
45 | dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *, long); | 45 | dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *, long); |
46 | dotraplinkage void do_invalid_TSS(struct pt_regs *, long); | 46 | dotraplinkage void do_invalid_TSS(struct pt_regs *, long); |
47 | dotraplinkage void do_segment_not_present(struct pt_regs *, long); | 47 | dotraplinkage void do_segment_not_present(struct pt_regs *, long); |
@@ -77,7 +77,7 @@ extern int panic_on_unrecovered_nmi; | |||
77 | extern int kstack_depth_to_print; | 77 | extern int kstack_depth_to_print; |
78 | 78 | ||
79 | void math_error(void __user *); | 79 | void math_error(void __user *); |
80 | asmlinkage void math_emulate(long); | 80 | void math_emulate(struct math_emu_info *); |
81 | #ifdef CONFIG_X86_32 | 81 | #ifdef CONFIG_X86_32 |
82 | unsigned long patch_espfix_desc(unsigned long, unsigned long); | 82 | unsigned long patch_espfix_desc(unsigned long, unsigned long); |
83 | #else | 83 | #else |
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index 7ef617ef1df3..4bd990ee43df 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h | |||
@@ -137,7 +137,7 @@ static inline pte_t mfn_pte(unsigned long page_nr, pgprot_t pgprot) | |||
137 | pte_t pte; | 137 | pte_t pte; |
138 | 138 | ||
139 | pte.pte = ((phys_addr_t)page_nr << PAGE_SHIFT) | | 139 | pte.pte = ((phys_addr_t)page_nr << PAGE_SHIFT) | |
140 | (pgprot_val(pgprot) & __supported_pte_mask); | 140 | massage_pgprot(pgprot); |
141 | 141 | ||
142 | return pte; | 142 | return pte; |
143 | } | 143 | } |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index d37593c2f438..7678f10c4568 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -973,6 +973,29 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) | |||
973 | nr_ioapics++; | 973 | nr_ioapics++; |
974 | } | 974 | } |
975 | 975 | ||
976 | int __init acpi_probe_gsi(void) | ||
977 | { | ||
978 | int idx; | ||
979 | int gsi; | ||
980 | int max_gsi = 0; | ||
981 | |||
982 | if (acpi_disabled) | ||
983 | return 0; | ||
984 | |||
985 | if (!acpi_ioapic) | ||
986 | return 0; | ||
987 | |||
988 | max_gsi = 0; | ||
989 | for (idx = 0; idx < nr_ioapics; idx++) { | ||
990 | gsi = mp_ioapic_routing[idx].gsi_end; | ||
991 | |||
992 | if (gsi > max_gsi) | ||
993 | max_gsi = gsi; | ||
994 | } | ||
995 | |||
996 | return max_gsi + 1; | ||
997 | } | ||
998 | |||
976 | static void assign_to_mp_irq(struct mp_config_intsrc *m, | 999 | static void assign_to_mp_irq(struct mp_config_intsrc *m, |
977 | struct mp_config_intsrc *mp_irq) | 1000 | struct mp_config_intsrc *mp_irq) |
978 | { | 1001 | { |
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 707c1f6f95fa..a60c1f3bcb87 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -156,11 +156,11 @@ static int __init acpi_sleep_setup(char *str) | |||
156 | #ifdef CONFIG_HIBERNATION | 156 | #ifdef CONFIG_HIBERNATION |
157 | if (strncmp(str, "s4_nohwsig", 10) == 0) | 157 | if (strncmp(str, "s4_nohwsig", 10) == 0) |
158 | acpi_no_s4_hw_signature(); | 158 | acpi_no_s4_hw_signature(); |
159 | if (strncmp(str, "s4_nonvs", 8) == 0) | ||
160 | acpi_s4_no_nvs(); | ||
159 | #endif | 161 | #endif |
160 | if (strncmp(str, "old_ordering", 12) == 0) | 162 | if (strncmp(str, "old_ordering", 12) == 0) |
161 | acpi_old_suspend_ordering(); | 163 | acpi_old_suspend_ordering(); |
162 | if (strncmp(str, "s4_nonvs", 8) == 0) | ||
163 | acpi_s4_no_nvs(); | ||
164 | str = strchr(str, ','); | 164 | str = strchr(str, ','); |
165 | if (str != NULL) | 165 | if (str != NULL) |
166 | str += strspn(str, ", \t"); | 166 | str += strspn(str, ", \t"); |
diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S index bcc293423a70..96258d9dc974 100644 --- a/arch/x86/kernel/acpi/wakeup_64.S +++ b/arch/x86/kernel/acpi/wakeup_64.S | |||
@@ -13,7 +13,6 @@ | |||
13 | * Hooray, we are in Long 64-bit mode (but still running in low memory) | 13 | * Hooray, we are in Long 64-bit mode (but still running in low memory) |
14 | */ | 14 | */ |
15 | ENTRY(wakeup_long64) | 15 | ENTRY(wakeup_long64) |
16 | wakeup_long64: | ||
17 | movq saved_magic, %rax | 16 | movq saved_magic, %rax |
18 | movq $0x123456789abcdef0, %rdx | 17 | movq $0x123456789abcdef0, %rdx |
19 | cmpq %rdx, %rax | 18 | cmpq %rdx, %rax |
@@ -34,16 +33,12 @@ wakeup_long64: | |||
34 | 33 | ||
35 | movq saved_rip, %rax | 34 | movq saved_rip, %rax |
36 | jmp *%rax | 35 | jmp *%rax |
36 | ENDPROC(wakeup_long64) | ||
37 | 37 | ||
38 | bogus_64_magic: | 38 | bogus_64_magic: |
39 | jmp bogus_64_magic | 39 | jmp bogus_64_magic |
40 | 40 | ||
41 | .align 2 | 41 | ENTRY(do_suspend_lowlevel) |
42 | .p2align 4,,15 | ||
43 | .globl do_suspend_lowlevel | ||
44 | .type do_suspend_lowlevel,@function | ||
45 | do_suspend_lowlevel: | ||
46 | .LFB5: | ||
47 | subq $8, %rsp | 42 | subq $8, %rsp |
48 | xorl %eax, %eax | 43 | xorl %eax, %eax |
49 | call save_processor_state | 44 | call save_processor_state |
@@ -67,7 +62,7 @@ do_suspend_lowlevel: | |||
67 | pushfq | 62 | pushfq |
68 | popq pt_regs_flags(%rax) | 63 | popq pt_regs_flags(%rax) |
69 | 64 | ||
70 | movq $.L97, saved_rip(%rip) | 65 | movq $resume_point, saved_rip(%rip) |
71 | 66 | ||
72 | movq %rsp, saved_rsp | 67 | movq %rsp, saved_rsp |
73 | movq %rbp, saved_rbp | 68 | movq %rbp, saved_rbp |
@@ -78,14 +73,12 @@ do_suspend_lowlevel: | |||
78 | addq $8, %rsp | 73 | addq $8, %rsp |
79 | movl $3, %edi | 74 | movl $3, %edi |
80 | xorl %eax, %eax | 75 | xorl %eax, %eax |
81 | jmp acpi_enter_sleep_state | 76 | call acpi_enter_sleep_state |
82 | .L97: | 77 | /* in case something went wrong, restore the machine status and go on */ |
83 | .p2align 4,,7 | 78 | jmp resume_point |
84 | .L99: | ||
85 | .align 4 | ||
86 | movl $24, %eax | ||
87 | movw %ax, %ds | ||
88 | 79 | ||
80 | .align 4 | ||
81 | resume_point: | ||
89 | /* We don't restore %rax, it must be 0 anyway */ | 82 | /* We don't restore %rax, it must be 0 anyway */ |
90 | movq $saved_context, %rax | 83 | movq $saved_context, %rax |
91 | movq saved_context_cr4(%rax), %rbx | 84 | movq saved_context_cr4(%rax), %rbx |
@@ -117,12 +110,9 @@ do_suspend_lowlevel: | |||
117 | xorl %eax, %eax | 110 | xorl %eax, %eax |
118 | addq $8, %rsp | 111 | addq $8, %rsp |
119 | jmp restore_processor_state | 112 | jmp restore_processor_state |
120 | .LFE5: | 113 | ENDPROC(do_suspend_lowlevel) |
121 | .Lfe5: | 114 | |
122 | .size do_suspend_lowlevel, .Lfe5-do_suspend_lowlevel | ||
123 | |||
124 | .data | 115 | .data |
125 | ALIGN | ||
126 | ENTRY(saved_rbp) .quad 0 | 116 | ENTRY(saved_rbp) .quad 0 |
127 | ENTRY(saved_rsi) .quad 0 | 117 | ENTRY(saved_rsi) .quad 0 |
128 | ENTRY(saved_rdi) .quad 0 | 118 | ENTRY(saved_rdi) .quad 0 |
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c index 115449f869ee..570f36e44e59 100644 --- a/arch/x86/kernel/apic.c +++ b/arch/x86/kernel/apic.c | |||
@@ -862,7 +862,7 @@ void clear_local_APIC(void) | |||
862 | } | 862 | } |
863 | 863 | ||
864 | /* lets not touch this if we didn't frob it */ | 864 | /* lets not touch this if we didn't frob it */ |
865 | #if defined(CONFIG_X86_MCE_P4THERMAL) || defined(X86_MCE_INTEL) | 865 | #if defined(CONFIG_X86_MCE_P4THERMAL) || defined(CONFIG_X86_MCE_INTEL) |
866 | if (maxlvt >= 5) { | 866 | if (maxlvt >= 5) { |
867 | v = apic_read(APIC_LVTTHMR); | 867 | v = apic_read(APIC_LVTTHMR); |
868 | apic_write(APIC_LVTTHMR, v | APIC_LVT_MASKED); | 868 | apic_write(APIC_LVTTHMR, v | APIC_LVT_MASKED); |
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index 98807bb095ad..266ec6c18b6c 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c | |||
@@ -1192,6 +1192,7 @@ static int suspend(int vetoable) | |||
1192 | device_suspend(PMSG_SUSPEND); | 1192 | device_suspend(PMSG_SUSPEND); |
1193 | local_irq_disable(); | 1193 | local_irq_disable(); |
1194 | device_power_down(PMSG_SUSPEND); | 1194 | device_power_down(PMSG_SUSPEND); |
1195 | sysdev_suspend(PMSG_SUSPEND); | ||
1195 | 1196 | ||
1196 | local_irq_enable(); | 1197 | local_irq_enable(); |
1197 | 1198 | ||
@@ -1208,6 +1209,7 @@ static int suspend(int vetoable) | |||
1208 | if (err != APM_SUCCESS) | 1209 | if (err != APM_SUCCESS) |
1209 | apm_error("suspend", err); | 1210 | apm_error("suspend", err); |
1210 | err = (err == APM_SUCCESS) ? 0 : -EIO; | 1211 | err = (err == APM_SUCCESS) ? 0 : -EIO; |
1212 | sysdev_resume(); | ||
1211 | device_power_up(PMSG_RESUME); | 1213 | device_power_up(PMSG_RESUME); |
1212 | local_irq_enable(); | 1214 | local_irq_enable(); |
1213 | device_resume(PMSG_RESUME); | 1215 | device_resume(PMSG_RESUME); |
@@ -1228,6 +1230,7 @@ static void standby(void) | |||
1228 | 1230 | ||
1229 | local_irq_disable(); | 1231 | local_irq_disable(); |
1230 | device_power_down(PMSG_SUSPEND); | 1232 | device_power_down(PMSG_SUSPEND); |
1233 | sysdev_suspend(PMSG_SUSPEND); | ||
1231 | local_irq_enable(); | 1234 | local_irq_enable(); |
1232 | 1235 | ||
1233 | err = set_system_power_state(APM_STATE_STANDBY); | 1236 | err = set_system_power_state(APM_STATE_STANDBY); |
@@ -1235,6 +1238,7 @@ static void standby(void) | |||
1235 | apm_error("standby", err); | 1238 | apm_error("standby", err); |
1236 | 1239 | ||
1237 | local_irq_disable(); | 1240 | local_irq_disable(); |
1241 | sysdev_resume(); | ||
1238 | device_power_up(PMSG_RESUME); | 1242 | device_power_up(PMSG_RESUME); |
1239 | local_irq_enable(); | 1243 | local_irq_enable(); |
1240 | } | 1244 | } |
diff --git a/arch/x86/kernel/cpu/cpufreq/Kconfig b/arch/x86/kernel/cpu/cpufreq/Kconfig index efae3b22a0ff..65792c2cc462 100644 --- a/arch/x86/kernel/cpu/cpufreq/Kconfig +++ b/arch/x86/kernel/cpu/cpufreq/Kconfig | |||
@@ -245,17 +245,6 @@ config X86_E_POWERSAVER | |||
245 | 245 | ||
246 | comment "shared options" | 246 | comment "shared options" |
247 | 247 | ||
248 | config X86_ACPI_CPUFREQ_PROC_INTF | ||
249 | bool "/proc/acpi/processor/../performance interface (deprecated)" | ||
250 | depends on PROC_FS | ||
251 | depends on X86_ACPI_CPUFREQ || X86_POWERNOW_K7_ACPI || X86_POWERNOW_K8_ACPI | ||
252 | help | ||
253 | This enables the deprecated /proc/acpi/processor/../performance | ||
254 | interface. While it is helpful for debugging, the generic, | ||
255 | cross-architecture cpufreq interfaces should be used. | ||
256 | |||
257 | If in doubt, say N. | ||
258 | |||
259 | config X86_SPEEDSTEP_LIB | 248 | config X86_SPEEDSTEP_LIB |
260 | tristate | 249 | tristate |
261 | default (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD) | 250 | default (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD) |
diff --git a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c index b585e04cbc9e..3178c3acd97e 100644 --- a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c +++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c | |||
@@ -277,7 +277,6 @@ static struct cpufreq_driver p4clockmod_driver = { | |||
277 | .name = "p4-clockmod", | 277 | .name = "p4-clockmod", |
278 | .owner = THIS_MODULE, | 278 | .owner = THIS_MODULE, |
279 | .attr = p4clockmod_attr, | 279 | .attr = p4clockmod_attr, |
280 | .hide_interface = 1, | ||
281 | }; | 280 | }; |
282 | 281 | ||
283 | 282 | ||
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 5c28b37dea11..6428aa17b40e 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -939,10 +939,25 @@ static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data) | |||
939 | free_cpumask_var(data->acpi_data.shared_cpu_map); | 939 | free_cpumask_var(data->acpi_data.shared_cpu_map); |
940 | } | 940 | } |
941 | 941 | ||
942 | static int get_transition_latency(struct powernow_k8_data *data) | ||
943 | { | ||
944 | int max_latency = 0; | ||
945 | int i; | ||
946 | for (i = 0; i < data->acpi_data.state_count; i++) { | ||
947 | int cur_latency = data->acpi_data.states[i].transition_latency | ||
948 | + data->acpi_data.states[i].bus_master_latency; | ||
949 | if (cur_latency > max_latency) | ||
950 | max_latency = cur_latency; | ||
951 | } | ||
952 | /* value in usecs, needs to be in nanoseconds */ | ||
953 | return 1000 * max_latency; | ||
954 | } | ||
955 | |||
942 | #else | 956 | #else |
943 | static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) { return -ENODEV; } | 957 | static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) { return -ENODEV; } |
944 | static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data) { return; } | 958 | static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data) { return; } |
945 | static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index) { return; } | 959 | static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index) { return; } |
960 | static int get_transition_latency(struct powernow_k8_data *data) { return 0; } | ||
946 | #endif /* CONFIG_X86_POWERNOW_K8_ACPI */ | 961 | #endif /* CONFIG_X86_POWERNOW_K8_ACPI */ |
947 | 962 | ||
948 | /* Take a frequency, and issue the fid/vid transition command */ | 963 | /* Take a frequency, and issue the fid/vid transition command */ |
@@ -1142,8 +1157,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1142 | data->cpu = pol->cpu; | 1157 | data->cpu = pol->cpu; |
1143 | data->currpstate = HW_PSTATE_INVALID; | 1158 | data->currpstate = HW_PSTATE_INVALID; |
1144 | 1159 | ||
1145 | rc = powernow_k8_cpu_init_acpi(data); | 1160 | if (powernow_k8_cpu_init_acpi(data)) { |
1146 | if (rc) { | ||
1147 | /* | 1161 | /* |
1148 | * Use the PSB BIOS structure. This is only availabe on | 1162 | * Use the PSB BIOS structure. This is only availabe on |
1149 | * an UP version, and is deprecated by AMD. | 1163 | * an UP version, and is deprecated by AMD. |
@@ -1161,19 +1175,28 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1161 | "ACPI maintainers and complain to your BIOS " | 1175 | "ACPI maintainers and complain to your BIOS " |
1162 | "vendor.\n"); | 1176 | "vendor.\n"); |
1163 | #endif | 1177 | #endif |
1164 | goto err_out; | 1178 | kfree(data); |
1179 | return -ENODEV; | ||
1165 | } | 1180 | } |
1166 | if (pol->cpu != 0) { | 1181 | if (pol->cpu != 0) { |
1167 | printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " | 1182 | printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " |
1168 | "CPU other than CPU0. Complain to your BIOS " | 1183 | "CPU other than CPU0. Complain to your BIOS " |
1169 | "vendor.\n"); | 1184 | "vendor.\n"); |
1170 | goto err_out; | 1185 | kfree(data); |
1186 | return -ENODEV; | ||
1171 | } | 1187 | } |
1172 | rc = find_psb_table(data); | 1188 | rc = find_psb_table(data); |
1173 | if (rc) { | 1189 | if (rc) { |
1174 | goto err_out; | 1190 | kfree(data); |
1191 | return -ENODEV; | ||
1175 | } | 1192 | } |
1176 | } | 1193 | /* Take a crude guess here. |
1194 | * That guess was in microseconds, so multiply with 1000 */ | ||
1195 | pol->cpuinfo.transition_latency = ( | ||
1196 | ((data->rvo + 8) * data->vstable * VST_UNITS_20US) + | ||
1197 | ((1 << data->irt) * 30)) * 1000; | ||
1198 | } else /* ACPI _PSS objects available */ | ||
1199 | pol->cpuinfo.transition_latency = get_transition_latency(data); | ||
1177 | 1200 | ||
1178 | /* only run on specific CPU from here on */ | 1201 | /* only run on specific CPU from here on */ |
1179 | oldmask = current->cpus_allowed; | 1202 | oldmask = current->cpus_allowed; |
@@ -1204,11 +1227,6 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1204 | cpumask_copy(pol->cpus, &per_cpu(cpu_core_map, pol->cpu)); | 1227 | cpumask_copy(pol->cpus, &per_cpu(cpu_core_map, pol->cpu)); |
1205 | data->available_cores = pol->cpus; | 1228 | data->available_cores = pol->cpus; |
1206 | 1229 | ||
1207 | /* Take a crude guess here. | ||
1208 | * That guess was in microseconds, so multiply with 1000 */ | ||
1209 | pol->cpuinfo.transition_latency = (((data->rvo + 8) * data->vstable * VST_UNITS_20US) | ||
1210 | + (3 * (1 << data->irt) * 10)) * 1000; | ||
1211 | |||
1212 | if (cpu_family == CPU_HW_PSTATE) | 1230 | if (cpu_family == CPU_HW_PSTATE) |
1213 | pol->cur = find_khz_freq_from_pstate(data->powernow_table, data->currpstate); | 1231 | pol->cur = find_khz_freq_from_pstate(data->powernow_table, data->currpstate); |
1214 | else | 1232 | else |
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 430e5c38a544..24ff26a38ade 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -291,6 +291,9 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) | |||
291 | ds_init_intel(c); | 291 | ds_init_intel(c); |
292 | } | 292 | } |
293 | 293 | ||
294 | if (c->x86 == 6 && c->x86_model == 29 && cpu_has_clflush) | ||
295 | set_cpu_cap(c, X86_FEATURE_CLFLUSH_MONITOR); | ||
296 | |||
294 | #ifdef CONFIG_X86_64 | 297 | #ifdef CONFIG_X86_64 |
295 | if (c->x86 == 15) | 298 | if (c->x86 == 15) |
296 | c->x86_cache_alignment = c->x86_clflush_size * 2; | 299 | c->x86_cache_alignment = c->x86_clflush_size * 2; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c index 1c838032fd37..fe79985ce0f2 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_64.c | |||
@@ -295,11 +295,11 @@ void do_machine_check(struct pt_regs * regs, long error_code) | |||
295 | * If we know that the error was in user space, send a | 295 | * If we know that the error was in user space, send a |
296 | * SIGBUS. Otherwise, panic if tolerance is low. | 296 | * SIGBUS. Otherwise, panic if tolerance is low. |
297 | * | 297 | * |
298 | * do_exit() takes an awful lot of locks and has a slight | 298 | * force_sig() takes an awful lot of locks and has a slight |
299 | * risk of deadlocking. | 299 | * risk of deadlocking. |
300 | */ | 300 | */ |
301 | if (user_space) { | 301 | if (user_space) { |
302 | do_exit(SIGBUS); | 302 | force_sig(SIGBUS, current); |
303 | } else if (panic_on_oops || tolerant < 2) { | 303 | } else if (panic_on_oops || tolerant < 2) { |
304 | mce_panic("Uncorrected machine check", | 304 | mce_panic("Uncorrected machine check", |
305 | &panicm, mcestart); | 305 | &panicm, mcestart); |
@@ -490,7 +490,7 @@ static void __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c) | |||
490 | 490 | ||
491 | } | 491 | } |
492 | 492 | ||
493 | static void __cpuinit mce_cpu_features(struct cpuinfo_x86 *c) | 493 | static void mce_cpu_features(struct cpuinfo_x86 *c) |
494 | { | 494 | { |
495 | switch (c->x86_vendor) { | 495 | switch (c->x86_vendor) { |
496 | case X86_VENDOR_INTEL: | 496 | case X86_VENDOR_INTEL: |
@@ -734,6 +734,7 @@ __setup("mce=", mcheck_enable); | |||
734 | static int mce_resume(struct sys_device *dev) | 734 | static int mce_resume(struct sys_device *dev) |
735 | { | 735 | { |
736 | mce_init(NULL); | 736 | mce_init(NULL); |
737 | mce_cpu_features(¤t_cpu_data); | ||
737 | return 0; | 738 | return 0; |
738 | } | 739 | } |
739 | 740 | ||
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c index 8ae8c4ff094d..f2ee0ae29bd6 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c | |||
@@ -121,7 +121,7 @@ static long threshold_restart_bank(void *_tr) | |||
121 | } | 121 | } |
122 | 122 | ||
123 | /* cpu init entry point, called from mce.c with preempt off */ | 123 | /* cpu init entry point, called from mce.c with preempt off */ |
124 | void __cpuinit mce_amd_feature_init(struct cpuinfo_x86 *c) | 124 | void mce_amd_feature_init(struct cpuinfo_x86 *c) |
125 | { | 125 | { |
126 | unsigned int bank, block; | 126 | unsigned int bank, block; |
127 | unsigned int cpu = smp_processor_id(); | 127 | unsigned int cpu = smp_processor_id(); |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c index 4b48f251fd39..f44c36624360 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c | |||
@@ -30,7 +30,7 @@ asmlinkage void smp_thermal_interrupt(void) | |||
30 | irq_exit(); | 30 | irq_exit(); |
31 | } | 31 | } |
32 | 32 | ||
33 | static void __cpuinit intel_init_thermal(struct cpuinfo_x86 *c) | 33 | static void intel_init_thermal(struct cpuinfo_x86 *c) |
34 | { | 34 | { |
35 | u32 l, h; | 35 | u32 l, h; |
36 | int tm2 = 0; | 36 | int tm2 = 0; |
@@ -84,7 +84,7 @@ static void __cpuinit intel_init_thermal(struct cpuinfo_x86 *c) | |||
84 | return; | 84 | return; |
85 | } | 85 | } |
86 | 86 | ||
87 | void __cpuinit mce_intel_feature_init(struct cpuinfo_x86 *c) | 87 | void mce_intel_feature_init(struct cpuinfo_x86 *c) |
88 | { | 88 | { |
89 | intel_init_thermal(c); | 89 | intel_init_thermal(c); |
90 | } | 90 | } |
diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c index 169a120587be..87b67e3a765a 100644 --- a/arch/x86/kernel/ds.c +++ b/arch/x86/kernel/ds.c | |||
@@ -729,7 +729,7 @@ struct pebs_tracer *ds_request_pebs(struct task_struct *task, | |||
729 | 729 | ||
730 | spin_unlock_irqrestore(&ds_lock, irq); | 730 | spin_unlock_irqrestore(&ds_lock, irq); |
731 | 731 | ||
732 | ds_write_config(tracer->ds.context, &tracer->trace.ds, ds_bts); | 732 | ds_write_config(tracer->ds.context, &tracer->trace.ds, ds_pebs); |
733 | ds_resume_pebs(tracer); | 733 | ds_resume_pebs(tracer); |
734 | 734 | ||
735 | return tracer; | 735 | return tracer; |
@@ -1029,5 +1029,4 @@ void ds_copy_thread(struct task_struct *tsk, struct task_struct *father) | |||
1029 | 1029 | ||
1030 | void ds_exit_thread(struct task_struct *tsk) | 1030 | void ds_exit_thread(struct task_struct *tsk) |
1031 | { | 1031 | { |
1032 | WARN_ON(tsk->thread.ds_ctx); | ||
1033 | } | 1032 | } |
diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c index 1119d247fe11..eb1ef3b67dd5 100644 --- a/arch/x86/kernel/efi.c +++ b/arch/x86/kernel/efi.c | |||
@@ -467,7 +467,7 @@ void __init efi_enter_virtual_mode(void) | |||
467 | efi_memory_desc_t *md; | 467 | efi_memory_desc_t *md; |
468 | efi_status_t status; | 468 | efi_status_t status; |
469 | unsigned long size; | 469 | unsigned long size; |
470 | u64 end, systab, addr, npages; | 470 | u64 end, systab, addr, npages, end_pfn; |
471 | void *p, *va; | 471 | void *p, *va; |
472 | 472 | ||
473 | efi.systab = NULL; | 473 | efi.systab = NULL; |
@@ -479,7 +479,10 @@ void __init efi_enter_virtual_mode(void) | |||
479 | size = md->num_pages << EFI_PAGE_SHIFT; | 479 | size = md->num_pages << EFI_PAGE_SHIFT; |
480 | end = md->phys_addr + size; | 480 | end = md->phys_addr + size; |
481 | 481 | ||
482 | if (PFN_UP(end) <= max_low_pfn_mapped) | 482 | end_pfn = PFN_UP(end); |
483 | if (end_pfn <= max_low_pfn_mapped | ||
484 | || (end_pfn > (1UL << (32 - PAGE_SHIFT)) | ||
485 | && end_pfn <= max_pfn_mapped)) | ||
483 | va = __va(md->phys_addr); | 486 | va = __va(md->phys_addr); |
484 | else | 487 | else |
485 | va = efi_ioremap(md->phys_addr, size); | 488 | va = efi_ioremap(md->phys_addr, size); |
diff --git a/arch/x86/kernel/efi_64.c b/arch/x86/kernel/efi_64.c index 652c5287215f..cb783b92c50c 100644 --- a/arch/x86/kernel/efi_64.c +++ b/arch/x86/kernel/efi_64.c | |||
@@ -99,24 +99,11 @@ void __init efi_call_phys_epilog(void) | |||
99 | 99 | ||
100 | void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size) | 100 | void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size) |
101 | { | 101 | { |
102 | static unsigned pages_mapped __initdata; | 102 | unsigned long last_map_pfn; |
103 | unsigned i, pages; | ||
104 | unsigned long offset; | ||
105 | 103 | ||
106 | pages = PFN_UP(phys_addr + size) - PFN_DOWN(phys_addr); | 104 | last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size); |
107 | offset = phys_addr & ~PAGE_MASK; | 105 | if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) |
108 | phys_addr &= PAGE_MASK; | ||
109 | |||
110 | if (pages_mapped + pages > MAX_EFI_IO_PAGES) | ||
111 | return NULL; | 106 | return NULL; |
112 | 107 | ||
113 | for (i = 0; i < pages; i++) { | 108 | return (void __iomem *)__va(phys_addr); |
114 | __set_fixmap(FIX_EFI_IO_MAP_FIRST_PAGE - pages_mapped, | ||
115 | phys_addr, PAGE_KERNEL); | ||
116 | phys_addr += PAGE_SIZE; | ||
117 | pages_mapped++; | ||
118 | } | ||
119 | |||
120 | return (void __iomem *)__fix_to_virt(FIX_EFI_IO_MAP_FIRST_PAGE - \ | ||
121 | (pages_mapped - pages)) + offset; | ||
122 | } | 109 | } |
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 1b43086b097a..231bdd3c5b1c 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -488,20 +488,21 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | |||
488 | * ignore such a protection. | 488 | * ignore such a protection. |
489 | */ | 489 | */ |
490 | asm volatile( | 490 | asm volatile( |
491 | "1: " _ASM_MOV " (%[parent_old]), %[old]\n" | 491 | "1: " _ASM_MOV " (%[parent]), %[old]\n" |
492 | "2: " _ASM_MOV " %[return_hooker], (%[parent_replaced])\n" | 492 | "2: " _ASM_MOV " %[return_hooker], (%[parent])\n" |
493 | " movl $0, %[faulted]\n" | 493 | " movl $0, %[faulted]\n" |
494 | "3:\n" | ||
494 | 495 | ||
495 | ".section .fixup, \"ax\"\n" | 496 | ".section .fixup, \"ax\"\n" |
496 | "3: movl $1, %[faulted]\n" | 497 | "4: movl $1, %[faulted]\n" |
498 | " jmp 3b\n" | ||
497 | ".previous\n" | 499 | ".previous\n" |
498 | 500 | ||
499 | _ASM_EXTABLE(1b, 3b) | 501 | _ASM_EXTABLE(1b, 4b) |
500 | _ASM_EXTABLE(2b, 3b) | 502 | _ASM_EXTABLE(2b, 4b) |
501 | 503 | ||
502 | : [parent_replaced] "=r" (parent), [old] "=r" (old), | 504 | : [old] "=r" (old), [faulted] "=r" (faulted) |
503 | [faulted] "=r" (faulted) | 505 | : [parent] "r" (parent), [return_hooker] "r" (return_hooker) |
504 | : [parent_old] "0" (parent), [return_hooker] "r" (return_hooker) | ||
505 | : "memory" | 506 | : "memory" |
506 | ); | 507 | ); |
507 | 508 | ||
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 64d5ad0b8add..a00545fe5cdd 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -269,6 +269,8 @@ static void hpet_set_mode(enum clock_event_mode mode, | |||
269 | now = hpet_readl(HPET_COUNTER); | 269 | now = hpet_readl(HPET_COUNTER); |
270 | cmp = now + (unsigned long) delta; | 270 | cmp = now + (unsigned long) delta; |
271 | cfg = hpet_readl(HPET_Tn_CFG(timer)); | 271 | cfg = hpet_readl(HPET_Tn_CFG(timer)); |
272 | /* Make sure we use edge triggered interrupts */ | ||
273 | cfg &= ~HPET_TN_LEVEL; | ||
272 | cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC | | 274 | cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC | |
273 | HPET_TN_SETVAL | HPET_TN_32BIT; | 275 | HPET_TN_SETVAL | HPET_TN_32BIT; |
274 | hpet_writel(cfg, HPET_Tn_CFG(timer)); | 276 | hpet_writel(cfg, HPET_Tn_CFG(timer)); |
@@ -897,7 +899,7 @@ static unsigned long hpet_rtc_flags; | |||
897 | static int hpet_prev_update_sec; | 899 | static int hpet_prev_update_sec; |
898 | static struct rtc_time hpet_alarm_time; | 900 | static struct rtc_time hpet_alarm_time; |
899 | static unsigned long hpet_pie_count; | 901 | static unsigned long hpet_pie_count; |
900 | static unsigned long hpet_t1_cmp; | 902 | static u32 hpet_t1_cmp; |
901 | static unsigned long hpet_default_delta; | 903 | static unsigned long hpet_default_delta; |
902 | static unsigned long hpet_pie_delta; | 904 | static unsigned long hpet_pie_delta; |
903 | static unsigned long hpet_pie_limit; | 905 | static unsigned long hpet_pie_limit; |
@@ -905,6 +907,14 @@ static unsigned long hpet_pie_limit; | |||
905 | static rtc_irq_handler irq_handler; | 907 | static rtc_irq_handler irq_handler; |
906 | 908 | ||
907 | /* | 909 | /* |
910 | * Check that the hpet counter c1 is ahead of the c2 | ||
911 | */ | ||
912 | static inline int hpet_cnt_ahead(u32 c1, u32 c2) | ||
913 | { | ||
914 | return (s32)(c2 - c1) < 0; | ||
915 | } | ||
916 | |||
917 | /* | ||
908 | * Registers a IRQ handler. | 918 | * Registers a IRQ handler. |
909 | */ | 919 | */ |
910 | int hpet_register_irq_handler(rtc_irq_handler handler) | 920 | int hpet_register_irq_handler(rtc_irq_handler handler) |
@@ -1075,7 +1085,7 @@ static void hpet_rtc_timer_reinit(void) | |||
1075 | hpet_t1_cmp += delta; | 1085 | hpet_t1_cmp += delta; |
1076 | hpet_writel(hpet_t1_cmp, HPET_T1_CMP); | 1086 | hpet_writel(hpet_t1_cmp, HPET_T1_CMP); |
1077 | lost_ints++; | 1087 | lost_ints++; |
1078 | } while ((long)(hpet_readl(HPET_COUNTER) - hpet_t1_cmp) > 0); | 1088 | } while (!hpet_cnt_ahead(hpet_t1_cmp, hpet_readl(HPET_COUNTER))); |
1079 | 1089 | ||
1080 | if (lost_ints) { | 1090 | if (lost_ints) { |
1081 | if (hpet_rtc_flags & RTC_PIE) | 1091 | if (hpet_rtc_flags & RTC_PIE) |
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index b0f61f0dcd0a..f2f8540a7f3d 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c | |||
@@ -136,7 +136,7 @@ int init_fpu(struct task_struct *tsk) | |||
136 | #ifdef CONFIG_X86_32 | 136 | #ifdef CONFIG_X86_32 |
137 | if (!HAVE_HWFP) { | 137 | if (!HAVE_HWFP) { |
138 | memset(tsk->thread.xstate, 0, xstate_size); | 138 | memset(tsk->thread.xstate, 0, xstate_size); |
139 | finit(); | 139 | finit_task(tsk); |
140 | set_stopped_child_used_math(tsk); | 140 | set_stopped_child_used_math(tsk); |
141 | return 0; | 141 | return 0; |
142 | } | 142 | } |
diff --git a/arch/x86/kernel/i8237.c b/arch/x86/kernel/i8237.c index dbd6c1d1b638..b42ca694dc68 100644 --- a/arch/x86/kernel/i8237.c +++ b/arch/x86/kernel/i8237.c | |||
@@ -28,10 +28,10 @@ static int i8237A_resume(struct sys_device *dev) | |||
28 | 28 | ||
29 | flags = claim_dma_lock(); | 29 | flags = claim_dma_lock(); |
30 | 30 | ||
31 | dma_outb(DMA1_RESET_REG, 0); | 31 | dma_outb(0, DMA1_RESET_REG); |
32 | dma_outb(DMA2_RESET_REG, 0); | 32 | dma_outb(0, DMA2_RESET_REG); |
33 | 33 | ||
34 | for (i = 0;i < 8;i++) { | 34 | for (i = 0; i < 8; i++) { |
35 | set_dma_addr(i, 0x000000); | 35 | set_dma_addr(i, 0x000000); |
36 | /* DMA count is a bit weird so this is not 0 */ | 36 | /* DMA count is a bit weird so this is not 0 */ |
37 | set_dma_count(i, 1); | 37 | set_dma_count(i, 1); |
@@ -51,14 +51,14 @@ static int i8237A_suspend(struct sys_device *dev, pm_message_t state) | |||
51 | } | 51 | } |
52 | 52 | ||
53 | static struct sysdev_class i8237_sysdev_class = { | 53 | static struct sysdev_class i8237_sysdev_class = { |
54 | .name = "i8237", | 54 | .name = "i8237", |
55 | .suspend = i8237A_suspend, | 55 | .suspend = i8237A_suspend, |
56 | .resume = i8237A_resume, | 56 | .resume = i8237A_resume, |
57 | }; | 57 | }; |
58 | 58 | ||
59 | static struct sys_device device_i8237A = { | 59 | static struct sys_device device_i8237A = { |
60 | .id = 0, | 60 | .id = 0, |
61 | .cls = &i8237_sysdev_class, | 61 | .cls = &i8237_sysdev_class, |
62 | }; | 62 | }; |
63 | 63 | ||
64 | static int __init i8237A_init_sysfs(void) | 64 | static int __init i8237A_init_sysfs(void) |
@@ -68,5 +68,4 @@ static int __init i8237A_init_sysfs(void) | |||
68 | error = sysdev_register(&device_i8237A); | 68 | error = sysdev_register(&device_i8237A); |
69 | return error; | 69 | return error; |
70 | } | 70 | } |
71 | |||
72 | device_initcall(i8237A_init_sysfs); | 71 | device_initcall(i8237A_init_sysfs); |
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index 9b0c480c383b..bc7ac4da90d7 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
@@ -3841,14 +3841,24 @@ int __init io_apic_get_redir_entries (int ioapic) | |||
3841 | 3841 | ||
3842 | void __init probe_nr_irqs_gsi(void) | 3842 | void __init probe_nr_irqs_gsi(void) |
3843 | { | 3843 | { |
3844 | int idx; | ||
3845 | int nr = 0; | 3844 | int nr = 0; |
3846 | 3845 | ||
3847 | for (idx = 0; idx < nr_ioapics; idx++) | 3846 | nr = acpi_probe_gsi(); |
3848 | nr += io_apic_get_redir_entries(idx) + 1; | 3847 | if (nr > nr_irqs_gsi) { |
3849 | |||
3850 | if (nr > nr_irqs_gsi) | ||
3851 | nr_irqs_gsi = nr; | 3848 | nr_irqs_gsi = nr; |
3849 | } else { | ||
3850 | /* for acpi=off or acpi is not compiled in */ | ||
3851 | int idx; | ||
3852 | |||
3853 | nr = 0; | ||
3854 | for (idx = 0; idx < nr_ioapics; idx++) | ||
3855 | nr += io_apic_get_redir_entries(idx) + 1; | ||
3856 | |||
3857 | if (nr > nr_irqs_gsi) | ||
3858 | nr_irqs_gsi = nr; | ||
3859 | } | ||
3860 | |||
3861 | printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi); | ||
3852 | } | 3862 | } |
3853 | 3863 | ||
3854 | /* -------------------------------------------------------------------------- | 3864 | /* -------------------------------------------------------------------------- |
diff --git a/arch/x86/kernel/olpc.c b/arch/x86/kernel/olpc.c index 7a13fac63a1f..4006c522adc7 100644 --- a/arch/x86/kernel/olpc.c +++ b/arch/x86/kernel/olpc.c | |||
@@ -203,7 +203,7 @@ static void __init platform_detect(void) | |||
203 | static void __init platform_detect(void) | 203 | static void __init platform_detect(void) |
204 | { | 204 | { |
205 | /* stopgap until OFW support is added to the kernel */ | 205 | /* stopgap until OFW support is added to the kernel */ |
206 | olpc_platform_info.boardrev = 0xc2; | 206 | olpc_platform_info.boardrev = olpc_board(0xc2); |
207 | } | 207 | } |
208 | #endif | 208 | #endif |
209 | 209 | ||
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index e4c8fb608873..c6520a4e85d4 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c | |||
@@ -268,6 +268,32 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void) | |||
268 | return __get_cpu_var(paravirt_lazy_mode); | 268 | return __get_cpu_var(paravirt_lazy_mode); |
269 | } | 269 | } |
270 | 270 | ||
271 | void arch_flush_lazy_mmu_mode(void) | ||
272 | { | ||
273 | preempt_disable(); | ||
274 | |||
275 | if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) { | ||
276 | WARN_ON(preempt_count() == 1); | ||
277 | arch_leave_lazy_mmu_mode(); | ||
278 | arch_enter_lazy_mmu_mode(); | ||
279 | } | ||
280 | |||
281 | preempt_enable(); | ||
282 | } | ||
283 | |||
284 | void arch_flush_lazy_cpu_mode(void) | ||
285 | { | ||
286 | preempt_disable(); | ||
287 | |||
288 | if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_CPU) { | ||
289 | WARN_ON(preempt_count() == 1); | ||
290 | arch_leave_lazy_cpu_mode(); | ||
291 | arch_enter_lazy_cpu_mode(); | ||
292 | } | ||
293 | |||
294 | preempt_enable(); | ||
295 | } | ||
296 | |||
271 | struct pv_info pv_info = { | 297 | struct pv_info pv_info = { |
272 | .name = "bare hardware", | 298 | .name = "bare hardware", |
273 | .paravirt_enabled = 0, | 299 | .paravirt_enabled = 0, |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index e68bb9e30864..6d12f7e37f8c 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -180,6 +180,9 @@ void mwait_idle_with_hints(unsigned long ax, unsigned long cx) | |||
180 | 180 | ||
181 | trace_power_start(&it, POWER_CSTATE, (ax>>4)+1); | 181 | trace_power_start(&it, POWER_CSTATE, (ax>>4)+1); |
182 | if (!need_resched()) { | 182 | if (!need_resched()) { |
183 | if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) | ||
184 | clflush((void *)¤t_thread_info()->flags); | ||
185 | |||
183 | __monitor((void *)¤t_thread_info()->flags, 0, 0); | 186 | __monitor((void *)¤t_thread_info()->flags, 0, 0); |
184 | smp_mb(); | 187 | smp_mb(); |
185 | if (!need_resched()) | 188 | if (!need_resched()) |
@@ -194,6 +197,9 @@ static void mwait_idle(void) | |||
194 | struct power_trace it; | 197 | struct power_trace it; |
195 | if (!need_resched()) { | 198 | if (!need_resched()) { |
196 | trace_power_start(&it, POWER_CSTATE, 1); | 199 | trace_power_start(&it, POWER_CSTATE, 1); |
200 | if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) | ||
201 | clflush((void *)¤t_thread_info()->flags); | ||
202 | |||
197 | __monitor((void *)¤t_thread_info()->flags, 0, 0); | 203 | __monitor((void *)¤t_thread_info()->flags, 0, 0); |
198 | smp_mb(); | 204 | smp_mb(); |
199 | if (!need_resched()) | 205 | if (!need_resched()) |
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index a546f55c77b4..bd4da2af08ae 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -104,9 +104,6 @@ void cpu_idle(void) | |||
104 | check_pgt_cache(); | 104 | check_pgt_cache(); |
105 | rmb(); | 105 | rmb(); |
106 | 106 | ||
107 | if (rcu_pending(cpu)) | ||
108 | rcu_check_callbacks(cpu, 0); | ||
109 | |||
110 | if (cpu_is_offline(cpu)) | 107 | if (cpu_is_offline(cpu)) |
111 | play_dead(); | 108 | play_dead(); |
112 | 109 | ||
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 416fb9282f4f..85b4cb5c1980 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/uaccess.h> | 40 | #include <linux/uaccess.h> |
41 | #include <linux/io.h> | 41 | #include <linux/io.h> |
42 | #include <linux/ftrace.h> | 42 | #include <linux/ftrace.h> |
43 | #include <linux/dmi.h> | ||
43 | 44 | ||
44 | #include <asm/pgtable.h> | 45 | #include <asm/pgtable.h> |
45 | #include <asm/system.h> | 46 | #include <asm/system.h> |
@@ -151,14 +152,18 @@ void __show_regs(struct pt_regs *regs, int all) | |||
151 | unsigned long d0, d1, d2, d3, d6, d7; | 152 | unsigned long d0, d1, d2, d3, d6, d7; |
152 | unsigned int fsindex, gsindex; | 153 | unsigned int fsindex, gsindex; |
153 | unsigned int ds, cs, es; | 154 | unsigned int ds, cs, es; |
155 | const char *board; | ||
154 | 156 | ||
155 | printk("\n"); | 157 | printk("\n"); |
156 | print_modules(); | 158 | print_modules(); |
157 | printk(KERN_INFO "Pid: %d, comm: %.20s %s %s %.*s\n", | 159 | board = dmi_get_system_info(DMI_PRODUCT_NAME); |
160 | if (!board) | ||
161 | board = ""; | ||
162 | printk(KERN_INFO "Pid: %d, comm: %.20s %s %s %.*s %s\n", | ||
158 | current->pid, current->comm, print_tainted(), | 163 | current->pid, current->comm, print_tainted(), |
159 | init_utsname()->release, | 164 | init_utsname()->release, |
160 | (int)strcspn(init_utsname()->version, " "), | 165 | (int)strcspn(init_utsname()->version, " "), |
161 | init_utsname()->version); | 166 | init_utsname()->version, board); |
162 | printk(KERN_INFO "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip); | 167 | printk(KERN_INFO "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip); |
163 | printk_address(regs->ip, 1); | 168 | printk_address(regs->ip, 1); |
164 | printk(KERN_INFO "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, | 169 | printk(KERN_INFO "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 0a5df5f82fb9..06ca07f6ad86 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -810,12 +810,16 @@ static void ptrace_bts_untrace(struct task_struct *child) | |||
810 | 810 | ||
811 | static void ptrace_bts_detach(struct task_struct *child) | 811 | static void ptrace_bts_detach(struct task_struct *child) |
812 | { | 812 | { |
813 | if (unlikely(child->bts)) { | 813 | /* |
814 | ds_release_bts(child->bts); | 814 | * Ptrace_detach() races with ptrace_untrace() in case |
815 | child->bts = NULL; | 815 | * the child dies and is reaped by another thread. |
816 | 816 | * | |
817 | ptrace_bts_free_buffer(child); | 817 | * We only do the memory accounting at this point and |
818 | } | 818 | * leave the buffer deallocation and the bts tracer |
819 | * release to ptrace_bts_untrace() which will be called | ||
820 | * later on with tasklist_lock held. | ||
821 | */ | ||
822 | release_locked_buffer(child->bts_buffer, child->bts_size); | ||
819 | } | 823 | } |
820 | #else | 824 | #else |
821 | static inline void ptrace_bts_fork(struct task_struct *tsk) {} | 825 | static inline void ptrace_bts_fork(struct task_struct *tsk) {} |
@@ -1384,7 +1388,7 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, | |||
1384 | #ifdef CONFIG_X86_32 | 1388 | #ifdef CONFIG_X86_32 |
1385 | # define IS_IA32 1 | 1389 | # define IS_IA32 1 |
1386 | #elif defined CONFIG_IA32_EMULATION | 1390 | #elif defined CONFIG_IA32_EMULATION |
1387 | # define IS_IA32 test_thread_flag(TIF_IA32) | 1391 | # define IS_IA32 is_compat_task() |
1388 | #else | 1392 | #else |
1389 | # define IS_IA32 0 | 1393 | # define IS_IA32 0 |
1390 | #endif | 1394 | #endif |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 2b46eb41643b..4526b3a75ed2 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -217,6 +217,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
217 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"), | 217 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"), |
218 | }, | 218 | }, |
219 | }, | 219 | }, |
220 | { /* Handle problems with rebooting on Dell XPS710 */ | ||
221 | .callback = set_bios_reboot, | ||
222 | .ident = "Dell XPS710", | ||
223 | .matches = { | ||
224 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
225 | DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"), | ||
226 | }, | ||
227 | }, | ||
220 | { } | 228 | { } |
221 | }; | 229 | }; |
222 | 230 | ||
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index ae0d8042cf69..6a8811a69324 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -607,7 +607,7 @@ struct x86_quirks *x86_quirks __initdata = &default_x86_quirks; | |||
607 | static int __init dmi_low_memory_corruption(const struct dmi_system_id *d) | 607 | static int __init dmi_low_memory_corruption(const struct dmi_system_id *d) |
608 | { | 608 | { |
609 | printk(KERN_NOTICE | 609 | printk(KERN_NOTICE |
610 | "%s detected: BIOS may corrupt low RAM, working it around.\n", | 610 | "%s detected: BIOS may corrupt low RAM, working around it.\n", |
611 | d->ident); | 611 | d->ident); |
612 | 612 | ||
613 | e820_update_range(0, 0x10000, E820_RAM, E820_RESERVED); | 613 | e820_update_range(0, 0x10000, E820_RAM, E820_RESERVED); |
@@ -770,6 +770,9 @@ void __init setup_arch(char **cmdline_p) | |||
770 | 770 | ||
771 | finish_e820_parsing(); | 771 | finish_e820_parsing(); |
772 | 772 | ||
773 | if (efi_enabled) | ||
774 | efi_init(); | ||
775 | |||
773 | dmi_scan_machine(); | 776 | dmi_scan_machine(); |
774 | 777 | ||
775 | dmi_check_system(bad_bios_dmi_table); | 778 | dmi_check_system(bad_bios_dmi_table); |
@@ -789,8 +792,6 @@ void __init setup_arch(char **cmdline_p) | |||
789 | insert_resource(&iomem_resource, &data_resource); | 792 | insert_resource(&iomem_resource, &data_resource); |
790 | insert_resource(&iomem_resource, &bss_resource); | 793 | insert_resource(&iomem_resource, &bss_resource); |
791 | 794 | ||
792 | if (efi_enabled) | ||
793 | efi_init(); | ||
794 | 795 | ||
795 | #ifdef CONFIG_X86_32 | 796 | #ifdef CONFIG_X86_32 |
796 | if (ppro_with_ram_bug()) { | 797 | if (ppro_with_ram_bug()) { |
diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c index e6e695acd725..241ec3923f61 100644 --- a/arch/x86/kernel/time_64.c +++ b/arch/x86/kernel/time_64.c | |||
@@ -115,7 +115,7 @@ unsigned long __init calibrate_cpu(void) | |||
115 | 115 | ||
116 | static struct irqaction irq0 = { | 116 | static struct irqaction irq0 = { |
117 | .handler = timer_interrupt, | 117 | .handler = timer_interrupt, |
118 | .flags = IRQF_DISABLED | IRQF_IRQPOLL | IRQF_NOBALANCING, | 118 | .flags = IRQF_DISABLED | IRQF_IRQPOLL | IRQF_NOBALANCING | IRQF_TIMER, |
119 | .mask = CPU_MASK_NONE, | 119 | .mask = CPU_MASK_NONE, |
120 | .name = "timer" | 120 | .name = "timer" |
121 | }; | 121 | }; |
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 98c2d055284b..a9e7548e1790 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -99,6 +99,12 @@ static inline void preempt_conditional_sti(struct pt_regs *regs) | |||
99 | local_irq_enable(); | 99 | local_irq_enable(); |
100 | } | 100 | } |
101 | 101 | ||
102 | static inline void conditional_cli(struct pt_regs *regs) | ||
103 | { | ||
104 | if (regs->flags & X86_EFLAGS_IF) | ||
105 | local_irq_disable(); | ||
106 | } | ||
107 | |||
102 | static inline void preempt_conditional_cli(struct pt_regs *regs) | 108 | static inline void preempt_conditional_cli(struct pt_regs *regs) |
103 | { | 109 | { |
104 | if (regs->flags & X86_EFLAGS_IF) | 110 | if (regs->flags & X86_EFLAGS_IF) |
@@ -626,8 +632,10 @@ clear_dr7: | |||
626 | 632 | ||
627 | #ifdef CONFIG_X86_32 | 633 | #ifdef CONFIG_X86_32 |
628 | debug_vm86: | 634 | debug_vm86: |
635 | /* reenable preemption: handle_vm86_trap() might sleep */ | ||
636 | dec_preempt_count(); | ||
629 | handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 1); | 637 | handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 1); |
630 | preempt_conditional_cli(regs); | 638 | conditional_cli(regs); |
631 | return; | 639 | return; |
632 | #endif | 640 | #endif |
633 | 641 | ||
@@ -896,7 +904,7 @@ asmlinkage void math_state_restore(void) | |||
896 | EXPORT_SYMBOL_GPL(math_state_restore); | 904 | EXPORT_SYMBOL_GPL(math_state_restore); |
897 | 905 | ||
898 | #ifndef CONFIG_MATH_EMULATION | 906 | #ifndef CONFIG_MATH_EMULATION |
899 | asmlinkage void math_emulate(long arg) | 907 | void math_emulate(struct math_emu_info *info) |
900 | { | 908 | { |
901 | printk(KERN_EMERG | 909 | printk(KERN_EMERG |
902 | "math-emulation not enabled and no coprocessor found.\n"); | 910 | "math-emulation not enabled and no coprocessor found.\n"); |
@@ -906,16 +914,19 @@ asmlinkage void math_emulate(long arg) | |||
906 | } | 914 | } |
907 | #endif /* CONFIG_MATH_EMULATION */ | 915 | #endif /* CONFIG_MATH_EMULATION */ |
908 | 916 | ||
909 | dotraplinkage void __kprobes | 917 | dotraplinkage void __kprobes do_device_not_available(struct pt_regs regs) |
910 | do_device_not_available(struct pt_regs *regs, long error) | ||
911 | { | 918 | { |
912 | #ifdef CONFIG_X86_32 | 919 | #ifdef CONFIG_X86_32 |
913 | if (read_cr0() & X86_CR0_EM) { | 920 | if (read_cr0() & X86_CR0_EM) { |
914 | conditional_sti(regs); | 921 | struct math_emu_info info = { }; |
915 | math_emulate(0); | 922 | |
923 | conditional_sti(®s); | ||
924 | |||
925 | info.regs = ®s; | ||
926 | math_emulate(&info); | ||
916 | } else { | 927 | } else { |
917 | math_state_restore(); /* interrupts still off */ | 928 | math_state_restore(); /* interrupts still off */ |
918 | conditional_sti(regs); | 929 | conditional_sti(®s); |
919 | } | 930 | } |
920 | #else | 931 | #else |
921 | math_state_restore(); | 932 | math_state_restore(); |
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c index 1d3302cc2ddf..bef58b4982db 100644 --- a/arch/x86/kernel/vmi_32.c +++ b/arch/x86/kernel/vmi_32.c | |||
@@ -321,6 +321,16 @@ static void vmi_release_pmd(unsigned long pfn) | |||
321 | } | 321 | } |
322 | 322 | ||
323 | /* | 323 | /* |
324 | * We use the pgd_free hook for releasing the pgd page: | ||
325 | */ | ||
326 | static void vmi_pgd_free(struct mm_struct *mm, pgd_t *pgd) | ||
327 | { | ||
328 | unsigned long pfn = __pa(pgd) >> PAGE_SHIFT; | ||
329 | |||
330 | vmi_ops.release_page(pfn, VMI_PAGE_L2); | ||
331 | } | ||
332 | |||
333 | /* | ||
324 | * Helper macros for MMU update flags. We can defer updates until a flush | 334 | * Helper macros for MMU update flags. We can defer updates until a flush |
325 | * or page invalidation only if the update is to the current address space | 335 | * or page invalidation only if the update is to the current address space |
326 | * (otherwise, there is no flush). We must check against init_mm, since | 336 | * (otherwise, there is no flush). We must check against init_mm, since |
@@ -762,6 +772,7 @@ static inline int __init activate_vmi(void) | |||
762 | if (vmi_ops.release_page) { | 772 | if (vmi_ops.release_page) { |
763 | pv_mmu_ops.release_pte = vmi_release_pte; | 773 | pv_mmu_ops.release_pte = vmi_release_pte; |
764 | pv_mmu_ops.release_pmd = vmi_release_pmd; | 774 | pv_mmu_ops.release_pmd = vmi_release_pmd; |
775 | pv_mmu_ops.pgd_free = vmi_pgd_free; | ||
765 | } | 776 | } |
766 | 777 | ||
767 | /* Set linear is needed in all cases */ | 778 | /* Set linear is needed in all cases */ |
diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c index c4c1f9e09402..e5b088fffa40 100644 --- a/arch/x86/kernel/vmiclock_32.c +++ b/arch/x86/kernel/vmiclock_32.c | |||
@@ -202,7 +202,7 @@ static irqreturn_t vmi_timer_interrupt(int irq, void *dev_id) | |||
202 | static struct irqaction vmi_clock_action = { | 202 | static struct irqaction vmi_clock_action = { |
203 | .name = "vmi-timer", | 203 | .name = "vmi-timer", |
204 | .handler = vmi_timer_interrupt, | 204 | .handler = vmi_timer_interrupt, |
205 | .flags = IRQF_DISABLED | IRQF_NOBALANCING, | 205 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TIMER, |
206 | .mask = CPU_MASK_ALL, | 206 | .mask = CPU_MASK_ALL, |
207 | }; | 207 | }; |
208 | 208 | ||
@@ -283,10 +283,13 @@ void __devinit vmi_time_ap_init(void) | |||
283 | #endif | 283 | #endif |
284 | 284 | ||
285 | /** vmi clocksource */ | 285 | /** vmi clocksource */ |
286 | static struct clocksource clocksource_vmi; | ||
286 | 287 | ||
287 | static cycle_t read_real_cycles(void) | 288 | static cycle_t read_real_cycles(void) |
288 | { | 289 | { |
289 | return vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL); | 290 | cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL); |
291 | return ret >= clocksource_vmi.cycle_last ? | ||
292 | ret : clocksource_vmi.cycle_last; | ||
290 | } | 293 | } |
291 | 294 | ||
292 | static struct clocksource clocksource_vmi = { | 295 | static struct clocksource clocksource_vmi = { |
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index e665d1c623ca..72bd275a9b5c 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c | |||
@@ -207,7 +207,7 @@ static int __pit_timer_fn(struct kvm_kpit_state *ps) | |||
207 | hrtimer_add_expires_ns(&pt->timer, pt->period); | 207 | hrtimer_add_expires_ns(&pt->timer, pt->period); |
208 | pt->scheduled = hrtimer_get_expires_ns(&pt->timer); | 208 | pt->scheduled = hrtimer_get_expires_ns(&pt->timer); |
209 | if (pt->period) | 209 | if (pt->period) |
210 | ps->channels[0].count_load_time = hrtimer_get_expires(&pt->timer); | 210 | ps->channels[0].count_load_time = ktime_get(); |
211 | 211 | ||
212 | return (pt->period == 0 ? 0 : 1); | 212 | return (pt->period == 0 ? 0 : 1); |
213 | } | 213 | } |
diff --git a/arch/x86/kvm/irq.c b/arch/x86/kvm/irq.c index c019b8edcdb7..cf17ed52f6fb 100644 --- a/arch/x86/kvm/irq.c +++ b/arch/x86/kvm/irq.c | |||
@@ -87,13 +87,6 @@ void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu) | |||
87 | } | 87 | } |
88 | EXPORT_SYMBOL_GPL(kvm_inject_pending_timer_irqs); | 88 | EXPORT_SYMBOL_GPL(kvm_inject_pending_timer_irqs); |
89 | 89 | ||
90 | void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec) | ||
91 | { | ||
92 | kvm_apic_timer_intr_post(vcpu, vec); | ||
93 | /* TODO: PIT, RTC etc. */ | ||
94 | } | ||
95 | EXPORT_SYMBOL_GPL(kvm_timer_intr_post); | ||
96 | |||
97 | void __kvm_migrate_timers(struct kvm_vcpu *vcpu) | 90 | void __kvm_migrate_timers(struct kvm_vcpu *vcpu) |
98 | { | 91 | { |
99 | __kvm_migrate_apic_timer(vcpu); | 92 | __kvm_migrate_apic_timer(vcpu); |
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h index 2bf32a03ceec..82579ee538d0 100644 --- a/arch/x86/kvm/irq.h +++ b/arch/x86/kvm/irq.h | |||
@@ -89,7 +89,6 @@ static inline int irqchip_in_kernel(struct kvm *kvm) | |||
89 | 89 | ||
90 | void kvm_pic_reset(struct kvm_kpic_state *s); | 90 | void kvm_pic_reset(struct kvm_kpic_state *s); |
91 | 91 | ||
92 | void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec); | ||
93 | void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu); | 92 | void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu); |
94 | void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu); | 93 | void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu); |
95 | void kvm_apic_nmi_wd_deliver(struct kvm_vcpu *vcpu); | 94 | void kvm_apic_nmi_wd_deliver(struct kvm_vcpu *vcpu); |
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index afac68c0815c..f0b67f2cdd69 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c | |||
@@ -35,6 +35,12 @@ | |||
35 | #include "kvm_cache_regs.h" | 35 | #include "kvm_cache_regs.h" |
36 | #include "irq.h" | 36 | #include "irq.h" |
37 | 37 | ||
38 | #ifndef CONFIG_X86_64 | ||
39 | #define mod_64(x, y) ((x) - (y) * div64_u64(x, y)) | ||
40 | #else | ||
41 | #define mod_64(x, y) ((x) % (y)) | ||
42 | #endif | ||
43 | |||
38 | #define PRId64 "d" | 44 | #define PRId64 "d" |
39 | #define PRIx64 "llx" | 45 | #define PRIx64 "llx" |
40 | #define PRIu64 "u" | 46 | #define PRIu64 "u" |
@@ -511,52 +517,22 @@ static void apic_send_ipi(struct kvm_lapic *apic) | |||
511 | 517 | ||
512 | static u32 apic_get_tmcct(struct kvm_lapic *apic) | 518 | static u32 apic_get_tmcct(struct kvm_lapic *apic) |
513 | { | 519 | { |
514 | u64 counter_passed; | 520 | ktime_t remaining; |
515 | ktime_t passed, now; | 521 | s64 ns; |
516 | u32 tmcct; | 522 | u32 tmcct; |
517 | 523 | ||
518 | ASSERT(apic != NULL); | 524 | ASSERT(apic != NULL); |
519 | 525 | ||
520 | now = apic->timer.dev.base->get_time(); | ||
521 | tmcct = apic_get_reg(apic, APIC_TMICT); | ||
522 | |||
523 | /* if initial count is 0, current count should also be 0 */ | 526 | /* if initial count is 0, current count should also be 0 */ |
524 | if (tmcct == 0) | 527 | if (apic_get_reg(apic, APIC_TMICT) == 0) |
525 | return 0; | 528 | return 0; |
526 | 529 | ||
527 | if (unlikely(ktime_to_ns(now) <= | 530 | remaining = hrtimer_expires_remaining(&apic->timer.dev); |
528 | ktime_to_ns(apic->timer.last_update))) { | 531 | if (ktime_to_ns(remaining) < 0) |
529 | /* Wrap around */ | 532 | remaining = ktime_set(0, 0); |
530 | passed = ktime_add(( { | 533 | |
531 | (ktime_t) { | 534 | ns = mod_64(ktime_to_ns(remaining), apic->timer.period); |
532 | .tv64 = KTIME_MAX - | 535 | tmcct = div64_u64(ns, (APIC_BUS_CYCLE_NS * apic->timer.divide_count)); |
533 | (apic->timer.last_update).tv64}; } | ||
534 | ), now); | ||
535 | apic_debug("time elapsed\n"); | ||
536 | } else | ||
537 | passed = ktime_sub(now, apic->timer.last_update); | ||
538 | |||
539 | counter_passed = div64_u64(ktime_to_ns(passed), | ||
540 | (APIC_BUS_CYCLE_NS * apic->timer.divide_count)); | ||
541 | |||
542 | if (counter_passed > tmcct) { | ||
543 | if (unlikely(!apic_lvtt_period(apic))) { | ||
544 | /* one-shot timers stick at 0 until reset */ | ||
545 | tmcct = 0; | ||
546 | } else { | ||
547 | /* | ||
548 | * periodic timers reset to APIC_TMICT when they | ||
549 | * hit 0. The while loop simulates this happening N | ||
550 | * times. (counter_passed %= tmcct) would also work, | ||
551 | * but might be slower or not work on 32-bit?? | ||
552 | */ | ||
553 | while (counter_passed > tmcct) | ||
554 | counter_passed -= tmcct; | ||
555 | tmcct -= counter_passed; | ||
556 | } | ||
557 | } else { | ||
558 | tmcct -= counter_passed; | ||
559 | } | ||
560 | 536 | ||
561 | return tmcct; | 537 | return tmcct; |
562 | } | 538 | } |
@@ -653,8 +629,6 @@ static void start_apic_timer(struct kvm_lapic *apic) | |||
653 | { | 629 | { |
654 | ktime_t now = apic->timer.dev.base->get_time(); | 630 | ktime_t now = apic->timer.dev.base->get_time(); |
655 | 631 | ||
656 | apic->timer.last_update = now; | ||
657 | |||
658 | apic->timer.period = apic_get_reg(apic, APIC_TMICT) * | 632 | apic->timer.period = apic_get_reg(apic, APIC_TMICT) * |
659 | APIC_BUS_CYCLE_NS * apic->timer.divide_count; | 633 | APIC_BUS_CYCLE_NS * apic->timer.divide_count; |
660 | atomic_set(&apic->timer.pending, 0); | 634 | atomic_set(&apic->timer.pending, 0); |
@@ -1110,16 +1084,6 @@ void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu) | |||
1110 | } | 1084 | } |
1111 | } | 1085 | } |
1112 | 1086 | ||
1113 | void kvm_apic_timer_intr_post(struct kvm_vcpu *vcpu, int vec) | ||
1114 | { | ||
1115 | struct kvm_lapic *apic = vcpu->arch.apic; | ||
1116 | |||
1117 | if (apic && apic_lvt_vector(apic, APIC_LVTT) == vec) | ||
1118 | apic->timer.last_update = ktime_add_ns( | ||
1119 | apic->timer.last_update, | ||
1120 | apic->timer.period); | ||
1121 | } | ||
1122 | |||
1123 | int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu) | 1087 | int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu) |
1124 | { | 1088 | { |
1125 | int vector = kvm_apic_has_interrupt(vcpu); | 1089 | int vector = kvm_apic_has_interrupt(vcpu); |
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h index 81858881287e..45ab6ee71209 100644 --- a/arch/x86/kvm/lapic.h +++ b/arch/x86/kvm/lapic.h | |||
@@ -12,7 +12,6 @@ struct kvm_lapic { | |||
12 | atomic_t pending; | 12 | atomic_t pending; |
13 | s64 period; /* unit: ns */ | 13 | s64 period; /* unit: ns */ |
14 | u32 divide_count; | 14 | u32 divide_count; |
15 | ktime_t last_update; | ||
16 | struct hrtimer dev; | 15 | struct hrtimer dev; |
17 | } timer; | 16 | } timer; |
18 | struct kvm_vcpu *vcpu; | 17 | struct kvm_vcpu *vcpu; |
@@ -42,7 +41,6 @@ void kvm_set_apic_base(struct kvm_vcpu *vcpu, u64 data); | |||
42 | void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu); | 41 | void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu); |
43 | int kvm_lapic_enabled(struct kvm_vcpu *vcpu); | 42 | int kvm_lapic_enabled(struct kvm_vcpu *vcpu); |
44 | int kvm_lapic_find_highest_irr(struct kvm_vcpu *vcpu); | 43 | int kvm_lapic_find_highest_irr(struct kvm_vcpu *vcpu); |
45 | void kvm_apic_timer_intr_post(struct kvm_vcpu *vcpu, int vec); | ||
46 | 44 | ||
47 | void kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr); | 45 | void kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr); |
48 | void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu); | 46 | void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu); |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 83f11c7474a1..2d4477c71473 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -1698,8 +1698,13 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte, | |||
1698 | if (largepage) | 1698 | if (largepage) |
1699 | spte |= PT_PAGE_SIZE_MASK; | 1699 | spte |= PT_PAGE_SIZE_MASK; |
1700 | if (mt_mask) { | 1700 | if (mt_mask) { |
1701 | mt_mask = get_memory_type(vcpu, gfn) << | 1701 | if (!kvm_is_mmio_pfn(pfn)) { |
1702 | kvm_x86_ops->get_mt_mask_shift(); | 1702 | mt_mask = get_memory_type(vcpu, gfn) << |
1703 | kvm_x86_ops->get_mt_mask_shift(); | ||
1704 | mt_mask |= VMX_EPT_IGMT_BIT; | ||
1705 | } else | ||
1706 | mt_mask = MTRR_TYPE_UNCACHABLE << | ||
1707 | kvm_x86_ops->get_mt_mask_shift(); | ||
1703 | spte |= mt_mask; | 1708 | spte |= mt_mask; |
1704 | } | 1709 | } |
1705 | 1710 | ||
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 1452851ae258..a9e769e4e251 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1600,7 +1600,6 @@ static void svm_intr_assist(struct kvm_vcpu *vcpu) | |||
1600 | /* Okay, we can deliver the interrupt: grab it and update PIC state. */ | 1600 | /* Okay, we can deliver the interrupt: grab it and update PIC state. */ |
1601 | intr_vector = kvm_cpu_get_interrupt(vcpu); | 1601 | intr_vector = kvm_cpu_get_interrupt(vcpu); |
1602 | svm_inject_irq(svm, intr_vector); | 1602 | svm_inject_irq(svm, intr_vector); |
1603 | kvm_timer_intr_post(vcpu, intr_vector); | ||
1604 | out: | 1603 | out: |
1605 | update_cr8_intercept(vcpu); | 1604 | update_cr8_intercept(vcpu); |
1606 | } | 1605 | } |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6259d7467648..7611af576829 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -903,6 +903,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) | |||
903 | data = vmcs_readl(GUEST_SYSENTER_ESP); | 903 | data = vmcs_readl(GUEST_SYSENTER_ESP); |
904 | break; | 904 | break; |
905 | default: | 905 | default: |
906 | vmx_load_host_state(to_vmx(vcpu)); | ||
906 | msr = find_msr_entry(to_vmx(vcpu), msr_index); | 907 | msr = find_msr_entry(to_vmx(vcpu), msr_index); |
907 | if (msr) { | 908 | if (msr) { |
908 | data = msr->data; | 909 | data = msr->data; |
@@ -3285,7 +3286,6 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu) | |||
3285 | } | 3286 | } |
3286 | if (vcpu->arch.interrupt.pending) { | 3287 | if (vcpu->arch.interrupt.pending) { |
3287 | vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr); | 3288 | vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr); |
3288 | kvm_timer_intr_post(vcpu, vcpu->arch.interrupt.nr); | ||
3289 | if (kvm_cpu_has_interrupt(vcpu)) | 3289 | if (kvm_cpu_has_interrupt(vcpu)) |
3290 | enable_irq_window(vcpu); | 3290 | enable_irq_window(vcpu); |
3291 | } | 3291 | } |
@@ -3687,8 +3687,7 @@ static int __init vmx_init(void) | |||
3687 | if (vm_need_ept()) { | 3687 | if (vm_need_ept()) { |
3688 | bypass_guest_pf = 0; | 3688 | bypass_guest_pf = 0; |
3689 | kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK | | 3689 | kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK | |
3690 | VMX_EPT_WRITABLE_MASK | | 3690 | VMX_EPT_WRITABLE_MASK); |
3691 | VMX_EPT_IGMT_BIT); | ||
3692 | kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, | 3691 | kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, |
3693 | VMX_EPT_EXECUTABLE_MASK, | 3692 | VMX_EPT_EXECUTABLE_MASK, |
3694 | VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT); | 3693 | VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT); |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cc17546a2406..758b7a155ae9 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -967,7 +967,6 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
967 | case KVM_CAP_MMU_SHADOW_CACHE_CONTROL: | 967 | case KVM_CAP_MMU_SHADOW_CACHE_CONTROL: |
968 | case KVM_CAP_SET_TSS_ADDR: | 968 | case KVM_CAP_SET_TSS_ADDR: |
969 | case KVM_CAP_EXT_CPUID: | 969 | case KVM_CAP_EXT_CPUID: |
970 | case KVM_CAP_CLOCKSOURCE: | ||
971 | case KVM_CAP_PIT: | 970 | case KVM_CAP_PIT: |
972 | case KVM_CAP_NOP_IO_DELAY: | 971 | case KVM_CAP_NOP_IO_DELAY: |
973 | case KVM_CAP_MP_STATE: | 972 | case KVM_CAP_MP_STATE: |
@@ -992,6 +991,9 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
992 | case KVM_CAP_IOMMU: | 991 | case KVM_CAP_IOMMU: |
993 | r = iommu_found(); | 992 | r = iommu_found(); |
994 | break; | 993 | break; |
994 | case KVM_CAP_CLOCKSOURCE: | ||
995 | r = boot_cpu_has(X86_FEATURE_CONSTANT_TSC); | ||
996 | break; | ||
995 | default: | 997 | default: |
996 | r = 0; | 998 | r = 0; |
997 | break; | 999 | break; |
@@ -4127,9 +4129,13 @@ static void kvm_free_vcpus(struct kvm *kvm) | |||
4127 | 4129 | ||
4128 | } | 4130 | } |
4129 | 4131 | ||
4130 | void kvm_arch_destroy_vm(struct kvm *kvm) | 4132 | void kvm_arch_sync_events(struct kvm *kvm) |
4131 | { | 4133 | { |
4132 | kvm_free_all_assigned_devices(kvm); | 4134 | kvm_free_all_assigned_devices(kvm); |
4135 | } | ||
4136 | |||
4137 | void kvm_arch_destroy_vm(struct kvm *kvm) | ||
4138 | { | ||
4133 | kvm_iommu_unmap_guest(kvm); | 4139 | kvm_iommu_unmap_guest(kvm); |
4134 | kvm_free_pit(kvm); | 4140 | kvm_free_pit(kvm); |
4135 | kfree(kvm->arch.vpic); | 4141 | kfree(kvm->arch.vpic); |
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index 92f1c6f3e19d..960a8d9c049c 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -343,6 +343,11 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx, | |||
343 | * flush_tlb_user() for both user and kernel mappings unless | 343 | * flush_tlb_user() for both user and kernel mappings unless |
344 | * the Page Global Enable (PGE) feature bit is set. */ | 344 | * the Page Global Enable (PGE) feature bit is set. */ |
345 | *dx |= 0x00002000; | 345 | *dx |= 0x00002000; |
346 | /* We also lie, and say we're family id 5. 6 or greater | ||
347 | * leads to a rdmsr in early_init_intel which we can't handle. | ||
348 | * Family ID is returned as bits 8-12 in ax. */ | ||
349 | *ax &= 0xFFFFF0FF; | ||
350 | *ax |= 0x00000500; | ||
346 | break; | 351 | break; |
347 | case 0x80000000: | 352 | case 0x80000000: |
348 | /* Futureproof this a little: if they ask how much extended | 353 | /* Futureproof this a little: if they ask how much extended |
@@ -589,19 +594,21 @@ static void __init lguest_init_IRQ(void) | |||
589 | /* Some systems map "vectors" to interrupts weirdly. Lguest has | 594 | /* Some systems map "vectors" to interrupts weirdly. Lguest has |
590 | * a straightforward 1 to 1 mapping, so force that here. */ | 595 | * a straightforward 1 to 1 mapping, so force that here. */ |
591 | __get_cpu_var(vector_irq)[vector] = i; | 596 | __get_cpu_var(vector_irq)[vector] = i; |
592 | if (vector != SYSCALL_VECTOR) { | 597 | if (vector != SYSCALL_VECTOR) |
593 | set_intr_gate(vector, | 598 | set_intr_gate(vector, interrupt[i]); |
594 | interrupt[vector-FIRST_EXTERNAL_VECTOR]); | ||
595 | set_irq_chip_and_handler_name(i, &lguest_irq_controller, | ||
596 | handle_level_irq, | ||
597 | "level"); | ||
598 | } | ||
599 | } | 599 | } |
600 | /* This call is required to set up for 4k stacks, where we have | 600 | /* This call is required to set up for 4k stacks, where we have |
601 | * separate stacks for hard and soft interrupts. */ | 601 | * separate stacks for hard and soft interrupts. */ |
602 | irq_ctx_init(smp_processor_id()); | 602 | irq_ctx_init(smp_processor_id()); |
603 | } | 603 | } |
604 | 604 | ||
605 | void lguest_setup_irq(unsigned int irq) | ||
606 | { | ||
607 | irq_to_desc_alloc_cpu(irq, 0); | ||
608 | set_irq_chip_and_handler_name(irq, &lguest_irq_controller, | ||
609 | handle_level_irq, "level"); | ||
610 | } | ||
611 | |||
605 | /* | 612 | /* |
606 | * Time. | 613 | * Time. |
607 | * | 614 | * |
diff --git a/arch/x86/mach-default/setup.c b/arch/x86/mach-default/setup.c index a265a7c63190..50b591871128 100644 --- a/arch/x86/mach-default/setup.c +++ b/arch/x86/mach-default/setup.c | |||
@@ -96,7 +96,7 @@ void __init trap_init_hook(void) | |||
96 | 96 | ||
97 | static struct irqaction irq0 = { | 97 | static struct irqaction irq0 = { |
98 | .handler = timer_interrupt, | 98 | .handler = timer_interrupt, |
99 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL, | 99 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER, |
100 | .mask = CPU_MASK_NONE, | 100 | .mask = CPU_MASK_NONE, |
101 | .name = "timer" | 101 | .name = "timer" |
102 | }; | 102 | }; |
diff --git a/arch/x86/mach-voyager/setup.c b/arch/x86/mach-voyager/setup.c index d914a7996a66..8e5118371f0f 100644 --- a/arch/x86/mach-voyager/setup.c +++ b/arch/x86/mach-voyager/setup.c | |||
@@ -56,7 +56,7 @@ void __init trap_init_hook(void) | |||
56 | 56 | ||
57 | static struct irqaction irq0 = { | 57 | static struct irqaction irq0 = { |
58 | .handler = timer_interrupt, | 58 | .handler = timer_interrupt, |
59 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL, | 59 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER, |
60 | .mask = CPU_MASK_NONE, | 60 | .mask = CPU_MASK_NONE, |
61 | .name = "timer" | 61 | .name = "timer" |
62 | }; | 62 | }; |
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index 7ffcdeec4631..b9cc84a2a4fc 100644 --- a/arch/x86/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c | |||
@@ -65,7 +65,7 @@ static volatile unsigned long smp_invalidate_needed; | |||
65 | 65 | ||
66 | /* Bitmask of CPUs present in the system - exported by i386_syms.c, used | 66 | /* Bitmask of CPUs present in the system - exported by i386_syms.c, used |
67 | * by scheduler but indexed physically */ | 67 | * by scheduler but indexed physically */ |
68 | cpumask_t phys_cpu_present_map = CPU_MASK_NONE; | 68 | static cpumask_t voyager_phys_cpu_present_map = CPU_MASK_NONE; |
69 | 69 | ||
70 | /* The internal functions */ | 70 | /* The internal functions */ |
71 | static void send_CPI(__u32 cpuset, __u8 cpi); | 71 | static void send_CPI(__u32 cpuset, __u8 cpi); |
@@ -366,19 +366,19 @@ void __init find_smp_config(void) | |||
366 | /* set up everything for just this CPU, we can alter | 366 | /* set up everything for just this CPU, we can alter |
367 | * this as we start the other CPUs later */ | 367 | * this as we start the other CPUs later */ |
368 | /* now get the CPU disposition from the extended CMOS */ | 368 | /* now get the CPU disposition from the extended CMOS */ |
369 | cpus_addr(phys_cpu_present_map)[0] = | 369 | cpus_addr(voyager_phys_cpu_present_map)[0] = |
370 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK); | 370 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK); |
371 | cpus_addr(phys_cpu_present_map)[0] |= | 371 | cpus_addr(voyager_phys_cpu_present_map)[0] |= |
372 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 1) << 8; | 372 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 1) << 8; |
373 | cpus_addr(phys_cpu_present_map)[0] |= | 373 | cpus_addr(voyager_phys_cpu_present_map)[0] |= |
374 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + | 374 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + |
375 | 2) << 16; | 375 | 2) << 16; |
376 | cpus_addr(phys_cpu_present_map)[0] |= | 376 | cpus_addr(voyager_phys_cpu_present_map)[0] |= |
377 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + | 377 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + |
378 | 3) << 24; | 378 | 3) << 24; |
379 | init_cpu_possible(&phys_cpu_present_map); | 379 | init_cpu_possible(&voyager_phys_cpu_present_map); |
380 | printk("VOYAGER SMP: phys_cpu_present_map = 0x%lx\n", | 380 | printk("VOYAGER SMP: voyager_phys_cpu_present_map = 0x%lx\n", |
381 | cpus_addr(phys_cpu_present_map)[0]); | 381 | cpus_addr(voyager_phys_cpu_present_map)[0]); |
382 | /* Here we set up the VIC to enable SMP */ | 382 | /* Here we set up the VIC to enable SMP */ |
383 | /* enable the CPIs by writing the base vector to their register */ | 383 | /* enable the CPIs by writing the base vector to their register */ |
384 | outb(VIC_DEFAULT_CPI_BASE, VIC_CPI_BASE_REGISTER); | 384 | outb(VIC_DEFAULT_CPI_BASE, VIC_CPI_BASE_REGISTER); |
@@ -628,15 +628,15 @@ void __init smp_boot_cpus(void) | |||
628 | /* now that the cat has probed the Voyager System Bus, sanity | 628 | /* now that the cat has probed the Voyager System Bus, sanity |
629 | * check the cpu map */ | 629 | * check the cpu map */ |
630 | if (((voyager_quad_processors | voyager_extended_vic_processors) | 630 | if (((voyager_quad_processors | voyager_extended_vic_processors) |
631 | & cpus_addr(phys_cpu_present_map)[0]) != | 631 | & cpus_addr(voyager_phys_cpu_present_map)[0]) != |
632 | cpus_addr(phys_cpu_present_map)[0]) { | 632 | cpus_addr(voyager_phys_cpu_present_map)[0]) { |
633 | /* should panic */ | 633 | /* should panic */ |
634 | printk("\n\n***WARNING*** " | 634 | printk("\n\n***WARNING*** " |
635 | "Sanity check of CPU present map FAILED\n"); | 635 | "Sanity check of CPU present map FAILED\n"); |
636 | } | 636 | } |
637 | } else if (voyager_level == 4) | 637 | } else if (voyager_level == 4) |
638 | voyager_extended_vic_processors = | 638 | voyager_extended_vic_processors = |
639 | cpus_addr(phys_cpu_present_map)[0]; | 639 | cpus_addr(voyager_phys_cpu_present_map)[0]; |
640 | 640 | ||
641 | /* this sets up the idle task to run on the current cpu */ | 641 | /* this sets up the idle task to run on the current cpu */ |
642 | voyager_extended_cpus = 1; | 642 | voyager_extended_cpus = 1; |
@@ -670,7 +670,7 @@ void __init smp_boot_cpus(void) | |||
670 | /* loop over all the extended VIC CPUs and boot them. The | 670 | /* loop over all the extended VIC CPUs and boot them. The |
671 | * Quad CPUs must be bootstrapped by their extended VIC cpu */ | 671 | * Quad CPUs must be bootstrapped by their extended VIC cpu */ |
672 | for (i = 0; i < nr_cpu_ids; i++) { | 672 | for (i = 0; i < nr_cpu_ids; i++) { |
673 | if (i == boot_cpu_id || !cpu_isset(i, phys_cpu_present_map)) | 673 | if (i == boot_cpu_id || !cpu_isset(i, voyager_phys_cpu_present_map)) |
674 | continue; | 674 | continue; |
675 | do_boot_cpu(i); | 675 | do_boot_cpu(i); |
676 | /* This udelay seems to be needed for the Quad boots | 676 | /* This udelay seems to be needed for the Quad boots |
diff --git a/arch/x86/math-emu/fpu_aux.c b/arch/x86/math-emu/fpu_aux.c index 491e737ce547..aa0987088774 100644 --- a/arch/x86/math-emu/fpu_aux.c +++ b/arch/x86/math-emu/fpu_aux.c | |||
@@ -30,20 +30,29 @@ static void fclex(void) | |||
30 | } | 30 | } |
31 | 31 | ||
32 | /* Needs to be externally visible */ | 32 | /* Needs to be externally visible */ |
33 | void finit(void) | 33 | void finit_task(struct task_struct *tsk) |
34 | { | 34 | { |
35 | control_word = 0x037f; | 35 | struct i387_soft_struct *soft = &tsk->thread.xstate->soft; |
36 | partial_status = 0; | 36 | struct address *oaddr, *iaddr; |
37 | top = 0; /* We don't keep top in the status word internally. */ | 37 | soft->cwd = 0x037f; |
38 | fpu_tag_word = 0xffff; | 38 | soft->swd = 0; |
39 | soft->ftop = 0; /* We don't keep top in the status word internally. */ | ||
40 | soft->twd = 0xffff; | ||
39 | /* The behaviour is different from that detailed in | 41 | /* The behaviour is different from that detailed in |
40 | Section 15.1.6 of the Intel manual */ | 42 | Section 15.1.6 of the Intel manual */ |
41 | operand_address.offset = 0; | 43 | oaddr = (struct address *)&soft->foo; |
42 | operand_address.selector = 0; | 44 | oaddr->offset = 0; |
43 | instruction_address.offset = 0; | 45 | oaddr->selector = 0; |
44 | instruction_address.selector = 0; | 46 | iaddr = (struct address *)&soft->fip; |
45 | instruction_address.opcode = 0; | 47 | iaddr->offset = 0; |
46 | no_ip_update = 1; | 48 | iaddr->selector = 0; |
49 | iaddr->opcode = 0; | ||
50 | soft->no_update = 1; | ||
51 | } | ||
52 | |||
53 | void finit(void) | ||
54 | { | ||
55 | finit_task(current); | ||
47 | } | 56 | } |
48 | 57 | ||
49 | /* | 58 | /* |
diff --git a/arch/x86/math-emu/fpu_entry.c b/arch/x86/math-emu/fpu_entry.c index c7b06feb139b..5d87f586f8d7 100644 --- a/arch/x86/math-emu/fpu_entry.c +++ b/arch/x86/math-emu/fpu_entry.c | |||
@@ -131,7 +131,7 @@ u_char emulating = 0; | |||
131 | static int valid_prefix(u_char *Byte, u_char __user ** fpu_eip, | 131 | static int valid_prefix(u_char *Byte, u_char __user ** fpu_eip, |
132 | overrides * override); | 132 | overrides * override); |
133 | 133 | ||
134 | asmlinkage void math_emulate(long arg) | 134 | void math_emulate(struct math_emu_info *info) |
135 | { | 135 | { |
136 | u_char FPU_modrm, byte1; | 136 | u_char FPU_modrm, byte1; |
137 | unsigned short code; | 137 | unsigned short code; |
@@ -161,7 +161,7 @@ asmlinkage void math_emulate(long arg) | |||
161 | RE_ENTRANT_CHECK_ON; | 161 | RE_ENTRANT_CHECK_ON; |
162 | #endif /* RE_ENTRANT_CHECKING */ | 162 | #endif /* RE_ENTRANT_CHECKING */ |
163 | 163 | ||
164 | SETUP_DATA_AREA(arg); | 164 | FPU_info = info; |
165 | 165 | ||
166 | FPU_ORIG_EIP = FPU_EIP; | 166 | FPU_ORIG_EIP = FPU_EIP; |
167 | 167 | ||
@@ -659,7 +659,7 @@ static int valid_prefix(u_char *Byte, u_char __user **fpu_eip, | |||
659 | } | 659 | } |
660 | } | 660 | } |
661 | 661 | ||
662 | void math_abort(struct info *info, unsigned int signal) | 662 | void math_abort(struct math_emu_info *info, unsigned int signal) |
663 | { | 663 | { |
664 | FPU_EIP = FPU_ORIG_EIP; | 664 | FPU_EIP = FPU_ORIG_EIP; |
665 | current->thread.trap_no = 16; | 665 | current->thread.trap_no = 16; |
diff --git a/arch/x86/math-emu/fpu_proto.h b/arch/x86/math-emu/fpu_proto.h index aa49b6a0d850..9779df436b7d 100644 --- a/arch/x86/math-emu/fpu_proto.h +++ b/arch/x86/math-emu/fpu_proto.h | |||
@@ -51,8 +51,8 @@ extern void ffreep(void); | |||
51 | extern void fst_i_(void); | 51 | extern void fst_i_(void); |
52 | extern void fstp_i(void); | 52 | extern void fstp_i(void); |
53 | /* fpu_entry.c */ | 53 | /* fpu_entry.c */ |
54 | asmlinkage extern void math_emulate(long arg); | 54 | extern void math_emulate(struct math_emu_info *info); |
55 | extern void math_abort(struct info *info, unsigned int signal); | 55 | extern void math_abort(struct math_emu_info *info, unsigned int signal); |
56 | /* fpu_etc.c */ | 56 | /* fpu_etc.c */ |
57 | extern void FPU_etc(void); | 57 | extern void FPU_etc(void); |
58 | /* fpu_tags.c */ | 58 | /* fpu_tags.c */ |
diff --git a/arch/x86/math-emu/fpu_system.h b/arch/x86/math-emu/fpu_system.h index 13488fa153e0..50fa0ec2c8a5 100644 --- a/arch/x86/math-emu/fpu_system.h +++ b/arch/x86/math-emu/fpu_system.h | |||
@@ -16,10 +16,6 @@ | |||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
18 | 18 | ||
19 | /* This sets the pointer FPU_info to point to the argument part | ||
20 | of the stack frame of math_emulate() */ | ||
21 | #define SETUP_DATA_AREA(arg) FPU_info = (struct info *) &arg | ||
22 | |||
23 | /* s is always from a cpu register, and the cpu does bounds checking | 19 | /* s is always from a cpu register, and the cpu does bounds checking |
24 | * during register load --> no further bounds checks needed */ | 20 | * during register load --> no further bounds checks needed */ |
25 | #define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.ldt)[(s) >> 3]) | 21 | #define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.ldt)[(s) >> 3]) |
@@ -38,12 +34,12 @@ | |||
38 | #define I387 (current->thread.xstate) | 34 | #define I387 (current->thread.xstate) |
39 | #define FPU_info (I387->soft.info) | 35 | #define FPU_info (I387->soft.info) |
40 | 36 | ||
41 | #define FPU_CS (*(unsigned short *) &(FPU_info->___cs)) | 37 | #define FPU_CS (*(unsigned short *) &(FPU_info->regs->cs)) |
42 | #define FPU_SS (*(unsigned short *) &(FPU_info->___ss)) | 38 | #define FPU_SS (*(unsigned short *) &(FPU_info->regs->ss)) |
43 | #define FPU_DS (*(unsigned short *) &(FPU_info->___ds)) | 39 | #define FPU_DS (*(unsigned short *) &(FPU_info->regs->ds)) |
44 | #define FPU_EAX (FPU_info->___eax) | 40 | #define FPU_EAX (FPU_info->regs->ax) |
45 | #define FPU_EFLAGS (FPU_info->___eflags) | 41 | #define FPU_EFLAGS (FPU_info->regs->flags) |
46 | #define FPU_EIP (FPU_info->___eip) | 42 | #define FPU_EIP (FPU_info->regs->ip) |
47 | #define FPU_ORIG_EIP (FPU_info->___orig_eip) | 43 | #define FPU_ORIG_EIP (FPU_info->___orig_eip) |
48 | 44 | ||
49 | #define FPU_lookahead (I387->soft.lookahead) | 45 | #define FPU_lookahead (I387->soft.lookahead) |
diff --git a/arch/x86/math-emu/get_address.c b/arch/x86/math-emu/get_address.c index d701e2b39e44..420b3b6e3915 100644 --- a/arch/x86/math-emu/get_address.c +++ b/arch/x86/math-emu/get_address.c | |||
@@ -29,46 +29,43 @@ | |||
29 | #define FPU_WRITE_BIT 0x10 | 29 | #define FPU_WRITE_BIT 0x10 |
30 | 30 | ||
31 | static int reg_offset[] = { | 31 | static int reg_offset[] = { |
32 | offsetof(struct info, ___eax), | 32 | offsetof(struct pt_regs, ax), |
33 | offsetof(struct info, ___ecx), | 33 | offsetof(struct pt_regs, cx), |
34 | offsetof(struct info, ___edx), | 34 | offsetof(struct pt_regs, dx), |
35 | offsetof(struct info, ___ebx), | 35 | offsetof(struct pt_regs, bx), |
36 | offsetof(struct info, ___esp), | 36 | offsetof(struct pt_regs, sp), |
37 | offsetof(struct info, ___ebp), | 37 | offsetof(struct pt_regs, bp), |
38 | offsetof(struct info, ___esi), | 38 | offsetof(struct pt_regs, si), |
39 | offsetof(struct info, ___edi) | 39 | offsetof(struct pt_regs, di) |
40 | }; | 40 | }; |
41 | 41 | ||
42 | #define REG_(x) (*(long *)(reg_offset[(x)]+(u_char *) FPU_info)) | 42 | #define REG_(x) (*(long *)(reg_offset[(x)] + (u_char *)FPU_info->regs)) |
43 | 43 | ||
44 | static int reg_offset_vm86[] = { | 44 | static int reg_offset_vm86[] = { |
45 | offsetof(struct info, ___cs), | 45 | offsetof(struct pt_regs, cs), |
46 | offsetof(struct info, ___vm86_ds), | 46 | offsetof(struct kernel_vm86_regs, ds), |
47 | offsetof(struct info, ___vm86_es), | 47 | offsetof(struct kernel_vm86_regs, es), |
48 | offsetof(struct info, ___vm86_fs), | 48 | offsetof(struct kernel_vm86_regs, fs), |
49 | offsetof(struct info, ___vm86_gs), | 49 | offsetof(struct kernel_vm86_regs, gs), |
50 | offsetof(struct info, ___ss), | 50 | offsetof(struct pt_regs, ss), |
51 | offsetof(struct info, ___vm86_ds) | 51 | offsetof(struct kernel_vm86_regs, ds) |
52 | }; | 52 | }; |
53 | 53 | ||
54 | #define VM86_REG_(x) (*(unsigned short *) \ | 54 | #define VM86_REG_(x) (*(unsigned short *) \ |
55 | (reg_offset_vm86[((unsigned)x)]+(u_char *) FPU_info)) | 55 | (reg_offset_vm86[((unsigned)x)] + (u_char *)FPU_info->regs)) |
56 | |||
57 | /* This dummy, gs is not saved on the stack. */ | ||
58 | #define ___GS ___ds | ||
59 | 56 | ||
60 | static int reg_offset_pm[] = { | 57 | static int reg_offset_pm[] = { |
61 | offsetof(struct info, ___cs), | 58 | offsetof(struct pt_regs, cs), |
62 | offsetof(struct info, ___ds), | 59 | offsetof(struct pt_regs, ds), |
63 | offsetof(struct info, ___es), | 60 | offsetof(struct pt_regs, es), |
64 | offsetof(struct info, ___fs), | 61 | offsetof(struct pt_regs, fs), |
65 | offsetof(struct info, ___GS), | 62 | offsetof(struct pt_regs, ds), /* dummy, not saved on stack */ |
66 | offsetof(struct info, ___ss), | 63 | offsetof(struct pt_regs, ss), |
67 | offsetof(struct info, ___ds) | 64 | offsetof(struct pt_regs, ds) |
68 | }; | 65 | }; |
69 | 66 | ||
70 | #define PM_REG_(x) (*(unsigned short *) \ | 67 | #define PM_REG_(x) (*(unsigned short *) \ |
71 | (reg_offset_pm[((unsigned)x)]+(u_char *) FPU_info)) | 68 | (reg_offset_pm[((unsigned)x)] + (u_char *)FPU_info->regs)) |
72 | 69 | ||
73 | /* Decode the SIB byte. This function assumes mod != 0 */ | 70 | /* Decode the SIB byte. This function assumes mod != 0 */ |
74 | static int sib(int mod, unsigned long *fpu_eip) | 71 | static int sib(int mod, unsigned long *fpu_eip) |
@@ -349,34 +346,34 @@ void __user *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip, | |||
349 | } | 346 | } |
350 | switch (rm) { | 347 | switch (rm) { |
351 | case 0: | 348 | case 0: |
352 | address += FPU_info->___ebx + FPU_info->___esi; | 349 | address += FPU_info->regs->bx + FPU_info->regs->si; |
353 | break; | 350 | break; |
354 | case 1: | 351 | case 1: |
355 | address += FPU_info->___ebx + FPU_info->___edi; | 352 | address += FPU_info->regs->bx + FPU_info->regs->di; |
356 | break; | 353 | break; |
357 | case 2: | 354 | case 2: |
358 | address += FPU_info->___ebp + FPU_info->___esi; | 355 | address += FPU_info->regs->bp + FPU_info->regs->si; |
359 | if (addr_modes.override.segment == PREFIX_DEFAULT) | 356 | if (addr_modes.override.segment == PREFIX_DEFAULT) |
360 | addr_modes.override.segment = PREFIX_SS_; | 357 | addr_modes.override.segment = PREFIX_SS_; |
361 | break; | 358 | break; |
362 | case 3: | 359 | case 3: |
363 | address += FPU_info->___ebp + FPU_info->___edi; | 360 | address += FPU_info->regs->bp + FPU_info->regs->di; |
364 | if (addr_modes.override.segment == PREFIX_DEFAULT) | 361 | if (addr_modes.override.segment == PREFIX_DEFAULT) |
365 | addr_modes.override.segment = PREFIX_SS_; | 362 | addr_modes.override.segment = PREFIX_SS_; |
366 | break; | 363 | break; |
367 | case 4: | 364 | case 4: |
368 | address += FPU_info->___esi; | 365 | address += FPU_info->regs->si; |
369 | break; | 366 | break; |
370 | case 5: | 367 | case 5: |
371 | address += FPU_info->___edi; | 368 | address += FPU_info->regs->di; |
372 | break; | 369 | break; |
373 | case 6: | 370 | case 6: |
374 | address += FPU_info->___ebp; | 371 | address += FPU_info->regs->bp; |
375 | if (addr_modes.override.segment == PREFIX_DEFAULT) | 372 | if (addr_modes.override.segment == PREFIX_DEFAULT) |
376 | addr_modes.override.segment = PREFIX_SS_; | 373 | addr_modes.override.segment = PREFIX_SS_; |
377 | break; | 374 | break; |
378 | case 7: | 375 | case 7: |
379 | address += FPU_info->___ebx; | 376 | address += FPU_info->regs->bx; |
380 | break; | 377 | break; |
381 | } | 378 | } |
382 | 379 | ||
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index e6d36b490250..b1352250096e 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -714,6 +714,8 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
714 | pos = start_pfn << PAGE_SHIFT; | 714 | pos = start_pfn << PAGE_SHIFT; |
715 | end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT) | 715 | end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT) |
716 | << (PMD_SHIFT - PAGE_SHIFT); | 716 | << (PMD_SHIFT - PAGE_SHIFT); |
717 | if (end_pfn > (end >> PAGE_SHIFT)) | ||
718 | end_pfn = end >> PAGE_SHIFT; | ||
717 | if (start_pfn < end_pfn) { | 719 | if (start_pfn < end_pfn) { |
718 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); | 720 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); |
719 | pos = end_pfn << PAGE_SHIFT; | 721 | pos = end_pfn << PAGE_SHIFT; |
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c index ca53224fc56c..04102d42ff42 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c | |||
@@ -20,6 +20,17 @@ | |||
20 | #include <asm/pat.h> | 20 | #include <asm/pat.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | 22 | ||
23 | int is_io_mapping_possible(resource_size_t base, unsigned long size) | ||
24 | { | ||
25 | #ifndef CONFIG_X86_PAE | ||
26 | /* There is no way to map greater than 1 << 32 address without PAE */ | ||
27 | if (base + size > 0x100000000ULL) | ||
28 | return 0; | ||
29 | #endif | ||
30 | return 1; | ||
31 | } | ||
32 | EXPORT_SYMBOL_GPL(is_io_mapping_possible); | ||
33 | |||
23 | /* Map 'pfn' using fixed map 'type' and protections 'prot' | 34 | /* Map 'pfn' using fixed map 'type' and protections 'prot' |
24 | */ | 35 | */ |
25 | void * | 36 | void * |
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index af750ab973b6..f45d5e29a72e 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -134,25 +134,6 @@ int page_is_ram(unsigned long pagenr) | |||
134 | return 0; | 134 | return 0; |
135 | } | 135 | } |
136 | 136 | ||
137 | int pagerange_is_ram(unsigned long start, unsigned long end) | ||
138 | { | ||
139 | int ram_page = 0, not_rampage = 0; | ||
140 | unsigned long page_nr; | ||
141 | |||
142 | for (page_nr = (start >> PAGE_SHIFT); page_nr < (end >> PAGE_SHIFT); | ||
143 | ++page_nr) { | ||
144 | if (page_is_ram(page_nr)) | ||
145 | ram_page = 1; | ||
146 | else | ||
147 | not_rampage = 1; | ||
148 | |||
149 | if (ram_page == not_rampage) | ||
150 | return -1; | ||
151 | } | ||
152 | |||
153 | return ram_page; | ||
154 | } | ||
155 | |||
156 | /* | 137 | /* |
157 | * Fix up the linear direct mapping of the kernel to avoid cache attribute | 138 | * Fix up the linear direct mapping of the kernel to avoid cache attribute |
158 | * conflicts. | 139 | * conflicts. |
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index 93d82038af4b..6a518dd08a36 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c | |||
@@ -32,11 +32,14 @@ struct kmmio_fault_page { | |||
32 | struct list_head list; | 32 | struct list_head list; |
33 | struct kmmio_fault_page *release_next; | 33 | struct kmmio_fault_page *release_next; |
34 | unsigned long page; /* location of the fault page */ | 34 | unsigned long page; /* location of the fault page */ |
35 | bool old_presence; /* page presence prior to arming */ | ||
36 | bool armed; | ||
35 | 37 | ||
36 | /* | 38 | /* |
37 | * Number of times this page has been registered as a part | 39 | * Number of times this page has been registered as a part |
38 | * of a probe. If zero, page is disarmed and this may be freed. | 40 | * of a probe. If zero, page is disarmed and this may be freed. |
39 | * Used only by writers (RCU). | 41 | * Used only by writers (RCU) and post_kmmio_handler(). |
42 | * Protected by kmmio_lock, when linked into kmmio_page_table. | ||
40 | */ | 43 | */ |
41 | int count; | 44 | int count; |
42 | }; | 45 | }; |
@@ -105,57 +108,85 @@ static struct kmmio_fault_page *get_kmmio_fault_page(unsigned long page) | |||
105 | return NULL; | 108 | return NULL; |
106 | } | 109 | } |
107 | 110 | ||
108 | static void set_page_present(unsigned long addr, bool present, | 111 | static void set_pmd_presence(pmd_t *pmd, bool present, bool *old) |
109 | unsigned int *pglevel) | 112 | { |
113 | pmdval_t v = pmd_val(*pmd); | ||
114 | *old = !!(v & _PAGE_PRESENT); | ||
115 | v &= ~_PAGE_PRESENT; | ||
116 | if (present) | ||
117 | v |= _PAGE_PRESENT; | ||
118 | set_pmd(pmd, __pmd(v)); | ||
119 | } | ||
120 | |||
121 | static void set_pte_presence(pte_t *pte, bool present, bool *old) | ||
122 | { | ||
123 | pteval_t v = pte_val(*pte); | ||
124 | *old = !!(v & _PAGE_PRESENT); | ||
125 | v &= ~_PAGE_PRESENT; | ||
126 | if (present) | ||
127 | v |= _PAGE_PRESENT; | ||
128 | set_pte_atomic(pte, __pte(v)); | ||
129 | } | ||
130 | |||
131 | static int set_page_presence(unsigned long addr, bool present, bool *old) | ||
110 | { | 132 | { |
111 | pteval_t pteval; | ||
112 | pmdval_t pmdval; | ||
113 | unsigned int level; | 133 | unsigned int level; |
114 | pmd_t *pmd; | ||
115 | pte_t *pte = lookup_address(addr, &level); | 134 | pte_t *pte = lookup_address(addr, &level); |
116 | 135 | ||
117 | if (!pte) { | 136 | if (!pte) { |
118 | pr_err("kmmio: no pte for page 0x%08lx\n", addr); | 137 | pr_err("kmmio: no pte for page 0x%08lx\n", addr); |
119 | return; | 138 | return -1; |
120 | } | 139 | } |
121 | 140 | ||
122 | if (pglevel) | ||
123 | *pglevel = level; | ||
124 | |||
125 | switch (level) { | 141 | switch (level) { |
126 | case PG_LEVEL_2M: | 142 | case PG_LEVEL_2M: |
127 | pmd = (pmd_t *)pte; | 143 | set_pmd_presence((pmd_t *)pte, present, old); |
128 | pmdval = pmd_val(*pmd) & ~_PAGE_PRESENT; | ||
129 | if (present) | ||
130 | pmdval |= _PAGE_PRESENT; | ||
131 | set_pmd(pmd, __pmd(pmdval)); | ||
132 | break; | 144 | break; |
133 | |||
134 | case PG_LEVEL_4K: | 145 | case PG_LEVEL_4K: |
135 | pteval = pte_val(*pte) & ~_PAGE_PRESENT; | 146 | set_pte_presence(pte, present, old); |
136 | if (present) | ||
137 | pteval |= _PAGE_PRESENT; | ||
138 | set_pte_atomic(pte, __pte(pteval)); | ||
139 | break; | 147 | break; |
140 | |||
141 | default: | 148 | default: |
142 | pr_err("kmmio: unexpected page level 0x%x.\n", level); | 149 | pr_err("kmmio: unexpected page level 0x%x.\n", level); |
143 | return; | 150 | return -1; |
144 | } | 151 | } |
145 | 152 | ||
146 | __flush_tlb_one(addr); | 153 | __flush_tlb_one(addr); |
154 | return 0; | ||
147 | } | 155 | } |
148 | 156 | ||
149 | /** Mark the given page as not present. Access to it will trigger a fault. */ | 157 | /* |
150 | static void arm_kmmio_fault_page(unsigned long page, unsigned int *pglevel) | 158 | * Mark the given page as not present. Access to it will trigger a fault. |
159 | * | ||
160 | * Struct kmmio_fault_page is protected by RCU and kmmio_lock, but the | ||
161 | * protection is ignored here. RCU read lock is assumed held, so the struct | ||
162 | * will not disappear unexpectedly. Furthermore, the caller must guarantee, | ||
163 | * that double arming the same virtual address (page) cannot occur. | ||
164 | * | ||
165 | * Double disarming on the other hand is allowed, and may occur when a fault | ||
166 | * and mmiotrace shutdown happen simultaneously. | ||
167 | */ | ||
168 | static int arm_kmmio_fault_page(struct kmmio_fault_page *f) | ||
151 | { | 169 | { |
152 | set_page_present(page & PAGE_MASK, false, pglevel); | 170 | int ret; |
171 | WARN_ONCE(f->armed, KERN_ERR "kmmio page already armed.\n"); | ||
172 | if (f->armed) { | ||
173 | pr_warning("kmmio double-arm: page 0x%08lx, ref %d, old %d\n", | ||
174 | f->page, f->count, f->old_presence); | ||
175 | } | ||
176 | ret = set_page_presence(f->page, false, &f->old_presence); | ||
177 | WARN_ONCE(ret < 0, KERN_ERR "kmmio arming 0x%08lx failed.\n", f->page); | ||
178 | f->armed = true; | ||
179 | return ret; | ||
153 | } | 180 | } |
154 | 181 | ||
155 | /** Mark the given page as present. */ | 182 | /** Restore the given page to saved presence state. */ |
156 | static void disarm_kmmio_fault_page(unsigned long page, unsigned int *pglevel) | 183 | static void disarm_kmmio_fault_page(struct kmmio_fault_page *f) |
157 | { | 184 | { |
158 | set_page_present(page & PAGE_MASK, true, pglevel); | 185 | bool tmp; |
186 | int ret = set_page_presence(f->page, f->old_presence, &tmp); | ||
187 | WARN_ONCE(ret < 0, | ||
188 | KERN_ERR "kmmio disarming 0x%08lx failed.\n", f->page); | ||
189 | f->armed = false; | ||
159 | } | 190 | } |
160 | 191 | ||
161 | /* | 192 | /* |
@@ -202,28 +233,32 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) | |||
202 | 233 | ||
203 | ctx = &get_cpu_var(kmmio_ctx); | 234 | ctx = &get_cpu_var(kmmio_ctx); |
204 | if (ctx->active) { | 235 | if (ctx->active) { |
205 | disarm_kmmio_fault_page(faultpage->page, NULL); | ||
206 | if (addr == ctx->addr) { | 236 | if (addr == ctx->addr) { |
207 | /* | 237 | /* |
208 | * On SMP we sometimes get recursive probe hits on the | 238 | * A second fault on the same page means some other |
209 | * same address. Context is already saved, fall out. | 239 | * condition needs handling by do_page_fault(), the |
240 | * page really not being present is the most common. | ||
210 | */ | 241 | */ |
211 | pr_debug("kmmio: duplicate probe hit on CPU %d, for " | 242 | pr_debug("kmmio: secondary hit for 0x%08lx CPU %d.\n", |
212 | "address 0x%08lx.\n", | 243 | addr, smp_processor_id()); |
213 | smp_processor_id(), addr); | 244 | |
214 | ret = 1; | 245 | if (!faultpage->old_presence) |
215 | goto no_kmmio_ctx; | 246 | pr_info("kmmio: unexpected secondary hit for " |
216 | } | 247 | "address 0x%08lx on CPU %d.\n", addr, |
217 | /* | 248 | smp_processor_id()); |
218 | * Prevent overwriting already in-flight context. | 249 | } else { |
219 | * This should not happen, let's hope disarming at least | 250 | /* |
220 | * prevents a panic. | 251 | * Prevent overwriting already in-flight context. |
221 | */ | 252 | * This should not happen, let's hope disarming at |
222 | pr_emerg("kmmio: recursive probe hit on CPU %d, " | 253 | * least prevents a panic. |
254 | */ | ||
255 | pr_emerg("kmmio: recursive probe hit on CPU %d, " | ||
223 | "for address 0x%08lx. Ignoring.\n", | 256 | "for address 0x%08lx. Ignoring.\n", |
224 | smp_processor_id(), addr); | 257 | smp_processor_id(), addr); |
225 | pr_emerg("kmmio: previous hit was at 0x%08lx.\n", | 258 | pr_emerg("kmmio: previous hit was at 0x%08lx.\n", |
226 | ctx->addr); | 259 | ctx->addr); |
260 | disarm_kmmio_fault_page(faultpage); | ||
261 | } | ||
227 | goto no_kmmio_ctx; | 262 | goto no_kmmio_ctx; |
228 | } | 263 | } |
229 | ctx->active++; | 264 | ctx->active++; |
@@ -244,7 +279,7 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) | |||
244 | regs->flags &= ~X86_EFLAGS_IF; | 279 | regs->flags &= ~X86_EFLAGS_IF; |
245 | 280 | ||
246 | /* Now we set present bit in PTE and single step. */ | 281 | /* Now we set present bit in PTE and single step. */ |
247 | disarm_kmmio_fault_page(ctx->fpage->page, NULL); | 282 | disarm_kmmio_fault_page(ctx->fpage); |
248 | 283 | ||
249 | /* | 284 | /* |
250 | * If another cpu accesses the same page while we are stepping, | 285 | * If another cpu accesses the same page while we are stepping, |
@@ -275,7 +310,7 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs) | |||
275 | struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); | 310 | struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); |
276 | 311 | ||
277 | if (!ctx->active) { | 312 | if (!ctx->active) { |
278 | pr_debug("kmmio: spurious debug trap on CPU %d.\n", | 313 | pr_warning("kmmio: spurious debug trap on CPU %d.\n", |
279 | smp_processor_id()); | 314 | smp_processor_id()); |
280 | goto out; | 315 | goto out; |
281 | } | 316 | } |
@@ -283,7 +318,11 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs) | |||
283 | if (ctx->probe && ctx->probe->post_handler) | 318 | if (ctx->probe && ctx->probe->post_handler) |
284 | ctx->probe->post_handler(ctx->probe, condition, regs); | 319 | ctx->probe->post_handler(ctx->probe, condition, regs); |
285 | 320 | ||
286 | arm_kmmio_fault_page(ctx->fpage->page, NULL); | 321 | /* Prevent racing against release_kmmio_fault_page(). */ |
322 | spin_lock(&kmmio_lock); | ||
323 | if (ctx->fpage->count) | ||
324 | arm_kmmio_fault_page(ctx->fpage); | ||
325 | spin_unlock(&kmmio_lock); | ||
287 | 326 | ||
288 | regs->flags &= ~X86_EFLAGS_TF; | 327 | regs->flags &= ~X86_EFLAGS_TF; |
289 | regs->flags |= ctx->saved_flags; | 328 | regs->flags |= ctx->saved_flags; |
@@ -315,20 +354,24 @@ static int add_kmmio_fault_page(unsigned long page) | |||
315 | f = get_kmmio_fault_page(page); | 354 | f = get_kmmio_fault_page(page); |
316 | if (f) { | 355 | if (f) { |
317 | if (!f->count) | 356 | if (!f->count) |
318 | arm_kmmio_fault_page(f->page, NULL); | 357 | arm_kmmio_fault_page(f); |
319 | f->count++; | 358 | f->count++; |
320 | return 0; | 359 | return 0; |
321 | } | 360 | } |
322 | 361 | ||
323 | f = kmalloc(sizeof(*f), GFP_ATOMIC); | 362 | f = kzalloc(sizeof(*f), GFP_ATOMIC); |
324 | if (!f) | 363 | if (!f) |
325 | return -1; | 364 | return -1; |
326 | 365 | ||
327 | f->count = 1; | 366 | f->count = 1; |
328 | f->page = page; | 367 | f->page = page; |
329 | list_add_rcu(&f->list, kmmio_page_list(f->page)); | ||
330 | 368 | ||
331 | arm_kmmio_fault_page(f->page, NULL); | 369 | if (arm_kmmio_fault_page(f)) { |
370 | kfree(f); | ||
371 | return -1; | ||
372 | } | ||
373 | |||
374 | list_add_rcu(&f->list, kmmio_page_list(f->page)); | ||
332 | 375 | ||
333 | return 0; | 376 | return 0; |
334 | } | 377 | } |
@@ -347,7 +390,7 @@ static void release_kmmio_fault_page(unsigned long page, | |||
347 | f->count--; | 390 | f->count--; |
348 | BUG_ON(f->count < 0); | 391 | BUG_ON(f->count < 0); |
349 | if (!f->count) { | 392 | if (!f->count) { |
350 | disarm_kmmio_fault_page(f->page, NULL); | 393 | disarm_kmmio_fault_page(f); |
351 | f->release_next = *release_list; | 394 | f->release_next = *release_list; |
352 | *release_list = f; | 395 | *release_list = f; |
353 | } | 396 | } |
@@ -408,23 +451,24 @@ static void rcu_free_kmmio_fault_pages(struct rcu_head *head) | |||
408 | 451 | ||
409 | static void remove_kmmio_fault_pages(struct rcu_head *head) | 452 | static void remove_kmmio_fault_pages(struct rcu_head *head) |
410 | { | 453 | { |
411 | struct kmmio_delayed_release *dr = container_of( | 454 | struct kmmio_delayed_release *dr = |
412 | head, | 455 | container_of(head, struct kmmio_delayed_release, rcu); |
413 | struct kmmio_delayed_release, | ||
414 | rcu); | ||
415 | struct kmmio_fault_page *p = dr->release_list; | 456 | struct kmmio_fault_page *p = dr->release_list; |
416 | struct kmmio_fault_page **prevp = &dr->release_list; | 457 | struct kmmio_fault_page **prevp = &dr->release_list; |
417 | unsigned long flags; | 458 | unsigned long flags; |
459 | |||
418 | spin_lock_irqsave(&kmmio_lock, flags); | 460 | spin_lock_irqsave(&kmmio_lock, flags); |
419 | while (p) { | 461 | while (p) { |
420 | if (!p->count) | 462 | if (!p->count) { |
421 | list_del_rcu(&p->list); | 463 | list_del_rcu(&p->list); |
422 | else | 464 | prevp = &p->release_next; |
465 | } else { | ||
423 | *prevp = p->release_next; | 466 | *prevp = p->release_next; |
424 | prevp = &p->release_next; | 467 | } |
425 | p = p->release_next; | 468 | p = p->release_next; |
426 | } | 469 | } |
427 | spin_unlock_irqrestore(&kmmio_lock, flags); | 470 | spin_unlock_irqrestore(&kmmio_lock, flags); |
471 | |||
428 | /* This is the real RCU destroy call. */ | 472 | /* This is the real RCU destroy call. */ |
429 | call_rcu(&dr->rcu, rcu_free_kmmio_fault_pages); | 473 | call_rcu(&dr->rcu, rcu_free_kmmio_fault_pages); |
430 | } | 474 | } |
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 71a14f89f89e..f3516da035d1 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -145,7 +145,7 @@ int __init compute_hash_shift(struct bootnode *nodes, int numnodes, | |||
145 | return shift; | 145 | return shift; |
146 | } | 146 | } |
147 | 147 | ||
148 | int early_pfn_to_nid(unsigned long pfn) | 148 | int __meminit __early_pfn_to_nid(unsigned long pfn) |
149 | { | 149 | { |
150 | return phys_to_nid(pfn << PAGE_SHIFT); | 150 | return phys_to_nid(pfn << PAGE_SHIFT); |
151 | } | 151 | } |
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 84ba74820ad6..7be47d1a97e4 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -508,18 +508,13 @@ static int split_large_page(pte_t *kpte, unsigned long address) | |||
508 | #endif | 508 | #endif |
509 | 509 | ||
510 | /* | 510 | /* |
511 | * Install the new, split up pagetable. Important details here: | 511 | * Install the new, split up pagetable. |
512 | * | 512 | * |
513 | * On Intel the NX bit of all levels must be cleared to make a | 513 | * We use the standard kernel pagetable protections for the new |
514 | * page executable. See section 4.13.2 of Intel 64 and IA-32 | 514 | * pagetable protections, the actual ptes set above control the |
515 | * Architectures Software Developer's Manual). | 515 | * primary protection behavior: |
516 | * | ||
517 | * Mark the entry present. The current mapping might be | ||
518 | * set to not present, which we preserved above. | ||
519 | */ | 516 | */ |
520 | ref_prot = pte_pgprot(pte_mkexec(pte_clrhuge(*kpte))); | 517 | __set_pmd_pte(kpte, address, mk_pte(base, __pgprot(_KERNPG_TABLE))); |
521 | pgprot_val(ref_prot) |= _PAGE_PRESENT; | ||
522 | __set_pmd_pte(kpte, address, mk_pte(base, ref_prot)); | ||
523 | base = NULL; | 518 | base = NULL; |
524 | 519 | ||
525 | out_unlock: | 520 | out_unlock: |
@@ -575,7 +570,6 @@ static int __change_page_attr(struct cpa_data *cpa, int primary) | |||
575 | address = cpa->vaddr[cpa->curpage]; | 570 | address = cpa->vaddr[cpa->curpage]; |
576 | else | 571 | else |
577 | address = *cpa->vaddr; | 572 | address = *cpa->vaddr; |
578 | |||
579 | repeat: | 573 | repeat: |
580 | kpte = lookup_address(address, &level); | 574 | kpte = lookup_address(address, &level); |
581 | if (!kpte) | 575 | if (!kpte) |
@@ -812,6 +806,13 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages, | |||
812 | 806 | ||
813 | vm_unmap_aliases(); | 807 | vm_unmap_aliases(); |
814 | 808 | ||
809 | /* | ||
810 | * If we're called with lazy mmu updates enabled, the | ||
811 | * in-memory pte state may be stale. Flush pending updates to | ||
812 | * bring them up to date. | ||
813 | */ | ||
814 | arch_flush_lazy_mmu_mode(); | ||
815 | |||
815 | cpa.vaddr = addr; | 816 | cpa.vaddr = addr; |
816 | cpa.numpages = numpages; | 817 | cpa.numpages = numpages; |
817 | cpa.mask_set = mask_set; | 818 | cpa.mask_set = mask_set; |
@@ -854,6 +855,13 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages, | |||
854 | } else | 855 | } else |
855 | cpa_flush_all(cache); | 856 | cpa_flush_all(cache); |
856 | 857 | ||
858 | /* | ||
859 | * If we've been called with lazy mmu updates enabled, then | ||
860 | * make sure that everything gets flushed out before we | ||
861 | * return. | ||
862 | */ | ||
863 | arch_flush_lazy_mmu_mode(); | ||
864 | |||
857 | out: | 865 | out: |
858 | return ret; | 866 | return ret; |
859 | } | 867 | } |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 7b61036427df..e0ab173b6974 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/bootmem.h> | 11 | #include <linux/bootmem.h> |
12 | #include <linux/debugfs.h> | 12 | #include <linux/debugfs.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/module.h> | ||
14 | #include <linux/gfp.h> | 15 | #include <linux/gfp.h> |
15 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
16 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
@@ -211,6 +212,33 @@ chk_conflict(struct memtype *new, struct memtype *entry, unsigned long *type) | |||
211 | static struct memtype *cached_entry; | 212 | static struct memtype *cached_entry; |
212 | static u64 cached_start; | 213 | static u64 cached_start; |
213 | 214 | ||
215 | static int pat_pagerange_is_ram(unsigned long start, unsigned long end) | ||
216 | { | ||
217 | int ram_page = 0, not_rampage = 0; | ||
218 | unsigned long page_nr; | ||
219 | |||
220 | for (page_nr = (start >> PAGE_SHIFT); page_nr < (end >> PAGE_SHIFT); | ||
221 | ++page_nr) { | ||
222 | /* | ||
223 | * For legacy reasons, physical address range in the legacy ISA | ||
224 | * region is tracked as non-RAM. This will allow users of | ||
225 | * /dev/mem to map portions of legacy ISA region, even when | ||
226 | * some of those portions are listed(or not even listed) with | ||
227 | * different e820 types(RAM/reserved/..) | ||
228 | */ | ||
229 | if (page_nr >= (ISA_END_ADDRESS >> PAGE_SHIFT) && | ||
230 | page_is_ram(page_nr)) | ||
231 | ram_page = 1; | ||
232 | else | ||
233 | not_rampage = 1; | ||
234 | |||
235 | if (ram_page == not_rampage) | ||
236 | return -1; | ||
237 | } | ||
238 | |||
239 | return ram_page; | ||
240 | } | ||
241 | |||
214 | /* | 242 | /* |
215 | * For RAM pages, mark the pages as non WB memory type using | 243 | * For RAM pages, mark the pages as non WB memory type using |
216 | * PageNonWB (PG_arch_1). We allow only one set_memory_uc() or | 244 | * PageNonWB (PG_arch_1). We allow only one set_memory_uc() or |
@@ -336,20 +364,12 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, | |||
336 | if (new_type) | 364 | if (new_type) |
337 | *new_type = actual_type; | 365 | *new_type = actual_type; |
338 | 366 | ||
339 | /* | 367 | is_range_ram = pat_pagerange_is_ram(start, end); |
340 | * For legacy reasons, some parts of the physical address range in the | 368 | if (is_range_ram == 1) |
341 | * legacy 1MB region is treated as non-RAM (even when listed as RAM in | 369 | return reserve_ram_pages_type(start, end, req_type, |
342 | * the e820 tables). So we will track the memory attributes of this | 370 | new_type); |
343 | * legacy 1MB region using the linear memtype_list always. | 371 | else if (is_range_ram < 0) |
344 | */ | 372 | return -EINVAL; |
345 | if (end >= ISA_END_ADDRESS) { | ||
346 | is_range_ram = pagerange_is_ram(start, end); | ||
347 | if (is_range_ram == 1) | ||
348 | return reserve_ram_pages_type(start, end, req_type, | ||
349 | new_type); | ||
350 | else if (is_range_ram < 0) | ||
351 | return -EINVAL; | ||
352 | } | ||
353 | 373 | ||
354 | new = kmalloc(sizeof(struct memtype), GFP_KERNEL); | 374 | new = kmalloc(sizeof(struct memtype), GFP_KERNEL); |
355 | if (!new) | 375 | if (!new) |
@@ -446,19 +466,11 @@ int free_memtype(u64 start, u64 end) | |||
446 | if (is_ISA_range(start, end - 1)) | 466 | if (is_ISA_range(start, end - 1)) |
447 | return 0; | 467 | return 0; |
448 | 468 | ||
449 | /* | 469 | is_range_ram = pat_pagerange_is_ram(start, end); |
450 | * For legacy reasons, some parts of the physical address range in the | 470 | if (is_range_ram == 1) |
451 | * legacy 1MB region is treated as non-RAM (even when listed as RAM in | 471 | return free_ram_pages_type(start, end); |
452 | * the e820 tables). So we will track the memory attributes of this | 472 | else if (is_range_ram < 0) |
453 | * legacy 1MB region using the linear memtype_list always. | 473 | return -EINVAL; |
454 | */ | ||
455 | if (end >= ISA_END_ADDRESS) { | ||
456 | is_range_ram = pagerange_is_ram(start, end); | ||
457 | if (is_range_ram == 1) | ||
458 | return free_ram_pages_type(start, end); | ||
459 | else if (is_range_ram < 0) | ||
460 | return -EINVAL; | ||
461 | } | ||
462 | 474 | ||
463 | spin_lock(&memtype_lock); | 475 | spin_lock(&memtype_lock); |
464 | list_for_each_entry(entry, &memtype_list, nd) { | 476 | list_for_each_entry(entry, &memtype_list, nd) { |
@@ -626,17 +638,13 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, | |||
626 | unsigned long flags; | 638 | unsigned long flags; |
627 | unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK); | 639 | unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK); |
628 | 640 | ||
629 | is_ram = pagerange_is_ram(paddr, paddr + size); | 641 | is_ram = pat_pagerange_is_ram(paddr, paddr + size); |
630 | 642 | ||
631 | if (is_ram != 0) { | 643 | /* |
632 | /* | 644 | * reserve_pfn_range() doesn't support RAM pages. |
633 | * For mapping RAM pages, drivers need to call | 645 | */ |
634 | * set_memory_[uc|wc|wb] directly, for reserve and free, before | 646 | if (is_ram != 0) |
635 | * setting up the PTE. | 647 | return -EINVAL; |
636 | */ | ||
637 | WARN_ON_ONCE(1); | ||
638 | return 0; | ||
639 | } | ||
640 | 648 | ||
641 | ret = reserve_memtype(paddr, paddr + size, want_flags, &flags); | 649 | ret = reserve_memtype(paddr, paddr + size, want_flags, &flags); |
642 | if (ret) | 650 | if (ret) |
@@ -693,7 +701,7 @@ static void free_pfn_range(u64 paddr, unsigned long size) | |||
693 | { | 701 | { |
694 | int is_ram; | 702 | int is_ram; |
695 | 703 | ||
696 | is_ram = pagerange_is_ram(paddr, paddr + size); | 704 | is_ram = pat_pagerange_is_ram(paddr, paddr + size); |
697 | if (is_ram == 0) | 705 | if (is_ram == 0) |
698 | free_memtype(paddr, paddr + size); | 706 | free_memtype(paddr, paddr + size); |
699 | } | 707 | } |
@@ -861,6 +869,7 @@ pgprot_t pgprot_writecombine(pgprot_t prot) | |||
861 | else | 869 | else |
862 | return pgprot_noncached(prot); | 870 | return pgprot_noncached(prot); |
863 | } | 871 | } |
872 | EXPORT_SYMBOL_GPL(pgprot_writecombine); | ||
864 | 873 | ||
865 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) | 874 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) |
866 | 875 | ||
diff --git a/arch/x86/mm/testmmiotrace.c b/arch/x86/mm/testmmiotrace.c index ab50a8d7402c..427fd1b56df5 100644 --- a/arch/x86/mm/testmmiotrace.c +++ b/arch/x86/mm/testmmiotrace.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Written by Pekka Paalanen, 2008 <pq@iki.fi> | 2 | * Written by Pekka Paalanen, 2008-2009 <pq@iki.fi> |
3 | */ | 3 | */ |
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/io.h> | 5 | #include <linux/io.h> |
@@ -9,35 +9,74 @@ | |||
9 | 9 | ||
10 | static unsigned long mmio_address; | 10 | static unsigned long mmio_address; |
11 | module_param(mmio_address, ulong, 0); | 11 | module_param(mmio_address, ulong, 0); |
12 | MODULE_PARM_DESC(mmio_address, "Start address of the mapping of 16 kB."); | 12 | MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB " |
13 | "(or 8 MB if read_far is non-zero)."); | ||
14 | |||
15 | static unsigned long read_far = 0x400100; | ||
16 | module_param(read_far, ulong, 0); | ||
17 | MODULE_PARM_DESC(read_far, " Offset of a 32-bit read within 8 MB " | ||
18 | "(default: 0x400100)."); | ||
19 | |||
20 | static unsigned v16(unsigned i) | ||
21 | { | ||
22 | return i * 12 + 7; | ||
23 | } | ||
24 | |||
25 | static unsigned v32(unsigned i) | ||
26 | { | ||
27 | return i * 212371 + 13; | ||
28 | } | ||
13 | 29 | ||
14 | static void do_write_test(void __iomem *p) | 30 | static void do_write_test(void __iomem *p) |
15 | { | 31 | { |
16 | unsigned int i; | 32 | unsigned int i; |
33 | pr_info(MODULE_NAME ": write test.\n"); | ||
17 | mmiotrace_printk("Write test.\n"); | 34 | mmiotrace_printk("Write test.\n"); |
35 | |||
18 | for (i = 0; i < 256; i++) | 36 | for (i = 0; i < 256; i++) |
19 | iowrite8(i, p + i); | 37 | iowrite8(i, p + i); |
38 | |||
20 | for (i = 1024; i < (5 * 1024); i += 2) | 39 | for (i = 1024; i < (5 * 1024); i += 2) |
21 | iowrite16(i * 12 + 7, p + i); | 40 | iowrite16(v16(i), p + i); |
41 | |||
22 | for (i = (5 * 1024); i < (16 * 1024); i += 4) | 42 | for (i = (5 * 1024); i < (16 * 1024); i += 4) |
23 | iowrite32(i * 212371 + 13, p + i); | 43 | iowrite32(v32(i), p + i); |
24 | } | 44 | } |
25 | 45 | ||
26 | static void do_read_test(void __iomem *p) | 46 | static void do_read_test(void __iomem *p) |
27 | { | 47 | { |
28 | unsigned int i; | 48 | unsigned int i; |
49 | unsigned errs[3] = { 0 }; | ||
50 | pr_info(MODULE_NAME ": read test.\n"); | ||
29 | mmiotrace_printk("Read test.\n"); | 51 | mmiotrace_printk("Read test.\n"); |
52 | |||
30 | for (i = 0; i < 256; i++) | 53 | for (i = 0; i < 256; i++) |
31 | ioread8(p + i); | 54 | if (ioread8(p + i) != i) |
55 | ++errs[0]; | ||
56 | |||
32 | for (i = 1024; i < (5 * 1024); i += 2) | 57 | for (i = 1024; i < (5 * 1024); i += 2) |
33 | ioread16(p + i); | 58 | if (ioread16(p + i) != v16(i)) |
59 | ++errs[1]; | ||
60 | |||
34 | for (i = (5 * 1024); i < (16 * 1024); i += 4) | 61 | for (i = (5 * 1024); i < (16 * 1024); i += 4) |
35 | ioread32(p + i); | 62 | if (ioread32(p + i) != v32(i)) |
63 | ++errs[2]; | ||
64 | |||
65 | mmiotrace_printk("Read errors: 8-bit %d, 16-bit %d, 32-bit %d.\n", | ||
66 | errs[0], errs[1], errs[2]); | ||
36 | } | 67 | } |
37 | 68 | ||
38 | static void do_test(void) | 69 | static void do_read_far_test(void __iomem *p) |
39 | { | 70 | { |
40 | void __iomem *p = ioremap_nocache(mmio_address, 0x4000); | 71 | pr_info(MODULE_NAME ": read far test.\n"); |
72 | mmiotrace_printk("Read far test.\n"); | ||
73 | |||
74 | ioread32(p + read_far); | ||
75 | } | ||
76 | |||
77 | static void do_test(unsigned long size) | ||
78 | { | ||
79 | void __iomem *p = ioremap_nocache(mmio_address, size); | ||
41 | if (!p) { | 80 | if (!p) { |
42 | pr_err(MODULE_NAME ": could not ioremap, aborting.\n"); | 81 | pr_err(MODULE_NAME ": could not ioremap, aborting.\n"); |
43 | return; | 82 | return; |
@@ -45,11 +84,15 @@ static void do_test(void) | |||
45 | mmiotrace_printk("ioremap returned %p.\n", p); | 84 | mmiotrace_printk("ioremap returned %p.\n", p); |
46 | do_write_test(p); | 85 | do_write_test(p); |
47 | do_read_test(p); | 86 | do_read_test(p); |
87 | if (read_far && read_far < size - 4) | ||
88 | do_read_far_test(p); | ||
48 | iounmap(p); | 89 | iounmap(p); |
49 | } | 90 | } |
50 | 91 | ||
51 | static int __init init(void) | 92 | static int __init init(void) |
52 | { | 93 | { |
94 | unsigned long size = (read_far) ? (8 << 20) : (16 << 10); | ||
95 | |||
53 | if (mmio_address == 0) { | 96 | if (mmio_address == 0) { |
54 | pr_err(MODULE_NAME ": you have to use the module argument " | 97 | pr_err(MODULE_NAME ": you have to use the module argument " |
55 | "mmio_address.\n"); | 98 | "mmio_address.\n"); |
@@ -58,10 +101,11 @@ static int __init init(void) | |||
58 | return -ENXIO; | 101 | return -ENXIO; |
59 | } | 102 | } |
60 | 103 | ||
61 | pr_warning(MODULE_NAME ": WARNING: mapping 16 kB @ 0x%08lx " | 104 | pr_warning(MODULE_NAME ": WARNING: mapping %lu kB @ 0x%08lx in PCI " |
62 | "in PCI address space, and writing " | 105 | "address space, and writing 16 kB of rubbish in there.\n", |
63 | "rubbish in there.\n", mmio_address); | 106 | size >> 10, mmio_address); |
64 | do_test(); | 107 | do_test(size); |
108 | pr_info(MODULE_NAME ": All done.\n"); | ||
65 | return 0; | 109 | return 0; |
66 | } | 110 | } |
67 | 111 | ||
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index e9f80c744cf3..10131fbdaada 100644 --- a/arch/x86/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c | |||
@@ -78,8 +78,18 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) | |||
78 | if (cpu_has_arch_perfmon) { | 78 | if (cpu_has_arch_perfmon) { |
79 | union cpuid10_eax eax; | 79 | union cpuid10_eax eax; |
80 | eax.full = cpuid_eax(0xa); | 80 | eax.full = cpuid_eax(0xa); |
81 | if (counter_width < eax.split.bit_width) | 81 | |
82 | counter_width = eax.split.bit_width; | 82 | /* |
83 | * For Core2 (family 6, model 15), don't reset the | ||
84 | * counter width: | ||
85 | */ | ||
86 | if (!(eax.split.version_id == 0 && | ||
87 | current_cpu_data.x86 == 6 && | ||
88 | current_cpu_data.x86_model == 15)) { | ||
89 | |||
90 | if (counter_width < eax.split.bit_width) | ||
91 | counter_width = eax.split.bit_width; | ||
92 | } | ||
83 | } | 93 | } |
84 | 94 | ||
85 | /* clear all counters */ | 95 | /* clear all counters */ |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index bea215230b20..b58e96338149 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1672,6 +1672,9 @@ asmlinkage void __init xen_start_kernel(void) | |||
1672 | possible map and a non-dummy shared_info. */ | 1672 | possible map and a non-dummy shared_info. */ |
1673 | per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; | 1673 | per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; |
1674 | 1674 | ||
1675 | local_irq_disable(); | ||
1676 | early_boot_irqs_off(); | ||
1677 | |||
1675 | xen_raw_console_write("mapping kernel into physical memory\n"); | 1678 | xen_raw_console_write("mapping kernel into physical memory\n"); |
1676 | pgd = xen_setup_kernel_pagetable(pgd, xen_start_info->nr_pages); | 1679 | pgd = xen_setup_kernel_pagetable(pgd, xen_start_info->nr_pages); |
1677 | 1680 | ||
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 6c873dceb177..981200830432 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -103,9 +103,6 @@ config MATH_EMULATION | |||
103 | help | 103 | help |
104 | Can we use information of configuration file? | 104 | Can we use information of configuration file? |
105 | 105 | ||
106 | config HIGHMEM | ||
107 | bool "High memory support" | ||
108 | |||
109 | endmenu | 106 | endmenu |
110 | 107 | ||
111 | menu "Platform options" | 108 | menu "Platform options" |
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 9606d2bd1dd9..4ec1633c2941 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c | |||
@@ -44,6 +44,8 @@ | |||
44 | #include <asm/setup.h> | 44 | #include <asm/setup.h> |
45 | #include <asm/param.h> | 45 | #include <asm/param.h> |
46 | 46 | ||
47 | #include <platform/hardware.h> | ||
48 | |||
47 | #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) | 49 | #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) |
48 | struct screen_info screen_info = { 0, 24, 0, 0, 0, 80, 0, 0, 0, 24, 1, 16}; | 50 | struct screen_info screen_info = { 0, 24, 0, 0, 0, 80, 0, 0, 0, 24, 1, 16}; |
49 | #endif | 51 | #endif |
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index c7a021d9f696..c44f830b6c7a 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/stringify.h> | 30 | #include <linux/stringify.h> |
31 | #include <linux/kallsyms.h> | 31 | #include <linux/kallsyms.h> |
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/hardirq.h> | ||
33 | 34 | ||
34 | #include <asm/ptrace.h> | 35 | #include <asm/ptrace.h> |
35 | #include <asm/timex.h> | 36 | #include <asm/timex.h> |
diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c index 33f366be323f..bdd860d93f72 100644 --- a/arch/xtensa/mm/fault.c +++ b/arch/xtensa/mm/fault.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/hardirq.h> | ||
17 | #include <asm/mmu_context.h> | 18 | #include <asm/mmu_context.h> |
18 | #include <asm/cacheflush.h> | 19 | #include <asm/cacheflush.h> |
19 | #include <asm/hardirq.h> | 20 | #include <asm/hardirq.h> |
diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index efed8897bef3..25d46c84eb08 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c | |||
@@ -140,16 +140,14 @@ static void rs_poll(unsigned long priv) | |||
140 | } | 140 | } |
141 | 141 | ||
142 | 142 | ||
143 | static void rs_put_char(struct tty_struct *tty, unsigned char ch) | 143 | static int rs_put_char(struct tty_struct *tty, unsigned char ch) |
144 | { | 144 | { |
145 | char buf[2]; | 145 | char buf[2]; |
146 | 146 | ||
147 | if (!tty) | ||
148 | return; | ||
149 | |||
150 | buf[0] = ch; | 147 | buf[0] = ch; |
151 | buf[1] = '\0'; /* Is this NULL necessary? */ | 148 | buf[1] = '\0'; /* Is this NULL necessary? */ |
152 | __simc (SYS_write, 1, (unsigned long) buf, 1, 0, 0); | 149 | __simc (SYS_write, 1, (unsigned long) buf, 1, 0, 0); |
150 | return 1; | ||
153 | } | 151 | } |
154 | 152 | ||
155 | static void rs_flush_chars(struct tty_struct *tty) | 153 | static void rs_flush_chars(struct tty_struct *tty) |